@automattic/newspack-blocks 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cache/babel/6aca28a6c4a1d89dde32fdeb4bda53d5.json.gz +0 -0
- package/.cache/babel/b69c05682a3bd6b8f597906127dab44e.json.gz +0 -0
- package/.cache/babel/c163868a7a55ba37b772721cb99ffc73.json.gz +0 -0
- package/.cache/babel/c7cfb8590e887722a3e715c72ee99bac.json.gz +0 -0
- package/CHANGELOG.md +34 -0
- package/composer.json +2 -2
- package/composer.lock +171 -19
- package/dist/checkout-button/view.asset.php +1 -1
- package/dist/checkout-button/view.css +1 -1
- package/dist/checkout-button/view.rtl.css +1 -1
- package/dist/donateStreamlined.asset.php +1 -1
- package/dist/donateStreamlined.js +1 -1
- package/dist/editor.asset.php +1 -1
- package/dist/editor.css +1 -1
- package/dist/editor.js +1 -1
- package/dist/editor.rtl.css +1 -1
- package/dist/homepage-articles/view.asset.php +1 -1
- package/dist/homepage-articles/view.css +1 -1
- package/dist/homepage-articles/view.rtl.css +1 -1
- package/includes/class-newspack-blocks-api.php +44 -30
- package/includes/class-newspack-blocks.php +2 -2
- package/newspack-blocks.php +2 -2
- package/package.json +5 -5
- package/src/block-patterns/subscribe-1.php +1 -1
- package/src/block-patterns/subscribe-10.php +1 -1
- package/src/block-patterns/subscribe-2.php +1 -1
- package/src/block-patterns/subscribe-3.php +1 -1
- package/src/block-patterns/subscribe-4.php +1 -1
- package/src/block-patterns/subscribe-5.php +1 -1
- package/src/block-patterns/subscribe-6.php +1 -1
- package/src/block-patterns/subscribe-7.php +1 -1
- package/src/block-patterns/subscribe-8.php +1 -1
- package/src/block-patterns/subscribe-9.php +1 -1
- package/src/blocks/author-list/class-wp-rest-newspack-author-list-controller.php +9 -11
- package/src/blocks/checkout-button/block.json +3 -0
- package/src/blocks/checkout-button/edit.js +35 -1
- package/src/blocks/checkout-button/save.js +3 -1
- package/src/blocks/checkout-button/view.scss +19 -6
- package/src/blocks/homepage-articles/class-wp-rest-newspack-articles-controller.php +13 -0
- package/src/blocks/homepage-articles/edit.js +1 -4
- package/src/blocks/homepage-articles/editor.js +16 -2
- package/src/blocks/homepage-articles/templates/article.php +10 -12
- package/src/blocks/homepage-articles/templates/articles-list.php +2 -2
- package/src/blocks/homepage-articles/view.php +177 -11
- package/src/blocks/homepage-articles/view.scss +0 -102
- package/src/modal-checkout/templates/thankyou.php +7 -1
- package/src/templates/author-profile-card.php +22 -12
- package/vendor/autoload.php +1 -1
- package/vendor/composer/autoload_real.php +4 -4
- package/vendor/composer/autoload_static.php +2 -2
- package/vendor/composer/installed.php +2 -2
- package/.cache/babel/39bcc541624feefe54d1493493ae1ce8.json.gz +0 -0
- package/.cache/babel/4d8c26a76e77fa64d01f30a5f2d62f85.json.gz +0 -0
- package/.cache/babel/6715650e6d89955011841839faac29f2.json.gz +0 -0
- package/.cache/babel/6d457f8985600b07d97aebc4e1a21855.json.gz +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,37 @@
|
|
|
1
|
+
# [2.2.0](https://github.com/Automattic/newspack-blocks/compare/v2.1.0...v2.2.0) (2023-11-27)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add checks for Newspack plugin ([#1579](https://github.com/Automattic/newspack-blocks/issues/1579)) ([b516a6f](https://github.com/Automattic/newspack-blocks/commit/b516a6f2a5111361f6180c98e09814c95f5e9861))
|
|
7
|
+
* **homepage-posts:** terms handling in category list ([#1596](https://github.com/Automattic/newspack-blocks/issues/1596)) ([55dbf42](https://github.com/Automattic/newspack-blocks/commit/55dbf42c969d33029ea6531cf6f5db1e5b4953a5))
|
|
8
|
+
* **modal-checkout:** place order button width ([b48efcb](https://github.com/Automattic/newspack-blocks/commit/b48efcb6391d7282322f63f9f8aeeb860bff2cf8)), closes [#1572](https://github.com/Automattic/newspack-blocks/issues/1572)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* add width control to the Checkout block ([#1583](https://github.com/Automattic/newspack-blocks/issues/1583)) ([3f75c1e](https://github.com/Automattic/newspack-blocks/commit/3f75c1e074554ead923f7007e9d026811cb186dd))
|
|
14
|
+
* **cwv:** inline HPB styles in a style tag ([#1548](https://github.com/Automattic/newspack-blocks/issues/1548)) ([dea8d93](https://github.com/Automattic/newspack-blocks/commit/dea8d93fb518fc815d00bbd3e926f052b1638250))
|
|
15
|
+
* **modal-checkout:** display item name on success ([a3a03df](https://github.com/Automattic/newspack-blocks/commit/a3a03df36a5bb18556d3c643a119e8401e9123fd))
|
|
16
|
+
* update subscribe patterns to use Newspack block ([#1580](https://github.com/Automattic/newspack-blocks/issues/1580)) ([70088e2](https://github.com/Automattic/newspack-blocks/commit/70088e2628e9045715f0b6df925b39290ecf00ed))
|
|
17
|
+
|
|
18
|
+
# [2.2.0-alpha.1](https://github.com/Automattic/newspack-blocks/compare/v2.1.0...v2.2.0-alpha.1) (2023-11-16)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* add checks for Newspack plugin ([#1579](https://github.com/Automattic/newspack-blocks/issues/1579)) ([b516a6f](https://github.com/Automattic/newspack-blocks/commit/b516a6f2a5111361f6180c98e09814c95f5e9861))
|
|
24
|
+
* **homepage-posts:** terms handling in category list ([#1596](https://github.com/Automattic/newspack-blocks/issues/1596)) ([55dbf42](https://github.com/Automattic/newspack-blocks/commit/55dbf42c969d33029ea6531cf6f5db1e5b4953a5))
|
|
25
|
+
* **modal-checkout:** place order button width ([b48efcb](https://github.com/Automattic/newspack-blocks/commit/b48efcb6391d7282322f63f9f8aeeb860bff2cf8)), closes [#1572](https://github.com/Automattic/newspack-blocks/issues/1572)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
* add width control to the Checkout block ([#1583](https://github.com/Automattic/newspack-blocks/issues/1583)) ([3f75c1e](https://github.com/Automattic/newspack-blocks/commit/3f75c1e074554ead923f7007e9d026811cb186dd))
|
|
31
|
+
* **cwv:** inline HPB styles in a style tag ([#1548](https://github.com/Automattic/newspack-blocks/issues/1548)) ([dea8d93](https://github.com/Automattic/newspack-blocks/commit/dea8d93fb518fc815d00bbd3e926f052b1638250))
|
|
32
|
+
* **modal-checkout:** display item name on success ([a3a03df](https://github.com/Automattic/newspack-blocks/commit/a3a03df36a5bb18556d3c643a119e8401e9123fd))
|
|
33
|
+
* update subscribe patterns to use Newspack block ([#1580](https://github.com/Automattic/newspack-blocks/issues/1580)) ([70088e2](https://github.com/Automattic/newspack-blocks/commit/70088e2628e9045715f0b6df925b39290ecf00ed))
|
|
34
|
+
|
|
1
35
|
# [2.1.0](https://github.com/Automattic/newspack-blocks/compare/v2.0.0...v2.1.0) (2023-11-13)
|
|
2
36
|
|
|
3
37
|
|
package/composer.json
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
"type": "wordpress-plugin",
|
|
5
5
|
"require-dev": {
|
|
6
6
|
"composer/installers": "~2.0",
|
|
7
|
-
"automattic/vipwpcs": "^
|
|
7
|
+
"automattic/vipwpcs": "^3.0",
|
|
8
8
|
"brainmaestro/composer-git-hooks": "^2.6",
|
|
9
|
-
"wp-coding-standards/wpcs": "
|
|
9
|
+
"wp-coding-standards/wpcs": "^3.0",
|
|
10
10
|
"dealerdirect/phpcodesniffer-composer-installer": "*",
|
|
11
11
|
"phpcompatibility/phpcompatibility-wp": "*",
|
|
12
12
|
"sirbrillig/phpcs-variable-analysis": "^2.10",
|
package/composer.lock
CHANGED
|
@@ -4,29 +4,30 @@
|
|
|
4
4
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
|
5
5
|
"This file is @generated automatically"
|
|
6
6
|
],
|
|
7
|
-
"content-hash": "
|
|
7
|
+
"content-hash": "1ac2decd4a5e66a65ff3bb0d2960c6de",
|
|
8
8
|
"packages": [],
|
|
9
9
|
"packages-dev": [
|
|
10
10
|
{
|
|
11
11
|
"name": "automattic/vipwpcs",
|
|
12
|
-
"version": "
|
|
12
|
+
"version": "3.0.0",
|
|
13
13
|
"source": {
|
|
14
14
|
"type": "git",
|
|
15
15
|
"url": "https://github.com/Automattic/VIP-Coding-Standards.git",
|
|
16
|
-
"reference": "
|
|
16
|
+
"reference": "1b8960ebff9ea3eb482258a906ece4d1ee1e25fd"
|
|
17
17
|
},
|
|
18
18
|
"dist": {
|
|
19
19
|
"type": "zip",
|
|
20
|
-
"url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/
|
|
21
|
-
"reference": "
|
|
20
|
+
"url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/1b8960ebff9ea3eb482258a906ece4d1ee1e25fd",
|
|
21
|
+
"reference": "1b8960ebff9ea3eb482258a906ece4d1ee1e25fd",
|
|
22
22
|
"shasum": ""
|
|
23
23
|
},
|
|
24
24
|
"require": {
|
|
25
|
-
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0",
|
|
26
25
|
"php": ">=5.4",
|
|
26
|
+
"phpcsstandards/phpcsextra": "^1.1.0",
|
|
27
|
+
"phpcsstandards/phpcsutils": "^1.0.8",
|
|
27
28
|
"sirbrillig/phpcs-variable-analysis": "^2.11.17",
|
|
28
|
-
"squizlabs/php_codesniffer": "^3.7.
|
|
29
|
-
"wp-coding-standards/wpcs": "^
|
|
29
|
+
"squizlabs/php_codesniffer": "^3.7.2",
|
|
30
|
+
"wp-coding-standards/wpcs": "^3.0"
|
|
30
31
|
},
|
|
31
32
|
"require-dev": {
|
|
32
33
|
"php-parallel-lint/php-console-highlighter": "^1.0.0",
|
|
@@ -58,7 +59,7 @@
|
|
|
58
59
|
"source": "https://github.com/Automattic/VIP-Coding-Standards",
|
|
59
60
|
"wiki": "https://github.com/Automattic/VIP-Coding-Standards/wiki"
|
|
60
61
|
},
|
|
61
|
-
"time": "2023-
|
|
62
|
+
"time": "2023-09-05T11:01:05+00:00"
|
|
62
63
|
},
|
|
63
64
|
{
|
|
64
65
|
"name": "brainmaestro/composer-git-hooks",
|
|
@@ -826,6 +827,142 @@
|
|
|
826
827
|
},
|
|
827
828
|
"time": "2022-10-24T09:00:36+00:00"
|
|
828
829
|
},
|
|
830
|
+
{
|
|
831
|
+
"name": "phpcsstandards/phpcsextra",
|
|
832
|
+
"version": "1.1.2",
|
|
833
|
+
"source": {
|
|
834
|
+
"type": "git",
|
|
835
|
+
"url": "https://github.com/PHPCSStandards/PHPCSExtra.git",
|
|
836
|
+
"reference": "746c3190ba8eb2f212087c947ba75f4f5b9a58d5"
|
|
837
|
+
},
|
|
838
|
+
"dist": {
|
|
839
|
+
"type": "zip",
|
|
840
|
+
"url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/746c3190ba8eb2f212087c947ba75f4f5b9a58d5",
|
|
841
|
+
"reference": "746c3190ba8eb2f212087c947ba75f4f5b9a58d5",
|
|
842
|
+
"shasum": ""
|
|
843
|
+
},
|
|
844
|
+
"require": {
|
|
845
|
+
"php": ">=5.4",
|
|
846
|
+
"phpcsstandards/phpcsutils": "^1.0.8",
|
|
847
|
+
"squizlabs/php_codesniffer": "^3.7.1"
|
|
848
|
+
},
|
|
849
|
+
"require-dev": {
|
|
850
|
+
"php-parallel-lint/php-console-highlighter": "^1.0",
|
|
851
|
+
"php-parallel-lint/php-parallel-lint": "^1.3.2",
|
|
852
|
+
"phpcsstandards/phpcsdevcs": "^1.1.6",
|
|
853
|
+
"phpcsstandards/phpcsdevtools": "^1.2.1",
|
|
854
|
+
"phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0"
|
|
855
|
+
},
|
|
856
|
+
"type": "phpcodesniffer-standard",
|
|
857
|
+
"extra": {
|
|
858
|
+
"branch-alias": {
|
|
859
|
+
"dev-stable": "1.x-dev",
|
|
860
|
+
"dev-develop": "1.x-dev"
|
|
861
|
+
}
|
|
862
|
+
},
|
|
863
|
+
"notification-url": "https://packagist.org/downloads/",
|
|
864
|
+
"license": [
|
|
865
|
+
"LGPL-3.0-or-later"
|
|
866
|
+
],
|
|
867
|
+
"authors": [
|
|
868
|
+
{
|
|
869
|
+
"name": "Juliette Reinders Folmer",
|
|
870
|
+
"homepage": "https://github.com/jrfnl",
|
|
871
|
+
"role": "lead"
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
"name": "Contributors",
|
|
875
|
+
"homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors"
|
|
876
|
+
}
|
|
877
|
+
],
|
|
878
|
+
"description": "A collection of sniffs and standards for use with PHP_CodeSniffer.",
|
|
879
|
+
"keywords": [
|
|
880
|
+
"PHP_CodeSniffer",
|
|
881
|
+
"phpcbf",
|
|
882
|
+
"phpcodesniffer-standard",
|
|
883
|
+
"phpcs",
|
|
884
|
+
"standards",
|
|
885
|
+
"static analysis"
|
|
886
|
+
],
|
|
887
|
+
"support": {
|
|
888
|
+
"issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues",
|
|
889
|
+
"source": "https://github.com/PHPCSStandards/PHPCSExtra"
|
|
890
|
+
},
|
|
891
|
+
"time": "2023-09-20T22:06:18+00:00"
|
|
892
|
+
},
|
|
893
|
+
{
|
|
894
|
+
"name": "phpcsstandards/phpcsutils",
|
|
895
|
+
"version": "1.0.8",
|
|
896
|
+
"source": {
|
|
897
|
+
"type": "git",
|
|
898
|
+
"url": "https://github.com/PHPCSStandards/PHPCSUtils.git",
|
|
899
|
+
"reference": "69465cab9d12454e5e7767b9041af0cd8cd13be7"
|
|
900
|
+
},
|
|
901
|
+
"dist": {
|
|
902
|
+
"type": "zip",
|
|
903
|
+
"url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/69465cab9d12454e5e7767b9041af0cd8cd13be7",
|
|
904
|
+
"reference": "69465cab9d12454e5e7767b9041af0cd8cd13be7",
|
|
905
|
+
"shasum": ""
|
|
906
|
+
},
|
|
907
|
+
"require": {
|
|
908
|
+
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0",
|
|
909
|
+
"php": ">=5.4",
|
|
910
|
+
"squizlabs/php_codesniffer": "^3.7.1 || 4.0.x-dev@dev"
|
|
911
|
+
},
|
|
912
|
+
"require-dev": {
|
|
913
|
+
"ext-filter": "*",
|
|
914
|
+
"php-parallel-lint/php-console-highlighter": "^1.0",
|
|
915
|
+
"php-parallel-lint/php-parallel-lint": "^1.3.2",
|
|
916
|
+
"phpcsstandards/phpcsdevcs": "^1.1.6",
|
|
917
|
+
"yoast/phpunit-polyfills": "^1.0.5 || ^2.0.0"
|
|
918
|
+
},
|
|
919
|
+
"type": "phpcodesniffer-standard",
|
|
920
|
+
"extra": {
|
|
921
|
+
"branch-alias": {
|
|
922
|
+
"dev-stable": "1.x-dev",
|
|
923
|
+
"dev-develop": "1.x-dev"
|
|
924
|
+
}
|
|
925
|
+
},
|
|
926
|
+
"autoload": {
|
|
927
|
+
"classmap": [
|
|
928
|
+
"PHPCSUtils/"
|
|
929
|
+
]
|
|
930
|
+
},
|
|
931
|
+
"notification-url": "https://packagist.org/downloads/",
|
|
932
|
+
"license": [
|
|
933
|
+
"LGPL-3.0-or-later"
|
|
934
|
+
],
|
|
935
|
+
"authors": [
|
|
936
|
+
{
|
|
937
|
+
"name": "Juliette Reinders Folmer",
|
|
938
|
+
"homepage": "https://github.com/jrfnl",
|
|
939
|
+
"role": "lead"
|
|
940
|
+
},
|
|
941
|
+
{
|
|
942
|
+
"name": "Contributors",
|
|
943
|
+
"homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors"
|
|
944
|
+
}
|
|
945
|
+
],
|
|
946
|
+
"description": "A suite of utility functions for use with PHP_CodeSniffer",
|
|
947
|
+
"homepage": "https://phpcsutils.com/",
|
|
948
|
+
"keywords": [
|
|
949
|
+
"PHP_CodeSniffer",
|
|
950
|
+
"phpcbf",
|
|
951
|
+
"phpcodesniffer-standard",
|
|
952
|
+
"phpcs",
|
|
953
|
+
"phpcs3",
|
|
954
|
+
"standards",
|
|
955
|
+
"static analysis",
|
|
956
|
+
"tokens",
|
|
957
|
+
"utility"
|
|
958
|
+
],
|
|
959
|
+
"support": {
|
|
960
|
+
"docs": "https://phpcsutils.com/",
|
|
961
|
+
"issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues",
|
|
962
|
+
"source": "https://github.com/PHPCSStandards/PHPCSUtils"
|
|
963
|
+
},
|
|
964
|
+
"time": "2023-07-16T21:39:41+00:00"
|
|
965
|
+
},
|
|
829
966
|
{
|
|
830
967
|
"name": "phpunit/php-code-coverage",
|
|
831
968
|
"version": "9.2.29",
|
|
@@ -3254,30 +3391,38 @@
|
|
|
3254
3391
|
},
|
|
3255
3392
|
{
|
|
3256
3393
|
"name": "wp-coding-standards/wpcs",
|
|
3257
|
-
"version": "
|
|
3394
|
+
"version": "3.0.1",
|
|
3258
3395
|
"source": {
|
|
3259
3396
|
"type": "git",
|
|
3260
3397
|
"url": "https://github.com/WordPress/WordPress-Coding-Standards.git",
|
|
3261
|
-
"reference": "
|
|
3398
|
+
"reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1"
|
|
3262
3399
|
},
|
|
3263
3400
|
"dist": {
|
|
3264
3401
|
"type": "zip",
|
|
3265
|
-
"url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/
|
|
3266
|
-
"reference": "
|
|
3402
|
+
"url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/b4caf9689f1a0e4a4c632679a44e638c1c67aff1",
|
|
3403
|
+
"reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1",
|
|
3267
3404
|
"shasum": ""
|
|
3268
3405
|
},
|
|
3269
3406
|
"require": {
|
|
3407
|
+
"ext-filter": "*",
|
|
3408
|
+
"ext-libxml": "*",
|
|
3409
|
+
"ext-tokenizer": "*",
|
|
3410
|
+
"ext-xmlreader": "*",
|
|
3270
3411
|
"php": ">=5.4",
|
|
3271
|
-
"
|
|
3412
|
+
"phpcsstandards/phpcsextra": "^1.1.0",
|
|
3413
|
+
"phpcsstandards/phpcsutils": "^1.0.8",
|
|
3414
|
+
"squizlabs/php_codesniffer": "^3.7.2"
|
|
3272
3415
|
},
|
|
3273
3416
|
"require-dev": {
|
|
3274
|
-
"
|
|
3417
|
+
"php-parallel-lint/php-console-highlighter": "^1.0.0",
|
|
3418
|
+
"php-parallel-lint/php-parallel-lint": "^1.3.2",
|
|
3275
3419
|
"phpcompatibility/php-compatibility": "^9.0",
|
|
3276
|
-
"phpcsstandards/phpcsdevtools": "^1.0",
|
|
3420
|
+
"phpcsstandards/phpcsdevtools": "^1.2.0",
|
|
3277
3421
|
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
|
|
3278
3422
|
},
|
|
3279
3423
|
"suggest": {
|
|
3280
|
-
"
|
|
3424
|
+
"ext-iconv": "For improved results",
|
|
3425
|
+
"ext-mbstring": "For improved results"
|
|
3281
3426
|
},
|
|
3282
3427
|
"type": "phpcodesniffer-standard",
|
|
3283
3428
|
"notification-url": "https://packagist.org/downloads/",
|
|
@@ -3294,6 +3439,7 @@
|
|
|
3294
3439
|
"keywords": [
|
|
3295
3440
|
"phpcs",
|
|
3296
3441
|
"standards",
|
|
3442
|
+
"static analysis",
|
|
3297
3443
|
"wordpress"
|
|
3298
3444
|
],
|
|
3299
3445
|
"support": {
|
|
@@ -3301,7 +3447,13 @@
|
|
|
3301
3447
|
"source": "https://github.com/WordPress/WordPress-Coding-Standards",
|
|
3302
3448
|
"wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki"
|
|
3303
3449
|
},
|
|
3304
|
-
"
|
|
3450
|
+
"funding": [
|
|
3451
|
+
{
|
|
3452
|
+
"url": "https://opencollective.com/thewpcc/contribute/wp-php-63406",
|
|
3453
|
+
"type": "custom"
|
|
3454
|
+
}
|
|
3455
|
+
],
|
|
3456
|
+
"time": "2023-09-14T07:06:09+00:00"
|
|
3305
3457
|
},
|
|
3306
3458
|
{
|
|
3307
3459
|
"name": "yoast/phpunit-polyfills",
|
|
@@ -3374,5 +3526,5 @@
|
|
|
3374
3526
|
"platform-overrides": {
|
|
3375
3527
|
"php": "7.4"
|
|
3376
3528
|
},
|
|
3377
|
-
"plugin-api-version": "2.
|
|
3529
|
+
"plugin-api-version": "2.1.0"
|
|
3378
3530
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<?php return array('dependencies' => array('wp-polyfill'), 'version' => '
|
|
1
|
+
<?php return array('dependencies' => array('wp-polyfill'), 'version' => 'd671898c7cde6ddf2074675228dcd4dd');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.wp-block-newspack-blocks-checkout-button.alignfull button,.wp-block-newspack-blocks-checkout-button.alignwide button{width:100%}.wp-block-newspack-blocks-checkout-button.aligncenter form{display:flex;flex-direction:column}.wp-block-newspack-blocks-checkout-button.aligncenter button{margin-left:auto;margin-right:auto}
|
|
1
|
+
.wp-block-newspack-blocks-checkout-button.alignfull button,.wp-block-newspack-blocks-checkout-button.alignwide button{width:100%}.wp-block-newspack-blocks-checkout-button.aligncenter form{display:flex;flex-direction:column}.wp-block-newspack-blocks-checkout-button.aligncenter button{margin-left:auto;margin-right:auto}.wp-block-newspack-blocks-checkout-button.wp-block-button__width-25 button{width:25%}.wp-block-newspack-blocks-checkout-button.wp-block-button__width-50 button{width:50%}.wp-block-newspack-blocks-checkout-button.wp-block-button__width-75 button{width:75%}.wp-block-newspack-blocks-checkout-button.wp-block-button__width-100 button{width:100%}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.wp-block-newspack-blocks-checkout-button.alignfull button,.wp-block-newspack-blocks-checkout-button.alignwide button{width:100%}.wp-block-newspack-blocks-checkout-button.aligncenter form{display:flex;flex-direction:column}.wp-block-newspack-blocks-checkout-button.aligncenter button{margin-right:auto;margin-left:auto}
|
|
1
|
+
.wp-block-newspack-blocks-checkout-button.alignfull button,.wp-block-newspack-blocks-checkout-button.alignwide button{width:100%}.wp-block-newspack-blocks-checkout-button.aligncenter form{display:flex;flex-direction:column}.wp-block-newspack-blocks-checkout-button.aligncenter button{margin-right:auto;margin-left:auto}.wp-block-newspack-blocks-checkout-button.wp-block-button__width-25 button{width:25%}.wp-block-newspack-blocks-checkout-button.wp-block-button__width-50 button{width:50%}.wp-block-newspack-blocks-checkout-button.wp-block-button__width-75 button{width:75%}.wp-block-newspack-blocks-checkout-button.wp-block-button__width-100 button{width:100%}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<?php return array('dependencies' => array('wp-i18n', 'wp-polyfill'), 'version' => '
|
|
1
|
+
<?php return array('dependencies' => array('wp-i18n', 'wp-polyfill'), 'version' => '61ce5db966ba8ddbbf84a95c9ac03645');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var e={7597:(e,t)=>{"use strict";function r(e){return 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},r(e)}var n,o="https://js.stripe.com/v3",a=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,i="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",u=null,c=function(e){return null!==u||(u=new Promise((function(t,r){if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(i),window.Stripe)t(window.Stripe);else try{var n=function(){for(var e=document.querySelectorAll('script[src^="'.concat(o,'"]')),t=0;t<e.length;t++){var r=e[t];if(a.test(r.src))return r}return null}();n&&e?console.warn(i):n||(n=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src="".concat(o).concat(t);var n=document.head||document.body;if(!n)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return n.appendChild(r),r}(e)),n.addEventListener("load",(function(){window.Stripe?t(window.Stripe):r(new Error("Stripe.js not available"))})),n.addEventListener("error",(function(){r(new Error("Failed to load Stripe.js"))}))}catch(u){return void r(u)}else t(null)}))),u},s=function(e,t,r){if(null===e)return null;var n=e.apply(void 0,t);return function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"2.1.7",startTime:t})}(n,r),n},l=function(e){var t="invalid load parameters; expected object of shape\n\n {advancedFraudSignals: boolean}\n\nbut received\n\n ".concat(JSON.stringify(e),"\n");if(null===e||"object"!==r(e))throw new Error(t);if(1===Object.keys(e).length&&"boolean"==typeof e.advancedFraudSignals)return e;throw new Error(t)},f=!1,p=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];f=!0;var o=Date.now();return c(n).then((function(e){return s(e,t,o)}))};p.setLoadParameters=function(e){if(f&&n){var t=l(e);if(Object.keys(t).reduce((function(t,r){var o;return t&&e[r]===(null===(o=n)||void 0===o?void 0:o[r])}),!0))return}if(f)throw new Error("You cannot change load parameters after calling loadStripe");n=l(e)},t.loadStripe=p},7894:(e,t,r)=>{e.exports=r(7597)},5666:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(R){s=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var a=t&&t.prototype instanceof h?t:h,i=Object.create(a.prototype),u=new P(n||[]);return o(i,"_invoke",{value:E(e,r,u)}),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(R){return{type:"throw",arg:R}}}e.wrap=l;var p="suspendedStart",d="executing",m="completed",y={};function h(){}function v(){}function b(){}var w={};s(w,i,(function(){return this}));var g=Object.getPrototypeOf,x=g&&g(g(q([])));x&&x!==r&&n.call(x,i)&&(w=x);var _=b.prototype=h.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function r(o,a,i,u){var c=f(e[o],e,a);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,i,u)}),(function(e){r("throw",e,i,u)})):t.resolve(l).then((function(e){s.value=e,i(s)}),(function(e){return r("throw",e,i,u)}))}u(c.arg)}var a;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return a=a?a.then(o,o):o()}})}function E(e,r,n){var o=p;return function(a,i){if(o===d)throw new Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var u=n.delegate;if(u){var c=j(u,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=f(e,r,n);if("normal"===s.type){if(o=n.done?m:"suspendedYield",s.arg===y)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=m,n.method="throw",n.arg=s.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(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 L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function q(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(typeof e+" is not iterable")}return v.prototype=b,o(_,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:v,configurable:!0}),v.displayName=s(b,c,"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,b):(e.__proto__=b,s(e,c,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},k(S.prototype),s(S.prototype,u,(function(){return this})),e.AsyncIterator=S,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new S(l(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(_),s(_,c,"Generator"),s(_,i,(function(){return this})),s(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=q,P.prototype={constructor:P,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(L),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=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 r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],u=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},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),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:q(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}(e.exports);try{regeneratorRuntime=t}catch(r){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(r){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}function a(e,t,r,n,o,a,i){try{var u=e[a](i),c=u.value}catch(s){return void r(s)}u.done?t(c):Promise.resolve(c).then(n,o)}function i(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function u(e){a(i,n,o,u,c,"next",e)}function c(e){a(i,n,o,u,c,"throw",e)}u(void 0)}))}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t){if(e){if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}function s(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||c(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}r.r(n),r.d(n,{processStreamlinedElements:()=>S});const l=window.wp.i18n;var f=r(7894);r(5666);function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],_n=!0,i=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);_n=!0);}catch(u){i=!0,o=u}finally{try{_n||null==r.return||r.return()}finally{if(i)throw o}}return a}}(e,t)||c(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var __=l.__,d=function(e,t){var r,n={};r=e.email,/\S+@\S+/.test(r)||(n.email=__("Email address is invalid.","newspack-blocks"));var o=t.minimumDonation;return o&&parseFloat(e.amount)<o&&(n.amount=(0,l.sprintf)(__("Amount must be at least %d.","newspack-blocks"),o)),0===e.full_name.length&&(n.amount=__("Full name should be provided.","newspack-blocks")),n},m=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"error";t.innerHTML="",e.forEach((function(e){if(e){var n=document.createElement("div");n.classList.add("type-".concat(r)),n.innerHTML=e,t.appendChild(n)}})),"success"===r&&t.parentElement&&t.parentElement.replaceWith(t)},y=function(e){var t=e.closest("[data-streamlined-config]"),r=null==t?void 0:t.getAttribute("data-streamlined-config");if(!r)return{};var n=p(JSON.parse(r),12),o=n[0],a=n[1],i=n[2],u=n[3],c=n[4],s=n[5],l=n[6],f=n[7],d=n[8],m=n[9],y=n[10],h=n[11];return{currency:o.toLowerCase(),currencySymbol:a,siteName:i,isCurrencyZeroDecimal:u,countryCode:c,frequencies:s,feeMultiplier:parseFloat(l),feeStatic:parseFloat(f),stripePublishableKey:d,paymentRequestType:m,captchaSiteKey:y,minimumDonation:parseFloat(h)}},h=function(e){var t=Object.fromEntries(new FormData(e)),r="donation_value_".concat(t.donation_frequency);return t.amount=t[r],"other"===t.amount&&(t.amount=t["".concat(r,"_other")]),t.amount||(t.amount=t["".concat(r,"_untiered")]),t.cid&&"string"==typeof t.cid&&0===t.cid.indexOf("CLIENT_ID")&&(t.cid=document.cookie.split("; ").reduce((function(e,t){var r=t.split("=");return e[r[0]]=r[1],e}),{})["newspack-cid"]),t},v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{convertToSubunit:!1},r=t.convertToSubunit,n=y(e),o=h(e),a=o.amount,i=void 0===a?"0":a,u=o.agree_to_pay_fees,c=function(e){return r?e*(n.isCurrencyZeroDecimal?1:100):e},s=0;return u&&(s=c(w(e)||0)),c(parseFloat(i))+s},b=function(e){var t=y(e),r=h(e).donation_frequency,n=t.frequencies[r];return{label:"".concat(t.siteName," (").concat(n,")"),amount:v(e,{convertToSubunit:!0})}},w=function(e){var t=y(e),r=t.feeMultiplier,n=t.feeStatic;if(void 0===r||void 0===n||isNaN(r)||isNaN(n))return 0;var o=h(e).amount;return function(e,t,r){return parseFloat(((e+r)/(100-t)*100-e).toFixed(2))}(parseFloat(o),r,n)},g=function(){var e=i(regeneratorRuntime.mark((function e(t,r){var n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>2&&void 0!==o[2]?o[2]:"POST",e.abrupt("return",fetch("/wp-json/newspack-blocks/v1".concat(t),{method:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).then(function(){var e=i(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.json();case 2:if(r=e.sent,!t.ok){e.next=5;break}return e.abrupt("return",r);case 5:return e.abrupt("return",{error:r});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 2:case"end":return e.stop()}}),e)})));return function(_x,t){return e.apply(this,arguments)}}(),x=function(e,t){var r=(0,l.sprintf)(__("Your payment has been processed. Thank you for your contribution! You will receive a confirmation email at %s.","newspack-blocks"),e);m([r],t,"success")},_=l.__,k=function(e){return s(e.querySelectorAll("input[data-is-additional-field]")).map((function(e){return{name:e.name,value:e.value}}))},S=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;return s(e.querySelectorAll(".stripe-payment")).forEach(function(){var e=i(regeneratorRuntime.mark((function e(t){var r,n,a,u,c,s,l,p,S,E,j,O,L,P,q,R,T,F;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=!1,s=t.closest("form"),l=t.querySelector(".stripe-payment__messages"),s&&l){e.next=5;break}return e.abrupt("return");case 5:p=t.closest(".wpbnbd"),S="newspackPaymentFlowComplete-".concat((null==p?void 0:p.id)||""),E=y(s),j=function(){return t.classList.add("stripe-payment--disabled")},(O=function(){return t.classList.remove("stripe-payment--disabled")})(),L=function(){if(!c){var e=t.querySelector(".stripe-payment__inputs.stripe-payment--hidden");e&&(e.classList.remove("stripe-payment--hidden"),c=!0)}},P=function(){var e=i(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var n=window.grecaptcha;if(!n)return e("");null!=n&&n.ready&&t||r(_("Error loading the reCaptcha library.","newspack-blocks")),n.ready(i(regeneratorRuntime.mark((function o(){var a;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,n.execute(t,{action:"submit"});case 3:return a=o.sent,o.abrupt("return",e(a));case 7:o.prev=7,o.t0=o.catch(0),r(o.t0);case 10:case"end":return o.stop()}}),o,null,[[0,7]])}))))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),q=function(){var e=i(regeneratorRuntime.mark((function e(t){var n,a,i,u,c,f,p,d,y,b,w,j,L,q,R,T=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=T.length>1&&void 0!==T[1]?T[1]:void 0,u=T.length>2&&void 0!==T[2]?T[2]:{},r){e.next=4;break}return e.abrupt("return");case 4:if(!(c=null==E?void 0:E.captchaSiteKey)){e.next=17;break}return e.prev=6,e.next=9,P(c);case 9:f=e.sent,e.next=17;break;case 12:return e.prev=12,e.t0=e.catch(6),p=e.t0 instanceof Error?e.t0.message:_("Error processing captcha request.","newspack-blocks"),m([p],l),e.abrupt("return",{error:!0});case 17:return d=h(s),y=k(s),b=o({captchaToken:f,stripe_tokenization_method:i?null===(n=i.card)||void 0===n?void 0:n.tokenization_method:"card",stripe_source_id:t.id,amount:v(s),email:d.email,full_name:d.full_name,frequency:d.donation_frequency,newsletter_opt_in:Boolean(d.newsletter_opt_in),newspack_popup_id:d.newspack_popup_id,_wp_http_referer:d._wp_http_referer,clientId:d.cid,additional_fields:y},u),e.next=22,g("/donate",b);case 22:if(w=e.sent,200===(null===(a=w.data)||void 0===a?void 0:a.status)||!w.message){e.next=26;break}return m([w.message],l),e.abrupt("return",{error:!0});case 26:if(!w.error){e.next=29;break}return m([w.error],l),e.abrupt("return",{error:!0});case 29:if(j=function(e){return m([e],l),O(),window.dispatchEvent(new Event(S)),{error:!0}},!w.client_secret){e.next=53;break}return e.next=33,r.confirmCardPayment(w.client_secret);case 33:if(!(L=e.sent).error){e.next=38;break}return e.abrupt("return",j(L.error.message));case 38:if("succeeded"!==L.paymentIntent.status){e.next=42;break}x(b.email,l),e.next=53;break;case 42:if("requires_action"!==L.paymentIntent.status){e.next=52;break}return e.next=45,r.confirmCardPayment(w.client_secret);case 45:if(q=e.sent,!(R=q.error)){e.next=49;break}return e.abrupt("return",j(R.message));case 49:x(b.email,l),e.next=53;break;case 52:return e.abrupt("return",j(_("Something went wrong with the payment. Please try again later.","newspack-blocks")));case 53:return"success"===w.status&&x(b.email,l),window.dispatchEvent(new Event(S)),e.abrupt("return",{});case 56:case"end":return e.stop()}}),e,null,[[6,12]])})));return function(t){return e.apply(this,arguments)}}(),R=function(){var e=i(regeneratorRuntime.mark((function e(){var o,c,l,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,f.loadStripe)(E.stripePublishableKey);case 2:if(r=e.sent){e.next=5;break}return e.abrupt("return");case 5:if(o=t.querySelector(".stripe-payment__card")){e.next=8;break}return e.abrupt("return");case 8:return c=r.elements(),(n=c.create("card")).mount(o),a=r.paymentRequest({country:E.countryCode,currency:E.currency,total:b(s),requestPayerName:!0,requestPayerEmail:!0}),e.next=14,a.canMakePayment();case 14:if(!e.sent){e.next=28;break}if(a.on("source",function(){var e=i(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,q(t.source,u,{email:t.payerEmail,full_name:t.payerName});case 2:r=e.sent,t.complete(null!=r&&r.error?"fail":"success");case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),a.on("token",function(){var e=i(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:u=t.token;case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),s.addEventListener("change",(function(){a.update({total:b(s)})})),l=c.create("paymentRequestButton",{paymentRequest:a,style:{paymentRequestButton:{type:E.paymentRequestType,height:"46px"}}}),p=t.querySelector(".stripe-payment__request-button")){e.next=23;break}return e.abrupt("return");case 23:l.mount(p),p.classList.remove("stripe-payment--hidden"),setTimeout((function(){p.classList.remove("stripe-payment__request-button--invisible")}),0),e.next=29;break;case 28:L();case 29:t.classList.remove("stripe-payment--invisible");case 30:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),new IntersectionObserver((function(e){e[0].isIntersecting&&R()})).observe(t),(T=t.querySelector('button[type="submit"]'))&&(T.onclick=function(e){c||(e.preventDefault(),L())}),(F=function(){var e=t.querySelector("#stripe-fees-amount");if(e){var r=Object.fromEntries(new FormData(s)),n=w(s);if(0===n){var o=t.querySelector("#stripe-fees-amount-container");o&&(o.style.display="none")}"string"==typeof r.donation_frequency&&(e.innerHTML="(".concat(E.currencySymbol).concat(n.toFixed(2)," ").concat(E.frequencies[r.donation_frequency].toLowerCase(),")"))}})(),s.addEventListener("change",F),s.addEventListener("submit",function(){var e=i(regeneratorRuntime.mark((function e(t){var o,a,i,u,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return");case 2:if(t.preventDefault(),j(),m([_("Processing payment…","newspack-blocks")],l,"info"),a=h(s),!((i=Object.values(d(a,E))).length>0)){e.next=11;break}return m(i,l),O(),e.abrupt("return");case 11:return u=function(e){e.message&&i.push(e.message),m(i,l),O()},e.next=14,r.createSource(n,{type:"card",owner:{name:a.full_name,email:a.email}});case 14:if(!(c=e.sent).error){e.next=18;break}return u(c.error),e.abrupt("return");case 18:return e.next=20,q(c.source);case 20:null!==(o=window.newspackReaderActivation)&&void 0!==o&&o.refreshAuthentication&&window.newspackReaderActivation.refreshAuthentication();case 21:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 23:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}())};S()})();var o=window;for(var a in n)o[a]=n[a];n.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})();
|
|
1
|
+
(()=>{var e={7597:(e,t)=>{"use strict";function r(e){return 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},r(e)}var n,o="https://js.stripe.com/v3",a=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,i="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",u=null,c=function(e){return null!==u||(u=new Promise((function(t,r){if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(i),window.Stripe)t(window.Stripe);else try{var n=function(){for(var e=document.querySelectorAll('script[src^="'.concat(o,'"]')),t=0;t<e.length;t++){var r=e[t];if(a.test(r.src))return r}return null}();n&&e?console.warn(i):n||(n=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src="".concat(o).concat(t);var n=document.head||document.body;if(!n)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return n.appendChild(r),r}(e)),n.addEventListener("load",(function(){window.Stripe?t(window.Stripe):r(new Error("Stripe.js not available"))})),n.addEventListener("error",(function(){r(new Error("Failed to load Stripe.js"))}))}catch(u){return void r(u)}else t(null)}))),u},s=function(e,t,r){if(null===e)return null;var n=e.apply(void 0,t);return function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"2.1.11",startTime:t})}(n,r),n},l=function(e){var t="invalid load parameters; expected object of shape\n\n {advancedFraudSignals: boolean}\n\nbut received\n\n ".concat(JSON.stringify(e),"\n");if(null===e||"object"!==r(e))throw new Error(t);if(1===Object.keys(e).length&&"boolean"==typeof e.advancedFraudSignals)return e;throw new Error(t)},f=!1,p=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];f=!0;var o=Date.now();return c(n).then((function(e){return s(e,t,o)}))};p.setLoadParameters=function(e){if(f&&n){var t=l(e);if(Object.keys(t).reduce((function(t,r){var o;return t&&e[r]===(null===(o=n)||void 0===o?void 0:o[r])}),!0))return}if(f)throw new Error("You cannot change load parameters after calling loadStripe");n=l(e)},t.loadStripe=p},7894:(e,t,r)=>{e.exports=r(7597)},5666:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(R){s=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var a=t&&t.prototype instanceof h?t:h,i=Object.create(a.prototype),u=new P(n||[]);return o(i,"_invoke",{value:E(e,r,u)}),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(R){return{type:"throw",arg:R}}}e.wrap=l;var p="suspendedStart",d="executing",m="completed",y={};function h(){}function v(){}function b(){}var w={};s(w,i,(function(){return this}));var g=Object.getPrototypeOf,x=g&&g(g(q([])));x&&x!==r&&n.call(x,i)&&(w=x);var _=b.prototype=h.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function r(o,a,i,u){var c=f(e[o],e,a);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,i,u)}),(function(e){r("throw",e,i,u)})):t.resolve(l).then((function(e){s.value=e,i(s)}),(function(e){return r("throw",e,i,u)}))}u(c.arg)}var a;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return a=a?a.then(o,o):o()}})}function E(e,r,n){var o=p;return function(a,i){if(o===d)throw new Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var u=n.delegate;if(u){var c=j(u,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=f(e,r,n);if("normal"===s.type){if(o=n.done?m:"suspendedYield",s.arg===y)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=m,n.method="throw",n.arg=s.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(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 L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function q(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(typeof e+" is not iterable")}return v.prototype=b,o(_,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:v,configurable:!0}),v.displayName=s(b,c,"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,b):(e.__proto__=b,s(e,c,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},k(S.prototype),s(S.prototype,u,(function(){return this})),e.AsyncIterator=S,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new S(l(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(_),s(_,c,"Generator"),s(_,i,(function(){return this})),s(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=q,P.prototype={constructor:P,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(L),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=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 r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],u=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},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),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:q(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}(e.exports);try{regeneratorRuntime=t}catch(r){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(r){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}function a(e,t,r,n,o,a,i){try{var u=e[a](i),c=u.value}catch(s){return void r(s)}u.done?t(c):Promise.resolve(c).then(n,o)}function i(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function u(e){a(i,n,o,u,c,"next",e)}function c(e){a(i,n,o,u,c,"throw",e)}u(void 0)}))}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t){if(e){if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}function s(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||c(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}r.r(n),r.d(n,{processStreamlinedElements:()=>S});const l=window.wp.i18n;var f=r(7894);r(5666);function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],_n=!0,i=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);_n=!0);}catch(u){i=!0,o=u}finally{try{_n||null==r.return||r.return()}finally{if(i)throw o}}return a}}(e,t)||c(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var __=l.__,d=function(e,t){var r,n={};r=e.email,/\S+@\S+/.test(r)||(n.email=__("Email address is invalid.","newspack-blocks"));var o=t.minimumDonation;return o&&parseFloat(e.amount)<o&&(n.amount=(0,l.sprintf)(__("Amount must be at least %d.","newspack-blocks"),o)),0===e.full_name.length&&(n.amount=__("Full name should be provided.","newspack-blocks")),n},m=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"error";t.innerHTML="",e.forEach((function(e){if(e){var n=document.createElement("div");n.classList.add("type-".concat(r)),n.innerHTML=e,t.appendChild(n)}})),"success"===r&&t.parentElement&&t.parentElement.replaceWith(t)},y=function(e){var t=e.closest("[data-streamlined-config]"),r=null==t?void 0:t.getAttribute("data-streamlined-config");if(!r)return{};var n=p(JSON.parse(r),12),o=n[0],a=n[1],i=n[2],u=n[3],c=n[4],s=n[5],l=n[6],f=n[7],d=n[8],m=n[9],y=n[10],h=n[11];return{currency:o.toLowerCase(),currencySymbol:a,siteName:i,isCurrencyZeroDecimal:u,countryCode:c,frequencies:s,feeMultiplier:parseFloat(l),feeStatic:parseFloat(f),stripePublishableKey:d,paymentRequestType:m,captchaSiteKey:y,minimumDonation:parseFloat(h)}},h=function(e){var t=Object.fromEntries(new FormData(e)),r="donation_value_".concat(t.donation_frequency);return t.amount=t[r],"other"===t.amount&&(t.amount=t["".concat(r,"_other")]),t.amount||(t.amount=t["".concat(r,"_untiered")]),t.cid&&"string"==typeof t.cid&&0===t.cid.indexOf("CLIENT_ID")&&(t.cid=document.cookie.split("; ").reduce((function(e,t){var r=t.split("=");return e[r[0]]=r[1],e}),{})["newspack-cid"]),t},v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{convertToSubunit:!1},r=t.convertToSubunit,n=y(e),o=h(e),a=o.amount,i=void 0===a?"0":a,u=o.agree_to_pay_fees,c=function(e){return r?e*(n.isCurrencyZeroDecimal?1:100):e},s=0;return u&&(s=c(w(e)||0)),c(parseFloat(i))+s},b=function(e){var t=y(e),r=h(e).donation_frequency,n=t.frequencies[r];return{label:"".concat(t.siteName," (").concat(n,")"),amount:v(e,{convertToSubunit:!0})}},w=function(e){var t=y(e),r=t.feeMultiplier,n=t.feeStatic;if(void 0===r||void 0===n||isNaN(r)||isNaN(n))return 0;var o=h(e).amount;return function(e,t,r){return parseFloat(((e+r)/(100-t)*100-e).toFixed(2))}(parseFloat(o),r,n)},g=function(){var e=i(regeneratorRuntime.mark((function e(t,r){var n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>2&&void 0!==o[2]?o[2]:"POST",e.abrupt("return",fetch("/wp-json/newspack-blocks/v1".concat(t),{method:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).then(function(){var e=i(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.json();case 2:if(r=e.sent,!t.ok){e.next=5;break}return e.abrupt("return",r);case 5:return e.abrupt("return",{error:r});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 2:case"end":return e.stop()}}),e)})));return function(_x,t){return e.apply(this,arguments)}}(),x=function(e,t){var r=(0,l.sprintf)(__("Your payment has been processed. Thank you for your contribution! You will receive a confirmation email at %s.","newspack-blocks"),e);m([r],t,"success")},_=l.__,k=function(e){return s(e.querySelectorAll("input[data-is-additional-field]")).map((function(e){return{name:e.name,value:e.value}}))},S=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;return s(e.querySelectorAll(".stripe-payment")).forEach(function(){var e=i(regeneratorRuntime.mark((function e(t){var r,n,a,u,c,s,l,p,S,E,j,O,L,P,q,R,T,F;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=!1,s=t.closest("form"),l=t.querySelector(".stripe-payment__messages"),s&&l){e.next=5;break}return e.abrupt("return");case 5:p=t.closest(".wpbnbd"),S="newspackPaymentFlowComplete-".concat((null==p?void 0:p.id)||""),E=y(s),j=function(){return t.classList.add("stripe-payment--disabled")},(O=function(){return t.classList.remove("stripe-payment--disabled")})(),L=function(){if(!c){var e=t.querySelector(".stripe-payment__inputs.stripe-payment--hidden");e&&(e.classList.remove("stripe-payment--hidden"),c=!0)}},P=function(){var e=i(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var n=window.grecaptcha;if(!n)return e("");null!=n&&n.ready&&t||r(_("Error loading the reCaptcha library.","newspack-blocks")),n.ready(i(regeneratorRuntime.mark((function o(){var a;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,n.execute(t,{action:"submit"});case 3:return a=o.sent,o.abrupt("return",e(a));case 7:o.prev=7,o.t0=o.catch(0),r(o.t0);case 10:case"end":return o.stop()}}),o,null,[[0,7]])}))))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),q=function(){var e=i(regeneratorRuntime.mark((function e(t){var n,a,i,u,c,f,p,d,y,b,w,j,L,q,R,T=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=T.length>1&&void 0!==T[1]?T[1]:void 0,u=T.length>2&&void 0!==T[2]?T[2]:{},r){e.next=4;break}return e.abrupt("return");case 4:if(!(c=null==E?void 0:E.captchaSiteKey)){e.next=17;break}return e.prev=6,e.next=9,P(c);case 9:f=e.sent,e.next=17;break;case 12:return e.prev=12,e.t0=e.catch(6),p=e.t0 instanceof Error?e.t0.message:_("Error processing captcha request.","newspack-blocks"),m([p],l),e.abrupt("return",{error:!0});case 17:return d=h(s),y=k(s),b=o({captchaToken:f,stripe_tokenization_method:i?null===(n=i.card)||void 0===n?void 0:n.tokenization_method:"card",stripe_source_id:t.id,amount:v(s),email:d.email,full_name:d.full_name,frequency:d.donation_frequency,newsletter_opt_in:Boolean(d.newsletter_opt_in),newspack_popup_id:d.newspack_popup_id,_wp_http_referer:d._wp_http_referer,clientId:d.cid,additional_fields:y},u),e.next=22,g("/donate",b);case 22:if(w=e.sent,200===(null===(a=w.data)||void 0===a?void 0:a.status)||!w.message){e.next=26;break}return m([w.message],l),e.abrupt("return",{error:!0});case 26:if(!w.error){e.next=29;break}return m([w.error],l),e.abrupt("return",{error:!0});case 29:if(j=function(e){return m([e],l),O(),window.dispatchEvent(new Event(S)),{error:!0}},!w.client_secret){e.next=53;break}return e.next=33,r.confirmCardPayment(w.client_secret);case 33:if(!(L=e.sent).error){e.next=38;break}return e.abrupt("return",j(L.error.message));case 38:if("succeeded"!==L.paymentIntent.status){e.next=42;break}x(b.email,l),e.next=53;break;case 42:if("requires_action"!==L.paymentIntent.status){e.next=52;break}return e.next=45,r.confirmCardPayment(w.client_secret);case 45:if(q=e.sent,!(R=q.error)){e.next=49;break}return e.abrupt("return",j(R.message));case 49:x(b.email,l),e.next=53;break;case 52:return e.abrupt("return",j(_("Something went wrong with the payment. Please try again later.","newspack-blocks")));case 53:return"success"===w.status&&x(b.email,l),window.dispatchEvent(new Event(S)),e.abrupt("return",{});case 56:case"end":return e.stop()}}),e,null,[[6,12]])})));return function(t){return e.apply(this,arguments)}}(),R=function(){var e=i(regeneratorRuntime.mark((function e(){var o,c,l,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,f.loadStripe)(E.stripePublishableKey);case 2:if(r=e.sent){e.next=5;break}return e.abrupt("return");case 5:if(o=t.querySelector(".stripe-payment__card")){e.next=8;break}return e.abrupt("return");case 8:return c=r.elements(),(n=c.create("card")).mount(o),a=r.paymentRequest({country:E.countryCode,currency:E.currency,total:b(s),requestPayerName:!0,requestPayerEmail:!0}),e.next=14,a.canMakePayment();case 14:if(!e.sent){e.next=28;break}if(a.on("source",function(){var e=i(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,q(t.source,u,{email:t.payerEmail,full_name:t.payerName});case 2:r=e.sent,t.complete(null!=r&&r.error?"fail":"success");case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),a.on("token",function(){var e=i(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:u=t.token;case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),s.addEventListener("change",(function(){a.update({total:b(s)})})),l=c.create("paymentRequestButton",{paymentRequest:a,style:{paymentRequestButton:{type:E.paymentRequestType,height:"46px"}}}),p=t.querySelector(".stripe-payment__request-button")){e.next=23;break}return e.abrupt("return");case 23:l.mount(p),p.classList.remove("stripe-payment--hidden"),setTimeout((function(){p.classList.remove("stripe-payment__request-button--invisible")}),0),e.next=29;break;case 28:L();case 29:t.classList.remove("stripe-payment--invisible");case 30:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),new IntersectionObserver((function(e){e[0].isIntersecting&&R()})).observe(t),(T=t.querySelector('button[type="submit"]'))&&(T.onclick=function(e){c||(e.preventDefault(),L())}),(F=function(){var e=t.querySelector("#stripe-fees-amount");if(e){var r=Object.fromEntries(new FormData(s)),n=w(s);if(0===n){var o=t.querySelector("#stripe-fees-amount-container");o&&(o.style.display="none")}"string"==typeof r.donation_frequency&&(e.innerHTML="(".concat(E.currencySymbol).concat(n.toFixed(2)," ").concat(E.frequencies[r.donation_frequency].toLowerCase(),")"))}})(),s.addEventListener("change",F),s.addEventListener("submit",function(){var e=i(regeneratorRuntime.mark((function e(t){var o,a,i,u,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return");case 2:if(t.preventDefault(),j(),m([_("Processing payment…","newspack-blocks")],l,"info"),a=h(s),!((i=Object.values(d(a,E))).length>0)){e.next=11;break}return m(i,l),O(),e.abrupt("return");case 11:return u=function(e){e.message&&i.push(e.message),m(i,l),O()},e.next=14,r.createSource(n,{type:"card",owner:{name:a.full_name,email:a.email}});case 14:if(!(c=e.sent).error){e.next=18;break}return u(c.error),e.abrupt("return");case 18:return e.next=20,q(c.source);case 20:null!==(o=window.newspackReaderActivation)&&void 0!==o&&o.refreshAuthentication&&window.newspackReaderActivation.refreshAuthentication();case 21:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 23:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}())};S()})();var o=window;for(var a in n)o[a]=n[a];n.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})();
|
package/dist/editor.asset.php
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '
|
|
1
|
+
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '0a820aa30f55bf42dd8eda6576be72b8');
|