php artisan ninja:update-key
',
'charge_late_fee' => 'Charge Late Fee',
'late_fee_amount' => 'Late Fee Amount',
@@ -2521,7 +2511,6 @@ $LANG = array(
'videos' => 'Videos',
'video' => 'Video',
'return_to_invoice' => 'Return to Invoice',
- 'gateway_help_13' => 'To use ITN leave the PDT Key field blank.',
'partial_due_date' => 'Partial Due Date',
'task_fields' => 'Task Fields',
'product_fields_help' => 'Drag and drop fields to change their order',
@@ -4677,7 +4666,6 @@ $LANG = array(
'vat' => 'VAT',
'view_map' => 'View Map',
'set_default_design' => 'Set Default Design',
- 'add_gateway_help_message' => 'Add a payment gateway (ie. Stripe, WePay or PayPal) to accept online payments',
'purchase_order_issued_to' => 'Purchase Order issued to',
'archive_task_status' => 'Archive Task Status',
'delete_task_status' => 'Delete Task Status',
@@ -5095,6 +5083,18 @@ $LANG = array(
'total_invoices_outstanding' => 'Total Invoices Outstanding',
'recent_activity' => 'Recent Activity',
'enable_auto_bill' => 'Enable auto billing',
+ 'email_count_invoices' => 'Email :count invoices',
+ 'invoice_task_item_description' => 'Invoice Task Item Description',
+ 'invoice_task_item_description_help' => 'Add the item description to the invoice line items',
+ 'next_send_time' => 'Next Send Time',
+ 'uploaded_certificate' => 'Successfully uploaded certificate',
+ 'certificate_set' => 'Certificate set',
+ 'certificate_not_set' => 'Certificate not set',
+ 'passphrase_set' => 'Passphrase set',
+ 'passphrase_not_set' => 'Passphrase not set',
+ 'upload_certificate' => 'Upload Certificate',
+ 'certificate_passphrase' => 'Certificate Passphrase',
+ 'valid_vat_number' => 'Valid VAT Number',
);
diff --git a/lang/fr_CA/texts.php b/lang/fr_CA/texts.php
index 380a7c18a10c..3865d7950563 100644
--- a/lang/fr_CA/texts.php
+++ b/lang/fr_CA/texts.php
@@ -5078,9 +5078,18 @@ Lorsque les montant apparaîtront sur votre relevé, veuillez revenir sur cette
'e_invoice' => 'Facture électronique',
'light_dark_mode' => 'Mode clair/sombre',
'activities' => 'Activités',
+ 'recent_transactions' => "Voici les transations les plus récentes de votre entreprise:",
+ 'country_Palestine' => "Palestine",
+ 'country_Taiwan' => 'Taiwan',
+ 'duties' => 'Droits',
+ 'order_number' => 'Numéro de commande',
+ 'order_id' => 'Commande',
+ 'total_invoices_outstanding' => 'Total des factures impayées',
+ 'recent_activity' => 'Activité récente',
+ 'enable_auto_bill' => 'Activer l\'autofacturation',
);
return $LANG;
-?>
+?>
\ No newline at end of file
diff --git a/public/css/app.css b/public/css/app.css
index bbc8e3d4d330..e4f40b76c262 100644
--- a/public/css/app.css
+++ b/public/css/app.css
@@ -1,190901 +1,3 @@
-/* purgecss start ignore */
+/*! tailwindcss v2.2.19 | MIT License | https://tailwindcss.com*/
-/* ! tailwindcss v2.2.19 | MIT License | https://tailwindcss.com */
-
-/*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */
-
-/*
-Document
-========
-*/
-
-/**
-Use a better box model (opinionated).
-*/
-
-*,
-::before,
-::after {
- box-sizing: border-box;
-}
-
-/**
-Use a more readable tab size (opinionated).
-*/
-
-html {
- -moz-tab-size: 4;
- -o-tab-size: 4;
- tab-size: 4;
-}
-
-/**
-1. Correct the line height in all browsers.
-2. Prevent adjustments of font size after orientation changes in iOS.
-*/
-
-html {
- line-height: 1.15; /* 1 */
- -webkit-text-size-adjust: 100%; /* 2 */
-}
-
-/*
-Sections
-========
-*/
-
-/**
-Remove the margin in all browsers.
-*/
-
-body {
- margin: 0;
-}
-
-/**
-Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)
-*/
-
-body {
- font-family:
- system-ui,
- -apple-system, /* Firefox supports this but not yet `system-ui` */
- 'Segoe UI',
- Roboto,
- Helvetica,
- Arial,
- sans-serif,
- 'Apple Color Emoji',
- 'Segoe UI Emoji';
-}
-
-/*
-Grouping content
-================
-*/
-
-/**
-1. Add the correct height in Firefox.
-2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
-*/
-
-hr {
- height: 0; /* 1 */
- color: inherit; /* 2 */
-}
-
-/*
-Text-level semantics
-====================
-*/
-
-/**
-Add the correct text decoration in Chrome, Edge, and Safari.
-*/
-
-abbr[title] {
- -webkit-text-decoration: underline dotted;
- text-decoration: underline dotted;
-}
-
-/**
-Add the correct font weight in Edge and Safari.
-*/
-
-b,
-strong {
- font-weight: bolder;
-}
-
-/**
-1. Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)
-2. Correct the odd 'em' font sizing in all browsers.
-*/
-
-code,
-kbd,
-samp,
-pre {
- font-family:
- ui-monospace,
- SFMono-Regular,
- Consolas,
- 'Liberation Mono',
- Menlo,
- monospace; /* 1 */
- font-size: 1em; /* 2 */
-}
-
-/**
-Add the correct font size in all browsers.
-*/
-
-small {
- font-size: 80%;
-}
-
-/**
-Prevent 'sub' and 'sup' elements from affecting the line height in all browsers.
-*/
-
-sub,
-sup {
- font-size: 75%;
- line-height: 0;
- position: relative;
- vertical-align: baseline;
-}
-
-sub {
- bottom: -0.25em;
-}
-
-sup {
- top: -0.5em;
-}
-
-/*
-Tabular data
-============
-*/
-
-/**
-1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
-2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
-*/
-
-table {
- text-indent: 0; /* 1 */
- border-color: inherit; /* 2 */
-}
-
-/*
-Forms
-=====
-*/
-
-/**
-1. Change the font styles in all browsers.
-2. Remove the margin in Firefox and Safari.
-*/
-
-button,
-input,
-optgroup,
-select,
-textarea {
- font-family: inherit; /* 1 */
- font-size: 100%; /* 1 */
- line-height: 1.15; /* 1 */
- margin: 0; /* 2 */
-}
-
-/**
-Remove the inheritance of text transform in Edge and Firefox.
-1. Remove the inheritance of text transform in Firefox.
-*/
-
-button,
-select { /* 1 */
- text-transform: none;
-}
-
-/**
-Correct the inability to style clickable types in iOS and Safari.
-*/
-
-button,
-[type='button'],
-[type='reset'],
-[type='submit'] {
- -webkit-appearance: button;
-}
-
-/**
-Remove the inner border and padding in Firefox.
-*/
-
-::-moz-focus-inner {
- border-style: none;
- padding: 0;
-}
-
-/**
-Restore the focus styles unset by the previous rule.
-*/
-
-:-moz-focusring {
- outline: 1px dotted ButtonText;
-}
-
-/**
-Remove the additional ':invalid' styles in Firefox.
-See: https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737
-*/
-
-:-moz-ui-invalid {
- box-shadow: none;
-}
-
-/**
-Remove the padding so developers are not caught out when they zero out 'fieldset' elements in all browsers.
-*/
-
-legend {
- padding: 0;
-}
-
-/**
-Add the correct vertical alignment in Chrome and Firefox.
-*/
-
-progress {
- vertical-align: baseline;
-}
-
-/**
-Correct the cursor style of increment and decrement buttons in Safari.
-*/
-
-::-webkit-inner-spin-button,
-::-webkit-outer-spin-button {
- height: auto;
-}
-
-/**
-1. Correct the odd appearance in Chrome and Safari.
-2. Correct the outline style in Safari.
-*/
-
-[type='search'] {
- -webkit-appearance: textfield; /* 1 */
- outline-offset: -2px; /* 2 */
-}
-
-/**
-Remove the inner padding in Chrome and Safari on macOS.
-*/
-
-::-webkit-search-decoration {
- -webkit-appearance: none;
-}
-
-/**
-1. Correct the inability to style clickable types in iOS and Safari.
-2. Change font properties to 'inherit' in Safari.
-*/
-
-::-webkit-file-upload-button {
- -webkit-appearance: button; /* 1 */
- font: inherit; /* 2 */
-}
-
-/*
-Interactive
-===========
-*/
-
-/*
-Add the correct display in Chrome and Safari.
-*/
-
-summary {
- display: list-item;
-}
-
-/**
- * Manually forked from SUIT CSS Base: https://github.com/suitcss/base
- * A thin layer on top of normalize.css that provides a starting point more
- * suitable for web applications.
- */
-
-/**
- * Removes the default spacing and border for appropriate elements.
- */
-
-blockquote,
-dl,
-dd,
-h1,
-h2,
-h3,
-h4,
-h5,
-h6,
-hr,
-figure,
-p,
-pre {
- margin: 0;
-}
-
-button {
- background-color: transparent;
- background-image: none;
-}
-
-fieldset {
- margin: 0;
- padding: 0;
-}
-
-ol,
-ul {
- list-style: none;
- margin: 0;
- padding: 0;
-}
-
-/**
- * Tailwind custom reset styles
- */
-
-/**
- * 1. Use the user's configured `sans` font-family (with Tailwind's default
- * sans-serif font stack as a fallback) as a sane default.
- * 2. Use Tailwind's default "normal" line-height so the user isn't forced
- * to override it to ensure consistency even when using the default theme.
- */
-
-html {
- font-family: Open Sans, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 1 */
- line-height: 1.5; /* 2 */
-}
-
-/**
- * Inherit font-family and line-height from `html` so users can set them as
- * a class directly on the `html` element.
- */
-
-body {
- font-family: inherit;
- line-height: inherit;
-}
-
-/**
- * 1. Prevent padding and border from affecting element width.
- *
- * We used to set this in the html element and inherit from
- * the parent element for everything else. This caused issues
- * in shadow-dom-enhanced elements like " + response.messages.message[i].code + ": " + response.messages.message[i].text + "
"); - document.getElementById('card_button').disabled = false; - document.querySelector('#card_button > svg').classList.add('hidden'); - document.querySelector('#card_button > span').classList.remove('hidden'); - } else if (response.messages.resultCode === "Ok") { - document.getElementById("dataDescriptor").value = response.opaqueData.dataDescriptor; - document.getElementById("dataValue").value = response.opaqueData.dataValue; - document.getElementById("server_response").submit(); - } - return false; - } - }, { - key: "handle", - value: function handle() { - var _this = this; - this.cardButton.addEventListener("click", function () { - _this.cardButton.disabled = !_this.cardButton.disabled; - _this.handleAuthorization(); - }); - return this; - } - }]); - return AuthorizeAuthorizeCard; -}(); -var publicKey = document.querySelector('meta[name="authorize-public-key"]').content; -var loginId = document.querySelector('meta[name="authorize-login-id"]').content; - -/** @handle */ -new AuthorizeAuthorizeCard(publicKey, loginId).handle(); -/******/ })() -; \ No newline at end of file +/*! For license information please see authorize-authorize-card.js.LICENSE.txt */ +(()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,r){for(var n=0;n"+e.messages.message[0].code+": "+e.messages.message[0].text+"
"),document.getElementById("card_button").disabled=!1,document.querySelector("#card_button > svg").classList.add("hidden"),document.querySelector("#card_button > span").classList.remove("hidden")):"Ok"===e.messages.resultCode&&(document.getElementById("dataDescriptor").value=e.opaqueData.dataDescriptor,document.getElementById("dataValue").value=e.opaqueData.dataValue,document.getElementById("server_response").submit()),!1}},{key:"handle",value:function(){var e=this;return this.cardButton.addEventListener("click",(function(){e.cardButton.disabled=!e.cardButton.disabled,e.handleAuthorization()})),this}}])&&t(r.prototype,n),a&&t(r,a),Object.defineProperty(r,"prototype",{writable:!1}),e}();new r(document.querySelector('meta[name="authorize-public-key"]').content,document.querySelector('meta[name="authorize-login-id"]').content).handle()})(); \ No newline at end of file diff --git a/public/js/clients/payment_methods/authorize-checkout-card.js b/public/js/clients/payment_methods/authorize-checkout-card.js index 8e0a99f72f43..fdccb142a349 100644 --- a/public/js/clients/payment_methods/authorize-checkout-card.js +++ b/public/js/clients/payment_methods/authorize-checkout-card.js @@ -1,54 +1,2 @@ -/******/ (() => { // webpackBootstrap -var __webpack_exports__ = {}; -/*!*************************************************************************!*\ - !*** ./resources/js/clients/payment_methods/authorize-checkout-card.js ***! - \*************************************************************************/ -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -/** - * Invoice Ninja (https://invoiceninja.com). - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */ -var CheckoutCreditCardAuthorization = /*#__PURE__*/function () { - function CheckoutCreditCardAuthorization() { - _classCallCheck(this, CheckoutCreditCardAuthorization); - this.button = document.querySelector('#pay-button'); - } - _createClass(CheckoutCreditCardAuthorization, [{ - key: "init", - value: function init() { - this.frames = Frames.init(document.querySelector('meta[name=public-key]').content); - } - }, { - key: "handle", - value: function handle() { - var _this = this; - this.init(); - Frames.addEventHandler(Frames.Events.CARD_VALIDATION_CHANGED, function (event) { - _this.button.disabled = !Frames.isCardValid(); - }); - Frames.addEventHandler(Frames.Events.CARD_TOKENIZED, function (event) { - document.querySelector('input[name="gateway_response"]').value = JSON.stringify(event); - document.getElementById('server_response').submit(); - }); - document.querySelector('#authorization-form').addEventListener('submit', function (event) { - _this.button.disabled = true; - event.preventDefault(); - Frames.submitCard(); - }); - } - }]); - return CheckoutCreditCardAuthorization; -}(); -new CheckoutCreditCardAuthorization().handle(); -/******/ })() -; \ No newline at end of file +/*! For license information please see authorize-checkout-card.js.LICENSE.txt */ +(()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,n){for(var r=0;r" + response.messages.message[i].code + ": " + response.messages.message[i].text + "
"); - document.getElementById('pay-now').disabled = false; - document.querySelector('#pay-now > svg').classList.add('hidden'); - document.querySelector('#pay-now > span').classList.remove('hidden'); - } else if (response.messages.resultCode === "Ok") { - document.getElementById("dataDescriptor").value = response.opaqueData.dataDescriptor; - document.getElementById("dataValue").value = response.opaqueData.dataValue; - var storeCard = document.querySelector('input[name=token-billing-checkbox]:checked'); - if (storeCard) { - document.getElementById("store_card").value = storeCard.value; - } - document.getElementById("server_response").submit(); - } - return false; - }); - _defineProperty(this, "handle", function () { - Array.from(document.getElementsByClassName('toggle-payment-with-token')).forEach(function (element) { - return element.addEventListener('click', function (e) { - document.getElementById('save-card--container').style.display = 'none'; - document.getElementById('authorize--credit-card-container').style.display = 'none'; - document.getElementById('token').value = e.target.dataset.token; - }); - }); - var payWithCreditCardToggle = document.getElementById('toggle-payment-with-credit-card'); - if (payWithCreditCardToggle) { - payWithCreditCardToggle.addEventListener('click', function () { - document.getElementById('save-card--container').style.display = 'grid'; - document.getElementById('authorize--credit-card-container').style.display = 'flex'; - document.getElementById('token').value = null; - }); - } - var payNowButton = document.getElementById('pay-now'); - if (payNowButton) { - payNowButton.addEventListener('click', function (e) { - var token = document.getElementById('token'); - token.value ? _this.handlePayNowAction(token.value) : _this.handleAuthorization(); - }); - } - return _this; - }); - this.publicKey = publicKey; - this.loginId = loginId; - this.cardHolderName = document.getElementById("cardholder_name"); - } - _createClass(AuthorizeAuthorizeCard, [{ - key: "handlePayNowAction", - value: function handlePayNowAction(token_hashed_id) { - document.getElementById('pay-now').disabled = true; - document.querySelector('#pay-now > svg').classList.remove('hidden'); - document.querySelector('#pay-now > span').classList.add('hidden'); - document.getElementById("token").value = token_hashed_id; - document.getElementById("server_response").submit(); - } - }]); - return AuthorizeAuthorizeCard; -}(); -var publicKey = document.querySelector('meta[name="authorize-public-key"]').content; -var loginId = document.querySelector('meta[name="authorize-login-id"]').content; - -/** @handle */ -new AuthorizeAuthorizeCard(publicKey, loginId).handle(); -/******/ })() -; \ No newline at end of file +/*! For license information please see authorize-credit-card-payment.js.LICENSE.txt */ +(()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){for(var n=0;n"+e.messages.message[0].code+": "+e.messages.message[0].text+"
"),document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}else if("Ok"===e.messages.resultCode){document.getElementById("dataDescriptor").value=e.opaqueData.dataDescriptor,document.getElementById("dataValue").value=e.opaqueData.dataValue;var t=document.querySelector("input[name=token-billing-checkbox]:checked");t&&(document.getElementById("store_card").value=t.value),document.getElementById("server_response").submit()}return!1})),n(this,"handle",(function(){Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach((function(e){return e.addEventListener("click",(function(e){document.getElementById("save-card--container").style.display="none",document.getElementById("authorize--credit-card-container").style.display="none",document.getElementById("token").value=e.target.dataset.token}))}));var e=document.getElementById("toggle-payment-with-credit-card");e&&e.addEventListener("click",(function(){document.getElementById("save-card--container").style.display="grid",document.getElementById("authorize--credit-card-container").style.display="flex",document.getElementById("token").value=null}));var t=document.getElementById("pay-now");return t&&t.addEventListener("click",(function(e){var t=document.getElementById("token");t.value?a.handlePayNowAction(t.value):a.handleAuthorization()})),a})),this.publicKey=t,this.loginId=r,this.cardHolderName=document.getElementById("cardholder_name")}var r,a,o;return r=e,(a=[{key:"handlePayNowAction",value:function(e){document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),document.getElementById("token").value=e,document.getElementById("server_response").submit()}}])&&t(r.prototype,a),o&&t(r,o),Object.defineProperty(r,"prototype",{writable:!1}),e}();new a(document.querySelector('meta[name="authorize-public-key"]').content,document.querySelector('meta[name="authorize-login-id"]').content).handle()})(); \ No newline at end of file diff --git a/public/js/clients/payments/braintree-credit-card.js b/public/js/clients/payments/braintree-credit-card.js index 793b48d3e9e7..865b6e406275 100644 --- a/public/js/clients/payments/braintree-credit-card.js +++ b/public/js/clients/payments/braintree-credit-card.js @@ -1,138 +1,2 @@ -/******/ (() => { // webpackBootstrap -var __webpack_exports__ = {}; -/*!****************************************************************!*\ - !*** ./resources/js/clients/payments/braintree-credit-card.js ***! - \****************************************************************/ -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -/** - * Invoice Ninja (https://invoiceninja.com). - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */ -var BraintreeCreditCard = /*#__PURE__*/function () { - function BraintreeCreditCard() { - _classCallCheck(this, BraintreeCreditCard); - } - _createClass(BraintreeCreditCard, [{ - key: "initBraintreeDataCollector", - value: function initBraintreeDataCollector() { - window.braintree.client.create({ - authorization: document.querySelector('meta[name=client-token]').content - }, function (err, clientInstance) { - window.braintree.dataCollector.create({ - client: clientInstance, - paypal: true - }, function (err, dataCollectorInstance) { - if (err) { - return; - } - document.querySelector('input[name=client-data]').value = dataCollectorInstance.deviceData; - }); - }); - } - }, { - key: "mountBraintreePaymentWidget", - value: function mountBraintreePaymentWidget() { - window.braintree.dropin.create({ - authorization: document.querySelector('meta[name=client-token]').content, - container: '#dropin-container', - threeDSecure: document.querySelector('input[name=threeds_enable]').value.toLowerCase() === 'true' - }, this.handleCallback); - } - }, { - key: "handleCallback", - value: function handleCallback(error, dropinInstance) { - if (error) { - console.error(error); - return; - } - var payNow = document.getElementById('pay-now'); - params = JSON.parse(document.querySelector('input[name=threeds]').value); - payNow.addEventListener('click', function () { - dropinInstance.requestPaymentMethod({ - threeDSecure: { - challengeRequested: true, - amount: params.amount, - email: params.email, - billingAddress: { - givenName: params.billingAddress.givenName, - // ASCII-printable characters required, else will throw a validation error - surname: params.billingAddress.surname, - // ASCII-printable characters required, else will throw a validation error - phoneNumber: params.billingAddress.phoneNumber, - streetAddress: params.billingAddress.streetAddress, - extendedAddress: params.billingAddress.extendedAddress, - locality: params.billingAddress.locality, - region: params.billingAddress.region, - postalCode: params.billingAddress.postalCode, - countryCodeAlpha2: params.billingAddress.countryCodeAlpha2 - } - } - }, function (err, payload) { - if (err) { - console.log(err); - dropin.clearSelectedPaymentMethod(); - alert("There was a problem verifying this card, please contact your merchant"); - return; - } - if (document.querySelector('input[name=threeds_enable]').value === 'true' && !payload.liabilityShifted) { - console.log('Liability did not shift', payload); - alert("There was a problem verifying this card, please contact your merchant"); - return; - } - payNow.disabled = true; - payNow.querySelector('svg').classList.remove('hidden'); - payNow.querySelector('span').classList.add('hidden'); - document.querySelector('input[name=gateway_response]').value = JSON.stringify(payload); - var tokenBillingCheckbox = document.querySelector('input[name="token-billing-checkbox"]:checked'); - if (tokenBillingCheckbox) { - document.querySelector('input[name="store_card"]').value = tokenBillingCheckbox.value; - } - document.getElementById('server-response').submit(); - }); - }); - } - }, { - key: "handle", - value: function handle() { - this.initBraintreeDataCollector(); - this.mountBraintreePaymentWidget(); - Array.from(document.getElementsByClassName('toggle-payment-with-token')).forEach(function (element) { - return element.addEventListener('click', function (element) { - document.getElementById('dropin-container').classList.add('hidden'); - document.getElementById('save-card--container').style.display = 'none'; - document.querySelector('input[name=token]').value = element.target.dataset.token; - document.getElementById('pay-now-with-token').classList.remove('hidden'); - document.getElementById('pay-now').classList.add('hidden'); - }); - }); - document.getElementById('toggle-payment-with-credit-card').addEventListener('click', function (element) { - document.getElementById('dropin-container').classList.remove('hidden'); - document.getElementById('save-card--container').style.display = 'grid'; - document.querySelector('input[name=token]').value = ""; - document.getElementById('pay-now-with-token').classList.add('hidden'); - document.getElementById('pay-now').classList.remove('hidden'); - }); - var payNowWithToken = document.getElementById('pay-now-with-token'); - payNowWithToken.addEventListener('click', function (element) { - payNowWithToken.disabled = true; - payNowWithToken.querySelector('svg').classList.remove('hidden'); - payNowWithToken.querySelector('span').classList.add('hidden'); - document.getElementById('server-response').submit(); - }); - } - }]); - return BraintreeCreditCard; -}(); -new BraintreeCreditCard().handle(); -/******/ })() -; \ No newline at end of file +/*! For license information please see braintree-credit-card.js.LICENSE.txt */ +(()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,n){for(var r=0;r