Easy Digital Downloads - Version 2.11

Version Description

Download this release

Release Info

Developer cklosows
Plugin Icon 128x128 Easy Digital Downloads
Version 2.11
Comparing to
See all releases

Code changes from version 2.10.6 to 2.11

Files changed (120) hide show
  1. assets/css/chosen-sprite.png +0 -0
  2. assets/css/chosen-sprite@2x.png +0 -0
  3. assets/css/edd-admin.css +22 -1
  4. assets/css/edd-admin.min.css +1 -1
  5. assets/images/edd-cpt-2x.png +0 -0
  6. assets/images/edd-cpt.png +0 -0
  7. assets/images/edd-cross-hair.png +0 -0
  8. assets/images/edd-icon-2x.png +0 -0
  9. assets/images/edd-icon.png +0 -0
  10. assets/images/edd-logo-pdf.png +0 -0
  11. assets/images/edd-logo.png +0 -0
  12. assets/images/edd-logo.svg +1 -30
  13. assets/images/edd-media.png +0 -0
  14. assets/images/edd-peeking.png +0 -0
  15. assets/images/icons/iphone.png +0 -0
  16. assets/images/promo/bfcm-header.svg +1 -1
  17. assets/images/promo/edd-25-percent-off.png +0 -0
  18. assets/images/screenshots/17checkout.png +0 -0
  19. assets/images/screenshots/17direct.png +0 -0
  20. assets/images/screenshots/17quantities.png +0 -0
  21. assets/images/screenshots/18-button-colors.png +0 -0
  22. assets/images/screenshots/18cart-saving.png +0 -0
  23. assets/images/screenshots/20-discount.png +0 -0
  24. assets/images/screenshots/20-register-login.png +0 -0
  25. assets/images/screenshots/20-sequential.png +0 -0
  26. assets/images/screenshots/20-unlimited-downloads.png +0 -0
  27. assets/images/screenshots/22-logs.png +0 -0
  28. assets/images/screenshots/22-purchased-downloads.png +0 -0
  29. assets/images/screenshots/22-purchased-downloads2.png +0 -0
  30. assets/images/screenshots/22-quantity.png +0 -0
  31. assets/images/screenshots/24-category-earnings.png +0 -0
  32. assets/images/screenshots/24-checkout.png +0 -0
  33. assets/images/screenshots/24-export.png +0 -0
  34. assets/images/screenshots/26-customer.png +0 -0
  35. assets/images/screenshots/26-import.png +0 -0
  36. assets/images/screenshots/26-refund.png +0 -0
  37. assets/images/screenshots/bundles.png +0 -0
  38. assets/images/screenshots/customer-ui.png +0 -0
  39. assets/images/screenshots/edit-download.png +0 -0
  40. assets/images/screenshots/email-template-21.png +0 -0
  41. assets/images/screenshots/grid.png +0 -0
  42. assets/images/screenshots/order-details.png +0 -0
  43. assets/images/screenshots/product-earnings.png +0 -0
  44. assets/images/screenshots/product-tax.png +0 -0
  45. assets/images/screenshots/purchase-link.png +0 -0
  46. assets/images/screenshots/tax-rates.png +0 -0
  47. assets/images/ui-icons_21759b_256x240.png +0 -0
  48. assets/images/ui-icons_999999_256x240.png +0 -0
  49. assets/js/admin-paypal-connect.js +130 -0
  50. assets/js/admin-paypal-connect.min.js +1 -0
  51. assets/js/admin-scripts.min.js +1 -1
  52. assets/js/edd-ajax.js +5 -0
  53. assets/js/edd-ajax.min.js +1 -1
  54. assets/js/edd-checkout-global.js +3 -1
  55. assets/js/edd-checkout-global.min.js +1 -1
  56. assets/js/paypal-checkout.js +255 -0
  57. assets/js/paypal-checkout.min.js +1 -0
  58. assets/js/wp-polyfill.min.js +1 -0
  59. easy-digital-downloads.php +6 -3
  60. includes/EDD_SL_Plugin_Updater.php +217 -215
  61. includes/admin/settings/register-settings.php +0 -1
  62. includes/admin/tools.php +38 -5
  63. includes/admin/upgrades/downgrades.php +75 -0
  64. includes/admin/upgrades/upgrade-functions.php +3 -5
  65. includes/ajax-functions.php +54 -51
  66. includes/class-edd-license-handler.php +21 -0
  67. includes/class-edd-session.php +5 -7
  68. includes/emails/class-edd-email-tags.php +22 -4
  69. includes/error-tracking.php +29 -15
  70. includes/gateways/functions.php +12 -1
  71. includes/gateways/paypal-standard.php +110 -106
  72. includes/gateways/paypal/admin/connect.php +657 -0
  73. includes/gateways/paypal/admin/notices.php +62 -0
  74. includes/gateways/paypal/admin/scripts.php +48 -0
  75. includes/gateways/paypal/admin/settings.php +150 -0
  76. includes/gateways/paypal/buy-now.php +103 -0
  77. includes/gateways/paypal/checkout-actions.php +410 -0
  78. includes/gateways/paypal/class-account-status-validator.php +178 -0
  79. includes/gateways/paypal/class-merchant-account.php +193 -0
  80. includes/gateways/paypal/class-paypal-api.php +269 -0
  81. includes/gateways/paypal/class-token.php +112 -0
  82. includes/gateways/paypal/exceptions/class-api-exception.php +17 -0
  83. includes/gateways/paypal/exceptions/class-authentication-exception.php +17 -0
  84. includes/gateways/paypal/exceptions/class-gateway-exception.php +59 -0
  85. includes/gateways/paypal/exceptions/class-invalid-merchant-details.php +15 -0
  86. includes/gateways/paypal/exceptions/class-missing-merchant-details.php +17 -0
  87. includes/gateways/paypal/functions.php +140 -0
  88. includes/gateways/paypal/gateway-filters.php +69 -0
  89. includes/gateways/paypal/paypal.php +76 -0
  90. includes/gateways/paypal/refunds.php +162 -0
  91. includes/gateways/paypal/scripts.php +194 -0
  92. includes/gateways/paypal/webhooks/class-webhook-handler.php +163 -0
  93. includes/gateways/paypal/webhooks/class-webhook-validator.php +168 -0
  94. includes/gateways/paypal/webhooks/events/abstract-webhook-event.php +171 -0
  95. includes/gateways/paypal/webhooks/events/class-payment-capture-completed.php +72 -0
  96. includes/gateways/paypal/webhooks/events/class-payment-capture-denied.php +30 -0
  97. includes/gateways/paypal/webhooks/events/class-payment-capture-refunded.php +60 -0
  98. includes/gateways/paypal/webhooks/functions.php +271 -0
  99. includes/gateways/stripe/vendor/composer/InstalledVersions.php +2 -2
  100. includes/gateways/stripe/vendor/composer/installed.php +2 -2
  101. includes/install.php +15 -4
  102. includes/process-purchase.php +24 -3
  103. includes/query-filters.php +2 -2
  104. includes/template-functions.php +2 -2
  105. includes/utils/class-tokenizer.php +116 -0
  106. languages/easy-digital-downloads.pot +658 -228
  107. readme.txt +18 -7
  108. templates/edd.min.css +1 -1
  109. templates/fonts/check.svg +1 -4
  110. templates/fonts/lock.svg +1 -4
  111. templates/images/icons/amazon.png +0 -0
  112. templates/images/icons/americanexpress.png +0 -0
  113. templates/images/icons/discover.png +0 -0
  114. templates/images/icons/iphone.png +0 -0
  115. templates/images/icons/mastercard.png +0 -0
  116. templates/images/icons/paypal.png +0 -0
  117. templates/images/icons/visa.png +0 -0
  118. templates/images/loading.gif +0 -0
  119. templates/images/tick.png +0 -0
  120. templates/images/xit.gif +0 -0
assets/css/chosen-sprite.png CHANGED
Binary file
assets/css/chosen-sprite@2x.png CHANGED
Binary file
assets/css/edd-admin.css CHANGED
@@ -2049,7 +2049,6 @@ td.edd_order_price {
2049
  width: 150px;
2050
  }
2051
 
2052
-
2053
  /* Promo Notices
2054
  -------------------------------------------------------------- */
2055
  .edd-admin-notice-top-of-page {
@@ -2104,3 +2103,25 @@ td.edd_order_price {
2104
  right: 9px;
2105
  }
2106
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2049
  width: 150px;
2050
  }
2051
 
 
2052
  /* Promo Notices
2053
  -------------------------------------------------------------- */
2054
  .edd-admin-notice-top-of-page {
2103
  right: 9px;
2104
  }
2105
  }
2106
+
2107
+ /* PayPal Connect
2108
+ -------------------------------------------------------------- */
2109
+ .edd-paypal-account-status ul {
2110
+ margin-left: 25px;
2111
+ }
2112
+ .edd-paypal-account-status > li {
2113
+ margin-bottom: 1em;
2114
+ }
2115
+ .edd-paypal-account-status ul:not(.edd-paypal-webhook-events) {
2116
+ list-style: disc;
2117
+ list-style-position: inside;
2118
+ }
2119
+ .edd-paypal-account-status ul:not(.edd-paypal-webhook-events) li {
2120
+ margin: .25em 0;
2121
+ }
2122
+ .edd-paypal-account-status .dashicons-yes {
2123
+ color: #008a20;
2124
+ }
2125
+ .edd-paypal-account-status .dashicons-no {
2126
+ color: #d63638;
2127
+ }
assets/css/edd-admin.min.css CHANGED
@@ -1 +1 @@
1
- .edd-hidden{display:none}.edd-clearfix:after{content:".";display:block;height:0;text-indent:-9999px;visibility:hidden}.edd-notice .notice-dismiss,.edd-wrap a{text-decoration:none}a.edd-delete{color:#a00}a.edd-delete:hover{color:red}.download_page_edd-settings .form-table label{color:#666;font-size:14px;font-style:italic;margin:4px 0 0}.download_page_edd-settings .form-table input.small-text~label,.download_page_edd-settings .form-table input[type=checkbox]+label{display:inline}.download_page_edd-settings .form-table tr>th>h3,.download_page_edd-settings .form-table tr>th>strong{font-size:1.2em;font-weight:600;margin:0 auto}.edd-help-tip{cursor:help}.edd-ui-tooltip{position:absolute;background:#333!important;border-width:1px!important;border-radius:3px!important;box-shadow:1px 1px 2px 1px rgba(214,214,214,.5)!important;color:#dedede!important;max-width:300px!important;padding:7px!important;text-rendering:optimizeLegibility;text-shadow:none!important;z-index:9999!important}.download_page_edd-settings .edd-settings-payment-icon-wrapper{margin-right:10px;line-height:16px;height:16px;display:table}#edd-add-ons h2.nav-tab-wrapper{position:relative}.edd-tab-span{top:-6px;right:0;position:absolute}.edd-add-ons-footer{padding-top:10px}#edd-add-ons h2{margin:0 0 15px}.edd-add-ons-view-wrapper{height:50px}#edd-add-ons h2 .button-primary{position:absolute}#edd-add-ons .edd-extension{background:#fff;border:1px solid #ccc;float:left;padding:14px;position:relative;margin:0 15px 15px 0;width:320px;height:315px}#edd-add-ons .edd-extension h3{font-size:13px;margin:0 0 8px}#edd-add-ons .edd-extension .button-secondary{position:absolute;bottom:14px;left:14px}#edd-add-ons .edd-browse-all{clear:both;width:100%}#edd-add-ons .edd-extension .third-party{display:none}#edd-add-ons .edd-starter-package{background-color:#85c0e5;border-color:#62a9d7;color:#fff}#edd-add-ons .edd-starter-package h3{color:#fff}#edd-add-ons .edd-extension .wp-post-image{width:100%;height:auto;vertical-align:bottom}#edd-products{height:100px;min-width:200px}#edd-add-discount input[type=text],#edd-edit-discount input[type=text]{width:300px}#edd-add-discount input.edd-price-field,#edd-edit-discount input.edd-price-field{padding:3px 5px;width:75px}.download_page_edd-addons .wrap .wp-heading-inline,.edit-php.post-type-download .wrap .wp-heading-inline{display:none}.download_page_edd-addons .wrap>.page-title-action,.edit-php.post-type-download .wrap>.page-title-action{display:none}.download_page_edd-addons .wrap .nav-tab-wrapper .page-title-action,.edit-php.post-type-download .wrap .nav-tab-wrapper .page-title-action{top:7px;margin-left:5px}#edd-payment-filters{background:#f5f5f5;clear:both;background-image:-webkit-gradient(linear,left bottom,left top,from(#f5f5f5),to(#fafafa));background-image:-webkit-linear-gradient(bottom,#f5f5f5,#fafafa);background-image:-moz-linear-gradient(bottom,#f5f5f5,#fafafa);background-image:-o-linear-gradient(bottom,#f5f5f5,#fafafa);background-image:linear-gradient(to top,#f5f5f5,#fafafa);border-color:#dfdfdf;border-width:1px;border-style:solid;border-radius:3px;font-size:13px;line-height:2.1em;overflow:auto;padding:12px;margin:8px 0}#edd-payments-filter ul.subsubsub{margin-bottom:8px}#edd-payment-filters p{color:#777}#edd-payment-date-filters input{vertical-align:middle}tr.status-refunded td{background:#cecece;border-top-color:#ccc}.wp-list-table.downloads th#ID{width:80px}.wp-list-table.downloads th#details{width:130px}.wp-list-table.downloads th#date{width:140px}.wp-list-table.downloads th#user{width:130px}.edd-mobile-link{line-height:32px;vertical-align:middle}.edd-mobile-link img{max-width:80%;height:auto;float:left}@media handheld,only screen and (max-width:640px){.wp-list-table.downloads th{width:auto!important}}.download_page_edd-payment-history .ui-dialog .ui-dialog-titlebar-close span{margin-left:-8px;margin-top:-8px}#edd-download-link-textarea{width:100%}.edd_files_name_label{width:225px;float:left}.edd_files_url_label{width:220px;float:left}#postbox-container-1 .edd_files_name_label{width:80px}#postbox-container-1 .edd_files_url_label{width:80px}.edd-add-repeatable-row{margin:10px 0}.edd-add-repeatable-row .submit{padding:0!important}.edd_repeatable_upload_wrapper:not(:first-child),.edd_variable_prices_wrapper:not(:first-child){margin-top:12px}.edd-repeatable-row-actions{color:#777;font-size:12px}.edd-repeatable-row-actions a{text-decoration:none;width:auto;cursor:pointer;vertical-align:middle}.edd-repeatable-row-actions .toggle-custom-price-option-section{color:#777}.edd-repeatable-row-actions .toggle-custom-price-option-section:hover{color:#444}.edd-bundle-products-header,.edd-repeatable-row-header{clear:both;background:#f1f1f1;border:1px solid #e5e5e5}.edd-repeatable-row-header{cursor:move}.edd-bundled-product-row:after,.edd-bundled-product-row:before,.edd-repeatable-row-header:after,.edd-repeatable-row-header:before{content:'';display:table}.edd-bundled-product-row:after,.edd-repeatable-row-header:after{clear:both}.edd-repeatable-row-title{float:left;font-weight:600}.edd-bundled-product-item-reorder .edd-product-file-reorder{color:#e5e5e5;font-family:dashicons;content:"\f545";font-size:18px;font-weight:300;margin-left:4px;vertical-align:top;transition:.2s color}.edd-bundled-product-item-reorder .edd-product-file-reorder:hover{color:#bbb}.edd-repeatable-row-actions,.edd-repeatable-row-title{padding:8px;box-sizing:border-box}.edd-repeatable-row-actions{float:right;text-align:right;padding:8px}.edd-bundled-product-row .edd-remove-row,.edd-repeatable-row-actions .edd-remove-row{font-size:12px;width:auto;cursor:pointer}.edd-bundled-product-row,.edd-repeatable-row-standard-fields{background:#f9f9f9;padding:8px;border-width:0 1px 1px;border-style:solid;border-color:#e5e5e5}.edd-repeatable-row-setting-label{display:block;margin-bottom:4px}.edd-repeatable-row-setting-label .edd-help-tip{display:inline-block;margin-left:4px}.edd-bundled-product-row .edd-bundled-product-actions,.edd-bundled-product-row .edd-bundled-product-item,.edd-bundled-product-row .edd-bundled-product-item-reorder,.edd-bundled-product-row .edd-bundled-product-price-assignment,.edd-file-assignment,.edd-file-name,.edd-file-url,.edd-option-name,.edd-option-price,.edd_repeatable_default{display:inline-block;vertical-align:top}.edd-option-name{width:38%;margin-right:5%}.edd-option-price{min-width:100px}.edd_repeatable_default{text-align:center;min-width:80px}.edd-file-name{width:18%;margin-right:3%}.edd-file-url{width:65%}.edd-repeatable-row-standard-fields.has-variable-pricing .edd-file-url{width:38%;margin-right:5%}.edd-file-assignment{width:27%}.edd-file-assignment .edd-repeatable-row-setting-label{margin-bottom:0}.edd-custom-price-option-sections-wrap{display:none;border-width:0 1px 1px;border-style:solid;border-color:#e5e5e5;box-sizing:border-box;width:100%}.edd-custom-price-option-section{display:block;padding:10px 8px;border-bottom:1px solid rgba(222,222,222,.3)}.edd-custom-price-option-section:last-child{border-bottom:none}label.edd_prices_shipping{display:none!important}.edd-custom-price-option-section-title{display:block;font-size:14px;font-weight:600;padding:0 0 10px}.edd-custom-price-option-section>:not(.edd-custom-price-option-section-title){display:inline-block;padding-right:20px;vertical-align:top;margin-bottom:4px}.edd-custom-price-option-section>:not(.edd-custom-price-option-section-title) label{display:block;margin-bottom:2px}.edd-bundle-products-header{font-weight:600;padding:8px}.edd-bundled-product-row .edd-bundled-product-item-reorder{min-width:30px;margin-right:8px}.edd-bundled-product-row .edd-bundled-product-item-reorder .edd-product-file-reorder{font-size:20px;font-weight:300;padding:16px 4px 0;cursor:move}.edd-bundled-product-row .edd-bundled-product-item{width:60%;margin-right:3%}.edd-bundled-product-row.has-variable-pricing .edd-bundled-product-item{width:47%}.edd-bundled-product-row .edd-bundled-product-price-assignment{width:23%;margin-right:3%}.edd-bundled-product-row .edd-bundled-product-actions{float:right}.edd_repeatable_upload_wrapper .edd_repeatable_upload_field_container{position:relative}.edd_upload_file{background:#fff;display:block;padding:2px 8px 2px;position:absolute;top:3px;right:7px}.edd_upload_field{padding-right:8em!important}textarea#edd-payment-note{width:100%;height:4em;margin:0}#edd-purchased-files .row .edd-purchased-files-list-wrapper .download{line-height:1.4}#edd-purchased-files .edd-purchased-files-list-wrapper .edd-purchased-option{color:#666}input[class*=edd-price-field]{padding:3px 5px;width:75px}#edd-order-download-quantity[type=number].small-text,#edd-order-download-tax[type=text].small-text,[class*=item_] [class*=edd-payment-details-download-][type=number].small-text{height:25px}#edd-order-download-quantity[type=number].small-text,.item_price .edd-payment-details-download-quantity[type=number].small-text{width:55px}#edd-order-download-tax[type=text].small-text,.item_tax .edd-payment-details-download-item-tax[type=number].small-text{width:75px}.edd_repeatable_product_wrapper .edd-select,.edd_repeatable_upload_wrapper .pricing select{min-width:100%}#edd_product_notes_field{display:block;margin:12px 0 0;height:4em;width:100%}.edd_remove_repeatable{border:none;cursor:pointer;display:inline-block;padding:0;overflow:hidden;margin:8px 0 0 0;text-indent:-9999px;width:10px;height:10px}.edd_remove_repeatable:active,.edd_remove_repeatable:focus,.edd_remove_repeatable:hover{background-position:-10px 0!important}#edd-edit-order-form .column{width:32%}.edd-edit-purchase-element[class*=columns-] ul li{padding-right:1%}#edd-edit-order-form .column:nth-child(2n+1),#edd-edit-order-form .columns-4 .column:nth-child(2n+1),#edd-edit-order-form .columns-5 .column:nth-child(3n+1){margin-right:0}#edd-edit-order-form input.large-text{width:90%}.edd-edit-purchase-element ul li.download{width:35%}.edd-edit-purchase-element ul li.item_price{width:15%}.edd-edit-purchase-element ul li.item_price.item_quantity{width:25%}.edd-edit-purchase-element ul li.item_tax{width:15%}.edd-edit-purchase-element ul li.price{width:20%}.edd-admin-box .label{font-weight:600}.edd-admin-box-inside{border-bottom:1px solid #eee;clear:both;padding:3px 12px;margin:0;word-break:break-word}.rtl .edd-admin-box-inside{padding:5px 10px 5px 0}.edd-admin-box-inside .strong{font-weight:600}.edd-payment-fees .fee-label{color:#666;font-weight:400}.edd-admin-box .right{float:right}.rtl .edd-admin-box .right{float:left;margin-left:10px}#edd-order-details .inside,#edd-order-update .inside{margin:0;padding:0}#edd-order-update input.edd_datepicker{width:180px}#edd-order-update input[type=number].edd-payment-time-hour,#edd-order-update input[type=number].edd-payment-time-min{width:50px}#edd-order-update .edd-tax-rate{color:#9c9c9c;font-style:italic}#edd-order-resend-receipt .inside{margin-top:11px}#edd-order-resend-receipt .edd-order-resend-receipt-addresses{margin-top:10px}.edd-admin-box-inside:last-child{border-bottom:0}#edd-edit-order-form .data-payment-key{word-break:break-all}.edd-order-update-box #major-publishing-actions .button-secondary{margin-right:10px}.edd-edit-purchase-element .edd-select-chosen{width:196px}#edd-customer-details .order-data-address input,#edd-customer-details .order-data-column p.data input,#edd-edit-order-form .column input,#edd-order-address-country-wrap select,.edd-edit-purchase-element ul{clear:both;display:block}#edd-customer-details .customer-info .column{width:49%}#edd-customer-details .actions{float:right}.edd-order-data input.small-text{margin:0}.edd-order-data input.med-text{margin:0;width:100px}#edd-order-update span.label{display:inline;width:50px}.edd-order-update-box .button-primary{margin-right:0}#edd-edit-order-form .column .description{padding-right:10px}#edd-edit-order-form .column,.edd-edit-purchase-element ul li{display:inline-block;line-height:1.4;position:relative;margin:0;vertical-align:middle}.edd-edit-purchase-element .row{padding:12px}.edd-edit-purchase-element .row:not(:last-child){border-bottom:1px solid #eee}.edd-edit-purchase-element .row:nth-child(odd):not(.header){background-color:#f9f9f9}.edd-edit-purchase-element .row.header{padding:6px 12px;font-weight:600;vertical-align:top}.edd-edit-purchase-element ul{font-size:0}.edd-edit-purchase-element ul li{font-size:13px}#edd-order-data .data span{color:#666;font-weight:600}.edd-edit-purchase-element .inside{padding:12px}.edd-edit-purchase-element .edd-purchased-download-title{font-size:14px;font-weight:500}.edd-edit-purchase-element .edd-purchased-download-title .deleted{color:#777}.edd-edit-purchase-element .edd-purchased-download-actions{color:#777;line-height:1.4}.edd-edit-purchase-element .edd-purchased-download-actions .edd-purchased-download-actions-label{font-weight:500}.edd-edit-purchase-element .edd-purchased-download-actions a{color:#777;font-size:12px}.edd-edit-purchase-element .edd-purchased-download-actions a:hover{color:#444}.edd-edit-purchase-element .edd-purchased-download-actions .edd-order-remove-download{color:#a00}.edd-edit-purchase-element .edd-purchased-download-actions .edd-order-remove-download:hover{color:red}#edd-order-recalc-total{float:right}#edd_products .edd-select,.edd_repeatable_product_wrapper .edd-select,.edd_repeatable_upload_wrapper .pricing select{min-width:100%;max-width:200px}.edd_repeatable_product_wrapper td{overflow:visible}.edd-payment-details-label-mobile{display:none}@media screen and (max-width:1284px){.edd-edit-purchase-element ul li.download{padding-bottom:15px;width:100%}.edd-edit-purchase-element .edd-purchased-download-title{font-size:16px}.edd-edit-purchase-element ul li.item_price{width:22%}.edd-edit-purchase-element ul li.item_price.item_quantity{width:35%}.edd-edit-purchase-element ul li.item_tax{width:25%}.edd-edit-purchase-element ul li.price{width:20%}.edd-edit-purchase-element .edd-purchased-download-actions{padding-top:10px}.edd-add-download-to-purchase-header,.edd-purchased-files-header{display:none}.edd-payment-details-label-mobile{display:block;font-weight:500;padding-bottom:6px}}@media screen and (max-width:1024px){.edd-edit-purchase-element ul li.item_price.item_quantity{width:40%}.edd-edit-purchase-element ul li.price{width:24%}.edd-edit-purchase-element .edd-purchased-download-actions{padding-top:15px}.edd-edit-purchase-element .edd-purchased-download-actions,.edd-edit-purchase-element .edd-purchased-download-actions a{font-size:14px}}@media screen and (max-width:782px){#edd-edit-order-form .column{width:49%}.edd-edit-purchase-element ul li.item_price,.edd-edit-purchase-element ul li.item_price.item_quantity{padding-bottom:10px}.edd-edit-purchase-element ul li.item_price.item_quantity{width:35%}.edd-edit-purchase-element ul li.item_tax,.edd-edit-purchase-element ul li.price{width:20%;padding-bottom:10px}.edd-payment-details-label-mobile{font-size:14px;font-weight:500}.edd-payment-details-download-amount,.edd-price-currency{font-size:16px}.order-data-column input[type=email]{padding:6px 10px}}@media screen and (max-width:600px){.edd-edit-purchase-element ul li.item_price,.edd-edit-purchase-element ul li.item_price.item_quantity,.edd-edit-purchase-element ul li.item_tax{width:100%;padding-bottom:20px}.edd-edit-purchase-element .edd-add-download-to-purchase ul li.item_tax,.edd-edit-purchase-element ul li.price{width:100%;padding-bottom:0}.edd-edit-purchase-element .edd-add-download-to-purchase-actions{padding-top:15px}#edd-edit-order-form .column{width:100%}}#edd_product_stats .label{display:inline-block}#edd_product_stats hr{border-style:solid;border-width:1px;border-color:#ccc #fff #fff #ccc}#edd_product_stats .product-earnings-stats:before,#edd_product_stats .product-sales-stats:before{color:#82878c;font:normal 20px/1 dashicons;display:inline-block;padding:0 2px 0 0;position:relative;top:0;left:-1px;speak:none;text-decoration:none!important;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#edd_product_stats .product-sales-stats:before{content:'\f174'}#edd_product_stats .product-earnings-stats:before{content:'\f239'}.edd_dashboard_widget table thead td{border-bottom:1px solid #ececec;color:#777}.edd_dashboard_widget .table_left{float:left;width:45%}.edd_dashboard_widget .table_right{float:right;width:45%}.edd_dashboard_widget .inside{font-size:12px}.edd_dashboard_widget td{padding:3px 0}.edd_dashboard_widget .b,.edd_dashboard_widget .t{line-height:1.5;vertical-align:middle}.edd_dashboard_widget .b{font-size:14px;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;padding-right:6px;width:auto}.edd_dashboard_widget .t{font-size:12px;padding-right:12px;color:#777;width:100%}.edd_dashboard_widget .label_heading{border-top:1px solid #ececec;color:#8f8f8f;font-family:Helvetica,Arial,sans-serif;font-size:12px;font-weight:400;display:block;padding-top:10px;margin:0 0 8px 12px}.edd_dashboard_widget .edd_dashboard_widget_subheading{border-top:1px solid #ececec;color:#8f8f8f;font-size:14px;padding-top:10px;margin:1em 0 0 0}.edd_dashboard_widget .edd_dashboard_widget_subheading+.table{margin:8px 0 0 0}.edd_dashboard_widget .edd_price_label{background:#00769c;border-radius:3px;color:#fff;font-size:10px;padding:2px 4px;margin-right:2px}.edd_dashboard_widget table{width:100%;margin-left:0;margin-bottom:1em}td.edd_order_label{width:80%}td.edd_order_price{text-align:right}@media handheld,only screen and (max-width:1000px){.edd_dashboard_widget .edd-recent-email{display:none}}#edd-dashboard-widgets-wrap .postbox h3{cursor:default}#edd-date-range-options,#edd-graphs-date-options{float:left}#edd-date-range-options span{float:left;line-height:24px;height:24px;margin-right:6px}.edd-import-export-form{position:relative}.edd-import-export-form .edd-progress{background:#ddd;position:absolute;bottom:15px;width:95%;height:15px}.edd-import-export-form .edd-progress div{background:#ccc;height:100%;width:0}.edd-import-export-form .notice-wrap{background-color:#f4f4f4;border-style:solid;border-width:1px 0;border-color:#eae9e9;padding:12px 12px 4px;overflow:auto;margin:20px -12px -23px;position:relative;width:100%}.edd-import-export-form .notice-wrap .spinner{margin:4px 10px 8px;float:right}.admin-color-fresh .edd-import-export-form .edd-progress div{background:#0073aa}.admin-color-light .edd-import-export-form .edd-progress div{background:#888}.admin-color-blue .edd-import-export-form .edd-progress div{background:#096484}.admin-color-coffee .edd-import-export-form .edd-progress div{background:#c7a589}.admin-color-ectoplasm .edd-import-export-form .edd-progress div{background:#a3b745}.admin-color-midnight .edd-import-export-form .edd-progress div{background:#e14d43}.admin-color-sunrise .edd-import-export-form .edd-progress div{background:#dd823b}#edd-graphs-filter label{vertical-align:inherit}#edd-graphs-filter .graph-option-section{float:left;line-height:2.5em;padding-right:5px}.edd-mix-totals{background-color:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);padding:10px}.edd-mix-chart{display:inline-block;width:49%;vertical-align:top}.edd-graph-notes{color:#9c9c9c}.edd-graph-notes span{display:block}.edd-pie-graph .legend{display:none}.edd-pie-legend{overflow:auto;margin-top:10px}.edd-legend-item-wrapper{color:#333;display:inline-block;font-size:8pt;padding:2px 5px 0 5px;width:48%;height:20px}.edd-legend-color{border:1px solid #cfcfcf;display:inline-block;margin-right:5px;width:20px;height:15px}.edd-pie-legend-item{display:inline-block;vertical-align:top;width:80%}[id*=edd-recapture-].button,[id*=edd-sendwp-].button{font-size:16px;height:auto;padding:8px 14px;margin:6px 0 0}[id*=edd-recapture-].button .dashicons,[id*=edd-sendwp-].button .dashicons{line-height:29px;margin-right:8px}[id*=edd-recapture-].button .edd-loading,[id*=edd-recapture-].button .edd-loading:after,[id*=edd-sendwp-].button .edd-loading,[id*=edd-sendwp-].button .edd-loading:after{border-radius:50%;display:inline-block;width:14px;height:14px}[id*=edd-recapture-].button .edd-loading,[id*=edd-sendwp-].button .edd-loading{position:relative;top:3px;margin-left:4px;box-shadow:0 0 2px rgba(0,0,0,.2)}[id*=edd-recapture-].button .edd-loading,[id*=edd-sendwp-].button .edd-loading{-webkit-animation:edd-spinning 1.1s infinite linear;animation:edd-spinning 1.1s infinite linear;border-top:2px solid rgba(255,255,255,.5);border-right:2px solid rgba(255,255,255,.5);border-bottom:2px solid rgba(255,255,255,.5);border-left:2px solid #fff;font-size:14px;-ms-transform:translateZ(0);transform:translateZ(0)}#edd-recapture-disconnect.button .edd-loading.dark,#edd-sendwp-disconnect.button .edd-loading.dark{border-top-color:rgba(0,0,0,.2);border-right-color:rgba(0,0,0,.2);border-bottom-color:rgba(0,0,0,.2);border-left-color:#666;box-shadow:none}.recapture-notice{position:relative}@-webkit-keyframes edd-spinning{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes edd-spinning{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}#edd_tax_rates{margin:1em 0 0}#edd_tax_rates .edd_tax_country *,#edd_tax_rates .edd_tax_state *{max-width:100%}#edd_tax_rates .edd_tax_country,#edd_tax_rates .edd_tax_state{width:180px}#edd_tax_rates .edd_tax_rate{width:80px}#edd_tax_rates th{padding:15px 10px}.wrap-licenses .form-table,.wrap-licenses caption,.wrap-licenses tbody,.wrap-licenses td,.wrap-licenses tfoot,.wrap-licenses th,.wrap-licenses thead,.wrap-licenses tr{display:block}.wrap-licenses .form-table tr{float:left;margin:0 15px 15px 0;background:#fff;border:1px solid #ccc;width:30.5%;max-width:350px;padding:14px;min-height:220px;position:relative;box-sizing:border-box}.wrap-licenses .form-table th{background:#f9f9f9;padding:14px;border-bottom:1px solid #ccc;margin:-14px -14px 20px;width:100%}.wrap-licenses .form-table td{padding:0}.wrap-licenses td input.regular-text{margin:0 0 8px;width:100%}.wrap-licenses .edd-license-data[class*=edd-license-]{position:absolute;background:#fafafa;padding:14px;border-top:1px solid #eee;margin:20px -14px -14px;min-height:67px;width:100%;bottom:14px;box-sizing:border-box}.wrap-licenses .edd-license-data[class*=edd-license-] a{color:#444}.wrap-licenses .edd-license-data[class*=edd-license-] a:hover{text-decoration:none}.wrap-licenses .edd-license-data.license-expires-soon-notice{background-color:#00a0d2;color:#fff;border-color:#00a0d2}.wrap-licenses .edd-license-data.edd-license-expired{background-color:#e24e4e;color:#fff;border-color:#e24e4e}.wrap-licenses .edd-license-data.edd-license-error,.wrap-licenses .edd-license-data.edd-license-invalid,.wrap-licenses .edd-license-data.edd-license-item_name_mismatch,.wrap-licenses .edd-license-data.edd-license-missing,.wrap-licenses .edd-license-data.edd-license-site_inactive{background-color:#ffebcd;border-color:#ffebcd}.wrap-licenses .edd-license-data p{font-size:13px;margin-top:0}.wrap-licenses .edd-license-data.edd-license-expired a,.wrap-licenses .edd-license-data.license-expires-soon-notice a{color:#fff}.wrap-licenses .edd-license-data.edd-license-expired a:hover,.wrap-licenses .edd-license-data.license-expires-soon-notice a:hover{text-decoration:none}.wrap-licenses p.submit{clear:both}#system-info-textarea{background:0 0;font-family:Menlo,Monaco,monospace;display:block;overflow:auto;white-space:pre;width:800px;height:400px}#TB_window #edd-add-download:active,#TB_window #edd-add-download:focus,#TB_window #edd-add-download:hover{color:#fff}.edd-graph .y1Axis{color:#edc240!important}.edd-graph .y2Axis{color:#afd8f8!important}.download_page_edd-tools .apikeys .column-user{width:192px}.edd-select-chosen{width:100%;max-width:300px}.chosen-container-multi .chosen-choices{background-image:none;border-color:#dfdfdf;-webkit-border-radius:3px;border-radius:3px}.chosen-container-multi .chosen-choices input{border-color:#dfdfdf;height:27px!important;margin:2px}.chosen-container .chosen-drop{border-color:#aaa;-webkit-box-shadow:1px 1px 2px rgba(0,0,0,.1);box-shadow:1px 1px 2px rgba(0,0,0,.1)}.chosen-container .search-field{float:none!important}.chosen-container .search-field input{width:90%!important}.chosen-container-active .chosen-choices{border-color:#aaa;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0;-webkit-box-shadow:1px 1px 2px rgba(0,0,0,.1);box-shadow:1px 1px 2px rgba(0,0,0,.1)}.download_page_edd-tools .tablenav .actions{overflow:visible}.edd_user_search_wrap{position:relative;overflow:visible}.edd_user_search_results{position:absolute;left:0;top:27px}.edd_user_search_results a.edd-ajax-user-cancel{position:absolute;right:6px;top:2px}.edd_user_search_results ul{background:#f0f0f0;border:1px solid #dfdfdf;overflow-y:scroll;padding:10px 10px 4px;margin:0;max-height:200px;width:300px}.wp-list-table .type-download .row-actions{color:#999}@media screen and (max-width:1100px){.edd-mix-chart{display:block;width:100%}.wrap-licenses .form-table tr{width:46%;max-width:none;min-height:230px}}@media screen and (max-width:782px){.post-type-download .nav-tab-wrapper a{font-size:70%;padding:2px 4px}.download_page_edd-tools .apikeys .column-user{width:80px}.license-expiration-date-notice,.license-lifetime-notice,.license-null{padding-left:0}[class^=license-] input[type=text]{margin-bottom:3px}}@media screen and (max-width:600px){.wrap-licenses .form-table tr{width:100%;min-height:230px}#edd-edit-order-form input.large-text{width:100%}}#edd-item-wrapper{background:#f5f5f5;border:1px solid #e5e5e5;webkit-box-shadow:0 1px 1px rgba(0,0,0,0.04);box-shadow:0 1px 1px rgba(0,0,0,.04);max-width:830px}#edd-item-wrapper:after{content:"";display:block;clear:both;visibility:hidden;font-size:0;height:0}#edd-item-tab-wrapper{float:left;width:18%;z-index:1}#edd-item-tab-wrapper-list{background:#fff;margin:0}#edd-item-tab-wrapper-list li{display:block;background-color:#eaeaea;color:#444;font-size:12px;border-bottom:1px solid #e5e5e5;margin-bottom:0;-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;word-wrap:break-word}#edd-item-tab-wrapper-list li a{display:block;padding:8px 10px 8px 6px}#edd-item-tab-wrapper-list li.active{display:block;background-color:#fff;padding:8px 10px 8px 6px}#edd-item-tab-wrapper-list .inactive a,#edd-item-tab-wrapper-list .inactive a:visited{background-color:#f5f5f5;color:#444;text-decoration:none}#edd-item-tab-wrapper-list .inactive a:hover{background-color:#fff}#edd-item-tab-wrapper-list .dashicons{color:#444;font-size:16px;min-width:24px;height:auto}#edd-item-card-wrapper .left{float:left}#edd-item-card-wrapper .right{float:right}#edd-item-card-wrapper input{font-weight:400}#edd-item-card-wrapper{background-color:#fff;border:1px solid #e5e5e5;display:inline-block;margin-left:-1px;min-height:200px;width:700px;z-index:2}.edd-item-has-tabs #edd-item-card-wrapper{border-width:0 0 0 1px;width:82%}#edd-item-card-wrapper .customer-section{border-bottom:1px solid #eee;margin-bottom:10px;overflow:auto}#edd-item-card-wrapper .customer-section table{margin-bottom:20px}#edd-item-card-wrapper>div{padding:0 20px}#edd-item-card-wrapper>div:first-child{padding-top:20px}#edd-item-card-wrapper>div:last-child{border:none;padding-bottom:20px}#edd-item-card-wrapper .avatar-wrap{padding-right:10px;text-align:center}#edd-item-card-wrapper .customer-id{font-size:24px;font-weight:600}#edd-item-card-wrapper .customer-main-wrapper input{width:200px}#edd-item-card-wrapper .customer-address-wrapper{margin-right:25px;max-width:33%;width:202px}#edd-item-card-wrapper .customer-address-wrapper select{width:200px}#edd-item-card-wrapper .customer-info{margin-top:5px;margin-bottom:10px;min-height:185px}#edd-item-card-wrapper .info-wrapper{min-height:125px;overflow:visible}#edd-item-card-wrapper a.delete{color:red;margin-right:5px;text-decoration:none}.customer-info .customer-name{font-size:24px;font-weight:600}.customer-edit-link a,.disconnect-user a{font-size:12px;font-weight:400;text-decoration:none}#customer-edit-actions{line-height:28px;margin-bottom:20px;text-align:center}#customer-edit-actions .button-secondary{margin-right:10px}#edd-item-card-wrapper .row-title{width:30%}#edd-item-card-wrapper .info-item{display:block;line-height:16px;padding-bottom:5px}#edd-item-card-wrapper .edit-item{display:none}#edd-item-card-wrapper .edd_user_search_results{left:1px;top:16px}#edd-item-card-wrapper .edd_user_search_results ul{width:200px}#edd-item-stats-wrapper{margin:0 auto;min-height:30px;text-align:center}#edd-item-stats-wrapper li{font-size:14px;float:left;line-height:22px;width:50%}#edd-item-stats-wrapper a{text-decoration:none}#edd-item-stats-wrapper .dashicons{color:#888}#edd-item-tables-wrapper table{text-align:center;width:100%}#edd-item-tables-wrapper th{text-align:center}#edd-item-tables-wrapper .downloads tr>td:first-child,#edd-item-tables-wrapper .downloads tr>th:first-child,#edd-item-tables-wrapper .emails tr>td:first-child,#edd-item-tables-wrapper .emails tr>th:first-child{text-align:left}#edd-item-tables-wrapper .downloads tr>td:only-child{text-align:center}#edd-item-tables-wrapper .emails .add-customer-email-row td{background-color:#f9f9f9;border-top:1px solid #e5e5e5}#edd-item-tables-wrapper .emails .primary-email-icon{font-size:13px;vertical-align:middle;line-height:1.5em}#edd-item-tables-wrapper .emails input{vertical-align:middle;margin:6px 0}#edd-item-tables-wrapper .emails .spinner{float:none}#edd-item-notes-wrapper{min-height:50px}.edd-item-notes-header img,.edd-item-notes-header span{font-weight:600;line-height:30px;vertical-align:middle}.customer-note-input{margin-bottom:5px;width:100%}#edd-customer-notes div:nth-of-type(even){background-color:#fcfcfc}.customer-note-wrapper{border-bottom:1px solid #f9f9f9;min-height:38px;padding:7px 0 7px 7px}.customer-note-wrapper span{display:block}.note-content-wrap{padding-top:7px}.delete-customer{text-align:center}#edd-item-card-wrapper .notice-container{padding-left:20px;padding-right:20px;margin-left:-20px;margin-right:-20px}#edd-item-card-wrapper .add-customer-email-wrapper>#add-customer-email{vertical-align:middle}@media screen and (max-width:810px) and (min-width:656px){.customer-info .customer-name{font-size:16px}#edd-item-card-wrapper .widefat td,.widefat th{padding:4px 6px;max-width:100px!important;display:table-cell}}@media screen and (max-width:781px){#edd-item-card-wrapper,#edd-item-tab-wrapper{margin:0;width:100%}#edd-item-tab-wrapper-list{background:#fff;margin:0}#edd-item-tab-wrapper-list li{float:left;display:inline;font-size:14px;box-sizing:border-box;border-width:0 1px 1px 0;border-style:solid;border-color:#e5e5e5;width:33.33333%}#edd-item-tab-wrapper-list li:nth-child(3n+3){border-width:0 0 1px 0}#edd-item-tab-wrapper-list .dashicons{font-size:18px}.edd-item-has-tabs #edd-item-card-wrapper{border-top:1px solid #e5e5e5;border-left:0;margin-top:-1px;width:100%}}@media screen and (max-width:656px){#edd-item-card-wrapper .customer-info{min-height:220px}.edd-item-info.customer-info{position:relative}#edd-item-card-wrapper .customer-address-wrapper{float:none;position:absolute;top:84px;left:110px;max-width:200px}#edd-item-card-wrapper .customer-main-wrapper{float:none;position:absolute;left:110px}.customer-info .customer-name{font-size:16px}#edd-item-card-wrapper #edd-item-stats-wrapper{padding-left:0;padding-right:0}#edd-item-card-wrapper .customer-section{margin-bottom:0}#edd-item-card-wrapper .widefat td,#edd-item-card-wrapper .widefat th{padding:4px 6px;max-width:100px!important;display:table-cell;overflow:hidden}#edd-item-card-wrapper .customer-id{font-size:16px}}@media screen and (max-width:480px){#edd-item-tab-wrapper-list li{width:50%}#edd-item-tab-wrapper-list li:nth-child(3n+3){border-width:0 1px 1px 0}#edd-item-tab-wrapper-list li:nth-child(even){border-width:0 0 1px 0}.edd-repeatable-row-actions,.edd-repeatable-row-title{text-align:left;width:100%}.edd-repeatable-row-title{padding-bottom:0}.edd-bundled-product-item-reorder,.edd-bundled-product-row .edd-bundled-product-item,.edd-bundled-product-row .edd-bundled-product-price-assignment,.edd-file-assignment,.edd-file-name,.edd-file-url,.edd-option-name,.edd-option-price,.edd_repeatable_default{float:none;text-align:left;width:100%!important;margin:10px 0}.edd-bundled-product-row .edd-bundled-product-actions{float:none}.edd-bundled-product-row .edd-bundled-product-item-reorder .edd-product-file-reorder{padding:0}#edd-payment-filters span{display:block;margin:2px 0}#edd-payment-filters a,.download_page_edd-reports .button{text-align:center}#edd-payment-date-filters span{display:block}#edd-payment-date-filters span>input{float:right}#edd-add-discount select[multiple] option,#edd-edit-discount select[multiple] option{height:20px}#edd-add-discount input[type=text],#edd-edit-discount input[type=text],#edd-payment-filters a,#edd-payment-filters input:not([type=radio]),#edd-payment-filters select,#system-info-textarea,.download_page_edd-reports .inside .button,.download_page_edd-reports .inside input[type=submit],.download_page_edd-reports .inside input[type=text],.download_page_edd-reports .inside select,.download_page_edd-settings .inside input[type=button],.download_page_edd-tools .inside input[type=submit],.download_page_edd-tools .inside input[type=text],.download_page_edd-tools .inside select{width:100%}#edd-add-discount select[multiple],#edd-edit-discount select[multiple],.download_page_edd-tools select[multiple]{height:200px!important}.download_page_edd-settings input[type=checkbox]{margin:2px 0}.post-type-download input[type=checkbox]{margin-left:2px}}.recount-stats-controls form{display:inline}.edd-recount-stats-descriptions span{display:none;line-height:24px}#edd-debug-log p.submit{margin:20px 0 0;padding:0}#edd-debug-log .edd-inline-button{margin-left:5px}.edd-settings-sidebar{padding-top:27px}.edd-settings-sidebar-content{background-color:#fff;text-align:center;border:1px solid #ddd;box-sizing:border-box;max-width:300px}.edd-settings-sidebar-content p{font-size:14px;line-height:1.5;margin-top:0}.edd-sidebar-header-section{background-color:#35495c;line-height:1;padding:26px 20px 24px;border-bottom:3px dashed #fafafa}.edd-sidebar-description-section{background-color:#fafafa;padding:16px 20px;border-bottom:1px solid #ddd}.edd-sidebar-description-section .edd-sidebar-description{margin:0}.edd-sidebar-coupon-section{font-size:14px;padding:16px 20px}.edd-sidebar-coupon-section label{display:block;line-height:1.4;margin-bottom:6px}.edd-sidebar-coupon-section label strong{color:#253b51;font-weight:700}.edd-sidebar-coupon-section input{background:#f4f7fa;font-size:22px;font-weight:600;text-align:center;padding:10px;border:2px dashed #2794da;border-radius:4px;margin-bottom:16px;box-shadow:none;width:100%}.edd-sidebar-coupon-section input:focus{border:2px dashed #2794da;box-shadow:none}.edd-settings-sidebar-content .edd-coupon-note{color:#6c7883;font-size:13px;font-style:italic;margin:0}.edd-settings-sidebar-content .edd-coupon-note a{color:#253b51}.edd-settings-sidebar-content .edd-coupon-note a:hover{text-decoration:none}.edd-sidebar-footer-section{background-color:#fafafa;padding:16px 20px;border-top:1px solid #ddd}.edd-sidebar-footer-section .edd-cta-button{display:block;background-color:#2794da;color:#fff;text-decoration:none;font-size:20px;font-weight:700;text-transform:uppercase;padding:17px 10px;border:none;border-radius:4px;width:100%;box-sizing:border-box;box-shadow:none;transition:background-color .2s}.edd-sidebar-footer-section .edd-cta-button:hover{background-color:#2386c5}@media all and (min-width:1080px){.edd-has-sidebar .edd-settings-content{float:left;width:67%}.edd-has-sidebar .edd-settings-sidebar{float:right;width:31%}}@media all and (min-width:1240px){.edd-has-sidebar .edd-settings-content{width:74%}.edd-has-sidebar .edd-settings-sidebar{width:23%}}.taxes-tab .edd-has-sidebar .edd-settings-content,.taxes-tab .edd-has-sidebar .edd-settings-sidebar{float:none;width:100%}.bfcm-promo-img-container{background-color:#35495c;width:100%;height:160px}.bfcm-code{color:#2794da;font-weight:700}.sale-ends{position:absolute;bottom:9px;right:14px;display:inline-block;color:#6c7883;font-size:12px;text-align:right;font-style:italic;width:150px}.edd-admin-notice-top-of-page{font-size:15px;line-height:1.4;color:#fff;margin-left:-20px;padding:12px 32px 12px 20px;background:#2d6ca2;display:none}@media screen and (min-width:783px){.edd-admin-notice-top-of-page{padding:10px 46px 10px 22px}}@media screen and (min-width:961px){.edd-admin-notice-top-of-page{text-align:center}}.edd-admin-notice-top-of-page a{color:#fff}.edd-admin-notice-top-of-page a:hover{text-decoration:none}.edd-admin-notice-top-of-page .button-link{position:absolute;top:48px;right:-1px;font-size:20px;color:#fff;font-weight:700;text-decoration:none;margin-left:5px;padding:6px 10px}.edd-admin-notice-top-of-page .button-link:active,.edd-admin-notice-top-of-page .button-link:focus,.edd-admin-notice-top-of-page .button-link:hover{color:#fff;text-decoration:none}@media screen and (min-width:601px){.edd-admin-notice-top-of-page .button-link{top:1px}}@media screen and (min-width:783px){.edd-admin-notice-top-of-page .button-link{right:9px}}
1
+ .edd-hidden{display:none}.edd-clearfix:after{content:".";display:block;height:0;text-indent:-9999px;visibility:hidden}.edd-notice .notice-dismiss,.edd-wrap a{text-decoration:none}a.edd-delete{color:#a00}a.edd-delete:hover{color:red}.download_page_edd-settings .form-table label{color:#666;font-size:14px;font-style:italic;margin:4px 0 0}.download_page_edd-settings .form-table input.small-text~label,.download_page_edd-settings .form-table input[type=checkbox]+label{display:inline}.download_page_edd-settings .form-table tr>th>h3,.download_page_edd-settings .form-table tr>th>strong{font-size:1.2em;font-weight:600;margin:0 auto}.edd-help-tip{cursor:help}.edd-ui-tooltip{position:absolute;background:#333!important;border-width:1px!important;border-radius:3px!important;box-shadow:1px 1px 2px 1px rgba(214,214,214,.5)!important;color:#dedede!important;max-width:300px!important;padding:7px!important;text-rendering:optimizeLegibility;text-shadow:none!important;z-index:9999!important}.download_page_edd-settings .edd-settings-payment-icon-wrapper{margin-right:10px;line-height:16px;height:16px;display:table}#edd-add-ons h2.nav-tab-wrapper{position:relative}.edd-tab-span{top:-6px;right:0;position:absolute}.edd-add-ons-footer{padding-top:10px}#edd-add-ons h2{margin:0 0 15px}.edd-add-ons-view-wrapper{height:50px}#edd-add-ons h2 .button-primary{position:absolute}#edd-add-ons .edd-extension{background:#fff;border:1px solid #ccc;float:left;padding:14px;position:relative;margin:0 15px 15px 0;width:320px;height:315px}#edd-add-ons .edd-extension h3{font-size:13px;margin:0 0 8px}#edd-add-ons .edd-extension .button-secondary{position:absolute;bottom:14px;left:14px}#edd-add-ons .edd-browse-all{clear:both;width:100%}#edd-add-ons .edd-extension .third-party{display:none}#edd-add-ons .edd-starter-package{background-color:#85c0e5;border-color:#62a9d7;color:#fff}#edd-add-ons .edd-starter-package h3{color:#fff}#edd-add-ons .edd-extension .wp-post-image{width:100%;height:auto;vertical-align:bottom}#edd-products{height:100px;min-width:200px}#edd-add-discount input[type=text],#edd-edit-discount input[type=text]{width:300px}#edd-add-discount input.edd-price-field,#edd-edit-discount input.edd-price-field{padding:3px 5px;width:75px}.download_page_edd-addons .wrap .wp-heading-inline,.edit-php.post-type-download .wrap .wp-heading-inline{display:none}.download_page_edd-addons .wrap>.page-title-action,.edit-php.post-type-download .wrap>.page-title-action{display:none}.download_page_edd-addons .wrap .nav-tab-wrapper .page-title-action,.edit-php.post-type-download .wrap .nav-tab-wrapper .page-title-action{top:7px;margin-left:5px}#edd-payment-filters{background:#f5f5f5;clear:both;background-image:-webkit-gradient(linear,left bottom,left top,from(#f5f5f5),to(#fafafa));background-image:-webkit-linear-gradient(bottom,#f5f5f5,#fafafa);background-image:-moz-linear-gradient(bottom,#f5f5f5,#fafafa);background-image:-o-linear-gradient(bottom,#f5f5f5,#fafafa);background-image:linear-gradient(to top,#f5f5f5,#fafafa);border-color:#dfdfdf;border-width:1px;border-style:solid;border-radius:3px;font-size:13px;line-height:2.1em;overflow:auto;padding:12px;margin:8px 0}#edd-payments-filter ul.subsubsub{margin-bottom:8px}#edd-payment-filters p{color:#777}#edd-payment-date-filters input{vertical-align:middle}tr.status-refunded td{background:#cecece;border-top-color:#ccc}.wp-list-table.downloads th#ID{width:80px}.wp-list-table.downloads th#details{width:130px}.wp-list-table.downloads th#date{width:140px}.wp-list-table.downloads th#user{width:130px}.edd-mobile-link{line-height:32px;vertical-align:middle}.edd-mobile-link img{max-width:80%;height:auto;float:left}@media handheld,only screen and (max-width:640px){.wp-list-table.downloads th{width:auto!important}}.download_page_edd-payment-history .ui-dialog .ui-dialog-titlebar-close span{margin-left:-8px;margin-top:-8px}#edd-download-link-textarea{width:100%}.edd_files_name_label{width:225px;float:left}.edd_files_url_label{width:220px;float:left}#postbox-container-1 .edd_files_name_label{width:80px}#postbox-container-1 .edd_files_url_label{width:80px}.edd-add-repeatable-row{margin:10px 0}.edd-add-repeatable-row .submit{padding:0!important}.edd_repeatable_upload_wrapper:not(:first-child),.edd_variable_prices_wrapper:not(:first-child){margin-top:12px}.edd-repeatable-row-actions{color:#777;font-size:12px}.edd-repeatable-row-actions a{text-decoration:none;width:auto;cursor:pointer;vertical-align:middle}.edd-repeatable-row-actions .toggle-custom-price-option-section{color:#777}.edd-repeatable-row-actions .toggle-custom-price-option-section:hover{color:#444}.edd-bundle-products-header,.edd-repeatable-row-header{clear:both;background:#f1f1f1;border:1px solid #e5e5e5}.edd-repeatable-row-header{cursor:move}.edd-bundled-product-row:after,.edd-bundled-product-row:before,.edd-repeatable-row-header:after,.edd-repeatable-row-header:before{content:'';display:table}.edd-bundled-product-row:after,.edd-repeatable-row-header:after{clear:both}.edd-repeatable-row-title{float:left;font-weight:600}.edd-bundled-product-item-reorder .edd-product-file-reorder{color:#e5e5e5;font-family:dashicons;content:"\f545";font-size:18px;font-weight:300;margin-left:4px;vertical-align:top;transition:.2s color}.edd-bundled-product-item-reorder .edd-product-file-reorder:hover{color:#bbb}.edd-repeatable-row-actions,.edd-repeatable-row-title{padding:8px;box-sizing:border-box}.edd-repeatable-row-actions{float:right;text-align:right;padding:8px}.edd-bundled-product-row .edd-remove-row,.edd-repeatable-row-actions .edd-remove-row{font-size:12px;width:auto;cursor:pointer}.edd-bundled-product-row,.edd-repeatable-row-standard-fields{background:#f9f9f9;padding:8px;border-width:0 1px 1px;border-style:solid;border-color:#e5e5e5}.edd-repeatable-row-setting-label{display:block;margin-bottom:4px}.edd-repeatable-row-setting-label .edd-help-tip{display:inline-block;margin-left:4px}.edd-bundled-product-row .edd-bundled-product-actions,.edd-bundled-product-row .edd-bundled-product-item,.edd-bundled-product-row .edd-bundled-product-item-reorder,.edd-bundled-product-row .edd-bundled-product-price-assignment,.edd-file-assignment,.edd-file-name,.edd-file-url,.edd-option-name,.edd-option-price,.edd_repeatable_default{display:inline-block;vertical-align:top}.edd-option-name{width:38%;margin-right:5%}.edd-option-price{min-width:100px}.edd_repeatable_default{text-align:center;min-width:80px}.edd-file-name{width:18%;margin-right:3%}.edd-file-url{width:65%}.edd-repeatable-row-standard-fields.has-variable-pricing .edd-file-url{width:38%;margin-right:5%}.edd-file-assignment{width:27%}.edd-file-assignment .edd-repeatable-row-setting-label{margin-bottom:0}.edd-custom-price-option-sections-wrap{display:none;border-width:0 1px 1px;border-style:solid;border-color:#e5e5e5;box-sizing:border-box;width:100%}.edd-custom-price-option-section{display:block;padding:10px 8px;border-bottom:1px solid rgba(222,222,222,.3)}.edd-custom-price-option-section:last-child{border-bottom:none}label.edd_prices_shipping{display:none!important}.edd-custom-price-option-section-title{display:block;font-size:14px;font-weight:600;padding:0 0 10px}.edd-custom-price-option-section>:not(.edd-custom-price-option-section-title){display:inline-block;padding-right:20px;vertical-align:top;margin-bottom:4px}.edd-custom-price-option-section>:not(.edd-custom-price-option-section-title) label{display:block;margin-bottom:2px}.edd-bundle-products-header{font-weight:600;padding:8px}.edd-bundled-product-row .edd-bundled-product-item-reorder{min-width:30px;margin-right:8px}.edd-bundled-product-row .edd-bundled-product-item-reorder .edd-product-file-reorder{font-size:20px;font-weight:300;padding:16px 4px 0;cursor:move}.edd-bundled-product-row .edd-bundled-product-item{width:60%;margin-right:3%}.edd-bundled-product-row.has-variable-pricing .edd-bundled-product-item{width:47%}.edd-bundled-product-row .edd-bundled-product-price-assignment{width:23%;margin-right:3%}.edd-bundled-product-row .edd-bundled-product-actions{float:right}.edd_repeatable_upload_wrapper .edd_repeatable_upload_field_container{position:relative}.edd_upload_file{background:#fff;display:block;padding:2px 8px 2px;position:absolute;top:3px;right:7px}.edd_upload_field{padding-right:8em!important}textarea#edd-payment-note{width:100%;height:4em;margin:0}#edd-purchased-files .row .edd-purchased-files-list-wrapper .download{line-height:1.4}#edd-purchased-files .edd-purchased-files-list-wrapper .edd-purchased-option{color:#666}input[class*=edd-price-field]{padding:3px 5px;width:75px}#edd-order-download-quantity[type=number].small-text,#edd-order-download-tax[type=text].small-text,[class*=item_] [class*=edd-payment-details-download-][type=number].small-text{height:25px}#edd-order-download-quantity[type=number].small-text,.item_price .edd-payment-details-download-quantity[type=number].small-text{width:55px}#edd-order-download-tax[type=text].small-text,.item_tax .edd-payment-details-download-item-tax[type=number].small-text{width:75px}.edd_repeatable_product_wrapper .edd-select,.edd_repeatable_upload_wrapper .pricing select{min-width:100%}#edd_product_notes_field{display:block;margin:12px 0 0;height:4em;width:100%}.edd_remove_repeatable{border:none;cursor:pointer;display:inline-block;padding:0;overflow:hidden;margin:8px 0 0 0;text-indent:-9999px;width:10px;height:10px}.edd_remove_repeatable:active,.edd_remove_repeatable:focus,.edd_remove_repeatable:hover{background-position:-10px 0!important}#edd-edit-order-form .column{width:32%}.edd-edit-purchase-element[class*=columns-] ul li{padding-right:1%}#edd-edit-order-form .column:nth-child(2n+1),#edd-edit-order-form .columns-4 .column:nth-child(2n+1),#edd-edit-order-form .columns-5 .column:nth-child(3n+1){margin-right:0}#edd-edit-order-form input.large-text{width:90%}.edd-edit-purchase-element ul li.download{width:35%}.edd-edit-purchase-element ul li.item_price{width:15%}.edd-edit-purchase-element ul li.item_price.item_quantity{width:25%}.edd-edit-purchase-element ul li.item_tax{width:15%}.edd-edit-purchase-element ul li.price{width:20%}.edd-admin-box .label{font-weight:600}.edd-admin-box-inside{border-bottom:1px solid #eee;clear:both;padding:3px 12px;margin:0;word-break:break-word}.rtl .edd-admin-box-inside{padding:5px 10px 5px 0}.edd-admin-box-inside .strong{font-weight:600}.edd-payment-fees .fee-label{color:#666;font-weight:400}.edd-admin-box .right{float:right}.rtl .edd-admin-box .right{float:left;margin-left:10px}#edd-order-details .inside,#edd-order-update .inside{margin:0;padding:0}#edd-order-update input.edd_datepicker{width:180px}#edd-order-update input[type=number].edd-payment-time-hour,#edd-order-update input[type=number].edd-payment-time-min{width:50px}#edd-order-update .edd-tax-rate{color:#9c9c9c;font-style:italic}#edd-order-resend-receipt .inside{margin-top:11px}#edd-order-resend-receipt .edd-order-resend-receipt-addresses{margin-top:10px}.edd-admin-box-inside:last-child{border-bottom:0}#edd-edit-order-form .data-payment-key{word-break:break-all}.edd-order-update-box #major-publishing-actions .button-secondary{margin-right:10px}.edd-edit-purchase-element .edd-select-chosen{width:196px}#edd-customer-details .order-data-address input,#edd-customer-details .order-data-column p.data input,#edd-edit-order-form .column input,#edd-order-address-country-wrap select,.edd-edit-purchase-element ul{clear:both;display:block}#edd-customer-details .customer-info .column{width:49%}#edd-customer-details .actions{float:right}.edd-order-data input.small-text{margin:0}.edd-order-data input.med-text{margin:0;width:100px}#edd-order-update span.label{display:inline;width:50px}.edd-order-update-box .button-primary{margin-right:0}#edd-edit-order-form .column .description{padding-right:10px}#edd-edit-order-form .column,.edd-edit-purchase-element ul li{display:inline-block;line-height:1.4;position:relative;margin:0;vertical-align:middle}.edd-edit-purchase-element .row{padding:12px}.edd-edit-purchase-element .row:not(:last-child){border-bottom:1px solid #eee}.edd-edit-purchase-element .row:nth-child(odd):not(.header){background-color:#f9f9f9}.edd-edit-purchase-element .row.header{padding:6px 12px;font-weight:600;vertical-align:top}.edd-edit-purchase-element ul{font-size:0}.edd-edit-purchase-element ul li{font-size:13px}#edd-order-data .data span{color:#666;font-weight:600}.edd-edit-purchase-element .inside{padding:12px}.edd-edit-purchase-element .edd-purchased-download-title{font-size:14px;font-weight:500}.edd-edit-purchase-element .edd-purchased-download-title .deleted{color:#777}.edd-edit-purchase-element .edd-purchased-download-actions{color:#777;line-height:1.4}.edd-edit-purchase-element .edd-purchased-download-actions .edd-purchased-download-actions-label{font-weight:500}.edd-edit-purchase-element .edd-purchased-download-actions a{color:#777;font-size:12px}.edd-edit-purchase-element .edd-purchased-download-actions a:hover{color:#444}.edd-edit-purchase-element .edd-purchased-download-actions .edd-order-remove-download{color:#a00}.edd-edit-purchase-element .edd-purchased-download-actions .edd-order-remove-download:hover{color:red}#edd-order-recalc-total{float:right}#edd_products .edd-select,.edd_repeatable_product_wrapper .edd-select,.edd_repeatable_upload_wrapper .pricing select{min-width:100%;max-width:200px}.edd_repeatable_product_wrapper td{overflow:visible}.edd-payment-details-label-mobile{display:none}@media screen and (max-width:1284px){.edd-edit-purchase-element ul li.download{padding-bottom:15px;width:100%}.edd-edit-purchase-element .edd-purchased-download-title{font-size:16px}.edd-edit-purchase-element ul li.item_price{width:22%}.edd-edit-purchase-element ul li.item_price.item_quantity{width:35%}.edd-edit-purchase-element ul li.item_tax{width:25%}.edd-edit-purchase-element ul li.price{width:20%}.edd-edit-purchase-element .edd-purchased-download-actions{padding-top:10px}.edd-add-download-to-purchase-header,.edd-purchased-files-header{display:none}.edd-payment-details-label-mobile{display:block;font-weight:500;padding-bottom:6px}}@media screen and (max-width:1024px){.edd-edit-purchase-element ul li.item_price.item_quantity{width:40%}.edd-edit-purchase-element ul li.price{width:24%}.edd-edit-purchase-element .edd-purchased-download-actions{padding-top:15px}.edd-edit-purchase-element .edd-purchased-download-actions,.edd-edit-purchase-element .edd-purchased-download-actions a{font-size:14px}}@media screen and (max-width:782px){#edd-edit-order-form .column{width:49%}.edd-edit-purchase-element ul li.item_price,.edd-edit-purchase-element ul li.item_price.item_quantity{padding-bottom:10px}.edd-edit-purchase-element ul li.item_price.item_quantity{width:35%}.edd-edit-purchase-element ul li.item_tax,.edd-edit-purchase-element ul li.price{width:20%;padding-bottom:10px}.edd-payment-details-label-mobile{font-size:14px;font-weight:500}.edd-payment-details-download-amount,.edd-price-currency{font-size:16px}.order-data-column input[type=email]{padding:6px 10px}}@media screen and (max-width:600px){.edd-edit-purchase-element ul li.item_price,.edd-edit-purchase-element ul li.item_price.item_quantity,.edd-edit-purchase-element ul li.item_tax{width:100%;padding-bottom:20px}.edd-edit-purchase-element .edd-add-download-to-purchase ul li.item_tax,.edd-edit-purchase-element ul li.price{width:100%;padding-bottom:0}.edd-edit-purchase-element .edd-add-download-to-purchase-actions{padding-top:15px}#edd-edit-order-form .column{width:100%}}#edd_product_stats .label{display:inline-block}#edd_product_stats hr{border-style:solid;border-width:1px;border-color:#ccc #fff #fff #ccc}#edd_product_stats .product-earnings-stats:before,#edd_product_stats .product-sales-stats:before{color:#82878c;font:normal 20px/1 dashicons;display:inline-block;padding:0 2px 0 0;position:relative;top:0;left:-1px;speak:none;text-decoration:none!important;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#edd_product_stats .product-sales-stats:before{content:'\f174'}#edd_product_stats .product-earnings-stats:before{content:'\f239'}.edd_dashboard_widget table thead td{border-bottom:1px solid #ececec;color:#777}.edd_dashboard_widget .table_left{float:left;width:45%}.edd_dashboard_widget .table_right{float:right;width:45%}.edd_dashboard_widget .inside{font-size:12px}.edd_dashboard_widget td{padding:3px 0}.edd_dashboard_widget .b,.edd_dashboard_widget .t{line-height:1.5;vertical-align:middle}.edd_dashboard_widget .b{font-size:14px;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;padding-right:6px;width:auto}.edd_dashboard_widget .t{font-size:12px;padding-right:12px;color:#777;width:100%}.edd_dashboard_widget .label_heading{border-top:1px solid #ececec;color:#8f8f8f;font-family:Helvetica,Arial,sans-serif;font-size:12px;font-weight:400;display:block;padding-top:10px;margin:0 0 8px 12px}.edd_dashboard_widget .edd_dashboard_widget_subheading{border-top:1px solid #ececec;color:#8f8f8f;font-size:14px;padding-top:10px;margin:1em 0 0 0}.edd_dashboard_widget .edd_dashboard_widget_subheading+.table{margin:8px 0 0 0}.edd_dashboard_widget .edd_price_label{background:#00769c;border-radius:3px;color:#fff;font-size:10px;padding:2px 4px;margin-right:2px}.edd_dashboard_widget table{width:100%;margin-left:0;margin-bottom:1em}td.edd_order_label{width:80%}td.edd_order_price{text-align:right}@media handheld,only screen and (max-width:1000px){.edd_dashboard_widget .edd-recent-email{display:none}}#edd-dashboard-widgets-wrap .postbox h3{cursor:default}#edd-date-range-options,#edd-graphs-date-options{float:left}#edd-date-range-options span{float:left;line-height:24px;height:24px;margin-right:6px}.edd-import-export-form{position:relative}.edd-import-export-form .edd-progress{background:#ddd;position:absolute;bottom:15px;width:95%;height:15px}.edd-import-export-form .edd-progress div{background:#ccc;height:100%;width:0}.edd-import-export-form .notice-wrap{background-color:#f4f4f4;border-style:solid;border-width:1px 0;border-color:#eae9e9;padding:12px 12px 4px;overflow:auto;margin:20px -12px -23px;position:relative;width:100%}.edd-import-export-form .notice-wrap .spinner{margin:4px 10px 8px;float:right}.admin-color-fresh .edd-import-export-form .edd-progress div{background:#0073aa}.admin-color-light .edd-import-export-form .edd-progress div{background:#888}.admin-color-blue .edd-import-export-form .edd-progress div{background:#096484}.admin-color-coffee .edd-import-export-form .edd-progress div{background:#c7a589}.admin-color-ectoplasm .edd-import-export-form .edd-progress div{background:#a3b745}.admin-color-midnight .edd-import-export-form .edd-progress div{background:#e14d43}.admin-color-sunrise .edd-import-export-form .edd-progress div{background:#dd823b}#edd-graphs-filter label{vertical-align:inherit}#edd-graphs-filter .graph-option-section{float:left;line-height:2.5em;padding-right:5px}.edd-mix-totals{background-color:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);padding:10px}.edd-mix-chart{display:inline-block;width:49%;vertical-align:top}.edd-graph-notes{color:#9c9c9c}.edd-graph-notes span{display:block}.edd-pie-graph .legend{display:none}.edd-pie-legend{overflow:auto;margin-top:10px}.edd-legend-item-wrapper{color:#333;display:inline-block;font-size:8pt;padding:2px 5px 0 5px;width:48%;height:20px}.edd-legend-color{border:1px solid #cfcfcf;display:inline-block;margin-right:5px;width:20px;height:15px}.edd-pie-legend-item{display:inline-block;vertical-align:top;width:80%}[id*=edd-recapture-].button,[id*=edd-sendwp-].button{font-size:16px;height:auto;padding:8px 14px;margin:6px 0 0}[id*=edd-recapture-].button .dashicons,[id*=edd-sendwp-].button .dashicons{line-height:29px;margin-right:8px}[id*=edd-recapture-].button .edd-loading,[id*=edd-recapture-].button .edd-loading:after,[id*=edd-sendwp-].button .edd-loading,[id*=edd-sendwp-].button .edd-loading:after{border-radius:50%;display:inline-block;width:14px;height:14px}[id*=edd-recapture-].button .edd-loading,[id*=edd-sendwp-].button .edd-loading{position:relative;top:3px;margin-left:4px;box-shadow:0 0 2px rgba(0,0,0,.2)}[id*=edd-recapture-].button .edd-loading,[id*=edd-sendwp-].button .edd-loading{-webkit-animation:edd-spinning 1.1s infinite linear;animation:edd-spinning 1.1s infinite linear;border-top:2px solid rgba(255,255,255,.5);border-right:2px solid rgba(255,255,255,.5);border-bottom:2px solid rgba(255,255,255,.5);border-left:2px solid #fff;font-size:14px;-ms-transform:translateZ(0);transform:translateZ(0)}#edd-recapture-disconnect.button .edd-loading.dark,#edd-sendwp-disconnect.button .edd-loading.dark{border-top-color:rgba(0,0,0,.2);border-right-color:rgba(0,0,0,.2);border-bottom-color:rgba(0,0,0,.2);border-left-color:#666;box-shadow:none}.recapture-notice{position:relative}@-webkit-keyframes edd-spinning{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes edd-spinning{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}#edd_tax_rates{margin:1em 0 0}#edd_tax_rates .edd_tax_country *,#edd_tax_rates .edd_tax_state *{max-width:100%}#edd_tax_rates .edd_tax_country,#edd_tax_rates .edd_tax_state{width:180px}#edd_tax_rates .edd_tax_rate{width:80px}#edd_tax_rates th{padding:15px 10px}.wrap-licenses .form-table,.wrap-licenses caption,.wrap-licenses tbody,.wrap-licenses td,.wrap-licenses tfoot,.wrap-licenses th,.wrap-licenses thead,.wrap-licenses tr{display:block}.wrap-licenses .form-table tr{float:left;margin:0 15px 15px 0;background:#fff;border:1px solid #ccc;width:30.5%;max-width:350px;padding:14px;min-height:220px;position:relative;box-sizing:border-box}.wrap-licenses .form-table th{background:#f9f9f9;padding:14px;border-bottom:1px solid #ccc;margin:-14px -14px 20px;width:100%}.wrap-licenses .form-table td{padding:0}.wrap-licenses td input.regular-text{margin:0 0 8px;width:100%}.wrap-licenses .edd-license-data[class*=edd-license-]{position:absolute;background:#fafafa;padding:14px;border-top:1px solid #eee;margin:20px -14px -14px;min-height:67px;width:100%;bottom:14px;box-sizing:border-box}.wrap-licenses .edd-license-data[class*=edd-license-] a{color:#444}.wrap-licenses .edd-license-data[class*=edd-license-] a:hover{text-decoration:none}.wrap-licenses .edd-license-data.license-expires-soon-notice{background-color:#00a0d2;color:#fff;border-color:#00a0d2}.wrap-licenses .edd-license-data.edd-license-expired{background-color:#e24e4e;color:#fff;border-color:#e24e4e}.wrap-licenses .edd-license-data.edd-license-error,.wrap-licenses .edd-license-data.edd-license-invalid,.wrap-licenses .edd-license-data.edd-license-item_name_mismatch,.wrap-licenses .edd-license-data.edd-license-missing,.wrap-licenses .edd-license-data.edd-license-site_inactive{background-color:#ffebcd;border-color:#ffebcd}.wrap-licenses .edd-license-data p{font-size:13px;margin-top:0}.wrap-licenses .edd-license-data.edd-license-expired a,.wrap-licenses .edd-license-data.license-expires-soon-notice a{color:#fff}.wrap-licenses .edd-license-data.edd-license-expired a:hover,.wrap-licenses .edd-license-data.license-expires-soon-notice a:hover{text-decoration:none}.wrap-licenses p.submit{clear:both}#system-info-textarea{background:0 0;font-family:Menlo,Monaco,monospace;display:block;overflow:auto;white-space:pre;width:800px;height:400px}#TB_window #edd-add-download:active,#TB_window #edd-add-download:focus,#TB_window #edd-add-download:hover{color:#fff}.edd-graph .y1Axis{color:#edc240!important}.edd-graph .y2Axis{color:#afd8f8!important}.download_page_edd-tools .apikeys .column-user{width:192px}.edd-select-chosen{width:100%;max-width:300px}.chosen-container-multi .chosen-choices{background-image:none;border-color:#dfdfdf;-webkit-border-radius:3px;border-radius:3px}.chosen-container-multi .chosen-choices input{border-color:#dfdfdf;height:27px!important;margin:2px}.chosen-container .chosen-drop{border-color:#aaa;-webkit-box-shadow:1px 1px 2px rgba(0,0,0,.1);box-shadow:1px 1px 2px rgba(0,0,0,.1)}.chosen-container .search-field{float:none!important}.chosen-container .search-field input{width:90%!important}.chosen-container-active .chosen-choices{border-color:#aaa;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0;-webkit-box-shadow:1px 1px 2px rgba(0,0,0,.1);box-shadow:1px 1px 2px rgba(0,0,0,.1)}.download_page_edd-tools .tablenav .actions{overflow:visible}.edd_user_search_wrap{position:relative;overflow:visible}.edd_user_search_results{position:absolute;left:0;top:27px}.edd_user_search_results a.edd-ajax-user-cancel{position:absolute;right:6px;top:2px}.edd_user_search_results ul{background:#f0f0f0;border:1px solid #dfdfdf;overflow-y:scroll;padding:10px 10px 4px;margin:0;max-height:200px;width:300px}.wp-list-table .type-download .row-actions{color:#999}@media screen and (max-width:1100px){.edd-mix-chart{display:block;width:100%}.wrap-licenses .form-table tr{width:46%;max-width:none;min-height:230px}}@media screen and (max-width:782px){.post-type-download .nav-tab-wrapper a{font-size:70%;padding:2px 4px}.download_page_edd-tools .apikeys .column-user{width:80px}.license-expiration-date-notice,.license-lifetime-notice,.license-null{padding-left:0}[class^=license-] input[type=text]{margin-bottom:3px}}@media screen and (max-width:600px){.wrap-licenses .form-table tr{width:100%;min-height:230px}#edd-edit-order-form input.large-text{width:100%}}#edd-item-wrapper{background:#f5f5f5;border:1px solid #e5e5e5;webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);box-shadow:0 1px 1px rgba(0,0,0,.04);max-width:830px}#edd-item-wrapper:after{content:"";display:block;clear:both;visibility:hidden;font-size:0;height:0}#edd-item-tab-wrapper{float:left;width:18%;z-index:1}#edd-item-tab-wrapper-list{background:#fff;margin:0}#edd-item-tab-wrapper-list li{display:block;background-color:#eaeaea;color:#444;font-size:12px;border-bottom:1px solid #e5e5e5;margin-bottom:0;-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;word-wrap:break-word}#edd-item-tab-wrapper-list li a{display:block;padding:8px 10px 8px 6px}#edd-item-tab-wrapper-list li.active{display:block;background-color:#fff;padding:8px 10px 8px 6px}#edd-item-tab-wrapper-list .inactive a,#edd-item-tab-wrapper-list .inactive a:visited{background-color:#f5f5f5;color:#444;text-decoration:none}#edd-item-tab-wrapper-list .inactive a:hover{background-color:#fff}#edd-item-tab-wrapper-list .dashicons{color:#444;font-size:16px;min-width:24px;height:auto}#edd-item-card-wrapper .left{float:left}#edd-item-card-wrapper .right{float:right}#edd-item-card-wrapper input{font-weight:400}#edd-item-card-wrapper{background-color:#fff;border:1px solid #e5e5e5;display:inline-block;margin-left:-1px;min-height:200px;width:700px;z-index:2}.edd-item-has-tabs #edd-item-card-wrapper{border-width:0 0 0 1px;width:82%}#edd-item-card-wrapper .customer-section{border-bottom:1px solid #eee;margin-bottom:10px;overflow:auto}#edd-item-card-wrapper .customer-section table{margin-bottom:20px}#edd-item-card-wrapper>div{padding:0 20px}#edd-item-card-wrapper>div:first-child{padding-top:20px}#edd-item-card-wrapper>div:last-child{border:none;padding-bottom:20px}#edd-item-card-wrapper .avatar-wrap{padding-right:10px;text-align:center}#edd-item-card-wrapper .customer-id{font-size:24px;font-weight:600}#edd-item-card-wrapper .customer-main-wrapper input{width:200px}#edd-item-card-wrapper .customer-address-wrapper{margin-right:25px;max-width:33%;width:202px}#edd-item-card-wrapper .customer-address-wrapper select{width:200px}#edd-item-card-wrapper .customer-info{margin-top:5px;margin-bottom:10px;min-height:185px}#edd-item-card-wrapper .info-wrapper{min-height:125px;overflow:visible}#edd-item-card-wrapper a.delete{color:red;margin-right:5px;text-decoration:none}.customer-info .customer-name{font-size:24px;font-weight:600}.customer-edit-link a,.disconnect-user a{font-size:12px;font-weight:400;text-decoration:none}#customer-edit-actions{line-height:28px;margin-bottom:20px;text-align:center}#customer-edit-actions .button-secondary{margin-right:10px}#edd-item-card-wrapper .row-title{width:30%}#edd-item-card-wrapper .info-item{display:block;line-height:16px;padding-bottom:5px}#edd-item-card-wrapper .edit-item{display:none}#edd-item-card-wrapper .edd_user_search_results{left:1px;top:16px}#edd-item-card-wrapper .edd_user_search_results ul{width:200px}#edd-item-stats-wrapper{margin:0 auto;min-height:30px;text-align:center}#edd-item-stats-wrapper li{font-size:14px;float:left;line-height:22px;width:50%}#edd-item-stats-wrapper a{text-decoration:none}#edd-item-stats-wrapper .dashicons{color:#888}#edd-item-tables-wrapper table{text-align:center;width:100%}#edd-item-tables-wrapper th{text-align:center}#edd-item-tables-wrapper .downloads tr>td:first-child,#edd-item-tables-wrapper .downloads tr>th:first-child,#edd-item-tables-wrapper .emails tr>td:first-child,#edd-item-tables-wrapper .emails tr>th:first-child{text-align:left}#edd-item-tables-wrapper .downloads tr>td:only-child{text-align:center}#edd-item-tables-wrapper .emails .add-customer-email-row td{background-color:#f9f9f9;border-top:1px solid #e5e5e5}#edd-item-tables-wrapper .emails .primary-email-icon{font-size:13px;vertical-align:middle;line-height:1.5em}#edd-item-tables-wrapper .emails input{vertical-align:middle;margin:6px 0}#edd-item-tables-wrapper .emails .spinner{float:none}#edd-item-notes-wrapper{min-height:50px}.edd-item-notes-header img,.edd-item-notes-header span{font-weight:600;line-height:30px;vertical-align:middle}.customer-note-input{margin-bottom:5px;width:100%}#edd-customer-notes div:nth-of-type(even){background-color:#fcfcfc}.customer-note-wrapper{border-bottom:1px solid #f9f9f9;min-height:38px;padding:7px 0 7px 7px}.customer-note-wrapper span{display:block}.note-content-wrap{padding-top:7px}.delete-customer{text-align:center}#edd-item-card-wrapper .notice-container{padding-left:20px;padding-right:20px;margin-left:-20px;margin-right:-20px}#edd-item-card-wrapper .add-customer-email-wrapper>#add-customer-email{vertical-align:middle}@media screen and (max-width:810px) and (min-width:656px){.customer-info .customer-name{font-size:16px}#edd-item-card-wrapper .widefat td,.widefat th{padding:4px 6px;max-width:100px!important;display:table-cell}}@media screen and (max-width:781px){#edd-item-card-wrapper,#edd-item-tab-wrapper{margin:0;width:100%}#edd-item-tab-wrapper-list{background:#fff;margin:0}#edd-item-tab-wrapper-list li{float:left;display:inline;font-size:14px;box-sizing:border-box;border-width:0 1px 1px 0;border-style:solid;border-color:#e5e5e5;width:33.33333%}#edd-item-tab-wrapper-list li:nth-child(3n+3){border-width:0 0 1px 0}#edd-item-tab-wrapper-list .dashicons{font-size:18px}.edd-item-has-tabs #edd-item-card-wrapper{border-top:1px solid #e5e5e5;border-left:0;margin-top:-1px;width:100%}}@media screen and (max-width:656px){#edd-item-card-wrapper .customer-info{min-height:220px}.edd-item-info.customer-info{position:relative}#edd-item-card-wrapper .customer-address-wrapper{float:none;position:absolute;top:84px;left:110px;max-width:200px}#edd-item-card-wrapper .customer-main-wrapper{float:none;position:absolute;left:110px}.customer-info .customer-name{font-size:16px}#edd-item-card-wrapper #edd-item-stats-wrapper{padding-left:0;padding-right:0}#edd-item-card-wrapper .customer-section{margin-bottom:0}#edd-item-card-wrapper .widefat td,#edd-item-card-wrapper .widefat th{padding:4px 6px;max-width:100px!important;display:table-cell;overflow:hidden}#edd-item-card-wrapper .customer-id{font-size:16px}}@media screen and (max-width:480px){#edd-item-tab-wrapper-list li{width:50%}#edd-item-tab-wrapper-list li:nth-child(3n+3){border-width:0 1px 1px 0}#edd-item-tab-wrapper-list li:nth-child(even){border-width:0 0 1px 0}.edd-repeatable-row-actions,.edd-repeatable-row-title{text-align:left;width:100%}.edd-repeatable-row-title{padding-bottom:0}.edd-bundled-product-item-reorder,.edd-bundled-product-row .edd-bundled-product-item,.edd-bundled-product-row .edd-bundled-product-price-assignment,.edd-file-assignment,.edd-file-name,.edd-file-url,.edd-option-name,.edd-option-price,.edd_repeatable_default{float:none;text-align:left;width:100%!important;margin:10px 0}.edd-bundled-product-row .edd-bundled-product-actions{float:none}.edd-bundled-product-row .edd-bundled-product-item-reorder .edd-product-file-reorder{padding:0}#edd-payment-filters span{display:block;margin:2px 0}#edd-payment-filters a,.download_page_edd-reports .button{text-align:center}#edd-payment-date-filters span{display:block}#edd-payment-date-filters span>input{float:right}#edd-add-discount select[multiple] option,#edd-edit-discount select[multiple] option{height:20px}#edd-add-discount input[type=text],#edd-edit-discount input[type=text],#edd-payment-filters a,#edd-payment-filters input:not([type=radio]),#edd-payment-filters select,#system-info-textarea,.download_page_edd-reports .inside .button,.download_page_edd-reports .inside input[type=submit],.download_page_edd-reports .inside input[type=text],.download_page_edd-reports .inside select,.download_page_edd-settings .inside input[type=button],.download_page_edd-tools .inside input[type=submit],.download_page_edd-tools .inside input[type=text],.download_page_edd-tools .inside select{width:100%}#edd-add-discount select[multiple],#edd-edit-discount select[multiple],.download_page_edd-tools select[multiple]{height:200px!important}.download_page_edd-settings input[type=checkbox]{margin:2px 0}.post-type-download input[type=checkbox]{margin-left:2px}}.recount-stats-controls form{display:inline}.edd-recount-stats-descriptions span{display:none;line-height:24px}#edd-debug-log p.submit{margin:20px 0 0;padding:0}#edd-debug-log .edd-inline-button{margin-left:5px}.edd-settings-sidebar{padding-top:27px}.edd-settings-sidebar-content{background-color:#fff;text-align:center;border:1px solid #ddd;box-sizing:border-box;max-width:300px}.edd-settings-sidebar-content p{font-size:14px;line-height:1.5;margin-top:0}.edd-sidebar-header-section{background-color:#35495c;line-height:1;padding:26px 20px 24px;border-bottom:3px dashed #fafafa}.edd-sidebar-description-section{background-color:#fafafa;padding:16px 20px;border-bottom:1px solid #ddd}.edd-sidebar-description-section .edd-sidebar-description{margin:0}.edd-sidebar-coupon-section{font-size:14px;padding:16px 20px}.edd-sidebar-coupon-section label{display:block;line-height:1.4;margin-bottom:6px}.edd-sidebar-coupon-section label strong{color:#253b51;font-weight:700}.edd-sidebar-coupon-section input{background:#f4f7fa;font-size:22px;font-weight:600;text-align:center;padding:10px;border:2px dashed #2794da;border-radius:4px;margin-bottom:16px;box-shadow:none;width:100%}.edd-sidebar-coupon-section input:focus{border:2px dashed #2794da;box-shadow:none}.edd-settings-sidebar-content .edd-coupon-note{color:#6c7883;font-size:13px;font-style:italic;margin:0}.edd-settings-sidebar-content .edd-coupon-note a{color:#253b51}.edd-settings-sidebar-content .edd-coupon-note a:hover{text-decoration:none}.edd-sidebar-footer-section{background-color:#fafafa;padding:16px 20px;border-top:1px solid #ddd}.edd-sidebar-footer-section .edd-cta-button{display:block;background-color:#2794da;color:#fff;text-decoration:none;font-size:20px;font-weight:700;text-transform:uppercase;padding:17px 10px;border:none;border-radius:4px;width:100%;box-sizing:border-box;box-shadow:none;transition:background-color .2s}.edd-sidebar-footer-section .edd-cta-button:hover{background-color:#2386c5}@media all and (min-width:1080px){.edd-has-sidebar .edd-settings-content{float:left;width:67%}.edd-has-sidebar .edd-settings-sidebar{float:right;width:31%}}@media all and (min-width:1240px){.edd-has-sidebar .edd-settings-content{width:74%}.edd-has-sidebar .edd-settings-sidebar{width:23%}}.taxes-tab .edd-has-sidebar .edd-settings-content,.taxes-tab .edd-has-sidebar .edd-settings-sidebar{float:none;width:100%}.bfcm-promo-img-container{background-color:#35495c;width:100%;height:160px}.bfcm-code{color:#2794da;font-weight:700}.sale-ends{position:absolute;bottom:9px;right:14px;display:inline-block;color:#6c7883;font-size:12px;text-align:right;font-style:italic;width:150px}.edd-admin-notice-top-of-page{font-size:15px;line-height:1.4;color:#fff;margin-left:-20px;padding:12px 32px 12px 20px;background:#2d6ca2;display:none}@media screen and (min-width:783px){.edd-admin-notice-top-of-page{padding:10px 46px 10px 22px}}@media screen and (min-width:961px){.edd-admin-notice-top-of-page{text-align:center}}.edd-admin-notice-top-of-page a{color:#fff}.edd-admin-notice-top-of-page a:hover{text-decoration:none}.edd-admin-notice-top-of-page .button-link{position:absolute;top:48px;right:-1px;font-size:20px;color:#fff;font-weight:700;text-decoration:none;margin-left:5px;padding:6px 10px}.edd-admin-notice-top-of-page .button-link:active,.edd-admin-notice-top-of-page .button-link:focus,.edd-admin-notice-top-of-page .button-link:hover{color:#fff;text-decoration:none}@media screen and (min-width:601px){.edd-admin-notice-top-of-page .button-link{top:1px}}@media screen and (min-width:783px){.edd-admin-notice-top-of-page .button-link{right:9px}}.edd-paypal-account-status ul{margin-left:25px}.edd-paypal-account-status>li{margin-bottom:1em}.edd-paypal-account-status ul:not(.edd-paypal-webhook-events){list-style:disc;list-style-position:inside}.edd-paypal-account-status ul:not(.edd-paypal-webhook-events) li{margin:.25em 0}.edd-paypal-account-status .dashicons-yes{color:#008a20}.edd-paypal-account-status .dashicons-no{color:#d63638}
assets/images/edd-cpt-2x.png CHANGED
Binary file
assets/images/edd-cpt.png CHANGED
Binary file
assets/images/edd-cross-hair.png CHANGED
Binary file
assets/images/edd-icon-2x.png CHANGED
Binary file
assets/images/edd-icon.png CHANGED
Binary file
assets/images/edd-logo-pdf.png CHANGED
Binary file
assets/images/edd-logo.png CHANGED
Binary file
assets/images/edd-logo.svg CHANGED
@@ -1,30 +1 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
- <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
- width="210px" height="210px" viewBox="0 0 210 210" enable-background="new 0 0 210 210" xml:space="preserve">
6
- <path fill="#1D2428" d="M116.226,155.494c-2.052-1.334-4.651-2.533-7.787-3.574c-2.398-0.827-4.371-1.606-5.911-2.358
7
- c-1.527-0.744-2.656-1.571-3.377-2.441c-0.739-0.888-1.085-1.951-1.085-3.172c0-0.976,0.293-1.903,0.923-2.782
8
- c0.617-0.875,1.584-1.606,2.896-2.157c1.326-0.56,3.014-0.862,5.11-0.871c1.689,0.009,3.229,0.144,4.624,0.385
9
- c1.378,0.249,2.599,0.551,3.644,0.897c1.059,0.359,1.916,0.696,2.59,1.015l2.332-7.031c-1.409-0.709-3.176-1.295-5.32-1.772
10
- c-1.82-0.402-3.903-0.634-6.269-0.713v-7.275h-6.409v7.639c-1.028,0.166-2.013,0.39-2.944,0.661
11
- c-2.358,0.696-4.384,1.663-6.059,2.923c-1.663,1.256-2.949,2.726-3.833,4.41c-0.888,1.684-1.326,3.539-1.343,5.534
12
- c0.013,2.31,0.617,4.344,1.811,6.103c1.194,1.759,2.896,3.286,5.093,4.594c2.188,1.304,4.799,2.428,7.818,3.373
13
- c2.266,0.726,4.113,1.483,5.521,2.262c1.409,0.774,2.441,1.628,3.084,2.559c0.656,0.932,0.98,2.012,0.967,3.22
14
- c0,1.326-0.389,2.476-1.151,3.469c-0.752,0.98-1.864,1.75-3.325,2.297c-1.461,0.551-3.246,0.823-5.337,0.84
15
- c-1.702-0.013-3.351-0.158-4.961-0.433c-1.597-0.289-3.098-0.661-4.48-1.124c-1.396-0.464-2.616-0.967-3.675-1.531l-2.253,7.324
16
- c1.019,0.56,2.292,1.063,3.85,1.527c1.557,0.468,3.272,0.84,5.149,1.124c1.864,0.276,3.78,0.415,5.727,0.433l0.341-0.005v7.521
17
- h6.409v-8.124c0.814-0.157,1.588-0.346,2.323-0.564c2.572-0.774,4.707-1.829,6.396-3.181c1.702-1.339,2.962-2.892,3.797-4.642
18
- c0.831-1.75,1.247-3.601,1.247-5.574c0-2.31-0.495-4.353-1.514-6.112C119.818,158.39,118.287,156.837,116.226,155.494z"/>
19
- <g id="EDD_logo">
20
- <path fill="#1D2428" d="M179.244,30.752C160.247,11.751,133.993,0,105.004,0C76.007,0,49.757,11.751,30.756,30.752
21
- C11.751,49.753,0,76.007,0,105s11.751,55.247,30.752,74.248C49.753,198.253,76.007,210,105.004,210
22
- c28.993,0,55.248-11.756,74.244-30.752C198.249,160.243,210,133.993,210,105S198.244,49.753,179.244,30.752z M175.779,175.779
23
- c-18.112,18.113-43.137,29.317-70.779,29.317s-52.671-11.204-70.783-29.317C16.105,157.666,4.9,132.641,4.9,105
24
- s11.205-52.666,29.317-70.779C52.329,16.109,77.355,4.904,104.996,4.904s52.666,11.205,70.779,29.317
25
- c18.113,18.113,29.317,43.138,29.317,70.779C205.096,132.641,193.891,157.666,175.779,175.779z"/>
26
- <path fill="#1D2428" d="M195.326,104.125c-0.472-49.486-40.727-89.456-90.322-89.456c-49.599,0-89.858,39.974-90.322,89.46
27
- l41.418-41.418l13.891,13.891l-30.31,30.31h130.646l-30.31-30.31l13.891-13.891L195.326,104.125z M105,88.603L66.513,48.217h25.576
28
- V28.311c0-5.167,5.81-9.402,12.911-9.402s12.911,4.231,12.911,9.402v19.906h25.576L105,88.603z"/>
29
- </g>
30
- </svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="210" height="210" xml:space="preserve"><path fill="#1D2428" d="M116.226 155.494c-2.052-1.334-4.651-2.533-7.787-3.574-2.398-.827-4.371-1.606-5.911-2.358-1.527-.744-2.656-1.571-3.377-2.441-.739-.888-1.085-1.951-1.085-3.172 0-.976.293-1.903.923-2.782.617-.875 1.584-1.606 2.896-2.157 1.326-.56 3.014-.862 5.11-.871 1.689.009 3.229.144 4.624.385 1.378.249 2.599.551 3.644.897 1.059.359 1.916.696 2.59 1.015l2.332-7.031c-1.409-.709-3.176-1.295-5.32-1.772-1.82-.402-3.903-.634-6.269-.713v-7.275h-6.409v7.639c-1.028.166-2.013.39-2.944.661-2.358.696-4.384 1.663-6.059 2.923-1.663 1.256-2.949 2.726-3.833 4.41-.888 1.684-1.326 3.539-1.343 5.534.013 2.31.617 4.344 1.811 6.103 1.194 1.759 2.896 3.286 5.093 4.594 2.188 1.304 4.799 2.428 7.818 3.373 2.266.726 4.113 1.483 5.521 2.262 1.409.774 2.441 1.628 3.084 2.559.656.932.98 2.012.967 3.22 0 1.326-.389 2.476-1.151 3.469-.752.98-1.864 1.75-3.325 2.297-1.461.551-3.246.823-5.337.84a30.776 30.776 0 0 1-4.961-.433 32.183 32.183 0 0 1-4.48-1.124c-1.396-.464-2.616-.967-3.675-1.531l-2.253 7.324c1.019.56 2.292 1.063 3.85 1.527 1.557.468 3.272.84 5.149 1.124a41.77 41.77 0 0 0 5.727.433l.341-.005v7.521h6.409v-8.124a24.452 24.452 0 0 0 2.323-.564c2.572-.774 4.707-1.829 6.396-3.181 1.702-1.339 2.962-2.892 3.797-4.642a12.811 12.811 0 0 0 1.247-5.574c0-2.31-.495-4.353-1.514-6.112-1.027-1.778-2.558-3.331-4.619-4.674z"/><g fill="#1D2428"><path d="M179.244 30.752C160.247 11.751 133.993 0 105.004 0 76.007 0 49.757 11.751 30.756 30.752 11.751 49.753 0 76.007 0 105s11.751 55.247 30.752 74.248C49.753 198.253 76.007 210 105.004 210c28.993 0 55.248-11.756 74.244-30.752C198.249 160.243 210 133.993 210 105s-11.756-55.247-30.756-74.248zm-3.465 145.027c-18.112 18.113-43.137 29.317-70.779 29.317s-52.671-11.204-70.783-29.317C16.105 157.666 4.9 132.641 4.9 105s11.205-52.666 29.317-70.779C52.329 16.109 77.355 4.904 104.996 4.904s52.666 11.205 70.779 29.317c18.113 18.113 29.317 43.138 29.317 70.779.004 27.641-11.201 52.666-29.313 70.779z"/><path d="M195.326 104.125c-.472-49.486-40.727-89.456-90.322-89.456-49.599 0-89.858 39.974-90.322 89.46L56.1 62.711l13.891 13.891-30.31 30.31h130.646l-30.31-30.31 13.891-13.891 41.418 41.414zM105 88.603 66.513 48.217h25.576V28.311c0-5.167 5.81-9.402 12.911-9.402s12.911 4.231 12.911 9.402v19.906h25.576L105 88.603z"/></g></svg>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/images/edd-media.png CHANGED
Binary file
assets/images/edd-peeking.png CHANGED
Binary file
assets/images/icons/iphone.png CHANGED
Binary file
assets/images/promo/bfcm-header.svg CHANGED
@@ -1 +1 @@
1
- <svg viewBox="0 0 300 52" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M0.555,-0.212c0,0.047 -0.012,0.087 -0.037,0.122c-0.025,0.034 -0.06,0.06 -0.105,0.077c-0.045,0.017 -0.099,0.025 -0.162,0.025c-0.073,0 -0.14,-0.012 -0.201,-0.037l0,-0.192c0.029,0.022 0.061,0.039 0.097,0.052c0.035,0.013 0.068,0.02 0.099,0.02c0.023,0 0.041,-0.004 0.054,-0.012c0.013,-0.009 0.019,-0.021 0.019,-0.037c0,-0.011 -0.003,-0.021 -0.01,-0.03c-0.006,-0.009 -0.016,-0.017 -0.028,-0.024c-0.013,-0.008 -0.037,-0.018 -0.072,-0.031c-0.113,-0.043 -0.169,-0.113 -0.169,-0.21c0,-0.067 0.026,-0.122 0.077,-0.162c0.052,-0.041 0.121,-0.061 0.207,-0.061c0.025,0 0.047,0.001 0.068,0.003c0.02,0.002 0.039,0.004 0.056,0.007c0.016,0.003 0.04,0.009 0.07,0.017l0,0.178c-0.059,-0.032 -0.117,-0.048 -0.174,-0.048c-0.023,0 -0.042,0.004 -0.056,0.013c-0.015,0.009 -0.022,0.021 -0.022,0.036c0,0.015 0.006,0.027 0.017,0.037c0.012,0.009 0.036,0.022 0.073,0.037c0.073,0.029 0.124,0.061 0.154,0.096c0.03,0.035 0.045,0.076 0.045,0.124Z" fill="#2794da" fill-rule="nonzero" transform="matrix(37.8505 0 0 37.8505 114.537 50.892)"/><path d="M0.508,0l-0.031,-0.129l-0.209,0l-0.033,0.129l-0.228,0l0.241,-0.7l0.262,0l0.227,0.7l-0.229,0Zm-0.133,-0.548l-0.005,0c-0.001,0.008 -0.003,0.021 -0.007,0.039c-0.004,0.018 -0.023,0.094 -0.059,0.23l0.134,0l-0.049,-0.19c-0.007,-0.028 -0.011,-0.054 -0.014,-0.079Z" fill="#2794da" fill-rule="nonzero" transform="matrix(37.8505 0 0 37.8505 136.18 50.892)"/><path d="M0.468,0l-0.237,0l-0.226,-0.7l0.227,0l0.107,0.431c0.008,0.035 0.013,0.061 0.014,0.078l0.005,0c0.002,-0.022 0.007,-0.049 0.015,-0.081l0.104,-0.428l0.22,0l-0.229,0.7Z" fill="#2794da" fill-rule="nonzero" transform="matrix(37.8505 0 0 37.8505 164.567 50.892)"/><path d="M0.069,0l0,-0.7l0.436,0l0,0.165l-0.225,0l0,0.102l0.211,0l0,0.165l-0.211,0l0,0.103l0.241,0l0,0.165l-0.452,0Z" fill="#2794da" fill-rule="nonzero" transform="matrix(37.8505 0 0 37.8505 191.144 50.892)"/><path d="M0.044,0l0,-0.056c0,-0.04 0.005,-0.074 0.015,-0.104c0.009,-0.029 0.025,-0.056 0.046,-0.082c0.021,-0.026 0.057,-0.059 0.109,-0.099c0.037,-0.03 0.062,-0.051 0.074,-0.064c0.013,-0.012 0.022,-0.025 0.028,-0.037c0.006,-0.012 0.009,-0.025 0.009,-0.039c0,-0.047 -0.028,-0.07 -0.084,-0.07c-0.057,0 -0.111,0.021 -0.162,0.062l0,-0.17c0.039,-0.02 0.075,-0.033 0.109,-0.041c0.033,-0.008 0.068,-0.012 0.104,-0.012c0.076,0 0.135,0.018 0.176,0.055c0.042,0.036 0.063,0.087 0.063,0.153c0,0.051 -0.011,0.093 -0.033,0.129c-0.022,0.035 -0.062,0.071 -0.122,0.109c-0.045,0.03 -0.075,0.051 -0.09,0.065c-0.014,0.013 -0.022,0.025 -0.022,0.034l0.273,0l0,0.167l-0.493,0Z" fill="#2794da" fill-rule="nonzero" transform="matrix(37.8505 0 0 37.8505 222.544 50.892)"/><path d="M0.532,-0.237c0,0.048 -0.011,0.091 -0.034,0.129c-0.022,0.038 -0.055,0.067 -0.098,0.088c-0.042,0.022 -0.093,0.032 -0.15,0.032c-0.033,0 -0.066,-0.003 -0.101,-0.008c-0.035,-0.006 -0.064,-0.013 -0.086,-0.021l0,-0.162c0.048,0.026 0.1,0.039 0.154,0.039c0.036,0 0.063,-0.007 0.082,-0.02c0.018,-0.013 0.027,-0.031 0.027,-0.055c0,-0.051 -0.042,-0.077 -0.128,-0.077c-0.042,0 -0.082,0.004 -0.118,0.012l0.026,-0.42l0.395,0l0,0.162l-0.234,0l-0.007,0.098c0.019,-0.002 0.037,-0.003 0.053,-0.003c0.069,0 0.122,0.019 0.161,0.056c0.039,0.036 0.058,0.087 0.058,0.15Z" fill="#2794da" fill-rule="nonzero" transform="matrix(37.8505 0 0 37.8505 245.22 50.892)"/><path d="M0.848,-0.179c0,0.057 -0.017,0.103 -0.05,0.137c-0.034,0.035 -0.079,0.052 -0.136,0.052c-0.053,0 -0.095,-0.016 -0.127,-0.049c-0.031,-0.032 -0.047,-0.074 -0.047,-0.127c0,-0.058 0.017,-0.104 0.051,-0.138c0.033,-0.034 0.079,-0.051 0.135,-0.051c0.054,0 0.096,0.015 0.128,0.046c0.031,0.031 0.046,0.074 0.046,0.13Zm-0.128,0.006c0,-0.023 -0.004,-0.041 -0.013,-0.054c-0.009,-0.013 -0.021,-0.02 -0.036,-0.02c-0.017,0 -0.03,0.007 -0.039,0.021c-0.009,0.014 -0.014,0.032 -0.014,0.056c0,0.023 0.004,0.04 0.013,0.053c0.008,0.013 0.02,0.019 0.037,0.019c0.017,0 0.03,-0.007 0.039,-0.02c0.009,-0.013 0.013,-0.031 0.013,-0.055Zm-0.418,0.173l-0.154,0l0.45,-0.7l0.154,0l-0.45,0.7Zm0.107,-0.533c0,0.058 -0.017,0.104 -0.05,0.138c-0.034,0.034 -0.079,0.051 -0.135,0.051c-0.053,0 -0.095,-0.016 -0.127,-0.049c-0.031,-0.032 -0.047,-0.074 -0.047,-0.127c0,-0.057 0.016,-0.103 0.049,-0.138c0.033,-0.035 0.079,-0.052 0.136,-0.052c0.054,0 0.096,0.016 0.128,0.047c0.031,0.032 0.046,0.075 0.046,0.13Zm-0.128,0.005c0,-0.022 -0.004,-0.04 -0.013,-0.053c-0.008,-0.013 -0.02,-0.02 -0.035,-0.02c-0.017,0 -0.03,0.007 -0.039,0.021c-0.009,0.014 -0.014,0.032 -0.014,0.056c0,0.023 0.004,0.04 0.013,0.053c0.008,0.013 0.02,0.019 0.037,0.019c0.016,0 0.029,-0.007 0.038,-0.02c0.008,-0.013 0.013,-0.031 0.013,-0.056Z" fill="#2794da" fill-rule="nonzero" transform="matrix(37.8505 0 0 37.8505 267.898 50.892)"/><g><path d="M0.555,-0.212c0,0.047 -0.012,0.087 -0.037,0.122c-0.025,0.034 -0.06,0.06 -0.105,0.077c-0.045,0.017 -0.099,0.025 -0.162,0.025c-0.073,0 -0.14,-0.012 -0.201,-0.037l0,-0.192c0.029,0.022 0.061,0.039 0.097,0.052c0.035,0.013 0.068,0.02 0.099,0.02c0.023,0 0.041,-0.004 0.054,-0.012c0.013,-0.009 0.019,-0.021 0.019,-0.037c0,-0.011 -0.003,-0.021 -0.01,-0.03c-0.006,-0.009 -0.016,-0.017 -0.028,-0.024c-0.013,-0.008 -0.037,-0.018 -0.072,-0.031c-0.113,-0.043 -0.169,-0.113 -0.169,-0.21c0,-0.067 0.026,-0.122 0.077,-0.162c0.052,-0.041 0.121,-0.061 0.207,-0.061c0.025,0 0.047,0.001 0.068,0.003c0.02,0.002 0.039,0.004 0.056,0.007c0.016,0.003 0.04,0.009 0.07,0.017l0,0.178c-0.059,-0.032 -0.117,-0.048 -0.174,-0.048c-0.023,0 -0.042,0.004 -0.056,0.013c-0.015,0.009 -0.022,0.021 -0.022,0.036c0,0.015 0.006,0.027 0.017,0.037c0.012,0.009 0.036,0.022 0.073,0.037c0.073,0.029 0.124,0.061 0.154,0.096c0.03,0.035 0.045,0.076 0.045,0.124Z" fill="#fff" fill-rule="nonzero" transform="matrix(37.8505 0 0 37.8505 -1.232 50.892)"/><path d="M0.508,0l-0.031,-0.129l-0.209,0l-0.033,0.129l-0.228,0l0.241,-0.7l0.262,0l0.227,0.7l-0.229,0Zm-0.133,-0.548l-0.005,0c-0.001,0.008 -0.003,0.021 -0.007,0.039c-0.004,0.018 -0.023,0.094 -0.059,0.23l0.134,0l-0.049,-0.19c-0.007,-0.028 -0.011,-0.054 -0.014,-0.079Z" fill="#fff" fill-rule="nonzero" transform="matrix(37.8505 0 0 37.8505 20.41 50.892)"/><path d="M0.069,0l0,-0.7l0.211,0l0,0.535l0.241,0l0,0.165l-0.452,0Z" fill="#fff" fill-rule="nonzero" transform="matrix(37.8505 0 0 37.8505 48.798 50.892)"/><path d="M0.069,0l0,-0.7l0.436,0l0,0.165l-0.225,0l0,0.102l0.211,0l0,0.165l-0.211,0l0,0.103l0.241,0l0,0.165l-0.452,0Z" fill="#fff" fill-rule="nonzero" transform="matrix(37.8505 0 0 37.8505 69.275 50.892)"/><path d="M0.265,-0.236l-0.167,0l-0.026,-0.464l0.219,0l-0.026,0.464Zm0.034,0.149c0,0.029 -0.011,0.053 -0.032,0.071c-0.021,0.019 -0.049,0.028 -0.084,0.028c-0.034,0 -0.062,-0.009 -0.084,-0.028c-0.021,-0.019 -0.032,-0.043 -0.032,-0.071c0,-0.029 0.01,-0.052 0.031,-0.069c0.021,-0.018 0.05,-0.027 0.085,-0.027c0.035,0 0.063,0.009 0.084,0.027c0.021,0.017 0.032,0.04 0.032,0.069Z" fill="#fff" fill-rule="nonzero" transform="matrix(37.8505 0 0 37.8505 90.16 50.892)"/></g><g><path d="M0.667,-0.215c0,0.069 -0.024,0.122 -0.072,0.159c-0.048,0.037 -0.117,0.056 -0.207,0.056l-0.319,0l0,-0.7l0.297,0c0.186,0 0.279,0.056 0.279,0.169c0,0.025 -0.006,0.047 -0.018,0.067c-0.011,0.021 -0.029,0.039 -0.053,0.054c-0.024,0.015 -0.05,0.026 -0.079,0.031l0,0.002c0.033,0.004 0.063,0.014 0.089,0.03c0.027,0.015 0.047,0.035 0.062,0.059c0.014,0.023 0.021,0.048 0.021,0.073Zm-0.246,-0.279c0,-0.043 -0.034,-0.065 -0.102,-0.065l-0.039,0l0,0.132l0.061,0c0.023,0 0.042,-0.006 0.057,-0.019c0.015,-0.012 0.023,-0.028 0.023,-0.048Zm0.022,0.278c0,-0.02 -0.007,-0.037 -0.022,-0.05c-0.015,-0.013 -0.034,-0.019 -0.058,-0.019l-0.083,0l0,0.143l0.07,0c0.029,0 0.051,-0.007 0.068,-0.02c0.017,-0.013 0.025,-0.031 0.025,-0.054Z" fill="#fff" fill-rule="nonzero" transform="matrix(17.92028 0 0 17.92028 -1.234 12.758)"/><path d="M0.069,0l0,-0.7l0.211,0l0,0.535l0.241,0l0,0.165l-0.452,0Z" fill="#fff" fill-rule="nonzero" transform="matrix(17.92028 0 0 17.92028 11.148 12.758)"/><path d="M0.508,0l-0.031,-0.129l-0.209,0l-0.033,0.129l-0.228,0l0.241,-0.7l0.262,0l0.227,0.7l-0.229,0Zm-0.133,-0.548l-0.005,0c-0.001,0.008 -0.003,0.021 -0.007,0.039c-0.004,0.018 -0.023,0.094 -0.059,0.23l0.134,0l-0.049,-0.19c-0.007,-0.028 -0.011,-0.054 -0.014,-0.079Z" fill="#fff" fill-rule="nonzero" transform="matrix(17.92028 0 0 17.92028 20.843 12.758)"/><path d="M0.59,-0.019c-0.058,0.021 -0.125,0.031 -0.201,0.031c-0.074,0 -0.139,-0.014 -0.193,-0.043c-0.054,-0.028 -0.095,-0.069 -0.123,-0.121c-0.029,-0.053 -0.043,-0.113 -0.043,-0.182c0,-0.074 0.016,-0.14 0.048,-0.197c0.032,-0.058 0.077,-0.102 0.135,-0.134c0.058,-0.031 0.125,-0.047 0.201,-0.047c0.061,0 0.119,0.007 0.176,0.022l0,0.195c-0.02,-0.012 -0.043,-0.021 -0.07,-0.027c-0.027,-0.007 -0.054,-0.01 -0.082,-0.01c-0.057,0 -0.102,0.016 -0.136,0.049c-0.033,0.033 -0.049,0.078 -0.049,0.134c0,0.056 0.016,0.1 0.049,0.132c0.034,0.033 0.078,0.049 0.133,0.049c0.051,0 0.103,-0.013 0.155,-0.039l0,0.188Z" fill="#fff" fill-rule="nonzero" transform="matrix(17.92028 0 0 17.92028 34.283 12.758)"/><path d="M0.456,0l-0.155,-0.296c-0.011,-0.023 -0.017,-0.039 -0.019,-0.048l-0.002,0l0,0.344l-0.211,0l0,-0.7l0.211,0l0,0.333l0.002,0c0.006,-0.018 0.013,-0.034 0.021,-0.049l0.14,-0.284l0.25,0l-0.199,0.334l0.218,0.366l-0.256,0Z" fill="#fff" fill-rule="nonzero" transform="matrix(17.92028 0 0 17.92028 45.57 12.758)"/><path d="M0.28,-0.535l0,0.126l0.208,0l0,0.165l-0.208,0l0,0.244l-0.211,0l0,-0.7l0.439,0l0,0.165l-0.228,0Z" fill="#fff" fill-rule="nonzero" transform="matrix(17.92028 0 0 17.92028 62.913 12.758)"/><path d="M0.432,0l-0.052,-0.151c-0.01,-0.03 -0.023,-0.053 -0.039,-0.07c-0.017,-0.017 -0.034,-0.025 -0.053,-0.025l-0.008,0l0,0.246l-0.211,0l0,-0.7l0.28,0c0.098,0 0.17,0.016 0.217,0.048c0.047,0.032 0.07,0.08 0.07,0.144c0,0.048 -0.013,0.089 -0.041,0.121c-0.027,0.033 -0.067,0.056 -0.121,0.071l0,0.002c0.03,0.009 0.054,0.024 0.074,0.044c0.02,0.021 0.037,0.051 0.053,0.092l0.069,0.178l-0.238,0Zm-0.02,-0.478c0,-0.023 -0.007,-0.042 -0.021,-0.056c-0.015,-0.013 -0.037,-0.02 -0.068,-0.02l-0.043,0l0,0.16l0.038,0c0.028,0 0.051,-0.008 0.068,-0.024c0.017,-0.016 0.026,-0.036 0.026,-0.06Z" fill="#fff" fill-rule="nonzero" transform="matrix(17.92028 0 0 17.92028 72.609 12.758)"/><path fill="#fff" fill-rule="nonzero" d="M0.069 -0.7H0.28V0H0.069z" transform="matrix(17.92028 0 0 17.92028 84.833 12.758)"/><path d="M0.729,-0.359c0,0.071 -0.015,0.134 -0.045,0.188c-0.029,0.055 -0.072,0.097 -0.127,0.127c-0.056,0.029 -0.119,0.044 -0.192,0.044l-0.296,0l0,-0.7l0.29,0c0.247,0 0.37,0.114 0.37,0.341Zm-0.224,0.002c0,-0.034 -0.007,-0.065 -0.021,-0.092c-0.014,-0.028 -0.033,-0.049 -0.059,-0.064c-0.026,-0.015 -0.056,-0.022 -0.091,-0.022l-0.054,0l0,0.37l0.059,0c0.05,0 0.091,-0.017 0.121,-0.052c0.03,-0.035 0.045,-0.081 0.045,-0.14Z" fill="#fff" fill-rule="nonzero" transform="matrix(17.92028 0 0 17.92028 91.08 12.758)"/><path d="M0.508,0l-0.031,-0.129l-0.209,0l-0.033,0.129l-0.228,0l0.241,-0.7l0.262,0l0.227,0.7l-0.229,0Zm-0.133,-0.548l-0.005,0c-0.001,0.008 -0.003,0.021 -0.007,0.039c-0.004,0.018 -0.023,0.094 -0.059,0.23l0.134,0l-0.049,-0.19c-0.007,-0.028 -0.011,-0.054 -0.014,-0.079Z" fill="#fff" fill-rule="nonzero" transform="matrix(17.92028 0 0 17.92028 104.678 12.758)"/><path d="M0.427,-0.243l0,0.243l-0.211,0l0,-0.24l-0.216,-0.46l0.242,0l0.076,0.22c0.005,0.015 0.009,0.028 0.011,0.039c0.002,0.011 0.004,0.022 0.007,0.034l0.002,0c0.004,-0.03 0.009,-0.053 0.014,-0.069l0.075,-0.224l0.223,0l-0.223,0.457Z" fill="#fff" fill-rule="nonzero" transform="matrix(17.92028 0 0 17.92028 118.119 12.758)"/><path d="M0.528,0.001l-0.041,-0.048c-0.022,0.017 -0.053,0.031 -0.092,0.042c-0.039,0.012 -0.077,0.017 -0.113,0.017c-0.08,0 -0.142,-0.017 -0.186,-0.052c-0.044,-0.034 -0.066,-0.083 -0.066,-0.145c0,-0.037 0.013,-0.072 0.04,-0.106c0.027,-0.033 0.067,-0.063 0.122,-0.091c-0.047,-0.051 -0.07,-0.103 -0.07,-0.154c0,-0.052 0.02,-0.095 0.061,-0.127c0.041,-0.033 0.094,-0.049 0.16,-0.049c0.062,0 0.112,0.015 0.15,0.044c0.038,0.029 0.057,0.068 0.057,0.116c0,0.039 -0.011,0.072 -0.034,0.1c-0.022,0.028 -0.058,0.054 -0.107,0.076l0.1,0.113c0.014,-0.029 0.022,-0.069 0.022,-0.119l0.159,0c0,0.047 -0.007,0.09 -0.02,0.127c-0.013,0.038 -0.035,0.072 -0.065,0.103l0.14,0.153l-0.217,0Zm-0.139,-0.542c0,-0.014 -0.005,-0.026 -0.015,-0.036c-0.01,-0.01 -0.022,-0.015 -0.036,-0.015c-0.016,0 -0.029,0.005 -0.039,0.013c-0.01,0.009 -0.015,0.021 -0.015,0.037c0,0.01 0.003,0.02 0.009,0.031c0.006,0.011 0.02,0.028 0.042,0.053c0.02,-0.012 0.034,-0.025 0.042,-0.038c0.008,-0.014 0.012,-0.028 0.012,-0.045Zm-0.124,0.244c-0.014,0.007 -0.025,0.018 -0.034,0.034c-0.01,0.016 -0.014,0.034 -0.014,0.054c0,0.028 0.009,0.05 0.027,0.067c0.019,0.016 0.041,0.025 0.068,0.025c0.017,0 0.033,-0.003 0.048,-0.008c0.016,-0.006 0.029,-0.013 0.039,-0.021l-0.134,-0.151Z" fill="#fff" fill-rule="nonzero" transform="matrix(17.92028 0 0 17.92028 134.743 12.758)"/><path d="M0.59,-0.019c-0.058,0.021 -0.125,0.031 -0.201,0.031c-0.074,0 -0.139,-0.014 -0.193,-0.043c-0.054,-0.028 -0.095,-0.069 -0.123,-0.121c-0.029,-0.053 -0.043,-0.113 -0.043,-0.182c0,-0.074 0.016,-0.14 0.048,-0.197c0.032,-0.058 0.077,-0.102 0.135,-0.134c0.058,-0.031 0.125,-0.047 0.201,-0.047c0.061,0 0.119,0.007 0.176,0.022l0,0.195c-0.02,-0.012 -0.043,-0.021 -0.07,-0.027c-0.027,-0.007 -0.054,-0.01 -0.082,-0.01c-0.057,0 -0.102,0.016 -0.136,0.049c-0.033,0.033 -0.049,0.078 -0.049,0.134c0,0.056 0.016,0.1 0.049,0.132c0.034,0.033 0.078,0.049 0.133,0.049c0.051,0 0.103,-0.013 0.155,-0.039l0,0.188Z" fill="#fff" fill-rule="nonzero" transform="matrix(17.92028 0 0 17.92028 152.962 12.758)"/><path d="M0.427,-0.243l0,0.243l-0.211,0l0,-0.24l-0.216,-0.46l0.242,0l0.076,0.22c0.005,0.015 0.009,0.028 0.011,0.039c0.002,0.011 0.004,0.022 0.007,0.034l0.002,0c0.004,-0.03 0.009,-0.053 0.014,-0.069l0.075,-0.224l0.223,0l-0.223,0.457Z" fill="#fff" fill-rule="nonzero" transform="matrix(17.92028 0 0 17.92028 164.25 12.758)"/><path d="M0.667,-0.215c0,0.069 -0.024,0.122 -0.072,0.159c-0.048,0.037 -0.117,0.056 -0.207,0.056l-0.319,0l0,-0.7l0.297,0c0.186,0 0.279,0.056 0.279,0.169c0,0.025 -0.006,0.047 -0.018,0.067c-0.011,0.021 -0.029,0.039 -0.053,0.054c-0.024,0.015 -0.05,0.026 -0.079,0.031l0,0.002c0.033,0.004 0.063,0.014 0.089,0.03c0.027,0.015 0.047,0.035 0.062,0.059c0.014,0.023 0.021,0.048 0.021,0.073Zm-0.246,-0.279c0,-0.043 -0.034,-0.065 -0.102,-0.065l-0.039,0l0,0.132l0.061,0c0.023,0 0.042,-0.006 0.057,-0.019c0.015,-0.012 0.023,-0.028 0.023,-0.048Zm0.022,0.278c0,-0.02 -0.007,-0.037 -0.022,-0.05c-0.015,-0.013 -0.034,-0.019 -0.058,-0.019l-0.083,0l0,0.143l0.07,0c0.029,0 0.051,-0.007 0.068,-0.02c0.017,-0.013 0.025,-0.031 0.025,-0.054Z" fill="#fff" fill-rule="nonzero" transform="matrix(17.92028 0 0 17.92028 175.896 12.758)"/><path d="M0.069,0l0,-0.7l0.436,0l0,0.165l-0.225,0l0,0.102l0.211,0l0,0.165l-0.211,0l0,0.103l0.241,0l0,0.165l-0.452,0Z" fill="#fff" fill-rule="nonzero" transform="matrix(17.92028 0 0 17.92028 188.277 12.758)"/><path d="M0.432,0l-0.052,-0.151c-0.01,-0.03 -0.023,-0.053 -0.039,-0.07c-0.017,-0.017 -0.034,-0.025 -0.053,-0.025l-0.008,0l0,0.246l-0.211,0l0,-0.7l0.28,0c0.098,0 0.17,0.016 0.217,0.048c0.047,0.032 0.07,0.08 0.07,0.144c0,0.048 -0.013,0.089 -0.041,0.121c-0.027,0.033 -0.067,0.056 -0.121,0.071l0,0.002c0.03,0.009 0.054,0.024 0.074,0.044c0.02,0.021 0.037,0.051 0.053,0.092l0.069,0.178l-0.238,0Zm-0.02,-0.478c0,-0.023 -0.007,-0.042 -0.021,-0.056c-0.015,-0.013 -0.037,-0.02 -0.068,-0.02l-0.043,0l0,0.16l0.038,0c0.028,0 0.051,-0.008 0.068,-0.024c0.017,-0.016 0.026,-0.036 0.026,-0.06Z" fill="#fff" fill-rule="nonzero" transform="matrix(17.92028 0 0 17.92028 198.164 12.758)"/><path d="M0.71,0l0,-0.384c0,-0.036 0.001,-0.076 0.003,-0.119l0.002,-0.032l-0.006,0c-0.01,0.055 -0.018,0.093 -0.024,0.114l-0.103,0.421l-0.198,0l-0.108,-0.416c-0.003,-0.01 -0.011,-0.05 -0.023,-0.119l-0.006,0c0.005,0.109 0.007,0.178 0.007,0.205l0,0.33l-0.185,0l0,-0.7l0.316,0l0.096,0.38c0.002,0.008 0.005,0.024 0.009,0.048c0.004,0.024 0.006,0.042 0.007,0.055l0.003,0c0.004,-0.029 0.009,-0.064 0.017,-0.105l0.09,-0.378l0.311,0l0,0.7l-0.208,0Z" fill="#fff" fill-rule="nonzero" transform="matrix(17.92028 0 0 17.92028 215.367 12.758)"/><path d="M0.735,-0.352c0,0.07 -0.015,0.133 -0.046,0.189c-0.03,0.055 -0.072,0.098 -0.126,0.129c-0.055,0.031 -0.116,0.046 -0.183,0.046c-0.066,0 -0.126,-0.015 -0.18,-0.044c-0.053,-0.03 -0.095,-0.072 -0.125,-0.126c-0.03,-0.054 -0.045,-0.115 -0.045,-0.183c0,-0.071 0.015,-0.135 0.045,-0.192c0.03,-0.057 0.073,-0.101 0.128,-0.132c0.054,-0.031 0.116,-0.047 0.186,-0.047c0.067,0 0.127,0.015 0.18,0.045c0.053,0.03 0.094,0.072 0.123,0.127c0.028,0.055 0.043,0.118 0.043,0.188Zm-0.224,0.006c0,-0.058 -0.011,-0.103 -0.033,-0.136c-0.022,-0.034 -0.052,-0.05 -0.091,-0.05c-0.042,0 -0.075,0.016 -0.098,0.048c-0.023,0.032 -0.035,0.077 -0.035,0.135c0,0.057 0.012,0.101 0.035,0.133c0.023,0.032 0.055,0.048 0.095,0.048c0.024,0 0.046,-0.007 0.066,-0.021c0.019,-0.015 0.034,-0.035 0.045,-0.062c0.011,-0.027 0.016,-0.058 0.016,-0.095Z" fill="#fff" fill-rule="nonzero" transform="matrix(17.92028 0 0 17.92028 233.051 12.758)"/><path d="M0.558,0l-0.247,-0.338c-0.019,-0.027 -0.035,-0.051 -0.048,-0.072l-0.002,0c0.002,0.034 0.003,0.073 0.003,0.116l0,0.294l-0.195,0l0,-0.7l0.199,0l0.237,0.321l0.023,0.033c0.005,0.006 0.009,0.013 0.012,0.018c0.004,0.006 0.007,0.011 0.009,0.016l0.002,0c-0.002,-0.014 -0.003,-0.039 -0.003,-0.074l0,-0.314l0.195,0l0,0.7l-0.185,0Z" fill="#fff" fill-rule="nonzero" transform="matrix(17.92028 0 0 17.92028 246.763 12.758)"/><path d="M0.729,-0.359c0,0.071 -0.015,0.134 -0.045,0.188c-0.029,0.055 -0.072,0.097 -0.127,0.127c-0.056,0.029 -0.119,0.044 -0.192,0.044l-0.296,0l0,-0.7l0.29,0c0.247,0 0.37,0.114 0.37,0.341Zm-0.224,0.002c0,-0.034 -0.007,-0.065 -0.021,-0.092c-0.014,-0.028 -0.033,-0.049 -0.059,-0.064c-0.026,-0.015 -0.056,-0.022 -0.091,-0.022l-0.054,0l0,0.37l0.059,0c0.05,0 0.091,-0.017 0.121,-0.052c0.03,-0.035 0.045,-0.081 0.045,-0.14Z" fill="#fff" fill-rule="nonzero" transform="matrix(17.92028 0 0 17.92028 261.314 12.758)"/><path d="M0.508,0l-0.031,-0.129l-0.209,0l-0.033,0.129l-0.228,0l0.241,-0.7l0.262,0l0.227,0.7l-0.229,0Zm-0.133,-0.548l-0.005,0c-0.001,0.008 -0.003,0.021 -0.007,0.039c-0.004,0.018 -0.023,0.094 -0.059,0.23l0.134,0l-0.049,-0.19c-0.007,-0.028 -0.011,-0.054 -0.014,-0.079Z" fill="#fff" fill-rule="nonzero" transform="matrix(17.92028 0 0 17.92028 274.913 12.758)"/><path d="M0.427,-0.243l0,0.243l-0.211,0l0,-0.24l-0.216,-0.46l0.242,0l0.076,0.22c0.005,0.015 0.009,0.028 0.011,0.039c0.002,0.011 0.004,0.022 0.007,0.034l0.002,0c0.004,-0.03 0.009,-0.053 0.014,-0.069l0.075,-0.224l0.223,0l-0.223,0.457Z" fill="#fff" fill-rule="nonzero" transform="matrix(17.92028 0 0 17.92028 288.352 12.758)"/></g></svg>
1
+ <svg viewBox="0 0 300 52" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M135.544 42.868c0 1.779-.454 3.293-1.4 4.617-.947 1.287-2.271 2.271-3.975 2.915-1.703.643-3.747.946-6.132.946-2.763 0-5.299-.454-7.607-1.4v-7.268c1.097.833 2.308 1.477 3.671 1.969 1.325.492 2.574.757 3.747.757.87 0 1.552-.152 2.044-.455.492-.34.72-.794.72-1.4 0-.416-.114-.795-.38-1.136-.226-.34-.605-.643-1.059-.908-.492-.303-1.4-.681-2.725-1.173-4.277-1.628-6.397-4.277-6.397-7.949 0-2.536.984-4.618 2.915-6.132 1.968-1.552 4.58-2.309 7.835-2.309.946 0 1.779.038 2.573.114.757.076 1.477.151 2.12.265.606.114 1.514.34 2.65.643v6.738c-2.234-1.211-4.429-1.817-6.586-1.817-.871 0-1.59.151-2.12.492-.568.34-.833.795-.833 1.363 0 .567.227 1.022.644 1.4.454.34 1.362.833 2.763 1.4 2.763 1.098 4.693 2.31 5.829 3.634 1.135 1.325 1.703 2.877 1.703 4.694zM155.408 50.892l-1.173-4.883h-7.911l-1.25 4.883h-8.629l9.122-26.495h9.917l8.592 26.495h-8.668zm-5.034-20.742h-.19c-.037.303-.113.795-.264 1.476-.152.681-.87 3.558-2.233 8.706h5.072l-1.855-7.192a23.777 23.777 0 0 1-.53-2.99zM182.281 50.892h-8.97l-8.555-26.495h8.592l4.05 16.313c.303 1.325.492 2.31.53 2.953h.19c.075-.833.264-1.855.567-3.066l3.937-16.2h8.327l-8.668 26.495zM193.756 50.892V24.397h16.503v6.245h-8.517v3.86h7.987v6.246h-7.987v3.899h9.122v6.245h-17.108zM224.21 50.892v-2.12c0-1.514.189-2.8.567-3.936.34-1.098.946-2.12 1.741-3.104.795-.984 2.158-2.233 4.126-3.747 1.4-1.136 2.347-1.93 2.8-2.422a4.884 4.884 0 0 0 1.06-1.4c.228-.455.341-.947.341-1.477 0-1.78-1.06-2.65-3.179-2.65-2.158 0-4.201.795-6.132 2.347V25.95c1.476-.757 2.839-1.25 4.126-1.552a16.733 16.733 0 0 1 3.936-.455c2.877 0 5.11.682 6.662 2.082 1.59 1.363 2.385 3.293 2.385 5.791 0 1.93-.417 3.52-1.25 4.883-.832 1.325-2.346 2.687-4.617 4.126-1.703 1.135-2.839 1.93-3.407 2.46-.53.492-.832.946-.832 1.287h10.333v6.321h-18.66zM265.356 41.921c0 1.817-.416 3.445-1.286 4.883-.833 1.438-2.082 2.536-3.71 3.331-1.59.833-3.52 1.211-5.677 1.211-1.25 0-2.499-.113-3.823-.303-1.325-.227-2.423-.492-3.255-.794v-6.132a12.125 12.125 0 0 0 5.829 1.476c1.362 0 2.384-.265 3.103-.757.682-.492 1.022-1.173 1.022-2.082 0-1.93-1.59-2.914-4.845-2.914-1.59 0-3.103.151-4.466.454l.984-15.897h14.951v6.131h-8.857l-.265 3.71c.72-.076 1.4-.114 2.006-.114 2.612 0 4.618.72 6.094 2.12 1.476 1.362 2.195 3.293 2.195 5.677zM299.995 44.117c0 2.157-.643 3.898-1.892 5.185-1.287 1.325-2.99 1.969-5.148 1.969-2.006 0-3.596-.606-4.807-1.855-1.173-1.211-1.779-2.801-1.779-4.807 0-2.196.644-3.937 1.93-5.224 1.25-1.286 2.99-1.93 5.11-1.93 2.044 0 3.634.568 4.845 1.741 1.173 1.174 1.741 2.801 1.741 4.92zm-4.845.227c0-.87-.151-1.552-.492-2.044-.34-.492-.795-.757-1.362-.757-.644 0-1.136.265-1.476.795-.341.53-.53 1.211-.53 2.12 0 .87.151 1.513.492 2.005.302.493.757.72 1.4.72.644 0 1.136-.265 1.476-.757.341-.492.492-1.174.492-2.082zm-15.821 6.548h-5.83l17.034-26.495h5.829l-17.033 26.495zm4.05-20.174c0 2.195-.644 3.936-1.893 5.223-1.287 1.287-2.99 1.93-5.11 1.93-2.006 0-3.595-.605-4.807-1.854-1.173-1.211-1.778-2.801-1.778-4.807 0-2.158.605-3.899 1.854-5.224 1.25-1.324 2.99-1.968 5.148-1.968 2.044 0 3.634.606 4.845 1.78 1.173 1.21 1.74 2.838 1.74 4.92zm-4.845.189c0-.833-.151-1.514-.492-2.006-.303-.492-.757-.757-1.325-.757-.643 0-1.135.265-1.476.795-.34.53-.53 1.21-.53 2.12 0 .87.151 1.513.492 2.005.303.492.757.72 1.4.72a1.68 1.68 0 0 0 1.439-.757c.303-.492.492-1.174.492-2.12z" fill="#2794da" fill-rule="nonzero"/><g fill="#fff" fill-rule="nonzero"><path d="M19.775 42.868c0 1.779-.454 3.293-1.4 4.617-.947 1.287-2.271 2.271-3.975 2.915-1.703.643-3.747.946-6.132.946-2.763 0-5.299-.454-7.607-1.4v-7.268c1.097.833 2.308 1.477 3.671 1.969 1.325.492 2.574.757 3.747.757.87 0 1.552-.152 2.044-.455.492-.34.72-.794.72-1.4 0-.416-.114-.795-.38-1.136-.226-.34-.605-.643-1.059-.908-.492-.303-1.4-.681-2.725-1.173C2.402 38.704.282 36.055.282 32.383c0-2.536.984-4.618 2.915-6.132 1.968-1.552 4.58-2.309 7.835-2.309.946 0 1.779.038 2.573.114.757.076 1.477.151 2.12.265.606.114 1.514.34 2.65.643v6.738c-2.234-1.211-4.429-1.817-6.586-1.817-.871 0-1.59.151-2.12.492-.568.34-.833.795-.833 1.363 0 .567.227 1.022.644 1.4.454.34 1.362.833 2.763 1.4 2.763 1.098 4.693 2.31 5.829 3.634 1.135 1.325 1.703 2.877 1.703 4.694zM39.638 50.892l-1.173-4.883h-7.911l-1.25 4.883h-8.629l9.122-26.495h9.917l8.592 26.495h-8.668zM34.604 30.15h-.19c-.037.303-.113.795-.264 1.476-.152.681-.87 3.558-2.233 8.706h5.072l-1.855-7.192a23.777 23.777 0 0 1-.53-2.99zM51.41 50.892V24.397h7.986v20.25h9.122v6.245H51.41zM71.887 50.892V24.397H88.39v6.245h-8.517v3.86h7.987v6.246h-7.987v3.899h9.122v6.245H71.887zM100.19 41.96h-6.32l-.985-17.563h8.29l-.985 17.562zm1.287 5.639c0 1.098-.416 2.006-1.21 2.687-.796.72-1.856 1.06-3.18 1.06-1.287 0-2.347-.34-3.18-1.06-.795-.719-1.211-1.627-1.211-2.687 0-1.098.378-1.968 1.173-2.612.795-.681 1.893-1.022 3.218-1.022 1.324 0 2.384.341 3.18 1.022.794.644 1.21 1.514 1.21 2.612z"/></g><g fill="#fff" fill-rule="nonzero"><path d="M10.719 8.905c0 1.237-.43 2.186-1.29 2.85-.86.663-2.097 1.003-3.71 1.003H.002V.214h5.323c3.333 0 5 1.003 5 3.028 0 .448-.108.843-.323 1.201-.197.376-.52.699-.95.968a3.9 3.9 0 0 1-1.415.555v.036c.59.072 1.129.25 1.594.538.484.268.843.627 1.112 1.057.25.412.376.86.376 1.308zm-4.409-5c0-.77-.609-1.164-1.827-1.164h-.7v2.365h1.094c.412 0 .752-.107 1.021-.34.27-.215.412-.502.412-.86zm.395 4.982c0-.358-.126-.663-.395-.896-.268-.233-.609-.34-1.039-.34H3.784v2.562h1.254c.52 0 .914-.125 1.219-.358.304-.233.448-.556.448-.968zM12.384 12.758V.214h3.782V9.8h4.318v2.957h-8.1zM29.947 12.758l-.556-2.312h-3.745l-.592 2.312h-4.086L25.288.214h4.694l4.068 12.544h-4.103zm-2.384-9.82h-.09a7.606 7.606 0 0 1-.125.699c-.072.322-.412 1.684-1.057 4.121h2.401l-.878-3.405a11.257 11.257 0 0 1-.25-1.415zM44.856 12.418c-1.04.376-2.24.555-3.602.555-1.326 0-2.49-.25-3.459-.77a5.15 5.15 0 0 1-2.204-2.169c-.52-.95-.77-2.025-.77-3.261 0-1.326.286-2.51.86-3.53A6.001 6.001 0 0 1 38.1.84c1.04-.556 2.24-.842 3.602-.842 1.093 0 2.133.125 3.154.394v3.494a4.162 4.162 0 0 0-1.254-.483 5.79 5.79 0 0 0-1.47-.18c-1.021 0-1.828.287-2.437.879-.591.59-.878 1.397-.878 2.4 0 1.004.287 1.793.878 2.366.61.592 1.398.878 2.383.878.914 0 1.846-.233 2.778-.698v3.369zM53.742 12.758l-2.778-5.304c-.197-.413-.305-.7-.34-.86h-.036v6.164h-3.782V.214h3.782V6.18h.036c.107-.322.232-.609.376-.878l2.509-5.09h4.48L54.423 6.2l3.906 6.559h-4.587zM67.93 3.17V5.43h3.728v2.956h-3.727v4.373h-3.782V.214h7.868V3.17H67.93zM80.35 12.758l-.931-2.706c-.18-.538-.412-.95-.7-1.254-.304-.305-.608-.448-.949-.448h-.143v4.408h-3.782V.214h5.018c1.756 0 3.047.287 3.889.86.842.573 1.254 1.434 1.254 2.58 0 .86-.233 1.595-.734 2.169-.484.591-1.201 1.003-2.169 1.272v.036c.538.161.968.43 1.326.789.359.376.663.913.95 1.648l1.237 3.19H80.35zm-.358-8.566c0-.412-.125-.753-.376-1.003-.269-.233-.663-.359-1.219-.359h-.77v2.867h.68c.502 0 .915-.143 1.22-.43.304-.286.465-.645.465-1.075zM86.07.214h3.78v12.544h-3.78zM104.144 6.325c0 1.272-.269 2.4-.807 3.369-.52.985-1.29 1.738-2.275 2.276-1.004.52-2.133.788-3.441.788h-5.305V.214h5.197c4.427 0 6.63 2.043 6.63 6.11zm-4.014.035c0-.609-.126-1.164-.377-1.648a2.626 2.626 0 0 0-1.057-1.147c-.466-.269-1.003-.394-1.63-.394h-.968V9.8h1.057c.896 0 1.63-.304 2.168-.932.538-.627.807-1.451.807-2.509zM113.782 12.758l-.556-2.312h-3.745l-.592 2.312h-4.086l4.32-12.544h4.694l4.068 12.544h-4.103zm-2.384-9.82h-.09a7.606 7.606 0 0 1-.125.699c-.072.322-.412 1.684-1.057 4.121h2.401l-.878-3.405a11.257 11.257 0 0 1-.25-1.415zM125.771 8.403v4.355h-3.781v-4.3L118.119.213h4.337l1.362 3.942c.09.27.16.502.197.7.036.196.071.393.125.608h.036c.072-.537.161-.95.25-1.236l1.345-4.014h3.996l-3.996 8.19zM144.205 12.776l-.735-.86c-.394.304-.95.555-1.648.752a6.862 6.862 0 0 1-2.025.305c-1.434 0-2.545-.305-3.334-.932-.788-.61-1.182-1.487-1.182-2.598 0-.663.233-1.29.716-1.9.484-.591 1.201-1.129 2.187-1.63-.843-.914-1.255-1.846-1.255-2.76 0-.932.359-1.703 1.093-2.276.735-.592 1.685-.878 2.868-.878 1.11 0 2.007.269 2.688.788.68.52 1.021 1.219 1.021 2.079 0 .699-.197 1.29-.61 1.792-.393.502-1.039.968-1.917 1.362l1.792 2.025c.251-.52.395-1.237.395-2.133h2.849c0 .843-.125 1.613-.358 2.276-.233.681-.628 1.29-1.165 1.846l2.509 2.742h-3.89zm-2.491-9.713a.88.88 0 0 0-.269-.645.88.88 0 0 0-.645-.269c-.287 0-.52.09-.699.233-.179.161-.269.376-.269.663 0 .18.054.359.162.556.107.197.358.502.752.95.359-.216.61-.448.753-.681.143-.251.215-.502.215-.807zm-2.222 4.373c-.251.125-.448.322-.61.609-.179.287-.25.61-.25.968 0 .501.161.896.484 1.2.34.287.734.448 1.218.448a2.547 2.547 0 0 0 1.56-.52l-2.402-2.705zM163.535 12.418c-1.04.376-2.24.555-3.602.555-1.326 0-2.49-.25-3.459-.77a5.15 5.15 0 0 1-2.204-2.169c-.52-.95-.77-2.025-.77-3.261 0-1.326.286-2.51.86-3.53A6.001 6.001 0 0 1 156.779.84c1.04-.556 2.24-.842 3.602-.842 1.093 0 2.133.125 3.154.394v3.494a4.162 4.162 0 0 0-1.254-.483 5.79 5.79 0 0 0-1.47-.18c-1.021 0-1.828.287-2.437.879-.591.59-.878 1.397-.878 2.4 0 1.004.287 1.793.878 2.366.61.592 1.398.878 2.383.878.914 0 1.846-.233 2.778-.698v3.369zM171.902 8.403v4.355h-3.781v-4.3L164.25.213h4.337l1.362 3.942c.09.27.16.502.197.7.036.196.071.393.125.608h.036c.072-.537.161-.95.25-1.236l1.345-4.014h3.996l-3.996 8.19zM187.849 8.905c0 1.237-.43 2.186-1.29 2.85-.86.663-2.097 1.003-3.71 1.003h-5.717V.214h5.323c3.333 0 5 1.003 5 3.028 0 .448-.108.843-.323 1.201-.197.376-.52.699-.95.968a3.9 3.9 0 0 1-1.415.555v.036c.59.072 1.129.25 1.594.538.484.268.843.627 1.112 1.057.25.412.376.86.376 1.308zm-4.409-5c0-.77-.609-1.164-1.827-1.164h-.7v2.365h1.094c.412 0 .752-.107 1.021-.34.27-.215.412-.502.412-.86zm.395 4.982c0-.358-.126-.663-.395-.896-.268-.233-.609-.34-1.039-.34h-1.487v2.562h1.254c.52 0 .914-.125 1.219-.358.304-.233.448-.556.448-.968zM189.513 12.758V.214h7.814V3.17h-4.032v1.828h3.78v2.956h-3.78v1.846h4.318v2.957h-8.1zM205.906 12.758l-.932-2.706c-.18-.538-.412-.95-.7-1.254-.304-.305-.608-.448-.949-.448h-.143v4.408H199.4V.214h5.018c1.756 0 3.047.287 3.889.86.842.573 1.254 1.434 1.254 2.58 0 .86-.233 1.595-.734 2.169-.484.591-1.201 1.003-2.169 1.272v.036c.538.161.968.43 1.326.789.359.376.663.913.95 1.648l1.237 3.19h-4.265zm-.359-8.566c0-.412-.125-.753-.376-1.003-.269-.233-.663-.359-1.219-.359h-.77v2.867h.68c.502 0 .915-.143 1.22-.43.304-.286.465-.645.465-1.075zM228.09 12.758V5.877c0-.646.018-1.362.054-2.133l.036-.573h-.108c-.179.985-.322 1.666-.43 2.043l-1.845 7.544h-3.549l-1.935-7.455c-.054-.179-.197-.896-.412-2.132h-.108c.09 1.953.126 3.19.126 3.673v5.914h-3.316V.214h5.663l1.72 6.81c.036.143.09.43.162.86.072.43.107.752.125.985h.054c.072-.52.161-1.147.305-1.881l1.613-6.774h5.573v12.544h-3.728zM246.222 6.45c0 1.254-.268 2.383-.824 3.387a5.837 5.837 0 0 1-2.258 2.312c-.985.555-2.079.824-3.28.824-1.182 0-2.257-.269-3.225-.788a5.774 5.774 0 0 1-2.24-2.258c-.538-.968-.806-2.061-.806-3.28 0-1.272.268-2.42.806-3.44A5.723 5.723 0 0 1 236.689.84c.968-.556 2.079-.842 3.333-.842 1.2 0 2.276.269 3.226.806a5.508 5.508 0 0 1 2.204 2.276c.502.986.77 2.115.77 3.37zm-4.014.108c0-1.04-.197-1.846-.591-2.438-.394-.609-.932-.896-1.63-.896-.754 0-1.345.287-1.757.86-.412.574-.627 1.38-.627 2.42 0 1.021.215 1.81.627 2.383.412.574.986.86 1.702.86.43 0 .825-.125 1.183-.376.34-.269.61-.627.807-1.111.197-.484.286-1.04.286-1.702zM256.763 12.758l-4.427-6.057c-.34-.484-.627-.914-.86-1.29h-.036c.036.609.054 1.308.054 2.078v5.269h-3.495V.214h3.567l4.247 5.752.412.592c.09.107.161.233.215.322.072.108.125.197.161.287h.036c-.036-.251-.054-.699-.054-1.326V.214h3.495v12.544h-3.315zM274.378 6.325c0 1.272-.269 2.4-.807 3.369-.52.985-1.29 1.738-2.275 2.276-1.004.52-2.133.788-3.441.788h-5.305V.214h5.197c4.427 0 6.63 2.043 6.63 6.11zm-4.014.035c0-.609-.126-1.164-.377-1.648a2.626 2.626 0 0 0-1.057-1.147c-.466-.269-1.003-.394-1.63-.394h-.968V9.8h1.057c.896 0 1.63-.304 2.168-.932.538-.627.807-1.451.807-2.509zM284.017 12.758l-.556-2.312h-3.745l-.592 2.312h-4.086l4.32-12.544h4.694l4.068 12.544h-4.103zm-2.384-9.82h-.09a7.606 7.606 0 0 1-.125.699c-.072.322-.412 1.684-1.057 4.121h2.401l-.878-3.405a11.257 11.257 0 0 1-.25-1.415zM296.004 8.403v4.355h-3.781v-4.3L288.352.213h4.337l1.362 3.942c.09.27.16.502.197.7.036.196.071.393.125.608h.036c.072-.537.161-.95.25-1.236l1.345-4.014H300l-3.996 8.19z"/></g></svg>
assets/images/promo/edd-25-percent-off.png CHANGED
Binary file
assets/images/screenshots/17checkout.png CHANGED
Binary file
assets/images/screenshots/17direct.png CHANGED
Binary file
assets/images/screenshots/17quantities.png CHANGED
Binary file
assets/images/screenshots/18-button-colors.png CHANGED
Binary file
assets/images/screenshots/18cart-saving.png CHANGED
Binary file
assets/images/screenshots/20-discount.png CHANGED
Binary file
assets/images/screenshots/20-register-login.png CHANGED
Binary file
assets/images/screenshots/20-sequential.png CHANGED
Binary file
assets/images/screenshots/20-unlimited-downloads.png CHANGED
Binary file
assets/images/screenshots/22-logs.png CHANGED
Binary file
assets/images/screenshots/22-purchased-downloads.png CHANGED
Binary file
assets/images/screenshots/22-purchased-downloads2.png CHANGED
Binary file
assets/images/screenshots/22-quantity.png CHANGED
Binary file
assets/images/screenshots/24-category-earnings.png CHANGED
Binary file
assets/images/screenshots/24-checkout.png CHANGED
Binary file
assets/images/screenshots/24-export.png CHANGED
Binary file
assets/images/screenshots/26-customer.png CHANGED
Binary file
assets/images/screenshots/26-import.png CHANGED
Binary file
assets/images/screenshots/26-refund.png CHANGED
Binary file
assets/images/screenshots/bundles.png CHANGED
Binary file
assets/images/screenshots/customer-ui.png CHANGED
Binary file
assets/images/screenshots/edit-download.png CHANGED
Binary file
assets/images/screenshots/email-template-21.png CHANGED
Binary file
assets/images/screenshots/grid.png CHANGED
Binary file
assets/images/screenshots/order-details.png CHANGED
Binary file
assets/images/screenshots/product-earnings.png CHANGED
Binary file
assets/images/screenshots/product-tax.png CHANGED
Binary file
assets/images/screenshots/purchase-link.png CHANGED
Binary file
assets/images/screenshots/tax-rates.png CHANGED
Binary file
assets/images/ui-icons_21759b_256x240.png CHANGED
Binary file
assets/images/ui-icons_999999_256x240.png CHANGED
Binary file
assets/js/admin-paypal-connect.js ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery( document ).ready( function ( $ ) {
2
+ /**
3
+ * Connect to PayPal
4
+ */
5
+ $( '#edd-paypal-commerce-connect' ).on( 'click', function ( e ) {
6
+ e.preventDefault();
7
+
8
+ // Clear errors.
9
+ var errorContainer = $( '#edd-paypal-commerce-errors' );
10
+ errorContainer.empty().removeClass( 'notice notice-error' );
11
+
12
+ var button = document.getElementById( 'edd-paypal-commerce-connect' );
13
+ button.classList.add( 'updating-message' );
14
+ button.disabled = true;
15
+
16
+ $.post( ajaxurl, {
17
+ action: 'edd_paypal_commerce_connect',
18
+ _ajax_nonce: $( this ).data( 'nonce' )
19
+ }, function( response ) {
20
+ if ( ! response.success ) {
21
+ console.log( 'Connection failure', response.data );
22
+ button.classList.remove( 'updating-message' );
23
+ button.disabled = false;
24
+
25
+ // Set errors.
26
+ errorContainer.html( '<p>' + response.data + '</p>' ).addClass( 'notice notice-error' );
27
+ return;
28
+ }
29
+
30
+ var paypalLinkEl = document.getElementById( 'edd-paypal-commerce-link' );
31
+ paypalLinkEl.href = response.data.signupLink + '&displayMode=minibrowser';
32
+
33
+ paypalLinkEl.click();
34
+ } );
35
+ } );
36
+
37
+ /**
38
+ * Checks the PayPal connection & webhook status.
39
+ */
40
+ function eddPayPalGetAccountStatus() {
41
+ var accountInfoEl = document.getElementById( 'edd-paypal-commerce-connect-wrap' );
42
+ if ( accountInfoEl ) {
43
+ $.post( ajaxurl, {
44
+ action: 'edd_paypal_commerce_get_account_info',
45
+ _ajax_nonce: accountInfoEl.getAttribute( 'data-nonce' )
46
+ }, function( response ) {
47
+ var newHtml = '<p>' + eddPayPalConnectVars.defaultError + '</p>';
48
+
49
+ if ( response.success ) {
50
+ newHtml = response.data.account_status;
51
+
52
+ if ( response.data.actions && response.data.actions.length ) {
53
+ newHtml += '<p class="edd-paypal-connect-actions">' + response.data.actions.join( ' ' ) + '</p>';
54
+ }
55
+ } else if ( response.data && response.data.message ) {
56
+ newHtml = response.data.message;
57
+ }
58
+
59
+ accountInfoEl.innerHTML = newHtml;
60
+
61
+ // Remove old status messages.
62
+ accountInfoEl.classList.remove( 'notice-success', 'notice-warning', 'notice-error' );
63
+
64
+ // Add new one.
65
+ var newClass = response.success && response.data.status ? 'notice-' + response.data.status : 'notice-error';
66
+ accountInfoEl.classList.add( newClass );
67
+ } );
68
+ }
69
+ }
70
+ eddPayPalGetAccountStatus();
71
+
72
+ /**
73
+ * Create webhook
74
+ */
75
+ $( document ).on( 'click', '.edd-paypal-connect-action', function ( e ) {
76
+ e.preventDefault();
77
+
78
+ var button = $( this );
79
+ button.prop( 'disabled', true );
80
+ button.addClass( 'updating-message' );
81
+
82
+ var errorWrap = $( '#edd-paypal-commerce-connect-wrap' ).find( '.edd-paypal-actions-error-wrap' );
83
+ if ( errorWrap.length ) {
84
+ errorWrap.remove();
85
+ }
86
+
87
+ $.post( ajaxurl, {
88
+ action: button.data( 'action' ),
89
+ _ajax_nonce: button.data( 'nonce' )
90
+ }, function( response ) {
91
+ button.prop( 'disabled', false );
92
+ button.removeClass( 'updating-message' );
93
+
94
+ if ( response.success ) {
95
+ button.addClass( 'updated-message' );
96
+
97
+ // Refresh account status.
98
+ eddPayPalGetAccountStatus();
99
+ } else {
100
+ button.parent().after( '<p class="edd-paypal-actions-error-wrap">' + response.data + '</p>' );
101
+ }
102
+ } );
103
+ } );
104
+ } );
105
+
106
+ function eddPayPalOnboardingCallback( authCode, shareId ) {
107
+ var connectButton = document.getElementById( 'edd-paypal-commerce-connect' );
108
+ var errorContainer = document.getElementById( 'edd-paypal-commerce-errors' );
109
+
110
+ jQuery.post( ajaxurl, {
111
+ action: 'edd_paypal_commerce_get_access_token',
112
+ auth_code: authCode,
113
+ share_id: shareId,
114
+ _ajax_nonce: connectButton.getAttribute( 'data-nonce' )
115
+ }, function( response ) {
116
+ connectButton.classList.remove( 'updating-message' );
117
+
118
+ if ( ! response.success ) {
119
+ connectButton.disabled = false;
120
+
121
+ errorContainer.innerHTML = '<p>' + response.data + '</p>';
122
+ errorContainer.classList.add( 'notice notice-error' );
123
+ return;
124
+ }
125
+
126
+ connectButton.classList.add( 'updated-message' );
127
+
128
+ window.location.reload();
129
+ } );
130
+ }
assets/js/admin-paypal-connect.min.js ADDED
@@ -0,0 +1 @@
 
1
+ function eddPayPalOnboardingCallback(authCode,shareId){var connectButton=document.getElementById("edd-paypal-commerce-connect"),errorContainer=document.getElementById("edd-paypal-commerce-errors");jQuery.post(ajaxurl,{action:"edd_paypal_commerce_get_access_token",auth_code:authCode,share_id:shareId,_ajax_nonce:connectButton.getAttribute("data-nonce")},function(response){if(connectButton.classList.remove("updating-message"),!response.success)return connectButton.disabled=!1,errorContainer.innerHTML="<p>"+response.data+"</p>",void errorContainer.classList.add("notice notice-error");connectButton.classList.add("updated-message"),window.location.reload()})}jQuery(document).ready(function($){function eddPayPalGetAccountStatus(){var accountInfoEl=document.getElementById("edd-paypal-commerce-connect-wrap");accountInfoEl&&$.post(ajaxurl,{action:"edd_paypal_commerce_get_account_info",_ajax_nonce:accountInfoEl.getAttribute("data-nonce")},function(response){var newHtml="<p>"+eddPayPalConnectVars.defaultError+"</p>";response.success?(newHtml=response.data.account_status,response.data.actions&&response.data.actions.length&&(newHtml+='<p class="edd-paypal-connect-actions">'+response.data.actions.join(" ")+"</p>")):response.data&&response.data.message&&(newHtml=response.data.message),accountInfoEl.innerHTML=newHtml,accountInfoEl.classList.remove("notice-success","notice-warning","notice-error");var newClass=response.success&&response.data.status?"notice-"+response.data.status:"notice-error";accountInfoEl.classList.add(newClass)})}$("#edd-paypal-commerce-connect").on("click",function(e){e.preventDefault();var errorContainer=$("#edd-paypal-commerce-errors");errorContainer.empty().removeClass("notice notice-error");var button=document.getElementById("edd-paypal-commerce-connect");button.classList.add("updating-message"),button.disabled=!0,$.post(ajaxurl,{action:"edd_paypal_commerce_connect",_ajax_nonce:$(this).data("nonce")},function(response){if(!response.success)return console.log("Connection failure",response.data),button.classList.remove("updating-message"),button.disabled=!1,void errorContainer.html("<p>"+response.data+"</p>").addClass("notice notice-error");var paypalLinkEl=document.getElementById("edd-paypal-commerce-link");paypalLinkEl.href=response.data.signupLink+"&displayMode=minibrowser",paypalLinkEl.click()})}),eddPayPalGetAccountStatus(),$(document).on("click",".edd-paypal-connect-action",function(e){e.preventDefault();var button=$(this);button.prop("disabled",!0),button.addClass("updating-message");var errorWrap=$("#edd-paypal-commerce-connect-wrap").find(".edd-paypal-actions-error-wrap");errorWrap.length&&errorWrap.remove(),$.post(ajaxurl,{action:button.data("action"),_ajax_nonce:button.data("nonce")},function(response){button.prop("disabled",!1),button.removeClass("updating-message"),response.success?(button.addClass("updated-message"),eddPayPalGetAccountStatus()):button.parent().after('<p class="edd-paypal-actions-error-wrap">'+response.data+"</p>")})})});
assets/js/admin-scripts.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function($){edd_attach_tooltips($(".edd-help-tip"));var EDD_Download_Configuration={init:function(){this.add(),this.move(),this.remove(),this.type(),this.prices(),this.files(),this.updatePrices()},clone_repeatable:function(row){var key;highest=1;return row.parent().find(".edd_repeatable_row").each(function(){var current=$(this).data("key");parseInt(current)>highest&&(highest=current)}),key=highest+=1,clone=row.clone(),clone.removeClass("edd_add_blank"),clone.attr("data-key",key),clone.find("input, select, textarea").val("").each(function(){var name=$(this).attr("name"),id=$(this).attr("id");name&&(name=name.replace(/\[(\d+)\]/,"["+parseInt(key)+"]"),$(this).attr("name",name)),$(this).attr("data-key",key),void 0!==id&&(id=id.replace(/(\d+)/,parseInt(key)),$(this).attr("id",id))}),clone.find("select").each(function(){$(this).val(row.find('select[name="'+$(this).attr("name")+'"]').val())}),clone.find('input[type="checkbox"]').each(function(){$(this).is(":checked")&&$(this).prop("checked",!1),$(this).val(1)}),clone.find("span.edd_price_id").each(function(){$(this).text(parseInt(key))}),clone.find("span.edd_file_id").each(function(){$(this).text(parseInt(key))}),clone.find(".edd_repeatable_default_input").each(function(){$(this).val(parseInt(key)).removeAttr("checked")}),clone.find(".edd_repeatable_condition_field").each(function(){$(this).find("option:eq(0)").prop("selected","selected")}),clone.find(".search-choice").remove(),clone.find(".chosen-container").remove(),edd_attach_tooltips(clone.find(".edd-help-tip")),clone},add:function(){$(document.body).on("click",".submit .edd_add_repeatable",function(clone){clone.preventDefault();var row=$(this).parent().parent().prev(".edd_repeatable_row"),clone=EDD_Download_Configuration.clone_repeatable(row);clone.insertAfter(row).find("input, textarea, select").filter(":visible").eq(0).focus(),clone.find(".edd-select-chosen").chosen({inherit_select_classes:!0,placeholder_text_single:edd_vars.one_option,placeholder_text_multiple:edd_vars.one_or_more_option}),clone.find(".edd-select-chosen").css("width","100%"),clone.find(".edd-select-chosen .chosen-search input").attr("placeholder",edd_vars.search_placeholder)})},move:function(){$(".edd_repeatable_table .edd-repeatables-wrap").sortable({handle:".edd-draghandle-anchor",items:".edd_repeatable_row",opacity:.6,cursor:"move",axis:"y",update:function(){var count=0;$(this).find(".edd_repeatable_row").each(function(){$(this).find("input.edd_repeatable_index").each(function(){$(this).val(count)}),count++})}})},remove:function(){$(document.body).on("click",".edd-remove-row, .edd_remove_repeatable",function(firstFocusable){firstFocusable.preventDefault();var row=$(this).parents(".edd_repeatable_row"),count=row.parent().find(".edd_repeatable_row").length,type=$(this).data("type"),repeatable="div.edd_repeatable_"+type+"s",price_row_id=$(this).is(".ui-sortable .edd_repeatable_row:first-child .edd-remove-row, .ui-sortable .edd_repeatable_row:first-child .edd_remove_repeatable")?row.next(".edd_repeatable_row"):row.prev(".edd_repeatable_row"),firstFocusable=price_row_id.find("select, input, textarea, button").filter(":visible").eq(0);if("price"===type&&(price_row_id=row.data("key"),$('.edd_repeatable_condition_field option[value="'+price_row_id+'"]').remove()),1<count)$("input, select",row).val(""),row.fadeOut("fast").remove(),firstFocusable.focus();else switch(type){case"price":alert(edd_vars.one_price_min);break;case"file":$("input, select",row).val("");break;default:alert(edd_vars.one_field_min)}$(repeatable).each(function(rowIndex){$(this).find("input, select").each(function(){var name=(name=$(this).attr("name")).replace(/\[(\d+)\]/,"["+rowIndex+"]");$(this).attr("name",name).attr("id",name)})})})},type:function(){$(document.body).on("change","#_edd_product_type",function(e){var edd_products=$("#edd_products"),edd_download_files=$("#edd_download_files"),edd_download_limit_wrap=$("#edd_download_limit_wrap");"bundle"===$(this).val()?(edd_products.show(),edd_download_files.hide(),edd_download_limit_wrap.hide()):(edd_products.hide(),edd_download_files.show(),edd_download_limit_wrap.show())})},prices:function(){$(document.body).on("change","#edd_variable_pricing",function(e){var checked=$(this).is(":checked"),single=$("#edd_regular_price_field"),variable=$("#edd_variable_price_fields, .edd_repeatable_table .pricing"),bundleRow=$(".edd-bundled-product-row, .edd-repeatable-row-standard-fields");checked?(single.hide(),variable.show(),bundleRow.addClass("has-variable-pricing")):(single.show(),variable.hide(),bundleRow.removeClass("has-variable-pricing"))})},files:function(){var file_frame;window.formfield="",$(document.body).on("click",".edd_upload_file_button",function(button){button.preventDefault();button=$(this);window.formfield=$(this).closest(".edd_repeatable_upload_wrapper"),file_frame||((file_frame=wp.media.frames.file_frame=wp.media({frame:"post",state:"insert",title:button.data("uploader-title"),button:{text:button.data("uploader-button-text")},multiple:"0"!=$(this).data("multiple")})).on("menu:render:default",function(view){view.unset("library-separator"),view.unset("gallery"),view.unset("featured-image"),view.unset("embed"),view.set({})}),file_frame.on("insert",function(){file_frame.state().get("selection").each(function(attachment,clone){var row,selectedSize="image"===(attachment=attachment.toJSON()).type&&$(".attachment-display-settings .size option:selected").val(),selectedURL=attachment.url,selectedName=0<attachment.title.length?attachment.title:attachment.filename;selectedSize&&void 0!==attachment.sizes[selectedSize]&&(selectedURL=attachment.sizes[selectedSize].url),"image"===attachment.type&&(selectedName=selectedSize&&void 0!==attachment.sizes[selectedSize]?selectedName+"-"+attachment.sizes[selectedSize].width+"x"+attachment.sizes[selectedSize].height:selectedName+"-"+attachment.width+"x"+attachment.height),0===clone?(window.formfield.find(".edd_repeatable_attachment_id_field").val(attachment.id),window.formfield.find(".edd_repeatable_thumbnail_size_field").val(selectedSize),window.formfield.find(".edd_repeatable_upload_field").val(selectedURL),window.formfield.find(".edd_repeatable_name_field").val(selectedName)):(row=window.formfield,(clone=EDD_Download_Configuration.clone_repeatable(row)).find(".edd_repeatable_attachment_id_field").val(attachment.id),clone.find(".edd_repeatable_thumbnail_size_field").val(selectedSize),clone.find(".edd_repeatable_upload_field").val(selectedURL),clone.find(".edd_repeatable_name_field").val(selectedName),clone.insertAfter(row))})})),file_frame.open()}),window.formfield=""},updatePrices:function(){$("#edd_price_fields").on("keyup",".edd_variable_prices_name",function(){var key=$(this).parents(".edd_repeatable_row").data("key"),name=$(this).val(),field_option=$(".edd_repeatable_condition_field option[value="+key+"]");0<field_option.length?field_option.text(name):$(".edd_repeatable_condition_field").append($("<option></option>").attr("value",key).text(name))})}};$(document.body).on("click",".toggle-custom-price-option-section",function(header){header.preventDefault();var show=$(this).html()==edd_vars.show_advanced_settings;show?$(this).html(edd_vars.hide_advanced_settings):$(this).html(edd_vars.show_advanced_settings);header=$(this).parents(".edd-repeatable-row-header");header.siblings(".edd-custom-price-option-sections-wrap").slideToggle(),$(":input:not(input[type=button],input[type=submit],button):visible:first",show?header.siblings(".edd-custom-price-option-sections-wrap"):header.siblings(".edd-repeatable-row-standard-fields")).focus()}),EDD_Download_Configuration.init();var typingTimer,edd_datepicker=$(".edd_datepicker");0<edd_datepicker.length&&edd_datepicker.datepicker({dateFormat:"mm/dd/yy"}),{init:function(){this.edit_address(),this.remove_download(),this.add_download(),this.change_customer(),this.new_customer(),this.edit_price(),this.recalculate_total(),this.variable_prices_check(),this.add_note(),this.remove_note(),this.resend_receipt(),this.copy_download_link()},edit_address:function(){$('select[name="edd-payment-address[0][country]"]').change(function(){var data=$(this),data={action:"edd_get_shop_states",country:data.val(),nonce:data.data("nonce"),field_name:"edd-payment-address[0][state]"};return $.post(ajaxurl,data,function(response){var state_wrapper=$("#edd-order-address-state-wrap select, #edd-order-address-state-wrap input");$("#edd-order-address-state-wrap .chosen-container").remove(),"nostates"==response?state_wrapper.replaceWith('<input type="text" name="edd-payment-address[0][state]" value="" class="edd-edit-toggles medium-text"/>'):state_wrapper.replaceWith(response)}),!1})},remove_download:function(){$("#edd-purchased-files").on("click",".edd-order-remove-download",function(){var key,download_id,price_id,quantity,amount,fees,currently_removed;return 1===$(document.body).find("#edd-purchased-files > .row:not(.header)").length?alert(edd_vars.one_download_min):confirm(edd_vars.delete_payment_download)&&(key=$(this).data("key"),$(".edd-payment-id").val(),download_id=$('input[name="edd-payment-details-downloads['+key+'][id]"]').val(),price_id=$('input[name="edd-payment-details-downloads['+key+'][price_id]"]').val(),quantity=$('input[name="edd-payment-details-downloads['+key+'][quantity]"]').val(),amount=$('input[name="edd-payment-details-downloads['+key+'][amount]"]').val(),$('input[name="edd-payment-details-downloads['+key+'][tax]"]').length&&(fees=$('input[name="edd-payment-details-downloads['+key+'][tax]"]').val()),$('input[name="edd-payment-details-downloads['+key+'][fees]"]').length&&(fees=$.parseJSON($('input[name="edd-payment-details-downloads['+key+'][fees]"]').val())),currently_removed=$('input[name="edd-payment-removed"]').val(),(currently_removed=(currently_removed=$.parseJSON(currently_removed)).length<1?{}:currently_removed)[key]=[{id:download_id,price_id:price_id,quantity:quantity,amount:amount,cart_index:key}],$('input[name="edd-payment-removed"]').val(JSON.stringify(currently_removed)),$(this).parent().parent().remove(),fees&&fees.length&&$.each(fees,function(key,value){$('*li[data-fee-id="'+value+'"]').remove()}),$("#edd-payment-downloads-changed").val(1),$(".edd-order-payment-recalc-totals").show()),!1})},change_customer:function(){$("#edd-customer-details").on("click",".edd-payment-change-customer, .edd-payment-change-customer-cancel",function(cancel){cancel.preventDefault();var change_customer=$(this).hasClass("edd-payment-change-customer"),cancel=$(this).hasClass("edd-payment-change-customer-cancel");change_customer?($(".customer-info").hide(),$(".change-customer").show(),$(".edd-payment-change-customer-input").css("width","auto")):cancel&&($(".customer-info").show(),$(".change-customer").hide())})},new_customer:function(){$("#edd-customer-details").on("click",".edd-payment-new-customer, .edd-payment-new-customer-cancel",function(cancel){cancel.preventDefault();var new_customer=$(this).hasClass("edd-payment-new-customer"),cancel=$(this).hasClass("edd-payment-new-customer-cancel");new_customer?($(".customer-info").hide(),$(".new-customer").show()):cancel&&($(".customer-info").show(),$(".new-customer").hide());new_customer=$("#edd-new-customer");$(".new-customer").is(":visible")?new_customer.val(1):new_customer.val(0)})},add_download:function(){$(".edd-edit-purchase-element").on("click","#edd-order-add-download",function(download_title){download_title.preventDefault();var quantity=$("#edd_order_download_select"),item_price=$("#edd-order-download-quantity"),item_total=$("#edd-order-download-price"),price_id=$("#edd-order-download-tax"),clone=$(".edd_price_options_select option:selected"),download_id=quantity.val(),download_title=quantity.find(":selected").text(),quantity=item_price.val(),item_price=item_total.val(),item_total=price_id.val(),price_id=clone.val(),clone=clone.text();if(download_id<1)return!1;if(item_price=item_price||0,item_price=parseFloat(item_price),isNaN(item_price))return alert(edd_vars.numeric_item_price),!1;if(item_total=parseFloat(item_total),isNaN(item_total))return alert(edd_vars.numeric_item_tax),!1;if(isNaN(parseInt(quantity)))return alert(edd_vars.numeric_quantity),!1;clone&&(download_title=download_title+" - "+clone);var count=$("#edd-purchased-files div.row:not(.edd-purchased-files-header)").length;0==count&&alert(edd_vars.no_downloads_error);clone=$("#edd-purchased-files div.row:not(.edd-purchased-files-header):last").clone();clone.find(".download span").html('<a href="post.php?post='+download_id+'&action=edit"></a>'),clone.find(".download span a").text(download_title),clone.find(".edd-payment-details-download-item-price").val(item_price.toFixed(edd_vars.currency_decimals)),clone.find(".edd-payment-details-download-item-tax").val(item_total.toFixed(edd_vars.currency_decimals)),clone.find("input.edd-payment-details-download-id").val(download_id),clone.find("input.edd-payment-details-download-price-id").val(price_id);item_total=(item_total=item_price*quantity+item_total).toFixed(edd_vars.currency_decimals);clone.find("span.edd-payment-details-download-amount").text(item_total),clone.find("input.edd-payment-details-download-amount").val(item_total),clone.find("input.edd-payment-details-download-quantity").val(quantity),clone.find("input.edd-payment-details-download-has-log").val(0),clone.find(".edd-copy-download-link-wrapper").remove(),clone.find("input").each(function(){var name=(name=$(this).attr("name")).replace(/\[(\d+)\]/,"["+parseInt(count)+"]");$(this).attr("name",name).attr("id",name)}),clone.find("a.edd-order-remove-download").attr("data-key",parseInt(count)),$("#edd-payment-downloads-changed").val(1),$("#edd-purchased-files div.row .edd-purchased-download-title .deleted").length&&$("#edd-purchased-files div.row:last").remove(),$(clone).insertAfter("#edd-purchased-files div.row:last"),$(".edd-order-payment-recalc-totals").show(),$(".edd-add-download-field").val("")})},edit_price:function(){$(document.body).on("change keyup",".edd-payment-item-input",function(){var row=$(this).parents("ul.edd-purchased-files-list-wrapper");$(".edd-order-payment-recalc-totals").show();var quantity=row.find("input.edd-payment-details-download-quantity").val().replace(edd_vars.thousands_separator,""),item_price=row.find("input.edd-payment-details-download-item-price").val().replace(edd_vars.thousands_separator,""),item_total=row.find("input.edd-payment-details-download-item-tax").val().replace(edd_vars.thousands_separator,""),item_price=parseFloat(item_price);if(isNaN(item_price))return alert(edd_vars.numeric_item_price),!1;item_total=parseFloat(item_total),isNaN(item_total)&&(item_total=0);item_total=(item_total=item_price*(quantity=isNaN(parseInt(quantity))?1:quantity)+item_total).toFixed(edd_vars.currency_decimals);row.find("input.edd-payment-details-download-amount").val(item_total),row.find("span.edd-payment-details-download-amount").text(item_total)})},recalculate_total:function(){$("#edd-order-recalc-total").on("click",function(taxes){taxes.preventDefault();var total=0,tax=0,totals=$("#edd-purchased-files .row input.edd-payment-details-download-amount"),taxes=$("#edd-purchased-files .row input.edd-payment-details-download-item-tax");totals.length&&totals.each(function(){total+=parseFloat($(this).val())}),taxes.length&&taxes.each(function(){tax+=parseFloat($(this).val())}),$(".edd-payment-fees").length&&$(".edd-payment-fees span.fee-amount").each(function(){total+=parseFloat($(this).data("fee"))}),$("input[name=edd-payment-total]").val(total.toFixed(edd_vars.currency_decimals)),$("input[name=edd-payment-tax]").val(tax.toFixed(edd_vars.currency_decimals))})},variable_prices_check:function(){$(".edd-edit-purchase-element").on("change","select#edd_order_download_select",function(){var $this=$(this),download_id=$this.val();0<parseInt(download_id)&&$.ajax({type:"POST",data:{action:"edd_check_for_download_price_variations",download_id:download_id},url:ajaxurl,success:function(response){$(".edd_price_options_select").remove(),$(response).insertAfter($this.next())}}).fail(function(data){window.console&&window.console.log&&console.log(data)})})},add_note:function(){$("#edd-add-payment-note").on("click",function(postData){postData.preventDefault();var border_color,postData={action:"edd_insert_payment_note",payment_id:$(this).data("payment-id"),note:$("#edd-payment-note").val()};postData.note?$.ajax({type:"POST",data:postData,url:ajaxurl,success:function(response){$("#edd-payment-notes-inner").append(response),$(".edd-no-payment-notes").hide(),$("#edd-payment-note").val("")}}).fail(function(data){window.console&&window.console.log&&console.log(data)}):(border_color=$("#edd-payment-note").css("border-color"),$("#edd-payment-note").css("border-color","red"),setTimeout(function(){$("#edd-payment-note").css("border-color",border_color)},500))})},remove_note:function(){$(document.body).on("click",".edd-delete-payment-note",function(e){if(e.preventDefault(),confirm(edd_vars.delete_payment_note)){var postData={action:"edd_delete_payment_note",payment_id:$(this).data("payment-id"),note_id:$(this).data("note-id")};return $.ajax({type:"POST",data:postData,url:ajaxurl,success:function(response){return $("#edd-payment-note-"+postData.note_id).remove(),$(".edd-payment-note").length||$(".edd-no-payment-notes").show(),!1}}).fail(function(data){window.console&&window.console.log&&console.log(data)}),!0}})},resend_receipt:function(){var emails_wrap=$(".edd-order-resend-receipt-addresses");$(document.body).on("click","#edd-select-receipt-email",function(e){e.preventDefault(),emails_wrap.slideDown()}),$(document.body).on("change",".edd-order-resend-receipt-email",function(){var href=$("#edd-select-receipt-email").prop("href")+"&email="+$(this).val();confirm(edd_vars.resend_receipt)&&(window.location=href)}),$(document.body).on("click","#edd-resend-receipt",function(e){return confirm(edd_vars.resend_receipt)})},copy_download_link:function(){$(document.body).on("click",".edd-copy-download-link",function(postData){postData.preventDefault();postData=$(this),postData={action:"edd_get_file_download_link",payment_id:$('input[name="edd_payment_id"]').val(),download_id:postData.data("download-id"),price_id:postData.data("price-id")};$.ajax({type:"POST",data:postData,url:ajaxurl,success:function(link){return $("#edd-download-link").dialog({width:400}).html('<textarea rows="10" cols="40" id="edd-download-link-textarea">'+link+"</textarea>"),$("#edd-download-link-textarea").focus().select(),!1}}).fail(function(data){window.console&&window.console.log&&console.log(data)})})}}.init(),{init:function(){this.type_select(),this.product_requirements()},type_select:function(){$("#edd-edit-discount #edd-type, #edd-add-discount #edd-type").change(function(){var val=$(this).val();$(".edd-amount-description").hide(),$(".edd-amount-description."+val+"-discount").show()})},product_requirements:function(){$("#products").change(function(){var product_conditions=$("#edd-discount-product-conditions");$(this).val()?product_conditions.show():product_conditions.hide()})}}.init(),{init:function(){this.date_options(),this.customers_export()},date_options:function(){$("#edd-graphs-date-options").change(function(){var $this=$(this),date_range_options=$("#edd-date-range-options");"other"===$this.val()?date_range_options.show():date_range_options.hide()})},customers_export:function(){$("#edd_customer_export_download").change(function(){var price_options_select,$this=$(this),data=$("option:selected",$this).val(),customer_export_option=$("#edd_customer_export_option");"0"===$this.val()?customer_export_option.show():customer_export_option.hide(),0!=parseInt(data)?(data={action:"edd_check_for_download_price_variations",download_id:data,all_prices:!0},price_options_select=$(".edd_price_options_select"),$.post(ajaxurl,data,function(response){price_options_select.remove(),$("#edd_customer_export_download_chosen").after(response)})):price_options_select.remove()})}}.init(),{init:function(){this.general(),this.taxes(),this.emails(),this.misc()},general:function(){var file_frame,edd_settings_upload_button=$(".edd-color-picker");edd_settings_upload_button.length&&edd_settings_upload_button.wpColorPicker(),"undefined"==typeof wp||"1"!==edd_vars.new_media_ui?0<(edd_settings_upload_button=$(".edd_settings_upload_button")).length&&(window.formfield="",$(document.body).on("click",edd_settings_upload_button,function(e){e.preventDefault(),window.formfield=$(this).parent().prev(),window.tbframe_interval=setInterval(function(){jQuery("#TB_iframeContent").contents().find(".savesend .button").val(edd_vars.use_this_file).end().find("#insert-gallery, .wp-post-thumbnail").hide()},2e3),tb_show(edd_vars.add_new_download,"media-upload.php?TB_iframe=true")}),window.edd_send_to_editor=window.send_to_editor,window.send_to_editor=function(html){window.formfield?(imgurl=$("a","<div>"+html+"</div>").attr("href"),window.formfield.val(imgurl),window.clearInterval(window.tbframe_interval),tb_remove()):window.edd_send_to_editor(html),window.send_to_editor=window.edd_send_to_editor,window.formfield="",window.imagefield=!1}):(window.formfield="",$(document.body).on("click",".edd_settings_upload_button",function(button){button.preventDefault();button=$(this);window.formfield=$(this).parent().prev(),file_frame||((file_frame=wp.media.frames.file_frame=wp.media({frame:"post",state:"insert",title:button.data("uploader_title"),button:{text:button.data("uploader_button_text")},multiple:!1})).on("menu:render:default",function(view){view.unset("library-separator"),view.unset("gallery"),view.unset("featured-image"),view.unset("embed"),view.set({})}),file_frame.on("insert",function(){file_frame.state().get("selection").each(function(attachment,index){attachment=attachment.toJSON(),window.formfield.val(attachment.url)})})),file_frame.open()}),window.formfield="")},taxes:function(){var no_states=$("select.edd-no-states");no_states.length&&no_states.closest("tr").addClass("hidden"),$('select[name="edd_settings[base_country]"]').change(function(){var data=$(this),$tr=data.closest("tr"),data={action:"edd_get_shop_states",country:data.val(),nonce:data.data("nonce"),field_name:"edd_settings[base_state]"};return $.post(ajaxurl,data,function(response){"nostates"==response?$tr.next().addClass("hidden"):($tr.next().removeClass("hidden"),$tr.next().find("select").replaceWith(response))}),!1}),$(document.body).on("change","#edd_tax_rates select.edd-tax-country",function(){var $this=$(this),data={action:"edd_get_shop_states",country:$this.val(),nonce:$this.data("nonce"),field_name:$this.attr("name").replace("country","state")};return $.post(ajaxurl,data,function(response){var text_field;"nostates"==response?(text_field='<input type="text" name="'+data.field_name+'" value=""/>',$this.parent().next().find("select").replaceWith(text_field)):($this.parent().next().find("input,select").show(),$this.parent().next().find("input,select").replaceWith(response))}),!1}),$("#edd_add_tax_rate").on("click",function(){var row=$("#edd_tax_rates tr:last"),clone=row.clone(),count=row.parent().find("tr").length;return clone.find("td input").not(":input[type=checkbox]").val(""),clone.find('td [type="checkbox"]').attr("checked",!1),clone.find("input, select").each(function(){var name=(name=$(this).attr("name")).replace(/\[(\d+)\]/,"["+parseInt(count)+"]");$(this).attr("name",name).attr("id",name)}),clone.find("label").each(function(){var name=(name=$(this).attr("for")).replace(/\[(\d+)\]/,"["+parseInt(count)+"]");$(this).attr("for",name)}),clone.insertAfter(row),!1}),$(document.body).on("click","#edd_tax_rates .edd_remove_tax_rate",function(){return confirm(edd_vars.delete_tax_rate)&&(2===$("#edd_tax_rates tr:visible").length?($("#edd_tax_rates select").val(""),$('#edd_tax_rates input[type="text"]').val(""),$('#edd_tax_rates input[type="number"]').val(""),$('#edd_tax_rates input[type="checkbox"]').attr("checked",!1)):$(this).closest("tr").remove(),$("#edd_tax_rates tr").each(function(rowIndex){$(this).children().find("input, select").each(function(){var name=(name=$(this).attr("name")).replace(/\[(\d+)\]/,"["+(rowIndex-1)+"]");$(this).attr("name",name).attr("id",name)})})),!1})},emails:function(){$("#edd-sendwp-connect").on("click",function(e){e.preventDefault(),$(this).html(edd_vars.wait+' <span class="edd-loading"></span>'),document.body.style.cursor="wait",easy_digital_downloads_sendwp_remote_install()}),$("#edd-sendwp-disconnect").on("click",function(e){e.preventDefault(),$(this).html(edd_vars.wait+' <span class="edd-loading dark"></span>'),document.body.style.cursor="wait",easy_digital_downloads_sendwp_disconnect()}),$("#edd-recapture-connect").on("click",function(e){e.preventDefault(),$(this).html(edd_vars.wait+' <span class="edd-loading"></span>'),document.body.style.cursor="wait",easy_digital_downloads_recapture_remote_install()})},misc:function(){var downloadMethod=$('select[name="edd_settings[download_method]"]'),symlink=downloadMethod.parent().parent().next();"direct"==downloadMethod.val()&&(symlink.hide(),symlink.find("input").prop("checked",!1)),downloadMethod.on("change",function(){"direct"==$(this).val()?(symlink.hide(),symlink.find("input").prop("checked",!1)):symlink.show()})}}.init(),$(".download_page_edd-payment-history .row-actions .delete a, a.edd-delete-payment").on("click",function(){return!!confirm(edd_vars.delete_payment)}),$("body").on("click","#the-list .editinline",function(){var post_id=(post_id=$(this).closest("tr").attr("id")).replace("post-",""),regprice=$("#post-"+post_id).find(".column-price .downloadprice-"+post_id).val();regprice!=$("#post-"+post_id+".column-price .downloadprice-"+post_id).val()?$(".regprice","#edd-download-data").val(regprice).attr("disabled",!1):$(".regprice","#edd-download-data").val(edd_vars.quick_edit_warning).attr("disabled","disabled")}),$(document.body).on("click","#bulk_edit",function(){var $price=$("#bulk-edit"),$post_ids=new Array;$price.find("#bulk-titles").children().each(function(){$post_ids.push($(this).attr("id").replace(/^(ttle)/i,""))});$price=$('#edd-download-data input[name="_edd_regprice"]').val();$.post(ajaxurl,{action:"edd_save_bulk_edit",edd_bulk_nonce:$post_ids,post_ids:$post_ids,price:$price})}),$(".edd-select-chosen").chosen({inherit_select_classes:!0,placeholder_text_single:edd_vars.one_option,placeholder_text_multiple:edd_vars.one_or_more_option}),$(".edd-select-chosen .chosen-search input").each(function(){var placeholder=$(this).parent().parent().parent().prev("select.edd-select-chosen"),placeholder=(placeholder.data("search-type"),placeholder.data("search-placeholder"));$(this).attr("placeholder",placeholder)}),$(".chosen-choices").on("click",function(){var placeholder=$(this).parent().prev().data("search-placeholder");void 0===placeholder&&(placeholder=edd_vars.type_to_search),$(this).children("li").children("input").attr("placeholder",placeholder)});$(document.body).on("keyup",".edd-select.chosen-container .chosen-search input, .edd-select.chosen-container .search-field input",function(lastKey){var val=$(this).val(),container=$(this).closest(".edd-select-chosen"),select=(container.attr("id").replace("_chosen",""),container.prev()),no_bundles=container.hasClass("no-bundles"),variations=container.hasClass("variations"),lastKey=lastKey.which,search_type="edd_download_search";if(container.prev().data("search-type")){if("no_ajax"==select.data("search-type"))return;search_type="edd_"+select.data("search-type")+"_search"}val.length<=3&&"edd_download_search"==search_type||16==lastKey||13==lastKey||91==lastKey||17==lastKey||37==lastKey||38==lastKey||39==lastKey||40==lastKey||(clearTimeout(typingTimer),typingTimer=setTimeout(function(){$.ajax({type:"GET",url:ajaxurl,data:{action:search_type,s:val,no_bundles:no_bundles,variations:variations},dataType:"json",beforeSend:function(){select.closest("ul.chosen-results").empty()},success:function(data){$("option:not(:selected)",select).remove(),$.each(data,function(key,item){$('option[value="'+item.id+'"]',select).length||select.prepend('<option value="'+item.id+'">'+item.name+"</option>")}),$(".edd-select-chosen").trigger("chosen:updated"),select.next().find("input").val(val)}}).fail(function(response){window.console&&window.console.log&&console.log(response)}).done(function(response){})},342))}),$("#post").on("click",".edd-thickbox",function(){$(".edd-select-chosen","#choose-download").css("width","100%")}),{init:function(){this.revoke_api_key(),this.regenerate_api_key(),this.create_api_key(),this.recount_stats()},revoke_api_key:function(){$(document.body).on("click",".edd-revoke-api-key",function(e){return confirm(edd_vars.revoke_api_key)})},regenerate_api_key:function(){$(document.body).on("click",".edd-regenerate-api-key",function(e){return confirm(edd_vars.regenerate_api_key)})},create_api_key:function(){$(document.body).on("submit","#api-key-generate-form",function(e){var input=$('input[type="text"][name="user_id"]');input.css("border-color","#ddd");var user_id=input.val();if(user_id.length<1||0==user_id)return input.css("border-color","#ff0000"),!1})},recount_stats:function(){$(document.body).on("change","#recount-stats-type",function(){var export_form=$("#edd-tools-recount-form"),selected_type=$("option:selected",this).data("type"),submit_button=$("#recount-stats-submit"),products=$("#tools-product-dropdown");export_form.find(".notice-wrap").remove(),submit_button.removeClass("button-disabled").attr("disabled",!1),products.hide(),$(".edd-recount-stats-descriptions span").hide(),"recount-download"===selected_type?(products.show(),products.find(".edd-select-chosen").css("width","auto")):"reset-stats"===selected_type?(export_form.append('<div class="notice-wrap"></div>'),export_form.find(".notice-wrap").html('<div class="notice notice-warning"><p><input type="checkbox" id="confirm-reset" name="confirm_reset_store" value="1" /> <label for="confirm-reset">'+edd_vars.reset_stats_warn+"</label></p></div>"),$("#recount-stats-submit").addClass("button-disabled").attr("disabled","disabled")):(products.hide(),products.val(0)),$("#"+selected_type).show()}),$(document.body).on("change","#confirm-reset",function(){$(this).is(":checked")?$("#recount-stats-submit").removeClass("button-disabled").removeAttr("disabled"):$("#recount-stats-submit").addClass("button-disabled").attr("disabled","disabled")}),$("#edd-tools-recount-form").submit(function(e){var selection=$("#recount-stats-type").val(),export_form=$(this),selected_type=$("option:selected",this).data("type");if("reset-stats"===selected_type){if($("#confirm-reset").is(":checked"))return!0;has_errors=!0}export_form.find(".notice-wrap").remove(),export_form.append('<div class="notice-wrap"></div>');var notice_wrap=export_form.find(".notice-wrap"),has_errors=!1;if(null!==selection&&0!==selection||(notice_wrap.html('<div class="updated error"><p>'+edd_vars.batch_export_no_class+"</p></div>"),has_errors=!0),"recount-download"===selected_type&&0==$('select[name="download_id"]').val()&&(notice_wrap.html('<div class="updated error"><p>'+edd_vars.batch_export_no_reqs+"</p></div>"),has_errors=!0),has_errors)return export_form.find(".button-disabled").removeClass("button-disabled"),!1})}}.init(),{init:function(){this.submit(),this.dismiss_message()},submit:function(){var self=this;$(document.body).on("submit",".edd-export-form",function(data){data.preventDefault();var submitButton=$(this).find('input[type="submit"]');submitButton.hasClass("button-disabled")||(data=$(this).serialize(),submitButton.addClass("button-disabled"),$(this).find(".notice-wrap").remove(),$(this).append('<div class="notice-wrap"><span class="spinner is-active"></span><div class="edd-progress"><div></div></div></div>'),self.process_step(1,data,self))})},process_step:function(step,data,self){$.ajax({type:"POST",url:ajaxurl,data:{form:data,action:"edd_do_ajax_export",step:step},dataType:"json",success:function(response){var export_form,notice_wrap,success_message;"done"==response.step||response.error||response.success?(notice_wrap=(export_form=$(".edd-export-form").find(".edd-progress").parent().parent()).find(".notice-wrap"),export_form.find(".button-disabled").removeClass("button-disabled"),response.error?(success_message=response.message,notice_wrap.html('<div class="updated error"><p>'+success_message+"</p></div>")):response.success?(success_message=response.message,notice_wrap.html('<div id="edd-batch-success" class="updated notice is-dismissible"><p>'+success_message+'<span class="notice-dismiss"></span></p></div>')):(notice_wrap.remove(),window.location=response.url)):($(".edd-progress div").animate({width:response.percentage+"%"},50,function(){}),self.process_step(parseInt(response.step),data,self))}}).fail(function(response){window.console&&window.console.log&&console.log(response)})},dismiss_message:function(){$(document.body).on("click","#edd-batch-success .notice-dismiss",function(){$("#edd-batch-success").parent().slideUp("fast")})}}.init();var EDD_Import={init:function(){this.submit()},submit:function(){$(".edd-import-form").ajaxForm({beforeSubmit:this.before_submit,success:this.success,complete:this.complete,dataType:"json",error:this.error})},before_submit:function(arr,notice_wrap,options){if(notice_wrap.find(".notice-wrap").remove(),notice_wrap.append('<div class="notice-wrap"><span class="spinner is-active"></span><div class="edd-progress"><div></div></div></div>'),!(window.File&&window.FileReader&&window.FileList&&window.Blob)){var import_form=$(".edd-import-form").find(".edd-progress").parent().parent(),notice_wrap=import_form.find(".notice-wrap");return import_form.find(".button-disabled").removeClass("button-disabled"),notice_wrap.html('<div class="update error"><p>'+edd_vars.unsupported_browser+"</p></div>"),!1}},success:function(responseText,statusText,xhr,$form){},complete:function(xhr){var $form,select,options,columns,response=jQuery.parseJSON(xhr.responseText);response.success?(($form=$(".edd-import-form .notice-wrap").parent()).find(".edd-import-file-wrap,.notice-wrap").remove(),$form.find(".edd-import-options").slideDown(),(select=$form.find("select.edd-import-csv-column")).parents("tr").first(),options="",columns=response.data.columns.sort(function(a,b){return a<b?-1:b<a?1:0}),$.each(columns,function(key,value){options+='<option value="'+value+'">'+value+"</option>"}),select.append(options),select.on("change",function(){var $key=$(this).val();$key&&0!=response.data.first_row[$key]?$(this).parent().next().html(response.data.first_row[$key]):$(this).parent().next().html("")}),$.each(select,function(){$(this).val($(this).attr("data-field")).change()}),$(document.body).on("click",".edd-import-proceed",function(e){e.preventDefault(),$form.append('<div class="notice-wrap"><span class="spinner is-active"></span><div class="edd-progress"><div></div></div></div>'),response.data.mapping=$form.serialize(),EDD_Import.process_step(1,response.data,self)})):EDD_Import.error(xhr)},error:function(notice_wrap){var response=jQuery.parseJSON(notice_wrap.responseText),import_form=$(".edd-import-form").find(".edd-progress").parent().parent(),notice_wrap=import_form.find(".notice-wrap");import_form.find(".button-disabled").removeClass("button-disabled"),response.data.error?notice_wrap.html('<div class="update error"><p>'+response.data.error+"</p></div>"):notice_wrap.remove()},process_step:function(step,import_data,self){$.ajax({type:"POST",url:ajaxurl,data:{form:import_data.form,nonce:import_data.nonce,class:import_data.class,upload:import_data.upload,mapping:import_data.mapping,action:"edd_do_ajax_import",step:step},dataType:"json",success:function(response){var import_form,notice_wrap;"done"==response.data.step||response.data.error?(notice_wrap=(import_form=$(".edd-import-form").find(".edd-progress").parent().parent()).find(".notice-wrap"),import_form.find(".button-disabled").removeClass("button-disabled"),response.data.error?notice_wrap.html('<div class="update error"><p>'+response.data.error+"</p></div>"):(import_form.find(".edd-import-options").hide(),$("html, body").animate({scrollTop:import_form.parent().offset().top},500),notice_wrap.html('<div class="updated"><p>'+response.data.message+"</p></div>"))):($(".edd-progress div").animate({width:response.data.percentage+"%"},50,function(){}),EDD_Import.process_step(parseInt(response.data.step),import_data,self))}}).fail(function(response){window.console&&window.console.log&&console.log(response)})}};EDD_Import.init();var EDD_Customer={vars:{customer_card_wrap_editable:$(".edd-customer-card-wrapper .editable"),customer_card_wrap_edit_item:$(".edd-customer-card-wrapper .edit-item"),user_id:$('input[name="customerinfo[user_id]"]'),state_input:$(':input[name="customerinfo[state]"]'),note:$("#customer-note")},init:function(){this.edit_customer(),this.add_email(),this.user_search(),this.remove_user(),this.cancel_edit(),this.change_country(),this.add_note(),this.delete_checked()},edit_customer:function(){$(document.body).on("click","#edit-customer",function(e){e.preventDefault(),EDD_Customer.vars.customer_card_wrap_editable.hide(),EDD_Customer.vars.customer_card_wrap_edit_item.fadeIn().css("display","block")})},add_email:function(){$(document.body).on("click","#add-customer-email",function(nonce){nonce.preventDefault();var button=$(this),wrapper=button.parent();wrapper.parent().find(".notice-container").remove(),wrapper.find(".spinner").css("visibility","visible"),button.attr("disabled",!0);var customer_id=wrapper.find('input[name="customer-id"]').val(),email=wrapper.find('input[name="additional-email"]').val(),primary=wrapper.find('input[name="make-additional-primary"]').is(":checked"),nonce=wrapper.find('input[name="add_email_nonce"]').val();$.post(ajaxurl,{edd_action:"customer-add-email",customer_id:customer_id,email:email,primary:primary,_wpnonce:nonce},function(response){!0===response.success?window.location.href=response.redirect:(button.attr("disabled",!1),wrapper.after('<div class="notice-container"><div class="notice notice-error inline"><p>'+response.message+"</p></div></div>"),wrapper.find(".spinner").css("visibility","hidden"))},"json")})},user_search:function(){$(document.body).on("click.eddSelectUser",".edd_user_search_results a",function(user_id){user_id.preventDefault();user_id=$(this).data("userid");EDD_Customer.vars.user_id.val(user_id)})},remove_user:function(){$(document.body).on("click","#disconnect-customer",function(postData){postData.preventDefault(),confirm(edd_vars.disconnect_customer)&&(postData={edd_action:"disconnect-userid",customer_id:$('input[name="customerinfo[id]"]').val(),_wpnonce:$("#edit-customer-info #_wpnonce").val()},$.post(ajaxurl,postData,function(response){window.location.href=window.location.href},"json"))})},cancel_edit:function(){$(document.body).on("click","#edd-edit-customer-cancel",function(e){e.preventDefault(),EDD_Customer.vars.customer_card_wrap_edit_item.hide(),EDD_Customer.vars.customer_card_wrap_editable.show(),$(".edd_user_search_results").html("")})},change_country:function(){$('select[name="customerinfo[country]"]').change(function(){var $this=$(this),data={action:"edd_get_shop_states",country:$this.val(),nonce:$this.data("nonce"),field_name:"customerinfo[state]"};return $.post(ajaxurl,data,function(response){"nostates"==response?EDD_Customer.vars.state_input.replaceWith('<input type="text" name="'+data.field_name+'" value="" class="edd-edit-toggles medium-text"/>'):EDD_Customer.vars.state_input.replaceWith(response)}),!1})},add_note:function(){$(document.body).on("click","#add-customer-note",function(postData){postData.preventDefault();var border_color,postData={edd_action:"add-customer-note",customer_id:$("#customer-id").val(),customer_note:EDD_Customer.vars.note.val(),add_customer_note_nonce:$("#add_customer_note_nonce").val()};postData.customer_note?$.ajax({type:"POST",data:postData,url:ajaxurl,success:function(response){$("#edd-customer-notes").prepend(response),$(".edd-no-customer-notes").hide(),EDD_Customer.vars.note.val("")}}).fail(function(data){window.console&&window.console.log&&console.log(data)}):(border_color=EDD_Customer.vars.note.css("border-color"),EDD_Customer.vars.note.css("border-color","red"),setTimeout(function(){EDD_Customer.vars.note.css("border-color",border_color)},500))})},delete_checked:function(){$("#edd-customer-delete-confirm").change(function(){var records_input=$("#edd-customer-delete-records"),submit_button=$("#edd-delete-customer");$(this).prop("checked")?(records_input.attr("disabled",!1),submit_button.attr("disabled",!1)):(records_input.attr("disabled",!0),records_input.prop("checked",!1),submit_button.attr("disabled",!0))})}};EDD_Customer.init();var EDD_Promo_Notices={init:function(){EDD_Promo_Notices.displayNotices(),EDD_Promo_Notices.dismissNotices()},displayNotices:function(){var topOfPageNoticeEl,topOfPageNotice=$(".edd-admin-notice-top-of-page");topOfPageNotice&&(topOfPageNoticeEl=topOfPageNotice.detach(),$("#wpbody-content").prepend(topOfPageNoticeEl),topOfPageNotice.delay(1e3).slideDown())},dismissNotices:function(){$(".edd-promo-notice").each(function(){var notice=$(this);notice.on("click",".edd-promo-notice-dismiss",function(e){e.preventDefault(),$.ajax({type:"POST",data:{action:"edd_dismiss_promo_notice",notice_id:notice.data("id"),nonce:notice.data("nonce"),lifespan:notice.data("lifespan")},url:ajaxurl,success:function(response){notice.slideUp()}})})})}};EDD_Promo_Notices.init(),$(".edd-ajax-user-search").keyup(function(){var user_search=$(this).val(),data="";$(this).data("exclude")&&(data=$(this).data("exclude")),$(".edd-ajax").show();data={action:"edd_search_users",user_name:user_search,exclude:data};document.body.style.cursor="wait",$.ajax({type:"POST",data:data,dataType:"json",url:ajaxurl,success:function(search_response){$(".edd-ajax").hide(),$(".edd_user_search_results").removeClass("hidden"),$(".edd_user_search_results span").html(""),$(search_response.results).appendTo(".edd_user_search_results span"),document.body.style.cursor="default"}})}),$(document.body).on("click.eddSelectUser",".edd_user_search_results span a",function(login){login.preventDefault();login=$(this).data("login");$(".edd-ajax-user-search").val(login),$(".edd_user_search_results").addClass("hidden"),$(".edd_user_search_results span").html("")}),$(document.body).on("click.eddCancelUserSearch",".edd_user_search_results a.edd-ajax-user-cancel",function(e){e.preventDefault(),$(".edd-ajax-user-search").val(""),$(".edd_user_search_results").addClass("hidden"),$(".edd_user_search_results span").html("")}),$("#edd_dashboard_sales").length&&$.ajax({type:"GET",data:{action:"edd_load_dashboard_widget"},url:ajaxurl,success:function(response){$("#edd_dashboard_sales .inside").html(response)}}),$(document.body).on("keydown",".customer-note-input",function(e){13==e.keyCode&&(e.metaKey||e.ctrlKey)&&$("#add-customer-note").click()})});var eddFormatCurrency=function(decimalPlaces){var numeric=parseFloat(decimalPlaces),storeCurrency=edd_vars.currency,decimalPlaces=edd_vars.currency_decimals;return numeric.toLocaleString(storeCurrency,{style:"currency",currency:storeCurrency,minimumFractionDigits:decimalPlaces,maximumFractionDigits:decimalPlaces})},eddFormatNumber=function(storeCurrency){var numeric=parseFloat(storeCurrency),storeCurrency=edd_vars.currency;edd_vars.currency_decimals;return numeric.toLocaleString(storeCurrency,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0})},eddLabelFormatter=function(label,series){return'<div style="font-size:12px; text-align:center; padding:2px">'+label+"</div>"},eddLegendFormatterSales=function(item,series){var slug=item.toLowerCase().replace(/\s/g,"-"),color='<div class="edd-legend-color" style="background-color: '+series.color+'"></div>',item='<div class="edd-pie-legend-item">'+item+": "+Math.round(series.percent)+"% ("+eddFormatNumber(series.data[0][1])+")</div>",item='<div id="'+series.edd_vars.id+slug+'" class="edd-legend-item-wrapper">'+color+item+"</div>";return jQuery("#edd-pie-legend-"+series.edd_vars.id).append(item),item},eddLegendFormatterEarnings=function(item,series){var slug=item.toLowerCase().replace(/\s/g,"-"),color='<div class="edd-legend-color" style="background-color: '+series.color+'"></div>',item='<div class="edd-pie-legend-item">'+item+": "+Math.round(series.percent)+"% ("+eddFormatCurrency(series.data[0][1])+")</div>",item='<div id="'+series.edd_vars.id+slug+'" class="edd-legend-item-wrapper">'+color+item+"</div>";return jQuery("#edd-pie-legend-"+series.edd_vars.id).append(item),item};function edd_attach_tooltips(selector){selector.tooltip({content:function(){return jQuery(this).prop("title")},tooltipClass:"edd-ui-tooltip",position:{my:"center top",at:"center bottom+10",collision:"flipfit"},hide:{duration:200},show:{duration:200}})}function easy_digital_downloads_sendwp_remote_install(){jQuery.post(ajaxurl,{action:"edd_sendwp_remote_install"},function(response){response.success||!confirm(response.data.error)?easy_digital_downloads_sendwp_register_client(response.data.register_url,response.data.client_name,response.data.client_secret,response.data.client_redirect,response.data.partner_id):location.reload()})}function easy_digital_downloads_sendwp_disconnect(){jQuery.post(ajaxurl,{action:"edd_sendwp_disconnect"},function(response){location.reload()})}function easy_digital_downloads_sendwp_register_client(register_url,client_name,client_secret,client_redirect,partner_id){var form=document.createElement("form");function easy_digital_downloads_sendwp_append_form_input(name,value){var input=document.createElement("input");input.setAttribute("type","hidden"),input.setAttribute("name",name),input.setAttribute("value",value),form.appendChild(input)}form.setAttribute("method","POST"),form.setAttribute("action",register_url),easy_digital_downloads_sendwp_append_form_input("client_name",client_name),easy_digital_downloads_sendwp_append_form_input("client_secret",client_secret),easy_digital_downloads_sendwp_append_form_input("client_redirect",client_redirect),easy_digital_downloads_sendwp_append_form_input("partner_id",partner_id),document.body.appendChild(form),form.submit()}function easy_digital_downloads_recapture_remote_install(){jQuery.post(ajaxurl,{action:"edd_recapture_remote_install"},function(response){0==response.success&&confirm(response.data.error)?location.reload():window.location.href="https://recapture.io/register"})}
1
+ jQuery(document).ready(function($){edd_attach_tooltips($(".edd-help-tip"));var EDD_Download_Configuration={init:function(){this.add(),this.move(),this.remove(),this.type(),this.prices(),this.files(),this.updatePrices()},clone_repeatable:function(row){var key=highest=1;return row.parent().find(".edd_repeatable_row").each(function(){var current=$(this).data("key");parseInt(current)>highest&&(highest=current)}),key=highest+=1,clone=row.clone(),clone.removeClass("edd_add_blank"),clone.attr("data-key",key),clone.find("input, select, textarea").val("").each(function(){var name=$(this).attr("name"),id=$(this).attr("id");name&&(name=name.replace(/\[(\d+)\]/,"["+parseInt(key)+"]"),$(this).attr("name",name)),$(this).attr("data-key",key),void 0!==id&&(id=id.replace(/(\d+)/,parseInt(key)),$(this).attr("id",id))}),clone.find("select").each(function(){$(this).val(row.find('select[name="'+$(this).attr("name")+'"]').val())}),clone.find('input[type="checkbox"]').each(function(){$(this).is(":checked")&&$(this).prop("checked",!1),$(this).val(1)}),clone.find("span.edd_price_id").each(function(){$(this).text(parseInt(key))}),clone.find("span.edd_file_id").each(function(){$(this).text(parseInt(key))}),clone.find(".edd_repeatable_default_input").each(function(){$(this).val(parseInt(key)).removeAttr("checked")}),clone.find(".edd_repeatable_condition_field").each(function(){$(this).find("option:eq(0)").prop("selected","selected")}),clone.find(".search-choice").remove(),clone.find(".chosen-container").remove(),edd_attach_tooltips(clone.find(".edd-help-tip")),clone},add:function(){$(document.body).on("click",".submit .edd_add_repeatable",function(e){e.preventDefault();var row=$(this).parent().parent().prev(".edd_repeatable_row"),clone=EDD_Download_Configuration.clone_repeatable(row);clone.insertAfter(row).find("input, textarea, select").filter(":visible").eq(0).focus(),clone.find(".edd-select-chosen").chosen({inherit_select_classes:!0,placeholder_text_single:edd_vars.one_option,placeholder_text_multiple:edd_vars.one_or_more_option}),clone.find(".edd-select-chosen").css("width","100%"),clone.find(".edd-select-chosen .chosen-search input").attr("placeholder",edd_vars.search_placeholder)})},move:function(){$(".edd_repeatable_table .edd-repeatables-wrap").sortable({handle:".edd-draghandle-anchor",items:".edd_repeatable_row",opacity:.6,cursor:"move",axis:"y",update:function(){var count=0;$(this).find(".edd_repeatable_row").each(function(){$(this).find("input.edd_repeatable_index").each(function(){$(this).val(count)}),count++})}})},remove:function(){$(document.body).on("click",".edd-remove-row, .edd_remove_repeatable",function(e){e.preventDefault();var firstFocusable,row=$(this).parents(".edd_repeatable_row"),count=row.parent().find(".edd_repeatable_row").length,type=$(this).data("type"),repeatable="div.edd_repeatable_"+type+"s";if(firstFocusable=($(this).is(".ui-sortable .edd_repeatable_row:first-child .edd-remove-row, .ui-sortable .edd_repeatable_row:first-child .edd_remove_repeatable")?row.next(".edd_repeatable_row"):row.prev(".edd_repeatable_row")).find("select, input, textarea, button").filter(":visible").eq(0),"price"===type){var price_row_id=row.data("key");$('.edd_repeatable_condition_field option[value="'+price_row_id+'"]').remove()}if(1<count)$("input, select",row).val(""),row.fadeOut("fast").remove(),firstFocusable.focus();else switch(type){case"price":alert(edd_vars.one_price_min);break;case"file":$("input, select",row).val("");break;default:alert(edd_vars.one_field_min)}$(repeatable).each(function(rowIndex){$(this).find("input, select").each(function(){var name=$(this).attr("name");name=name.replace(/\[(\d+)\]/,"["+rowIndex+"]"),$(this).attr("name",name).attr("id",name)})})})},type:function(){$(document.body).on("change","#_edd_product_type",function(e){var edd_products=$("#edd_products"),edd_download_files=$("#edd_download_files"),edd_download_limit_wrap=$("#edd_download_limit_wrap");"bundle"===$(this).val()?(edd_products.show(),edd_download_files.hide(),edd_download_limit_wrap.hide()):(edd_products.hide(),edd_download_files.show(),edd_download_limit_wrap.show())})},prices:function(){$(document.body).on("change","#edd_variable_pricing",function(e){var checked=$(this).is(":checked"),single=$("#edd_regular_price_field"),variable=$("#edd_variable_price_fields, .edd_repeatable_table .pricing"),bundleRow=$(".edd-bundled-product-row, .edd-repeatable-row-standard-fields");checked?(single.hide(),variable.show(),bundleRow.addClass("has-variable-pricing")):(single.show(),variable.hide(),bundleRow.removeClass("has-variable-pricing"))})},files:function(){var file_frame;window.formfield="",$(document.body).on("click",".edd_upload_file_button",function(e){e.preventDefault();var button=$(this);window.formfield=$(this).closest(".edd_repeatable_upload_wrapper"),file_frame||((file_frame=wp.media.frames.file_frame=wp.media({frame:"post",state:"insert",title:button.data("uploader-title"),button:{text:button.data("uploader-button-text")},multiple:"0"!=$(this).data("multiple")})).on("menu:render:default",function(view){view.unset("library-separator"),view.unset("gallery"),view.unset("featured-image"),view.unset("embed"),view.set({})}),file_frame.on("insert",function(){file_frame.state().get("selection").each(function(attachment,index){var selectedSize="image"===(attachment=attachment.toJSON()).type&&$(".attachment-display-settings .size option:selected").val(),selectedURL=attachment.url,selectedName=0<attachment.title.length?attachment.title:attachment.filename;if(selectedSize&&void 0!==attachment.sizes[selectedSize]&&(selectedURL=attachment.sizes[selectedSize].url),"image"===attachment.type&&(selectedName=selectedSize&&void 0!==attachment.sizes[selectedSize]?selectedName+"-"+attachment.sizes[selectedSize].width+"x"+attachment.sizes[selectedSize].height:selectedName+"-"+attachment.width+"x"+attachment.height),0===index)window.formfield.find(".edd_repeatable_attachment_id_field").val(attachment.id),window.formfield.find(".edd_repeatable_thumbnail_size_field").val(selectedSize),window.formfield.find(".edd_repeatable_upload_field").val(selectedURL),window.formfield.find(".edd_repeatable_name_field").val(selectedName);else{var row=window.formfield,clone=EDD_Download_Configuration.clone_repeatable(row);clone.find(".edd_repeatable_attachment_id_field").val(attachment.id),clone.find(".edd_repeatable_thumbnail_size_field").val(selectedSize),clone.find(".edd_repeatable_upload_field").val(selectedURL),clone.find(".edd_repeatable_name_field").val(selectedName),clone.insertAfter(row)}})})),file_frame.open()}),window.formfield=""},updatePrices:function(){$("#edd_price_fields").on("keyup",".edd_variable_prices_name",function(){var key=$(this).parents(".edd_repeatable_row").data("key"),name=$(this).val(),field_option=$(".edd_repeatable_condition_field option[value="+key+"]");0<field_option.length?field_option.text(name):$(".edd_repeatable_condition_field").append($("<option></option>").attr("value",key).text(name))})}};$(document.body).on("click",".toggle-custom-price-option-section",function(e){e.preventDefault();var show=$(this).html()==edd_vars.show_advanced_settings;show?$(this).html(edd_vars.hide_advanced_settings):$(this).html(edd_vars.show_advanced_settings);var header=$(this).parents(".edd-repeatable-row-header");header.siblings(".edd-custom-price-option-sections-wrap").slideToggle(),$(":input:not(input[type=button],input[type=submit],button):visible:first",show?header.siblings(".edd-custom-price-option-sections-wrap"):header.siblings(".edd-repeatable-row-standard-fields")).focus()}),EDD_Download_Configuration.init();var typingTimer,edd_datepicker=$(".edd_datepicker");if(0<edd_datepicker.length){edd_datepicker.datepicker({dateFormat:"mm/dd/yy"})}({init:function(){this.edit_address(),this.remove_download(),this.add_download(),this.change_customer(),this.new_customer(),this.edit_price(),this.recalculate_total(),this.variable_prices_check(),this.add_note(),this.remove_note(),this.resend_receipt(),this.copy_download_link()},edit_address:function(){$('select[name="edd-payment-address[0][country]"]').change(function(){var $this=$(this),data={action:"edd_get_shop_states",country:$this.val(),nonce:$this.data("nonce"),field_name:"edd-payment-address[0][state]"};return $.post(ajaxurl,data,function(response){var state_wrapper=$("#edd-order-address-state-wrap select, #edd-order-address-state-wrap input");$("#edd-order-address-state-wrap .chosen-container").remove(),"nostates"==response?state_wrapper.replaceWith('<input type="text" name="edd-payment-address[0][state]" value="" class="edd-edit-toggles medium-text"/>'):state_wrapper.replaceWith(response)}),!1})},remove_download:function(){$("#edd-purchased-files").on("click",".edd-order-remove-download",function(){if(1===$(document.body).find("#edd-purchased-files > .row:not(.header)").length)return alert(edd_vars.one_download_min),!1;if(confirm(edd_vars.delete_payment_download)){var key=$(this).data("key"),download_id=($(".edd-payment-id").val(),$('input[name="edd-payment-details-downloads['+key+'][id]"]').val()),price_id=$('input[name="edd-payment-details-downloads['+key+'][price_id]"]').val(),quantity=$('input[name="edd-payment-details-downloads['+key+'][quantity]"]').val(),amount=$('input[name="edd-payment-details-downloads['+key+'][amount]"]').val();if($('input[name="edd-payment-details-downloads['+key+'][tax]"]').length)var fees=$('input[name="edd-payment-details-downloads['+key+'][tax]"]').val();if($('input[name="edd-payment-details-downloads['+key+'][fees]"]').length)fees=$.parseJSON($('input[name="edd-payment-details-downloads['+key+'][fees]"]').val());var currently_removed=$('input[name="edd-payment-removed"]').val();(currently_removed=$.parseJSON(currently_removed)).length<1&&(currently_removed={});var removed_item=[{id:download_id,price_id:price_id,quantity:quantity,amount:amount,cart_index:key}];currently_removed[key]=removed_item,$('input[name="edd-payment-removed"]').val(JSON.stringify(currently_removed)),$(this).parent().parent().remove(),fees&&fees.length&&$.each(fees,function(key,value){$('*li[data-fee-id="'+value+'"]').remove()}),$("#edd-payment-downloads-changed").val(1),$(".edd-order-payment-recalc-totals").show()}return!1})},change_customer:function(){$("#edd-customer-details").on("click",".edd-payment-change-customer, .edd-payment-change-customer-cancel",function(e){e.preventDefault();var change_customer=$(this).hasClass("edd-payment-change-customer"),cancel=$(this).hasClass("edd-payment-change-customer-cancel");change_customer?($(".customer-info").hide(),$(".change-customer").show(),$(".edd-payment-change-customer-input").css("width","auto")):cancel&&($(".customer-info").show(),$(".change-customer").hide())})},new_customer:function(){$("#edd-customer-details").on("click",".edd-payment-new-customer, .edd-payment-new-customer-cancel",function(e){e.preventDefault();var new_customer=$(this).hasClass("edd-payment-new-customer"),cancel=$(this).hasClass("edd-payment-new-customer-cancel");new_customer?($(".customer-info").hide(),$(".new-customer").show()):cancel&&($(".customer-info").show(),$(".new-customer").hide());new_customer=$("#edd-new-customer");$(".new-customer").is(":visible")?new_customer.val(1):new_customer.val(0)})},add_download:function(){$(".edd-edit-purchase-element").on("click","#edd-order-add-download",function(e){e.preventDefault();var order_download_select=$("#edd_order_download_select"),order_download_quantity=$("#edd-order-download-quantity"),order_download_price=$("#edd-order-download-price"),order_download_tax=$("#edd-order-download-tax"),selected_price_option=$(".edd_price_options_select option:selected"),download_id=order_download_select.val(),download_title=order_download_select.find(":selected").text(),quantity=order_download_quantity.val(),item_price=order_download_price.val(),item_tax=order_download_tax.val(),price_id=selected_price_option.val(),price_name=selected_price_option.text();if(download_id<1)return!1;if(item_price||(item_price=0),item_price=parseFloat(item_price),isNaN(item_price))return alert(edd_vars.numeric_item_price),!1;if(item_tax=parseFloat(item_tax),isNaN(item_tax))return alert(edd_vars.numeric_item_tax),!1;if(isNaN(parseInt(quantity)))return alert(edd_vars.numeric_quantity),!1;price_name&&(download_title=download_title+" - "+price_name);var count=$("#edd-purchased-files div.row:not(.edd-purchased-files-header)").length;0==count&&alert(edd_vars.no_downloads_error);var clone=$("#edd-purchased-files div.row:not(.edd-purchased-files-header):last").clone();clone.find(".download span").html('<a href="post.php?post='+download_id+'&action=edit"></a>'),clone.find(".download span a").text(download_title),clone.find(".edd-payment-details-download-item-price").val(item_price.toFixed(edd_vars.currency_decimals)),clone.find(".edd-payment-details-download-item-tax").val(item_tax.toFixed(edd_vars.currency_decimals)),clone.find("input.edd-payment-details-download-id").val(download_id),clone.find("input.edd-payment-details-download-price-id").val(price_id);var item_total=item_price*quantity+item_tax;item_total=item_total.toFixed(edd_vars.currency_decimals),clone.find("span.edd-payment-details-download-amount").text(item_total),clone.find("input.edd-payment-details-download-amount").val(item_total),clone.find("input.edd-payment-details-download-quantity").val(quantity),clone.find("input.edd-payment-details-download-has-log").val(0),clone.find(".edd-copy-download-link-wrapper").remove(),clone.find("input").each(function(){var name=$(this).attr("name");name=name.replace(/\[(\d+)\]/,"["+parseInt(count)+"]"),$(this).attr("name",name).attr("id",name)}),clone.find("a.edd-order-remove-download").attr("data-key",parseInt(count)),$("#edd-payment-downloads-changed").val(1),$("#edd-purchased-files div.row .edd-purchased-download-title .deleted").length&&$("#edd-purchased-files div.row:last").remove(),$(clone).insertAfter("#edd-purchased-files div.row:last"),$(".edd-order-payment-recalc-totals").show(),$(".edd-add-download-field").val("")})},edit_price:function(){$(document.body).on("change keyup",".edd-payment-item-input",function(){var row=$(this).parents("ul.edd-purchased-files-list-wrapper");$(".edd-order-payment-recalc-totals").show();var quantity=row.find("input.edd-payment-details-download-quantity").val().replace(edd_vars.thousands_separator,""),item_price=row.find("input.edd-payment-details-download-item-price").val().replace(edd_vars.thousands_separator,""),item_tax=row.find("input.edd-payment-details-download-item-tax").val().replace(edd_vars.thousands_separator,"");if(item_price=parseFloat(item_price),isNaN(item_price))return alert(edd_vars.numeric_item_price),!1;item_tax=parseFloat(item_tax),isNaN(item_tax)&&(item_tax=0),isNaN(parseInt(quantity))&&(quantity=1);var item_total=item_price*quantity+item_tax;item_total=item_total.toFixed(edd_vars.currency_decimals),row.find("input.edd-payment-details-download-amount").val(item_total),row.find("span.edd-payment-details-download-amount").text(item_total)})},recalculate_total:function(){$("#edd-order-recalc-total").on("click",function(e){e.preventDefault();var total=0,tax=0,totals=$("#edd-purchased-files .row input.edd-payment-details-download-amount"),taxes=$("#edd-purchased-files .row input.edd-payment-details-download-item-tax");totals.length&&totals.each(function(){total+=parseFloat($(this).val())}),taxes.length&&taxes.each(function(){tax+=parseFloat($(this).val())}),$(".edd-payment-fees").length&&$(".edd-payment-fees span.fee-amount").each(function(){total+=parseFloat($(this).data("fee"))}),$("input[name=edd-payment-total]").val(total.toFixed(edd_vars.currency_decimals)),$("input[name=edd-payment-tax]").val(tax.toFixed(edd_vars.currency_decimals))})},variable_prices_check:function(){$(".edd-edit-purchase-element").on("change","select#edd_order_download_select",function(){var $this=$(this),download_id=$this.val();if(0<parseInt(download_id)){var postData={action:"edd_check_for_download_price_variations",download_id:download_id};$.ajax({type:"POST",data:postData,url:ajaxurl,success:function(response){$(".edd_price_options_select").remove(),$(response).insertAfter($this.next())}}).fail(function(data){window.console&&window.console.log&&console.log(data)})}})},add_note:function(){$("#edd-add-payment-note").on("click",function(e){e.preventDefault();var postData={action:"edd_insert_payment_note",payment_id:$(this).data("payment-id"),note:$("#edd-payment-note").val()};if(postData.note)$.ajax({type:"POST",data:postData,url:ajaxurl,success:function(response){$("#edd-payment-notes-inner").append(response),$(".edd-no-payment-notes").hide(),$("#edd-payment-note").val("")}}).fail(function(data){window.console&&window.console.log&&console.log(data)});else{var border_color=$("#edd-payment-note").css("border-color");$("#edd-payment-note").css("border-color","red"),setTimeout(function(){$("#edd-payment-note").css("border-color",border_color)},500)}})},remove_note:function(){$(document.body).on("click",".edd-delete-payment-note",function(e){if(e.preventDefault(),confirm(edd_vars.delete_payment_note)){var postData={action:"edd_delete_payment_note",payment_id:$(this).data("payment-id"),note_id:$(this).data("note-id")};return $.ajax({type:"POST",data:postData,url:ajaxurl,success:function(response){return $("#edd-payment-note-"+postData.note_id).remove(),$(".edd-payment-note").length||$(".edd-no-payment-notes").show(),!1}}).fail(function(data){window.console&&window.console.log&&console.log(data)}),!0}})},resend_receipt:function(){var emails_wrap=$(".edd-order-resend-receipt-addresses");$(document.body).on("click","#edd-select-receipt-email",function(e){e.preventDefault(),emails_wrap.slideDown()}),$(document.body).on("change",".edd-order-resend-receipt-email",function(){var href=$("#edd-select-receipt-email").prop("href")+"&email="+$(this).val();confirm(edd_vars.resend_receipt)&&(window.location=href)}),$(document.body).on("click","#edd-resend-receipt",function(e){return confirm(edd_vars.resend_receipt)})},copy_download_link:function(){$(document.body).on("click",".edd-copy-download-link",function(e){e.preventDefault();var $this=$(this),postData={action:"edd_get_file_download_link",payment_id:$('input[name="edd_payment_id"]').val(),download_id:$this.data("download-id"),price_id:$this.data("price-id")};$.ajax({type:"POST",data:postData,url:ajaxurl,success:function(link){return $("#edd-download-link").dialog({width:400}).html('<textarea rows="10" cols="40" id="edd-download-link-textarea">'+link+"</textarea>"),$("#edd-download-link-textarea").focus().select(),!1}}).fail(function(data){window.console&&window.console.log&&console.log(data)})})}}).init(),{init:function(){this.type_select(),this.product_requirements()},type_select:function(){$("#edd-edit-discount #edd-type, #edd-add-discount #edd-type").change(function(){var val=$(this).val();$(".edd-amount-description").hide(),$(".edd-amount-description."+val+"-discount").show()})},product_requirements:function(){$("#products").change(function(){var product_conditions=$("#edd-discount-product-conditions");$(this).val()?product_conditions.show():product_conditions.hide()})}}.init(),{init:function(){this.date_options(),this.customers_export()},date_options:function(){$("#edd-graphs-date-options").change(function(){var $this=$(this),date_range_options=$("#edd-date-range-options");"other"===$this.val()?date_range_options.show():date_range_options.hide()})},customers_export:function(){$("#edd_customer_export_download").change(function(){var $this=$(this),download_id=$("option:selected",$this).val(),customer_export_option=$("#edd_customer_export_option");if("0"===$this.val()?customer_export_option.show():customer_export_option.hide(),0!=parseInt(download_id)){var data={action:"edd_check_for_download_price_variations",download_id:download_id,all_prices:!0},price_options_select=$(".edd_price_options_select");$.post(ajaxurl,data,function(response){price_options_select.remove(),$("#edd_customer_export_download_chosen").after(response)})}else price_options_select.remove()})}}.init(),{init:function(){this.general(),this.taxes(),this.emails(),this.misc()},general:function(){var edd_color_picker=$(".edd-color-picker");if(edd_color_picker.length&&edd_color_picker.wpColorPicker(),"undefined"==typeof wp||"1"!==edd_vars.new_media_ui){var edd_settings_upload_button=$(".edd_settings_upload_button");0<edd_settings_upload_button.length&&(window.formfield="",$(document.body).on("click",edd_settings_upload_button,function(e){e.preventDefault(),window.formfield=$(this).parent().prev(),window.tbframe_interval=setInterval(function(){jQuery("#TB_iframeContent").contents().find(".savesend .button").val(edd_vars.use_this_file).end().find("#insert-gallery, .wp-post-thumbnail").hide()},2e3),tb_show(edd_vars.add_new_download,"media-upload.php?TB_iframe=true")}),window.edd_send_to_editor=window.send_to_editor,window.send_to_editor=function(html){window.formfield?(imgurl=$("a","<div>"+html+"</div>").attr("href"),window.formfield.val(imgurl),window.clearInterval(window.tbframe_interval),tb_remove()):window.edd_send_to_editor(html),window.send_to_editor=window.edd_send_to_editor,window.formfield="",window.imagefield=!1})}else{var file_frame;window.formfield="",$(document.body).on("click",".edd_settings_upload_button",function(e){e.preventDefault();var button=$(this);window.formfield=$(this).parent().prev(),file_frame||((file_frame=wp.media.frames.file_frame=wp.media({frame:"post",state:"insert",title:button.data("uploader_title"),button:{text:button.data("uploader_button_text")},multiple:!1})).on("menu:render:default",function(view){view.unset("library-separator"),view.unset("gallery"),view.unset("featured-image"),view.unset("embed"),view.set({})}),file_frame.on("insert",function(){file_frame.state().get("selection").each(function(attachment,index){attachment=attachment.toJSON(),window.formfield.val(attachment.url)})})),file_frame.open()}),window.formfield=""}},taxes:function(){var no_states=$("select.edd-no-states");no_states.length&&no_states.closest("tr").addClass("hidden"),$('select[name="edd_settings[base_country]"]').change(function(){var $this=$(this),$tr=$this.closest("tr"),data={action:"edd_get_shop_states",country:$this.val(),nonce:$this.data("nonce"),field_name:"edd_settings[base_state]"};return $.post(ajaxurl,data,function(response){"nostates"==response?$tr.next().addClass("hidden"):($tr.next().removeClass("hidden"),$tr.next().find("select").replaceWith(response))}),!1}),$(document.body).on("change","#edd_tax_rates select.edd-tax-country",function(){var $this=$(this),data={action:"edd_get_shop_states",country:$this.val(),nonce:$this.data("nonce"),field_name:$this.attr("name").replace("country","state")};return $.post(ajaxurl,data,function(response){if("nostates"==response){var text_field='<input type="text" name="'+data.field_name+'" value=""/>';$this.parent().next().find("select").replaceWith(text_field)}else $this.parent().next().find("input,select").show(),$this.parent().next().find("input,select").replaceWith(response)}),!1}),$("#edd_add_tax_rate").on("click",function(){var row=$("#edd_tax_rates tr:last"),clone=row.clone(),count=row.parent().find("tr").length;return clone.find("td input").not(":input[type=checkbox]").val(""),clone.find('td [type="checkbox"]').attr("checked",!1),clone.find("input, select").each(function(){var name=$(this).attr("name");name=name.replace(/\[(\d+)\]/,"["+parseInt(count)+"]"),$(this).attr("name",name).attr("id",name)}),clone.find("label").each(function(){var name=$(this).attr("for");name=name.replace(/\[(\d+)\]/,"["+parseInt(count)+"]"),$(this).attr("for",name)}),clone.insertAfter(row),!1}),$(document.body).on("click","#edd_tax_rates .edd_remove_tax_rate",function(){confirm(edd_vars.delete_tax_rate)&&(2===$("#edd_tax_rates tr:visible").length?($("#edd_tax_rates select").val(""),$('#edd_tax_rates input[type="text"]').val(""),$('#edd_tax_rates input[type="number"]').val(""),$('#edd_tax_rates input[type="checkbox"]').attr("checked",!1)):$(this).closest("tr").remove(),$("#edd_tax_rates tr").each(function(rowIndex){$(this).children().find("input, select").each(function(){var name=$(this).attr("name");name=name.replace(/\[(\d+)\]/,"["+(rowIndex-1)+"]"),$(this).attr("name",name).attr("id",name)})}));return!1})},emails:function(){$("#edd-sendwp-connect").on("click",function(e){e.preventDefault(),$(this).html(edd_vars.wait+' <span class="edd-loading"></span>'),document.body.style.cursor="wait",easy_digital_downloads_sendwp_remote_install()}),$("#edd-sendwp-disconnect").on("click",function(e){e.preventDefault(),$(this).html(edd_vars.wait+' <span class="edd-loading dark"></span>'),document.body.style.cursor="wait",easy_digital_downloads_sendwp_disconnect()}),$("#edd-recapture-connect").on("click",function(e){e.preventDefault(),$(this).html(edd_vars.wait+' <span class="edd-loading"></span>'),document.body.style.cursor="wait",easy_digital_downloads_recapture_remote_install()})},misc:function(){var downloadMethod=$('select[name="edd_settings[download_method]"]'),symlink=downloadMethod.parent().parent().next();"direct"==downloadMethod.val()&&(symlink.hide(),symlink.find("input").prop("checked",!1)),downloadMethod.on("change",function(){"direct"==$(this).val()?(symlink.hide(),symlink.find("input").prop("checked",!1)):symlink.show()})}}.init(),$(".download_page_edd-payment-history .row-actions .delete a, a.edd-delete-payment").on("click",function(){return!!confirm(edd_vars.delete_payment)}),$("body").on("click","#the-list .editinline",function(){var post_id=$(this).closest("tr").attr("id");post_id=post_id.replace("post-","");var regprice=$("#post-"+post_id).find(".column-price .downloadprice-"+post_id).val();regprice!=$("#post-"+post_id+".column-price .downloadprice-"+post_id).val()?$(".regprice","#edd-download-data").val(regprice).attr("disabled",!1):$(".regprice","#edd-download-data").val(edd_vars.quick_edit_warning).attr("disabled","disabled")}),$(document.body).on("click","#bulk_edit",function(){var $bulk_row=$("#bulk-edit"),$post_ids=new Array;$bulk_row.find("#bulk-titles").children().each(function(){$post_ids.push($(this).attr("id").replace(/^(ttle)/i,""))});var $price=$('#edd-download-data input[name="_edd_regprice"]').val(),data={action:"edd_save_bulk_edit",edd_bulk_nonce:$post_ids,post_ids:$post_ids,price:$price};$.post(ajaxurl,data)}),$(".edd-select-chosen").chosen({inherit_select_classes:!0,placeholder_text_single:edd_vars.one_option,placeholder_text_multiple:edd_vars.one_or_more_option}),$(".edd-select-chosen .chosen-search input").each(function(){var selectElem=$(this).parent().parent().parent().prev("select.edd-select-chosen"),placeholder=(selectElem.data("search-type"),selectElem.data("search-placeholder"));$(this).attr("placeholder",placeholder)}),$(".chosen-choices").on("click",function(){var placeholder=$(this).parent().prev().data("search-placeholder");void 0===placeholder&&(placeholder=edd_vars.type_to_search),$(this).children("li").children("input").attr("placeholder",placeholder)});$(document.body).on("keyup",".edd-select.chosen-container .chosen-search input, .edd-select.chosen-container .search-field input",function(e){var val=$(this).val(),container=$(this).closest(".edd-select-chosen"),select=(container.attr("id").replace("_chosen",""),container.prev()),no_bundles=container.hasClass("no-bundles"),variations=container.hasClass("variations"),lastKey=e.which,search_type="edd_download_search";if(container.prev().data("search-type")){if("no_ajax"==select.data("search-type"))return;search_type="edd_"+select.data("search-type")+"_search"}val.length<=3&&"edd_download_search"==search_type||16==lastKey||13==lastKey||91==lastKey||17==lastKey||37==lastKey||38==lastKey||39==lastKey||40==lastKey||(clearTimeout(typingTimer),typingTimer=setTimeout(function(){$.ajax({type:"GET",url:ajaxurl,data:{action:search_type,s:val,no_bundles:no_bundles,variations:variations},dataType:"json",beforeSend:function(){select.closest("ul.chosen-results").empty()},success:function(data){$("option:not(:selected)",select).remove(),$.each(data,function(key,item){$('option[value="'+item.id+'"]',select).length||select.prepend('<option value="'+item.id+'">'+item.name+"</option>")}),$(".edd-select-chosen").trigger("chosen:updated"),select.next().find("input").val(val)}}).fail(function(response){window.console&&window.console.log&&console.log(response)}).done(function(response){})},342))}),$("#post").on("click",".edd-thickbox",function(){$(".edd-select-chosen","#choose-download").css("width","100%")}),{init:function(){this.revoke_api_key(),this.regenerate_api_key(),this.create_api_key(),this.recount_stats()},revoke_api_key:function(){$(document.body).on("click",".edd-revoke-api-key",function(e){return confirm(edd_vars.revoke_api_key)})},regenerate_api_key:function(){$(document.body).on("click",".edd-regenerate-api-key",function(e){return confirm(edd_vars.regenerate_api_key)})},create_api_key:function(){$(document.body).on("submit","#api-key-generate-form",function(e){var input=$('input[type="text"][name="user_id"]');input.css("border-color","#ddd");var user_id=input.val();if(user_id.length<1||0==user_id)return input.css("border-color","#ff0000"),!1})},recount_stats:function(){$(document.body).on("change","#recount-stats-type",function(){var export_form=$("#edd-tools-recount-form"),selected_type=$("option:selected",this).data("type"),submit_button=$("#recount-stats-submit"),products=$("#tools-product-dropdown");if(export_form.find(".notice-wrap").remove(),submit_button.removeClass("button-disabled").attr("disabled",!1),products.hide(),$(".edd-recount-stats-descriptions span").hide(),"recount-download"===selected_type)products.show(),products.find(".edd-select-chosen").css("width","auto");else if("reset-stats"===selected_type){export_form.append('<div class="notice-wrap"></div>'),export_form.find(".notice-wrap").html('<div class="notice notice-warning"><p><input type="checkbox" id="confirm-reset" name="confirm_reset_store" value="1" /> <label for="confirm-reset">'+edd_vars.reset_stats_warn+"</label></p></div>"),$("#recount-stats-submit").addClass("button-disabled").attr("disabled","disabled")}else products.hide(),products.val(0);$("#"+selected_type).show()}),$(document.body).on("change","#confirm-reset",function(){$(this).is(":checked")?$("#recount-stats-submit").removeClass("button-disabled").removeAttr("disabled"):$("#recount-stats-submit").addClass("button-disabled").attr("disabled","disabled")}),$("#edd-tools-recount-form").submit(function(e){var selection=$("#recount-stats-type").val(),export_form=$(this),selected_type=$("option:selected",this).data("type");if("reset-stats"===selected_type){if($("#confirm-reset").is(":checked"))return!0;has_errors=!0}export_form.find(".notice-wrap").remove(),export_form.append('<div class="notice-wrap"></div>');var notice_wrap=export_form.find(".notice-wrap"),has_errors=!1;(null!==selection&&0!==selection||(notice_wrap.html('<div class="updated error"><p>'+edd_vars.batch_export_no_class+"</p></div>"),has_errors=!0),"recount-download"===selected_type)&&(0==$('select[name="download_id"]').val()&&(notice_wrap.html('<div class="updated error"><p>'+edd_vars.batch_export_no_reqs+"</p></div>"),has_errors=!0));if(has_errors)return export_form.find(".button-disabled").removeClass("button-disabled"),!1})}}.init(),{init:function(){this.submit(),this.dismiss_message()},submit:function(){var self=this;$(document.body).on("submit",".edd-export-form",function(e){e.preventDefault();var submitButton=$(this).find('input[type="submit"]');if(!submitButton.hasClass("button-disabled")){var data=$(this).serialize();submitButton.addClass("button-disabled"),$(this).find(".notice-wrap").remove(),$(this).append('<div class="notice-wrap"><span class="spinner is-active"></span><div class="edd-progress"><div></div></div></div>'),self.process_step(1,data,self)}})},process_step:function(step,data,self){$.ajax({type:"POST",url:ajaxurl,data:{form:data,action:"edd_do_ajax_export",step:step},dataType:"json",success:function(response){if("done"==response.step||response.error||response.success){var export_form=$(".edd-export-form").find(".edd-progress").parent().parent(),notice_wrap=export_form.find(".notice-wrap");if(export_form.find(".button-disabled").removeClass("button-disabled"),response.error){var error_message=response.message;notice_wrap.html('<div class="updated error"><p>'+error_message+"</p></div>")}else if(response.success){var success_message=response.message;notice_wrap.html('<div id="edd-batch-success" class="updated notice is-dismissible"><p>'+success_message+'<span class="notice-dismiss"></span></p></div>')}else notice_wrap.remove(),window.location=response.url}else $(".edd-progress div").animate({width:response.percentage+"%"},50,function(){}),self.process_step(parseInt(response.step),data,self)}}).fail(function(response){window.console&&window.console.log&&console.log(response)})},dismiss_message:function(){$(document.body).on("click","#edd-batch-success .notice-dismiss",function(){$("#edd-batch-success").parent().slideUp("fast")})}}.init();var EDD_Import={init:function(){this.submit()},submit:function(){$(".edd-import-form").ajaxForm({beforeSubmit:this.before_submit,success:this.success,complete:this.complete,dataType:"json",error:this.error})},before_submit:function(arr,$form,options){if($form.find(".notice-wrap").remove(),$form.append('<div class="notice-wrap"><span class="spinner is-active"></span><div class="edd-progress"><div></div></div></div>'),!(window.File&&window.FileReader&&window.FileList&&window.Blob)){var import_form=$(".edd-import-form").find(".edd-progress").parent().parent(),notice_wrap=import_form.find(".notice-wrap");return import_form.find(".button-disabled").removeClass("button-disabled"),notice_wrap.html('<div class="update error"><p>'+edd_vars.unsupported_browser+"</p></div>"),!1}},success:function(responseText,statusText,xhr,$form){},complete:function(xhr){var response=jQuery.parseJSON(xhr.responseText);if(response.success){var $form=$(".edd-import-form .notice-wrap").parent();$form.find(".edd-import-file-wrap,.notice-wrap").remove(),$form.find(".edd-import-options").slideDown();var select=$form.find("select.edd-import-csv-column"),options=(select.parents("tr").first(),""),columns=response.data.columns.sort(function(a,b){return a<b?-1:b<a?1:0});$.each(columns,function(key,value){options+='<option value="'+value+'">'+value+"</option>"}),select.append(options),select.on("change",function(){var $key=$(this).val();$key&&0!=response.data.first_row[$key]?$(this).parent().next().html(response.data.first_row[$key]):$(this).parent().next().html("")}),$.each(select,function(){$(this).val($(this).attr("data-field")).change()}),$(document.body).on("click",".edd-import-proceed",function(e){e.preventDefault(),$form.append('<div class="notice-wrap"><span class="spinner is-active"></span><div class="edd-progress"><div></div></div></div>'),response.data.mapping=$form.serialize(),EDD_Import.process_step(1,response.data,self)})}else EDD_Import.error(xhr)},error:function(xhr){var response=jQuery.parseJSON(xhr.responseText),import_form=$(".edd-import-form").find(".edd-progress").parent().parent(),notice_wrap=import_form.find(".notice-wrap");import_form.find(".button-disabled").removeClass("button-disabled"),response.data.error?notice_wrap.html('<div class="update error"><p>'+response.data.error+"</p></div>"):notice_wrap.remove()},process_step:function(step,import_data,self){$.ajax({type:"POST",url:ajaxurl,data:{form:import_data.form,nonce:import_data.nonce,class:import_data.class,upload:import_data.upload,mapping:import_data.mapping,action:"edd_do_ajax_import",step:step},dataType:"json",success:function(response){if("done"==response.data.step||response.data.error){var import_form=$(".edd-import-form").find(".edd-progress").parent().parent(),notice_wrap=import_form.find(".notice-wrap");import_form.find(".button-disabled").removeClass("button-disabled"),response.data.error?notice_wrap.html('<div class="update error"><p>'+response.data.error+"</p></div>"):(import_form.find(".edd-import-options").hide(),$("html, body").animate({scrollTop:import_form.parent().offset().top},500),notice_wrap.html('<div class="updated"><p>'+response.data.message+"</p></div>"))}else $(".edd-progress div").animate({width:response.data.percentage+"%"},50,function(){}),EDD_Import.process_step(parseInt(response.data.step),import_data,self)}}).fail(function(response){window.console&&window.console.log&&console.log(response)})}};EDD_Import.init();var EDD_Customer={vars:{customer_card_wrap_editable:$(".edd-customer-card-wrapper .editable"),customer_card_wrap_edit_item:$(".edd-customer-card-wrapper .edit-item"),user_id:$('input[name="customerinfo[user_id]"]'),state_input:$(':input[name="customerinfo[state]"]'),note:$("#customer-note")},init:function(){this.edit_customer(),this.add_email(),this.user_search(),this.remove_user(),this.cancel_edit(),this.change_country(),this.add_note(),this.delete_checked()},edit_customer:function(){$(document.body).on("click","#edit-customer",function(e){e.preventDefault(),EDD_Customer.vars.customer_card_wrap_editable.hide(),EDD_Customer.vars.customer_card_wrap_edit_item.fadeIn().css("display","block")})},add_email:function(){$(document.body).on("click","#add-customer-email",function(e){e.preventDefault();var button=$(this),wrapper=button.parent();wrapper.parent().find(".notice-container").remove(),wrapper.find(".spinner").css("visibility","visible"),button.attr("disabled",!0);var postData={edd_action:"customer-add-email",customer_id:wrapper.find('input[name="customer-id"]').val(),email:wrapper.find('input[name="additional-email"]').val(),primary:wrapper.find('input[name="make-additional-primary"]').is(":checked"),_wpnonce:wrapper.find('input[name="add_email_nonce"]').val()};$.post(ajaxurl,postData,function(response){!0===response.success?window.location.href=response.redirect:(button.attr("disabled",!1),wrapper.after('<div class="notice-container"><div class="notice notice-error inline"><p>'+response.message+"</p></div></div>"),wrapper.find(".spinner").css("visibility","hidden"))},"json")})},user_search:function(){$(document.body).on("click.eddSelectUser",".edd_user_search_results a",function(e){e.preventDefault();var user_id=$(this).data("userid");EDD_Customer.vars.user_id.val(user_id)})},remove_user:function(){$(document.body).on("click","#disconnect-customer",function(e){if(e.preventDefault(),confirm(edd_vars.disconnect_customer)){var postData={edd_action:"disconnect-userid",customer_id:$('input[name="customerinfo[id]"]').val(),_wpnonce:$("#edit-customer-info #_wpnonce").val()};$.post(ajaxurl,postData,function(response){window.location.href=window.location.href},"json")}})},cancel_edit:function(){$(document.body).on("click","#edd-edit-customer-cancel",function(e){e.preventDefault(),EDD_Customer.vars.customer_card_wrap_edit_item.hide(),EDD_Customer.vars.customer_card_wrap_editable.show(),$(".edd_user_search_results").html("")})},change_country:function(){$('select[name="customerinfo[country]"]').change(function(){var $this=$(this),data={action:"edd_get_shop_states",country:$this.val(),nonce:$this.data("nonce"),field_name:"customerinfo[state]"};return $.post(ajaxurl,data,function(response){"nostates"==response?EDD_Customer.vars.state_input.replaceWith('<input type="text" name="'+data.field_name+'" value="" class="edd-edit-toggles medium-text"/>'):EDD_Customer.vars.state_input.replaceWith(response)}),!1})},add_note:function(){$(document.body).on("click","#add-customer-note",function(e){e.preventDefault();var postData={edd_action:"add-customer-note",customer_id:$("#customer-id").val(),customer_note:EDD_Customer.vars.note.val(),add_customer_note_nonce:$("#add_customer_note_nonce").val()};if(postData.customer_note)$.ajax({type:"POST",data:postData,url:ajaxurl,success:function(response){$("#edd-customer-notes").prepend(response),$(".edd-no-customer-notes").hide(),EDD_Customer.vars.note.val("")}}).fail(function(data){window.console&&window.console.log&&console.log(data)});else{var border_color=EDD_Customer.vars.note.css("border-color");EDD_Customer.vars.note.css("border-color","red"),setTimeout(function(){EDD_Customer.vars.note.css("border-color",border_color)},500)}})},delete_checked:function(){$("#edd-customer-delete-confirm").change(function(){var records_input=$("#edd-customer-delete-records"),submit_button=$("#edd-delete-customer");$(this).prop("checked")?(records_input.attr("disabled",!1),submit_button.attr("disabled",!1)):(records_input.attr("disabled",!0),records_input.prop("checked",!1),submit_button.attr("disabled",!0))})}};EDD_Customer.init();var EDD_Promo_Notices={init:function(){EDD_Promo_Notices.displayNotices(),EDD_Promo_Notices.dismissNotices()},displayNotices:function(){var topOfPageNotice=$(".edd-admin-notice-top-of-page");if(topOfPageNotice){var topOfPageNoticeEl=topOfPageNotice.detach();$("#wpbody-content").prepend(topOfPageNoticeEl),topOfPageNotice.delay(1e3).slideDown()}},dismissNotices:function(){$(".edd-promo-notice").each(function(){var notice=$(this);notice.on("click",".edd-promo-notice-dismiss",function(e){e.preventDefault(),$.ajax({type:"POST",data:{action:"edd_dismiss_promo_notice",notice_id:notice.data("id"),nonce:notice.data("nonce"),lifespan:notice.data("lifespan")},url:ajaxurl,success:function(response){notice.slideUp()}})})})}};EDD_Promo_Notices.init(),$(".edd-ajax-user-search").keyup(function(){var user_search=$(this).val(),exclude="";$(this).data("exclude")&&(exclude=$(this).data("exclude")),$(".edd-ajax").show();var data={action:"edd_search_users",user_name:user_search,exclude:exclude};document.body.style.cursor="wait",$.ajax({type:"POST",data:data,dataType:"json",url:ajaxurl,success:function(search_response){$(".edd-ajax").hide(),$(".edd_user_search_results").removeClass("hidden"),$(".edd_user_search_results span").html(""),$(search_response.results).appendTo(".edd_user_search_results span"),document.body.style.cursor="default"}})}),$(document.body).on("click.eddSelectUser",".edd_user_search_results span a",function(e){e.preventDefault();var login=$(this).data("login");$(".edd-ajax-user-search").val(login),$(".edd_user_search_results").addClass("hidden"),$(".edd_user_search_results span").html("")}),$(document.body).on("click.eddCancelUserSearch",".edd_user_search_results a.edd-ajax-user-cancel",function(e){e.preventDefault(),$(".edd-ajax-user-search").val(""),$(".edd_user_search_results").addClass("hidden"),$(".edd_user_search_results span").html("")}),$("#edd_dashboard_sales").length&&$.ajax({type:"GET",data:{action:"edd_load_dashboard_widget"},url:ajaxurl,success:function(response){$("#edd_dashboard_sales .inside").html(response)}}),$(document.body).on("keydown",".customer-note-input",function(e){13==e.keyCode&&(e.metaKey||e.ctrlKey)&&$("#add-customer-note").click()})});var eddFormatCurrency=function(value){var numeric=parseFloat(value),storeCurrency=edd_vars.currency,decimalPlaces=edd_vars.currency_decimals;return numeric.toLocaleString(storeCurrency,{style:"currency",currency:storeCurrency,minimumFractionDigits:decimalPlaces,maximumFractionDigits:decimalPlaces})},eddFormatNumber=function(value){var numeric=parseFloat(value),storeCurrency=edd_vars.currency;edd_vars.currency_decimals;return numeric.toLocaleString(storeCurrency,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0})},eddLabelFormatter=function(label,series){return'<div style="font-size:12px; text-align:center; padding:2px">'+label+"</div>"},eddLegendFormatterSales=function(label,series){var slug=label.toLowerCase().replace(/\s/g,"-"),color='<div class="edd-legend-color" style="background-color: '+series.color+'"></div>',value='<div class="edd-pie-legend-item">'+label+": "+Math.round(series.percent)+"% ("+eddFormatNumber(series.data[0][1])+")</div>",item='<div id="'+series.edd_vars.id+slug+'" class="edd-legend-item-wrapper">'+color+value+"</div>";return jQuery("#edd-pie-legend-"+series.edd_vars.id).append(item),item},eddLegendFormatterEarnings=function(label,series){var slug=label.toLowerCase().replace(/\s/g,"-"),color='<div class="edd-legend-color" style="background-color: '+series.color+'"></div>',value='<div class="edd-pie-legend-item">'+label+": "+Math.round(series.percent)+"% ("+eddFormatCurrency(series.data[0][1])+")</div>",item='<div id="'+series.edd_vars.id+slug+'" class="edd-legend-item-wrapper">'+color+value+"</div>";return jQuery("#edd-pie-legend-"+series.edd_vars.id).append(item),item};function edd_attach_tooltips(selector){selector.tooltip({content:function(){return jQuery(this).prop("title")},tooltipClass:"edd-ui-tooltip",position:{my:"center top",at:"center bottom+10",collision:"flipfit"},hide:{duration:200},show:{duration:200}})}function easy_digital_downloads_sendwp_remote_install(){jQuery.post(ajaxurl,{action:"edd_sendwp_remote_install"},function(response){response.success||!confirm(response.data.error)?easy_digital_downloads_sendwp_register_client(response.data.register_url,response.data.client_name,response.data.client_secret,response.data.client_redirect,response.data.partner_id):location.reload()})}function easy_digital_downloads_sendwp_disconnect(){jQuery.post(ajaxurl,{action:"edd_sendwp_disconnect"},function(response){location.reload()})}function easy_digital_downloads_sendwp_register_client(register_url,client_name,client_secret,client_redirect,partner_id){var form=document.createElement("form");function easy_digital_downloads_sendwp_append_form_input(name,value){var input=document.createElement("input");input.setAttribute("type","hidden"),input.setAttribute("name",name),input.setAttribute("value",value),form.appendChild(input)}form.setAttribute("method","POST"),form.setAttribute("action",register_url),easy_digital_downloads_sendwp_append_form_input("client_name",client_name),easy_digital_downloads_sendwp_append_form_input("client_secret",client_secret),easy_digital_downloads_sendwp_append_form_input("client_redirect",client_redirect),easy_digital_downloads_sendwp_append_form_input("partner_id",partner_id),document.body.appendChild(form),form.submit()}function easy_digital_downloads_recapture_remote_install(){jQuery.post(ajaxurl,{action:"edd_recapture_remote_install"},function(response){0==response.success&&confirm(response.data.error)?location.reload():window.location.href="https://recapture.io/register"})}
assets/js/edd-ajax.js CHANGED
@@ -174,6 +174,8 @@ jQuery(document).ready(function ($) {
174
  price_ids : item_price_ids,
175
  post_data: $(form).serialize(),
176
  nonce: nonce,
 
 
177
  };
178
 
179
  $.ajax({
@@ -397,7 +399,10 @@ jQuery(document).ready(function ($) {
397
 
398
  e.preventDefault();
399
 
 
 
400
  var complete_purchase_val = $(this).val();
 
401
 
402
  $(this).val(edd_global_vars.purchase_loading);
403
 
174
  price_ids : item_price_ids,
175
  post_data: $(form).serialize(),
176
  nonce: nonce,
177
+ timestamp: $this.data( 'timestamp' ),
178
+ token: $this.data( 'token' )
179
  };
180
 
181
  $.ajax({
399
 
400
  e.preventDefault();
401
 
402
+ var submitButton = document.getElementById( $( this ).attr( 'id' ) );
403
+
404
  var complete_purchase_val = $(this).val();
405
+ submitButton.setAttribute( 'data-original-value', complete_purchase_val );
406
 
407
  $(this).val(edd_global_vars.purchase_loading);
408
 
assets/js/edd-ajax.min.js CHANGED
@@ -1 +1 @@
1
- var edd_scripts;function edd_load_gateway(payment_mode){jQuery(".edd-cart-ajax").show(),jQuery("#edd_purchase_form_wrap").html('<span class="edd-loading-ajax edd-loading"></span>');var nonce=jQuery("#edd-gateway-"+payment_mode).data(payment_mode+"-nonce"),url=edd_scripts.ajaxurl;0<url.indexOf("?")?url+="&":url+="?",url=url+"payment-mode="+payment_mode,jQuery.post(url,{action:"edd_load_gateway",edd_payment_mode:payment_mode,nonce:nonce},function(response){jQuery("#edd_purchase_form_wrap").html(response),jQuery(".edd-no-js").hide(),jQuery("body").trigger("edd_gateway_loaded",[payment_mode])})}jQuery(document).ready(function($){var chosen_gateway,ajax_needed;$(".edd-no-js").hide(),$("a.edd-add-to-cart").addClass("edd-has-js"),$(document.body).on("click.eddRemoveFromCart",".edd-remove-from-cart",function(event){var nonce=$(this),item=nonce.data("cart-item"),action=nonce.data("action"),id=nonce.data("download-id"),nonce=nonce.data("nonce");return $.ajax({type:"POST",data:{action:action,cart_item:item,nonce:nonce},dataType:"json",url:edd_scripts.ajaxurl,xhrFields:{withCredentials:!0},success:function(response){if(response.removed){if(parseInt(edd_scripts.position_in_cart,10)===parseInt(item,10)||edd_scripts.has_purchase_links)return window.location=window.location,!1;$(".edd-cart").each(function(){$(this).find("[data-cart-item='"+item+"']").parent().remove()}),$(".edd-cart").each(function(){var cart_item_counter=0;$(this).find("[data-cart-item]").each(function(){$(this).attr("data-cart-item",cart_item_counter),cart_item_counter+=1})}),$("[id^=edd_purchase_"+id+"]").length&&($("[id^=edd_purchase_"+id+"] .edd_go_to_checkout").hide(),$("[id^=edd_purchase_"+id+"] a.edd-add-to-cart").show().removeAttr("data-edd-loading"),"1"==edd_scripts.quantities_enabled&&$("[id^=edd_purchase_"+id+"] .edd_download_quantity_wrapper").show()),$("span.edd-cart-quantity").text(response.cart_quantity),$(document.body).trigger("edd_quantity_updated",[response.cart_quantity]),edd_scripts.taxes_enabled&&($(".cart_item.edd_subtotal span").html(response.subtotal),$(".cart_item.edd_cart_tax span").html(response.tax)),$(".cart_item.edd_total span").html(response.total),0==response.cart_quantity&&($(".cart_item.edd_subtotal,.edd-cart-number-of-items,.cart_item.edd_checkout,.cart_item.edd_cart_tax,.cart_item.edd_total").hide(),$(".edd-cart").each(function(){var cart_wrapper=$(this).parent();cart_wrapper.length&&(cart_wrapper.addClass("cart-empty"),cart_wrapper.removeClass("cart-not-empty")),$(this).append('<li class="cart_item empty">'+edd_scripts.empty_cart_message+"</li>")})),$(document.body).trigger("edd_cart_item_removed",[response])}}}).fail(function(response){window.console&&window.console.log&&console.log(response)}).done(function(response){}),!1}),$(document.body).on("click.eddAddToCart",".edd-add-to-cart",function(e){e.preventDefault();var $this=$(this),form=$this.closest("form");$this.prop("disabled",!0);$this.find(".edd-loading");var container=$this.closest("div");$this.attr("data-edd-loading","");var form=$this.parents("form").last(),download=$this.data("download-id"),variable_price=$this.data("variable-price"),price_mode=$this.data("price-mode"),data=$this.data("nonce"),item_price_ids=[],free_items=!0;if("yes"==variable_price)if(0<form.find(".edd_price_option_"+download+'[type="hidden"]').length)item_price_ids[0]=$(".edd_price_option_"+download,form).val(),form.find(".edd-submit").data("price")&&0<form.find(".edd-submit").data("price")&&(free_items=!1);else{if(!form.find(".edd_price_option_"+download+":checked",form).length)return $this.removeAttr("data-edd-loading"),alert(edd_scripts.select_option),e.stopPropagation(),$this.prop("disabled",!1),!1;form.find(".edd_price_option_"+download+":checked",form).each(function(item_price){item_price_ids[item_price]=$(this).val(),!0!==free_items||(item_price=$(this).data("price"))&&0<item_price&&(free_items=!1)})}else item_price_ids[0]=download,$this.data("price")&&0<$this.data("price")&&(free_items=!1);if(free_items&&form.find(".edd_action_input").val("add_to_cart"),"straight_to_gateway"==form.find(".edd_action_input").val())return form.submit(),!0;data={action:$this.data("action"),download_id:download,price_ids:item_price_ids,post_data:$(form).serialize(),nonce:data};return $.ajax({type:"POST",data:data,dataType:"json",url:edd_scripts.ajaxurl,xhrFields:{withCredentials:!0},success:function(response){var store_redirect="1"==edd_scripts.redirect_to_checkout,parent_form="1"==form.find("#edd_redirect_to_checkout").val();store_redirect&&parent_form||!store_redirect&&parent_form?window.location=edd_scripts.checkout_page:("1"===edd_scripts.taxes_enabled&&($(".cart_item.edd_subtotal").show(),$(".cart_item.edd_cart_tax").show()),$(".cart_item.edd_total").show(),$(".cart_item.edd_checkout").show(),$(".cart_item.empty").length&&$(".cart_item.empty").hide(),$(".widget_edd_cart_widget .edd-cart").each(function(cart){var cart_wrapper=$(this).find(".edd-cart-meta:first");$(response.cart_item).insertBefore(cart_wrapper);cart_wrapper=$(this).parent();cart_wrapper.length&&(cart_wrapper.addClass("cart-not-empty"),cart_wrapper.removeClass("cart-empty"))}),"1"===edd_scripts.taxes_enabled&&($(".edd-cart-meta.edd_subtotal span").html(response.subtotal),$(".edd-cart-meta.edd_cart_tax span").html(response.tax)),$(".edd-cart-meta.edd_total span").html(response.total),$(".edd-cart-item-title",response.cart_item).length,$("span.edd-cart-quantity").each(function(){$(this).text(response.cart_quantity),$(document.body).trigger("edd_quantity_updated",[response.cart_quantity])}),"none"==$(".edd-cart-number-of-items").css("display")&&$(".edd-cart-number-of-items").show("slow"),"no"!=variable_price&&"multi"==price_mode||($("a.edd-add-to-cart",container).toggle(),$(".edd_go_to_checkout",container).css("display","inline-block")),"multi"==price_mode&&$this.removeAttr("data-edd-loading"),!$(".edd_download_purchase_form").length||"no"!=variable_price&&form.find(".edd_price_option_"+download).is("input:hidden")||(parent_form=$('.edd_download_purchase_form *[data-download-id="'+download+'"]').parents("form"),$("a.edd-add-to-cart",parent_form).hide(),"multi"!=price_mode&&parent_form.find(".edd_download_quantity_wrapper").slideUp(),$(".edd_go_to_checkout",parent_form).show().removeAttr("data-edd-loading")),"incart"!=response&&($(".edd-cart-added-alert",container).fadeIn(),setTimeout(function(){$(".edd-cart-added-alert",container).fadeOut()},3e3)),$this.prop("disabled",!1),$(document.body).trigger("edd_cart_item_added",[response]))}}).fail(function(response){window.console&&window.console.log&&console.log(response)}).done(function(response){}),!1}),$("#edd_checkout_form_wrap").on("click",".edd_checkout_register_login",function(){var data=$(this),data={action:data.data("action"),nonce:data.data("nonce")};return $(".edd-cart-ajax").show(),$.post(edd_scripts.ajaxurl,data,function(checkout_response){$("#edd_checkout_login_register").html(edd_scripts.loading),$("#edd_checkout_login_register").html(checkout_response),$(".edd-cart-ajax").hide()}),!1}),$(document).on("click","#edd_purchase_form #edd_login_fields input[type=submit]",function(data){data.preventDefault();var complete_purchase_val=$(this).val();$(this).val(edd_global_vars.purchase_loading),$(this).after('<span class="edd-loading-ajax edd-loading"></span>');data={action:"edd_process_checkout_login",edd_ajax:1,edd_user_login:$("#edd_login_fields #edd_user_login").val(),edd_user_pass:$("#edd_login_fields #edd_user_pass").val(),edd_login_nonce:$("#edd_login_nonce").val()};$.post(edd_global_vars.ajaxurl,data,function(data){"success"==$.trim(data)?($(".edd_errors").remove(),window.location=edd_scripts.checkout_page):($("#edd_login_fields input[type=submit]").val(complete_purchase_val),$(".edd-loading-ajax").remove(),$(".edd_errors").remove(),$("#edd-user-login-submit").before(data))})}),$(document).on("change","select#edd-gateway, input.edd-gateway",function(e){var payment_mode=$("#edd-gateway option:selected, input.edd-gateway:checked").val();return"0"==payment_mode||edd_load_gateway(payment_mode),!1}),"1"==edd_scripts.is_checkout&&(ajax_needed=chosen_gateway=!1,$("select#edd-gateway, input.edd-gateway").length&&(chosen_gateway=$("meta[name='edd-chosen-gateway']").attr("content"),ajax_needed=!0),chosen_gateway=chosen_gateway||edd_scripts.default_gateway,ajax_needed?setTimeout(function(){edd_load_gateway(chosen_gateway)},200):$("body").trigger("edd_gateway_loaded",[chosen_gateway])),$(document).on("click","#edd_purchase_form #edd_purchase_submit [type=submit]",function(e){var complete_purchase_val,eddPurchaseform=document.getElementById("edd_purchase_form");"function"==typeof eddPurchaseform.checkValidity&&!1===eddPurchaseform.checkValidity()||(e.preventDefault(),complete_purchase_val=$(this).val(),$(this).val(edd_global_vars.purchase_loading),$(this).prop("disabled",!0),$(this).after('<span class="edd-loading-ajax edd-loading"></span>'),$.post(edd_global_vars.ajaxurl,$("#edd_purchase_form").serialize()+"&action=edd_process_checkout&edd_ajax=true",function(data){"success"==$.trim(data)?($(".edd_errors").remove(),$(".edd-error").hide(),$(eddPurchaseform).submit()):($("#edd-purchase-button").val(complete_purchase_val),$(".edd-loading-ajax").remove(),$(".edd_errors").remove(),$(".edd-error").hide(),$(edd_global_vars.checkout_error_anchor).before(data),$("#edd-purchase-button").prop("disabled",!1),$(document.body).trigger("edd_checkout_error",[data]))}))}),$(document.body).on("change","#edd_cc_address input.card_state, #edd_cc_address select, #edd_address_country",function(){var $form,$this=$(this),is_checkout="undefined"!=typeof edd_global_vars,field_name="card_state";"edd_address_country"==$(this).attr("id")&&(field_name="edd_address_state");var postData=document.getElementById(field_name);"card_state"!=$this.attr("id")&&null!=postData?(postData=$(this).data("nonce"),postData={action:"edd_get_shop_states",country:$this.val(),field_name:field_name,nonce:postData},$.ajax({type:"POST",data:postData,url:edd_scripts.ajaxurl,xhrFields:{withCredentials:!0},success:function(response){$form=is_checkout?$("#edd_purchase_form"):$this.closest("form");var text_field,state_inputs='input[name="card_state"], select[name="card_state"], input[name="edd_address_state"], select[name="edd_address_state"]';"nostates"==$.trim(response)?(text_field='<input type="text" id='+field_name+' name="card_state" class="card-state edd-input required" value=""/>',$form.find(state_inputs).replaceWith(text_field)):$form.find(state_inputs).replaceWith(response),is_checkout&&$(document.body).trigger("edd_cart_billing_address_updated",[response])}}).fail(function(data){window.console&&window.console.log&&console.log(data)}).done(function(data){is_checkout&&recalculate_taxes()})):is_checkout&&recalculate_taxes();return!1}),$(document.body).on("change","#edd_cc_address input[name=card_zip]",function(){"undefined"!=typeof edd_global_vars&&recalculate_taxes()})});
1
+ var edd_scripts;function edd_load_gateway(payment_mode){jQuery(".edd-cart-ajax").show(),jQuery("#edd_purchase_form_wrap").html('<span class="edd-loading-ajax edd-loading"></span>');var nonce=jQuery("#edd-gateway-"+payment_mode).data(payment_mode+"-nonce"),url=edd_scripts.ajaxurl;0<url.indexOf("?")?url+="&":url+="?",url=url+"payment-mode="+payment_mode,jQuery.post(url,{action:"edd_load_gateway",edd_payment_mode:payment_mode,nonce:nonce},function(response){jQuery("#edd_purchase_form_wrap").html(response),jQuery(".edd-no-js").hide(),jQuery("body").trigger("edd_gateway_loaded",[payment_mode])})}jQuery(document).ready(function($){if($(".edd-no-js").hide(),$("a.edd-add-to-cart").addClass("edd-has-js"),$(document.body).on("click.eddRemoveFromCart",".edd-remove-from-cart",function(event){var $this=$(this),item=$this.data("cart-item"),action=$this.data("action"),id=$this.data("download-id"),nonce=$this.data("nonce"),data={action:action,cart_item:item,nonce:nonce};return $.ajax({type:"POST",data:data,dataType:"json",url:edd_scripts.ajaxurl,xhrFields:{withCredentials:!0},success:function(response){if(response.removed){if(parseInt(edd_scripts.position_in_cart,10)===parseInt(item,10)||edd_scripts.has_purchase_links)return window.location=window.location,!1;$(".edd-cart").each(function(){$(this).find("[data-cart-item='"+item+"']").parent().remove()}),$(".edd-cart").each(function(){var cart_item_counter=0;$(this).find("[data-cart-item]").each(function(){$(this).attr("data-cart-item",cart_item_counter),cart_item_counter+=1})}),$("[id^=edd_purchase_"+id+"]").length&&($("[id^=edd_purchase_"+id+"] .edd_go_to_checkout").hide(),$("[id^=edd_purchase_"+id+"] a.edd-add-to-cart").show().removeAttr("data-edd-loading"),"1"==edd_scripts.quantities_enabled&&$("[id^=edd_purchase_"+id+"] .edd_download_quantity_wrapper").show()),$("span.edd-cart-quantity").text(response.cart_quantity),$(document.body).trigger("edd_quantity_updated",[response.cart_quantity]),edd_scripts.taxes_enabled&&($(".cart_item.edd_subtotal span").html(response.subtotal),$(".cart_item.edd_cart_tax span").html(response.tax)),$(".cart_item.edd_total span").html(response.total),0==response.cart_quantity&&($(".cart_item.edd_subtotal,.edd-cart-number-of-items,.cart_item.edd_checkout,.cart_item.edd_cart_tax,.cart_item.edd_total").hide(),$(".edd-cart").each(function(){var cart_wrapper=$(this).parent();cart_wrapper.length&&(cart_wrapper.addClass("cart-empty"),cart_wrapper.removeClass("cart-not-empty")),$(this).append('<li class="cart_item empty">'+edd_scripts.empty_cart_message+"</li>")})),$(document.body).trigger("edd_cart_item_removed",[response])}}}).fail(function(response){window.console&&window.console.log&&console.log(response)}).done(function(response){}),!1}),$(document.body).on("click.eddAddToCart",".edd-add-to-cart",function(e){e.preventDefault();var $this=$(this),form=$this.closest("form");$this.prop("disabled",!0);$this.find(".edd-loading");var container=$this.closest("div");$this.attr("data-edd-loading","");form=$this.parents("form").last();var download=$this.data("download-id"),variable_price=$this.data("variable-price"),price_mode=$this.data("price-mode"),nonce=$this.data("nonce"),item_price_ids=[],free_items=!0;if("yes"==variable_price)if(0<form.find(".edd_price_option_"+download+'[type="hidden"]').length)item_price_ids[0]=$(".edd_price_option_"+download,form).val(),form.find(".edd-submit").data("price")&&0<form.find(".edd-submit").data("price")&&(free_items=!1);else{if(!form.find(".edd_price_option_"+download+":checked",form).length)return $this.removeAttr("data-edd-loading"),alert(edd_scripts.select_option),e.stopPropagation(),$this.prop("disabled",!1),!1;form.find(".edd_price_option_"+download+":checked",form).each(function(index){if(item_price_ids[index]=$(this).val(),!0===free_items){var item_price=$(this).data("price");item_price&&0<item_price&&(free_items=!1)}})}else item_price_ids[0]=download,$this.data("price")&&0<$this.data("price")&&(free_items=!1);if(free_items&&form.find(".edd_action_input").val("add_to_cart"),"straight_to_gateway"==form.find(".edd_action_input").val())return form.submit(),!0;var data={action:$this.data("action"),download_id:download,price_ids:item_price_ids,post_data:$(form).serialize(),nonce:nonce,timestamp:$this.data("timestamp"),token:$this.data("token")};return $.ajax({type:"POST",data:data,dataType:"json",url:edd_scripts.ajaxurl,xhrFields:{withCredentials:!0},success:function(response){var store_redirect="1"==edd_scripts.redirect_to_checkout,item_redirect="1"==form.find("#edd_redirect_to_checkout").val();if(store_redirect&&item_redirect||!store_redirect&&item_redirect)window.location=edd_scripts.checkout_page;else{"1"===edd_scripts.taxes_enabled&&($(".cart_item.edd_subtotal").show(),$(".cart_item.edd_cart_tax").show()),$(".cart_item.edd_total").show(),$(".cart_item.edd_checkout").show(),$(".cart_item.empty").length&&$(".cart_item.empty").hide(),$(".widget_edd_cart_widget .edd-cart").each(function(cart){var target=$(this).find(".edd-cart-meta:first");$(response.cart_item).insertBefore(target);var cart_wrapper=$(this).parent();cart_wrapper.length&&(cart_wrapper.addClass("cart-not-empty"),cart_wrapper.removeClass("cart-empty"))}),"1"===edd_scripts.taxes_enabled&&($(".edd-cart-meta.edd_subtotal span").html(response.subtotal),$(".edd-cart-meta.edd_cart_tax span").html(response.tax)),$(".edd-cart-meta.edd_total span").html(response.total);$(".edd-cart-item-title",response.cart_item).length;if($("span.edd-cart-quantity").each(function(){$(this).text(response.cart_quantity),$(document.body).trigger("edd_quantity_updated",[response.cart_quantity])}),"none"==$(".edd-cart-number-of-items").css("display")&&$(".edd-cart-number-of-items").show("slow"),"no"!=variable_price&&"multi"==price_mode||($("a.edd-add-to-cart",container).toggle(),$(".edd_go_to_checkout",container).css("display","inline-block")),"multi"==price_mode&&$this.removeAttr("data-edd-loading"),$(".edd_download_purchase_form").length&&("no"==variable_price||!form.find(".edd_price_option_"+download).is("input:hidden"))){var parent_form=$('.edd_download_purchase_form *[data-download-id="'+download+'"]').parents("form");$("a.edd-add-to-cart",parent_form).hide(),"multi"!=price_mode&&parent_form.find(".edd_download_quantity_wrapper").slideUp(),$(".edd_go_to_checkout",parent_form).show().removeAttr("data-edd-loading")}"incart"!=response&&($(".edd-cart-added-alert",container).fadeIn(),setTimeout(function(){$(".edd-cart-added-alert",container).fadeOut()},3e3)),$this.prop("disabled",!1),$(document.body).trigger("edd_cart_item_added",[response])}}}).fail(function(response){window.console&&window.console.log&&console.log(response)}).done(function(response){}),!1}),$("#edd_checkout_form_wrap").on("click",".edd_checkout_register_login",function(){var $this=$(this),data={action:$this.data("action"),nonce:$this.data("nonce")};return $(".edd-cart-ajax").show(),$.post(edd_scripts.ajaxurl,data,function(checkout_response){$("#edd_checkout_login_register").html(edd_scripts.loading),$("#edd_checkout_login_register").html(checkout_response),$(".edd-cart-ajax").hide()}),!1}),$(document).on("click","#edd_purchase_form #edd_login_fields input[type=submit]",function(e){e.preventDefault();var complete_purchase_val=$(this).val();$(this).val(edd_global_vars.purchase_loading),$(this).after('<span class="edd-loading-ajax edd-loading"></span>');var data={action:"edd_process_checkout_login",edd_ajax:1,edd_user_login:$("#edd_login_fields #edd_user_login").val(),edd_user_pass:$("#edd_login_fields #edd_user_pass").val(),edd_login_nonce:$("#edd_login_nonce").val()};$.post(edd_global_vars.ajaxurl,data,function(data){"success"==$.trim(data)?($(".edd_errors").remove(),window.location=edd_scripts.checkout_page):($("#edd_login_fields input[type=submit]").val(complete_purchase_val),$(".edd-loading-ajax").remove(),$(".edd_errors").remove(),$("#edd-user-login-submit").before(data))})}),$(document).on("change","select#edd-gateway, input.edd-gateway",function(e){var payment_mode=$("#edd-gateway option:selected, input.edd-gateway:checked").val();return"0"==payment_mode||edd_load_gateway(payment_mode),!1}),"1"==edd_scripts.is_checkout){var chosen_gateway=!1,ajax_needed=!1;$("select#edd-gateway, input.edd-gateway").length&&(chosen_gateway=$("meta[name='edd-chosen-gateway']").attr("content"),ajax_needed=!0),chosen_gateway||(chosen_gateway=edd_scripts.default_gateway),ajax_needed?setTimeout(function(){edd_load_gateway(chosen_gateway)},200):$("body").trigger("edd_gateway_loaded",[chosen_gateway])}$(document).on("click","#edd_purchase_form #edd_purchase_submit [type=submit]",function(e){var eddPurchaseform=document.getElementById("edd_purchase_form");if("function"!=typeof eddPurchaseform.checkValidity||!1!==eddPurchaseform.checkValidity()){e.preventDefault();var submitButton=document.getElementById($(this).attr("id")),complete_purchase_val=$(this).val();submitButton.setAttribute("data-original-value",complete_purchase_val),$(this).val(edd_global_vars.purchase_loading),$(this).prop("disabled",!0),$(this).after('<span class="edd-loading-ajax edd-loading"></span>'),$.post(edd_global_vars.ajaxurl,$("#edd_purchase_form").serialize()+"&action=edd_process_checkout&edd_ajax=true",function(data){"success"==$.trim(data)?($(".edd_errors").remove(),$(".edd-error").hide(),$(eddPurchaseform).submit()):($("#edd-purchase-button").val(complete_purchase_val),$(".edd-loading-ajax").remove(),$(".edd_errors").remove(),$(".edd-error").hide(),$(edd_global_vars.checkout_error_anchor).before(data),$("#edd-purchase-button").prop("disabled",!1),$(document.body).trigger("edd_checkout_error",[data]))})}}),$(document.body).on("change","#edd_cc_address input.card_state, #edd_cc_address select, #edd_address_country",function(){var $form,$this=$(this),is_checkout="undefined"!=typeof edd_global_vars,field_name="card_state";"edd_address_country"==$(this).attr("id")&&(field_name="edd_address_state");var state_inputs=document.getElementById(field_name);if("card_state"!=$this.attr("id")&&null!=state_inputs){var nonce=$(this).data("nonce"),postData={action:"edd_get_shop_states",country:$this.val(),field_name:field_name,nonce:nonce};$.ajax({type:"POST",data:postData,url:edd_scripts.ajaxurl,xhrFields:{withCredentials:!0},success:function(response){$form=is_checkout?$("#edd_purchase_form"):$this.closest("form");var state_inputs='input[name="card_state"], select[name="card_state"], input[name="edd_address_state"], select[name="edd_address_state"]';if("nostates"==$.trim(response)){var text_field='<input type="text" id='+field_name+' name="card_state" class="card-state edd-input required" value=""/>';$form.find(state_inputs).replaceWith(text_field)}else $form.find(state_inputs).replaceWith(response);is_checkout&&$(document.body).trigger("edd_cart_billing_address_updated",[response])}}).fail(function(data){window.console&&window.console.log&&console.log(data)}).done(function(data){is_checkout&&recalculate_taxes()})}else is_checkout&&recalculate_taxes();return!1}),$(document.body).on("change","#edd_cc_address input[name=card_zip]",function(){"undefined"!=typeof edd_global_vars&&recalculate_taxes()})});
assets/js/edd-checkout-global.js CHANGED
@@ -378,7 +378,9 @@ function recalculate_taxes(state) {
378
  // Avoids bug with form autocomplete firing multiple ajax calls at the same time and not
379
  // being able to predict the call response order.
380
  if (current_ajax_count === ajax_tax_count) {
381
- jQuery('#edd_checkout_cart_form').replaceWith(tax_response.html);
 
 
382
  jQuery('.edd_cart_amount').html(tax_response.total);
383
  var tax_data = new Object();
384
  tax_data.postdata = postData;
378
  // Avoids bug with form autocomplete firing multiple ajax calls at the same time and not
379
  // being able to predict the call response order.
380
  if (current_ajax_count === ajax_tax_count) {
381
+ if ( tax_response.html ) {
382
+ jQuery( '#edd_checkout_cart_form' ).replaceWith( tax_response.html );
383
+ }
384
  jQuery('.edd_cart_amount').html(tax_response.total);
385
  var tax_data = new Object();
386
  tax_data.postdata = postData;
assets/js/edd-checkout-global.min.js CHANGED
@@ -1 +1 @@
1
- window.EDD_Checkout=function($){"use strict";var $body,$form,$edd_cart_amount,$checkout_form_wrap;function apply_discount(postData){postData.preventDefault();var postData=$("#edd-discount").val(),edd_discount_loader=$("#edd-discount-loader"),required_inputs=$("#edd_cc_address .edd-input, #edd_cc_address .edd-select").filter("[required]");if(""==postData||postData==edd_global_vars.enter_discount)return!1;postData={action:"edd_apply_discount",code:postData,form:$("#edd_purchase_form").serialize()};return $("#edd-discount-error-wrap").html("").hide(),edd_discount_loader.show(),$.ajax({type:"POST",data:postData,dataType:"json",url:edd_global_vars.ajaxurl,xhrFields:{withCredentials:!0},success:function(discount_response){discount_response?"valid"==discount_response.msg?($(".edd_cart_discount").html(discount_response.html),$(".edd_cart_discount_row").show(),$(".edd_cart_amount").each(function(){$(this).text(discount_response.total),$(this).data("total",discount_response.total_plain)}),$("#edd-discount",$checkout_form_wrap).val(""),recalculate_taxes(),"0.00"==discount_response.total_plain?($("#edd_cc_fields,#edd_cc_address,#edd_payment_mode_select").slideUp(),required_inputs.prop("required",!1),$('input[name="edd-gateway"]').val("manual")):(required_inputs.prop("required",!0),$("#edd_cc_fields,#edd_cc_address").slideDown()),$body.trigger("edd_discount_applied",[discount_response])):($("#edd-discount-error-wrap").html('<span class="edd_error">'+discount_response.msg+"</span>"),$("#edd-discount-error-wrap").show(),$body.trigger("edd_discount_invalid",[discount_response])):(window.console&&window.console.log&&console.log(discount_response),$body.trigger("edd_discount_failed",[discount_response])),edd_discount_loader.hide()}}).fail(function(data){window.console&&window.console.log&&console.log(data)}),!1}function remove_discount(event){var postData={action:"edd_remove_discount",code:$(this).data("code")};return $.ajax({type:"POST",data:postData,dataType:"json",url:edd_global_vars.ajaxurl,xhrFields:{withCredentials:!0},success:function(discount_response){var zero="0"+edd_global_vars.decimal_separator+"00";$(".edd_cart_amount").each(function(){edd_global_vars.currency_sign+zero!=$(this).text()&&zero+edd_global_vars.currency_sign!=$(this).text()||window.location.reload(),$(this).text(discount_response.total),$(this).data("total",discount_response.total_plain)}),$(".edd_cart_discount").html(discount_response.html),discount_response.discounts||$(".edd_cart_discount_row").hide(),recalculate_taxes(),$("#edd_cc_fields,#edd_cc_address").slideDown(),$body.trigger("edd_discount_removed",[discount_response])}}).fail(function(data){window.console&&window.console.log&&console.log(data)}),!1}function update_item_quantities(event){var card_state=$(this),quantity=card_state.val(),billing_country=card_state.data("key"),download_id=card_state.closest(".edd_cart_item").data("download-id"),options=card_state.parent().find('input[name="edd-cart-download-'+billing_country+'-options"]').val(),card_state=$("#edd_cc_address"),billing_country=card_state.find("#billing_country").val(),card_state=card_state.find("#card_state").val();return $.ajax({type:"POST",data:{action:"edd_update_quantity",quantity:quantity,download_id:download_id,options:options,billing_country:billing_country,card_state:card_state},dataType:"json",url:edd_global_vars.ajaxurl,xhrFields:{withCredentials:!0},success:function(response){$(".edd_cart_subtotal_amount").each(function(){$(this).text(response.subtotal)}),$(".edd_cart_tax_amount").each(function(){$(this).text(response.taxes)}),$(".edd_cart_amount").each(function(){var float_total=response.total,float_subtotal=response.subtotal;$(this).text(float_total);float_total=parseFloat(float_total.replace(/[^0-9\.-]+/g,"")),float_subtotal=parseFloat(float_subtotal.replace(/[^0-9\.-]+/g,""));$(this).data("total",float_total),$(this).data("subtotal",float_subtotal),$body.trigger("edd_quantity_updated",[response])})}}).fail(function(data){window.console&&window.console.log&&console.log(data)}),!1}return{init:function(){$body=$(document.body),$form=$("#edd_purchase_form"),$edd_cart_amount=$(".edd_cart_amount"),$edd_cart_amount.text(),$checkout_form_wrap=$("#edd_checkout_form_wrap"),$body.on("edd_gateway_loaded",function(e){var card_expiry,card_number,card_cvc;card_number=(card_expiry=$form).find(".card-number"),card_cvc=card_expiry.find(".card-cvc"),card_expiry=card_expiry.find(".card-expiry"),card_number.length&&"function"==typeof card_number.payment&&(card_number.payment("formatCardNumber"),card_cvc.payment("formatCardCVC"),card_expiry.payment("formatCardExpiry"))}),$body.on("keyup change",".edd-do-validate .card-number",function(){var field,card_field;field=$(this),(card_field=field).validateCreditCard(function(result){var $card_type=$(".card-type");null==result.card_type?($card_type.removeClass().addClass("off card-type"),card_field.removeClass("valid"),card_field.addClass("error")):($card_type.removeClass("off"),$card_type.addClass(result.card_type.name),result.length_valid&&result.luhn_valid?(card_field.addClass("valid"),card_field.removeClass("error")):(card_field.removeClass("valid"),card_field.addClass("error")))})}),$body.on("blur change",".card-name",function(){var name_field=$(this);name_field.validateCreditCard(function(result){null!=result.card_type?(name_field.removeClass("valid").addClass("error"),$("#edd-purchase-button").attr("disabled","disabled")):(name_field.removeClass("error").addClass("valid"),$("#edd-purchase-button").removeAttr("disabled"))})}),$body.on("submit","#edd_payment_mode",function(){if(0==$("#edd-gateway option:selected").val())return alert(edd_global_vars.no_gateway),!1}),$body.on("click","#edd_payment_mode_select input",function(){$("#edd_payment_mode_select label.edd-gateway-option-selected").removeClass("edd-gateway-option-selected"),$("#edd_payment_mode_select input:checked").parent().addClass("edd-gateway-option-selected")}),$checkout_form_wrap.on("click",".edd-apply-discount",apply_discount),$checkout_form_wrap.on("keypress","#edd-discount",function(event){if("13"==event.keyCode)return!1}),$checkout_form_wrap.on("keyup","#edd-discount",function(event){"13"==event.keyCode&&$checkout_form_wrap.find(".edd-apply-discount").trigger("click")}),$body.on("click",".edd_discount_remove",remove_discount),$body.on("click",".edd_discount_link",function(e){e.preventDefault(),$(".edd_discount_link").parent().hide(),$("#edd-discount-code-wrap").show().find("#edd-discount").focus()}),$body.find("#edd-discount-code-wrap").hide(),$body.find("#edd_show_discount").show(),$body.on("change",".edd-item-quantity",update_item_quantities),$body.on("click",".edd-amazon-logout #Logout",function(e){e.preventDefault(),amazon.Login.logout(),window.location=edd_amazon.checkoutUri})},recalculate_taxes:recalculate_taxes}}(window.jQuery),window.jQuery(document).ready(EDD_Checkout.init);var ajax_tax_count=0;function recalculate_taxes(state){var $edd_cc_address,postData,current_ajax_count;"1"==edd_global_vars.taxes_enabled&&($edd_cc_address=jQuery("#edd_cc_address"),state=state||$edd_cc_address.find("#card_state").val(),postData={action:"edd_recalculate_taxes",billing_country:$edd_cc_address.find("#billing_country").val(),state:state,card_zip:$edd_cc_address.find("input[name=card_zip]").val(),nonce:jQuery("#edd-checkout-address-fields-nonce").val()},jQuery("#edd_purchase_submit [type=submit]").after('<span class="edd-loading-ajax edd-recalculate-taxes-loading edd-loading"></span>'),current_ajax_count=++ajax_tax_count,jQuery.ajax({type:"POST",data:postData,dataType:"json",url:edd_global_vars.ajaxurl,xhrFields:{withCredentials:!0},success:function(tax_response){var tax_data;current_ajax_count===ajax_tax_count&&(jQuery("#edd_checkout_cart_form").replaceWith(tax_response.html),jQuery(".edd_cart_amount").html(tax_response.total),(tax_data=new Object).postdata=postData,tax_data.response=tax_response,jQuery("body").trigger("edd_taxes_recalculated",[tax_data])),jQuery(".edd-recalculate-taxes-loading").remove()}}).fail(function(data){window.console&&window.console.log&&(console.log(data),current_ajax_count===ajax_tax_count&&jQuery("body").trigger("edd_taxes_recalculated",[tax_data]))}))}
1
+ window.EDD_Checkout=function($){"use strict";var $body,$form,$edd_cart_amount,$checkout_form_wrap;function apply_discount(event){event.preventDefault();var discount_code=$("#edd-discount").val(),edd_discount_loader=$("#edd-discount-loader"),required_inputs=$("#edd_cc_address .edd-input, #edd_cc_address .edd-select").filter("[required]");if(""==discount_code||discount_code==edd_global_vars.enter_discount)return!1;var postData={action:"edd_apply_discount",code:discount_code,form:$("#edd_purchase_form").serialize()};return $("#edd-discount-error-wrap").html("").hide(),edd_discount_loader.show(),$.ajax({type:"POST",data:postData,dataType:"json",url:edd_global_vars.ajaxurl,xhrFields:{withCredentials:!0},success:function(discount_response){discount_response?"valid"==discount_response.msg?($(".edd_cart_discount").html(discount_response.html),$(".edd_cart_discount_row").show(),$(".edd_cart_amount").each(function(){$(this).text(discount_response.total),$(this).data("total",discount_response.total_plain)}),$("#edd-discount",$checkout_form_wrap).val(""),recalculate_taxes(),"0.00"==discount_response.total_plain?($("#edd_cc_fields,#edd_cc_address,#edd_payment_mode_select").slideUp(),required_inputs.prop("required",!1),$('input[name="edd-gateway"]').val("manual")):(required_inputs.prop("required",!0),$("#edd_cc_fields,#edd_cc_address").slideDown()),$body.trigger("edd_discount_applied",[discount_response])):($("#edd-discount-error-wrap").html('<span class="edd_error">'+discount_response.msg+"</span>"),$("#edd-discount-error-wrap").show(),$body.trigger("edd_discount_invalid",[discount_response])):(window.console&&window.console.log&&console.log(discount_response),$body.trigger("edd_discount_failed",[discount_response])),edd_discount_loader.hide()}}).fail(function(data){window.console&&window.console.log&&console.log(data)}),!1}function remove_discount(event){var postData={action:"edd_remove_discount",code:$(this).data("code")};return $.ajax({type:"POST",data:postData,dataType:"json",url:edd_global_vars.ajaxurl,xhrFields:{withCredentials:!0},success:function(discount_response){var zero="0"+edd_global_vars.decimal_separator+"00";$(".edd_cart_amount").each(function(){edd_global_vars.currency_sign+zero!=$(this).text()&&zero+edd_global_vars.currency_sign!=$(this).text()||window.location.reload(),$(this).text(discount_response.total),$(this).data("total",discount_response.total_plain)}),$(".edd_cart_discount").html(discount_response.html),discount_response.discounts||$(".edd_cart_discount_row").hide(),recalculate_taxes(),$("#edd_cc_fields,#edd_cc_address").slideDown(),$body.trigger("edd_discount_removed",[discount_response])}}).fail(function(data){window.console&&window.console.log&&console.log(data)}),!1}function update_item_quantities(event){var $this=$(this),quantity=$this.val(),key=$this.data("key"),download_id=$this.closest(".edd_cart_item").data("download-id"),options=$this.parent().find('input[name="edd-cart-download-'+key+'-options"]').val(),edd_cc_address=$("#edd_cc_address"),postData={action:"edd_update_quantity",quantity:quantity,download_id:download_id,options:options,billing_country:edd_cc_address.find("#billing_country").val(),card_state:edd_cc_address.find("#card_state").val()};return $.ajax({type:"POST",data:postData,dataType:"json",url:edd_global_vars.ajaxurl,xhrFields:{withCredentials:!0},success:function(response){$(".edd_cart_subtotal_amount").each(function(){$(this).text(response.subtotal)}),$(".edd_cart_tax_amount").each(function(){$(this).text(response.taxes)}),$(".edd_cart_amount").each(function(){var total=response.total,subtotal=response.subtotal;$(this).text(total);var float_total=parseFloat(total.replace(/[^0-9\.-]+/g,"")),float_subtotal=parseFloat(subtotal.replace(/[^0-9\.-]+/g,""));$(this).data("total",float_total),$(this).data("subtotal",float_subtotal),$body.trigger("edd_quantity_updated",[response])})}}).fail(function(data){window.console&&window.console.log&&console.log(data)}),!1}return{init:function(){$body=$(document.body),$form=$("#edd_purchase_form"),$edd_cart_amount=$(".edd_cart_amount"),$edd_cart_amount.text(),$checkout_form_wrap=$("#edd_checkout_form_wrap"),$body.on("edd_gateway_loaded",function(e){var form,card_number,card_cvc,card_expiry;card_number=(form=$form).find(".card-number"),card_cvc=form.find(".card-cvc"),card_expiry=form.find(".card-expiry"),card_number.length&&"function"==typeof card_number.payment&&(card_number.payment("formatCardNumber"),card_cvc.payment("formatCardCVC"),card_expiry.payment("formatCardExpiry"))}),$body.on("keyup change",".edd-do-validate .card-number",function(){var field,card_field;field=$(this),(card_field=field).validateCreditCard(function(result){var $card_type=$(".card-type");null==result.card_type?($card_type.removeClass().addClass("off card-type"),card_field.removeClass("valid"),card_field.addClass("error")):($card_type.removeClass("off"),$card_type.addClass(result.card_type.name),result.length_valid&&result.luhn_valid?(card_field.addClass("valid"),card_field.removeClass("error")):(card_field.removeClass("valid"),card_field.addClass("error")))})}),$body.on("blur change",".card-name",function(){var name_field=$(this);name_field.validateCreditCard(function(result){null!=result.card_type?(name_field.removeClass("valid").addClass("error"),$("#edd-purchase-button").attr("disabled","disabled")):(name_field.removeClass("error").addClass("valid"),$("#edd-purchase-button").removeAttr("disabled"))})}),$body.on("submit","#edd_payment_mode",function(){if(0==$("#edd-gateway option:selected").val())return alert(edd_global_vars.no_gateway),!1}),$body.on("click","#edd_payment_mode_select input",function(){$("#edd_payment_mode_select label.edd-gateway-option-selected").removeClass("edd-gateway-option-selected"),$("#edd_payment_mode_select input:checked").parent().addClass("edd-gateway-option-selected")}),$checkout_form_wrap.on("click",".edd-apply-discount",apply_discount),$checkout_form_wrap.on("keypress","#edd-discount",function(event){if("13"==event.keyCode)return!1}),$checkout_form_wrap.on("keyup","#edd-discount",function(event){"13"==event.keyCode&&$checkout_form_wrap.find(".edd-apply-discount").trigger("click")}),$body.on("click",".edd_discount_remove",remove_discount),$body.on("click",".edd_discount_link",function(e){e.preventDefault(),$(".edd_discount_link").parent().hide(),$("#edd-discount-code-wrap").show().find("#edd-discount").focus()}),$body.find("#edd-discount-code-wrap").hide(),$body.find("#edd_show_discount").show(),$body.on("change",".edd-item-quantity",update_item_quantities),$body.on("click",".edd-amazon-logout #Logout",function(e){e.preventDefault(),amazon.Login.logout(),window.location=edd_amazon.checkoutUri})},recalculate_taxes:recalculate_taxes}}(window.jQuery),window.jQuery(document).ready(EDD_Checkout.init);var ajax_tax_count=0;function recalculate_taxes(state){if("1"==edd_global_vars.taxes_enabled){var $edd_cc_address=jQuery("#edd_cc_address");state||(state=$edd_cc_address.find("#card_state").val());var postData={action:"edd_recalculate_taxes",billing_country:$edd_cc_address.find("#billing_country").val(),state:state,card_zip:$edd_cc_address.find("input[name=card_zip]").val(),nonce:jQuery("#edd-checkout-address-fields-nonce").val()};jQuery("#edd_purchase_submit [type=submit]").after('<span class="edd-loading-ajax edd-recalculate-taxes-loading edd-loading"></span>');var current_ajax_count=++ajax_tax_count;jQuery.ajax({type:"POST",data:postData,dataType:"json",url:edd_global_vars.ajaxurl,xhrFields:{withCredentials:!0},success:function(tax_response){if(current_ajax_count===ajax_tax_count){tax_response.html&&jQuery("#edd_checkout_cart_form").replaceWith(tax_response.html),jQuery(".edd_cart_amount").html(tax_response.total);var tax_data=new Object;tax_data.postdata=postData,tax_data.response=tax_response,jQuery("body").trigger("edd_taxes_recalculated",[tax_data])}jQuery(".edd-recalculate-taxes-loading").remove()}}).fail(function(data){window.console&&window.console.log&&(console.log(data),current_ajax_count===ajax_tax_count&&jQuery("body").trigger("edd_taxes_recalculated",[tax_data]))})}}
assets/js/paypal-checkout.js ADDED
@@ -0,0 +1,255 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* global eddPayPalVars, edd_global_vars */
2
+
3
+ var EDD_PayPal = {
4
+ isMounted: false,
5
+
6
+ /**
7
+ * Initializes PayPal buttons and sets up some events.
8
+ */
9
+ init: function() {
10
+ if ( document.getElementById( 'edd-paypal-container' ) ) {
11
+ this.initButtons( '#edd-paypal-container', 'checkout' );
12
+ }
13
+
14
+ jQuery( document.body ).on( 'edd_discount_applied', this.maybeRefreshPage );
15
+ jQuery( document.body ).on( 'edd_discount_removed', this.maybeRefreshPage );
16
+ },
17
+
18
+ /**
19
+ * Determines whether or not the selected gateway is PayPal.
20
+ * @returns {boolean}
21
+ */
22
+ isPayPal: function() {
23
+ var chosenGateway = false;
24
+ if ( jQuery('select#edd-gateway, input.edd-gateway').length ) {
25
+ chosenGateway = jQuery("meta[name='edd-chosen-gateway']").attr('content');
26
+ }
27
+
28
+ if ( ! chosenGateway && edd_scripts.default_gateway ) {
29
+ chosenGateway = edd_scripts.default_gateway;
30
+ }
31
+
32
+ return 'paypal_commerce' === chosenGateway;
33
+ },
34
+
35
+ /**
36
+ * Refreshes the page when adding or removing a 100% discount.
37
+ *
38
+ * @param e
39
+ * @param {object} data
40
+ */
41
+ maybeRefreshPage: function( e, data ) {
42
+ if ( 0 === data.total_plain && EDD_PayPal.isPayPal() ) {
43
+ window.location.reload();
44
+ } else if ( ! EDD_PayPal.isMounted && EDD_PayPal.isPayPal() && data.total_plain > 0 ) {
45
+ window.location.reload();
46
+ }
47
+ },
48
+
49
+ /**
50
+ * Sets the error HTML, depending on the context.
51
+ *
52
+ * @param {string|HTMLElement} container
53
+ * @param {string} context
54
+ * @param {string} errorHtml
55
+ */
56
+ setErrorHtml: function( container, context, errorHtml ) {
57
+ // Format errors.
58
+
59
+ if ( 'checkout' === context && 'undefined' !== typeof edd_global_vars && edd_global_vars.checkout_error_anchor ) {
60
+ // Checkout errors.
61
+ var errorWrapper = document.getElementById( 'edd-paypal-errors-wrap' );
62
+ if ( errorWrapper ) {
63
+ errorWrapper.innerHTML = errorHtml;
64
+ }
65
+ } else if ( 'buy_now' === context ) {
66
+ // Buy Now errors
67
+ var form = container.closest( '.edd_download_purchase_form' );
68
+ var errorWrapper = form ? form.querySelector( '.edd-paypal-checkout-buy-now-error-wrapper' ) : false;
69
+
70
+ if ( errorWrapper ) {
71
+ errorWrapper.innerHTML = errorHtml;
72
+ }
73
+ }
74
+
75
+ jQuery( document.body ).trigger( 'edd_checkout_error', [ errorHtml ] );
76
+ },
77
+
78
+ /**
79
+ * Initializes PayPal buttons
80
+ *
81
+ * @param {string|HTMLElement} container Element to render the buttons in.
82
+ * @param {string} context Context for the button. Either `checkout` or `buy_now`.
83
+ */
84
+ initButtons: function( container, context ) {
85
+ EDD_PayPal.isMounted = true;
86
+
87
+ paypal.Buttons( EDD_PayPal.getButtonArgs( container, context ) ).render( container );
88
+
89
+ document.dispatchEvent( new CustomEvent( 'edd_paypal_buttons_mounted' ) );
90
+ },
91
+
92
+ /**
93
+ * Retrieves the arguments used to build the PayPal button.
94
+ *
95
+ * @param {string|HTMLElement} container Element to render the buttons in.
96
+ * @param {string} context Context for the button. Either `checkout` or `buy_now`.
97
+ */
98
+ getButtonArgs: function ( container, context ) {
99
+ var form = ( 'checkout' === context ) ? document.getElementById( 'edd_purchase_form' ) : container.closest( '.edd_download_purchase_form' );
100
+ var errorWrapper = ( 'checkout' === context ) ? form.querySelector( '#edd-paypal-errors-wrap' ) : form.querySelector( '.edd-paypal-checkout-buy-now-error-wrapper' );
101
+ var spinner = ( 'checkout' === context ) ? document.getElementById( 'edd-paypal-spinner' ) : form.querySelector( '.edd-paypal-spinner' );
102
+ var nonceEl = form.querySelector( 'input[name="edd_process_paypal_nonce"]' );
103
+ var createFunc = ( 'subscription' === eddPayPalVars.intent ) ? 'createSubscription' : 'createOrder';
104
+
105
+ var buttonArgs = {
106
+ onApprove: function( data, actions ) {
107
+ var formData = new FormData();
108
+ formData.append( 'action', eddPayPalVars.approvalAction );
109
+ formData.append( 'edd_process_paypal_nonce', nonceEl.value );
110
+
111
+ if ( data.orderID ) {
112
+ formData.append( 'paypal_order_id', data.orderID );
113
+ }
114
+ if ( data.subscriptionID ) {
115
+ formData.append( 'paypal_subscription_id', data.subscriptionID );
116
+ }
117
+
118
+ return fetch( edd_scripts.ajaxurl, {
119
+ method: 'POST',
120
+ body: formData
121
+ } ).then( function( response ) {
122
+ return response.json();
123
+ } ).then( function( responseData ) {
124
+ if ( responseData.success && responseData.data.redirect_url ) {
125
+ window.location = responseData.data.redirect_url;
126
+ } else {
127
+ // Hide spinner.
128
+ spinner.style.display = 'none';
129
+
130
+ var errorHtml = responseData.data.message ? responseData.data.message : eddPayPalVars.defaultError;
131
+
132
+ EDD_PayPal.setErrorHtml( container, context, errorHtml );
133
+
134
+ // @link https://developer.paypal.com/docs/checkout/integration-features/funding-failure/
135
+ if ( responseData.data.retry ) {
136
+ return actions.restart();
137
+ }
138
+ }
139
+ } );
140
+ },
141
+ onError: function( error ) {
142
+ // Hide spinner.
143
+ spinner.style.display = 'none';
144
+
145
+ error.name = '';
146
+ EDD_PayPal.setErrorHtml( container, context, error );
147
+ },
148
+ onCancel: function( data ) {
149
+ // Hide spinner.
150
+ spinner.style.display = 'none';
151
+ }
152
+ };
153
+
154
+ /*
155
+ * Add style if we have any
156
+ *
157
+ * @link https://developer.paypal.com/docs/checkout/integration-features/customize-button/
158
+ */
159
+ if ( eddPayPalVars.style ) {
160
+ buttonArgs.style = eddPayPalVars.style;
161
+ }
162
+
163
+ /*
164
+ * Add the `create` logic. This gets added to `createOrder` for one-time purchases
165
+ * or `createSubscription` for recurring.
166
+ */
167
+ buttonArgs[ createFunc ] = function ( data, actions ) {
168
+ // Show spinner.
169
+ spinner.style.display = 'block';
170
+
171
+ // Clear errors at the start of each attempt.
172
+ if ( errorWrapper ) {
173
+ errorWrapper.innerHTML = '';
174
+ }
175
+
176
+ // Submit the form via AJAX.
177
+ return fetch( edd_scripts.ajaxurl, {
178
+ method: 'POST',
179
+ body: new FormData( form )
180
+ } ).then( function( response ) {
181
+ return response.json();
182
+ } ).then( function( orderData ) {
183
+ if ( orderData.data && orderData.data.paypal_order_id ) {
184
+ // Add the nonce to the form so we can validate it later.
185
+ if ( orderData.data.nonce ) {
186
+ nonceEl.value = orderData.data.nonce;
187
+ }
188
+
189
+ return orderData.data.paypal_order_id;
190
+ } else {
191
+ // Error message.
192
+ var errorHtml = eddPayPalVars.defaultError;
193
+ if ( orderData.data && 'string' === typeof orderData.data ) {
194
+ errorHtml = orderData.data;
195
+ } else if ( 'string' === typeof orderData ) {
196
+ errorHtml = orderData;
197
+ }
198
+
199
+ return new Promise( function( resolve, reject ) {
200
+ reject( new Error( errorHtml ) );
201
+ } );
202
+ }
203
+ } );
204
+ };
205
+
206
+ return buttonArgs;
207
+ }
208
+ };
209
+
210
+ /**
211
+ * Initialize on checkout.
212
+ */
213
+ jQuery( document.body ).on( 'edd_gateway_loaded', function( e, gateway ) {
214
+ if ( 'paypal_commerce' !== gateway ) {
215
+ return;
216
+ }
217
+
218
+ EDD_PayPal.init();
219
+ } );
220
+
221
+ /**
222
+ * Initialize Buy Now buttons.
223
+ */
224
+ jQuery( document ).ready( function( $ ) {
225
+ var buyButtons = document.querySelectorAll( '.edd-paypal-checkout-buy-now' );
226
+ for ( var i = 0; i < buyButtons.length; i++ ) {
227
+ var element = buyButtons[ i ];
228
+ // Skip if "Free Downloads" is enabled for this download.
229
+ if ( element.classList.contains( 'edd-free-download' ) ) {
230
+ return;
231
+ }
232
+
233
+ var wrapper = element.closest( '.edd_purchase_submit_wrapper' );
234
+ if ( ! wrapper ) {
235
+ return;
236
+ }
237
+
238
+ // Clear contents of the wrapper.
239
+ wrapper.innerHTML = '';
240
+
241
+ // Add error container after the wrapper.
242
+ var errorNode = document.createElement( 'div' );
243
+ errorNode.classList.add( 'edd-paypal-checkout-buy-now-error-wrapper' );
244
+ wrapper.before( errorNode );
245
+
246
+ // Add spinner container.
247
+ var spinnerWrap = document.createElement( 'span' );
248
+ spinnerWrap.classList.add( 'edd-paypal-spinner', 'edd-loading-ajax', 'edd-loading' );
249
+ spinnerWrap.style.display = 'none';
250
+ wrapper.after( spinnerWrap );
251
+
252
+ // Initialize button.
253
+ EDD_PayPal.initButtons( wrapper, 'buy_now' );
254
+ }
255
+ } );
assets/js/paypal-checkout.min.js ADDED
@@ -0,0 +1 @@
 
1
+ var EDD_PayPal={isMounted:!1,init:function(){document.getElementById("edd-paypal-container")&&this.initButtons("#edd-paypal-container","checkout"),jQuery(document.body).on("edd_discount_applied",this.maybeRefreshPage),jQuery(document.body).on("edd_discount_removed",this.maybeRefreshPage)},isPayPal:function(){var chosenGateway=!1;return jQuery("select#edd-gateway, input.edd-gateway").length&&(chosenGateway=jQuery("meta[name='edd-chosen-gateway']").attr("content")),!chosenGateway&&edd_scripts.default_gateway&&(chosenGateway=edd_scripts.default_gateway),"paypal_commerce"===chosenGateway},maybeRefreshPage:function(e,data){0===data.total_plain&&EDD_PayPal.isPayPal()?window.location.reload():!EDD_PayPal.isMounted&&EDD_PayPal.isPayPal()&&0<data.total_plain&&window.location.reload()},setErrorHtml:function(container,context,errorHtml){if("checkout"===context&&"undefined"!=typeof edd_global_vars&&edd_global_vars.checkout_error_anchor)(errorWrapper=document.getElementById("edd-paypal-errors-wrap"))&&(errorWrapper.innerHTML=errorHtml);else if("buy_now"===context){var errorWrapper,form=container.closest(".edd_download_purchase_form");(errorWrapper=!!form&&form.querySelector(".edd-paypal-checkout-buy-now-error-wrapper"))&&(errorWrapper.innerHTML=errorHtml)}jQuery(document.body).trigger("edd_checkout_error",[errorHtml])},initButtons:function(container,context){EDD_PayPal.isMounted=!0,paypal.Buttons(EDD_PayPal.getButtonArgs(container,context)).render(container),document.dispatchEvent(new CustomEvent("edd_paypal_buttons_mounted"))},getButtonArgs:function(container,context){var form="checkout"===context?document.getElementById("edd_purchase_form"):container.closest(".edd_download_purchase_form"),errorWrapper="checkout"===context?form.querySelector("#edd-paypal-errors-wrap"):form.querySelector(".edd-paypal-checkout-buy-now-error-wrapper"),spinner="checkout"===context?document.getElementById("edd-paypal-spinner"):form.querySelector(".edd-paypal-spinner"),nonceEl=form.querySelector('input[name="edd_process_paypal_nonce"]'),createFunc="subscription"===eddPayPalVars.intent?"createSubscription":"createOrder",buttonArgs={onApprove:function(data,actions){var formData=new FormData;return formData.append("action",eddPayPalVars.approvalAction),formData.append("edd_process_paypal_nonce",nonceEl.value),data.orderID&&formData.append("paypal_order_id",data.orderID),data.subscriptionID&&formData.append("paypal_subscription_id",data.subscriptionID),fetch(edd_scripts.ajaxurl,{method:"POST",body:formData}).then(function(response){return response.json()}).then(function(responseData){if(responseData.success&&responseData.data.redirect_url)window.location=responseData.data.redirect_url;else{spinner.style.display="none";var errorHtml=responseData.data.message?responseData.data.message:eddPayPalVars.defaultError;if(EDD_PayPal.setErrorHtml(container,context,errorHtml),responseData.data.retry)return actions.restart()}})},onError:function(error){spinner.style.display="none",error.name="",EDD_PayPal.setErrorHtml(container,context,error)},onCancel:function(data){spinner.style.display="none"}};return eddPayPalVars.style&&(buttonArgs.style=eddPayPalVars.style),buttonArgs[createFunc]=function(data,actions){return spinner.style.display="block",errorWrapper&&(errorWrapper.innerHTML=""),fetch(edd_scripts.ajaxurl,{method:"POST",body:new FormData(form)}).then(function(response){return response.json()}).then(function(orderData){if(orderData.data&&orderData.data.paypal_order_id)return orderData.data.nonce&&(nonceEl.value=orderData.data.nonce),orderData.data.paypal_order_id;var errorHtml=eddPayPalVars.defaultError;return orderData.data&&"string"==typeof orderData.data?errorHtml=orderData.data:"string"==typeof orderData&&(errorHtml=orderData),new Promise(function(resolve,reject){reject(new Error(errorHtml))})})},buttonArgs}};jQuery(document.body).on("edd_gateway_loaded",function(e,gateway){"paypal_commerce"===gateway&&EDD_PayPal.init()}),jQuery(document).ready(function($){for(var buyButtons=document.querySelectorAll(".edd-paypal-checkout-buy-now"),i=0;i<buyButtons.length;i++){var element=buyButtons[i];if(element.classList.contains("edd-free-download"))return;var wrapper=element.closest(".edd_purchase_submit_wrapper");if(!wrapper)return;wrapper.innerHTML="";var errorNode=document.createElement("div");errorNode.classList.add("edd-paypal-checkout-buy-now-error-wrapper"),wrapper.before(errorNode);var spinnerWrap=document.createElement("span");spinnerWrap.classList.add("edd-paypal-spinner","edd-loading-ajax","edd-loading"),spinnerWrap.style.display="none",wrapper.after(spinnerWrap),EDD_PayPal.initButtons(wrapper,"buy_now")}});
assets/js/wp-polyfill.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function r(c,a,f){function o(n,t){if(!a[n]){if(!c[n]){var e="function"==typeof require&&require;if(!t&&e)return e(n,!0);if(s)return s(n,!0);var i=new Error("Cannot find module '"+n+"'");throw i.code="MODULE_NOT_FOUND",i}var u=a[n]={exports:{}};c[n][0].call(u.exports,function(t){return o(c[n][1][t]||t)},u,u.exports,r,c,a,f)}return a[n].exports}for(var s="function"==typeof require&&require,t=0;t<f.length;t++)o(f[t]);return o}({1:[function(t,n,r){"use strict";t(2);var e=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(t(15));e.default._babelPolyfill&&"undefined"!=typeof console&&console.warn&&console.warn("@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended and may have consequences if different versions of the polyfills are applied sequentially. If you do need to load the polyfill more than once, use @babel/polyfill/noConflict instead to bypass the warning."),e.default._babelPolyfill=!0},{15:15,2:2}],2:[function(t,n,r){"use strict";t(3),t(5),t(4),t(11),t(10),t(13),t(12),t(14),t(7),t(8),t(6),t(9),t(306),t(307)},{10:10,11:11,12:12,13:13,14:14,3:3,306:306,307:307,4:4,5:5,6:6,7:7,8:8,9:9}],3:[function(t,n,r){t(278),t(214),t(216),t(215),t(218),t(220),t(225),t(219),t(217),t(227),t(226),t(222),t(223),t(221),t(213),t(224),t(228),t(229),t(180),t(182),t(181),t(231),t(230),t(201),t(211),t(212),t(202),t(203),t(204),t(205),t(206),t(207),t(208),t(209),t(210),t(184),t(185),t(186),t(187),t(188),t(189),t(190),t(191),t(192),t(193),t(194),t(195),t(196),t(197),t(198),t(199),t(200),t(265),t(270),t(277),t(268),t(260),t(261),t(266),t(271),t(273),t(256),t(257),t(258),t(259),t(262),t(263),t(264),t(267),t(269),t(272),t(274),t(275),t(276),t(175),t(177),t(176),t(179),t(178),t(163),t(161),t(168),t(165),t(171),t(173),t(160),t(167),t(157),t(172),t(155),t(170),t(169),t(162),t(166),t(154),t(156),t(159),t(158),t(174),t(164),t(247),t(248),t(254),t(249),t(250),t(251),t(252),t(253),t(232),t(183),t(255),t(290),t(291),t(279),t(280),t(285),t(288),t(289),t(283),t(286),t(284),t(287),t(281),t(282),t(233),t(234),t(235),t(236),t(237),t(240),t(238),t(239),t(241),t(242),t(243),t(244),t(246),t(245),n.exports=t(52)},{154:154,155:155,156:156,157:157,158:158,159:159,160:160,161:161,162:162,163:163,164:164,165:165,166:166,167:167,168:168,169:169,170:170,171:171,172:172,173:173,174:174,175:175,176:176,177:177,178:178,179:179,180:180,181:181,182:182,183:183,184:184,185:185,186:186,187:187,188:188,189:189,190:190,191:191,192:192,193:193,194:194,195:195,196:196,197:197,198:198,199:199,200:200,201:201,202:202,203:203,204:204,205:205,206:206,207:207,208:208,209:209,210:210,211:211,212:212,213:213,214:214,215:215,216:216,217:217,218:218,219:219,220:220,221:221,222:222,223:223,224:224,225:225,226:226,227:227,228:228,229:229,230:230,231:231,232:232,233:233,234:234,235:235,236:236,237:237,238:238,239:239,240:240,241:241,242:242,243:243,244:244,245:245,246:246,247:247,248:248,249:249,250:250,251:251,252:252,253:253,254:254,255:255,256:256,257:257,258:258,259:259,260:260,261:261,262:262,263:263,264:264,265:265,266:266,267:267,268:268,269:269,270:270,271:271,272:272,273:273,274:274,275:275,276:276,277:277,278:278,279:279,280:280,281:281,282:282,283:283,284:284,285:285,286:286,287:287,288:288,289:289,290:290,291:291,52:52}],4:[function(t,n,r){t(292),n.exports=t(52).Array.flatMap},{292:292,52:52}],5:[function(t,n,r){t(293),n.exports=t(52).Array.includes},{293:293,52:52}],6:[function(t,n,r){t(294),n.exports=t(52).Object.entries},{294:294,52:52}],7:[function(t,n,r){t(295),n.exports=t(52).Object.getOwnPropertyDescriptors},{295:295,52:52}],8:[function(t,n,r){t(296),n.exports=t(52).Object.values},{296:296,52:52}],9:[function(t,n,r){"use strict";t(232),t(297),n.exports=t(52).Promise.finally},{232:232,297:297,52:52}],10:[function(t,n,r){t(298),n.exports=t(52).String.padEnd},{298:298,52:52}],11:[function(t,n,r){t(299),n.exports=t(52).String.padStart},{299:299,52:52}],12:[function(t,n,r){t(301),n.exports=t(52).String.trimRight},{301:301,52:52}],13:[function(t,n,r){t(300),n.exports=t(52).String.trimLeft},{300:300,52:52}],14:[function(t,n,r){t(302),n.exports=t(151).f("asyncIterator")},{151:151,302:302}],15:[function(t,n,r){t(32),n.exports=t(18).global},{18:18,32:32}],16:[function(t,n,r){n.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},{}],17:[function(t,n,r){var e=t(28);n.exports=function(t){if(!e(t))throw TypeError(t+" is not an object!");return t}},{28:28}],18:[function(t,n,r){var e=n.exports={version:"2.6.11"};"number"==typeof __e&&(__e=e)},{}],19:[function(t,n,r){var o=t(16);n.exports=function(e,i,t){if(o(e),void 0===i)return e;switch(t){case 1:return function(t){return e.call(i,t)};case 2:return function(t,n){return e.call(i,t,n)};case 3:return function(t,n,r){return e.call(i,t,n,r)}}return function(){return e.apply(i,arguments)}}},{16:16}],20:[function(t,n,r){n.exports=!t(23)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{23:23}],21:[function(t,n,r){var e=t(28),i=t(24).document,o=e(i)&&e(i.createElement);n.exports=function(t){return o?i.createElement(t):{}}},{24:24,28:28}],22:[function(t,n,r){var g=t(24),y=t(18),d=t(19),x=t(26),m=t(25),S="prototype",b=function(t,n,r){var e,i,o,u=t&b.F,c=t&b.G,a=t&b.S,f=t&b.P,s=t&b.B,l=t&b.W,h=c?y:y[n]||(y[n]={}),p=h[S],v=c?g:a?g[n]:(g[n]||{})[S];for(e in c&&(r=n),r)(i=!u&&v&&void 0!==v[e])&&m(h,e)||(o=i?v[e]:r[e],h[e]=c&&"function"!=typeof v[e]?r[e]:s&&i?d(o,g):l&&v[e]==o?function(e){function qb(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 qb[S]=e[S],qb}(o):f&&"function"==typeof o?d(Function.call,o):o,f&&((h.virtual||(h.virtual={}))[e]=o,t&b.R&&p&&!p[e]&&x(p,e,o)))};b.F=1,b.G=2,b.S=4,b.P=8,b.B=16,b.W=32,b.U=64,b.R=128,n.exports=b},{18:18,19:19,24:24,25:25,26:26}],23:[function(t,n,r){n.exports=function(t){try{return!!t()}catch(t){return!0}}},{}],24:[function(t,n,r){var e=n.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},{}],25:[function(t,n,r){var e={}.hasOwnProperty;n.exports=function(t,n){return e.call(t,n)}},{}],26:[function(t,n,r){var e=t(29),i=t(30);n.exports=t(20)?function(t,n,r){return e.f(t,n,i(1,r))}:function(t,n,r){return t[n]=r,t}},{20:20,29:29,30:30}],27:[function(t,n,r){n.exports=!t(20)&&!t(23)(function(){return 7!=Object.defineProperty(t(21)("div"),"a",{get:function(){return 7}}).a})},{20:20,21:21,23:23}],28:[function(t,n,r){n.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},{}],29:[function(t,n,r){var e=t(17),i=t(27),o=t(31),u=Object.defineProperty;r.f=t(20)?Object.defineProperty:function defineProperty(t,n,r){if(e(t),n=o(n,!0),e(r),i)try{return u(t,n,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[n]=r.value),t}},{17:17,20:20,27:27,31:31}],30:[function(t,n,r){n.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},{}],31:[function(t,n,r){var i=t(28);n.exports=function(t,n){if(!i(t))return t;var r,e;if(n&&"function"==typeof(r=t.toString)&&!i(e=r.call(t)))return e;if("function"==typeof(r=t.valueOf)&&!i(e=r.call(t)))return e;if(!n&&"function"==typeof(r=t.toString)&&!i(e=r.call(t)))return e;throw TypeError("Can't convert object to primitive value")}},{28:28}],32:[function(t,n,r){var e=t(22);e(e.G,{global:t(24)})},{22:22,24:24}],33:[function(t,n,r){arguments[4][16][0].apply(r,arguments)},{16:16}],34:[function(t,n,r){var e=t(48);n.exports=function(t,n){if("number"!=typeof t&&"Number"!=e(t))throw TypeError(n);return+t}},{48:48}],35:[function(t,n,r){var e=t(152)("unscopables"),i=Array.prototype;null==i[e]&&t(72)(i,e,{}),n.exports=function(t){i[e][t]=!0}},{152:152,72:72}],36:[function(t,n,r){"use strict";var e=t(129)(!0);n.exports=function(t,n,r){return n+(r?e(t,n).length:1)}},{129:129}],37:[function(t,n,r){n.exports=function(t,n,r,e){if(!(t instanceof n)||void 0!==e&&e in t)throw TypeError(r+": incorrect invocation!");return t}},{}],38:[function(t,n,r){arguments[4][17][0].apply(r,arguments)},{17:17,81:81}],39:[function(t,n,r){"use strict";var f=t(142),s=t(137),l=t(141);n.exports=[].copyWithin||function copyWithin(t,n){var r=f(this),e=l(r.length),i=s(t,e),o=s(n,e),u=2<arguments.length?arguments[2]:void 0,c=Math.min((void 0===u?e:s(u,e))-o,e-i),a=1;for(o<i&&i<o+c&&(a=-1,o+=c-1,i+=c-1);0<c--;)o in r?r[i]=r[o]:delete r[i],i+=a,o+=a;return r}},{137:137,141:141,142:142}],40:[function(t,n,r){"use strict";var c=t(142),a=t(137),f=t(141);n.exports=function fill(t){for(var n=c(this),r=f(n.length),e=arguments.length,i=a(1<e?arguments[1]:void 0,r),o=2<e?arguments[2]:void 0,u=void 0===o?r:a(o,r);i<u;)n[i++]=t;return n}},{137:137,141:141,142:142}],41:[function(t,n,r){var a=t(140),f=t(141),s=t(137);n.exports=function(c){return function(t,n,r){var e,i=a(t),o=f(i.length),u=s(r,o);if(c&&n!=n){for(;u<o;)if((e=i[u++])!=e)return!0}else for(;u<o;u++)if((c||u in i)&&i[u]===n)return c||u||0;return!c&&-1}}},{137:137,140:140,141:141}],42:[function(t,n,r){var m=t(54),S=t(77),b=t(142),w=t(141),e=t(45);n.exports=function(l,t){var h=1==l,p=2==l,v=3==l,g=4==l,y=6==l,d=5==l||y,x=t||e;return function(t,n,r){for(var e,i,o=b(t),u=S(o),c=m(n,r,3),a=w(u.length),f=0,s=h?x(t,a):p?x(t,0):void 0;f<a;f++)if((d||f in u)&&(i=c(e=u[f],f,o),l))if(h)s[f]=i;else if(i)switch(l){case 3:return!0;case 5:return e;case 6:return f;case 2:s.push(e)}else if(g)return!1;return y?-1:v||g?g:s}}},{141:141,142:142,45:45,54:54,77:77}],43:[function(t,n,r){var s=t(33),l=t(142),h=t(77),p=t(141);n.exports=function(t,n,r,e,i){s(n);var o=l(t),u=h(o),c=p(o.length),a=i?c-1:0,f=i?-1:1;if(r<2)for(;;){if(a in u){e=u[a],a+=f;break}if(a+=f,i?a<0:c<=a)throw TypeError("Reduce of empty array with no initial value")}for(;i?0<=a:a<c;a+=f)a in u&&(e=n(e,u[a],a,o));return e}},{141:141,142:142,33:33,77:77}],44:[function(t,n,r){var e=t(81),i=t(79),o=t(152)("species");n.exports=function(t){var n;return i(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!i(n.prototype)||(n=void 0),e(n)&&null===(n=n[o])&&(n=void 0)),void 0===n?Array:n}},{152:152,79:79,81:81}],45:[function(t,n,r){var e=t(44);n.exports=function(t,n){return new(e(t))(n)}},{44:44}],46:[function(t,n,r){"use strict";var o=t(33),u=t(81),c=t(76),a=[].slice,f={};n.exports=Function.bind||function bind(n){var r=o(this),e=a.call(arguments,1),i=function(){var t=e.concat(a.call(arguments));return this instanceof i?function(t,n,r){if(!(n in f)){for(var e=[],i=0;i<n;i++)e[i]="a["+i+"]";f[n]=Function("F,a","return new F("+e.join(",")+")")}return f[n](t,r)}(r,t.length,t):c(r,t,n)};return u(r.prototype)&&(i.prototype=r.prototype),i}},{33:33,76:76,81:81}],47:[function(t,n,r){var i=t(48),o=t(152)("toStringTag"),u="Arguments"==i(function(){return arguments}());n.exports=function(t){var n,r,e;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,n){try{return t[n]}catch(t){}}(n=Object(t),o))?r:u?i(n):"Object"==(e=i(n))&&"function"==typeof n.callee?"Arguments":e}},{152:152,48:48}],48:[function(t,n,r){var e={}.toString;n.exports=function(t){return e.call(t).slice(8,-1)}},{}],49:[function(t,n,r){"use strict";function ag(t,n){var r,e=p(n);if("F"!==e)return t._i[e];for(r=t._f;r;r=r.n)if(r.k==n)return r}var u=t(99).f,c=t(98),a=t(117),f=t(54),s=t(37),l=t(68),e=t(85),i=t(87),o=t(123),h=t(58),p=t(94).fastKey,v=t(149),g=h?"_s":"size";n.exports={getConstructor:function(t,o,r,e){var i=t(function(t,n){s(t,i,o,"_i"),t._t=o,t._i=c(null),t._f=void 0,t._l=void 0,t[g]=0,null!=n&&l(n,r,t[e],t)});return a(i.prototype,{clear:function clear(){for(var t=v(this,o),n=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];t._f=t._l=void 0,t[g]=0},delete:function(t){var n=v(this,o),r=ag(n,t);if(r){var e=r.n,i=r.p;delete n._i[r.i],r.r=!0,i&&(i.n=e),e&&(e.p=i),n._f==r&&(n._f=e),n._l==r&&(n._l=i),n[g]--}return!!r},forEach:function forEach(t){v(this,o);for(var n,r=f(t,1<arguments.length?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 has(t){return!!ag(v(this,o),t)}}),h&&u(i.prototype,"size",{get:function(){return v(this,o)[g]}}),i},def:function(t,n,r){var e,i,o=ag(t,n);return o?o.v=r:(t._l=o={i:i=p(n,!0),k:n,v:r,p:e=t._l,n:void 0,r:!1},t._f||(t._f=o),e&&(e.n=o),t[g]++,"F"!==i&&(t._i[i]=o)),t},getEntry:ag,setStrong:function(t,r,n){e(t,r,function(t,n){this._t=v(t,r),this._k=n,this._l=void 0},function(){for(var t=this,n=t._k,r=t._l;r&&r.r;)r=r.p;return t._t&&(t._l=r=r?r.n:t._t._f)?i(0,"keys"==n?r.k:"values"==n?r.v:[r.k,r.v]):(t._t=void 0,i(1))},n?"entries":"values",!n,!0),o(r)}}},{117:117,123:123,149:149,37:37,54:54,58:58,68:68,85:85,87:87,94:94,98:98,99:99}],50:[function(t,n,r){"use strict";function _g(t){return t._l||(t._l=new g)}function bh(t,n){return o(t.a,function(t){return t[0]===n})}var u=t(117),c=t(94).getWeak,i=t(38),a=t(81),f=t(37),s=t(68),e=t(42),l=t(71),h=t(149),o=e(5),p=e(6),v=0,g=function(){this.a=[]};g.prototype={get:function(t){var n=bh(this,t);if(n)return n[1]},has:function(t){return!!bh(this,t)},set:function(t,n){var r=bh(this,t);r?r[1]=n:this.a.push([t,n])},delete:function(n){var t=p(this.a,function(t){return t[0]===n});return~t&&this.a.splice(t,1),!!~t}},n.exports={getConstructor:function(t,r,e,i){var o=t(function(t,n){f(t,o,r,"_i"),t._t=r,t._i=v++,t._l=void 0,null!=n&&s(n,e,t[i],t)});return u(o.prototype,{delete:function(t){if(!a(t))return!1;var n=c(t);return!0===n?_g(h(this,r)).delete(t):n&&l(n,this._i)&&delete n[this._i]},has:function has(t){if(!a(t))return!1;var n=c(t);return!0===n?_g(h(this,r)).has(t):n&&l(n,this._i)}}),o},def:function(t,n,r){var e=c(i(n),!0);return!0===e?_g(t).set(n,r):e[t._i]=r,t},ufstore:_g}},{117:117,149:149,37:37,38:38,42:42,68:68,71:71,81:81,94:94}],51:[function(t,n,r){"use strict";var y=t(70),d=t(62),x=t(118),m=t(117),S=t(94),b=t(68),w=t(37),_=t(81),E=t(64),O=t(86),F=t(124),I=t(75);n.exports=function(e,t,n,r,i,o){function ci(t){var r=f[t];x(f,t,"delete"==t?function(t){return!(o&&!_(t))&&r.call(this,0===t?0:t)}:"has"==t?function has(t){return!(o&&!_(t))&&r.call(this,0===t?0:t)}:"get"==t?function get(t){return o&&!_(t)?void 0:r.call(this,0===t?0:t)}:"add"==t?function add(t){return r.call(this,0===t?0:t),this}:function set(t,n){return r.call(this,0===t?0:t,n),this})}var u=y[e],c=u,a=i?"set":"add",f=c&&c.prototype,s={};if("function"==typeof c&&(o||f.forEach&&!E(function(){(new c).entries().next()}))){var l=new c,h=l[a](o?{}:-0,1)!=l,p=E(function(){l.has(1)}),v=O(function(t){new c(t)}),g=!o&&E(function(){for(var t=new c,n=5;n--;)t[a](n,n);return!t.has(-0)});v||(((c=t(function(t,n){w(t,c,e);var r=I(new u,t,c);return null!=n&&b(n,i,r[a],r),r})).prototype=f).constructor=c),(p||g)&&(ci("delete"),ci("has"),i&&ci("get")),(g||h)&&ci(a),o&&f.clear&&delete f.clear}else c=r.getConstructor(t,e,i,a),m(c.prototype,n),S.NEED=!0;return F(c,e),s[e]=c,d(d.G+d.W+d.F*(c!=u),s),o||r.setStrong(c,e,i),c}},{117:117,118:118,124:124,37:37,62:62,64:64,68:68,70:70,75:75,81:81,86:86,94:94}],52:[function(t,n,r){arguments[4][18][0].apply(r,arguments)},{18:18}],53:[function(t,n,r){"use strict";var e=t(99),i=t(116);n.exports=function(t,n,r){n in t?e.f(t,n,i(0,r)):t[n]=r}},{116:116,99:99}],54:[function(t,n,r){arguments[4][19][0].apply(r,arguments)},{19:19,33:33}],55:[function(t,n,r){"use strict";function Qi(t){return 9<t?t:"0"+t}var e=t(64),i=Date.prototype.getTime,o=Date.prototype.toISOString;n.exports=e(function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-5e13-1))})||!e(function(){o.call(new Date(NaN))})?function toISOString(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var t=this,n=t.getUTCFullYear(),r=t.getUTCMilliseconds(),e=n<0?"-":9999<n?"+":"";return e+("00000"+Math.abs(n)).slice(e?-6:-4)+"-"+Qi(t.getUTCMonth()+1)+"-"+Qi(t.getUTCDate())+"T"+Qi(t.getUTCHours())+":"+Qi(t.getUTCMinutes())+":"+Qi(t.getUTCSeconds())+"."+(99<r?r:"0"+Qi(r))+"Z"}:o},{64:64}],56:[function(t,n,r){"use strict";var e=t(38),i=t(143);n.exports=function(t){if("string"!==t&&"number"!==t&&"default"!==t)throw TypeError("Incorrect hint");return i(e(this),"number"!=t)}},{143:143,38:38}],57:[function(t,n,r){n.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},{}],58:[function(t,n,r){arguments[4][20][0].apply(r,arguments)},{20:20,64:64}],59:[function(t,n,r){arguments[4][21][0].apply(r,arguments)},{21:21,70:70,81:81}],60:[function(t,n,r){n.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],61:[function(t,n,r){var c=t(107),a=t(104),f=t(108);n.exports=function(t){var n=c(t),r=a.f;if(r)for(var e,i=r(t),o=f.f,u=0;i.length>u;)o.call(t,e=i[u++])&&n.push(e);return n}},{104:104,107:107,108:108}],62:[function(t,n,r){var g=t(70),y=t(52),d=t(72),x=t(118),m=t(54),S="prototype",b=function(t,n,r){var e,i,o,u,c=t&b.F,a=t&b.G,f=t&b.S,s=t&b.P,l=t&b.B,h=a?g:f?g[n]||(g[n]={}):(g[n]||{})[S],p=a?y:y[n]||(y[n]={}),v=p[S]||(p[S]={});for(e in a&&(r=n),r)o=((i=!c&&h&&void 0!==h[e])?h:r)[e],u=l&&i?m(o,g):s&&"function"==typeof o?m(Function.call,o):o,h&&x(h,e,o,t&b.U),p[e]!=o&&d(p,e,u),s&&v[e]!=o&&(v[e]=o)};g.core=y,b.F=1,b.G=2,b.S=4,b.P=8,b.B=16,b.W=32,b.U=64,b.R=128,n.exports=b},{118:118,52:52,54:54,70:70,72:72}],63:[function(t,n,r){var e=t(152)("match");n.exports=function(n){var r=/./;try{"/./"[n](r)}catch(t){try{return r[e]=!1,!"/./"[n](r)}catch(t){}}return!0}},{152:152}],64:[function(t,n,r){arguments[4][23][0].apply(r,arguments)},{23:23}],65:[function(t,n,r){"use strict";t(248);var s=t(118),l=t(72),h=t(64),p=t(57),v=t(152),g=t(120),y=v("species"),d=!h(function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}),x=function(){var t=/(?:)/,n=t.exec;t.exec=function(){return n.apply(this,arguments)};var r="ab".split(t);return 2===r.length&&"a"===r[0]&&"b"===r[1]}();n.exports=function(r,t,n){var e=v(r),o=!h(function(){var t={};return t[e]=function(){return 7},7!=""[r](t)}),i=o?!h(function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===r&&(n.constructor={},n.constructor[y]=function(){return n}),n[e](""),!t}):void 0;if(!o||!i||"replace"===r&&!d||"split"===r&&!x){var u=/./[e],c=n(p,e,""[r],function maybeCallNative(t,n,r,e,i){return n.exec===g?o&&!i?{done:!0,value:u.call(n,r,e)}:{done:!0,value:t.call(r,n,e)}:{done:!1}}),a=c[0],f=c[1];s(String.prototype,r,a),l(RegExp.prototype,e,2==t?function(t,n){return f.call(t,this,n)}:function(t){return f.call(t,this)})}}},{118:118,120:120,152:152,248:248,57:57,64:64,72:72}],66:[function(t,n,r){"use strict";var e=t(38);n.exports=function(){var t=e(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n}},{38:38}],67:[function(t,n,r){"use strict";var p=t(79),v=t(81),g=t(141),y=t(54),d=t(152)("isConcatSpreadable");n.exports=function flattenIntoArray(t,n,r,e,i,o,u,c){for(var a,f,s=i,l=0,h=!!u&&y(u,c,3);l<e;){if(l in r){if(a=h?h(r[l],l,n):r[l],f=!1,v(a)&&(f=void 0!==(f=a[d])?!!f:p(a)),f&&0<o)s=flattenIntoArray(t,n,a,g(a.length),s,o-1)-1;else{if(9007199254740991<=s)throw TypeError();t[s]=a}s++}l++}return s}},{141:141,152:152,54:54,79:79,81:81}],68:[function(t,n,r){var h=t(54),p=t(83),v=t(78),g=t(38),y=t(141),d=t(153),x={},m={};(r=n.exports=function(t,n,r,e,i){var o,u,c,a,f=i?function(){return t}:d(t),s=h(r,e,n?2:1),l=0;if("function"!=typeof f)throw TypeError(t+" is not iterable!");if(v(f)){for(o=y(t.length);l<o;l++)if((a=n?s(g(u=t[l])[0],u[1]):s(t[l]))===x||a===m)return a}else for(c=f.call(t);!(u=c.next()).done;)if((a=p(c,s,u.value,n))===x||a===m)return a}).BREAK=x,r.RETURN=m},{141:141,153:153,38:38,54:54,78:78,83:83}],69:[function(t,n,r){n.exports=t(126)("native-function-to-string",Function.toString)},{126:126}],70:[function(t,n,r){arguments[4][24][0].apply(r,arguments)},{24:24}],71:[function(t,n,r){arguments[4][25][0].apply(r,arguments)},{25:25}],72:[function(t,n,r){arguments[4][26][0].apply(r,arguments)},{116:116,26:26,58:58,99:99}],73:[function(t,n,r){var e=t(70).document;n.exports=e&&e.documentElement},{70:70}],74:[function(t,n,r){arguments[4][27][0].apply(r,arguments)},{27:27,58:58,59:59,64:64}],75:[function(t,n,r){var o=t(81),u=t(122).set;n.exports=function(t,n,r){var e,i=n.constructor;return i!==r&&"function"==typeof i&&(e=i.prototype)!==r.prototype&&o(e)&&u&&u(t,e),t}},{122:122,81:81}],76:[function(t,n,r){n.exports=function(t,n,r){var e=void 0===r;switch(n.length){case 0:return e?t():t.call(r);case 1:return e?t(n[0]):t.call(r,n[0]);case 2:return e?t(n[0],n[1]):t.call(r,n[0],n[1]);case 3:return e?t(n[0],n[1],n[2]):t.call(r,n[0],n[1],n[2]);case 4:return e?t(n[0],n[1],n[2],n[3]):t.call(r,n[0],n[1],n[2],n[3])}return t.apply(r,n)}},{}],77:[function(t,n,r){var e=t(48);n.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==e(t)?t.split(""):Object(t)}},{48:48}],78:[function(t,n,r){var e=t(88),i=t(152)("iterator"),o=Array.prototype;n.exports=function(t){return void 0!==t&&(e.Array===t||o[i]===t)}},{152:152,88:88}],79:[function(t,n,r){var e=t(48);n.exports=Array.isArray||function isArray(t){return"Array"==e(t)}},{48:48}],80:[function(t,n,r){var e=t(81),i=Math.floor;n.exports=function isInteger(t){return!e(t)&&isFinite(t)&&i(t)===t}},{81:81}],81:[function(t,n,r){arguments[4][28][0].apply(r,arguments)},{28:28}],82:[function(t,n,r){var e=t(81),i=t(48),o=t(152)("match");n.exports=function(t){var n;return e(t)&&(void 0!==(n=t[o])?!!n:"RegExp"==i(t))}},{152:152,48:48,81:81}],83:[function(t,n,r){var o=t(38);n.exports=function(n,t,r,e){try{return e?t(o(r)[0],r[1]):t(r)}catch(t){var i=n.return;throw void 0!==i&&o(i.call(n)),t}}},{38:38}],84:[function(t,n,r){"use strict";var e=t(98),i=t(116),o=t(124),u={};t(72)(u,t(152)("iterator"),function(){return this}),n.exports=function(t,n,r){t.prototype=e(u,{next:i(1,r)}),o(t,n+" Iterator")}},{116:116,124:124,152:152,72:72,98:98}],85:[function(t,n,r){"use strict";function Qn(){return this}var x=t(89),m=t(62),S=t(118),b=t(72),w=t(88),_=t(84),E=t(124),O=t(105),F=t(152)("iterator"),I=!([].keys&&"next"in[].keys()),P="values";n.exports=function(t,n,r,e,i,o,u){_(r,n,e);function Yn(t){if(!I&&t in p)return p[t];switch(t){case"keys":return function keys(){return new r(this,t)};case P:return function values(){return new r(this,t)}}return function entries(){return new r(this,t)}}var c,a,f,s=n+" Iterator",l=i==P,h=!1,p=t.prototype,v=p[F]||p["@@iterator"]||i&&p[i],g=v||Yn(i),y=i?l?Yn("entries"):g:void 0,d="Array"==n&&p.entries||v;if(d&&(f=O(d.call(new t)))!==Object.prototype&&f.next&&(E(f,s,!0),x||"function"==typeof f[F]||b(f,F,Qn)),l&&v&&v.name!==P&&(h=!0,g=function values(){return v.call(this)}),x&&!u||!I&&!h&&p[F]||b(p,F,g),w[n]=g,w[s]=Qn,i)if(c={values:l?g:Yn(P),keys:o?g:Yn("keys"),entries:y},u)for(a in c)a in p||S(p,a,c[a]);else m(m.P+m.F*(I||h),n,c);return c}},{105:105,118:118,124:124,152:152,62:62,72:72,84:84,88:88,89:89}],86:[function(t,n,r){var o=t(152)("iterator"),u=!1;try{var e=[7][o]();e.return=function(){u=!0},Array.from(e,function(){throw 2})}catch(t){}n.exports=function(t,n){if(!n&&!u)return!1;var r=!1;try{var e=[7],i=e[o]();i.next=function(){return{done:r=!0}},e[o]=function(){return i},t(e)}catch(t){}return r}},{152:152}],87:[function(t,n,r){n.exports=function(t,n){return{value:n,done:!!t}}},{}],88:[function(t,n,r){n.exports={}},{}],89:[function(t,n,r){n.exports=!1},{}],90:[function(t,n,r){var e=Math.expm1;n.exports=!e||22025.465794806718<e(10)||e(10)<22025.465794806718||-2e-17!=e(-2e-17)?function expm1(t){return 0==(t=+t)?t:-1e-6<t&&t<1e-6?t+t*t/2:Math.exp(t)-1}:e},{}],91:[function(t,n,r){var o=t(93),e=Math.pow,u=e(2,-52),c=e(2,-23),a=e(2,127)*(2-c),f=e(2,-126);n.exports=Math.fround||function fround(t){var n,r,e=Math.abs(t),i=o(t);return e<f?i*(e/f/c+1/u-1/u)*f*c:a<(r=(n=(1+c/u)*e)-(n-e))||r!=r?i*(1/0):i*r}},{93:93}],92:[function(t,n,r){n.exports=Math.log1p||function log1p(t){return-1e-8<(t=+t)&&t<1e-8?t-t*t/2:Math.log(1+t)}},{}],93:[function(t,n,r){n.exports=Math.sign||function sign(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},{}],94:[function(t,n,r){function tp(t){u(t,e,{value:{i:"O"+ ++c,w:{}}})}var e=t(147)("meta"),i=t(81),o=t(71),u=t(99).f,c=0,a=Object.isExtensible||function(){return!0},f=!t(64)(function(){return a(Object.preventExtensions({}))}),s=n.exports={KEY:e,NEED:!1,fastKey:function(t,n){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,e)){if(!a(t))return"F";if(!n)return"E";tp(t)}return t[e].i},getWeak:function(t,n){if(!o(t,e)){if(!a(t))return!0;if(!n)return!1;tp(t)}return t[e].w},onFreeze:function(t){return f&&s.NEED&&a(t)&&!o(t,e)&&tp(t),t}}},{147:147,64:64,71:71,81:81,99:99}],95:[function(t,n,r){var u=t(70),c=t(136).set,a=u.MutationObserver||u.WebKitMutationObserver,f=u.process,s=u.Promise,l="process"==t(48)(f);n.exports=function(){function Qp(){var t,n;for(l&&(t=f.domain)&&t.exit();r;){n=r.fn,r=r.next;try{n()}catch(t){throw r?i():e=void 0,t}}e=void 0,t&&t.enter()}var r,e,i;if(l)i=function(){f.nextTick(Qp)};else if(!a||u.navigator&&u.navigator.standalone)if(s&&s.resolve){var t=s.resolve(void 0);i=function(){t.then(Qp)}}else i=function(){c.call(u,Qp)};else{var n=!0,o=document.createTextNode("");new a(Qp).observe(o,{characterData:!0}),i=function(){o.data=n=!n}}return function(t){var n={fn:t,next:void 0};e&&(e.next=n),r||(r=n,i()),e=n}}},{136:136,48:48,70:70}],96:[function(t,n,r){"use strict";var i=t(33);function PromiseCapability(t){var r,e;this.promise=new t(function(t,n){if(void 0!==r||void 0!==e)throw TypeError("Bad Promise constructor");r=t,e=n}),this.resolve=i(r),this.reject=i(e)}n.exports.f=function(t){return new PromiseCapability(t)}},{33:33}],97:[function(t,n,r){"use strict";var h=t(58),p=t(107),v=t(104),g=t(108),y=t(142),d=t(77),i=Object.assign;n.exports=!i||t(64)(function(){var t={},n={},r=Symbol(),e="abcdefghijklmnopqrst";return t[r]=7,e.split("").forEach(function(t){n[t]=t}),7!=i({},t)[r]||Object.keys(i({},n)).join("")!=e})?function assign(t,n){for(var r=y(t),e=arguments.length,i=1,o=v.f,u=g.f;i<e;)for(var c,a=d(arguments[i++]),f=o?p(a).concat(o(a)):p(a),s=f.length,l=0;l<s;)c=f[l++],h&&!u.call(a,c)||(r[c]=a[c]);return r}:i},{104:104,107:107,108:108,142:142,58:58,64:64,77:77}],98:[function(e,t,n){function Pq(){}var i=e(38),o=e(100),u=e(60),c=e(125)("IE_PROTO"),a="prototype",f=function(){var t,n=e(59)("iframe"),r=u.length;for(n.style.display="none",e(73).appendChild(n),n.src="javascript:",(t=n.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),f=t.F;r--;)delete f[a][u[r]];return f()};t.exports=Object.create||function create(t,n){var r;return null!==t?(Pq[a]=i(t),r=new Pq,Pq[a]=null,r[c]=t):r=f(),void 0===n?r:o(r,n)}},{100:100,125:125,38:38,59:59,60:60,73:73}],99:[function(t,n,r){arguments[4][29][0].apply(r,arguments)},{143:143,29:29,38:38,58:58,74:74}],100:[function(t,n,r){var u=t(99),c=t(38),a=t(107);n.exports=t(58)?Object.defineProperties:function defineProperties(t,n){c(t);for(var r,e=a(n),i=e.length,o=0;o<i;)u.f(t,r=e[o++],n[r]);return t}},{107:107,38:38,58:58,99:99}],101:[function(t,n,r){var e=t(108),i=t(116),o=t(140),u=t(143),c=t(71),a=t(74),f=Object.getOwnPropertyDescriptor;r.f=t(58)?f:function getOwnPropertyDescriptor(t,n){if(t=o(t),n=u(n,!0),a)try{return f(t,n)}catch(t){}if(c(t,n))return i(!e.f.call(t,n),t[n])}},{108:108,116:116,140:140,143:143,58:58,71:71,74:74}],102:[function(t,n,r){var e=t(140),i=t(103).f,o={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];n.exports.f=function getOwnPropertyNames(t){return u&&"[object Window]"==o.call(t)?function(t){try{return i(t)}catch(t){return u.slice()}}(t):i(e(t))}},{103:103,140:140}],103:[function(t,n,r){var e=t(106),i=t(60).concat("length","prototype");r.f=Object.getOwnPropertyNames||function getOwnPropertyNames(t){return e(t,i)}},{106:106,60:60}],104:[function(t,n,r){r.f=Object.getOwnPropertySymbols},{}],105:[function(t,n,r){var e=t(71),i=t(142),o=t(125)("IE_PROTO"),u=Object.prototype;n.exports=Object.getPrototypeOf||function(t){return t=i(t),e(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},{125:125,142:142,71:71}],106:[function(t,n,r){var u=t(71),c=t(140),a=t(41)(!1),f=t(125)("IE_PROTO");n.exports=function(t,n){var r,e=c(t),i=0,o=[];for(r in e)r!=f&&u(e,r)&&o.push(r);for(;n.length>i;)u(e,r=n[i++])&&(~a(o,r)||o.push(r));return o}},{125:125,140:140,41:41,71:71}],107:[function(t,n,r){var e=t(106),i=t(60);n.exports=Object.keys||function keys(t){return e(t,i)}},{106:106,60:60}],108:[function(t,n,r){r.f={}.propertyIsEnumerable},{}],109:[function(t,n,r){var i=t(62),o=t(52),u=t(64);n.exports=function(t,n){var r=(o.Object||{})[t]||Object[t],e={};e[t]=n(r),i(i.S+i.F*u(function(){r(1)}),"Object",e)}},{52:52,62:62,64:64}],110:[function(t,n,r){var a=t(58),f=t(107),s=t(140),l=t(108).f;n.exports=function(c){return function(t){for(var n,r=s(t),e=f(r),i=e.length,o=0,u=[];o<i;)n=e[o++],a&&!l.call(r,n)||u.push(c?[n,r[n]]:r[n]);return u}}},{107:107,108:108,140:140,58:58}],111:[function(t,n,r){var e=t(103),i=t(104),o=t(38),u=t(70).Reflect;n.exports=u&&u.ownKeys||function ownKeys(t){var n=e.f(o(t)),r=i.f;return r?n.concat(r(t)):n}},{103:103,104:104,38:38,70:70}],112:[function(t,n,r){var e=t(70).parseFloat,i=t(134).trim;n.exports=1/e(t(135)+"-0")!=-1/0?function parseFloat(t){var n=i(String(t),3),r=e(n);return 0===r&&"-"==n.charAt(0)?-0:r}:e},{134:134,135:135,70:70}],113:[function(t,n,r){var e=t(70).parseInt,i=t(134).trim,o=t(135),u=/^[-+]?0[xX]/;n.exports=8!==e(o+"08")||22!==e(o+"0x16")?function parseInt(t,n){var r=i(String(t),3);return e(r,n>>>0||(u.test(r)?16:10))}:e},{134:134,135:135,70:70}],114:[function(t,n,r){n.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},{}],115:[function(t,n,r){var e=t(38),i=t(81),o=t(96);n.exports=function(t,n){if(e(t),i(n)&&n.constructor===t)return n;var r=o.f(t);return(0,r.resolve)(n),r.promise}},{38:38,81:81,96:96}],116:[function(t,n,r){arguments[4][30][0].apply(r,arguments)},{30:30}],117:[function(t,n,r){var i=t(118);n.exports=function(t,n,r){for(var e in n)i(t,e,n[e],r);return t}},{118:118}],118:[function(t,n,r){var o=t(70),u=t(72),c=t(71),a=t(147)("src"),e=t(69),i="toString",f=(""+e).split(i);t(52).inspectSource=function(t){return e.call(t)},(n.exports=function(t,n,r,e){var i="function"==typeof r;i&&(c(r,"name")||u(r,"name",n)),t[n]!==r&&(i&&(c(r,a)||u(r,a,t[n]?""+t[n]:f.join(String(n)))),t===o?t[n]=r:e?t[n]?t[n]=r:u(t,n,r):(delete t[n],u(t,n,r)))})(Function.prototype,i,function toString(){return"function"==typeof this&&this[a]||e.call(this)})},{147:147,52:52,69:69,70:70,71:71,72:72}],119:[function(t,n,r){"use strict";var i=t(47),o=RegExp.prototype.exec;n.exports=function(t,n){var r=t.exec;if("function"==typeof r){var e=r.call(t,n);if("object"!=typeof e)throw new TypeError("RegExp exec method returned something other than an Object or null");return e}if("RegExp"!==i(t))throw new TypeError("RegExp#exec called on incompatible receiver");return o.call(t,n)}},{47:47}],120:[function(t,n,r){"use strict";var e,i,u=t(66),c=RegExp.prototype.exec,a=String.prototype.replace,o=c,f="lastIndex",s=(e=/a/,i=/b*/g,c.call(e,"a"),c.call(i,"a"),0!==e[f]||0!==i[f]),l=void 0!==/()??/.exec("")[1];(s||l)&&(o=function exec(t){var n,r,e,i,o=this;return l&&(r=new RegExp("^"+o.source+"$(?!\\s)",u.call(o))),s&&(n=o[f]),e=c.call(o,t),s&&e&&(o[f]=o.global?e.index+e[0].length:n),l&&e&&1<e.length&&a.call(e[0],r,function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(e[i]=void 0)}),e}),n.exports=o},{66:66}],121:[function(t,n,r){n.exports=Object.is||function is(t,n){return t===n?0!==t||1/t==1/n:t!=t&&n!=n}},{}],122:[function(n,t,r){function Wu(t,n){if(i(t),!e(n)&&null!==n)throw TypeError(n+": can't set as prototype!")}var e=n(81),i=n(38);t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,r,e){try{(e=n(54)(Function.call,n(101).f(Object.prototype,"__proto__").set,2))(t,[]),r=!(t instanceof Array)}catch(t){r=!0}return function setPrototypeOf(t,n){return Wu(t,n),r?t.__proto__=n:e(t,n),t}}({},!1):void 0),check:Wu}},{101:101,38:38,54:54,81:81}],123:[function(t,n,r){"use strict";var e=t(70),i=t(99),o=t(58),u=t(152)("species");n.exports=function(t){var n=e[t];o&&n&&!n[u]&&i.f(n,u,{configurable:!0,get:function(){return this}})}},{152:152,58:58,70:70,99:99}],124:[function(t,n,r){var e=t(99).f,i=t(71),o=t(152)("toStringTag");n.exports=function(t,n,r){t&&!i(t=r?t:t.prototype,o)&&e(t,o,{configurable:!0,value:n})}},{152:152,71:71,99:99}],125:[function(t,n,r){var e=t(126)("keys"),i=t(147);n.exports=function(t){return e[t]||(e[t]=i(t))}},{126:126,147:147}],126:[function(t,n,r){var e=t(52),i=t(70),o="__core-js_shared__",u=i[o]||(i[o]={});(n.exports=function(t,n){return u[t]||(u[t]=void 0!==n?n:{})})("versions",[]).push({version:e.version,mode:t(89)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},{52:52,70:70,89:89}],127:[function(t,n,r){var i=t(38),o=t(33),u=t(152)("species");n.exports=function(t,n){var r,e=i(t).constructor;return void 0===e||null==(r=i(e)[u])?n:o(r)}},{152:152,33:33,38:38}],128:[function(t,n,r){"use strict";var e=t(64);n.exports=function(t,n){return!!t&&e(function(){n?t.call(null,function(){},1):t.call(null)})}},{64:64}],129:[function(t,n,r){var a=t(139),f=t(57);n.exports=function(c){return function(t,n){var r,e,i=String(f(t)),o=a(n),u=i.length;return o<0||u<=o?c?"":void 0:(r=i.charCodeAt(o))<55296||56319<r||o+1===u||(e=i.charCodeAt(o+1))<56320||57343<e?c?i.charAt(o):r:c?i.slice(o,o+2):e-56320+(r-55296<<10)+65536}}},{139:139,57:57}],130:[function(t,n,r){var e=t(82),i=t(57);n.exports=function(t,n,r){if(e(n))throw TypeError("String#"+r+" doesn't accept regex!");return String(i(t))}},{57:57,82:82}],131:[function(t,n,r){function Aw(t,n,r,e){var i=String(u(t)),o="<"+n;return""!==r&&(o+=" "+r+'="'+String(e).replace(c,"&quot;")+'"'),o+">"+i+"</"+n+">"}var e=t(62),i=t(64),u=t(57),c=/"/g;n.exports=function(n,t){var r={};r[n]=t(Aw),e(e.P+e.F*i(function(){var t=""[n]('"');return t!==t.toLowerCase()||3<t.split('"').length}),"String",r)}},{57:57,62:62,64:64}],132:[function(t,n,r){var s=t(141),l=t(133),h=t(57);n.exports=function(t,n,r,e){var i=String(h(t)),o=i.length,u=void 0===r?" ":String(r),c=s(n);if(c<=o||""==u)return i;var a=c-o,f=l.call(u,Math.ceil(a/u.length));return f.length>a&&(f=f.slice(0,a)),e?f+i:i+f}},{133:133,141:141,57:57}],133:[function(t,n,r){"use strict";var i=t(139),o=t(57);n.exports=function repeat(t){var n=String(o(this)),r="",e=i(t);if(e<0||e==1/0)throw RangeError("Count can't be negative");for(;0<e;(e>>>=1)&&(n+=n))1&e&&(r+=n);return r}},{139:139,57:57}],134:[function(t,n,r){function tx(t,n,r){var e={},i=c(function(){return!!a[t]()||"​…"!="​…"[t]()}),o=e[t]=i?n(s):a[t];r&&(e[r]=o),u(u.P+u.F*i,"String",e)}var u=t(62),e=t(57),c=t(64),a=t(135),i="["+a+"]",o=RegExp("^"+i+i+"*"),f=RegExp(i+i+"*$"),s=tx.trim=function(t,n){return t=String(e(t)),1&n&&(t=t.replace(o,"")),2&n&&(t=t.replace(f,"")),t};n.exports=tx},{135:135,57:57,62:62,64:64}],135:[function(t,n,r){n.exports="\t\n\v\f\r Â áš€á Žâ€€â€â€‚â€ƒâ€„â€…â€†â€‡â€ˆâ€‰â€Šâ€¯âŸã€€\u2028\u2029\ufeff"},{}],136:[function(t,n,r){function Zx(){var t=+this;if(d.hasOwnProperty(t)){var n=d[t];delete d[t],n()}}function $x(t){Zx.call(t.data)}var e,i,o,u=t(54),c=t(76),a=t(73),f=t(59),s=t(70),l=s.process,h=s.setImmediate,p=s.clearImmediate,v=s.MessageChannel,g=s.Dispatch,y=0,d={},x="onreadystatechange";h&&p||(h=function setImmediate(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);return d[++y]=function(){c("function"==typeof t?t:Function(t),n)},e(y),y},p=function clearImmediate(t){delete d[t]},"process"==t(48)(l)?e=function(t){l.nextTick(u(Zx,t,1))}:g&&g.now?e=function(t){g.now(u(Zx,t,1))}:v?(o=(i=new v).port2,i.port1.onmessage=$x,e=u(o.postMessage,o,1)):s.addEventListener&&"function"==typeof postMessage&&!s.importScripts?(e=function(t){s.postMessage(t+"","*")},s.addEventListener("message",$x,!1)):e=x in f("script")?function(t){a.appendChild(f("script"))[x]=function(){a.removeChild(this),Zx.call(t)}}:function(t){setTimeout(u(Zx,t,1),0)}),n.exports={set:h,clear:p}},{48:48,54:54,59:59,70:70,73:73,76:76}],137:[function(t,n,r){var e=t(139),i=Math.max,o=Math.min;n.exports=function(t,n){return(t=e(t))<0?i(t+n,0):o(t,n)}},{139:139}],138:[function(t,n,r){var e=t(139),i=t(141);n.exports=function(t){if(void 0===t)return 0;var n=e(t),r=i(n);if(n!==r)throw RangeError("Wrong length!");return r}},{139:139,141:141}],139:[function(t,n,r){var e=Math.ceil,i=Math.floor;n.exports=function(t){return isNaN(t=+t)?0:(0<t?i:e)(t)}},{}],140:[function(t,n,r){var e=t(77),i=t(57);n.exports=function(t){return e(i(t))}},{57:57,77:77}],141:[function(t,n,r){var e=t(139),i=Math.min;n.exports=function(t){return 0<t?i(e(t),9007199254740991):0}},{139:139}],142:[function(t,n,r){var e=t(57);n.exports=function(t){return Object(e(t))}},{57:57}],143:[function(t,n,r){arguments[4][31][0].apply(r,arguments)},{31:31,81:81}],144:[function(t,n,r){"use strict";if(t(58)){var y=t(89),d=t(70),x=t(64),m=t(62),S=t(146),e=t(145),h=t(54),b=t(37),i=t(116),w=t(72),o=t(117),u=t(139),_=t(141),E=t(138),c=t(137),a=t(143),f=t(71),O=t(47),F=t(81),p=t(142),v=t(78),I=t(98),P=t(105),A=t(103).f,g=t(153),s=t(147),l=t(152),M=t(42),k=t(41),N=t(127),j=t(164),R=t(88),T=t(86),L=t(123),C=t(40),G=t(39),D=t(99),U=t(101),W=D.f,V=U.f,B=d.RangeError,q=d.TypeError,Y=d.Uint8Array,z="ArrayBuffer",X="Shared"+z,$="BYTES_PER_ELEMENT",Q="prototype",Z=Array[Q],J=e.ArrayBuffer,H=e.DataView,K=M(0),tt=M(2),nt=M(3),rt=M(4),et=M(5),it=M(6),ot=k(!0),ut=k(!1),ct=j.values,at=j.keys,ft=j.entries,st=Z.lastIndexOf,lt=Z.reduce,ht=Z.reduceRight,pt=Z.join,vt=Z.sort,gt=Z.slice,yt=Z.toString,dt=Z.toLocaleString,xt=l("iterator"),mt=l("toStringTag"),St=s("typed_constructor"),bt=s("def_constructor"),wt=S.CONSTR,_t=S.TYPED,Et=S.VIEW,Ot="Wrong length!",Ft=M(1,function(t,n){return kt(N(t,t[bt]),n)}),It=x(function(){return 1===new Y(new Uint16Array([1]).buffer)[0]}),Pt=!!Y&&!!Y[Q].set&&x(function(){new Y(1).set({})}),At=function(t,n){var r=u(t);if(r<0||r%n)throw B("Wrong offset!");return r},Mt=function(t){if(F(t)&&_t in t)return t;throw q(t+" is not a typed array!")},kt=function(t,n){if(!(F(t)&&St in t))throw q("It is not a typed array constructor!");return new t(n)},Nt=function(t,n){return jt(N(t,t[bt]),n)},jt=function(t,n){for(var r=0,e=n.length,i=kt(t,e);r<e;)i[r]=n[r++];return i},Rt=function(t,n,r){W(t,n,{get:function(){return this._d[r]}})},Tt=function from(t){var n,r,e,i,o,u,c=p(t),a=arguments.length,f=1<a?arguments[1]:void 0,s=void 0!==f,l=g(c);if(null!=l&&!v(l)){for(u=l.call(c),e=[],n=0;!(o=u.next()).done;n++)e.push(o.value);c=e}for(s&&2<a&&(f=h(f,arguments[2],2)),n=0,r=_(c.length),i=kt(this,r);n<r;n++)i[n]=s?f(c[n],n):c[n];return i},Lt=function of(){for(var t=0,n=arguments.length,r=kt(this,n);t<n;)r[t]=arguments[t++];return r},Ct=!!Y&&x(function(){dt.call(new Y(1))}),Gt=function toLocaleString(){return dt.apply(Ct?gt.call(Mt(this)):Mt(this),arguments)},Dt={copyWithin:function copyWithin(t,n){return G.call(Mt(this),t,n,2<arguments.length?arguments[2]:void 0)},every:function every(t){return rt(Mt(this),t,1<arguments.length?arguments[1]:void 0)},fill:function fill(t){return C.apply(Mt(this),arguments)},filter:function filter(t){return Nt(this,tt(Mt(this),t,1<arguments.length?arguments[1]:void 0))},find:function find(t){return et(Mt(this),t,1<arguments.length?arguments[1]:void 0)},findIndex:function findIndex(t){return it(Mt(this),t,1<arguments.length?arguments[1]:void 0)},forEach:function forEach(t){K(Mt(this),t,1<arguments.length?arguments[1]:void 0)},indexOf:function indexOf(t){return ut(Mt(this),t,1<arguments.length?arguments[1]:void 0)},includes:function includes(t){return ot(Mt(this),t,1<arguments.length?arguments[1]:void 0)},join:function join(t){return pt.apply(Mt(this),arguments)},lastIndexOf:function lastIndexOf(t){return st.apply(Mt(this),arguments)},map:function map(t){return Ft(Mt(this),t,1<arguments.length?arguments[1]:void 0)},reduce:function reduce(t){return lt.apply(Mt(this),arguments)},reduceRight:function reduceRight(t){return ht.apply(Mt(this),arguments)},reverse:function reverse(){for(var t,n=this,r=Mt(n).length,e=Math.floor(r/2),i=0;i<e;)t=n[i],n[i++]=n[--r],n[r]=t;return n},some:function some(t){return nt(Mt(this),t,1<arguments.length?arguments[1]:void 0)},sort:function sort(t){return vt.call(Mt(this),t)},subarray:function subarray(t,n){var r=Mt(this),e=r.length,i=c(t,e);return new(N(r,r[bt]))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,_((void 0===n?e:c(n,e))-i))}},Ut=function slice(t,n){return Nt(this,gt.call(Mt(this),t,n))},Wt=function set(t){Mt(this);var n=At(arguments[1],1),r=this.length,e=p(t),i=_(e.length),o=0;if(r<i+n)throw B(Ot);for(;o<i;)this[n+o]=e[o++]},Vt={entries:function entries(){return ft.call(Mt(this))},keys:function keys(){return at.call(Mt(this))},values:function values(){return ct.call(Mt(this))}},Bt=function(t,n){return F(t)&&t[_t]&&"symbol"!=typeof n&&n in t&&String(+n)==String(n)},qt=function getOwnPropertyDescriptor(t,n){return Bt(t,n=a(n,!0))?i(2,t[n]):V(t,n)},Yt=function defineProperty(t,n,r){return!(Bt(t,n=a(n,!0))&&F(r)&&f(r,"value"))||f(r,"get")||f(r,"set")||r.configurable||f(r,"writable")&&!r.writable||f(r,"enumerable")&&!r.enumerable?W(t,n,r):(t[n]=r.value,t)};wt||(U.f=qt,D.f=Yt),m(m.S+m.F*!wt,"Object",{getOwnPropertyDescriptor:qt,defineProperty:Yt}),x(function(){yt.call({})})&&(yt=dt=function toString(){return pt.call(this)});var zt=o({},Dt);o(zt,Vt),w(zt,xt,Vt.values),o(zt,{slice:Ut,set:Wt,constructor:function(){},toString:yt,toLocaleString:Gt}),Rt(zt,"buffer","b"),Rt(zt,"byteOffset","o"),Rt(zt,"byteLength","l"),Rt(zt,"length","e"),W(zt,mt,{get:function(){return this[_t]}}),n.exports=function(t,l,n,o){function CC(t,i){W(t,i,{get:function(){return t=i,(n=this._d).v[r](t*l+n.o,It);var t,n},set:function(t){return n=i,r=t,e=this._d,o&&(r=(r=Math.round(r))<0?0:255<r?255:255&r),void e.v[u](n*l+e.o,r,It);var n,r,e},enumerable:!0})}var h=t+((o=!!o)?"Clamped":"")+"Array",r="get"+t,u="set"+t,p=d[h],c=p||{},e=p&&P(p),i=!p||!S.ABV,a={},f=p&&p[Q];i?(p=n(function(t,n,r,e){b(t,p,h,"_d");var i,o,u,c,a=0,f=0;if(F(n)){if(!(n instanceof J||(c=O(n))==z||c==X))return _t in n?jt(p,n):Tt.call(p,n);i=n,f=At(r,l);var s=n.byteLength;if(void 0===e){if(s%l)throw B(Ot);if((o=s-f)<0)throw B(Ot)}else if(s<(o=_(e)*l)+f)throw B(Ot);u=o/l}else u=E(n),i=new J(o=u*l);for(w(t,"_d",{b:i,o:f,l:o,e:u,v:new H(i)});a<u;)CC(t,a++)}),f=p[Q]=I(zt),w(f,"constructor",p)):x(function(){p(1)})&&x(function(){new p(-1)})&&T(function(t){new p,new p(null),new p(1.5),new p(t)},!0)||(p=n(function(t,n,r,e){var i;return b(t,p,h),F(n)?n instanceof J||(i=O(n))==z||i==X?void 0!==e?new c(n,At(r,l),e):void 0!==r?new c(n,At(r,l)):new c(n):_t in n?jt(p,n):Tt.call(p,n):new c(E(n))}),K(e!==Function.prototype?A(c).concat(A(e)):A(c),function(t){t in p||w(p,t,c[t])}),p[Q]=f,y||(f.constructor=p));var s=f[xt],v=!!s&&("values"==s.name||null==s.name),g=Vt.values;w(p,St,!0),w(f,_t,h),w(f,Et,!0),w(f,bt,p),(o?new p(1)[mt]==h:mt in f)||W(f,mt,{get:function(){return h}}),a[h]=p,m(m.G+m.W+m.F*(p!=c),a),m(m.S,h,{BYTES_PER_ELEMENT:l}),m(m.S+m.F*x(function(){c.of.call(p,1)}),h,{from:Tt,of:Lt}),$ in f||w(f,$,l),m(m.P,h,Dt),L(h),m(m.P+m.F*Pt,h,{set:Wt}),m(m.P+m.F*!v,h,Vt),y||f.toString==yt||(f.toString=yt),m(m.P+m.F*x(function(){new p(1).slice()}),h,{slice:Ut}),m(m.P+m.F*(x(function(){return[1,2].toLocaleString()!=new p([1,2]).toLocaleString()})||!x(function(){f.toLocaleString.call([1,2])})),h,{toLocaleString:Gt}),R[h]=v?s:g,y||v||w(f,xt,g)}}else n.exports=function(){}},{101:101,103:103,105:105,116:116,117:117,123:123,127:127,137:137,138:138,139:139,141:141,142:142,143:143,145:145,146:146,147:147,152:152,153:153,164:164,37:37,39:39,40:40,41:41,42:42,47:47,54:54,58:58,62:62,64:64,70:70,71:71,72:72,78:78,81:81,86:86,88:88,89:89,98:98,99:99}],145:[function(t,n,r){"use strict";var e=t(70),i=t(58),o=t(89),u=t(146),c=t(72),a=t(117),f=t(64),s=t(37),l=t(139),h=t(141),p=t(138),v=t(103).f,g=t(99).f,y=t(40),d=t(124),x="ArrayBuffer",m="DataView",S="prototype",b="Wrong index!",w=e[x],_=e[m],E=e.Math,O=e.RangeError,F=e.Infinity,I=w,P=E.abs,A=E.pow,M=E.floor,k=E.log,N=E.LN2,j="byteLength",R="byteOffset",T=i?"_b":"buffer",L=i?"_l":j,C=i?"_o":R;function packIEEE754(t,n,r){var e,i,o,u=new Array(r),c=8*r-n-1,a=(1<<c)-1,f=a>>1,s=23===n?A(2,-24)-A(2,-77):0,l=0,h=t<0||0===t&&1/t<0?1:0;for((t=P(t))!=t||t===F?(i=t!=t?1:0,e=a):(e=M(k(t)/N),t*(o=A(2,-e))<1&&(e--,o*=2),2<=(t+=1<=e+f?s/o:s*A(2,1-f))*o&&(e++,o/=2),a<=e+f?(i=0,e=a):1<=e+f?(i=(t*o-1)*A(2,n),e+=f):(i=t*A(2,f-1)*A(2,n),e=0));8<=n;u[l++]=255&i,i/=256,n-=8);for(e=e<<n|i,c+=n;0<c;u[l++]=255&e,e/=256,c-=8);return u[--l]|=128*h,u}function unpackIEEE754(t,n,r){var e,i=8*r-n-1,o=(1<<i)-1,u=o>>1,c=i-7,a=r-1,f=t[a--],s=127&f;for(f>>=7;0<c;s=256*s+t[a],a--,c-=8);for(e=s&(1<<-c)-1,s>>=-c,c+=n;0<c;e=256*e+t[a],a--,c-=8);if(0===s)s=1-u;else{if(s===o)return e?NaN:f?-F:F;e+=A(2,n),s-=u}return(f?-1:1)*e*A(2,s-n)}function unpackI32(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function packI8(t){return[255&t]}function packI16(t){return[255&t,t>>8&255]}function packI32(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function packF64(t){return packIEEE754(t,52,8)}function packF32(t){return packIEEE754(t,23,4)}function addGetter(t,n,r){g(t[S],n,{get:function(){return this[r]}})}function get(t,n,r,e){var i=p(+r);if(i+n>t[L])throw O(b);var o=t[T]._b,u=i+t[C],c=o.slice(u,u+n);return e?c:c.reverse()}function set(t,n,r,e,i,o){var u=p(+r);if(u+n>t[L])throw O(b);for(var c=t[T]._b,a=u+t[C],f=e(+i),s=0;s<n;s++)c[a+s]=f[o?s:n-s-1]}if(u.ABV){if(!f(function(){w(1)})||!f(function(){new w(-1)})||f(function(){return new w,new w(1.5),new w(NaN),w.name!=x})){for(var G,D=(w=function ArrayBuffer(t){return s(this,w),new I(p(t))})[S]=I[S],U=v(I),W=0;U.length>W;)(G=U[W++])in w||c(w,G,I[G]);o||(D.constructor=w)}var V=new _(new w(2)),B=_[S].setInt8;V.setInt8(0,2147483648),V.setInt8(1,2147483649),!V.getInt8(0)&&V.getInt8(1)||a(_[S],{setInt8:function setInt8(t,n){B.call(this,t,n<<24>>24)},setUint8:function setUint8(t,n){B.call(this,t,n<<24>>24)}},!0)}else w=function ArrayBuffer(t){s(this,w,x);var n=p(t);this._b=y.call(new Array(n),0),this[L]=n},_=function DataView(t,n,r){s(this,_,m),s(t,w,m);var e=t[L],i=l(n);if(i<0||e<i)throw O("Wrong offset!");if(e<i+(r=void 0===r?e-i:h(r)))throw O("Wrong length!");this[T]=t,this[C]=i,this[L]=r},i&&(addGetter(w,j,"_l"),addGetter(_,"buffer","_b"),addGetter(_,j,"_l"),addGetter(_,R,"_o")),a(_[S],{getInt8:function getInt8(t){return get(this,1,t)[0]<<24>>24},getUint8:function getUint8(t){return get(this,1,t)[0]},getInt16:function getInt16(t){var n=get(this,2,t,arguments[1]);return(n[1]<<8|n[0])<<16>>16},getUint16:function getUint16(t){var n=get(this,2,t,arguments[1]);return n[1]<<8|n[0]},getInt32:function getInt32(t){return unpackI32(get(this,4,t,arguments[1]))},getUint32:function getUint32(t){return unpackI32(get(this,4,t,arguments[1]))>>>0},getFloat32:function getFloat32(t){return unpackIEEE754(get(this,4,t,arguments[1]),23,4)},getFloat64:function getFloat64(t){return unpackIEEE754(get(this,8,t,arguments[1]),52,8)},setInt8:function setInt8(t,n){set(this,1,t,packI8,n)},setUint8:function setUint8(t,n){set(this,1,t,packI8,n)},setInt16:function setInt16(t,n){set(this,2,t,packI16,n,arguments[2])},setUint16:function setUint16(t,n){set(this,2,t,packI16,n,arguments[2])},setInt32:function setInt32(t,n){set(this,4,t,packI32,n,arguments[2])},setUint32:function setUint32(t,n){set(this,4,t,packI32,n,arguments[2])},setFloat32:function setFloat32(t,n){set(this,4,t,packF32,n,arguments[2])},setFloat64:function setFloat64(t,n){set(this,8,t,packF64,n,arguments[2])}});d(w,x),d(_,m),c(_[S],u.VIEW,!0),r[x]=w,r[m]=_},{103:103,117:117,124:124,138:138,139:139,141:141,146:146,37:37,40:40,58:58,64:64,70:70,72:72,89:89,99:99}],146:[function(t,n,r){for(var e,i=t(70),o=t(72),u=t(147),c=u("typed_array"),a=u("view"),f=!(!i.ArrayBuffer||!i.DataView),s=f,l=0,h="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");l<9;)(e=i[h[l++]])?(o(e.prototype,c,!0),o(e.prototype,a,!0)):s=!1;n.exports={ABV:f,CONSTR:s,TYPED:c,VIEW:a}},{147:147,70:70,72:72}],147:[function(t,n,r){var e=0,i=Math.random();n.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+i).toString(36))}},{}],148:[function(t,n,r){var e=t(70).navigator;n.exports=e&&e.userAgent||""},{70:70}],149:[function(t,n,r){var e=t(81);n.exports=function(t,n){if(!e(t)||t._t!==n)throw TypeError("Incompatible receiver, "+n+" required!");return t}},{81:81}],150:[function(t,n,r){var e=t(70),i=t(52),o=t(89),u=t(151),c=t(99).f;n.exports=function(t){var n=i.Symbol||(i.Symbol=o?{}:e.Symbol||{});"_"==t.charAt(0)||t in n||c(n,t,{value:u.f(t)})}},{151:151,52:52,70:70,89:89,99:99}],151:[function(t,n,r){r.f=t(152)},{152:152}],152:[function(t,n,r){var e=t(126)("wks"),i=t(147),o=t(70).Symbol,u="function"==typeof o;(n.exports=function(t){return e[t]||(e[t]=u&&o[t]||(u?o:i)("Symbol."+t))}).store=e},{126:126,147:147,70:70}],153:[function(t,n,r){var e=t(47),i=t(152)("iterator"),o=t(88);n.exports=t(52).getIteratorMethod=function(t){if(null!=t)return t[i]||t["@@iterator"]||o[e(t)]}},{152:152,47:47,52:52,88:88}],154:[function(t,n,r){var e=t(62);e(e.P,"Array",{copyWithin:t(39)}),t(35)("copyWithin")},{35:35,39:39,62:62}],155:[function(t,n,r){"use strict";var e=t(62),i=t(42)(4);e(e.P+e.F*!t(128)([].every,!0),"Array",{every:function every(t){return i(this,t,arguments[1])}})},{128:128,42:42,62:62}],156:[function(t,n,r){var e=t(62);e(e.P,"Array",{fill:t(40)}),t(35)("fill")},{35:35,40:40,62:62}],157:[function(t,n,r){"use strict";var e=t(62),i=t(42)(2);e(e.P+e.F*!t(128)([].filter,!0),"Array",{filter:function filter(t){return i(this,t,arguments[1])}})},{128:128,42:42,62:62}],158:[function(t,n,r){"use strict";var e=t(62),i=t(42)(6),o="findIndex",u=!0;o in[]&&Array(1)[o](function(){u=!1}),e(e.P+e.F*u,"Array",{findIndex:function findIndex(t){return i(this,t,1<arguments.length?arguments[1]:void 0)}}),t(35)(o)},{35:35,42:42,62:62}],159:[function(t,n,r){"use strict";var e=t(62),i=t(42)(5),o="find",u=!0;o in[]&&Array(1)[o](function(){u=!1}),e(e.P+e.F*u,"Array",{find:function find(t){return i(this,t,1<arguments.length?arguments[1]:void 0)}}),t(35)(o)},{35:35,42:42,62:62}],160:[function(t,n,r){"use strict";var e=t(62),i=t(42)(0),o=t(128)([].forEach,!0);e(e.P+e.F*!o,"Array",{forEach:function forEach(t){return i(this,t,arguments[1])}})},{128:128,42:42,62:62}],161:[function(t,n,r){"use strict";var h=t(54),e=t(62),p=t(142),v=t(83),g=t(78),y=t(141),d=t(53),x=t(153);e(e.S+e.F*!t(86)(function(t){Array.from(t)}),"Array",{from:function from(t){var n,r,e,i,o=p(t),u="function"==typeof this?this:Array,c=arguments.length,a=1<c?arguments[1]:void 0,f=void 0!==a,s=0,l=x(o);if(f&&(a=h(a,2<c?arguments[2]:void 0,2)),null==l||u==Array&&g(l))for(r=new u(n=y(o.length));s<n;s++)d(r,s,f?a(o[s],s):o[s]);else for(i=l.call(o),r=new u;!(e=i.next()).done;s++)d(r,s,f?v(i,a,[e.value,s],!0):e.value);return r.length=s,r}})},{141:141,142:142,153:153,53:53,54:54,62:62,78:78,83:83,86:86}],162:[function(t,n,r){"use strict";var e=t(62),i=t(41)(!1),o=[].indexOf,u=!!o&&1/[1].indexOf(1,-0)<0;e(e.P+e.F*(u||!t(128)(o)),"Array",{indexOf:function indexOf(t){return u?o.apply(this,arguments)||0:i(this,t,arguments[1])}})},{128:128,41:41,62:62}],163:[function(t,n,r){var e=t(62);e(e.S,"Array",{isArray:t(79)})},{62:62,79:79}],164:[function(t,n,r){"use strict";var e=t(35),i=t(87),o=t(88),u=t(140);n.exports=t(85)(Array,"Array",function(t,n){this._t=u(t),this._i=0,this._k=n},function(){var t=this._t,n=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,i(1)):i(0,"keys"==n?r:"values"==n?t[r]:[r,t[r]])},"values"),o.Arguments=o.Array,e("keys"),e("values"),e("entries")},{140:140,35:35,85:85,87:87,88:88}],165:[function(t,n,r){"use strict";var e=t(62),i=t(140),o=[].join;e(e.P+e.F*(t(77)!=Object||!t(128)(o)),"Array",{join:function join(t){return o.call(i(this),void 0===t?",":t)}})},{128:128,140:140,62:62,77:77}],166:[function(t,n,r){"use strict";var e=t(62),i=t(140),o=t(139),u=t(141),c=[].lastIndexOf,a=!!c&&1/[1].lastIndexOf(1,-0)<0;e(e.P+e.F*(a||!t(128)(c)),"Array",{lastIndexOf:function lastIndexOf(t){if(a)return c.apply(this,arguments)||0;var n=i(this),r=u(n.length),e=r-1;for(1<arguments.length&&(e=Math.min(e,o(arguments[1]))),e<0&&(e=r+e);0<=e;e--)if(e in n&&n[e]===t)return e||0;return-1}})},{128:128,139:139,140:140,141:141,62:62}],167:[function(t,n,r){"use strict";var e=t(62),i=t(42)(1);e(e.P+e.F*!t(128)([].map,!0),"Array",{map:function map(t){return i(this,t,arguments[1])}})},{128:128,42:42,62:62}],168:[function(t,n,r){"use strict";var e=t(62),i=t(53);e(e.S+e.F*t(64)(function(){function F(){}return!(Array.of.call(F)instanceof F)}),"Array",{of:function of(){for(var t=0,n=arguments.length,r=new("function"==typeof this?this:Array)(n);t<n;)i(r,t,arguments[t++]);return r.length=n,r}})},{53:53,62:62,64:64}],169:[function(t,n,r){"use strict";var e=t(62),i=t(43);e(e.P+e.F*!t(128)([].reduceRight,!0),"Array",{reduceRight:function reduceRight(t){return i(this,t,arguments.length,arguments[1],!0)}})},{128:128,43:43,62:62}],170:[function(t,n,r){"use strict";var e=t(62),i=t(43);e(e.P+e.F*!t(128)([].reduce,!0),"Array",{reduce:function reduce(t){return i(this,t,arguments.length,arguments[1],!1)}})},{128:128,43:43,62:62}],171:[function(t,n,r){"use strict";var e=t(62),i=t(73),f=t(48),s=t(137),l=t(141),h=[].slice;e(e.P+e.F*t(64)(function(){i&&h.call(i)}),"Array",{slice:function slice(t,n){var r=l(this.length),e=f(this);if(n=void 0===n?r:n,"Array"==e)return h.call(this,t,n);for(var i=s(t,r),o=s(n,r),u=l(o-i),c=new Array(u),a=0;a<u;a++)c[a]="String"==e?this.charAt(i+a):this[i+a];return c}})},{137:137,141:141,48:48,62:62,64:64,73:73}],172:[function(t,n,r){"use strict";var e=t(62),i=t(42)(3);e(e.P+e.F*!t(128)([].some,!0),"Array",{some:function some(t){return i(this,t,arguments[1])}})},{128:128,42:42,62:62}],173:[function(t,n,r){"use strict";var e=t(62),i=t(33),o=t(142),u=t(64),c=[].sort,a=[1,2,3];e(e.P+e.F*(u(function(){a.sort(void 0)})||!u(function(){a.sort(null)})||!t(128)(c)),"Array",{sort:function sort(t){return void 0===t?c.call(o(this)):c.call(o(this),i(t))}})},{128:128,142:142,33:33,62:62,64:64}],174:[function(t,n,r){t(123)("Array")},{123:123}],175:[function(t,n,r){var e=t(62);e(e.S,"Date",{now:function(){return(new Date).getTime()}})},{62:62}],176:[function(t,n,r){var e=t(62),i=t(55);e(e.P+e.F*(Date.prototype.toISOString!==i),"Date",{toISOString:i})},{55:55,62:62}],177:[function(t,n,r){"use strict";var e=t(62),i=t(142),o=t(143);e(e.P+e.F*t(64)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function toJSON(t){var n=i(this),r=o(n);return"number"!=typeof r||isFinite(r)?n.toISOString():null}})},{142:142,143:143,62:62,64:64}],178:[function(t,n,r){var e=t(152)("toPrimitive"),i=Date.prototype;e in i||t(72)(i,e,t(56))},{152:152,56:56,72:72}],179:[function(t,n,r){var e=Date.prototype,i="Invalid Date",o="toString",u=e[o],c=e.getTime;new Date(NaN)+""!=i&&t(118)(e,o,function toString(){var t=c.call(this);return t==t?u.call(this):i})},{118:118}],180:[function(t,n,r){var e=t(62);e(e.P,"Function",{bind:t(46)})},{46:46,62:62}],181:[function(t,n,r){"use strict";var e=t(81),i=t(105),o=t(152)("hasInstance"),u=Function.prototype;o in u||t(99).f(u,o,{value:function(t){if("function"!=typeof this||!e(t))return!1;if(!e(this.prototype))return t instanceof this;for(;t=i(t);)if(this.prototype===t)return!0;return!1}})},{105:105,152:152,81:81,99:99}],182:[function(t,n,r){var e=t(99).f,i=Function.prototype,o=/^\s*function ([^ (]*)/;"name"in i||t(58)&&e(i,"name",{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(t){return""}}})},{58:58,99:99}],183:[function(t,n,r){"use strict";var e=t(49),i=t(149);n.exports=t(51)("Map",function(t){return function Map(){return t(this,0<arguments.length?arguments[0]:void 0)}},{get:function get(t){var n=e.getEntry(i(this,"Map"),t);return n&&n.v},set:function set(t,n){return e.def(i(this,"Map"),0===t?0:t,n)}},e,!0)},{149:149,49:49,51:51}],184:[function(t,n,r){var e=t(62),i=t(92),o=Math.sqrt,u=Math.acosh;e(e.S+e.F*!(u&&710==Math.floor(u(Number.MAX_VALUE))&&u(1/0)==1/0),"Math",{acosh:function acosh(t){return(t=+t)<1?NaN:94906265.62425156<t?Math.log(t)+Math.LN2:i(t-1+o(t-1)*o(t+1))}})},{62:62,92:92}],185:[function(t,n,r){var e=t(62),i=Math.asinh;e(e.S+e.F*!(i&&0<1/i(0)),"Math",{asinh:function asinh(t){return isFinite(t=+t)&&0!=t?t<0?-asinh(-t):Math.log(t+Math.sqrt(t*t+1)):t}})},{62:62}],186:[function(t,n,r){var e=t(62),i=Math.atanh;e(e.S+e.F*!(i&&1/i(-0)<0),"Math",{atanh:function atanh(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},{62:62}],187:[function(t,n,r){var e=t(62),i=t(93);e(e.S,"Math",{cbrt:function cbrt(t){return i(t=+t)*Math.pow(Math.abs(t),1/3)}})},{62:62,93:93}],188:[function(t,n,r){var e=t(62);e(e.S,"Math",{clz32:function clz32(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},{62:62}],189:[function(t,n,r){var e=t(62),i=Math.exp;e(e.S,"Math",{cosh:function cosh(t){return(i(t=+t)+i(-t))/2}})},{62:62}],190:[function(t,n,r){var e=t(62),i=t(90);e(e.S+e.F*(i!=Math.expm1),"Math",{expm1:i})},{62:62,90:90}],191:[function(t,n,r){var e=t(62);e(e.S,"Math",{fround:t(91)})},{62:62,91:91}],192:[function(t,n,r){var e=t(62),a=Math.abs;e(e.S,"Math",{hypot:function hypot(t,n){for(var r,e,i=0,o=0,u=arguments.length,c=0;o<u;)c<(r=a(arguments[o++]))?(i=i*(e=c/r)*e+1,c=r):i+=0<r?(e=r/c)*e:r;return c===1/0?1/0:c*Math.sqrt(i)}})},{62:62}],193:[function(t,n,r){var e=t(62),i=Math.imul;e(e.S+e.F*t(64)(function(){return-5!=i(4294967295,5)||2!=i.length}),"Math",{imul:function imul(t,n){var r=65535,e=+t,i=+n,o=r&e,u=r&i;return 0|o*u+((r&e>>>16)*u+o*(r&i>>>16)<<16>>>0)}})},{62:62,64:64}],194:[function(t,n,r){var e=t(62);e(e.S,"Math",{log10:function log10(t){return Math.log(t)*Math.LOG10E}})},{62:62}],195:[function(t,n,r){var e=t(62);e(e.S,"Math",{log1p:t(92)})},{62:62,92:92}],196:[function(t,n,r){var e=t(62);e(e.S,"Math",{log2:function log2(t){return Math.log(t)/Math.LN2}})},{62:62}],197:[function(t,n,r){var e=t(62);e(e.S,"Math",{sign:t(93)})},{62:62,93:93}],198:[function(t,n,r){var e=t(62),i=t(90),o=Math.exp;e(e.S+e.F*t(64)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function sinh(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},{62:62,64:64,90:90}],199:[function(t,n,r){var e=t(62),i=t(90),o=Math.exp;e(e.S,"Math",{tanh:function tanh(t){var n=i(t=+t),r=i(-t);return n==1/0?1:r==1/0?-1:(n-r)/(o(t)+o(-t))}})},{62:62,90:90}],200:[function(t,n,r){var e=t(62);e(e.S,"Math",{trunc:function trunc(t){return(0<t?Math.floor:Math.ceil)(t)}})},{62:62}],201:[function(t,n,r){"use strict";function EN(t){var n=s(t,!1);if("string"==typeof n&&2<n.length){var r,e,i,o=(n=x?n.trim():h(n,3)).charCodeAt(0);if(43===o||45===o){if(88===(r=n.charCodeAt(2))||120===r)return NaN}else if(48===o){switch(n.charCodeAt(1)){case 66:case 98:e=2,i=49;break;case 79:case 111:e=8,i=55;break;default:return+n}for(var u,c=n.slice(2),a=0,f=c.length;a<f;a++)if((u=c.charCodeAt(a))<48||i<u)return NaN;return parseInt(c,e)}}return+n}var e=t(70),i=t(71),o=t(48),u=t(75),s=t(143),c=t(64),a=t(103).f,f=t(101).f,l=t(99).f,h=t(134).trim,p="Number",v=e[p],g=v,y=v.prototype,d=o(t(98)(y))==p,x="trim"in String.prototype;if(!v(" 0o1")||!v("0b1")||v("+0x1")){v=function Number(t){var n=arguments.length<1?0:t,r=this;return r instanceof v&&(d?c(function(){y.valueOf.call(r)}):o(r)!=p)?u(new g(EN(n)),r,v):EN(n)};for(var m,S=t(58)?a(g):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),b=0;S.length>b;b++)i(g,m=S[b])&&!i(v,m)&&l(v,m,f(g,m));(v.prototype=y).constructor=v,t(118)(e,p,v)}},{101:101,103:103,118:118,134:134,143:143,48:48,58:58,64:64,70:70,71:71,75:75,98:98,99:99}],202:[function(t,n,r){var e=t(62);e(e.S,"Number",{EPSILON:Math.pow(2,-52)})},{62:62}],203:[function(t,n,r){var e=t(62),i=t(70).isFinite;e(e.S,"Number",{isFinite:function isFinite(t){return"number"==typeof t&&i(t)}})},{62:62,70:70}],204:[function(t,n,r){var e=t(62);e(e.S,"Number",{isInteger:t(80)})},{62:62,80:80}],205:[function(t,n,r){var e=t(62);e(e.S,"Number",{isNaN:function isNaN(t){return t!=t}})},{62:62}],206:[function(t,n,r){var e=t(62),i=t(80),o=Math.abs;e(e.S,"Number",{isSafeInteger:function isSafeInteger(t){return i(t)&&o(t)<=9007199254740991}})},{62:62,80:80}],207:[function(t,n,r){var e=t(62);e(e.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},{62:62}],208:[function(t,n,r){var e=t(62);e(e.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},{62:62}],209:[function(t,n,r){var e=t(62),i=t(112);e(e.S+e.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},{112:112,62:62}],210:[function(t,n,r){var e=t(62),i=t(113);e(e.S+e.F*(Number.parseInt!=i),"Number",{parseInt:i})},{113:113,62:62}],211:[function(t,n,r){"use strict";function XO(t,n){for(var r=-1,e=n;++r<6;)e+=t*u[r],u[r]=e%1e7,e=o(e/1e7)}function YO(t){for(var n=6,r=0;0<=--n;)r+=u[n],u[n]=o(r/t),r=r%t*1e7}function ZO(){for(var t=6,n="";0<=--t;)if(""!==n||0===t||0!==u[t]){var r=String(u[t]);n=""===n?r:n+l.call("0",7-r.length)+r}return n}var e=t(62),f=t(139),s=t(34),l=t(133),i=1..toFixed,o=Math.floor,u=[0,0,0,0,0,0],h="Number.toFixed: incorrect invocation!",p=function(t,n,r){return 0===n?r:n%2==1?p(t,n-1,r*t):p(t*t,n/2,r)};e(e.P+e.F*(!!i&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!t(64)(function(){i.call({})})),"Number",{toFixed:function toFixed(t){var n,r,e,i,o=s(this,h),u=f(t),c="",a="0";if(u<0||20<u)throw RangeError(h);if(o!=o)return"NaN";if(o<=-1e21||1e21<=o)return String(o);if(o<0&&(c="-",o=-o),1e-21<o)if(r=(n=function(t){for(var n=0,r=t;4096<=r;)n+=12,r/=4096;for(;2<=r;)n+=1,r/=2;return n}(o*p(2,69,1))-69)<0?o*p(2,-n,1):o/p(2,n,1),r*=4503599627370496,0<(n=52-n)){for(XO(0,r),e=u;7<=e;)XO(1e7,0),e-=7;for(XO(p(10,e,1),0),e=n-1;23<=e;)YO(1<<23),e-=23;YO(1<<e),XO(1,1),YO(2),a=ZO()}else XO(0,r),XO(1<<-n,0),a=ZO()+l.call("0",u);return a=0<u?c+((i=a.length)<=u?"0."+l.call("0",u-i)+a:a.slice(0,i-u)+"."+a.slice(i-u)):c+a}})},{133:133,139:139,34:34,62:62,64:64}],212:[function(t,n,r){"use strict";var e=t(62),i=t(64),o=t(34),u=1..toPrecision;e(e.P+e.F*(i(function(){return"1"!==u.call(1,void 0)})||!i(function(){u.call({})})),"Number",{toPrecision:function toPrecision(t){var n=o(this,"Number#toPrecision: incorrect invocation!");return void 0===t?u.call(n):u.call(n,t)}})},{34:34,62:62,64:64}],213:[function(t,n,r){var e=t(62);e(e.S+e.F,"Object",{assign:t(97)})},{62:62,97:97}],214:[function(t,n,r){var e=t(62);e(e.S,"Object",{create:t(98)})},{62:62,98:98}],215:[function(t,n,r){var e=t(62);e(e.S+e.F*!t(58),"Object",{defineProperties:t(100)})},{100:100,58:58,62:62}],216:[function(t,n,r){var e=t(62);e(e.S+e.F*!t(58),"Object",{defineProperty:t(99).f})},{58:58,62:62,99:99}],217:[function(t,n,r){var e=t(81),i=t(94).onFreeze;t(109)("freeze",function(n){return function freeze(t){return n&&e(t)?n(i(t)):t}})},{109:109,81:81,94:94}],218:[function(t,n,r){var e=t(140),i=t(101).f;t(109)("getOwnPropertyDescriptor",function(){return function getOwnPropertyDescriptor(t,n){return i(e(t),n)}})},{101:101,109:109,140:140}],219:[function(t,n,r){t(109)("getOwnPropertyNames",function(){return t(102).f})},{102:102,109:109}],220:[function(t,n,r){var e=t(142),i=t(105);t(109)("getPrototypeOf",function(){return function getPrototypeOf(t){return i(e(t))}})},{105:105,109:109,142:142}],221:[function(t,n,r){var e=t(81);t(109)("isExtensible",function(n){return function isExtensible(t){return!!e(t)&&(!n||n(t))}})},{109:109,81:81}],222:[function(t,n,r){var e=t(81);t(109)("isFrozen",function(n){return function isFrozen(t){return!e(t)||!!n&&n(t)}})},{109:109,81:81}],223:[function(t,n,r){var e=t(81);t(109)("isSealed",function(n){return function isSealed(t){return!e(t)||!!n&&n(t)}})},{109:109,81:81}],224:[function(t,n,r){var e=t(62);e(e.S,"Object",{is:t(121)})},{121:121,62:62}],225:[function(t,n,r){var e=t(142),i=t(107);t(109)("keys",function(){return function keys(t){return i(e(t))}})},{107:107,109:109,142:142}],226:[function(t,n,r){var e=t(81),i=t(94).onFreeze;t(109)("preventExtensions",function(n){return function preventExtensions(t){return n&&e(t)?n(i(t)):t}})},{109:109,81:81,94:94}],227:[function(t,n,r){var e=t(81),i=t(94).onFreeze;t(109)("seal",function(n){return function seal(t){return n&&e(t)?n(i(t)):t}})},{109:109,81:81,94:94}],228:[function(t,n,r){var e=t(62);e(e.S,"Object",{setPrototypeOf:t(122).set})},{122:122,62:62}],229:[function(t,n,r){"use strict";var e=t(47),i={};i[t(152)("toStringTag")]="z",i+""!="[object z]"&&t(118)(Object.prototype,"toString",function toString(){return"[object "+e(this)+"]"},!0)},{118:118,152:152,47:47}],230:[function(t,n,r){var e=t(62),i=t(112);e(e.G+e.F*(parseFloat!=i),{parseFloat:i})},{112:112,62:62}],231:[function(t,n,r){var e=t(62),i=t(113);e(e.G+e.F*(parseInt!=i),{parseInt:i})},{113:113,62:62}],232:[function(r,t,n){"use strict";function $R(){}function fS(t){var n;return!(!h(t)||"function"!=typeof(n=t.then))&&n}function gS(s,r){if(!s._n){s._n=!0;var e=s._c;x(function(){for(var a=s._v,f=1==s._s,t=0,n=function(t){var n,r,e,i=f?t.ok:t.fail,o=t.resolve,u=t.reject,c=t.domain;try{i?(f||(2==s._h&&R(s),s._h=1),!0===i?n=a:(c&&c.enter(),n=i(a),c&&(c.exit(),e=!0)),n===t.promise?u(E("Promise-chain cycle")):(r=fS(n))?r.call(n,o,u):o(n)):u(a)}catch(t){c&&!e&&c.exit(),u(t)}};e.length>t;)n(e[t++]);s._c=[],s._n=!1,r&&!s._h&&N(s)})}}function kS(t){var n=this;n._d||(n._d=!0,(n=n._w||n)._v=t,n._s=2,n._a||(n._a=n._c.slice()),gS(n,!0))}var e,i,o,u,c=r(89),a=r(70),f=r(54),s=r(47),l=r(62),h=r(81),p=r(33),v=r(37),g=r(68),y=r(127),d=r(136).set,x=r(95)(),m=r(96),S=r(114),b=r(148),w=r(115),_="Promise",E=a.TypeError,O=a.process,F=O&&O.versions,I=F&&F.v8||"",P=a[_],A="process"==s(O),M=i=m.f,k=!!function(){try{var t=P.resolve(1),n=(t.constructor={})[r(152)("species")]=function(t){t($R,$R)};return(A||"function"==typeof PromiseRejectionEvent)&&t.then($R)instanceof n&&0!==I.indexOf("6.6")&&-1===b.indexOf("Chrome/66")}catch(t){}}(),N=function(o){d.call(a,function(){var t,n,r,e=o._v,i=j(o);if(i&&(t=S(function(){A?O.emit("unhandledRejection",e,o):(n=a.onunhandledrejection)?n({promise:o,reason:e}):(r=a.console)&&r.error&&r.error("Unhandled promise rejection",e)}),o._h=A||j(o)?2:1),o._a=void 0,i&&t.e)throw t.v})},j=function(t){return 1!==t._h&&0===(t._a||t._c).length},R=function(n){d.call(a,function(){var t;A?O.emit("rejectionHandled",n):(t=a.onrejectionhandled)&&t({promise:n,reason:n._v})})},T=function(t){var r,e=this;if(!e._d){e._d=!0,e=e._w||e;try{if(e===t)throw E("Promise can't be resolved itself");(r=fS(t))?x(function(){var n={_w:e,_d:!1};try{r.call(t,f(T,n,1),f(kS,n,1))}catch(t){kS.call(n,t)}}):(e._v=t,e._s=1,gS(e,!1))}catch(t){kS.call({_w:e,_d:!1},t)}}};k||(P=function Promise(t){v(this,P,_,"_h"),p(t),e.call(this);try{t(f(T,this,1),f(kS,this,1))}catch(t){kS.call(this,t)}},(e=function Promise(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=r(117)(P.prototype,{then:function then(t,n){var r=M(y(this,P));return r.ok="function"!=typeof t||t,r.fail="function"==typeof n&&n,r.domain=A?O.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&gS(this,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new e;this.promise=t,this.resolve=f(T,t,1),this.reject=f(kS,t,1)},m.f=M=function(t){return t===P||t===u?new o(t):i(t)}),l(l.G+l.W+l.F*!k,{Promise:P}),r(124)(P,_),r(123)(_),u=r(52)[_],l(l.S+l.F*!k,_,{reject:function reject(t){var n=M(this);return(0,n.reject)(t),n.promise}}),l(l.S+l.F*(c||!k),_,{resolve:function resolve(t){return w(c&&this===u?P:this,t)}}),l(l.S+l.F*!(k&&r(86)(function(t){P.all(t).catch($R)})),_,{all:function all(t){var u=this,n=M(u),c=n.resolve,a=n.reject,r=S(function(){var e=[],i=0,o=1;g(t,!1,function(t){var n=i++,r=!1;e.push(void 0),o++,u.resolve(t).then(function(t){r||(r=!0,e[n]=t,--o||c(e))},a)}),--o||c(e)});return r.e&&a(r.v),n.promise},race:function race(t){var n=this,r=M(n),e=r.reject,i=S(function(){g(t,!1,function(t){n.resolve(t).then(r.resolve,e)})});return i.e&&e(i.v),r.promise}})},{114:114,115:115,117:117,123:123,124:124,127:127,136:136,148:148,152:152,33:33,37:37,47:47,52:52,54:54,62:62,68:68,70:70,81:81,86:86,89:89,95:95,96:96}],233:[function(t,n,r){var e=t(62),o=t(33),u=t(38),c=(t(70).Reflect||{}).apply,a=Function.apply;e(e.S+e.F*!t(64)(function(){c(function(){})}),"Reflect",{apply:function apply(t,n,r){var e=o(t),i=u(r);return c?c(e,n,i):a.call(e,n,i)}})},{33:33,38:38,62:62,64:64,70:70}],234:[function(t,n,r){var e=t(62),c=t(98),a=t(33),f=t(38),s=t(81),i=t(64),l=t(46),h=(t(70).Reflect||{}).construct,p=i(function(){function F(){}return!(h(function(){},[],F)instanceof F)}),v=!i(function(){h(function(){})});e(e.S+e.F*(p||v),"Reflect",{construct:function construct(t,n){a(t),f(n);var r=arguments.length<3?t:a(arguments[2]);if(v&&!p)return h(t,n,r);if(t==r){switch(n.length){case 0:return new t;case 1:return new t(n[0]);case 2:return new t(n[0],n[1]);case 3:return new t(n[0],n[1],n[2]);case 4:return new t(n[0],n[1],n[2],n[3])}var e=[null];return e.push.apply(e,n),new(l.apply(t,e))}var i=r.prototype,o=c(s(i)?i:Object.prototype),u=Function.apply.call(t,o,n);return s(u)?u:o}})},{33:33,38:38,46:46,62:62,64:64,70:70,81:81,98:98}],235:[function(t,n,r){var e=t(99),i=t(62),o=t(38),u=t(143);i(i.S+i.F*t(64)(function(){Reflect.defineProperty(e.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function defineProperty(t,n,r){o(t),n=u(n,!0),o(r);try{return e.f(t,n,r),!0}catch(t){return!1}}})},{143:143,38:38,62:62,64:64,99:99}],236:[function(t,n,r){var e=t(62),i=t(101).f,o=t(38);e(e.S,"Reflect",{deleteProperty:function deleteProperty(t,n){var r=i(o(t),n);return!(r&&!r.configurable)&&delete t[n]}})},{101:101,38:38,62:62}],237:[function(t,n,r){"use strict";function IU(t){this._t=i(t),this._i=0;var n,r=this._k=[];for(n in t)r.push(n)}var e=t(62),i=t(38);t(84)(IU,"Object",function(){var t,n=this._k;do{if(this._i>=n.length)return{value:void 0,done:!0}}while(!((t=n[this._i++])in this._t));return{value:t,done:!1}}),e(e.S,"Reflect",{enumerate:function enumerate(t){return new IU(t)}})},{38:38,62:62,84:84}],238:[function(t,n,r){var e=t(101),i=t(62),o=t(38);i(i.S,"Reflect",{getOwnPropertyDescriptor:function getOwnPropertyDescriptor(t,n){return e.f(o(t),n)}})},{101:101,38:38,62:62}],239:[function(t,n,r){var e=t(62),i=t(105),o=t(38);e(e.S,"Reflect",{getPrototypeOf:function getPrototypeOf(t){return i(o(t))}})},{105:105,38:38,62:62}],240:[function(t,n,r){var o=t(101),u=t(105),c=t(71),e=t(62),a=t(81),f=t(38);e(e.S,"Reflect",{get:function get(t,n){var r,e,i=arguments.length<3?t:arguments[2];return f(t)===i?t[n]:(r=o.f(t,n))?c(r,"value")?r.value:void 0!==r.get?r.get.call(i):void 0:a(e=u(t))?get(e,n,i):void 0}})},{101:101,105:105,38:38,62:62,71:71,81:81}],241:[function(t,n,r){var e=t(62);e(e.S,"Reflect",{has:function has(t,n){return n in t}})},{62:62}],242:[function(t,n,r){var e=t(62),i=t(38),o=Object.isExtensible;e(e.S,"Reflect",{isExtensible:function isExtensible(t){return i(t),!o||o(t)}})},{38:38,62:62}],243:[function(t,n,r){var e=t(62);e(e.S,"Reflect",{ownKeys:t(111)})},{111:111,62:62}],244:[function(t,n,r){var e=t(62),i=t(38),o=Object.preventExtensions;e(e.S,"Reflect",{preventExtensions:function preventExtensions(t){i(t);try{return o&&o(t),!0}catch(t){return!1}}})},{38:38,62:62}],245:[function(t,n,r){var e=t(62),i=t(122);i&&e(e.S,"Reflect",{setPrototypeOf:function setPrototypeOf(t,n){i.check(t,n);try{return i.set(t,n),!0}catch(t){return!1}}})},{122:122,62:62}],246:[function(t,n,r){var c=t(99),a=t(101),f=t(105),s=t(71),e=t(62),l=t(116),h=t(38),p=t(81);e(e.S,"Reflect",{set:function set(t,n,r){var e,i,o=arguments.length<4?t:arguments[3],u=a.f(h(t),n);if(!u){if(p(i=f(t)))return set(i,n,r,o);u=l(0)}if(s(u,"value")){if(!1===u.writable||!p(o))return!1;if(e=a.f(o,n)){if(e.get||e.set||!1===e.writable)return!1;e.value=r,c.f(o,n,e)}else c.f(o,n,l(0,r));return!0}return void 0!==u.set&&(u.set.call(o,r),!0)}})},{101:101,105:105,116:116,38:38,62:62,71:71,81:81,99:99}],247:[function(t,n,r){var e=t(70),o=t(75),i=t(99).f,u=t(103).f,c=t(82),a=t(66),f=e.RegExp,s=f,l=f.prototype,h=/a/g,p=/a/g,v=new f(h)!==h;if(t(58)&&(!v||t(64)(function(){return p[t(152)("match")]=!1,f(h)!=h||f(p)==p||"/a/i"!=f(h,"i")}))){f=function RegExp(t,n){var r=this instanceof f,e=c(t),i=void 0===n;return!r&&e&&t.constructor===f&&i?t:o(v?new s(e&&!i?t.source:t,n):s((e=t instanceof f)?t.source:t,e&&i?a.call(t):n),r?this:l,f)};function DW(n){n in f||i(f,n,{configurable:!0,get:function(){return s[n]},set:function(t){s[n]=t}})}for(var g=u(s),y=0;g.length>y;)DW(g[y++]);(l.constructor=f).prototype=l,t(118)(e,"RegExp",f)}t(123)("RegExp")},{103:103,118:118,123:123,152:152,58:58,64:64,66:66,70:70,75:75,82:82,99:99}],248:[function(t,n,r){"use strict";var e=t(120);t(62)({target:"RegExp",proto:!0,forced:e!==/./.exec},{exec:e})},{120:120,62:62}],249:[function(t,n,r){t(58)&&"g"!=/./g.flags&&t(99).f(RegExp.prototype,"flags",{configurable:!0,get:t(66)})},{58:58,66:66,99:99}],250:[function(t,n,r){"use strict";var l=t(38),h=t(141),p=t(36),v=t(119);t(65)("match",1,function(e,i,f,s){return[function match(t){var n=e(this),r=null==t?void 0:t[i];return void 0!==r?r.call(t,n):new RegExp(t)[i](String(n))},function(t){var n=s(f,t,this);if(n.done)return n.value;var r=l(t),e=String(this);if(!r.global)return v(r,e);for(var i,o=r.unicode,u=[],c=r.lastIndex=0;null!==(i=v(r,e));){var a=String(i[0]);""===(u[c]=a)&&(r.lastIndex=p(e,h(r.lastIndex),o)),c++}return 0===c?null:u}]})},{119:119,141:141,36:36,38:38,65:65}],251:[function(t,n,r){"use strict";var _=t(38),e=t(142),E=t(141),O=t(139),F=t(36),I=t(119),P=Math.max,A=Math.min,h=Math.floor,p=/\$([$&`']|\d\d?|<[^>]*>)/g,v=/\$([$&`']|\d\d?)/g;t(65)("replace",2,function(i,o,b,w){return[function replace(t,n){var r=i(this),e=null==t?void 0:t[o];return void 0!==e?e.call(t,r,n):b.call(String(r),t,n)},function(t,n){var r=w(b,t,this,n);if(r.done)return r.value;var e=_(t),i=String(this),o="function"==typeof n;o||(n=String(n));var u=e.global;if(u){var c=e.unicode;e.lastIndex=0}for(var a=[];;){var f=I(e,i);if(null===f)break;if(a.push(f),!u)break;""===String(f[0])&&(e.lastIndex=F(i,E(e.lastIndex),c))}for(var s,l="",h=0,p=0;p<a.length;p++){f=a[p];for(var v=String(f[0]),g=P(A(O(f.index),i.length),0),y=[],d=1;d<f.length;d++)y.push(void 0===(s=f[d])?s:String(s));var x=f.groups;if(o){var m=[v].concat(y,g,i);void 0!==x&&m.push(x);var S=String(n.apply(void 0,m))}else S=getSubstitution(v,i,g,y,x,n);h<=g&&(l+=i.slice(h,g)+S,h=g+v.length)}return l+i.slice(h)}];function getSubstitution(o,u,c,a,f,t){var s=c+o.length,l=a.length,n=v;return void 0!==f&&(f=e(f),n=p),b.call(t,n,function(t,n){var r;switch(n.charAt(0)){case"$":return"$";case"&":return o;case"`":return u.slice(0,c);case"'":return u.slice(s);case"<":r=f[n.slice(1,-1)];break;default:var e=+n;if(0==e)return t;if(l<e){var i=h(e/10);return 0===i?t:i<=l?void 0===a[i-1]?n.charAt(1):a[i-1]+n.charAt(1):t}r=a[e-1]}return void 0===r?"":r})}})},{119:119,139:139,141:141,142:142,36:36,38:38,65:65}],252:[function(t,n,r){"use strict";var a=t(38),f=t(121),s=t(119);t(65)("search",1,function(e,i,u,c){return[function search(t){var n=e(this),r=null==t?void 0:t[i];return void 0!==r?r.call(t,n):new RegExp(t)[i](String(n))},function(t){var n=c(u,t,this);if(n.done)return n.value;var r=a(t),e=String(this),i=r.lastIndex;f(i,0)||(r.lastIndex=0);var o=s(r,e);return f(r.lastIndex,i)||(r.lastIndex=i),null===o?-1:o.index}]})},{119:119,121:121,38:38,65:65}],253:[function(t,n,r){"use strict";var l=t(82),m=t(38),S=t(127),b=t(36),w=t(141),_=t(119),h=t(120),e=t(64),E=Math.min,p=[].push,u="split",v="length",g="lastIndex",O=4294967295,F=!e(function(){RegExp(O,"y")});t(65)("split",2,function(i,o,y,d){var x;return x="c"=="abbc"[u](/(b)*/)[1]||4!="test"[u](/(?:)/,-1)[v]||2!="ab"[u](/(?:ab)*/)[v]||4!="."[u](/(.?)(.?)/)[v]||1<"."[u](/()()/)[v]||""[u](/.?/)[v]?function(t,n){var r=String(this);if(void 0===t&&0===n)return[];if(!l(t))return y.call(r,t,n);for(var e,i,o,u=[],c=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),a=0,f=void 0===n?O:n>>>0,s=new RegExp(t.source,c+"g");(e=h.call(s,r))&&!(a<(i=s[g])&&(u.push(r.slice(a,e.index)),1<e[v]&&e.index<r[v]&&p.apply(u,e.slice(1)),o=e[0][v],a=i,u[v]>=f));)s[g]===e.index&&s[g]++;return a===r[v]?!o&&s.test("")||u.push(""):u.push(r.slice(a)),u[v]>f?u.slice(0,f):u}:"0"[u](void 0,0)[v]?function(t,n){return void 0===t&&0===n?[]:y.call(this,t,n)}:y,[function split(t,n){var r=i(this),e=null==t?void 0:t[o];return void 0!==e?e.call(t,r,n):x.call(String(r),t,n)},function(t,n){var r=d(x,t,this,n,x!==y);if(r.done)return r.value;var e=m(t),i=String(this),o=S(e,RegExp),u=e.unicode,c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(F?"y":"g"),a=new o(F?e:"^(?:"+e.source+")",c),f=void 0===n?O:n>>>0;if(0==f)return[];if(0===i.length)return null===_(a,i)?[i]:[];for(var s=0,l=0,h=[];l<i.length;){a.lastIndex=F?l:0;var p,v=_(a,F?i:i.slice(l));if(null===v||(p=E(w(a.lastIndex+(F?0:l)),i.length))===s)l=b(i,l,u);else{if(h.push(i.slice(s,l)),h.length===f)return h;for(var g=1;g<=v.length-1;g++)if(h.push(v[g]),h.length===f)return h;l=s=p}}return h.push(i.slice(s)),h}]})},{119:119,120:120,127:127,141:141,36:36,38:38,64:64,65:65,82:82}],254:[function(n,t,r){"use strict";n(249);function XZ(t){n(118)(RegExp.prototype,u,t,!0)}var e=n(38),i=n(66),o=n(58),u="toString",c=/./[u];n(64)(function(){return"/a/b"!=c.call({source:"a",flags:"b"})})?XZ(function toString(){var t=e(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?i.call(t):void 0)}):c.name!=u&&XZ(function toString(){return c.call(this)})},{118:118,249:249,38:38,58:58,64:64,66:66}],255:[function(t,n,r){"use strict";var e=t(49),i=t(149);n.exports=t(51)("Set",function(t){return function Set(){return t(this,0<arguments.length?arguments[0]:void 0)}},{add:function add(t){return e.def(i(this,"Set"),t=0===t?0:t,t)}},e)},{149:149,49:49,51:51}],256:[function(t,n,r){"use strict";t(131)("anchor",function(n){return function anchor(t){return n(this,"a","name",t)}})},{131:131}],257:[function(t,n,r){"use strict";t(131)("big",function(t){return function big(){return t(this,"big","","")}})},{131:131}],258:[function(t,n,r){"use strict";t(131)("blink",function(t){return function blink(){return t(this,"blink","","")}})},{131:131}],259:[function(t,n,r){"use strict";t(131)("bold",function(t){return function bold(){return t(this,"b","","")}})},{131:131}],260:[function(t,n,r){"use strict";var e=t(62),i=t(129)(!1);e(e.P,"String",{codePointAt:function codePointAt(t){return i(this,t)}})},{129:129,62:62}],261:[function(t,n,r){"use strict";var e=t(62),u=t(141),c=t(130),a="endsWith",f=""[a];e(e.P+e.F*t(63)(a),"String",{endsWith:function endsWith(t){var n=c(this,t,a),r=1<arguments.length?arguments[1]:void 0,e=u(n.length),i=void 0===r?e:Math.min(u(r),e),o=String(t);return f?f.call(n,o,i):n.slice(i-o.length,i)===o}})},{130:130,141:141,62:62,63:63}],262:[function(t,n,r){"use strict";t(131)("fixed",function(t){return function fixed(){return t(this,"tt","","")}})},{131:131}],263:[function(t,n,r){"use strict";t(131)("fontcolor",function(n){return function fontcolor(t){return n(this,"font","color",t)}})},{131:131}],264:[function(t,n,r){"use strict";t(131)("fontsize",function(n){return function fontsize(t){return n(this,"font","size",t)}})},{131:131}],265:[function(t,n,r){var e=t(62),o=t(137),u=String.fromCharCode,i=String.fromCodePoint;e(e.S+e.F*(!!i&&1!=i.length),"String",{fromCodePoint:function fromCodePoint(t){for(var n,r=[],e=arguments.length,i=0;i<e;){if(n=+arguments[i++],o(n,1114111)!==n)throw RangeError(n+" is not a valid code point");r.push(n<65536?u(n):u(55296+((n-=65536)>>10),n%1024+56320))}return r.join("")}})},{137:137,62:62}],266:[function(t,n,r){"use strict";var e=t(62),i=t(130),o="includes";e(e.P+e.F*t(63)(o),"String",{includes:function includes(t){return!!~i(this,t,o).indexOf(t,1<arguments.length?arguments[1]:void 0)}})},{130:130,62:62,63:63}],267:[function(t,n,r){"use strict";t(131)("italics",function(t){return function italics(){return t(this,"i","","")}})},{131:131}],268:[function(t,n,r){"use strict";var e=t(129)(!0);t(85)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,n=this._t,r=this._i;return r>=n.length?{value:void 0,done:!0}:(t=e(n,r),this._i+=t.length,{value:t,done:!1})})},{129:129,85:85}],269:[function(t,n,r){"use strict";t(131)("link",function(n){return function link(t){return n(this,"a","href",t)}})},{131:131}],270:[function(t,n,r){var e=t(62),u=t(140),c=t(141);e(e.S,"String",{raw:function raw(t){for(var n=u(t.raw),r=c(n.length),e=arguments.length,i=[],o=0;o<r;)i.push(String(n[o++])),o<e&&i.push(String(arguments[o]));return i.join("")}})},{140:140,141:141,62:62}],271:[function(t,n,r){var e=t(62);e(e.P,"String",{repeat:t(133)})},{133:133,62:62}],272:[function(t,n,r){"use strict";t(131)("small",function(t){return function small(){return t(this,"small","","")}})},{131:131}],273:[function(t,n,r){"use strict";var e=t(62),i=t(141),o=t(130),u="startsWith",c=""[u];e(e.P+e.F*t(63)(u),"String",{startsWith:function startsWith(t){var n=o(this,t,u),r=i(Math.min(1<arguments.length?arguments[1]:void 0,n.length)),e=String(t);return c?c.call(n,e,r):n.slice(r,r+e.length)===e}})},{130:130,141:141,62:62,63:63}],274:[function(t,n,r){"use strict";t(131)("strike",function(t){return function strike(){return t(this,"strike","","")}})},{131:131}],275:[function(t,n,r){"use strict";t(131)("sub",function(t){return function sub(){return t(this,"sub","","")}})},{131:131}],276:[function(t,n,r){"use strict";t(131)("sup",function(t){return function sup(){return t(this,"sup","","")}})},{131:131}],277:[function(t,n,r){"use strict";t(134)("trim",function(t){return function trim(){return t(this,3)}})},{134:134}],278:[function(t,n,r){"use strict";function B1(t){var n=W[t]=E(j[L]);return n._k=t,n}function E1(t,n){x(t);for(var r,e=y(n=b(n)),i=0,o=e.length;i<o;)Q(t,r=e[i++],n[r]);return t}function G1(t){var n=D.call(this,t=w(t,!0));return!(this===B&&u(W,t)&&!u(V,t))&&(!(n||!u(this,t)||!u(W,t)||u(this,C)&&this[C][t])||n)}function H1(t,n){if(t=b(t),n=w(n,!0),t!==B||!u(W,n)||u(V,n)){var r=M(t,n);return!r||!u(W,n)||u(t,C)&&t[C][n]||(r.enumerable=!0),r}}function I1(t){for(var n,r=N(b(t)),e=[],i=0;r.length>i;)u(W,n=r[i++])||n==C||n==a||e.push(n);return e}function J1(t){for(var n,r=t===B,e=N(r?V:b(t)),i=[],o=0;e.length>o;)!u(W,n=e[o++])||r&&!u(B,n)||i.push(W[n]);return i}var e=t(70),u=t(71),i=t(58),o=t(62),c=t(118),a=t(94).KEY,f=t(64),s=t(126),l=t(124),h=t(147),p=t(152),v=t(151),g=t(150),y=t(61),d=t(79),x=t(38),m=t(81),S=t(142),b=t(140),w=t(143),_=t(116),E=t(98),O=t(102),F=t(101),I=t(104),P=t(99),A=t(107),M=F.f,k=P.f,N=O.f,j=e.Symbol,R=e.JSON,T=R&&R.stringify,L="prototype",C=p("_hidden"),G=p("toPrimitive"),D={}.propertyIsEnumerable,U=s("symbol-registry"),W=s("symbols"),V=s("op-symbols"),B=Object[L],q="function"==typeof j&&!!I.f,Y=e.QObject,z=!Y||!Y[L]||!Y[L].findChild,X=i&&f(function(){return 7!=E(k({},"a",{get:function(){return k(this,"a",{value:7}).a}})).a})?function(t,n,r){var e=M(B,n);e&&delete B[n],k(t,n,r),e&&t!==B&&k(B,n,e)}:k,$=q&&"symbol"==typeof j.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof j},Q=function defineProperty(t,n,r){return t===B&&Q(V,n,r),x(t),n=w(n,!0),x(r),u(W,n)?(r.enumerable?(u(t,C)&&t[C][n]&&(t[C][n]=!1),r=E(r,{enumerable:_(0,!1)})):(u(t,C)||k(t,C,_(1,{})),t[C][n]=!0),X(t,n,r)):k(t,n,r)};q||(c((j=function Symbol(){if(this instanceof j)throw TypeError("Symbol is not a constructor!");var n=h(0<arguments.length?arguments[0]:void 0),r=function(t){this===B&&r.call(V,t),u(this,C)&&u(this[C],n)&&(this[C][n]=!1),X(this,n,_(1,t))};return i&&z&&X(B,n,{configurable:!0,set:r}),B1(n)})[L],"toString",function toString(){return this._k}),F.f=H1,P.f=Q,t(103).f=O.f=I1,t(108).f=G1,I.f=J1,i&&!t(89)&&c(B,"propertyIsEnumerable",G1,!0),v.f=function(t){return B1(p(t))}),o(o.G+o.W+o.F*!q,{Symbol:j});for(var Z="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),J=0;Z.length>J;)p(Z[J++]);for(var H=A(p.store),K=0;H.length>K;)g(H[K++]);o(o.S+o.F*!q,"Symbol",{for:function(t){return u(U,t+="")?U[t]:U[t]=j(t)},keyFor:function keyFor(t){if(!$(t))throw TypeError(t+" is not a symbol!");for(var n in U)if(U[n]===t)return n},useSetter:function(){z=!0},useSimple:function(){z=!1}}),o(o.S+o.F*!q,"Object",{create:function create(t,n){return void 0===n?E(t):E1(E(t),n)},defineProperty:Q,defineProperties:E1,getOwnPropertyDescriptor:H1,getOwnPropertyNames:I1,getOwnPropertySymbols:J1});var tt=f(function(){I.f(1)});o(o.S+o.F*tt,"Object",{getOwnPropertySymbols:function getOwnPropertySymbols(t){return I.f(S(t))}}),R&&o(o.S+o.F*(!q||f(function(){var t=j();return"[null]"!=T([t])||"{}"!=T({a:t})||"{}"!=T(Object(t))})),"JSON",{stringify:function stringify(t){for(var n,r,e=[t],i=1;i<arguments.length;)e.push(arguments[i++]);if(r=n=e[1],(m(n)||void 0!==t)&&!$(t))return d(n)||(n=function(t,n){if("function"==typeof r&&(n=r.call(this,t,n)),!$(n))return n}),e[1]=n,T.apply(R,e)}}),j[L][G]||t(72)(j[L],G,j[L].valueOf),l(j,"Symbol"),l(Math,"Math",!0),l(e.JSON,"JSON",!0)},{101:101,102:102,103:103,104:104,107:107,108:108,116:116,118:118,124:124,126:126,140:140,142:142,143:143,147:147,150:150,151:151,152:152,38:38,58:58,61:61,62:62,64:64,70:70,71:71,72:72,79:79,81:81,89:89,94:94,98:98,99:99}],279:[function(t,n,r){"use strict";var e=t(62),i=t(146),o=t(145),f=t(38),s=t(137),l=t(141),u=t(81),c=t(70).ArrayBuffer,h=t(127),p=o.ArrayBuffer,v=o.DataView,a=i.ABV&&c.isView,g=p.prototype.slice,y=i.VIEW,d="ArrayBuffer";e(e.G+e.W+e.F*(c!==p),{ArrayBuffer:p}),e(e.S+e.F*!i.CONSTR,d,{isView:function isView(t){return a&&a(t)||u(t)&&y in t}}),e(e.P+e.U+e.F*t(64)(function(){return!new p(2).slice(1,void 0).byteLength}),d,{slice:function slice(t,n){if(void 0!==g&&void 0===n)return g.call(f(this),t);for(var r=f(this).byteLength,e=s(t,r),i=s(void 0===n?r:n,r),o=new(h(this,p))(l(i-e)),u=new v(this),c=new v(o),a=0;e<i;)c.setUint8(a++,u.getUint8(e++));return o}}),t(123)(d)},{123:123,127:127,137:137,141:141,145:145,146:146,38:38,62:62,64:64,70:70,81:81}],280:[function(t,n,r){var e=t(62);e(e.G+e.W+e.F*!t(146).ABV,{DataView:t(145).DataView})},{145:145,146:146,62:62}],281:[function(t,n,r){t(144)("Float32",4,function(e){return function Float32Array(t,n,r){return e(this,t,n,r)}})},{144:144}],282:[function(t,n,r){t(144)("Float64",8,function(e){return function Float64Array(t,n,r){return e(this,t,n,r)}})},{144:144}],283:[function(t,n,r){t(144)("Int16",2,function(e){return function Int16Array(t,n,r){return e(this,t,n,r)}})},{144:144}],284:[function(t,n,r){t(144)("Int32",4,function(e){return function Int32Array(t,n,r){return e(this,t,n,r)}})},{144:144}],285:[function(t,n,r){t(144)("Int8",1,function(e){return function Int8Array(t,n,r){return e(this,t,n,r)}})},{144:144}],286:[function(t,n,r){t(144)("Uint16",2,function(e){return function Uint16Array(t,n,r){return e(this,t,n,r)}})},{144:144}],287:[function(t,n,r){t(144)("Uint32",4,function(e){return function Uint32Array(t,n,r){return e(this,t,n,r)}})},{144:144}],288:[function(t,n,r){t(144)("Uint8",1,function(e){return function Uint8Array(t,n,r){return e(this,t,n,r)}})},{144:144}],289:[function(t,n,r){t(144)("Uint8",1,function(e){return function Uint8ClampedArray(t,n,r){return e(this,t,n,r)}},!0)},{144:144}],290:[function(t,n,r){"use strict";function R4(t){return function WeakMap(){return t(this,0<arguments.length?arguments[0]:void 0)}}var o,e=t(70),i=t(42)(0),u=t(118),c=t(94),a=t(97),f=t(50),s=t(81),l=t(149),h=t(149),p=!e.ActiveXObject&&"ActiveXObject"in e,v="WeakMap",g=c.getWeak,y=Object.isExtensible,d=f.ufstore,x={get:function get(t){if(s(t)){var n=g(t);return!0===n?d(l(this,v)).get(t):n?n[this._i]:void 0}},set:function set(t,n){return f.def(l(this,v),t,n)}},m=n.exports=t(51)(v,R4,x,f,!0,!0);h&&p&&(a((o=f.getConstructor(R4,v)).prototype,x),c.NEED=!0,i(["delete","has","get","set"],function(e){var t=m.prototype,i=t[e];u(t,e,function(t,n){if(!s(t)||y(t))return i.call(this,t,n);this._f||(this._f=new o);var r=this._f[e](t,n);return"set"==e?this:r})}))},{118:118,149:149,42:42,50:50,51:51,70:70,81:81,94:94,97:97}],291:[function(t,n,r){"use strict";var e=t(50),i=t(149),o="WeakSet";t(51)(o,function(t){return function WeakSet(){return t(this,0<arguments.length?arguments[0]:void 0)}},{add:function add(t){return e.def(i(this,o),t,!0)}},e,!1,!0)},{149:149,50:50,51:51}],292:[function(t,n,r){"use strict";var e=t(62),i=t(67),o=t(142),u=t(141),c=t(33),a=t(45);e(e.P,"Array",{flatMap:function flatMap(t){var n,r,e=o(this);return c(t),n=u(e.length),r=a(e,0),i(r,e,e,n,0,1,t,arguments[1]),r}}),t(35)("flatMap")},{141:141,142:142,33:33,35:35,45:45,62:62,67:67}],293:[function(t,n,r){"use strict";var e=t(62),i=t(41)(!0);e(e.P,"Array",{includes:function includes(t){return i(this,t,1<arguments.length?arguments[1]:void 0)}}),t(35)("includes")},{35:35,41:41,62:62}],294:[function(t,n,r){var e=t(62),i=t(110)(!0);e(e.S,"Object",{entries:function entries(t){return i(t)}})},{110:110,62:62}],295:[function(t,n,r){var e=t(62),a=t(111),f=t(140),s=t(101),l=t(53);e(e.S,"Object",{getOwnPropertyDescriptors:function getOwnPropertyDescriptors(t){for(var n,r,e=f(t),i=s.f,o=a(e),u={},c=0;o.length>c;)void 0!==(r=i(e,n=o[c++]))&&l(u,n,r);return u}})},{101:101,111:111,140:140,53:53,62:62}],296:[function(t,n,r){var e=t(62),i=t(110)(!1);e(e.S,"Object",{values:function values(t){return i(t)}})},{110:110,62:62}],297:[function(t,n,r){"use strict";var e=t(62),i=t(52),o=t(70),u=t(127),c=t(115);e(e.P+e.R,"Promise",{finally:function(n){var r=u(this,i.Promise||o.Promise),t="function"==typeof n;return this.then(t?function(t){return c(r,n()).then(function(){return t})}:n,t?function(t){return c(r,n()).then(function(){throw t})}:n)}})},{115:115,127:127,52:52,62:62,70:70}],298:[function(t,n,r){"use strict";var e=t(62),i=t(132),o=t(148),u=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);e(e.P+e.F*u,"String",{padEnd:function padEnd(t){return i(this,t,1<arguments.length?arguments[1]:void 0,!1)}})},{132:132,148:148,62:62}],299:[function(t,n,r){"use strict";var e=t(62),i=t(132),o=t(148),u=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);e(e.P+e.F*u,"String",{padStart:function padStart(t){return i(this,t,1<arguments.length?arguments[1]:void 0,!0)}})},{132:132,148:148,62:62}],300:[function(t,n,r){"use strict";t(134)("trimLeft",function(t){return function trimLeft(){return t(this,1)}},"trimStart")},{134:134}],301:[function(t,n,r){"use strict";t(134)("trimRight",function(t){return function trimRight(){return t(this,2)}},"trimEnd")},{134:134}],302:[function(t,n,r){t(150)("asyncIterator")},{150:150}],303:[function(t,n,r){for(var e=t(164),i=t(107),o=t(118),u=t(70),c=t(72),a=t(88),f=t(152),s=f("iterator"),l=f("toStringTag"),h=a.Array,p={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},v=i(p),g=0;g<v.length;g++){var y,d=v[g],x=p[d],m=u[d],S=m&&m.prototype;if(S&&(S[s]||c(S,s,h),S[l]||c(S,l,d),a[d]=h,x))for(y in e)S[y]||o(S,y,e[y],!0)}},{107:107,118:118,152:152,164:164,70:70,72:72,88:88}],304:[function(t,n,r){var e=t(62),i=t(136);e(e.G+e.B,{setImmediate:i.set,clearImmediate:i.clear})},{136:136,62:62}],305:[function(t,n,r){function y7(i){return function(t,n){var r=2<arguments.length,e=r&&u.call(arguments,2);return i(r?function(){("function"==typeof t?t:Function(t)).apply(this,e)}:t,n)}}var e=t(70),i=t(62),o=t(148),u=[].slice,c=/MSIE .\./.test(o);i(i.G+i.B+i.F*c,{setTimeout:y7(e.setTimeout),setInterval:y7(e.setInterval)})},{148:148,62:62,70:70}],306:[function(t,n,r){t(305),t(304),t(303),n.exports=t(52)},{303:303,304:304,305:305,52:52}],307:[function(t,n,r){var e=function(u){"use strict";var c,t=Object.prototype,f=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.asyncIterator||"@@asyncIterator",e=n.toStringTag||"@@toStringTag";function wrap(t,n,r,e){var i=n&&n.prototype instanceof Generator?n:Generator,o=Object.create(i.prototype),u=new Context(e||[]);return o._invoke=function makeInvokeMethod(o,u,c){var a=s;return function invoke(t,n){if(a===h)throw new Error("Generator is already running");if(a===p){if("throw"===t)throw n;return doneResult()}for(c.method=t,c.arg=n;;){var r=c.delegate;if(r){var e=maybeInvokeDelegate(r,c);if(e){if(e===v)continue;return e}}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if(a===s)throw a=p,c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);a=h;var i=tryCatch(o,u,c);if("normal"===i.type){if(a=c.done?p:l,i.arg===v)continue;return{value:i.arg,done:c.done}}"throw"===i.type&&(a=p,c.method="throw",c.arg=i.arg)}}}(t,r,u),o}function tryCatch(t,n,r){try{return{type:"normal",arg:t.call(n,r)}}catch(t){return{type:"throw",arg:t}}}u.wrap=wrap;var s="suspendedStart",l="suspendedYield",h="executing",p="completed",v={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var o={};o[i]=function(){return this};var a=Object.getPrototypeOf,g=a&&a(a(values([])));g&&g!==t&&f.call(g,i)&&(o=g);var y=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(o);function defineIteratorMethods(t){["next","throw","return"].forEach(function(n){t[n]=function(t){return this._invoke(n,t)}})}function AsyncIterator(c,a){var t;this._invoke=function enqueue(r,e){function callInvokeWithMethodAndArg(){return new a(function(t,n){!function invoke(t,n,r,e){var i=tryCatch(c[t],c,n);if("throw"!==i.type){var o=i.arg,u=o.value;return u&&"object"==typeof u&&f.call(u,"__await")?a.resolve(u.__await).then(function(t){invoke("next",t,r,e)},function(t){invoke("throw",t,r,e)}):a.resolve(u).then(function(t){o.value=t,r(o)},function(t){return invoke("throw",t,r,e)})}e(i.arg)}(r,e,t,n)})}return t=t?t.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(t,n){var r=t.iterator[n.method];if(r===c){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=c,maybeInvokeDelegate(t,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var e=tryCatch(r,t.iterator,n.arg);if("throw"===e.type)return n.method="throw",n.arg=e.arg,n.delegate=null,v;var i=e.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=c),n.delegate=null,v):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function pushTryEntry(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function resetTryEntry(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(t){if(t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,e=function next(){for(;++r<t.length;)if(f.call(t,r))return next.value=t[r],next.done=!1,next;return next.value=c,next.done=!0,next};return e.next=e}}return{next:doneResult}}function doneResult(){return{value:c,done:!0}}return GeneratorFunction.prototype=y.constructor=GeneratorFunctionPrototype,GeneratorFunctionPrototype.constructor=GeneratorFunction,GeneratorFunctionPrototype[e]=GeneratorFunction.displayName="GeneratorFunction",u.isGeneratorFunction=function(t){var n="function"==typeof t&&t.constructor;return!!n&&(n===GeneratorFunction||"GeneratorFunction"===(n.displayName||n.name))},u.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,e in t||(t[e]="GeneratorFunction")),t.prototype=Object.create(y),t},u.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),AsyncIterator.prototype[r]=function(){return this},u.AsyncIterator=AsyncIterator,u.async=function(t,n,r,e,i){void 0===i&&(i=Promise);var o=new AsyncIterator(wrap(t,n,r,e),i);return u.isGeneratorFunction(n)?o:o.next().then(function(t){return t.done?t.value:o.next()})},defineIteratorMethods(y),y[e]="Generator",y[i]=function(){return this},y.toString=function(){return"[object Generator]"},u.keys=function(n){var r=[];for(var t in n)r.push(t);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in n)return next.value=t,next.done=!1,next}return next.done=!0,next}},u.values=values,Context.prototype={constructor:Context,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=c,this.done=!1,this.delegate=null,this.method="next",this.arg=c,this.tryEntries.forEach(resetTryEntry),!t)for(var n in this)"t"===n.charAt(0)&&f.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=c)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function handle(t,n){return i.type="throw",i.arg=r,e.next=t,n&&(e.method="next",e.arg=c),!!n}for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t],i=n.completion;if("root"===n.tryLoc)return handle("end");if(n.tryLoc<=this.prev){var o=f.call(n,"catchLoc"),u=f.call(n,"finallyLoc");if(o&&u){if(this.prev<n.catchLoc)return handle(n.catchLoc,!0);if(this.prev<n.finallyLoc)return handle(n.finallyLoc)}else if(o){if(this.prev<n.catchLoc)return handle(n.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return handle(n.finallyLoc)}}}},abrupt:function(t,n){for(var r=this.tryEntries.length-1;0<=r;--r){var e=this.tryEntries[r];if(e.tryLoc<=this.prev&&f.call(e,"finallyLoc")&&this.prev<e.finallyLoc){var i=e;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=n&&n<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=n,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,n){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&n&&(this.next=n),v},finish:function(t){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),v}},catch:function(t){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc===t){var e=r.completion;if("throw"===e.type){var i=e.arg;resetTryEntry(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:values(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=c),v}},u}("object"==typeof n?n.exports:{});try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}},{}]},{},[1]);
easy-digital-downloads.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: The easiest way to sell digital products with WordPress.
6
  * Author: Sandhills Development, LLC
7
  * Author URI: https://sandhillsdev.com
8
- * Version: 2.10.6
9
  * Text Domain: easy-digital-downloads
10
  * Domain Path: languages
11
  *
@@ -25,7 +25,7 @@
25
  * @package EDD
26
  * @category Core
27
  * @author Pippin Williamson
28
- * @version 2.10.6
29
  */
30
 
31
  // Exit if accessed directly.
@@ -206,7 +206,7 @@ final class Easy_Digital_Downloads {
206
 
207
  // Plugin version.
208
  if ( ! defined( 'EDD_VERSION' ) ) {
209
- define( 'EDD_VERSION', '2.10.6' );
210
  }
211
 
212
  // Plugin Folder Path.
@@ -287,6 +287,7 @@ final class Easy_Digital_Downloads {
287
  require_once EDD_PLUGIN_DIR . 'includes/gateways/amazon-payments.php';
288
  }
289
  require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal-standard.php';
 
290
  require_once EDD_PLUGIN_DIR . 'includes/gateways/manual.php';
291
 
292
  $stripe = EDD_PLUGIN_DIR . 'includes/gateways/stripe/edd-stripe.php';
@@ -319,6 +320,7 @@ final class Easy_Digital_Downloads {
319
  require_once EDD_PLUGIN_DIR . 'includes/shortcodes.php';
320
  require_once EDD_PLUGIN_DIR . 'includes/admin/tracking.php'; // Must be loaded on frontend to ensure cron runs
321
  require_once EDD_PLUGIN_DIR . 'includes/privacy-functions.php';
 
322
 
323
  if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
324
  require_once EDD_PLUGIN_DIR . 'includes/admin/add-ons.php';
@@ -354,6 +356,7 @@ final class Easy_Digital_Downloads {
354
  require_once EDD_PLUGIN_DIR . 'includes/admin/settings/contextual-help.php';
355
  require_once EDD_PLUGIN_DIR . 'includes/admin/tools.php';
356
  require_once EDD_PLUGIN_DIR . 'includes/admin/plugins.php';
 
357
  require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php';
358
  require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/upgrades.php';
359
  require_once EDD_PLUGIN_DIR . 'includes/admin/class-edd-heartbeat.php';
5
  * Description: The easiest way to sell digital products with WordPress.
6
  * Author: Sandhills Development, LLC
7
  * Author URI: https://sandhillsdev.com
8
+ * Version: 2.11
9
  * Text Domain: easy-digital-downloads
10
  * Domain Path: languages
11
  *
25
  * @package EDD
26
  * @category Core
27
  * @author Pippin Williamson
28
+ * @version 2.11
29
  */
30
 
31
  // Exit if accessed directly.
206
 
207
  // Plugin version.
208
  if ( ! defined( 'EDD_VERSION' ) ) {
209
+ define( 'EDD_VERSION', '2.11' );
210
  }
211
 
212
  // Plugin Folder Path.
287
  require_once EDD_PLUGIN_DIR . 'includes/gateways/amazon-payments.php';
288
  }
289
  require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal-standard.php';
290
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/paypal.php';
291
  require_once EDD_PLUGIN_DIR . 'includes/gateways/manual.php';
292
 
293
  $stripe = EDD_PLUGIN_DIR . 'includes/gateways/stripe/edd-stripe.php';
320
  require_once EDD_PLUGIN_DIR . 'includes/shortcodes.php';
321
  require_once EDD_PLUGIN_DIR . 'includes/admin/tracking.php'; // Must be loaded on frontend to ensure cron runs
322
  require_once EDD_PLUGIN_DIR . 'includes/privacy-functions.php';
323
+ require_once EDD_PLUGIN_DIR . 'includes/utils/class-tokenizer.php';
324
 
325
  if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
326
  require_once EDD_PLUGIN_DIR . 'includes/admin/add-ons.php';
356
  require_once EDD_PLUGIN_DIR . 'includes/admin/settings/contextual-help.php';
357
  require_once EDD_PLUGIN_DIR . 'includes/admin/tools.php';
358
  require_once EDD_PLUGIN_DIR . 'includes/admin/plugins.php';
359
+ require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/downgrades.php';
360
  require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php';
361
  require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/upgrades.php';
362
  require_once EDD_PLUGIN_DIR . 'includes/admin/class-edd-heartbeat.php';
includes/EDD_SL_Plugin_Updater.php CHANGED
@@ -1,24 +1,26 @@
1
  <?php
2
 
3
  // Exit if accessed directly
4
- if ( ! defined( 'ABSPATH' ) ) exit;
 
 
5
 
6
  /**
7
  * Allows plugins to use their own update API.
8
  *
9
  * @author Easy Digital Downloads
10
- * @version 1.8.0
11
  */
12
  class EDD_SL_Plugin_Updater {
13
 
14
- private $api_url = '';
15
- private $api_data = array();
16
- private $name = '';
17
- private $slug = '';
18
- private $version = '';
19
- private $wp_override = false;
20
- private $cache_key = '';
21
-
22
  private $health_check_timeout = 5;
23
 
24
  /**
@@ -37,12 +39,12 @@ class EDD_SL_Plugin_Updater {
37
 
38
  $this->api_url = trailingslashit( $_api_url );
39
  $this->api_data = $_api_data;
 
40
  $this->name = plugin_basename( $_plugin_file );
41
  $this->slug = basename( $_plugin_file, '.php' );
42
  $this->version = $_api_data['version'];
43
  $this->wp_override = isset( $_api_data['wp_override'] ) ? (bool) $_api_data['wp_override'] : false;
44
  $this->beta = ! empty( $this->api_data['beta'] ) ? true : false;
45
- $this->cache_key = 'edd_sl_' . md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) );
46
 
47
  $edd_plugin_data[ $this->slug ] = $this->api_data;
48
 
@@ -71,8 +73,7 @@ class EDD_SL_Plugin_Updater {
71
 
72
  add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
73
  add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
74
- remove_action( 'after_plugin_row_' . $this->name, 'wp_plugin_update_row', 10 );
75
- add_action( 'after_plugin_row_' . $this->name, array( $this, 'show_update_notification' ), 10, 2 );
76
  add_action( 'admin_init', array( $this, 'show_changelog' ) );
77
 
78
  }
@@ -95,11 +96,7 @@ class EDD_SL_Plugin_Updater {
95
  global $pagenow;
96
 
97
  if ( ! is_object( $_transient_data ) ) {
98
- $_transient_data = new stdClass;
99
- }
100
-
101
- if ( 'plugins.php' == $pagenow && is_multisite() ) {
102
- return $_transient_data;
103
  }
104
 
105
  if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[ $this->name ] ) && false === $this->wp_override ) {
@@ -153,122 +150,120 @@ class EDD_SL_Plugin_Updater {
153
  }
154
 
155
  /**
156
- * show update nofication row -- needed for multisite subsites, because WP won't tell you otherwise!
157
  *
158
  * @param string $file
159
  * @param array $plugin
160
  */
161
  public function show_update_notification( $file, $plugin ) {
162
 
163
- if ( is_network_admin() ) {
 
164
  return;
165
  }
166
 
167
- if( ! current_user_can( 'update_plugins' ) ) {
168
  return;
169
  }
170
 
171
- if( ! is_multisite() ) {
172
  return;
173
  }
174
 
175
- if ( $this->name != $file ) {
176
- return;
177
- }
178
-
179
- // Remove our filter on the site transient
180
- remove_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ), 10 );
181
-
182
  $update_cache = get_site_transient( 'update_plugins' );
183
 
184
- $update_cache = is_object( $update_cache ) ? $update_cache : new stdClass();
185
-
186
- if ( empty( $update_cache->response ) || empty( $update_cache->response[ $this->name ] ) ) {
187
-
188
- $version_info = $this->get_repo_api_data();
189
-
190
- if ( false === $version_info ) {
191
- $version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug, 'beta' => $this->beta ) );
192
-
193
- // Since we disabled our filter for the transient, we aren't running our object conversion on banners, sections, or icons. Do this now:
194
- if ( isset( $version_info->banners ) && ! is_array( $version_info->banners ) ) {
195
- $version_info->banners = $this->convert_object_to_array( $version_info->banners );
196
- }
197
-
198
- if ( isset( $version_info->sections ) && ! is_array( $version_info->sections ) ) {
199
- $version_info->sections = $this->convert_object_to_array( $version_info->sections );
200
- }
201
-
202
- if ( isset( $version_info->icons ) && ! is_array( $version_info->icons ) ) {
203
- $version_info->icons = $this->convert_object_to_array( $version_info->icons );
204
- }
205
-
206
- if ( isset( $version_info->contributors ) && ! is_array( $version_info->contributors ) ) {
207
- $version_info->contributors = $this->convert_object_to_array( $version_info->contributors );
208
- }
209
-
210
- $this->set_version_info_cache( $version_info );
211
  }
 
 
212
 
213
- if ( ! is_object( $version_info ) ) {
214
- return;
215
- }
216
-
217
- if ( version_compare( $this->version, $version_info->new_version, '<' ) ) {
218
- $update_cache->response[ $this->name ] = $version_info;
219
- } else {
220
- $update_cache->no_update[ $this->name ] = $version_info;
221
- }
222
-
223
- $update_cache->last_checked = time();
224
- $update_cache->checked[ $this->name ] = $this->version;
225
-
226
- set_site_transient( 'update_plugins', $update_cache );
227
 
228
- } else {
 
 
 
 
 
229
 
230
- $version_info = $update_cache->response[ $this->name ];
 
231
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
  }
 
 
 
 
 
 
 
233
 
234
- // Restore our filter
235
- add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
236
-
237
- if ( ! empty( $update_cache->response[ $this->name ] ) && version_compare( $this->version, $version_info->new_version, '<' ) ) {
 
238
 
239
- // build a plugin list row, with update notification
240
- $wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
241
- # <tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange">
242
- echo '<tr class="plugin-update-tr" id="' . $this->slug . '-update" data-slug="' . $this->slug . '" data-plugin="' . $this->slug . '/' . $file . '">';
243
- echo '<td colspan="3" class="plugin-update colspanchange">';
244
- echo '<div class="update-message notice inline notice-warning notice-alt">';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
245
 
246
- $changelog_link = self_admin_url( 'index.php?edd_sl_action=view_plugin_changelog&plugin=' . $this->name . '&slug=' . $this->slug . '&TB_iframe=true&width=772&height=911' );
247
 
248
- if ( empty( $version_info->download_link ) ) {
249
- printf(
250
- __( 'There is a new version of %1$s available. %2$sView version %3$s details%4$s.', 'easy-digital-downloads' ),
251
- esc_html( $version_info->name ),
252
- '<a target="_blank" class="thickbox" href="' . esc_url( $changelog_link ) . '">',
253
- esc_html( $version_info->new_version ),
254
- '</a>'
255
- );
256
- } else {
257
- printf(
258
- __( 'There is a new version of %1$s available. %2$sView version %3$s details%4$s or %5$supdate now%6$s.', 'easy-digital-downloads' ),
259
- esc_html( $version_info->name ),
260
- '<a target="_blank" class="thickbox" href="' . esc_url( $changelog_link ) . '">',
261
- esc_html( $version_info->new_version ),
262
- '</a>',
263
- '<a href="' . esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $this->name, 'upgrade-plugin_' . $this->name ) ) .'">',
264
- '</a>'
265
- );
266
- }
267
 
268
- do_action( "in_plugin_update_message-{$file}", $plugin, $version_info );
 
 
 
 
 
 
 
269
 
270
- echo '</div></td></tr>';
271
- }
272
  }
273
 
274
  /**
@@ -283,13 +278,13 @@ class EDD_SL_Plugin_Updater {
283
  */
284
  public function plugins_api_filter( $_data, $_action = '', $_args = null ) {
285
 
286
- if ( $_action != 'plugin_information' ) {
287
 
288
  return $_data;
289
 
290
  }
291
 
292
- if ( ! isset( $_args->slug ) || ( $_args->slug != $this->slug ) ) {
293
 
294
  return $_data;
295
 
@@ -302,7 +297,7 @@ class EDD_SL_Plugin_Updater {
302
  'banners' => array(),
303
  'reviews' => false,
304
  'icons' => array(),
305
- )
306
  );
307
 
308
  // Get the transient where we store the api request for this plugin for 24 hours
@@ -319,7 +314,6 @@ class EDD_SL_Plugin_Updater {
319
  if ( false !== $api_response ) {
320
  $_data = $api_response;
321
  }
322
-
323
  } else {
324
  $_data = $edd_api_request_transient;
325
  }
@@ -344,7 +338,7 @@ class EDD_SL_Plugin_Updater {
344
  $_data->contributors = $this->convert_object_to_array( $_data->contributors );
345
  }
346
 
347
- if( ! isset( $_data->plugin ) ) {
348
  $_data->plugin = $this->name;
349
  }
350
 
@@ -364,6 +358,9 @@ class EDD_SL_Plugin_Updater {
364
  * @return array
365
  */
366
  private function convert_object_to_array( $data ) {
 
 
 
367
  $new_data = array();
368
  foreach ( $data as $key => $value ) {
369
  $new_data[ $key ] = is_object( $value ) ? $this->convert_object_to_array( $value ) : $value;
@@ -381,9 +378,8 @@ class EDD_SL_Plugin_Updater {
381
  */
382
  public function http_request_args( $args, $url ) {
383
 
384
- $verify_ssl = $this->verify_ssl();
385
  if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
386
- $args['sslverify'] = $verify_ssl;
387
  }
388
  return $args;
389
 
@@ -402,24 +398,28 @@ class EDD_SL_Plugin_Updater {
402
  */
403
  private function api_request( $_action, $_data ) {
404
 
405
- global $wp_version, $edd_plugin_url_available;
406
-
407
- $verify_ssl = $this->verify_ssl();
408
 
409
  // Do a quick status check on this domain if we haven't already checked it.
410
  $store_hash = md5( $this->api_url );
411
  if ( ! is_array( $edd_plugin_url_available ) || ! isset( $edd_plugin_url_available[ $store_hash ] ) ) {
412
- $test_url_parts = parse_url( $this->api_url );
413
 
414
- $scheme = ! empty( $test_url_parts['scheme'] ) ? $test_url_parts['scheme'] : 'http';
415
- $host = ! empty( $test_url_parts['host'] ) ? $test_url_parts['host'] : '';
416
- $port = ! empty( $test_url_parts['port'] ) ? ':' . $test_url_parts['port'] : '';
417
 
418
  if ( empty( $host ) ) {
419
  $edd_plugin_url_available[ $store_hash ] = false;
420
  } else {
421
- $test_url = $scheme . '://' . $host . $port;
422
- $response = wp_remote_get( $test_url, array( 'timeout' => $this->health_check_timeout, 'sslverify' => $verify_ssl ) );
 
 
 
 
 
 
423
  $edd_plugin_url_available[ $store_hash ] = is_wp_error( $response ) ? false : true;
424
  }
425
  }
@@ -430,53 +430,16 @@ class EDD_SL_Plugin_Updater {
430
 
431
  $data = array_merge( $this->api_data, $_data );
432
 
433
- if ( $data['slug'] != $this->slug ) {
434
- return false;
435
- }
436
-
437
- if ( $this->api_url == trailingslashit ( home_url() ) ) {
438
- return false; // Don't allow a plugin to ping itself
439
- }
440
-
441
- $api_params = array(
442
- 'edd_action' => 'get_version',
443
- 'license' => ! empty( $data['license'] ) ? $data['license'] : '',
444
- 'item_name' => isset( $data['item_name'] ) ? $data['item_name'] : false,
445
- 'item_id' => isset( $data['item_id'] ) ? $data['item_id'] : false,
446
- 'version' => isset( $data['version'] ) ? $data['version'] : false,
447
- 'slug' => $data['slug'],
448
- 'author' => $data['author'],
449
- 'url' => home_url(),
450
- 'beta' => ! empty( $data['beta'] ),
451
- );
452
-
453
- $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $verify_ssl, 'body' => $api_params ) );
454
-
455
- if ( ! is_wp_error( $request ) ) {
456
- $request = json_decode( wp_remote_retrieve_body( $request ) );
457
- }
458
-
459
- if ( $request && isset( $request->sections ) ) {
460
- $request->sections = maybe_unserialize( $request->sections );
461
- } else {
462
- $request = false;
463
- }
464
-
465
- if ( $request && isset( $request->banners ) ) {
466
- $request->banners = maybe_unserialize( $request->banners );
467
- }
468
-
469
- if ( $request && isset( $request->icons ) ) {
470
- $request->icons = maybe_unserialize( $request->icons );
471
  }
472
 
473
- if ( ! empty( $request->sections ) ) {
474
- foreach( $request->sections as $key => $section ) {
475
- $request->$key = (array) $section;
476
- }
477
  }
478
 
479
- return $request;
480
  }
481
 
482
  /**
@@ -484,90 +447,117 @@ class EDD_SL_Plugin_Updater {
484
  */
485
  public function show_changelog() {
486
 
487
- global $edd_plugin_data;
488
-
489
- if( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action'] ) {
490
  return;
491
  }
492
 
493
- if( empty( $_REQUEST['plugin'] ) ) {
494
  return;
495
  }
496
 
497
- if( empty( $_REQUEST['slug'] ) ) {
498
  return;
499
  }
500
 
501
- if( ! current_user_can( 'update_plugins' ) ) {
502
- wp_die( __( 'You do not have permission to install plugin updates', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) );
503
  }
504
 
505
- $data = $edd_plugin_data[ $_REQUEST['slug'] ];
506
- $version_info = $this->get_cached_version_info();
 
 
 
 
 
507
 
508
- if( false === $version_info ) {
 
509
 
510
- $api_params = array(
511
- 'edd_action' => 'get_version',
512
- 'item_name' => isset( $data['item_name'] ) ? $data['item_name'] : false,
513
- 'item_id' => isset( $data['item_id'] ) ? $data['item_id'] : false,
514
- 'slug' => $_REQUEST['slug'],
515
- 'author' => $data['author'],
516
- 'url' => home_url(),
517
- 'beta' => ! empty( $data['beta'] )
518
- );
 
 
 
 
 
 
 
 
 
 
519
 
520
- $verify_ssl = $this->verify_ssl();
521
- $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $verify_ssl, 'body' => $api_params ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
522
 
523
- if ( ! is_wp_error( $request ) ) {
524
- $version_info = json_decode( wp_remote_retrieve_body( $request ) );
525
- }
526
 
527
- if ( ! empty( $version_info ) && isset( $version_info->sections ) ) {
528
- $version_info->sections = maybe_unserialize( $version_info->sections );
529
- } else {
530
- $version_info = false;
531
- }
532
 
533
- if( ! empty( $version_info ) ) {
534
- foreach( $version_info->sections as $key => $section ) {
535
- $version_info->$key = (array) $section;
536
- }
537
- }
538
 
539
- $this->set_version_info_cache( $version_info );
 
 
540
 
541
- // Delete the unneeded option
542
- delete_option( md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_' . $this->beta . '_version_info' ) );
543
  }
544
 
545
- if ( isset( $version_info->sections ) ) {
546
- $sections = $this->convert_object_to_array( $version_info->sections );
547
- if ( ! empty( $sections['changelog'] ) ) {
548
- echo '<div style="background:#fff;padding:10px;">' . wp_kses_post( $sections['changelog'] ) . '</div>';
549
  }
550
  }
551
 
552
- exit;
553
  }
554
 
555
  /**
556
- * Gets the plugin's cached version information from the database.
557
  *
558
  * @param string $cache_key
559
- * @return boolean|string
560
  */
561
  public function get_cached_version_info( $cache_key = '' ) {
562
 
563
- if( empty( $cache_key ) ) {
564
- $cache_key = $this->cache_key;
565
  }
566
 
567
  $cache = get_option( $cache_key );
568
 
569
- if( empty( $cache['timeout'] ) || time() > $cache['timeout'] ) {
570
- return false; // Cache is expired
 
571
  }
572
 
573
  // We need to turn the icons into an array, thanks to WP Core forcing these into an object at some point.
@@ -588,13 +578,13 @@ class EDD_SL_Plugin_Updater {
588
  */
589
  public function set_version_info_cache( $value = '', $cache_key = '' ) {
590
 
591
- if( empty( $cache_key ) ) {
592
- $cache_key = $this->cache_key;
593
  }
594
 
595
  $data = array(
596
  'timeout' => strtotime( '+3 hours', time() ),
597
- 'value' => json_encode( $value )
598
  );
599
 
600
  update_option( $cache_key, $data, 'no' );
@@ -613,4 +603,16 @@ class EDD_SL_Plugin_Updater {
613
  return (bool) apply_filters( 'edd_sl_api_request_verify_ssl', true, $this );
614
  }
615
 
 
 
 
 
 
 
 
 
 
 
 
 
616
  }
1
  <?php
2
 
3
  // Exit if accessed directly
4
+ if ( ! defined( 'ABSPATH' ) ) {
5
+ exit;
6
+ }
7
 
8
  /**
9
  * Allows plugins to use their own update API.
10
  *
11
  * @author Easy Digital Downloads
12
+ * @version 1.9.0
13
  */
14
  class EDD_SL_Plugin_Updater {
15
 
16
+ private $api_url = '';
17
+ private $api_data = array();
18
+ private $plugin_file = '';
19
+ private $name = '';
20
+ private $slug = '';
21
+ private $version = '';
22
+ private $wp_override = false;
23
+ private $beta = false;
24
  private $health_check_timeout = 5;
25
 
26
  /**
39
 
40
  $this->api_url = trailingslashit( $_api_url );
41
  $this->api_data = $_api_data;
42
+ $this->plugin_file = $_plugin_file;
43
  $this->name = plugin_basename( $_plugin_file );
44
  $this->slug = basename( $_plugin_file, '.php' );
45
  $this->version = $_api_data['version'];
46
  $this->wp_override = isset( $_api_data['wp_override'] ) ? (bool) $_api_data['wp_override'] : false;
47
  $this->beta = ! empty( $this->api_data['beta'] ) ? true : false;
 
48
 
49
  $edd_plugin_data[ $this->slug ] = $this->api_data;
50
 
73
 
74
  add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
75
  add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
76
+ add_action( 'after_plugin_row', array( $this, 'show_update_notification' ), 10, 2 );
 
77
  add_action( 'admin_init', array( $this, 'show_changelog' ) );
78
 
79
  }
96
  global $pagenow;
97
 
98
  if ( ! is_object( $_transient_data ) ) {
99
+ $_transient_data = new stdClass();
 
 
 
 
100
  }
101
 
102
  if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[ $this->name ] ) && false === $this->wp_override ) {
150
  }
151
 
152
  /**
153
+ * Show the update notification on multisite subsites.
154
  *
155
  * @param string $file
156
  * @param array $plugin
157
  */
158
  public function show_update_notification( $file, $plugin ) {
159
 
160
+ // Return early if in the network admin, or if this is not a multisite install.
161
+ if ( is_network_admin() || ! is_multisite() ) {
162
  return;
163
  }
164
 
165
+ if ( ! current_user_can( 'update_plugins' ) ) {
166
  return;
167
  }
168
 
169
+ if ( $this->name !== $file ) {
170
  return;
171
  }
172
 
173
+ // Do not print any message if update does not exist.
 
 
 
 
 
 
174
  $update_cache = get_site_transient( 'update_plugins' );
175
 
176
+ if ( ! isset( $update_cache->response[ $this->name ] ) ) {
177
+ if ( ! is_object( $update_cache ) ) {
178
+ $update_cache = new stdClass();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
  }
180
+ $update_cache->response[ $this->name ] = $this->get_repo_api_data();
181
+ }
182
 
183
+ // Return early if this plugin isn't in the transient->response or if the site is running the current or newer version of the plugin.
184
+ if ( empty( $update_cache->response[ $this->name ] ) || version_compare( $this->version, $update_cache->response[ $this->name ]->new_version, '>=' ) ) {
185
+ return;
186
+ }
 
 
 
 
 
 
 
 
 
 
187
 
188
+ printf(
189
+ '<tr class="plugin-update-tr %3$s" id="%1$s-update" data-slug="%1$s" data-plugin="%2$s">',
190
+ $this->slug,
191
+ $file,
192
+ in_array( $this->name, $this->get_active_plugins(), true ) ? 'active' : 'inactive'
193
+ );
194
 
195
+ echo '<td colspan="3" class="plugin-update colspanchange">';
196
+ echo '<div class="update-message notice inline notice-warning notice-alt"><p>';
197
 
198
+ $changelog_link = '';
199
+ if ( ! empty( $update_cache->response[ $this->name ]->sections->changelog ) ) {
200
+ $changelog_link = add_query_arg(
201
+ array(
202
+ 'edd_sl_action' => 'view_plugin_changelog',
203
+ 'plugin' => urlencode( $this->name ),
204
+ 'slug' => urlencode( $this->slug ),
205
+ 'TB_iframe' => 'true',
206
+ 'width' => 77,
207
+ 'height' => 911,
208
+ ),
209
+ self_admin_url( 'index.php' )
210
+ );
211
  }
212
+ $update_link = add_query_arg(
213
+ array(
214
+ 'action' => 'upgrade-plugin',
215
+ 'plugin' => urlencode( $this->name ),
216
+ ),
217
+ self_admin_url( 'update.php' )
218
+ );
219
 
220
+ printf(
221
+ /* translators: the plugin name. */
222
+ esc_html__( 'There is a new version of %1$s available.', 'easy-digital-downloads' ),
223
+ esc_html( $plugin['Name'] )
224
+ );
225
 
226
+ if ( empty( $update_cache->response[ $this->name ]->package ) && ! empty( $changelog_link ) ) {
227
+ printf(
228
+ /* translators: 1. opening anchor tag, do not translate 2. the new plugin version 3. closing anchor tag, do not translate. */
229
+ __( ' %1$sView version %2$s details%3$s.', 'easy-digital-downloads' ),
230
+ '<a target="_blank" class="thickbox open-plugin-details-modal" href="' . esc_url( $changelog_link ) . '">',
231
+ esc_html( $update_cache->response[ $this->name ]->new_version ),
232
+ '</a>'
233
+ );
234
+ } elseif ( ! empty( $changelog_link ) ) {
235
+ printf(
236
+ __( ' %1$sView version %2$s details%3$s or %4$supdate now%5$s.', 'easy-digital-downloads' ),
237
+ '<a target="_blank" class="thickbox open-plugin-details-modal" href="' . esc_url( $changelog_link ) . '">',
238
+ esc_html( $update_cache->response[ $this->name ]->new_version ),
239
+ '</a>',
240
+ '<a target="_blank" class="update-link" href="' . esc_url( wp_nonce_url( $update_link, 'upgrade-plugin_' . $file ) ) . '">',
241
+ '</a>'
242
+ );
243
+ } else {
244
+ printf(
245
+ ' %1$s%2$s%3$s',
246
+ '<a target="_blank" class="update-link" href="' . esc_url( wp_nonce_url( $update_link, 'upgrade-plugin_' . $file ) ) . '">',
247
+ esc_html__( 'Update now.', 'easy-digital-downloads' ),
248
+ '</a>'
249
+ );
250
+ }
251
 
252
+ do_action( "in_plugin_update_message-{$file}", $plugin, $plugin );
253
 
254
+ echo '</p></div></td></tr>';
255
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
256
 
257
+ /**
258
+ * Gets the plugins active in a multisite network.
259
+ *
260
+ * @return array
261
+ */
262
+ private function get_active_plugins() {
263
+ $active_plugins = (array) get_option( 'active_plugins' );
264
+ $active_network_plugins = (array) get_site_option( 'active_sitewide_plugins' );
265
 
266
+ return array_merge( $active_plugins, array_keys( $active_network_plugins ) );
 
267
  }
268
 
269
  /**
278
  */
279
  public function plugins_api_filter( $_data, $_action = '', $_args = null ) {
280
 
281
+ if ( 'plugin_information' !== $_action ) {
282
 
283
  return $_data;
284
 
285
  }
286
 
287
+ if ( ! isset( $_args->slug ) || ( $_args->slug !== $this->slug ) ) {
288
 
289
  return $_data;
290
 
297
  'banners' => array(),
298
  'reviews' => false,
299
  'icons' => array(),
300
+ ),
301
  );
302
 
303
  // Get the transient where we store the api request for this plugin for 24 hours
314
  if ( false !== $api_response ) {
315
  $_data = $api_response;
316
  }
 
317
  } else {
318
  $_data = $edd_api_request_transient;
319
  }
338
  $_data->contributors = $this->convert_object_to_array( $_data->contributors );
339
  }
340
 
341
+ if ( ! isset( $_data->plugin ) ) {
342
  $_data->plugin = $this->name;
343
  }
344
 
358
  * @return array
359
  */
360
  private function convert_object_to_array( $data ) {
361
+ if ( ! is_array( $data ) && ! is_object( $data ) ) {
362
+ return array();
363
+ }
364
  $new_data = array();
365
  foreach ( $data as $key => $value ) {
366
  $new_data[ $key ] = is_object( $value ) ? $this->convert_object_to_array( $value ) : $value;
378
  */
379
  public function http_request_args( $args, $url ) {
380
 
 
381
  if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
382
+ $args['sslverify'] = $this->verify_ssl();
383
  }
384
  return $args;
385
 
398
  */
399
  private function api_request( $_action, $_data ) {
400
 
401
+ global $edd_plugin_url_available;
 
 
402
 
403
  // Do a quick status check on this domain if we haven't already checked it.
404
  $store_hash = md5( $this->api_url );
405
  if ( ! is_array( $edd_plugin_url_available ) || ! isset( $edd_plugin_url_available[ $store_hash ] ) ) {
406
+ $test_url_parts = wp_parse_url( $this->api_url );
407
 
408
+ $scheme = ! empty( $test_url_parts['scheme'] ) ? $test_url_parts['scheme'] : 'http';
409
+ $host = ! empty( $test_url_parts['host'] ) ? $test_url_parts['host'] : '';
410
+ $port = ! empty( $test_url_parts['port'] ) ? ':' . $test_url_parts['port'] : '';
411
 
412
  if ( empty( $host ) ) {
413
  $edd_plugin_url_available[ $store_hash ] = false;
414
  } else {
415
+ $test_url = $scheme . '://' . $host . $port;
416
+ $response = wp_remote_get(
417
+ $test_url,
418
+ array(
419
+ 'timeout' => $this->health_check_timeout,
420
+ 'sslverify' => $this->verify_ssl(),
421
+ )
422
+ );
423
  $edd_plugin_url_available[ $store_hash ] = is_wp_error( $response ) ? false : true;
424
  }
425
  }
430
 
431
  $data = array_merge( $this->api_data, $_data );
432
 
433
+ if ( $data['slug'] !== $this->slug ) {
434
+ return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
435
  }
436
 
437
+ // Don't allow a plugin to ping itself
438
+ if ( trailingslashit( home_url() ) === $this->api_url ) {
439
+ return false;
 
440
  }
441
 
442
+ return $this->get_version_from_remote();
443
  }
444
 
445
  /**
447
  */
448
  public function show_changelog() {
449
 
450
+ if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' !== $_REQUEST['edd_sl_action'] ) {
 
 
451
  return;
452
  }
453
 
454
+ if ( empty( $_REQUEST['plugin'] ) ) {
455
  return;
456
  }
457
 
458
+ if ( empty( $_REQUEST['slug'] ) || $this->slug !== $_REQUEST['slug'] ) {
459
  return;
460
  }
461
 
462
+ if ( ! current_user_can( 'update_plugins' ) ) {
463
+ wp_die( esc_html__( 'You do not have permission to install plugin updates', 'easy-digital-downloads' ), esc_html__( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) );
464
  }
465
 
466
+ $version_info = $this->get_repo_api_data();
467
+ if ( isset( $version_info->sections ) ) {
468
+ $sections = $this->convert_object_to_array( $version_info->sections );
469
+ if ( ! empty( $sections['changelog'] ) ) {
470
+ echo '<div style="background:#fff;padding:10px;">' . wp_kses_post( $sections['changelog'] ) . '</div>';
471
+ }
472
+ }
473
 
474
+ exit;
475
+ }
476
 
477
+ /**
478
+ * Gets the current version information from the remote site.
479
+ *
480
+ * @return array|false
481
+ */
482
+ private function get_version_from_remote() {
483
+ $api_params = array(
484
+ 'edd_action' => 'get_version',
485
+ 'license' => ! empty( $this->api_data['license'] ) ? $this->api_data['license'] : '',
486
+ 'item_name' => isset( $this->api_data['item_name'] ) ? $this->api_data['item_name'] : false,
487
+ 'item_id' => isset( $this->api_data['item_id'] ) ? $this->api_data['item_id'] : false,
488
+ 'version' => isset( $this->api_data['version'] ) ? $this->api_data['version'] : false,
489
+ 'slug' => $this->slug,
490
+ 'author' => $this->api_data['author'],
491
+ 'url' => home_url(),
492
+ 'beta' => $this->beta,
493
+ 'php_version' => phpversion(),
494
+ 'wp_version' => get_bloginfo( 'version' ),
495
+ );
496
 
497
+ /**
498
+ * Filters the parameters sent in the API request.
499
+ *
500
+ * @param array $api_params The array of data sent in the request.
501
+ * @param array $this->api_data The array of data set up in the class constructor.
502
+ * @param string $this->plugin_file The full path and filename of the file.
503
+ */
504
+ $api_params = apply_filters( 'edd_sl_plugin_updater_api_params', $api_params, $this->api_data, $this->plugin_file );
505
+
506
+ $request = wp_remote_post(
507
+ $this->api_url,
508
+ array(
509
+ 'timeout' => 15,
510
+ 'sslverify' => $this->verify_ssl(),
511
+ 'body' => $api_params,
512
+ )
513
+ );
514
 
515
+ if ( is_wp_error( $request ) ) {
516
+ return false;
517
+ }
518
 
519
+ $request = json_decode( wp_remote_retrieve_body( $request ) );
 
 
 
 
520
 
521
+ if ( $request && isset( $request->sections ) ) {
522
+ $request->sections = maybe_unserialize( $request->sections );
523
+ } else {
524
+ $request = false;
525
+ }
526
 
527
+ if ( $request && isset( $request->banners ) ) {
528
+ $request->banners = maybe_unserialize( $request->banners );
529
+ }
530
 
531
+ if ( $request && isset( $request->icons ) ) {
532
+ $request->icons = maybe_unserialize( $request->icons );
533
  }
534
 
535
+ if ( ! empty( $request->sections ) ) {
536
+ foreach ( $request->sections as $key => $section ) {
537
+ $request->$key = (array) $section;
 
538
  }
539
  }
540
 
541
+ return $request;
542
  }
543
 
544
  /**
545
+ * Get the version info from the cache, if it exists.
546
  *
547
  * @param string $cache_key
548
+ * @return object
549
  */
550
  public function get_cached_version_info( $cache_key = '' ) {
551
 
552
+ if ( empty( $cache_key ) ) {
553
+ $cache_key = $this->get_cache_key();
554
  }
555
 
556
  $cache = get_option( $cache_key );
557
 
558
+ // Cache is expired
559
+ if ( empty( $cache['timeout'] ) || time() > $cache['timeout'] ) {
560
+ return false;
561
  }
562
 
563
  // We need to turn the icons into an array, thanks to WP Core forcing these into an object at some point.
578
  */
579
  public function set_version_info_cache( $value = '', $cache_key = '' ) {
580
 
581
+ if ( empty( $cache_key ) ) {
582
+ $cache_key = $this->get_cache_key();
583
  }
584
 
585
  $data = array(
586
  'timeout' => strtotime( '+3 hours', time() ),
587
+ 'value' => wp_json_encode( $value ),
588
  );
589
 
590
  update_option( $cache_key, $data, 'no' );
603
  return (bool) apply_filters( 'edd_sl_api_request_verify_ssl', true, $this );
604
  }
605
 
606
+ /**
607
+ * Gets the unique key (option name) for a plugin.
608
+ *
609
+ * @since 1.9.0
610
+ * @return string
611
+ */
612
+ private function get_cache_key() {
613
+ $string = $this->slug . $this->api_data['license'] . $this->beta;
614
+
615
+ return 'edd_sl_' . md5( serialize( $string ) );
616
+ }
617
+
618
  }
includes/admin/settings/register-settings.php CHANGED
@@ -1429,7 +1429,6 @@ function edd_get_registered_settings_sections() {
1429
  ) ),
1430
  'gateways' => apply_filters( 'edd_settings_sections_gateways', array(
1431
  'main' => __( 'General', 'easy-digital-downloads' ),
1432
- 'paypal' => __( 'PayPal Standard', 'easy-digital-downloads' ),
1433
  ) ),
1434
  'emails' => apply_filters( 'edd_settings_sections_emails', array(
1435
  'main' => __( 'General', 'easy-digital-downloads' ),
1429
  ) ),
1430
  'gateways' => apply_filters( 'edd_settings_sections_gateways', array(
1431
  'main' => __( 'General', 'easy-digital-downloads' ),
 
1432
  ) ),
1433
  'emails' => apply_filters( 'edd_settings_sections_emails', array(
1434
  'main' => __( 'General', 'easy-digital-downloads' ),
includes/admin/tools.php CHANGED
@@ -1228,8 +1228,8 @@ function edd_tools_sysinfo_get() {
1228
  $front_page_id = get_option( 'page_on_front' );
1229
  $blog_page_id = get_option( 'page_for_posts' );
1230
 
1231
- $return .= 'Page On Front: ' . ( $front_page_id != 0 ? get_the_title( $front_page_id ) . ' (#' . $front_page_id . ')' : 'Unset' ) . "\n";
1232
- $return .= 'Page For Posts: ' . ( $blog_page_id != 0 ? get_the_title( $blog_page_id ) . ' (#' . $blog_page_id . ')' : 'Unset' ) . "\n";
1233
  }
1234
 
1235
  $return .= 'ABSPATH: ' . ABSPATH . "\n";
@@ -1377,7 +1377,18 @@ function edd_tools_sysinfo_get() {
1377
  continue;
1378
 
1379
  $update = ( array_key_exists( $plugin_path, $updates ) ) ? ' (needs update - ' . $updates[$plugin_path]->update->new_version . ')' : '';
1380
- $return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n";
 
 
 
 
 
 
 
 
 
 
 
1381
  }
1382
 
1383
  $return = apply_filters( 'edd_sysinfo_after_wordpress_plugins', $return );
@@ -1390,7 +1401,18 @@ function edd_tools_sysinfo_get() {
1390
  continue;
1391
 
1392
  $update = ( array_key_exists( $plugin_path, $updates ) ) ? ' (needs update - ' . $updates[$plugin_path]->update->new_version . ')' : '';
1393
- $return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n";
 
 
 
 
 
 
 
 
 
 
 
1394
  }
1395
 
1396
  $return = apply_filters( 'edd_sysinfo_after_wordpress_plugins_inactive', $return );
@@ -1410,7 +1432,18 @@ function edd_tools_sysinfo_get() {
1410
 
1411
  $update = ( array_key_exists( $plugin_path, $updates ) ) ? ' (needs update - ' . $updates[$plugin_path]->update->new_version . ')' : '';
1412
  $plugin = get_plugin_data( $plugin_path );
1413
- $return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n";
 
 
 
 
 
 
 
 
 
 
 
1414
  }
1415
 
1416
  $return = apply_filters( 'edd_sysinfo_after_wordpress_ms_plugins', $return );
1228
  $front_page_id = get_option( 'page_on_front' );
1229
  $blog_page_id = get_option( 'page_for_posts' );
1230
 
1231
+ $return .= 'Page On Front: ' . ( $front_page_id != 0 ? '#' . $front_page_id : 'Unset' ) . "\n";
1232
+ $return .= 'Page For Posts: ' . ( $blog_page_id != 0 ? '#' . $blog_page_id : 'Unset' ) . "\n";
1233
  }
1234
 
1235
  $return .= 'ABSPATH: ' . ABSPATH . "\n";
1377
  continue;
1378
 
1379
  $update = ( array_key_exists( $plugin_path, $updates ) ) ? ' (needs update - ' . $updates[$plugin_path]->update->new_version . ')' : '';
1380
+ $plugin_url = '';
1381
+ if ( ! empty( $plugin['PluginURI'] ) ) {
1382
+ $plugin_url = $plugin['PluginURI'];
1383
+ } elseif ( ! empty( $plugin['AuthorURI'] ) ) {
1384
+ $plugin_url = $plugin['AuthorURI'];
1385
+ } elseif ( ! empty( $plugin['Author'] ) ) {
1386
+ $plugin_url = $plugin['Author'];
1387
+ }
1388
+ if ( $plugin_url ) {
1389
+ $plugin_url = ' &mdash; ' . $plugin_url;
1390
+ }
1391
+ $return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . $plugin_url . "\n";
1392
  }
1393
 
1394
  $return = apply_filters( 'edd_sysinfo_after_wordpress_plugins', $return );
1401
  continue;
1402
 
1403
  $update = ( array_key_exists( $plugin_path, $updates ) ) ? ' (needs update - ' . $updates[$plugin_path]->update->new_version . ')' : '';
1404
+ $plugin_url = '';
1405
+ if ( ! empty( $plugin['PluginURI'] ) ) {
1406
+ $plugin_url = $plugin['PluginURI'];
1407
+ } elseif ( ! empty( $plugin['AuthorURI'] ) ) {
1408
+ $plugin_url = $plugin['AuthorURI'];
1409
+ } elseif ( ! empty( $plugin['Author'] ) ) {
1410
+ $plugin_url = $plugin['Author'];
1411
+ }
1412
+ if ( $plugin_url ) {
1413
+ $plugin_url = ' &mdash; ' . $plugin_url;
1414
+ }
1415
+ $return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . $plugin_url . "\n";
1416
  }
1417
 
1418
  $return = apply_filters( 'edd_sysinfo_after_wordpress_plugins_inactive', $return );
1432
 
1433
  $update = ( array_key_exists( $plugin_path, $updates ) ) ? ' (needs update - ' . $updates[$plugin_path]->update->new_version . ')' : '';
1434
  $plugin = get_plugin_data( $plugin_path );
1435
+ $plugin_url = '';
1436
+ if ( ! empty( $plugin['PluginURI'] ) ) {
1437
+ $plugin_url = $plugin['PluginURI'];
1438
+ } elseif ( ! empty( $plugin['AuthorURI'] ) ) {
1439
+ $plugin_url = $plugin['AuthorURI'];
1440
+ } elseif ( ! empty( $plugin['Author'] ) ) {
1441
+ $plugin_url = $plugin['Author'];
1442
+ }
1443
+ if ( $plugin_url ) {
1444
+ $plugin_url = ' &mdash; ' . $plugin_url;
1445
+ }
1446
+ $return .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . $plugin_url . "\n";
1447
  }
1448
 
1449
  $return = apply_filters( 'edd_sysinfo_after_wordpress_ms_plugins', $return );
includes/admin/upgrades/downgrades.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Downgrades
4
+ *
5
+ * @package easy-digital-downloads
6
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
7
+ * @license GPL2+
8
+ * @since 2.11
9
+ */
10
+
11
+ /**
12
+ * Checks if the current site has downgraded, and if so, performs any necessary actions.
13
+ *
14
+ * @since 2.11
15
+ * @return bool Whether or not a downgrade was performed.
16
+ */
17
+ function edd_do_downgrade() {
18
+ $did_downgrade = false;
19
+ $edd_version = preg_replace( '/[^0-9.].*/', '', get_option( 'edd_version' ) );
20
+ $downgraded_from = get_option( 'edd_version_downgraded_from' );
21
+
22
+ /**
23
+ * Check for downgrade from 3.0 to 2.11.
24
+ */
25
+ if ( version_compare( EDD_VERSION, '3.0-beta1', '<' ) ) {
26
+ if (
27
+ version_compare( $edd_version, '3.0-beta1', '>=' ) ||
28
+ ( $downgraded_from && version_compare( $downgraded_from, '3.0-beta1', '>=' ) )
29
+ ) {
30
+ /*
31
+ * This site probably just downgraded from EDD 3.0. Let's perform a downgrade.
32
+ */
33
+ $did_downgrade = edd_maybe_downgrade_from_v3();
34
+ }
35
+ }
36
+
37
+ if ( $did_downgrade ) {
38
+ update_option( 'edd_version', preg_replace( '/[^0-9.].*/', '', EDD_VERSION ) );
39
+ delete_option( 'edd_version_downgraded_from' );
40
+ }
41
+
42
+ return $did_downgrade;
43
+ }
44
+ add_action( 'admin_init', 'edd_do_downgrade' );
45
+
46
+ /**
47
+ * Performs a database downgrade from EDD 3.0 to 2.11 if one is needed.
48
+ * The main operation here is changing the customer meta column from `edd_customer_id` (v3.0 version)
49
+ * back to `customer_id` for v2.x.
50
+ *
51
+ * @since 2.11
52
+ * @return bool Whether the downgrade was performed.
53
+ */
54
+ function edd_maybe_downgrade_from_v3() {
55
+ global $wpdb;
56
+ $customer_meta_table = EDD()->customer_meta->table_name;
57
+
58
+ // If there is no column called `edd_customer_id`, then we don't need to downgrade.
59
+ $columns = $wpdb->query( "SHOW COLUMNS FROM {$customer_meta_table} LIKE 'edd_customer_id'");
60
+ if ( empty( $columns ) ) {
61
+ return false;
62
+ }
63
+
64
+ $wpdb->query( "ALTER TABLE {$customer_meta_table} CHANGE `edd_customer_id` `customer_id` bigint(20) unsigned NOT NULL default '0'" );
65
+ $wpdb->query( "ALTER TABLE {$customer_meta_table} DROP INDEX edd_customer_id" );
66
+ $wpdb->query( "ALTER TABLE {$customer_meta_table} ADD INDEX customer_id (customer_id)" );
67
+
68
+ // These two calls re-add the table version numbers for us.
69
+ EDD()->customer_meta->create_table();
70
+ EDD()->customers->create_table();
71
+
72
+ edd_debug_log( 'Completed downgrade from EDD 3.0.', true );
73
+
74
+ return true;
75
+ }
includes/admin/upgrades/upgrade-functions.php CHANGED
@@ -24,10 +24,8 @@ function edd_do_automatic_upgrades() {
24
  $did_upgrade = false;
25
  $edd_version = preg_replace( '/[^0-9.].*/', '', get_option( 'edd_version' ) );
26
 
27
- if( version_compare( $edd_version, '2.6', '<' ) ) {
28
-
29
  edd_v26_upgrades();
30
-
31
  }
32
 
33
  if( version_compare( $edd_version, EDD_VERSION, '<' ) ) {
@@ -37,7 +35,7 @@ function edd_do_automatic_upgrades() {
37
 
38
  }
39
 
40
- if( $did_upgrade ) {
41
 
42
  update_option( 'edd_version', preg_replace( '/[^0-9.].*/', '', EDD_VERSION ) );
43
 
@@ -1291,4 +1289,4 @@ function edd_include_file_download_log_migration_batch_processor( $class ) {
1291
  require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/classes/class-file-download-log-migration.php';
1292
  }
1293
 
1294
- }
24
  $did_upgrade = false;
25
  $edd_version = preg_replace( '/[^0-9.].*/', '', get_option( 'edd_version' ) );
26
 
27
+ if ( version_compare( $edd_version, '2.6', '<' ) ) {
 
28
  edd_v26_upgrades();
 
29
  }
30
 
31
  if( version_compare( $edd_version, EDD_VERSION, '<' ) ) {
35
 
36
  }
37
 
38
+ if ( $did_upgrade ) {
39
 
40
  update_option( 'edd_version', preg_replace( '/[^0-9.].*/', '', EDD_VERSION ) );
41
 
1289
  require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/classes/class-file-download-log-migration.php';
1290
  }
1291
 
1292
+ }
includes/ajax-functions.php CHANGED
@@ -186,76 +186,78 @@ add_action( 'wp_ajax_nopriv_edd_remove_from_cart', 'edd_ajax_remove_from_cart' )
186
  * @return void
187
  */
188
  function edd_ajax_add_to_cart() {
189
- if ( ! isset( $_POST['nonce'] ) ) {
190
- edd_debug_log( __( 'Missing nonce when adding an item to the cart. Please read the following for more information: https://easydigitaldownloads.com/development/2018/07/05/important-update-to-ajax-requests-in-easy-digital-downloads-2-9-4', 'easy-digital-downloads' ), true );
191
  }
192
 
193
- if ( isset( $_POST['download_id'] ) && isset( $_POST['nonce'] ) ) {
194
- $download_id = absint( $_POST['download_id'] );
195
- $nonce = sanitize_text_field( $_POST['nonce'] );
196
-
197
- $nonce_verified = wp_verify_nonce( $nonce, 'edd-add-to-cart-' . $download_id );
 
 
198
 
199
- if ( false === $nonce_verified ) {
200
- edd_die( '', '', 403 );
201
- }
 
202
 
203
- $to_add = array();
204
 
205
- if ( isset( $_POST['price_ids'] ) && is_array( $_POST['price_ids'] ) ) {
206
- foreach ( $_POST['price_ids'] as $price ) {
207
- $to_add[] = array( 'price_id' => $price );
208
- }
209
  }
 
210
 
211
- $items = '';
212
 
213
- foreach ( $to_add as $options ) {
214
 
215
- if( $_POST['download_id'] == $options['price_id'] ) {
216
- $options = array();
217
- }
218
 
219
- parse_str( $_POST['post_data'], $post_data );
220
 
221
- if( isset( $options['price_id'] ) && isset( $post_data['edd_download_quantity_' . $options['price_id'] ] ) ) {
222
 
223
- $options['quantity'] = absint( $post_data['edd_download_quantity_' . $options['price_id'] ] );
224
 
225
- } else {
226
 
227
- $options['quantity'] = isset( $post_data['edd_download_quantity'] ) ? absint( $post_data['edd_download_quantity'] ) : 1;
228
 
229
- }
230
 
231
- $key = edd_add_to_cart( $_POST['download_id'], $options );
232
 
233
- $item = array(
234
- 'id' => $_POST['download_id'],
235
- 'options' => $options
236
- );
237
 
238
- $item = apply_filters( 'edd_ajax_pre_cart_item_template', $item );
239
- $items .= html_entity_decode( edd_get_cart_item_template( $key, $item, true ), ENT_COMPAT, 'UTF-8' );
240
 
241
- }
242
 
243
- $return = array(
244
- 'subtotal' => html_entity_decode( edd_currency_filter( edd_format_amount( edd_get_cart_subtotal() ) ), ENT_COMPAT, 'UTF-8' ),
245
- 'total' => html_entity_decode( edd_currency_filter( edd_format_amount( edd_get_cart_total() ) ), ENT_COMPAT, 'UTF-8' ),
246
- 'cart_item' => $items,
247
- 'cart_quantity' => html_entity_decode( edd_get_cart_quantity() )
248
- );
249
 
250
- if ( edd_use_taxes() ) {
251
- $cart_tax = (float) edd_get_cart_tax();
252
- $return['tax'] = html_entity_decode( edd_currency_filter( edd_format_amount( $cart_tax ) ), ENT_COMPAT, 'UTF-8' );
253
- }
254
 
255
- $return = apply_filters( 'edd_ajax_add_to_cart_response', $return );
256
 
257
- echo json_encode( $return );
258
- }
259
  edd_die();
260
  }
261
  add_action( 'wp_ajax_edd_add_to_cart', 'edd_ajax_add_to_cart' );
@@ -381,10 +383,11 @@ function edd_ajax_remove_discount() {
381
  $total = edd_get_cart_total();
382
 
383
  $return = array(
384
- 'total' => html_entity_decode( edd_currency_filter( edd_format_amount( $total ) ), ENT_COMPAT, 'UTF-8' ),
385
- 'code' => sanitize_text_field( $_POST['code'] ),
386
- 'discounts' => edd_get_cart_discounts(),
387
- 'html' => edd_get_cart_discounts_html()
 
388
  );
389
 
390
  wp_send_json( $return );
186
  * @return void
187
  */
188
  function edd_ajax_add_to_cart() {
189
+ if ( ! isset( $_POST['download_id'] ) ) {
190
+ edd_die();
191
  }
192
 
193
+ $download_id = absint( $_POST['download_id'] );
194
+ $request_validated = false;
195
+ if ( isset( $_POST['timestamp'] ) && isset( $_POST['token'] ) && EDD\Utils\Tokenizer::is_token_valid( $_POST['token'], $_POST['timestamp'] ) ) {
196
+ $request_validated = true;
197
+ } elseif ( isset( $_POST['nonce'] ) && wp_verify_nonce( $_POST['nonce'], 'edd-add-to-cart-' . $download_id ) ) {
198
+ $request_validated = true;
199
+ }
200
 
201
+ if ( ! $request_validated ) {
202
+ edd_debug_log( __( 'Missing nonce when adding an item to the cart. Please read the following for more information: https://easydigitaldownloads.com/development/2018/07/05/important-update-to-ajax-requests-in-easy-digital-downloads-2-9-4', 'easy-digital-downloads' ), true );
203
+ edd_die( '', '', 403 );
204
+ }
205
 
206
+ $to_add = array();
207
 
208
+ if ( isset( $_POST['price_ids'] ) && is_array( $_POST['price_ids'] ) ) {
209
+ foreach ( $_POST['price_ids'] as $price ) {
210
+ $to_add[] = array( 'price_id' => $price );
 
211
  }
212
+ }
213
 
214
+ $items = '';
215
 
216
+ foreach ( $to_add as $options ) {
217
 
218
+ if( $_POST['download_id'] == $options['price_id'] ) {
219
+ $options = array();
220
+ }
221
 
222
+ parse_str( $_POST['post_data'], $post_data );
223
 
224
+ if( isset( $options['price_id'] ) && isset( $post_data['edd_download_quantity_' . $options['price_id'] ] ) ) {
225
 
226
+ $options['quantity'] = absint( $post_data['edd_download_quantity_' . $options['price_id'] ] );
227
 
228
+ } else {
229
 
230
+ $options['quantity'] = isset( $post_data['edd_download_quantity'] ) ? absint( $post_data['edd_download_quantity'] ) : 1;
231
 
232
+ }
233
 
234
+ $key = edd_add_to_cart( $_POST['download_id'], $options );
235
 
236
+ $item = array(
237
+ 'id' => $_POST['download_id'],
238
+ 'options' => $options
239
+ );
240
 
241
+ $item = apply_filters( 'edd_ajax_pre_cart_item_template', $item );
242
+ $items .= html_entity_decode( edd_get_cart_item_template( $key, $item, true ), ENT_COMPAT, 'UTF-8' );
243
 
244
+ }
245
 
246
+ $return = array(
247
+ 'subtotal' => html_entity_decode( edd_currency_filter( edd_format_amount( edd_get_cart_subtotal() ) ), ENT_COMPAT, 'UTF-8' ),
248
+ 'total' => html_entity_decode( edd_currency_filter( edd_format_amount( edd_get_cart_total() ) ), ENT_COMPAT, 'UTF-8' ),
249
+ 'cart_item' => $items,
250
+ 'cart_quantity' => html_entity_decode( edd_get_cart_quantity() )
251
+ );
252
 
253
+ if ( edd_use_taxes() ) {
254
+ $cart_tax = (float) edd_get_cart_tax();
255
+ $return['tax'] = html_entity_decode( edd_currency_filter( edd_format_amount( $cart_tax ) ), ENT_COMPAT, 'UTF-8' );
256
+ }
257
 
258
+ $return = apply_filters( 'edd_ajax_add_to_cart_response', $return );
259
 
260
+ echo json_encode( $return );
 
261
  edd_die();
262
  }
263
  add_action( 'wp_ajax_edd_add_to_cart', 'edd_ajax_add_to_cart' );
383
  $total = edd_get_cart_total();
384
 
385
  $return = array(
386
+ 'total_plain' => $total,
387
+ 'total' => html_entity_decode( edd_currency_filter( edd_format_amount( $total ) ), ENT_COMPAT, 'UTF-8' ),
388
+ 'code' => sanitize_text_field( $_POST['code'] ),
389
+ 'discounts' => edd_get_cart_discounts(),
390
+ 'html' => edd_get_cart_discounts_html()
391
  );
392
 
393
  wp_send_json( $return );
includes/class-edd-license-handler.php CHANGED
@@ -138,6 +138,9 @@ class EDD_License {
138
 
139
  // Register plugins for beta support
140
  add_filter( 'edd_beta_enabled_extensions', array( $this, 'register_beta_support' ) );
 
 
 
141
  }
142
 
143
  /**
@@ -562,6 +565,24 @@ class EDD_License {
562
 
563
  return $products;
564
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
565
  }
566
 
567
  endif; // end class_exists check
138
 
139
  // Register plugins for beta support
140
  add_filter( 'edd_beta_enabled_extensions', array( $this, 'register_beta_support' ) );
141
+
142
+ // Add the EDD version to the API parameters.
143
+ add_filter( 'edd_sl_plugin_updater_api_params', array( $this, 'filter_sl_api_params' ), 10, 3 );
144
  }
145
 
146
  /**
565
 
566
  return $products;
567
  }
568
+
569
+ /**
570
+ * Adds the EDD version to the API parameters.
571
+ *
572
+ * @since 2.11
573
+ * @param array $api_params The array of parameters sent in the API request.
574
+ * @param array $api_data The array of API data defined when instantiating the class.
575
+ * @param string $plugin_file The path to the plugin file.
576
+ * @return array
577
+ */
578
+ public function filter_sl_api_params( $api_params, $api_data, $plugin_file ) {
579
+
580
+ if ( $this->file === $plugin_file ) {
581
+ $api_params['easy-digital-downloads_version'] = defined( 'EDD_VERSION' ) ? EDD_VERSION : '';
582
+ }
583
+
584
+ return $api_params;
585
+ }
586
  }
587
 
588
  endif; // end class_exists check
includes/class-edd-session.php CHANGED
@@ -231,13 +231,11 @@ class EDD_Session {
231
  * @return void
232
  */
233
  public function set_cart_cookie( $set = true ) {
234
- if( ! headers_sent() ) {
235
- if( $set ) {
236
- @setcookie( 'edd_items_in_cart', '1', time() + 30 * 60, COOKIEPATH, COOKIE_DOMAIN, false );
237
- } else {
238
- if ( isset($_COOKIE['edd_items_in_cart']) ) {
239
- @setcookie( 'edd_items_in_cart', '', time() - 3600, COOKIEPATH, COOKIE_DOMAIN, false );
240
- }
241
  }
242
  }
243
  }
231
  * @return void
232
  */
233
  public function set_cart_cookie( $set = true ) {
234
+ if ( ! headers_sent() ) {
235
+ if ( $set ) {
236
+ setcookie( 'edd_items_in_cart', '1', time() + 1800, COOKIEPATH, COOKIE_DOMAIN, is_ssl() );
237
+ } elseif ( isset( $_COOKIE['edd_items_in_cart'] ) ) {
238
+ setcookie( 'edd_items_in_cart', '', time() - 3600, COOKIEPATH, COOKIE_DOMAIN, is_ssl() );
 
 
239
  }
240
  }
241
  }
includes/emails/class-edd-email-tags.php CHANGED
@@ -383,6 +383,7 @@ function edd_email_tag_download_list( $payment_id ) {
383
  $download_list = '<ul>';
384
  $cart_items = $payment->cart_details;
385
  $email = $payment->email;
 
386
 
387
  if ( $cart_items ) {
388
  $show_names = apply_filters( 'edd_email_show_names', true );
@@ -473,12 +474,16 @@ function edd_email_tag_download_list( $payment_id ) {
473
  }
474
  }
475
 
476
-
477
- if ( '' != edd_get_product_notes( $item['id'] ) ) {
478
- $download_list .= ' &mdash; <small>' . edd_get_product_notes( $item['id'] ) . '</small>';
 
 
 
 
 
479
  }
480
 
481
-
482
  if ( $show_names ) {
483
  $download_list .= '</li>';
484
  }
@@ -486,6 +491,19 @@ function edd_email_tag_download_list( $payment_id ) {
486
  }
487
  $download_list .= '</ul>';
488
 
 
 
 
 
 
 
 
 
 
 
 
 
 
489
  return $download_list;
490
  }
491
 
383
  $download_list = '<ul>';
384
  $cart_items = $payment->cart_details;
385
  $email = $payment->email;
386
+ $needs_notes = array();
387
 
388
  if ( $cart_items ) {
389
  $show_names = apply_filters( 'edd_email_show_names', true );
474
  }
475
  }
476
 
477
+ if ( ! array_key_exists( $item['id'], $needs_notes ) ) {
478
+ $item_notes = edd_get_product_notes( $item['id'] );
479
+ if ( $item_notes ) {
480
+ $needs_notes[ $item['id'] ] = array(
481
+ 'item_name' => get_the_title( $item['id'] ),
482
+ 'item_notes' => $item_notes,
483
+ );
484
+ }
485
  }
486
 
 
487
  if ( $show_names ) {
488
  $download_list .= '</li>';
489
  }
491
  }
492
  $download_list .= '</ul>';
493
 
494
+ // Remove any empty values.
495
+ $needs_notes = array_filter( $needs_notes );
496
+ if ( ! empty( $needs_notes ) ) {
497
+ $download_list .= __( 'Additional information about your purchase:', 'easy-digital-downloads' );
498
+
499
+ $download_list .= '<ul>';
500
+ foreach ( $needs_notes as $note ) {
501
+ $download_list .= '<li>' . $note['item_name'] . "\n" . '<small>' . $note['item_notes'] . '</small></li>';
502
+ }
503
+ $download_list .= '</ul>';
504
+ }
505
+
506
+
507
  return $download_list;
508
  }
509
 
includes/error-tracking.php CHANGED
@@ -28,21 +28,7 @@ function edd_print_errors() {
28
  $errors = edd_get_errors();
29
  if ( $errors ) {
30
 
31
- $classes = apply_filters( 'edd_error_class', array(
32
- 'edd_errors', 'edd-alert', 'edd-alert-error'
33
- ) );
34
-
35
- if ( ! empty( $errors ) ) {
36
- echo '<div class="' . implode( ' ', $classes ) . '">';
37
- // Loop error codes and display errors
38
- foreach ( $errors as $error_id => $error ) {
39
-
40
- echo '<p class="edd_error" id="edd_error_' . $error_id . '"><strong>' . __( 'Error', 'easy-digital-downloads' ) . '</strong>: ' . $error . '</p>';
41
-
42
- }
43
-
44
- echo '</div>';
45
- }
46
 
47
  edd_clear_errors();
48
 
@@ -52,6 +38,34 @@ add_action( 'edd_purchase_form_before_submit', 'edd_print_errors' );
52
  add_action( 'edd_ajax_checkout_errors', 'edd_print_errors' );
53
  add_action( 'edd_print_errors', 'edd_print_errors' );
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  /**
56
  * Get Errors
57
  *
28
  $errors = edd_get_errors();
29
  if ( $errors ) {
30
 
31
+ echo edd_build_errors_html( $errors );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
  edd_clear_errors();
34
 
38
  add_action( 'edd_ajax_checkout_errors', 'edd_print_errors' );
39
  add_action( 'edd_print_errors', 'edd_print_errors' );
40
 
41
+ /**
42
+ * Formats error messages and returns an HTML string.
43
+ *
44
+ * @param array $errors
45
+ *
46
+ * @since 2.11
47
+ * @return string
48
+ */
49
+ function edd_build_errors_html( $errors ) {
50
+ $error_html = '';
51
+
52
+ $classes = apply_filters( 'edd_error_class', array(
53
+ 'edd_errors', 'edd-alert', 'edd-alert-error'
54
+ ) );
55
+
56
+ if ( ! empty( $errors ) && is_array( $errors ) ) {
57
+ $error_html .= '<div class="' . implode( ' ', $classes ) . '">';
58
+ // Loop error codes and display errors
59
+ foreach ( $errors as $error_id => $error ) {
60
+ $error_html .= '<p class="edd_error" id="edd_error_' . $error_id . '"><strong>' . __( 'Error', 'easy-digital-downloads' ) . '</strong>: ' . $error . '</p>';
61
+
62
+ }
63
+ $error_html .= '</div>';
64
+ }
65
+
66
+ return $error_html;
67
+ }
68
+
69
  /**
70
  * Get Errors
71
  *
includes/gateways/functions.php CHANGED
@@ -21,6 +21,17 @@ if ( ! defined( 'ABSPATH' ) ) exit;
21
  function edd_get_payment_gateways() {
22
  // Default, built-in gateways
23
  $gateways = array(
 
 
 
 
 
 
 
 
 
 
 
24
  'paypal' => array(
25
  'admin_label' => __( 'PayPal Standard', 'easy-digital-downloads' ),
26
  'checkout_label' => __( 'PayPal', 'easy-digital-downloads' ),
@@ -294,7 +305,7 @@ function edd_build_straight_to_gateway_data( $download_id = 0, $options = array(
294
  'user_info' => $user_info,
295
  'post_data' => array(),
296
  'cart_details' => $cart_details,
297
- 'gateway' => 'paypal',
298
  'buy_now' => true,
299
  'card_info' => array()
300
  );
21
  function edd_get_payment_gateways() {
22
  // Default, built-in gateways
23
  $gateways = array(
24
+ 'paypal_commerce' => array(
25
+ 'admin_label' => __( 'PayPal', 'easy-digital-downloads' ),
26
+ 'checkout_label' => __( 'PayPal', 'easy-digital-downloads' ),
27
+ 'supports' => array( 'buy_now' )
28
+ ),
29
+ /**
30
+ * PayPal Standard is available only if it was used prior to 2.11 and the store owner hasn't
31
+ * yet been onboarded to PayPal Commerce.
32
+ *
33
+ * @see \EDD\Gateways\PayPal\maybe_remove_paypal_standard()
34
+ */
35
  'paypal' => array(
36
  'admin_label' => __( 'PayPal Standard', 'easy-digital-downloads' ),
37
  'checkout_label' => __( 'PayPal', 'easy-digital-downloads' ),
305
  'user_info' => $user_info,
306
  'post_data' => array(),
307
  'cart_details' => $cart_details,
308
+ 'gateway' => \EDD\Gateways\PayPal\paypal_standard_enabled() ? 'paypal' : 'paypal_commerce',
309
  'buy_now' => true,
310
  'card_info' => array()
311
  );
includes/gateways/paypal-standard.php CHANGED
@@ -30,7 +30,9 @@ add_action( 'edd_paypal_cc_form', '__return_false' );
30
  * @return array Gateway subsections with PayPal Standard
31
  */
32
  function edd_register_paypal_gateway_section( $gateway_sections ) {
33
- $gateway_sections['paypal'] = __( 'PayPal Standard', 'easy-digital-downloads' );
 
 
34
 
35
  return $gateway_sections;
36
  }
@@ -44,118 +46,120 @@ add_filter( 'edd_settings_sections_gateways', 'edd_register_paypal_gateway_secti
44
  * @return array Gateway tab settings with the PayPal Standard settings
45
  */
46
  function edd_register_paypal_gateway_settings( $gateway_settings ) {
 
 
 
47
 
48
- $paypal_settings = array (
49
- 'paypal_settings' => array(
50
- 'id' => 'paypal_settings',
51
- 'name' => '<strong>' . __( 'PayPal Standard Settings', 'easy-digital-downloads' ) . '</strong>',
52
- 'type' => 'header',
53
- ),
54
- 'paypal_email' => array(
55
- 'id' => 'paypal_email',
56
- 'name' => __( 'PayPal Email', 'easy-digital-downloads' ),
57
- 'desc' => __( 'Enter your PayPal account\'s email', 'easy-digital-downloads' ),
58
- 'type' => 'text',
59
- 'size' => 'regular',
60
- ),
61
- 'paypal_image_url' => array(
62
- 'id' => 'paypal_image_url',
63
- 'name' => __( 'PayPal Image URL', 'easy-digital-downloads' ),
64
- 'desc' => __( 'Upload an image to display on the PayPal checkout page.', 'easy-digital-downloads' ),
65
- 'type' => 'upload',
66
- 'size' => 'regular',
67
- ),
68
- );
69
-
70
- $pdt_desc = sprintf(
71
- __( 'Enter your PayPal Identity Token in order to enable Payment Data Transfer (PDT). This allows payments to be verified without relying on the PayPal IPN. See our <a href="%s" target="_blank">documentation</a> for further information.', 'easy-digital-downloads' ),
72
- 'http://docs.easydigitaldownloads.com/article/918-paypal-standard'
73
- );
74
-
75
- $paypal_settings['paypal_identify_token'] = array(
76
- 'id' => 'paypal_identity_token',
77
- 'name' => __( 'PayPal Identity Token', 'easy-digital-downloads' ),
78
  'type' => 'text',
79
- 'desc' => $pdt_desc,
80
  'size' => 'regular',
81
- );
 
 
 
 
 
 
 
 
82
 
83
- $disable_ipn_desc = sprintf(
84
- __( 'If you are unable to use Payment Data Transfer and payments are not getting marked as complete, then check this box. This forces the site to use a slightly less secure method of verifying purchases. See our <a href="%s" target="_blank">FAQ</a> for further information.', 'easy-digital-downloads' ),
85
- 'http://docs.easydigitaldownloads.com/article/190-payments-not-marked-as-complete'
86
- );
87
 
88
- $paypal_settings['disable_paypal_verification'] = array(
89
- 'id' => 'disable_paypal_verification',
90
- 'name' => __( 'Disable PayPal IPN Verification', 'easy-digital-downloads' ),
91
- 'desc' => $disable_ipn_desc,
92
- 'type' => 'checkbox',
93
- );
 
94
 
95
- $api_key_settings = array(
96
- 'paypal_api_keys_desc' => array(
97
- 'id' => 'paypal_api_keys_desc',
98
- 'name' => __( 'API Credentials', 'easy-digital-downloads' ),
99
- 'type' => 'descriptive_text',
100
- 'desc' => sprintf(
101
- __( 'API credentials are necessary to process PayPal refunds from inside WordPress. These can be obtained from <a href="%s" target="_blank">your PayPal account</a>.', 'easy-digital-downloads' ),
102
- 'https://developer.paypal.com/docs/classic/api/apiCredentials/#creating-an-api-signature'
103
- )
104
- ),
105
- 'paypal_live_api_username' => array(
106
- 'id' => 'paypal_live_api_username',
107
- 'name' => __( 'Live API Username', 'easy-digital-downloads' ),
108
- 'desc' => __( 'Your PayPal live API username. ', 'easy-digital-downloads' ),
109
- 'type' => 'text',
110
- 'size' => 'regular'
111
- ),
112
- 'paypal_live_api_password' => array(
113
- 'id' => 'paypal_live_api_password',
114
- 'name' => __( 'Live API Password', 'easy-digital-downloads' ),
115
- 'desc' => __( 'Your PayPal live API password.', 'easy-digital-downloads' ),
116
- 'type' => 'text',
117
- 'size' => 'regular'
118
- ),
119
- 'paypal_live_api_signature' => array(
120
- 'id' => 'paypal_live_api_signature',
121
- 'name' => __( 'Live API Signature', 'easy-digital-downloads' ),
122
- 'desc' => __( 'Your PayPal live API signature.', 'easy-digital-downloads' ),
123
- 'type' => 'text',
124
- 'size' => 'regular'
125
- ),
126
- 'paypal_test_api_username' => array(
127
- 'id' => 'paypal_test_api_username',
128
- 'name' => __( 'Test API Username', 'easy-digital-downloads' ),
129
- 'desc' => __( 'Your PayPal test API username.', 'easy-digital-downloads' ),
130
- 'type' => 'text',
131
- 'size' => 'regular'
132
- ),
133
- 'paypal_test_api_password' => array(
134
- 'id' => 'paypal_test_api_password',
135
- 'name' => __( 'Test API Password', 'easy-digital-downloads' ),
136
- 'desc' => __( 'Your PayPal test API password.', 'easy-digital-downloads' ),
137
- 'type' => 'text',
138
- 'size' => 'regular'
139
- ),
140
- 'paypal_test_api_signature' => array(
141
- 'id' => 'paypal_test_api_signature',
142
- 'name' => __( 'Test API Signature', 'easy-digital-downloads' ),
143
- 'desc' => __( 'Your PayPal test API signature.', 'easy-digital-downloads' ),
144
- 'type' => 'text',
145
- 'size' => 'regular'
146
  )
147
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
 
149
- $paypal_settings = array_merge( $paypal_settings, $api_key_settings );
150
 
151
- $paypal_settings = apply_filters( 'edd_paypal_settings', $paypal_settings );
152
- $gateway_settings['paypal'] = $paypal_settings;
153
 
154
- return $gateway_settings;
155
  }
156
  add_filter( 'edd_settings_gateways', 'edd_register_paypal_gateway_settings', 1, 1 );
157
 
158
-
159
  /**
160
  * Process PayPal Purchase
161
  *
@@ -1098,9 +1102,9 @@ add_filter( 'edd_get_payment_transaction_id-paypal', 'edd_paypal_get_payment_tra
1098
  */
1099
  function edd_paypal_link_transaction_id( $transaction_id, $payment_id ) {
1100
 
1101
- $payment = new EDD_Payment( $payment_id );
1102
- $sandbox = 'test' == $payment->mode ? 'sandbox.' : '';
1103
- $paypal_base_url = 'https://www.' . $sandbox . 'paypal.com/webscr?cmd=_history-details-from-hub&id=';
1104
  $transaction_url = '<a href="' . esc_url( $paypal_base_url . $transaction_id ) . '" target="_blank">' . $transaction_id . '</a>';
1105
 
1106
  return apply_filters( 'edd_paypal_link_payment_details_transaction_id', $transaction_url );
@@ -1221,9 +1225,9 @@ function edd_refund_paypal_purchase( $payment ) {
1221
  $credentials = apply_filters( 'edd_paypal_refund_api_credentials', $credentials, $payment );
1222
 
1223
  $body = array(
1224
- 'USER' => $credentials['api_username'],
1225
- 'PWD' => $credentials['api_password'],
1226
- 'SIGNATURE' => $credentials['api_signature'],
1227
  'VERSION' => '124',
1228
  'METHOD' => 'RefundTransaction',
1229
  'TRANSACTIONID' => $payment->transaction_id,
30
  * @return array Gateway subsections with PayPal Standard
31
  */
32
  function edd_register_paypal_gateway_section( $gateway_sections ) {
33
+ if ( \EDD\Gateways\PayPal\paypal_standard_enabled() ) {
34
+ $gateway_sections['paypal'] = __( 'PayPal Standard', 'easy-digital-downloads' );
35
+ }
36
 
37
  return $gateway_sections;
38
  }
46
  * @return array Gateway tab settings with the PayPal Standard settings
47
  */
48
  function edd_register_paypal_gateway_settings( $gateway_settings ) {
49
+ if ( ! \EDD\Gateways\PayPal\paypal_standard_enabled() ) {
50
+ return $gateway_settings;
51
+ }
52
 
53
+ $paypal_settings = array (
54
+ 'paypal_settings' => array(
55
+ 'id' => 'paypal_settings',
56
+ 'name' => '<strong>' . __( 'PayPal Standard Settings', 'easy-digital-downloads' ) . '</strong>',
57
+ 'type' => 'header',
58
+ ),
59
+ 'paypal_email' => array(
60
+ 'id' => 'paypal_email',
61
+ 'name' => __( 'PayPal Email', 'easy-digital-downloads' ),
62
+ 'desc' => __( 'Enter your PayPal account\'s email', 'easy-digital-downloads' ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  'type' => 'text',
 
64
  'size' => 'regular',
65
+ ),
66
+ 'paypal_image_url' => array(
67
+ 'id' => 'paypal_image_url',
68
+ 'name' => __( 'PayPal Image URL', 'easy-digital-downloads' ),
69
+ 'desc' => __( 'Upload an image to display on the PayPal checkout page.', 'easy-digital-downloads' ),
70
+ 'type' => 'upload',
71
+ 'size' => 'regular',
72
+ ),
73
+ );
74
 
75
+ $pdt_desc = sprintf(
76
+ __( 'Enter your PayPal Identity Token in order to enable Payment Data Transfer (PDT). This allows payments to be verified without relying on the PayPal IPN. See our <a href="%s" target="_blank">documentation</a> for further information.', 'easy-digital-downloads' ),
77
+ 'https://docs.easydigitaldownloads.com/article/918-paypal-standard'
78
+ );
79
 
80
+ $paypal_settings['paypal_identify_token'] = array(
81
+ 'id' => 'paypal_identity_token',
82
+ 'name' => __( 'PayPal Identity Token', 'easy-digital-downloads' ),
83
+ 'type' => 'text',
84
+ 'desc' => $pdt_desc,
85
+ 'size' => 'regular',
86
+ );
87
 
88
+ $disable_ipn_desc = sprintf(
89
+ __( 'If you are unable to use Payment Data Transfer and payments are not getting marked as complete, then check this box. This forces the site to use a slightly less secure method of verifying purchases. See our <a href="%s" target="_blank">FAQ</a> for further information.', 'easy-digital-downloads' ),
90
+ 'https://docs.easydigitaldownloads.com/article/190-payments-not-marked-as-complete'
91
+ );
92
+
93
+ $paypal_settings['disable_paypal_verification'] = array(
94
+ 'id' => 'disable_paypal_verification',
95
+ 'name' => __( 'Disable PayPal IPN Verification', 'easy-digital-downloads' ),
96
+ 'desc' => $disable_ipn_desc,
97
+ 'type' => 'checkbox',
98
+ );
99
+
100
+ $api_key_settings = array(
101
+ 'paypal_api_keys_desc' => array(
102
+ 'id' => 'paypal_api_keys_desc',
103
+ 'name' => __( 'API Credentials', 'easy-digital-downloads' ),
104
+ 'type' => 'descriptive_text',
105
+ 'desc' => sprintf(
106
+ __( 'API credentials are necessary to process PayPal refunds from inside WordPress. These can be obtained from <a href="%s" target="_blank">your PayPal account</a>.', 'easy-digital-downloads' ),
107
+ 'https://developer.paypal.com/docs/classic/api/apiCredentials/#creating-an-api-signature'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  )
109
+ ),
110
+ 'paypal_live_api_username' => array(
111
+ 'id' => 'paypal_live_api_username',
112
+ 'name' => __( 'Live API Username', 'easy-digital-downloads' ),
113
+ 'desc' => __( 'Your PayPal live API username. ', 'easy-digital-downloads' ),
114
+ 'type' => 'text',
115
+ 'size' => 'regular'
116
+ ),
117
+ 'paypal_live_api_password' => array(
118
+ 'id' => 'paypal_live_api_password',
119
+ 'name' => __( 'Live API Password', 'easy-digital-downloads' ),
120
+ 'desc' => __( 'Your PayPal live API password.', 'easy-digital-downloads' ),
121
+ 'type' => 'text',
122
+ 'size' => 'regular'
123
+ ),
124
+ 'paypal_live_api_signature' => array(
125
+ 'id' => 'paypal_live_api_signature',
126
+ 'name' => __( 'Live API Signature', 'easy-digital-downloads' ),
127
+ 'desc' => __( 'Your PayPal live API signature.', 'easy-digital-downloads' ),
128
+ 'type' => 'text',
129
+ 'size' => 'regular'
130
+ ),
131
+ 'paypal_test_api_username' => array(
132
+ 'id' => 'paypal_test_api_username',
133
+ 'name' => __( 'Test API Username', 'easy-digital-downloads' ),
134
+ 'desc' => __( 'Your PayPal test API username.', 'easy-digital-downloads' ),
135
+ 'type' => 'text',
136
+ 'size' => 'regular'
137
+ ),
138
+ 'paypal_test_api_password' => array(
139
+ 'id' => 'paypal_test_api_password',
140
+ 'name' => __( 'Test API Password', 'easy-digital-downloads' ),
141
+ 'desc' => __( 'Your PayPal test API password.', 'easy-digital-downloads' ),
142
+ 'type' => 'text',
143
+ 'size' => 'regular'
144
+ ),
145
+ 'paypal_test_api_signature' => array(
146
+ 'id' => 'paypal_test_api_signature',
147
+ 'name' => __( 'Test API Signature', 'easy-digital-downloads' ),
148
+ 'desc' => __( 'Your PayPal test API signature.', 'easy-digital-downloads' ),
149
+ 'type' => 'text',
150
+ 'size' => 'regular'
151
+ )
152
+ );
153
 
154
+ $paypal_settings = array_merge( $paypal_settings, $api_key_settings );
155
 
156
+ $paypal_settings = apply_filters( 'edd_paypal_settings', $paypal_settings );
157
+ $gateway_settings['paypal'] = $paypal_settings;
158
 
159
+ return $gateway_settings;
160
  }
161
  add_filter( 'edd_settings_gateways', 'edd_register_paypal_gateway_settings', 1, 1 );
162
 
 
163
  /**
164
  * Process PayPal Purchase
165
  *
1102
  */
1103
  function edd_paypal_link_transaction_id( $transaction_id, $payment_id ) {
1104
 
1105
+ $payment = new EDD_Payment( $payment_id );
1106
+ $sandbox = 'test' === $payment->mode ? 'sandbox.' : '';
1107
+ $paypal_base_url = 'https://www.' . $sandbox . 'paypal.com/activity/payment/';
1108
  $transaction_url = '<a href="' . esc_url( $paypal_base_url . $transaction_id ) . '" target="_blank">' . $transaction_id . '</a>';
1109
 
1110
  return apply_filters( 'edd_paypal_link_payment_details_transaction_id', $transaction_url );
1225
  $credentials = apply_filters( 'edd_paypal_refund_api_credentials', $credentials, $payment );
1226
 
1227
  $body = array(
1228
+ 'USER' => $credentials['api_username'],
1229
+ 'PWD' => $credentials['api_password'],
1230
+ 'SIGNATURE' => $credentials['api_signature'],
1231
  'VERSION' => '124',
1232
  'METHOD' => 'RefundTransaction',
1233
  'TRANSACTIONID' => $payment->transaction_id,
includes/gateways/paypal/admin/connect.php ADDED
@@ -0,0 +1,657 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * PayPal Commerce Connect
4
+ *
5
+ * @package easy-digital-downloads
6
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
7
+ * @license GPL2+
8
+ * @since 2.11
9
+ */
10
+
11
+ namespace EDD\Gateways\PayPal\Admin;
12
+
13
+ use EDD\Gateways\PayPal;
14
+ use EDD\Gateways\PayPal\AccountStatusValidator;
15
+ use EDD\Gateways\PayPal\API;
16
+
17
+ if ( ! defined( 'EDD_PAYPAL_PARTNER_CONNECT_URL' ) ) {
18
+ define( 'EDD_PAYPAL_PARTNER_CONNECT_URL', 'https://easydigitaldownloads.com/wp-json/paypal-connect/v1/' );
19
+ }
20
+
21
+ /**
22
+ * Returns the content for the PayPal Commerce Connect fields.
23
+ *
24
+ * If the account is not yet connected, the user is shown a "Connect with PayPal" button.
25
+ * If they are connected, their account details are shown instead.
26
+ *
27
+ * @since 2.11
28
+ * @return string
29
+ */
30
+ function connect_settings_field() {
31
+ $is_connected = PayPal\has_rest_api_connection();
32
+ $mode = edd_is_test_mode() ? __( 'sandbox', 'easy-digital-downloads' ) : __( 'live', 'easy-digital-downloads' );
33
+
34
+ ob_start();
35
+
36
+ if ( ! $is_connected ) {
37
+ /**
38
+ * Show Connect
39
+ */
40
+
41
+ /*
42
+ * If we have Partner details but no REST credentials then that most likely means
43
+ * PayPal wasn't opened in the modal. We'll show an error message about popups.
44
+ */
45
+ if ( get_partner_details() ) {
46
+ ?>
47
+ <div class="notice notice-error inline">
48
+ <p>
49
+ <?php
50
+ echo wp_kses( sprintf(
51
+ /* Translators: %1$s opening <strong> tag; %2$s closing </strong> tag */
52
+ __( '%1$sConnection failure:%2$s Please ensure browser popups are enabled then click the button below to connect again. If you continue to experience this error, please contact support.', 'easy-digital-downloads' ),
53
+ '<strong>',
54
+ '</strong>'
55
+ ), array( 'strong' => array() ) );
56
+ ?>
57
+ </p>
58
+ </div>
59
+ <?php
60
+ }
61
+ ?>
62
+ <button type="button" id="edd-paypal-commerce-connect" class="button" data-nonce="<?php echo esc_attr( wp_create_nonce( 'edd_process_paypal_connect' ) ); ?>">
63
+ <?php
64
+ /* Translators: %s - the store mode, either `sandbox` or `live` */
65
+ printf( esc_html__( 'Connect with PayPal in %s mode', 'easy-digital-downloads' ), esc_html( $mode ) );
66
+ ?>
67
+ </button>
68
+ <a href="#" target="_blank" id="edd-paypal-commerce-link" class="edd-hidden" data-paypal-onboard-complete="eddPayPalOnboardingCallback" data-paypal-button="true">
69
+ <?php esc_html_e( 'Sign up for PayPal', 'easy-digital-downloads' ); ?>
70
+ </a>
71
+ <div id="edd-paypal-commerce-errors"></div>
72
+ <?php
73
+ } else {
74
+ /**
75
+ * Show Account Info & Disconnect
76
+ */
77
+ ?>
78
+ <div id="edd-paypal-commerce-connect-wrap" class="edd-paypal-connect-account-info notice inline" data-nonce="<?php echo esc_attr( wp_create_nonce( 'edd_paypal_account_information' ) ); ?>">
79
+ <p>
80
+ <em><?php esc_html_e( 'Retrieving account information...', 'easy-digital-downloads' ); ?></em>
81
+ <span class="spinner is-active"></span>
82
+ </p>
83
+ </div>
84
+ <div id="edd-paypal-disconnect">
85
+ <a href="<?php echo esc_url( get_disconnect_url() ); ?>"><?php esc_html_e( 'Disconnect from PayPal', 'easy-digital-downloads' ); ?></a>
86
+ </div>
87
+ <?php
88
+ }
89
+ ?>
90
+
91
+ <?php
92
+ return ob_get_clean();
93
+ }
94
+
95
+ /**
96
+ * AJAX handler for processing the PayPal Connection.
97
+ *
98
+ * @since 2.11
99
+ * @return void
100
+ */
101
+ function process_connect() {
102
+ // This validates the nonce.
103
+ check_ajax_referer( 'edd_process_paypal_connect' );
104
+
105
+ if ( ! current_user_can( 'manage_options' ) ) {
106
+ wp_send_json_error( __( 'You do not have permission to perform this action.', 'easy-digital-downloads' ) );
107
+ }
108
+
109
+ $mode = edd_is_test_mode() ? API::MODE_SANDBOX : API::MODE_LIVE;
110
+
111
+ $response = wp_remote_post( EDD_PAYPAL_PARTNER_CONNECT_URL . 'signup-link', array(
112
+ 'headers' => array(
113
+ 'Content-Type' => 'application/json',
114
+ ),
115
+ 'body' => json_encode( array(
116
+ 'mode' => $mode,
117
+ 'country_code' => edd_get_shop_country(),
118
+ 'currency_code' => edd_get_currency(),
119
+ 'return_url' => get_settings_url()
120
+ ) )
121
+ ) );
122
+
123
+ if ( is_wp_error( $response ) ) {
124
+ wp_send_json_error( $response->get_error_message() );
125
+ }
126
+
127
+ $code = wp_remote_retrieve_response_code( $response );
128
+ $body = json_decode( wp_remote_retrieve_body( $response ) );
129
+
130
+ if ( 200 !== intval( $code ) ) {
131
+ wp_send_json_error( sprintf(
132
+ /* Translators: %d - HTTP response code; %s - Response from the API */
133
+ __( 'Unexpected response code: %d. Error: %s', 'easy-digital-downloads' ),
134
+ $code,
135
+ json_encode( $body )
136
+ ) );
137
+ }
138
+
139
+ if ( empty( $body->signupLink ) || empty( $body->nonce ) ) {
140
+ wp_send_json_error( __( 'An unexpected error occurred.', 'easy-digital-downloads' ) );
141
+ }
142
+
143
+ /**
144
+ * We need to store this temporarily so we can use the nonce again in the next request.
145
+ *
146
+ * @see get_access_token()
147
+ */
148
+ update_option( 'edd_paypal_commerce_connect_details_' . $mode, json_encode( $body ) );
149
+
150
+ wp_send_json_success( $body );
151
+ }
152
+
153
+ add_action( 'wp_ajax_edd_paypal_commerce_connect', __NAMESPACE__ . '\process_connect' );
154
+
155
+ /**
156
+ * Retrieves partner Connect details for the given mode.
157
+ *
158
+ * @param string $mode Store mode. If omitted, current mode is used.
159
+ *
160
+ * @return array|null
161
+ */
162
+ function get_partner_details( $mode = '' ) {
163
+ if ( ! $mode ) {
164
+ $mode = edd_is_test_mode() ? API::MODE_SANDBOX : API::MODE_LIVE;
165
+ }
166
+
167
+ return json_decode( get_option( 'edd_paypal_commerce_connect_details_' . $mode ) );
168
+ }
169
+
170
+ /**
171
+ * AJAX handler for retrieving a one-time access token, then used to retrieve
172
+ * the seller's API credentials.
173
+ *
174
+ * @since 2.11
175
+ * @return void
176
+ */
177
+ function get_and_save_credentials() {
178
+ // This validates the nonce.
179
+ check_ajax_referer( 'edd_process_paypal_connect' );
180
+
181
+ if ( ! current_user_can( 'manage_options' ) ) {
182
+ wp_send_json_error( __( 'You do not have permission to perform this action.', 'easy-digital-downloads' ) );
183
+ }
184
+
185
+ if ( empty( $_POST['auth_code'] ) || empty( $_POST['share_id'] ) ) {
186
+ wp_send_json_error( __( 'Missing PayPal authentication information. Please try again.', 'easy-digital-downloads' ) );
187
+ }
188
+
189
+ $mode = edd_is_test_mode() ? PayPal\API::MODE_SANDBOX : PayPal\API::MODE_LIVE;
190
+
191
+ $partner_details = get_partner_details( $mode );
192
+ if ( empty( $partner_details->nonce ) ) {
193
+ wp_send_json_error( __( 'Missing nonce. Please refresh the page and try again.', 'easy-digital-downloads' ) );
194
+ }
195
+
196
+ $paypal_subdomain = edd_is_test_mode() ? '.sandbox' : '';
197
+ $api_url = 'https://api-m' . $paypal_subdomain . '.paypal.com/';
198
+
199
+ /*
200
+ * First get a temporary access token from PayPal.
201
+ */
202
+ $response = wp_remote_post( $api_url . 'v1/oauth2/token', array(
203
+ 'headers' => array(
204
+ 'Content-Type' => 'application/x-www-form-urlencoded',
205
+ 'Authorization' => sprintf( 'Basic %s', base64_encode( $_POST['share_id'] ) ),
206
+ 'timeout' => 15
207
+ ),
208
+ 'body' => array(
209
+ 'grant_type' => 'authorization_code',
210
+ 'code' => $_POST['auth_code'],
211
+ 'code_verifier' => $partner_details->nonce
212
+ )
213
+ ) );
214
+
215
+ if ( is_wp_error( $response ) ) {
216
+ wp_send_json_error( $response->get_error_message() );
217
+ }
218
+
219
+ $code = wp_remote_retrieve_response_code( $response );
220
+ $body = json_decode( wp_remote_retrieve_body( $response ) );
221
+
222
+ if ( empty( $body->access_token ) ) {
223
+ wp_send_json_error( sprintf(
224
+ /* Translators: %d - HTTP response code */
225
+ __( 'Unexpected response from PayPal while generating token. Response code: %d. Please try again.', 'easy-digital-downloads' ),
226
+ $code
227
+ ) );
228
+ }
229
+
230
+ /*
231
+ * Now we can use this access token to fetch the seller's credentials for all future
232
+ * API requests.
233
+ */
234
+ $response = wp_remote_get( $api_url . 'v1/customer/partners/' . urlencode( \EDD\Gateways\PayPal\get_partner_merchant_id( $mode ) ) . '/merchant-integrations/credentials/', array(
235
+ 'headers' => array(
236
+ 'Authorization' => sprintf( 'Bearer %s', $body->access_token ),
237
+ 'Content-Type' => 'application/json',
238
+ 'timeout' => 15
239
+ )
240
+ ) );
241
+
242
+ if ( is_wp_error( $response ) ) {
243
+ wp_send_json_error( $response->get_error_message() );
244
+ }
245
+
246
+ $code = wp_remote_retrieve_response_code( $response );
247
+ $body = json_decode( wp_remote_retrieve_body( $response ) );
248
+
249
+ if ( empty( $body->client_id ) || empty( $body->client_secret ) ) {
250
+ wp_send_json_error( sprintf(
251
+ /* Translators: %d - HTTP response code */
252
+ __( 'Unexpected response from PayPal. Response code: %d. Please try again.', 'easy-digital-downloads' ),
253
+ $code
254
+ ) );
255
+ }
256
+
257
+ edd_update_option( 'paypal_' . $mode . '_client_id', sanitize_text_field( $body->client_id ) );
258
+ edd_update_option( 'paypal_' . $mode . '_client_secret', sanitize_text_field( $body->client_secret ) );
259
+
260
+ $message = esc_html__( 'Successfully connected.', 'easy-digital-downloads' );
261
+
262
+ try {
263
+ PayPal\Webhooks\create_webhook( $mode );
264
+ } catch ( \Exception $e ) {
265
+ $message = esc_html__( 'Your account has been successfully connected, but an error occurred while creating a webhook.', 'easy-digital-downloads' );
266
+ }
267
+
268
+ /**
269
+ * Triggers when an account is successfully connected to PayPal.
270
+ *
271
+ * @param string $mode The mode that the account was connected in. Either `sandbox` or `live`.
272
+ *
273
+ * @since 2.11
274
+ */
275
+ do_action( 'edd_paypal_commerce_connected', $mode );
276
+
277
+ wp_send_json_success( $message );
278
+ }
279
+
280
+ add_action( 'wp_ajax_edd_paypal_commerce_get_access_token', __NAMESPACE__ . '\get_and_save_credentials' );
281
+
282
+ /**
283
+ * Verifies the connected account.
284
+ *
285
+ * @since 2.11
286
+ * @return void
287
+ */
288
+ function get_account_info() {
289
+ check_ajax_referer( 'edd_paypal_account_information' );
290
+
291
+ if ( ! current_user_can( 'manage_shop_settings' ) ) {
292
+ wp_send_json_error( wpautop( __( 'You do not have permission to perform this action.', 'easy-digital-downloads' ) ) );
293
+ }
294
+
295
+ try {
296
+ $status = 'success';
297
+ $account_status = '';
298
+ $actions = array(
299
+ 'refresh_merchant' => '<button type="button" class="button edd-paypal-connect-action" data-nonce="' . esc_attr( wp_create_nonce( 'edd_check_merchant_status' ) ) . '" data-action="edd_paypal_commerce_check_merchant_status">' . esc_html__( 'Re-Check Payment Status', 'easy-digital-downloads' ) . '</button>',
300
+ 'webhook' => '<button type="button" class="button edd-paypal-connect-action" data-nonce="' . esc_attr( wp_create_nonce( 'edd_update_paypal_webhook' ) ) . '" data-action="edd_paypal_commerce_update_webhook">' . esc_html__( 'Sync Webhook', 'easy-digital-downloads' ) . '</button>'
301
+ );
302
+
303
+ $validator = new AccountStatusValidator();
304
+ $validator->check();
305
+
306
+ /*
307
+ * 1. Check REST API credentials
308
+ */
309
+ $rest_api_message = '<strong>' . __( 'API:', 'easy-digital-downloads' ) . '</strong>' . ' ';
310
+ if ( $validator->errors_for_credentials->errors ) {
311
+ $rest_api_dashicon = 'no';
312
+ $status = 'error';
313
+ $rest_api_message .= $validator->errors_for_credentials->get_error_message();
314
+ } else {
315
+ $rest_api_dashicon = 'yes';
316
+ $mode_string = edd_is_test_mode() ? __( 'sandbox', 'easy-digital-downloads' ) : __( 'live', 'easy-digital-downloads' );
317
+
318
+ /* Translators: %s - the connected mode, either `sandbox` or `live` */
319
+ $rest_api_message .= sprintf( __( 'Your PayPal account is successfully connected in %s mode.', 'easy-digital-downloads' ), $mode_string );
320
+ }
321
+
322
+ ob_start();
323
+ ?>
324
+ <li>
325
+ <span class="dashicons dashicons-<?php echo esc_attr( $rest_api_dashicon ); ?>"></span>
326
+ <span><?php echo wp_kses( $rest_api_message, array( 'strong' => array() ) ); ?></span>
327
+ </li>
328
+ <?php
329
+ $account_status .= ob_get_clean();
330
+
331
+ /*
332
+ * 2. Check merchant account
333
+ */
334
+ $merchant_account_message = '<strong>' . __( 'Payment Status:', 'easy-digital-downloads' ) . '</strong>' . ' ';
335
+ if ( $validator->errors_for_merchant_account->errors ) {
336
+ $merchant_dashicon = 'no';
337
+ $status = 'error';
338
+ $merchant_account_message .= __( 'You need to address the following issues before you can start receiving payments:', 'easy-digital-downloads' );
339
+
340
+ // We can only refresh the status if we have a merchant ID.
341
+ if ( in_array( 'missing_merchant_details', $validator->errors_for_merchant_account->get_error_codes() ) ) {
342
+ unset( $actions['refresh_merchant'] );
343
+ }
344
+ } else {
345
+ $merchant_dashicon = 'yes';
346
+ $merchant_account_message .= __( 'Ready to accept payments.', 'easy-digital-downloads' );
347
+ }
348
+
349
+ ob_start();
350
+ ?>
351
+ <li>
352
+ <span class="dashicons dashicons-<?php echo esc_attr( $merchant_dashicon ); ?>"></span>
353
+ <span><?php echo wp_kses_post( $merchant_account_message ); ?></span>
354
+ <?php if ( $validator->errors_for_merchant_account->errors ) : ?>
355
+ <ul>
356
+ <?php foreach ( $validator->errors_for_merchant_account->get_error_codes() as $code ) : ?>
357
+ <li><?php echo wp_kses( $validator->errors_for_merchant_account->get_error_message( $code ), array( 'strong' => array() ) ); ?></li>
358
+ <?php endforeach; ?>
359
+ </ul>
360
+ <?php endif; ?>
361
+ </li>
362
+ <?php
363
+ $account_status .= ob_get_clean();
364
+
365
+ /*
366
+ * 3. Webhooks
367
+ */
368
+ $webhook_message = '<strong>' . __( 'Webhook:', 'easy-digital-downloads' ) . '</strong>' . ' ';
369
+ if ( $validator->errors_for_webhook->errors ) {
370
+ $webhook_dashicon = 'no';
371
+ $status = ( 'success' === $status ) ? 'warning' : $status;
372
+ $webhook_message .= $validator->errors_for_webhook->get_error_message();
373
+
374
+ if ( in_array( 'webhook_missing', $validator->errors_for_webhook->get_error_codes() ) ) {
375
+ $actions['webhook'] = '<button type="button" class="button edd-paypal-connect-action" data-nonce="' . esc_attr( wp_create_nonce( 'edd_create_paypal_webhook' ) ) . '" data-action="edd_paypal_commerce_create_webhook">' . esc_html__( 'Create Webhook', 'easy-digital-downloads' ) . '</button>';
376
+ }
377
+ } else {
378
+ $webhook_dashicon = 'yes';
379
+ $webhook_message .= __( 'Webhook successfully configured for the following events:', 'easy-digital-downloads' );
380
+ }
381
+
382
+ ob_start();
383
+ ?>
384
+ <li>
385
+ <span class="dashicons dashicons-<?php echo esc_attr( $webhook_dashicon ); ?>"></span>
386
+ <span><?php echo wp_kses( $webhook_message, array( 'strong' => array() ) ); ?></span>
387
+ <?php if ( $validator->webhook ) : ?>
388
+ <ul class="edd-paypal-webhook-events">
389
+ <?php foreach ( array_keys( PayPal\Webhooks\get_webhook_events() ) as $event_name ) : ?>
390
+ <li>
391
+ <span class="dashicons dashicons-<?php echo in_array( $event_name, $validator->enabled_webhook_events ) ? 'yes' : 'no'; ?>"></span>
392
+ <span class="edd-paypal-webhook-event-name"><?php echo esc_html( $event_name ); ?></span>
393
+ </li>
394
+ <?php endforeach; ?>
395
+ </ul>
396
+ <?php endif; ?>
397
+ </li>
398
+ <?php
399
+ $account_status .= ob_get_clean();
400
+
401
+ if ( ! edd_is_gateway_active( 'paypal_commerce' ) ) {
402
+ $account_status .= ' ' . sprintf(
403
+ /* Translators: %1$s opening anchor tag; %2$s closing anchor tag */
404
+ __( 'PayPal is not currently active. %1$sEnable PayPal%2$s in the general gateway settings to start using it.', 'easy-digital-downloads' ),
405
+ '<a href="' . esc_url( admin_url( 'edit.php?post_type=download&page=edd-settings&tab=gateways&section=main' ) ) . '">',
406
+ '</a>'
407
+ );
408
+ }
409
+
410
+ wp_send_json_success( array(
411
+ 'status' => $status,
412
+ 'account_status' => '<ul class="edd-paypal-account-status">' . $account_status . '</ul>',
413
+ 'webhook_object' => isset( $validator ) ? $validator->webhook : null,
414
+ 'actions' => array_values( $actions )
415
+ ) );
416
+ } catch ( \Exception $e ) {
417
+ wp_send_json_error( array(
418
+ 'status' => isset( $status ) ? $status : 'error',
419
+ 'message' => wpautop( $e->getMessage() )
420
+ ) );
421
+ }
422
+ }
423
+
424
+ add_action( 'wp_ajax_edd_paypal_commerce_get_account_info', __NAMESPACE__ . '\get_account_info' );
425
+
426
+ /**
427
+ * Returns the URL for disconnecting from PayPal Commerce.
428
+ *
429
+ * @since 2.11
430
+ * @return string
431
+ */
432
+ function get_disconnect_url() {
433
+ return wp_nonce_url(
434
+ add_query_arg(
435
+ array(
436
+ 'edd_action' => 'disconnect_paypal_commerce'
437
+ ),
438
+ admin_url()
439
+ ),
440
+ 'edd_disconnect_paypal_commerce'
441
+ );
442
+ }
443
+
444
+ /**
445
+ * Disconnects from PayPal in the current mode.
446
+ *
447
+ * @since 2.11
448
+ * @return void
449
+ */
450
+ function process_disconnect() {
451
+ if ( ! current_user_can( 'manage_options' ) ) {
452
+ wp_die( esc_html__( 'You do not have permission to perform this action.', 'easy-digital-downloads' ), esc_html__( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) );
453
+ }
454
+
455
+ if ( empty( $_GET['_wpnonce'] ) || ! wp_verify_nonce( $_GET['_wpnonce'], 'edd_disconnect_paypal_commerce' ) ) {
456
+ wp_die( esc_html__( 'You do not have permission to perform this action.', 'easy-digital-downloads' ), esc_html__( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) );
457
+ }
458
+
459
+ $mode = edd_is_test_mode() ? PayPal\API::MODE_SANDBOX : PayPal\API::MODE_LIVE;
460
+
461
+ // Delete API credentials.
462
+ $edd_settings_to_delete = array(
463
+ 'paypal_' . $mode . '_client_id',
464
+ 'paypal_' . $mode . '_client_secret'
465
+ );
466
+
467
+ // Delete merchant information.
468
+ delete_option( 'edd_paypal_' . $mode . '_merchant_details' );
469
+
470
+ // Delete partner connect information.
471
+ delete_option( 'edd_paypal_commerce_connect_details_' . $mode );
472
+
473
+ try {
474
+ // Also delete the token cache key, to ensure we fetch a fresh one if they connect to a different account later.
475
+ $api = new PayPal\API();
476
+ $edd_settings_to_delete[] = $api->token_cache_key;
477
+
478
+ // Disconnect the webhook.
479
+ PayPal\Webhooks\delete_webhook( $mode );
480
+ } catch ( \Exception $e ) {
481
+
482
+ }
483
+
484
+ foreach ( $edd_settings_to_delete as $option_name ) {
485
+ edd_delete_option( $option_name );
486
+ }
487
+
488
+ wp_safe_redirect( esc_url_raw( get_settings_url() ) );
489
+ exit;
490
+ }
491
+
492
+ add_action( 'edd_disconnect_paypal_commerce', __NAMESPACE__ . '\process_disconnect' );
493
+
494
+ /**
495
+ * AJAX callback for refreshing payment status.
496
+ *
497
+ * @since 2.11
498
+ */
499
+ function refresh_merchant_status() {
500
+ check_ajax_referer( 'edd_check_merchant_status' );
501
+
502
+ if ( ! current_user_can( 'manage_options' ) ) {
503
+ wp_send_json_error( esc_html__( 'You do not have permission to perform this action.', 'easy-digital-downloads' ) );
504
+ }
505
+
506
+ $merchant_details = PayPal\MerchantAccount::retrieve();
507
+
508
+ try {
509
+ if ( empty( $merchant_details->merchant_id ) ) {
510
+ throw new \Exception( __( 'No merchant ID saved. Please reconnect to PayPal.', 'easy-digital-downloads' ) );
511
+ }
512
+
513
+ $partner_details = get_partner_details();
514
+ $nonce = isset( $partner_details->nonce ) ? $partner_details->nonce : null;
515
+
516
+ $new_details = get_merchant_status( $merchant_details->merchant_id, $nonce );
517
+ $merchant_account = new PayPal\MerchantAccount( $new_details );
518
+ $merchant_account->save();
519
+
520
+ wp_send_json_success();
521
+ } catch ( \Exception $e ) {
522
+ wp_send_json_error( esc_html( $e->getMessage() ) );
523
+ }
524
+ }
525
+
526
+ add_action( 'wp_ajax_edd_paypal_commerce_check_merchant_status', __NAMESPACE__ . '\refresh_merchant_status' );
527
+
528
+ /**
529
+ * AJAX callback for creating a webhook.
530
+ *
531
+ * @since 2.11
532
+ */
533
+ function create_webhook() {
534
+ check_ajax_referer( 'edd_create_paypal_webhook' );
535
+
536
+ if ( ! current_user_can( 'manage_options' ) ) {
537
+ wp_send_json_error( esc_html__( 'You do not have permission to perform this action.', 'easy-digital-downloads' ) );
538
+ }
539
+
540
+ try {
541
+ PayPal\Webhooks\create_webhook();
542
+
543
+ wp_send_json_success();
544
+ } catch ( \Exception $e ) {
545
+ wp_send_json_error( esc_html( $e->getMessage() ) );
546
+ }
547
+ }
548
+
549
+ add_action( 'wp_ajax_edd_paypal_commerce_create_webhook', __NAMESPACE__ . '\create_webhook' );
550
+
551
+ /**
552
+ * AJAX callback for syncing a webhook. This is used to fix issues with missing events.
553
+ *
554
+ * @since 2.11
555
+ */
556
+ function update_webhook() {
557
+ check_ajax_referer( 'edd_update_paypal_webhook' );
558
+
559
+ if ( ! current_user_can( 'manage_options' ) ) {
560
+ wp_send_json_error( esc_html__( 'You do not have permission to perform this action.', 'easy-digital-downloads' ) );
561
+ }
562
+
563
+ try {
564
+ PayPal\Webhooks\sync_webhook();
565
+
566
+ wp_send_json_success();
567
+ } catch ( \Exception $e ) {
568
+ wp_send_json_error( esc_html( $e->getMessage() ) );
569
+ }
570
+ }
571
+
572
+ add_action( 'wp_ajax_edd_paypal_commerce_update_webhook', __NAMESPACE__ . '\update_webhook' );
573
+
574
+ /**
575
+ * PayPal Redirect Callback
576
+ *
577
+ * This processes after the merchant is redirected from PayPal. We immediately
578
+ * check their seller status via partner connect and save their merchant status.
579
+ * The user is then redirected back to the settings page.
580
+ *
581
+ * @since 2.11
582
+ */
583
+ add_action( 'admin_init', function () {
584
+ if ( ! isset( $_GET['merchantIdInPayPal'] ) || ! edd_is_admin_page( 'settings' ) ) {
585
+ return;
586
+ }
587
+
588
+ if ( ! current_user_can( 'manage_options' ) ) {
589
+ wp_die( __( 'You do not have permission to perform this action.', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) );
590
+ }
591
+
592
+ edd_debug_log( 'PayPal Connect - Checking merchant status.' );
593
+
594
+ $merchant_id = urldecode( $_GET['merchantIdInPayPal'] );
595
+
596
+ try {
597
+ $details = get_merchant_status( $merchant_id );
598
+ edd_debug_log( 'PayPal Connect - Successfully retrieved merchant status.' );
599
+ } catch ( \Exception $e ) {
600
+ /*
601
+ * This won't be enough to actually validate the merchant status, but we want to ensure
602
+ * we save the merchant ID no matter what.
603
+ */
604
+ $details = array(
605
+ 'merchant_id' => $merchant_id
606
+ );
607
+
608
+ edd_debug_log( 'PayPal Connect - Failed to retrieve merchant status from PayPal. Error: %s', $e->getMessage() );
609
+ }
610
+
611
+ $merchant_account = new PayPal\MerchantAccount( $details );
612
+ $merchant_account->save();
613
+
614
+ wp_safe_redirect( esc_url_raw( get_settings_url() ) );
615
+ exit;
616
+ } );
617
+
618
+ /**
619
+ * Retrieves the merchant's status in PayPal.
620
+ *
621
+ * @param string $merchant_id
622
+ * @param string $nonce
623
+ *
624
+ * @return array
625
+ * @throws PayPal\Exceptions\API_Exception
626
+ */
627
+ function get_merchant_status( $merchant_id, $nonce = '' ) {
628
+ $response = wp_remote_post( EDD_PAYPAL_PARTNER_CONNECT_URL . 'merchant-status', array(
629
+ 'headers' => array(
630
+ 'Content-Type' => 'application/json',
631
+ ),
632
+ 'body' => json_encode( array(
633
+ 'mode' => edd_is_test_mode() ? API::MODE_SANDBOX : API::MODE_LIVE,
634
+ 'merchant_id' => $merchant_id,
635
+ 'nonce' => $nonce
636
+ ) )
637
+ ) );
638
+
639
+ $response_code = wp_remote_retrieve_response_code( $response );
640
+ $response_body = json_decode( wp_remote_retrieve_body( $response ), true );
641
+
642
+ if ( 200 !== (int) $response_code ) {
643
+ if ( ! empty( $response_body['error'] ) ) {
644
+ $error_message = $response_body['error'];
645
+ } else {
646
+ $error_message = sprintf(
647
+ 'Invalid HTTP response code: %d. Response: %s',
648
+ $response_code,
649
+ wp_remote_retrieve_body( $response )
650
+ );
651
+ }
652
+
653
+ throw new PayPal\Exceptions\API_Exception( $error_message, $response_code );
654
+ }
655
+
656
+ return $response_body;
657
+ }
includes/gateways/paypal/admin/notices.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * PayPal Admin Notices
4
+ *
5
+ * @package easy-digital-downloads
6
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
7
+ * @license GPL2+
8
+ * @since 2.11
9
+ */
10
+
11
+ namespace EDD\Gateways\PayPal\Admin;
12
+
13
+ add_action( 'admin_notices', function () {
14
+ if ( ! current_user_can( 'manage_options' ) ) {
15
+ return;
16
+ }
17
+
18
+ // Bail if this notice has already been dismissed.
19
+ if ( get_user_meta( get_current_user_id(), '_edd_paypal_commerce_dismissed' ) ) {
20
+ return;
21
+ }
22
+
23
+ $enabled_gateways = array_keys( edd_get_enabled_payment_gateways() );
24
+ $enabled_gateways = array_diff( $enabled_gateways, array( 'paypal_commerce' ) );
25
+
26
+ // Show a notice if any PayPal gateway is enabled, other than PayPal Commerce.
27
+ $paypal_gateways = array_filter( $enabled_gateways, function( $gateway ) {
28
+ return false !== strpos( strtolower( $gateway ), 'paypal' );
29
+ } );
30
+
31
+ if ( ! $paypal_gateways ) {
32
+ return;
33
+ }
34
+
35
+ $dismiss_url = add_query_arg( array( 'edd_action' => 'dismiss_notices', 'edd_notice' => 'paypal_commerce' ) );
36
+ $setup_url = add_query_arg( array(
37
+ 'post_type' => 'download',
38
+ 'page' => 'edd-settings',
39
+ 'tab' => 'gateways',
40
+ 'section' => 'paypal_commerce'
41
+ ), admin_url( 'edit.php' ) );
42
+
43
+ ?>
44
+ <div class="notice notice-info">
45
+ <h2><?php esc_html_e( 'Enable the new PayPal gateway for Easy Digital Downloads', 'easy-digital-downloads' ); ?></h2>
46
+ <p>
47
+ <?php
48
+ echo wp_kses( sprintf(
49
+ /* Translators: %1$s opening anchor tag; %2$s closing anchor tag */
50
+ __( 'A new, improved PayPal experience is now available in Easy Digital Downloads. You can learn more about the new integration in %1$sour documentation%2$s.', 'easy-digital-downloads' ),
51
+ '<a href="https://docs.easydigitaldownloads.com/article/2410-paypal#migration" target="_blank">',
52
+ '</a>'
53
+ ), array( 'a' => array( 'href' => true, 'target' => true ) ) );
54
+ ?>
55
+ </p>
56
+ <p>
57
+ <a href="<?php echo esc_url( $setup_url ); ?>" class="button button-primary"><?php esc_html_e( 'Activate the New PayPal', 'easy-digital-downloads' ); ?></a>
58
+ <a href="<?php echo esc_url( $dismiss_url ); ?>" class="button"><?php esc_html_e( 'Dismiss Notice', 'easy-digital-downloads' ); ?></a>
59
+ </p>
60
+ </div>
61
+ <?php
62
+ } );
includes/gateways/paypal/admin/scripts.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * PayPal Commerce Admin Scripts
4
+ *
5
+ * @package easy-digital-downloads
6
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
7
+ * @license GPL2+
8
+ * @since 2.11
9
+ */
10
+
11
+ namespace EDD\Gateways\PayPal\Admin;
12
+
13
+ /**
14
+ * Enqueue PayPal connect admin JS.
15
+ *
16
+ * @since 2.11
17
+ */
18
+ function enqueue_connect_scripts() {
19
+ if ( edd_is_admin_page( 'settings' ) && isset( $_GET['section'] ) && 'paypal_commerce' === $_GET['section'] ) {
20
+ \EDD\Gateways\PayPal\maybe_enqueue_polyfills();
21
+
22
+ // Use minified libraries if SCRIPT_DEBUG is turned off
23
+ $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
24
+ $subdomain = edd_is_test_mode() ? 'sandbox.' : '';
25
+
26
+ wp_enqueue_script(
27
+ 'sandhills-paypal-partner-js',
28
+ 'https://www.' . $subdomain . 'paypal.com/webapps/merchantboarding/js/lib/lightbox/partner.js',
29
+ array(),
30
+ null,
31
+ true
32
+ );
33
+
34
+ wp_enqueue_script(
35
+ 'edd-paypal-connect',
36
+ EDD_PLUGIN_URL . 'assets/js/admin-paypal-connect' . $suffix . '.js',
37
+ array( 'jquery' ),
38
+ EDD_VERSION,
39
+ true
40
+ );
41
+
42
+ wp_localize_script( 'edd-paypal-connect', 'eddPayPalConnectVars', array(
43
+ 'defaultError' => esc_html__( 'An unexpected error occurred. Please refresh the page and try again.', 'easy-digital-downloads' )
44
+ ) );
45
+ }
46
+ }
47
+
48
+ add_action( 'admin_enqueue_scripts', __NAMESPACE__ . '\enqueue_connect_scripts' );
includes/gateways/paypal/admin/settings.php ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * PayPal Settings
4
+ *
5
+ * @package easy-digital-downloads
6
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
7
+ * @license GPL2+
8
+ * @since 2.11
9
+ */
10
+
11
+ namespace EDD\Gateways\PayPal\Admin;
12
+
13
+ /**
14
+ * Returns the URL to the PayPal Commerce settings page.
15
+ *
16
+ * @since 2.11
17
+ *
18
+ * @return string
19
+ */
20
+ function get_settings_url() {
21
+ return admin_url( 'edit.php?post_type=download&page=edd-settings&tab=gateways&section=paypal_commerce' );
22
+ }
23
+
24
+ /**
25
+ * Register the PayPal Standard gateway subsection
26
+ *
27
+ * @param array $gateway_sections Current Gateway Tab subsections
28
+ *
29
+ * @since 2.11
30
+ * @return array Gateway subsections with PayPal Standard
31
+ */
32
+ function register_paypal_gateway_section( $gateway_sections ) {
33
+ $gateway_sections['paypal_commerce'] = __( 'PayPal', 'easy-digital-downloads' );
34
+
35
+ return $gateway_sections;
36
+ }
37
+
38
+ add_filter( 'edd_settings_sections_gateways', __NAMESPACE__ . '\register_paypal_gateway_section', 1, 1 );
39
+
40
+ /**
41
+ * Registers the PayPal Standard settings for the PayPal Standard subsection
42
+ *
43
+ * @param array $gateway_settings Gateway tab settings
44
+ *
45
+ * @since 2.11
46
+ * @return array Gateway tab settings with the PayPal Standard settings
47
+ */
48
+ function register_gateway_settings( $gateway_settings ) {
49
+
50
+ $paypal_settings = array(
51
+ 'paypal_settings' => array(
52
+ 'id' => 'paypal_settings',
53
+ 'name' => '<h3>' . __( 'PayPal Settings', 'easy-digital-downloads' ) . '</h3>',
54
+ 'type' => 'header',
55
+ ),
56
+ 'paypal_documentation' => array(
57
+ 'id' => 'paypal_documentation',
58
+ 'name' => __( 'Documentation', 'easy-digital-downloads' ),
59
+ 'desc' => documentation_settings_field(),
60
+ 'type' => 'descriptive_text'
61
+ ),
62
+ 'paypal_connect_button' => array(
63
+ 'id' => 'paypal_connect_button',
64
+ 'name' => __( 'Connection Status', 'easy-digital-downloads' ),
65
+ 'desc' => connect_settings_field(),
66
+ 'type' => 'descriptive_text',
67
+ 'class' => 'edd-paypal-connect-row'
68
+ ),
69
+ 'paypal_sandbox_client_id' => array(
70
+ 'id' => 'paypal_sandbox_client_id',
71
+ 'name' => __( 'Test Client ID', 'easy-digital-downloads' ),
72
+ 'desc' => __( 'Enter your test client ID.', 'easy-digital-downloads' ),
73
+ 'type' => 'text',
74
+ 'size' => 'regular',
75
+ 'class' => 'edd-hidden'
76
+ ),
77
+ 'paypal_sandbox_client_secret' => array(
78
+ 'id' => 'paypal_sandbox_client_secret',
79
+ 'name' => __( 'Test Client Secret', 'easy-digital-downloads' ),
80
+ 'desc' => __( 'Enter your test client secret.', 'easy-digital-downloads' ),
81
+ 'type' => 'password',
82
+ 'size' => 'regular',
83
+ 'class' => 'edd-hidden'
84
+ ),
85
+ 'paypal_live_client_id' => array(
86
+ 'id' => 'paypal_live_client_id',
87
+ 'name' => __( 'Live Client ID', 'easy-digital-downloads' ),
88
+ 'desc' => __( 'Enter your live client ID.', 'easy-digital-downloads' ),
89
+ 'type' => 'text',
90
+ 'size' => 'regular',
91
+ 'class' => 'edd-hidden'
92
+ ),
93
+ 'paypal_live_client_secret' => array(
94
+ 'id' => 'paypal_live_client_secret',
95
+ 'name' => __( 'Live Client Secret', 'easy-digital-downloads' ),
96
+ 'desc' => __( 'Enter your live client secret.', 'easy-digital-downloads' ),
97
+ 'type' => 'password',
98
+ 'size' => 'regular',
99
+ 'class' => 'edd-hidden'
100
+ ),
101
+ );
102
+
103
+ /**
104
+ * Filters the PayPal Settings.
105
+ *
106
+ * @param array $paypal_settings
107
+ */
108
+ $paypal_settings = apply_filters( 'edd_paypal_settings', $paypal_settings );
109
+ $gateway_settings['paypal_commerce'] = $paypal_settings;
110
+
111
+ return $gateway_settings;
112
+ }
113
+
114
+ add_filter( 'edd_settings_gateways', __NAMESPACE__ . '\register_gateway_settings', 1, 1 );
115
+
116
+ /**
117
+ * Returns the content for the documentation settings.
118
+ *
119
+ * @since 2.11
120
+ * @return string
121
+ */
122
+ function documentation_settings_field() {
123
+ ob_start();
124
+ ?>
125
+ <p>
126
+ <?php
127
+ echo wp_kses( sprintf(
128
+ __( 'To learn more about the PayPal gateway, visit <a href="%s" target="_blank">our documentation</a>.', 'easy-digital-downloads' ),
129
+ 'https://docs.easydigitaldownloads.com/article/2410-paypal'
130
+ ), array( 'a' => array( 'href' => true, 'target' => true ) ) )
131
+ ?>
132
+ </p>
133
+ <?php
134
+ if ( ! is_ssl() ) {
135
+ ?>
136
+ <div class="notice notice-warning inline">
137
+ <p>
138
+ <?php
139
+ echo wp_kses( sprintf(
140
+ __( 'PayPal requires an SSL certificate to accept payments. You can learn more about obtaining an SSL certificate in our <a href="%s" target="_blank">SSL setup article</a>.', 'easy-digital-downloads' ),
141
+ 'https://docs.easydigitaldownloads.com/article/994-how-to-set-up-ssl'
142
+ ), array( 'a' => array( 'href' => true, 'target' => true ) ) );
143
+ ?>
144
+ </p>
145
+ </div>
146
+ <?php
147
+ }
148
+
149
+ return ob_get_clean();
150
+ }
includes/gateways/paypal/buy-now.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * PayPal Commerce "Buy Now" Buttons
4
+ *
5
+ * @package easy-digital-downloads
6
+ * @subpackage Gateways\PayPal
7
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
8
+ * @license GPL2+
9
+ */
10
+
11
+ namespace EDD\Gateways\PayPal;
12
+
13
+ /**
14
+ * Determines whether or not Buy Now is enabled for PayPal.
15
+ *
16
+ * @since 2.11
17
+ * @return bool
18
+ */
19
+ function is_buy_now_enabled() {
20
+ return edd_shop_supports_buy_now() && array_key_exists( 'paypal_commerce', edd_get_enabled_payment_gateways() );
21
+ }
22
+
23
+ /**
24
+ * Sets the gateway to `paypal_commerce` when building straight to gateway data.
25
+ * This is technically already set via `edd_build_straight_to_gateway_data()` but we want
26
+ * to make 100% sure we override PayPal Standard when PayPal Commerce is enabled.
27
+ *
28
+ * @param array $purchase_data
29
+ *
30
+ * @since 2.11
31
+ * @return array
32
+ */
33
+ function straight_to_gateway_data( $purchase_data ) {
34
+ if ( is_buy_now_enabled() ) {
35
+ $_REQUEST['edd-gateway'] = 'paypal_commerce';
36
+ $purchase_data['gateway'] = 'paypal_commerce';
37
+ }
38
+
39
+ return $purchase_data;
40
+ }
41
+
42
+ add_filter( 'edd_straight_to_gateway_purchase_data', __NAMESPACE__ . '\straight_to_gateway_data' );
43
+
44
+ /**
45
+ * Adds the `edd-paypal-checkout-buy-now` class to qualified shortcodes.
46
+ *
47
+ * @param array $args
48
+ *
49
+ * @since 2.11
50
+ * @return array
51
+ */
52
+ function maybe_add_purchase_link_class( $args ) {
53
+ if ( ! is_buy_now_enabled() ) {
54
+ return $args;
55
+ }
56
+
57
+ // Don't add class if "Free Downloads" is active and available for this download.
58
+ if ( function_exists( 'edd_free_downloads_use_modal' ) ) {
59
+ if ( edd_free_downloads_use_modal( $args['download_id'] ) && ! edd_has_variable_prices( $args['download_id'] ) ) {
60
+ return $args;
61
+ }
62
+ }
63
+
64
+ // Don't add class if Recurring is enabled for this download.
65
+ if ( function_exists( 'edd_recurring' ) ) {
66
+ // Overall download is recurring.
67
+ if ( edd_recurring()->is_recurring( $args['download_id'] ) ) {
68
+ return $args;
69
+ }
70
+
71
+ // Price ID is recurring.
72
+ if ( ! empty( $args['price_id'] ) && edd_recurring()->is_price_recurring( $args['download_id'], $args['price_id'] ) ) {
73
+ return $args;
74
+ }
75
+ }
76
+
77
+ if ( ! empty( $args['direct'] ) ) {
78
+ $args['class'] .= ' edd-paypal-checkout-buy-now';
79
+ }
80
+
81
+ return $args;
82
+ }
83
+
84
+ add_filter( 'edd_purchase_link_args', __NAMESPACE__ . '\maybe_add_purchase_link_class' );
85
+
86
+ /**
87
+ * Registers PayPal Commerce JavaScript if using "direct" buy now links.
88
+ *
89
+ * @param int $download_id ID of the download.
90
+ * @param array $args Purchase link arguments.
91
+ *
92
+ * @since 2.11
93
+ */
94
+ function maybe_enable_buy_now_js( $download_id, $args ) {
95
+ if ( ! empty( $args['direct'] ) && is_buy_now_enabled() ) {
96
+ register_js( true );
97
+ ?>
98
+ <input type="hidden" name="edd_process_paypal_nonce" value="<?php echo esc_attr( wp_create_nonce( 'edd_process_paypal' ) ); ?>">
99
+ <?php
100
+ }
101
+ }
102
+
103
+ add_action( 'edd_purchase_link_end', __NAMESPACE__ . '\maybe_enable_buy_now_js', 10, 2 );
includes/gateways/paypal/checkout-actions.php ADDED
@@ -0,0 +1,410 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * PayPal Commerce Checkout Actions
4
+ *
5
+ * @package easy-digital-downloads
6
+ * @subpackage Gateways\PayPal
7
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
8
+ * @license GPL2+
9
+ * @since 2.11
10
+ */
11
+
12
+ namespace EDD\Gateways\PayPal;
13
+
14
+ use EDD\Gateways\PayPal\Exceptions\API_Exception;
15
+ use EDD\Gateways\PayPal\Exceptions\Authentication_Exception;
16
+ use EDD\Gateways\PayPal\Exceptions\Gateway_Exception;
17
+
18
+ /**
19
+ * Removes the credit card form for PayPal Commerce
20
+ *
21
+ * @access private
22
+ * @since 2.11
23
+ */
24
+ add_action( 'edd_paypal_commerce_cc_form', '__return_false' );
25
+
26
+ /**
27
+ * Replaces the "Submit" button with a PayPal smart button.
28
+ *
29
+ * @param string $button
30
+ *
31
+ * @since 2.11
32
+ * @return string
33
+ */
34
+ function override_purchase_button( $button ) {
35
+ if ( 'paypal_commerce' === edd_get_chosen_gateway() && edd_get_cart_total() ) {
36
+ ob_start();
37
+ if ( ready_to_accept_payments() ) {
38
+ wp_nonce_field( 'edd_process_paypal', 'edd_process_paypal_nonce' );
39
+ ?>
40
+ <div id="edd-paypal-errors-wrap"></div>
41
+ <div id="edd-paypal-container"></div>
42
+ <div id="edd-paypal-spinner" style="display: none;">
43
+ <span class="edd-loading-ajax edd-loading"></span>
44
+ </div>
45
+ <?php
46
+ /**
47
+ * Triggers right below the button container.
48
+ *
49
+ * @since 2.11
50
+ */
51
+ do_action( 'edd_paypal_after_button_container' );
52
+ } else {
53
+ $error_message = current_user_can( 'manage_options' )
54
+ ? __( 'Please connect your PayPal account in the gateway settings.', 'easy-digital-downloads' )
55
+ : __( 'Unexpected authentication error. Please contact a site administrator.', 'easy-digital-downloads' );
56
+ ?>
57
+ <div class="edd_errors edd-alert edd-alert-error">
58
+ <p class="edd_error">
59
+ <?php echo esc_html( $error_message ); ?>
60
+ </p>
61
+ </div>
62
+ <?php
63
+ }
64
+
65
+ return ob_get_clean();
66
+ }
67
+
68
+ return $button;
69
+ }
70
+
71
+ add_filter( 'edd_checkout_button_purchase', __NAMESPACE__ . '\override_purchase_button', 10000 );
72
+
73
+ /**
74
+ * Sends checkout error messages via AJAX.
75
+ *
76
+ * This overrides the normal error behaviour in `edd_process_purchase_form()` because we *always*
77
+ * want to send errors back via JSON.
78
+ *
79
+ * @param array $user User data.
80
+ * @param array $valid_data Validated form data.
81
+ * @param array $posted Raw $_POST data.
82
+ *
83
+ * @since 2.11
84
+ * @return void
85
+ */
86
+ function send_ajax_errors( $user, $valid_data, $posted ) {
87
+ if ( empty( $valid_data['gateway'] ) || 'paypal_commerce' !== $valid_data['gateway'] ) {
88
+ return;
89
+ }
90
+
91
+ $errors = edd_get_errors();
92
+ if ( $errors ) {
93
+ edd_clear_errors();
94
+
95
+ wp_send_json_error( edd_build_errors_html( $errors ) );
96
+ }
97
+ }
98
+
99
+ add_action( 'edd_checkout_user_error_checks', __NAMESPACE__ . '\send_ajax_errors', 99999, 3 );
100
+
101
+ /**
102
+ * Creates a new order in PayPal and EDD.
103
+ *
104
+ * @param array $purchase_data
105
+ *
106
+ * @since 2.11
107
+ * @return void
108
+ */
109
+ function create_order( $purchase_data ) {
110
+ edd_debug_log( 'PayPal - create_order()' );
111
+
112
+ if ( ! ready_to_accept_payments() ) {
113
+ edd_record_gateway_error(
114
+ __( 'PayPal Gateway Error', 'easy-digital-downloads' ),
115
+ __( 'Account not ready to accept payments.', 'easy-digital-downloads' )
116
+ );
117
+
118
+ $error_message = current_user_can( 'manage_options' )
119
+ ? __( 'Please connect your PayPal account in the gateway settings.', 'easy-digital-downloads' )
120
+ : __( 'Unexpected authentication error. Please contact a site administrator.', 'easy-digital-downloads' );
121
+
122
+ wp_send_json_error( edd_build_errors_html( array(
123
+ 'paypal-error' => $error_message
124
+ ) ) );
125
+ }
126
+
127
+ try {
128
+ // Create pending payment in EDD.
129
+ $payment_args = array(
130
+ 'price' => $purchase_data['price'],
131
+ 'date' => $purchase_data['date'],
132
+ 'user_email' => $purchase_data['user_email'],
133
+ 'purchase_key' => $purchase_data['purchase_key'],
134
+ 'currency' => edd_get_currency(),
135
+ 'downloads' => $purchase_data['downloads'],
136
+ 'cart_details' => $purchase_data['cart_details'],
137
+ 'user_info' => $purchase_data['user_info'],
138
+ 'status' => 'pending',
139
+ 'gateway' => 'paypal_commerce'
140
+ );
141
+
142
+ $payment_id = edd_insert_payment( $payment_args );
143
+
144
+ if ( ! $payment_id ) {
145
+ throw new Gateway_Exception(
146
+ __( 'An unexpected error occurred. Please try again.', 'easy-digital-downloads' ),
147
+ 500,
148
+ sprintf(
149
+ 'Payment creation failed before sending buyer to PayPal. Payment data: %s',
150
+ json_encode( $payment_args )
151
+ )
152
+ );
153
+ }
154
+
155
+ $order_amount = array(
156
+ 'currency_code' => edd_get_currency(),
157
+ 'value' => (string) $purchase_data['price']
158
+ );
159
+ if ( (float) $purchase_data['tax'] > 0 ) {
160
+ $order_amount['breakdown'] = array(
161
+ 'item_total' => array(
162
+ 'currency_code' => edd_get_currency(),
163
+ 'value' => (string) ( $purchase_data['price'] - $purchase_data['tax'] )
164
+ ),
165
+ 'tax_total' => array(
166
+ 'currency_code' => edd_get_currency(),
167
+ 'value' => (string) $purchase_data['tax']
168
+ )
169
+ );
170
+ }
171
+
172
+ $order_data = array(
173
+ 'intent' => 'CAPTURE',
174
+ 'purchase_units' => array(
175
+ array(
176
+ // @todo We could put the breakdown here (tax, discount, etc.)
177
+ 'reference_id' => $payment_args['purchase_key'],
178
+ 'amount' => $order_amount,
179
+ 'custom_id' => $payment_id
180
+ )
181
+ ),
182
+ 'application_context' => array(
183
+ //'locale' => get_locale(), // PayPal doesn't like this. Might be able to replace `_` with `-`
184
+ 'shipping_preference' => 'NO_SHIPPING',
185
+ 'user_action' => 'PAY_NOW',
186
+ 'return_url' => edd_get_checkout_uri(),
187
+ 'cancel_url' => edd_get_failed_transaction_uri( '?payment-id=' . urlencode( $payment_id ) )
188
+ ),
189
+ 'payment_instructions' => array(
190
+ 'disbursement_mode' => 'INSTANT'
191
+ )
192
+ );
193
+
194
+ // Add payer data if we have it. We won't have it when using Buy Now buttons.
195
+ if ( ! empty( $purchase_data['user_email'] ) ) {
196
+ $order_data['payer']['email_address'] = $purchase_data['user_email'];
197
+ }
198
+ if ( ! empty( $purchase_data['user_info']['first_name'] ) ) {
199
+ $order_data['payer']['name']['given_name'] = $purchase_data['user_info']['first_name'];
200
+ }
201
+ if ( ! empty( $purchase_data['user_info']['last_name'] ) ) {
202
+ $order_data['payer']['name']['surname'] = $purchase_data['user_info']['last_name'];
203
+ }
204
+
205
+ /**
206
+ * Filters the arguments sent to PayPal.
207
+ *
208
+ * @param array $order_data API request arguments.
209
+ * @param array $purchase_data Purchase data.
210
+ * @param int $payment_id ID of the EDD payment.
211
+ *
212
+ * @since 2.11
213
+ */
214
+ $order_data = apply_filters( 'edd_paypal_order_arguments', $order_data, $purchase_data, $payment_id );
215
+
216
+ try {
217
+ $api = new API();
218
+ $response = $api->make_request( 'v2/checkout/orders', $order_data );
219
+
220
+ if ( ! isset( $response->id ) ) {
221
+ throw new Gateway_Exception(
222
+ __( 'An error occurred while communicating with PayPal. Please try again.', 'easy-digital-downloads' ),
223
+ $api->last_response_code,
224
+ sprintf(
225
+ 'Unexpected response when creating order: %s',
226
+ json_encode( $response )
227
+ )
228
+ );
229
+ }
230
+
231
+ edd_debug_log( sprintf( '-- Successful PayPal response. PayPal order ID: %s; EDD order ID: %d', esc_html( $response->id ), $payment_id ) );
232
+
233
+ edd_update_payment_meta( $payment_id, 'paypal_order_id', sanitize_text_field( $response->id ) );
234
+
235
+ /*
236
+ * Send successfully created order ID back.
237
+ * We also send back a new nonce, for verification in the next step: `capture_order()`.
238
+ * If the user was just logged into a new account, the previously sent nonce may have
239
+ * become invalid.
240
+ */
241
+ wp_send_json_success( array(
242
+ 'paypal_order_id' => $response->id,
243
+ 'edd_order_id' => $payment_id,
244
+ 'nonce' => wp_create_nonce( 'edd_process_paypal' )
245
+ ) );
246
+ } catch ( Authentication_Exception $e ) {
247
+ throw new Gateway_Exception( __( 'An authentication error occurred. Please try again.', 'easy-digital-downloads' ), $e->getCode(), $e->getMessage() );
248
+ } catch ( API_Exception $e ) {
249
+ throw new Gateway_Exception( __( 'An error occurred while communicating with PayPal. Please try again.', 'easy-digital-downloads' ), $e->getCode(), $e->getMessage() );
250
+ }
251
+ } catch ( Gateway_Exception $e ) {
252
+ if ( ! isset( $payment_id ) ) {
253
+ $payment_id = 0;
254
+ }
255
+
256
+ $e->record_gateway_error( $payment_id );
257
+
258
+ wp_send_json_error( edd_build_errors_html( array(
259
+ 'paypal-error' => $e->getMessage()
260
+ ) ) );
261
+ }
262
+ }
263
+
264
+ add_action( 'edd_gateway_paypal_commerce', __NAMESPACE__ . '\create_order', 9 );
265
+
266
+ /**
267
+ * Captures the order in PayPal
268
+ *
269
+ * @since 2.11
270
+ */
271
+ function capture_order() {
272
+ edd_debug_log( 'PayPal - capture_order()' );
273
+ try {
274
+ if ( empty( $_POST['edd_process_paypal_nonce'] ) ) {
275
+ throw new Gateway_Exception(
276
+ __( 'A validation error occurred. Please try again.', 'easy-digital-downloads' ),
277
+ 400,
278
+ 'Missing approval nonce.'
279
+ );
280
+ }
281
+
282
+ if ( ! wp_verify_nonce( $_POST['edd_process_paypal_nonce'], 'edd_process_paypal' ) ) {
283
+ throw new Gateway_Exception(
284
+ __( 'A validation error occurred. Please try again.', 'easy-digital-downloads' ),
285
+ 403,
286
+ 'Nonce validation failed.'
287
+ );
288
+ }
289
+
290
+ if ( empty( $_POST['paypal_order_id'] ) ) {
291
+ throw new Gateway_Exception(
292
+ __( 'An unexpected error occurred. Please try again.', 'easy-digital-downloads' ),
293
+ 400,
294
+ 'Missing PayPal order ID during capture.'
295
+ );
296
+ }
297
+
298
+ try {
299
+ $api = new API();
300
+ $response = $api->make_request( 'v2/checkout/orders/' . urlencode( $_POST['paypal_order_id'] ) . '/capture' );
301
+
302
+ edd_debug_log( sprintf( '-- PayPal Response code: %d; order ID: %s', $api->last_response_code, esc_html( $_POST['paypal_order_id'] ) ) );
303
+
304
+ if ( ! in_array( $api->last_response_code, array( 200, 201 ) ) ) {
305
+ $message = ! empty( $response->message ) ? $response->message : __( 'Failed to process payment. Please try again.', 'easy-digital-downloads' );
306
+
307
+ /*
308
+ * If capture failed due to funding source, we want to send a `restart` back to PayPal.
309
+ * @link https://developer.paypal.com/docs/checkout/integration-features/funding-failure/
310
+ */
311
+ if ( ! empty( $response->details ) && is_array( $response->details ) ) {
312
+ foreach ( $response->details as $detail ) {
313
+ if ( isset( $detail->issue ) && 'INSTRUMENT_DECLINED' === $detail->issue ) {
314
+ $message = __( 'Unable to complete your order with your chosen payment method. Please choose a new funding source.', 'easy-digital-downloads' );
315
+ $retry = true;
316
+ break;
317
+ }
318
+ }
319
+ }
320
+
321
+ throw new Gateway_Exception(
322
+ $message,
323
+ 400,
324
+ sprintf( 'Order capture failure. PayPal response: %s', json_encode( $response ) )
325
+ );
326
+ }
327
+
328
+ $payment = $transaction_id = false;
329
+ if ( isset( $response->purchase_units ) && is_array( $response->purchase_units ) ) {
330
+ foreach ( $response->purchase_units as $purchase_unit ) {
331
+ if ( ! empty( $purchase_unit->reference_id ) ) {
332
+ $payment = edd_get_payment_by( 'key', $purchase_unit->reference_id );
333
+ $transaction_id = isset( $purchase_unit->payments->captures[0]->id ) ? $purchase_unit->payments->captures[0]->id : false;
334
+ break;
335
+ }
336
+ }
337
+ }
338
+
339
+ if ( ! empty( $payment ) ) {
340
+ if ( ! empty( $response->status ) && 'COMPLETED' === strtoupper( $response->status ) ) {
341
+ $payment->status = 'complete';
342
+ }
343
+
344
+ /**
345
+ * Buy Now Button
346
+ *
347
+ * Fill in missing data when using "Buy Now". This bypasses checkout so not all information
348
+ * was collected prior to payment. Instead, we pull it from the PayPal info.
349
+ */
350
+ if ( empty( $payment->email ) ) {
351
+ if ( ! empty( $response->payer->email_address ) ) {
352
+ $payment->email = sanitize_text_field( $response->payer->email_address );
353
+ }
354
+ if ( empty( $payment->first_name ) && ! empty( $response->payer->name->given_name ) ) {
355
+ $payment->first_name = sanitize_text_field( $response->payer->name->given_name );
356
+ }
357
+ if ( empty( $payment->last_name ) && ! empty( $response->payer->name->surname ) ) {
358
+ $payment->last_name = sanitize_text_field( $response->payer->name->surname );
359
+ }
360
+
361
+ if ( empty( $payment->customer_id ) && ! empty( $payment->email ) ) {
362
+ $customer = new \EDD_Customer( $payment->email );
363
+
364
+ if ( $customer->id < 1 ) {
365
+ $customer->create( array(
366
+ 'email' => $payment->email,
367
+ 'name' => trim( sprintf( '%s %s', $payment->first_name, $payment->last_name ) ),
368
+ 'user_id' => $payment->user_id
369
+ ) );
370
+ }
371
+ }
372
+ }
373
+
374
+ if ( ! empty( $transaction_id ) ) {
375
+ $payment->transaction_id = sanitize_text_field( $transaction_id );
376
+
377
+ edd_insert_payment_note( $payment->ID, sprintf(
378
+ /* Translators: %s - transaction ID */
379
+ __( 'PayPal Transaction ID: %s', 'easy-digital-downloads' ),
380
+ esc_html( $transaction_id )
381
+ ) );
382
+ }
383
+
384
+ $payment->save();
385
+ }
386
+
387
+ wp_send_json_success( array( 'redirect_url' => edd_get_success_page_uri() ) );
388
+ } catch ( Authentication_Exception $e ) {
389
+ throw new Gateway_Exception( __( 'An authentication error occurred. Please try again.', 'easy-digital-downloads' ), $e->getCode(), $e->getMessage() );
390
+ } catch ( API_Exception $e ) {
391
+ throw new Gateway_Exception( __( 'An error occurred while communicating with PayPal. Please try again.', 'easy-digital-downloads' ), $e->getCode(), $e->getMessage() );
392
+ }
393
+ } catch ( Gateway_Exception $e ) {
394
+ if ( ! isset( $payment_id ) ) {
395
+ $payment_id = 0;
396
+ }
397
+
398
+ $e->record_gateway_error( $payment_id );
399
+
400
+ wp_send_json_error( array(
401
+ 'message' => edd_build_errors_html( array(
402
+ 'paypal_capture_failure' => $e->getMessage()
403
+ ) ),
404
+ 'retry' => isset( $retry ) ? $retry : false
405
+ ) );
406
+ }
407
+ }
408
+
409
+ add_action( 'wp_ajax_nopriv_edd_capture_paypal_order', __NAMESPACE__ . '\capture_order' );
410
+ add_action( 'wp_ajax_edd_capture_paypal_order', __NAMESPACE__ . '\capture_order' );
includes/gateways/paypal/class-account-status-validator.php ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Account Status Validator
4
+ *
5
+ * This validator helps to check the status of a PayPal merchant account
6
+ * and ensure it's ready to receive payments. This is used to display
7
+ * the connection status on the admin settings page, and also to help
8
+ * determine if we should allow the merchant to start processing payments.
9
+ *
10
+ * @package easy-digital-downloads
11
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
12
+ * @license GPL2+
13
+ * @since 2.11
14
+ */
15
+
16
+ namespace EDD\Gateways\PayPal;
17
+
18
+ use EDD\Gateways\PayPal;
19
+
20
+ class AccountStatusValidator {
21
+
22
+ /**
23
+ * @var bool Whether or not we have REST API credentials.
24
+ */
25
+ public $has_rest_credentials = false;
26
+
27
+ /**
28
+ * @var \WP_Error Errors thrown when checking REST API credentials.
29
+ */
30
+ public $errors_for_credentials;
31
+
32
+ /**
33
+ * @var array|false Merchant details, if any.
34
+ */
35
+ public $merchant_details = false;
36
+
37
+ /**
38
+ * @var \WP_Error Errors thrown when checking merchant account status.
39
+ */
40
+ public $errors_for_merchant_account;
41
+
42
+ /**
43
+ * @var null|object Webhook object from the API.
44
+ */
45
+ public $webhook;
46
+
47
+ /**
48
+ * @var array Enabled webhook event names.
49
+ */
50
+ public $enabled_webhook_events = array();
51
+
52
+ /**
53
+ * @var \WP_Error Errors thrown when checking webhook status.
54
+ */
55
+ public $errors_for_webhook;
56
+
57
+ /**
58
+ * @var string Identifier of the connected account -- if available.
59
+ */
60
+ public $connected_account = '';
61
+
62
+ /**
63
+ * @var string Current store mode.
64
+ */
65
+ private $mode;
66
+
67
+ /**
68
+ * AccountStatusValidator constructor.
69
+ *
70
+ * @param string $mode Mode to check (`live` or `sandbox`). If omitted, current store mode is used.
71
+ */
72
+ public function __construct( $mode = '' ) {
73
+ if ( empty( $mode ) ) {
74
+ $mode = edd_is_test_mode() ? PayPal\API::MODE_SANDBOX : PayPal\API::MODE_LIVE;
75
+ }
76
+ $this->mode = $mode;
77
+
78
+ // Set up base error objects.
79
+ $this->errors_for_credentials = new \WP_Error();
80
+ $this->errors_for_merchant_account = new \WP_Error();
81
+ $this->errors_for_webhook = new \WP_Error();
82
+ }
83
+
84
+ /**
85
+ * Checks everything.
86
+ *
87
+ * @since 2.11
88
+ */
89
+ public function check() {
90
+ $this->check_rest();
91
+ $this->check_merchant_account();
92
+ $this->check_webhook();
93
+ }
94
+
95
+ /**
96
+ * Checks for valid REST API credentials.
97
+ *
98
+ * @since 2.11
99
+ */
100
+ public function check_rest() {
101
+ $credentials = array(
102
+ 'client_id' => edd_get_option( 'paypal_' . $this->mode . '_client_id' ),
103
+ 'client_secret' => edd_get_option( 'paypal_' . $this->mode . '_client_secret' ),
104
+ );
105
+
106
+ foreach ( $credentials as $credential ) {
107
+ if ( empty( $credential ) ) {
108
+ $this->errors_for_credentials->add( 'no_credentials', __( 'Not connected.', 'easy-digital-downloads' ) );
109
+ break;
110
+ }
111
+ }
112
+ }
113
+
114
+ /**
115
+ * Determines if the merchant account is ready to accept payments.
116
+ * It's possible (I think) to have valid API credentials ( @see AccountStatusValidator::check_rest() )
117
+ * but still be unable to start taking payments, such as because your account
118
+ * email hasn't been confirmed yet.
119
+ *
120
+ * @since 2.11
121
+ */
122
+ public function check_merchant_account() {
123
+ try {
124
+ $this->merchant_details = MerchantAccount::retrieve();
125
+ $this->merchant_details->validate();
126
+
127
+ if ( ! $this->merchant_details->is_account_ready() ) {
128
+ foreach ( $this->merchant_details->get_errors()->get_error_codes() as $code ) {
129
+ $this->errors_for_merchant_account->add( $code, $this->merchant_details->get_errors()->get_error_message( $code ) );
130
+ }
131
+ }
132
+ } catch ( Exceptions\MissingMerchantDetails $e ) {
133
+ $this->errors_for_merchant_account->add( 'missing_merchant_details', __( 'Missing merchant details from PayPal. Please reconnect and make sure you click the button to be redirected back to your site.', 'easy-digital-downloads' ) );
134
+ } catch ( Exceptions\InvalidMerchantDetails $e ) {
135
+ $this->errors_for_merchant_account->add( 'invalid_merchant_details', $e->getMessage() );
136
+ }
137
+ }
138
+
139
+ /**
140
+ * Confirms that the webhook is set up and has all the necessary events registered.
141
+ *
142
+ * @since 2.11
143
+ */
144
+ public function check_webhook() {
145
+ try {
146
+ $this->webhook = Webhooks\get_webhook_details( $this->mode );
147
+ if ( empty( $this->webhook->id ) ) {
148
+ throw new \Exception( __( 'Webhook not configured. Some actions may not work properly.', 'easy-digital-downloads' ) );
149
+ }
150
+
151
+ // Now compare the events to make sure we have them all.
152
+ $expected_events = array_keys( Webhooks\get_webhook_events( $this->mode ) );
153
+
154
+ if ( ! empty( $this->webhook->event_types ) && is_array( $this->webhook->event_types ) ) {
155
+ foreach ( $this->webhook->event_types as $event_type ) {
156
+ if ( ! empty( $event_type->name ) && ! empty( $event_type->status ) && 'ENABLED' === strtoupper( $event_type->status ) ) {
157
+ $this->enabled_webhook_events[] = $event_type->name;
158
+ }
159
+ }
160
+ }
161
+
162
+ $missing_events = array_diff( $expected_events, $this->enabled_webhook_events );
163
+ $number_missing = count( $missing_events );
164
+
165
+ if ( $number_missing ) {
166
+ $this->errors_for_webhook->add( 'missing_events', _n(
167
+ 'Webhook is configured but missing an event. Click "Sync Webhook" to correct this.',
168
+ 'Webhook is configured but missing events. Click "Sync Webhook" to correct this.',
169
+ $number_missing,
170
+ 'easy-digital-downloads'
171
+ ) );
172
+ }
173
+ } catch ( \Exception $e ) {
174
+ $this->errors_for_webhook->add( 'webhook_missing', $e->getMessage() );
175
+ }
176
+ }
177
+
178
+ }
includes/gateways/paypal/class-merchant-account.php ADDED
@@ -0,0 +1,193 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * PayPal Merchant Account Details
4
+ *
5
+ * Contains information about the connected PayPal account.
6
+ *
7
+ * @package easy-digital-downloads
8
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
9
+ * @license GPL2+
10
+ * @since 2.11
11
+ */
12
+
13
+ namespace EDD\Gateways\PayPal;
14
+
15
+ use EDD\Gateways\PayPal\Exceptions\InvalidMerchantDetails;
16
+ use EDD\Gateways\PayPal\Exceptions\MissingMerchantDetails;
17
+
18
+ class MerchantAccount {
19
+
20
+ /**
21
+ * @var string Merchant ID of the seller's PayPal account.
22
+ */
23
+ public $merchant_id;
24
+
25
+ /**
26
+ * @var bool Indicates whether the seller account can receive payments.
27
+ */
28
+ public $payments_receivable;
29
+
30
+ /**
31
+ * @var bool Indicates whether the primary email of the seller has been confirmed.
32
+ */
33
+ public $primary_email_confirmed;
34
+
35
+ /**
36
+ * @var array An array of all products that are integrated with the partner for the seller.
37
+ */
38
+ public $products;
39
+
40
+ /**
41
+ * @var \WP_Error
42
+ */
43
+ private $wp_error;
44
+
45
+ /**
46
+ * MerchantAccount constructor.
47
+ *
48
+ * @param array $details
49
+ */
50
+ public function __construct( $details ) {
51
+ foreach ( $details as $key => $value ) {
52
+ $this->{$key} = $value;
53
+ }
54
+
55
+ $this->wp_error = new \WP_Error();
56
+ }
57
+
58
+ /**
59
+ * Builds a new MerchantAccount object from a JSON object.
60
+ *
61
+ * @since 2.11
62
+ *
63
+ * @param string $json
64
+ *
65
+ * @return MerchantAccount
66
+ */
67
+ public static function from_json( $json ) {
68
+ $merchant_details = json_decode( $json, true );
69
+ if ( empty( $merchant_details ) || ! is_array( $merchant_details ) ) {
70
+ $merchant_details = array();
71
+ }
72
+
73
+ return new MerchantAccount( $merchant_details );
74
+ }
75
+
76
+ /**
77
+ * Converts the account details to JSON.
78
+ *
79
+ * @since 2.11
80
+ *
81
+ * @return string|false
82
+ */
83
+ public function to_json() {
84
+ return json_encode( get_object_vars( $this ) );
85
+ }
86
+
87
+ /**
88
+ * Determines whether or not the details are valid.
89
+ * Note: This does NOT determine actual "ready to accept payments" status, it just
90
+ * verifies that we have all the information we need to determine that.
91
+ *
92
+ * @throws MissingMerchantDetails
93
+ * @throws InvalidMerchantDetails
94
+ */
95
+ public function validate() {
96
+ if ( empty( $this->merchant_id ) ) {
97
+ throw new MissingMerchantDetails();
98
+ }
99
+
100
+ $required_properties = array(
101
+ 'merchant_id',
102
+ 'payments_receivable',
103
+ 'primary_email_confirmed',
104
+ 'products',
105
+ );
106
+
107
+ $valid_properties = array();
108
+ foreach( $required_properties as $property ) {
109
+ if ( property_exists( $this, $property ) && ! is_null( $this->{$property} ) ) {
110
+ $valid_properties[] = $property;
111
+ }
112
+ }
113
+
114
+ $difference = array_diff( $required_properties, $valid_properties );
115
+
116
+ if ( $difference ) {
117
+ throw new InvalidMerchantDetails(
118
+ 'Please click "Re-Check Payment Status" below to confirm your payment status.'
119
+ );
120
+ }
121
+ }
122
+
123
+ /**
124
+ * Determines whether or not the account is ready to accept payments.
125
+ *
126
+ * @since 2.11
127
+ *
128
+ * @return bool
129
+ */
130
+ public function is_account_ready() {
131
+ if ( ! $this->payments_receivable ) {
132
+ $this->wp_error->add( 'payments_receivable', __( 'Your account is unable to receive payments. Please contact PayPal customer support.', 'easy-digital-downloads' ) );
133
+ }
134
+
135
+ if ( ! $this->primary_email_confirmed ) {
136
+ $this->wp_error->add(
137
+ 'primary_email_confirmed',
138
+ __( 'Your PayPal email address needs to be confirmed.', 'easy-digital-downloads' )
139
+ );
140
+ }
141
+
142
+ return empty( $this->wp_error->errors );
143
+ }
144
+
145
+ /**
146
+ * Retrieves errors preventing the account from being "ready".
147
+ *
148
+ * @see MerchantAccount::is_account_ready()
149
+ *
150
+ * @since 2.11
151
+ *
152
+ * @return \WP_Error
153
+ */
154
+ public function get_errors() {
155
+ return $this->wp_error;
156
+ }
157
+
158
+ /**
159
+ * Returns the option name for the current mode.
160
+ *
161
+ * @since 2.11
162
+ *
163
+ * @return string
164
+ */
165
+ private static function get_option_name() {
166
+ return sprintf(
167
+ 'edd_paypal_%s_merchant_details',
168
+ edd_is_test_mode() ? API::MODE_SANDBOX : API::MODE_LIVE
169
+ );
170
+ }
171
+
172
+ /**
173
+ * Saves the merchant details.
174
+ *
175
+ * @since 2.11
176
+ */
177
+ public function save() {
178
+ update_option( self::get_option_name(), $this->to_json() );
179
+ }
180
+
181
+ /**
182
+ * Retrieves the saved merchant details.
183
+ *
184
+ * @since 2.11
185
+ *
186
+ * @return MerchantAccount
187
+ * @throws \InvalidArgumentException
188
+ */
189
+ public static function retrieve() {
190
+ return self::from_json( get_option( self::get_option_name(), '' ) );
191
+ }
192
+
193
+ }
includes/gateways/paypal/class-paypal-api.php ADDED
@@ -0,0 +1,269 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * PayPal REST API Wrapper
4
+ *
5
+ * @package easy-digital-downloads
6
+ * @subpackage Gateways\PayPal
7
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
8
+ * @license GPL2+
9
+ * @since 2.11
10
+ */
11
+
12
+ namespace EDD\Gateways\PayPal;
13
+
14
+ use EDD\Gateways\PayPal\Exceptions\API_Exception;
15
+ use EDD\Gateways\PayPal\Exceptions\Authentication_Exception;
16
+
17
+ /**
18
+ * Class API
19
+ *
20
+ * @property string $mode
21
+ * @property string $api_url
22
+ * @property string $client_id
23
+ * @property string $client_secret
24
+ * @property string $token_cache_key
25
+ * @property int $last_response_code
26
+ *
27
+ * @package EDD\PayPal
28
+ */
29
+ class API {
30
+
31
+ const MODE_SANDBOX = 'sandbox';
32
+ const MODE_LIVE = 'live';
33
+
34
+ /**
35
+ * Mode to use for API requests
36
+ *
37
+ * @var string
38
+ */
39
+ private $mode;
40
+
41
+ /**
42
+ * Base API URL
43
+ *
44
+ * @var string
45
+ */
46
+ private $api_url;
47
+
48
+ /**
49
+ * Client ID
50
+ *
51
+ * @var string
52
+ */
53
+ private $client_id;
54
+
55
+ /**
56
+ * Client secret
57
+ *
58
+ * @var string
59
+ */
60
+ private $client_secret;
61
+
62
+ /**
63
+ * Cache key to use for the token.
64
+ *
65
+ * @var string
66
+ */
67
+ private $token_cache_key;
68
+
69
+ /**
70
+ * Response code from the last API request.
71
+ *
72
+ * @var int
73
+ */
74
+ private $last_response_code;
75
+
76
+ /**
77
+ * API constructor.
78
+ *
79
+ * @param string $mode Mode to connect in. Either `sandbox` or `live`.
80
+ * @param array $credentials Optional. Credentials to use for the connection. If omitted, saved store
81
+ * credentials are used.
82
+ *
83
+ * @throws Authentication_Exception
84
+ */
85
+ public function __construct( $mode = '', $credentials = array() ) {
86
+ // If mode is not provided, use the current store mode.
87
+ if ( empty( $mode ) ) {
88
+ $mode = edd_is_test_mode() ? self::MODE_SANDBOX : self::MODE_LIVE;
89
+ }
90
+
91
+ $this->mode = $mode;
92
+
93
+ if ( self::MODE_SANDBOX === $mode ) {
94
+ $this->api_url = 'https://api-m.sandbox.paypal.com';
95
+ } else {
96
+ $this->api_url = 'https://api-m.paypal.com';
97
+ }
98
+
99
+ if ( empty( $credentials ) ) {
100
+ $credentials = array(
101
+ 'client_id' => edd_get_option( 'paypal_' . $this->mode . '_client_id' ),
102
+ 'client_secret' => edd_get_option( 'paypal_' . $this->mode . '_client_secret' ),
103
+ );
104
+ }
105
+
106
+ $this->set_credentials( $credentials );
107
+ }
108
+
109
+ /**
110
+ * Magic getter
111
+ *
112
+ * @param string $property
113
+ *
114
+ * @since 2.10
115
+ * @return mixed
116
+ */
117
+ public function __get( $property ) {
118
+ return isset( $this->{$property} ) ? $this->{$property} : null;
119
+ }
120
+
121
+ /**
122
+ * Sets the credentials to use for API requests.
123
+ *
124
+ * @param array $creds {
125
+ * Credentials to set.
126
+ *
127
+ * @type string $client_id PayPal client ID.
128
+ * @type string $client_secret PayPal client secret.
129
+ * @type string $cache_key Cache key used for storing the access token until it expires. Should be unique to
130
+ * the set of credentials. The mode is automatically appended, so should not be
131
+ * included manually.
132
+ * }
133
+ *
134
+ * @since 2.11
135
+ * @throws Authentication_Exception
136
+ */
137
+ public function set_credentials( $creds ) {
138
+ $creds = wp_parse_args( $creds, array(
139
+ 'client_id' => '',
140
+ 'client_secret' => '',
141
+ 'cache_key' => 'edd_paypal_commerce_access_token'
142
+ ) );
143
+
144
+ $required_creds = array( 'client_id', 'client_secret', 'cache_key' );
145
+
146
+ foreach ( $required_creds as $cred_id ) {
147
+ if ( empty( $creds[ $cred_id ] ) ) {
148
+ throw new Authentication_Exception( sprintf(
149
+ /* Translators: %s - The ID of the PayPal credential */
150
+ __( 'Missing PayPal credential: %s', 'easy-digital-downloads' ),
151
+ $cred_id
152
+ ) );
153
+ }
154
+ }
155
+
156
+ foreach ( $creds as $cred_id => $cred_value ) {
157
+ $this->{$cred_id} = $cred_value;
158
+ }
159
+
160
+ $this->token_cache_key = sanitize_key( $creds['cache_key'] . '_' . $this->mode );
161
+ }
162
+
163
+ /**
164
+ * Retrieves the access token. This checks cache first, and if the cached token isn't valid then
165
+ * a new one is generated from the API.
166
+ *
167
+ * @since 2.11
168
+ * @return Token
169
+ * @throws API_Exception
170
+ */
171
+ public function get_access_token() {
172
+ try {
173
+ $token = Token::from_json( (string) get_option( $this->token_cache_key ) );
174
+
175
+ return ! $token->is_expired() ? $token : $this->generate_access_token();
176
+ } catch ( \RuntimeException $e ) {
177
+ return $this->generate_access_token();
178
+ }
179
+ }
180
+
181
+ /**
182
+ * Generates a new access token and caches it.
183
+ *
184
+ * @since 2.11
185
+ * @return Token
186
+ * @throws API_Exception
187
+ */
188
+ private function generate_access_token() {
189
+ $response = wp_remote_post( $this->api_url . '/v1/oauth2/token', array(
190
+ 'headers' => array(
191
+ 'Content-Type' => 'application/x-www-form-urlencoded',
192
+ 'Authorization' => sprintf( 'Basic %s', base64_encode( sprintf( '%s:%s', $this->client_id, $this->client_secret ) ) ),
193
+ 'timeout' => 15
194
+ ),
195
+ 'body' => array(
196
+ 'grant_type' => 'client_credentials'
197
+ )
198
+ ) );
199
+
200
+ $body = json_decode( wp_remote_retrieve_body( $response ) );
201
+ $code = intval( wp_remote_retrieve_response_code( $response ) );
202
+
203
+ if ( is_wp_error( $response ) ) {
204
+ throw new API_Exception( $response->get_error_message(), $code );
205
+ }
206
+
207
+ if ( ! empty( $body->error_description ) ) {
208
+ throw new API_Exception( $body->error_description, $code );
209
+ }
210
+
211
+ if ( 200 !== $code ) {
212
+ throw new API_Exception( sprintf(
213
+ /* Translators: %d - HTTP response code. */
214
+ __( 'Unexpected response code: %d', 'easy-digital-downloads' ),
215
+ $code
216
+ ), $code );
217
+ }
218
+
219
+ $token = new Token( $body );
220
+
221
+ update_option( $this->token_cache_key, $token->to_json() );
222
+
223
+ return $token;
224
+ }
225
+
226
+ /**
227
+ * Makes an API request.
228
+ *
229
+ * @param string $endpoint API endpoint.
230
+ * @param array $body Array of data to send in the request.
231
+ * @param array $headers Array of headers.
232
+ * @param string $method HTTP method.
233
+ *
234
+ * @since 2.11
235
+ * @return mixed
236
+ * @throws API_Exception
237
+ */
238
+ public function make_request( $endpoint, $body = array(), $headers = array(), $method = 'POST' ) {
239
+ $headers = wp_parse_args( $headers, array(
240
+ 'Content-Type' => 'application/json',
241
+ 'Authorization' => sprintf( 'Bearer %s', $this->get_access_token()->token() ),
242
+ 'PayPal-Partner-Attribution-Id' => EDD_PAYPAL_PARTNER_ATTRIBUTION_ID
243
+ ) );
244
+
245
+ $request_args = array(
246
+ 'method' => $method,
247
+ 'timeout' => 15,
248
+ 'headers' => $headers
249
+ );
250
+
251
+ if ( ! empty( $body ) ) {
252
+ $request_args['body'] = json_encode( $body );
253
+ }
254
+
255
+ // In a few rare cases, we may be providing a full URL to `$endpoint` instead of just the path.
256
+ $api_url = ( 'https://' === substr( $endpoint, 0, 8 ) ) ? $endpoint : $this->api_url . '/' . $endpoint;
257
+
258
+ $response = wp_remote_request( $api_url, $request_args );
259
+
260
+ if ( is_wp_error( $response ) ) {
261
+ throw new API_Exception( $response->get_error_message() );
262
+ }
263
+
264
+ $this->last_response_code = intval( wp_remote_retrieve_response_code( $response ) );
265
+
266
+ return json_decode( wp_remote_retrieve_body( $response ) );
267
+ }
268
+
269
+ }
includes/gateways/paypal/class-token.php ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * PayPal REST API Token
4
+ *
5
+ * @package easy-digital-downloads
6
+ * @subpackage Gateways\PayPal
7
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
8
+ * @license GPL2+
9
+ */
10
+
11
+ namespace EDD\Gateways\PayPal;
12
+
13
+ class Token {
14
+
15
+ /**
16
+ * Token object
17
+ *
18
+ * @var object
19
+ */
20
+ private $token_object;
21
+
22
+ /**
23
+ * Token constructor.
24
+ *
25
+ * @param $token_object
26
+ *
27
+ * @throws \RuntimeException
28
+ */
29
+ public function __construct( $token_object ) {
30
+ if ( is_object( $token_object ) && ! isset( $token_object->created ) ) {
31
+ $token_object->created = time();
32
+ }
33
+
34
+ if ( ! $this->is_valid( $token_object ) ) {
35
+ throw new \RuntimeException( __( 'Invalid token.', 'easy-digital-downloads' ) );
36
+ }
37
+
38
+ $this->token_object = $token_object;
39
+ }
40
+
41
+ /**
42
+ * Creates a new token from a JSON string.
43
+ *
44
+ * @param string $json
45
+ *
46
+ * @return Token
47
+ * @throws \Exception
48
+ */
49
+ public static function from_json( $json ) {
50
+ return new Token( json_decode( $json ) );
51
+ }
52
+
53
+ /**
54
+ * Returns the token object as a JSON string.
55
+ *
56
+ * @since 2.11
57
+ * @return string|false
58
+ */
59
+ public function to_json() {
60
+ return json_encode( $this->token_object );
61
+ }
62
+
63
+ /**
64
+ * Determines whether or not the token has expired.
65
+ *
66
+ * @since 2.11
67
+ * @return bool
68
+ */
69
+ public function is_expired() {
70
+ // Regenerate tokens 10 minutes early, just in case.
71
+ $expires_in = $this->token_object->expires_in - ( 10 * MINUTE_IN_SECONDS );
72
+
73
+ return time() > $this->token_object->created + $expires_in;
74
+ }
75
+
76
+ /**
77
+ * Returns the access token.
78
+ *
79
+ * @since 2.11
80
+ * @return string
81
+ */
82
+ public function token() {
83
+ return $this->token_object->access_token;
84
+ }
85
+
86
+ /**
87
+ * Determines whether or not we have a valid token object.
88
+ * Note: This does not check the _expiration_ of the token, just validates that the expected
89
+ * data is _present_.
90
+ *
91
+ * @param object $token_object
92
+ *
93
+ * @since 2.11
94
+ * @return bool
95
+ */
96
+ private function is_valid( $token_object ) {
97
+ $required_properties = array(
98
+ 'created',
99
+ 'access_token',
100
+ 'expires_in'
101
+ );
102
+
103
+ foreach ( $required_properties as $property ) {
104
+ if ( ! isset( $token_object->{$property} ) ) {
105
+ return false;
106
+ }
107
+ }
108
+
109
+ return true;
110
+ }
111
+
112
+ }
includes/gateways/paypal/exceptions/class-api-exception.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * API Exception
4
+ *
5
+ * Thrown when an API request has failed.
6
+ *
7
+ * @package easy-digital-downloads
8
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
9
+ * @license GPL2+
10
+ * @since 2.11
11
+ */
12
+
13
+ namespace EDD\Gateways\PayPal\Exceptions;
14
+
15
+ class API_Exception extends \Exception {
16
+
17
+ }
includes/gateways/paypal/exceptions/class-authentication-exception.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Authentication Exception
4
+ *
5
+ * Will be thrown if PayPal API credentials are missing or invalid.
6
+ *
7
+ * @package easy-digital-downloads
8
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
9
+ * @license GPL2+
10
+ * @since 2.11
11
+ */
12
+
13
+ namespace EDD\Gateways\PayPal\Exceptions;
14
+
15
+ class Authentication_Exception extends \Exception {
16
+
17
+ }
includes/gateways/paypal/exceptions/class-gateway-exception.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * PayPal Gateway Exception
4
+ *
5
+ * @package easy-digital-downloads
6
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
7
+ * @license GPL2+
8
+ * @since 2.11
9
+ */
10
+
11
+ namespace EDD\Gateways\PayPal\Exceptions;
12
+
13
+ class Gateway_Exception extends \Exception {
14
+
15
+ /**
16
+ * More specific message, used for recording gateway errors.
17
+ *
18
+ * @var string
19
+ */
20
+ private $debug_message;
21
+
22
+ /**
23
+ * Gateway_Exception constructor.
24
+ *
25
+ * @param string $message Exception message. This might be vague, as it's usually presented to the end user.
26
+ * @param int $code Error code.
27
+ * @param string $debug_message More detailed debug message, used when recording gateway errors.
28
+ *
29
+ * @since 2.11
30
+ */
31
+ public function __construct( $message = '', $code = 0, $debug_message = '' ) {
32
+ $this->debug_message = $debug_message;
33
+
34
+ parent::__construct( $message, $code );
35
+ }
36
+
37
+ /**
38
+ * Records a gateway error based off this exception.
39
+ *
40
+ * @param int $payment_id
41
+ *
42
+ * @since 2.11
43
+ */
44
+ public function record_gateway_error( $payment_id = 0 ) {
45
+ $message = ! empty( $this->debug_message ) ? $this->debug_message : $this->getMessage();
46
+
47
+ edd_record_gateway_error(
48
+ __( 'PayPal Gateway Error', 'easy-digital-downloads' ),
49
+ sprintf(
50
+ /* Translators: %d - HTTP response code; %s - Error message */
51
+ __( 'Response Code: %d; Message: %s', 'easy-digital-downloads' ),
52
+ $this->getCode(),
53
+ $message
54
+ ),
55
+ $payment_id
56
+ );
57
+ }
58
+
59
+ }
includes/gateways/paypal/exceptions/class-invalid-merchant-details.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Thrown if merchant details are supplied, but invalid.
4
+ *
5
+ * @package easy-digital-downloads
6
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
7
+ * @license GPL2+
8
+ * @since 2.11
9
+ */
10
+
11
+ namespace EDD\Gateways\PayPal\Exceptions;
12
+
13
+ class InvalidMerchantDetails extends \InvalidArgumentException {
14
+
15
+ }
includes/gateways/paypal/exceptions/class-missing-merchant-details.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Thrown if there are no merchant details at all
4
+ *
5
+ * @see \EDD\Gateways\PayPal\MerchantAccount
6
+ *
7
+ * @package easy-digital-downloads
8
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
9
+ * @license GPL2+
10
+ * @since 2.11
11
+ */
12
+
13
+ namespace EDD\Gateways\PayPal\Exceptions;
14
+
15
+ class MissingMerchantDetails extends \Exception {
16
+
17
+ }
includes/gateways/paypal/functions.php ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * PayPal Commerce Functions
4
+ *
5
+ * @package easy-digital-downloads
6
+ * @subpackage Gateways\PayPal
7
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
8
+ * @license GPL2+
9
+ * @since 2.11
10
+ */
11
+
12
+ namespace EDD\Gateways\PayPal;
13
+
14
+ use EDD\Gateways\PayPal\Exceptions\Authentication_Exception;
15
+
16
+ /**
17
+ * Determines whether or not there's a valid REST API connection.
18
+ *
19
+ * @param string $mode Mode to check (`live` or `sandbox`).
20
+ *
21
+ * @since 2.11
22
+ * @return bool
23
+ */
24
+ function has_rest_api_connection( $mode = '' ) {
25
+ try {
26
+ $api = new API( $mode );
27
+
28
+ return true;
29
+ } catch ( Authentication_Exception $e ) {
30
+ return false;
31
+ }
32
+ }
33
+
34
+ /**
35
+ * Determines whether or not the account is ready to accept payments.
36
+ * Requirements:
37
+ *
38
+ * - API keys must be set.
39
+ * - Merchant account must be ready to accept payments.
40
+ *
41
+ * @see API::set_credentials()
42
+ * @see AccountStatusValidator::check_merchant_account()
43
+ *
44
+ * @since 2.11
45
+ *
46
+ * @param string $mode
47
+ *
48
+ * @return bool
49
+ */
50
+ function ready_to_accept_payments( $mode = '' ) {
51
+ if ( empty( $mode ) ) {
52
+ $mode = edd_is_test_mode() ? API::MODE_SANDBOX : API::MODE_LIVE;
53
+ }
54
+
55
+ if ( ! has_rest_api_connection( $mode ) ) {
56
+ return false;
57
+ }
58
+
59
+ $validator = new AccountStatusValidator( $mode );
60
+ $validator->check_merchant_account();
61
+
62
+ return empty( $validator->errors_for_merchant_account->errors );
63
+ }
64
+
65
+ /**
66
+ * Determines whether or not PayPal Standard should be enabled.
67
+ * This returns true if the store owner previously had a PayPal Standard connection but has not yet
68
+ * connected to the new REST API implementation.
69
+ *
70
+ * If PayPal Standard is enabled, then PayPal payments run through the legacy API.
71
+ *
72
+ * @param string $mode If omitted, current site mode is used.
73
+ *
74
+ * @since 2.11
75
+ * @return bool
76
+ */
77
+ function paypal_standard_enabled( $mode = '' ) {
78
+ if ( empty( $mode ) ) {
79
+ $mode = edd_is_test_mode() ? API::MODE_SANDBOX : API::MODE_LIVE;
80
+ }
81
+
82
+ $rest_connection = has_rest_api_connection( $mode );
83
+ $enabled = ! $rest_connection && edd_get_option( 'paypal_email' );
84
+
85
+ /**
86
+ * Filters whether or not PayPal Standard is enabled.
87
+ *
88
+ * @since 2.11
89
+ *
90
+ * @param bool $enabled
91
+ */
92
+ return apply_filters( 'edd_paypal_standard_enabled', $enabled );
93
+ }
94
+
95
+ /**
96
+ * Returns the partner merchant ID for a given mode.
97
+ *
98
+ * @param string $mode If omitted, current site mode is used.
99
+ *
100
+ * @since 2.11
101
+ * @return string
102
+ */
103
+ function get_partner_merchant_id( $mode = '' ) {
104
+ if ( empty( $mode ) ) {
105
+ $mode = edd_is_test_mode() ? API::MODE_SANDBOX : API::MODE_LIVE;
106
+ }
107
+
108
+ if ( API::MODE_LIVE === $mode ) {
109
+ return EDD_PAYPAL_MERCHANT_ID;
110
+ } else {
111
+ return EDD_PAYPAL_SANDBOX_MERCHANT_ID;
112
+ }
113
+ }
114
+
115
+ /**
116
+ * Returns the styles used for the PayPal buttons.
117
+ *
118
+ * @return array
119
+ */
120
+ function get_button_styles() {
121
+ $styles = array(
122
+ 'layout' => 'vertical',
123
+ 'size' => 'responsive',
124
+ 'shape' => 'rect',
125
+ 'color' => 'gold',
126
+ 'label' => 'paypal'
127
+ );
128
+
129
+ if ( ! edd_is_checkout() ) {
130
+ $styles['layout'] = 'horizontal';
131
+ $styles['label'] = 'buynow';
132
+ }
133
+
134
+ /**
135
+ * Filters the button styles.
136
+ *
137
+ * @since 2.11
138
+ */
139
+ return apply_filters( 'edd_paypal_smart_button_style', $styles );
140
+ }
includes/gateways/paypal/gateway-filters.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * PayPal Commerce Gateway Filters
4
+ *
5
+ * @package easy-digital-downloads
6
+ * @subpackage Gateways\PayPal
7
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
8
+ * @license GPL2+
9
+ */
10
+
11
+ namespace EDD\Gateways\PayPal;
12
+
13
+ /**
14
+ * Removes PayPal Standard from the list of available gateways while we're on the EDD Settings page.
15
+ * This prevents PayPal Standard from being enabled as a gateway if:
16
+ *
17
+ * - The store owner has never used PayPal Standard; or
18
+ * - The store Owner used PayPal Standard previously but has now been onboarded to PayPal Commerce.
19
+ *
20
+ * @param array $gateways
21
+ *
22
+ * @since 2.11
23
+ * @return array
24
+ */
25
+ function maybe_remove_paypal_standard( $gateways ) {
26
+ if ( function_exists( 'edd_is_admin_page' ) && edd_is_admin_page( 'settings' ) && ! paypal_standard_enabled() ) {
27
+ unset( $gateways['paypal'] );
28
+ }
29
+
30
+ return $gateways;
31
+ }
32
+
33
+ add_filter( 'edd_payment_gateways', __NAMESPACE__ . '\maybe_remove_paypal_standard' );
34
+
35
+ /**
36
+ * Creates a link to the transaction within PayPal.
37
+ *
38
+ * @param string $transaction_id PayPal transaction ID.
39
+ * @param int $payment_id ID of the payment.
40
+ *
41
+ * @since 2.11
42
+ * @return string
43
+ */
44
+ function link_transaction_id( $transaction_id, $payment_id ) {
45
+ if ( empty( $transaction_id ) ) {
46
+ return $transaction_id;
47
+ }
48
+
49
+ $payment = edd_get_payment( $payment_id );
50
+
51
+ if ( ! $payment ) {
52
+ return $transaction_id;
53
+ }
54
+
55
+ $subdomain = ( 'test' === $payment->mode ) ? 'sandbox.' : '';
56
+ $transaction_url = 'https://' . urlencode( $subdomain ) . 'paypal.com/activity/payment/' . urlencode( $transaction_id );
57
+
58
+ return '<a href="' . esc_url( $transaction_url ) . '" target="_blank">' . esc_html( $transaction_id ) . '</a>';
59
+ }
60
+
61
+ add_filter( 'edd_payment_details_transaction_id-paypal_commerce', __NAMESPACE__ . '\link_transaction_id', 10, 2 );
62
+
63
+ /**
64
+ * By default, EDD_Payment converts an empty transaction ID to be the ID of the payment.
65
+ * We don't want that to happen... Empty should be empty.
66
+ *
67
+ * @since 2.11
68
+ */
69
+ add_filter( 'edd_get_payment_transaction_id-paypal_commerce', '__return_false' );
includes/gateways/paypal/paypal.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * PayPal Commerce Gateway
4
+ *
5
+ * Loads all required files for PayPal Commerce. This gateway uses:
6
+ *
7
+ * Onboarding: "Build Onboarding into Software"
8
+ * @link https://developer.paypal.com/docs/platforms/seller-onboarding/build-onboarding/
9
+ *
10
+ * JavaScript SDK
11
+ * @link https://developer.paypal.com/docs/business/javascript-sdk/javascript-sdk-reference/
12
+ *
13
+ * - REST API
14
+ * @link https://developer.paypal.com/docs/api/overview/
15
+ *
16
+ * @package easy-digital-downloads
17
+ * @subpackage Gateways\PayPal
18
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
19
+ * @license GPL2+
20
+ * @since 2.11
21
+ */
22
+
23
+ namespace EDD\Gateways\PayPal;
24
+
25
+ /**
26
+ * Partner attribution ID
27
+ *
28
+ * @link https://developer.paypal.com/docs/api/reference/api-requests/#paypal-partner-attribution-id
29
+ */
30
+ if ( ! defined( 'EDD_PAYPAL_PARTNER_ATTRIBUTION_ID' ) ) {
31
+ define( 'EDD_PAYPAL_PARTNER_ATTRIBUTION_ID', 'EasyDigitalDownloadsLLC_PPFM_pcp' );
32
+ }
33
+
34
+ /**
35
+ * Partner merchant ID
36
+ */
37
+ if ( ! defined( 'EDD_PAYPAL_MERCHANT_ID' ) ) {
38
+ define( 'EDD_PAYPAL_MERCHANT_ID', 'GFJPUJ4SNZYJN' );
39
+ }
40
+
41
+ if ( ! defined( 'EDD_PAYPAL_SANDBOX_MERCHANT_ID' ) ) {
42
+ define( 'EDD_PAYPAL_SANDBOX_MERCHANT_ID', 'NUGJTUUBANR46' );
43
+ }
44
+
45
+ /**
46
+ * Include PayPal gateway files
47
+ */
48
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/exceptions/class-api-exception.php';
49
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/exceptions/class-authentication-exception.php';
50
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/exceptions/class-gateway-exception.php';
51
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/exceptions/class-invalid-merchant-details.php';
52
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/exceptions/class-missing-merchant-details.php';
53
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/buy-now.php';
54
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/checkout-actions.php';
55
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/class-account-status-validator.php';
56
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/class-merchant-account.php';
57
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/class-paypal-api.php';
58
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/class-token.php';
59
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/functions.php';
60
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/gateway-filters.php';
61
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/refunds.php';
62
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/scripts.php';
63
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/webhooks/class-webhook-handler.php';
64
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/webhooks/class-webhook-validator.php';
65
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/webhooks/functions.php';
66
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/webhooks/events/abstract-webhook-event.php';
67
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/webhooks/events/class-payment-capture-completed.php';
68
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/webhooks/events/class-payment-capture-denied.php';
69
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/webhooks/events/class-payment-capture-refunded.php';
70
+
71
+ if ( is_admin() ) {
72
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/admin/connect.php';
73
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/admin/notices.php';
74
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/admin/scripts.php';
75
+ require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/admin/settings.php';
76
+ }
includes/gateways/paypal/refunds.php ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * PayPal Commerce Refunds
4
+ *
5
+ * @package easy-digital-downloads
6
+ * @subpackage Gateways\PayPal
7
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
8
+ * @license GPL2+
9
+ * @since 2.11
10
+ */
11
+
12
+ namespace EDD\Gateways\PayPal;
13
+
14
+ use EDD\Gateways\PayPal\Exceptions\API_Exception;
15
+ use EDD\Gateways\PayPal\Exceptions\Authentication_Exception;
16
+
17
+ /**
18
+ * Adds a "Refund in PayPal" checkbox when switching the payment's status to "Refunded".
19
+ *
20
+ * @param int $payment_id
21
+ *
22
+ * @since 2.11
23
+ * @return void
24
+ */
25
+ function add_refund_javascript( $payment_id ) {
26
+ $payment = edd_get_payment( $payment_id );
27
+
28
+ if ( ! $payment || 'paypal_commerce' !== $payment->gateway ) {
29
+ return;
30
+ }
31
+
32
+ $mode = ( 'live' === $payment->mode ) ? API::MODE_LIVE : API::MODE_SANDBOX;
33
+
34
+ try {
35
+ $api = new API( $mode );
36
+ } catch ( Exceptions\Authentication_Exception $e ) {
37
+ // If we don't have credentials.
38
+ return;
39
+ }
40
+
41
+ $label = __( 'Refund Transaction in PayPal', 'easy-digital-downloads' );
42
+ ?>
43
+ <script type="text/javascript">
44
+ jQuery( document ).ready( function ( $ ) {
45
+ $( 'select[name=edd-payment-status]' ).change( function () {
46
+ if ( 'refunded' === $( this ).val() ) {
47
+ $( this ).parent().parent().append( '<input type="checkbox" id="edd-paypal-commerce-refund" name="edd-paypal-commerce-refund" value="1" style="margin-top:0">' );
48
+ $( this ).parent().parent().append( '<label for="edd-paypal-commerce-refund"><?php echo esc_html( $label ); ?></label>' );
49
+ } else {
50
+ $( '#edd-paypal-commerce-refund' ).remove();
51
+ $( 'label[for="edd-paypal-commerce-refund"]' ).remove();
52
+ }
53
+ } );
54
+ } );
55
+ </script>
56
+ <?php
57
+ }
58
+
59
+ add_action( 'edd_view_order_details_before', __NAMESPACE__ . '\add_refund_javascript', 100 );
60
+
61
+ /**
62
+ * Refunds the transaction in PayPal, if the option was selected.
63
+ *
64
+ * @param \EDD_Payment $payment The payment being refunded.
65
+ *
66
+ * @since 2.11
67
+ * @return void
68
+ */
69
+ function maybe_refund_transaction( \EDD_Payment $payment ) {
70
+ if ( ! current_user_can( 'edit_shop_payments', $payment->ID ) ) {
71
+ return;
72
+ }
73
+
74
+ if ( 'paypal_commerce' !== $payment->gateway || empty( $_POST['edd-paypal-commerce-refund'] ) ) {
75
+ return;
76
+ }
77
+
78
+ // Payment status should be coming from "publish" or "revoked".
79
+ // @todo In 3.0 use `edd_get_refundable_order_statuses()`
80
+ if ( ! in_array( $payment->old_status, array( 'publish', 'complete', 'revoked', 'edd_subscription' ) ) ) {
81
+ return;
82
+ }
83
+
84
+ // If the payment has already been refunded, bail.
85
+ if ( $payment->get_meta( '_edd_paypal_refunded', true ) ) {
86
+ return;
87
+ }
88
+
89
+ // Process the refund.
90
+ try {
91
+ refund_transaction( $payment );
92
+ } catch ( \Exception $e ) {
93
+ edd_insert_payment_note( $payment->ID, sprintf(
94
+ /* Translators: %s - The error message */
95
+ __( 'Failed to refund transaction in PayPal. Error Message: %s', 'easy-digital-downloads' ),
96
+ $e->getMessage()
97
+ ) );
98
+ }
99
+ }
100
+
101
+ add_action( 'edd_pre_refund_payment', __NAMESPACE__ . '\maybe_refund_transaction', 999 );
102
+
103
+ /**
104
+ * Refunds a transaction in PayPal.
105
+ *
106
+ * @link https://developer.paypal.com/docs/api/payments/v2/#captures_refund
107
+ *
108
+ * @param \EDD_Payment $payment
109
+ *
110
+ * @since 2.11
111
+ * @throws Authentication_Exception
112
+ * @throws API_Exception
113
+ * @throws \Exception
114
+ */
115
+ function refund_transaction( \EDD_Payment $payment ) {
116
+ $transaction_id = $payment->transaction_id;
117
+
118
+ if ( empty( $transaction_id ) ) {
119
+ throw new \Exception( __( 'Missing transaction ID.', 'easy-digital-downloads' ) );
120
+ }
121
+
122
+ $mode = ( 'live' === $payment->mode ) ? API::MODE_LIVE : API::MODE_SANDBOX;
123
+
124
+ $api = new API( $mode );
125
+
126
+ $response = $api->make_request( 'v2/payments/captures/' . urlencode( $transaction_id ) . '/refund' );
127
+
128
+ if ( 201 !== $api->last_response_code ) {
129
+ throw new API_Exception( sprintf(
130
+ /* Translators: %d - The HTTP response code; %s - Full API response from PayPal */
131
+ __( 'Unexpected response code: %d. Response: %s', 'easy-digital-downloads' ),
132
+ $api->last_response_code,
133
+ json_encode( $response )
134
+ ), $api->last_response_code );
135
+ }
136
+
137
+ if ( empty( $response->status ) || 'COMPLETED' !== strtoupper( $response->status ) ) {
138
+ throw new API_Exception( sprintf(
139
+ /* Translators: %s - API response from PayPal */
140
+ __( 'Missing or unexpected refund status. Response: %s', 'easy-digital-downloads' ),
141
+ json_encode( $response )
142
+ ) );
143
+ }
144
+
145
+ // At this point we can assume it was successful.
146
+ $payment->update_meta( '_edd_paypal_refunded', true );
147
+
148
+ if ( ! empty( $response->id ) ) {
149
+ $payment->add_note( sprintf(
150
+ /* Translators: %s - ID of the refund in PayPal */
151
+ __( 'Successfully refunded in PayPal. Refund transaction ID: %s', 'easy-digital-downloads' ),
152
+ esc_html( $response->id )
153
+ ) );
154
+ }
155
+
156
+ /**
157
+ * Triggers after a successful refund.
158
+ *
159
+ * @param \EDD_Payment $payment
160
+ */
161
+ do_action( 'edd_paypal_refund_purchase', $payment );
162
+ }
includes/gateways/paypal/scripts.php ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * PayPal Commerce Scripts
4
+ *
5
+ * @package Sandhills Development, LLC
6
+ * @subpackage Gateways\PayPal
7
+ * @copyright Copyright (c) 2021, Ashley Gibson
8
+ * @license GPL2+
9
+ * @since 2.11
10
+ */
11
+
12
+ namespace EDD\Gateways\PayPal;
13
+
14
+ use EDD\Gateways\PayPal\Exceptions\Authentication_Exception;
15
+
16
+ /**
17
+ * Enqueues polyfills for Promise and Fetch.
18
+ *
19
+ * @since 2.11
20
+ */
21
+ function maybe_enqueue_polyfills() {
22
+ /**
23
+ * Filters whether or not IE11 polyfills should be loaded.
24
+ * Note: This filter may have its default changed at any time, or may entirely
25
+ * go away at one point.
26
+ *
27
+ * @since 2.11
28
+ */
29
+ if ( ! apply_filters( 'edd_load_ie11_polyfills', true ) ) {
30
+ return;
31
+ }
32
+
33
+ global $wp_version;
34
+ if ( version_compare( $wp_version, '5.0', '>=' ) ) {
35
+ wp_enqueue_script( 'wp-polyfill' );
36
+ } else {
37
+ wp_enqueue_script(
38
+ 'wp-polyfill',
39
+ EDD_PLUGIN_URL . 'assets/js/wp-polyfill.min.js',
40
+ array(),
41
+ false,
42
+ false
43
+ );
44
+ }
45
+ }
46
+
47
+ /**
48
+ * Registers PayPal JavaScript
49
+ *
50
+ * @param bool $force_load
51
+ *
52
+ * @since 2.11
53
+ * @return void
54
+ */
55
+ function register_js( $force_load = false ) {
56
+ if ( ! edd_is_gateway_active( 'paypal_commerce' ) ) {
57
+ return;
58
+ }
59
+
60
+ if ( ! ready_to_accept_payments() ) {
61
+ return;
62
+ }
63
+
64
+ try {
65
+ $api = new API();
66
+ } catch ( Authentication_Exception $e ) {
67
+ return;
68
+ }
69
+
70
+ // Use minified libraries if SCRIPT_DEBUG is turned off
71
+ $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
72
+
73
+ /**
74
+ * Filters the query arguments added to the SDK URL.
75
+ *
76
+ * @link https://developer.paypal.com/docs/checkout/reference/customize-sdk/#query-parameters
77
+ *
78
+ * @since 2.11
79
+ */
80
+ $sdk_query_args = apply_filters( 'edd_paypal_js_sdk_query_args', array(
81
+ 'client-id' => urlencode( $api->client_id ),
82
+ 'locale' => urlencode( get_locale() ),
83
+ 'currency' => urlencode( strtoupper( edd_get_currency() ) ),
84
+ 'intent' => 'capture',
85
+ 'disable-funding' => 'card,credit,bancontact,blik,eps,giropay,ideal,mercadopago,mybank,p24,sepa,sofort,venmo'
86
+ ) );
87
+
88
+ wp_register_script(
89
+ 'sandhills-paypal-js-sdk',
90
+ add_query_arg( array_filter( $sdk_query_args ), 'https://www.paypal.com/sdk/js' )
91
+ );
92
+
93
+ wp_register_script(
94
+ 'edd-paypal',
95
+ EDD_PLUGIN_URL . 'assets/js/paypal-checkout' . $suffix . '.js',
96
+ array(
97
+ 'sandhills-paypal-js-sdk',
98
+ 'jquery',
99
+ 'edd-ajax'
100
+ ),
101
+ EDD_VERSION,
102
+ true
103
+ );
104
+
105
+ if ( edd_is_checkout() || $force_load ) {
106
+ maybe_enqueue_polyfills();
107
+
108
+ wp_enqueue_script( 'sandhills-paypal-js-sdk' );
109
+ wp_enqueue_script( 'edd-paypal' );
110
+
111
+ $paypal_script_vars = array(
112
+ /**
113
+ * Filters the order approval handler.
114
+ *
115
+ * @since 2.11
116
+ */
117
+ 'approvalAction' => apply_filters( 'edd_paypal_on_approve_action', 'edd_capture_paypal_order' ),
118
+ 'defaultError' => edd_build_errors_html( array(
119
+ 'paypal-error' => esc_html__( 'An unexpected error occurred. Please try again.', 'easy-digital-downloads' )
120
+ ) ),
121
+ 'intent' => ! empty( $sdk_query_args['intent'] ) ? $sdk_query_args['intent'] : 'capture',
122
+ 'style' => get_button_styles()
123
+ );
124
+
125
+ wp_localize_script( 'edd-paypal', 'eddPayPalVars', $paypal_script_vars );
126
+ }
127
+ }
128
+
129
+ add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\register_js', 100 );
130
+
131
+ /**
132
+ * Removes the "?ver=" query arg from the PayPal JS SDK URL, because PayPal will throw an error
133
+ * if it's included.
134
+ *
135
+ * @param string $url
136
+ *
137
+ * @since 2.11
138
+ * @return string
139
+ */
140
+ function remove_ver_query_arg( $url ) {
141
+ $sdk_url = 'https://www.paypal.com/sdk/js';
142
+
143
+ if ( false !== strpos( $url, $sdk_url ) ) {
144
+ $new_url = preg_split( "/(&ver|\?ver)/", $url );
145
+
146
+ return $new_url[0];
147
+ }
148
+
149
+ return $url;
150
+ }
151
+
152
+ add_filter( 'script_loader_src', __NAMESPACE__ . '\remove_ver_query_arg', 100 );
153
+
154
+ /**
155
+ * Adds data attributes to the PayPal JS SDK <script> tag.
156
+ *
157
+ * @link https://developer.paypal.com/docs/checkout/reference/customize-sdk/#script-parameters
158
+ *
159
+ * @since 2.11
160
+ *
161
+ * @param string $script_tag HTML <script> tag.
162
+ * @param string $handle Registered handle.
163
+ * @param string $src Script SRC value.
164
+ *
165
+ * @return string
166
+ */
167
+ function add_data_attributes( $script_tag, $handle, $src ) {
168
+ if ( 'sandhills-paypal-js-sdk' !== $handle ) {
169
+ return $script_tag;
170
+ }
171
+
172
+ /**
173
+ * Filters the data attributes to add to the <script> tag.
174
+ *
175
+ * @since 2.11
176
+ *
177
+ * @param array $data_attributes
178
+ */
179
+ $data_attributes = apply_filters( 'edd_paypal_js_sdk_data_attributes', array(
180
+ 'partner-attribution-id' => EDD_PAYPAL_PARTNER_ATTRIBUTION_ID
181
+ ) );
182
+
183
+ if ( empty( $data_attributes ) || ! is_array( $data_attributes ) ) {
184
+ return $script_tag;
185
+ }
186
+
187
+ $formatted_attributes = array_map( function ( $key, $value ) {
188
+ return sprintf( 'data-%s="%s"', sanitize_html_class( $key ), esc_attr( $value ) );
189
+ }, array_keys( $data_attributes ), $data_attributes );
190
+
191
+ return str_replace( ' src', ' ' . implode( ' ', $formatted_attributes ) . ' src', $script_tag );
192
+ }
193
+
194
+ add_filter( 'script_loader_tag', __NAMESPACE__ . '\add_data_attributes', 10, 3 );
includes/gateways/paypal/webhooks/class-webhook-handler.php ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Webhook Handler
4
+ *
5
+ * @package easy-digital-downloads
6
+ * @subpackage Gateways\PayPal\Webhooks
7
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
8
+ * @license GPL2+
9
+ * @since 2.11
10
+ */
11
+
12
+ namespace EDD\Gateways\PayPal\Webhooks;
13
+
14
+ use EDD\Gateways\PayPal;
15
+
16
+ class Webhook_Handler {
17
+ /**
18
+ * Endpoint namespace.
19
+ *
20
+ * @since 2.11
21
+ */
22
+ const REST_NAMESPACE = 'edd/webhooks/v1';
23
+
24
+ /**
25
+ * Endpoint route.
26
+ *
27
+ * @since 2.11
28
+ */
29
+ const REST_ROUTE = 'paypal';
30
+
31
+ /**
32
+ * Webhook payload
33
+ *
34
+ * @var object
35
+ * @since 2.11
36
+ */
37
+ private $event;
38
+
39
+ /**
40
+ * Registers REST API routes.
41
+ *
42
+ * @since 2.11
43
+ * @return void
44
+ */
45
+ public function register_routes() {
46
+ register_rest_route( self::REST_NAMESPACE, self::REST_ROUTE, array(
47
+ 'methods' => \WP_REST_Server::CREATABLE,
48
+ 'callback' => array( $this, 'handle_request' ),
49
+ 'permission_callback' => array( $this, 'validate_request' )
50
+ ) );
51
+ }
52
+
53
+ /**
54
+ * Handles the current request.
55
+ *
56
+ * @param \WP_REST_Request $request
57
+ *
58
+ * @since 2.11
59
+ * @return \WP_REST_Response
60
+ */
61
+ public function handle_request( \WP_REST_Request $request ) {
62
+ edd_debug_log( sprintf(
63
+ 'PayPal Commerce webhook endpoint loaded. Mode: %s; Event: %s',
64
+ ( edd_is_test_mode() ? 'sandbox' : 'live' ),
65
+ $request->get_param( 'event_type' )
66
+ ) );
67
+
68
+ edd_debug_log( sprintf( 'Payload: %s', json_encode( $this->event ) ) ); // @todo remove
69
+
70
+ try {
71
+ // We need to match this event to one of our handlers.
72
+ $events = get_webhook_events();
73
+ if ( ! array_key_exists( $request->get_param( 'event_type' ), $events ) ) {
74
+ throw new \Exception( sprintf( 'Event not registered. Event: %s', esc_html( $request->get_param( 'event_type' ) ) ), 200 );
75
+ }
76
+
77
+ $class_name = $events[ $request->get_param( 'event_type' ) ];
78
+
79
+ if ( ! class_exists( $class_name ) ) {
80
+ throw new \Exception( sprintf( 'Class %s doesn\'t exist for event type.', $class_name ), 500 );
81
+ }
82
+
83
+ /**
84
+ * Initialize the handler for this event.
85
+ *
86
+ * @var PayPal\Webhooks\Events\Webhook_Event $handler
87
+ */
88
+ $handler = new $class_name( $request );
89
+
90
+ if ( ! method_exists( $handler, 'handle' ) ) {
91
+ throw new \Exception( sprintf( 'handle() method doesn\'t exist in class %s.', $class_name ), 500 );
92
+ }
93
+
94
+ edd_debug_log( sprintf( 'PayPal Commerce Webhook - Passing to handler %s', esc_html( $class_name ) ) );
95
+
96
+ $handler->handle();
97
+
98
+ $action_key = sanitize_key( strtolower( str_replace( '.', '_', $request->get_param( 'event_type' ) ) ) );
99
+ /**
100
+ * Triggers once the handler has run successfully.
101
+ * $action_key is a formatted version of the event type:
102
+ * - All lowercase
103
+ * - Full stops `.` replaced with underscores `_`
104
+ *
105
+ * Note: This action hook exists so you can execute custom code *after* a handler has run.
106
+ * If you're registering a custom event, please build a custom handler by extending
107
+ * the `Webhook_Event` class and not via this hook.
108
+ *
109
+ * @param \WP_REST_Request $event
110
+ *
111
+ * @since 2.11
112
+ */
113
+ do_action( 'edd_paypal_webhook_event_' . $action_key, $request );
114
+
115
+ return new \WP_REST_Response( 'Success', 200 );
116
+ } catch ( PayPal\Exceptions\Authentication_Exception $e ) {
117
+ // Failure with PayPal credentials.
118
+ edd_debug_log( sprintf( 'PayPal Commerce Webhook - Exiting due to authentication exception. Message: %s', $e->getMessage() ), true );
119
+
120
+ return new \WP_REST_Response( $e->getMessage(), 403 );
121
+ } catch ( PayPal\Exceptions\API_Exception $e ) {
122
+ // Failure with a PayPal API request.
123
+ edd_debug_log( sprintf( 'PayPal Commerce Webhook - Failure due to an API exception. Message: %s', $e->getMessage() ) );
124
+
125
+ return new \WP_REST_Response( $e->getMessage(), 500 );
126
+ } catch ( \Exception $e ) {
127
+ edd_debug_log( sprintf( 'PayPal Commerce - Exiting webhook due to an exception. Message: %s', $e->getMessage() ), true );
128
+
129
+ $response_code = $e->getCode() > 0 ? $e->getCode() : 500;
130
+
131
+ return new \WP_REST_Response( $e->getMessage(), $response_code );
132
+ }
133
+ }
134
+
135
+ /**
136
+ * Validates the webhook
137
+ *
138
+ * @since 2.11
139
+ * @return bool|\WP_Error
140
+ */
141
+ public function validate_request() {
142
+ if ( ! PayPal\has_rest_api_connection() ) {
143
+ return new \WP_Error( 'missing_api_credentials', 'API credentials not set.' );
144
+ }
145
+
146
+ $this->event = json_decode( file_get_contents( 'php://input' ) );
147
+
148
+ try {
149
+ Webhook_Validator::validate_from_request( $this->event );
150
+
151
+ edd_debug_log( 'PayPal Commerce webhook successfully validated.' );
152
+
153
+ return true;
154
+ } catch ( \Exception $e ) {
155
+ return new \WP_Error( 'validation_failure', $e->getMessage() );
156
+ }
157
+ }
158
+ }
159
+
160
+ add_action( 'rest_api_init', function () {
161
+ $handler = new Webhook_Handler();
162
+ $handler->register_routes();
163
+ } );
includes/gateways/paypal/webhooks/class-webhook-validator.php ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Webhook Validator
4
+ *
5
+ * @link https://developer.paypal.com/docs/api/webhooks/v1/#verify-webhook-signature_post
6
+ *
7
+ * @package easy-digital-downloads
8
+ * @subpackage Gateways\PayPal\Webhooks
9
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
10
+ * @license GPL2+
11
+ * @since 2.11
12
+ */
13
+
14
+ namespace EDD\Gateways\PayPal\Webhooks;
15
+
16
+ use EDD\Gateways\PayPal\API;
17
+ use EDD\Gateways\PayPal\Exceptions\API_Exception;
18
+
19
+ class Webhook_Validator {
20
+
21
+ /**
22
+ * Headers from the webhook
23
+ *
24
+ * @var array
25
+ * @since 2.11
26
+ */
27
+ private $headers;
28
+
29
+ /**
30
+ * Webhook event
31
+ *
32
+ * @var object
33
+ * @since 2.11
34
+ */
35
+ private $event;
36
+
37
+ /**
38
+ * Maps the incoming header key to the outgoing API request key.
39
+ *
40
+ * @var string[]
41
+ * @since 2.11
42
+ */
43
+ private $header_map = array(
44
+ 'PAYPAL-AUTH-ALGO' => 'auth_algo',
45
+ 'PAYPAL-CERT-URL' => 'cert_url',
46
+ 'PAYPAL-TRANSMISSION-ID' => 'transmission_id',
47
+ 'PAYPAL-TRANSMISSION-SIG' => 'transmission_sig',
48
+ 'PAYPAL-TRANSMISSION-TIME' => 'transmission_time'
49
+ );
50
+
51
+ /**
52
+ * Webhook_Validator constructor.
53
+ *
54
+ * @param array $headers
55
+ * @param object $event
56
+ *
57
+ * @since 2.11
58
+ */
59
+ public function __construct( $headers, $event ) {
60
+ $this->headers = array_change_key_case( $headers, CASE_UPPER );
61
+ $this->event = $event;
62
+ }
63
+
64
+ /**
65
+ * Verifies the signature.
66
+ *
67
+ * @since 2.11
68
+ * @return true
69
+ * @throws API_Exception
70
+ * @throws \InvalidArgumentException
71
+ */
72
+ public function verify_signature() {
73
+ $api = new API();
74
+
75
+ $response = $api->make_request( 'v1/notifications/verify-webhook-signature', $this->get_body() );
76
+
77
+ if ( 200 !== $api->last_response_code ) {
78
+ throw new API_Exception( sprintf(
79
+ 'Invalid response code: %d. Response: %s',
80
+ $api->last_response_code,
81
+ json_encode( $response )
82
+ ) );
83
+ }
84
+
85
+ if ( empty( $response->verification_status ) || 'SUCCESS' !== strtoupper( $response->verification_status ) ) {
86
+ throw new API_Exception( sprintf(
87
+ 'Verification failure. Response: %s',
88
+ json_encode( $response )
89
+ ) );
90
+ }
91
+
92
+ return true;
93
+ }
94
+
95
+ /**
96
+ * Validates that we have all the required headers.
97
+ *
98
+ * @since 2.11
99
+ * @throws \InvalidArgumentException
100
+ */
101
+ private function validate_headers() {
102
+ foreach ( array_keys( $this->header_map ) as $required_key ) {
103
+ if ( ! array_key_exists( $required_key, $this->headers ) ) {
104
+ throw new \InvalidArgumentException( sprintf(
105
+ 'Missing PayPal header %s',
106
+ $required_key
107
+ ) );
108
+ }
109
+ }
110
+ }
111
+
112
+ /**
113
+ * Retrieves the webhook ID for the current mode.
114
+ *
115
+ * @since 2.11
116
+ * @return string
117
+ * @throws \Exception
118
+ */
119
+ private function get_webhook_id() {
120
+ $id = get_webhook_id();
121
+
122
+ if ( empty( $id ) ) {
123
+ throw new \Exception( 'No webhook created in current mode.' );
124
+ }
125
+
126
+ return $id;
127
+ }
128
+
129
+ /**
130
+ * Builds arguments for the body of the API request.
131
+ *
132
+ * @return array
133
+ * @throws \InvalidArgumentException
134
+ * @throws \Exception
135
+ */
136
+ private function get_body() {
137
+ $this->validate_headers();
138
+
139
+ $body = array(
140
+ 'webhook_id' => $this->get_webhook_id(),
141
+ 'webhook_event' => $this->event
142
+ );
143
+
144
+ // Add arguments from the headers.
145
+ foreach ( $this->header_map as $header_key => $body_key ) {
146
+ $body[ $body_key ] = $this->headers[ $header_key ];
147
+ }
148
+
149
+ return $body;
150
+ }
151
+
152
+ /**
153
+ * Validates the webhook from the current request.
154
+ *
155
+ * @param object $event Webhook event.
156
+ *
157
+ * @since 2.11
158
+ * @return true
159
+ * @throws API_Exception
160
+ * @throws \InvalidArgumentException
161
+ */
162
+ public static function validate_from_request( $event ) {
163
+ $validator = new Webhook_Validator( getallheaders(), $event );
164
+
165
+ return $validator->verify_signature();
166
+ }
167
+
168
+ }
includes/gateways/paypal/webhooks/events/abstract-webhook-event.php ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Webhook Event Handler
4
+ *
5
+ * @package easy-digital-downloads
6
+ * @subpackage Gateways\PayPal\Webhooks\Events
7
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
8
+ * @license GPL2+
9
+ * @since 2.11
10
+ */
11
+
12
+ namespace EDD\Gateways\PayPal\Webhooks\Events;
13
+
14
+ use EDD\Gateways\PayPal\API;
15
+ use EDD\Gateways\PayPal\Exceptions\API_Exception;
16
+ use EDD\Gateways\PayPal\Exceptions\Authentication_Exception;
17
+
18
+ abstract class Webhook_Event {
19
+
20
+ /**
21
+ * API request
22
+ *
23
+ * @var \WP_REST_Request
24
+ * @since 2.11
25
+ */
26
+ protected $request;
27
+
28
+ /**
29
+ * Data from the request.
30
+ *
31
+ * @var object
32
+ * @since 2.11
33
+ */
34
+ protected $event;
35
+
36
+ /**
37
+ * Webhook_Event constructor.
38
+ *
39
+ * @param \WP_REST_Request $request
40
+ *
41
+ * @since 2.11
42
+ */
43
+ public function __construct( $request ) {
44
+ $this->request = $request;
45
+
46
+ // `get_params()` returns an array, but we want an object.
47
+ $this->event = json_decode( json_encode( $this->request->get_params() ) );
48
+ }
49
+
50
+ /**
51
+ * Handles the webhook event.
52
+ *
53
+ * @throws \Exception
54
+ */
55
+ public function handle() {
56
+ $this->process_event();
57
+ }
58
+
59
+ /**
60
+ * Processes the event.
61
+ *
62
+ * @since 2.11
63
+ * @return void
64
+ */
65
+ abstract protected function process_event();
66
+
67
+ /**
68
+ * Retrieves an EDD_Payment record from a capture event.
69
+ *
70
+ * @since 2.11
71
+ *
72
+ * @return \EDD_Payment
73
+ * @throws \Exception
74
+ */
75
+ protected function get_payment_from_capture() {
76
+ if ( 'capture' !== $this->request->get_param( 'resource_type' ) ) {
77
+ throw new \Exception( sprintf( 'get_payment_from_capture() - Invalid resource type: %s', $this->request->get_param( 'resource_type' ) ) );
78
+ }
79
+
80
+ if ( empty( $this->event->resource ) ) {
81
+ throw new \Exception( sprintf( 'get_payment_from_capture() - Missing event resource.' ) );
82
+ }
83
+
84
+ return $this->get_payment_from_capture_object( $this->event->resource );
85
+ }
86
+
87
+ /**
88
+ * Retrieves an EDD_Payment record from a capture object.
89
+ *
90
+ * @param object $resource
91
+ *
92
+ * @since 2.11
93
+ *
94
+ * @return \EDD_Payment
95
+ * @throws \Exception
96
+ */
97
+ protected function get_payment_from_capture_object( $resource ) {
98
+ $payment = false;
99
+
100
+ if ( ! empty( $resource->custom_id ) && is_numeric( $resource->custom_id ) ) {
101
+ $payment = edd_get_payment( $resource->custom_id );
102
+ }
103
+
104
+ if ( empty( $payment ) && ! empty( $resource->id ) ) {
105
+ $payment_id = edd_get_purchase_id_by_transaction_id( $resource->id );
106
+ $payment = $payment_id ? edd_get_payment( $payment_id ) : false;
107
+ }
108
+
109
+ if ( ! $payment instanceof \EDD_Payment ) {
110
+ throw new \Exception( 'get_payment_from_capture_object() - Failed to locate payment.', 200 );
111
+ }
112
+
113
+ /*
114
+ * Verify the transaction ID. This covers us in case we fetched the payment via `custom_id`, but
115
+ * it wasn't actually an EDD-initiated payment.
116
+ */
117
+ if ( $payment->transaction_id !== $resource->id ) {
118
+ throw new \Exception( sprintf( 'get_payment_from_capture_object() - Transaction ID mismatch. Expected: %s; Actual: %s', $payment->transaction_id, $resource->id ), 200 );
119
+ }
120
+
121
+ return $payment;
122
+ }
123
+
124
+ /**
125
+ * Retrieves an EDD_Payment record from a refund event.
126
+ *
127
+ * @since 2.11
128
+ *
129
+ * @return \EDD_Payment
130
+ * @throws API_Exception
131
+ * @throws Authentication_Exception
132
+ * @throws \Exception
133
+ */
134
+ protected function get_payment_from_refund() {
135
+ edd_debug_log( sprintf( 'PayPal Commerce Webhook - get_payment_from_resource_link() - Resource type: %s; Resource ID: %s', $this->request->get_param( 'resource_type' ), $this->event->resource->id ) );
136
+
137
+ if ( empty( $this->event->resource->links ) || ! is_array( $this->event->resource->links ) ) {
138
+ throw new \Exception( 'Missing resources.', 200 );
139
+ }
140
+
141
+ $order_link = current( array_filter( $this->event->resource->links, function ( $link ) {
142
+ return ! empty( $link->rel ) && 'up' === strtolower( $link->rel );
143
+ } ) );
144
+
145
+ if ( empty( $order_link->href ) ) {
146
+ throw new \Exception( 'Missing order link.', 200 );
147
+ }
148
+
149
+ // Based on the payment link, determine which mode we should act in.
150
+ if ( false === strpos( $order_link->href, 'sandbox.paypal.com' ) ) {
151
+ $mode = API::MODE_LIVE;
152
+ } else {
153
+ $mode = API::MODE_SANDBOX;
154
+ }
155
+
156
+ // Look up the full order record in PayPal.
157
+ $api = new API( $mode );
158
+ $response = $api->make_request( $order_link->href, array(), array(), $order_link->method );
159
+
160
+ if ( 200 !== $api->last_response_code ) {
161
+ throw new API_Exception( sprintf( 'Invalid response code when retrieving order record: %d', $api->last_response_code ) );
162
+ }
163
+
164
+ if ( empty( $response->id ) ) {
165
+ throw new API_Exception( 'Missing order ID from API response.' );
166
+ }
167
+
168
+ return $this->get_payment_from_capture_object( $response );
169
+ }
170
+
171
+ }
includes/gateways/paypal/webhooks/events/class-payment-capture-completed.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Webhook Event: PAYMENT.CAPTURE.COMPLETED
4
+ *
5
+ * @package easy-digital-downloads
6
+ * @subpackage Gateways\PayPal\Webhooks\Events
7
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
8
+ * @license GPL2+
9
+ * @since 2.11
10
+ */
11
+
12
+ namespace EDD\Gateways\PayPal\Webhooks\Events;
13
+
14
+ class Payment_Capture_Completed extends Webhook_Event {
15
+
16
+ /**
17
+ * Processes the event.
18
+ *
19
+ * @throws \EDD\Gateways\PayPal\Exceptions\API_Exception
20
+ * @throws \EDD\Gateways\PayPal\Exceptions\Authentication_Exception
21
+ * @throws \Exception
22
+ *
23
+ * @since 2.11
24
+ */
25
+ protected function process_event() {
26
+ $payment = $this->get_payment_from_capture();
27
+
28
+ // Bail if the payment has already been completed.
29
+ if ( in_array( $payment->status, array( 'publish', 'complete' ) ) ) {
30
+ edd_debug_log( 'PayPal Commerce - Exiting webhook, as payment is already complete.' );
31
+
32
+ return;
33
+ }
34
+
35
+ if ( empty( $this->event->resource->status ) || 'COMPLETED' !== strtoupper( $this->event->resource->status ) ) {
36
+ throw new \Exception( 'Capture status is not complete.', 200 );
37
+ }
38
+
39
+ if ( ! isset( $this->event->resource->amount->value ) ) {
40
+ throw new \Exception( 'Missing amount value.', 200 );
41
+ }
42
+
43
+ if ( ! isset( $this->event->resource->amount->currency_code ) || strtoupper( $this->event->resource->amount->currency_code ) !== strtoupper( $payment->currency ) ) {
44
+ throw new \Exception( sprintf( 'Missing or invalid currency code. Expected: %s; PayPal: %s', $payment->currency, esc_html( $this->event->resource->amount->currency_code ) ), 200 );
45
+ }
46
+
47
+ $paypal_amount = (float) $this->event->resource->amount->value;
48
+ $payment_amount = edd_get_payment_amount( $payment->ID );
49
+
50
+ if ( $paypal_amount < $payment_amount ) {
51
+ edd_record_gateway_error(
52
+ __( 'Webhook Error', 'easy-digital-downloads' ),
53
+ sprintf(
54
+ /* Translators: %s is the webhook data */
55
+ __( 'Invalid payment about in webhook response. Webhook data: %s', 'easy-digital-downloads' ),
56
+ json_encode( $this->event )
57
+ )
58
+ );
59
+
60
+ edd_update_payment_status( $payment->ID, 'failed' );
61
+ edd_insert_payment_note( $payment->ID, sprintf(
62
+ __( 'Payment failed due to invalid amount in PayPal webhook. Expected amount: %s; PayPal amount: %s.', 'easy-digital-downloads' ),
63
+ $payment_amount,
64
+ esc_html( $paypal_amount )
65
+ ) );
66
+
67
+ throw new \Exception( sprintf( 'Webhook amount (%s) doesn\'t match payment amount (%s).', esc_html( $paypal_amount ), esc_html( $payment_amount ) ), 200 );
68
+ }
69
+
70
+ edd_update_payment_status( $payment->ID, 'complete' );
71
+ }
72
+ }
includes/gateways/paypal/webhooks/events/class-payment-capture-denied.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Webhook Event: PAYMENT.CAPTURE.DENIED
4
+ *
5
+ * @package easy-digital-downloads
6
+ * @subpackage Gateways\PayPal\Webhooks\Events
7
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
8
+ * @license GPL2+
9
+ * @since 2.11
10
+ */
11
+
12
+ namespace EDD\Gateways\PayPal\Webhooks\Events;
13
+
14
+ class Payment_Capture_Denied extends Webhook_Event {
15
+
16
+ /**
17
+ * Processes the webhook event
18
+ *
19
+ * @since 2.11
20
+ *
21
+ * @throws \Exception
22
+ */
23
+ protected function process_event() {
24
+ $payment = $this->get_payment_from_capture();
25
+
26
+ edd_update_payment_status( $payment->ID, 'failed' );
27
+
28
+ $payment->add_note( __( 'PayPal transaction denied.', 'easy-digital-downloads' ) );
29
+ }
30
+ }
includes/gateways/paypal/webhooks/events/class-payment-capture-refunded.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Webhook Events:
4
+ *
5
+ * - PAYMENT.CAPTURE.REFUNDED - Merchant refunds a sale.
6
+ * - PAYMENT.CAPTURE.REVERSED - PayPal reverses a sale.
7
+ *
8
+ * @package easy-digital-downloads
9
+ * @subpackage Gateways\PayPal\Webhooks\Events
10
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
11
+ * @license GPL2+
12
+ * @since 2.11
13
+ */
14
+
15
+ namespace EDD\Gateways\PayPal\Webhooks\Events;
16
+
17
+ use EDD\Gateways\PayPal\Exceptions\API_Exception;
18
+ use EDD\Gateways\PayPal\Exceptions\Authentication_Exception;
19
+
20
+ class Payment_Capture_Refunded extends Webhook_Event {
21
+
22
+ /**
23
+ * Processes the event.
24
+ *
25
+ * @throws API_Exception
26
+ * @throws Authentication_Exception
27
+ *
28
+ * @since 2.11
29
+ */
30
+ protected function process_event() {
31
+ $payment = $this->get_payment_from_refund();
32
+
33
+ if ( 'refunded' === $payment->status ) {
34
+ edd_debug_log( 'PayPal Commerce - Exiting webhook, as payment status is already refunded.' );
35
+
36
+ return;
37
+ }
38
+
39
+ $payment_amount = edd_get_payment_amount( $payment->ID );
40
+ $refunded_amount = isset( $this->event->resource->amount->value ) ? $this->event->resource->amount->value : $payment_amount;
41
+ $currency = isset( $this->event->resource->amount->currency_code ) ? $this->event->resource->amount->currency_code : $payment->currency;
42
+
43
+ /* Translators: %1$s - Amount refunded; %2$s - Original payment ID; %3$s - Refund transaction ID */
44
+ $payment_note = sprintf(
45
+ esc_html__( 'Amount: %1$s; Payment transaction ID: %2$s; Refund transaction ID: %3$s', 'easy-digital-downloads' ),
46
+ edd_currency_filter( edd_format_amount( $refunded_amount ), $currency ),
47
+ esc_html( $payment->transaction_id ),
48
+ esc_html( $this->event->resource->id )
49
+ );
50
+
51
+ // Partial refund.
52
+ if ( (float) $refunded_amount < (float) $payment_amount ) {
53
+ edd_insert_payment_note( $payment->ID, esc_html__( 'Partial refund processed in PayPal.', 'easy-digital-downloads' ) . ' ' . $payment_note );
54
+ } else {
55
+ // Full refund.
56
+ edd_insert_payment_note( $payment->ID, esc_html__( 'Full refund processed in PayPal.', 'easy-digital-downloads' ) . ' ' . $payment_note );
57
+ edd_update_payment_status( $payment->ID, 'refunded' );
58
+ }
59
+ }
60
+ }
includes/gateways/paypal/webhooks/functions.php ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Webhook Functions
4
+ *
5
+ * @package easy-digital-downloads
6
+ * @subpackage Gateways\PayPal\Webhooks
7
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
8
+ * @license GPL2+
9
+ * @since 2.11
10
+ */
11
+
12
+ namespace EDD\Gateways\PayPal\Webhooks;
13
+
14
+ use EDD\Gateways\PayPal\API;
15
+ use EDD\Gateways\PayPal\Exceptions\API_Exception;
16
+ use EDD\Gateways\PayPal\Exceptions\Authentication_Exception;
17
+
18
+ /**
19
+ * Returns the webhook URL.
20
+ *
21
+ * @since 2.11
22
+ * @return string
23
+ */
24
+ function get_webhook_url() {
25
+ return rest_url( Webhook_Handler::REST_NAMESPACE . '/' . Webhook_Handler::REST_ROUTE );
26
+ }
27
+
28
+ /**
29
+ * Returns the ID of the webhook.
30
+ *
31
+ * @param string $mode API mode. Either `sandbox` or `live`. If omitted, current store mode is used.
32
+ *
33
+ * @since 2.11
34
+ * @return string|false
35
+ */
36
+ function get_webhook_id( $mode = '' ) {
37
+ if ( empty( $mode ) ) {
38
+ $mode = edd_is_test_mode() ? API::MODE_SANDBOX : API::MODE_LIVE;
39
+ }
40
+
41
+ return get_option( sanitize_key( 'edd_paypal_commerce_webhook_id_' . $mode ) );
42
+ }
43
+
44
+ /**
45
+ * Returns the list of webhook events that EDD requires.
46
+ *
47
+ * @link https://developer.paypal.com/docs/api-basics/notifications/webhooks/event-names/#sales
48
+ *
49
+ * @todo Would be nice to use the EDD 3.0 registry for this at some point.
50
+ *
51
+ * @param string $mode Store mode. Either `sandbox` or `live`.
52
+ *
53
+ * @since 2.11
54
+ * @return array
55
+ */
56
+ function get_webhook_events( $mode = '' ) {
57
+ $events = array(
58
+ 'PAYMENT.CAPTURE.COMPLETED' => '\\EDD\\Gateways\\PayPal\\Webhooks\\Events\\Payment_Capture_Completed',
59
+ 'PAYMENT.CAPTURE.DENIED' => '\\EDD\\Gateways\\PayPal\\Webhooks\\Events\\Payment_Capture_Denied',
60
+ 'PAYMENT.CAPTURE.REFUNDED' => '\\EDD\\Gateways\\PayPal\\Webhooks\\Events\\Payment_Capture_Refunded',
61
+ 'PAYMENT.CAPTURE.REVERSED' => '\\EDD\\Gateways\\PayPal\\Webhooks\\Events\\Payment_Capture_Refunded',
62
+ );
63
+
64
+ /**
65
+ * Filters the webhook events.
66
+ *
67
+ * @param array $events Array of events that PayPal will send webhooks for.
68
+ * @param string $mode Mode the webhook is being created in. Either `sandbox` or `live`.
69
+ *
70
+ * @since 2.11
71
+ */
72
+ return (array) apply_filters( 'edd_paypal_webhook_events', $events, $mode );
73
+ }
74
+
75
+ /**
76
+ * Creates a webhook.
77
+ *
78
+ * @param string $mode Store mode. Either `sandbox` or `live`. If omitted, current store mode is used.
79
+ *
80
+ * @return true
81
+ * @throws API_Exception
82
+ * @throws Authentication_Exception
83
+ */
84
+ function create_webhook( $mode = '' ) {
85
+ if ( ! is_ssl() ) {
86
+ throw new API_Exception( __( 'An SSL certificate is required to create a PayPal webhook.', 'easy-digital-downloads' ) );
87
+ }
88
+
89
+ if ( empty( $mode ) ) {
90
+ $mode = edd_is_test_mode() ? API::MODE_SANDBOX : API::MODE_LIVE;
91
+ }
92
+
93
+ $webhook_url = get_webhook_url();
94
+
95
+ $api = new API( $mode );
96
+
97
+ // First, list webhooks in case it's already added.
98
+ try {
99
+ $response = $api->make_request( 'v1/notifications/webhooks', array(), array(), 'GET' );
100
+ if ( ! empty( $response->webhooks ) && is_array( $response->webhooks ) ) {
101
+ foreach ( $response->webhooks as $webhook ) {
102
+ if ( ! empty( $webook->id ) && ! empty( $webhook->url ) && $webhook_url === $webhook->url ) {
103
+ update_option( sanitize_key( 'edd_paypal_commerce_webhook_id_' . $mode ), sanitize_text_field( $webhook->id ) );
104
+
105
+ return true;
106
+ }
107
+ }
108
+ }
109
+ } catch ( \Exception $e ) {
110
+ // Continue to webhook creation.
111
+ }
112
+
113
+ $event_types = array();
114
+
115
+ foreach ( array_keys( get_webhook_events( $mode ) ) as $event ) {
116
+ $event_types[] = array( 'name' => $event );
117
+ }
118
+
119
+ $response = $api->make_request( 'v1/notifications/webhooks', array(
120
+ 'url' => $webhook_url,
121
+ 'event_types' => $event_types
122
+ ) );
123
+
124
+ if ( 201 !== $api->last_response_code ) {
125
+ throw new API_Exception( sprintf(
126
+ /* Translators: %d - HTTP response code; %s - Full response from the API. */
127
+ __( 'Invalid response code %d while creating webhook. Response: %s', 'easy-digital-downloads' ),
128
+ $api->last_response_code,
129
+ json_encode( $response )
130
+ ) );
131
+ }
132
+
133
+ if ( empty( $response->id ) ) {
134
+ throw new API_Exception( __( 'Unexpected response from PayPal.', 'easy-digital-downloads' ) );
135
+ }
136
+
137
+ update_option( sanitize_key( 'edd_paypal_commerce_webhook_id_' . $mode ), sanitize_text_field( $response->id ) );
138
+
139
+ return true;
140
+ }
141
+
142
+ /**
143
+ * Syncs the webhook with expected data. This replaces the webhook URL and event types with
144
+ * what EDD expects them to be. This can be used when the events need to be updated in
145
+ * the event that some are missing.
146
+ *
147
+ * @param string $mode Either `sandbox` or `live` mode. If omitted, current store mode is used.
148
+ *
149
+ * @since 2.11
150
+ * @return true
151
+ * @throws API_Exception
152
+ * @throws Authentication_Exception
153
+ */
154
+ function sync_webhook( $mode = '' ) {
155
+ if ( empty( $mode ) ) {
156
+ $mode = edd_is_test_mode() ? API::MODE_SANDBOX : API::MODE_LIVE;
157
+ }
158
+
159
+ $webhook_id = get_webhook_id( $mode );
160
+ if ( empty( $webhook_id ) ) {
161
+ throw new \Exception( esc_html__( 'Webhook not configured.', 'easy-digital-downloads' ) );
162
+ }
163
+
164
+ $event_types = array();
165
+ foreach ( array_keys( get_webhook_events( $mode ) ) as $event ) {
166
+ $event_types[] = array( 'name' => $event );
167
+ }
168
+
169
+ $new_data = array(
170
+ array(
171
+ 'op' => 'replace',
172
+ 'path' => '/url',
173
+ 'value' => get_webhook_url()
174
+ ),
175
+ array(
176
+ 'op' => 'replace',
177
+ 'path' => '/event_types',
178
+ 'value' => $event_types
179
+ )
180
+ );
181
+
182
+ $api = new API( $mode );
183
+ $response = $api->make_request( 'v1/notifications/webhooks/' . urlencode( $webhook_id ), $new_data, array(), 'PATCH' );
184
+ if ( 400 === $api->last_response_code && isset( $response->name ) && 'WEBHOOK_PATCH_REQUEST_NO_CHANGE' === $response->name ) {
185
+ return true;
186
+ }
187
+
188
+ if ( 200 !== $api->last_response_code ) {
189
+ throw new API_Exception( sprintf(
190
+ /* Translators: %d - HTTP response code; %s - Full response from the API. */
191
+ __( 'Invalid response code %d while syncing webhook. Response: %s', 'easy-digital-downloads' ),
192
+ $api->last_response_code,
193
+ json_encode( $response )
194
+ ) );
195
+ }
196
+
197
+ return true;
198
+ }
199
+
200
+ /**
201
+ * Retrieves information about the webhook EDD created.
202
+ *
203
+ * @param string $mode Mode to get the webhook in. If omitted, current store mode is used.
204
+ *
205
+ * @return object|false Webhook object on success, false if there is no webhook set up.
206
+ * @throws API_Exception
207
+ * @throws Authentication_Exception
208
+ */
209
+ function get_webhook_details( $mode = '' ) {
210
+ if ( empty( $mode ) ) {
211
+ $mode = edd_is_test_mode() ? API::MODE_SANDBOX : API::MODE_LIVE;
212
+ }
213
+
214
+ $webhook_id = get_option( sanitize_key( 'edd_paypal_commerce_webhook_id_' . $mode ) );
215
+
216
+ // Bail if webhook was never set.
217
+ if ( ! $webhook_id ) {
218
+ return false;
219
+ }
220
+
221
+ $api = new API( $mode );
222
+ $response = $api->make_request( 'v1/notifications/webhooks/' . urlencode( $webhook_id ), array(), array(), 'GET' );
223
+ if ( 200 !== $api->last_response_code ) {
224
+ throw new API_Exception( sprintf(
225
+ /* Translators: %d - HTTP response code. */
226
+ __( 'Invalid response code %d while retrieving webhook details.', 'easy-digital-downloads' ),
227
+ $api->last_response_code
228
+ ) );
229
+ }
230
+
231
+ if ( empty( $response->id ) ) {
232
+ throw new API_Exception( __( 'Unexpected response from PayPal when retrieving webhook details.', 'easy-digital-downloads' ) );
233
+ }
234
+
235
+ return $response;
236
+ }
237
+
238
+ /**
239
+ * Deletes the webhook.
240
+ *
241
+ * @since 2.11
242
+ *
243
+ * @param string $mode
244
+ *
245
+ * @throws API_Exception
246
+ * @throws Authentication_Exception
247
+ */
248
+ function delete_webhook( $mode = '' ) {
249
+ if ( empty( $mode ) ) {
250
+ $mode = edd_is_test_mode() ? API::MODE_SANDBOX : API::MODE_LIVE;
251
+ }
252
+
253
+ $webhook_id = get_option( sanitize_key( 'edd_paypal_commerce_webhook_id_' . $mode ) );
254
+
255
+ // Bail if webhook was never set.
256
+ if ( ! $webhook_id ) {
257
+ return;
258
+ }
259
+
260
+ $api = new API( $mode );
261
+
262
+ $api->make_request( 'v1/notifications/webhooks/' . urlencode( $webhook_id ), array(), array(), 'DELETE' );
263
+
264
+ if ( 204 !== $api->last_response_code ) {
265
+ throw new API_Exception( sprintf(
266
+ /* Translators: %d - HTTP response code. */
267
+ __( 'Invalid response code %d while deleting webhook.', 'easy-digital-downloads' ),
268
+ $api->last_response_code
269
+ ) );
270
+ }
271
+ }
includes/gateways/stripe/vendor/composer/InstalledVersions.php CHANGED
@@ -30,7 +30,7 @@ private static $installed = array (
30
  'aliases' =>
31
  array (
32
  ),
33
- 'reference' => '15351f43939ecb36e4acc5b0cf5477c28f232632',
34
  'name' => 'easy-digital-downloads/edd-stripe',
35
  ),
36
  'versions' =>
@@ -51,7 +51,7 @@ private static $installed = array (
51
  'aliases' =>
52
  array (
53
  ),
54
- 'reference' => '15351f43939ecb36e4acc5b0cf5477c28f232632',
55
  ),
56
  'roundcube/plugin-installer' =>
57
  array (
30
  'aliases' =>
31
  array (
32
  ),
33
+ 'reference' => 'a2ea05befdc50285965a7c73099485d1dc67d86a',
34
  'name' => 'easy-digital-downloads/edd-stripe',
35
  ),
36
  'versions' =>
51
  'aliases' =>
52
  array (
53
  ),
54
+ 'reference' => 'a2ea05befdc50285965a7c73099485d1dc67d86a',
55
  ),
56
  'roundcube/plugin-installer' =>
57
  array (
includes/gateways/stripe/vendor/composer/installed.php CHANGED
@@ -6,7 +6,7 @@
6
  'aliases' =>
7
  array (
8
  ),
9
- 'reference' => '15351f43939ecb36e4acc5b0cf5477c28f232632',
10
  'name' => 'easy-digital-downloads/edd-stripe',
11
  ),
12
  'versions' =>
@@ -27,7 +27,7 @@
27
  'aliases' =>
28
  array (
29
  ),
30
- 'reference' => '15351f43939ecb36e4acc5b0cf5477c28f232632',
31
  ),
32
  'roundcube/plugin-installer' =>
33
  array (
6
  'aliases' =>
7
  array (
8
  ),
9
+ 'reference' => 'a2ea05befdc50285965a7c73099485d1dc67d86a',
10
  'name' => 'easy-digital-downloads/edd-stripe',
11
  ),
12
  'versions' =>
27
  'aliases' =>
28
  array (
29
  ),
30
+ 'reference' => 'a2ea05befdc50285965a7c73099485d1dc67d86a',
31
  ),
32
  'roundcube/plugin-installer' =>
33
  array (
includes/install.php CHANGED
@@ -71,9 +71,15 @@ function edd_run_install() {
71
  // Clear the permalinks
72
  flush_rewrite_rules( false );
73
 
74
- // Add Upgraded From Option
75
  $current_version = get_option( 'edd_version' );
 
76
  if ( $current_version ) {
 
 
 
 
 
77
  update_option( 'edd_version_upgraded_from', $current_version );
78
  }
79
 
@@ -196,9 +202,14 @@ function edd_run_install() {
196
  $api = new EDD_API;
197
  update_option( 'edd_default_api_version', 'v' . $api->get_version() );
198
 
199
- // Create the customer databases
200
- @EDD()->customers->create_table();
201
- @EDD()->customer_meta->create_table();
 
 
 
 
 
202
 
203
  // Check for PHP Session support, and enable if available
204
  EDD()->session->use_php_sessions();
71
  // Clear the permalinks
72
  flush_rewrite_rules( false );
73
 
74
+ // Add Upgraded/Downgraded From Option
75
  $current_version = get_option( 'edd_version' );
76
+ $downgraded = false;
77
  if ( $current_version ) {
78
+ if ( version_compare( $current_version, EDD_VERSION, '>' ) ) {
79
+ $downgraded = true;
80
+ update_option( 'edd_version_downgraded_from', $current_version );
81
+ }
82
+
83
  update_option( 'edd_version_upgraded_from', $current_version );
84
  }
85
 
202
  $api = new EDD_API;
203
  update_option( 'edd_default_api_version', 'v' . $api->get_version() );
204
 
205
+ if ( ! $downgraded || ! edd_do_downgrade() ) {
206
+ /*
207
+ * Create the customer databases.
208
+ * This should only run if a downgrade _wasn't_ performed.
209
+ */
210
+ @EDD()->customers->create_table();
211
+ @EDD()->customer_meta->create_table();
212
+ }
213
 
214
  // Check for PHP Session support, and enable if available
215
  EDD()->session->use_php_sessions();
includes/process-purchase.php CHANGED
@@ -58,7 +58,7 @@ function edd_process_purchase_form() {
58
  }
59
 
60
  // Validate the user.
61
- $user = edd_get_purchase_form_user( $valid_data );
62
 
63
  // Let extensions validate fields after user is logged in if user has used login/registration form.
64
  do_action( 'edd_checkout_user_error_checks', $user, $valid_data, $_POST );
@@ -820,10 +820,10 @@ function edd_register_and_login_new_user( $user_data = array() ) {
820
  * @param array $valid_data The validated data from the checkout form validation.
821
  * @return array
822
  */
823
- function edd_get_purchase_form_user( $valid_data = array() ) {
824
  // Initialize user.
825
  $user = false;
826
- $is_ajax = defined( 'DOING_AJAX' ) && DOING_AJAX;
827
 
828
  if ( $is_ajax ) {
829
 
@@ -837,6 +837,9 @@ function edd_get_purchase_form_user( $valid_data = array() ) {
837
 
838
  } elseif ( true === $valid_data['need_new_user'] || true === $valid_data['need_user_login'] ) {
839
 
 
 
 
840
  // New user registration.
841
  if ( true === $valid_data['need_new_user'] ) {
842
 
@@ -869,6 +872,8 @@ function edd_get_purchase_form_user( $valid_data = array() ) {
869
  edd_log_user_in( $user['user_id'], $user['user_login'], $user['user_pass'] );
870
  }
871
  }
 
 
872
  }
873
 
874
  // Check guest checkout.
@@ -914,6 +919,22 @@ function edd_get_purchase_form_user( $valid_data = array() ) {
914
  return $user;
915
  }
916
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
917
  /**
918
  * Validates the credit card info
919
  *
58
  }
59
 
60
  // Validate the user.
61
+ $user = edd_get_purchase_form_user( $valid_data, $is_ajax );
62
 
63
  // Let extensions validate fields after user is logged in if user has used login/registration form.
64
  do_action( 'edd_checkout_user_error_checks', $user, $valid_data, $_POST );
820
  * @param array $valid_data The validated data from the checkout form validation.
821
  * @return array
822
  */
823
+ function edd_get_purchase_form_user( $valid_data = array(), $is_ajax = null ) {
824
  // Initialize user.
825
  $user = false;
826
+ $is_ajax = ( null === $is_ajax ) ? ( defined( 'DOING_AJAX' ) && DOING_AJAX ) : $is_ajax;
827
 
828
  if ( $is_ajax ) {
829
 
837
 
838
  } elseif ( true === $valid_data['need_new_user'] || true === $valid_data['need_user_login'] ) {
839
 
840
+ // This ensures $_COOKIE is available without a new HTTP request.
841
+ add_action( 'set_logged_in_cookie', 'edd_set_logged_in_cookie' );
842
+
843
  // New user registration.
844
  if ( true === $valid_data['need_new_user'] ) {
845
 
872
  edd_log_user_in( $user['user_id'], $user['user_login'], $user['user_pass'] );
873
  }
874
  }
875
+
876
+ remove_action( 'set_logged_in_cookie', 'edd_set_logged_in_cookie' );
877
  }
878
 
879
  // Check guest checkout.
919
  return $user;
920
  }
921
 
922
+ /**
923
+ * Sets the $_COOKIE global when a logged in cookie is available.
924
+ *
925
+ * We need the global to be immediately available so calls to wp_create_nonce()
926
+ * within the same session will use the newly available data.
927
+ *
928
+ * @since 2.11
929
+ *
930
+ * @link https://wordpress.stackexchange.com/a/184055
931
+ *
932
+ * @param string $logged_in_cookie The logged-in cookie value.
933
+ */
934
+ function edd_set_logged_in_cookie( $logged_in_cookie ) {
935
+ $_COOKIE[ LOGGED_IN_COOKIE ] = $logged_in_cookie;
936
+ }
937
+
938
  /**
939
  * Validates the credit card info
940
  *
includes/query-filters.php CHANGED
@@ -57,7 +57,7 @@ add_action( 'template_redirect', 'edd_block_attachments' );
57
  */
58
  function edd_unset_discount_query_arg( $query ) {
59
 
60
- if ( is_admin() || ! $query->is_main_query() ) {
61
  return;
62
  }
63
 
@@ -148,4 +148,4 @@ function edd_refresh_permalinks_on_bad_404() {
148
 
149
  }
150
  }
151
- add_action( 'template_redirect', 'edd_refresh_permalinks_on_bad_404' );
57
  */
58
  function edd_unset_discount_query_arg( $query ) {
59
 
60
+ if ( is_admin() || ! $query->is_main_query() || ! empty( $query->query_vars['edd-api'] ) ) {
61
  return;
62
  }
63
 
148
 
149
  }
150
  }
151
+ add_action( 'template_redirect', 'edd_refresh_permalinks_on_bad_404' );
includes/template-functions.php CHANGED
@@ -183,8 +183,8 @@ function edd_get_purchase_link( $args = array() ) {
183
  $class = implode( ' ', array( $args['style'], $args['color'], trim( $args['class'] ) ) );
184
 
185
  if ( ! edd_is_ajax_disabled() ) {
186
-
187
- echo '<a href="#" class="edd-add-to-cart ' . esc_attr( $class ) . '" data-nonce="' . wp_create_nonce( 'edd-add-to-cart-' . $download->ID ) . '" data-action="edd_add_to_cart" data-download-id="' . esc_attr( $download->ID ) . '" ' . $data_variable . ' ' . $type . ' ' . $data_price . ' ' . $button_display . '><span class="edd-add-to-cart-label">' . $args['text'] . '</span> <span class="edd-loading" aria-label="' . esc_attr__( 'Loading', 'easy-digital-downloads' ) . '"></span></a>';
188
 
189
  }
190
 
183
  $class = implode( ' ', array( $args['style'], $args['color'], trim( $args['class'] ) ) );
184
 
185
  if ( ! edd_is_ajax_disabled() ) {
186
+ $timestamp = time();
187
+ echo '<a href="#" class="edd-add-to-cart ' . esc_attr( $class ) . '" data-nonce="' . wp_create_nonce( 'edd-add-to-cart-' . $download->ID ) . '" data-timestamp="' . esc_attr( $timestamp ) . '" data-token="' . esc_attr( EDD\Utils\Tokenizer::tokenize( $timestamp ) ) . '" data-action="edd_add_to_cart" data-download-id="' . esc_attr( $download->ID ) . '" ' . $data_variable . ' ' . $type . ' ' . $data_price . ' ' . $button_display . '><span class="edd-add-to-cart-label">' . $args['text'] . '</span> <span class="edd-loading" aria-label="' . esc_attr__( 'Loading', 'easy-digital-downloads' ) . '"></span></a>';
188
 
189
  }
190
 
includes/utils/class-tokenizer.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Tokenizer
4
+ *
5
+ * A class for generating tokens as an alternative to nonce verification.
6
+ * This is designed to work a little better with full page caching.
7
+ *
8
+ * @package easy-digital-downloads
9
+ * @copyright Copyright (c) 2021, Sandhills Development, LLC
10
+ * @license GPL2+
11
+ * @since 2.11
12
+ */
13
+
14
+ namespace EDD\Utils;
15
+
16
+ class Tokenizer {
17
+
18
+ /**
19
+ * @var mixed Data to tokenize.
20
+ */
21
+ private $data;
22
+
23
+ /**
24
+ * Tokenizer constructor.
25
+ *
26
+ * @param string|int|float $data Data to be tokenized.
27
+ */
28
+ public function __construct( $data ) {
29
+ $this->data = $data;
30
+ }
31
+
32
+ /**
33
+ * Retrieves the signing key.
34
+ *
35
+ * @since 2.11
36
+ *
37
+ * @return string
38
+ */
39
+ private function get_signing_key() {
40
+ $key = get_option( 'edd_tokenizer_signing_key' );
41
+ if ( empty( $key ) ) {
42
+ $key = $this->generate_and_save_signing_key();
43
+ }
44
+
45
+ return $key;
46
+ }
47
+
48
+ /**
49
+ * Generates and saves a new signing key.
50
+ *
51
+ * @since 2.11
52
+ *
53
+ * @return string
54
+ */
55
+ private function generate_and_save_signing_key() {
56
+ if ( function_exists( 'random_bytes' ) ) {
57
+ try {
58
+ $key = bin2hex( random_bytes( 32 ) );
59
+ } catch ( \Exception $e ) {
60
+ // If this failed for some reason, we'll generate using the fallback below.
61
+ }
62
+ }
63
+
64
+ if ( empty( $key ) ) {
65
+ $key = function_exists( 'openssl_random_pseudo_bytes' ) ? bin2hex( openssl_random_pseudo_bytes( 32 ) ) : md5( uniqid() );
66
+ }
67
+
68
+ update_option( 'edd_tokenizer_signing_key', $key );
69
+
70
+ return $key;
71
+ }
72
+
73
+ /**
74
+ * Generates a token from the data.
75
+ *
76
+ * @since 2.11
77
+ *
78
+ * @return string|false
79
+ */
80
+ public function generate_token() {
81
+ return hash_hmac( 'sha256', $this->data, $this->get_signing_key() );
82
+ }
83
+
84
+ /**
85
+ * Determines whether or not the supplied token is valid for the
86
+ * supplied data.
87
+ *
88
+ * @since 2.11
89
+ *
90
+ * @param string $token Token to check.
91
+ * @param string|int|float $data Data that's been tokenized.
92
+ *
93
+ * @return bool
94
+ */
95
+ public static function is_token_valid( $token, $data ) {
96
+ $real_token = self::tokenize( $data );
97
+
98
+ return hash_equals( $token, $real_token );
99
+ }
100
+
101
+ /**
102
+ * Generates a token for the supplied data.
103
+ *
104
+ * @since 2.11
105
+ *
106
+ * @param string|int|float $data
107
+ *
108
+ * @return string|false
109
+ */
110
+ public static function tokenize( $data ) {
111
+ $generator = new Tokenizer( $data );
112
+
113
+ return $generator->generate_token();
114
+ }
115
+
116
+ }
languages/easy-digital-downloads.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the Easy Digital Downloads package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Easy Digital Downloads 2.10.6\n"
6
  "Report-Msgid-Bugs-To: https://easydigitaldownloads.com/\n"
7
- "POT-Creation-Date: 2021-06-21 13:06:51+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -28,21 +28,30 @@ msgstr ""
28
  msgid "Cheatin&#8217; huh?"
29
  msgstr ""
30
 
31
- #: includes/EDD_SL_Plugin_Updater.php:250
32
- msgid "There is a new version of %1$s available. %2$sView version %3$s details%4$s."
 
33
  msgstr ""
34
 
35
- #: includes/EDD_SL_Plugin_Updater.php:258
36
- msgid ""
37
- "There is a new version of %1$s available. %2$sView version %3$s details%4$s "
38
- "or %5$supdate now%6$s."
 
 
 
 
 
 
 
 
39
  msgstr ""
40
 
41
- #: includes/EDD_SL_Plugin_Updater.php:502
42
  msgid "You do not have permission to install plugin updates"
43
  msgstr ""
44
 
45
- #: includes/EDD_SL_Plugin_Updater.php:502
46
  #: includes/admin/customers/customer-actions.php:301
47
  #: includes/admin/customers/customer-actions.php:345
48
  #: includes/admin/customers/customer-actions.php:603
@@ -80,23 +89,27 @@ msgstr ""
80
  #: includes/admin/tools/class-edd-tools-reset-stats.php:179
81
  #: includes/admin/tools.php:1027 includes/admin/tools.php:1033
82
  #: includes/admin/upgrades/classes/class-file-download-log-migration.php:136
83
- #: includes/admin/upgrades/upgrade-functions.php:221
84
- #: includes/admin/upgrades/upgrade-functions.php:537
85
- #: includes/admin/upgrades/upgrade-functions.php:619
86
- #: includes/admin/upgrades/upgrade-functions.php:730
87
- #: includes/admin/upgrades/upgrade-functions.php:827
88
- #: includes/admin/upgrades/upgrade-functions.php:901
89
- #: includes/admin/upgrades/upgrade-functions.php:1029
90
- #: includes/admin/upgrades/upgrade-functions.php:1114
91
  #: includes/api/class-edd-api.php:1976 includes/api/class-edd-api.php:1981
92
  #: includes/api/class-edd-api.php:1993 includes/api/class-edd-api.php:1995
93
  #: includes/cart/class-edd-cart.php:1433 includes/cart/class-edd-cart.php:1447
94
- #: includes/class-edd-license-handler.php:382
95
  #: includes/deprecated-functions.php:517 includes/deprecated-functions.php:532
96
  #: includes/deprecated-functions.php:542 includes/download-functions.php:1277
97
  #: includes/emails/actions.php:53 includes/emails/template.php:243
98
- #: includes/error-tracking.php:40 includes/gateways/functions.php:232
99
- #: includes/gateways/manual.php:33 includes/gateways/paypal-standard.php:168
 
 
 
 
100
  #: includes/gateways/stripe/includes/admin/upgrade-functions.php:57
101
  #: includes/gateways/stripe/includes/payment-actions.php:1403
102
  #: includes/process-download.php:303 includes/process-download.php:894
@@ -273,6 +286,7 @@ msgstr ""
273
  #: includes/admin/class-edd-notices.php:49
274
  #: includes/admin/class-edd-notices.php:70
275
  #: includes/admin/class-edd-notices.php:87
 
276
  msgid "Dismiss Notice"
277
  msgstr ""
278
 
@@ -616,7 +630,7 @@ msgstr ""
616
  #: includes/admin/import/import-functions.php:113
617
  #: includes/admin/reporting/export/export-actions.php:23
618
  #: includes/api/class-edd-api.php:1976
619
- #: includes/class-edd-license-handler.php:382
620
  msgid "Nonce verification failed"
621
  msgstr ""
622
 
@@ -705,7 +719,7 @@ msgid "City"
705
  msgstr ""
706
 
707
  #: includes/admin/customers/customers.php:269
708
- #: includes/admin/settings/register-settings.php:2298
709
  #: includes/admin/tools.php:695 includes/checkout/template.php:435
710
  #: templates/shortcode-profile-editor.php:171
711
  msgid "State / Province"
@@ -813,7 +827,7 @@ msgstr ""
813
  #: includes/admin/downloads/metabox.php:714
814
  #: includes/admin/downloads/metabox.php:839
815
  #: includes/admin/payments/view-order-details.php:523
816
- #: includes/admin/settings/register-settings.php:2301 includes/scripts.php:227
817
  #: templates/checkout_cart.php:57 templates/checkout_cart.php:75
818
  #: templates/shortcode-profile-editor.php:123
819
  msgid "Remove"
@@ -1328,10 +1342,10 @@ msgstr ""
1328
  #: includes/admin/settings/register-settings.php:1370
1329
  #: includes/admin/settings/register-settings.php:1426
1330
  #: includes/admin/settings/register-settings.php:1431
1331
- #: includes/admin/settings/register-settings.php:1435
1332
- #: includes/admin/settings/register-settings.php:1440
1333
- #: includes/admin/settings/register-settings.php:1443
1334
- #: includes/admin/settings/register-settings.php:1458
1335
  #: includes/admin/tools.php:68
1336
  msgid "General"
1337
  msgstr ""
@@ -2546,6 +2560,15 @@ msgstr ""
2546
 
2547
  #: includes/admin/promos/class-promo-handler.php:109
2548
  #: includes/admin/promos/class-promo-handler.php:117
 
 
 
 
 
 
 
 
 
2549
  msgid "You do not have permission to perform this action."
2550
  msgstr ""
2551
 
@@ -2752,7 +2775,7 @@ msgstr ""
2752
 
2753
  #: includes/admin/reporting/class-export-payments.php:68
2754
  #: includes/admin/reporting/export/class-batch-export-payments.php:49
2755
- #: includes/admin/settings/register-settings.php:2297
2756
  #: includes/admin/tools.php:713
2757
  #: includes/gateways/stripe/includes/template-functions.php:510
2758
  #: includes/gateways/stripe/includes/template-functions.php:519
@@ -2827,7 +2850,7 @@ msgid "Payment ID"
2827
  msgstr ""
2828
 
2829
  #: includes/admin/reporting/class-gateway-error-logs-list-table.php:78
2830
- #: includes/gateways/manual.php:73 includes/gateways/paypal-standard.php:191
2831
  msgid "Payment Error"
2832
  msgstr ""
2833
 
@@ -2982,8 +3005,8 @@ msgid "Featured Image"
2982
  msgstr ""
2983
 
2984
  #: includes/admin/reporting/export/class-batch-export-downloads.php:55
2985
- #: includes/emails/class-edd-email-tags.php:411
2986
- #: includes/emails/class-edd-email-tags.php:533
2987
  #: templates/shortcode-receipt.php:125
2988
  msgid "SKU"
2989
  msgstr ""
@@ -3153,7 +3176,7 @@ msgid "Refresh Reports"
3153
  msgstr ""
3154
 
3155
  #: includes/admin/reporting/logs.php:144
3156
- #: includes/admin/settings/register-settings.php:1453
3157
  #: includes/privacy-functions.php:544
3158
  msgid "File Downloads"
3159
  msgstr ""
@@ -3463,7 +3486,7 @@ msgid ""
3463
  msgstr ""
3464
 
3465
  #: includes/admin/settings/contextual-help.php:93
3466
- #: includes/admin/settings/register-settings.php:1450
3467
  msgid "Miscellaneous"
3468
  msgstr ""
3469
 
@@ -4471,227 +4494,222 @@ msgstr ""
4471
  msgid "Misc"
4472
  msgstr ""
4473
 
4474
- #: includes/admin/settings/register-settings.php:1432
4475
- #: includes/gateways/functions.php:25 includes/gateways/paypal-standard.php:33
4476
- msgid "PayPal Standard"
4477
- msgstr ""
4478
-
4479
- #: includes/admin/settings/register-settings.php:1436
4480
  msgid "Purchase Receipts"
4481
  msgstr ""
4482
 
4483
- #: includes/admin/settings/register-settings.php:1437
4484
  msgid "New Sale Notifications"
4485
  msgstr ""
4486
 
4487
- #: includes/admin/settings/register-settings.php:1446
4488
  msgid "Main"
4489
  msgstr ""
4490
 
4491
- #: includes/admin/settings/register-settings.php:1451
4492
  #: includes/gateways/stripe/includes/payment-methods/payment-request/admin/settings.php:82
4493
- #: includes/install.php:92 templates/widget-cart-checkout.php:6
4494
  #: templates/widget-cart-empty.php:7
4495
  msgid "Checkout"
4496
  msgstr ""
4497
 
4498
- #: includes/admin/settings/register-settings.php:1452
4499
  msgid "Button Text"
4500
  msgstr ""
4501
 
4502
- #: includes/admin/settings/register-settings.php:1454
4503
  msgid "Accounting"
4504
  msgstr ""
4505
 
4506
- #: includes/admin/settings/register-settings.php:1455
4507
  msgid "Terms of Agreement"
4508
  msgstr ""
4509
 
4510
- #: includes/admin/settings/register-settings.php:1459
4511
  msgid "Export & Erase"
4512
  msgstr ""
4513
 
4514
- #: includes/admin/settings/register-settings.php:1701
4515
  msgid ""
4516
  "Don't see what you need? More Payment Gateway options are available <a "
4517
  "href=\"%s\">here</a>."
4518
  msgstr ""
4519
 
4520
- #: includes/admin/settings/register-settings.php:1922
4521
  msgid "The callback function used for the %s setting is missing."
4522
  msgstr ""
4523
 
4524
- #: includes/admin/settings/register-settings.php:2084
4525
  msgid "Upload File"
4526
  msgstr ""
4527
 
4528
- #: includes/admin/settings/register-settings.php:2177
4529
  msgid ""
4530
  "<a href=\"https://sendwp.com/account/\" target=\"_blank\" rel=\"noopener "
4531
  "noreferrer\">Access your SendWP account</a>."
4532
  msgstr ""
4533
 
4534
- #: includes/admin/settings/register-settings.php:2197
4535
  msgid "SendWP plugin activated."
4536
  msgstr ""
4537
 
4538
- #: includes/admin/settings/register-settings.php:2200
4539
  msgid "Disconnect SendWP"
4540
  msgstr ""
4541
 
4542
- #: includes/admin/settings/register-settings.php:2207
4543
  msgid ""
4544
  "We recommend SendWP to ensure quick and reliable delivery of all emails "
4545
  "sent from your store, such as purchase receipts, subscription renewal "
4546
  "reminders, password resets, and more."
4547
  msgstr ""
4548
 
4549
- #: includes/admin/settings/register-settings.php:2207
4550
  msgid "%sLearn more%s"
4551
  msgstr ""
4552
 
4553
- #: includes/admin/settings/register-settings.php:2210
4554
  msgid "Connect with SendWP"
4555
  msgstr ""
4556
 
4557
- #: includes/admin/settings/register-settings.php:2246
4558
  msgid "Recapture plugin activated."
4559
  msgstr ""
4560
 
4561
- #: includes/admin/settings/register-settings.php:2247
4562
  msgid "%sAccess your Recapture account%s."
4563
  msgstr ""
4564
 
4565
- #: includes/admin/settings/register-settings.php:2252
4566
  msgid "Disconnect Recapture"
4567
  msgstr ""
4568
 
4569
- #: includes/admin/settings/register-settings.php:2256
4570
  msgid "%sComplete your connection to Recapture%s"
4571
  msgstr ""
4572
 
4573
- #: includes/admin/settings/register-settings.php:2264
4574
  msgid ""
4575
  "We recommend Recapture for recovering lost revenue by automatically sending "
4576
  "effective, targeted emails to customers who abandon their shopping cart."
4577
  msgstr ""
4578
 
4579
- #: includes/admin/settings/register-settings.php:2264
4580
  msgid "%sLearn more%s (Free trial available)"
4581
  msgstr ""
4582
 
4583
- #: includes/admin/settings/register-settings.php:2268
4584
  msgid "Connect with Recapture"
4585
  msgstr ""
4586
 
4587
- #: includes/admin/settings/register-settings.php:2299
4588
  msgid "Country Wide"
4589
  msgstr ""
4590
 
4591
- #: includes/admin/settings/register-settings.php:2300
4592
  msgid "Rate"
4593
  msgstr ""
4594
 
4595
- #: includes/admin/settings/register-settings.php:2300
4596
  msgid ""
4597
  "<strong>Regional tax rates: </strong>When a customer enters an address on "
4598
  "checkout that matches the specified region for this tax rate, the cart tax "
4599
  "will adjust automatically. Enter a percentage, such as 6.5 for 6.5%."
4600
  msgstr ""
4601
 
4602
- #: includes/admin/settings/register-settings.php:2317
4603
- #: includes/admin/settings/register-settings.php:2365
4604
  msgid "Choose a country"
4605
  msgstr ""
4606
 
4607
- #: includes/admin/settings/register-settings.php:2335
4608
  msgid "Choose a state"
4609
  msgstr ""
4610
 
4611
- #: includes/admin/settings/register-settings.php:2347
4612
- #: includes/admin/settings/register-settings.php:2378
4613
  msgid "Apply to whole country"
4614
  msgstr ""
4615
 
4616
- #: includes/admin/settings/register-settings.php:2350
4617
- #: includes/admin/settings/register-settings.php:2381
4618
  msgid "Remove Rate"
4619
  msgstr ""
4620
 
4621
- #: includes/admin/settings/register-settings.php:2386
4622
  msgid "Add Tax Rate"
4623
  msgstr ""
4624
 
4625
- #: includes/admin/settings/register-settings.php:2439
4626
  msgid ""
4627
  "Your license key expired on %s. Please <a href=\"%s\" "
4628
  "target=\"_blank\">renew your license key</a>."
4629
  msgstr ""
4630
 
4631
- #: includes/admin/settings/register-settings.php:2452
4632
  msgid ""
4633
  "Your license key has been disabled. Please <a href=\"%s\" "
4634
  "target=\"_blank\">contact support</a> for more information."
4635
  msgstr ""
4636
 
4637
- #: includes/admin/settings/register-settings.php:2464
4638
  msgid ""
4639
  "Invalid license. Please <a href=\"%s\" target=\"_blank\">visit your account "
4640
  "page</a> and verify it."
4641
  msgstr ""
4642
 
4643
- #: includes/admin/settings/register-settings.php:2477
4644
  msgid ""
4645
  "Your %s is not active for this URL. Please <a href=\"%s\" "
4646
  "target=\"_blank\">visit your account page</a> to manage your license key "
4647
  "URLs."
4648
  msgstr ""
4649
 
4650
- #: includes/admin/settings/register-settings.php:2489
4651
  msgid "This appears to be an invalid license key for %s."
4652
  msgstr ""
4653
 
4654
- #: includes/admin/settings/register-settings.php:2498
4655
  msgid ""
4656
  "Your license key has reached its activation limit. <a href=\"%s\">View "
4657
  "possible upgrades</a> now."
4658
  msgstr ""
4659
 
4660
- #: includes/admin/settings/register-settings.php:2507
4661
  msgid ""
4662
  "The key you entered belongs to a bundle, please use the product specific "
4663
  "license key."
4664
  msgstr ""
4665
 
4666
- #: includes/admin/settings/register-settings.php:2515
4667
  msgid "unknown_error"
4668
  msgstr ""
4669
 
4670
- #: includes/admin/settings/register-settings.php:2516
4671
  msgid ""
4672
  "There was an error with this license key: %s. Please <a href=\"%s\">contact "
4673
  "our support team</a>."
4674
  msgstr ""
4675
 
4676
- #: includes/admin/settings/register-settings.php:2536
4677
  msgid "License key never expires."
4678
  msgstr ""
4679
 
4680
- #: includes/admin/settings/register-settings.php:2543
4681
  msgid ""
4682
  "Your license key expires soon! It expires on %s. <a href=\"%s\" "
4683
  "target=\"_blank\">Renew your license key</a>."
4684
  msgstr ""
4685
 
4686
- #: includes/admin/settings/register-settings.php:2553
4687
  msgid "Your license key expires on %s."
4688
  msgstr ""
4689
 
4690
- #: includes/admin/settings/register-settings.php:2571
4691
  msgid "To receive updates, please enter your valid %s license key."
4692
  msgstr ""
4693
 
4694
- #: includes/admin/settings/register-settings.php:2584
4695
  msgid "Deactivate License"
4696
  msgstr ""
4697
 
@@ -5169,141 +5187,141 @@ msgstr ""
5169
  msgid "File download logs updated successfully."
5170
  msgstr ""
5171
 
5172
- #: includes/admin/upgrades/upgrade-functions.php:87
5173
  msgid "The Payment History needs to be updated. %s"
5174
  msgstr ""
5175
 
5176
- #: includes/admin/upgrades/upgrade-functions.php:87
5177
  msgid "Click to Upgrade"
5178
  msgstr ""
5179
 
5180
- #: includes/admin/upgrades/upgrade-functions.php:93
5181
  msgid ""
5182
  "The Purchase and File Download History in Easy Digital Downloads needs to "
5183
  "be upgraded, click %shere%s to start the upgrade."
5184
  msgstr ""
5185
 
5186
- #: includes/admin/upgrades/upgrade-functions.php:101
5187
  msgid ""
5188
  "Easy Digital Downloads needs to upgrade the plugin pages, click %shere%s to "
5189
  "start the upgrade."
5190
  msgstr ""
5191
 
5192
- #: includes/admin/upgrades/upgrade-functions.php:109
5193
- #: includes/admin/upgrades/upgrade-functions.php:117
5194
  msgid ""
5195
  "Easy Digital Downloads needs to upgrade the database, click %shere%s to "
5196
  "start the upgrade."
5197
  msgstr ""
5198
 
5199
- #: includes/admin/upgrades/upgrade-functions.php:129
5200
  msgid ""
5201
  "Easy Digital Downloads needs to complete a database upgrade that was "
5202
  "previously started, click <a href=\"%s\">here</a> to resume the upgrade."
5203
  msgstr ""
5204
 
5205
- #: includes/admin/upgrades/upgrade-functions.php:140
5206
  msgid ""
5207
  "Easy Digital Downloads needs to upgrade past order numbers to make them "
5208
  "sequential, click <a href=\"%s\">here</a> to start the upgrade."
5209
  msgstr ""
5210
 
5211
- #: includes/admin/upgrades/upgrade-functions.php:147
5212
  msgid ""
5213
  "Easy Digital Downloads needs to upgrade the customer database, click "
5214
  "%shere%s to start the upgrade."
5215
  msgstr ""
5216
 
5217
- #: includes/admin/upgrades/upgrade-functions.php:155
5218
- #: includes/admin/upgrades/upgrade-functions.php:169
5219
  msgid ""
5220
  "Easy Digital Downloads needs to upgrade the payment database, click <a "
5221
  "href=\"%s\">here</a> to start the upgrade."
5222
  msgstr ""
5223
 
5224
- #: includes/admin/upgrades/upgrade-functions.php:162
5225
  msgid ""
5226
  "Easy Digital Downloads needs to upgrade the customer database, click <a "
5227
  "href=\"%s\">here</a> to start the upgrade."
5228
  msgstr ""
5229
 
5230
- #: includes/admin/upgrades/upgrade-functions.php:176
5231
  msgid ""
5232
  "Easy Digital Downloads needs to upgrade the API Key database, click <a "
5233
  "href=\"%s\">here</a> to start the upgrade."
5234
  msgstr ""
5235
 
5236
- #: includes/admin/upgrades/upgrade-functions.php:183
5237
  msgid ""
5238
  "Easy Digital Downloads needs to upgrade the payments database, click <a "
5239
  "href=\"%s\">here</a> to start the upgrade."
5240
  msgstr ""
5241
 
5242
- #: includes/admin/upgrades/upgrade-functions.php:190
5243
  msgid ""
5244
  "Easy Digital Downloads needs to upgrade the file download logs database, "
5245
  "click <a href=\"%s\">here</a> to start the upgrade."
5246
  msgstr ""
5247
 
5248
- #: includes/admin/upgrades/upgrade-functions.php:221
5249
- #: includes/admin/upgrades/upgrade-functions.php:537
5250
- #: includes/admin/upgrades/upgrade-functions.php:619
5251
- #: includes/admin/upgrades/upgrade-functions.php:730
5252
- #: includes/admin/upgrades/upgrade-functions.php:827
5253
- #: includes/admin/upgrades/upgrade-functions.php:901
5254
- #: includes/admin/upgrades/upgrade-functions.php:1029
5255
- #: includes/admin/upgrades/upgrade-functions.php:1114
5256
  #: includes/gateways/stripe/includes/admin/upgrade-functions.php:57
5257
  msgid "You do not have permission to do shop upgrades"
5258
  msgstr ""
5259
 
5260
- #: includes/admin/upgrades/upgrade-functions.php:390 includes/install.php:129
5261
  msgid "Transaction Failed"
5262
  msgstr ""
5263
 
5264
- #: includes/admin/upgrades/upgrade-functions.php:391 includes/install.php:130
5265
  msgid "Your transaction failed, please try again or contact site support."
5266
  msgstr ""
5267
 
5268
- #: includes/admin/upgrades/upgrade-functions.php:1190
5269
  msgid ""
5270
  "<strong>Migration complete:</strong> You have already completed the update "
5271
  "to the file download logs."
5272
  msgstr ""
5273
 
5274
- #: includes/admin/upgrades/upgrade-functions.php:1198
5275
  msgid ""
5276
  "<strong>Database Upgrade Complete:</strong> All database upgrades have been "
5277
  "completed."
5278
  msgstr ""
5279
 
5280
- #: includes/admin/upgrades/upgrade-functions.php:1200
5281
  msgid "You may now leave this page."
5282
  msgstr ""
5283
 
5284
- #: includes/admin/upgrades/upgrade-functions.php:1206
5285
  msgid ""
5286
  "<strong>Important:</strong> Please leave this screen open and do not "
5287
  "navigate away until the process completes."
5288
  msgstr ""
5289
 
5290
- #: includes/admin/upgrades/upgrade-functions.php:1249
5291
  msgid "Update file download logs"
5292
  msgstr ""
5293
 
5294
- #: includes/admin/upgrades/upgrade-functions.php:1254
5295
  msgid ""
5296
  "This will update the file download logs to remove some <abbr "
5297
  "title=\"Personally Identifiable Information\">PII</abbr> and make file "
5298
  "download counts more accurate."
5299
  msgstr ""
5300
 
5301
- #: includes/admin/upgrades/upgrade-functions.php:1263
5302
- #: includes/admin/upgrades/upgrade-functions.php:1266
5303
  msgid "Update File Download Logs"
5304
  msgstr ""
5305
 
5306
- #: includes/admin/upgrades/upgrade-functions.php:1267
5307
  msgid "File download logs have already been updated."
5308
  msgstr ""
5309
 
@@ -5330,7 +5348,7 @@ msgid ""
5330
  "ajax-requests-in-easy-digital-downloads-2-9-4"
5331
  msgstr ""
5332
 
5333
- #: includes/ajax-functions.php:190
5334
  msgid ""
5335
  "Missing nonce when adding an item to the cart. Please read the following "
5336
  "for more information: "
@@ -5338,7 +5356,7 @@ msgid ""
5338
  "ajax-requests-in-easy-digital-downloads-2-9-4"
5339
  msgstr ""
5340
 
5341
- #: includes/ajax-functions.php:471
5342
  msgid ""
5343
  "Missing nonce when recalculating taxes. Please read the following for more "
5344
  "information: "
@@ -5346,7 +5364,7 @@ msgid ""
5346
  "ajax-requests-in-easy-digital-downloads-2-9-4"
5347
  msgstr ""
5348
 
5349
- #: includes/ajax-functions.php:521
5350
  msgid ""
5351
  "Missing nonce when retrieving state list. Please read the following for "
5352
  "more information: "
@@ -5354,16 +5372,16 @@ msgid ""
5354
  "ajax-requests-in-easy-digital-downloads-2-9-4"
5355
  msgstr ""
5356
 
5357
- #: includes/ajax-functions.php:651 includes/ajax-functions.php:703
5358
  msgid "No results found"
5359
  msgstr ""
5360
 
5361
- #: includes/ajax-functions.php:752 includes/ajax-functions.php:844
5362
  #: includes/class-edd-html-elements.php:339
5363
  msgid "No users found"
5364
  msgstr ""
5365
 
5366
- #: includes/ajax-functions.php:794
5367
  msgid "All Prices"
5368
  msgstr ""
5369
 
@@ -6176,24 +6194,24 @@ msgstr ""
6176
  msgid "Enter username"
6177
  msgstr ""
6178
 
6179
- #: includes/class-edd-license-handler.php:190
6180
  msgid "%1$s"
6181
  msgstr ""
6182
 
6183
- #: includes/class-edd-license-handler.php:222
6184
  msgid ""
6185
  "Enter your extension license keys here to receive updates for purchased "
6186
  "extensions. If your license key has expired, please <a href=\"%s\" "
6187
  "target=\"_blank\">renew your license</a>."
6188
  msgstr ""
6189
 
6190
- #: includes/class-edd-license-handler.php:509
6191
  msgid ""
6192
  "You have invalid or expired license keys for Easy Digital Downloads. Please "
6193
  "go to the <a href=\"%s\">Licenses page</a> to correct this issue."
6194
  msgstr ""
6195
 
6196
- #: includes/class-edd-license-handler.php:547
6197
  msgid "Enter valid license key for automatic updates."
6198
  msgstr ""
6199
 
@@ -6671,18 +6689,22 @@ msgstr ""
6671
  msgid "The buyer's IP Address"
6672
  msgstr ""
6673
 
6674
- #: includes/emails/class-edd-email-tags.php:407
6675
- #: includes/emails/class-edd-email-tags.php:529
6676
  #: templates/shortcode-receipt.php:128
6677
  msgid "Quantity"
6678
  msgstr ""
6679
 
6680
- #: includes/emails/class-edd-email-tags.php:466
6681
  #: templates/history-downloads.php:74 templates/shortcode-receipt.php:207
6682
  msgid "No downloadable files found."
6683
  msgstr ""
6684
 
6685
- #: includes/emails/class-edd-email-tags.php:857
 
 
 
 
6686
  msgid "%1$sView it in your browser %2$s"
6687
  msgstr ""
6688
 
@@ -6907,12 +6929,12 @@ msgstr ""
6907
 
6908
  #: includes/gateways/amazon-payments.php:1094
6909
  #: includes/gateways/amazon-payments.php:1148
6910
- #: includes/gateways/paypal-standard.php:471
6911
- #: includes/gateways/paypal-standard.php:478
6912
- #: includes/gateways/paypal-standard.php:567
6913
- #: includes/gateways/paypal-standard.php:577
6914
- #: includes/gateways/paypal-standard.php:650
6915
- #: includes/gateways/paypal-standard.php:659
6916
  msgid "IPN Error"
6917
  msgstr ""
6918
 
@@ -6937,23 +6959,29 @@ msgstr ""
6937
  msgid "Refund request failed in Amazon."
6938
  msgstr ""
6939
 
6940
- #: includes/gateways/functions.php:26
 
 
6941
  msgid "PayPal"
6942
  msgstr ""
6943
 
6944
- #: includes/gateways/functions.php:30 includes/gateways/functions.php:31
 
 
 
 
6945
  msgid "Test Payment"
6946
  msgstr ""
6947
 
6948
- #: includes/gateways/functions.php:131 includes/gateways/functions.php:150
6949
  msgid "Free Purchase"
6950
  msgstr ""
6951
 
6952
- #: includes/gateways/functions.php:232
6953
  msgid "The requested price ID does not exist."
6954
  msgstr ""
6955
 
6956
- #: includes/gateways/manual.php:33 includes/gateways/paypal-standard.php:168
6957
  msgid "Nonce verification has failed"
6958
  msgstr ""
6959
 
@@ -6963,27 +6991,448 @@ msgid ""
6963
  "Payment data: %s"
6964
  msgstr ""
6965
 
6966
- #: includes/gateways/paypal-standard.php:51
6967
- msgid "PayPal Standard Settings"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6968
  msgstr ""
6969
 
6970
  #: includes/gateways/paypal-standard.php:56
 
 
 
 
6971
  msgid "PayPal Email"
6972
  msgstr ""
6973
 
6974
- #: includes/gateways/paypal-standard.php:57
6975
  msgid "Enter your PayPal account's email"
6976
  msgstr ""
6977
 
6978
- #: includes/gateways/paypal-standard.php:63
6979
  msgid "PayPal Image URL"
6980
  msgstr ""
6981
 
6982
- #: includes/gateways/paypal-standard.php:64
6983
  msgid "Upload an image to display on the PayPal checkout page."
6984
  msgstr ""
6985
 
6986
- #: includes/gateways/paypal-standard.php:71
6987
  msgid ""
6988
  "Enter your PayPal Identity Token in order to enable Payment Data Transfer "
6989
  "(PDT). This allows payments to be verified without relying on the PayPal "
@@ -6991,11 +7440,11 @@ msgid ""
6991
  "information."
6992
  msgstr ""
6993
 
6994
- #: includes/gateways/paypal-standard.php:77
6995
  msgid "PayPal Identity Token"
6996
  msgstr ""
6997
 
6998
- #: includes/gateways/paypal-standard.php:84
6999
  msgid ""
7000
  "If you are unable to use Payment Data Transfer and payments are not getting "
7001
  "marked as complete, then check this box. This forces the site to use a "
@@ -7003,214 +7452,203 @@ msgid ""
7003
  "target=\"_blank\">FAQ</a> for further information."
7004
  msgstr ""
7005
 
7006
- #: includes/gateways/paypal-standard.php:90
7007
  msgid "Disable PayPal IPN Verification"
7008
  msgstr ""
7009
 
7010
- #: includes/gateways/paypal-standard.php:98
7011
  msgid "API Credentials"
7012
  msgstr ""
7013
 
7014
- #: includes/gateways/paypal-standard.php:101
7015
  msgid ""
7016
  "API credentials are necessary to process PayPal refunds from inside "
7017
  "WordPress. These can be obtained from <a href=\"%s\" target=\"_blank\">your "
7018
  "PayPal account</a>."
7019
  msgstr ""
7020
 
7021
- #: includes/gateways/paypal-standard.php:107
7022
  msgid "Live API Username"
7023
  msgstr ""
7024
 
7025
- #: includes/gateways/paypal-standard.php:108
7026
  msgid "Your PayPal live API username. "
7027
  msgstr ""
7028
 
7029
- #: includes/gateways/paypal-standard.php:114
7030
  msgid "Live API Password"
7031
  msgstr ""
7032
 
7033
- #: includes/gateways/paypal-standard.php:115
7034
  msgid "Your PayPal live API password."
7035
  msgstr ""
7036
 
7037
- #: includes/gateways/paypal-standard.php:121
7038
  msgid "Live API Signature"
7039
  msgstr ""
7040
 
7041
- #: includes/gateways/paypal-standard.php:122
7042
  msgid "Your PayPal live API signature."
7043
  msgstr ""
7044
 
7045
- #: includes/gateways/paypal-standard.php:128
7046
  msgid "Test API Username"
7047
  msgstr ""
7048
 
7049
- #: includes/gateways/paypal-standard.php:129
7050
  msgid "Your PayPal test API username."
7051
  msgstr ""
7052
 
7053
- #: includes/gateways/paypal-standard.php:135
7054
  msgid "Test API Password"
7055
  msgstr ""
7056
 
7057
- #: includes/gateways/paypal-standard.php:136
7058
  msgid "Your PayPal test API password."
7059
  msgstr ""
7060
 
7061
- #: includes/gateways/paypal-standard.php:142
7062
  msgid "Test API Signature"
7063
  msgstr ""
7064
 
7065
- #: includes/gateways/paypal-standard.php:143
7066
  msgid "Your PayPal test API signature."
7067
  msgstr ""
7068
 
7069
- #: includes/gateways/paypal-standard.php:191
7070
  msgid "Payment creation failed before sending buyer to PayPal. Payment data: %s"
7071
  msgstr ""
7072
 
7073
- #: includes/gateways/paypal-standard.php:471
7074
- #: includes/gateways/paypal-standard.php:478
7075
  msgid "Invalid IPN verification response. IPN data: %s"
7076
  msgstr ""
7077
 
7078
- #: includes/gateways/paypal-standard.php:567
7079
  msgid "Invalid business email in IPN response. IPN data: %s"
7080
  msgstr ""
7081
 
7082
- #: includes/gateways/paypal-standard.php:570
7083
  msgid "Payment failed due to invalid PayPal business email."
7084
  msgstr ""
7085
 
7086
- #: includes/gateways/paypal-standard.php:577
7087
  msgid "Invalid currency in IPN response. IPN data: %s"
7088
  msgstr ""
7089
 
7090
- #: includes/gateways/paypal-standard.php:580
7091
  msgid "Payment failed due to invalid currency in PayPal IPN."
7092
  msgstr ""
7093
 
7094
- #: includes/gateways/paypal-standard.php:650
7095
  msgid "Invalid payment amount in IPN response. IPN data: %s"
7096
  msgstr ""
7097
 
7098
- #: includes/gateways/paypal-standard.php:653
7099
  msgid "Payment failed due to invalid amount in PayPal IPN."
7100
  msgstr ""
7101
 
7102
- #: includes/gateways/paypal-standard.php:659
7103
  msgid "Invalid purchase key in IPN response. IPN data: %s"
7104
  msgstr ""
7105
 
7106
- #: includes/gateways/paypal-standard.php:661
7107
  msgid "Payment failed due to invalid purchase key in PayPal IPN."
7108
  msgstr ""
7109
 
7110
- #: includes/gateways/paypal-standard.php:667
7111
- #: tests/helpers/class-helper-payment.php:131
7112
- #: tests/helpers/class-helper-payment.php:234
7113
- #: tests/helpers/class-helper-payment.php:342
7114
- #: tests/helpers/class-helper-payment.php:452
7115
- #: tests/helpers/class-helper-payment.php:541
7116
- #: tests/helpers/class-helper-payment.php:649 tests/tests-payment-class.php:28
7117
- #: tests/tests-payments.php:28
7118
- msgid "PayPal Transaction ID: %s"
7119
- msgstr ""
7120
-
7121
- #: includes/gateways/paypal-standard.php:681
7122
  msgid "Payment made via eCheck and will clear automatically in 5-8 days"
7123
  msgstr ""
7124
 
7125
- #: includes/gateways/paypal-standard.php:688
7126
  msgid ""
7127
  "Payment requires a confirmed customer address and must be accepted manually "
7128
  "through PayPal"
7129
  msgstr ""
7130
 
7131
- #: includes/gateways/paypal-standard.php:694
7132
  msgid ""
7133
  "Payment must be accepted manually through PayPal due to international "
7134
  "account regulations"
7135
  msgstr ""
7136
 
7137
- #: includes/gateways/paypal-standard.php:700
7138
  msgid ""
7139
  "Payment received in non-shop currency and must be accepted manually through "
7140
  "PayPal"
7141
  msgstr ""
7142
 
7143
- #: includes/gateways/paypal-standard.php:707
7144
  msgid ""
7145
  "Payment is being reviewed by PayPal staff as high-risk or in possible "
7146
  "violation of government regulations"
7147
  msgstr ""
7148
 
7149
- #: includes/gateways/paypal-standard.php:713
7150
  msgid "Payment was sent to non-confirmed or non-registered email address."
7151
  msgstr ""
7152
 
7153
- #: includes/gateways/paypal-standard.php:719
7154
  msgid "PayPal account must be upgraded before this payment can be accepted"
7155
  msgstr ""
7156
 
7157
- #: includes/gateways/paypal-standard.php:725
7158
  msgid ""
7159
  "PayPal account is not verified. Verify account in order to accept this "
7160
  "payment"
7161
  msgstr ""
7162
 
7163
- #: includes/gateways/paypal-standard.php:731
7164
  msgid ""
7165
  "Payment is pending for unknown reasons. Contact PayPal support for "
7166
  "assistance"
7167
  msgstr ""
7168
 
7169
- #: includes/gateways/paypal-standard.php:784
7170
  msgid "Partial PayPal refund processed: %s"
7171
  msgstr ""
7172
 
7173
- #: includes/gateways/paypal-standard.php:789
7174
  msgid "PayPal Payment #%s Refunded for reason: %s"
7175
  msgstr ""
7176
 
7177
- #: includes/gateways/paypal-standard.php:790
7178
  msgid "PayPal Refund Transaction ID: %s"
7179
  msgstr ""
7180
 
7181
- #: includes/gateways/paypal-standard.php:1004
7182
  msgid ""
7183
  "Payment could not be verified while validating PayPal PDT. Missing payment "
7184
  "total fields."
7185
  msgstr ""
7186
 
7187
- #: includes/gateways/paypal-standard.php:1015
7188
  msgid ""
7189
  "Payment failed while validating PayPal PDT. Amount expected: %f. Amount "
7190
  "Received: %f"
7191
  msgstr ""
7192
 
7193
- #: includes/gateways/paypal-standard.php:1045
7194
  msgid "Payment failed while validating PayPal PDT."
7195
  msgstr ""
7196
 
7197
- #: includes/gateways/paypal-standard.php:1052
7198
  msgid "PayPal PDT encountered an unexpected result, payment set to pending"
7199
  msgstr ""
7200
 
7201
- #: includes/gateways/paypal-standard.php:1137
7202
  msgid "Refund Payment in PayPal"
7203
  msgstr ""
7204
 
7205
- #: includes/gateways/paypal-standard.php:1284
7206
  msgid "PayPal refund failed for unknown reason."
7207
  msgstr ""
7208
 
7209
- #: includes/gateways/paypal-standard.php:1294
7210
  msgid "PayPal refund transaction ID: %s"
7211
  msgstr ""
7212
 
7213
- #: includes/gateways/paypal-standard.php:1298
7214
  msgid "PayPal refund failed: %s"
7215
  msgstr ""
7216
 
@@ -7375,10 +7813,6 @@ msgstr ""
7375
  msgid "Have questions about connecting with Stripe? See the %1$sdocumentation%2$s."
7376
  msgstr ""
7377
 
7378
- #: includes/gateways/stripe/includes/admin/settings/stripe-connect.php:249
7379
- msgid "Retrieving account information..."
7380
- msgstr ""
7381
-
7382
  #: includes/gateways/stripe/includes/admin/settings/stripe-connect.php:262
7383
  msgid "Manage API keys manually"
7384
  msgstr ""
@@ -7473,10 +7907,6 @@ msgstr ""
7473
  msgid "Unmet Requirements"
7474
  msgstr ""
7475
 
7476
- #: includes/gateways/stripe/includes/admin/settings.php:47
7477
- msgid "Connection Status"
7478
- msgstr ""
7479
-
7480
  #: includes/gateways/stripe/includes/admin/settings.php:54
7481
  msgid "Test Publishable Key"
7482
  msgstr ""
@@ -7772,7 +8202,7 @@ msgid "Unable to call %1$s::%2$s"
7772
  msgstr ""
7773
 
7774
  #: includes/gateways/stripe/includes/compat.php:116
7775
- #: includes/process-purchase.php:550 includes/process-purchase.php:866
7776
  msgid "The user information is invalid"
7777
  msgstr ""
7778
 
@@ -8210,15 +8640,15 @@ msgstr ""
8210
  msgid "Stripe Radar review closed with a reason of %s."
8211
  msgstr ""
8212
 
8213
- #: includes/install.php:111
8214
  msgid "Purchase Confirmation"
8215
  msgstr ""
8216
 
8217
- #: includes/install.php:112
8218
  msgid "Thank you for your purchase! [edd_receipt]"
8219
  msgstr ""
8220
 
8221
- #: includes/install.php:147
8222
  msgid "Purchase History"
8223
  msgstr ""
8224
 
@@ -9060,15 +9490,15 @@ msgstr ""
9060
  msgid "You must be logged into an account to purchase"
9061
  msgstr ""
9062
 
9063
- #: includes/process-purchase.php:930
9064
  msgid "The zip / postal code you entered for your billing address is invalid"
9065
  msgstr ""
9066
 
9067
- #: includes/process-purchase.php:1179
9068
  msgid "An internal error has occurred, please try again or contact support."
9069
  msgstr ""
9070
 
9071
- #: includes/process-purchase.php:1215
9072
  msgid "There was an error completing your purchase. Please try again."
9073
  msgstr ""
9074
 
2
  # This file is distributed under the same license as the Easy Digital Downloads package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Easy Digital Downloads 2.11\n"
6
  "Report-Msgid-Bugs-To: https://easydigitaldownloads.com/\n"
7
+ "POT-Creation-Date: 2021-08-19 13:58:55+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
28
  msgid "Cheatin&#8217; huh?"
29
  msgstr ""
30
 
31
+ #: includes/EDD_SL_Plugin_Updater.php:222
32
+ #. translators: the plugin name.
33
+ msgid "There is a new version of %1$s available."
34
  msgstr ""
35
 
36
+ #: includes/EDD_SL_Plugin_Updater.php:229
37
+ #. translators: 1. opening anchor tag, do not translate 2. the new plugin
38
+ #. version 3. closing anchor tag, do not translate.
39
+ msgid " %1$sView version %2$s details%3$s."
40
+ msgstr ""
41
+
42
+ #: includes/EDD_SL_Plugin_Updater.php:236
43
+ msgid " %1$sView version %2$s details%3$s or %4$supdate now%5$s."
44
+ msgstr ""
45
+
46
+ #: includes/EDD_SL_Plugin_Updater.php:247
47
+ msgid "Update now."
48
  msgstr ""
49
 
50
+ #: includes/EDD_SL_Plugin_Updater.php:463
51
  msgid "You do not have permission to install plugin updates"
52
  msgstr ""
53
 
54
+ #: includes/EDD_SL_Plugin_Updater.php:463
55
  #: includes/admin/customers/customer-actions.php:301
56
  #: includes/admin/customers/customer-actions.php:345
57
  #: includes/admin/customers/customer-actions.php:603
89
  #: includes/admin/tools/class-edd-tools-reset-stats.php:179
90
  #: includes/admin/tools.php:1027 includes/admin/tools.php:1033
91
  #: includes/admin/upgrades/classes/class-file-download-log-migration.php:136
92
+ #: includes/admin/upgrades/upgrade-functions.php:219
93
+ #: includes/admin/upgrades/upgrade-functions.php:535
94
+ #: includes/admin/upgrades/upgrade-functions.php:617
95
+ #: includes/admin/upgrades/upgrade-functions.php:728
96
+ #: includes/admin/upgrades/upgrade-functions.php:825
97
+ #: includes/admin/upgrades/upgrade-functions.php:899
98
+ #: includes/admin/upgrades/upgrade-functions.php:1027
99
+ #: includes/admin/upgrades/upgrade-functions.php:1112
100
  #: includes/api/class-edd-api.php:1976 includes/api/class-edd-api.php:1981
101
  #: includes/api/class-edd-api.php:1993 includes/api/class-edd-api.php:1995
102
  #: includes/cart/class-edd-cart.php:1433 includes/cart/class-edd-cart.php:1447
103
+ #: includes/class-edd-license-handler.php:385
104
  #: includes/deprecated-functions.php:517 includes/deprecated-functions.php:532
105
  #: includes/deprecated-functions.php:542 includes/download-functions.php:1277
106
  #: includes/emails/actions.php:53 includes/emails/template.php:243
107
+ #: includes/error-tracking.php:60 includes/gateways/functions.php:243
108
+ #: includes/gateways/manual.php:33
109
+ #: includes/gateways/paypal/admin/connect.php:452
110
+ #: includes/gateways/paypal/admin/connect.php:456
111
+ #: includes/gateways/paypal/admin/connect.php:589
112
+ #: includes/gateways/paypal-standard.php:172
113
  #: includes/gateways/stripe/includes/admin/upgrade-functions.php:57
114
  #: includes/gateways/stripe/includes/payment-actions.php:1403
115
  #: includes/process-download.php:303 includes/process-download.php:894
286
  #: includes/admin/class-edd-notices.php:49
287
  #: includes/admin/class-edd-notices.php:70
288
  #: includes/admin/class-edd-notices.php:87
289
+ #: includes/gateways/paypal/admin/notices.php:58
290
  msgid "Dismiss Notice"
291
  msgstr ""
292
 
630
  #: includes/admin/import/import-functions.php:113
631
  #: includes/admin/reporting/export/export-actions.php:23
632
  #: includes/api/class-edd-api.php:1976
633
+ #: includes/class-edd-license-handler.php:385
634
  msgid "Nonce verification failed"
635
  msgstr ""
636
 
719
  msgstr ""
720
 
721
  #: includes/admin/customers/customers.php:269
722
+ #: includes/admin/settings/register-settings.php:2297
723
  #: includes/admin/tools.php:695 includes/checkout/template.php:435
724
  #: templates/shortcode-profile-editor.php:171
725
  msgid "State / Province"
827
  #: includes/admin/downloads/metabox.php:714
828
  #: includes/admin/downloads/metabox.php:839
829
  #: includes/admin/payments/view-order-details.php:523
830
+ #: includes/admin/settings/register-settings.php:2300 includes/scripts.php:227
831
  #: templates/checkout_cart.php:57 templates/checkout_cart.php:75
832
  #: templates/shortcode-profile-editor.php:123
833
  msgid "Remove"
1342
  #: includes/admin/settings/register-settings.php:1370
1343
  #: includes/admin/settings/register-settings.php:1426
1344
  #: includes/admin/settings/register-settings.php:1431
1345
+ #: includes/admin/settings/register-settings.php:1434
1346
+ #: includes/admin/settings/register-settings.php:1439
1347
+ #: includes/admin/settings/register-settings.php:1442
1348
+ #: includes/admin/settings/register-settings.php:1457
1349
  #: includes/admin/tools.php:68
1350
  msgid "General"
1351
  msgstr ""
2560
 
2561
  #: includes/admin/promos/class-promo-handler.php:109
2562
  #: includes/admin/promos/class-promo-handler.php:117
2563
+ #: includes/gateways/paypal/admin/connect.php:106
2564
+ #: includes/gateways/paypal/admin/connect.php:182
2565
+ #: includes/gateways/paypal/admin/connect.php:292
2566
+ #: includes/gateways/paypal/admin/connect.php:452
2567
+ #: includes/gateways/paypal/admin/connect.php:456
2568
+ #: includes/gateways/paypal/admin/connect.php:503
2569
+ #: includes/gateways/paypal/admin/connect.php:537
2570
+ #: includes/gateways/paypal/admin/connect.php:560
2571
+ #: includes/gateways/paypal/admin/connect.php:589
2572
  msgid "You do not have permission to perform this action."
2573
  msgstr ""
2574
 
2775
 
2776
  #: includes/admin/reporting/class-export-payments.php:68
2777
  #: includes/admin/reporting/export/class-batch-export-payments.php:49
2778
+ #: includes/admin/settings/register-settings.php:2296
2779
  #: includes/admin/tools.php:713
2780
  #: includes/gateways/stripe/includes/template-functions.php:510
2781
  #: includes/gateways/stripe/includes/template-functions.php:519
2850
  msgstr ""
2851
 
2852
  #: includes/admin/reporting/class-gateway-error-logs-list-table.php:78
2853
+ #: includes/gateways/manual.php:73 includes/gateways/paypal-standard.php:195
2854
  msgid "Payment Error"
2855
  msgstr ""
2856
 
3005
  msgstr ""
3006
 
3007
  #: includes/admin/reporting/export/class-batch-export-downloads.php:55
3008
+ #: includes/emails/class-edd-email-tags.php:412
3009
+ #: includes/emails/class-edd-email-tags.php:551
3010
  #: templates/shortcode-receipt.php:125
3011
  msgid "SKU"
3012
  msgstr ""
3176
  msgstr ""
3177
 
3178
  #: includes/admin/reporting/logs.php:144
3179
+ #: includes/admin/settings/register-settings.php:1452
3180
  #: includes/privacy-functions.php:544
3181
  msgid "File Downloads"
3182
  msgstr ""
3486
  msgstr ""
3487
 
3488
  #: includes/admin/settings/contextual-help.php:93
3489
+ #: includes/admin/settings/register-settings.php:1449
3490
  msgid "Miscellaneous"
3491
  msgstr ""
3492
 
4494
  msgid "Misc"
4495
  msgstr ""
4496
 
4497
+ #: includes/admin/settings/register-settings.php:1435
 
 
 
 
 
4498
  msgid "Purchase Receipts"
4499
  msgstr ""
4500
 
4501
+ #: includes/admin/settings/register-settings.php:1436
4502
  msgid "New Sale Notifications"
4503
  msgstr ""
4504
 
4505
+ #: includes/admin/settings/register-settings.php:1445
4506
  msgid "Main"
4507
  msgstr ""
4508
 
4509
+ #: includes/admin/settings/register-settings.php:1450
4510
  #: includes/gateways/stripe/includes/payment-methods/payment-request/admin/settings.php:82
4511
+ #: includes/install.php:98 templates/widget-cart-checkout.php:6
4512
  #: templates/widget-cart-empty.php:7
4513
  msgid "Checkout"
4514
  msgstr ""
4515
 
4516
+ #: includes/admin/settings/register-settings.php:1451
4517
  msgid "Button Text"
4518
  msgstr ""
4519
 
4520
+ #: includes/admin/settings/register-settings.php:1453
4521
  msgid "Accounting"
4522
  msgstr ""
4523
 
4524
+ #: includes/admin/settings/register-settings.php:1454
4525
  msgid "Terms of Agreement"
4526
  msgstr ""
4527
 
4528
+ #: includes/admin/settings/register-settings.php:1458
4529
  msgid "Export & Erase"
4530
  msgstr ""
4531
 
4532
+ #: includes/admin/settings/register-settings.php:1700
4533
  msgid ""
4534
  "Don't see what you need? More Payment Gateway options are available <a "
4535
  "href=\"%s\">here</a>."
4536
  msgstr ""
4537
 
4538
+ #: includes/admin/settings/register-settings.php:1921
4539
  msgid "The callback function used for the %s setting is missing."
4540
  msgstr ""
4541
 
4542
+ #: includes/admin/settings/register-settings.php:2083
4543
  msgid "Upload File"
4544
  msgstr ""
4545
 
4546
+ #: includes/admin/settings/register-settings.php:2176
4547
  msgid ""
4548
  "<a href=\"https://sendwp.com/account/\" target=\"_blank\" rel=\"noopener "
4549
  "noreferrer\">Access your SendWP account</a>."
4550
  msgstr ""
4551
 
4552
+ #: includes/admin/settings/register-settings.php:2196
4553
  msgid "SendWP plugin activated."
4554
  msgstr ""
4555
 
4556
+ #: includes/admin/settings/register-settings.php:2199
4557
  msgid "Disconnect SendWP"
4558
  msgstr ""
4559
 
4560
+ #: includes/admin/settings/register-settings.php:2206
4561
  msgid ""
4562
  "We recommend SendWP to ensure quick and reliable delivery of all emails "
4563
  "sent from your store, such as purchase receipts, subscription renewal "
4564
  "reminders, password resets, and more."
4565
  msgstr ""
4566
 
4567
+ #: includes/admin/settings/register-settings.php:2206
4568
  msgid "%sLearn more%s"
4569
  msgstr ""
4570
 
4571
+ #: includes/admin/settings/register-settings.php:2209
4572
  msgid "Connect with SendWP"
4573
  msgstr ""
4574
 
4575
+ #: includes/admin/settings/register-settings.php:2245
4576
  msgid "Recapture plugin activated."
4577
  msgstr ""
4578
 
4579
+ #: includes/admin/settings/register-settings.php:2246
4580
  msgid "%sAccess your Recapture account%s."
4581
  msgstr ""
4582
 
4583
+ #: includes/admin/settings/register-settings.php:2251
4584
  msgid "Disconnect Recapture"
4585
  msgstr ""
4586
 
4587
+ #: includes/admin/settings/register-settings.php:2255
4588
  msgid "%sComplete your connection to Recapture%s"
4589
  msgstr ""
4590
 
4591
+ #: includes/admin/settings/register-settings.php:2263
4592
  msgid ""
4593
  "We recommend Recapture for recovering lost revenue by automatically sending "
4594
  "effective, targeted emails to customers who abandon their shopping cart."
4595
  msgstr ""
4596
 
4597
+ #: includes/admin/settings/register-settings.php:2263
4598
  msgid "%sLearn more%s (Free trial available)"
4599
  msgstr ""
4600
 
4601
+ #: includes/admin/settings/register-settings.php:2267
4602
  msgid "Connect with Recapture"
4603
  msgstr ""
4604
 
4605
+ #: includes/admin/settings/register-settings.php:2298
4606
  msgid "Country Wide"
4607
  msgstr ""
4608
 
4609
+ #: includes/admin/settings/register-settings.php:2299
4610
  msgid "Rate"
4611
  msgstr ""
4612
 
4613
+ #: includes/admin/settings/register-settings.php:2299
4614
  msgid ""
4615
  "<strong>Regional tax rates: </strong>When a customer enters an address on "
4616
  "checkout that matches the specified region for this tax rate, the cart tax "
4617
  "will adjust automatically. Enter a percentage, such as 6.5 for 6.5%."
4618
  msgstr ""
4619
 
4620
+ #: includes/admin/settings/register-settings.php:2316
4621
+ #: includes/admin/settings/register-settings.php:2364
4622
  msgid "Choose a country"
4623
  msgstr ""
4624
 
4625
+ #: includes/admin/settings/register-settings.php:2334
4626
  msgid "Choose a state"
4627
  msgstr ""
4628
 
4629
+ #: includes/admin/settings/register-settings.php:2346
4630
+ #: includes/admin/settings/register-settings.php:2377
4631
  msgid "Apply to whole country"
4632
  msgstr ""
4633
 
4634
+ #: includes/admin/settings/register-settings.php:2349
4635
+ #: includes/admin/settings/register-settings.php:2380
4636
  msgid "Remove Rate"
4637
  msgstr ""
4638
 
4639
+ #: includes/admin/settings/register-settings.php:2385
4640
  msgid "Add Tax Rate"
4641
  msgstr ""
4642
 
4643
+ #: includes/admin/settings/register-settings.php:2438
4644
  msgid ""
4645
  "Your license key expired on %s. Please <a href=\"%s\" "
4646
  "target=\"_blank\">renew your license key</a>."
4647
  msgstr ""
4648
 
4649
+ #: includes/admin/settings/register-settings.php:2451
4650
  msgid ""
4651
  "Your license key has been disabled. Please <a href=\"%s\" "
4652
  "target=\"_blank\">contact support</a> for more information."
4653
  msgstr ""
4654
 
4655
+ #: includes/admin/settings/register-settings.php:2463
4656
  msgid ""
4657
  "Invalid license. Please <a href=\"%s\" target=\"_blank\">visit your account "
4658
  "page</a> and verify it."
4659
  msgstr ""
4660
 
4661
+ #: includes/admin/settings/register-settings.php:2476
4662
  msgid ""
4663
  "Your %s is not active for this URL. Please <a href=\"%s\" "
4664
  "target=\"_blank\">visit your account page</a> to manage your license key "
4665
  "URLs."
4666
  msgstr ""
4667
 
4668
+ #: includes/admin/settings/register-settings.php:2488
4669
  msgid "This appears to be an invalid license key for %s."
4670
  msgstr ""
4671
 
4672
+ #: includes/admin/settings/register-settings.php:2497
4673
  msgid ""
4674
  "Your license key has reached its activation limit. <a href=\"%s\">View "
4675
  "possible upgrades</a> now."
4676
  msgstr ""
4677
 
4678
+ #: includes/admin/settings/register-settings.php:2506
4679
  msgid ""
4680
  "The key you entered belongs to a bundle, please use the product specific "
4681
  "license key."
4682
  msgstr ""
4683
 
4684
+ #: includes/admin/settings/register-settings.php:2514
4685
  msgid "unknown_error"
4686
  msgstr ""
4687
 
4688
+ #: includes/admin/settings/register-settings.php:2515
4689
  msgid ""
4690
  "There was an error with this license key: %s. Please <a href=\"%s\">contact "
4691
  "our support team</a>."
4692
  msgstr ""
4693
 
4694
+ #: includes/admin/settings/register-settings.php:2535
4695
  msgid "License key never expires."
4696
  msgstr ""
4697
 
4698
+ #: includes/admin/settings/register-settings.php:2542
4699
  msgid ""
4700
  "Your license key expires soon! It expires on %s. <a href=\"%s\" "
4701
  "target=\"_blank\">Renew your license key</a>."
4702
  msgstr ""
4703
 
4704
+ #: includes/admin/settings/register-settings.php:2552
4705
  msgid "Your license key expires on %s."
4706
  msgstr ""
4707
 
4708
+ #: includes/admin/settings/register-settings.php:2570
4709
  msgid "To receive updates, please enter your valid %s license key."
4710
  msgstr ""
4711
 
4712
+ #: includes/admin/settings/register-settings.php:2583
4713
  msgid "Deactivate License"
4714
  msgstr ""
4715
 
5187
  msgid "File download logs updated successfully."
5188
  msgstr ""
5189
 
5190
+ #: includes/admin/upgrades/upgrade-functions.php:85
5191
  msgid "The Payment History needs to be updated. %s"
5192
  msgstr ""
5193
 
5194
+ #: includes/admin/upgrades/upgrade-functions.php:85
5195
  msgid "Click to Upgrade"
5196
  msgstr ""
5197
 
5198
+ #: includes/admin/upgrades/upgrade-functions.php:91
5199
  msgid ""
5200
  "The Purchase and File Download History in Easy Digital Downloads needs to "
5201
  "be upgraded, click %shere%s to start the upgrade."
5202
  msgstr ""
5203
 
5204
+ #: includes/admin/upgrades/upgrade-functions.php:99
5205
  msgid ""
5206
  "Easy Digital Downloads needs to upgrade the plugin pages, click %shere%s to "
5207
  "start the upgrade."
5208
  msgstr ""
5209
 
5210
+ #: includes/admin/upgrades/upgrade-functions.php:107
5211
+ #: includes/admin/upgrades/upgrade-functions.php:115
5212
  msgid ""
5213
  "Easy Digital Downloads needs to upgrade the database, click %shere%s to "
5214
  "start the upgrade."
5215
  msgstr ""
5216
 
5217
+ #: includes/admin/upgrades/upgrade-functions.php:127
5218
  msgid ""
5219
  "Easy Digital Downloads needs to complete a database upgrade that was "
5220
  "previously started, click <a href=\"%s\">here</a> to resume the upgrade."
5221
  msgstr ""
5222
 
5223
+ #: includes/admin/upgrades/upgrade-functions.php:138
5224
  msgid ""
5225
  "Easy Digital Downloads needs to upgrade past order numbers to make them "
5226
  "sequential, click <a href=\"%s\">here</a> to start the upgrade."
5227
  msgstr ""
5228
 
5229
+ #: includes/admin/upgrades/upgrade-functions.php:145
5230
  msgid ""
5231
  "Easy Digital Downloads needs to upgrade the customer database, click "
5232
  "%shere%s to start the upgrade."
5233
  msgstr ""
5234
 
5235
+ #: includes/admin/upgrades/upgrade-functions.php:153
5236
+ #: includes/admin/upgrades/upgrade-functions.php:167
5237
  msgid ""
5238
  "Easy Digital Downloads needs to upgrade the payment database, click <a "
5239
  "href=\"%s\">here</a> to start the upgrade."
5240
  msgstr ""
5241
 
5242
+ #: includes/admin/upgrades/upgrade-functions.php:160
5243
  msgid ""
5244
  "Easy Digital Downloads needs to upgrade the customer database, click <a "
5245
  "href=\"%s\">here</a> to start the upgrade."
5246
  msgstr ""
5247
 
5248
+ #: includes/admin/upgrades/upgrade-functions.php:174
5249
  msgid ""
5250
  "Easy Digital Downloads needs to upgrade the API Key database, click <a "
5251
  "href=\"%s\">here</a> to start the upgrade."
5252
  msgstr ""
5253
 
5254
+ #: includes/admin/upgrades/upgrade-functions.php:181
5255
  msgid ""
5256
  "Easy Digital Downloads needs to upgrade the payments database, click <a "
5257
  "href=\"%s\">here</a> to start the upgrade."
5258
  msgstr ""
5259
 
5260
+ #: includes/admin/upgrades/upgrade-functions.php:188
5261
  msgid ""
5262
  "Easy Digital Downloads needs to upgrade the file download logs database, "
5263
  "click <a href=\"%s\">here</a> to start the upgrade."
5264
  msgstr ""
5265
 
5266
+ #: includes/admin/upgrades/upgrade-functions.php:219
5267
+ #: includes/admin/upgrades/upgrade-functions.php:535
5268
+ #: includes/admin/upgrades/upgrade-functions.php:617
5269
+ #: includes/admin/upgrades/upgrade-functions.php:728
5270
+ #: includes/admin/upgrades/upgrade-functions.php:825
5271
+ #: includes/admin/upgrades/upgrade-functions.php:899
5272
+ #: includes/admin/upgrades/upgrade-functions.php:1027
5273
+ #: includes/admin/upgrades/upgrade-functions.php:1112
5274
  #: includes/gateways/stripe/includes/admin/upgrade-functions.php:57
5275
  msgid "You do not have permission to do shop upgrades"
5276
  msgstr ""
5277
 
5278
+ #: includes/admin/upgrades/upgrade-functions.php:388 includes/install.php:135
5279
  msgid "Transaction Failed"
5280
  msgstr ""
5281
 
5282
+ #: includes/admin/upgrades/upgrade-functions.php:389 includes/install.php:136
5283
  msgid "Your transaction failed, please try again or contact site support."
5284
  msgstr ""
5285
 
5286
+ #: includes/admin/upgrades/upgrade-functions.php:1188
5287
  msgid ""
5288
  "<strong>Migration complete:</strong> You have already completed the update "
5289
  "to the file download logs."
5290
  msgstr ""
5291
 
5292
+ #: includes/admin/upgrades/upgrade-functions.php:1196
5293
  msgid ""
5294
  "<strong>Database Upgrade Complete:</strong> All database upgrades have been "
5295
  "completed."
5296
  msgstr ""
5297
 
5298
+ #: includes/admin/upgrades/upgrade-functions.php:1198
5299
  msgid "You may now leave this page."
5300
  msgstr ""
5301
 
5302
+ #: includes/admin/upgrades/upgrade-functions.php:1204
5303
  msgid ""
5304
  "<strong>Important:</strong> Please leave this screen open and do not "
5305
  "navigate away until the process completes."
5306
  msgstr ""
5307
 
5308
+ #: includes/admin/upgrades/upgrade-functions.php:1247
5309
  msgid "Update file download logs"
5310
  msgstr ""
5311
 
5312
+ #: includes/admin/upgrades/upgrade-functions.php:1252
5313
  msgid ""
5314
  "This will update the file download logs to remove some <abbr "
5315
  "title=\"Personally Identifiable Information\">PII</abbr> and make file "
5316
  "download counts more accurate."
5317
  msgstr ""
5318
 
5319
+ #: includes/admin/upgrades/upgrade-functions.php:1261
5320
+ #: includes/admin/upgrades/upgrade-functions.php:1264
5321
  msgid "Update File Download Logs"
5322
  msgstr ""
5323
 
5324
+ #: includes/admin/upgrades/upgrade-functions.php:1265
5325
  msgid "File download logs have already been updated."
5326
  msgstr ""
5327
 
5348
  "ajax-requests-in-easy-digital-downloads-2-9-4"
5349
  msgstr ""
5350
 
5351
+ #: includes/ajax-functions.php:202
5352
  msgid ""
5353
  "Missing nonce when adding an item to the cart. Please read the following "
5354
  "for more information: "
5356
  "ajax-requests-in-easy-digital-downloads-2-9-4"
5357
  msgstr ""
5358
 
5359
+ #: includes/ajax-functions.php:474
5360
  msgid ""
5361
  "Missing nonce when recalculating taxes. Please read the following for more "
5362
  "information: "
5364
  "ajax-requests-in-easy-digital-downloads-2-9-4"
5365
  msgstr ""
5366
 
5367
+ #: includes/ajax-functions.php:524
5368
  msgid ""
5369
  "Missing nonce when retrieving state list. Please read the following for "
5370
  "more information: "
5372
  "ajax-requests-in-easy-digital-downloads-2-9-4"
5373
  msgstr ""
5374
 
5375
+ #: includes/ajax-functions.php:654 includes/ajax-functions.php:706
5376
  msgid "No results found"
5377
  msgstr ""
5378
 
5379
+ #: includes/ajax-functions.php:755 includes/ajax-functions.php:847
5380
  #: includes/class-edd-html-elements.php:339
5381
  msgid "No users found"
5382
  msgstr ""
5383
 
5384
+ #: includes/ajax-functions.php:797
5385
  msgid "All Prices"
5386
  msgstr ""
5387
 
6194
  msgid "Enter username"
6195
  msgstr ""
6196
 
6197
+ #: includes/class-edd-license-handler.php:193
6198
  msgid "%1$s"
6199
  msgstr ""
6200
 
6201
+ #: includes/class-edd-license-handler.php:225
6202
  msgid ""
6203
  "Enter your extension license keys here to receive updates for purchased "
6204
  "extensions. If your license key has expired, please <a href=\"%s\" "
6205
  "target=\"_blank\">renew your license</a>."
6206
  msgstr ""
6207
 
6208
+ #: includes/class-edd-license-handler.php:512
6209
  msgid ""
6210
  "You have invalid or expired license keys for Easy Digital Downloads. Please "
6211
  "go to the <a href=\"%s\">Licenses page</a> to correct this issue."
6212
  msgstr ""
6213
 
6214
+ #: includes/class-edd-license-handler.php:550
6215
  msgid "Enter valid license key for automatic updates."
6216
  msgstr ""
6217
 
6689
  msgid "The buyer's IP Address"
6690
  msgstr ""
6691
 
6692
+ #: includes/emails/class-edd-email-tags.php:408
6693
+ #: includes/emails/class-edd-email-tags.php:547
6694
  #: templates/shortcode-receipt.php:128
6695
  msgid "Quantity"
6696
  msgstr ""
6697
 
6698
+ #: includes/emails/class-edd-email-tags.php:467
6699
  #: templates/history-downloads.php:74 templates/shortcode-receipt.php:207
6700
  msgid "No downloadable files found."
6701
  msgstr ""
6702
 
6703
+ #: includes/emails/class-edd-email-tags.php:497
6704
+ msgid "Additional information about your purchase:"
6705
+ msgstr ""
6706
+
6707
+ #: includes/emails/class-edd-email-tags.php:875
6708
  msgid "%1$sView it in your browser %2$s"
6709
  msgstr ""
6710
 
6929
 
6930
  #: includes/gateways/amazon-payments.php:1094
6931
  #: includes/gateways/amazon-payments.php:1148
6932
+ #: includes/gateways/paypal-standard.php:475
6933
+ #: includes/gateways/paypal-standard.php:482
6934
+ #: includes/gateways/paypal-standard.php:571
6935
+ #: includes/gateways/paypal-standard.php:581
6936
+ #: includes/gateways/paypal-standard.php:654
6937
+ #: includes/gateways/paypal-standard.php:663
6938
  msgid "IPN Error"
6939
  msgstr ""
6940
 
6959
  msgid "Refund request failed in Amazon."
6960
  msgstr ""
6961
 
6962
+ #: includes/gateways/functions.php:25 includes/gateways/functions.php:26
6963
+ #: includes/gateways/functions.php:37
6964
+ #: includes/gateways/paypal/admin/settings.php:33
6965
  msgid "PayPal"
6966
  msgstr ""
6967
 
6968
+ #: includes/gateways/functions.php:36 includes/gateways/paypal-standard.php:34
6969
+ msgid "PayPal Standard"
6970
+ msgstr ""
6971
+
6972
+ #: includes/gateways/functions.php:41 includes/gateways/functions.php:42
6973
  msgid "Test Payment"
6974
  msgstr ""
6975
 
6976
+ #: includes/gateways/functions.php:142 includes/gateways/functions.php:161
6977
  msgid "Free Purchase"
6978
  msgstr ""
6979
 
6980
+ #: includes/gateways/functions.php:243
6981
  msgid "The requested price ID does not exist."
6982
  msgstr ""
6983
 
6984
+ #: includes/gateways/manual.php:33 includes/gateways/paypal-standard.php:172
6985
  msgid "Nonce verification has failed"
6986
  msgstr ""
6987
 
6991
  "Payment data: %s"
6992
  msgstr ""
6993
 
6994
+ #: includes/gateways/paypal/admin/connect.php:32
6995
+ #: includes/gateways/paypal/admin/connect.php:316
6996
+ msgid "sandbox"
6997
+ msgstr ""
6998
+
6999
+ #: includes/gateways/paypal/admin/connect.php:32
7000
+ #: includes/gateways/paypal/admin/connect.php:316
7001
+ msgid "live"
7002
+ msgstr ""
7003
+
7004
+ #: includes/gateways/paypal/admin/connect.php:52
7005
+ #. Translators: %1$s opening <strong> tag; %2$s closing </strong> tag
7006
+ msgid ""
7007
+ "%1$sConnection failure:%2$s Please ensure browser popups are enabled then "
7008
+ "click the button below to connect again. If you continue to experience this "
7009
+ "error, please contact support."
7010
+ msgstr ""
7011
+
7012
+ #: includes/gateways/paypal/admin/connect.php:65
7013
+ #. Translators: %s - the store mode, either `sandbox` or `live`
7014
+ msgid "Connect with PayPal in %s mode"
7015
+ msgstr ""
7016
+
7017
+ #: includes/gateways/paypal/admin/connect.php:69
7018
+ msgid "Sign up for PayPal"
7019
+ msgstr ""
7020
+
7021
+ #: includes/gateways/paypal/admin/connect.php:80
7022
+ #: includes/gateways/stripe/includes/admin/settings/stripe-connect.php:249
7023
+ msgid "Retrieving account information..."
7024
+ msgstr ""
7025
+
7026
+ #: includes/gateways/paypal/admin/connect.php:85
7027
+ msgid "Disconnect from PayPal"
7028
+ msgstr ""
7029
+
7030
+ #: includes/gateways/paypal/admin/connect.php:133
7031
+ #. Translators: %d - HTTP response code; %s - Response from the API
7032
+ msgid "Unexpected response code: %d. Error: %s"
7033
+ msgstr ""
7034
+
7035
+ #: includes/gateways/paypal/admin/connect.php:140
7036
+ msgid "An unexpected error occurred."
7037
+ msgstr ""
7038
+
7039
+ #: includes/gateways/paypal/admin/connect.php:186
7040
+ msgid "Missing PayPal authentication information. Please try again."
7041
+ msgstr ""
7042
+
7043
+ #: includes/gateways/paypal/admin/connect.php:193
7044
+ msgid "Missing nonce. Please refresh the page and try again."
7045
+ msgstr ""
7046
+
7047
+ #: includes/gateways/paypal/admin/connect.php:225
7048
+ #. Translators: %d - HTTP response code
7049
+ msgid ""
7050
+ "Unexpected response from PayPal while generating token. Response code: %d. "
7051
+ "Please try again."
7052
+ msgstr ""
7053
+
7054
+ #: includes/gateways/paypal/admin/connect.php:252
7055
+ #. Translators: %d - HTTP response code
7056
+ msgid "Unexpected response from PayPal. Response code: %d. Please try again."
7057
+ msgstr ""
7058
+
7059
+ #: includes/gateways/paypal/admin/connect.php:260
7060
+ msgid "Successfully connected."
7061
+ msgstr ""
7062
+
7063
+ #: includes/gateways/paypal/admin/connect.php:265
7064
+ msgid ""
7065
+ "Your account has been successfully connected, but an error occurred while "
7066
+ "creating a webhook."
7067
+ msgstr ""
7068
+
7069
+ #: includes/gateways/paypal/admin/connect.php:299
7070
+ msgid "Re-Check Payment Status"
7071
+ msgstr ""
7072
+
7073
+ #: includes/gateways/paypal/admin/connect.php:300
7074
+ msgid "Sync Webhook"
7075
+ msgstr ""
7076
+
7077
+ #: includes/gateways/paypal/admin/connect.php:309
7078
+ msgid "API:"
7079
+ msgstr ""
7080
+
7081
+ #: includes/gateways/paypal/admin/connect.php:319
7082
+ #. Translators: %s - the connected mode, either `sandbox` or `live`
7083
+ msgid "Your PayPal account is successfully connected in %s mode."
7084
+ msgstr ""
7085
+
7086
+ #: includes/gateways/paypal/admin/connect.php:334
7087
+ msgid "Payment Status:"
7088
+ msgstr ""
7089
+
7090
+ #: includes/gateways/paypal/admin/connect.php:338
7091
+ msgid ""
7092
+ "You need to address the following issues before you can start receiving "
7093
+ "payments:"
7094
+ msgstr ""
7095
+
7096
+ #: includes/gateways/paypal/admin/connect.php:346
7097
+ msgid "Ready to accept payments."
7098
+ msgstr ""
7099
+
7100
+ #: includes/gateways/paypal/admin/connect.php:368
7101
+ msgid "Webhook:"
7102
+ msgstr ""
7103
+
7104
+ #: includes/gateways/paypal/admin/connect.php:375
7105
+ msgid "Create Webhook"
7106
+ msgstr ""
7107
+
7108
+ #: includes/gateways/paypal/admin/connect.php:379
7109
+ msgid "Webhook successfully configured for the following events:"
7110
+ msgstr ""
7111
+
7112
+ #: includes/gateways/paypal/admin/connect.php:404
7113
+ #. Translators: %1$s opening anchor tag; %2$s closing anchor tag
7114
+ msgid ""
7115
+ "PayPal is not currently active. %1$sEnable PayPal%2$s in the general "
7116
+ "gateway settings to start using it."
7117
+ msgstr ""
7118
+
7119
+ #: includes/gateways/paypal/admin/connect.php:510
7120
+ msgid "No merchant ID saved. Please reconnect to PayPal."
7121
+ msgstr ""
7122
+
7123
+ #: includes/gateways/paypal/admin/notices.php:45
7124
+ msgid "Enable the new PayPal gateway for Easy Digital Downloads"
7125
+ msgstr ""
7126
+
7127
+ #: includes/gateways/paypal/admin/notices.php:50
7128
+ #. Translators: %1$s opening anchor tag; %2$s closing anchor tag
7129
+ msgid ""
7130
+ "A new, improved PayPal experience is now available in Easy Digital "
7131
+ "Downloads. You can learn more about the new integration in %1$sour "
7132
+ "documentation%2$s."
7133
+ msgstr ""
7134
+
7135
+ #: includes/gateways/paypal/admin/notices.php:57
7136
+ msgid "Activate the New PayPal"
7137
+ msgstr ""
7138
+
7139
+ #: includes/gateways/paypal/admin/scripts.php:43
7140
+ msgid "An unexpected error occurred. Please refresh the page and try again."
7141
+ msgstr ""
7142
+
7143
+ #: includes/gateways/paypal/admin/settings.php:53
7144
+ msgid "PayPal Settings"
7145
+ msgstr ""
7146
+
7147
+ #: includes/gateways/paypal/admin/settings.php:58
7148
+ msgid "Documentation"
7149
+ msgstr ""
7150
+
7151
+ #: includes/gateways/paypal/admin/settings.php:64
7152
+ #: includes/gateways/stripe/includes/admin/settings.php:47
7153
+ msgid "Connection Status"
7154
+ msgstr ""
7155
+
7156
+ #: includes/gateways/paypal/admin/settings.php:71
7157
+ msgid "Test Client ID"
7158
+ msgstr ""
7159
+
7160
+ #: includes/gateways/paypal/admin/settings.php:72
7161
+ msgid "Enter your test client ID."
7162
+ msgstr ""
7163
+
7164
+ #: includes/gateways/paypal/admin/settings.php:79
7165
+ msgid "Test Client Secret"
7166
+ msgstr ""
7167
+
7168
+ #: includes/gateways/paypal/admin/settings.php:80
7169
+ msgid "Enter your test client secret."
7170
+ msgstr ""
7171
+
7172
+ #: includes/gateways/paypal/admin/settings.php:87
7173
+ msgid "Live Client ID"
7174
+ msgstr ""
7175
+
7176
+ #: includes/gateways/paypal/admin/settings.php:88
7177
+ msgid "Enter your live client ID."
7178
+ msgstr ""
7179
+
7180
+ #: includes/gateways/paypal/admin/settings.php:95
7181
+ msgid "Live Client Secret"
7182
+ msgstr ""
7183
+
7184
+ #: includes/gateways/paypal/admin/settings.php:96
7185
+ msgid "Enter your live client secret."
7186
+ msgstr ""
7187
+
7188
+ #: includes/gateways/paypal/admin/settings.php:128
7189
+ msgid ""
7190
+ "To learn more about the PayPal gateway, visit <a href=\"%s\" "
7191
+ "target=\"_blank\">our documentation</a>."
7192
+ msgstr ""
7193
+
7194
+ #: includes/gateways/paypal/admin/settings.php:140
7195
+ msgid ""
7196
+ "PayPal requires an SSL certificate to accept payments. You can learn more "
7197
+ "about obtaining an SSL certificate in our <a href=\"%s\" "
7198
+ "target=\"_blank\">SSL setup article</a>."
7199
+ msgstr ""
7200
+
7201
+ #: includes/gateways/paypal/checkout-actions.php:54
7202
+ #: includes/gateways/paypal/checkout-actions.php:119
7203
+ msgid "Please connect your PayPal account in the gateway settings."
7204
+ msgstr ""
7205
+
7206
+ #: includes/gateways/paypal/checkout-actions.php:55
7207
+ #: includes/gateways/paypal/checkout-actions.php:120
7208
+ msgid "Unexpected authentication error. Please contact a site administrator."
7209
+ msgstr ""
7210
+
7211
+ #: includes/gateways/paypal/checkout-actions.php:114
7212
+ #: includes/gateways/paypal/exceptions/class-gateway-exception.php:48
7213
+ msgid "PayPal Gateway Error"
7214
+ msgstr ""
7215
+
7216
+ #: includes/gateways/paypal/checkout-actions.php:115
7217
+ msgid "Account not ready to accept payments."
7218
+ msgstr ""
7219
+
7220
+ #: includes/gateways/paypal/checkout-actions.php:146
7221
+ #: includes/gateways/paypal/checkout-actions.php:292
7222
+ #: includes/gateways/paypal/scripts.php:119
7223
+ msgid "An unexpected error occurred. Please try again."
7224
+ msgstr ""
7225
+
7226
+ #: includes/gateways/paypal/checkout-actions.php:222
7227
+ #: includes/gateways/paypal/checkout-actions.php:249
7228
+ #: includes/gateways/paypal/checkout-actions.php:391
7229
+ msgid "An error occurred while communicating with PayPal. Please try again."
7230
+ msgstr ""
7231
+
7232
+ #: includes/gateways/paypal/checkout-actions.php:247
7233
+ #: includes/gateways/paypal/checkout-actions.php:389
7234
+ msgid "An authentication error occurred. Please try again."
7235
+ msgstr ""
7236
+
7237
+ #: includes/gateways/paypal/checkout-actions.php:276
7238
+ #: includes/gateways/paypal/checkout-actions.php:284
7239
+ msgid "A validation error occurred. Please try again."
7240
+ msgstr ""
7241
+
7242
+ #: includes/gateways/paypal/checkout-actions.php:305
7243
+ msgid "Failed to process payment. Please try again."
7244
+ msgstr ""
7245
+
7246
+ #: includes/gateways/paypal/checkout-actions.php:314
7247
+ msgid ""
7248
+ "Unable to complete your order with your chosen payment method. Please "
7249
+ "choose a new funding source."
7250
+ msgstr ""
7251
+
7252
+ #: includes/gateways/paypal/checkout-actions.php:379
7253
+ #: includes/gateways/paypal-standard.php:671
7254
+ #: tests/helpers/class-helper-payment.php:131
7255
+ #: tests/helpers/class-helper-payment.php:234
7256
+ #: tests/helpers/class-helper-payment.php:342
7257
+ #: tests/helpers/class-helper-payment.php:452
7258
+ #: tests/helpers/class-helper-payment.php:541
7259
+ #: tests/helpers/class-helper-payment.php:649 tests/tests-payment-class.php:28
7260
+ #: tests/tests-payments.php:28
7261
+ #. Translators: %s - transaction ID
7262
+ msgid "PayPal Transaction ID: %s"
7263
+ msgstr ""
7264
+
7265
+ #: includes/gateways/paypal/class-account-status-validator.php:108
7266
+ msgid "Not connected."
7267
+ msgstr ""
7268
+
7269
+ #: includes/gateways/paypal/class-account-status-validator.php:133
7270
+ msgid ""
7271
+ "Missing merchant details from PayPal. Please reconnect and make sure you "
7272
+ "click the button to be redirected back to your site."
7273
+ msgstr ""
7274
+
7275
+ #: includes/gateways/paypal/class-account-status-validator.php:148
7276
+ msgid "Webhook not configured. Some actions may not work properly."
7277
+ msgstr ""
7278
+
7279
+ #: includes/gateways/paypal/class-account-status-validator.php:166
7280
+ msgid ""
7281
+ "Webhook is configured but missing an event. Click \"Sync Webhook\" to "
7282
+ "correct this."
7283
+ msgid_plural ""
7284
+ "Webhook is configured but missing events. Click \"Sync Webhook\" to correct "
7285
+ "this."
7286
+ msgstr[0] ""
7287
+ msgstr[1] ""
7288
+
7289
+ #: includes/gateways/paypal/class-merchant-account.php:132
7290
+ msgid ""
7291
+ "Your account is unable to receive payments. Please contact PayPal customer "
7292
+ "support."
7293
+ msgstr ""
7294
+
7295
+ #: includes/gateways/paypal/class-merchant-account.php:138
7296
+ msgid "Your PayPal email address needs to be confirmed."
7297
+ msgstr ""
7298
+
7299
+ #: includes/gateways/paypal/class-paypal-api.php:150
7300
+ #. Translators: %s - The ID of the PayPal credential
7301
+ msgid "Missing PayPal credential: %s"
7302
+ msgstr ""
7303
+
7304
+ #: includes/gateways/paypal/class-paypal-api.php:214
7305
+ #. Translators: %d - HTTP response code.
7306
+ msgid "Unexpected response code: %d"
7307
+ msgstr ""
7308
+
7309
+ #: includes/gateways/paypal/class-token.php:35
7310
+ msgid "Invalid token."
7311
+ msgstr ""
7312
+
7313
+ #: includes/gateways/paypal/exceptions/class-gateway-exception.php:51
7314
+ #. Translators: %d - HTTP response code; %s - Error message
7315
+ msgid "Response Code: %d; Message: %s"
7316
+ msgstr ""
7317
+
7318
+ #: includes/gateways/paypal/refunds.php:41
7319
+ msgid "Refund Transaction in PayPal"
7320
+ msgstr ""
7321
+
7322
+ #: includes/gateways/paypal/refunds.php:95
7323
+ #. Translators: %s - The error message
7324
+ msgid "Failed to refund transaction in PayPal. Error Message: %s"
7325
+ msgstr ""
7326
+
7327
+ #: includes/gateways/paypal/refunds.php:119
7328
+ msgid "Missing transaction ID."
7329
+ msgstr ""
7330
+
7331
+ #: includes/gateways/paypal/refunds.php:131
7332
+ #. Translators: %d - The HTTP response code; %s - Full API response from PayPal
7333
+ msgid "Unexpected response code: %d. Response: %s"
7334
+ msgstr ""
7335
+
7336
+ #: includes/gateways/paypal/refunds.php:140
7337
+ #. Translators: %s - API response from PayPal
7338
+ msgid "Missing or unexpected refund status. Response: %s"
7339
+ msgstr ""
7340
+
7341
+ #: includes/gateways/paypal/refunds.php:151
7342
+ #. Translators: %s - ID of the refund in PayPal
7343
+ msgid "Successfully refunded in PayPal. Refund transaction ID: %s"
7344
+ msgstr ""
7345
+
7346
+ #: includes/gateways/paypal/webhooks/events/class-payment-capture-completed.php:52
7347
+ msgid "Webhook Error"
7348
+ msgstr ""
7349
+
7350
+ #: includes/gateways/paypal/webhooks/events/class-payment-capture-completed.php:55
7351
+ #. Translators: %s is the webhook data
7352
+ msgid "Invalid payment about in webhook response. Webhook data: %s"
7353
+ msgstr ""
7354
+
7355
+ #: includes/gateways/paypal/webhooks/events/class-payment-capture-completed.php:62
7356
+ msgid ""
7357
+ "Payment failed due to invalid amount in PayPal webhook. Expected amount: "
7358
+ "%s; PayPal amount: %s."
7359
+ msgstr ""
7360
+
7361
+ #: includes/gateways/paypal/webhooks/events/class-payment-capture-denied.php:28
7362
+ msgid "PayPal transaction denied."
7363
+ msgstr ""
7364
+
7365
+ #: includes/gateways/paypal/webhooks/events/class-payment-capture-refunded.php:45
7366
+ #. Translators: %1$s - Amount refunded; %2$s - Original payment ID; %3$s -
7367
+ #. Refund transaction ID
7368
+ msgid "Amount: %1$s; Payment transaction ID: %2$s; Refund transaction ID: %3$s"
7369
+ msgstr ""
7370
+
7371
+ #: includes/gateways/paypal/webhooks/events/class-payment-capture-refunded.php:53
7372
+ msgid "Partial refund processed in PayPal."
7373
+ msgstr ""
7374
+
7375
+ #: includes/gateways/paypal/webhooks/events/class-payment-capture-refunded.php:56
7376
+ msgid "Full refund processed in PayPal."
7377
+ msgstr ""
7378
+
7379
+ #: includes/gateways/paypal/webhooks/functions.php:86
7380
+ msgid "An SSL certificate is required to create a PayPal webhook."
7381
+ msgstr ""
7382
+
7383
+ #: includes/gateways/paypal/webhooks/functions.php:127
7384
+ #. Translators: %d - HTTP response code; %s - Full response from the API.
7385
+ msgid "Invalid response code %d while creating webhook. Response: %s"
7386
+ msgstr ""
7387
+
7388
+ #: includes/gateways/paypal/webhooks/functions.php:134
7389
+ msgid "Unexpected response from PayPal."
7390
+ msgstr ""
7391
+
7392
+ #: includes/gateways/paypal/webhooks/functions.php:161
7393
+ msgid "Webhook not configured."
7394
+ msgstr ""
7395
+
7396
+ #: includes/gateways/paypal/webhooks/functions.php:191
7397
+ #. Translators: %d - HTTP response code; %s - Full response from the API.
7398
+ msgid "Invalid response code %d while syncing webhook. Response: %s"
7399
+ msgstr ""
7400
+
7401
+ #: includes/gateways/paypal/webhooks/functions.php:226
7402
+ #. Translators: %d - HTTP response code.
7403
+ msgid "Invalid response code %d while retrieving webhook details."
7404
+ msgstr ""
7405
+
7406
+ #: includes/gateways/paypal/webhooks/functions.php:232
7407
+ msgid "Unexpected response from PayPal when retrieving webhook details."
7408
+ msgstr ""
7409
+
7410
+ #: includes/gateways/paypal/webhooks/functions.php:267
7411
+ #. Translators: %d - HTTP response code.
7412
+ msgid "Invalid response code %d while deleting webhook."
7413
  msgstr ""
7414
 
7415
  #: includes/gateways/paypal-standard.php:56
7416
+ msgid "PayPal Standard Settings"
7417
+ msgstr ""
7418
+
7419
+ #: includes/gateways/paypal-standard.php:61
7420
  msgid "PayPal Email"
7421
  msgstr ""
7422
 
7423
+ #: includes/gateways/paypal-standard.php:62
7424
  msgid "Enter your PayPal account's email"
7425
  msgstr ""
7426
 
7427
+ #: includes/gateways/paypal-standard.php:68
7428
  msgid "PayPal Image URL"
7429
  msgstr ""
7430
 
7431
+ #: includes/gateways/paypal-standard.php:69
7432
  msgid "Upload an image to display on the PayPal checkout page."
7433
  msgstr ""
7434
 
7435
+ #: includes/gateways/paypal-standard.php:76
7436
  msgid ""
7437
  "Enter your PayPal Identity Token in order to enable Payment Data Transfer "
7438
  "(PDT). This allows payments to be verified without relying on the PayPal "
7440
  "information."
7441
  msgstr ""
7442
 
7443
+ #: includes/gateways/paypal-standard.php:82
7444
  msgid "PayPal Identity Token"
7445
  msgstr ""
7446
 
7447
+ #: includes/gateways/paypal-standard.php:89
7448
  msgid ""
7449
  "If you are unable to use Payment Data Transfer and payments are not getting "
7450
  "marked as complete, then check this box. This forces the site to use a "
7452
  "target=\"_blank\">FAQ</a> for further information."
7453
  msgstr ""
7454
 
7455
+ #: includes/gateways/paypal-standard.php:95
7456
  msgid "Disable PayPal IPN Verification"
7457
  msgstr ""
7458
 
7459
+ #: includes/gateways/paypal-standard.php:103
7460
  msgid "API Credentials"
7461
  msgstr ""
7462
 
7463
+ #: includes/gateways/paypal-standard.php:106
7464
  msgid ""
7465
  "API credentials are necessary to process PayPal refunds from inside "
7466
  "WordPress. These can be obtained from <a href=\"%s\" target=\"_blank\">your "
7467
  "PayPal account</a>."
7468
  msgstr ""
7469
 
7470
+ #: includes/gateways/paypal-standard.php:112
7471
  msgid "Live API Username"
7472
  msgstr ""
7473
 
7474
+ #: includes/gateways/paypal-standard.php:113
7475
  msgid "Your PayPal live API username. "
7476
  msgstr ""
7477
 
7478
+ #: includes/gateways/paypal-standard.php:119
7479
  msgid "Live API Password"
7480
  msgstr ""
7481
 
7482
+ #: includes/gateways/paypal-standard.php:120
7483
  msgid "Your PayPal live API password."
7484
  msgstr ""
7485
 
7486
+ #: includes/gateways/paypal-standard.php:126
7487
  msgid "Live API Signature"
7488
  msgstr ""
7489
 
7490
+ #: includes/gateways/paypal-standard.php:127
7491
  msgid "Your PayPal live API signature."
7492
  msgstr ""
7493
 
7494
+ #: includes/gateways/paypal-standard.php:133
7495
  msgid "Test API Username"
7496
  msgstr ""
7497
 
7498
+ #: includes/gateways/paypal-standard.php:134
7499
  msgid "Your PayPal test API username."
7500
  msgstr ""
7501
 
7502
+ #: includes/gateways/paypal-standard.php:140
7503
  msgid "Test API Password"
7504
  msgstr ""
7505
 
7506
+ #: includes/gateways/paypal-standard.php:141
7507
  msgid "Your PayPal test API password."
7508
  msgstr ""
7509
 
7510
+ #: includes/gateways/paypal-standard.php:147
7511
  msgid "Test API Signature"
7512
  msgstr ""
7513
 
7514
+ #: includes/gateways/paypal-standard.php:148
7515
  msgid "Your PayPal test API signature."
7516
  msgstr ""
7517
 
7518
+ #: includes/gateways/paypal-standard.php:195
7519
  msgid "Payment creation failed before sending buyer to PayPal. Payment data: %s"
7520
  msgstr ""
7521
 
7522
+ #: includes/gateways/paypal-standard.php:475
7523
+ #: includes/gateways/paypal-standard.php:482
7524
  msgid "Invalid IPN verification response. IPN data: %s"
7525
  msgstr ""
7526
 
7527
+ #: includes/gateways/paypal-standard.php:571
7528
  msgid "Invalid business email in IPN response. IPN data: %s"
7529
  msgstr ""
7530
 
7531
+ #: includes/gateways/paypal-standard.php:574
7532
  msgid "Payment failed due to invalid PayPal business email."
7533
  msgstr ""
7534
 
7535
+ #: includes/gateways/paypal-standard.php:581
7536
  msgid "Invalid currency in IPN response. IPN data: %s"
7537
  msgstr ""
7538
 
7539
+ #: includes/gateways/paypal-standard.php:584
7540
  msgid "Payment failed due to invalid currency in PayPal IPN."
7541
  msgstr ""
7542
 
7543
+ #: includes/gateways/paypal-standard.php:654
7544
  msgid "Invalid payment amount in IPN response. IPN data: %s"
7545
  msgstr ""
7546
 
7547
+ #: includes/gateways/paypal-standard.php:657
7548
  msgid "Payment failed due to invalid amount in PayPal IPN."
7549
  msgstr ""
7550
 
7551
+ #: includes/gateways/paypal-standard.php:663
7552
  msgid "Invalid purchase key in IPN response. IPN data: %s"
7553
  msgstr ""
7554
 
7555
+ #: includes/gateways/paypal-standard.php:665
7556
  msgid "Payment failed due to invalid purchase key in PayPal IPN."
7557
  msgstr ""
7558
 
7559
+ #: includes/gateways/paypal-standard.php:685
 
 
 
 
 
 
 
 
 
 
 
7560
  msgid "Payment made via eCheck and will clear automatically in 5-8 days"
7561
  msgstr ""
7562
 
7563
+ #: includes/gateways/paypal-standard.php:692
7564
  msgid ""
7565
  "Payment requires a confirmed customer address and must be accepted manually "
7566
  "through PayPal"
7567
  msgstr ""
7568
 
7569
+ #: includes/gateways/paypal-standard.php:698
7570
  msgid ""
7571
  "Payment must be accepted manually through PayPal due to international "
7572
  "account regulations"
7573
  msgstr ""
7574
 
7575
+ #: includes/gateways/paypal-standard.php:704
7576
  msgid ""
7577
  "Payment received in non-shop currency and must be accepted manually through "
7578
  "PayPal"
7579
  msgstr ""
7580
 
7581
+ #: includes/gateways/paypal-standard.php:711
7582
  msgid ""
7583
  "Payment is being reviewed by PayPal staff as high-risk or in possible "
7584
  "violation of government regulations"
7585
  msgstr ""
7586
 
7587
+ #: includes/gateways/paypal-standard.php:717
7588
  msgid "Payment was sent to non-confirmed or non-registered email address."
7589
  msgstr ""
7590
 
7591
+ #: includes/gateways/paypal-standard.php:723
7592
  msgid "PayPal account must be upgraded before this payment can be accepted"
7593
  msgstr ""
7594
 
7595
+ #: includes/gateways/paypal-standard.php:729
7596
  msgid ""
7597
  "PayPal account is not verified. Verify account in order to accept this "
7598
  "payment"
7599
  msgstr ""
7600
 
7601
+ #: includes/gateways/paypal-standard.php:735
7602
  msgid ""
7603
  "Payment is pending for unknown reasons. Contact PayPal support for "
7604
  "assistance"
7605
  msgstr ""
7606
 
7607
+ #: includes/gateways/paypal-standard.php:788
7608
  msgid "Partial PayPal refund processed: %s"
7609
  msgstr ""
7610
 
7611
+ #: includes/gateways/paypal-standard.php:793
7612
  msgid "PayPal Payment #%s Refunded for reason: %s"
7613
  msgstr ""
7614
 
7615
+ #: includes/gateways/paypal-standard.php:794
7616
  msgid "PayPal Refund Transaction ID: %s"
7617
  msgstr ""
7618
 
7619
+ #: includes/gateways/paypal-standard.php:1008
7620
  msgid ""
7621
  "Payment could not be verified while validating PayPal PDT. Missing payment "
7622
  "total fields."
7623
  msgstr ""
7624
 
7625
+ #: includes/gateways/paypal-standard.php:1019
7626
  msgid ""
7627
  "Payment failed while validating PayPal PDT. Amount expected: %f. Amount "
7628
  "Received: %f"
7629
  msgstr ""
7630
 
7631
+ #: includes/gateways/paypal-standard.php:1049
7632
  msgid "Payment failed while validating PayPal PDT."
7633
  msgstr ""
7634
 
7635
+ #: includes/gateways/paypal-standard.php:1056
7636
  msgid "PayPal PDT encountered an unexpected result, payment set to pending"
7637
  msgstr ""
7638
 
7639
+ #: includes/gateways/paypal-standard.php:1141
7640
  msgid "Refund Payment in PayPal"
7641
  msgstr ""
7642
 
7643
+ #: includes/gateways/paypal-standard.php:1288
7644
  msgid "PayPal refund failed for unknown reason."
7645
  msgstr ""
7646
 
7647
+ #: includes/gateways/paypal-standard.php:1298
7648
  msgid "PayPal refund transaction ID: %s"
7649
  msgstr ""
7650
 
7651
+ #: includes/gateways/paypal-standard.php:1302
7652
  msgid "PayPal refund failed: %s"
7653
  msgstr ""
7654
 
7813
  msgid "Have questions about connecting with Stripe? See the %1$sdocumentation%2$s."
7814
  msgstr ""
7815
 
 
 
 
 
7816
  #: includes/gateways/stripe/includes/admin/settings/stripe-connect.php:262
7817
  msgid "Manage API keys manually"
7818
  msgstr ""
7907
  msgid "Unmet Requirements"
7908
  msgstr ""
7909
 
 
 
 
 
7910
  #: includes/gateways/stripe/includes/admin/settings.php:54
7911
  msgid "Test Publishable Key"
7912
  msgstr ""
8202
  msgstr ""
8203
 
8204
  #: includes/gateways/stripe/includes/compat.php:116
8205
+ #: includes/process-purchase.php:550 includes/process-purchase.php:869
8206
  msgid "The user information is invalid"
8207
  msgstr ""
8208
 
8640
  msgid "Stripe Radar review closed with a reason of %s."
8641
  msgstr ""
8642
 
8643
+ #: includes/install.php:117
8644
  msgid "Purchase Confirmation"
8645
  msgstr ""
8646
 
8647
+ #: includes/install.php:118
8648
  msgid "Thank you for your purchase! [edd_receipt]"
8649
  msgstr ""
8650
 
8651
+ #: includes/install.php:153
8652
  msgid "Purchase History"
8653
  msgstr ""
8654
 
9490
  msgid "You must be logged into an account to purchase"
9491
  msgstr ""
9492
 
9493
+ #: includes/process-purchase.php:951
9494
  msgid "The zip / postal code you entered for your billing address is invalid"
9495
  msgstr ""
9496
 
9497
+ #: includes/process-purchase.php:1200
9498
  msgid "An internal error has occurred, please try again or contact support."
9499
  msgstr ""
9500
 
9501
+ #: includes/process-purchase.php:1236
9502
  msgid "There was an error completing your purchase. Please try again."
9503
  msgstr ""
9504
 
readme.txt CHANGED
@@ -7,7 +7,7 @@ Tags: ecommerce, sell, checkout, digital store, stripe
7
  Requires at least: 4.4
8
  Tested up to: 5.8
9
  Requires PHP: 5.3
10
- Stable Tag: 2.10.6
11
  License: GNU Version 2 or Any Later Version
12
 
13
  Sell your digital products the simple way. Easily build an online store complete with a cart system, checkout forms, reports, coupons, and more!
@@ -54,17 +54,14 @@ The internet has made it possible for anyone to sell their products to a world-w
54
 
55
  Payment gateways supported in the free Easy Digital Downloads plugin:
56
 
57
- * Stripe **[new]**
58
- * PayPal Standard
59
  * Amazon Payments
60
 
61
  Payment gateways supported through free or premium extensions:
62
 
63
  * Stripe Pro (reduced fees and preapproved payments functionality)
64
- * PayPal Pro
65
- * PayPal Express
66
- * PayPal Payments Advanced
67
- * PayPal Adaptive Payments
68
  * Braintree
69
  * Authorize.net
70
  * 2Checkout
@@ -245,8 +242,22 @@ Yes, through the use of our commercial addon called [Recurring Payments](https:/
245
  9. Apple Pay purchase buttons
246
  10. Checkout screen
247
  11. Google Pay checkout
 
 
248
 
249
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
250
  = 2.10.6, June 22, 2021 =
251
  * New: Added license upgrade notices to EDD admin pages.
252
  * Improvement: The discount API endpoint now includes `excluded_products`.
7
  Requires at least: 4.4
8
  Tested up to: 5.8
9
  Requires PHP: 5.3
10
+ Stable Tag: 2.11
11
  License: GNU Version 2 or Any Later Version
12
 
13
  Sell your digital products the simple way. Easily build an online store complete with a cart system, checkout forms, reports, coupons, and more!
54
 
55
  Payment gateways supported in the free Easy Digital Downloads plugin:
56
 
57
+ * Stripe
58
+ * PayPal
59
  * Amazon Payments
60
 
61
  Payment gateways supported through free or premium extensions:
62
 
63
  * Stripe Pro (reduced fees and preapproved payments functionality)
64
+ * PayPal Commerce Pro (unbranded card payments and additional payment methods)
 
 
 
65
  * Braintree
66
  * Authorize.net
67
  * 2Checkout
242
  9. Apple Pay purchase buttons
243
  10. Checkout screen
244
  11. Google Pay checkout
245
+ 12. PayPal button on checkout page
246
+ 13. Pay with PayPal modal
247
 
248
  == Changelog ==
249
+ = 2.11, August 19, 2021 =
250
+ * New: Introducing the new PayPal Commerce gateway integration.
251
+ * New: System info page now shows Plugin Author or Update URI
252
+ * New: Improved support for caching pages that contain add to cart buttons by using a custom token verification instead of nonces.
253
+ * Improved: The extension updater class has been updated to version 1.9.0.
254
+ * Fix: Download Notes could be duplicated in the email receipt.
255
+ * Fix: The Paypal transaction ID links were using an older format.
256
+ * Fix: The edd_items_in_cart cookie wasn't setting the correct attributes on sites with SSLs.
257
+ * Fix: Some bundled images hadn't been optimized.
258
+ * Fix: The discounts API endpoint could not filter a discount by ID.
259
+ * Fix: When making an EDD Wallet deposit, the cart HTML would be removed when taxes were enabled.
260
+
261
  = 2.10.6, June 22, 2021 =
262
  * New: Added license upgrade notices to EDD admin pages.
263
  * Improvement: The discount API endpoint now includes `excluded_products`.
templates/edd.min.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";.edd-icon{display:inline-block;fill:currentColor;position:relative;top:-.0625em;vertical-align:middle;width:1em;height:1em}.edd-icon-lock{top:-.125rem}.edd-icon-spin{display:inline-block;-moz-animation:edd-icon-spin 2s infinite linear;-o-animation:edd-icon-spin 2s infinite linear;-webkit-animation:edd-icon-spin 2s infinite linear;animation:edd-icon-spin 2s infinite linear}@-moz-keyframes edd-icon-spin{0%{-moz-transform:rotate(0)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes edd-icon-spin{0%{-webkit-transform:rotate(0)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes edd-icon-spin{0%{-o-transform:rotate(0)}100%{-o-transform:rotate(359deg)}}@-ms-keyframes edd-icon-spin{0%{-ms-transform:rotate(0)}100%{-ms-transform:rotate(359deg)}}@keyframes edd-icon-spin{0%{transform:rotate(0)}100%{transform:rotate(359deg)}}.edd_clearfix:after{display:block;visibility:hidden;float:none;clear:both;text-indent:-9999px;content:"."}#edd_checkout_cart{text-align:left;width:100%;border:none;margin:0 0 21px;table-layout:auto}#edd_checkout_cart td,#edd_checkout_cart th{text-align:left;border:1px solid #eee;color:#666;padding:.5em 1.387em}#edd_checkout_cart .edd_cart_header_row th{background:#fafafa;padding:1.387em}#edd_checkout_cart .edd_cart_discount_row th,#edd_checkout_cart .edd_cart_tax_row th{background:0 0}#edd_checkout_cart th{font-weight:700}#edd_checkout_cart td{line-height:25px;vertical-align:middle;background:#fff}#edd_checkout_cart td.edd_cart_actions,#edd_checkout_cart td:last-child,#edd_checkout_cart th.edd_cart_actions,#edd_checkout_cart th.edd_cart_total,#edd_checkout_cart th:last-child{text-align:right}#edd_checkout_cart td img{float:left;margin:0 8px 0 0;background:0 0;padding:0;border:none}#edd_checkout_cart input.edd-item-quantity{width:3em;padding:2px}#edd_checkout_cart .edd_discount{display:inline-block;margin-left:5px}.edd_discount_remove{display:inline-block;width:10px;height:11px;background:url(images/xit.gif) 0 0 no-repeat;position:relative;top:3px}.edd_discount_remove:hover{background-position:-10px 0}#edd_checkout_cart br{display:none}#edd_checkout_cart a.edd-cart-saving-button{font-weight:400;text-decoration:none}#edd_checkout_form_wrap legend{display:block;font-size:120%;line-height:1;font-weight:700;width:100%;margin:0 0 21px;padding:0}#edd_checkout_form_wrap label{font-weight:700;display:block;position:relative;line-height:100%;font-size:95%;margin:0 0 5px}#edd_checkout_form_wrap span.edd-description{color:#666;font-size:80%;display:block;margin:0 0 5px}#edd_checkout_form_wrap input.edd-input,#edd_checkout_form_wrap textarea.edd-input{display:inline-block;width:70%}#edd_checkout_form_wrap select.edd-select{display:block;width:60%}#edd_checkout_form_wrap select.edd-select.edd-select-small{display:inline;width:auto}#edd_checkout_form_wrap input.edd-input.error,#edd_checkout_form_wrap textarea.edd-input.error{border-color:#c4554e}#edd_checkout_form_wrap>p{margin:0 0 21px}#edd_checkout_form_wrap span.edd-required-indicator{color:#b94a48;display:inline}#edd_checkout_form_wrap input[type=email],#edd_checkout_form_wrap input[type=password],#edd_checkout_form_wrap input[type=tel],#edd_checkout_form_wrap input[type=text],#edd_checkout_form_wrap textarea{padding:4px 6px}#edd_checkout_form_wrap input[type=radio]{border:none;margin-right:5px}#edd_checkout_form_wrap input[type=checkbox]{display:inline-block;margin:0 5px 0 0}#edd_checkout_form_wrap input[type=checkbox]+label,#edd_checkout_form_wrap input[type=checkbox]+label:after{display:inline}#edd_checkout_form_wrap .edd-payment-icons{height:32px;display:block;margin:0 0 8px}#edd_checkout_form_wrap .edd-payment-icons img.payment-icon{max-height:32px;width:auto;margin:0 3px 0 0;float:left;background:0 0;padding:0;border:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}#edd_checkout_form_wrap #edd-payment-mode-wrap label{display:inline-block;margin:0 20px 0 0}#edd_checkout_form_wrap #edd-payment-mode-wrap .edd-payment-mode-label{font-weight:700;display:inline-block;position:relative;margin-bottom:5px}#edd_checkout_form_wrap fieldset{border:1px solid #eee;padding:1.387em;margin:0 0 21px}#edd_checkout_form_wrap #edd_discount_code,#edd_checkout_form_wrap #edd_purchase_submit,#edd_checkout_form_wrap #edd_register_account_fields{padding:0;border:none}#edd_checkout_form_wrap fieldset fieldset{margin:0;border:none;padding:0}#edd_checkout_form_wrap #edd-login-account-wrap,#edd_checkout_form_wrap #edd-new-account-wrap,#edd_checkout_form_wrap #edd_final_total_wrap,#edd_checkout_form_wrap #edd_show_discount,#edd_checkout_form_wrap .edd-cart-adjustment{background:#fafafa;color:#666;padding:.5em 1.387em}#edd_checkout_form_wrap #edd-discount-code-wrap,#edd_checkout_form_wrap #edd_final_total_wrap,#edd_checkout_form_wrap #edd_show_discount{border:1px solid #eee}#edd_checkout_form_wrap .edd-cart-adjustment{padding:1.387em}#edd_checkout_form_wrap .edd-cart-adjustment input.edd-input,#edd_checkout_form_wrap .edd-cart-adjustment input.edd-submit{display:inline-block}#edd_checkout_form_wrap .edd-cart-adjustment input.edd-submit{padding:3px 12px;margin-bottom:2px}#edd_checkout_form_wrap #edd-discount-error-wrap{width:100%;display:inline-block;margin:1em 0 0}#edd_checkout_form_wrap #edd-login-account-wrap,#edd_checkout_form_wrap #edd-new-account-wrap{margin:-1.387em -1.387em 21px;border-left:none;border-right:none;border-top:none}#edd_checkout_form_wrap #edd_payment_mode_select{margin-bottom:21px}#edd_checkout_form_wrap fieldset#edd_register_fields #edd_checkout_user_info{margin-bottom:21px}#edd_checkout_form_wrap fieldset#edd_register_account_fields legend{padding-top:11px}#edd_checkout_form_wrap fieldset#edd_register_account_fields p.edd_login_password,#edd_checkout_form_wrap fieldset#edd_register_account_fields p.edd_register_password{margin:0}#edd_checkout_form_wrap fieldset#edd_cc_fields{border:1px solid #f0f0f0;background:#f9f9f9;position:relative}#edd_checkout_form_wrap fieldset#edd_cc_fields legend{border:none;padding:0}#edd_checkout_form_wrap fieldset p:last-child{margin-bottom:0}#edd_checkout_form_wrap fieldset#edd_cc_fields #edd-card-number-wrap{margin-top:5px}#edd_checkout_form_wrap #edd_purchase_final_total{margin:21px 0}#edd_checkout_form_wrap #edd_purchase_final_total p{margin:0}#edd_secure_site_wrapper{padding:4px 4px 4px 0;font-weight:700}#edd_checkout_form_wrap input.edd-input.card-number.valid{background-image:url(images/tick.png);background-repeat:no-repeat;background-position:98% 50%}#edd_checkout_form_wrap span.exp-divider{display:inline}#edd_checkout_form_wrap span.card-type{position:absolute;top:-2px;right:0;width:43px;height:32px;background-size:43px 32px!important}#edd_checkout_form_wrap span.card-type.off{display:none}#edd_checkout_form_wrap span.card-type.visa{background:url(images/icons/visa.png) no-repeat}#edd_checkout_form_wrap span.card-type.mastercard{background:url(images/icons/mastercard.png) no-repeat}#edd_checkout_form_wrap span.card-type.discover{background:url(images/icons/discover.png) no-repeat}#edd_checkout_form_wrap span.card-type.amex{background:url(images/icons/americanexpress.png) no-repeat}#edd_checkout_form_wrap .edd-cart-ajax{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.edd-amazon-profile-wrapper{font-size:12px}.edd-amazon-profile-name{font-weight:600}.edd-amazon-logout{font-size:10px;line-height:12px}.edd-amazon-logout a{cursor:pointer}#edd-amazon-address-box,#edd-amazon-wallet-box{height:228px;width:350px}#edd-amazon-address-box{margin-bottom:15px}@media only screen and (min-width:768px){#edd-amazon-address-box,#edd-amazon-wallet-box{width:100%;height:228px}}.edd_purchase_submit_wrapper{position:relative}.edd_purchase_submit_wrapper a.edd-add-to-cart{text-decoration:none;display:none;position:relative;overflow:hidden}.edd_purchase_submit_wrapper a.edd-add-to-cart.edd-has-js{display:inline-block}.edd_purchase_submit_wrapper .edd-cart-ajax{display:none;position:relative;left:-35px}.edd-submit.button.edd-ajax-loading{padding-right:30px}.edd-add-to-cart .edd-add-to-cart-label{opacity:1}.edd-loading,.edd-loading:after{border-radius:50%;display:block;width:1.5em;height:1.5em}.edd-loading{-webkit-animation:edd-spinning 1.1s infinite linear;animation:edd-spinning 1.1s infinite linear;border-top:.2em solid rgba(255,255,255,.2);border-right:.2em solid rgba(255,255,255,.2);border-bottom:.2em solid rgba(255,255,255,.2);border-left:.2em solid #fff;font-size:.75em;position:absolute;left:calc(50% - .75em);top:calc(50% - .75em);opacity:0;-ms-transform:translateZ(0);transform:translateZ(0)}.edd-discount-loader.edd-loading,.edd-loading-ajax.edd-loading,a.edd-add-to-cart.white .edd-loading{border-top-color:rgba(0,0,0,.2);border-right-color:rgba(0,0,0,.2);border-bottom-color:rgba(0,0,0,.2);border-left-color:#000}.edd-loading-ajax.edd-loading{display:inline-block;position:relative;top:0;left:.25em;vertical-align:middle}#edd_checkout_form_wrap .edd-cart-adjustment .edd-apply-discount.edd-submit{display:inline-block}.edd-discount-loader.edd-loading{display:inline-block;position:relative;left:auto;vertical-align:middle;width:1.25em;height:1.25em}.edd-loading-ajax.edd-loading{opacity:1}@-webkit-keyframes edd-spinning{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes edd-spinning{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.edd-loading,a.edd-add-to-cart .edd-add-to-cart-label{-webkit-transition:.1s opacity!important;-moz-transition:.1s opacity!important;-ms-transition:.1s opacity!important;-o-transition:.1s opacity!important;transition:.1s opacity!important}.edd-add-to-cart[data-edd-loading] .edd-add-to-cart-label{opacity:0}.edd-add-to-cart[data-edd-loading] .edd-loading,.edd-discount-loader.edd-loading{opacity:1}.edd-cart-added-alert{color:#567622;display:block;position:absolute}.edd_form input.edd-input.required,.edd_form select.edd-select.required{color:#000}body.edd_receipt_page{background-color:#fff;color:#141412;margin:0;font-family:Helvetica,sans-serif;font-size:12px}body.edd_receipt_page:before{position:relative}body.edd_receipt_page #edd_receipt_wrapper{width:660px;margin:0 auto;padding:50px 0}body.edd_receipt_page table{display:table;width:100%;border-bottom:1px solid #ededed;border-collapse:collapse;border-spacing:0;font-size:14px;line-height:2;margin:0 0 20px}body.edd_receipt_page td,body.edd_receipt_page th{display:table-cell;text-align:left;border-top:1px solid #ededed;padding:6px 10px;font-weight:400}body.edd_receipt_page th{font-weight:700;text-transform:uppercase}body.edd_receipt_page h3{font-size:22px;margin:40px 0 5px;clear:both;display:block;font-weight:700}body.edd_receipt_page li{list-style:none}table#edd_purchase_receipt,table#edd_purchase_receipt_products{width:100%}table#edd_purchase_receipt td,table#edd_purchase_receipt th,table#edd_purchase_receipt_products td,table#edd_purchase_receipt_products th{text-align:left}table#edd_purchase_receipt .edd_receipt_payment_status.cancelled,table#edd_purchase_receipt .edd_receipt_payment_status.failed,table#edd_purchase_receipt .edd_receipt_payment_status.pending,table#edd_purchase_receipt .edd_receipt_payment_status.revoked{color:#f73f2e}table#edd_purchase_receipt_products li{list-style:none;margin:0 0 8px 10px}table#edd_purchase_receipt ul,table#edd_purchase_receipt_products ul.edd_purchase_receipt_files{margin:0;padding:0}table#edd_purchase_receipt li.edd_download_file{list-style:none;margin:0 0 8px 0}table#edd_purchase_receipt_products .edd_purchase_receipt_product_notes{font-style:italic}table#edd_purchase_receipt_products .edd_purchase_receipt_product_name{font-weight:700}table#edd_purchase_receipt_products .edd_bundled_product_name{font-style:italic;font-weight:700}#edd_user_history{text-align:left;width:100%;border-top:1px solid #f0f0f0;border-bottom:none}#edd_user_history td,#edd_user_history th{text-align:left;padding:3px 5px;border-bottom:1px solid #f0f0f0;border-top:none}#edd_user_history th{font-weight:700;background:#f5f5f5}#edd_user_history td{line-height:25px;vertical-align:middle}#edd_user_history .edd_purchase_status.cancelled,#edd_user_history .edd_purchase_status.failed,#edd_user_history .edd_purchase_status.pending,#edd_user_history .edd_purchase_status.revoked{color:#f73f2e}#edd_login_form legend,#edd_register_form legend{font-size:120%;margin-bottom:1em}#edd_login_form fieldset,#edd_register_form fieldset{border:none}#edd_login_form .edd-input,#edd_register_form .edd-input{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#edd_login_form label,#edd_register_form label{cursor:pointer}#edd_profile_editor_form p{margin-bottom:8px}#edd_profile_editor_form label{display:inline-block}#edd_profile_editor_form .edd-profile-emails{list-style-type:none;display:inline-table;margin-left:0;margin-bottom:0}#edd_profile_editor_form .edd-profile-email{width:auto}#edd_profile_editor_form .edd-profile-email .actions{display:none}#edd_profile_editor_form .edd-profile-email:hover>span{display:inline-block}.edd_added_to_cart_alert{padding:5px;font-size:14px;border:1px solid #046a9e;background:#9ecce2;color:#333;margin:8px 0}.edd_added_to_cart_alert a.edd_alert_checkout_link{color:#000!important}input.edd_submit_plain{background:0 0!important;border:none!important;padding:0!important;display:inline;cursor:pointer}.single-download .edd_download_purchase_form{margin-bottom:1.387em}.edd_download_purchase_form .edd_download_quantity_wrapper{margin:0 0 .5em}.edd_download_purchase_form .edd_download_quantity_wrapper .edd-item-quantity{width:75px}.edd_download_purchase_form .edd_price_options{margin:0 0 15px}.edd_download_purchase_form .edd_price_options ul{margin:0;padding:0;list-style:none}.edd_download_purchase_form .edd_price_options li{display:block;padding:0;margin:0}.edd_download_purchase_form .edd_price_options span{display:inline;padding:0;margin:0}.edd_download_purchase_form .edd_price_options .edd_download_quantity_wrapper{padding-left:18px}.edd_download_purchase_form .edd_price_options .edd_download_quantity_wrapper *{font-size:80%}.edd_download_purchase_form .edd_price_options input.edd-item-quantity{display:inline;width:50px;max-width:90%}#edd-purchase-button,.edd-submit,[type=submit].edd-submit{display:inline-block;padding:6px 12px;margin:0;font-size:14px;font-weight:400;line-height:1.428571429;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.edd-submit.button:focus,[type=submit].edd-submit:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.edd-submit.button:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.edd-submit.plain{padding:0;border:none;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.edd-submit.button,.edd-submit.button.gray,.edd-submit.button:visited{color:#333;background:#f0f0f0;border-color:#ccc}.edd-submit.button.gray:active,.edd-submit.button.gray:focus,.edd-submit.button.gray:hover,.edd-submit.button:active,.edd-submit.button:focus,.edd-submit.button:hover{color:#333;background:#ebebeb;border-color:#adadad}.edd-submit.button.gray:active{background-image:none}.edd-submit.button.white{color:#333;background:#fff;border-color:#ccc}.edd-submit.button.white:active,.edd-submit.button.white:focus,.edd-submit.button.white:hover{color:#333;background:#ebebeb;border-color:#adadad}.edd-submit.button.white:active{background-image:none}.edd-submit.button.blue{color:#fff;background:#428bca;border-color:#357ebd}.edd-submit.button.blue.active,.edd-submit.button.blue:focus,.edd-submit.button.blue:hover{color:#fff;background:#3276b1;border-color:#285e8e}.edd-submit.button.blue.active{background-image:none}.edd-submit.button.red{color:#fff;background:#d9534f;border-color:#d43f3a}.edd-submit.button.red:active,.edd-submit.button.red:focus,.edd-submit.button.red:hover{color:#fff;background:#d2322d;border-color:#ac2925}.edd-submit.button.red:active{background-image:none}.edd-submit.button.green{color:#fff;background:#5cb85c;border-color:#4cae4c}.edd-submit.button.green:active,.edd-submit.button.green:focus,.edd-submit.button.green:hover{color:#fff;background:#47a447;border-color:#398439}.edd-submit.button.green:active{background-image:none}.edd-submit.button.yellow{color:#fff;background:#f0ad4e;border-color:#eea236}.edd-submit.button.yellow:active,.edd-submit.button.yellow:focus,.edd-submit.button.yellow:hover{color:#fff;background:#ed9c28;border-color:#d58512}.edd-submit.button.yellow:active{background-image:none}.edd-submit.button.orange{color:#fff;background:#ed9c28;border-color:#e3921e}.edd-submit.button.orange:active,.edd-submit.button.orange:focus,.edd-submit.button.orange:hover{color:#fff;background:#e59016;border-color:#d58512}.edd-submit.button.orange:active{background-image:none}.edd-submit.button.dark-gray{color:#fff;background:#363636;border-color:#222}.edd-submit.button.dark-gray:active,.edd-submit.button.dark-gray:focus,.edd-submit.button.dark-gray:hover{color:#fff;background:#333;border-color:#adadad}.edd-submit.button.dark-gray:active{background-image:none}.edd_downloads_list:after{content:"";display:table;clear:both}.edd_download{float:left}.edd_download_columns_1 .edd_download{width:100%}.edd_download_columns_2 .edd_download{width:50%}.edd_download_columns_0 .edd_download,.edd_download_columns_3 .edd_download{width:33%}.edd_download_columns_4 .edd_download{width:25%}.edd_download_columns_5 .edd_download{width:20%}.edd_download_columns_6 .edd_download{width:16.6%}.edd_download_inner{padding:0 8px 8px;margin:0 0 10px}.edd_download_columns_2 .edd_download:nth-child(2n+1),.edd_download_columns_3 .edd_download:nth-child(3n+1),.edd_download_columns_4 .edd_download:nth-child(4n+1),.edd_download_columns_5 .edd_download:nth-child(5n+1),.edd_download_columns_6 .edd_download:nth-child(6n+1){clear:left}.edd_download_image{max-width:100%}.edd_download .edd_price{margin-bottom:10px}.edd-hide-on-empty.cart-empty{display:none}edd-hide-on-empty.cart-not.empty{display:block}.edd-cart-ajax{margin:0 8px 0 4px;position:relative;top:2px;background:0 0;border:none;padding:0}.edd-cart-number-of-items{font-style:italic;color:grey}.edd-cart-meta.edd_subtotal{font-weight:700;font-style:italic}.edd-cart-meta.edd_cart_tax{font-size:1em;font-style:italic}.edd-cart-meta.edd_cart_tax::before{font-style:normal}.edd-cart-meta.edd_total{font-weight:700}.edd-cart-meta{padding:2px 5px}.edd-cart-meta.edd_subtotal,.edd-cart-meta.edd_total{background-color:#f9f9f9}.edd_errors:not(.edd-alert){-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;border:1px solid #e6db55;margin:0 0 21px;background:#ffffe0;color:#333}.edd_error{padding:10px}p.edd_error{margin:0!important}.edd_success:not(.edd-alert){-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;border:1px solid #b3ce89;margin:20px 0;background:#d5eab3;color:#567622;padding:6px 8px;box-shadow:inset 0 1px 0 rgba(255,255,255,.7)}.edd-alert{-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;margin-bottom:20px;padding:10px;border:1px solid transparent;vertical-align:middle}.edd-alert p{padding:0}.edd-alert p:not(:last-child){margin-bottom:5px}.edd-alert p:last-child{margin-bottom:0}.edd-alert-error{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.edd-alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d}.edd-alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.edd-alert-warn{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}
1
+ @charset "UTF-8";.edd-icon{display:inline-block;fill:currentColor;position:relative;top:-.0625em;vertical-align:middle;width:1em;height:1em}.edd-icon-lock{top:-.125rem}.edd-icon-spin{display:inline-block;-moz-animation:edd-icon-spin 2s infinite linear;-o-animation:edd-icon-spin 2s infinite linear;-webkit-animation:edd-icon-spin 2s infinite linear;animation:edd-icon-spin 2s infinite linear}@-moz-keyframes edd-icon-spin{0%{-moz-transform:rotate(0)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes edd-icon-spin{0%{-webkit-transform:rotate(0)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes edd-icon-spin{0%{-o-transform:rotate(0)}100%{-o-transform:rotate(359deg)}}@-ms-keyframes edd-icon-spin{0%{-ms-transform:rotate(0)}100%{-ms-transform:rotate(359deg)}}@keyframes edd-icon-spin{0%{transform:rotate(0)}100%{transform:rotate(359deg)}}.edd_clearfix:after{display:block;visibility:hidden;float:none;clear:both;text-indent:-9999px;content:"."}#edd_checkout_cart{text-align:left;width:100%;border:none;margin:0 0 21px;table-layout:auto}#edd_checkout_cart td,#edd_checkout_cart th{text-align:left;border:1px solid #eee;color:#666;padding:.5em 1.387em}#edd_checkout_cart .edd_cart_header_row th{background:#fafafa;padding:1.387em}#edd_checkout_cart .edd_cart_discount_row th,#edd_checkout_cart .edd_cart_tax_row th{background:0 0}#edd_checkout_cart th{font-weight:700}#edd_checkout_cart td{line-height:25px;vertical-align:middle;background:#fff}#edd_checkout_cart td.edd_cart_actions,#edd_checkout_cart td:last-child,#edd_checkout_cart th.edd_cart_actions,#edd_checkout_cart th.edd_cart_total,#edd_checkout_cart th:last-child{text-align:right}#edd_checkout_cart td img{float:left;margin:0 8px 0 0;background:0 0;padding:0;border:none}#edd_checkout_cart input.edd-item-quantity{width:3em;padding:2px}#edd_checkout_cart .edd_discount{display:inline-block;margin-left:5px}.edd_discount_remove{display:inline-block;width:10px;height:11px;background:url(images/xit.gif ) 0 0 no-repeat;position:relative;top:3px}.edd_discount_remove:hover{background-position:-10px 0}#edd_checkout_cart br{display:none}#edd_checkout_cart a.edd-cart-saving-button{font-weight:400;text-decoration:none}#edd_checkout_form_wrap legend{display:block;font-size:120%;line-height:1;font-weight:700;width:100%;margin:0 0 21px;padding:0}#edd_checkout_form_wrap label{font-weight:700;display:block;position:relative;line-height:100%;font-size:95%;margin:0 0 5px}#edd_checkout_form_wrap span.edd-description{color:#666;font-size:80%;display:block;margin:0 0 5px}#edd_checkout_form_wrap input.edd-input,#edd_checkout_form_wrap textarea.edd-input{display:inline-block;width:70%}#edd_checkout_form_wrap select.edd-select{display:block;width:60%}#edd_checkout_form_wrap select.edd-select.edd-select-small{display:inline;width:auto}#edd_checkout_form_wrap input.edd-input.error,#edd_checkout_form_wrap textarea.edd-input.error{border-color:#c4554e}#edd_checkout_form_wrap>p{margin:0 0 21px}#edd_checkout_form_wrap span.edd-required-indicator{color:#b94a48;display:inline}#edd_checkout_form_wrap input[type=email],#edd_checkout_form_wrap input[type=password],#edd_checkout_form_wrap input[type=tel],#edd_checkout_form_wrap input[type=text],#edd_checkout_form_wrap textarea{padding:4px 6px}#edd_checkout_form_wrap input[type=radio]{border:none;margin-right:5px}#edd_checkout_form_wrap input[type=checkbox]{display:inline-block;margin:0 5px 0 0}#edd_checkout_form_wrap input[type=checkbox]+label,#edd_checkout_form_wrap input[type=checkbox]+label:after{display:inline}#edd_checkout_form_wrap .edd-payment-icons{height:32px;display:block;margin:0 0 8px}#edd_checkout_form_wrap .edd-payment-icons img.payment-icon{max-height:32px;width:auto;margin:0 3px 0 0;float:left;background:0 0;padding:0;border:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}#edd_checkout_form_wrap #edd-payment-mode-wrap label{display:inline-block;margin:0 20px 0 0}#edd_checkout_form_wrap #edd-payment-mode-wrap .edd-payment-mode-label{font-weight:700;display:inline-block;position:relative;margin-bottom:5px}#edd_checkout_form_wrap fieldset{border:1px solid #eee;padding:1.387em;margin:0 0 21px}#edd_checkout_form_wrap #edd_discount_code,#edd_checkout_form_wrap #edd_purchase_submit,#edd_checkout_form_wrap #edd_register_account_fields{padding:0;border:none}#edd_checkout_form_wrap fieldset fieldset{margin:0;border:none;padding:0}#edd_checkout_form_wrap #edd-login-account-wrap,#edd_checkout_form_wrap #edd-new-account-wrap,#edd_checkout_form_wrap #edd_final_total_wrap,#edd_checkout_form_wrap #edd_show_discount,#edd_checkout_form_wrap .edd-cart-adjustment{background:#fafafa;color:#666;padding:.5em 1.387em}#edd_checkout_form_wrap #edd-discount-code-wrap,#edd_checkout_form_wrap #edd_final_total_wrap,#edd_checkout_form_wrap #edd_show_discount{border:1px solid #eee}#edd_checkout_form_wrap .edd-cart-adjustment{padding:1.387em}#edd_checkout_form_wrap .edd-cart-adjustment input.edd-input,#edd_checkout_form_wrap .edd-cart-adjustment input.edd-submit{display:inline-block}#edd_checkout_form_wrap .edd-cart-adjustment input.edd-submit{padding:3px 12px;margin-bottom:2px}#edd_checkout_form_wrap #edd-discount-error-wrap{width:100%;display:inline-block;margin:1em 0 0}#edd_checkout_form_wrap #edd-login-account-wrap,#edd_checkout_form_wrap #edd-new-account-wrap{margin:-1.387em -1.387em 21px;border-left:none;border-right:none;border-top:none}#edd_checkout_form_wrap #edd_payment_mode_select{margin-bottom:21px}#edd_checkout_form_wrap fieldset#edd_register_fields #edd_checkout_user_info{margin-bottom:21px}#edd_checkout_form_wrap fieldset#edd_register_account_fields legend{padding-top:11px}#edd_checkout_form_wrap fieldset#edd_register_account_fields p.edd_login_password,#edd_checkout_form_wrap fieldset#edd_register_account_fields p.edd_register_password{margin:0}#edd_checkout_form_wrap fieldset#edd_cc_fields{border:1px solid #f0f0f0;background:#f9f9f9;position:relative}#edd_checkout_form_wrap fieldset#edd_cc_fields legend{border:none;padding:0}#edd_checkout_form_wrap fieldset p:last-child{margin-bottom:0}#edd_checkout_form_wrap fieldset#edd_cc_fields #edd-card-number-wrap{margin-top:5px}#edd_checkout_form_wrap #edd_purchase_final_total{margin:21px 0}#edd_checkout_form_wrap #edd_purchase_final_total p{margin:0}#edd_secure_site_wrapper{padding:4px 4px 4px 0;font-weight:700}#edd_checkout_form_wrap input.edd-input.card-number.valid{background-image:url(images/tick.png);background-repeat:no-repeat;background-position:98% 50%}#edd_checkout_form_wrap span.exp-divider{display:inline}#edd_checkout_form_wrap span.card-type{position:absolute;top:-2px;right:0;width:43px;height:32px;background-size:43px 32px!important}#edd_checkout_form_wrap span.card-type.off{display:none}#edd_checkout_form_wrap span.card-type.visa{background:url(images/icons/visa.png ) no-repeat}#edd_checkout_form_wrap span.card-type.mastercard{background:url(images/icons/mastercard.png ) no-repeat}#edd_checkout_form_wrap span.card-type.discover{background:url(images/icons/discover.png ) no-repeat}#edd_checkout_form_wrap span.card-type.amex{background:url(images/icons/americanexpress.png ) no-repeat}#edd_checkout_form_wrap .edd-cart-ajax{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.edd-amazon-profile-wrapper{font-size:12px}.edd-amazon-profile-name{font-weight:600}.edd-amazon-logout{font-size:10px;line-height:12px}.edd-amazon-logout a{cursor:pointer}#edd-amazon-address-box,#edd-amazon-wallet-box{height:228px;width:350px}#edd-amazon-address-box{margin-bottom:15px}@media only screen and (min-width:768px){#edd-amazon-address-box,#edd-amazon-wallet-box{width:100%;height:228px}}.edd_purchase_submit_wrapper{position:relative}.edd_purchase_submit_wrapper a.edd-add-to-cart{text-decoration:none;display:none;position:relative;overflow:hidden}.edd_purchase_submit_wrapper a.edd-add-to-cart.edd-has-js{display:inline-block}.edd_purchase_submit_wrapper .edd-cart-ajax{display:none;position:relative;left:-35px}.edd-submit.button.edd-ajax-loading{padding-right:30px}.edd-add-to-cart .edd-add-to-cart-label{opacity:1}.edd-loading,.edd-loading:after{border-radius:50%;display:block;width:1.5em;height:1.5em}.edd-loading{-webkit-animation:edd-spinning 1.1s infinite linear;animation:edd-spinning 1.1s infinite linear;border-top:.2em solid rgba(255,255,255,.2);border-right:.2em solid rgba(255,255,255,.2);border-bottom:.2em solid rgba(255,255,255,.2);border-left:.2em solid #fff;font-size:.75em;position:absolute;left:calc(50% - .75em);top:calc(50% - .75em);opacity:0;-ms-transform:translateZ(0);transform:translateZ(0)}.edd-discount-loader.edd-loading,.edd-loading-ajax.edd-loading,a.edd-add-to-cart.white .edd-loading{border-top-color:rgba(0,0,0,.2);border-right-color:rgba(0,0,0,.2);border-bottom-color:rgba(0,0,0,.2);border-left-color:#000}.edd-loading-ajax.edd-loading{display:inline-block;position:relative;top:0;left:.25em;vertical-align:middle}#edd_checkout_form_wrap .edd-cart-adjustment .edd-apply-discount.edd-submit{display:inline-block}.edd-discount-loader.edd-loading{display:inline-block;position:relative;left:auto;vertical-align:middle;width:1.25em;height:1.25em}.edd-loading-ajax.edd-loading{opacity:1}@-webkit-keyframes edd-spinning{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes edd-spinning{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.edd-loading,a.edd-add-to-cart .edd-add-to-cart-label{-webkit-transition:.1s opacity!important;-moz-transition:.1s opacity!important;-ms-transition:.1s opacity!important;-o-transition:.1s opacity!important;transition:.1s opacity!important}.edd-add-to-cart[data-edd-loading] .edd-add-to-cart-label{opacity:0}.edd-add-to-cart[data-edd-loading] .edd-loading,.edd-discount-loader.edd-loading{opacity:1}.edd-cart-added-alert{color:#567622;display:block;position:absolute}.edd_form input.edd-input.required,.edd_form select.edd-select.required{color:#000}body.edd_receipt_page{background-color:#fff;color:#141412;margin:0;font-family:Helvetica,sans-serif;font-size:12px}body.edd_receipt_page:before{position:relative}body.edd_receipt_page #edd_receipt_wrapper{width:660px;margin:0 auto;padding:50px 0}body.edd_receipt_page table{display:table;width:100%;border-bottom:1px solid #ededed;border-collapse:collapse;border-spacing:0;font-size:14px;line-height:2;margin:0 0 20px}body.edd_receipt_page td,body.edd_receipt_page th{display:table-cell;text-align:left;border-top:1px solid #ededed;padding:6px 10px;font-weight:400}body.edd_receipt_page th{font-weight:700;text-transform:uppercase}body.edd_receipt_page h3{font-size:22px;margin:40px 0 5px;clear:both;display:block;font-weight:700}body.edd_receipt_page li{list-style:none}table#edd_purchase_receipt,table#edd_purchase_receipt_products{width:100%}table#edd_purchase_receipt td,table#edd_purchase_receipt th,table#edd_purchase_receipt_products td,table#edd_purchase_receipt_products th{text-align:left}table#edd_purchase_receipt .edd_receipt_payment_status.cancelled,table#edd_purchase_receipt .edd_receipt_payment_status.failed,table#edd_purchase_receipt .edd_receipt_payment_status.pending,table#edd_purchase_receipt .edd_receipt_payment_status.revoked{color:#f73f2e}table#edd_purchase_receipt_products li{list-style:none;margin:0 0 8px 10px}table#edd_purchase_receipt ul,table#edd_purchase_receipt_products ul.edd_purchase_receipt_files{margin:0;padding:0}table#edd_purchase_receipt li.edd_download_file{list-style:none;margin:0 0 8px 0}table#edd_purchase_receipt_products .edd_purchase_receipt_product_notes{font-style:italic}table#edd_purchase_receipt_products .edd_purchase_receipt_product_name{font-weight:700}table#edd_purchase_receipt_products .edd_bundled_product_name{font-style:italic;font-weight:700}#edd_user_history{text-align:left;width:100%;border-top:1px solid #f0f0f0;border-bottom:none}#edd_user_history td,#edd_user_history th{text-align:left;padding:3px 5px;border-bottom:1px solid #f0f0f0;border-top:none}#edd_user_history th{font-weight:700;background:#f5f5f5}#edd_user_history td{line-height:25px;vertical-align:middle}#edd_user_history .edd_purchase_status.cancelled,#edd_user_history .edd_purchase_status.failed,#edd_user_history .edd_purchase_status.pending,#edd_user_history .edd_purchase_status.revoked{color:#f73f2e}#edd_login_form legend,#edd_register_form legend{font-size:120%;margin-bottom:1em}#edd_login_form fieldset,#edd_register_form fieldset{border:none}#edd_login_form .edd-input,#edd_register_form .edd-input{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#edd_login_form label,#edd_register_form label{cursor:pointer}#edd_profile_editor_form p{margin-bottom:8px}#edd_profile_editor_form label{display:inline-block}#edd_profile_editor_form .edd-profile-emails{list-style-type:none;display:inline-table;margin-left:0;margin-bottom:0}#edd_profile_editor_form .edd-profile-email{width:auto}#edd_profile_editor_form .edd-profile-email .actions{display:none}#edd_profile_editor_form .edd-profile-email:hover>span{display:inline-block}.edd_added_to_cart_alert{padding:5px;font-size:14px;border:1px solid #046a9e;background:#9ecce2;color:#333;margin:8px 0}.edd_added_to_cart_alert a.edd_alert_checkout_link{color:#000!important}input.edd_submit_plain{background:0 0!important;border:none!important;padding:0!important;display:inline;cursor:pointer}.single-download .edd_download_purchase_form{margin-bottom:1.387em}.edd_download_purchase_form .edd_download_quantity_wrapper{margin:0 0 .5em}.edd_download_purchase_form .edd_download_quantity_wrapper .edd-item-quantity{width:75px}.edd_download_purchase_form .edd_price_options{margin:0 0 15px}.edd_download_purchase_form .edd_price_options ul{margin:0;padding:0;list-style:none}.edd_download_purchase_form .edd_price_options li{display:block;padding:0;margin:0}.edd_download_purchase_form .edd_price_options span{display:inline;padding:0;margin:0}.edd_download_purchase_form .edd_price_options .edd_download_quantity_wrapper{padding-left:18px}.edd_download_purchase_form .edd_price_options .edd_download_quantity_wrapper *{font-size:80%}.edd_download_purchase_form .edd_price_options input.edd-item-quantity{display:inline;width:50px;max-width:90%}#edd-purchase-button,.edd-submit,[type=submit].edd-submit{display:inline-block;padding:6px 12px;margin:0;font-size:14px;font-weight:400;line-height:1.428571429;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.edd-submit.button:focus,[type=submit].edd-submit:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.edd-submit.button:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.edd-submit.plain{padding:0;border:none;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.edd-submit.button,.edd-submit.button.gray,.edd-submit.button:visited{color:#333;background:#f0f0f0;border-color:#ccc}.edd-submit.button.gray:active,.edd-submit.button.gray:focus,.edd-submit.button.gray:hover,.edd-submit.button:active,.edd-submit.button:focus,.edd-submit.button:hover{color:#333;background:#ebebeb;border-color:#adadad}.edd-submit.button.gray:active{background-image:none}.edd-submit.button.white{color:#333;background:#fff;border-color:#ccc}.edd-submit.button.white:active,.edd-submit.button.white:focus,.edd-submit.button.white:hover{color:#333;background:#ebebeb;border-color:#adadad}.edd-submit.button.white:active{background-image:none}.edd-submit.button.blue{color:#fff;background:#428bca;border-color:#357ebd}.edd-submit.button.blue.active,.edd-submit.button.blue:focus,.edd-submit.button.blue:hover{color:#fff;background:#3276b1;border-color:#285e8e}.edd-submit.button.blue.active{background-image:none}.edd-submit.button.red{color:#fff;background:#d9534f;border-color:#d43f3a}.edd-submit.button.red:active,.edd-submit.button.red:focus,.edd-submit.button.red:hover{color:#fff;background:#d2322d;border-color:#ac2925}.edd-submit.button.red:active{background-image:none}.edd-submit.button.green{color:#fff;background:#5cb85c;border-color:#4cae4c}.edd-submit.button.green:active,.edd-submit.button.green:focus,.edd-submit.button.green:hover{color:#fff;background:#47a447;border-color:#398439}.edd-submit.button.green:active{background-image:none}.edd-submit.button.yellow{color:#fff;background:#f0ad4e;border-color:#eea236}.edd-submit.button.yellow:active,.edd-submit.button.yellow:focus,.edd-submit.button.yellow:hover{color:#fff;background:#ed9c28;border-color:#d58512}.edd-submit.button.yellow:active{background-image:none}.edd-submit.button.orange{color:#fff;background:#ed9c28;border-color:#e3921e}.edd-submit.button.orange:active,.edd-submit.button.orange:focus,.edd-submit.button.orange:hover{color:#fff;background:#e59016;border-color:#d58512}.edd-submit.button.orange:active{background-image:none}.edd-submit.button.dark-gray{color:#fff;background:#363636;border-color:#222}.edd-submit.button.dark-gray:active,.edd-submit.button.dark-gray:focus,.edd-submit.button.dark-gray:hover{color:#fff;background:#333;border-color:#adadad}.edd-submit.button.dark-gray:active{background-image:none}.edd_downloads_list:after{content:"";display:table;clear:both}.edd_download{float:left}.edd_download_columns_1 .edd_download{width:100%}.edd_download_columns_2 .edd_download{width:50%}.edd_download_columns_0 .edd_download,.edd_download_columns_3 .edd_download{width:33%}.edd_download_columns_4 .edd_download{width:25%}.edd_download_columns_5 .edd_download{width:20%}.edd_download_columns_6 .edd_download{width:16.6%}.edd_download_inner{padding:0 8px 8px;margin:0 0 10px}.edd_download_columns_2 .edd_download:nth-child(2n+1),.edd_download_columns_3 .edd_download:nth-child(3n+1),.edd_download_columns_4 .edd_download:nth-child(4n+1),.edd_download_columns_5 .edd_download:nth-child(5n+1),.edd_download_columns_6 .edd_download:nth-child(6n+1){clear:left}.edd_download_image{max-width:100%}.edd_download .edd_price{margin-bottom:10px}.edd-hide-on-empty.cart-empty{display:none}edd-hide-on-empty.cart-not.empty{display:block}.edd-cart-ajax{margin:0 8px 0 4px;position:relative;top:2px;background:0 0;border:none;padding:0}.edd-cart-number-of-items{font-style:italic;color:grey}.edd-cart-meta.edd_subtotal{font-weight:700;font-style:italic}.edd-cart-meta.edd_cart_tax{font-size:1em;font-style:italic}.edd-cart-meta.edd_cart_tax::before{font-style:normal}.edd-cart-meta.edd_total{font-weight:700}.edd-cart-meta{padding:2px 5px}.edd-cart-meta.edd_subtotal,.edd-cart-meta.edd_total{background-color:#f9f9f9}.edd_errors:not(.edd-alert){-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;border:1px solid #e6db55;margin:0 0 21px;background:#ffffe0;color:#333}.edd_error{padding:10px}p.edd_error{margin:0!important}.edd_success:not(.edd-alert){-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;border:1px solid #b3ce89;margin:20px 0;background:#d5eab3;color:#567622;padding:6px 8px;box-shadow:inset 0 1px 0 rgba(255,255,255,.7)}.edd-alert{-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;margin-bottom:20px;padding:10px;border:1px solid transparent;vertical-align:middle}.edd-alert p{padding:0}.edd-alert p:not(:last-child){margin-bottom:5px}.edd-alert p:last-child{margin-bottom:0}.edd-alert-error{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.edd-alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d}.edd-alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.edd-alert-warn{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}
templates/fonts/check.svg CHANGED
@@ -1,4 +1 @@
1
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
2
- <svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28">
3
- <path d="M26.11 8.844c0 .39-.157.78-.44 1.062L12.234 23.344c-.28.28-.672.438-1.062.438s-.78-.156-1.06-.438l-7.782-7.78c-.28-.282-.438-.673-.438-1.063s.156-.78.438-1.06l2.125-2.126c.28-.28.672-.438 1.062-.438s.78.156 1.062.438l4.594 4.61L21.42 5.656c.282-.28.673-.438 1.063-.438s.78.155 1.062.437l2.125 2.125c.28.28.438.672.438 1.062z"/>
4
- </svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"><path d="M26.11 8.844c0 .39-.157.78-.44 1.062L12.234 23.344a1.506 1.506 0 0 1-2.122 0l-7.782-7.78a1.506 1.506 0 0 1 0-2.123l2.125-2.126c.28-.28.672-.438 1.062-.438s.78.156 1.062.438l4.594 4.61L21.42 5.656a1.513 1.513 0 0 1 2.125-.001L25.67 7.78c.28.28.438.672.438 1.062z"/></svg>
 
 
 
templates/fonts/lock.svg CHANGED
@@ -1,4 +1 @@
1
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
2
- <svg xmlns="http://www.w3.org/2000/svg" width="18" height="28" viewBox="0 0 18 28">
3
- <path d="M5 12h8V9c0-2.203-1.797-4-4-4S5 6.797 5 9v3zm13 1.5v9c0 .828-.672 1.5-1.5 1.5h-15C.672 24 0 23.328 0 22.5v-9c0-.828.672-1.5 1.5-1.5H2V9c0-3.844 3.156-7 7-7s7 3.156 7 7v3h.5c.828 0 1.5.672 1.5 1.5z"/>
4
- </svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="28"><path d="M5 12h8V9c0-2.203-1.797-4-4-4S5 6.797 5 9v3zm13 1.5v9a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 0 22.5v-9A1.5 1.5 0 0 1 1.5 12H2V9c0-3.844 3.156-7 7-7s7 3.156 7 7v3h.5a1.5 1.5 0 0 1 1.5 1.5z"/></svg>
 
 
 
templates/images/icons/amazon.png CHANGED
Binary file
templates/images/icons/americanexpress.png CHANGED
Binary file
templates/images/icons/discover.png CHANGED
Binary file
templates/images/icons/iphone.png CHANGED
Binary file
templates/images/icons/mastercard.png CHANGED
Binary file
templates/images/icons/paypal.png CHANGED
Binary file
templates/images/icons/visa.png CHANGED
Binary file
templates/images/loading.gif CHANGED
Binary file
templates/images/tick.png CHANGED
Binary file
templates/images/xit.gif CHANGED
Binary file