diff --git a/CHANGELOG.md b/CHANGELOG.md index e06f7b4b..9c9db643 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,16 +2,43 @@ This file documents all notable changes made to ITFlow. +## [26.04] Stable Release +### Bug Fixes +- Racks: Fix Device Removal. +- Table Lists: replace class table-responsive-sm with just table-reponsive was causing ui issues with certain screen sizes. +- Client: Fix Edit erroring on certain characters. +- Category: Fix Add/Edit due to missing CSRF fields. +- Category: Fix Restore function and Icon and text color. +- Invoice: Do not apply late fee on first overdue reminder (1 day). +- Ticket: Fix issue with contact not being added with Add contact modal v1. +- Quote: Fix Copy was missing client. +- API: Don't set client ID from POST - this is properly done via require_post_method instead only if it's an all-clients key. +- API: Prevent error 500s when existing data can't be cleanly re-inserted to database. +- API: Add more helpful errors. +- API: Fix asset read uri_2 field. +- API: Various other field fixes. + +### New Features & Updates +- Categories: Add Description Field. +- Categories: Add DB Field for order. +- Categories: Move Asset Status and Network Interface Type to categories so custom ones can be created and edited. +- Categories: Moved note type, software type, rack type to be creatable/editable Categories with common defaults and descriptions +- Files: Allow .swb file for MikroTik Backup Files. +- Software: Added additonal License Types including Perpetual, Site, etc. +- API: Invoice Items: Add read endpoint. +- Networks: Added Import. +- Bump TinyMCE from 8.3.2 to 8.4.0. +- Bump stripe-php from 19.4.1 to 20.0.0. + ## [26.03] Stable Release ### Bug Fixes -- Ticket Templates: Fix Task Sorting. +- Ticket Templates: Fix Task Sortinhahahg. - Ticket: Lower autoclose setting minimum value from 48 to 24 Hours. - Ticket: Fix Task Approval. - Recurring Ticket: add empty value placeholder for Ticket Frequency. - Documents/Files: Fix redirect after File Upload to redirect to files instead of the non existent documents. - Setup: Fix base url tacking on /setup when not installing via script. - ### New Features & Updates - Clients: Net Terms: Added common 45 and 15 Days, removed 14 Days not as common. - Clients: Bulk Action Set Net Terms Added. diff --git a/admin/category.php b/admin/category.php index 7613c9af..16bca100 100644 --- a/admin/category.php +++ b/admin/category.php @@ -28,14 +28,14 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));

- Categories + Categories

+ class="fas fa-plus mr-2">New Category
" - placeholder="Search Categories "> + placeholder="Search Categories ">
@@ -83,6 +83,36 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); } else { echo 'btn-default'; } ?>">Ticket + Network Interface + Asset Status + Software Type + Rack Type + Contact Note Type @@ -122,6 +153,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); +
@@ -134,9 +166,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); - - Restore + Restore diff --git a/admin/database_updates.php b/admin/database_updates.php index 86d0a061..c4e8d115 100644 --- a/admin/database_updates.php +++ b/admin/database_updates.php @@ -4334,11 +4334,70 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) { mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.4.2'"); } - // - // // if (CURRENT_DATABASE_VERSION == '2.4.2') { - // // Insert queries here required to update to DB version 2.4.3 + + if (CURRENT_DATABASE_VERSION == '2.4.2') { + + mysqli_query($mysqli, "ALTER TABLE `categories` ADD `category_description` VARCHAR(255) DEFAULT NULL AFTER `category_name`"); + mysqli_query($mysqli, "ALTER TABLE `categories` ADD `category_order` INT(11) NOT NULL DEFAULT 0 AFTER `category_icon`"); + + // Create network_interfaces + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'Ethernet', category_type = 'network_interface', category_order = 1"); // 1 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'SFP', category_type = 'network_interface', category_order = 2"); // 2 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'SFP+', category_type = 'network_interface', category_order = 3"); // 3 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'QSFP28', category_type = 'network_interface', category_order = 4"); // 4 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'QSFP-DD', category_type = 'network_interface', category_order = 5"); // 5 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'Coaxial', category_type = 'network_interface', category_order = 6"); // 6 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'Fiber', category_type = 'network_interface', category_order = 7"); // 7 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'WiFi', category_type = 'network_interface', category_order = 8"); // 8 + + + + mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.4.3'"); + } + + if (CURRENT_DATABASE_VERSION == '2.4.3') { + // Asset Status + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'Ready to Deploy', category_description = 'Asset is configured and ready to be assigned', category_type = 'asset_status', category_order = 1"); // 1 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'Deployed', category_description = 'Asset is actively in use and assigned to a client or location', category_type = 'asset_status', category_order = 2"); // 2 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'Out for Repair', category_description = 'Asset has been sent out for servicing or repair', category_type = 'asset_status', category_order = 3"); // 3 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'Lost', category_description = 'Asset location is unknown and cannot be accounted for', category_type = 'asset_status', category_order = 4"); // 4 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'Stolen', category_description = 'Asset has been reported stolen', category_type = 'asset_status', category_order = 5"); // 5 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'Retired', category_description = 'Asset has been decommissioned and is no longer in service', category_type = 'asset_status', category_order = 6"); // 6 + + // Contact note types + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'Call', category_description = 'Phone call with a client or contact', category_icon = 'fa-phone-alt', category_type = 'contact_note_type', category_order = 1"); // 1 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'Email', category_description = 'Email correspondence with a client or contact', category_icon = 'fa-envelope', category_type = 'contact_note_type', category_order = 2"); // 2 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'Meeting', category_description = 'Scheduled meeting with a client or contact', category_icon = 'fa-handshake', category_type = 'contact_note_type', category_order = 3"); // 3 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'In Person', category_description = 'In person visit or on-site interaction', category_icon = 'fa-people-arrows', category_type = 'contact_note_type', category_order = 4"); // 4 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'Note', category_description = 'General note or internal comment', category_icon = 'fa-sticky-note', category_type = 'contact_note_type', category_order = 5"); // 5 + + // Rack Types + mysqli_query($mysqli, "INSERT INTO categories SET category_name = '2-Post Open Frame', category_description = 'Two-post open frame rack for patch panels and lightweight equipment', category_type = 'rack_type', category_order = 1"); // 1 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = '4-Post Open Frame', category_description = 'Four-post open frame rack for servers and heavier equipment', category_type = 'rack_type', category_order = 2"); // 2 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = '4-Post Enclosed Cabinet', category_description = 'Four-post enclosed cabinet with doors and sides for secure equipment housing', category_type = 'rack_type', category_order = 3"); // 3 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'Wall-Mount Open', category_description = 'Open frame rack mounted directly to a wall for small deployments', category_type = 'rack_type', category_order = 4"); // 4 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'Wall-Mount Enclosed', category_description = 'Enclosed cabinet rack mounted to a wall with a locking door', category_type = 'rack_type', category_order = 5"); // 5 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'Other', category_description = 'Rack type does not fit any standard category', category_type = 'rack_type', category_order = 6"); // 6 + + // Software Types + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'Software as a Service (SaaS)', category_description = 'Cloud-hosted software accessed via a web browser or API', category_type = 'software_type', category_order = 1"); // 1 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'Productivity Suite', category_description = 'Bundled office and collaboration tools such as Microsoft 365 or Google Workspace', category_type = 'software_type', category_order = 2"); // 2 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'Web Application', category_description = 'Application hosted on a web server and accessed through a browser', category_type = 'software_type', category_order = 3"); // 3 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'Desktop Application', category_description = 'Application installed and run locally on a workstation or laptop', category_type = 'software_type', category_order = 4"); // 4 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'Mobile Application', category_description = 'Application installed and run on a mobile device or tablet', category_type = 'software_type', category_order = 5"); // 5 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'Security Software', category_description = 'Software providing antivirus, endpoint protection, or security monitoring', category_type = 'software_type', category_order = 6"); // 6 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'System Software', category_description = 'Low-level software managing hardware resources and system operations', category_type = 'software_type', category_order = 7"); // 7 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'Operating System', category_description = 'Core software managing hardware and providing a platform for applications', category_type = 'software_type', category_order = 8"); // 8 + mysqli_query($mysqli, "INSERT INTO categories SET category_name = 'Other', category_description = 'Software type does not fit any standard category', category_type = 'software_type', category_order = 9"); // 9 + + mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.4.4'"); + + } + + // if (CURRENT_DATABASE_VERSION == '2.4.4') { + // // Insert queries here required to update to DB version 2.4.5 // // Then, update the database to the next sequential version - // mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.4.3'"); + // mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.4.5'"); // } } else { diff --git a/admin/modals/category/category_add.php b/admin/modals/category/category_add.php index 8fa6ac74..d4b5715c 100644 --- a/admin/modals/category/category_add.php +++ b/admin/modals/category/category_add.php @@ -9,12 +9,13 @@ $category_types_array = ['Expense', 'Income', 'Referral', 'Ticket']; ?>
+
+
+ +
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+
+ + diff --git a/admin/post/category.php b/admin/post/category.php index 2a0f11bb..0a6bccf7 100644 --- a/admin/post/category.php +++ b/admin/post/category.php @@ -12,7 +12,7 @@ if (isset($_POST['add_category'])) { require_once 'category_model.php'; - mysqli_query($mysqli,"INSERT INTO categories SET category_name = '$name', category_type = '$type', category_color = '$color'"); + mysqli_query($mysqli,"INSERT INTO categories SET category_name = '$name', category_description = '$description', category_type = '$type', category_color = '$color'"); $category_id = mysqli_insert_id($mysqli); @@ -32,7 +32,7 @@ if (isset($_POST['edit_category'])) { $category_id = intval($_POST['category_id']); - mysqli_query($mysqli,"UPDATE categories SET category_name = '$name', category_type = '$type', category_color = '$color' WHERE category_id = $category_id"); + mysqli_query($mysqli,"UPDATE categories SET category_name = '$name', category_description = '$description', category_type = '$type', category_color = '$color' WHERE category_id = $category_id"); logAction("Category", "Edit", "$session_name edited category $type $name", 0, $category_id); @@ -68,7 +68,7 @@ if (isset($_GET['restore_category'])) { validateCSRFToken($_GET['csrf_token']); - $category_id = intval($_GET['retore_category']); + $category_id = intval($_GET['restore_category']); // Get Category Name and Type for logging $sql = mysqli_query($mysqli,"SELECT category_name, category_type FROM categories WHERE category_id = $category_id"); diff --git a/admin/post/category_model.php b/admin/post/category_model.php index 81b54a39..30268bce 100644 --- a/admin/post/category_model.php +++ b/admin/post/category_model.php @@ -2,5 +2,6 @@ defined('FROM_POST_HANDLER') || die("Direct file access is not allowed"); $name = sanitizeInput($_POST['name']); +$description = sanitizeInput($_POST['description']); $type = sanitizeInput($_POST['type']); $color = sanitizeInput($_POST['color']); diff --git a/admin/settings_default.php b/admin/settings_default.php index 4b7b942c..bb96bf7b 100644 --- a/admin/settings_default.php +++ b/admin/settings_default.php @@ -1,7 +1,25 @@ + +$start_page_select_array = array ( + 'dashboard.php'=>'Dashboard', + 'clients.php'=> 'Client Management', + 'tickets.php'=> 'Support Tickets', + 'invoices.php' => 'Invoices' +); + +$net_terms_array = array ( + '0'=>'On Receipt', + '7'=>'7 Days', + '10'=>'10 Days', + '15'=>'15 Days', + '30'=>'30 Days', + '45'=>'45 Days', + '60'=>'60 Days', + '90'=>'90 Days' +); + +?>
diff --git a/admin/settings_theme.php b/admin/settings_theme.php index 80957ff1..6e5cc6a5 100644 --- a/admin/settings_theme.php +++ b/admin/settings_theme.php @@ -1,68 +1,90 @@ -
-
-

Theme

-
-
+ +
-
+
"> diff --git a/agent/certificates.php b/agent/certificates.php index bbeb4773..db65cc03 100644 --- a/agent/certificates.php +++ b/agent/certificates.php @@ -148,7 +148,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
-
+
diff --git a/agent/clients.php b/agent/clients.php index f7a8e0c9..e5a0dea3 100644 --- a/agent/clients.php +++ b/agent/clients.php @@ -444,7 +444,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); } $client_tag_id_array[] = $client_tag_id; - $client_tag_name_display_array[] = "$client_tag_name"; + $client_tag_name_display_array[] = "$client_tag_name"; } $client_tags_display = implode('', $client_tag_name_display_array); @@ -512,10 +512,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
-
+
- +
'fa-phone-alt', + 'Email'=>'fa-envelope', + 'Meeting'=>'fa-handshake', + 'In Person'=>'fa-people-arrows', + 'Note'=>'fa-sticky-note' + ); + while ($row = mysqli_fetch_assoc($sql_related_notes)) { $contact_note_id = intval($row['contact_note_id']); $contact_note_type = nullable_htmlentities($row['contact_note_type']); diff --git a/agent/contacts.php b/agent/contacts.php index 73eacde9..40e9630a 100644 --- a/agent/contacts.php +++ b/agent/contacts.php @@ -288,7 +288,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); -
+
diff --git a/agent/contact_details.php b/agent/contact_details.php index 85256291..0eee557e 100644 --- a/agent/contact_details.php +++ b/agent/contact_details.php @@ -1101,6 +1101,14 @@ if (isset($_GET['contact_id'])) {
"> diff --git a/agent/credentials.php b/agent/credentials.php index 5ec6a538..4762ecf0 100644 --- a/agent/credentials.php +++ b/agent/credentials.php @@ -276,7 +276,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); -
+
text-nowrap"> diff --git a/agent/domains.php b/agent/domains.php index 926b5034..b3e49292 100644 --- a/agent/domains.php +++ b/agent/domains.php @@ -172,7 +172,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
-
+
diff --git a/agent/expenses.php b/agent/expenses.php index 2403b438..f0fa8023 100644 --- a/agent/expenses.php +++ b/agent/expenses.php @@ -202,7 +202,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
-
+
"> diff --git a/agent/invoices.php b/agent/invoices.php index 7a7d1009..17466994 100644 --- a/agent/invoices.php +++ b/agent/invoices.php @@ -257,7 +257,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
-
+
text-nowrap"> diff --git a/agent/locations.php b/agent/locations.php index 164dba37..bd91d70f 100644 --- a/agent/locations.php +++ b/agent/locations.php @@ -216,7 +216,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); -
+
"> diff --git a/agent/modals/asset/asset_add.php b/agent/modals/asset/asset_add.php index bd4dcaac..2bc7bf00 100644 --- a/agent/modals/asset/asset_add.php +++ b/agent/modals/asset/asset_add.php @@ -258,8 +258,17 @@ ob_start(); diff --git a/agent/modals/asset/asset_bulk_edit_status.php b/agent/modals/asset/asset_bulk_edit_status.php index 2e6407f6..6cbca8bd 100644 --- a/agent/modals/asset/asset_bulk_edit_status.php +++ b/agent/modals/asset/asset_bulk_edit_status.php @@ -26,12 +26,21 @@ ob_start();
- +
diff --git a/agent/modals/asset/asset_copy.php b/agent/modals/asset/asset_copy.php index 9b903f12..a02653a9 100644 --- a/agent/modals/asset/asset_copy.php +++ b/agent/modals/asset/asset_copy.php @@ -228,8 +228,20 @@ ob_start(); diff --git a/agent/modals/asset/asset_edit.php b/agent/modals/asset/asset_edit.php index 6d2cccc8..78cc4e37 100644 --- a/agent/modals/asset/asset_edit.php +++ b/agent/modals/asset/asset_edit.php @@ -270,8 +270,20 @@ ob_start(); diff --git a/agent/modals/asset/asset_interface_add.php b/agent/modals/asset/asset_interface_add.php index 468db9d2..8b939895 100644 --- a/agent/modals/asset/asset_interface_add.php +++ b/agent/modals/asset/asset_interface_add.php @@ -57,15 +57,24 @@ ob_start();
- +
diff --git a/agent/modals/asset/asset_interface_bulk_edit_type.php b/agent/modals/asset/asset_interface_bulk_edit_type.php index 7796b956..575d428a 100644 --- a/agent/modals/asset/asset_interface_bulk_edit_type.php +++ b/agent/modals/asset/asset_interface_bulk_edit_type.php @@ -24,16 +24,26 @@ ob_start();
diff --git a/agent/modals/software/software_edit.php b/agent/modals/software/software_edit.php index 401d71f6..384e1cef 100644 --- a/agent/modals/software/software_edit.php +++ b/agent/modals/software/software_edit.php @@ -41,9 +41,20 @@ while ($row = mysqli_fetch_assoc($contact_licenses_sql)) { } $contact_licenses = implode(',', $contact_licenses_array); -// Generate the HTML form content using output buffering. +$license_types_array = array ( + 'Device', + 'User', + 'Site', + 'Concurrent', + 'Trial', + 'Perpetual', + 'Usage-based' +); + ob_start(); + ?> + diff --git a/agent/modals/ticket/ticket_add.php b/agent/modals/ticket/ticket_add.php index 0d1f3395..9b683c34 100644 --- a/agent/modals/ticket/ticket_add.php +++ b/agent/modals/ticket/ticket_add.php @@ -247,7 +247,7 @@ ob_start();
-
- 0) { ?> - +
@@ -187,7 +193,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
-
+
diff --git a/agent/payments.php b/agent/payments.php index 936b03fe..30f294fd 100644 --- a/agent/payments.php +++ b/agent/payments.php @@ -138,7 +138,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));

-
+
text-nowrap"> diff --git a/agent/post/account.php b/agent/post/account.php index cd776049..9140d250 100644 --- a/agent/post/account.php +++ b/agent/post/account.php @@ -12,7 +12,6 @@ if (isset($_POST['add_account'])) { enforceUserPermission('module_financial', 2); - $name = sanitizeInput($_POST['name']); $opening_balance = floatval($_POST['opening_balance']); $currency_code = sanitizeInput($_POST['currency_code']); diff --git a/agent/post/client.php b/agent/post/client.php index 6eb859c2..90ec6ef5 100644 --- a/agent/post/client.php +++ b/agent/post/client.php @@ -8,6 +8,8 @@ defined('FROM_POST_HANDLER') || die("Direct file access is not allowed"); if (isset($_POST['add_client'])) { + // JQ - Using Prepared MySQLi Statements here for show this is not our standard and is only used in the client add/edit POST. + validateCSRFToken($_POST['csrf_token']); enforceUserPermission('module_client', 2); @@ -260,25 +262,63 @@ if (isset($_POST['edit_client'])) { $client_id = intval($_POST['client_id']); - mysqli_query($mysqli, "UPDATE clients SET client_name = '$name', client_type = '$type', client_website = '$website', client_referral = '$referral', client_rate = $rate, client_net_terms = $net_terms, client_tax_id_number = '$tax_id_number', client_lead = $lead, client_abbreviation = '$abbreviation', client_notes = '$notes' WHERE client_id = $client_id"); + // Update client using prepared statement + $query = mysqli_prepare( + $mysqli, + "UPDATE clients SET + client_name = ?, + client_type = ?, + client_website = ?, + client_referral = ?, + client_rate = ?, + client_net_terms = ?, + client_tax_id_number = ?, + client_lead = ?, + client_abbreviation = ?, + client_notes = ? + WHERE client_id = ?" + ); + mysqli_stmt_bind_param( + $query, + "ssssdisiisi", + $name, + $type, + $website, + $referral, + $rate, + $net_terms, + $tax_id_number, + $lead, + $abbreviation, + $notes, + $client_id + ); + mysqli_stmt_execute($query); - // Create Referral if it doesn't exist - $sql = mysqli_query($mysqli, "SELECT category_name FROM categories WHERE category_type = 'Referral' AND category_archived_at IS NULL AND category_name = '$referral'"); - if(mysqli_num_rows($sql) == 0) { - mysqli_query($mysqli, "INSERT INTO categories SET category_name = '$referral', category_type = 'Referral'"); + // Create referral category if it doesn't exist + $query = mysqli_prepare($mysqli, "SELECT category_name FROM categories WHERE category_type = 'Referral' AND category_archived_at IS NULL AND category_name = ?"); + mysqli_stmt_bind_param($query, "s", $referral); + mysqli_stmt_execute($query); + mysqli_stmt_store_result($query); + if (mysqli_stmt_num_rows($query) == 0) { + $query = mysqli_prepare($mysqli, "INSERT INTO categories SET category_name = ?, category_type = 'Referral'"); + mysqli_stmt_bind_param($query, "s", $referral); + mysqli_stmt_execute($query); logAction("Category", "Create", "$session_name created referral category $referral"); } - // Tags - // Delete existing tags - mysqli_query($mysqli, "DELETE FROM client_tags WHERE client_id = $client_id"); + // Tags - delete existing and re-insert + $query = mysqli_prepare($mysqli, "DELETE FROM client_tags WHERE client_id = ?"); + mysqli_stmt_bind_param($query, "i", $client_id); + mysqli_stmt_execute($query); - // Add new tags - if(isset($_POST['tags'])) { - foreach($_POST['tags'] as $tag) { + if (isset($_POST['tags'])) { + $query = mysqli_prepare($mysqli, "INSERT INTO client_tags SET client_id = ?, tag_id = ?"); + foreach ($_POST['tags'] as $tag) { $tag = intval($tag); - mysqli_query($mysqli, "INSERT INTO client_tags SET client_id = $client_id, tag_id = $tag"); + mysqli_stmt_bind_param($query, "ii", $client_id, $tag); + mysqli_stmt_execute($query); } } diff --git a/agent/post/file.php b/agent/post/file.php index 5eb8096b..483aae4a 100644 --- a/agent/post/file.php +++ b/agent/post/file.php @@ -33,7 +33,7 @@ if (isset($_POST['upload_files'])) { 'odt', 'csv', 'xls', 'xlsx', 'ods', 'pptx', 'odp', 'zip', 'tar', 'gz', 'msg', 'json', 'wav', 'mp3', 'ogg', 'mov', 'mp4', 'av1', 'ovpn', 'cfg', 'ps1', 'vsdx', 'drawio', 'pfx', 'pages', 'numbers', 'unf', 'unifi', - 'key', 'bat', 'stk' + 'key', 'bat', 'stk', 'swb' ]; // Loop through each uploaded file diff --git a/agent/post/network.php b/agent/post/network.php index 3b7e1b02..845ee440 100644 --- a/agent/post/network.php +++ b/agent/post/network.php @@ -188,7 +188,7 @@ if (isset($_POST['export_networks_csv'])) { $file_name_prepend = "$session_company_name-"; } - $sql = mysqli_query($mysqli,"SELECT * FROM networks LEFT JOIN client ON client_id = network_client_id WHERE network_archived_at IS NULL $client_query $access_permission_query ORDER BY network_name ASC"); + $sql = mysqli_query($mysqli,"SELECT * FROM networks LEFT JOIN clients ON client_id = network_client_id WHERE network_archived_at IS NULL $client_query $access_permission_query ORDER BY network_name ASC"); $num_rows = mysqli_num_rows($sql); @@ -227,3 +227,161 @@ if (isset($_POST['export_networks_csv'])) { exit; } + +// ============================================================ +// Add these two blocks to agent/post/network.php +// Place them alongside the existing export_networks_csv block. +// ============================================================ + +// ---------------------------------------------------------- +// CSV Template Download +// GET: post.php?download_networks_csv_template= +// ---------------------------------------------------------- +if (isset($_GET['download_networks_csv_template'])) { + + $delimiter = ","; + $enclosure = '"'; + $escape = '\\'; + $filename = "Networks-Template.csv"; + + $f = fopen('php://memory', 'w'); + + $fields = array('Name', 'Description', 'VLAN', 'Network (CIDR)', 'Gateway', 'IP Range', 'Primary DNS', 'Secondary DNS'); + fputcsv($f, $fields, $delimiter, $enclosure, $escape); + + // One example row so the user can see expected formatting + $example = array('Office LAN', 'Main office network', '10', '192.168.1.0/24', '192.168.1.1', '192.168.1.100-192.168.1.200', '8.8.8.8', '8.8.4.4'); + fputcsv($f, $example, $delimiter, $enclosure, $escape); + + fseek($f, 0); + + header('Content-Type: text/csv'); + header('Content-Disposition: attachment; filename="' . $filename . '";'); + + fpassthru($f); + exit; + +} + +// ---------------------------------------------------------- +// CSV Import +// POST: post.php (name="import_networks_csv") +// ---------------------------------------------------------- +if (isset($_POST['import_networks_csv'])) { + + validateCSRFToken($_POST['csrf_token']); + + enforceUserPermission('module_support', 2); + + $client_id = intval($_POST['client_id']); + + enforceClientAccess(); + + $error = false; + + // File provided? + if (!empty($_FILES['file']['tmp_name'])) { + $file_name = $_FILES['file']['tmp_name']; + } else { + flash_alert("Please select a file to upload.", 'error'); + redirect(); + } + + // Check extension + $file_extension = strtolower(end(explode('.', $_FILES['file']['name']))); + if ($file_extension !== 'csv') { + $error = true; + flash_alert("Bad file extension — only .csv files are accepted.", 'error'); + } + + // Check not empty + elseif ($_FILES['file']['size'] < 1) { + $error = true; + flash_alert("Bad file size (empty file?).", 'error'); + } + + // Check column count matches the 8-column export/template format + else { + $f = fopen($file_name, 'r'); + $f_columns = fgetcsv($f, 1000, ','); + fclose($f); + + if (count($f_columns) !== 8) { + $error = true; + flash_alert("Bad column count — expected 8 columns: Name, Description, VLAN, Network (CIDR), Gateway, IP Range, Primary DNS, Secondary DNS.", 'error'); + } + } + + // Parse and insert + if (!$error) { + $file = fopen($file_name, 'r'); + fgetcsv($file, 1000, ','); // Skip header row + + $row_count = 0; + $duplicate_count = 0; + + while (($column = fgetcsv($file, 1000, ',')) !== false) { + + $duplicate_detect = 0; + + $name = isset($column[0]) ? sanitizeInput($column[0]) : ''; + $description = isset($column[1]) ? sanitizeInput($column[1]) : ''; + $vlan = isset($column[2]) ? intval($column[2]) : 0; + $network = isset($column[3]) ? sanitizeInput($column[3]) : ''; + $gateway = isset($column[4]) ? sanitizeInput($column[4]) : ''; + $dhcp_range = isset($column[5]) ? sanitizeInput($column[5]) : ''; + $primary_dns = isset($column[6]) ? sanitizeInput($column[6]) : ''; + $secondary_dns = isset($column[7]) ? sanitizeInput($column[7]) : ''; + + // Skip rows with no name + if ($name === '') { + continue; + } + + // Duplicate check — same name + network address for this client + $dup_check = mysqli_query($mysqli, + "SELECT network_id FROM networks + WHERE network_name = '$name' + AND network = '$network' + AND network_client_id = $client_id + AND network_archived_at IS NULL + LIMIT 1" + ); + + if (mysqli_num_rows($dup_check) > 0) { + $duplicate_detect = 1; + } + + if ($duplicate_detect === 0) { + mysqli_query($mysqli, + "INSERT INTO networks SET + network_name = '$name', + network_description = '$description', + network_vlan = $vlan, + network = '$network', + network_gateway = '$gateway', + network_dhcp_range = '$dhcp_range', + network_primary_dns = '$primary_dns', + network_secondary_dns = '$secondary_dns', + network_client_id = $client_id" + ); + $row_count++; + } else { + $duplicate_count++; + } + } + + fclose($file); + + logAction("Network", "Import", "$session_name imported $row_count network(s). $duplicate_count duplicate(s) found and not imported", $client_id); + + flash_alert("$row_count Network(s) imported, $duplicate_count duplicate(s) detected and not imported"); + + redirect(); + } + + if ($error) { + redirect(); + } + +} diff --git a/agent/post/quote.php b/agent/post/quote.php index 346f91da..6d34d4a8 100644 --- a/agent/post/quote.php +++ b/agent/post/quote.php @@ -14,7 +14,7 @@ if (isset($_POST['add_quote'])) { require_once 'quote_model.php'; - $client_id = intval($_POST['client']); + $client_id = intval($_POST['client_id']); enforceClientAccess(); @@ -55,7 +55,7 @@ if (isset($_POST['add_quote_copy'])) { enforceUserPermission('module_sales', 2); $quote_id = intval($_POST['quote_id']); - $client_id = intval($_POST['client']); + $client_id = intval($_POST['client_id']); $date = sanitizeInput($_POST['date']); $expire = sanitizeInput($_POST['expire']); diff --git a/agent/post/rack.php b/agent/post/rack.php index 7b953f63..672c49a7 100644 --- a/agent/post/rack.php +++ b/agent/post/rack.php @@ -265,7 +265,7 @@ if (isset($_POST['edit_rack_unit'])) { if (isset($_GET['remove_rack_unit'])) { - validateCSRFToken($_POST['csrf_token']); + validateCSRFToken($_GET['csrf_token']); enforceUserPermission('module_support', 2); diff --git a/agent/products.php b/agent/products.php index a0fb9be8..2fed030f 100644 --- a/agent/products.php +++ b/agent/products.php @@ -169,7 +169,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
-
+
text-nowrap"> diff --git a/agent/project_details.php b/agent/project_details.php index bf74e708..2b8940e6 100644 --- a/agent/project_details.php +++ b/agent/project_details.php @@ -341,13 +341,13 @@ if (isset($_GET['project_id'])) {
-
+
- diff --git a/agent/projects.php b/agent/projects.php index d58ef67c..4809ea7d 100644 --- a/agent/projects.php +++ b/agent/projects.php @@ -108,7 +108,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
-
+
- +
@@ -494,7 +494,6 @@ if (isset($_GET['project_id'])) {
text-nowrap"> diff --git a/agent/quotes.php b/agent/quotes.php index f60658c3..f56a2e25 100644 --- a/agent/quotes.php +++ b/agent/quotes.php @@ -91,7 +91,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
-
+
text-nowrap"> diff --git a/agent/recurring_expenses.php b/agent/recurring_expenses.php index 27262add..54dc20c1 100644 --- a/agent/recurring_expenses.php +++ b/agent/recurring_expenses.php @@ -63,7 +63,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
-
+
"> diff --git a/agent/recurring_invoices.php b/agent/recurring_invoices.php index 44159909..32932b50 100644 --- a/agent/recurring_invoices.php +++ b/agent/recurring_invoices.php @@ -93,7 +93,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
-
+
text-nowrap"> diff --git a/agent/recurring_tickets.php b/agent/recurring_tickets.php index 74d76072..bfbec629 100644 --- a/agent/recurring_tickets.php +++ b/agent/recurring_tickets.php @@ -212,7 +212,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
-
+
diff --git a/agent/revenues.php b/agent/revenues.php index 67b7240b..2e429d4d 100644 --- a/agent/revenues.php +++ b/agent/revenues.php @@ -60,7 +60,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));

-
+
text-nowrap"> diff --git a/agent/services.php b/agent/services.php index fe542edc..82755085 100644 --- a/agent/services.php +++ b/agent/services.php @@ -110,7 +110,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
-
+
"> diff --git a/agent/software.php b/agent/software.php index 2c3bedad..d1ee865d 100644 --- a/agent/software.php +++ b/agent/software.php @@ -146,7 +146,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
-
+
text-nowrap"> diff --git a/agent/ticket_list.php b/agent/ticket_list.php index 2bab24e4..82775e5f 100644 --- a/agent/ticket_list.php +++ b/agent/ticket_list.php @@ -3,7 +3,7 @@ -
+
text-nowrap"> diff --git a/agent/transfers.php b/agent/transfers.php index 6d91576b..744b43d6 100644 --- a/agent/transfers.php +++ b/agent/transfers.php @@ -120,7 +120,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
-
+
text-nowrap"> diff --git a/agent/trips.php b/agent/trips.php index a2327c8d..bd63a48c 100644 --- a/agent/trips.php +++ b/agent/trips.php @@ -85,7 +85,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
-
+
"> diff --git a/agent/vendors.php b/agent/vendors.php index a6dbbd0f..ce705df0 100644 --- a/agent/vendors.php +++ b/agent/vendors.php @@ -113,7 +113,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); -
+
text-nowrap"> diff --git a/api/v1/assets/asset_model.php b/api/v1/assets/asset_model.php index b17db3aa..60c90081 100644 --- a/api/v1/assets/asset_model.php +++ b/api/v1/assets/asset_model.php @@ -4,7 +4,7 @@ if (isset($_POST['asset_name'])) { $name = sanitizeInput($_POST['asset_name']); } elseif (isset($asset_row) && isset($asset_row['asset_name'])) { - $name = $asset_row['asset_name']; + $name = mysqli_real_escape_string($mysqli, $asset_row['asset_name']); } else { $name = ''; } @@ -12,7 +12,7 @@ if (isset($_POST['asset_name'])) { if (isset($_POST['asset_description'])) { $description = sanitizeInput($_POST['asset_description']); } elseif (isset($asset_row) && isset($asset_row['asset_description'])) { - $description = $asset_row['asset_description']; + $description = mysqli_real_escape_string($mysqli, $asset_row['asset_description']); } else { $description = ''; } @@ -20,7 +20,7 @@ if (isset($_POST['asset_description'])) { if (isset($_POST['asset_type'])) { $type = sanitizeInput($_POST['asset_type']); } elseif (isset($asset_row) && isset($asset_row['asset_type'])) { - $type = $asset_row['asset_type']; + $type = mysqli_real_escape_string($mysqli, $asset_row['asset_type']); } else { $type = ''; } @@ -28,14 +28,14 @@ if (isset($_POST['asset_type'])) { if (isset($_POST['asset_make'])) { $make = sanitizeInput($_POST['asset_make']); } elseif (isset($asset_row) && isset($asset_row['asset_make'])) { - $make = $asset_row['asset_make']; + $make = mysqli_real_escape_string($mysqli, $asset_row['asset_make']); } else { $make = ''; } if (isset($_POST['asset_model'])) { $model = sanitizeInput($_POST['asset_model']); } elseif (isset($asset_row) && isset($asset_row['asset_model'])) { - $model = $asset_row['asset_model']; + $model = mysqli_real_escape_string($mysqli, $asset_row['asset_model']); } else { $model = ''; } @@ -43,7 +43,7 @@ if (isset($_POST['asset_model'])) { if (isset($_POST['asset_serial'])) { $serial = sanitizeInput($_POST['asset_serial']); } elseif (isset($asset_row) && isset($asset_row['asset_serial'])) { - $serial = $asset_row['asset_serial']; + $serial = mysqli_real_escape_string($mysqli, $asset_row['asset_serial']); } else { $serial = ''; } @@ -51,7 +51,7 @@ if (isset($_POST['asset_serial'])) { if (isset($_POST['asset_os'])) { $os = sanitizeInput($_POST['asset_os']); } elseif (isset($asset_row) && isset($asset_row['asset_os'])) { - $os = $asset_row['asset_os']; + $os = mysqli_real_escape_string($mysqli, $asset_row['asset_os']); } else { $os = ''; } @@ -59,7 +59,7 @@ if (isset($_POST['asset_os'])) { if (isset($_POST['asset_ip'])) { $ip = sanitizeInput($_POST['asset_ip']); } elseif (isset($asset_row) && isset($asset_row['interface_ip'])) { - $ip = $asset_row['interface_ip']; + $ip = mysqli_real_escape_string($mysqli, $asset_row['interface_ip']); } else { $ip = ''; } @@ -67,7 +67,7 @@ if (isset($_POST['asset_ip'])) { if (isset($_POST['asset_mac'])) { $mac = sanitizeInput($_POST['asset_mac']); } elseif (isset($asset_row) && isset($asset_row['interface_mac'])) { - $mac = $asset_row['interface_mac']; + $mac = mysqli_real_escape_string($mysqli, $asset_row['interface_mac']); } else { $mac = ''; } @@ -75,15 +75,23 @@ if (isset($_POST['asset_mac'])) { if (isset($_POST['asset_uri'])) { $uri = sanitizeInput($_POST['asset_uri']); } elseif (isset($asset_row) && isset($asset_row['asset_uri'])) { - $uri = $asset_row['asset_uri']; + $uri = mysqli_real_escape_string($mysqli, $asset_row['asset_uri']); } else { $uri = ''; } +if (isset($_POST['asset_uri_2'])) { + $uri_2 = sanitizeInput($_POST['asset_uri_2']); +} elseif (isset($asset_row) && isset($asset_row['asset_uri_2'])) { + $uri_2 = mysqli_real_escape_string($mysqli, $asset_row['asset_uri_2']); +} else { + $uri_2 = ''; +} + if (isset($_POST['asset_status'])) { $status = sanitizeInput($_POST['asset_status']); } elseif (isset($asset_row) && isset($asset_row['asset_status'])) { - $status = $asset_row['asset_status']; + $status = mysqli_real_escape_string($mysqli, $asset_row['asset_status']); } else { $status = ''; } @@ -91,7 +99,7 @@ if (isset($_POST['asset_status'])) { if (isset($_POST['asset_purchase_date']) && !empty($_POST['asset_purchase_date'])) { $purchase_date = "'" . sanitizeInput($_POST['asset_purchase_date']) . "'"; } elseif (isset($asset_row) && isset($asset_row['asset_purchase_date'])) { - $purchase_date = "'" . $asset_row['asset_purchase_date'] . "'"; + $purchase_date = "'" . mysqli_real_escape_string($mysqli, $asset_row['asset_purchase_date']) . "'"; } else { $purchase_date = "NULL"; } @@ -99,7 +107,7 @@ if (isset($_POST['asset_purchase_date']) && !empty($_POST['asset_purchase_date'] if (isset($_POST['asset_warranty_expire']) && !empty($_POST['asset_warranty_expire'])) { $warranty_expire = "'" . sanitizeInput($_POST['asset_warranty_expire']) . "'"; } elseif (isset($asset_row) && isset($asset_row['asset_warranty_expire'])) { - $warranty_expire = "'" . $asset_row['asset_warranty_expire'] . "'"; + $warranty_expire = "'" . mysqli_real_escape_string($mysqli, $asset_row['asset_warranty_expire']) . "'"; } else { $warranty_expire = "NULL"; } @@ -107,7 +115,7 @@ if (isset($_POST['asset_warranty_expire']) && !empty($_POST['asset_warranty_expi if (isset($_POST['asset_install_date']) && !empty($_POST['asset_install_date'])) { $install_date = "'" . sanitizeInput($_POST['asset_install_date']) . "'"; } elseif (isset($asset_row) && isset($asset_row['asset_install_date'])) { - $install_date = "'" . $asset_row['asset_install_date'] . "'"; + $install_date = "'" . mysqli_real_escape_string($mysqli, $asset_row['asset_install_date']) . "'"; } else { $install_date = "NULL"; } @@ -115,7 +123,7 @@ if (isset($_POST['asset_install_date']) && !empty($_POST['asset_install_date'])) if (isset($_POST['asset_notes'])) { $notes = sanitizeInput($_POST['asset_notes']); } elseif (isset($asset_row) && isset($asset_row['asset_notes'])) { - $notes = $asset_row['asset_notes']; + $notes = mysqli_real_escape_string($mysqli, $asset_row['asset_notes']); } else { $notes = ''; } diff --git a/api/v1/assets/read.php b/api/v1/assets/read.php index bf3d1d14..1dc1d9d0 100644 --- a/api/v1/assets/read.php +++ b/api/v1/assets/read.php @@ -37,7 +37,7 @@ if (isset($_GET['asset_id'])) { } elseif (isset($_GET['asset_uri_2'])) { // Asset query via uri2 - $uri2 = mysqli_real_escape_string($mysqli, $_GET['asset_uri']); + $uri2 = mysqli_real_escape_string($mysqli, $_GET['asset_uri_2']); $sql = mysqli_query($mysqli, "SELECT * FROM assets WHERE asset_uri_2 = '$uri2' AND asset_client_id LIKE '$client_id' ORDER BY asset_id LIMIT $limit OFFSET $offset"); }else { diff --git a/api/v1/assets/update.php b/api/v1/assets/update.php index 86f59b57..4c5ecfb7 100644 --- a/api/v1/assets/update.php +++ b/api/v1/assets/update.php @@ -18,8 +18,7 @@ if (!empty($asset_id)) { // Variable assignment from POST - assigning the current database value if a value is not provided require_once 'asset_model.php'; - - $update_sql = mysqli_query($mysqli, "UPDATE assets SET asset_name = '$name', asset_description = '$description', asset_type = '$type', asset_make = '$make', asset_model = '$model', asset_serial = '$serial', asset_os = '$os', asset_uri = '$uri', asset_status = '$status', asset_location_id = $location, asset_vendor_id = $vendor, asset_contact_id = $contact, asset_purchase_date = $purchase_date, asset_warranty_expire = $warranty_expire, asset_install_date = $install_date, asset_notes = '$notes' WHERE asset_id = $asset_id AND asset_client_id = $client_id LIMIT 1"); + $update_sql = mysqli_query($mysqli, "UPDATE assets SET asset_name = '$name', asset_description = '$description', asset_type = '$type', asset_make = '$make', asset_model = '$model', asset_serial = '$serial', asset_os = '$os', asset_uri = '$uri', asset_uri_2 = '$uri_2', asset_status = '$status', asset_location_id = $location, asset_vendor_id = $vendor, asset_contact_id = $contact, asset_purchase_date = $purchase_date, asset_warranty_expire = $warranty_expire, asset_install_date = $install_date, asset_notes = '$notes' WHERE asset_id = $asset_id AND asset_client_id = $client_id LIMIT 1"); // Check insert & get insert ID if ($update_sql) { @@ -28,6 +27,9 @@ if (!empty($asset_id)) { // Update Primary Interface mysqli_query($mysqli,"UPDATE asset_interfaces SET interface_mac = '$mac', interface_ip = '$ip', interface_network_id = $network WHERE interface_asset_id = $asset_id AND interface_primary = 1"); + // Add to History + mysqli_query($mysqli,"INSERT INTO asset_history SET asset_history_status = '$status', asset_history_description = 'API updated $name ($api_key_name)', asset_history_asset_id = $asset_id"); + // Logging logAction("Asset", "Edit", "$name via API ($api_key_name)", $client_id); logAction("API", "Success", "Edited asset $name via API ($api_key_name)", $client_id); diff --git a/api/v1/clients/client_model.php b/api/v1/clients/client_model.php index 42321016..4ab7a9c7 100644 --- a/api/v1/clients/client_model.php +++ b/api/v1/clients/client_model.php @@ -5,7 +5,7 @@ if (isset($_POST['client_name'])) { $name = sanitizeInput($_POST['client_name']); } elseif ($client_row) { - $name = $client_row['client_name']; + $name = mysqli_real_escape_string($mysqli, $client_row['client_name']); } else { $name = ''; } @@ -13,7 +13,7 @@ if (isset($_POST['client_name'])) { if (isset($_POST['client_type'])) { $type = sanitizeInput($_POST['client_type']); } elseif ($client_row) { - $type = $client_row['client_type']; + $type = mysqli_real_escape_string($mysqli, $client_row['client_type']); } else { $type = ''; } @@ -21,7 +21,7 @@ if (isset($_POST['client_type'])) { if (isset($_POST['client_website'])) { $website = preg_replace("(^https?://)", "", sanitizeInput($_POST['client_website'])); } elseif ($client_row) { - $website = $client_row['client_website']; + $website = mysqli_real_escape_string($mysqli, $client_row['client_website']); } else { $website = ''; } @@ -29,7 +29,7 @@ if (isset($_POST['client_website'])) { if (isset($_POST['client_referral'])) { $referral = sanitizeInput($_POST['client_referral']); } elseif ($client_row) { - $referral = $client_row['client_referral']; + $referral = mysqli_real_escape_string($mysqli, $client_row['client_referral']); } else { $referral = ''; } @@ -45,7 +45,7 @@ if (isset($_POST['client_rate'])) { if (isset($_POST['client_currency_code'])) { $currency_code = sanitizeInput($_POST['client_currency_code']); } elseif ($client_row) { - $currency_code = $client_row['client_currency_code']; + $currency_code = mysqli_real_escape_string($mysqli, $client_row['client_currency_code']); } else { $currency_code = ''; } @@ -61,7 +61,7 @@ if (isset($_POST['client_net_terms'])) { if (isset($_POST['client_tax_id_number'])) { $tax_id_number = sanitizeInput($_POST['client_tax_id_number']); } elseif ($client_row) { - $tax_id_number = $client_row['client_tax_id_number']; + $tax_id_number = mysqli_real_escape_string($mysqli, $client_row['client_tax_id_number']); } else { $tax_id_number = ''; } @@ -69,7 +69,7 @@ if (isset($_POST['client_tax_id_number'])) { if (isset($_POST['client_abbreviation'])) { $abbreviation = sanitizeInput(substr($_POST['client_abbreviation'], 0, 6)); } elseif ($client_row) { - $abbreviation = $client_row['client_abbreviation']; + $abbreviation = mysqli_real_escape_string($mysqli, $client_row['client_abbreviation']); } else { $abbreviation = ''; } @@ -85,7 +85,7 @@ if (isset($_POST['client_is_lead'])) { if (isset($_POST['client_notes'])) { $notes = sanitizeInput($_POST['client_notes']); } elseif ($client_row) { - $notes = $client_row['client_notes']; + $notes = mysqli_real_escape_string($mysqli, $client_row['client_notes']); } else { $notes = ''; } diff --git a/api/v1/clients/update.php b/api/v1/clients/update.php index 13ec877e..cf2fb52c 100644 --- a/api/v1/clients/update.php +++ b/api/v1/clients/update.php @@ -3,9 +3,6 @@ require_once '../validate_api_key.php'; require_once '../require_post_method.php'; -// Parse Info -$client_id = intval($_POST['client_id']); - // Default $update_count = false; diff --git a/api/v1/contacts/contact_model.php b/api/v1/contacts/contact_model.php index dbac6bda..e92f4246 100644 --- a/api/v1/contacts/contact_model.php +++ b/api/v1/contacts/contact_model.php @@ -5,7 +5,7 @@ define('number_regex', '/[^0-9]/'); if (isset($_POST['contact_name'])) { $name = sanitizeInput($_POST['contact_name']); } elseif ($contact_row) { - $name = $contact_row['contact_name']; + $name = mysqli_real_escape_string($mysqli, $contact_row['contact_name']); } else { $name = ''; } @@ -13,7 +13,7 @@ if (isset($_POST['contact_name'])) { if (isset($_POST['contact_title'])) { $title = sanitizeInput($_POST['contact_title']); } elseif ($contact_row) { - $title = $contact_row['contact_title']; + $title = mysqli_real_escape_string($mysqli, $contact_row['contact_title']); } else { $title = ''; } @@ -21,7 +21,7 @@ if (isset($_POST['contact_title'])) { if (isset($_POST['contact_department'])) { $department = sanitizeInput($_POST['contact_department']); } elseif ($contact_row) { - $department = $contact_row['contact_department']; + $department = mysqli_real_escape_string($mysqli, $contact_row['contact_department']); } else { $department = ''; } @@ -29,7 +29,7 @@ if (isset($_POST['contact_department'])) { if (isset($_POST['contact_email'])) { $email = sanitizeInput($_POST['contact_email']); } elseif ($contact_row) { - $email = $contact_row['contact_email']; + $email = mysqli_real_escape_string($mysqli, $contact_row['contact_email']); } else { $email = ''; } @@ -37,7 +37,7 @@ if (isset($_POST['contact_email'])) { if (isset($_POST['contact_phone'])) { $phone = preg_replace(number_regex, '', $_POST['contact_phone']); } elseif ($contact_row) { - $phone = $contact_row['contact_phone']; + $phone = mysqli_real_escape_string($mysqli, $contact_row['contact_phone']); } else { $phone = ''; } @@ -45,7 +45,7 @@ if (isset($_POST['contact_phone'])) { if (isset($_POST['contact_extension'])) { $extension = preg_replace(number_regex, '', $_POST['contact_extension']); } elseif ($contact_row) { - $extension = $contact_row['contact_extension']; + $extension = mysqli_real_escape_string($mysqli, $contact_row['contact_extension']); } else { $extension = ''; } @@ -53,7 +53,7 @@ if (isset($_POST['contact_extension'])) { if (isset($_POST['contact_mobile'])) { $mobile = preg_replace(number_regex, '', $_POST['contact_mobile']); } elseif ($contact_row) { - $mobile = $contact_row['contact_mobile']; + $mobile = mysqli_real_escape_string($mysqli, $contact_row['contact_mobile']); } else { $mobile = ''; } @@ -61,7 +61,7 @@ if (isset($_POST['contact_mobile'])) { if (isset($_POST['contact_notes'])) { $notes = sanitizeInput($_POST['contact_notes']); } elseif ($contact_row) { - $notes = $contact_row['contact_notes']; + $notes = mysqli_real_escape_string($mysqli, $contact_row['contact_notes']); } else { $notes = ''; } diff --git a/api/v1/credentials/create.php b/api/v1/credentials/create.php index 5fb2b224..44618610 100644 --- a/api/v1/credentials/create.php +++ b/api/v1/credentials/create.php @@ -13,7 +13,7 @@ $insert_id = false; if (!empty($api_key_decrypt_password) && !empty($name) && !(empty($password))) { // Add credential - $insert_sql = mysqli_query($mysqli,"INSERT INTO credentials SET credential_name = '$name', credential_description = '$description', credential_uri = '$uri', credential_uri_2 = '$uri_2', credential_username = '$username', credential_password = '$password', credential_otp_secret = '$otp_secret', credential_note = '$note', credential_important = $important, credential_contact_id = $contact_id, credential_vendor_id = $vendor_id, credential_asset_id = $asset_id, credential_software_id = $software_id, credential_client_id = $client_id"); + $insert_sql = mysqli_query($mysqli,"INSERT INTO credentials SET credential_name = '$name', credential_description = '$description', credential_uri = '$uri', credential_uri_2 = '$uri_2', credential_username = '$username', credential_password = '$password', credential_otp_secret = '$otp_secret', credential_note = '$note', credential_favorite = $favorite, credential_contact_id = $contact_id, credential_asset_id = $asset_id, credential_client_id = $client_id"); // Check insert & get insert ID if ($insert_sql) { diff --git a/api/v1/credentials/credential_model.php b/api/v1/credentials/credential_model.php index ac2faf5f..04531727 100644 --- a/api/v1/credentials/credential_model.php +++ b/api/v1/credentials/credential_model.php @@ -11,7 +11,7 @@ if (isset($_POST['api_key_decrypt_password'])) { if (isset($_POST['credential_name'])) { $name = sanitizeInput($_POST['credential_name']); } elseif (isset($credential_row) && isset($credential_row['credential_name'])) { - $name = $credential_row['credential_name']; + $name = mysqli_real_escape_string($mysqli, $credential_row['credential_name']); } else { $name = ''; } @@ -19,7 +19,7 @@ if (isset($_POST['credential_name'])) { if (isset($_POST['credential_description'])) { $description = sanitizeInput($_POST['credential_description']); } elseif (isset($credential_row) && isset($credential_row['credential_description'])) { - $description = $credential_row['credential_description']; + $description = mysqli_real_escape_string($mysqli, $credential_row['credential_description']); } else { $description = ''; } @@ -27,7 +27,7 @@ if (isset($_POST['credential_description'])) { if (isset($_POST['credential_uri'])) { $uri = sanitizeInput($_POST['credential_uri']); } elseif (isset($credential_row) && isset($credential_row['credential_uri'])) { - $uri = $credential_row['credential_uri']; + $uri = mysqli_real_escape_string($mysqli, $credential_row['credential_uri']); } else { $uri = ''; } @@ -35,7 +35,7 @@ if (isset($_POST['credential_uri'])) { if (isset($_POST['credential_uri_2'])) { $uri_2 = sanitizeInput($_POST['credential_uri_2']); } elseif (isset($credential_row) && isset($credential_row['credential_uri_2'])) { - $uri_2 = $credential_row['credential_uri_2']; + $uri_2 = mysqli_real_escape_string($mysqli, $credential_row['credential_uri_2']); } else { $uri_2 = ''; } @@ -61,12 +61,10 @@ if (isset($_POST['credential_password'])) { $password_changed = false; } - - if (isset($_POST['credential_otp_secret'])) { $otp_secret = sanitizeInput($_POST['credential_otp_secret']); } elseif (isset($credential_row) && isset($credential_row['credential_otp_secret'])) { - $otp_secret = $credential_row['credential_otp_secret']; + $otp_secret = mysqli_real_escape_string($mysqli, $credential_row['credential_otp_secret']); } else { $otp_secret = ''; } @@ -74,17 +72,17 @@ if (isset($_POST['credential_otp_secret'])) { if (isset($_POST['credential_note'])) { $note = sanitizeInput($_POST['credential_note']); } elseif (isset($credential_row) && isset($credential_row['credential_note'])) { - $note = $credential_row['credential_note']; + $note = mysqli_real_escape_string($mysqli, $credential_row['credential_note']); } else { $note = ''; } -if (isset($_POST['credential_important'])) { - $important = intval($_POST['credential_important']); -} elseif (isset($credential_row) && isset($credential_row['credential_important'])) { - $important = $credential_row['credential_important']; +if (isset($_POST['credential_favorite'])) { + $favorite = intval($_POST['credential_favorite']); +} elseif (isset($credential_row) && isset($credential_row['credential_favorite'])) { + $favorite = $credential_row['credential_favorite']; } else { - $important = ''; + $favorite = 0; } if (isset($_POST['credential_contact_id'])) { @@ -92,7 +90,7 @@ if (isset($_POST['credential_contact_id'])) { } elseif (isset($credential_row) && isset($credential_row['credential_contact_id'])) { $contact_id = $credential_row['credential_contact_id']; } else { - $contact_id = ''; + $contact_id = 0; } if (isset($_POST['credential_vendor_id'])) { @@ -100,7 +98,7 @@ if (isset($_POST['credential_vendor_id'])) { } elseif (isset($credential_row) && isset($credential_row['credential_vendor_id'])) { $vendor_id = $credential_row['credential_vendor_id']; } else { - $vendor_id = ''; + $vendor_id = 0; } if (isset($_POST['credential_asset_id'])) { @@ -108,7 +106,7 @@ if (isset($_POST['credential_asset_id'])) { } elseif (isset($credential_row) && isset($credential_row['credential_asset_id'])) { $asset_id = $credential_row['credential_asset_id']; } else { - $asset_id = ''; + $asset_id = 0; } if (isset($_POST['credential_software_id'])) { @@ -116,5 +114,5 @@ if (isset($_POST['credential_software_id'])) { } elseif (isset($credential_row) && isset($credential_row['credential_software_id'])) { $software_id = $credential_row['credential_software_id']; } else { - $software_id = ''; + $software_id = 0; } diff --git a/api/v1/credentials/update.php b/api/v1/credentials/update.php index 78c4f296..2aff7a6b 100644 --- a/api/v1/credentials/update.php +++ b/api/v1/credentials/update.php @@ -17,7 +17,7 @@ if (!empty($_POST['api_key_decrypt_password']) && !empty($credential_id)) { // Variable assignment from POST - assigning the current database value if a value is not provided require_once 'credential_model.php'; - $update_sql = mysqli_query($mysqli,"UPDATE credentials SET credential_name = '$name', credential_description = '$description', credential_uri = '$uri', credential_uri_2 = '$uri_2', credential_username = '$username', credential_password = '$password', credential_otp_secret = '$otp_secret', credential_note = '$note', credential_important = $important, credential_contact_id = $contact_id, credential_vendor_id = $vendor_id, credential_asset_id = $asset_id, credential_software_id = $software_id, credential_client_id = $client_id WHERE credential_id = '$credential_id' AND credential_client_id = $client_id LIMIT 1"); + $update_sql = mysqli_query($mysqli,"UPDATE credentials SET credential_name = '$name', credential_description = '$description', credential_uri = '$uri', credential_uri_2 = '$uri_2', credential_username = '$username', credential_password = '$password', credential_otp_secret = '$otp_secret', credential_note = '$note', credential_favorite = $favorite, credential_contact_id = $contact_id, credential_asset_id = $asset_id, credential_client_id = $client_id WHERE credential_id = '$credential_id' AND credential_client_id = $client_id LIMIT 1"); // Check insert & get insert ID if ($update_sql) { diff --git a/api/v1/documents/document_model.php b/api/v1/documents/document_model.php index 75a93d56..47d5962f 100644 --- a/api/v1/documents/document_model.php +++ b/api/v1/documents/document_model.php @@ -4,7 +4,7 @@ if (isset($_POST['document_name'])) { $name = sanitizeInput($_POST['document_name']); } elseif (isset($document_row) && isset($document_row['document_name'])) { - $name = $document_row['document_name']; + $name = mysqli_real_escape_string($mysqli, $document_row['document_name']); } else { $name = ''; } @@ -12,7 +12,7 @@ if (isset($_POST['document_name'])) { if (isset($_POST['document_description'])) { $description = sanitizeInput($_POST['document_description']); } elseif (isset($document_row) && isset($document_row['document_description'])) { - $description = $document_row['document_description']; + $description = mysqli_real_escape_string($mysqli, $document_row['document_description']); } else { $description = ''; } @@ -20,7 +20,7 @@ if (isset($_POST['document_description'])) { if (isset($_POST['document_content'])) { $content = mysqli_real_escape_string($mysqli, $_POST['document_content']); } elseif (isset($document_row) && isset($document_row['document_content'])) { - $content = $document_row['document_content']; + $content = mysqli_real_escape_string($mysqli, $document_row['document_content']); } else { $content = ''; } @@ -29,7 +29,7 @@ if (isset($_POST['document_content'])) { if (isset($_POST['document_content'])) { $content_raw = sanitizeInput($_POST['document_name'] . $_POST['document_description'] . " " . str_replace("<", " <", $_POST['document_content'])); } elseif (isset($document_row) && isset($document_row['document_content_raw'])) { - $content_raw = $document_row['document_content_raw']; + $content_raw = mysqli_real_escape_string($mysqli, $document_row['document_content_raw']); } else { $content_raw = ''; } diff --git a/api/v1/documents/update.php b/api/v1/documents/update.php index 1cd987eb..4c690c7c 100644 --- a/api/v1/documents/update.php +++ b/api/v1/documents/update.php @@ -60,8 +60,18 @@ if (!empty($document_id)) { $document_version_id = mysqli_insert_id($mysqli); - // 3) Variable assignment from POST (uses trigger you already have) + // 3) Variable assignment from POST // This should set: $name, $description, $content (raw html), $folder, etc. + + // Fetch current doc data (fresh) + $document_row = mysqli_fetch_assoc(mysqli_query($mysqli, " + SELECT * FROM documents + WHERE document_client_id = $client_id + AND document_id = $document_id + LIMIT 1 + ")); + + // Assign variables from POST or fallback to DB require_once 'document_model.php'; // Process NEW HTML content: save base64 images to /uploads/documents// diff --git a/api/v1/domains/read.php b/api/v1/domains/read.php index b65aab99..6bbd96a2 100644 --- a/api/v1/domains/read.php +++ b/api/v1/domains/read.php @@ -13,7 +13,7 @@ if (isset($_GET['domain_id'])) { } elseif (isset($_GET['domain_name'])) { // Domain by name $name = mysqli_real_escape_string($mysqli, $_GET['domain_name']); - $sql = mysqli_query($mysqli, "SELECT * FROM domains WHERE domain_name = '$name' AND domain_client_id LIKE '$client_id' ORDER BY asset_id LIMIT $limit OFFSET $offset"); + $sql = mysqli_query($mysqli, "SELECT * FROM domains WHERE domain_name = '$name' AND domain_client_id LIKE '$client_id' ORDER BY domain_id LIMIT $limit OFFSET $offset"); } else { // All domains (by client ID or all in general if key permits) diff --git a/api/v1/invoice_items/read.php b/api/v1/invoice_items/read.php new file mode 100644 index 00000000..9b6a435b --- /dev/null +++ b/api/v1/invoice_items/read.php @@ -0,0 +1,64 @@ + 'False', + 'message' => 'A filter is required. Please supply either invoice_id or item_id.', + 'count' => 0, + 'data' => [] + ]); + exit; +} + +// Output +require_once "../read_output.php"; diff --git a/api/v1/locations/location_model.php b/api/v1/locations/location_model.php index 6f031a79..b177a4e5 100644 --- a/api/v1/locations/location_model.php +++ b/api/v1/locations/location_model.php @@ -5,7 +5,7 @@ if (isset($_POST['location_name'])) { $name = sanitizeInput($_POST['location_name']); } elseif ($location_row) { - $name = $location_row['location_name']; + $name = mysqli_real_escape_string($mysqli, $location_row['location_name']); } else { $name = ''; } @@ -13,7 +13,7 @@ if (isset($_POST['location_name'])) { if (isset($_POST['location_description'])) { $description = sanitizeInput($_POST['location_description']); } elseif ($location_row) { - $description = $location_row['location_description']; + $description = mysqli_real_escape_string($mysqli, $location_row['location_description']); } else { $description = ''; } @@ -21,7 +21,7 @@ if (isset($_POST['location_description'])) { if (isset($_POST['location_country'])) { $country = sanitizeInput($_POST['location_country']); } elseif ($location_row) { - $country = $location_row['location_country']; + $country = mysqli_real_escape_string($mysqli, $location_row['location_country']); } else { $country = ''; } @@ -29,7 +29,7 @@ if (isset($_POST['location_country'])) { if (isset($_POST['location_address'])) { $address = sanitizeInput($_POST['location_address']); } elseif ($location_row) { - $address = $location_row['location_address']; + $address = mysqli_real_escape_string($mysqli, $location_row['location_address']); } else { $address = ''; } @@ -37,7 +37,7 @@ if (isset($_POST['location_address'])) { if (isset($_POST['location_city'])) { $city = sanitizeInput($_POST['location_city']); } elseif ($location_row) { - $city = $location_row['location_city']; + $city = mysqli_real_escape_string($mysqli, $location_row['location_city']); } else { $city = ''; } @@ -45,7 +45,7 @@ if (isset($_POST['location_city'])) { if (isset($_POST['location_state'])) { $state = sanitizeInput($_POST['location_state']); } elseif ($location_row) { - $state = $location_row['location_state']; + $state = mysqli_real_escape_string($mysqli, $location_row['location_state']); } else { $state = ''; } @@ -53,7 +53,7 @@ if (isset($_POST['location_state'])) { if (isset($_POST['location_zip'])) { $zip = sanitizeInput($_POST['location_zip']); } elseif ($location_row) { - $zip = $location_row['location_zip']; + $zip = mysqli_real_escape_string($mysqli, $location_row['location_zip']); } else { $zip = ''; } @@ -61,7 +61,7 @@ if (isset($_POST['location_zip'])) { if (isset($_POST['location_hours'])) { $hours = sanitizeInput($_POST['location_hours']); } elseif ($location_row) { - $hours = $location_row['location_hours']; + $hours = mysqli_real_escape_string($mysqli, $location_row['location_hours']); } else { $hours = ''; } @@ -69,7 +69,7 @@ if (isset($_POST['location_hours'])) { if (isset($_POST['location_notes'])) { $notes = sanitizeInput($_POST['location_notes']); } elseif ($location_row) { - $notes = $location_row['location_notes']; + $notes = mysqli_real_escape_string($mysqli, $location_row['location_notes']); } else { $notes = ''; } diff --git a/api/v1/payments/read.php b/api/v1/payments/read.php deleted file mode 100644 index 6e877762..00000000 --- a/api/v1/payments/read.php +++ /dev/null @@ -1,31 +0,0 @@ -"); + $details = mysqli_real_escape_string($mysqli, $_POST['ticket_details'] . "
"); } elseif ($ticket_row) { - $details = $ticket_row['ticket_details']; + $details = mysqli_real_escape_string($mysqli, $ticket_row['ticket_details']); } else { $details = '< blank >
'; } diff --git a/api/v1/update_output.php b/api/v1/update_output.php index da985b54..ed9402be 100644 --- a/api/v1/update_output.php +++ b/api/v1/update_output.php @@ -16,7 +16,7 @@ if (isset($update_count) && is_numeric($update_count) && $update_count > 0) { // Query returned false: something went wrong, or it was declined due to required variables missing else { $return_arr['success'] = "False"; - $return_arr['message'] = "Auth success but update query failed/returned no results. Ensure ALL required variables are provided and database schema is up-to-date. Most likely cause: non-existent module ID (i.e. bad contact ID/ticket ID/etc)."; + $return_arr['message'] = "Auth success but update query failed/returned no results. Ensure ALL required variables are provided and database schema is up-to-date. Most likely cause: non-existent module ID (i.e. bad contact ID/ticket ID/etc) or no rows changed."; // Log any database/schema related errors to the PHP Error log if (mysqli_error($mysqli)) { diff --git a/cron/cron.php b/cron/cron.php index 71cff90c..4ab6c21a 100644 --- a/cron/cron.php +++ b/cron/cron.php @@ -524,7 +524,7 @@ if ($config_send_invoice_reminders == 1) { // Late Charges - if ($config_invoice_late_fee_enable == 1) { + if ($config_invoice_late_fee_enable == 1 && $day > 1) { $todays_date = date('Y-m-d'); $late_fee_amount = ($invoice_amount * $config_invoice_late_fee_percent) / 100; diff --git a/db.sql b/db.sql index 1e6409b0..b9b8b8e8 100644 --- a/db.sql +++ b/db.sql @@ -1,4 +1,4 @@ -/*M!999999\- enable the sandbox mode */ +/*M!999999\- enable the sandbox mode */ -- MariaDB dump 10.19 Distrib 10.11.14-MariaDB, for debian-linux-gnu (x86_64) -- -- Host: localhost Database: itflow_dev @@ -449,9 +449,11 @@ DROP TABLE IF EXISTS `categories`; CREATE TABLE `categories` ( `category_id` int(11) NOT NULL AUTO_INCREMENT, `category_name` varchar(200) NOT NULL, + `category_description` varchar(255) DEFAULT NULL, `category_type` varchar(200) NOT NULL, `category_color` varchar(200) DEFAULT NULL, `category_icon` varchar(200) DEFAULT NULL, + `category_order` int(11) NOT NULL DEFAULT 0, `category_parent` int(11) DEFAULT 0, `category_created_at` datetime NOT NULL DEFAULT current_timestamp(), `category_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(), @@ -1293,8 +1295,6 @@ CREATE TABLE `invoice_items` ( `item_archived_at` datetime DEFAULT NULL, `item_tax_id` int(11) NOT NULL DEFAULT 0, `item_product_id` int(11) NOT NULL DEFAULT 0, - `item_quote_id` int(11) NOT NULL DEFAULT 0, - `item_recurring_invoice_id` int(11) NOT NULL DEFAULT 0, `item_invoice_id` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`item_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; @@ -2997,4 +2997,4 @@ CREATE TABLE `vendors` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2026-03-07 18:46:25 +-- Dump completed on 2026-04-04 18:13:53 diff --git a/includes/app_version.php b/includes/app_version.php index 67a54bcb..738d2d0c 100644 --- a/includes/app_version.php +++ b/includes/app_version.php @@ -5,4 +5,4 @@ * Update this file each time we merge develop into master. Format is YY.MM (add a .v if there is more than one release a month. */ -DEFINE("APP_VERSION", "26.03"); +DEFINE("APP_VERSION", "26.04"); diff --git a/includes/database_version.php b/includes/database_version.php index d848c3e8..53c431bc 100644 --- a/includes/database_version.php +++ b/includes/database_version.php @@ -5,4 +5,4 @@ * It is used in conjunction with database_updates.php */ -DEFINE("LATEST_DATABASE_VERSION", "2.4.2"); +DEFINE("LATEST_DATABASE_VERSION", "2.4.4"); diff --git a/includes/load_global_settings.php b/includes/load_global_settings.php index dcbf8fca..13b8ebf5 100644 --- a/includes/load_global_settings.php +++ b/includes/load_global_settings.php @@ -135,28 +135,6 @@ $config_whitelabel_key = $row['config_whitelabel_key']; // Select Arrays - -$theme_colors_array = array ( - 'lightblue', - 'blue', - 'cyan', - 'green', - 'olive', - 'teal', - 'red', - 'maroon', - 'pink', - 'purple', - 'indigo', - 'fuchsia', - 'yellow', - 'orange', - 'yellow', - 'black', - 'navy', - 'gray' -); - $colors_array = array ( 'lightblue', 'blue', @@ -180,29 +158,10 @@ $colors_array = array ( 'olive' ); -$net_terms_array = array ( - '0'=>'On Receipt', - '7'=>'7 Days', - '10'=>'10 Days', - '15'=>'15 Days', - '30'=>'30 Days', - '45'=>'45 Days', - '60'=>'60 Days', - '90'=>'90 Days' -); - $records_per_page_array = array ('5','10','15','20','30','50','100'); include_once "settings_localization_array.php"; - -$category_types_array = array ( - 'Expense', - 'Income', - 'Payment Method', - 'Referral' -); - $asset_types_array = array ( 'Laptop'=>'fa-laptop', 'Desktop'=>'fa-desktop', @@ -219,97 +178,3 @@ $asset_types_array = array ( 'Virtual Machine'=>'fa-cloud', 'Other'=>'fa-tag' ); - -$software_types_array = array ( - 'Software as a Service (SaaS)', - 'Productivity Suites', - 'Web Application', - 'Desktop Application', - 'Mobile Application', - 'Security Software', - 'System Software', - 'Operating System', - 'Other' -); - -$license_types_array = array ( - 'Device', - 'User' -); - -$document_types_array = array ( - '0'=>'Document', - '1'=>'Template', - '2'=>'Global Template' -); - -$asset_status_array = array ( - 'Ready to Deploy', - 'Deployed', - 'Out for Repair', - 'Lost', - 'Stolen', - 'Retired' -); - -$ticket_status_array = array ( - 'Open', - 'On Hold', - 'Auto Close', - 'Closed' -); - -$industry_select_array = array( - "Accounting", - "Agriculture", - "Automotive", - "Construction", - "Education", - "Entertainent", - "Finance", - "Government", - "Healthcare", - "Hospititality", - "Information Technology", - "Insurance", - "Pharmacy", - "Law", - "Manufacturing", - "Marketing & Advertising", - "Military", - "Non-Profit", - "Real Estate", - "Retail", - "Services", - "Transportation", - "Other" // An 'Other' option for industries not listed -); - -$start_page_select_array = array ( - 'dashboard.php'=>'Dashboard', - 'clients.php'=> 'Client Management', - 'tickets.php'=> 'Support Tickets', - 'invoices.php' => 'Invoices' -); - -$rack_type_select_array = array( - "Open Wall-Mount", - "Enclosed Wall-Mount", - "Open Floor-Standing", - "Enclosed Floor-Standing", - "Other" -); - -$note_types_array = array ( - 'Call'=>'fa-phone-alt', - 'Email'=>'fa-envelope', - 'Meeting'=>'fa-handshake', - 'In Person'=>'fa-people-arrows', - 'Note'=>'fa-sticky-note' -); - -$interface_types_array = array ( - 'Ethernet', - 'SFP', - 'WiFi' -); diff --git a/plugins/stripe-php/.claude/CLAUDE.md b/plugins/stripe-php/.claude/CLAUDE.md new file mode 100644 index 00000000..c7ae2cdb --- /dev/null +++ b/plugins/stripe-php/.claude/CLAUDE.md @@ -0,0 +1,49 @@ +# stripe-php + +## Testing + +- Run all tests: `just test` +- Run specific test: `just test --filter testMethodName` +- Run specific test file: `just test tests/Stripe/SomeTest.php` +- Tests use PHPUnit + +## Formatting & Linting + +- Format: `just format` (uses php-cs-fixer) +- Lint/static analysis: `just lint` (uses PHPStan) + +## Key Locations + +- HTTP client interface: `lib/HttpClient/ClientInterface.php` +- cURL HTTP implementation: `lib/HttpClient/CurlClient.php` +- Streaming client interface: `lib/HttpClient/StreamingClientInterface.php` +- Base client (request building, auth): `lib/BaseStripeClient.php` +- Main client class: `lib/StripeClient.php` +- Version/config: `lib/Stripe.php` + +## Generated Code + +- Files containing `File generated from our OpenAPI spec` at the top are generated; do not edit. Similarly, any code block starting with `The beginning of the section generated from our OpenAPI spec` is generated and should not be edited directly. + - If something in a generated file/range needs to be updated, add a summary of the change to your report but don't attempt to edit it directly. +- Resource classes under `lib/` (e.g. `lib/Customer.php`, `lib/Service/`) are largely generated. +- The `HttpClient/` directory and `BaseStripeClient.php` are NOT generated. + +## Conventions + +- Uses PHP cURL extension for HTTP +- Composer for dependency management +- Vendored executables in `vendor/bin/` +- Work is not complete until `just test` and `just lint` complete successfully. +- All code must run on all supported PHP versions (full list in the test section of @.github/workflows/ci.yml) + +### Comments + +- Comments MUST only be used to: + 1. Document a function + 2. Explain the WHY of a piece of code + 3. Explain a particularly complicated piece of code +- Comments NEVER should be used to: + 1. Say what used to be there. That's no longer relevant! + 2. Explain the WHAT of a piece of code (unless it's very non-obvious) + +It's ok not to put comments on/in a function if their addition wouldn't meaningfully clarify anything. diff --git a/plugins/stripe-php/CHANGELOG.md b/plugins/stripe-php/CHANGELOG.md index 381a9365..f27b3424 100644 --- a/plugins/stripe-php/CHANGELOG.md +++ b/plugins/stripe-php/CHANGELOG.md @@ -1,4 +1,55 @@ # Changelog + +## 20.0.0 - 2026-03-25 + +This release changes the pinned API version to `2026-03-25.dahlia` and contains breaking changes (prefixed with ⚠️ below). There's also a [detailed migration guide](https://github.com/stripe/stripe-php/wiki/Migration-guide-for-v20) to simplify your upgrade process. + +Please review details for the breaking changes and alternatives in the [Stripe API changelog](https://docs.stripe.com/changelog/dahlia) before upgrading. + +* ⚠️ **Breaking change:** [#2038](https://github.com/stripe/stripe-php/pull/2038) Drop support for PHP < 7.2. This is also the **last major version to support PHP 7.2 and 7.3**. Please upgrade to 7.4+ before September 2026. See the [versioning policy](https://docs.stripe.com/sdks/versioning?lang=php#stripe-sdk-language-version-support-policy) for more information. +* ⚠️ **Breaking change:** [#2042](https://github.com/stripe/stripe-php/pull/2042) Preserve null values in v2 JSON request bodies + - The SDK now preserves and sends `null` when set in V2 API metadata and params, enabling you to clear metadata entries and some unsettable properties for V2 APIs. + - ⚠️ The `Util::objectsToIds()` method now has a required `$serializeNull` parameter to indicate if null values set in the object should be output in the resulting hash. This is relevant for V2 POST APIs to let callers clear emptyable values. +* [#1917](https://github.com/stripe/stripe-php/pull/1917) Avoid using func_get_args +* [#2011](https://github.com/stripe/stripe-php/pull/2011) Ensure that `previous_attributes` is always an instance of `StripeObject` +* [#2033](https://github.com/stripe/stripe-php/pull/2033) Add runtime support for V2 int64 string-encoded fields + +### ⚠️ Breaking changes due to changes in the Stripe API + +* [#2041](https://github.com/stripe/stripe-php/pull/2041) ⚠️ Throw an error when using the wrong webhook parsing method +* Generated changes from [#2046](https://github.com/stripe/stripe-php/pull/2046), [#2044](https://github.com/stripe/stripe-php/pull/2044), [#2025](https://github.com/stripe/stripe-php/pull/2025) + * Add support for `upi_payments` on `Account.capabilities`, `Account.create().$params.capability`, and `Account.update().$params.capability` + * Add support for `upi` on `Charge.payment_method_details`, `Checkout.Session.payment_method_options`, `Checkout\Session.create().$params.payment_method_option`, `ConfirmationToken.create().$params.payment_method_datum`, `ConfirmationToken.payment_method_preview`, `Mandate.payment_method_details`, `PaymentAttemptRecord.payment_method_details`, `PaymentIntent.confirm().$params.payment_method_datum`, `PaymentIntent.confirm().$params.payment_method_option`, `PaymentIntent.create().$params.payment_method_datum`, `PaymentIntent.create().$params.payment_method_option`, `PaymentIntent.payment_method_options`, `PaymentIntent.update().$params.payment_method_datum`, `PaymentIntent.update().$params.payment_method_option`, `PaymentMethod.create().$params`, `PaymentMethodConfiguration.create().$params`, `PaymentMethodConfiguration.update().$params`, `PaymentMethodConfiguration`, `PaymentMethod`, `PaymentRecord.payment_method_details`, `SetupAttempt.payment_method_details`, `SetupIntent.confirm().$params.payment_method_datum`, `SetupIntent.confirm().$params.payment_method_option`, `SetupIntent.create().$params.payment_method_datum`, `SetupIntent.create().$params.payment_method_option`, `SetupIntent.payment_method_options`, `SetupIntent.update().$params.payment_method_datum`, and `SetupIntent.update().$params.payment_method_option` + * Add support for new value `tempo` on enums `Charge.payment_method_details.crypto.network`, `PaymentAttemptRecord.payment_method_details.crypto.network`, and `PaymentRecord.payment_method_details.crypto.network` + * Add support for `integration_identifier` on `Checkout.Session` and `Checkout\Session.create().$params` + * Add support for `crypto` on `Checkout\Session.create().$params.payment_method_option` + * Add support for `pending_invoice_item_interval` on `Checkout\Session.create().$params.subscription_datum` + * Add support for new values `elements`, `embedded_page`, `form`, and `hosted_page` on enum `Checkout.Session.ui_mode` + * Add support for new value `marine_carbon_removal` on enum `Climate.Supplier.removal_pathway` + * Add support for new value `upi` on enums `ConfirmationToken.payment_method_preview.type` and `PaymentMethod.type` + * Add support for `metadata` on `CreditNote.create().$params.line`, `CreditNote.preview().$params.line`, `CreditNote.preview_lines().$params.line`, and `CreditNoteLineItem` + * Add support for `quantity_decimal` on `Invoice.add_lines().$params.line`, `Invoice.create_preview().$params.invoice_item`, `Invoice.update_lines().$params.line`, `InvoiceItem.create().$params`, `InvoiceItem.update().$params`, `InvoiceItem`, `InvoiceLineItem.update().$params`, and `InvoiceLineItem` + * ⚠️ Add support for `level` on `Issuing\Authorization.create().$params.risk_assessment.card_testing_risk` and `Issuing\Authorization.create().$params.risk_assessment.merchant_dispute_risk` + * ⚠️ Remove support for `risk_level` on `Issuing\Authorization.create().$params.risk_assessment.card_testing_risk` and `Issuing\Authorization.create().$params.risk_assessment.merchant_dispute_risk` + * Add support for `lifecycle_controls` on `Issuing.Card` and `Issuing\Card.create().$params` + * ⚠️ Change type of `Issuing.Token.network_data.visa.card_reference_id` from `string` to `nullable(string)` + * ⚠️ Change type of `PaymentAttemptRecord.payment_method_details.card.brand` and `PaymentRecord.payment_method_details.card.brand` from `enum` to `nullable(enum)` + * ⚠️ Change type of `PaymentAttemptRecord.payment_method_details.card.exp_month` and `PaymentRecord.payment_method_details.card.exp_month` from `longInteger` to `nullable(longInteger)` + * ⚠️ Change type of `PaymentAttemptRecord.payment_method_details.card.exp_year` and `PaymentRecord.payment_method_details.card.exp_year` from `longInteger` to `nullable(longInteger)` + * ⚠️ Change type of `PaymentAttemptRecord.payment_method_details.card.funding` and `PaymentRecord.payment_method_details.card.funding` from `enum('credit'|'debit'|'prepaid'|'unknown')` to `nullable(enum('credit'|'debit'|'prepaid'|'unknown'))` + * ⚠️ Change type of `PaymentAttemptRecord.payment_method_details.card.last4` and `PaymentRecord.payment_method_details.card.last4` from `string` to `nullable(string)` + * ⚠️ Change type of `PaymentAttemptRecord.payment_method_details.card.moto` and `PaymentRecord.payment_method_details.card.moto` from `boolean` to `nullable(boolean)` + * Add support for `cryptogram`, `electronic_commerce_indicator`, `exemption_indicator_applied`, and `exemption_indicator` on `PaymentAttemptRecord.payment_method_details.card.three_d_secure` and `PaymentRecord.payment_method_details.card.three_d_secure` + * Add support for new value `upi` on enums `PaymentIntent.excluded_payment_method_types` and `SetupIntent.excluded_payment_method_types` + * Add support for `upi_handle_redirect_or_display_qr_code` on `PaymentIntent.next_action` and `SetupIntent.next_action` + * Add support for new value `upi` on enum `PaymentLink.payment_method_types` + * Add support for `recommended_action` and `signals` on `Radar.PaymentEvaluation` + * ⚠️ Remove support for `insights` on `Radar.PaymentEvaluation` + * Add support for new value `crypto_fingerprint` on enum `Radar.ValueList.item_type` + * Add support for new value `canceled_by_retention_policy` on enum `Subscription.cancellation_details.reason` + * ⚠️ Change type of `V2.Core.EventDestination.events_from` from `enum('other_accounts'|'self')` to `string` + * Add support for error code `service_period_coupon_with_metered_tiered_item_unsupported` on `Invoice.last_finalization_error`, `PaymentIntent.last_payment_error`, `SetupAttempt.setup_error`, `SetupIntent.last_setup_error`, and `StripeError` + ## 19.4.1 - 2026-03-06 * [#2024](https://github.com/stripe/stripe-php/pull/2024) Add Stripe-Request-Trigger header * [#2022](https://github.com/stripe/stripe-php/pull/2022) Add agent information to UserAgent diff --git a/plugins/stripe-php/CODEGEN_VERSION b/plugins/stripe-php/CODEGEN_VERSION index 17557a68..7f0c1f6c 100644 --- a/plugins/stripe-php/CODEGEN_VERSION +++ b/plugins/stripe-php/CODEGEN_VERSION @@ -1 +1 @@ -e65e48569f6dfad2d5f1b58018017856520c3ae6 \ No newline at end of file +c6c496e5daed61b9bb5504a4af318c46e722f783 \ No newline at end of file diff --git a/plugins/stripe-php/OPENAPI_VERSION b/plugins/stripe-php/OPENAPI_VERSION index 58dae793..4ec501ea 100644 --- a/plugins/stripe-php/OPENAPI_VERSION +++ b/plugins/stripe-php/OPENAPI_VERSION @@ -1 +1 @@ -v2186 \ No newline at end of file +v2205 \ No newline at end of file diff --git a/plugins/stripe-php/README.md b/plugins/stripe-php/README.md index b582cab9..722e958f 100644 --- a/plugins/stripe-php/README.md +++ b/plugins/stripe-php/README.md @@ -5,6 +5,9 @@ [![Total Downloads](https://poser.pugx.org/stripe/stripe-php/downloads.svg)](https://packagist.org/packages/stripe/stripe-php) [![License](https://poser.pugx.org/stripe/stripe-php/license.svg)](https://packagist.org/packages/stripe/stripe-php) +> [!TIP] +> Want to chat live with Stripe engineers? Join us on our [Discord server](https://stripe.com/go/discord/php). + The Stripe PHP library provides convenient access to the Stripe API from applications written in the PHP language. It includes a pre-defined set of classes for API resources that initialize themselves dynamically from API @@ -13,9 +16,9 @@ API. ## Requirements -PHP 5.6.0 and later. +PHP 7.2.0 and later. -Note that per our [language version support policy](https://docs.stripe.com/sdks/versioning?lang=php#stripe-sdk-language-version-support-policy), support for PHP 5.6, 7.0, and 7.1 will be removed in the March 2026 major version. +Note that per our [language version support policy](https://docs.stripe.com/sdks/versioning?lang=php#stripe-sdk-language-version-support-policy), support for PHP 7.2 and 7.3 will be removed soon, so upgrade your runtime if you're able to. Additional PHP versions will be dropped in future major versions, so upgrade to supported versions if possible. @@ -45,9 +48,9 @@ require_once '/path/to/stripe-php/init.php'; The bindings require the following extensions in order to work properly: -- [`curl`](https://secure.php.net/manual/en/book.curl.php), although you can use your own non-cURL client if you prefer -- [`json`](https://secure.php.net/manual/en/book.json.php) -- [`mbstring`](https://secure.php.net/manual/en/book.mbstring.php) (Multibyte String) +- [`curl`](https://secure.php.net/manual/en/book.curl.php), although you can use your own non-cURL client if you prefer +- [`json`](https://secure.php.net/manual/en/book.json.php) +- [`mbstring`](https://secure.php.net/manual/en/book.mbstring.php) (Multibyte String) If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available. @@ -206,7 +209,7 @@ You can disable this behavior if you prefer: ### How to use undocumented parameters and properties In some cases, you might encounter parameters on an API request or fields on an API response that aren’t available in the SDKs. -This might happen when they’re undocumented or when they’re in preview and you aren’t using a preview SDK. +This might happen when they’re undocumented or when they’re in preview and you aren’t using a preview SDK. See [undocumented params and properties](https://docs.stripe.com/sdks/server-side?lang=php#undocumented-params-and-fields) to send those parameters or access those fields. ### Public Preview SDKs diff --git a/plugins/stripe-php/VERSION b/plugins/stripe-php/VERSION index ab73a550..e88320d7 100644 --- a/plugins/stripe-php/VERSION +++ b/plugins/stripe-php/VERSION @@ -1 +1 @@ -19.4.1 +20.0.0 diff --git a/plugins/stripe-php/composer.json b/plugins/stripe-php/composer.json index 5bf2d54b..e2bd7120 100644 --- a/plugins/stripe-php/composer.json +++ b/plugins/stripe-php/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php": ">=5.6.0", + "php": ">=7.2.0", "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*" @@ -28,7 +28,10 @@ "autoload": { "psr-4": { "Stripe\\": "lib/" - } + }, + "files": [ + "lib/version_check.php" + ] }, "autoload-dev": { "psr-4": { @@ -45,9 +48,9 @@ }, "config": { "audit": { - "ignore": { - "PKSA-z3gr-8qht-p93v": "PHPUnit is only a dev dependency. Temporarily ignore PHPUnit security advisory to ensure continued support for PHP 5.6 in CI." - } + "ignore": { + "PKSA-z3gr-8qht-p93v": "PHPUnit is only a dev dependency. Temporarily ignore PHPUnit security advisory to ensure continued support for PHP 5.6 in CI." + } } } } diff --git a/plugins/stripe-php/init.php b/plugins/stripe-php/init.php index c809874e..08f3f52c 100644 --- a/plugins/stripe-php/init.php +++ b/plugins/stripe-php/init.php @@ -1,5 +1,7 @@ Accounts v2 API, in place of /v1/accounts and /v1/customers to represent a user. + * * This is an object representing a Stripe account. You can retrieve it to see * properties on the account like its current requirements or if the account is * enabled to make live charges or receive payouts. @@ -22,7 +24,7 @@ namespace Stripe; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property null|(object{annual_revenue?: null|(object{amount: null|int, currency: null|string, fiscal_year_end: null|string}&StripeObject), estimated_worker_count?: null|int, mcc: null|string, minority_owned_business_designation: null|string[], monthly_estimated_revenue?: (object{amount: int, currency: string}&StripeObject), name: null|string, product_description?: null|string, support_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), support_email: null|string, support_phone: null|string, support_url: null|string, url: null|string}&StripeObject) $business_profile Business information about the account. * @property null|string $business_type The business type. - * @property null|(object{acss_debit_payments?: string, affirm_payments?: string, afterpay_clearpay_payments?: string, alma_payments?: string, amazon_pay_payments?: string, au_becs_debit_payments?: string, bacs_debit_payments?: string, bancontact_payments?: string, bank_transfer_payments?: string, billie_payments?: string, blik_payments?: string, boleto_payments?: string, card_issuing?: string, card_payments?: string, cartes_bancaires_payments?: string, cashapp_payments?: string, crypto_payments?: string, eps_payments?: string, fpx_payments?: string, gb_bank_transfer_payments?: string, giropay_payments?: string, grabpay_payments?: string, ideal_payments?: string, india_international_payments?: string, jcb_payments?: string, jp_bank_transfer_payments?: string, kakao_pay_payments?: string, klarna_payments?: string, konbini_payments?: string, kr_card_payments?: string, legacy_payments?: string, link_payments?: string, mb_way_payments?: string, mobilepay_payments?: string, multibanco_payments?: string, mx_bank_transfer_payments?: string, naver_pay_payments?: string, nz_bank_account_becs_debit_payments?: string, oxxo_payments?: string, p24_payments?: string, pay_by_bank_payments?: string, payco_payments?: string, paynow_payments?: string, payto_payments?: string, pix_payments?: string, promptpay_payments?: string, revolut_pay_payments?: string, samsung_pay_payments?: string, satispay_payments?: string, sepa_bank_transfer_payments?: string, sepa_debit_payments?: string, sofort_payments?: string, swish_payments?: string, tax_reporting_us_1099_k?: string, tax_reporting_us_1099_misc?: string, transfers?: string, treasury?: string, twint_payments?: string, us_bank_account_ach_payments?: string, us_bank_transfer_payments?: string, zip_payments?: string}&StripeObject) $capabilities + * @property null|(object{acss_debit_payments?: string, affirm_payments?: string, afterpay_clearpay_payments?: string, alma_payments?: string, amazon_pay_payments?: string, au_becs_debit_payments?: string, bacs_debit_payments?: string, bancontact_payments?: string, bank_transfer_payments?: string, billie_payments?: string, blik_payments?: string, boleto_payments?: string, card_issuing?: string, card_payments?: string, cartes_bancaires_payments?: string, cashapp_payments?: string, crypto_payments?: string, eps_payments?: string, fpx_payments?: string, gb_bank_transfer_payments?: string, giropay_payments?: string, grabpay_payments?: string, ideal_payments?: string, india_international_payments?: string, jcb_payments?: string, jp_bank_transfer_payments?: string, kakao_pay_payments?: string, klarna_payments?: string, konbini_payments?: string, kr_card_payments?: string, legacy_payments?: string, link_payments?: string, mb_way_payments?: string, mobilepay_payments?: string, multibanco_payments?: string, mx_bank_transfer_payments?: string, naver_pay_payments?: string, nz_bank_account_becs_debit_payments?: string, oxxo_payments?: string, p24_payments?: string, pay_by_bank_payments?: string, payco_payments?: string, paynow_payments?: string, payto_payments?: string, pix_payments?: string, promptpay_payments?: string, revolut_pay_payments?: string, samsung_pay_payments?: string, satispay_payments?: string, sepa_bank_transfer_payments?: string, sepa_debit_payments?: string, sofort_payments?: string, swish_payments?: string, tax_reporting_us_1099_k?: string, tax_reporting_us_1099_misc?: string, transfers?: string, treasury?: string, twint_payments?: string, upi_payments?: string, us_bank_account_ach_payments?: string, us_bank_transfer_payments?: string, zip_payments?: string}&StripeObject) $capabilities * @property null|bool $charges_enabled Whether the account can process charges. * @property null|(object{address?: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), address_kana?: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string, town: null|string}&StripeObject), address_kanji?: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string, town: null|string}&StripeObject), directors_provided?: bool, directorship_declaration?: null|(object{date: null|int, ip: null|string, user_agent: null|string}&StripeObject), executives_provided?: bool, export_license_id?: string, export_purpose_code?: string, name?: null|string, name_kana?: null|string, name_kanji?: null|string, owners_provided?: bool, ownership_declaration?: null|(object{date: null|int, ip: null|string, user_agent: null|string}&StripeObject), ownership_exemption_reason?: string, phone?: null|string, registration_date?: (object{day: null|int, month: null|int, year: null|int}&StripeObject), representative_declaration?: null|(object{date: null|int, ip: null|string, user_agent: null|string}&StripeObject), structure?: string, tax_id_provided?: bool, tax_id_registrar?: string, vat_id_provided?: bool, verification?: null|(object{document: (object{back: null|File|string, details: null|string, details_code: null|string, front: null|File|string}&StripeObject)}&StripeObject)}&StripeObject) $company * @property null|(object{fees?: (object{payer: string}&StripeObject), is_controller?: bool, losses?: (object{payments: string}&StripeObject), requirement_collection?: string, stripe_dashboard?: (object{type: string}&StripeObject), type: string}&StripeObject) $controller @@ -71,7 +73,7 @@ class Account extends ApiResource * information during account onboarding. You can prefill any information on the * account. * - * @param null|array{account_token?: string, business_profile?: array{annual_revenue?: array{amount: int, currency: string, fiscal_year_end: string}, estimated_worker_count?: int, mcc?: string, minority_owned_business_designation?: string[], monthly_estimated_revenue?: array{amount: int, currency: string}, name?: string, product_description?: string, support_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, support_email?: string, support_phone?: string, support_url?: null|string, url?: string}, business_type?: string, capabilities?: array{acss_debit_payments?: array{requested?: bool}, affirm_payments?: array{requested?: bool}, afterpay_clearpay_payments?: array{requested?: bool}, alma_payments?: array{requested?: bool}, amazon_pay_payments?: array{requested?: bool}, au_becs_debit_payments?: array{requested?: bool}, bacs_debit_payments?: array{requested?: bool}, bancontact_payments?: array{requested?: bool}, bank_transfer_payments?: array{requested?: bool}, billie_payments?: array{requested?: bool}, blik_payments?: array{requested?: bool}, boleto_payments?: array{requested?: bool}, card_issuing?: array{requested?: bool}, card_payments?: array{requested?: bool}, cartes_bancaires_payments?: array{requested?: bool}, cashapp_payments?: array{requested?: bool}, crypto_payments?: array{requested?: bool}, eps_payments?: array{requested?: bool}, fpx_payments?: array{requested?: bool}, gb_bank_transfer_payments?: array{requested?: bool}, giropay_payments?: array{requested?: bool}, grabpay_payments?: array{requested?: bool}, ideal_payments?: array{requested?: bool}, india_international_payments?: array{requested?: bool}, jcb_payments?: array{requested?: bool}, jp_bank_transfer_payments?: array{requested?: bool}, kakao_pay_payments?: array{requested?: bool}, klarna_payments?: array{requested?: bool}, konbini_payments?: array{requested?: bool}, kr_card_payments?: array{requested?: bool}, legacy_payments?: array{requested?: bool}, link_payments?: array{requested?: bool}, mb_way_payments?: array{requested?: bool}, mobilepay_payments?: array{requested?: bool}, multibanco_payments?: array{requested?: bool}, mx_bank_transfer_payments?: array{requested?: bool}, naver_pay_payments?: array{requested?: bool}, nz_bank_account_becs_debit_payments?: array{requested?: bool}, oxxo_payments?: array{requested?: bool}, p24_payments?: array{requested?: bool}, pay_by_bank_payments?: array{requested?: bool}, payco_payments?: array{requested?: bool}, paynow_payments?: array{requested?: bool}, payto_payments?: array{requested?: bool}, pix_payments?: array{requested?: bool}, promptpay_payments?: array{requested?: bool}, revolut_pay_payments?: array{requested?: bool}, samsung_pay_payments?: array{requested?: bool}, satispay_payments?: array{requested?: bool}, sepa_bank_transfer_payments?: array{requested?: bool}, sepa_debit_payments?: array{requested?: bool}, sofort_payments?: array{requested?: bool}, swish_payments?: array{requested?: bool}, tax_reporting_us_1099_k?: array{requested?: bool}, tax_reporting_us_1099_misc?: array{requested?: bool}, transfers?: array{requested?: bool}, treasury?: array{requested?: bool}, twint_payments?: array{requested?: bool}, us_bank_account_ach_payments?: array{requested?: bool}, us_bank_transfer_payments?: array{requested?: bool}, zip_payments?: array{requested?: bool}}, company?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, directors_provided?: bool, directorship_declaration?: array{date?: int, ip?: string, user_agent?: string}, executives_provided?: bool, export_license_id?: string, export_purpose_code?: string, name?: string, name_kana?: string, name_kanji?: string, owners_provided?: bool, ownership_declaration?: array{date?: int, ip?: string, user_agent?: string}, ownership_exemption_reason?: null|string, phone?: string, registration_date?: null|array{day: int, month: int, year: int}, registration_number?: string, representative_declaration?: array{date?: int, ip?: string, user_agent?: string}, structure?: null|string, tax_id?: string, tax_id_registrar?: string, vat_id?: string, verification?: array{document?: array{back?: string, front?: string}}}, controller?: array{fees?: array{payer?: string}, losses?: array{payments?: string}, requirement_collection?: string, stripe_dashboard?: array{type?: string}}, country?: string, default_currency?: string, documents?: array{bank_account_ownership_verification?: array{files?: string[]}, company_license?: array{files?: string[]}, company_memorandum_of_association?: array{files?: string[]}, company_ministerial_decree?: array{files?: string[]}, company_registration_verification?: array{files?: string[]}, company_tax_id_verification?: array{files?: string[]}, proof_of_address?: array{files?: string[]}, proof_of_registration?: array{files?: string[], signer?: array{person?: string}}, proof_of_ultimate_beneficial_ownership?: array{files?: string[], signer?: array{person?: string}}}, email?: string, expand?: string[], external_account?: array|string, groups?: array{payments_pricing?: null|string}, individual?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, dob?: null|array{day: int, month: int, year: int}, email?: string, first_name?: string, first_name_kana?: string, first_name_kanji?: string, full_name_aliases?: null|string[], gender?: string, id_number?: string, id_number_secondary?: string, last_name?: string, last_name_kana?: string, last_name_kanji?: string, maiden_name?: string, metadata?: null|array, phone?: string, political_exposure?: string, registered_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, relationship?: array{director?: bool, executive?: bool, owner?: bool, percent_ownership?: null|float, title?: string}, ssn_last_4?: string, verification?: array{additional_document?: array{back?: string, front?: string}, document?: array{back?: string, front?: string}}}, metadata?: null|array, settings?: array{bacs_debit_payments?: array{display_name?: string}, branding?: array{icon?: string, logo?: string, primary_color?: string, secondary_color?: string}, card_issuing?: array{tos_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}, card_payments?: array{decline_on?: array{avs_failure?: bool, cvc_failure?: bool}, statement_descriptor_prefix?: string, statement_descriptor_prefix_kana?: null|string, statement_descriptor_prefix_kanji?: null|string}, invoices?: array{hosted_payment_method_save?: string}, payments?: array{statement_descriptor?: string, statement_descriptor_kana?: string, statement_descriptor_kanji?: string}, payouts?: array{debit_negative_balances?: bool, schedule?: array{delay_days?: array|int|string, interval?: string, monthly_anchor?: int, monthly_payout_days?: int[], weekly_anchor?: string, weekly_payout_days?: string[]}, statement_descriptor?: string}, treasury?: array{tos_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}}, tos_acceptance?: array{date?: int, ip?: string, service_agreement?: string, user_agent?: string}, type?: string} $params + * @param null|array{account_token?: string, business_profile?: array{annual_revenue?: array{amount: int, currency: string, fiscal_year_end: string}, estimated_worker_count?: int, mcc?: string, minority_owned_business_designation?: string[], monthly_estimated_revenue?: array{amount: int, currency: string}, name?: string, product_description?: string, support_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, support_email?: string, support_phone?: string, support_url?: null|string, url?: string}, business_type?: string, capabilities?: array{acss_debit_payments?: array{requested?: bool}, affirm_payments?: array{requested?: bool}, afterpay_clearpay_payments?: array{requested?: bool}, alma_payments?: array{requested?: bool}, amazon_pay_payments?: array{requested?: bool}, au_becs_debit_payments?: array{requested?: bool}, bacs_debit_payments?: array{requested?: bool}, bancontact_payments?: array{requested?: bool}, bank_transfer_payments?: array{requested?: bool}, billie_payments?: array{requested?: bool}, blik_payments?: array{requested?: bool}, boleto_payments?: array{requested?: bool}, card_issuing?: array{requested?: bool}, card_payments?: array{requested?: bool}, cartes_bancaires_payments?: array{requested?: bool}, cashapp_payments?: array{requested?: bool}, crypto_payments?: array{requested?: bool}, eps_payments?: array{requested?: bool}, fpx_payments?: array{requested?: bool}, gb_bank_transfer_payments?: array{requested?: bool}, giropay_payments?: array{requested?: bool}, grabpay_payments?: array{requested?: bool}, ideal_payments?: array{requested?: bool}, india_international_payments?: array{requested?: bool}, jcb_payments?: array{requested?: bool}, jp_bank_transfer_payments?: array{requested?: bool}, kakao_pay_payments?: array{requested?: bool}, klarna_payments?: array{requested?: bool}, konbini_payments?: array{requested?: bool}, kr_card_payments?: array{requested?: bool}, legacy_payments?: array{requested?: bool}, link_payments?: array{requested?: bool}, mb_way_payments?: array{requested?: bool}, mobilepay_payments?: array{requested?: bool}, multibanco_payments?: array{requested?: bool}, mx_bank_transfer_payments?: array{requested?: bool}, naver_pay_payments?: array{requested?: bool}, nz_bank_account_becs_debit_payments?: array{requested?: bool}, oxxo_payments?: array{requested?: bool}, p24_payments?: array{requested?: bool}, pay_by_bank_payments?: array{requested?: bool}, payco_payments?: array{requested?: bool}, paynow_payments?: array{requested?: bool}, payto_payments?: array{requested?: bool}, pix_payments?: array{requested?: bool}, promptpay_payments?: array{requested?: bool}, revolut_pay_payments?: array{requested?: bool}, samsung_pay_payments?: array{requested?: bool}, satispay_payments?: array{requested?: bool}, sepa_bank_transfer_payments?: array{requested?: bool}, sepa_debit_payments?: array{requested?: bool}, sofort_payments?: array{requested?: bool}, swish_payments?: array{requested?: bool}, tax_reporting_us_1099_k?: array{requested?: bool}, tax_reporting_us_1099_misc?: array{requested?: bool}, transfers?: array{requested?: bool}, treasury?: array{requested?: bool}, twint_payments?: array{requested?: bool}, upi_payments?: array{requested?: bool}, us_bank_account_ach_payments?: array{requested?: bool}, us_bank_transfer_payments?: array{requested?: bool}, zip_payments?: array{requested?: bool}}, company?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, directors_provided?: bool, directorship_declaration?: array{date?: int, ip?: string, user_agent?: string}, executives_provided?: bool, export_license_id?: string, export_purpose_code?: string, name?: string, name_kana?: string, name_kanji?: string, owners_provided?: bool, ownership_declaration?: array{date?: int, ip?: string, user_agent?: string}, ownership_exemption_reason?: null|string, phone?: string, registration_date?: null|array{day: int, month: int, year: int}, registration_number?: string, representative_declaration?: array{date?: int, ip?: string, user_agent?: string}, structure?: null|string, tax_id?: string, tax_id_registrar?: string, vat_id?: string, verification?: array{document?: array{back?: string, front?: string}}}, controller?: array{fees?: array{payer?: string}, losses?: array{payments?: string}, requirement_collection?: string, stripe_dashboard?: array{type?: string}}, country?: string, default_currency?: string, documents?: array{bank_account_ownership_verification?: array{files?: string[]}, company_license?: array{files?: string[]}, company_memorandum_of_association?: array{files?: string[]}, company_ministerial_decree?: array{files?: string[]}, company_registration_verification?: array{files?: string[]}, company_tax_id_verification?: array{files?: string[]}, proof_of_address?: array{files?: string[]}, proof_of_registration?: array{files?: string[], signer?: array{person?: string}}, proof_of_ultimate_beneficial_ownership?: array{files?: string[], signer?: array{person?: string}}}, email?: string, expand?: string[], external_account?: array|string, groups?: array{payments_pricing?: null|string}, individual?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, dob?: null|array{day: int, month: int, year: int}, email?: string, first_name?: string, first_name_kana?: string, first_name_kanji?: string, full_name_aliases?: null|string[], gender?: string, id_number?: string, id_number_secondary?: string, last_name?: string, last_name_kana?: string, last_name_kanji?: string, maiden_name?: string, metadata?: null|array, phone?: string, political_exposure?: string, registered_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, relationship?: array{director?: bool, executive?: bool, owner?: bool, percent_ownership?: null|float, title?: string}, ssn_last_4?: string, verification?: array{additional_document?: array{back?: string, front?: string}, document?: array{back?: string, front?: string}}}, metadata?: null|array, settings?: array{bacs_debit_payments?: array{display_name?: string}, branding?: array{icon?: string, logo?: string, primary_color?: string, secondary_color?: string}, card_issuing?: array{tos_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}, card_payments?: array{decline_on?: array{avs_failure?: bool, cvc_failure?: bool}, statement_descriptor_prefix?: string, statement_descriptor_prefix_kana?: null|string, statement_descriptor_prefix_kanji?: null|string}, invoices?: array{hosted_payment_method_save?: string}, payments?: array{statement_descriptor?: string, statement_descriptor_kana?: string, statement_descriptor_kanji?: string}, payouts?: array{debit_negative_balances?: bool, schedule?: array{delay_days?: array|int|string, interval?: string, monthly_anchor?: int, monthly_payout_days?: int[], weekly_anchor?: string, weekly_payout_days?: string[]}, statement_descriptor?: string}, treasury?: array{tos_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}}, tos_acceptance?: array{date?: int, ip?: string, service_agreement?: string, user_agent?: string}, type?: string} $params * @param null|array|string $options * * @return Account the created resource @@ -162,7 +164,7 @@ class Account extends ApiResource * more about updating accounts. * * @param string $id the ID of the resource to update - * @param null|array{account_token?: string, business_profile?: array{annual_revenue?: array{amount: int, currency: string, fiscal_year_end: string}, estimated_worker_count?: int, mcc?: string, minority_owned_business_designation?: string[], monthly_estimated_revenue?: array{amount: int, currency: string}, name?: string, product_description?: string, support_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, support_email?: string, support_phone?: string, support_url?: null|string, url?: string}, business_type?: string, capabilities?: array{acss_debit_payments?: array{requested?: bool}, affirm_payments?: array{requested?: bool}, afterpay_clearpay_payments?: array{requested?: bool}, alma_payments?: array{requested?: bool}, amazon_pay_payments?: array{requested?: bool}, au_becs_debit_payments?: array{requested?: bool}, bacs_debit_payments?: array{requested?: bool}, bancontact_payments?: array{requested?: bool}, bank_transfer_payments?: array{requested?: bool}, billie_payments?: array{requested?: bool}, blik_payments?: array{requested?: bool}, boleto_payments?: array{requested?: bool}, card_issuing?: array{requested?: bool}, card_payments?: array{requested?: bool}, cartes_bancaires_payments?: array{requested?: bool}, cashapp_payments?: array{requested?: bool}, crypto_payments?: array{requested?: bool}, eps_payments?: array{requested?: bool}, fpx_payments?: array{requested?: bool}, gb_bank_transfer_payments?: array{requested?: bool}, giropay_payments?: array{requested?: bool}, grabpay_payments?: array{requested?: bool}, ideal_payments?: array{requested?: bool}, india_international_payments?: array{requested?: bool}, jcb_payments?: array{requested?: bool}, jp_bank_transfer_payments?: array{requested?: bool}, kakao_pay_payments?: array{requested?: bool}, klarna_payments?: array{requested?: bool}, konbini_payments?: array{requested?: bool}, kr_card_payments?: array{requested?: bool}, legacy_payments?: array{requested?: bool}, link_payments?: array{requested?: bool}, mb_way_payments?: array{requested?: bool}, mobilepay_payments?: array{requested?: bool}, multibanco_payments?: array{requested?: bool}, mx_bank_transfer_payments?: array{requested?: bool}, naver_pay_payments?: array{requested?: bool}, nz_bank_account_becs_debit_payments?: array{requested?: bool}, oxxo_payments?: array{requested?: bool}, p24_payments?: array{requested?: bool}, pay_by_bank_payments?: array{requested?: bool}, payco_payments?: array{requested?: bool}, paynow_payments?: array{requested?: bool}, payto_payments?: array{requested?: bool}, pix_payments?: array{requested?: bool}, promptpay_payments?: array{requested?: bool}, revolut_pay_payments?: array{requested?: bool}, samsung_pay_payments?: array{requested?: bool}, satispay_payments?: array{requested?: bool}, sepa_bank_transfer_payments?: array{requested?: bool}, sepa_debit_payments?: array{requested?: bool}, sofort_payments?: array{requested?: bool}, swish_payments?: array{requested?: bool}, tax_reporting_us_1099_k?: array{requested?: bool}, tax_reporting_us_1099_misc?: array{requested?: bool}, transfers?: array{requested?: bool}, treasury?: array{requested?: bool}, twint_payments?: array{requested?: bool}, us_bank_account_ach_payments?: array{requested?: bool}, us_bank_transfer_payments?: array{requested?: bool}, zip_payments?: array{requested?: bool}}, company?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, directors_provided?: bool, directorship_declaration?: array{date?: int, ip?: string, user_agent?: string}, executives_provided?: bool, export_license_id?: string, export_purpose_code?: string, name?: string, name_kana?: string, name_kanji?: string, owners_provided?: bool, ownership_declaration?: array{date?: int, ip?: string, user_agent?: string}, ownership_exemption_reason?: null|string, phone?: string, registration_date?: null|array{day: int, month: int, year: int}, registration_number?: string, representative_declaration?: array{date?: int, ip?: string, user_agent?: string}, structure?: null|string, tax_id?: string, tax_id_registrar?: string, vat_id?: string, verification?: array{document?: array{back?: string, front?: string}}}, default_currency?: string, documents?: array{bank_account_ownership_verification?: array{files?: string[]}, company_license?: array{files?: string[]}, company_memorandum_of_association?: array{files?: string[]}, company_ministerial_decree?: array{files?: string[]}, company_registration_verification?: array{files?: string[]}, company_tax_id_verification?: array{files?: string[]}, proof_of_address?: array{files?: string[]}, proof_of_registration?: array{files?: string[], signer?: array{person?: string}}, proof_of_ultimate_beneficial_ownership?: array{files?: string[], signer?: array{person?: string}}}, email?: string, expand?: string[], external_account?: null|array|string, groups?: array{payments_pricing?: null|string}, individual?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, dob?: null|array{day: int, month: int, year: int}, email?: string, first_name?: string, first_name_kana?: string, first_name_kanji?: string, full_name_aliases?: null|string[], gender?: string, id_number?: string, id_number_secondary?: string, last_name?: string, last_name_kana?: string, last_name_kanji?: string, maiden_name?: string, metadata?: null|array, phone?: string, political_exposure?: string, registered_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, relationship?: array{director?: bool, executive?: bool, owner?: bool, percent_ownership?: null|float, title?: string}, ssn_last_4?: string, verification?: array{additional_document?: array{back?: string, front?: string}, document?: array{back?: string, front?: string}}}, metadata?: null|array, settings?: array{bacs_debit_payments?: array{display_name?: string}, branding?: array{icon?: string, logo?: string, primary_color?: string, secondary_color?: string}, card_issuing?: array{tos_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}, card_payments?: array{decline_on?: array{avs_failure?: bool, cvc_failure?: bool}, statement_descriptor_prefix?: string, statement_descriptor_prefix_kana?: null|string, statement_descriptor_prefix_kanji?: null|string}, invoices?: array{default_account_tax_ids?: null|string[], hosted_payment_method_save?: string}, payments?: array{statement_descriptor?: string, statement_descriptor_kana?: string, statement_descriptor_kanji?: string}, payouts?: array{debit_negative_balances?: bool, schedule?: array{delay_days?: array|int|string, interval?: string, monthly_anchor?: int, monthly_payout_days?: int[], weekly_anchor?: string, weekly_payout_days?: string[]}, statement_descriptor?: string}, treasury?: array{tos_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}}, tos_acceptance?: array{date?: int, ip?: string, service_agreement?: string, user_agent?: string}} $params + * @param null|array{account_token?: string, business_profile?: array{annual_revenue?: array{amount: int, currency: string, fiscal_year_end: string}, estimated_worker_count?: int, mcc?: string, minority_owned_business_designation?: string[], monthly_estimated_revenue?: array{amount: int, currency: string}, name?: string, product_description?: string, support_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, support_email?: string, support_phone?: string, support_url?: null|string, url?: string}, business_type?: string, capabilities?: array{acss_debit_payments?: array{requested?: bool}, affirm_payments?: array{requested?: bool}, afterpay_clearpay_payments?: array{requested?: bool}, alma_payments?: array{requested?: bool}, amazon_pay_payments?: array{requested?: bool}, au_becs_debit_payments?: array{requested?: bool}, bacs_debit_payments?: array{requested?: bool}, bancontact_payments?: array{requested?: bool}, bank_transfer_payments?: array{requested?: bool}, billie_payments?: array{requested?: bool}, blik_payments?: array{requested?: bool}, boleto_payments?: array{requested?: bool}, card_issuing?: array{requested?: bool}, card_payments?: array{requested?: bool}, cartes_bancaires_payments?: array{requested?: bool}, cashapp_payments?: array{requested?: bool}, crypto_payments?: array{requested?: bool}, eps_payments?: array{requested?: bool}, fpx_payments?: array{requested?: bool}, gb_bank_transfer_payments?: array{requested?: bool}, giropay_payments?: array{requested?: bool}, grabpay_payments?: array{requested?: bool}, ideal_payments?: array{requested?: bool}, india_international_payments?: array{requested?: bool}, jcb_payments?: array{requested?: bool}, jp_bank_transfer_payments?: array{requested?: bool}, kakao_pay_payments?: array{requested?: bool}, klarna_payments?: array{requested?: bool}, konbini_payments?: array{requested?: bool}, kr_card_payments?: array{requested?: bool}, legacy_payments?: array{requested?: bool}, link_payments?: array{requested?: bool}, mb_way_payments?: array{requested?: bool}, mobilepay_payments?: array{requested?: bool}, multibanco_payments?: array{requested?: bool}, mx_bank_transfer_payments?: array{requested?: bool}, naver_pay_payments?: array{requested?: bool}, nz_bank_account_becs_debit_payments?: array{requested?: bool}, oxxo_payments?: array{requested?: bool}, p24_payments?: array{requested?: bool}, pay_by_bank_payments?: array{requested?: bool}, payco_payments?: array{requested?: bool}, paynow_payments?: array{requested?: bool}, payto_payments?: array{requested?: bool}, pix_payments?: array{requested?: bool}, promptpay_payments?: array{requested?: bool}, revolut_pay_payments?: array{requested?: bool}, samsung_pay_payments?: array{requested?: bool}, satispay_payments?: array{requested?: bool}, sepa_bank_transfer_payments?: array{requested?: bool}, sepa_debit_payments?: array{requested?: bool}, sofort_payments?: array{requested?: bool}, swish_payments?: array{requested?: bool}, tax_reporting_us_1099_k?: array{requested?: bool}, tax_reporting_us_1099_misc?: array{requested?: bool}, transfers?: array{requested?: bool}, treasury?: array{requested?: bool}, twint_payments?: array{requested?: bool}, upi_payments?: array{requested?: bool}, us_bank_account_ach_payments?: array{requested?: bool}, us_bank_transfer_payments?: array{requested?: bool}, zip_payments?: array{requested?: bool}}, company?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, directors_provided?: bool, directorship_declaration?: array{date?: int, ip?: string, user_agent?: string}, executives_provided?: bool, export_license_id?: string, export_purpose_code?: string, name?: string, name_kana?: string, name_kanji?: string, owners_provided?: bool, ownership_declaration?: array{date?: int, ip?: string, user_agent?: string}, ownership_exemption_reason?: null|string, phone?: string, registration_date?: null|array{day: int, month: int, year: int}, registration_number?: string, representative_declaration?: array{date?: int, ip?: string, user_agent?: string}, structure?: null|string, tax_id?: string, tax_id_registrar?: string, vat_id?: string, verification?: array{document?: array{back?: string, front?: string}}}, default_currency?: string, documents?: array{bank_account_ownership_verification?: array{files?: string[]}, company_license?: array{files?: string[]}, company_memorandum_of_association?: array{files?: string[]}, company_ministerial_decree?: array{files?: string[]}, company_registration_verification?: array{files?: string[]}, company_tax_id_verification?: array{files?: string[]}, proof_of_address?: array{files?: string[]}, proof_of_registration?: array{files?: string[], signer?: array{person?: string}}, proof_of_ultimate_beneficial_ownership?: array{files?: string[], signer?: array{person?: string}}}, email?: string, expand?: string[], external_account?: null|array|string, groups?: array{payments_pricing?: null|string}, individual?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, dob?: null|array{day: int, month: int, year: int}, email?: string, first_name?: string, first_name_kana?: string, first_name_kanji?: string, full_name_aliases?: null|string[], gender?: string, id_number?: string, id_number_secondary?: string, last_name?: string, last_name_kana?: string, last_name_kanji?: string, maiden_name?: string, metadata?: null|array, phone?: string, political_exposure?: string, registered_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, relationship?: array{director?: bool, executive?: bool, owner?: bool, percent_ownership?: null|float, title?: string}, ssn_last_4?: string, verification?: array{additional_document?: array{back?: string, front?: string}, document?: array{back?: string, front?: string}}}, metadata?: null|array, settings?: array{bacs_debit_payments?: array{display_name?: string}, branding?: array{icon?: string, logo?: string, primary_color?: string, secondary_color?: string}, card_issuing?: array{tos_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}, card_payments?: array{decline_on?: array{avs_failure?: bool, cvc_failure?: bool}, statement_descriptor_prefix?: string, statement_descriptor_prefix_kana?: null|string, statement_descriptor_prefix_kanji?: null|string}, invoices?: array{default_account_tax_ids?: null|string[], hosted_payment_method_save?: string}, payments?: array{statement_descriptor?: string, statement_descriptor_kana?: string, statement_descriptor_kanji?: string}, payouts?: array{debit_negative_balances?: bool, schedule?: array{delay_days?: array|int|string, interval?: string, monthly_anchor?: int, monthly_payout_days?: int[], weekly_anchor?: string, weekly_payout_days?: string[]}, statement_descriptor?: string}, treasury?: array{tos_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}}, tos_acceptance?: array{date?: int, ip?: string, service_agreement?: string, user_agent?: string}} $params * @param null|array|string $opts * * @return Account the updated resource diff --git a/plugins/stripe-php/lib/AccountSession.php b/plugins/stripe-php/lib/AccountSession.php index 5222c5b6..3b9e1ea9 100644 --- a/plugins/stripe-php/lib/AccountSession.php +++ b/plugins/stripe-php/lib/AccountSession.php @@ -18,7 +18,7 @@ namespace Stripe; * @property string $client_secret

The client secret of this AccountSession. Used on the client to set up secure access to the given account.

The client secret can be used to provide access to account from your frontend. It should not be stored, logged, or exposed to anyone other than the connected account. Make sure that you have TLS enabled on any page that includes the client secret.

Refer to our docs to setup Connect embedded components and learn about how client_secret should be handled.

* @property (object{account_management: (object{enabled: bool, features: (object{disable_stripe_user_authentication: bool, external_account_collection: bool}&StripeObject)}&StripeObject), account_onboarding: (object{enabled: bool, features: (object{disable_stripe_user_authentication: bool, external_account_collection: bool}&StripeObject)}&StripeObject), balances: (object{enabled: bool, features: (object{disable_stripe_user_authentication: bool, edit_payout_schedule: bool, external_account_collection: bool, instant_payouts: bool, standard_payouts: bool}&StripeObject)}&StripeObject), disputes_list: (object{enabled: bool, features: (object{capture_payments: bool, destination_on_behalf_of_charge_management: bool, dispute_management: bool, refund_management: bool}&StripeObject)}&StripeObject), documents: (object{enabled: bool, features: (object{}&StripeObject)}&StripeObject), financial_account: (object{enabled: bool, features: (object{disable_stripe_user_authentication: bool, external_account_collection: bool, send_money: bool, transfer_balance: bool}&StripeObject)}&StripeObject), financial_account_transactions: (object{enabled: bool, features: (object{card_spend_dispute_management: bool}&StripeObject)}&StripeObject), instant_payouts_promotion: (object{enabled: bool, features: (object{disable_stripe_user_authentication: bool, external_account_collection: bool, instant_payouts: bool}&StripeObject)}&StripeObject), issuing_card: (object{enabled: bool, features: (object{card_management: bool, card_spend_dispute_management: bool, cardholder_management: bool, spend_control_management: bool}&StripeObject)}&StripeObject), issuing_cards_list: (object{enabled: bool, features: (object{card_management: bool, card_spend_dispute_management: bool, cardholder_management: bool, disable_stripe_user_authentication: bool, spend_control_management: bool}&StripeObject)}&StripeObject), notification_banner: (object{enabled: bool, features: (object{disable_stripe_user_authentication: bool, external_account_collection: bool}&StripeObject)}&StripeObject), payment_details: (object{enabled: bool, features: (object{capture_payments: bool, destination_on_behalf_of_charge_management: bool, dispute_management: bool, refund_management: bool}&StripeObject)}&StripeObject), payment_disputes: (object{enabled: bool, features: (object{destination_on_behalf_of_charge_management: bool, dispute_management: bool, refund_management: bool}&StripeObject)}&StripeObject), payments: (object{enabled: bool, features: (object{capture_payments: bool, destination_on_behalf_of_charge_management: bool, dispute_management: bool, refund_management: bool}&StripeObject)}&StripeObject), payout_details: (object{enabled: bool, features: (object{}&StripeObject)}&StripeObject), payouts: (object{enabled: bool, features: (object{disable_stripe_user_authentication: bool, edit_payout_schedule: bool, external_account_collection: bool, instant_payouts: bool, standard_payouts: bool}&StripeObject)}&StripeObject), payouts_list: (object{enabled: bool, features: (object{}&StripeObject)}&StripeObject), tax_registrations: (object{enabled: bool, features: (object{}&StripeObject)}&StripeObject), tax_settings: (object{enabled: bool, features: (object{}&StripeObject)}&StripeObject)}&StripeObject) $components * @property int $expires_at The timestamp at which this AccountSession will expire. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. */ class AccountSession extends ApiResource { diff --git a/plugins/stripe-php/lib/ApiRequestor.php b/plugins/stripe-php/lib/ApiRequestor.php index 6bf85474..6b226105 100644 --- a/plugins/stripe-php/lib/ApiRequestor.php +++ b/plugins/stripe-php/lib/ApiRequestor.php @@ -270,6 +270,16 @@ class ApiRequestor return Exception\IdempotencyException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code); // switchCases: The beginning of the section generated from our OpenAPI spec + case 'rate_limit': + return Exception\RateLimitException::factory( + $msg, + $rcode, + $rbody, + $resp, + $rheaders, + $code + ); + case 'temporary_session_expired': return Exception\TemporarySessionExpiredException::factory( $msg, @@ -385,6 +395,7 @@ class ApiRequestor ['CODEX_CI', 'codex_cli'], ['CURSOR_AGENT', 'cursor'], ['GEMINI_CLI', 'gemini_cli'], + ['OPENCLAW_SHELL', 'openclaw'], ['OPENCODE', 'open_code'], // aiAgents: The end of the section generated from our OpenAPI spec ]; @@ -419,8 +430,6 @@ class ApiRequestor $uaString = "Stripe/{$apiMode} PhpBindings/" . Stripe::VERSION; $langVersion = \PHP_VERSION; - $uname_disabled = self::_isDisabled(\ini_get('disable_functions'), 'php_uname'); - $uname = $uname_disabled ? '(disabled)' : \php_uname(); // Fallback to global configuration to maintain backwards compatibility. $appInfo = $appInfo ?: Stripe::getAppInfo(); @@ -428,9 +437,14 @@ class ApiRequestor 'bindings_version' => Stripe::VERSION, 'lang' => 'php', 'lang_version' => $langVersion, - 'publisher' => 'stripe', - 'uname' => $uname, ]; + if (Stripe::getEnableTelemetry()) { + $uname_disabled = self::_isDisabled(\ini_get('disable_functions'), 'php_uname'); + $ua['platform'] = $uname_disabled + ? '(disabled)' + // only get general platform information, e.g. `Darwin 25.3.0 arm64` + : \php_uname('s') . ' ' . \php_uname('r') . ' ' . \php_uname('m'); + } if ($clientInfo) { $ua = \array_merge($clientInfo, $ua); } diff --git a/plugins/stripe-php/lib/ApplePayDomain.php b/plugins/stripe-php/lib/ApplePayDomain.php index 0aa38422..da2c0964 100644 --- a/plugins/stripe-php/lib/ApplePayDomain.php +++ b/plugins/stripe-php/lib/ApplePayDomain.php @@ -9,7 +9,7 @@ namespace Stripe; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $domain_name - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. */ class ApplePayDomain extends ApiResource { diff --git a/plugins/stripe-php/lib/ApplicationFee.php b/plugins/stripe-php/lib/ApplicationFee.php index 32db7913..ac0241e7 100644 --- a/plugins/stripe-php/lib/ApplicationFee.php +++ b/plugins/stripe-php/lib/ApplicationFee.php @@ -16,7 +16,7 @@ namespace Stripe; * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property null|(object{charge?: string, payout?: string, type: string}&StripeObject) $fee_source Polymorphic source of the application fee. Includes the ID of the object the application fee was created from. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|Charge|string $originating_transaction ID of the corresponding charge on the platform account, if this fee was the result of a charge using the destination parameter. * @property bool $refunded Whether the fee has been fully refunded. If the fee is only partially refunded, this attribute will still be false. * @property Collection $refunds A list of refunds that have been applied to the fee. diff --git a/plugins/stripe-php/lib/Apps/Secret.php b/plugins/stripe-php/lib/Apps/Secret.php index 98ace562..1f746d01 100644 --- a/plugins/stripe-php/lib/Apps/Secret.php +++ b/plugins/stripe-php/lib/Apps/Secret.php @@ -20,7 +20,7 @@ namespace Stripe\Apps; * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|bool $deleted If true, indicates that this secret has been deleted * @property null|int $expires_at The Unix timestamp for the expiry time of the secret, after which the secret deletes. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property string $name A name for the secret that's unique within the scope. * @property null|string $payload The plaintext secret value to be stored. * @property (object{type: string, user?: string}&\Stripe\StripeObject) $scope diff --git a/plugins/stripe-php/lib/Balance.php b/plugins/stripe-php/lib/Balance.php index ef488325..3292ffc7 100644 --- a/plugins/stripe-php/lib/Balance.php +++ b/plugins/stripe-php/lib/Balance.php @@ -17,7 +17,7 @@ namespace Stripe; * @property null|(object{amount: int, currency: string, source_types?: (object{bank_account?: int, card?: int, fpx?: int}&StripeObject)}&StripeObject)[] $connect_reserved Funds held due to negative balances on connected accounts where account.controller.requirement_collection is application, which includes Custom accounts. You can find the connect reserve balance for each currency and payment type in the source_types property. * @property null|(object{amount: int, currency: string, net_available?: (object{amount: int, destination: string, source_types?: (object{bank_account?: int, card?: int, fpx?: int}&StripeObject)}&StripeObject)[], source_types?: (object{bank_account?: int, card?: int, fpx?: int}&StripeObject)}&StripeObject)[] $instant_available Funds that you can pay out using Instant Payouts. * @property null|(object{available: (object{amount: int, currency: string, source_types?: (object{bank_account?: int, card?: int, fpx?: int}&StripeObject)}&StripeObject)[]}&StripeObject) $issuing - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property (object{amount: int, currency: string, source_types?: (object{bank_account?: int, card?: int, fpx?: int}&StripeObject)}&StripeObject)[] $pending Funds that aren't available in the balance yet. You can find the pending balance for each currency and each payment type in the source_types property. * @property null|(object{available: (object{amount: int, currency: string, source_types?: (object{bank_account?: int, card?: int, fpx?: int}&StripeObject)}&StripeObject)[], pending: (object{amount: int, currency: string, source_types?: (object{bank_account?: int, card?: int, fpx?: int}&StripeObject)}&StripeObject)[]}&StripeObject) $refund_and_dispute_prefunding */ diff --git a/plugins/stripe-php/lib/Billing/Alert.php b/plugins/stripe-php/lib/Billing/Alert.php index 49fe58a0..9e54cf3a 100644 --- a/plugins/stripe-php/lib/Billing/Alert.php +++ b/plugins/stripe-php/lib/Billing/Alert.php @@ -10,7 +10,7 @@ namespace Stripe\Billing; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property string $alert_type Defines the type of the alert. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|string $status Status of the alert. This can be active, inactive or archived. * @property string $title Title of the alert. * @property null|(object{filters: null|((object{customer: null|string|\Stripe\Customer, type: string}&\Stripe\StripeObject))[], gte: int, meter: Meter|string, recurrence: string}&\Stripe\StripeObject) $usage_threshold Encapsulates configuration of the alert to monitor usage on a specific Billing Meter. diff --git a/plugins/stripe-php/lib/Billing/AlertTriggered.php b/plugins/stripe-php/lib/Billing/AlertTriggered.php index 8641dd38..b73f0b28 100644 --- a/plugins/stripe-php/lib/Billing/AlertTriggered.php +++ b/plugins/stripe-php/lib/Billing/AlertTriggered.php @@ -9,7 +9,7 @@ namespace Stripe\Billing; * @property Alert $alert A billing alert is a resource that notifies you when a certain usage threshold on a meter is crossed. For example, you might create a billing alert to notify you when a certain user made 100 API requests. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $customer ID of customer for which the alert triggered - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property int $value The value triggering the alert */ class AlertTriggered extends \Stripe\ApiResource diff --git a/plugins/stripe-php/lib/Billing/CreditBalanceSummary.php b/plugins/stripe-php/lib/Billing/CreditBalanceSummary.php index e767650e..2801352e 100644 --- a/plugins/stripe-php/lib/Billing/CreditBalanceSummary.php +++ b/plugins/stripe-php/lib/Billing/CreditBalanceSummary.php @@ -11,7 +11,7 @@ namespace Stripe\Billing; * @property ((object{available_balance: (object{monetary: null|(object{currency: string, value: int}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), ledger_balance: (object{monetary: null|(object{currency: string, value: int}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject)}&\Stripe\StripeObject))[] $balances The billing credit balances. One entry per credit grant currency. If a customer only has credit grants in a single currency, then this will have a single balance entry. * @property string|\Stripe\Customer $customer The customer the balance is for. * @property null|string $customer_account The account the balance is for. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. */ class CreditBalanceSummary extends \Stripe\SingletonApiResource { diff --git a/plugins/stripe-php/lib/Billing/CreditBalanceTransaction.php b/plugins/stripe-php/lib/Billing/CreditBalanceTransaction.php index 2d3be6f7..ddb7696f 100644 --- a/plugins/stripe-php/lib/Billing/CreditBalanceTransaction.php +++ b/plugins/stripe-php/lib/Billing/CreditBalanceTransaction.php @@ -14,7 +14,7 @@ namespace Stripe\Billing; * @property CreditGrant|string $credit_grant The credit grant associated with this credit balance transaction. * @property null|(object{amount: (object{monetary: null|(object{currency: string, value: int}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), credits_applied: null|(object{invoice: string|\Stripe\Invoice, invoice_line_item: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject) $debit Debit details for this credit balance transaction. Only present if type is debit. * @property int $effective_at The effective time of this credit balance transaction. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this credit balance transaction belongs to. * @property null|string $type The type of credit balance transaction (credit or debit). */ diff --git a/plugins/stripe-php/lib/Billing/CreditGrant.php b/plugins/stripe-php/lib/Billing/CreditGrant.php index 5d1f2add..881099d8 100644 --- a/plugins/stripe-php/lib/Billing/CreditGrant.php +++ b/plugins/stripe-php/lib/Billing/CreditGrant.php @@ -19,7 +19,7 @@ namespace Stripe\Billing; * @property null|string $customer_account ID of the account representing the customer receiving the billing credits * @property null|int $effective_at The time when the billing credits become effective-when they're eligible for use. * @property null|int $expires_at The time when the billing credits expire. If not present, the billing credits don't expire. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $name A descriptive name shown in dashboard. * @property null|int $priority The priority for applying this credit grant. The highest priority is 0 and the lowest is 100. diff --git a/plugins/stripe-php/lib/Billing/Meter.php b/plugins/stripe-php/lib/Billing/Meter.php index c5465856..21f30dee 100644 --- a/plugins/stripe-php/lib/Billing/Meter.php +++ b/plugins/stripe-php/lib/Billing/Meter.php @@ -17,7 +17,7 @@ namespace Stripe\Billing; * @property string $display_name The meter's name. * @property string $event_name The name of the meter event to record usage for. Corresponds with the event_name field on meter events. * @property null|string $event_time_window The time window which meter events have been pre-aggregated for, if any. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property string $status The meter's status. * @property (object{deactivated_at: null|int}&\Stripe\StripeObject) $status_transitions * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. diff --git a/plugins/stripe-php/lib/Billing/MeterEvent.php b/plugins/stripe-php/lib/Billing/MeterEvent.php index 96c19184..e12a69dc 100644 --- a/plugins/stripe-php/lib/Billing/MeterEvent.php +++ b/plugins/stripe-php/lib/Billing/MeterEvent.php @@ -11,7 +11,7 @@ namespace Stripe\Billing; * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $event_name The name of the meter event. Corresponds with the event_name field on a meter. * @property string $identifier A unique identifier for the event. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property \Stripe\StripeObject $payload The payload of the event. This contains the fields corresponding to a meter's customer_mapping.event_payload_key (default is stripe_customer_id) and value_settings.event_payload_key (default is value). Read more about the payload. * @property int $timestamp The timestamp passed in when creating the event. Measured in seconds since the Unix epoch. */ diff --git a/plugins/stripe-php/lib/Billing/MeterEventAdjustment.php b/plugins/stripe-php/lib/Billing/MeterEventAdjustment.php index a6742b46..842ed597 100644 --- a/plugins/stripe-php/lib/Billing/MeterEventAdjustment.php +++ b/plugins/stripe-php/lib/Billing/MeterEventAdjustment.php @@ -10,7 +10,7 @@ namespace Stripe\Billing; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property null|(object{identifier: null|string}&\Stripe\StripeObject) $cancel Specifies which event to cancel. * @property string $event_name The name of the meter event. Corresponds with the event_name field on a meter. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property string $status The meter event adjustment's status. * @property string $type Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet. */ diff --git a/plugins/stripe-php/lib/Billing/MeterEventSummary.php b/plugins/stripe-php/lib/Billing/MeterEventSummary.php index 008525a6..0ab36c90 100644 --- a/plugins/stripe-php/lib/Billing/MeterEventSummary.php +++ b/plugins/stripe-php/lib/Billing/MeterEventSummary.php @@ -14,7 +14,7 @@ namespace Stripe\Billing; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property float $aggregated_value Aggregated value of all the events within start_time (inclusive) and end_time (inclusive). The aggregation strategy is defined on meter via default_aggregation. * @property int $end_time End timestamp for this event summary (exclusive). Must be aligned with minute boundaries. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property string $meter The meter associated with this event summary. * @property int $start_time Start timestamp for this event summary (inclusive). Must be aligned with minute boundaries. */ diff --git a/plugins/stripe-php/lib/BillingPortal/Configuration.php b/plugins/stripe-php/lib/BillingPortal/Configuration.php index 4cc47d33..fb90e434 100644 --- a/plugins/stripe-php/lib/BillingPortal/Configuration.php +++ b/plugins/stripe-php/lib/BillingPortal/Configuration.php @@ -16,7 +16,7 @@ namespace Stripe\BillingPortal; * @property null|string $default_return_url The default URL to redirect customers to when they click on the portal's link to return to your website. This can be overriden when creating the session. * @property (object{customer_update: (object{allowed_updates: string[], enabled: bool}&\Stripe\StripeObject), invoice_history: (object{enabled: bool}&\Stripe\StripeObject), payment_method_update: (object{enabled: bool, payment_method_configuration: null|string}&\Stripe\StripeObject), subscription_cancel: (object{cancellation_reason: (object{enabled: bool, options: string[]}&\Stripe\StripeObject), enabled: bool, mode: string, proration_behavior: string}&\Stripe\StripeObject), subscription_update: (object{billing_cycle_anchor: null|string, default_allowed_updates: string[], enabled: bool, products?: null|((object{adjustable_quantity: (object{enabled: bool, maximum: null|int, minimum: int}&\Stripe\StripeObject), prices: string[], product: string}&\Stripe\StripeObject))[], proration_behavior: string, schedule_at_period_end: (object{conditions: (object{type: string}&\Stripe\StripeObject)[]}&\Stripe\StripeObject), trial_update_behavior: string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $features * @property bool $is_default Whether the configuration is the default. If true, this configuration can be managed in the Dashboard and portal sessions will use this configuration unless it is overriden when creating the session. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property (object{enabled: bool, url: null|string}&\Stripe\StripeObject) $login_page * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $name The name of the configuration. diff --git a/plugins/stripe-php/lib/BillingPortal/Session.php b/plugins/stripe-php/lib/BillingPortal/Session.php index b833a6e2..8be7a3d6 100644 --- a/plugins/stripe-php/lib/BillingPortal/Session.php +++ b/plugins/stripe-php/lib/BillingPortal/Session.php @@ -27,7 +27,7 @@ namespace Stripe\BillingPortal; * @property string $customer The ID of the customer for this session. * @property null|string $customer_account The ID of the account for this session. * @property null|(object{after_completion: (object{hosted_confirmation: null|(object{custom_message: null|string}&\Stripe\StripeObject), redirect: null|(object{return_url: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), subscription_cancel: null|(object{retention: null|(object{coupon_offer: null|(object{coupon: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), subscription: string}&\Stripe\StripeObject), subscription_update: null|(object{subscription: string}&\Stripe\StripeObject), subscription_update_confirm: null|(object{discounts: null|((object{coupon: null|string, promotion_code: null|string}&\Stripe\StripeObject))[], items: ((object{id: null|string, price: null|string, quantity?: int}&\Stripe\StripeObject))[], subscription: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject) $flow Information about a specific flow for the customer to go through. See the docs to learn more about using customer portal deep links and flows. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|string $locale The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the customer’s preferred_locales or browser’s locale is used. * @property null|string $on_behalf_of The account for which the session was created on behalf of. When specified, only subscriptions and invoices with this on_behalf_of account appear in the portal. For more information, see the docs. Use the Accounts API to modify the on_behalf_of account's branding settings, which the portal displays. * @property null|string $return_url The URL to redirect customers to when they click on the portal's link to return to your website. diff --git a/plugins/stripe-php/lib/CashBalance.php b/plugins/stripe-php/lib/CashBalance.php index fd0cbfe2..a9261494 100644 --- a/plugins/stripe-php/lib/CashBalance.php +++ b/plugins/stripe-php/lib/CashBalance.php @@ -11,7 +11,7 @@ namespace Stripe; * @property null|StripeObject $available A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0. Amounts are represented in the smallest currency unit. * @property string $customer The ID of the customer whose cash balance this object represents. * @property null|string $customer_account The ID of an Account representing a customer whose cash balance this object represents. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property (object{reconciliation_mode: string, using_merchant_default: bool}&StripeObject) $settings */ class CashBalance extends ApiResource diff --git a/plugins/stripe-php/lib/Charge.php b/plugins/stripe-php/lib/Charge.php index 73a86547..06d10b74 100644 --- a/plugins/stripe-php/lib/Charge.php +++ b/plugins/stripe-php/lib/Charge.php @@ -32,14 +32,14 @@ namespace Stripe; * @property null|string $failure_message Message to user further explaining reason for charge failure if available. * @property null|(object{stripe_report?: string, user_report?: string}&StripeObject) $fraud_details Information on fraud assessments for the charge. * @property null|(object{customer_reference?: string, line_items: ((object{discount_amount: null|int, product_code: string, product_description: string, quantity: null|int, tax_amount: null|int, unit_cost: null|int}&StripeObject))[], merchant_reference: string, shipping_address_zip?: string, shipping_amount?: int, shipping_from_zip?: string}&StripeObject) $level3 - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|Account|string $on_behalf_of The account (if any) the charge was made on behalf of without triggering an automatic transfer. See the Connect documentation for details. * @property null|(object{advice_code: null|string, network_advice_code: null|string, network_decline_code: null|string, network_status: null|string, reason: null|string, risk_level?: string, risk_score?: int, rule?: (object{action: string, id: string, predicate: string}&StripeObject)|string, seller_message: null|string, type: string}&StripeObject) $outcome Details about whether the payment was accepted, and why. See understanding declines for details. * @property bool $paid true if the charge succeeded, or was successfully authorized for later capture. * @property null|PaymentIntent|string $payment_intent ID of the PaymentIntent associated with this charge, if one exists. * @property null|string $payment_method ID of the payment method used in this charge. - * @property null|(object{ach_credit_transfer?: (object{account_number: null|string, bank_name: null|string, routing_number: null|string, swift_code: null|string}&StripeObject), ach_debit?: (object{account_holder_type: null|string, bank_name: null|string, country: null|string, fingerprint: null|string, last4: null|string, routing_number: null|string}&StripeObject), acss_debit?: (object{bank_name: null|string, expected_debit_date?: string, fingerprint: null|string, institution_number: null|string, last4: null|string, mandate?: string, transit_number: null|string}&StripeObject), affirm?: (object{location?: string, reader?: string, transaction_id: null|string}&StripeObject), afterpay_clearpay?: (object{order_id: null|string, reference: null|string}&StripeObject), alipay?: (object{buyer_id?: string, fingerprint: null|string, transaction_id: null|string}&StripeObject), alma?: (object{installments?: (object{count: int}&StripeObject), transaction_id: null|string}&StripeObject), amazon_pay?: (object{funding?: (object{card?: (object{brand: null|string, country: null|string, exp_month: null|int, exp_year: null|int, funding: null|string, last4: null|string}&StripeObject), type: null|string}&StripeObject), transaction_id: null|string}&StripeObject), au_becs_debit?: (object{bsb_number: null|string, expected_debit_date?: string, fingerprint: null|string, last4: null|string, mandate?: string}&StripeObject), bacs_debit?: (object{expected_debit_date?: string, fingerprint: null|string, last4: null|string, mandate: null|string, sort_code: null|string}&StripeObject), bancontact?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, preferred_language: null|string, verified_name: null|string}&StripeObject), billie?: (object{transaction_id: null|string}&StripeObject), blik?: (object{buyer_id: null|string}&StripeObject), boleto?: (object{tax_id: string}&StripeObject), card?: (object{amount_authorized: null|int, authorization_code: null|string, brand: null|string, capture_before?: int, checks: null|(object{address_line1_check: null|string, address_postal_code_check: null|string, cvc_check: null|string}&StripeObject), country: null|string, description?: null|string, exp_month: int, exp_year: int, extended_authorization?: (object{status: string}&StripeObject), fingerprint?: null|string, funding: null|string, iin?: null|string, incremental_authorization?: (object{status: string}&StripeObject), installments: null|(object{plan: null|(object{count: null|int, interval: null|string, type: string}&StripeObject)}&StripeObject), issuer?: null|string, last4: null|string, mandate: null|string, moto?: null|bool, multicapture?: (object{status: string}&StripeObject), network: null|string, network_token?: null|(object{used: bool}&StripeObject), network_transaction_id: null|string, overcapture?: (object{maximum_amount_capturable: int, status: string}&StripeObject), regulated_status: null|string, three_d_secure: null|(object{authentication_flow: null|string, electronic_commerce_indicator: null|string, exemption_indicator: null|string, exemption_indicator_applied?: bool, result: null|string, result_reason: null|string, transaction_id: null|string, version: null|string}&StripeObject), wallet: null|(object{amex_express_checkout?: (object{}&StripeObject), apple_pay?: (object{}&StripeObject), dynamic_last4: null|string, google_pay?: (object{}&StripeObject), link?: (object{}&StripeObject), masterpass?: (object{billing_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, shipping_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject)}&StripeObject), samsung_pay?: (object{}&StripeObject), type: string, visa_checkout?: (object{billing_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, shipping_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject)}&StripeObject)}&StripeObject)}&StripeObject), card_present?: (object{amount_authorized: null|int, brand: null|string, brand_product: null|string, capture_before?: int, cardholder_name: null|string, country: null|string, description?: null|string, emv_auth_data: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, generated_card: null|string, iin?: null|string, incremental_authorization_supported: bool, issuer?: null|string, last4: null|string, location?: string, network: null|string, network_transaction_id: null|string, offline: null|(object{stored_at: null|int, type: null|string}&StripeObject), overcapture_supported: bool, preferred_locales: null|string[], read_method: null|string, reader?: string, receipt: null|(object{account_type?: string, application_cryptogram: null|string, application_preferred_name: null|string, authorization_code: null|string, authorization_response_code: null|string, cardholder_verification_method: null|string, dedicated_file_name: null|string, terminal_verification_results: null|string, transaction_status_information: null|string}&StripeObject), wallet?: (object{type: string}&StripeObject)}&StripeObject), cashapp?: (object{buyer_id: null|string, cashtag: null|string, transaction_id: null|string}&StripeObject), crypto?: (object{buyer_address?: string, network?: string, token_currency?: string, transaction_hash?: string}&StripeObject), customer_balance?: (object{}&StripeObject), eps?: (object{bank: null|string, verified_name: null|string}&StripeObject), fpx?: (object{account_holder_type: null|string, bank: string, transaction_id: null|string}&StripeObject), giropay?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, verified_name: null|string}&StripeObject), grabpay?: (object{transaction_id: null|string}&StripeObject), ideal?: (object{bank: null|string, bic: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, transaction_id: null|string, verified_name: null|string}&StripeObject), interac_present?: (object{brand: null|string, cardholder_name: null|string, country: null|string, description?: null|string, emv_auth_data: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, generated_card: null|string, iin?: null|string, issuer?: null|string, last4: null|string, location?: string, network: null|string, network_transaction_id: null|string, preferred_locales: null|string[], read_method: null|string, reader?: string, receipt: null|(object{account_type?: string, application_cryptogram: null|string, application_preferred_name: null|string, authorization_code: null|string, authorization_response_code: null|string, cardholder_verification_method: null|string, dedicated_file_name: null|string, terminal_verification_results: null|string, transaction_status_information: null|string}&StripeObject)}&StripeObject), kakao_pay?: (object{buyer_id: null|string, transaction_id: null|string}&StripeObject), klarna?: (object{payer_details: null|(object{address: null|(object{country: null|string}&StripeObject)}&StripeObject), payment_method_category: null|string, preferred_locale: null|string}&StripeObject), konbini?: (object{store: null|(object{chain: null|string}&StripeObject)}&StripeObject), kr_card?: (object{brand: null|string, buyer_id: null|string, last4: null|string, transaction_id: null|string}&StripeObject), link?: (object{country: null|string}&StripeObject), mb_way?: (object{}&StripeObject), mobilepay?: (object{card: null|(object{brand: null|string, country: null|string, exp_month: null|int, exp_year: null|int, last4: null|string}&StripeObject)}&StripeObject), multibanco?: (object{entity: null|string, reference: null|string}&StripeObject), naver_pay?: (object{buyer_id: null|string, transaction_id: null|string}&StripeObject), nz_bank_account?: (object{account_holder_name: null|string, bank_code: string, bank_name: string, branch_code: string, expected_debit_date?: string, last4: string, suffix: null|string}&StripeObject), oxxo?: (object{number: null|string}&StripeObject), p24?: (object{bank: null|string, reference: null|string, verified_name: null|string}&StripeObject), pay_by_bank?: (object{}&StripeObject), payco?: (object{buyer_id: null|string, transaction_id: null|string}&StripeObject), paynow?: (object{location?: string, reader?: string, reference: null|string}&StripeObject), paypal?: (object{country: null|string, payer_email: null|string, payer_id: null|string, payer_name: null|string, seller_protection: null|(object{dispute_categories: null|string[], status: string}&StripeObject), transaction_id: null|string}&StripeObject), payto?: (object{bsb_number: null|string, last4: null|string, mandate?: string, pay_id: null|string}&StripeObject), pix?: (object{bank_transaction_id?: null|string}&StripeObject), promptpay?: (object{reference: null|string}&StripeObject), revolut_pay?: (object{funding?: (object{card?: (object{brand: null|string, country: null|string, exp_month: null|int, exp_year: null|int, funding: null|string, last4: null|string}&StripeObject), type: null|string}&StripeObject), transaction_id: null|string}&StripeObject), samsung_pay?: (object{buyer_id: null|string, transaction_id: null|string}&StripeObject), satispay?: (object{transaction_id: null|string}&StripeObject), sepa_credit_transfer?: (object{bank_name: null|string, bic: null|string, iban: null|string}&StripeObject), sepa_debit?: (object{bank_code: null|string, branch_code: null|string, country: null|string, expected_debit_date?: string, fingerprint: null|string, last4: null|string, mandate: null|string}&StripeObject), sofort?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, country: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, preferred_language: null|string, verified_name: null|string}&StripeObject), stripe_account?: (object{}&StripeObject), swish?: (object{fingerprint: null|string, payment_reference: null|string, verified_phone_last4: null|string}&StripeObject), twint?: (object{}&StripeObject), type: string, us_bank_account?: (object{account_holder_type: null|string, account_type: null|string, bank_name: null|string, expected_debit_date?: string, fingerprint: null|string, last4: null|string, mandate?: Mandate|string, payment_reference: null|string, routing_number: null|string}&StripeObject), wechat?: (object{}&StripeObject), wechat_pay?: (object{fingerprint: null|string, location?: string, reader?: string, transaction_id: null|string}&StripeObject), zip?: (object{}&StripeObject)}&StripeObject) $payment_method_details Details about the payment method at the time of the transaction. + * @property null|(object{ach_credit_transfer?: (object{account_number: null|string, bank_name: null|string, routing_number: null|string, swift_code: null|string}&StripeObject), ach_debit?: (object{account_holder_type: null|string, bank_name: null|string, country: null|string, fingerprint: null|string, last4: null|string, routing_number: null|string}&StripeObject), acss_debit?: (object{bank_name: null|string, expected_debit_date?: string, fingerprint: null|string, institution_number: null|string, last4: null|string, mandate?: string, transit_number: null|string}&StripeObject), affirm?: (object{location?: string, reader?: string, transaction_id: null|string}&StripeObject), afterpay_clearpay?: (object{order_id: null|string, reference: null|string}&StripeObject), alipay?: (object{buyer_id?: string, fingerprint: null|string, transaction_id: null|string}&StripeObject), alma?: (object{installments?: (object{count: int}&StripeObject), transaction_id: null|string}&StripeObject), amazon_pay?: (object{funding?: (object{card?: (object{brand: null|string, country: null|string, exp_month: null|int, exp_year: null|int, funding: null|string, last4: null|string}&StripeObject), type: null|string}&StripeObject), transaction_id: null|string}&StripeObject), au_becs_debit?: (object{bsb_number: null|string, expected_debit_date?: string, fingerprint: null|string, last4: null|string, mandate?: string}&StripeObject), bacs_debit?: (object{expected_debit_date?: string, fingerprint: null|string, last4: null|string, mandate: null|string, sort_code: null|string}&StripeObject), bancontact?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, preferred_language: null|string, verified_name: null|string}&StripeObject), billie?: (object{transaction_id: null|string}&StripeObject), blik?: (object{buyer_id: null|string}&StripeObject), boleto?: (object{tax_id: string}&StripeObject), card?: (object{amount_authorized: null|int, authorization_code: null|string, brand: null|string, capture_before?: int, checks: null|(object{address_line1_check: null|string, address_postal_code_check: null|string, cvc_check: null|string}&StripeObject), country: null|string, description?: null|string, exp_month: int, exp_year: int, extended_authorization?: (object{status: string}&StripeObject), fingerprint?: null|string, funding: null|string, iin?: null|string, incremental_authorization?: (object{status: string}&StripeObject), installments: null|(object{plan: null|(object{count: null|int, interval: null|string, type: string}&StripeObject)}&StripeObject), issuer?: null|string, last4: null|string, mandate: null|string, moto?: null|bool, multicapture?: (object{status: string}&StripeObject), network: null|string, network_token?: null|(object{used: bool}&StripeObject), network_transaction_id: null|string, overcapture?: (object{maximum_amount_capturable: int, status: string}&StripeObject), regulated_status: null|string, three_d_secure: null|(object{authentication_flow: null|string, electronic_commerce_indicator: null|string, exemption_indicator: null|string, exemption_indicator_applied?: bool, result: null|string, result_reason: null|string, transaction_id: null|string, version: null|string}&StripeObject), wallet: null|(object{amex_express_checkout?: (object{}&StripeObject), apple_pay?: (object{}&StripeObject), dynamic_last4: null|string, google_pay?: (object{}&StripeObject), link?: (object{}&StripeObject), masterpass?: (object{billing_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, shipping_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject)}&StripeObject), samsung_pay?: (object{}&StripeObject), type: string, visa_checkout?: (object{billing_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, shipping_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject)}&StripeObject)}&StripeObject)}&StripeObject), card_present?: (object{amount_authorized: null|int, brand: null|string, brand_product: null|string, capture_before?: int, cardholder_name: null|string, country: null|string, description?: null|string, emv_auth_data: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, generated_card: null|string, iin?: null|string, incremental_authorization_supported: bool, issuer?: null|string, last4: null|string, location?: string, network: null|string, network_transaction_id: null|string, offline: null|(object{stored_at: null|int, type: null|string}&StripeObject), overcapture_supported: bool, preferred_locales: null|string[], read_method: null|string, reader?: string, receipt: null|(object{account_type?: string, application_cryptogram: null|string, application_preferred_name: null|string, authorization_code: null|string, authorization_response_code: null|string, cardholder_verification_method: null|string, dedicated_file_name: null|string, terminal_verification_results: null|string, transaction_status_information: null|string}&StripeObject), wallet?: (object{type: string}&StripeObject)}&StripeObject), cashapp?: (object{buyer_id: null|string, cashtag: null|string, transaction_id: null|string}&StripeObject), crypto?: (object{buyer_address?: string, network?: string, token_currency?: string, transaction_hash?: string}&StripeObject), customer_balance?: (object{}&StripeObject), eps?: (object{bank: null|string, verified_name: null|string}&StripeObject), fpx?: (object{account_holder_type: null|string, bank: string, transaction_id: null|string}&StripeObject), giropay?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, verified_name: null|string}&StripeObject), grabpay?: (object{transaction_id: null|string}&StripeObject), ideal?: (object{bank: null|string, bic: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, transaction_id: null|string, verified_name: null|string}&StripeObject), interac_present?: (object{brand: null|string, cardholder_name: null|string, country: null|string, description?: null|string, emv_auth_data: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, generated_card: null|string, iin?: null|string, issuer?: null|string, last4: null|string, location?: string, network: null|string, network_transaction_id: null|string, preferred_locales: null|string[], read_method: null|string, reader?: string, receipt: null|(object{account_type?: string, application_cryptogram: null|string, application_preferred_name: null|string, authorization_code: null|string, authorization_response_code: null|string, cardholder_verification_method: null|string, dedicated_file_name: null|string, terminal_verification_results: null|string, transaction_status_information: null|string}&StripeObject)}&StripeObject), kakao_pay?: (object{buyer_id: null|string, transaction_id: null|string}&StripeObject), klarna?: (object{payer_details: null|(object{address: null|(object{country: null|string}&StripeObject)}&StripeObject), payment_method_category: null|string, preferred_locale: null|string}&StripeObject), konbini?: (object{store: null|(object{chain: null|string}&StripeObject)}&StripeObject), kr_card?: (object{brand: null|string, buyer_id: null|string, last4: null|string, transaction_id: null|string}&StripeObject), link?: (object{country: null|string}&StripeObject), mb_way?: (object{}&StripeObject), mobilepay?: (object{card: null|(object{brand: null|string, country: null|string, exp_month: null|int, exp_year: null|int, last4: null|string}&StripeObject)}&StripeObject), multibanco?: (object{entity: null|string, reference: null|string}&StripeObject), naver_pay?: (object{buyer_id: null|string, transaction_id: null|string}&StripeObject), nz_bank_account?: (object{account_holder_name: null|string, bank_code: string, bank_name: string, branch_code: string, expected_debit_date?: string, last4: string, suffix: null|string}&StripeObject), oxxo?: (object{number: null|string}&StripeObject), p24?: (object{bank: null|string, reference: null|string, verified_name: null|string}&StripeObject), pay_by_bank?: (object{}&StripeObject), payco?: (object{buyer_id: null|string, transaction_id: null|string}&StripeObject), paynow?: (object{location?: string, reader?: string, reference: null|string}&StripeObject), paypal?: (object{country: null|string, payer_email: null|string, payer_id: null|string, payer_name: null|string, seller_protection: null|(object{dispute_categories: null|string[], status: string}&StripeObject), transaction_id: null|string}&StripeObject), payto?: (object{bsb_number: null|string, last4: null|string, mandate?: string, pay_id: null|string}&StripeObject), pix?: (object{bank_transaction_id?: null|string}&StripeObject), promptpay?: (object{reference: null|string}&StripeObject), revolut_pay?: (object{funding?: (object{card?: (object{brand: null|string, country: null|string, exp_month: null|int, exp_year: null|int, funding: null|string, last4: null|string}&StripeObject), type: null|string}&StripeObject), transaction_id: null|string}&StripeObject), samsung_pay?: (object{buyer_id: null|string, transaction_id: null|string}&StripeObject), satispay?: (object{transaction_id: null|string}&StripeObject), sepa_credit_transfer?: (object{bank_name: null|string, bic: null|string, iban: null|string}&StripeObject), sepa_debit?: (object{bank_code: null|string, branch_code: null|string, country: null|string, expected_debit_date?: string, fingerprint: null|string, last4: null|string, mandate: null|string}&StripeObject), sofort?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, country: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, preferred_language: null|string, verified_name: null|string}&StripeObject), stripe_account?: (object{}&StripeObject), swish?: (object{fingerprint: null|string, payment_reference: null|string, verified_phone_last4: null|string}&StripeObject), twint?: (object{}&StripeObject), type: string, upi?: (object{vpa: null|string}&StripeObject), us_bank_account?: (object{account_holder_type: null|string, account_type: null|string, bank_name: null|string, expected_debit_date?: string, fingerprint: null|string, last4: null|string, mandate?: Mandate|string, payment_reference: null|string, routing_number: null|string}&StripeObject), wechat?: (object{}&StripeObject), wechat_pay?: (object{fingerprint: null|string, location?: string, reader?: string, transaction_id: null|string}&StripeObject), zip?: (object{}&StripeObject)}&StripeObject) $payment_method_details Details about the payment method at the time of the transaction. * @property null|(object{presentment_amount: int, presentment_currency: string}&StripeObject) $presentment_details * @property null|(object{session?: string}&StripeObject) $radar_options Options to configure Radar. See Radar Session for more information. * @property null|string $receipt_email This is the email address that the receipt for this charge was sent to. diff --git a/plugins/stripe-php/lib/Checkout/Session.php b/plugins/stripe-php/lib/Checkout/Session.php index 9a405abd..cae8dd38 100644 --- a/plugins/stripe-php/lib/Checkout/Session.php +++ b/plugins/stripe-php/lib/Checkout/Session.php @@ -49,10 +49,11 @@ namespace Stripe\Checkout; * @property null|((object{coupon: null|string|\Stripe\Coupon, promotion_code: null|string|\Stripe\PromotionCode}&\Stripe\StripeObject))[] $discounts List of coupons and promotion codes attached to the Checkout Session. * @property null|string[] $excluded_payment_method_types A list of the types of payment methods (e.g., card) that should be excluded from this Checkout Session. This should only be used when payment methods for this Checkout Session are managed through the Stripe Dashboard. * @property int $expires_at The timestamp at which the Checkout Session will expire. + * @property null|string $integration_identifier The integration identifier for this Checkout Session. Multiple Checkout Sessions can have the same integration identifier. * @property null|string|\Stripe\Invoice $invoice ID of the invoice created by the Checkout Session, if it exists. * @property null|(object{enabled: bool, invoice_data: (object{account_tax_ids: null|(string|\Stripe\TaxId)[], custom_fields: null|(object{name: string, value: string}&\Stripe\StripeObject)[], description: null|string, footer: null|string, issuer: null|(object{account?: string|\Stripe\Account, type: string}&\Stripe\StripeObject), metadata: null|\Stripe\StripeObject, rendering_options: null|(object{amount_tax_display: null|string, template: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject)}&\Stripe\StripeObject) $invoice_creation Details on the state of invoice creation for the Checkout Session. * @property null|\Stripe\Collection<\Stripe\LineItem> $line_items The line items purchased by the customer. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|string $locale The IETF language tag of the locale Checkout is displayed in. If blank or auto, the browser's locale is used. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $mode The mode of the Checkout Session. @@ -63,7 +64,7 @@ namespace Stripe\Checkout; * @property null|string|\Stripe\PaymentLink $payment_link The ID of the Payment Link that created this Session. * @property null|string $payment_method_collection Configure whether a Checkout Session should collect a payment method. Defaults to always. * @property null|(object{id: string, parent: null|string}&\Stripe\StripeObject) $payment_method_configuration_details Information about the payment method configuration used for this Checkout session if using dynamic payment methods. - * @property null|(object{acss_debit?: (object{currency?: string, mandate_options?: (object{custom_mandate_url?: string, default_for?: string[], interval_description: null|string, payment_schedule: null|string, transaction_type: null|string}&\Stripe\StripeObject), setup_future_usage?: string, target_date?: string, verification_method?: string}&\Stripe\StripeObject), affirm?: (object{capture_method?: string, setup_future_usage?: string}&\Stripe\StripeObject), afterpay_clearpay?: (object{capture_method?: string, setup_future_usage?: string}&\Stripe\StripeObject), alipay?: (object{setup_future_usage?: string}&\Stripe\StripeObject), alma?: (object{capture_method?: string}&\Stripe\StripeObject), amazon_pay?: (object{capture_method?: string, setup_future_usage?: string}&\Stripe\StripeObject), au_becs_debit?: (object{setup_future_usage?: string, target_date?: string}&\Stripe\StripeObject), bacs_debit?: (object{mandate_options?: (object{reference_prefix?: string}&\Stripe\StripeObject), setup_future_usage?: string, target_date?: string}&\Stripe\StripeObject), bancontact?: (object{setup_future_usage?: string}&\Stripe\StripeObject), billie?: (object{capture_method?: string}&\Stripe\StripeObject), boleto?: (object{expires_after_days: int, setup_future_usage?: string}&\Stripe\StripeObject), card?: (object{capture_method?: string, installments?: (object{enabled?: bool}&\Stripe\StripeObject), request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure: string, restrictions?: (object{brands_blocked?: string[]}&\Stripe\StripeObject), setup_future_usage?: string, statement_descriptor_suffix_kana?: string, statement_descriptor_suffix_kanji?: string}&\Stripe\StripeObject), cashapp?: (object{capture_method?: string, setup_future_usage?: string}&\Stripe\StripeObject), customer_balance?: (object{bank_transfer?: (object{eu_bank_transfer?: (object{country: string}&\Stripe\StripeObject), requested_address_types?: string[], type: null|string}&\Stripe\StripeObject), funding_type: null|string, setup_future_usage?: string}&\Stripe\StripeObject), eps?: (object{setup_future_usage?: string}&\Stripe\StripeObject), fpx?: (object{setup_future_usage?: string}&\Stripe\StripeObject), giropay?: (object{setup_future_usage?: string}&\Stripe\StripeObject), grabpay?: (object{setup_future_usage?: string}&\Stripe\StripeObject), ideal?: (object{setup_future_usage?: string}&\Stripe\StripeObject), kakao_pay?: (object{capture_method?: string, setup_future_usage?: string}&\Stripe\StripeObject), klarna?: (object{capture_method?: string, setup_future_usage?: string}&\Stripe\StripeObject), konbini?: (object{expires_after_days: null|int, setup_future_usage?: string}&\Stripe\StripeObject), kr_card?: (object{capture_method?: string, setup_future_usage?: string}&\Stripe\StripeObject), link?: (object{capture_method?: string, setup_future_usage?: string}&\Stripe\StripeObject), mobilepay?: (object{capture_method?: string, setup_future_usage?: string}&\Stripe\StripeObject), multibanco?: (object{setup_future_usage?: string}&\Stripe\StripeObject), naver_pay?: (object{capture_method?: string, setup_future_usage?: string}&\Stripe\StripeObject), oxxo?: (object{expires_after_days: int, setup_future_usage?: string}&\Stripe\StripeObject), p24?: (object{setup_future_usage?: string}&\Stripe\StripeObject), payco?: (object{capture_method?: string}&\Stripe\StripeObject), paynow?: (object{setup_future_usage?: string}&\Stripe\StripeObject), paypal?: (object{capture_method?: string, preferred_locale: null|string, reference: null|string, setup_future_usage?: string}&\Stripe\StripeObject), payto?: (object{mandate_options?: (object{amount: null|int, amount_type: null|string, end_date: null|string, payment_schedule: null|string, payments_per_period: null|int, purpose: null|string, start_date: null|string}&\Stripe\StripeObject), setup_future_usage?: string}&\Stripe\StripeObject), pix?: (object{amount_includes_iof?: string, expires_after_seconds: null|int, setup_future_usage?: string}&\Stripe\StripeObject), revolut_pay?: (object{capture_method?: string, setup_future_usage?: string}&\Stripe\StripeObject), samsung_pay?: (object{capture_method?: string}&\Stripe\StripeObject), satispay?: (object{capture_method?: string}&\Stripe\StripeObject), sepa_debit?: (object{mandate_options?: (object{reference_prefix?: string}&\Stripe\StripeObject), setup_future_usage?: string, target_date?: string}&\Stripe\StripeObject), sofort?: (object{setup_future_usage?: string}&\Stripe\StripeObject), swish?: (object{reference: null|string}&\Stripe\StripeObject), twint?: (object{setup_future_usage?: string}&\Stripe\StripeObject), us_bank_account?: (object{financial_connections?: (object{filters?: (object{account_subcategories?: string[]}&\Stripe\StripeObject), permissions?: string[], prefetch: null|string[], return_url?: string}&\Stripe\StripeObject), setup_future_usage?: string, target_date?: string, verification_method?: string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $payment_method_options Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession. + * @property null|(object{acss_debit?: (object{currency?: string, mandate_options?: (object{custom_mandate_url?: string, default_for?: string[], interval_description: null|string, payment_schedule: null|string, transaction_type: null|string}&\Stripe\StripeObject), setup_future_usage?: string, target_date?: string, verification_method?: string}&\Stripe\StripeObject), affirm?: (object{capture_method?: string, setup_future_usage?: string}&\Stripe\StripeObject), afterpay_clearpay?: (object{capture_method?: string, setup_future_usage?: string}&\Stripe\StripeObject), alipay?: (object{setup_future_usage?: string}&\Stripe\StripeObject), alma?: (object{capture_method?: string}&\Stripe\StripeObject), amazon_pay?: (object{capture_method?: string, setup_future_usage?: string}&\Stripe\StripeObject), au_becs_debit?: (object{setup_future_usage?: string, target_date?: string}&\Stripe\StripeObject), bacs_debit?: (object{mandate_options?: (object{reference_prefix?: string}&\Stripe\StripeObject), setup_future_usage?: string, target_date?: string}&\Stripe\StripeObject), bancontact?: (object{setup_future_usage?: string}&\Stripe\StripeObject), billie?: (object{capture_method?: string}&\Stripe\StripeObject), boleto?: (object{expires_after_days: int, setup_future_usage?: string}&\Stripe\StripeObject), card?: (object{capture_method?: string, installments?: (object{enabled?: bool}&\Stripe\StripeObject), request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure: string, restrictions?: (object{brands_blocked?: string[]}&\Stripe\StripeObject), setup_future_usage?: string, statement_descriptor_suffix_kana?: string, statement_descriptor_suffix_kanji?: string}&\Stripe\StripeObject), cashapp?: (object{capture_method?: string, setup_future_usage?: string}&\Stripe\StripeObject), customer_balance?: (object{bank_transfer?: (object{eu_bank_transfer?: (object{country: string}&\Stripe\StripeObject), requested_address_types?: string[], type: null|string}&\Stripe\StripeObject), funding_type: null|string, setup_future_usage?: string}&\Stripe\StripeObject), eps?: (object{setup_future_usage?: string}&\Stripe\StripeObject), fpx?: (object{setup_future_usage?: string}&\Stripe\StripeObject), giropay?: (object{setup_future_usage?: string}&\Stripe\StripeObject), grabpay?: (object{setup_future_usage?: string}&\Stripe\StripeObject), ideal?: (object{setup_future_usage?: string}&\Stripe\StripeObject), kakao_pay?: (object{capture_method?: string, setup_future_usage?: string}&\Stripe\StripeObject), klarna?: (object{capture_method?: string, setup_future_usage?: string}&\Stripe\StripeObject), konbini?: (object{expires_after_days: null|int, setup_future_usage?: string}&\Stripe\StripeObject), kr_card?: (object{capture_method?: string, setup_future_usage?: string}&\Stripe\StripeObject), link?: (object{capture_method?: string, setup_future_usage?: string}&\Stripe\StripeObject), mobilepay?: (object{capture_method?: string, setup_future_usage?: string}&\Stripe\StripeObject), multibanco?: (object{setup_future_usage?: string}&\Stripe\StripeObject), naver_pay?: (object{capture_method?: string, setup_future_usage?: string}&\Stripe\StripeObject), oxxo?: (object{expires_after_days: int, setup_future_usage?: string}&\Stripe\StripeObject), p24?: (object{setup_future_usage?: string}&\Stripe\StripeObject), payco?: (object{capture_method?: string}&\Stripe\StripeObject), paynow?: (object{setup_future_usage?: string}&\Stripe\StripeObject), paypal?: (object{capture_method?: string, preferred_locale: null|string, reference: null|string, setup_future_usage?: string}&\Stripe\StripeObject), payto?: (object{mandate_options?: (object{amount: null|int, amount_type: null|string, end_date: null|string, payment_schedule: null|string, payments_per_period: null|int, purpose: null|string, start_date: null|string}&\Stripe\StripeObject), setup_future_usage?: string}&\Stripe\StripeObject), pix?: (object{amount_includes_iof?: string, expires_after_seconds: null|int, setup_future_usage?: string}&\Stripe\StripeObject), revolut_pay?: (object{capture_method?: string, setup_future_usage?: string}&\Stripe\StripeObject), samsung_pay?: (object{capture_method?: string}&\Stripe\StripeObject), satispay?: (object{capture_method?: string}&\Stripe\StripeObject), sepa_debit?: (object{mandate_options?: (object{reference_prefix?: string}&\Stripe\StripeObject), setup_future_usage?: string, target_date?: string}&\Stripe\StripeObject), sofort?: (object{setup_future_usage?: string}&\Stripe\StripeObject), swish?: (object{reference: null|string}&\Stripe\StripeObject), twint?: (object{setup_future_usage?: string}&\Stripe\StripeObject), upi?: (object{mandate_options?: (object{amount: null|int, amount_type: null|string, description: null|string, end_date: null|int}&\Stripe\StripeObject), setup_future_usage?: string}&\Stripe\StripeObject), us_bank_account?: (object{financial_connections?: (object{filters?: (object{account_subcategories?: string[]}&\Stripe\StripeObject), permissions?: string[], prefetch: null|string[], return_url?: string}&\Stripe\StripeObject), setup_future_usage?: string, target_date?: string, verification_method?: string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $payment_method_options Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession. * @property string[] $payment_method_types A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept. * @property string $payment_status The payment status of the Checkout Session, one of paid, unpaid, or no_payment_required. You can use this value to decide when to fulfill your customer's order. * @property null|(object{update_shipping_details: null|string}&\Stripe\StripeObject) $permissions

This property is used to set up permissions for various actions (e.g., update) on the CheckoutSession object.

For specific permissions, please refer to their dedicated subsections, such as permissions.update_shipping_details.

@@ -83,7 +84,7 @@ namespace Stripe\Checkout; * @property null|string $success_url The URL the customer will be directed to after the payment or subscription creation is successful. * @property null|(object{enabled: bool, required: string}&\Stripe\StripeObject) $tax_id_collection * @property null|(object{amount_discount: int, amount_shipping: null|int, amount_tax: int, breakdown?: (object{discounts: (object{amount: int, discount: \Stripe\Discount}&\Stripe\StripeObject)[], taxes: ((object{amount: int, rate: \Stripe\TaxRate, taxability_reason: null|string, taxable_amount: null|int}&\Stripe\StripeObject))[]}&\Stripe\StripeObject)}&\Stripe\StripeObject) $total_details Tax and discount details for the computed total amount. - * @property null|string $ui_mode The UI mode of the Session. Defaults to hosted. + * @property null|string $ui_mode The UI mode of the Session. Defaults to hosted_page. * @property null|string $url The URL to the Checkout Session. Applies to Checkout Sessions with ui_mode: hosted. Redirect customers to this URL to take them to Checkout. If you’re using Custom Domains, the URL will use your subdomain. Otherwise, it’ll use checkout.stripe.com. This value is only present when the session is active. * @property null|(object{link?: (object{display?: string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $wallet_options Wallet-specific configuration for this Checkout Session. */ @@ -127,14 +128,15 @@ class Session extends \Stripe\ApiResource const SUBMIT_TYPE_PAY = 'pay'; const SUBMIT_TYPE_SUBSCRIBE = 'subscribe'; - const UI_MODE_CUSTOM = 'custom'; - const UI_MODE_EMBEDDED = 'embedded'; - const UI_MODE_HOSTED = 'hosted'; + const UI_MODE_ELEMENTS = 'elements'; + const UI_MODE_EMBEDDED_PAGE = 'embedded_page'; + const UI_MODE_FORM = 'form'; + const UI_MODE_HOSTED_PAGE = 'hosted_page'; /** * Creates a Checkout Session object. * - * @param null|array{adaptive_pricing?: array{enabled?: bool}, after_expiration?: array{recovery?: array{allow_promotion_codes?: bool, enabled: bool}}, allow_promotion_codes?: bool, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, billing_address_collection?: string, branding_settings?: array{background_color?: null|string, border_style?: null|string, button_color?: null|string, display_name?: string, font_family?: null|string, icon?: array{file?: string, type: string, url?: string}, logo?: array{file?: string, type: string, url?: string}}, cancel_url?: string, client_reference_id?: string, consent_collection?: array{payment_method_reuse_agreement?: array{position: string}, promotions?: string, terms_of_service?: string}, currency?: string, custom_fields?: array{dropdown?: array{default_value?: string, options: array{label: string, value: string}[]}, key: string, label: array{custom: string, type: string}, numeric?: array{default_value?: string, maximum_length?: int, minimum_length?: int}, optional?: bool, text?: array{default_value?: string, maximum_length?: int, minimum_length?: int}, type: string}[], custom_text?: array{after_submit?: null|array{message: string}, shipping_address?: null|array{message: string}, submit?: null|array{message: string}, terms_of_service_acceptance?: null|array{message: string}}, customer?: string, customer_account?: string, customer_creation?: string, customer_email?: string, customer_update?: array{address?: string, name?: string, shipping?: string}, discounts?: array{coupon?: string, promotion_code?: string}[], excluded_payment_method_types?: string[], expand?: string[], expires_at?: int, invoice_creation?: array{enabled: bool, invoice_data?: array{account_tax_ids?: null|string[], custom_fields?: null|array{name: string, value: string}[], description?: string, footer?: string, issuer?: array{account?: string, type: string}, metadata?: array, rendering_options?: null|array{amount_tax_display?: null|string, template?: string}}}, line_items?: array{adjustable_quantity?: array{enabled: bool, maximum?: int, minimum?: int}, dynamic_tax_rates?: string[], metadata?: array, price?: string, price_data?: array{currency: string, product?: string, product_data?: array{description?: string, images?: string[], metadata?: array, name: string, tax_code?: string, unit_label?: string}, recurring?: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: string[]}[], locale?: string, metadata?: array, mode?: string, name_collection?: array{business?: array{enabled: bool, optional?: bool}, individual?: array{enabled: bool, optional?: bool}}, optional_items?: array{adjustable_quantity?: array{enabled: bool, maximum?: int, minimum?: int}, price: string, quantity: int}[], origin_context?: string, payment_intent_data?: array{application_fee_amount?: int, capture_method?: string, description?: string, metadata?: array, on_behalf_of?: string, receipt_email?: string, setup_future_usage?: string, shipping?: array{address: array{city?: string, country?: string, line1: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name: string, phone?: string, tracking_number?: string}, statement_descriptor?: string, statement_descriptor_suffix?: string, transfer_data?: array{amount?: int, destination: string}, transfer_group?: string}, payment_method_collection?: string, payment_method_configuration?: string, payment_method_data?: array{allow_redisplay?: string}, payment_method_options?: array{acss_debit?: array{currency?: string, mandate_options?: array{custom_mandate_url?: null|string, default_for?: string[], interval_description?: string, payment_schedule?: string, transaction_type?: string}, setup_future_usage?: string, target_date?: string, verification_method?: string}, affirm?: array{capture_method?: string, setup_future_usage?: string}, afterpay_clearpay?: array{capture_method?: string, setup_future_usage?: string}, alipay?: array{setup_future_usage?: string}, alma?: array{capture_method?: string}, amazon_pay?: array{capture_method?: string, setup_future_usage?: string}, au_becs_debit?: array{setup_future_usage?: string, target_date?: string}, bacs_debit?: array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: string, target_date?: string}, bancontact?: array{setup_future_usage?: string}, billie?: array{capture_method?: string}, boleto?: array{expires_after_days?: int, setup_future_usage?: string}, card?: array{capture_method?: string, installments?: array{enabled?: bool}, request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure?: string, restrictions?: array{brands_blocked?: string[]}, setup_future_usage?: string, statement_descriptor_suffix_kana?: string, statement_descriptor_suffix_kanji?: string}, cashapp?: array{capture_method?: string, setup_future_usage?: string}, customer_balance?: array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, requested_address_types?: string[], type: string}, funding_type?: string, setup_future_usage?: string}, demo_pay?: array{setup_future_usage?: string}, eps?: array{setup_future_usage?: string}, fpx?: array{setup_future_usage?: string}, giropay?: array{setup_future_usage?: string}, grabpay?: array{setup_future_usage?: string}, ideal?: array{setup_future_usage?: string}, kakao_pay?: array{capture_method?: string, setup_future_usage?: string}, klarna?: array{capture_method?: string, setup_future_usage?: string, subscriptions?: null|array{interval: string, interval_count?: int, name?: string, next_billing: array{amount: int, date: string}, reference: string}[]}, konbini?: array{expires_after_days?: int, setup_future_usage?: string}, kr_card?: array{capture_method?: string, setup_future_usage?: string}, link?: array{capture_method?: string, setup_future_usage?: string}, mobilepay?: array{capture_method?: string, setup_future_usage?: string}, multibanco?: array{setup_future_usage?: string}, naver_pay?: array{capture_method?: string, setup_future_usage?: string}, oxxo?: array{expires_after_days?: int, setup_future_usage?: string}, p24?: array{setup_future_usage?: string, tos_shown_and_accepted?: bool}, pay_by_bank?: array{}, payco?: array{capture_method?: string}, paynow?: array{setup_future_usage?: string}, paypal?: array{capture_method?: null|string, preferred_locale?: string, reference?: string, risk_correlation_id?: string, setup_future_usage?: null|string}, payto?: array{mandate_options?: array{amount?: null|int, amount_type?: null|string, end_date?: null|string, payment_schedule?: null|string, payments_per_period?: null|int, purpose?: null|string, start_date?: null|string}, setup_future_usage?: string}, pix?: array{amount_includes_iof?: string, expires_after_seconds?: int, setup_future_usage?: string}, revolut_pay?: array{capture_method?: string, setup_future_usage?: string}, samsung_pay?: array{capture_method?: string}, satispay?: array{capture_method?: string}, sepa_debit?: array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: string, target_date?: string}, sofort?: array{setup_future_usage?: string}, swish?: array{reference?: string}, twint?: array{setup_future_usage?: string}, us_bank_account?: array{financial_connections?: array{permissions?: string[], prefetch?: string[]}, setup_future_usage?: string, target_date?: string, verification_method?: string}, wechat_pay?: array{app_id?: string, client: string, setup_future_usage?: string}}, payment_method_types?: string[], permissions?: array{update_shipping_details?: string}, phone_number_collection?: array{enabled: bool}, redirect_on_completion?: string, return_url?: string, saved_payment_method_options?: array{allow_redisplay_filters?: string[], payment_method_remove?: string, payment_method_save?: string}, setup_intent_data?: array{description?: string, metadata?: array, on_behalf_of?: string}, shipping_address_collection?: array{allowed_countries: string[]}, shipping_options?: array{shipping_rate?: string, shipping_rate_data?: array{delivery_estimate?: array{maximum?: array{unit: string, value: int}, minimum?: array{unit: string, value: int}}, display_name: string, fixed_amount?: array{amount: int, currency: string, currency_options?: array}, metadata?: array, tax_behavior?: string, tax_code?: string, type?: string}}[], submit_type?: string, subscription_data?: array{application_fee_percent?: float, billing_cycle_anchor?: int, billing_mode?: array{flexible?: array{proration_discounts?: string}, type: string}, default_tax_rates?: string[], description?: string, invoice_settings?: array{issuer?: array{account?: string, type: string}}, metadata?: array, on_behalf_of?: string, proration_behavior?: string, transfer_data?: array{amount_percent?: float, destination: string}, trial_end?: int, trial_period_days?: int, trial_settings?: array{end_behavior: array{missing_payment_method: string}}}, success_url?: string, tax_id_collection?: array{enabled: bool, required?: string}, ui_mode?: string, wallet_options?: array{link?: array{display?: string}}} $params + * @param null|array{adaptive_pricing?: array{enabled?: bool}, after_expiration?: array{recovery?: array{allow_promotion_codes?: bool, enabled: bool}}, allow_promotion_codes?: bool, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, billing_address_collection?: string, branding_settings?: array{background_color?: null|string, border_style?: null|string, button_color?: null|string, display_name?: string, font_family?: null|string, icon?: array{file?: string, type: string, url?: string}, logo?: array{file?: string, type: string, url?: string}}, cancel_url?: string, client_reference_id?: string, consent_collection?: array{payment_method_reuse_agreement?: array{position: string}, promotions?: string, terms_of_service?: string}, currency?: string, custom_fields?: array{dropdown?: array{default_value?: string, options: array{label: string, value: string}[]}, key: string, label: array{custom: string, type: string}, numeric?: array{default_value?: string, maximum_length?: int, minimum_length?: int}, optional?: bool, text?: array{default_value?: string, maximum_length?: int, minimum_length?: int}, type: string}[], custom_text?: array{after_submit?: null|array{message: string}, shipping_address?: null|array{message: string}, submit?: null|array{message: string}, terms_of_service_acceptance?: null|array{message: string}}, customer?: string, customer_account?: string, customer_creation?: string, customer_email?: string, customer_update?: array{address?: string, name?: string, shipping?: string}, discounts?: array{coupon?: string, promotion_code?: string}[], excluded_payment_method_types?: string[], expand?: string[], expires_at?: int, integration_identifier?: string, invoice_creation?: array{enabled: bool, invoice_data?: array{account_tax_ids?: null|string[], custom_fields?: null|array{name: string, value: string}[], description?: string, footer?: string, issuer?: array{account?: string, type: string}, metadata?: array, rendering_options?: null|array{amount_tax_display?: null|string, template?: string}}}, line_items?: array{adjustable_quantity?: array{enabled: bool, maximum?: int, minimum?: int}, dynamic_tax_rates?: string[], metadata?: array, price?: string, price_data?: array{currency: string, product?: string, product_data?: array{description?: string, images?: string[], metadata?: array, name: string, tax_code?: string, unit_label?: string}, recurring?: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: string[]}[], locale?: string, metadata?: array, mode?: string, name_collection?: array{business?: array{enabled: bool, optional?: bool}, individual?: array{enabled: bool, optional?: bool}}, optional_items?: array{adjustable_quantity?: array{enabled: bool, maximum?: int, minimum?: int}, price: string, quantity: int}[], origin_context?: string, payment_intent_data?: array{application_fee_amount?: int, capture_method?: string, description?: string, metadata?: array, on_behalf_of?: string, receipt_email?: string, setup_future_usage?: string, shipping?: array{address: array{city?: string, country?: string, line1: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name: string, phone?: string, tracking_number?: string}, statement_descriptor?: string, statement_descriptor_suffix?: string, transfer_data?: array{amount?: int, destination: string}, transfer_group?: string}, payment_method_collection?: string, payment_method_configuration?: string, payment_method_data?: array{allow_redisplay?: string}, payment_method_options?: array{acss_debit?: array{currency?: string, mandate_options?: array{custom_mandate_url?: null|string, default_for?: string[], interval_description?: string, payment_schedule?: string, transaction_type?: string}, setup_future_usage?: string, target_date?: string, verification_method?: string}, affirm?: array{capture_method?: string, setup_future_usage?: string}, afterpay_clearpay?: array{capture_method?: string, setup_future_usage?: string}, alipay?: array{setup_future_usage?: string}, alma?: array{capture_method?: string}, amazon_pay?: array{capture_method?: string, setup_future_usage?: string}, au_becs_debit?: array{setup_future_usage?: string, target_date?: string}, bacs_debit?: array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: string, target_date?: string}, bancontact?: array{setup_future_usage?: string}, billie?: array{capture_method?: string}, boleto?: array{expires_after_days?: int, setup_future_usage?: string}, card?: array{capture_method?: string, installments?: array{enabled?: bool}, request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure?: string, restrictions?: array{brands_blocked?: string[]}, setup_future_usage?: string, statement_descriptor_suffix_kana?: string, statement_descriptor_suffix_kanji?: string}, cashapp?: array{capture_method?: string, setup_future_usage?: string}, crypto?: array{setup_future_usage?: string}, customer_balance?: array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, requested_address_types?: string[], type: string}, funding_type?: string, setup_future_usage?: string}, demo_pay?: array{setup_future_usage?: string}, eps?: array{setup_future_usage?: string}, fpx?: array{setup_future_usage?: string}, giropay?: array{setup_future_usage?: string}, grabpay?: array{setup_future_usage?: string}, ideal?: array{setup_future_usage?: string}, kakao_pay?: array{capture_method?: string, setup_future_usage?: string}, klarna?: array{capture_method?: string, setup_future_usage?: string, subscriptions?: null|array{interval: string, interval_count?: int, name?: string, next_billing: array{amount: int, date: string}, reference: string}[]}, konbini?: array{expires_after_days?: int, setup_future_usage?: string}, kr_card?: array{capture_method?: string, setup_future_usage?: string}, link?: array{capture_method?: string, setup_future_usage?: string}, mobilepay?: array{capture_method?: string, setup_future_usage?: string}, multibanco?: array{setup_future_usage?: string}, naver_pay?: array{capture_method?: string, setup_future_usage?: string}, oxxo?: array{expires_after_days?: int, setup_future_usage?: string}, p24?: array{setup_future_usage?: string, tos_shown_and_accepted?: bool}, pay_by_bank?: array{}, payco?: array{capture_method?: string}, paynow?: array{setup_future_usage?: string}, paypal?: array{capture_method?: null|string, preferred_locale?: string, reference?: string, risk_correlation_id?: string, setup_future_usage?: null|string}, payto?: array{mandate_options?: array{amount?: null|int, amount_type?: null|string, end_date?: null|string, payment_schedule?: null|string, payments_per_period?: null|int, purpose?: null|string, start_date?: null|string}, setup_future_usage?: string}, pix?: array{amount_includes_iof?: string, expires_after_seconds?: int, setup_future_usage?: string}, revolut_pay?: array{capture_method?: string, setup_future_usage?: string}, samsung_pay?: array{capture_method?: string}, satispay?: array{capture_method?: string}, sepa_debit?: array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: string, target_date?: string}, sofort?: array{setup_future_usage?: string}, swish?: array{reference?: string}, twint?: array{setup_future_usage?: string}, upi?: array{mandate_options?: array{amount?: int, amount_type?: string, description?: string, end_date?: int}, setup_future_usage?: null|string}, us_bank_account?: array{financial_connections?: array{permissions?: string[], prefetch?: string[]}, setup_future_usage?: string, target_date?: string, verification_method?: string}, wechat_pay?: array{app_id?: string, client: string, setup_future_usage?: string}}, payment_method_types?: string[], permissions?: array{update_shipping_details?: string}, phone_number_collection?: array{enabled: bool}, redirect_on_completion?: string, return_url?: string, saved_payment_method_options?: array{allow_redisplay_filters?: string[], payment_method_remove?: string, payment_method_save?: string}, setup_intent_data?: array{description?: string, metadata?: array, on_behalf_of?: string}, shipping_address_collection?: array{allowed_countries: string[]}, shipping_options?: array{shipping_rate?: string, shipping_rate_data?: array{delivery_estimate?: array{maximum?: array{unit: string, value: int}, minimum?: array{unit: string, value: int}}, display_name: string, fixed_amount?: array{amount: int, currency: string, currency_options?: array}, metadata?: array, tax_behavior?: string, tax_code?: string, type?: string}}[], submit_type?: string, subscription_data?: array{application_fee_percent?: float, billing_cycle_anchor?: int, billing_mode?: array{flexible?: array{proration_discounts?: string}, type: string}, default_tax_rates?: string[], description?: string, invoice_settings?: array{issuer?: array{account?: string, type: string}}, metadata?: array, on_behalf_of?: string, pending_invoice_item_interval?: array{interval: string, interval_count?: int}, proration_behavior?: string, transfer_data?: array{amount_percent?: float, destination: string}, trial_end?: int, trial_period_days?: int, trial_settings?: array{end_behavior: array{missing_payment_method: string}}}, success_url?: string, tax_id_collection?: array{enabled: bool, required?: string}, ui_mode?: string, wallet_options?: array{link?: array{display?: string}}} $params * @param null|array|string $options * * @return Session the created resource diff --git a/plugins/stripe-php/lib/Climate/Supplier.php b/plugins/stripe-php/lib/Climate/Supplier.php index 02044540..8fe52c2f 100644 --- a/plugins/stripe-php/lib/Climate/Supplier.php +++ b/plugins/stripe-php/lib/Climate/Supplier.php @@ -22,6 +22,7 @@ class Supplier extends \Stripe\ApiResource const REMOVAL_PATHWAY_BIOMASS_CARBON_REMOVAL_AND_STORAGE = 'biomass_carbon_removal_and_storage'; const REMOVAL_PATHWAY_DIRECT_AIR_CAPTURE = 'direct_air_capture'; const REMOVAL_PATHWAY_ENHANCED_WEATHERING = 'enhanced_weathering'; + const REMOVAL_PATHWAY_MARINE_CARBON_REMOVAL = 'marine_carbon_removal'; /** * Lists all available Climate supplier objects. diff --git a/plugins/stripe-php/lib/ConfirmationToken.php b/plugins/stripe-php/lib/ConfirmationToken.php index 94c5f6f3..020acf4f 100644 --- a/plugins/stripe-php/lib/ConfirmationToken.php +++ b/plugins/stripe-php/lib/ConfirmationToken.php @@ -17,11 +17,11 @@ namespace Stripe; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|int $expires_at Time at which this ConfirmationToken expires and can no longer be used to confirm a PaymentIntent or SetupIntent. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|(object{customer_acceptance: (object{online: null|(object{ip_address: null|string, user_agent: null|string}&StripeObject), type: string}&StripeObject)}&StripeObject) $mandate_data Data used for generating a Mandate. * @property null|string $payment_intent ID of the PaymentIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used. * @property null|(object{card: null|(object{cvc_token: null|string, installments?: (object{plan?: (object{count: null|int, interval: null|string, type: string}&StripeObject)}&StripeObject)}&StripeObject)}&StripeObject) $payment_method_options Payment-method-specific configuration for this ConfirmationToken. - * @property null|(object{acss_debit?: (object{bank_name: null|string, fingerprint: null|string, institution_number: null|string, last4: null|string, transit_number: null|string}&StripeObject), affirm?: (object{}&StripeObject), afterpay_clearpay?: (object{}&StripeObject), alipay?: (object{}&StripeObject), allow_redisplay?: string, alma?: (object{}&StripeObject), amazon_pay?: (object{}&StripeObject), au_becs_debit?: (object{bsb_number: null|string, fingerprint: null|string, last4: null|string}&StripeObject), bacs_debit?: (object{fingerprint: null|string, last4: null|string, sort_code: null|string}&StripeObject), bancontact?: (object{}&StripeObject), billie?: (object{}&StripeObject), billing_details: (object{address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, phone: null|string, tax_id: null|string}&StripeObject), blik?: (object{}&StripeObject), boleto?: (object{tax_id: string}&StripeObject), card?: (object{brand: string, checks: null|(object{address_line1_check: null|string, address_postal_code_check: null|string, cvc_check: null|string}&StripeObject), country: null|string, description?: null|string, display_brand: null|string, exp_month: int, exp_year: int, fingerprint?: null|string, funding: string, generated_from: null|(object{charge: null|string, payment_method_details: null|(object{card_present?: (object{amount_authorized: null|int, brand: null|string, brand_product: null|string, capture_before?: int, cardholder_name: null|string, country: null|string, description?: null|string, emv_auth_data: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, generated_card: null|string, iin?: null|string, incremental_authorization_supported: bool, issuer?: null|string, last4: null|string, location?: string, network: null|string, network_transaction_id: null|string, offline: null|(object{stored_at: null|int, type: null|string}&StripeObject), overcapture_supported: bool, preferred_locales: null|string[], read_method: null|string, reader?: string, receipt: null|(object{account_type?: string, application_cryptogram: null|string, application_preferred_name: null|string, authorization_code: null|string, authorization_response_code: null|string, cardholder_verification_method: null|string, dedicated_file_name: null|string, terminal_verification_results: null|string, transaction_status_information: null|string}&StripeObject), wallet?: (object{type: string}&StripeObject)}&StripeObject), type: string}&StripeObject), setup_attempt: null|SetupAttempt|string}&StripeObject), iin?: null|string, issuer?: null|string, last4: string, networks: null|(object{available: string[], preferred: null|string}&StripeObject), regulated_status: null|string, three_d_secure_usage: null|(object{supported: bool}&StripeObject), wallet: null|(object{amex_express_checkout?: (object{}&StripeObject), apple_pay?: (object{}&StripeObject), dynamic_last4: null|string, google_pay?: (object{}&StripeObject), link?: (object{}&StripeObject), masterpass?: (object{billing_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, shipping_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject)}&StripeObject), samsung_pay?: (object{}&StripeObject), type: string, visa_checkout?: (object{billing_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, shipping_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject)}&StripeObject)}&StripeObject)}&StripeObject), card_present?: (object{brand: null|string, brand_product: null|string, cardholder_name: null|string, country: null|string, description?: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, iin?: null|string, issuer?: null|string, last4: null|string, networks: null|(object{available: string[], preferred: null|string}&StripeObject), offline: null|(object{stored_at: null|int, type: null|string}&StripeObject), preferred_locales: null|string[], read_method: null|string, wallet?: (object{type: string}&StripeObject)}&StripeObject), cashapp?: (object{buyer_id: null|string, cashtag: null|string}&StripeObject), crypto?: (object{}&StripeObject), customer: null|Customer|string, customer_account: null|string, customer_balance?: (object{}&StripeObject), eps?: (object{bank: null|string}&StripeObject), fpx?: (object{account_holder_type: null|string, bank: string}&StripeObject), giropay?: (object{}&StripeObject), grabpay?: (object{}&StripeObject), ideal?: (object{bank: null|string, bic: null|string}&StripeObject), interac_present?: (object{brand: null|string, cardholder_name: null|string, country: null|string, description?: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, iin?: null|string, issuer?: null|string, last4: null|string, networks: null|(object{available: string[], preferred: null|string}&StripeObject), preferred_locales: null|string[], read_method: null|string}&StripeObject), kakao_pay?: (object{}&StripeObject), klarna?: (object{dob?: null|(object{day: null|int, month: null|int, year: null|int}&StripeObject)}&StripeObject), konbini?: (object{}&StripeObject), kr_card?: (object{brand: null|string, last4: null|string}&StripeObject), link?: (object{email: null|string, persistent_token?: string}&StripeObject), mb_way?: (object{}&StripeObject), mobilepay?: (object{}&StripeObject), multibanco?: (object{}&StripeObject), naver_pay?: (object{buyer_id: null|string, funding: string}&StripeObject), nz_bank_account?: (object{account_holder_name: null|string, bank_code: string, bank_name: string, branch_code: string, last4: string, suffix: null|string}&StripeObject), oxxo?: (object{}&StripeObject), p24?: (object{bank: null|string}&StripeObject), pay_by_bank?: (object{}&StripeObject), payco?: (object{}&StripeObject), paynow?: (object{}&StripeObject), paypal?: (object{country: null|string, payer_email: null|string, payer_id: null|string}&StripeObject), payto?: (object{bsb_number: null|string, last4: null|string, pay_id: null|string}&StripeObject), pix?: (object{}&StripeObject), promptpay?: (object{}&StripeObject), revolut_pay?: (object{}&StripeObject), samsung_pay?: (object{}&StripeObject), satispay?: (object{}&StripeObject), sepa_debit?: (object{bank_code: null|string, branch_code: null|string, country: null|string, fingerprint: null|string, generated_from: null|(object{charge: null|Charge|string, setup_attempt: null|SetupAttempt|string}&StripeObject), last4: null|string}&StripeObject), sofort?: (object{country: null|string}&StripeObject), swish?: (object{}&StripeObject), twint?: (object{}&StripeObject), type: string, us_bank_account?: (object{account_holder_type: null|string, account_type: null|string, bank_name: null|string, financial_connections_account: null|string, fingerprint: null|string, last4: null|string, networks: null|(object{preferred: null|string, supported: string[]}&StripeObject), routing_number: null|string, status_details: null|(object{blocked?: (object{network_code: null|string, reason: null|string}&StripeObject)}&StripeObject)}&StripeObject), wechat_pay?: (object{}&StripeObject), zip?: (object{}&StripeObject)}&StripeObject) $payment_method_preview Payment details collected by the Payment Element, used to create a PaymentMethod when a PaymentIntent or SetupIntent is confirmed with this ConfirmationToken. + * @property null|(object{acss_debit?: (object{bank_name: null|string, fingerprint: null|string, institution_number: null|string, last4: null|string, transit_number: null|string}&StripeObject), affirm?: (object{}&StripeObject), afterpay_clearpay?: (object{}&StripeObject), alipay?: (object{}&StripeObject), allow_redisplay?: string, alma?: (object{}&StripeObject), amazon_pay?: (object{}&StripeObject), au_becs_debit?: (object{bsb_number: null|string, fingerprint: null|string, last4: null|string}&StripeObject), bacs_debit?: (object{fingerprint: null|string, last4: null|string, sort_code: null|string}&StripeObject), bancontact?: (object{}&StripeObject), billie?: (object{}&StripeObject), billing_details: (object{address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, phone: null|string, tax_id: null|string}&StripeObject), blik?: (object{}&StripeObject), boleto?: (object{tax_id: string}&StripeObject), card?: (object{brand: string, checks: null|(object{address_line1_check: null|string, address_postal_code_check: null|string, cvc_check: null|string}&StripeObject), country: null|string, description?: null|string, display_brand: null|string, exp_month: int, exp_year: int, fingerprint?: null|string, funding: string, generated_from: null|(object{charge: null|string, payment_method_details: null|(object{card_present?: (object{amount_authorized: null|int, brand: null|string, brand_product: null|string, capture_before?: int, cardholder_name: null|string, country: null|string, description?: null|string, emv_auth_data: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, generated_card: null|string, iin?: null|string, incremental_authorization_supported: bool, issuer?: null|string, last4: null|string, location?: string, network: null|string, network_transaction_id: null|string, offline: null|(object{stored_at: null|int, type: null|string}&StripeObject), overcapture_supported: bool, preferred_locales: null|string[], read_method: null|string, reader?: string, receipt: null|(object{account_type?: string, application_cryptogram: null|string, application_preferred_name: null|string, authorization_code: null|string, authorization_response_code: null|string, cardholder_verification_method: null|string, dedicated_file_name: null|string, terminal_verification_results: null|string, transaction_status_information: null|string}&StripeObject), wallet?: (object{type: string}&StripeObject)}&StripeObject), type: string}&StripeObject), setup_attempt: null|SetupAttempt|string}&StripeObject), iin?: null|string, issuer?: null|string, last4: string, networks: null|(object{available: string[], preferred: null|string}&StripeObject), regulated_status: null|string, three_d_secure_usage: null|(object{supported: bool}&StripeObject), wallet: null|(object{amex_express_checkout?: (object{}&StripeObject), apple_pay?: (object{}&StripeObject), dynamic_last4: null|string, google_pay?: (object{}&StripeObject), link?: (object{}&StripeObject), masterpass?: (object{billing_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, shipping_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject)}&StripeObject), samsung_pay?: (object{}&StripeObject), type: string, visa_checkout?: (object{billing_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, shipping_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject)}&StripeObject)}&StripeObject)}&StripeObject), card_present?: (object{brand: null|string, brand_product: null|string, cardholder_name: null|string, country: null|string, description?: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, iin?: null|string, issuer?: null|string, last4: null|string, networks: null|(object{available: string[], preferred: null|string}&StripeObject), offline: null|(object{stored_at: null|int, type: null|string}&StripeObject), preferred_locales: null|string[], read_method: null|string, wallet?: (object{type: string}&StripeObject)}&StripeObject), cashapp?: (object{buyer_id: null|string, cashtag: null|string}&StripeObject), crypto?: (object{}&StripeObject), customer: null|Customer|string, customer_account: null|string, customer_balance?: (object{}&StripeObject), eps?: (object{bank: null|string}&StripeObject), fpx?: (object{account_holder_type: null|string, bank: string}&StripeObject), giropay?: (object{}&StripeObject), grabpay?: (object{}&StripeObject), ideal?: (object{bank: null|string, bic: null|string}&StripeObject), interac_present?: (object{brand: null|string, cardholder_name: null|string, country: null|string, description?: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, iin?: null|string, issuer?: null|string, last4: null|string, networks: null|(object{available: string[], preferred: null|string}&StripeObject), preferred_locales: null|string[], read_method: null|string}&StripeObject), kakao_pay?: (object{}&StripeObject), klarna?: (object{dob?: null|(object{day: null|int, month: null|int, year: null|int}&StripeObject)}&StripeObject), konbini?: (object{}&StripeObject), kr_card?: (object{brand: null|string, last4: null|string}&StripeObject), link?: (object{email: null|string, persistent_token?: string}&StripeObject), mb_way?: (object{}&StripeObject), mobilepay?: (object{}&StripeObject), multibanco?: (object{}&StripeObject), naver_pay?: (object{buyer_id: null|string, funding: string}&StripeObject), nz_bank_account?: (object{account_holder_name: null|string, bank_code: string, bank_name: string, branch_code: string, last4: string, suffix: null|string}&StripeObject), oxxo?: (object{}&StripeObject), p24?: (object{bank: null|string}&StripeObject), pay_by_bank?: (object{}&StripeObject), payco?: (object{}&StripeObject), paynow?: (object{}&StripeObject), paypal?: (object{country: null|string, payer_email: null|string, payer_id: null|string}&StripeObject), payto?: (object{bsb_number: null|string, last4: null|string, pay_id: null|string}&StripeObject), pix?: (object{}&StripeObject), promptpay?: (object{}&StripeObject), revolut_pay?: (object{}&StripeObject), samsung_pay?: (object{}&StripeObject), satispay?: (object{}&StripeObject), sepa_debit?: (object{bank_code: null|string, branch_code: null|string, country: null|string, fingerprint: null|string, generated_from: null|(object{charge: null|Charge|string, setup_attempt: null|SetupAttempt|string}&StripeObject), last4: null|string}&StripeObject), sofort?: (object{country: null|string}&StripeObject), swish?: (object{}&StripeObject), twint?: (object{}&StripeObject), type: string, upi?: (object{vpa: null|string}&StripeObject), us_bank_account?: (object{account_holder_type: null|string, account_type: null|string, bank_name: null|string, financial_connections_account: null|string, fingerprint: null|string, last4: null|string, networks: null|(object{preferred: null|string, supported: string[]}&StripeObject), routing_number: null|string, status_details: null|(object{blocked?: (object{network_code: null|string, reason: null|string}&StripeObject)}&StripeObject)}&StripeObject), wechat_pay?: (object{}&StripeObject), zip?: (object{}&StripeObject)}&StripeObject) $payment_method_preview Payment details collected by the Payment Element, used to create a PaymentMethod when a PaymentIntent or SetupIntent is confirmed with this ConfirmationToken. * @property null|string $return_url Return URL used to confirm the Intent. * @property null|string $setup_future_usage

Indicates that you intend to make future payments with this ConfirmationToken's payment method.

The presence of this property will attach the payment method to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete.

* @property null|string $setup_intent ID of the SetupIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used. diff --git a/plugins/stripe-php/lib/ConnectCollectionTransfer.php b/plugins/stripe-php/lib/ConnectCollectionTransfer.php index 837547a2..15a7d706 100644 --- a/plugins/stripe-php/lib/ConnectCollectionTransfer.php +++ b/plugins/stripe-php/lib/ConnectCollectionTransfer.php @@ -10,7 +10,7 @@ namespace Stripe; * @property int $amount Amount transferred, in cents (or local equivalent). * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property Account|string $destination ID of the account that funds are being collected for. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. */ class ConnectCollectionTransfer extends ApiResource { diff --git a/plugins/stripe-php/lib/Coupon.php b/plugins/stripe-php/lib/Coupon.php index 52051cf6..6071cf69 100644 --- a/plugins/stripe-php/lib/Coupon.php +++ b/plugins/stripe-php/lib/Coupon.php @@ -7,7 +7,7 @@ namespace Stripe; /** * A coupon contains information about a percent-off or amount-off discount you * might want to apply to a customer. Coupons may be applied to subscriptions, invoices, - * checkout sessions, quotes, and more. Coupons do not work with conventional one-off charges or payment intents. + * checkout sessions, quotes, and more. Coupons do not work with conventional one-off charges or payment intents. * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. @@ -18,7 +18,7 @@ namespace Stripe; * @property null|StripeObject $currency_options Coupons defined in each available currency option. Each key must be a three-letter ISO currency code and a supported currency. * @property string $duration One of forever, once, or repeating. Describes how long a customer who applies this coupon will get the discount. * @property null|int $duration_in_months If duration is repeating, the number of months the coupon applies. Null if coupon duration is forever or once. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|int $max_redemptions Maximum number of times this coupon can be redeemed, in total, across all customers, before it is no longer valid. * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $name Name of the coupon displayed to customers on for instance invoices or receipts. diff --git a/plugins/stripe-php/lib/CreditNote.php b/plugins/stripe-php/lib/CreditNote.php index 8606c640..56b90acb 100644 --- a/plugins/stripe-php/lib/CreditNote.php +++ b/plugins/stripe-php/lib/CreditNote.php @@ -23,7 +23,7 @@ namespace Stripe; * @property null|int $effective_at The date when this credit note is in effect. Same as created unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. * @property Invoice|string $invoice ID of the invoice. * @property Collection $lines Line items that make up the credit note - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|string $memo Customer-facing text that appears on the credit note PDF. * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $number A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice. @@ -86,7 +86,7 @@ class CreditNote extends ApiResource * post_payment_credit_notes_amount, or both, depending on the * invoice’s amount_remaining at the time of credit note creation. * - * @param null|array{amount?: int, credit_amount?: int, effective_at?: int, email_type?: string, expand?: string[], invoice: string, lines?: (array{amount?: int, description?: string, invoice_line_item?: string, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate: string, taxable_amount: int}[], tax_rates?: null|string[], type: string, unit_amount?: int, unit_amount_decimal?: string})[], memo?: string, metadata?: array, out_of_band_amount?: int, reason?: string, refund_amount?: int, refunds?: array{amount_refunded?: int, payment_record_refund?: array{payment_record: string, refund_group: string}, refund?: string, type?: string}[], shipping_cost?: array{shipping_rate?: string}} $params + * @param null|array{amount?: int, credit_amount?: int, effective_at?: int, email_type?: string, expand?: string[], invoice: string, lines?: (array{amount?: int, description?: string, invoice_line_item?: string, metadata?: array, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate: string, taxable_amount: int}[], tax_rates?: null|string[], type: string, unit_amount?: int, unit_amount_decimal?: string})[], memo?: string, metadata?: array, out_of_band_amount?: int, reason?: string, refund_amount?: int, refunds?: array{amount_refunded?: int, payment_record_refund?: array{payment_record: string, refund_group: string}, refund?: string, type?: string}[], shipping_cost?: array{shipping_rate?: string}} $params * @param null|array|string $options * * @return CreditNote the created resource diff --git a/plugins/stripe-php/lib/CreditNoteLineItem.php b/plugins/stripe-php/lib/CreditNoteLineItem.php index 10b2d3d6..00be8ee6 100644 --- a/plugins/stripe-php/lib/CreditNoteLineItem.php +++ b/plugins/stripe-php/lib/CreditNoteLineItem.php @@ -14,7 +14,8 @@ namespace Stripe; * @property int $discount_amount The integer amount in cents (or local equivalent) representing the discount being credited for this line item. * @property ((object{amount: int, discount: Discount|string}&StripeObject))[] $discount_amounts The amount of discount calculated per discount for this line item * @property null|string $invoice_line_item ID of the invoice line item being credited - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. + * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property ((object{amount: int, credit_balance_transaction?: Billing\CreditBalanceTransaction|string, discount?: Discount|string, type: string}&StripeObject))[] $pretax_credit_amounts The pretax credit amounts (ex: discount, credit grants, etc) for this line item. * @property null|int $quantity The number of units of product being credited. * @property TaxRate[] $tax_rates The tax rates which apply to the line item. diff --git a/plugins/stripe-php/lib/Customer.php b/plugins/stripe-php/lib/Customer.php index 5c95bcd7..8aa80002 100644 --- a/plugins/stripe-php/lib/Customer.php +++ b/plugins/stripe-php/lib/Customer.php @@ -26,7 +26,7 @@ namespace Stripe; * @property null|StripeObject $invoice_credit_balance The current multi-currency balances, if any, that's stored on the customer. If positive in a currency, the customer has a credit to apply to their next invoice denominated in that currency. If negative, the customer has an amount owed that's added to their next invoice denominated in that currency. These balances don't apply to unpaid invoices. They solely track amounts that Stripe hasn't successfully applied to any invoice. Stripe only applies a balance in a specific currency to an invoice after that invoice (which is in the same currency) finalizes. * @property null|string $invoice_prefix The prefix for the customer used to generate unique invoice numbers. * @property null|(object{custom_fields: null|(object{name: string, value: string}&StripeObject)[], default_payment_method: null|PaymentMethod|string, footer: null|string, rendering_options: null|(object{amount_tax_display: null|string, template: null|string}&StripeObject)}&StripeObject) $invoice_settings - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $name The customer's full name or business name. * @property null|int $next_invoice_sequence The suffix of the customer's next invoice number (for example, 0001). When the account uses account level sequencing, this parameter is ignored in API requests and the field omitted in API responses. diff --git a/plugins/stripe-php/lib/CustomerBalanceTransaction.php b/plugins/stripe-php/lib/CustomerBalanceTransaction.php index 667d6507..c5924a46 100644 --- a/plugins/stripe-php/lib/CustomerBalanceTransaction.php +++ b/plugins/stripe-php/lib/CustomerBalanceTransaction.php @@ -24,7 +24,7 @@ namespace Stripe; * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. * @property int $ending_balance The customer's balance after the transaction was applied. A negative value decreases the amount due on the customer's next invoice. A positive value increases the amount due on the customer's next invoice. * @property null|Invoice|string $invoice The ID of the invoice (if any) related to the transaction. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $type Transaction type: adjustment, applied_to_invoice, credit_note, initial, invoice_overpaid, invoice_too_large, invoice_too_small, unspent_receiver_credit, unapplied_from_invoice, checkout_session_subscription_payment, or checkout_session_subscription_payment_canceled. See the Customer Balance page to learn more about transaction types. */ diff --git a/plugins/stripe-php/lib/CustomerCashBalanceTransaction.php b/plugins/stripe-php/lib/CustomerCashBalanceTransaction.php index 57102426..4241f4a9 100644 --- a/plugins/stripe-php/lib/CustomerCashBalanceTransaction.php +++ b/plugins/stripe-php/lib/CustomerCashBalanceTransaction.php @@ -20,7 +20,7 @@ namespace Stripe; * @property null|string $customer_account The ID of an Account representing a customer whose available cash balance changed as a result of this transaction. * @property int $ending_balance The total available cash balance for the specified currency after this transaction was applied. Represented in the smallest currency unit. * @property null|(object{bank_transfer: (object{eu_bank_transfer?: (object{bic: null|string, iban_last4: null|string, sender_name: null|string}&StripeObject), gb_bank_transfer?: (object{account_number_last4: null|string, sender_name: null|string, sort_code: null|string}&StripeObject), jp_bank_transfer?: (object{sender_bank: null|string, sender_branch: null|string, sender_name: null|string}&StripeObject), reference: null|string, type: string, us_bank_transfer?: (object{network?: string, sender_name: null|string}&StripeObject)}&StripeObject)}&StripeObject) $funded - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property int $net_amount The amount by which the cash balance changed, represented in the smallest currency unit. A positive value represents funds being added to the cash balance, a negative value represents funds being removed from the cash balance. * @property null|(object{refund: Refund|string}&StripeObject) $refunded_from_payment * @property null|(object{balance_transaction: BalanceTransaction|string}&StripeObject) $transferred_to_balance diff --git a/plugins/stripe-php/lib/CustomerSession.php b/plugins/stripe-php/lib/CustomerSession.php index 999b91f8..c37d5f37 100644 --- a/plugins/stripe-php/lib/CustomerSession.php +++ b/plugins/stripe-php/lib/CustomerSession.php @@ -19,7 +19,7 @@ namespace Stripe; * @property Customer|string $customer The Customer the Customer Session was created for. * @property null|string $customer_account The Account that the Customer Session was created for. * @property int $expires_at The timestamp at which this Customer Session will expire. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. */ class CustomerSession extends ApiResource { diff --git a/plugins/stripe-php/lib/Dispute.php b/plugins/stripe-php/lib/Dispute.php index d0a3474a..372a2c68 100644 --- a/plugins/stripe-php/lib/Dispute.php +++ b/plugins/stripe-php/lib/Dispute.php @@ -22,7 +22,7 @@ namespace Stripe; * @property (object{access_activity_log: null|string, billing_address: null|string, cancellation_policy: null|File|string, cancellation_policy_disclosure: null|string, cancellation_rebuttal: null|string, customer_communication: null|File|string, customer_email_address: null|string, customer_name: null|string, customer_purchase_ip: null|string, customer_signature: null|File|string, duplicate_charge_documentation: null|File|string, duplicate_charge_explanation: null|string, duplicate_charge_id: null|string, enhanced_evidence: (object{visa_compelling_evidence_3?: (object{disputed_transaction: null|(object{customer_account_id: null|string, customer_device_fingerprint: null|string, customer_device_id: null|string, customer_email_address: null|string, customer_purchase_ip: null|string, merchandise_or_services: null|string, product_description: null|string, shipping_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject)}&StripeObject), prior_undisputed_transactions: ((object{charge: string, customer_account_id: null|string, customer_device_fingerprint: null|string, customer_device_id: null|string, customer_email_address: null|string, customer_purchase_ip: null|string, product_description: null|string, shipping_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject)}&StripeObject))[]}&StripeObject), visa_compliance?: (object{fee_acknowledged: bool}&StripeObject)}&StripeObject), product_description: null|string, receipt: null|File|string, refund_policy: null|File|string, refund_policy_disclosure: null|string, refund_refusal_explanation: null|string, service_date: null|string, service_documentation: null|File|string, shipping_address: null|string, shipping_carrier: null|string, shipping_date: null|string, shipping_documentation: null|File|string, shipping_tracking_number: null|string, uncategorized_file: null|File|string, uncategorized_text: null|string}&StripeObject) $evidence * @property (object{due_by: null|int, enhanced_eligibility: (object{visa_compelling_evidence_3?: (object{required_actions: string[], status: string}&StripeObject), visa_compliance?: (object{status: string}&StripeObject)}&StripeObject), has_evidence: bool, past_due: bool, submission_count: int}&StripeObject) $evidence_details * @property bool $is_charge_refundable If true, it's still possible to refund the disputed payment. After the payment has been fully refunded, no further funds are withdrawn from your Stripe account as a result of this dispute. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $network_reason_code Network-dependent reason code for the dispute. * @property null|PaymentIntent|string $payment_intent ID of the PaymentIntent that's disputed. diff --git a/plugins/stripe-php/lib/Entitlements/ActiveEntitlement.php b/plugins/stripe-php/lib/Entitlements/ActiveEntitlement.php index 16bc27b0..5c936f17 100644 --- a/plugins/stripe-php/lib/Entitlements/ActiveEntitlement.php +++ b/plugins/stripe-php/lib/Entitlements/ActiveEntitlement.php @@ -10,7 +10,7 @@ namespace Stripe\Entitlements; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property Feature|string $feature The Feature that the customer is entitled to. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property string $lookup_key A unique key you provide as your own system identifier. This may be up to 80 characters. */ class ActiveEntitlement extends \Stripe\ApiResource diff --git a/plugins/stripe-php/lib/Entitlements/ActiveEntitlementSummary.php b/plugins/stripe-php/lib/Entitlements/ActiveEntitlementSummary.php index cfa368e4..f5bede7f 100644 --- a/plugins/stripe-php/lib/Entitlements/ActiveEntitlementSummary.php +++ b/plugins/stripe-php/lib/Entitlements/ActiveEntitlementSummary.php @@ -10,7 +10,7 @@ namespace Stripe\Entitlements; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property string $customer The customer that is entitled to this feature. * @property \Stripe\Collection $entitlements The list of entitlements this customer has. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. */ class ActiveEntitlementSummary extends \Stripe\ApiResource { diff --git a/plugins/stripe-php/lib/Entitlements/Feature.php b/plugins/stripe-php/lib/Entitlements/Feature.php index 61b49a26..a7036c20 100644 --- a/plugins/stripe-php/lib/Entitlements/Feature.php +++ b/plugins/stripe-php/lib/Entitlements/Feature.php @@ -11,7 +11,7 @@ namespace Stripe\Entitlements; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property bool $active Inactive features cannot be attached to new products and will not be returned from the features list endpoint. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property string $lookup_key A unique key you provide as your own system identifier. This may be up to 80 characters. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $name The feature's name, for your own purpose, not meant to be displayable to the customer. diff --git a/plugins/stripe-php/lib/EphemeralKey.php b/plugins/stripe-php/lib/EphemeralKey.php index cd78fe6f..b7e97507 100644 --- a/plugins/stripe-php/lib/EphemeralKey.php +++ b/plugins/stripe-php/lib/EphemeralKey.php @@ -9,7 +9,7 @@ namespace Stripe; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property int $expires Time at which the key will expire. Measured in seconds since the Unix epoch. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|string $secret The key's secret. You can use this value to make authorized requests to the Stripe API. */ class EphemeralKey extends ApiResource diff --git a/plugins/stripe-php/lib/ErrorObject.php b/plugins/stripe-php/lib/ErrorObject.php index fd2305f2..9e228ba8 100644 --- a/plugins/stripe-php/lib/ErrorObject.php +++ b/plugins/stripe-php/lib/ErrorObject.php @@ -195,6 +195,7 @@ class ErrorObject extends StripeObject const CODE_ROUTING_NUMBER_INVALID = 'routing_number_invalid'; const CODE_SECRET_KEY_REQUIRED = 'secret_key_required'; const CODE_SEPA_UNSUPPORTED_ACCOUNT = 'sepa_unsupported_account'; + const CODE_SERVICE_PERIOD_COUPON_WITH_METERED_TIERED_ITEM_UNSUPPORTED = 'service_period_coupon_with_metered_tiered_item_unsupported'; const CODE_SETUP_ATTEMPT_FAILED = 'setup_attempt_failed'; const CODE_SETUP_INTENT_AUTHENTICATION_FAILURE = 'setup_intent_authentication_failure'; const CODE_SETUP_INTENT_INVALID_PARAMETER = 'setup_intent_invalid_parameter'; diff --git a/plugins/stripe-php/lib/Event.php b/plugins/stripe-php/lib/Event.php index 7a9ebde1..162e7e55 100644 --- a/plugins/stripe-php/lib/Event.php +++ b/plugins/stripe-php/lib/Event.php @@ -34,7 +34,7 @@ namespace Stripe; * @property null|string $context Authentication context needed to fetch the event or related object. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property (object{object: StripeObject, previous_attributes?: StripeObject}&StripeObject) $data - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property int $pending_webhooks Number of webhooks that haven't been successfully delivered (for example, to return a 20x response) to the URLs you specify. * @property null|(object{id: null|string, idempotency_key: null|string}&StripeObject) $request Information on the API request that triggers the event. * @property string $type Description of the event (for example, invoice.created or charge.refunded). diff --git a/plugins/stripe-php/lib/FileLink.php b/plugins/stripe-php/lib/FileLink.php index 6e786a12..bb37a59c 100644 --- a/plugins/stripe-php/lib/FileLink.php +++ b/plugins/stripe-php/lib/FileLink.php @@ -15,7 +15,7 @@ namespace Stripe; * @property bool $expired Returns if the link is already expired. * @property null|int $expires_at Time that the link expires. * @property File|string $file The file object this link points to. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $url The publicly accessible URL to download the file. */ diff --git a/plugins/stripe-php/lib/FinancialConnections/Account.php b/plugins/stripe-php/lib/FinancialConnections/Account.php index 2a8fe28e..cbeea960 100644 --- a/plugins/stripe-php/lib/FinancialConnections/Account.php +++ b/plugins/stripe-php/lib/FinancialConnections/Account.php @@ -18,7 +18,7 @@ namespace Stripe\FinancialConnections; * @property null|string $display_name A human-readable name that has been assigned to this account, either by the account holder or by the institution. * @property string $institution_name The name of the institution that holds this account. * @property null|string $last4 The last 4 digits of the account number. If present, this will be 4 numeric characters. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|AccountOwnership|string $ownership The most recent information about the account's owners. * @property null|(object{last_attempted_at: int, next_refresh_available_at: null|int, status: string}&\Stripe\StripeObject) $ownership_refresh The state of the most recent attempt to refresh the account owners. * @property null|string[] $permissions The list of permissions granted by this account. diff --git a/plugins/stripe-php/lib/FinancialConnections/Session.php b/plugins/stripe-php/lib/FinancialConnections/Session.php index db8bc2b2..2bbb6800 100644 --- a/plugins/stripe-php/lib/FinancialConnections/Session.php +++ b/plugins/stripe-php/lib/FinancialConnections/Session.php @@ -13,7 +13,7 @@ namespace Stripe\FinancialConnections; * @property \Stripe\Collection $accounts The accounts that were collected as part of this Session. * @property null|string $client_secret A value that will be passed to the client to launch the authentication flow. * @property null|(object{account_subcategories: null|string[], countries: null|string[]}&\Stripe\StripeObject) $filters - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property string[] $permissions Permissions requested for accounts collected during this session. * @property null|string[] $prefetch Data features requested to be retrieved upon account creation. * @property null|string $return_url For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. diff --git a/plugins/stripe-php/lib/FinancialConnections/Transaction.php b/plugins/stripe-php/lib/FinancialConnections/Transaction.php index 68a95262..d68c2b1c 100644 --- a/plugins/stripe-php/lib/FinancialConnections/Transaction.php +++ b/plugins/stripe-php/lib/FinancialConnections/Transaction.php @@ -13,7 +13,7 @@ namespace Stripe\FinancialConnections; * @property int $amount The amount of this transaction, in cents (or local equivalent). * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property string $description The description of this transaction. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property string $status The status of the transaction. * @property (object{posted_at: null|int, void_at: null|int}&\Stripe\StripeObject) $status_transitions * @property int $transacted_at Time at which the transaction was transacted. Measured in seconds since the Unix epoch. diff --git a/plugins/stripe-php/lib/Forwarding/Request.php b/plugins/stripe-php/lib/Forwarding/Request.php index e6dcc12c..536707c8 100644 --- a/plugins/stripe-php/lib/Forwarding/Request.php +++ b/plugins/stripe-php/lib/Forwarding/Request.php @@ -25,7 +25,7 @@ namespace Stripe\Forwarding; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $payment_method The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed. * @property string[] $replacements The field kinds to be replaced in the forwarded request. diff --git a/plugins/stripe-php/lib/FundingInstructions.php b/plugins/stripe-php/lib/FundingInstructions.php index 3e8cf3e7..4b2f7dce 100644 --- a/plugins/stripe-php/lib/FundingInstructions.php +++ b/plugins/stripe-php/lib/FundingInstructions.php @@ -15,7 +15,7 @@ namespace Stripe; * @property (object{country: string, financial_addresses: ((object{aba?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, account_number: string, account_type: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bank_name: string, routing_number: string}&StripeObject), iban?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bic: string, country: string, iban: string}&StripeObject), sort_code?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, account_number: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), sort_code: string}&StripeObject), spei?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bank_code: string, bank_name: string, clabe: string}&StripeObject), supported_networks?: string[], swift?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, account_number: string, account_type: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bank_name: string, swift_code: string}&StripeObject), type: string, zengin?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: null|string, account_number: null|string, account_type: null|string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bank_code: null|string, bank_name: null|string, branch_code: null|string, branch_name: null|string}&StripeObject)}&StripeObject))[], type: string}&StripeObject) $bank_transfer * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property string $funding_type The funding_type of the returned instructions - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. */ class FundingInstructions extends ApiResource { diff --git a/plugins/stripe-php/lib/HttpClient/CurlClient.php b/plugins/stripe-php/lib/HttpClient/CurlClient.php index c210a32c..d9fd963b 100644 --- a/plugins/stripe-php/lib/HttpClient/CurlClient.php +++ b/plugins/stripe-php/lib/HttpClient/CurlClient.php @@ -202,7 +202,13 @@ class CurlClient implements ClientInterface, StreamingClientInterface */ private function constructUrlAndBody($method, $absUrl, $params, $hasFile, $apiMode) { - $params = Util\Util::objectsToIds($params); + // For V2 POST bodies, preserve null values so they serialize to JSON + // null (the V2 mechanism for clearing fields / metadata keys). + // For all other cases (V1, GET/DELETE query params), strip nulls as + // before — null values become empty strings in query params which + // causes server errors. + $serializeNull = ('post' === $method && 'v2' === $apiMode); + $params = Util\Util::objectsToIds($params, $serializeNull); if ('post' === $method) { $absUrl = Util\Util::utf8($absUrl); if ($hasFile) { diff --git a/plugins/stripe-php/lib/Identity/VerificationReport.php b/plugins/stripe-php/lib/Identity/VerificationReport.php index 033b6791..75f58956 100644 --- a/plugins/stripe-php/lib/Identity/VerificationReport.php +++ b/plugins/stripe-php/lib/Identity/VerificationReport.php @@ -24,7 +24,7 @@ namespace Stripe\Identity; * @property null|(object{address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), dob?: null|(object{day: null|int, month: null|int, year: null|int}&\Stripe\StripeObject), error: null|(object{code: null|string, reason: null|string}&\Stripe\StripeObject), expiration_date?: null|(object{day: null|int, month: null|int, year: null|int}&\Stripe\StripeObject), files: null|string[], first_name: null|string, issued_date: null|(object{day: null|int, month: null|int, year: null|int}&\Stripe\StripeObject), issuing_country: null|string, last_name: null|string, number?: null|string, sex?: null|string, status: string, type: null|string, unparsed_place_of_birth?: null|string, unparsed_sex?: null|string}&\Stripe\StripeObject) $document Result from a document check * @property null|(object{email: null|string, error: null|(object{code: null|string, reason: null|string}&\Stripe\StripeObject), status: string}&\Stripe\StripeObject) $email Result from a email check * @property null|(object{dob?: null|(object{day: null|int, month: null|int, year: null|int}&\Stripe\StripeObject), error: null|(object{code: null|string, reason: null|string}&\Stripe\StripeObject), first_name: null|string, id_number?: null|string, id_number_type: null|string, last_name: null|string, status: string}&\Stripe\StripeObject) $id_number Result from an id_number check - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|(object{document?: (object{allowed_types?: string[], require_id_number?: bool, require_live_capture?: bool, require_matching_selfie?: bool}&\Stripe\StripeObject), id_number?: (object{}&\Stripe\StripeObject)}&\Stripe\StripeObject) $options * @property null|(object{error: null|(object{code: null|string, reason: null|string}&\Stripe\StripeObject), phone: null|string, status: string}&\Stripe\StripeObject) $phone Result from a phone check * @property null|(object{document: null|string, error: null|(object{code: null|string, reason: null|string}&\Stripe\StripeObject), selfie: null|string, status: string}&\Stripe\StripeObject) $selfie Result from a selfie check diff --git a/plugins/stripe-php/lib/Identity/VerificationSession.php b/plugins/stripe-php/lib/Identity/VerificationSession.php index 2e68e674..e4927166 100644 --- a/plugins/stripe-php/lib/Identity/VerificationSession.php +++ b/plugins/stripe-php/lib/Identity/VerificationSession.php @@ -24,7 +24,7 @@ namespace Stripe\Identity; * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|(object{code: null|string, reason: null|string}&\Stripe\StripeObject) $last_error If present, this property tells you the last error encountered when processing the verification. * @property null|string|VerificationReport $last_verification_report ID of the most recent VerificationReport. Learn more about accessing detailed verification results. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|(object{document?: (object{allowed_types?: string[], require_id_number?: bool, require_live_capture?: bool, require_matching_selfie?: bool}&\Stripe\StripeObject), email?: (object{require_verification?: bool}&\Stripe\StripeObject), id_number?: (object{}&\Stripe\StripeObject), matching?: (object{dob?: string, name?: string}&\Stripe\StripeObject), phone?: (object{require_verification?: bool}&\Stripe\StripeObject)}&\Stripe\StripeObject) $options A set of options for the session’s verification checks. * @property null|(object{email?: string, phone?: string}&\Stripe\StripeObject) $provided_details Details provided about the user being verified. These details may be shown to the user. diff --git a/plugins/stripe-php/lib/Invoice.php b/plugins/stripe-php/lib/Invoice.php index 7341dd85..39e996b4 100644 --- a/plugins/stripe-php/lib/Invoice.php +++ b/plugins/stripe-php/lib/Invoice.php @@ -85,7 +85,7 @@ namespace Stripe; * @property null|(object{advice_code?: string, charge?: string, code?: string, decline_code?: string, doc_url?: string, message?: string, network_advice_code?: string, network_decline_code?: string, param?: string, payment_intent?: PaymentIntent, payment_method?: PaymentMethod, payment_method_type?: string, request_log_url?: string, setup_intent?: SetupIntent, source?: Account|BankAccount|Card|Source, type: string}&StripeObject) $last_finalization_error The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized. * @property null|Invoice|string $latest_revision The ID of the most recent non-draft revision of this invoice * @property Collection $lines The individual line items that make up the invoice. lines is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|int $next_payment_attempt The time at which payment will next be attempted. This value will be null for invoices where collection_method=send_invoice. * @property null|string $number A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified. @@ -148,8 +148,8 @@ class Invoice extends ApiResource /** * This endpoint creates a draft invoice for a given customer. The invoice remains - * a draft until you finalize the invoice, which - * allows you to pay or finalize the invoice, + * which allows you to pay or send the invoice to your customers. * * @param null|array{account_tax_ids?: null|string[], application_fee_amount?: int, auto_advance?: bool, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, automatically_finalizes_at?: int, collection_method?: string, currency?: string, custom_fields?: null|array{name: string, value: string}[], customer?: string, customer_account?: string, days_until_due?: int, default_payment_method?: string, default_source?: string, default_tax_rates?: string[], description?: string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], due_date?: int, effective_at?: int, expand?: string[], footer?: string, from_invoice?: array{action: string, invoice: string}, issuer?: array{account?: string, type: string}, metadata?: null|array, number?: string, on_behalf_of?: string, payment_settings?: array{default_mandate?: null|string, payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{transaction_type?: string}, verification_method?: string}, bancontact?: null|array{preferred_language?: string}, card?: null|array{installments?: array{enabled?: bool, plan?: null|array{count?: int, interval?: string, type: string}}, request_three_d_secure?: string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, type?: string}, funding_type?: string}, konbini?: null|array{}, payto?: null|array{mandate_options?: array{amount?: int, purpose?: string}}, sepa_debit?: null|array{}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[]}, verification_method?: string}}, payment_method_types?: null|string[]}, pending_invoice_items_behavior?: string, rendering?: array{amount_tax_display?: null|string, pdf?: array{page_size?: string}, template?: string, template_version?: null|int}, shipping_cost?: array{shipping_rate?: string, shipping_rate_data?: array{delivery_estimate?: array{maximum?: array{unit: string, value: int}, minimum?: array{unit: string, value: int}}, display_name: string, fixed_amount?: array{amount: int, currency: string, currency_options?: array}, metadata?: array, tax_behavior?: string, tax_code?: string, type?: string}}, shipping_details?: array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name: string, phone?: null|string}, statement_descriptor?: string, subscription?: string, transfer_data?: array{amount?: int, destination: string}} $params @@ -175,7 +175,7 @@ class Invoice extends ApiResource * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to * delete invoices that are no longer in a draft state will fail; once an invoice * has been finalized or if an invoice is for a subscription, it must be voided. + * href="/api/invoices/void">voided. * * @param null|array $params * @param null|array|string $opts diff --git a/plugins/stripe-php/lib/InvoiceItem.php b/plugins/stripe-php/lib/InvoiceItem.php index 48c18be9..e78ee84b 100644 --- a/plugins/stripe-php/lib/InvoiceItem.php +++ b/plugins/stripe-php/lib/InvoiceItem.php @@ -25,7 +25,7 @@ namespace Stripe; * @property bool $discountable If true, discounts will apply to this invoice item. Always false for prorations. * @property null|(Discount|string)[] $discounts The discounts which apply to the invoice item. Item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. * @property null|Invoice|string $invoice The ID of the invoice this invoice item belongs to. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|int $net_amount The amount after discounts, but before credits and taxes. This field is null for discountable=true items. * @property null|(object{subscription_details: null|(object{subscription: string, subscription_item?: string}&StripeObject), type: string}&StripeObject) $parent The parent that generated this invoice item. @@ -33,7 +33,8 @@ namespace Stripe; * @property null|(object{price_details?: (object{price: Price|string, product: string}&StripeObject), type: string, unit_amount_decimal: null|string}&StripeObject) $pricing The pricing information of the invoice item. * @property bool $proration Whether the invoice item was created automatically as a proration adjustment when the customer switched plans. * @property null|(object{discount_amounts: ((object{amount: int, discount: Discount|string}&StripeObject))[]}&StripeObject) $proration_details - * @property int $quantity Quantity of units for the invoice item. If the invoice item is a proration, the quantity of the subscription that the proration was computed for. + * @property int $quantity Quantity of units for the invoice item in integer format, with any decimal precision truncated. For the item's full-precision decimal quantity, use quantity_decimal. This field will be deprecated in favor of quantity_decimal in a future version. If the invoice item is a proration, the quantity of the subscription that the proration was computed for. + * @property string $quantity_decimal Non-negative decimal with at most 12 decimal places. The quantity of units for the invoice item. * @property null|TaxRate[] $tax_rates The tax rates which apply to the invoice item. When set, the default_tax_rates on the invoice do not apply to this invoice item. * @property null|string|TestHelpers\TestClock $test_clock ID of the test clock this invoice item belongs to. */ @@ -48,7 +49,7 @@ class InvoiceItem extends ApiResource * no invoice is specified, the item will be on the next invoice created for the * customer specified. * - * @param null|array{amount?: int, currency?: string, customer?: string, customer_account?: string, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], invoice?: string, metadata?: null|array, period?: array{end: int, start: int}, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, subscription?: string, tax_behavior?: string, tax_code?: null|string, tax_rates?: string[], unit_amount_decimal?: string} $params + * @param null|array{amount?: int, currency?: string, customer?: string, customer_account?: string, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], invoice?: string, metadata?: null|array, period?: array{end: int, start: int}, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, quantity_decimal?: string, subscription?: string, tax_behavior?: string, tax_code?: null|string, tax_rates?: string[], unit_amount_decimal?: string} $params * @param null|array|string $options * * @return InvoiceItem the created resource @@ -133,7 +134,7 @@ class InvoiceItem extends ApiResource * closed. * * @param string $id the ID of the resource to update - * @param null|array{amount?: int, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], metadata?: null|array, period?: array{end: int, start: int}, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, tax_behavior?: string, tax_code?: null|string, tax_rates?: null|string[], unit_amount_decimal?: string} $params + * @param null|array{amount?: int, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], metadata?: null|array, period?: array{end: int, start: int}, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, quantity_decimal?: string, tax_behavior?: string, tax_code?: null|string, tax_rates?: null|string[], unit_amount_decimal?: string} $params * @param null|array|string $opts * * @return InvoiceItem the updated resource diff --git a/plugins/stripe-php/lib/InvoiceLineItem.php b/plugins/stripe-php/lib/InvoiceLineItem.php index 3b8ca051..d20e92ee 100644 --- a/plugins/stripe-php/lib/InvoiceLineItem.php +++ b/plugins/stripe-php/lib/InvoiceLineItem.php @@ -18,13 +18,14 @@ namespace Stripe; * @property bool $discountable If true, discounts will apply to this line item. Always false for prorations. * @property (Discount|string)[] $discounts The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. * @property null|string $invoice The ID of the invoice that contains this line item. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Note that for line items with type=subscription, metadata reflects the current metadata from the subscription associated with the line item, unless the invoice line was directly updated with different metadata after creation. * @property null|(object{invoice_item_details: null|(object{invoice_item: string, proration: bool, proration_details: null|(object{credited_items: null|(object{invoice: string, invoice_line_items: string[]}&StripeObject)}&StripeObject), subscription: null|string}&StripeObject), subscription_item_details: null|(object{invoice_item: null|string, proration: bool, proration_details: null|(object{credited_items: null|(object{invoice: string, invoice_line_items: string[]}&StripeObject)}&StripeObject), subscription: null|string, subscription_item: string}&StripeObject), type: string}&StripeObject) $parent The parent that generated this line item. * @property (object{end: int, start: int}&StripeObject) $period * @property null|((object{amount: int, credit_balance_transaction?: null|Billing\CreditBalanceTransaction|string, discount?: Discount|string, type: string}&StripeObject))[] $pretax_credit_amounts Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this line item. * @property null|(object{price_details?: (object{price: Price|string, product: string}&StripeObject), type: string, unit_amount_decimal: null|string}&StripeObject) $pricing The pricing information of the line item. - * @property null|int $quantity The quantity of the subscription, if the line item is a subscription or a proration. + * @property null|int $quantity Quantity of units for the invoice line item in integer format, with any decimal precision truncated. For the line item's full-precision decimal quantity, use quantity_decimal. This field will be deprecated in favor of quantity_decimal in a future version. If the line item is a proration or subscription, the quantity of the subscription that the proration was computed for. + * @property null|string $quantity_decimal Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. * @property null|string|Subscription $subscription * @property int $subtotal The subtotal of the line item, in cents (or local equivalent), before any discounts or taxes. * @property null|((object{amount: int, tax_behavior: string, tax_rate_details: null|(object{tax_rate: string}&StripeObject), taxability_reason: string, taxable_amount: null|int, type: string}&StripeObject))[] $taxes The tax information of the line item. @@ -44,7 +45,7 @@ class InvoiceLineItem extends ApiResource * before the invoice is finalized. * * @param string $id the ID of the resource to update - * @param null|array{amount?: int, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], metadata?: null|array, period?: array{end: int, start: int}, price_data?: array{currency: string, product?: string, product_data?: array{description?: string, images?: string[], metadata?: array, name: string, tax_code?: string, unit_label?: string}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate_data: array{country?: string, description?: string, display_name: string, inclusive: bool, jurisdiction?: string, jurisdiction_level?: string, percentage: float, state?: string, tax_type?: string}, taxability_reason?: string, taxable_amount: int}[], tax_rates?: null|string[]} $params + * @param null|array{amount?: int, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], metadata?: null|array, period?: array{end: int, start: int}, price_data?: array{currency: string, product?: string, product_data?: array{description?: string, images?: string[], metadata?: array, name: string, tax_code?: string, unit_label?: string}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, quantity_decimal?: string, tax_amounts?: null|array{amount: int, tax_rate_data: array{country?: string, description?: string, display_name: string, inclusive: bool, jurisdiction?: string, jurisdiction_level?: string, percentage: float, state?: string, tax_type?: string}, taxability_reason?: string, taxable_amount: int}[], tax_rates?: null|string[]} $params * @param null|array|string $opts * * @return InvoiceLineItem the updated resource diff --git a/plugins/stripe-php/lib/InvoicePayment.php b/plugins/stripe-php/lib/InvoicePayment.php index b90fe85b..1561d62d 100644 --- a/plugins/stripe-php/lib/InvoicePayment.php +++ b/plugins/stripe-php/lib/InvoicePayment.php @@ -22,7 +22,7 @@ namespace Stripe; * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property Invoice|string $invoice The invoice that was paid. * @property bool $is_default Stripe automatically creates a default InvoicePayment when the invoice is finalized, and keeps it synchronized with the invoice’s amount_remaining. The PaymentIntent associated with the default payment can’t be edited or canceled directly. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property (object{charge?: Charge|string, payment_intent?: PaymentIntent|string, payment_record?: PaymentRecord|string, type: string}&StripeObject) $payment * @property string $status The status of the payment, one of open, paid, or canceled. * @property (object{canceled_at: null|int, paid_at: null|int}&StripeObject) $status_transitions diff --git a/plugins/stripe-php/lib/InvoiceRenderingTemplate.php b/plugins/stripe-php/lib/InvoiceRenderingTemplate.php index 268d8159..e6ec7027 100644 --- a/plugins/stripe-php/lib/InvoiceRenderingTemplate.php +++ b/plugins/stripe-php/lib/InvoiceRenderingTemplate.php @@ -11,7 +11,7 @@ namespace Stripe; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $nickname A brief description of the template, hidden from customers * @property string $status The status of the template, one of active or archived. diff --git a/plugins/stripe-php/lib/Issuing/Authorization.php b/plugins/stripe-php/lib/Issuing/Authorization.php index a828674e..6e3affc6 100644 --- a/plugins/stripe-php/lib/Issuing/Authorization.php +++ b/plugins/stripe-php/lib/Issuing/Authorization.php @@ -25,7 +25,7 @@ namespace Stripe\Issuing; * @property null|(object{cardholder_prompt_data: null|(object{alphanumeric_id: null|string, driver_id: null|string, odometer: null|int, unspecified_id: null|string, user_id: null|string, vehicle_number: null|string}&\Stripe\StripeObject), purchase_type: null|string, reported_breakdown: null|(object{fuel: null|(object{gross_amount_decimal: null|string}&\Stripe\StripeObject), non_fuel: null|(object{gross_amount_decimal: null|string}&\Stripe\StripeObject), tax: null|(object{local_amount_decimal: null|string, national_amount_decimal: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject), service_type: null|string}&\Stripe\StripeObject) $fleet Fleet-specific information for authorizations using Fleet cards. * @property null|((object{channel: string, status: string, undeliverable_reason: null|string}&\Stripe\StripeObject))[] $fraud_challenges Fraud challenges sent to the cardholder, if this authorization was declined for fraud risk reasons. * @property null|(object{industry_product_code: null|string, quantity_decimal: null|string, type: null|string, unit: null|string, unit_cost_decimal: null|string}&\Stripe\StripeObject) $fuel Information about fuel that was purchased with this transaction. Typically this information is received from the merchant after the authorization has been approved and the fuel dispensed. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property int $merchant_amount The total amount that was authorized or rejected. This amount is in the merchant_currency and in the smallest currency unit. merchant_amount should be the same as amount, unless merchant_currency and currency are different. * @property string $merchant_currency The local currency that was presented to the cardholder for the authorization. This currency can be different from the cardholder currency and the currency field on this authorization. Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property (object{category: string, category_code: string, city: null|string, country: null|string, name: null|string, network_id: string, postal_code: null|string, state: null|string, tax_id: null|string, terminal_id: null|string, url: null|string}&\Stripe\StripeObject) $merchant_data diff --git a/plugins/stripe-php/lib/Issuing/Card.php b/plugins/stripe-php/lib/Issuing/Card.php index 8d0f4b61..efb0077c 100644 --- a/plugins/stripe-php/lib/Issuing/Card.php +++ b/plugins/stripe-php/lib/Issuing/Card.php @@ -20,7 +20,8 @@ namespace Stripe\Issuing; * @property null|string $financial_account The financial account this card is attached to. * @property string $last4 The last 4 digits of the card number. * @property null|(object{started_at: null|int, type: null|string}&\Stripe\StripeObject) $latest_fraud_warning Stripe’s assessment of whether this card’s details have been compromised. If this property isn't null, cancel and reissue the card to prevent fraudulent activity risk. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|(object{cancel_after: (object{payment_count: int}&\Stripe\StripeObject)}&\Stripe\StripeObject) $lifecycle_controls Rules that control the lifecycle of this card, such as automatic cancellation. Refer to our documentation for more details. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $number The full unredacted card number. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with the expand parameter. Additionally, it's only available via the "Retrieve a card" endpoint, not via "List all cards" or any other endpoint. * @property null|PersonalizationDesign|string $personalization_design The personalization design object belonging to this card. @@ -59,7 +60,7 @@ class Card extends \Stripe\ApiResource /** * Creates an Issuing Card object. * - * @param null|array{cardholder?: string, currency: string, exp_month?: int, exp_year?: int, expand?: string[], financial_account?: string, metadata?: array, personalization_design?: string, pin?: array{encrypted_number?: string}, replacement_for?: string, replacement_reason?: string, second_line?: null|string, shipping?: array{address: array{city: string, country: string, line1: string, line2?: string, postal_code: string, state?: string}, address_validation?: array{mode: string}, customs?: array{eori_number?: string}, name: string, phone_number?: string, require_signature?: bool, service?: string, type?: string}, spending_controls?: array{allowed_categories?: string[], allowed_merchant_countries?: string[], blocked_categories?: string[], blocked_merchant_countries?: string[], spending_limits?: array{amount: int, categories?: string[], interval: string}[]}, status?: string, type: string} $params + * @param null|array{cardholder?: string, currency: string, exp_month?: int, exp_year?: int, expand?: string[], financial_account?: string, lifecycle_controls?: array{cancel_after: array{payment_count: int}}, metadata?: array, personalization_design?: string, pin?: array{encrypted_number?: string}, replacement_for?: string, replacement_reason?: string, second_line?: null|string, shipping?: array{address: array{city: string, country: string, line1: string, line2?: string, postal_code: string, state?: string}, address_validation?: array{mode: string}, customs?: array{eori_number?: string}, name: string, phone_number?: string, require_signature?: bool, service?: string, type?: string}, spending_controls?: array{allowed_categories?: string[], allowed_merchant_countries?: string[], blocked_categories?: string[], blocked_merchant_countries?: string[], spending_limits?: array{amount: int, categories?: string[], interval: string}[]}, status?: string, type: string} $params * @param null|array|string $options * * @return Card the created resource diff --git a/plugins/stripe-php/lib/Issuing/Cardholder.php b/plugins/stripe-php/lib/Issuing/Cardholder.php index 3389086a..0a009796 100644 --- a/plugins/stripe-php/lib/Issuing/Cardholder.php +++ b/plugins/stripe-php/lib/Issuing/Cardholder.php @@ -16,11 +16,11 @@ namespace Stripe\Issuing; * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $email The cardholder's email address. * @property null|(object{card_issuing?: null|(object{user_terms_acceptance: null|(object{date: null|int, ip: null|string, user_agent: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject), dob: null|(object{day: null|int, month: null|int, year: null|int}&\Stripe\StripeObject), first_name: null|string, last_name: null|string, verification: null|(object{document: null|(object{back: null|string|\Stripe\File, front: null|string|\Stripe\File}&\Stripe\StripeObject)}&\Stripe\StripeObject)}&\Stripe\StripeObject) $individual Additional information about an individual cardholder. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $name The cardholder's name. This will be printed on cards issued to them. * @property null|string $phone_number The cardholder's phone number. This is required for all cardholders who will be creating EU cards. See the 3D Secure documentation for more details. - * @property null|string[] $preferred_locales The cardholder’s preferred locales (languages), ordered by preference. Locales can be de, en, es, fr, or it. This changes the language of the 3D Secure flow and one-time password messages sent to the cardholder. + * @property null|string[] $preferred_locales The cardholder’s preferred locales (languages), ordered by preference. Locales can be da, de, en, es, fr, it, pl, or sv. This changes the language of the 3D Secure flow and one-time password messages sent to the cardholder. * @property (object{disabled_reason: null|string, past_due: null|string[]}&\Stripe\StripeObject) $requirements * @property null|(object{allowed_categories: null|string[], allowed_merchant_countries: null|string[], blocked_categories: null|string[], blocked_merchant_countries: null|string[], spending_limits: null|((object{amount: int, categories: null|string[], interval: string}&\Stripe\StripeObject))[], spending_limits_currency: null|string}&\Stripe\StripeObject) $spending_controls Rules that control spending across this cardholder's cards. Refer to our documentation for more details. * @property string $status Specifies whether to permit authorizations on this cardholder's cards. diff --git a/plugins/stripe-php/lib/Issuing/Dispute.php b/plugins/stripe-php/lib/Issuing/Dispute.php index d05d7d09..a23c7268 100644 --- a/plugins/stripe-php/lib/Issuing/Dispute.php +++ b/plugins/stripe-php/lib/Issuing/Dispute.php @@ -16,7 +16,7 @@ namespace Stripe\Issuing; * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency The currency the transaction was made in. * @property (object{canceled?: (object{additional_documentation: null|string|\Stripe\File, canceled_at: null|int, cancellation_policy_provided: null|bool, cancellation_reason: null|string, expected_at: null|int, explanation: null|string, product_description: null|string, product_type: null|string, return_status: null|string, returned_at: null|int}&\Stripe\StripeObject), duplicate?: (object{additional_documentation: null|string|\Stripe\File, card_statement: null|string|\Stripe\File, cash_receipt: null|string|\Stripe\File, check_image: null|string|\Stripe\File, explanation: null|string, original_transaction: null|string}&\Stripe\StripeObject), fraudulent?: (object{additional_documentation: null|string|\Stripe\File, explanation: null|string}&\Stripe\StripeObject), merchandise_not_as_described?: (object{additional_documentation: null|string|\Stripe\File, explanation: null|string, received_at: null|int, return_description: null|string, return_status: null|string, returned_at: null|int}&\Stripe\StripeObject), no_valid_authorization?: (object{additional_documentation: null|string|\Stripe\File, explanation: null|string}&\Stripe\StripeObject), not_received?: (object{additional_documentation: null|string|\Stripe\File, expected_at: null|int, explanation: null|string, product_description: null|string, product_type: null|string}&\Stripe\StripeObject), other?: (object{additional_documentation: null|string|\Stripe\File, explanation: null|string, product_description: null|string, product_type: null|string}&\Stripe\StripeObject), reason: string, service_not_as_described?: (object{additional_documentation: null|string|\Stripe\File, canceled_at: null|int, cancellation_reason: null|string, explanation: null|string, received_at: null|int}&\Stripe\StripeObject)}&\Stripe\StripeObject) $evidence - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|string $loss_reason The enum that describes the dispute loss outcome. If the dispute is not lost, this field will be absent. New enum values may be added in the future, so be sure to handle unknown values. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $status Current status of the dispute. diff --git a/plugins/stripe-php/lib/Issuing/PersonalizationDesign.php b/plugins/stripe-php/lib/Issuing/PersonalizationDesign.php index 3cca57c2..98de87be 100644 --- a/plugins/stripe-php/lib/Issuing/PersonalizationDesign.php +++ b/plugins/stripe-php/lib/Issuing/PersonalizationDesign.php @@ -12,7 +12,7 @@ namespace Stripe\Issuing; * @property null|string|\Stripe\File $card_logo The file for the card logo to use with physical bundles that support card logos. Must have a purpose value of issuing_logo. * @property null|(object{footer_body: null|string, footer_title: null|string, header_body: null|string, header_title: null|string}&\Stripe\StripeObject) $carrier_text Hash containing carrier text, for use with physical bundles that support carrier text. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|string $lookup_key A lookup key used to retrieve personalization designs dynamically from a static string. This may be up to 200 characters. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $name Friendly display name. diff --git a/plugins/stripe-php/lib/Issuing/PhysicalBundle.php b/plugins/stripe-php/lib/Issuing/PhysicalBundle.php index 6e130c70..1e0a49de 100644 --- a/plugins/stripe-php/lib/Issuing/PhysicalBundle.php +++ b/plugins/stripe-php/lib/Issuing/PhysicalBundle.php @@ -10,7 +10,7 @@ namespace Stripe\Issuing; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property (object{card_logo: string, carrier_text: string, second_line: string}&\Stripe\StripeObject) $features - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property string $name Friendly display name. * @property string $status Whether this physical bundle can be used to create cards. * @property string $type Whether this physical bundle is a standard Stripe offering or custom-made for you. diff --git a/plugins/stripe-php/lib/Issuing/Token.php b/plugins/stripe-php/lib/Issuing/Token.php index 9ea27d76..990d5885 100644 --- a/plugins/stripe-php/lib/Issuing/Token.php +++ b/plugins/stripe-php/lib/Issuing/Token.php @@ -13,9 +13,9 @@ namespace Stripe\Issuing; * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $device_fingerprint The hashed ID derived from the device ID from the card network associated with the token. * @property null|string $last4 The last four digits of the token. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property string $network The token service provider / card network associated with the token. - * @property null|(object{device?: (object{device_fingerprint?: string, ip_address?: string, location?: string, name?: string, phone_number?: string, type?: string}&\Stripe\StripeObject), mastercard?: (object{card_reference_id?: string, token_reference_id: string, token_requestor_id: string, token_requestor_name?: string}&\Stripe\StripeObject), type: string, visa?: (object{card_reference_id: string, token_reference_id: string, token_requestor_id: string, token_risk_score?: string}&\Stripe\StripeObject), wallet_provider?: (object{account_id?: string, account_trust_score?: int, card_number_source?: string, cardholder_address?: (object{line1: string, postal_code: string}&\Stripe\StripeObject), cardholder_name?: string, device_trust_score?: int, hashed_account_email_address?: string, reason_codes?: string[], suggested_decision?: string, suggested_decision_version?: string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $network_data + * @property null|(object{device?: (object{device_fingerprint?: string, ip_address?: string, location?: string, name?: string, phone_number?: string, type?: string}&\Stripe\StripeObject), mastercard?: (object{card_reference_id?: string, token_reference_id: string, token_requestor_id: string, token_requestor_name?: string}&\Stripe\StripeObject), type: string, visa?: (object{card_reference_id: null|string, token_reference_id: string, token_requestor_id: string, token_risk_score?: string}&\Stripe\StripeObject), wallet_provider?: (object{account_id?: string, account_trust_score?: int, card_number_source?: string, cardholder_address?: (object{line1: string, postal_code: string}&\Stripe\StripeObject), cardholder_name?: string, device_trust_score?: int, hashed_account_email_address?: string, reason_codes?: string[], suggested_decision?: string, suggested_decision_version?: string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $network_data * @property int $network_updated_at Time at which the token was last updated by the card network. Measured in seconds since the Unix epoch. * @property string $status The usage state of the token. * @property null|string $wallet_provider The digital wallet for this token, if one was used. diff --git a/plugins/stripe-php/lib/Issuing/Transaction.php b/plugins/stripe-php/lib/Issuing/Transaction.php index 578b95cf..5fbb85c3 100644 --- a/plugins/stripe-php/lib/Issuing/Transaction.php +++ b/plugins/stripe-php/lib/Issuing/Transaction.php @@ -22,7 +22,7 @@ namespace Stripe\Issuing; * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property null|Dispute|string $dispute If you've disputed the transaction, the ID of the dispute. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property int $merchant_amount The amount that the merchant will receive, denominated in merchant_currency and in the smallest currency unit. It will be different from amount if the merchant is taking payment in a different currency. * @property string $merchant_currency The currency with which the merchant is taking payment. * @property (object{category: string, category_code: string, city: null|string, country: null|string, name: null|string, network_id: string, postal_code: null|string, state: null|string, tax_id: null|string, terminal_id: null|string, url: null|string}&\Stripe\StripeObject) $merchant_data diff --git a/plugins/stripe-php/lib/Mandate.php b/plugins/stripe-php/lib/Mandate.php index 35315829..e6ce7715 100644 --- a/plugins/stripe-php/lib/Mandate.php +++ b/plugins/stripe-php/lib/Mandate.php @@ -10,11 +10,11 @@ namespace Stripe; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property (object{accepted_at: null|int, offline?: (object{}&StripeObject), online?: (object{ip_address: null|string, user_agent: null|string}&StripeObject), type: string}&StripeObject) $customer_acceptance - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|(object{}&StripeObject) $multi_use * @property null|string $on_behalf_of The account (if any) that the mandate is intended for. * @property PaymentMethod|string $payment_method ID of the payment method associated with this mandate. - * @property (object{acss_debit?: (object{default_for?: string[], interval_description: null|string, payment_schedule: string, transaction_type: string}&StripeObject), amazon_pay?: (object{}&StripeObject), au_becs_debit?: (object{url: string}&StripeObject), bacs_debit?: (object{display_name: null|string, network_status: string, reference: string, revocation_reason: null|string, service_user_number: null|string, url: string}&StripeObject), card?: (object{}&StripeObject), cashapp?: (object{}&StripeObject), kakao_pay?: (object{}&StripeObject), klarna?: (object{}&StripeObject), kr_card?: (object{}&StripeObject), link?: (object{}&StripeObject), naver_pay?: (object{}&StripeObject), nz_bank_account?: (object{}&StripeObject), paypal?: (object{billing_agreement_id: null|string, payer_id: null|string}&StripeObject), payto?: (object{amount: null|int, amount_type: string, end_date: null|string, payment_schedule: string, payments_per_period: null|int, purpose: null|string, start_date: null|string}&StripeObject), revolut_pay?: (object{}&StripeObject), sepa_debit?: (object{reference: string, url: string}&StripeObject), type: string, us_bank_account?: (object{collection_method?: string}&StripeObject)}&StripeObject) $payment_method_details + * @property (object{acss_debit?: (object{default_for?: string[], interval_description: null|string, payment_schedule: string, transaction_type: string}&StripeObject), amazon_pay?: (object{}&StripeObject), au_becs_debit?: (object{url: string}&StripeObject), bacs_debit?: (object{display_name: null|string, network_status: string, reference: string, revocation_reason: null|string, service_user_number: null|string, url: string}&StripeObject), card?: (object{}&StripeObject), cashapp?: (object{}&StripeObject), kakao_pay?: (object{}&StripeObject), klarna?: (object{}&StripeObject), kr_card?: (object{}&StripeObject), link?: (object{}&StripeObject), naver_pay?: (object{}&StripeObject), nz_bank_account?: (object{}&StripeObject), paypal?: (object{billing_agreement_id: null|string, payer_id: null|string}&StripeObject), payto?: (object{amount: null|int, amount_type: string, end_date: null|string, payment_schedule: string, payments_per_period: null|int, purpose: null|string, start_date: null|string}&StripeObject), revolut_pay?: (object{}&StripeObject), sepa_debit?: (object{reference: string, url: string}&StripeObject), type: string, upi?: (object{amount: null|int, amount_type: null|string, description: null|string, end_date: null|int}&StripeObject), us_bank_account?: (object{collection_method?: string}&StripeObject)}&StripeObject) $payment_method_details * @property null|(object{amount: int, currency: string}&StripeObject) $single_use * @property string $status The mandate status indicates whether or not you can use it to initiate a payment. * @property string $type The type of the mandate. diff --git a/plugins/stripe-php/lib/PaymentAttemptRecord.php b/plugins/stripe-php/lib/PaymentAttemptRecord.php index 4002bc96..4e69dbda 100644 --- a/plugins/stripe-php/lib/PaymentAttemptRecord.php +++ b/plugins/stripe-php/lib/PaymentAttemptRecord.php @@ -24,9 +24,9 @@ namespace Stripe; * @property null|(object{customer: null|string, email: null|string, name: null|string, phone: null|string}&StripeObject) $customer_details Customer information for this payment. * @property null|string $customer_presence Indicates whether the customer was present in your checkout flow during this payment. * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|(object{ach_credit_transfer?: (object{account_number: null|string, bank_name: null|string, routing_number: null|string, swift_code: null|string}&StripeObject), ach_debit?: (object{account_holder_type: null|string, bank_name: null|string, country: null|string, fingerprint: null|string, last4: null|string, routing_number: null|string}&StripeObject), acss_debit?: (object{bank_name: null|string, expected_debit_date?: string, fingerprint: null|string, institution_number: null|string, last4: null|string, mandate?: string, transit_number: null|string}&StripeObject), affirm?: (object{location?: string, reader?: string, transaction_id: null|string}&StripeObject), afterpay_clearpay?: (object{order_id: null|string, reference: null|string}&StripeObject), alipay?: (object{buyer_id?: string, fingerprint: null|string, transaction_id: null|string}&StripeObject), alma?: (object{installments?: (object{count: int}&StripeObject), transaction_id: null|string}&StripeObject), amazon_pay?: (object{funding?: (object{card?: (object{brand: null|string, country: null|string, exp_month: null|int, exp_year: null|int, funding: null|string, last4: null|string}&StripeObject), type: null|string}&StripeObject), transaction_id: null|string}&StripeObject), au_becs_debit?: (object{bsb_number: null|string, expected_debit_date?: string, fingerprint: null|string, last4: null|string, mandate?: string}&StripeObject), bacs_debit?: (object{expected_debit_date?: string, fingerprint: null|string, last4: null|string, mandate: null|string, sort_code: null|string}&StripeObject), bancontact?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, preferred_language: null|string, verified_name: null|string}&StripeObject), billie?: (object{transaction_id: null|string}&StripeObject), billing_details: null|(object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, phone: null|string}&StripeObject), blik?: (object{buyer_id: null|string}&StripeObject), boleto?: (object{tax_id: null|string}&StripeObject), card?: (object{authorization_code: null|string, brand: string, capture_before?: int, checks: null|(object{address_line1_check: null|string, address_postal_code_check: null|string, cvc_check: null|string}&StripeObject), country: null|string, description: null|string, exp_month: int, exp_year: int, fingerprint?: null|string, funding: string, iin: null|string, installments: null|(object{plan: null|(object{count: null|int, interval: null|string, type: string}&StripeObject)}&StripeObject), issuer: null|string, last4: string, moto?: bool, network: null|string, network_advice_code: null|string, network_decline_code: null|string, network_token?: null|(object{used: bool}&StripeObject), network_transaction_id: null|string, stored_credential_usage: null|string, three_d_secure: null|(object{authentication_flow: null|string, result: null|string, result_reason: null|string, version: null|string}&StripeObject), wallet: null|(object{apple_pay?: (object{type: string}&StripeObject), dynamic_last4?: string, google_pay?: (object{}&StripeObject), type: string}&StripeObject)}&StripeObject), card_present?: (object{amount_authorized: null|int, brand: null|string, brand_product: null|string, capture_before?: int, cardholder_name: null|string, country: null|string, description?: null|string, emv_auth_data: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, generated_card: null|string, iin?: null|string, incremental_authorization_supported: bool, issuer?: null|string, last4: null|string, location?: string, network: null|string, network_transaction_id: null|string, offline: null|(object{stored_at: null|int, type: null|string}&StripeObject), overcapture_supported: bool, preferred_locales: null|string[], read_method: null|string, reader?: string, receipt: null|(object{account_type?: string, application_cryptogram: null|string, application_preferred_name: null|string, authorization_code: null|string, authorization_response_code: null|string, cardholder_verification_method: null|string, dedicated_file_name: null|string, terminal_verification_results: null|string, transaction_status_information: null|string}&StripeObject), wallet?: (object{type: string}&StripeObject)}&StripeObject), cashapp?: (object{buyer_id: null|string, cashtag: null|string, transaction_id: null|string}&StripeObject), crypto?: (object{buyer_address?: string, network?: string, token_currency?: string, transaction_hash?: string}&StripeObject), custom?: (object{display_name: string, type: null|string}&StripeObject), customer_balance?: (object{}&StripeObject), eps?: (object{bank: null|string, verified_name: null|string}&StripeObject), fpx?: (object{account_holder_type: null|string, bank: string, transaction_id: null|string}&StripeObject), giropay?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, verified_name: null|string}&StripeObject), grabpay?: (object{transaction_id: null|string}&StripeObject), ideal?: (object{bank: null|string, bic: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, transaction_id: null|string, verified_name: null|string}&StripeObject), interac_present?: (object{brand: null|string, cardholder_name: null|string, country: null|string, description?: null|string, emv_auth_data: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, generated_card: null|string, iin?: null|string, issuer?: null|string, last4: null|string, location?: string, network: null|string, network_transaction_id: null|string, preferred_locales: null|string[], read_method: null|string, reader?: string, receipt: null|(object{account_type?: string, application_cryptogram: null|string, application_preferred_name: null|string, authorization_code: null|string, authorization_response_code: null|string, cardholder_verification_method: null|string, dedicated_file_name: null|string, terminal_verification_results: null|string, transaction_status_information: null|string}&StripeObject)}&StripeObject), kakao_pay?: (object{buyer_id: null|string, transaction_id: null|string}&StripeObject), klarna?: (object{payer_details: null|(object{address: null|(object{country: null|string}&StripeObject)}&StripeObject), payment_method_category: null|string, preferred_locale: null|string}&StripeObject), konbini?: (object{store: null|(object{chain: null|string}&StripeObject)}&StripeObject), kr_card?: (object{brand: null|string, buyer_id: null|string, last4: null|string, transaction_id: null|string}&StripeObject), link?: (object{country: null|string}&StripeObject), mb_way?: (object{}&StripeObject), mobilepay?: (object{card: null|(object{brand: null|string, country: null|string, exp_month: null|int, exp_year: null|int, last4: null|string}&StripeObject)}&StripeObject), multibanco?: (object{entity: null|string, reference: null|string}&StripeObject), naver_pay?: (object{buyer_id: null|string, transaction_id: null|string}&StripeObject), nz_bank_account?: (object{account_holder_name: null|string, bank_code: string, bank_name: string, branch_code: string, expected_debit_date?: string, last4: string, suffix: null|string}&StripeObject), oxxo?: (object{number: null|string}&StripeObject), p24?: (object{bank: null|string, reference: null|string, verified_name: null|string}&StripeObject), pay_by_bank?: (object{}&StripeObject), payco?: (object{buyer_id: null|string, transaction_id: null|string}&StripeObject), payment_method: null|string, paynow?: (object{location?: string, reader?: string, reference: null|string}&StripeObject), paypal?: (object{country: null|string, payer_email: null|string, payer_id: null|string, payer_name: null|string, seller_protection: null|(object{dispute_categories: null|string[], status: string}&StripeObject), transaction_id: null|string}&StripeObject), payto?: (object{bsb_number: null|string, last4: null|string, mandate?: string, pay_id: null|string}&StripeObject), pix?: (object{bank_transaction_id?: null|string}&StripeObject), promptpay?: (object{reference: null|string}&StripeObject), revolut_pay?: (object{funding?: (object{card?: (object{brand: null|string, country: null|string, exp_month: null|int, exp_year: null|int, funding: null|string, last4: null|string}&StripeObject), type: null|string}&StripeObject), transaction_id: null|string}&StripeObject), samsung_pay?: (object{buyer_id: null|string, transaction_id: null|string}&StripeObject), satispay?: (object{transaction_id: null|string}&StripeObject), sepa_credit_transfer?: (object{bank_name: null|string, bic: null|string, iban: null|string}&StripeObject), sepa_debit?: (object{bank_code: null|string, branch_code: null|string, country: null|string, expected_debit_date?: string, fingerprint: null|string, last4: null|string, mandate: null|string}&StripeObject), sofort?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, country: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, preferred_language: null|string, verified_name: null|string}&StripeObject), stripe_account?: (object{}&StripeObject), swish?: (object{fingerprint: null|string, payment_reference: null|string, verified_phone_last4: null|string}&StripeObject), twint?: (object{}&StripeObject), type: string, us_bank_account?: (object{account_holder_type: null|string, account_type: null|string, bank_name: null|string, expected_debit_date?: string, fingerprint: null|string, last4: null|string, mandate?: Mandate|string, payment_reference: null|string, routing_number: null|string}&StripeObject), wechat?: (object{}&StripeObject), wechat_pay?: (object{fingerprint: null|string, location?: string, reader?: string, transaction_id: null|string}&StripeObject), zip?: (object{}&StripeObject)}&StripeObject) $payment_method_details Information about the Payment Method debited for this payment. + * @property null|(object{ach_credit_transfer?: (object{account_number: null|string, bank_name: null|string, routing_number: null|string, swift_code: null|string}&StripeObject), ach_debit?: (object{account_holder_type: null|string, bank_name: null|string, country: null|string, fingerprint: null|string, last4: null|string, routing_number: null|string}&StripeObject), acss_debit?: (object{bank_name: null|string, expected_debit_date?: string, fingerprint: null|string, institution_number: null|string, last4: null|string, mandate?: string, transit_number: null|string}&StripeObject), affirm?: (object{location?: string, reader?: string, transaction_id: null|string}&StripeObject), afterpay_clearpay?: (object{order_id: null|string, reference: null|string}&StripeObject), alipay?: (object{buyer_id?: string, fingerprint: null|string, transaction_id: null|string}&StripeObject), alma?: (object{installments?: (object{count: int}&StripeObject), transaction_id: null|string}&StripeObject), amazon_pay?: (object{funding?: (object{card?: (object{brand: null|string, country: null|string, exp_month: null|int, exp_year: null|int, funding: null|string, last4: null|string}&StripeObject), type: null|string}&StripeObject), transaction_id: null|string}&StripeObject), au_becs_debit?: (object{bsb_number: null|string, expected_debit_date?: string, fingerprint: null|string, last4: null|string, mandate?: string}&StripeObject), bacs_debit?: (object{expected_debit_date?: string, fingerprint: null|string, last4: null|string, mandate: null|string, sort_code: null|string}&StripeObject), bancontact?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, preferred_language: null|string, verified_name: null|string}&StripeObject), billie?: (object{transaction_id: null|string}&StripeObject), billing_details: null|(object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, phone: null|string}&StripeObject), blik?: (object{buyer_id: null|string}&StripeObject), boleto?: (object{tax_id: null|string}&StripeObject), card?: (object{authorization_code: null|string, brand: null|string, capture_before?: int, checks: null|(object{address_line1_check: null|string, address_postal_code_check: null|string, cvc_check: null|string}&StripeObject), country: null|string, description: null|string, exp_month: null|int, exp_year: null|int, fingerprint?: null|string, funding: null|string, iin: null|string, installments: null|(object{plan: null|(object{count: null|int, interval: null|string, type: string}&StripeObject)}&StripeObject), issuer: null|string, last4: null|string, moto?: null|bool, network: null|string, network_advice_code: null|string, network_decline_code: null|string, network_token?: null|(object{used: bool}&StripeObject), network_transaction_id: null|string, stored_credential_usage: null|string, three_d_secure: null|(object{authentication_flow: null|string, cryptogram: null|string, electronic_commerce_indicator: null|string, exemption_indicator: null|string, exemption_indicator_applied: null|bool, result: null|string, result_reason: null|string, version: null|string}&StripeObject), wallet: null|(object{apple_pay?: (object{type: string}&StripeObject), dynamic_last4?: string, google_pay?: (object{}&StripeObject), type: string}&StripeObject)}&StripeObject), card_present?: (object{amount_authorized: null|int, brand: null|string, brand_product: null|string, capture_before?: int, cardholder_name: null|string, country: null|string, description?: null|string, emv_auth_data: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, generated_card: null|string, iin?: null|string, incremental_authorization_supported: bool, issuer?: null|string, last4: null|string, location?: string, network: null|string, network_transaction_id: null|string, offline: null|(object{stored_at: null|int, type: null|string}&StripeObject), overcapture_supported: bool, preferred_locales: null|string[], read_method: null|string, reader?: string, receipt: null|(object{account_type?: string, application_cryptogram: null|string, application_preferred_name: null|string, authorization_code: null|string, authorization_response_code: null|string, cardholder_verification_method: null|string, dedicated_file_name: null|string, terminal_verification_results: null|string, transaction_status_information: null|string}&StripeObject), wallet?: (object{type: string}&StripeObject)}&StripeObject), cashapp?: (object{buyer_id: null|string, cashtag: null|string, transaction_id: null|string}&StripeObject), crypto?: (object{buyer_address?: string, network?: string, token_currency?: string, transaction_hash?: string}&StripeObject), custom?: (object{display_name: string, type: null|string}&StripeObject), customer_balance?: (object{}&StripeObject), eps?: (object{bank: null|string, verified_name: null|string}&StripeObject), fpx?: (object{account_holder_type: null|string, bank: string, transaction_id: null|string}&StripeObject), giropay?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, verified_name: null|string}&StripeObject), grabpay?: (object{transaction_id: null|string}&StripeObject), ideal?: (object{bank: null|string, bic: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, transaction_id: null|string, verified_name: null|string}&StripeObject), interac_present?: (object{brand: null|string, cardholder_name: null|string, country: null|string, description?: null|string, emv_auth_data: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, generated_card: null|string, iin?: null|string, issuer?: null|string, last4: null|string, location?: string, network: null|string, network_transaction_id: null|string, preferred_locales: null|string[], read_method: null|string, reader?: string, receipt: null|(object{account_type?: string, application_cryptogram: null|string, application_preferred_name: null|string, authorization_code: null|string, authorization_response_code: null|string, cardholder_verification_method: null|string, dedicated_file_name: null|string, terminal_verification_results: null|string, transaction_status_information: null|string}&StripeObject)}&StripeObject), kakao_pay?: (object{buyer_id: null|string, transaction_id: null|string}&StripeObject), klarna?: (object{payer_details: null|(object{address: null|(object{country: null|string}&StripeObject)}&StripeObject), payment_method_category: null|string, preferred_locale: null|string}&StripeObject), konbini?: (object{store: null|(object{chain: null|string}&StripeObject)}&StripeObject), kr_card?: (object{brand: null|string, buyer_id: null|string, last4: null|string, transaction_id: null|string}&StripeObject), link?: (object{country: null|string}&StripeObject), mb_way?: (object{}&StripeObject), mobilepay?: (object{card: null|(object{brand: null|string, country: null|string, exp_month: null|int, exp_year: null|int, last4: null|string}&StripeObject)}&StripeObject), multibanco?: (object{entity: null|string, reference: null|string}&StripeObject), naver_pay?: (object{buyer_id: null|string, transaction_id: null|string}&StripeObject), nz_bank_account?: (object{account_holder_name: null|string, bank_code: string, bank_name: string, branch_code: string, expected_debit_date?: string, last4: string, suffix: null|string}&StripeObject), oxxo?: (object{number: null|string}&StripeObject), p24?: (object{bank: null|string, reference: null|string, verified_name: null|string}&StripeObject), pay_by_bank?: (object{}&StripeObject), payco?: (object{buyer_id: null|string, transaction_id: null|string}&StripeObject), payment_method: null|string, paynow?: (object{location?: string, reader?: string, reference: null|string}&StripeObject), paypal?: (object{country: null|string, payer_email: null|string, payer_id: null|string, payer_name: null|string, seller_protection: null|(object{dispute_categories: null|string[], status: string}&StripeObject), transaction_id: null|string}&StripeObject), payto?: (object{bsb_number: null|string, last4: null|string, mandate?: string, pay_id: null|string}&StripeObject), pix?: (object{bank_transaction_id?: null|string}&StripeObject), promptpay?: (object{reference: null|string}&StripeObject), revolut_pay?: (object{funding?: (object{card?: (object{brand: null|string, country: null|string, exp_month: null|int, exp_year: null|int, funding: null|string, last4: null|string}&StripeObject), type: null|string}&StripeObject), transaction_id: null|string}&StripeObject), samsung_pay?: (object{buyer_id: null|string, transaction_id: null|string}&StripeObject), satispay?: (object{transaction_id: null|string}&StripeObject), sepa_credit_transfer?: (object{bank_name: null|string, bic: null|string, iban: null|string}&StripeObject), sepa_debit?: (object{bank_code: null|string, branch_code: null|string, country: null|string, expected_debit_date?: string, fingerprint: null|string, last4: null|string, mandate: null|string}&StripeObject), sofort?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, country: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, preferred_language: null|string, verified_name: null|string}&StripeObject), stripe_account?: (object{}&StripeObject), swish?: (object{fingerprint: null|string, payment_reference: null|string, verified_phone_last4: null|string}&StripeObject), twint?: (object{}&StripeObject), type: string, upi?: (object{vpa: null|string}&StripeObject), us_bank_account?: (object{account_holder_type: null|string, account_type: null|string, bank_name: null|string, expected_debit_date?: string, fingerprint: null|string, last4: null|string, mandate?: Mandate|string, payment_reference: null|string, routing_number: null|string}&StripeObject), wechat?: (object{}&StripeObject), wechat_pay?: (object{fingerprint: null|string, location?: string, reader?: string, transaction_id: null|string}&StripeObject), zip?: (object{}&StripeObject)}&StripeObject) $payment_method_details Information about the Payment Method debited for this payment. * @property null|string $payment_record ID of the Payment Record this Payment Attempt Record belongs to. * @property (object{custom?: (object{payment_reference: null|string}&StripeObject), type: string}&StripeObject) $processor_details Processor information associated with this payment. * @property string $reported_by Indicates who reported the payment. diff --git a/plugins/stripe-php/lib/PaymentIntent.php b/plugins/stripe-php/lib/PaymentIntent.php index 5aba14e7..b64b1128 100644 --- a/plugins/stripe-php/lib/PaymentIntent.php +++ b/plugins/stripe-php/lib/PaymentIntent.php @@ -40,14 +40,14 @@ namespace Stripe; * @property null|(object{inputs?: (object{tax?: (object{calculation: string}&StripeObject)}&StripeObject)}&StripeObject) $hooks * @property null|(object{advice_code?: string, charge?: string, code?: string, decline_code?: string, doc_url?: string, message?: string, network_advice_code?: string, network_decline_code?: string, param?: string, payment_intent?: PaymentIntent, payment_method?: PaymentMethod, payment_method_type?: string, request_log_url?: string, setup_intent?: SetupIntent, source?: Account|BankAccount|Card|Source, type: string}&StripeObject) $last_payment_error The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason. * @property null|Charge|string $latest_charge ID of the latest Charge object created by this PaymentIntent. This property is null until PaymentIntent confirmation is attempted. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Learn more about storing information in metadata. - * @property null|(object{alipay_handle_redirect?: (object{native_data: null|string, native_url: null|string, return_url: null|string, url: null|string}&StripeObject), boleto_display_details?: (object{expires_at: null|int, hosted_voucher_url: null|string, number: null|string, pdf: null|string}&StripeObject), card_await_notification?: (object{charge_attempt_at: null|int, customer_approval_required: null|bool}&StripeObject), cashapp_handle_redirect_or_display_qr_code?: (object{hosted_instructions_url: string, mobile_auth_url: string, qr_code: (object{expires_at: int, image_url_png: string, image_url_svg: string}&StripeObject)}&StripeObject), display_bank_transfer_instructions?: (object{amount_remaining: null|int, currency: null|string, financial_addresses?: ((object{aba?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, account_number: string, account_type: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bank_name: string, routing_number: string}&StripeObject), iban?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bic: string, country: string, iban: string}&StripeObject), sort_code?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, account_number: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), sort_code: string}&StripeObject), spei?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bank_code: string, bank_name: string, clabe: string}&StripeObject), supported_networks?: string[], swift?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, account_number: string, account_type: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bank_name: string, swift_code: string}&StripeObject), type: string, zengin?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: null|string, account_number: null|string, account_type: null|string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bank_code: null|string, bank_name: null|string, branch_code: null|string, branch_name: null|string}&StripeObject)}&StripeObject))[], hosted_instructions_url: null|string, reference: null|string, type: string}&StripeObject), konbini_display_details?: (object{expires_at: int, hosted_voucher_url: null|string, stores: (object{familymart: null|(object{confirmation_number?: string, payment_code: string}&StripeObject), lawson: null|(object{confirmation_number?: string, payment_code: string}&StripeObject), ministop: null|(object{confirmation_number?: string, payment_code: string}&StripeObject), seicomart: null|(object{confirmation_number?: string, payment_code: string}&StripeObject)}&StripeObject)}&StripeObject), multibanco_display_details?: (object{entity: null|string, expires_at: null|int, hosted_voucher_url: null|string, reference: null|string}&StripeObject), oxxo_display_details?: (object{expires_after: null|int, hosted_voucher_url: null|string, number: null|string}&StripeObject), paynow_display_qr_code?: (object{data: string, hosted_instructions_url: null|string, image_url_png: string, image_url_svg: string}&StripeObject), pix_display_qr_code?: (object{data?: string, expires_at?: int, hosted_instructions_url?: string, image_url_png?: string, image_url_svg?: string}&StripeObject), promptpay_display_qr_code?: (object{data: string, hosted_instructions_url: string, image_url_png: string, image_url_svg: string}&StripeObject), redirect_to_url?: (object{return_url: null|string, url: null|string}&StripeObject), swish_handle_redirect_or_display_qr_code?: (object{hosted_instructions_url: string, mobile_auth_url: string, qr_code: (object{data: string, image_url_png: string, image_url_svg: string}&StripeObject)}&StripeObject), type: string, use_stripe_sdk?: StripeObject, verify_with_microdeposits?: (object{arrival_date: int, hosted_verification_url: string, microdeposit_type: null|string}&StripeObject), wechat_pay_display_qr_code?: (object{data: string, hosted_instructions_url: string, image_data_url: string, image_url_png: string, image_url_svg: string}&StripeObject), wechat_pay_redirect_to_android_app?: (object{app_id: string, nonce_str: string, package: string, partner_id: string, prepay_id: string, sign: string, timestamp: string}&StripeObject), wechat_pay_redirect_to_ios_app?: (object{native_url: string}&StripeObject)}&StripeObject) $next_action If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source. + * @property null|(object{alipay_handle_redirect?: (object{native_data: null|string, native_url: null|string, return_url: null|string, url: null|string}&StripeObject), boleto_display_details?: (object{expires_at: null|int, hosted_voucher_url: null|string, number: null|string, pdf: null|string}&StripeObject), card_await_notification?: (object{charge_attempt_at: null|int, customer_approval_required: null|bool}&StripeObject), cashapp_handle_redirect_or_display_qr_code?: (object{hosted_instructions_url: string, mobile_auth_url: string, qr_code: (object{expires_at: int, image_url_png: string, image_url_svg: string}&StripeObject)}&StripeObject), display_bank_transfer_instructions?: (object{amount_remaining: null|int, currency: null|string, financial_addresses?: ((object{aba?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, account_number: string, account_type: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bank_name: string, routing_number: string}&StripeObject), iban?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bic: string, country: string, iban: string}&StripeObject), sort_code?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, account_number: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), sort_code: string}&StripeObject), spei?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bank_code: string, bank_name: string, clabe: string}&StripeObject), supported_networks?: string[], swift?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: string, account_number: string, account_type: string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bank_name: string, swift_code: string}&StripeObject), type: string, zengin?: (object{account_holder_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), account_holder_name: null|string, account_number: null|string, account_type: null|string, bank_address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), bank_code: null|string, bank_name: null|string, branch_code: null|string, branch_name: null|string}&StripeObject)}&StripeObject))[], hosted_instructions_url: null|string, reference: null|string, type: string}&StripeObject), konbini_display_details?: (object{expires_at: int, hosted_voucher_url: null|string, stores: (object{familymart: null|(object{confirmation_number?: string, payment_code: string}&StripeObject), lawson: null|(object{confirmation_number?: string, payment_code: string}&StripeObject), ministop: null|(object{confirmation_number?: string, payment_code: string}&StripeObject), seicomart: null|(object{confirmation_number?: string, payment_code: string}&StripeObject)}&StripeObject)}&StripeObject), multibanco_display_details?: (object{entity: null|string, expires_at: null|int, hosted_voucher_url: null|string, reference: null|string}&StripeObject), oxxo_display_details?: (object{expires_after: null|int, hosted_voucher_url: null|string, number: null|string}&StripeObject), paynow_display_qr_code?: (object{data: string, hosted_instructions_url: null|string, image_url_png: string, image_url_svg: string}&StripeObject), pix_display_qr_code?: (object{data?: string, expires_at?: int, hosted_instructions_url?: string, image_url_png?: string, image_url_svg?: string}&StripeObject), promptpay_display_qr_code?: (object{data: string, hosted_instructions_url: string, image_url_png: string, image_url_svg: string}&StripeObject), redirect_to_url?: (object{return_url: null|string, url: null|string}&StripeObject), swish_handle_redirect_or_display_qr_code?: (object{hosted_instructions_url: string, mobile_auth_url: string, qr_code: (object{data: string, image_url_png: string, image_url_svg: string}&StripeObject)}&StripeObject), type: string, upi_handle_redirect_or_display_qr_code?: (object{hosted_instructions_url: string, qr_code: (object{expires_at: int, image_url_png: string, image_url_svg: string}&StripeObject)}&StripeObject), use_stripe_sdk?: StripeObject, verify_with_microdeposits?: (object{arrival_date: int, hosted_verification_url: string, microdeposit_type: null|string}&StripeObject), wechat_pay_display_qr_code?: (object{data: string, hosted_instructions_url: string, image_data_url: string, image_url_png: string, image_url_svg: string}&StripeObject), wechat_pay_redirect_to_android_app?: (object{app_id: string, nonce_str: string, package: string, partner_id: string, prepay_id: string, sign: string, timestamp: string}&StripeObject), wechat_pay_redirect_to_ios_app?: (object{native_url: string}&StripeObject)}&StripeObject) $next_action If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source. * @property null|Account|string $on_behalf_of You can specify the settlement merchant as the connected account using the on_behalf_of attribute on the charge. See the PaymentIntents use case for connected accounts for details. * @property null|(object{customer_reference: null|string, order_reference: null|string}&StripeObject) $payment_details * @property null|PaymentMethod|string $payment_method ID of the payment method used in this PaymentIntent. * @property null|(object{id: string, parent: null|string}&StripeObject) $payment_method_configuration_details Information about the payment method configuration used for this PaymentIntent. - * @property null|(object{acss_debit?: (object{mandate_options?: (object{custom_mandate_url?: string, interval_description: null|string, payment_schedule: null|string, transaction_type: null|string}&StripeObject), setup_future_usage?: string, target_date?: string, verification_method?: string}&StripeObject), affirm?: (object{capture_method?: string, preferred_locale?: string, setup_future_usage?: string}&StripeObject), afterpay_clearpay?: (object{capture_method?: string, reference: null|string, setup_future_usage?: string}&StripeObject), alipay?: (object{setup_future_usage?: string}&StripeObject), alma?: (object{capture_method?: string}&StripeObject), amazon_pay?: (object{capture_method?: string, setup_future_usage?: string}&StripeObject), au_becs_debit?: (object{setup_future_usage?: string, target_date?: string}&StripeObject), bacs_debit?: (object{mandate_options?: (object{reference_prefix?: string}&StripeObject), setup_future_usage?: string, target_date?: string}&StripeObject), bancontact?: (object{preferred_language: string, setup_future_usage?: string}&StripeObject), billie?: (object{capture_method?: string}&StripeObject), blik?: (object{setup_future_usage?: string}&StripeObject), boleto?: (object{expires_after_days: int, setup_future_usage?: string}&StripeObject), card?: (object{capture_method?: string, installments: null|(object{available_plans: null|((object{count: null|int, interval: null|string, type: string}&StripeObject))[], enabled: bool, plan: null|(object{count: null|int, interval: null|string, type: string}&StripeObject)}&StripeObject), mandate_options: null|(object{amount: int, amount_type: string, description: null|string, end_date: null|int, interval: string, interval_count: null|int, reference: string, start_date: int, supported_types: null|string[]}&StripeObject), network: null|string, request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure: null|string, require_cvc_recollection?: bool, setup_future_usage?: string, statement_descriptor_suffix_kana?: string, statement_descriptor_suffix_kanji?: string}&StripeObject), card_present?: (object{capture_method?: string, request_extended_authorization: null|bool, request_incremental_authorization_support: null|bool, routing?: (object{requested_priority: null|string}&StripeObject)}&StripeObject), cashapp?: (object{capture_method?: string, setup_future_usage?: string}&StripeObject), crypto?: (object{setup_future_usage?: string}&StripeObject), customer_balance?: (object{bank_transfer?: (object{eu_bank_transfer?: (object{country: string}&StripeObject), requested_address_types?: string[], type: null|string}&StripeObject), funding_type: null|string, setup_future_usage?: string}&StripeObject), eps?: (object{setup_future_usage?: string}&StripeObject), fpx?: (object{setup_future_usage?: string}&StripeObject), giropay?: (object{setup_future_usage?: string}&StripeObject), grabpay?: (object{setup_future_usage?: string}&StripeObject), ideal?: (object{setup_future_usage?: string}&StripeObject), interac_present?: (object{}&StripeObject), kakao_pay?: (object{capture_method?: string, setup_future_usage?: string}&StripeObject), klarna?: (object{capture_method?: string, preferred_locale: null|string, setup_future_usage?: string}&StripeObject), konbini?: (object{confirmation_number: null|string, expires_after_days: null|int, expires_at: null|int, product_description: null|string, setup_future_usage?: string}&StripeObject), kr_card?: (object{capture_method?: string, setup_future_usage?: string}&StripeObject), link?: (object{capture_method?: string, persistent_token: null|string, setup_future_usage?: string}&StripeObject), mb_way?: (object{setup_future_usage?: string}&StripeObject), mobilepay?: (object{capture_method?: string, setup_future_usage?: string}&StripeObject), multibanco?: (object{setup_future_usage?: string}&StripeObject), naver_pay?: (object{capture_method?: string, setup_future_usage?: string}&StripeObject), nz_bank_account?: (object{setup_future_usage?: string, target_date?: string}&StripeObject), oxxo?: (object{expires_after_days: int, setup_future_usage?: string}&StripeObject), p24?: (object{setup_future_usage?: string}&StripeObject), pay_by_bank?: (object{}&StripeObject), payco?: (object{capture_method?: string}&StripeObject), paynow?: (object{setup_future_usage?: string}&StripeObject), paypal?: (object{capture_method?: string, preferred_locale: null|string, reference: null|string, setup_future_usage?: string}&StripeObject), payto?: (object{mandate_options?: (object{amount: null|int, amount_type: null|string, end_date: null|string, payment_schedule: null|string, payments_per_period: null|int, purpose: null|string}&StripeObject), setup_future_usage?: string}&StripeObject), pix?: (object{amount_includes_iof?: string, expires_after_seconds: null|int, expires_at: null|int, setup_future_usage?: string}&StripeObject), promptpay?: (object{setup_future_usage?: string}&StripeObject), revolut_pay?: (object{capture_method?: string, setup_future_usage?: string}&StripeObject), samsung_pay?: (object{capture_method?: string}&StripeObject), satispay?: (object{capture_method?: string}&StripeObject), sepa_debit?: (object{mandate_options?: (object{reference_prefix?: string}&StripeObject), setup_future_usage?: string, target_date?: string}&StripeObject), sofort?: (object{preferred_language: null|string, setup_future_usage?: string}&StripeObject), swish?: (object{reference: null|string, setup_future_usage?: string}&StripeObject), twint?: (object{setup_future_usage?: string}&StripeObject), us_bank_account?: (object{financial_connections?: (object{filters?: (object{account_subcategories?: string[]}&StripeObject), permissions?: string[], prefetch: null|string[], return_url?: string}&StripeObject), mandate_options?: (object{collection_method?: string}&StripeObject), setup_future_usage?: string, target_date?: string, transaction_purpose?: string, verification_method?: string, preferred_settlement_speed?: string}&StripeObject), wechat_pay?: (object{app_id: null|string, client: null|string, setup_future_usage?: string}&StripeObject), zip?: (object{setup_future_usage?: string}&StripeObject)}&StripeObject) $payment_method_options Payment-method-specific configuration for this PaymentIntent. + * @property null|(object{acss_debit?: (object{mandate_options?: (object{custom_mandate_url?: string, interval_description: null|string, payment_schedule: null|string, transaction_type: null|string}&StripeObject), setup_future_usage?: string, target_date?: string, verification_method?: string}&StripeObject), affirm?: (object{capture_method?: string, preferred_locale?: string, setup_future_usage?: string}&StripeObject), afterpay_clearpay?: (object{capture_method?: string, reference: null|string, setup_future_usage?: string}&StripeObject), alipay?: (object{setup_future_usage?: string}&StripeObject), alma?: (object{capture_method?: string}&StripeObject), amazon_pay?: (object{capture_method?: string, setup_future_usage?: string}&StripeObject), au_becs_debit?: (object{setup_future_usage?: string, target_date?: string}&StripeObject), bacs_debit?: (object{mandate_options?: (object{reference_prefix?: string}&StripeObject), setup_future_usage?: string, target_date?: string}&StripeObject), bancontact?: (object{preferred_language: string, setup_future_usage?: string}&StripeObject), billie?: (object{capture_method?: string}&StripeObject), blik?: (object{setup_future_usage?: string}&StripeObject), boleto?: (object{expires_after_days: int, setup_future_usage?: string}&StripeObject), card?: (object{capture_method?: string, installments: null|(object{available_plans: null|((object{count: null|int, interval: null|string, type: string}&StripeObject))[], enabled: bool, plan: null|(object{count: null|int, interval: null|string, type: string}&StripeObject)}&StripeObject), mandate_options: null|(object{amount: int, amount_type: string, description: null|string, end_date: null|int, interval: string, interval_count: null|int, reference: string, start_date: int, supported_types: null|string[]}&StripeObject), network: null|string, request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure: null|string, require_cvc_recollection?: bool, setup_future_usage?: string, statement_descriptor_suffix_kana?: string, statement_descriptor_suffix_kanji?: string}&StripeObject), card_present?: (object{capture_method?: string, request_extended_authorization: null|bool, request_incremental_authorization_support: null|bool, routing?: (object{requested_priority: null|string}&StripeObject)}&StripeObject), cashapp?: (object{capture_method?: string, setup_future_usage?: string}&StripeObject), crypto?: (object{setup_future_usage?: string}&StripeObject), customer_balance?: (object{bank_transfer?: (object{eu_bank_transfer?: (object{country: string}&StripeObject), requested_address_types?: string[], type: null|string}&StripeObject), funding_type: null|string, setup_future_usage?: string}&StripeObject), eps?: (object{setup_future_usage?: string}&StripeObject), fpx?: (object{setup_future_usage?: string}&StripeObject), giropay?: (object{setup_future_usage?: string}&StripeObject), grabpay?: (object{setup_future_usage?: string}&StripeObject), ideal?: (object{setup_future_usage?: string}&StripeObject), interac_present?: (object{}&StripeObject), kakao_pay?: (object{capture_method?: string, setup_future_usage?: string}&StripeObject), klarna?: (object{capture_method?: string, preferred_locale: null|string, setup_future_usage?: string}&StripeObject), konbini?: (object{confirmation_number: null|string, expires_after_days: null|int, expires_at: null|int, product_description: null|string, setup_future_usage?: string}&StripeObject), kr_card?: (object{capture_method?: string, setup_future_usage?: string}&StripeObject), link?: (object{capture_method?: string, persistent_token: null|string, setup_future_usage?: string}&StripeObject), mb_way?: (object{setup_future_usage?: string}&StripeObject), mobilepay?: (object{capture_method?: string, setup_future_usage?: string}&StripeObject), multibanco?: (object{setup_future_usage?: string}&StripeObject), naver_pay?: (object{capture_method?: string, setup_future_usage?: string}&StripeObject), nz_bank_account?: (object{setup_future_usage?: string, target_date?: string}&StripeObject), oxxo?: (object{expires_after_days: int, setup_future_usage?: string}&StripeObject), p24?: (object{setup_future_usage?: string}&StripeObject), pay_by_bank?: (object{}&StripeObject), payco?: (object{capture_method?: string}&StripeObject), paynow?: (object{setup_future_usage?: string}&StripeObject), paypal?: (object{capture_method?: string, preferred_locale: null|string, reference: null|string, setup_future_usage?: string}&StripeObject), payto?: (object{mandate_options?: (object{amount: null|int, amount_type: null|string, end_date: null|string, payment_schedule: null|string, payments_per_period: null|int, purpose: null|string}&StripeObject), setup_future_usage?: string}&StripeObject), pix?: (object{amount_includes_iof?: string, expires_after_seconds: null|int, expires_at: null|int, setup_future_usage?: string}&StripeObject), promptpay?: (object{setup_future_usage?: string}&StripeObject), revolut_pay?: (object{capture_method?: string, setup_future_usage?: string}&StripeObject), samsung_pay?: (object{capture_method?: string}&StripeObject), satispay?: (object{capture_method?: string}&StripeObject), sepa_debit?: (object{mandate_options?: (object{reference_prefix?: string}&StripeObject), setup_future_usage?: string, target_date?: string}&StripeObject), sofort?: (object{preferred_language: null|string, setup_future_usage?: string}&StripeObject), swish?: (object{reference: null|string, setup_future_usage?: string}&StripeObject), twint?: (object{setup_future_usage?: string}&StripeObject), upi?: (object{setup_future_usage?: string}&StripeObject), us_bank_account?: (object{financial_connections?: (object{filters?: (object{account_subcategories?: string[]}&StripeObject), permissions?: string[], prefetch: null|string[], return_url?: string}&StripeObject), mandate_options?: (object{collection_method?: string}&StripeObject), setup_future_usage?: string, target_date?: string, transaction_purpose?: string, verification_method?: string}&StripeObject), wechat_pay?: (object{app_id: null|string, client: null|string, setup_future_usage?: string}&StripeObject), zip?: (object{setup_future_usage?: string}&StripeObject)}&StripeObject) $payment_method_options Payment-method-specific configuration for this PaymentIntent. * @property string[] $payment_method_types The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. A comprehensive list of valid payment method types can be found here. * @property null|(object{presentment_amount: int, presentment_currency: string}&StripeObject) $presentment_details * @property null|(object{card?: (object{customer_notification?: (object{approval_requested: null|bool, completes_at: null|int}&StripeObject)}&StripeObject), type: string}&StripeObject) $processing If present, this property tells you about the processing state of the payment. @@ -109,7 +109,7 @@ class PaymentIntent extends ApiResource * parameters available in the confirm * API when you supply confirm=true. * - * @param null|array{amount: int, amount_details?: array{discount_amount?: null|int, enforce_arithmetic_validation?: bool, line_items?: null|array{discount_amount?: int, payment_method_options?: array{card?: array{commodity_code?: string}, card_present?: array{commodity_code?: string}, klarna?: array{image_url?: string, product_url?: string, reference?: string, subscription_reference?: string}, paypal?: array{category?: string, description?: string, sold_by?: string}}, product_code?: string, product_name: string, quantity: int, tax?: array{total_tax_amount: int}, unit_cost: int, unit_of_measure?: string}[], shipping?: null|array{amount?: null|int, from_postal_code?: null|string, to_postal_code?: null|string}, tax?: null|array{total_tax_amount: int}}, application_fee_amount?: int, automatic_payment_methods?: array{allow_redirects?: string, enabled: bool}, capture_method?: string, confirm?: bool, confirmation_method?: string, confirmation_token?: string, currency: string, customer?: string, customer_account?: string, description?: string, error_on_requires_action?: bool, excluded_payment_method_types?: string[], expand?: string[], hooks?: array{inputs?: array{tax?: array{calculation: null|string}}}, mandate?: string, mandate_data?: null|array{customer_acceptance: array{accepted_at?: int, offline?: array{}, online?: array{ip_address: string, user_agent: string}, type: string}}, metadata?: array, off_session?: array|bool|string, on_behalf_of?: string, payment_details?: array{customer_reference?: null|string, order_reference?: null|string}, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, crypto?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{custom_mandate_url?: null|string, interval_description?: string, payment_schedule?: string, transaction_type?: string}, setup_future_usage?: null|string, target_date?: string, verification_method?: string}, affirm?: null|array{capture_method?: null|string, preferred_locale?: string, setup_future_usage?: string}, afterpay_clearpay?: null|array{capture_method?: null|string, reference?: string, setup_future_usage?: string}, alipay?: null|array{setup_future_usage?: null|string}, alma?: null|array{capture_method?: null|string}, amazon_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, au_becs_debit?: null|array{setup_future_usage?: null|string, target_date?: string}, bacs_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, bancontact?: null|array{preferred_language?: string, setup_future_usage?: null|string}, billie?: null|array{capture_method?: null|string}, blik?: null|array{code?: string, setup_future_usage?: null|string}, boleto?: null|array{expires_after_days?: int, setup_future_usage?: null|string}, card?: null|array{capture_method?: null|string, cvc_token?: string, installments?: array{enabled?: bool, plan?: null|array{count?: int, interval?: string, type: string}}, mandate_options?: array{amount: int, amount_type: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure?: string, require_cvc_recollection?: bool, setup_future_usage?: null|string, statement_descriptor_suffix_kana?: null|string, statement_descriptor_suffix_kanji?: null|string, three_d_secure?: array{ares_trans_status?: string, cryptogram: string, electronic_commerce_indicator?: string, exemption_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id: string, version: string}}, card_present?: null|array{capture_method?: string, request_extended_authorization?: bool, request_incremental_authorization_support?: bool, routing?: array{requested_priority?: string}}, cashapp?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, crypto?: null|array{setup_future_usage?: string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, requested_address_types?: string[], type: string}, funding_type?: string, setup_future_usage?: string}, eps?: null|array{setup_future_usage?: string}, fpx?: null|array{setup_future_usage?: string}, giropay?: null|array{setup_future_usage?: string}, grabpay?: null|array{setup_future_usage?: string}, ideal?: null|array{setup_future_usage?: null|string}, interac_present?: null|array{}, kakao_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, klarna?: null|array{capture_method?: null|string, on_demand?: array{average_amount?: int, maximum_amount?: int, minimum_amount?: int, purchase_interval?: string, purchase_interval_count?: int}, preferred_locale?: string, setup_future_usage?: string, subscriptions?: null|array{interval: string, interval_count?: int, name?: string, next_billing?: array{amount: int, date: string}, reference: string}[]}, konbini?: null|array{confirmation_number?: null|string, expires_after_days?: null|int, expires_at?: null|int, product_description?: null|string, setup_future_usage?: string}, kr_card?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, link?: null|array{capture_method?: null|string, persistent_token?: string, setup_future_usage?: null|string}, mb_way?: null|array{setup_future_usage?: string}, mobilepay?: null|array{capture_method?: null|string, setup_future_usage?: string}, multibanco?: null|array{setup_future_usage?: string}, naver_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, nz_bank_account?: null|array{setup_future_usage?: null|string, target_date?: string}, oxxo?: null|array{expires_after_days?: int, setup_future_usage?: string}, p24?: null|array{setup_future_usage?: string, tos_shown_and_accepted?: bool}, pay_by_bank?: null|array{}, payco?: null|array{capture_method?: null|string}, paynow?: null|array{setup_future_usage?: string}, paypal?: null|array{capture_method?: null|string, preferred_locale?: string, reference?: string, risk_correlation_id?: string, setup_future_usage?: null|string}, payto?: null|array{mandate_options?: array{amount?: null|int, amount_type?: null|string, end_date?: null|string, payment_schedule?: null|string, payments_per_period?: null|int, purpose?: null|string}, setup_future_usage?: null|string}, pix?: null|array{amount_includes_iof?: string, expires_after_seconds?: int, expires_at?: int, setup_future_usage?: string}, promptpay?: null|array{setup_future_usage?: string}, revolut_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, samsung_pay?: null|array{capture_method?: null|string}, satispay?: null|array{capture_method?: null|string}, sepa_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, sofort?: null|array{preferred_language?: null|string, setup_future_usage?: null|string}, swish?: null|array{reference?: null|string, setup_future_usage?: string}, twint?: null|array{setup_future_usage?: string}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, setup_future_usage?: null|string, target_date?: string, transaction_purpose?: null|string, verification_method?: string, preferred_settlement_speed?: null|string}, wechat_pay?: null|array{app_id?: string, client?: string, setup_future_usage?: string}, zip?: null|array{setup_future_usage?: string}}, payment_method_types?: string[], radar_options?: array{session?: string}, receipt_email?: string, return_url?: string, setup_future_usage?: string, shipping?: array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name: string, phone?: string, tracking_number?: string}, statement_descriptor?: string, statement_descriptor_suffix?: string, transfer_data?: array{amount?: int, destination: string}, transfer_group?: string, use_stripe_sdk?: bool} $params + * @param null|array{amount: int, amount_details?: array{discount_amount?: null|int, enforce_arithmetic_validation?: bool, line_items?: null|array{discount_amount?: int, payment_method_options?: array{card?: array{commodity_code?: string}, card_present?: array{commodity_code?: string}, klarna?: array{image_url?: string, product_url?: string, reference?: string, subscription_reference?: string}, paypal?: array{category?: string, description?: string, sold_by?: string}}, product_code?: string, product_name: string, quantity: int, tax?: array{total_tax_amount: int}, unit_cost: int, unit_of_measure?: string}[], shipping?: null|array{amount?: null|int, from_postal_code?: null|string, to_postal_code?: null|string}, tax?: null|array{total_tax_amount: int}}, application_fee_amount?: int, automatic_payment_methods?: array{allow_redirects?: string, enabled: bool}, capture_method?: string, confirm?: bool, confirmation_method?: string, confirmation_token?: string, currency: string, customer?: string, customer_account?: string, description?: string, error_on_requires_action?: bool, excluded_payment_method_types?: string[], expand?: string[], hooks?: array{inputs?: array{tax?: array{calculation: null|string}}}, mandate?: string, mandate_data?: null|array{customer_acceptance: array{accepted_at?: int, offline?: array{}, online?: array{ip_address: string, user_agent: string}, type: string}}, metadata?: array, off_session?: array|bool|string, on_behalf_of?: string, payment_details?: array{customer_reference?: null|string, order_reference?: null|string}, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, crypto?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, upi?: array{mandate_options?: array{amount?: int, amount_type?: string, description?: string, end_date?: int}}, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{custom_mandate_url?: null|string, interval_description?: string, payment_schedule?: string, transaction_type?: string}, setup_future_usage?: null|string, target_date?: string, verification_method?: string}, affirm?: null|array{capture_method?: null|string, preferred_locale?: string, setup_future_usage?: string}, afterpay_clearpay?: null|array{capture_method?: null|string, reference?: string, setup_future_usage?: string}, alipay?: null|array{setup_future_usage?: null|string}, alma?: null|array{capture_method?: null|string}, amazon_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, au_becs_debit?: null|array{setup_future_usage?: null|string, target_date?: string}, bacs_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, bancontact?: null|array{preferred_language?: string, setup_future_usage?: null|string}, billie?: null|array{capture_method?: null|string}, blik?: null|array{code?: string, setup_future_usage?: null|string}, boleto?: null|array{expires_after_days?: int, setup_future_usage?: null|string}, card?: null|array{capture_method?: null|string, cvc_token?: string, installments?: array{enabled?: bool, plan?: null|array{count?: int, interval?: string, type: string}}, mandate_options?: array{amount: int, amount_type: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure?: string, require_cvc_recollection?: bool, setup_future_usage?: null|string, statement_descriptor_suffix_kana?: null|string, statement_descriptor_suffix_kanji?: null|string, three_d_secure?: array{ares_trans_status?: string, cryptogram: string, electronic_commerce_indicator?: string, exemption_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id: string, version: string}}, card_present?: null|array{capture_method?: string, request_extended_authorization?: bool, request_incremental_authorization_support?: bool, routing?: array{requested_priority?: string}}, cashapp?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, crypto?: null|array{setup_future_usage?: string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, requested_address_types?: string[], type: string}, funding_type?: string, setup_future_usage?: string}, eps?: null|array{setup_future_usage?: string}, fpx?: null|array{setup_future_usage?: string}, giropay?: null|array{setup_future_usage?: string}, grabpay?: null|array{setup_future_usage?: string}, ideal?: null|array{setup_future_usage?: null|string}, interac_present?: null|array{}, kakao_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, klarna?: null|array{capture_method?: null|string, on_demand?: array{average_amount?: int, maximum_amount?: int, minimum_amount?: int, purchase_interval?: string, purchase_interval_count?: int}, preferred_locale?: string, setup_future_usage?: string, subscriptions?: null|array{interval: string, interval_count?: int, name?: string, next_billing?: array{amount: int, date: string}, reference: string}[]}, konbini?: null|array{confirmation_number?: null|string, expires_after_days?: null|int, expires_at?: null|int, product_description?: null|string, setup_future_usage?: string}, kr_card?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, link?: null|array{capture_method?: null|string, persistent_token?: string, setup_future_usage?: null|string}, mb_way?: null|array{setup_future_usage?: string}, mobilepay?: null|array{capture_method?: null|string, setup_future_usage?: string}, multibanco?: null|array{setup_future_usage?: string}, naver_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, nz_bank_account?: null|array{setup_future_usage?: null|string, target_date?: string}, oxxo?: null|array{expires_after_days?: int, setup_future_usage?: string}, p24?: null|array{setup_future_usage?: string, tos_shown_and_accepted?: bool}, pay_by_bank?: null|array{}, payco?: null|array{capture_method?: null|string}, paynow?: null|array{setup_future_usage?: string}, paypal?: null|array{capture_method?: null|string, preferred_locale?: string, reference?: string, risk_correlation_id?: string, setup_future_usage?: null|string}, payto?: null|array{mandate_options?: array{amount?: null|int, amount_type?: null|string, end_date?: null|string, payment_schedule?: null|string, payments_per_period?: null|int, purpose?: null|string}, setup_future_usage?: null|string}, pix?: null|array{amount_includes_iof?: string, expires_after_seconds?: int, expires_at?: int, setup_future_usage?: string}, promptpay?: null|array{setup_future_usage?: string}, revolut_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, samsung_pay?: null|array{capture_method?: null|string}, satispay?: null|array{capture_method?: null|string}, sepa_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, sofort?: null|array{preferred_language?: null|string, setup_future_usage?: null|string}, swish?: null|array{reference?: null|string, setup_future_usage?: string}, twint?: null|array{setup_future_usage?: string}, upi?: null|array{mandate_options?: array{amount?: int, amount_type?: string, description?: string, end_date?: int}, setup_future_usage?: null|string}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, setup_future_usage?: null|string, target_date?: string, transaction_purpose?: null|string, verification_method?: string}, wechat_pay?: null|array{app_id?: string, client?: string, setup_future_usage?: string}, zip?: null|array{setup_future_usage?: string}}, payment_method_types?: string[], radar_options?: array{session?: string}, receipt_email?: string, return_url?: string, setup_future_usage?: string, shipping?: array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name: string, phone?: string, tracking_number?: string}, statement_descriptor?: string, statement_descriptor_suffix?: string, transfer_data?: array{amount?: int, destination: string}, transfer_group?: string, use_stripe_sdk?: bool} $params * @param null|array|string $options * * @return PaymentIntent the created resource @@ -181,7 +181,7 @@ class PaymentIntent extends ApiResource * href="/docs/api/payment_intents/confirm">confirm API instead. * * @param string $id the ID of the resource to update - * @param null|array{amount?: int, amount_details?: null|array{discount_amount?: null|int, enforce_arithmetic_validation?: bool, line_items?: null|array{discount_amount?: int, payment_method_options?: array{card?: array{commodity_code?: string}, card_present?: array{commodity_code?: string}, klarna?: array{image_url?: string, product_url?: string, reference?: string, subscription_reference?: string}, paypal?: array{category?: string, description?: string, sold_by?: string}}, product_code?: string, product_name: string, quantity: int, tax?: array{total_tax_amount: int}, unit_cost: int, unit_of_measure?: string}[], shipping?: null|array{amount?: null|int, from_postal_code?: null|string, to_postal_code?: null|string}, tax?: null|array{total_tax_amount: int}}, application_fee_amount?: null|int, capture_method?: string, currency?: string, customer?: string, customer_account?: string, description?: string, excluded_payment_method_types?: null|string[], expand?: string[], hooks?: array{inputs?: array{tax?: array{calculation: null|string}}}, metadata?: null|array, payment_details?: null|array{customer_reference?: null|string, order_reference?: null|string}, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, crypto?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{custom_mandate_url?: null|string, interval_description?: string, payment_schedule?: string, transaction_type?: string}, setup_future_usage?: null|string, target_date?: string, verification_method?: string}, affirm?: null|array{capture_method?: null|string, preferred_locale?: string, setup_future_usage?: string}, afterpay_clearpay?: null|array{capture_method?: null|string, reference?: string, setup_future_usage?: string}, alipay?: null|array{setup_future_usage?: null|string}, alma?: null|array{capture_method?: null|string}, amazon_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, au_becs_debit?: null|array{setup_future_usage?: null|string, target_date?: string}, bacs_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, bancontact?: null|array{preferred_language?: string, setup_future_usage?: null|string}, billie?: null|array{capture_method?: null|string}, blik?: null|array{code?: string, setup_future_usage?: null|string}, boleto?: null|array{expires_after_days?: int, setup_future_usage?: null|string}, card?: null|array{capture_method?: null|string, cvc_token?: string, installments?: array{enabled?: bool, plan?: null|array{count?: int, interval?: string, type: string}}, mandate_options?: array{amount: int, amount_type: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure?: string, require_cvc_recollection?: bool, setup_future_usage?: null|string, statement_descriptor_suffix_kana?: null|string, statement_descriptor_suffix_kanji?: null|string, three_d_secure?: array{ares_trans_status?: string, cryptogram: string, electronic_commerce_indicator?: string, exemption_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id: string, version: string}}, card_present?: null|array{capture_method?: string, request_extended_authorization?: bool, request_incremental_authorization_support?: bool, routing?: array{requested_priority?: string}}, cashapp?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, crypto?: null|array{setup_future_usage?: string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, requested_address_types?: string[], type: string}, funding_type?: string, setup_future_usage?: string}, eps?: null|array{setup_future_usage?: string}, fpx?: null|array{setup_future_usage?: string}, giropay?: null|array{setup_future_usage?: string}, grabpay?: null|array{setup_future_usage?: string}, ideal?: null|array{setup_future_usage?: null|string}, interac_present?: null|array{}, kakao_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, klarna?: null|array{capture_method?: null|string, on_demand?: array{average_amount?: int, maximum_amount?: int, minimum_amount?: int, purchase_interval?: string, purchase_interval_count?: int}, preferred_locale?: string, setup_future_usage?: string, subscriptions?: null|array{interval: string, interval_count?: int, name?: string, next_billing?: array{amount: int, date: string}, reference: string}[]}, konbini?: null|array{confirmation_number?: null|string, expires_after_days?: null|int, expires_at?: null|int, product_description?: null|string, setup_future_usage?: string}, kr_card?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, link?: null|array{capture_method?: null|string, persistent_token?: string, setup_future_usage?: null|string}, mb_way?: null|array{setup_future_usage?: string}, mobilepay?: null|array{capture_method?: null|string, setup_future_usage?: string}, multibanco?: null|array{setup_future_usage?: string}, naver_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, nz_bank_account?: null|array{setup_future_usage?: null|string, target_date?: string}, oxxo?: null|array{expires_after_days?: int, setup_future_usage?: string}, p24?: null|array{setup_future_usage?: string, tos_shown_and_accepted?: bool}, pay_by_bank?: null|array{}, payco?: null|array{capture_method?: null|string}, paynow?: null|array{setup_future_usage?: string}, paypal?: null|array{capture_method?: null|string, preferred_locale?: string, reference?: string, risk_correlation_id?: string, setup_future_usage?: null|string}, payto?: null|array{mandate_options?: array{amount?: null|int, amount_type?: null|string, end_date?: null|string, payment_schedule?: null|string, payments_per_period?: null|int, purpose?: null|string}, setup_future_usage?: null|string}, pix?: null|array{amount_includes_iof?: string, expires_after_seconds?: int, expires_at?: int, setup_future_usage?: string}, promptpay?: null|array{setup_future_usage?: string}, revolut_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, samsung_pay?: null|array{capture_method?: null|string}, satispay?: null|array{capture_method?: null|string}, sepa_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, sofort?: null|array{preferred_language?: null|string, setup_future_usage?: null|string}, swish?: null|array{reference?: null|string, setup_future_usage?: string}, twint?: null|array{setup_future_usage?: string}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, setup_future_usage?: null|string, target_date?: string, transaction_purpose?: null|string, verification_method?: string, preferred_settlement_speed?: null|string}, wechat_pay?: null|array{app_id?: string, client?: string, setup_future_usage?: string}, zip?: null|array{setup_future_usage?: string}}, payment_method_types?: string[], receipt_email?: null|string, setup_future_usage?: null|string, shipping?: null|array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name: string, phone?: string, tracking_number?: string}, statement_descriptor?: string, statement_descriptor_suffix?: string, transfer_data?: array{amount?: int}, transfer_group?: string} $params + * @param null|array{amount?: int, amount_details?: null|array{discount_amount?: null|int, enforce_arithmetic_validation?: bool, line_items?: null|array{discount_amount?: int, payment_method_options?: array{card?: array{commodity_code?: string}, card_present?: array{commodity_code?: string}, klarna?: array{image_url?: string, product_url?: string, reference?: string, subscription_reference?: string}, paypal?: array{category?: string, description?: string, sold_by?: string}}, product_code?: string, product_name: string, quantity: int, tax?: array{total_tax_amount: int}, unit_cost: int, unit_of_measure?: string}[], shipping?: null|array{amount?: null|int, from_postal_code?: null|string, to_postal_code?: null|string}, tax?: null|array{total_tax_amount: int}}, application_fee_amount?: null|int, capture_method?: string, currency?: string, customer?: string, customer_account?: string, description?: string, excluded_payment_method_types?: null|string[], expand?: string[], hooks?: array{inputs?: array{tax?: array{calculation: null|string}}}, metadata?: null|array, payment_details?: null|array{customer_reference?: null|string, order_reference?: null|string}, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, crypto?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, upi?: array{mandate_options?: array{amount?: int, amount_type?: string, description?: string, end_date?: int}}, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{custom_mandate_url?: null|string, interval_description?: string, payment_schedule?: string, transaction_type?: string}, setup_future_usage?: null|string, target_date?: string, verification_method?: string}, affirm?: null|array{capture_method?: null|string, preferred_locale?: string, setup_future_usage?: string}, afterpay_clearpay?: null|array{capture_method?: null|string, reference?: string, setup_future_usage?: string}, alipay?: null|array{setup_future_usage?: null|string}, alma?: null|array{capture_method?: null|string}, amazon_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, au_becs_debit?: null|array{setup_future_usage?: null|string, target_date?: string}, bacs_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, bancontact?: null|array{preferred_language?: string, setup_future_usage?: null|string}, billie?: null|array{capture_method?: null|string}, blik?: null|array{code?: string, setup_future_usage?: null|string}, boleto?: null|array{expires_after_days?: int, setup_future_usage?: null|string}, card?: null|array{capture_method?: null|string, cvc_token?: string, installments?: array{enabled?: bool, plan?: null|array{count?: int, interval?: string, type: string}}, mandate_options?: array{amount: int, amount_type: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure?: string, require_cvc_recollection?: bool, setup_future_usage?: null|string, statement_descriptor_suffix_kana?: null|string, statement_descriptor_suffix_kanji?: null|string, three_d_secure?: array{ares_trans_status?: string, cryptogram: string, electronic_commerce_indicator?: string, exemption_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id: string, version: string}}, card_present?: null|array{capture_method?: string, request_extended_authorization?: bool, request_incremental_authorization_support?: bool, routing?: array{requested_priority?: string}}, cashapp?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, crypto?: null|array{setup_future_usage?: string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, requested_address_types?: string[], type: string}, funding_type?: string, setup_future_usage?: string}, eps?: null|array{setup_future_usage?: string}, fpx?: null|array{setup_future_usage?: string}, giropay?: null|array{setup_future_usage?: string}, grabpay?: null|array{setup_future_usage?: string}, ideal?: null|array{setup_future_usage?: null|string}, interac_present?: null|array{}, kakao_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, klarna?: null|array{capture_method?: null|string, on_demand?: array{average_amount?: int, maximum_amount?: int, minimum_amount?: int, purchase_interval?: string, purchase_interval_count?: int}, preferred_locale?: string, setup_future_usage?: string, subscriptions?: null|array{interval: string, interval_count?: int, name?: string, next_billing?: array{amount: int, date: string}, reference: string}[]}, konbini?: null|array{confirmation_number?: null|string, expires_after_days?: null|int, expires_at?: null|int, product_description?: null|string, setup_future_usage?: string}, kr_card?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, link?: null|array{capture_method?: null|string, persistent_token?: string, setup_future_usage?: null|string}, mb_way?: null|array{setup_future_usage?: string}, mobilepay?: null|array{capture_method?: null|string, setup_future_usage?: string}, multibanco?: null|array{setup_future_usage?: string}, naver_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, nz_bank_account?: null|array{setup_future_usage?: null|string, target_date?: string}, oxxo?: null|array{expires_after_days?: int, setup_future_usage?: string}, p24?: null|array{setup_future_usage?: string, tos_shown_and_accepted?: bool}, pay_by_bank?: null|array{}, payco?: null|array{capture_method?: null|string}, paynow?: null|array{setup_future_usage?: string}, paypal?: null|array{capture_method?: null|string, preferred_locale?: string, reference?: string, risk_correlation_id?: string, setup_future_usage?: null|string}, payto?: null|array{mandate_options?: array{amount?: null|int, amount_type?: null|string, end_date?: null|string, payment_schedule?: null|string, payments_per_period?: null|int, purpose?: null|string}, setup_future_usage?: null|string}, pix?: null|array{amount_includes_iof?: string, expires_after_seconds?: int, expires_at?: int, setup_future_usage?: string}, promptpay?: null|array{setup_future_usage?: string}, revolut_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, samsung_pay?: null|array{capture_method?: null|string}, satispay?: null|array{capture_method?: null|string}, sepa_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, sofort?: null|array{preferred_language?: null|string, setup_future_usage?: null|string}, swish?: null|array{reference?: null|string, setup_future_usage?: string}, twint?: null|array{setup_future_usage?: string}, upi?: null|array{mandate_options?: array{amount?: int, amount_type?: string, description?: string, end_date?: int}, setup_future_usage?: null|string}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, setup_future_usage?: null|string, target_date?: string, transaction_purpose?: null|string, verification_method?: string}, wechat_pay?: null|array{app_id?: string, client?: string, setup_future_usage?: string}, zip?: null|array{setup_future_usage?: string}}, payment_method_types?: string[], receipt_email?: null|string, setup_future_usage?: null|string, shipping?: null|array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name: string, phone?: string, tracking_number?: string}, statement_descriptor?: string, statement_descriptor_suffix?: string, transfer_data?: array{amount?: int}, transfer_group?: string} $params * @param null|array|string $opts * * @return PaymentIntent the updated resource diff --git a/plugins/stripe-php/lib/PaymentLink.php b/plugins/stripe-php/lib/PaymentLink.php index 95521441..630c2ef4 100644 --- a/plugins/stripe-php/lib/PaymentLink.php +++ b/plugins/stripe-php/lib/PaymentLink.php @@ -29,7 +29,7 @@ namespace Stripe; * @property null|string $inactive_message The custom message to be displayed to a customer when a payment link is no longer active. * @property null|(object{enabled: bool, invoice_data: null|(object{account_tax_ids: null|(string|TaxId)[], custom_fields: null|(object{name: string, value: string}&StripeObject)[], description: null|string, footer: null|string, issuer: null|(object{account?: Account|string, type: string}&StripeObject), metadata: null|StripeObject, rendering_options: null|(object{amount_tax_display: null|string, template: null|string}&StripeObject)}&StripeObject)}&StripeObject) $invoice_creation Configuration for creating invoice for payment mode payment links. * @property null|Collection $line_items The line items representing what is being sold. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|(object{business?: (object{enabled: bool, optional: bool}&StripeObject), individual?: (object{enabled: bool, optional: bool}&StripeObject)}&StripeObject) $name_collection * @property null|Account|string $on_behalf_of The account on behalf of which to charge. See the Connect documentation for details. diff --git a/plugins/stripe-php/lib/PaymentMethod.php b/plugins/stripe-php/lib/PaymentMethod.php index f994852a..5ce7469d 100644 --- a/plugins/stripe-php/lib/PaymentMethod.php +++ b/plugins/stripe-php/lib/PaymentMethod.php @@ -47,7 +47,7 @@ namespace Stripe; * @property null|(object{}&StripeObject) $konbini * @property null|(object{brand: null|string, last4: null|string}&StripeObject) $kr_card * @property null|(object{email: null|string, persistent_token?: string}&StripeObject) $link - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|(object{}&StripeObject) $mb_way * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|(object{}&StripeObject) $mobilepay @@ -72,6 +72,7 @@ namespace Stripe; * @property null|(object{}&StripeObject) $swish * @property null|(object{}&StripeObject) $twint * @property string $type The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + * @property null|(object{vpa: null|string}&StripeObject) $upi * @property null|(object{account_holder_type: null|string, account_type: null|string, bank_name: null|string, financial_connections_account: null|string, fingerprint: null|string, last4: null|string, networks: null|(object{preferred: null|string, supported: string[]}&StripeObject), routing_number: null|string, status_details: null|(object{blocked?: (object{network_code: null|string, reason: null|string}&StripeObject)}&StripeObject)}&StripeObject) $us_bank_account * @property null|(object{}&StripeObject) $wechat_pay * @property null|(object{}&StripeObject) $zip @@ -136,6 +137,7 @@ class PaymentMethod extends ApiResource const TYPE_SOFORT = 'sofort'; const TYPE_SWISH = 'swish'; const TYPE_TWINT = 'twint'; + const TYPE_UPI = 'upi'; const TYPE_US_BANK_ACCOUNT = 'us_bank_account'; const TYPE_WECHAT_PAY = 'wechat_pay'; const TYPE_ZIP = 'zip'; @@ -151,7 +153,7 @@ class PaymentMethod extends ApiResource * href="/docs/payments/save-and-reuse">SetupIntent API to collect payment * method details ahead of a future payment. * - * @param null|array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, card?: array{cvc?: string, exp_month?: int, exp_year?: int, networks?: array{preferred?: string}, number?: string, token?: string}, cashapp?: array{}, crypto?: array{}, custom?: array{type: string}, customer?: string, customer_balance?: array{}, eps?: array{bank?: string}, expand?: string[], fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, payment_method?: string, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type?: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}} $params + * @param null|array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, card?: array{cvc?: string, exp_month?: int, exp_year?: int, networks?: array{preferred?: string}, number?: string, token?: string}, cashapp?: array{}, crypto?: array{}, custom?: array{type: string}, customer?: string, customer_balance?: array{}, eps?: array{bank?: string}, expand?: string[], fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, payment_method?: string, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type?: string, upi?: array{mandate_options?: array{amount?: int, amount_type?: string, description?: string, end_date?: int}}, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}} $params * @param null|array|string $options * * @return PaymentMethod the created resource diff --git a/plugins/stripe-php/lib/PaymentMethodConfiguration.php b/plugins/stripe-php/lib/PaymentMethodConfiguration.php index 6bdcfb31..9822f09b 100644 --- a/plugins/stripe-php/lib/PaymentMethodConfiguration.php +++ b/plugins/stripe-php/lib/PaymentMethodConfiguration.php @@ -55,7 +55,7 @@ namespace Stripe; * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $konbini * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $kr_card * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $link - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $mb_way * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $mobilepay * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $multibanco @@ -79,6 +79,7 @@ namespace Stripe; * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $sofort * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $swish * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $twint + * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $upi * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $us_bank_account * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $wechat_pay * @property null|(object{available: bool, display_preference: (object{overridable: null|bool, preference: string, value: string}&StripeObject)}&StripeObject) $zip @@ -92,7 +93,7 @@ class PaymentMethodConfiguration extends ApiResource /** * Creates a payment method configuration. * - * @param null|array{acss_debit?: array{display_preference?: array{preference?: string}}, affirm?: array{display_preference?: array{preference?: string}}, afterpay_clearpay?: array{display_preference?: array{preference?: string}}, alipay?: array{display_preference?: array{preference?: string}}, alma?: array{display_preference?: array{preference?: string}}, amazon_pay?: array{display_preference?: array{preference?: string}}, apple_pay?: array{display_preference?: array{preference?: string}}, apple_pay_later?: array{display_preference?: array{preference?: string}}, au_becs_debit?: array{display_preference?: array{preference?: string}}, bacs_debit?: array{display_preference?: array{preference?: string}}, bancontact?: array{display_preference?: array{preference?: string}}, billie?: array{display_preference?: array{preference?: string}}, blik?: array{display_preference?: array{preference?: string}}, boleto?: array{display_preference?: array{preference?: string}}, card?: array{display_preference?: array{preference?: string}}, cartes_bancaires?: array{display_preference?: array{preference?: string}}, cashapp?: array{display_preference?: array{preference?: string}}, crypto?: array{display_preference?: array{preference?: string}}, customer_balance?: array{display_preference?: array{preference?: string}}, eps?: array{display_preference?: array{preference?: string}}, expand?: string[], fpx?: array{display_preference?: array{preference?: string}}, fr_meal_voucher_conecs?: array{display_preference?: array{preference?: string}}, giropay?: array{display_preference?: array{preference?: string}}, google_pay?: array{display_preference?: array{preference?: string}}, grabpay?: array{display_preference?: array{preference?: string}}, ideal?: array{display_preference?: array{preference?: string}}, jcb?: array{display_preference?: array{preference?: string}}, kakao_pay?: array{display_preference?: array{preference?: string}}, klarna?: array{display_preference?: array{preference?: string}}, konbini?: array{display_preference?: array{preference?: string}}, kr_card?: array{display_preference?: array{preference?: string}}, link?: array{display_preference?: array{preference?: string}}, mb_way?: array{display_preference?: array{preference?: string}}, mobilepay?: array{display_preference?: array{preference?: string}}, multibanco?: array{display_preference?: array{preference?: string}}, name?: string, naver_pay?: array{display_preference?: array{preference?: string}}, nz_bank_account?: array{display_preference?: array{preference?: string}}, oxxo?: array{display_preference?: array{preference?: string}}, p24?: array{display_preference?: array{preference?: string}}, parent?: string, pay_by_bank?: array{display_preference?: array{preference?: string}}, payco?: array{display_preference?: array{preference?: string}}, paynow?: array{display_preference?: array{preference?: string}}, paypal?: array{display_preference?: array{preference?: string}}, payto?: array{display_preference?: array{preference?: string}}, pix?: array{display_preference?: array{preference?: string}}, promptpay?: array{display_preference?: array{preference?: string}}, revolut_pay?: array{display_preference?: array{preference?: string}}, samsung_pay?: array{display_preference?: array{preference?: string}}, satispay?: array{display_preference?: array{preference?: string}}, sepa_debit?: array{display_preference?: array{preference?: string}}, sofort?: array{display_preference?: array{preference?: string}}, swish?: array{display_preference?: array{preference?: string}}, twint?: array{display_preference?: array{preference?: string}}, us_bank_account?: array{display_preference?: array{preference?: string}}, wechat_pay?: array{display_preference?: array{preference?: string}}, zip?: array{display_preference?: array{preference?: string}}} $params + * @param null|array{acss_debit?: array{display_preference?: array{preference?: string}}, affirm?: array{display_preference?: array{preference?: string}}, afterpay_clearpay?: array{display_preference?: array{preference?: string}}, alipay?: array{display_preference?: array{preference?: string}}, alma?: array{display_preference?: array{preference?: string}}, amazon_pay?: array{display_preference?: array{preference?: string}}, apple_pay?: array{display_preference?: array{preference?: string}}, apple_pay_later?: array{display_preference?: array{preference?: string}}, au_becs_debit?: array{display_preference?: array{preference?: string}}, bacs_debit?: array{display_preference?: array{preference?: string}}, bancontact?: array{display_preference?: array{preference?: string}}, billie?: array{display_preference?: array{preference?: string}}, blik?: array{display_preference?: array{preference?: string}}, boleto?: array{display_preference?: array{preference?: string}}, card?: array{display_preference?: array{preference?: string}}, cartes_bancaires?: array{display_preference?: array{preference?: string}}, cashapp?: array{display_preference?: array{preference?: string}}, crypto?: array{display_preference?: array{preference?: string}}, customer_balance?: array{display_preference?: array{preference?: string}}, eps?: array{display_preference?: array{preference?: string}}, expand?: string[], fpx?: array{display_preference?: array{preference?: string}}, fr_meal_voucher_conecs?: array{display_preference?: array{preference?: string}}, giropay?: array{display_preference?: array{preference?: string}}, google_pay?: array{display_preference?: array{preference?: string}}, grabpay?: array{display_preference?: array{preference?: string}}, ideal?: array{display_preference?: array{preference?: string}}, jcb?: array{display_preference?: array{preference?: string}}, kakao_pay?: array{display_preference?: array{preference?: string}}, klarna?: array{display_preference?: array{preference?: string}}, konbini?: array{display_preference?: array{preference?: string}}, kr_card?: array{display_preference?: array{preference?: string}}, link?: array{display_preference?: array{preference?: string}}, mb_way?: array{display_preference?: array{preference?: string}}, mobilepay?: array{display_preference?: array{preference?: string}}, multibanco?: array{display_preference?: array{preference?: string}}, name?: string, naver_pay?: array{display_preference?: array{preference?: string}}, nz_bank_account?: array{display_preference?: array{preference?: string}}, oxxo?: array{display_preference?: array{preference?: string}}, p24?: array{display_preference?: array{preference?: string}}, parent?: string, pay_by_bank?: array{display_preference?: array{preference?: string}}, payco?: array{display_preference?: array{preference?: string}}, paynow?: array{display_preference?: array{preference?: string}}, paypal?: array{display_preference?: array{preference?: string}}, payto?: array{display_preference?: array{preference?: string}}, pix?: array{display_preference?: array{preference?: string}}, promptpay?: array{display_preference?: array{preference?: string}}, revolut_pay?: array{display_preference?: array{preference?: string}}, samsung_pay?: array{display_preference?: array{preference?: string}}, satispay?: array{display_preference?: array{preference?: string}}, sepa_debit?: array{display_preference?: array{preference?: string}}, sofort?: array{display_preference?: array{preference?: string}}, swish?: array{display_preference?: array{preference?: string}}, twint?: array{display_preference?: array{preference?: string}}, upi?: array{display_preference?: array{preference?: string}}, us_bank_account?: array{display_preference?: array{preference?: string}}, wechat_pay?: array{display_preference?: array{preference?: string}}, zip?: array{display_preference?: array{preference?: string}}} $params * @param null|array|string $options * * @return PaymentMethodConfiguration the created resource @@ -151,7 +152,7 @@ class PaymentMethodConfiguration extends ApiResource * Update payment method configuration. * * @param string $id the ID of the resource to update - * @param null|array{acss_debit?: array{display_preference?: array{preference?: string}}, active?: bool, affirm?: array{display_preference?: array{preference?: string}}, afterpay_clearpay?: array{display_preference?: array{preference?: string}}, alipay?: array{display_preference?: array{preference?: string}}, alma?: array{display_preference?: array{preference?: string}}, amazon_pay?: array{display_preference?: array{preference?: string}}, apple_pay?: array{display_preference?: array{preference?: string}}, apple_pay_later?: array{display_preference?: array{preference?: string}}, au_becs_debit?: array{display_preference?: array{preference?: string}}, bacs_debit?: array{display_preference?: array{preference?: string}}, bancontact?: array{display_preference?: array{preference?: string}}, billie?: array{display_preference?: array{preference?: string}}, blik?: array{display_preference?: array{preference?: string}}, boleto?: array{display_preference?: array{preference?: string}}, card?: array{display_preference?: array{preference?: string}}, cartes_bancaires?: array{display_preference?: array{preference?: string}}, cashapp?: array{display_preference?: array{preference?: string}}, crypto?: array{display_preference?: array{preference?: string}}, customer_balance?: array{display_preference?: array{preference?: string}}, eps?: array{display_preference?: array{preference?: string}}, expand?: string[], fpx?: array{display_preference?: array{preference?: string}}, fr_meal_voucher_conecs?: array{display_preference?: array{preference?: string}}, giropay?: array{display_preference?: array{preference?: string}}, google_pay?: array{display_preference?: array{preference?: string}}, grabpay?: array{display_preference?: array{preference?: string}}, ideal?: array{display_preference?: array{preference?: string}}, jcb?: array{display_preference?: array{preference?: string}}, kakao_pay?: array{display_preference?: array{preference?: string}}, klarna?: array{display_preference?: array{preference?: string}}, konbini?: array{display_preference?: array{preference?: string}}, kr_card?: array{display_preference?: array{preference?: string}}, link?: array{display_preference?: array{preference?: string}}, mb_way?: array{display_preference?: array{preference?: string}}, mobilepay?: array{display_preference?: array{preference?: string}}, multibanco?: array{display_preference?: array{preference?: string}}, name?: string, naver_pay?: array{display_preference?: array{preference?: string}}, nz_bank_account?: array{display_preference?: array{preference?: string}}, oxxo?: array{display_preference?: array{preference?: string}}, p24?: array{display_preference?: array{preference?: string}}, pay_by_bank?: array{display_preference?: array{preference?: string}}, payco?: array{display_preference?: array{preference?: string}}, paynow?: array{display_preference?: array{preference?: string}}, paypal?: array{display_preference?: array{preference?: string}}, payto?: array{display_preference?: array{preference?: string}}, pix?: array{display_preference?: array{preference?: string}}, promptpay?: array{display_preference?: array{preference?: string}}, revolut_pay?: array{display_preference?: array{preference?: string}}, samsung_pay?: array{display_preference?: array{preference?: string}}, satispay?: array{display_preference?: array{preference?: string}}, sepa_debit?: array{display_preference?: array{preference?: string}}, sofort?: array{display_preference?: array{preference?: string}}, swish?: array{display_preference?: array{preference?: string}}, twint?: array{display_preference?: array{preference?: string}}, us_bank_account?: array{display_preference?: array{preference?: string}}, wechat_pay?: array{display_preference?: array{preference?: string}}, zip?: array{display_preference?: array{preference?: string}}} $params + * @param null|array{acss_debit?: array{display_preference?: array{preference?: string}}, active?: bool, affirm?: array{display_preference?: array{preference?: string}}, afterpay_clearpay?: array{display_preference?: array{preference?: string}}, alipay?: array{display_preference?: array{preference?: string}}, alma?: array{display_preference?: array{preference?: string}}, amazon_pay?: array{display_preference?: array{preference?: string}}, apple_pay?: array{display_preference?: array{preference?: string}}, apple_pay_later?: array{display_preference?: array{preference?: string}}, au_becs_debit?: array{display_preference?: array{preference?: string}}, bacs_debit?: array{display_preference?: array{preference?: string}}, bancontact?: array{display_preference?: array{preference?: string}}, billie?: array{display_preference?: array{preference?: string}}, blik?: array{display_preference?: array{preference?: string}}, boleto?: array{display_preference?: array{preference?: string}}, card?: array{display_preference?: array{preference?: string}}, cartes_bancaires?: array{display_preference?: array{preference?: string}}, cashapp?: array{display_preference?: array{preference?: string}}, crypto?: array{display_preference?: array{preference?: string}}, customer_balance?: array{display_preference?: array{preference?: string}}, eps?: array{display_preference?: array{preference?: string}}, expand?: string[], fpx?: array{display_preference?: array{preference?: string}}, fr_meal_voucher_conecs?: array{display_preference?: array{preference?: string}}, giropay?: array{display_preference?: array{preference?: string}}, google_pay?: array{display_preference?: array{preference?: string}}, grabpay?: array{display_preference?: array{preference?: string}}, ideal?: array{display_preference?: array{preference?: string}}, jcb?: array{display_preference?: array{preference?: string}}, kakao_pay?: array{display_preference?: array{preference?: string}}, klarna?: array{display_preference?: array{preference?: string}}, konbini?: array{display_preference?: array{preference?: string}}, kr_card?: array{display_preference?: array{preference?: string}}, link?: array{display_preference?: array{preference?: string}}, mb_way?: array{display_preference?: array{preference?: string}}, mobilepay?: array{display_preference?: array{preference?: string}}, multibanco?: array{display_preference?: array{preference?: string}}, name?: string, naver_pay?: array{display_preference?: array{preference?: string}}, nz_bank_account?: array{display_preference?: array{preference?: string}}, oxxo?: array{display_preference?: array{preference?: string}}, p24?: array{display_preference?: array{preference?: string}}, pay_by_bank?: array{display_preference?: array{preference?: string}}, payco?: array{display_preference?: array{preference?: string}}, paynow?: array{display_preference?: array{preference?: string}}, paypal?: array{display_preference?: array{preference?: string}}, payto?: array{display_preference?: array{preference?: string}}, pix?: array{display_preference?: array{preference?: string}}, promptpay?: array{display_preference?: array{preference?: string}}, revolut_pay?: array{display_preference?: array{preference?: string}}, samsung_pay?: array{display_preference?: array{preference?: string}}, satispay?: array{display_preference?: array{preference?: string}}, sepa_debit?: array{display_preference?: array{preference?: string}}, sofort?: array{display_preference?: array{preference?: string}}, swish?: array{display_preference?: array{preference?: string}}, twint?: array{display_preference?: array{preference?: string}}, upi?: array{display_preference?: array{preference?: string}}, us_bank_account?: array{display_preference?: array{preference?: string}}, wechat_pay?: array{display_preference?: array{preference?: string}}, zip?: array{display_preference?: array{preference?: string}}} $params * @param null|array|string $opts * * @return PaymentMethodConfiguration the updated resource diff --git a/plugins/stripe-php/lib/PaymentMethodDomain.php b/plugins/stripe-php/lib/PaymentMethodDomain.php index 328db8e9..932024d0 100644 --- a/plugins/stripe-php/lib/PaymentMethodDomain.php +++ b/plugins/stripe-php/lib/PaymentMethodDomain.php @@ -20,7 +20,7 @@ namespace Stripe; * @property (object{status: string, status_details?: (object{error_message: string}&StripeObject)}&StripeObject) $google_pay Indicates the status of a specific payment method on a payment method domain. * @property (object{status: string, status_details?: (object{error_message: string}&StripeObject)}&StripeObject) $klarna Indicates the status of a specific payment method on a payment method domain. * @property (object{status: string, status_details?: (object{error_message: string}&StripeObject)}&StripeObject) $link Indicates the status of a specific payment method on a payment method domain. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property (object{status: string, status_details?: (object{error_message: string}&StripeObject)}&StripeObject) $paypal Indicates the status of a specific payment method on a payment method domain. */ class PaymentMethodDomain extends ApiResource diff --git a/plugins/stripe-php/lib/PaymentRecord.php b/plugins/stripe-php/lib/PaymentRecord.php index 64dced48..e9261c01 100644 --- a/plugins/stripe-php/lib/PaymentRecord.php +++ b/plugins/stripe-php/lib/PaymentRecord.php @@ -25,9 +25,9 @@ namespace Stripe; * @property null|string $customer_presence Indicates whether the customer was present in your checkout flow during this payment. * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. * @property null|string $latest_payment_attempt_record ID of the latest Payment Attempt Record attached to this Payment Record. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|(object{ach_credit_transfer?: (object{account_number: null|string, bank_name: null|string, routing_number: null|string, swift_code: null|string}&StripeObject), ach_debit?: (object{account_holder_type: null|string, bank_name: null|string, country: null|string, fingerprint: null|string, last4: null|string, routing_number: null|string}&StripeObject), acss_debit?: (object{bank_name: null|string, expected_debit_date?: string, fingerprint: null|string, institution_number: null|string, last4: null|string, mandate?: string, transit_number: null|string}&StripeObject), affirm?: (object{location?: string, reader?: string, transaction_id: null|string}&StripeObject), afterpay_clearpay?: (object{order_id: null|string, reference: null|string}&StripeObject), alipay?: (object{buyer_id?: string, fingerprint: null|string, transaction_id: null|string}&StripeObject), alma?: (object{installments?: (object{count: int}&StripeObject), transaction_id: null|string}&StripeObject), amazon_pay?: (object{funding?: (object{card?: (object{brand: null|string, country: null|string, exp_month: null|int, exp_year: null|int, funding: null|string, last4: null|string}&StripeObject), type: null|string}&StripeObject), transaction_id: null|string}&StripeObject), au_becs_debit?: (object{bsb_number: null|string, expected_debit_date?: string, fingerprint: null|string, last4: null|string, mandate?: string}&StripeObject), bacs_debit?: (object{expected_debit_date?: string, fingerprint: null|string, last4: null|string, mandate: null|string, sort_code: null|string}&StripeObject), bancontact?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, preferred_language: null|string, verified_name: null|string}&StripeObject), billie?: (object{transaction_id: null|string}&StripeObject), billing_details: null|(object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, phone: null|string}&StripeObject), blik?: (object{buyer_id: null|string}&StripeObject), boleto?: (object{tax_id: null|string}&StripeObject), card?: (object{authorization_code: null|string, brand: string, capture_before?: int, checks: null|(object{address_line1_check: null|string, address_postal_code_check: null|string, cvc_check: null|string}&StripeObject), country: null|string, description: null|string, exp_month: int, exp_year: int, fingerprint?: null|string, funding: string, iin: null|string, installments: null|(object{plan: null|(object{count: null|int, interval: null|string, type: string}&StripeObject)}&StripeObject), issuer: null|string, last4: string, moto?: bool, network: null|string, network_advice_code: null|string, network_decline_code: null|string, network_token?: null|(object{used: bool}&StripeObject), network_transaction_id: null|string, stored_credential_usage: null|string, three_d_secure: null|(object{authentication_flow: null|string, result: null|string, result_reason: null|string, version: null|string}&StripeObject), wallet: null|(object{apple_pay?: (object{type: string}&StripeObject), dynamic_last4?: string, google_pay?: (object{}&StripeObject), type: string}&StripeObject)}&StripeObject), card_present?: (object{amount_authorized: null|int, brand: null|string, brand_product: null|string, capture_before?: int, cardholder_name: null|string, country: null|string, description?: null|string, emv_auth_data: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, generated_card: null|string, iin?: null|string, incremental_authorization_supported: bool, issuer?: null|string, last4: null|string, location?: string, network: null|string, network_transaction_id: null|string, offline: null|(object{stored_at: null|int, type: null|string}&StripeObject), overcapture_supported: bool, preferred_locales: null|string[], read_method: null|string, reader?: string, receipt: null|(object{account_type?: string, application_cryptogram: null|string, application_preferred_name: null|string, authorization_code: null|string, authorization_response_code: null|string, cardholder_verification_method: null|string, dedicated_file_name: null|string, terminal_verification_results: null|string, transaction_status_information: null|string}&StripeObject), wallet?: (object{type: string}&StripeObject)}&StripeObject), cashapp?: (object{buyer_id: null|string, cashtag: null|string, transaction_id: null|string}&StripeObject), crypto?: (object{buyer_address?: string, network?: string, token_currency?: string, transaction_hash?: string}&StripeObject), custom?: (object{display_name: string, type: null|string}&StripeObject), customer_balance?: (object{}&StripeObject), eps?: (object{bank: null|string, verified_name: null|string}&StripeObject), fpx?: (object{account_holder_type: null|string, bank: string, transaction_id: null|string}&StripeObject), giropay?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, verified_name: null|string}&StripeObject), grabpay?: (object{transaction_id: null|string}&StripeObject), ideal?: (object{bank: null|string, bic: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, transaction_id: null|string, verified_name: null|string}&StripeObject), interac_present?: (object{brand: null|string, cardholder_name: null|string, country: null|string, description?: null|string, emv_auth_data: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, generated_card: null|string, iin?: null|string, issuer?: null|string, last4: null|string, location?: string, network: null|string, network_transaction_id: null|string, preferred_locales: null|string[], read_method: null|string, reader?: string, receipt: null|(object{account_type?: string, application_cryptogram: null|string, application_preferred_name: null|string, authorization_code: null|string, authorization_response_code: null|string, cardholder_verification_method: null|string, dedicated_file_name: null|string, terminal_verification_results: null|string, transaction_status_information: null|string}&StripeObject)}&StripeObject), kakao_pay?: (object{buyer_id: null|string, transaction_id: null|string}&StripeObject), klarna?: (object{payer_details: null|(object{address: null|(object{country: null|string}&StripeObject)}&StripeObject), payment_method_category: null|string, preferred_locale: null|string}&StripeObject), konbini?: (object{store: null|(object{chain: null|string}&StripeObject)}&StripeObject), kr_card?: (object{brand: null|string, buyer_id: null|string, last4: null|string, transaction_id: null|string}&StripeObject), link?: (object{country: null|string}&StripeObject), mb_way?: (object{}&StripeObject), mobilepay?: (object{card: null|(object{brand: null|string, country: null|string, exp_month: null|int, exp_year: null|int, last4: null|string}&StripeObject)}&StripeObject), multibanco?: (object{entity: null|string, reference: null|string}&StripeObject), naver_pay?: (object{buyer_id: null|string, transaction_id: null|string}&StripeObject), nz_bank_account?: (object{account_holder_name: null|string, bank_code: string, bank_name: string, branch_code: string, expected_debit_date?: string, last4: string, suffix: null|string}&StripeObject), oxxo?: (object{number: null|string}&StripeObject), p24?: (object{bank: null|string, reference: null|string, verified_name: null|string}&StripeObject), pay_by_bank?: (object{}&StripeObject), payco?: (object{buyer_id: null|string, transaction_id: null|string}&StripeObject), payment_method: null|string, paynow?: (object{location?: string, reader?: string, reference: null|string}&StripeObject), paypal?: (object{country: null|string, payer_email: null|string, payer_id: null|string, payer_name: null|string, seller_protection: null|(object{dispute_categories: null|string[], status: string}&StripeObject), transaction_id: null|string}&StripeObject), payto?: (object{bsb_number: null|string, last4: null|string, mandate?: string, pay_id: null|string}&StripeObject), pix?: (object{bank_transaction_id?: null|string}&StripeObject), promptpay?: (object{reference: null|string}&StripeObject), revolut_pay?: (object{funding?: (object{card?: (object{brand: null|string, country: null|string, exp_month: null|int, exp_year: null|int, funding: null|string, last4: null|string}&StripeObject), type: null|string}&StripeObject), transaction_id: null|string}&StripeObject), samsung_pay?: (object{buyer_id: null|string, transaction_id: null|string}&StripeObject), satispay?: (object{transaction_id: null|string}&StripeObject), sepa_credit_transfer?: (object{bank_name: null|string, bic: null|string, iban: null|string}&StripeObject), sepa_debit?: (object{bank_code: null|string, branch_code: null|string, country: null|string, expected_debit_date?: string, fingerprint: null|string, last4: null|string, mandate: null|string}&StripeObject), sofort?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, country: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, preferred_language: null|string, verified_name: null|string}&StripeObject), stripe_account?: (object{}&StripeObject), swish?: (object{fingerprint: null|string, payment_reference: null|string, verified_phone_last4: null|string}&StripeObject), twint?: (object{}&StripeObject), type: string, us_bank_account?: (object{account_holder_type: null|string, account_type: null|string, bank_name: null|string, expected_debit_date?: string, fingerprint: null|string, last4: null|string, mandate?: Mandate|string, payment_reference: null|string, routing_number: null|string}&StripeObject), wechat?: (object{}&StripeObject), wechat_pay?: (object{fingerprint: null|string, location?: string, reader?: string, transaction_id: null|string}&StripeObject), zip?: (object{}&StripeObject)}&StripeObject) $payment_method_details Information about the Payment Method debited for this payment. + * @property null|(object{ach_credit_transfer?: (object{account_number: null|string, bank_name: null|string, routing_number: null|string, swift_code: null|string}&StripeObject), ach_debit?: (object{account_holder_type: null|string, bank_name: null|string, country: null|string, fingerprint: null|string, last4: null|string, routing_number: null|string}&StripeObject), acss_debit?: (object{bank_name: null|string, expected_debit_date?: string, fingerprint: null|string, institution_number: null|string, last4: null|string, mandate?: string, transit_number: null|string}&StripeObject), affirm?: (object{location?: string, reader?: string, transaction_id: null|string}&StripeObject), afterpay_clearpay?: (object{order_id: null|string, reference: null|string}&StripeObject), alipay?: (object{buyer_id?: string, fingerprint: null|string, transaction_id: null|string}&StripeObject), alma?: (object{installments?: (object{count: int}&StripeObject), transaction_id: null|string}&StripeObject), amazon_pay?: (object{funding?: (object{card?: (object{brand: null|string, country: null|string, exp_month: null|int, exp_year: null|int, funding: null|string, last4: null|string}&StripeObject), type: null|string}&StripeObject), transaction_id: null|string}&StripeObject), au_becs_debit?: (object{bsb_number: null|string, expected_debit_date?: string, fingerprint: null|string, last4: null|string, mandate?: string}&StripeObject), bacs_debit?: (object{expected_debit_date?: string, fingerprint: null|string, last4: null|string, mandate: null|string, sort_code: null|string}&StripeObject), bancontact?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, preferred_language: null|string, verified_name: null|string}&StripeObject), billie?: (object{transaction_id: null|string}&StripeObject), billing_details: null|(object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, phone: null|string}&StripeObject), blik?: (object{buyer_id: null|string}&StripeObject), boleto?: (object{tax_id: null|string}&StripeObject), card?: (object{authorization_code: null|string, brand: null|string, capture_before?: int, checks: null|(object{address_line1_check: null|string, address_postal_code_check: null|string, cvc_check: null|string}&StripeObject), country: null|string, description: null|string, exp_month: null|int, exp_year: null|int, fingerprint?: null|string, funding: null|string, iin: null|string, installments: null|(object{plan: null|(object{count: null|int, interval: null|string, type: string}&StripeObject)}&StripeObject), issuer: null|string, last4: null|string, moto?: null|bool, network: null|string, network_advice_code: null|string, network_decline_code: null|string, network_token?: null|(object{used: bool}&StripeObject), network_transaction_id: null|string, stored_credential_usage: null|string, three_d_secure: null|(object{authentication_flow: null|string, cryptogram: null|string, electronic_commerce_indicator: null|string, exemption_indicator: null|string, exemption_indicator_applied: null|bool, result: null|string, result_reason: null|string, version: null|string}&StripeObject), wallet: null|(object{apple_pay?: (object{type: string}&StripeObject), dynamic_last4?: string, google_pay?: (object{}&StripeObject), type: string}&StripeObject)}&StripeObject), card_present?: (object{amount_authorized: null|int, brand: null|string, brand_product: null|string, capture_before?: int, cardholder_name: null|string, country: null|string, description?: null|string, emv_auth_data: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, generated_card: null|string, iin?: null|string, incremental_authorization_supported: bool, issuer?: null|string, last4: null|string, location?: string, network: null|string, network_transaction_id: null|string, offline: null|(object{stored_at: null|int, type: null|string}&StripeObject), overcapture_supported: bool, preferred_locales: null|string[], read_method: null|string, reader?: string, receipt: null|(object{account_type?: string, application_cryptogram: null|string, application_preferred_name: null|string, authorization_code: null|string, authorization_response_code: null|string, cardholder_verification_method: null|string, dedicated_file_name: null|string, terminal_verification_results: null|string, transaction_status_information: null|string}&StripeObject), wallet?: (object{type: string}&StripeObject)}&StripeObject), cashapp?: (object{buyer_id: null|string, cashtag: null|string, transaction_id: null|string}&StripeObject), crypto?: (object{buyer_address?: string, network?: string, token_currency?: string, transaction_hash?: string}&StripeObject), custom?: (object{display_name: string, type: null|string}&StripeObject), customer_balance?: (object{}&StripeObject), eps?: (object{bank: null|string, verified_name: null|string}&StripeObject), fpx?: (object{account_holder_type: null|string, bank: string, transaction_id: null|string}&StripeObject), giropay?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, verified_name: null|string}&StripeObject), grabpay?: (object{transaction_id: null|string}&StripeObject), ideal?: (object{bank: null|string, bic: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, transaction_id: null|string, verified_name: null|string}&StripeObject), interac_present?: (object{brand: null|string, cardholder_name: null|string, country: null|string, description?: null|string, emv_auth_data: null|string, exp_month: int, exp_year: int, fingerprint: null|string, funding: null|string, generated_card: null|string, iin?: null|string, issuer?: null|string, last4: null|string, location?: string, network: null|string, network_transaction_id: null|string, preferred_locales: null|string[], read_method: null|string, reader?: string, receipt: null|(object{account_type?: string, application_cryptogram: null|string, application_preferred_name: null|string, authorization_code: null|string, authorization_response_code: null|string, cardholder_verification_method: null|string, dedicated_file_name: null|string, terminal_verification_results: null|string, transaction_status_information: null|string}&StripeObject)}&StripeObject), kakao_pay?: (object{buyer_id: null|string, transaction_id: null|string}&StripeObject), klarna?: (object{payer_details: null|(object{address: null|(object{country: null|string}&StripeObject)}&StripeObject), payment_method_category: null|string, preferred_locale: null|string}&StripeObject), konbini?: (object{store: null|(object{chain: null|string}&StripeObject)}&StripeObject), kr_card?: (object{brand: null|string, buyer_id: null|string, last4: null|string, transaction_id: null|string}&StripeObject), link?: (object{country: null|string}&StripeObject), mb_way?: (object{}&StripeObject), mobilepay?: (object{card: null|(object{brand: null|string, country: null|string, exp_month: null|int, exp_year: null|int, last4: null|string}&StripeObject)}&StripeObject), multibanco?: (object{entity: null|string, reference: null|string}&StripeObject), naver_pay?: (object{buyer_id: null|string, transaction_id: null|string}&StripeObject), nz_bank_account?: (object{account_holder_name: null|string, bank_code: string, bank_name: string, branch_code: string, expected_debit_date?: string, last4: string, suffix: null|string}&StripeObject), oxxo?: (object{number: null|string}&StripeObject), p24?: (object{bank: null|string, reference: null|string, verified_name: null|string}&StripeObject), pay_by_bank?: (object{}&StripeObject), payco?: (object{buyer_id: null|string, transaction_id: null|string}&StripeObject), payment_method: null|string, paynow?: (object{location?: string, reader?: string, reference: null|string}&StripeObject), paypal?: (object{country: null|string, payer_email: null|string, payer_id: null|string, payer_name: null|string, seller_protection: null|(object{dispute_categories: null|string[], status: string}&StripeObject), transaction_id: null|string}&StripeObject), payto?: (object{bsb_number: null|string, last4: null|string, mandate?: string, pay_id: null|string}&StripeObject), pix?: (object{bank_transaction_id?: null|string}&StripeObject), promptpay?: (object{reference: null|string}&StripeObject), revolut_pay?: (object{funding?: (object{card?: (object{brand: null|string, country: null|string, exp_month: null|int, exp_year: null|int, funding: null|string, last4: null|string}&StripeObject), type: null|string}&StripeObject), transaction_id: null|string}&StripeObject), samsung_pay?: (object{buyer_id: null|string, transaction_id: null|string}&StripeObject), satispay?: (object{transaction_id: null|string}&StripeObject), sepa_credit_transfer?: (object{bank_name: null|string, bic: null|string, iban: null|string}&StripeObject), sepa_debit?: (object{bank_code: null|string, branch_code: null|string, country: null|string, expected_debit_date?: string, fingerprint: null|string, last4: null|string, mandate: null|string}&StripeObject), sofort?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, country: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, preferred_language: null|string, verified_name: null|string}&StripeObject), stripe_account?: (object{}&StripeObject), swish?: (object{fingerprint: null|string, payment_reference: null|string, verified_phone_last4: null|string}&StripeObject), twint?: (object{}&StripeObject), type: string, upi?: (object{vpa: null|string}&StripeObject), us_bank_account?: (object{account_holder_type: null|string, account_type: null|string, bank_name: null|string, expected_debit_date?: string, fingerprint: null|string, last4: null|string, mandate?: Mandate|string, payment_reference: null|string, routing_number: null|string}&StripeObject), wechat?: (object{}&StripeObject), wechat_pay?: (object{fingerprint: null|string, location?: string, reader?: string, transaction_id: null|string}&StripeObject), zip?: (object{}&StripeObject)}&StripeObject) $payment_method_details Information about the Payment Method debited for this payment. * @property (object{custom?: (object{payment_reference: null|string}&StripeObject), type: string}&StripeObject) $processor_details Processor information associated with this payment. * @property string $reported_by Indicates who reported the payment. * @property null|(object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), name: null|string, phone: null|string}&StripeObject) $shipping_details Shipping information for this payment. diff --git a/plugins/stripe-php/lib/Payout.php b/plugins/stripe-php/lib/Payout.php index c9c12a1a..3a4aeed7 100644 --- a/plugins/stripe-php/lib/Payout.php +++ b/plugins/stripe-php/lib/Payout.php @@ -29,7 +29,7 @@ namespace Stripe; * @property null|BalanceTransaction|string $failure_balance_transaction If the payout fails or cancels, this is the ID of the balance transaction that reverses the initial balance transaction and returns the funds from the failed payout back in your balance. * @property null|string $failure_code Error code that provides a reason for a payout failure, if available. View our list of failure codes. * @property null|string $failure_message Message that provides the reason for a payout failure, if available. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $method The method used to send this payout, which can be standard or instant. instant is supported for payouts to debit cards and bank accounts in certain countries. Learn more about bank support for Instant Payouts. * @property null|Payout|string $original_payout If the payout reverses another, this is the ID of the original payout. @@ -74,8 +74,8 @@ class Payout extends ApiResource * * If you create a manual payout on a Stripe account that uses multiple payment * source types, you need to specify the source type balance that the payout draws - * from. The balance object details available and - * pending amounts by source type. + * from. The balance object details available + * and pending amounts by source type. * * @param null|array{amount: int, currency: string, description?: string, destination?: string, expand?: string[], metadata?: array, method?: string, payout_method?: string, source_type?: string, statement_descriptor?: string} $params * @param null|array|string $options diff --git a/plugins/stripe-php/lib/Plan.php b/plugins/stripe-php/lib/Plan.php index 5b211c26..636c4ecc 100644 --- a/plugins/stripe-php/lib/Plan.php +++ b/plugins/stripe-php/lib/Plan.php @@ -24,7 +24,7 @@ namespace Stripe; * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property string $interval The frequency at which a subscription is billed. One of day, week, month or year. * @property int $interval_count The number of intervals (specified in the interval attribute) between subscription billings. For example, interval=month and interval_count=3 bills every 3 months. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $meter The meter tracking the usage of a metered price * @property null|string $nickname A brief description of the plan, hidden from customers. diff --git a/plugins/stripe-php/lib/Price.php b/plugins/stripe-php/lib/Price.php index 17fd2848..a2ae6b09 100644 --- a/plugins/stripe-php/lib/Price.php +++ b/plugins/stripe-php/lib/Price.php @@ -20,7 +20,7 @@ namespace Stripe; * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property null|StripeObject $currency_options Prices defined in each available currency option. Each key must be a three-letter ISO currency code and a supported currency. * @property null|(object{maximum: null|int, minimum: null|int, preset: null|int}&StripeObject) $custom_unit_amount When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|string $lookup_key A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $nickname A brief description of the price, hidden from customers. diff --git a/plugins/stripe-php/lib/Product.php b/plugins/stripe-php/lib/Product.php index e73af652..9f5423df 100644 --- a/plugins/stripe-php/lib/Product.php +++ b/plugins/stripe-php/lib/Product.php @@ -21,7 +21,7 @@ namespace Stripe; * @property null|Price|string $default_price The ID of the Price object that is the default price for this product. * @property null|string $description The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. * @property string[] $images A list of up to 8 URLs of images for this product, meant to be displayable to the customer. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property (object{name?: string}&StripeObject)[] $marketing_features A list of up to 15 marketing features for this product. These are displayed in pricing tables. * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $name The product's name, meant to be displayable to the customer. diff --git a/plugins/stripe-php/lib/ProductFeature.php b/plugins/stripe-php/lib/ProductFeature.php index a5aac756..b1292390 100644 --- a/plugins/stripe-php/lib/ProductFeature.php +++ b/plugins/stripe-php/lib/ProductFeature.php @@ -11,7 +11,7 @@ namespace Stripe; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property Entitlements\Feature $entitlement_feature A feature represents a monetizable ability or functionality in your system. Features can be assigned to products, and when those products are purchased, Stripe will create an entitlement to the feature for the purchasing customer. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. */ class ProductFeature extends ApiResource { diff --git a/plugins/stripe-php/lib/PromotionCode.php b/plugins/stripe-php/lib/PromotionCode.php index 260427dc..8c176276 100644 --- a/plugins/stripe-php/lib/PromotionCode.php +++ b/plugins/stripe-php/lib/PromotionCode.php @@ -19,7 +19,7 @@ namespace Stripe; * @property null|Customer|string $customer The customer who can use this promotion code. * @property null|string $customer_account The account representing the customer who can use this promotion code. * @property null|int $expires_at Date at which the promotion code can no longer be redeemed. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|int $max_redemptions Maximum number of times this promotion code can be redeemed. * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property (object{coupon: null|Coupon|string, type: string}&StripeObject) $promotion diff --git a/plugins/stripe-php/lib/Quote.php b/plugins/stripe-php/lib/Quote.php index ec608042..ed945d15 100644 --- a/plugins/stripe-php/lib/Quote.php +++ b/plugins/stripe-php/lib/Quote.php @@ -32,7 +32,7 @@ namespace Stripe; * @property null|Invoice|string $invoice The invoice that was created from this quote. * @property (object{days_until_due: null|int, issuer: (object{account?: Account|string, type: string}&StripeObject)}&StripeObject) $invoice_settings * @property null|Collection $line_items A list of items the customer is being quoted for. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $number A unique number that identifies this particular quote. This number is assigned once the quote is finalized. * @property null|Account|string $on_behalf_of The account on behalf of which to charge. See the Connect documentation for details. diff --git a/plugins/stripe-php/lib/Radar/EarlyFraudWarning.php b/plugins/stripe-php/lib/Radar/EarlyFraudWarning.php index f85b3bab..cdd1775c 100644 --- a/plugins/stripe-php/lib/Radar/EarlyFraudWarning.php +++ b/plugins/stripe-php/lib/Radar/EarlyFraudWarning.php @@ -16,7 +16,7 @@ namespace Stripe\Radar; * @property string|\Stripe\Charge $charge ID of the charge this early fraud warning is for, optionally expanded. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $fraud_type The type of fraud labelled by the issuer. One of card_never_received, fraudulent_card_application, made_with_counterfeit_card, made_with_lost_card, made_with_stolen_card, misc, unauthorized_use_of_card. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the Payment Intent this early fraud warning is for, optionally expanded. */ class EarlyFraudWarning extends \Stripe\ApiResource diff --git a/plugins/stripe-php/lib/Radar/PaymentEvaluation.php b/plugins/stripe-php/lib/Radar/PaymentEvaluation.php index c4110320..871545c4 100644 --- a/plugins/stripe-php/lib/Radar/PaymentEvaluation.php +++ b/plugins/stripe-php/lib/Radar/PaymentEvaluation.php @@ -13,16 +13,20 @@ namespace Stripe\Radar; * @property int $created_at Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|(object{customer: null|string, customer_account: null|string, email: null|string, name: null|string, phone: null|string}&\Stripe\StripeObject) $customer_details Customer details attached to this payment evaluation. * @property null|((object{dispute_opened?: (object{amount: int, currency: string, reason: string}&\Stripe\StripeObject), early_fraud_warning_received?: (object{fraud_type: string}&\Stripe\StripeObject), occurred_at: int, refunded?: (object{amount: int, currency: string, reason: string}&\Stripe\StripeObject), type: string, user_intervention_raised?: (object{custom?: (object{type: string}&\Stripe\StripeObject), key: string, type: string}&\Stripe\StripeObject), user_intervention_resolved?: (object{key: string, outcome: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject))[] $events Event information associated with the payment evaluation, such as refunds, dispute, early fraud warnings, or user interventions. - * @property (object{evaluated_at: int, fraudulent_dispute: (object{recommended_action: string, risk_score: int}&\Stripe\StripeObject)}&\Stripe\StripeObject) $insights Collection of scores and insights for this payment evaluation. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|(object{merchant_blocked?: (object{reason: string}&\Stripe\StripeObject), payment_intent_id?: string, rejected?: (object{card?: (object{address_line1_check: string, address_postal_code_check: string, cvc_check: string, reason: string}&\Stripe\StripeObject)}&\Stripe\StripeObject), succeeded?: (object{card?: (object{address_line1_check: string, address_postal_code_check: string, cvc_check: string}&\Stripe\StripeObject)}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject) $outcome Indicates the final outcome for the payment evaluation. * @property null|(object{amount: int, currency: string, description: null|string, money_movement_details: null|(object{card: null|(object{customer_presence: null|string, payment_type: null|string}&\Stripe\StripeObject), money_movement_type: string}&\Stripe\StripeObject), payment_method_details: null|(object{billing_details: null|(object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), email: null|string, name: null|string, phone: null|string}&\Stripe\StripeObject), payment_method: string|\Stripe\PaymentMethod}&\Stripe\StripeObject), shipping_details: null|(object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), name: null|string, phone: null|string}&\Stripe\StripeObject), statement_descriptor: null|string}&\Stripe\StripeObject) $payment_details Payment details attached to this payment evaluation. + * @property string $recommended_action Recommended action based on the score of the fraudulent_payment signal. Possible values are block and continue. + * @property (object{fraudulent_payment: (object{evaluated_at: int, risk_level: string, score: float}&\Stripe\StripeObject)}&\Stripe\StripeObject) $signals Collection of signals for this payment evaluation. */ class PaymentEvaluation extends \Stripe\ApiResource { const OBJECT_NAME = 'radar.payment_evaluation'; + const RECOMMENDED_ACTION_BLOCK = 'block'; + const RECOMMENDED_ACTION_CONTINUE = 'continue'; + /** * Request a Radar API fraud risk score from Stripe for a payment before sending it * for external processor authorization. diff --git a/plugins/stripe-php/lib/Radar/ValueList.php b/plugins/stripe-php/lib/Radar/ValueList.php index 25f0f1c9..c1b62fce 100644 --- a/plugins/stripe-php/lib/Radar/ValueList.php +++ b/plugins/stripe-php/lib/Radar/ValueList.php @@ -14,9 +14,9 @@ namespace Stripe\Radar; * @property string $alias The name of the value list for use in rules. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $created_by The name or email address of the user who created this value list. - * @property string $item_type The type of items in the value list. One of card_fingerprint, card_bin, email, ip_address, country, string, case_sensitive_string, customer_id, sepa_debit_fingerprint, or us_bank_account_fingerprint. + * @property string $item_type The type of items in the value list. One of card_fingerprint, card_bin, crypto_fingerprint, email, ip_address, country, string, case_sensitive_string, customer_id, sepa_debit_fingerprint, or us_bank_account_fingerprint. * @property \Stripe\Collection $list_items List of items contained within this value list. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $name The name of the value list. */ @@ -30,6 +30,7 @@ class ValueList extends \Stripe\ApiResource const ITEM_TYPE_CARD_FINGERPRINT = 'card_fingerprint'; const ITEM_TYPE_CASE_SENSITIVE_STRING = 'case_sensitive_string'; const ITEM_TYPE_COUNTRY = 'country'; + const ITEM_TYPE_CRYPTO_FINGERPRINT = 'crypto_fingerprint'; const ITEM_TYPE_CUSTOMER_ID = 'customer_id'; const ITEM_TYPE_EMAIL = 'email'; const ITEM_TYPE_IP_ADDRESS = 'ip_address'; diff --git a/plugins/stripe-php/lib/Radar/ValueListItem.php b/plugins/stripe-php/lib/Radar/ValueListItem.php index 34e64da3..59f0e0ad 100644 --- a/plugins/stripe-php/lib/Radar/ValueListItem.php +++ b/plugins/stripe-php/lib/Radar/ValueListItem.php @@ -13,7 +13,7 @@ namespace Stripe\Radar; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $created_by The name or email address of the user who added this item to the value list. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property string $value The value of the item. * @property string $value_list The identifier of the value list this item belongs to. */ diff --git a/plugins/stripe-php/lib/Reporting/ReportType.php b/plugins/stripe-php/lib/Reporting/ReportType.php index a3cef891..b36cfeeb 100644 --- a/plugins/stripe-php/lib/Reporting/ReportType.php +++ b/plugins/stripe-php/lib/Reporting/ReportType.php @@ -19,7 +19,7 @@ namespace Stripe\Reporting; * @property int $data_available_end Most recent time for which this Report Type is available. Measured in seconds since the Unix epoch. * @property int $data_available_start Earliest time for which this Report Type is available. Measured in seconds since the Unix epoch. * @property null|string[] $default_columns List of column names that are included by default when this Report Type gets run. (If the Report Type doesn't support the columns parameter, this will be null.) - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property string $name Human-readable name of the Report Type * @property int $updated When this Report Type was latest updated. Measured in seconds since the Unix epoch. * @property int $version Version of the Report Type. Different versions report with the same ID will have the same purpose, but may take different run parameters or have different result schemas. diff --git a/plugins/stripe-php/lib/Reserve/Hold.php b/plugins/stripe-php/lib/Reserve/Hold.php index 6e4bdb97..867d8321 100644 --- a/plugins/stripe-php/lib/Reserve/Hold.php +++ b/plugins/stripe-php/lib/Reserve/Hold.php @@ -15,7 +15,7 @@ namespace Stripe\Reserve; * @property string $created_by Indicates which party created this ReserveHold. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property null|bool $is_releasable Whether there are any funds available to release on this ReserveHold. Note that if the ReserveHold is in the process of being released, this could be false, even though the funds haven't been fully released yet. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $reason The reason for the ReserveHold. * @property (object{release_after: null|int, scheduled_release: null|int}&\Stripe\StripeObject) $release_schedule diff --git a/plugins/stripe-php/lib/Reserve/Plan.php b/plugins/stripe-php/lib/Reserve/Plan.php index 034dd10d..76e64630 100644 --- a/plugins/stripe-php/lib/Reserve/Plan.php +++ b/plugins/stripe-php/lib/Reserve/Plan.php @@ -14,7 +14,7 @@ namespace Stripe\Reserve; * @property null|string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. An unset currency indicates that the plan applies to all currencies. * @property null|int $disabled_at Time at which the ReservePlan was disabled. * @property null|(object{release_after: int, scheduled_release: int}&\Stripe\StripeObject) $fixed_release - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property int $percent The percent of each Charge to reserve. * @property null|(object{days_after_charge: int, expires_on: null|int}&\Stripe\StripeObject) $rolling_release diff --git a/plugins/stripe-php/lib/Reserve/Release.php b/plugins/stripe-php/lib/Reserve/Release.php index e9bc2d16..73825fbd 100644 --- a/plugins/stripe-php/lib/Reserve/Release.php +++ b/plugins/stripe-php/lib/Reserve/Release.php @@ -13,7 +13,7 @@ namespace Stripe\Reserve; * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $created_by Indicates which party created this ReserveRelease. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $reason The reason for the ReserveRelease, indicating why the funds were released. * @property int $released_at The release timestamp of the funds. diff --git a/plugins/stripe-php/lib/Review.php b/plugins/stripe-php/lib/Review.php index fd29bad9..c98321a5 100644 --- a/plugins/stripe-php/lib/Review.php +++ b/plugins/stripe-php/lib/Review.php @@ -18,7 +18,7 @@ namespace Stripe; * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $ip_address The IP address where the payment originated. * @property null|(object{city: null|string, country: null|string, latitude: null|float, longitude: null|float, region: null|string}&StripeObject) $ip_address_location Information related to the location of the payment. Note that this information is an approximation and attempts to locate the nearest population center - it should not be used to determine a specific address. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property bool $open If true, the review needs action. * @property string $opened_reason The reason the review was opened. One of rule or manual. * @property null|PaymentIntent|string $payment_intent The PaymentIntent ID associated with this review, if one exists. diff --git a/plugins/stripe-php/lib/Service/AbstractService.php b/plugins/stripe-php/lib/Service/AbstractService.php index 23132a37..fdafae75 100644 --- a/plugins/stripe-php/lib/Service/AbstractService.php +++ b/plugins/stripe-php/lib/Service/AbstractService.php @@ -49,18 +49,25 @@ abstract class AbstractService } /** - * Translate null values to empty strings. For service methods, - * we interpret null as a request to unset the field, which - * corresponds to sending an empty string for the field to the - * API. + * Translate null values to empty strings for v1 API requests. + * For v1, we interpret null as a request to unset the field, + * which corresponds to sending an empty string in the + * form-encoded body. + * + * For v2, null values are preserved as-is so they serialize + * to JSON null, which is the v2 mechanism for clearing fields. * * @param null|array $params + * @param 'v1'|'v2' $apiMode */ - private static function formatParams($params) + private static function formatParams($params, $apiMode) { if (null === $params) { return null; } + if ('v2' === $apiMode) { + return $params; + } \array_walk_recursive($params, static function (&$value, $key) { if (null === $value) { $value = ''; @@ -70,24 +77,44 @@ abstract class AbstractService return $params; } - protected function request($method, $path, $params, $opts) + protected function request($method, $path, $params, $opts, $schemas = null) { - return $this->getClient()->request($method, $path, self::formatParams($params), $opts); + $apiMode = \Stripe\Util\Util::getApiMode($path); + $params = self::formatParams($params, $apiMode); + if (null !== $schemas && isset($schemas['request_schema'])) { + $params = \Stripe\Util\Int64::coerceRequestParams($params, $schemas['request_schema']); + } + + return $this->getClient()->request($method, $path, $params, $opts); } protected function requestStream($method, $path, $readBodyChunkCallable, $params, $opts) { - return $this->getStreamingClient()->requestStream($method, $path, $readBodyChunkCallable, self::formatParams($params), $opts); + $apiMode = \Stripe\Util\Util::getApiMode($path); + + return $this->getStreamingClient()->requestStream($method, $path, $readBodyChunkCallable, self::formatParams($params, $apiMode), $opts); } - protected function requestCollection($method, $path, $params, $opts) + protected function requestCollection($method, $path, $params, $opts, $schemas = null) { - return $this->getClient()->requestCollection($method, $path, self::formatParams($params), $opts); + $apiMode = \Stripe\Util\Util::getApiMode($path); + $params = self::formatParams($params, $apiMode); + if (null !== $schemas && isset($schemas['request_schema'])) { + $params = \Stripe\Util\Int64::coerceRequestParams($params, $schemas['request_schema']); + } + + return $this->getClient()->requestCollection($method, $path, $params, $opts); } - protected function requestSearchResult($method, $path, $params, $opts) + protected function requestSearchResult($method, $path, $params, $opts, $schemas = null) { - return $this->getClient()->requestSearchResult($method, $path, self::formatParams($params), $opts); + $apiMode = \Stripe\Util\Util::getApiMode($path); + $params = self::formatParams($params, $apiMode); + if (null !== $schemas && isset($schemas['request_schema'])) { + $params = \Stripe\Util\Int64::coerceRequestParams($params, $schemas['request_schema']); + } + + return $this->getClient()->requestSearchResult($method, $path, $params, $opts); } protected function buildPath($basePath, ...$ids) diff --git a/plugins/stripe-php/lib/Service/AccountService.php b/plugins/stripe-php/lib/Service/AccountService.php index b69760dd..047940a2 100644 --- a/plugins/stripe-php/lib/Service/AccountService.php +++ b/plugins/stripe-php/lib/Service/AccountService.php @@ -91,7 +91,7 @@ class AccountService extends AbstractService * information during account onboarding. You can prefill any information on the * account. * - * @param null|array{account_token?: string, business_profile?: array{annual_revenue?: array{amount: int, currency: string, fiscal_year_end: string}, estimated_worker_count?: int, mcc?: string, minority_owned_business_designation?: string[], monthly_estimated_revenue?: array{amount: int, currency: string}, name?: string, product_description?: string, support_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, support_email?: string, support_phone?: string, support_url?: null|string, url?: string}, business_type?: string, capabilities?: array{acss_debit_payments?: array{requested?: bool}, affirm_payments?: array{requested?: bool}, afterpay_clearpay_payments?: array{requested?: bool}, alma_payments?: array{requested?: bool}, amazon_pay_payments?: array{requested?: bool}, au_becs_debit_payments?: array{requested?: bool}, bacs_debit_payments?: array{requested?: bool}, bancontact_payments?: array{requested?: bool}, bank_transfer_payments?: array{requested?: bool}, billie_payments?: array{requested?: bool}, blik_payments?: array{requested?: bool}, boleto_payments?: array{requested?: bool}, card_issuing?: array{requested?: bool}, card_payments?: array{requested?: bool}, cartes_bancaires_payments?: array{requested?: bool}, cashapp_payments?: array{requested?: bool}, crypto_payments?: array{requested?: bool}, eps_payments?: array{requested?: bool}, fpx_payments?: array{requested?: bool}, gb_bank_transfer_payments?: array{requested?: bool}, giropay_payments?: array{requested?: bool}, grabpay_payments?: array{requested?: bool}, ideal_payments?: array{requested?: bool}, india_international_payments?: array{requested?: bool}, jcb_payments?: array{requested?: bool}, jp_bank_transfer_payments?: array{requested?: bool}, kakao_pay_payments?: array{requested?: bool}, klarna_payments?: array{requested?: bool}, konbini_payments?: array{requested?: bool}, kr_card_payments?: array{requested?: bool}, legacy_payments?: array{requested?: bool}, link_payments?: array{requested?: bool}, mb_way_payments?: array{requested?: bool}, mobilepay_payments?: array{requested?: bool}, multibanco_payments?: array{requested?: bool}, mx_bank_transfer_payments?: array{requested?: bool}, naver_pay_payments?: array{requested?: bool}, nz_bank_account_becs_debit_payments?: array{requested?: bool}, oxxo_payments?: array{requested?: bool}, p24_payments?: array{requested?: bool}, pay_by_bank_payments?: array{requested?: bool}, payco_payments?: array{requested?: bool}, paynow_payments?: array{requested?: bool}, payto_payments?: array{requested?: bool}, pix_payments?: array{requested?: bool}, promptpay_payments?: array{requested?: bool}, revolut_pay_payments?: array{requested?: bool}, samsung_pay_payments?: array{requested?: bool}, satispay_payments?: array{requested?: bool}, sepa_bank_transfer_payments?: array{requested?: bool}, sepa_debit_payments?: array{requested?: bool}, sofort_payments?: array{requested?: bool}, swish_payments?: array{requested?: bool}, tax_reporting_us_1099_k?: array{requested?: bool}, tax_reporting_us_1099_misc?: array{requested?: bool}, transfers?: array{requested?: bool}, treasury?: array{requested?: bool}, twint_payments?: array{requested?: bool}, us_bank_account_ach_payments?: array{requested?: bool}, us_bank_transfer_payments?: array{requested?: bool}, zip_payments?: array{requested?: bool}}, company?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, directors_provided?: bool, directorship_declaration?: array{date?: int, ip?: string, user_agent?: string}, executives_provided?: bool, export_license_id?: string, export_purpose_code?: string, name?: string, name_kana?: string, name_kanji?: string, owners_provided?: bool, ownership_declaration?: array{date?: int, ip?: string, user_agent?: string}, ownership_exemption_reason?: null|string, phone?: string, registration_date?: null|array{day: int, month: int, year: int}, registration_number?: string, representative_declaration?: array{date?: int, ip?: string, user_agent?: string}, structure?: null|string, tax_id?: string, tax_id_registrar?: string, vat_id?: string, verification?: array{document?: array{back?: string, front?: string}}}, controller?: array{fees?: array{payer?: string}, losses?: array{payments?: string}, requirement_collection?: string, stripe_dashboard?: array{type?: string}}, country?: string, default_currency?: string, documents?: array{bank_account_ownership_verification?: array{files?: string[]}, company_license?: array{files?: string[]}, company_memorandum_of_association?: array{files?: string[]}, company_ministerial_decree?: array{files?: string[]}, company_registration_verification?: array{files?: string[]}, company_tax_id_verification?: array{files?: string[]}, proof_of_address?: array{files?: string[]}, proof_of_registration?: array{files?: string[], signer?: array{person?: string}}, proof_of_ultimate_beneficial_ownership?: array{files?: string[], signer?: array{person?: string}}}, email?: string, expand?: string[], external_account?: array|string, groups?: array{payments_pricing?: null|string}, individual?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, dob?: null|array{day: int, month: int, year: int}, email?: string, first_name?: string, first_name_kana?: string, first_name_kanji?: string, full_name_aliases?: null|string[], gender?: string, id_number?: string, id_number_secondary?: string, last_name?: string, last_name_kana?: string, last_name_kanji?: string, maiden_name?: string, metadata?: null|array, phone?: string, political_exposure?: string, registered_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, relationship?: array{director?: bool, executive?: bool, owner?: bool, percent_ownership?: null|float, title?: string}, ssn_last_4?: string, verification?: array{additional_document?: array{back?: string, front?: string}, document?: array{back?: string, front?: string}}}, metadata?: null|array, settings?: array{bacs_debit_payments?: array{display_name?: string}, branding?: array{icon?: string, logo?: string, primary_color?: string, secondary_color?: string}, card_issuing?: array{tos_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}, card_payments?: array{decline_on?: array{avs_failure?: bool, cvc_failure?: bool}, statement_descriptor_prefix?: string, statement_descriptor_prefix_kana?: null|string, statement_descriptor_prefix_kanji?: null|string}, invoices?: array{hosted_payment_method_save?: string}, payments?: array{statement_descriptor?: string, statement_descriptor_kana?: string, statement_descriptor_kanji?: string}, payouts?: array{debit_negative_balances?: bool, schedule?: array{delay_days?: array|int|string, interval?: string, monthly_anchor?: int, monthly_payout_days?: int[], weekly_anchor?: string, weekly_payout_days?: string[]}, statement_descriptor?: string}, treasury?: array{tos_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}}, tos_acceptance?: array{date?: int, ip?: string, service_agreement?: string, user_agent?: string}, type?: string} $params + * @param null|array{account_token?: string, business_profile?: array{annual_revenue?: array{amount: int, currency: string, fiscal_year_end: string}, estimated_worker_count?: int, mcc?: string, minority_owned_business_designation?: string[], monthly_estimated_revenue?: array{amount: int, currency: string}, name?: string, product_description?: string, support_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, support_email?: string, support_phone?: string, support_url?: null|string, url?: string}, business_type?: string, capabilities?: array{acss_debit_payments?: array{requested?: bool}, affirm_payments?: array{requested?: bool}, afterpay_clearpay_payments?: array{requested?: bool}, alma_payments?: array{requested?: bool}, amazon_pay_payments?: array{requested?: bool}, au_becs_debit_payments?: array{requested?: bool}, bacs_debit_payments?: array{requested?: bool}, bancontact_payments?: array{requested?: bool}, bank_transfer_payments?: array{requested?: bool}, billie_payments?: array{requested?: bool}, blik_payments?: array{requested?: bool}, boleto_payments?: array{requested?: bool}, card_issuing?: array{requested?: bool}, card_payments?: array{requested?: bool}, cartes_bancaires_payments?: array{requested?: bool}, cashapp_payments?: array{requested?: bool}, crypto_payments?: array{requested?: bool}, eps_payments?: array{requested?: bool}, fpx_payments?: array{requested?: bool}, gb_bank_transfer_payments?: array{requested?: bool}, giropay_payments?: array{requested?: bool}, grabpay_payments?: array{requested?: bool}, ideal_payments?: array{requested?: bool}, india_international_payments?: array{requested?: bool}, jcb_payments?: array{requested?: bool}, jp_bank_transfer_payments?: array{requested?: bool}, kakao_pay_payments?: array{requested?: bool}, klarna_payments?: array{requested?: bool}, konbini_payments?: array{requested?: bool}, kr_card_payments?: array{requested?: bool}, legacy_payments?: array{requested?: bool}, link_payments?: array{requested?: bool}, mb_way_payments?: array{requested?: bool}, mobilepay_payments?: array{requested?: bool}, multibanco_payments?: array{requested?: bool}, mx_bank_transfer_payments?: array{requested?: bool}, naver_pay_payments?: array{requested?: bool}, nz_bank_account_becs_debit_payments?: array{requested?: bool}, oxxo_payments?: array{requested?: bool}, p24_payments?: array{requested?: bool}, pay_by_bank_payments?: array{requested?: bool}, payco_payments?: array{requested?: bool}, paynow_payments?: array{requested?: bool}, payto_payments?: array{requested?: bool}, pix_payments?: array{requested?: bool}, promptpay_payments?: array{requested?: bool}, revolut_pay_payments?: array{requested?: bool}, samsung_pay_payments?: array{requested?: bool}, satispay_payments?: array{requested?: bool}, sepa_bank_transfer_payments?: array{requested?: bool}, sepa_debit_payments?: array{requested?: bool}, sofort_payments?: array{requested?: bool}, swish_payments?: array{requested?: bool}, tax_reporting_us_1099_k?: array{requested?: bool}, tax_reporting_us_1099_misc?: array{requested?: bool}, transfers?: array{requested?: bool}, treasury?: array{requested?: bool}, twint_payments?: array{requested?: bool}, upi_payments?: array{requested?: bool}, us_bank_account_ach_payments?: array{requested?: bool}, us_bank_transfer_payments?: array{requested?: bool}, zip_payments?: array{requested?: bool}}, company?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, directors_provided?: bool, directorship_declaration?: array{date?: int, ip?: string, user_agent?: string}, executives_provided?: bool, export_license_id?: string, export_purpose_code?: string, name?: string, name_kana?: string, name_kanji?: string, owners_provided?: bool, ownership_declaration?: array{date?: int, ip?: string, user_agent?: string}, ownership_exemption_reason?: null|string, phone?: string, registration_date?: null|array{day: int, month: int, year: int}, registration_number?: string, representative_declaration?: array{date?: int, ip?: string, user_agent?: string}, structure?: null|string, tax_id?: string, tax_id_registrar?: string, vat_id?: string, verification?: array{document?: array{back?: string, front?: string}}}, controller?: array{fees?: array{payer?: string}, losses?: array{payments?: string}, requirement_collection?: string, stripe_dashboard?: array{type?: string}}, country?: string, default_currency?: string, documents?: array{bank_account_ownership_verification?: array{files?: string[]}, company_license?: array{files?: string[]}, company_memorandum_of_association?: array{files?: string[]}, company_ministerial_decree?: array{files?: string[]}, company_registration_verification?: array{files?: string[]}, company_tax_id_verification?: array{files?: string[]}, proof_of_address?: array{files?: string[]}, proof_of_registration?: array{files?: string[], signer?: array{person?: string}}, proof_of_ultimate_beneficial_ownership?: array{files?: string[], signer?: array{person?: string}}}, email?: string, expand?: string[], external_account?: array|string, groups?: array{payments_pricing?: null|string}, individual?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, dob?: null|array{day: int, month: int, year: int}, email?: string, first_name?: string, first_name_kana?: string, first_name_kanji?: string, full_name_aliases?: null|string[], gender?: string, id_number?: string, id_number_secondary?: string, last_name?: string, last_name_kana?: string, last_name_kanji?: string, maiden_name?: string, metadata?: null|array, phone?: string, political_exposure?: string, registered_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, relationship?: array{director?: bool, executive?: bool, owner?: bool, percent_ownership?: null|float, title?: string}, ssn_last_4?: string, verification?: array{additional_document?: array{back?: string, front?: string}, document?: array{back?: string, front?: string}}}, metadata?: null|array, settings?: array{bacs_debit_payments?: array{display_name?: string}, branding?: array{icon?: string, logo?: string, primary_color?: string, secondary_color?: string}, card_issuing?: array{tos_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}, card_payments?: array{decline_on?: array{avs_failure?: bool, cvc_failure?: bool}, statement_descriptor_prefix?: string, statement_descriptor_prefix_kana?: null|string, statement_descriptor_prefix_kanji?: null|string}, invoices?: array{hosted_payment_method_save?: string}, payments?: array{statement_descriptor?: string, statement_descriptor_kana?: string, statement_descriptor_kanji?: string}, payouts?: array{debit_negative_balances?: bool, schedule?: array{delay_days?: array|int|string, interval?: string, monthly_anchor?: int, monthly_payout_days?: int[], weekly_anchor?: string, weekly_payout_days?: string[]}, statement_descriptor?: string}, treasury?: array{tos_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}}, tos_acceptance?: array{date?: int, ip?: string, service_agreement?: string, user_agent?: string}, type?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\Account @@ -315,7 +315,7 @@ class AccountService extends AbstractService * more about updating accounts. * * @param string $id - * @param null|array{account_token?: string, business_profile?: array{annual_revenue?: array{amount: int, currency: string, fiscal_year_end: string}, estimated_worker_count?: int, mcc?: string, minority_owned_business_designation?: string[], monthly_estimated_revenue?: array{amount: int, currency: string}, name?: string, product_description?: string, support_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, support_email?: string, support_phone?: string, support_url?: null|string, url?: string}, business_type?: string, capabilities?: array{acss_debit_payments?: array{requested?: bool}, affirm_payments?: array{requested?: bool}, afterpay_clearpay_payments?: array{requested?: bool}, alma_payments?: array{requested?: bool}, amazon_pay_payments?: array{requested?: bool}, au_becs_debit_payments?: array{requested?: bool}, bacs_debit_payments?: array{requested?: bool}, bancontact_payments?: array{requested?: bool}, bank_transfer_payments?: array{requested?: bool}, billie_payments?: array{requested?: bool}, blik_payments?: array{requested?: bool}, boleto_payments?: array{requested?: bool}, card_issuing?: array{requested?: bool}, card_payments?: array{requested?: bool}, cartes_bancaires_payments?: array{requested?: bool}, cashapp_payments?: array{requested?: bool}, crypto_payments?: array{requested?: bool}, eps_payments?: array{requested?: bool}, fpx_payments?: array{requested?: bool}, gb_bank_transfer_payments?: array{requested?: bool}, giropay_payments?: array{requested?: bool}, grabpay_payments?: array{requested?: bool}, ideal_payments?: array{requested?: bool}, india_international_payments?: array{requested?: bool}, jcb_payments?: array{requested?: bool}, jp_bank_transfer_payments?: array{requested?: bool}, kakao_pay_payments?: array{requested?: bool}, klarna_payments?: array{requested?: bool}, konbini_payments?: array{requested?: bool}, kr_card_payments?: array{requested?: bool}, legacy_payments?: array{requested?: bool}, link_payments?: array{requested?: bool}, mb_way_payments?: array{requested?: bool}, mobilepay_payments?: array{requested?: bool}, multibanco_payments?: array{requested?: bool}, mx_bank_transfer_payments?: array{requested?: bool}, naver_pay_payments?: array{requested?: bool}, nz_bank_account_becs_debit_payments?: array{requested?: bool}, oxxo_payments?: array{requested?: bool}, p24_payments?: array{requested?: bool}, pay_by_bank_payments?: array{requested?: bool}, payco_payments?: array{requested?: bool}, paynow_payments?: array{requested?: bool}, payto_payments?: array{requested?: bool}, pix_payments?: array{requested?: bool}, promptpay_payments?: array{requested?: bool}, revolut_pay_payments?: array{requested?: bool}, samsung_pay_payments?: array{requested?: bool}, satispay_payments?: array{requested?: bool}, sepa_bank_transfer_payments?: array{requested?: bool}, sepa_debit_payments?: array{requested?: bool}, sofort_payments?: array{requested?: bool}, swish_payments?: array{requested?: bool}, tax_reporting_us_1099_k?: array{requested?: bool}, tax_reporting_us_1099_misc?: array{requested?: bool}, transfers?: array{requested?: bool}, treasury?: array{requested?: bool}, twint_payments?: array{requested?: bool}, us_bank_account_ach_payments?: array{requested?: bool}, us_bank_transfer_payments?: array{requested?: bool}, zip_payments?: array{requested?: bool}}, company?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, directors_provided?: bool, directorship_declaration?: array{date?: int, ip?: string, user_agent?: string}, executives_provided?: bool, export_license_id?: string, export_purpose_code?: string, name?: string, name_kana?: string, name_kanji?: string, owners_provided?: bool, ownership_declaration?: array{date?: int, ip?: string, user_agent?: string}, ownership_exemption_reason?: null|string, phone?: string, registration_date?: null|array{day: int, month: int, year: int}, registration_number?: string, representative_declaration?: array{date?: int, ip?: string, user_agent?: string}, structure?: null|string, tax_id?: string, tax_id_registrar?: string, vat_id?: string, verification?: array{document?: array{back?: string, front?: string}}}, default_currency?: string, documents?: array{bank_account_ownership_verification?: array{files?: string[]}, company_license?: array{files?: string[]}, company_memorandum_of_association?: array{files?: string[]}, company_ministerial_decree?: array{files?: string[]}, company_registration_verification?: array{files?: string[]}, company_tax_id_verification?: array{files?: string[]}, proof_of_address?: array{files?: string[]}, proof_of_registration?: array{files?: string[], signer?: array{person?: string}}, proof_of_ultimate_beneficial_ownership?: array{files?: string[], signer?: array{person?: string}}}, email?: string, expand?: string[], external_account?: null|array|string, groups?: array{payments_pricing?: null|string}, individual?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, dob?: null|array{day: int, month: int, year: int}, email?: string, first_name?: string, first_name_kana?: string, first_name_kanji?: string, full_name_aliases?: null|string[], gender?: string, id_number?: string, id_number_secondary?: string, last_name?: string, last_name_kana?: string, last_name_kanji?: string, maiden_name?: string, metadata?: null|array, phone?: string, political_exposure?: string, registered_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, relationship?: array{director?: bool, executive?: bool, owner?: bool, percent_ownership?: null|float, title?: string}, ssn_last_4?: string, verification?: array{additional_document?: array{back?: string, front?: string}, document?: array{back?: string, front?: string}}}, metadata?: null|array, settings?: array{bacs_debit_payments?: array{display_name?: string}, branding?: array{icon?: string, logo?: string, primary_color?: string, secondary_color?: string}, card_issuing?: array{tos_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}, card_payments?: array{decline_on?: array{avs_failure?: bool, cvc_failure?: bool}, statement_descriptor_prefix?: string, statement_descriptor_prefix_kana?: null|string, statement_descriptor_prefix_kanji?: null|string}, invoices?: array{default_account_tax_ids?: null|string[], hosted_payment_method_save?: string}, payments?: array{statement_descriptor?: string, statement_descriptor_kana?: string, statement_descriptor_kanji?: string}, payouts?: array{debit_negative_balances?: bool, schedule?: array{delay_days?: array|int|string, interval?: string, monthly_anchor?: int, monthly_payout_days?: int[], weekly_anchor?: string, weekly_payout_days?: string[]}, statement_descriptor?: string}, treasury?: array{tos_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}}, tos_acceptance?: array{date?: int, ip?: string, service_agreement?: string, user_agent?: string}} $params + * @param null|array{account_token?: string, business_profile?: array{annual_revenue?: array{amount: int, currency: string, fiscal_year_end: string}, estimated_worker_count?: int, mcc?: string, minority_owned_business_designation?: string[], monthly_estimated_revenue?: array{amount: int, currency: string}, name?: string, product_description?: string, support_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, support_email?: string, support_phone?: string, support_url?: null|string, url?: string}, business_type?: string, capabilities?: array{acss_debit_payments?: array{requested?: bool}, affirm_payments?: array{requested?: bool}, afterpay_clearpay_payments?: array{requested?: bool}, alma_payments?: array{requested?: bool}, amazon_pay_payments?: array{requested?: bool}, au_becs_debit_payments?: array{requested?: bool}, bacs_debit_payments?: array{requested?: bool}, bancontact_payments?: array{requested?: bool}, bank_transfer_payments?: array{requested?: bool}, billie_payments?: array{requested?: bool}, blik_payments?: array{requested?: bool}, boleto_payments?: array{requested?: bool}, card_issuing?: array{requested?: bool}, card_payments?: array{requested?: bool}, cartes_bancaires_payments?: array{requested?: bool}, cashapp_payments?: array{requested?: bool}, crypto_payments?: array{requested?: bool}, eps_payments?: array{requested?: bool}, fpx_payments?: array{requested?: bool}, gb_bank_transfer_payments?: array{requested?: bool}, giropay_payments?: array{requested?: bool}, grabpay_payments?: array{requested?: bool}, ideal_payments?: array{requested?: bool}, india_international_payments?: array{requested?: bool}, jcb_payments?: array{requested?: bool}, jp_bank_transfer_payments?: array{requested?: bool}, kakao_pay_payments?: array{requested?: bool}, klarna_payments?: array{requested?: bool}, konbini_payments?: array{requested?: bool}, kr_card_payments?: array{requested?: bool}, legacy_payments?: array{requested?: bool}, link_payments?: array{requested?: bool}, mb_way_payments?: array{requested?: bool}, mobilepay_payments?: array{requested?: bool}, multibanco_payments?: array{requested?: bool}, mx_bank_transfer_payments?: array{requested?: bool}, naver_pay_payments?: array{requested?: bool}, nz_bank_account_becs_debit_payments?: array{requested?: bool}, oxxo_payments?: array{requested?: bool}, p24_payments?: array{requested?: bool}, pay_by_bank_payments?: array{requested?: bool}, payco_payments?: array{requested?: bool}, paynow_payments?: array{requested?: bool}, payto_payments?: array{requested?: bool}, pix_payments?: array{requested?: bool}, promptpay_payments?: array{requested?: bool}, revolut_pay_payments?: array{requested?: bool}, samsung_pay_payments?: array{requested?: bool}, satispay_payments?: array{requested?: bool}, sepa_bank_transfer_payments?: array{requested?: bool}, sepa_debit_payments?: array{requested?: bool}, sofort_payments?: array{requested?: bool}, swish_payments?: array{requested?: bool}, tax_reporting_us_1099_k?: array{requested?: bool}, tax_reporting_us_1099_misc?: array{requested?: bool}, transfers?: array{requested?: bool}, treasury?: array{requested?: bool}, twint_payments?: array{requested?: bool}, upi_payments?: array{requested?: bool}, us_bank_account_ach_payments?: array{requested?: bool}, us_bank_transfer_payments?: array{requested?: bool}, zip_payments?: array{requested?: bool}}, company?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, directors_provided?: bool, directorship_declaration?: array{date?: int, ip?: string, user_agent?: string}, executives_provided?: bool, export_license_id?: string, export_purpose_code?: string, name?: string, name_kana?: string, name_kanji?: string, owners_provided?: bool, ownership_declaration?: array{date?: int, ip?: string, user_agent?: string}, ownership_exemption_reason?: null|string, phone?: string, registration_date?: null|array{day: int, month: int, year: int}, registration_number?: string, representative_declaration?: array{date?: int, ip?: string, user_agent?: string}, structure?: null|string, tax_id?: string, tax_id_registrar?: string, vat_id?: string, verification?: array{document?: array{back?: string, front?: string}}}, default_currency?: string, documents?: array{bank_account_ownership_verification?: array{files?: string[]}, company_license?: array{files?: string[]}, company_memorandum_of_association?: array{files?: string[]}, company_ministerial_decree?: array{files?: string[]}, company_registration_verification?: array{files?: string[]}, company_tax_id_verification?: array{files?: string[]}, proof_of_address?: array{files?: string[]}, proof_of_registration?: array{files?: string[], signer?: array{person?: string}}, proof_of_ultimate_beneficial_ownership?: array{files?: string[], signer?: array{person?: string}}}, email?: string, expand?: string[], external_account?: null|array|string, groups?: array{payments_pricing?: null|string}, individual?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, dob?: null|array{day: int, month: int, year: int}, email?: string, first_name?: string, first_name_kana?: string, first_name_kanji?: string, full_name_aliases?: null|string[], gender?: string, id_number?: string, id_number_secondary?: string, last_name?: string, last_name_kana?: string, last_name_kanji?: string, maiden_name?: string, metadata?: null|array, phone?: string, political_exposure?: string, registered_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, relationship?: array{director?: bool, executive?: bool, owner?: bool, percent_ownership?: null|float, title?: string}, ssn_last_4?: string, verification?: array{additional_document?: array{back?: string, front?: string}, document?: array{back?: string, front?: string}}}, metadata?: null|array, settings?: array{bacs_debit_payments?: array{display_name?: string}, branding?: array{icon?: string, logo?: string, primary_color?: string, secondary_color?: string}, card_issuing?: array{tos_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}, card_payments?: array{decline_on?: array{avs_failure?: bool, cvc_failure?: bool}, statement_descriptor_prefix?: string, statement_descriptor_prefix_kana?: null|string, statement_descriptor_prefix_kanji?: null|string}, invoices?: array{default_account_tax_ids?: null|string[], hosted_payment_method_save?: string}, payments?: array{statement_descriptor?: string, statement_descriptor_kana?: string, statement_descriptor_kanji?: string}, payouts?: array{debit_negative_balances?: bool, schedule?: array{delay_days?: array|int|string, interval?: string, monthly_anchor?: int, monthly_payout_days?: int[], weekly_anchor?: string, weekly_payout_days?: string[]}, statement_descriptor?: string}, treasury?: array{tos_acceptance?: array{date?: int, ip?: string, user_agent?: null|string}}}, tos_acceptance?: array{date?: int, ip?: string, service_agreement?: string, user_agent?: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\Account diff --git a/plugins/stripe-php/lib/Service/Checkout/SessionService.php b/plugins/stripe-php/lib/Service/Checkout/SessionService.php index 65bbbc2f..4847fce1 100644 --- a/plugins/stripe-php/lib/Service/Checkout/SessionService.php +++ b/plugins/stripe-php/lib/Service/Checkout/SessionService.php @@ -48,7 +48,7 @@ class SessionService extends \Stripe\Service\AbstractService /** * Creates a Checkout Session object. * - * @param null|array{adaptive_pricing?: array{enabled?: bool}, after_expiration?: array{recovery?: array{allow_promotion_codes?: bool, enabled: bool}}, allow_promotion_codes?: bool, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, billing_address_collection?: string, branding_settings?: array{background_color?: null|string, border_style?: null|string, button_color?: null|string, display_name?: string, font_family?: null|string, icon?: array{file?: string, type: string, url?: string}, logo?: array{file?: string, type: string, url?: string}}, cancel_url?: string, client_reference_id?: string, consent_collection?: array{payment_method_reuse_agreement?: array{position: string}, promotions?: string, terms_of_service?: string}, currency?: string, custom_fields?: array{dropdown?: array{default_value?: string, options: array{label: string, value: string}[]}, key: string, label: array{custom: string, type: string}, numeric?: array{default_value?: string, maximum_length?: int, minimum_length?: int}, optional?: bool, text?: array{default_value?: string, maximum_length?: int, minimum_length?: int}, type: string}[], custom_text?: array{after_submit?: null|array{message: string}, shipping_address?: null|array{message: string}, submit?: null|array{message: string}, terms_of_service_acceptance?: null|array{message: string}}, customer?: string, customer_account?: string, customer_creation?: string, customer_email?: string, customer_update?: array{address?: string, name?: string, shipping?: string}, discounts?: array{coupon?: string, promotion_code?: string}[], excluded_payment_method_types?: string[], expand?: string[], expires_at?: int, invoice_creation?: array{enabled: bool, invoice_data?: array{account_tax_ids?: null|string[], custom_fields?: null|array{name: string, value: string}[], description?: string, footer?: string, issuer?: array{account?: string, type: string}, metadata?: array, rendering_options?: null|array{amount_tax_display?: null|string, template?: string}}}, line_items?: array{adjustable_quantity?: array{enabled: bool, maximum?: int, minimum?: int}, dynamic_tax_rates?: string[], metadata?: array, price?: string, price_data?: array{currency: string, product?: string, product_data?: array{description?: string, images?: string[], metadata?: array, name: string, tax_code?: string, unit_label?: string}, recurring?: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: string[]}[], locale?: string, metadata?: array, mode?: string, name_collection?: array{business?: array{enabled: bool, optional?: bool}, individual?: array{enabled: bool, optional?: bool}}, optional_items?: array{adjustable_quantity?: array{enabled: bool, maximum?: int, minimum?: int}, price: string, quantity: int}[], origin_context?: string, payment_intent_data?: array{application_fee_amount?: int, capture_method?: string, description?: string, metadata?: array, on_behalf_of?: string, receipt_email?: string, setup_future_usage?: string, shipping?: array{address: array{city?: string, country?: string, line1: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name: string, phone?: string, tracking_number?: string}, statement_descriptor?: string, statement_descriptor_suffix?: string, transfer_data?: array{amount?: int, destination: string}, transfer_group?: string}, payment_method_collection?: string, payment_method_configuration?: string, payment_method_data?: array{allow_redisplay?: string}, payment_method_options?: array{acss_debit?: array{currency?: string, mandate_options?: array{custom_mandate_url?: null|string, default_for?: string[], interval_description?: string, payment_schedule?: string, transaction_type?: string}, setup_future_usage?: string, target_date?: string, verification_method?: string}, affirm?: array{capture_method?: string, setup_future_usage?: string}, afterpay_clearpay?: array{capture_method?: string, setup_future_usage?: string}, alipay?: array{setup_future_usage?: string}, alma?: array{capture_method?: string}, amazon_pay?: array{capture_method?: string, setup_future_usage?: string}, au_becs_debit?: array{setup_future_usage?: string, target_date?: string}, bacs_debit?: array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: string, target_date?: string}, bancontact?: array{setup_future_usage?: string}, billie?: array{capture_method?: string}, boleto?: array{expires_after_days?: int, setup_future_usage?: string}, card?: array{capture_method?: string, installments?: array{enabled?: bool}, request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure?: string, restrictions?: array{brands_blocked?: string[]}, setup_future_usage?: string, statement_descriptor_suffix_kana?: string, statement_descriptor_suffix_kanji?: string}, cashapp?: array{capture_method?: string, setup_future_usage?: string}, customer_balance?: array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, requested_address_types?: string[], type: string}, funding_type?: string, setup_future_usage?: string}, demo_pay?: array{setup_future_usage?: string}, eps?: array{setup_future_usage?: string}, fpx?: array{setup_future_usage?: string}, giropay?: array{setup_future_usage?: string}, grabpay?: array{setup_future_usage?: string}, ideal?: array{setup_future_usage?: string}, kakao_pay?: array{capture_method?: string, setup_future_usage?: string}, klarna?: array{capture_method?: string, setup_future_usage?: string, subscriptions?: null|array{interval: string, interval_count?: int, name?: string, next_billing: array{amount: int, date: string}, reference: string}[]}, konbini?: array{expires_after_days?: int, setup_future_usage?: string}, kr_card?: array{capture_method?: string, setup_future_usage?: string}, link?: array{capture_method?: string, setup_future_usage?: string}, mobilepay?: array{capture_method?: string, setup_future_usage?: string}, multibanco?: array{setup_future_usage?: string}, naver_pay?: array{capture_method?: string, setup_future_usage?: string}, oxxo?: array{expires_after_days?: int, setup_future_usage?: string}, p24?: array{setup_future_usage?: string, tos_shown_and_accepted?: bool}, pay_by_bank?: array{}, payco?: array{capture_method?: string}, paynow?: array{setup_future_usage?: string}, paypal?: array{capture_method?: null|string, preferred_locale?: string, reference?: string, risk_correlation_id?: string, setup_future_usage?: null|string}, payto?: array{mandate_options?: array{amount?: null|int, amount_type?: null|string, end_date?: null|string, payment_schedule?: null|string, payments_per_period?: null|int, purpose?: null|string, start_date?: null|string}, setup_future_usage?: string}, pix?: array{amount_includes_iof?: string, expires_after_seconds?: int, setup_future_usage?: string}, revolut_pay?: array{capture_method?: string, setup_future_usage?: string}, samsung_pay?: array{capture_method?: string}, satispay?: array{capture_method?: string}, sepa_debit?: array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: string, target_date?: string}, sofort?: array{setup_future_usage?: string}, swish?: array{reference?: string}, twint?: array{setup_future_usage?: string}, us_bank_account?: array{financial_connections?: array{permissions?: string[], prefetch?: string[]}, setup_future_usage?: string, target_date?: string, verification_method?: string}, wechat_pay?: array{app_id?: string, client: string, setup_future_usage?: string}}, payment_method_types?: string[], permissions?: array{update_shipping_details?: string}, phone_number_collection?: array{enabled: bool}, redirect_on_completion?: string, return_url?: string, saved_payment_method_options?: array{allow_redisplay_filters?: string[], payment_method_remove?: string, payment_method_save?: string}, setup_intent_data?: array{description?: string, metadata?: array, on_behalf_of?: string}, shipping_address_collection?: array{allowed_countries: string[]}, shipping_options?: array{shipping_rate?: string, shipping_rate_data?: array{delivery_estimate?: array{maximum?: array{unit: string, value: int}, minimum?: array{unit: string, value: int}}, display_name: string, fixed_amount?: array{amount: int, currency: string, currency_options?: array}, metadata?: array, tax_behavior?: string, tax_code?: string, type?: string}}[], submit_type?: string, subscription_data?: array{application_fee_percent?: float, billing_cycle_anchor?: int, billing_mode?: array{flexible?: array{proration_discounts?: string}, type: string}, default_tax_rates?: string[], description?: string, invoice_settings?: array{issuer?: array{account?: string, type: string}}, metadata?: array, on_behalf_of?: string, proration_behavior?: string, transfer_data?: array{amount_percent?: float, destination: string}, trial_end?: int, trial_period_days?: int, trial_settings?: array{end_behavior: array{missing_payment_method: string}}}, success_url?: string, tax_id_collection?: array{enabled: bool, required?: string}, ui_mode?: string, wallet_options?: array{link?: array{display?: string}}} $params + * @param null|array{adaptive_pricing?: array{enabled?: bool}, after_expiration?: array{recovery?: array{allow_promotion_codes?: bool, enabled: bool}}, allow_promotion_codes?: bool, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, billing_address_collection?: string, branding_settings?: array{background_color?: null|string, border_style?: null|string, button_color?: null|string, display_name?: string, font_family?: null|string, icon?: array{file?: string, type: string, url?: string}, logo?: array{file?: string, type: string, url?: string}}, cancel_url?: string, client_reference_id?: string, consent_collection?: array{payment_method_reuse_agreement?: array{position: string}, promotions?: string, terms_of_service?: string}, currency?: string, custom_fields?: array{dropdown?: array{default_value?: string, options: array{label: string, value: string}[]}, key: string, label: array{custom: string, type: string}, numeric?: array{default_value?: string, maximum_length?: int, minimum_length?: int}, optional?: bool, text?: array{default_value?: string, maximum_length?: int, minimum_length?: int}, type: string}[], custom_text?: array{after_submit?: null|array{message: string}, shipping_address?: null|array{message: string}, submit?: null|array{message: string}, terms_of_service_acceptance?: null|array{message: string}}, customer?: string, customer_account?: string, customer_creation?: string, customer_email?: string, customer_update?: array{address?: string, name?: string, shipping?: string}, discounts?: array{coupon?: string, promotion_code?: string}[], excluded_payment_method_types?: string[], expand?: string[], expires_at?: int, integration_identifier?: string, invoice_creation?: array{enabled: bool, invoice_data?: array{account_tax_ids?: null|string[], custom_fields?: null|array{name: string, value: string}[], description?: string, footer?: string, issuer?: array{account?: string, type: string}, metadata?: array, rendering_options?: null|array{amount_tax_display?: null|string, template?: string}}}, line_items?: array{adjustable_quantity?: array{enabled: bool, maximum?: int, minimum?: int}, dynamic_tax_rates?: string[], metadata?: array, price?: string, price_data?: array{currency: string, product?: string, product_data?: array{description?: string, images?: string[], metadata?: array, name: string, tax_code?: string, unit_label?: string}, recurring?: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: string[]}[], locale?: string, metadata?: array, mode?: string, name_collection?: array{business?: array{enabled: bool, optional?: bool}, individual?: array{enabled: bool, optional?: bool}}, optional_items?: array{adjustable_quantity?: array{enabled: bool, maximum?: int, minimum?: int}, price: string, quantity: int}[], origin_context?: string, payment_intent_data?: array{application_fee_amount?: int, capture_method?: string, description?: string, metadata?: array, on_behalf_of?: string, receipt_email?: string, setup_future_usage?: string, shipping?: array{address: array{city?: string, country?: string, line1: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name: string, phone?: string, tracking_number?: string}, statement_descriptor?: string, statement_descriptor_suffix?: string, transfer_data?: array{amount?: int, destination: string}, transfer_group?: string}, payment_method_collection?: string, payment_method_configuration?: string, payment_method_data?: array{allow_redisplay?: string}, payment_method_options?: array{acss_debit?: array{currency?: string, mandate_options?: array{custom_mandate_url?: null|string, default_for?: string[], interval_description?: string, payment_schedule?: string, transaction_type?: string}, setup_future_usage?: string, target_date?: string, verification_method?: string}, affirm?: array{capture_method?: string, setup_future_usage?: string}, afterpay_clearpay?: array{capture_method?: string, setup_future_usage?: string}, alipay?: array{setup_future_usage?: string}, alma?: array{capture_method?: string}, amazon_pay?: array{capture_method?: string, setup_future_usage?: string}, au_becs_debit?: array{setup_future_usage?: string, target_date?: string}, bacs_debit?: array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: string, target_date?: string}, bancontact?: array{setup_future_usage?: string}, billie?: array{capture_method?: string}, boleto?: array{expires_after_days?: int, setup_future_usage?: string}, card?: array{capture_method?: string, installments?: array{enabled?: bool}, request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure?: string, restrictions?: array{brands_blocked?: string[]}, setup_future_usage?: string, statement_descriptor_suffix_kana?: string, statement_descriptor_suffix_kanji?: string}, cashapp?: array{capture_method?: string, setup_future_usage?: string}, crypto?: array{setup_future_usage?: string}, customer_balance?: array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, requested_address_types?: string[], type: string}, funding_type?: string, setup_future_usage?: string}, demo_pay?: array{setup_future_usage?: string}, eps?: array{setup_future_usage?: string}, fpx?: array{setup_future_usage?: string}, giropay?: array{setup_future_usage?: string}, grabpay?: array{setup_future_usage?: string}, ideal?: array{setup_future_usage?: string}, kakao_pay?: array{capture_method?: string, setup_future_usage?: string}, klarna?: array{capture_method?: string, setup_future_usage?: string, subscriptions?: null|array{interval: string, interval_count?: int, name?: string, next_billing: array{amount: int, date: string}, reference: string}[]}, konbini?: array{expires_after_days?: int, setup_future_usage?: string}, kr_card?: array{capture_method?: string, setup_future_usage?: string}, link?: array{capture_method?: string, setup_future_usage?: string}, mobilepay?: array{capture_method?: string, setup_future_usage?: string}, multibanco?: array{setup_future_usage?: string}, naver_pay?: array{capture_method?: string, setup_future_usage?: string}, oxxo?: array{expires_after_days?: int, setup_future_usage?: string}, p24?: array{setup_future_usage?: string, tos_shown_and_accepted?: bool}, pay_by_bank?: array{}, payco?: array{capture_method?: string}, paynow?: array{setup_future_usage?: string}, paypal?: array{capture_method?: null|string, preferred_locale?: string, reference?: string, risk_correlation_id?: string, setup_future_usage?: null|string}, payto?: array{mandate_options?: array{amount?: null|int, amount_type?: null|string, end_date?: null|string, payment_schedule?: null|string, payments_per_period?: null|int, purpose?: null|string, start_date?: null|string}, setup_future_usage?: string}, pix?: array{amount_includes_iof?: string, expires_after_seconds?: int, setup_future_usage?: string}, revolut_pay?: array{capture_method?: string, setup_future_usage?: string}, samsung_pay?: array{capture_method?: string}, satispay?: array{capture_method?: string}, sepa_debit?: array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: string, target_date?: string}, sofort?: array{setup_future_usage?: string}, swish?: array{reference?: string}, twint?: array{setup_future_usage?: string}, upi?: array{mandate_options?: array{amount?: int, amount_type?: string, description?: string, end_date?: int}, setup_future_usage?: null|string}, us_bank_account?: array{financial_connections?: array{permissions?: string[], prefetch?: string[]}, setup_future_usage?: string, target_date?: string, verification_method?: string}, wechat_pay?: array{app_id?: string, client: string, setup_future_usage?: string}}, payment_method_types?: string[], permissions?: array{update_shipping_details?: string}, phone_number_collection?: array{enabled: bool}, redirect_on_completion?: string, return_url?: string, saved_payment_method_options?: array{allow_redisplay_filters?: string[], payment_method_remove?: string, payment_method_save?: string}, setup_intent_data?: array{description?: string, metadata?: array, on_behalf_of?: string}, shipping_address_collection?: array{allowed_countries: string[]}, shipping_options?: array{shipping_rate?: string, shipping_rate_data?: array{delivery_estimate?: array{maximum?: array{unit: string, value: int}, minimum?: array{unit: string, value: int}}, display_name: string, fixed_amount?: array{amount: int, currency: string, currency_options?: array}, metadata?: array, tax_behavior?: string, tax_code?: string, type?: string}}[], submit_type?: string, subscription_data?: array{application_fee_percent?: float, billing_cycle_anchor?: int, billing_mode?: array{flexible?: array{proration_discounts?: string}, type: string}, default_tax_rates?: string[], description?: string, invoice_settings?: array{issuer?: array{account?: string, type: string}}, metadata?: array, on_behalf_of?: string, pending_invoice_item_interval?: array{interval: string, interval_count?: int}, proration_behavior?: string, transfer_data?: array{amount_percent?: float, destination: string}, trial_end?: int, trial_period_days?: int, trial_settings?: array{end_behavior: array{missing_payment_method: string}}}, success_url?: string, tax_id_collection?: array{enabled: bool, required?: string}, ui_mode?: string, wallet_options?: array{link?: array{display?: string}}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\Checkout\Session diff --git a/plugins/stripe-php/lib/Service/CreditNoteService.php b/plugins/stripe-php/lib/Service/CreditNoteService.php index b1b7a263..72f02014 100644 --- a/plugins/stripe-php/lib/Service/CreditNoteService.php +++ b/plugins/stripe-php/lib/Service/CreditNoteService.php @@ -67,7 +67,7 @@ class CreditNoteService extends AbstractService * post_payment_credit_notes_amount, or both, depending on the * invoice’s amount_remaining at the time of credit note creation. * - * @param null|array{amount?: int, credit_amount?: int, effective_at?: int, email_type?: string, expand?: string[], invoice: string, lines?: (array{amount?: int, description?: string, invoice_line_item?: string, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate: string, taxable_amount: int}[], tax_rates?: null|string[], type: string, unit_amount?: int, unit_amount_decimal?: string})[], memo?: string, metadata?: array, out_of_band_amount?: int, reason?: string, refund_amount?: int, refunds?: array{amount_refunded?: int, payment_record_refund?: array{payment_record: string, refund_group: string}, refund?: string, type?: string}[], shipping_cost?: array{shipping_rate?: string}} $params + * @param null|array{amount?: int, credit_amount?: int, effective_at?: int, email_type?: string, expand?: string[], invoice: string, lines?: (array{amount?: int, description?: string, invoice_line_item?: string, metadata?: array, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate: string, taxable_amount: int}[], tax_rates?: null|string[], type: string, unit_amount?: int, unit_amount_decimal?: string})[], memo?: string, metadata?: array, out_of_band_amount?: int, reason?: string, refund_amount?: int, refunds?: array{amount_refunded?: int, payment_record_refund?: array{payment_record: string, refund_group: string}, refund?: string, type?: string}[], shipping_cost?: array{shipping_rate?: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\CreditNote @@ -82,7 +82,7 @@ class CreditNoteService extends AbstractService /** * Get a preview of a credit note without creating it. * - * @param null|array{amount?: int, credit_amount?: int, effective_at?: int, email_type?: string, expand?: string[], invoice: string, lines?: (array{amount?: int, description?: string, invoice_line_item?: string, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate: string, taxable_amount: int}[], tax_rates?: null|string[], type: string, unit_amount?: int, unit_amount_decimal?: string})[], memo?: string, metadata?: array, out_of_band_amount?: int, reason?: string, refund_amount?: int, refunds?: array{amount_refunded?: int, payment_record_refund?: array{payment_record: string, refund_group: string}, refund?: string, type?: string}[], shipping_cost?: array{shipping_rate?: string}} $params + * @param null|array{amount?: int, credit_amount?: int, effective_at?: int, email_type?: string, expand?: string[], invoice: string, lines?: (array{amount?: int, description?: string, invoice_line_item?: string, metadata?: array, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate: string, taxable_amount: int}[], tax_rates?: null|string[], type: string, unit_amount?: int, unit_amount_decimal?: string})[], memo?: string, metadata?: array, out_of_band_amount?: int, reason?: string, refund_amount?: int, refunds?: array{amount_refunded?: int, payment_record_refund?: array{payment_record: string, refund_group: string}, refund?: string, type?: string}[], shipping_cost?: array{shipping_rate?: string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\CreditNote @@ -99,7 +99,7 @@ class CreditNoteService extends AbstractService * property containing the first handful of those items. This URL you can retrieve * the full (paginated) list of line items. * - * @param null|array{amount?: int, credit_amount?: int, effective_at?: int, email_type?: string, ending_before?: string, expand?: string[], invoice: string, limit?: int, lines?: (array{amount?: int, description?: string, invoice_line_item?: string, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate: string, taxable_amount: int}[], tax_rates?: null|string[], type: string, unit_amount?: int, unit_amount_decimal?: string})[], memo?: string, metadata?: array, out_of_band_amount?: int, reason?: string, refund_amount?: int, refunds?: array{amount_refunded?: int, payment_record_refund?: array{payment_record: string, refund_group: string}, refund?: string, type?: string}[], shipping_cost?: array{shipping_rate?: string}, starting_after?: string} $params + * @param null|array{amount?: int, credit_amount?: int, effective_at?: int, email_type?: string, ending_before?: string, expand?: string[], invoice: string, limit?: int, lines?: (array{amount?: int, description?: string, invoice_line_item?: string, metadata?: array, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate: string, taxable_amount: int}[], tax_rates?: null|string[], type: string, unit_amount?: int, unit_amount_decimal?: string})[], memo?: string, metadata?: array, out_of_band_amount?: int, reason?: string, refund_amount?: int, refunds?: array{amount_refunded?: int, payment_record_refund?: array{payment_record: string, refund_group: string}, refund?: string, type?: string}[], shipping_cost?: array{shipping_rate?: string}, starting_after?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\Collection<\Stripe\CreditNoteLineItem> diff --git a/plugins/stripe-php/lib/Service/CustomerService.php b/plugins/stripe-php/lib/Service/CustomerService.php index 63a4548d..d9e388df 100644 --- a/plugins/stripe-php/lib/Service/CustomerService.php +++ b/plugins/stripe-php/lib/Service/CustomerService.php @@ -167,7 +167,7 @@ class CustomerService extends AbstractService * * If the card’s owner has no default card, then the new card will become the * default. However, if the owner already has a default, then it will not change. - * To change the default, you should update the + * To change the default, you should update the * customer to have a new default_source. * * @param string $parentId diff --git a/plugins/stripe-php/lib/Service/InvoiceItemService.php b/plugins/stripe-php/lib/Service/InvoiceItemService.php index 07edc946..72b32e34 100644 --- a/plugins/stripe-php/lib/Service/InvoiceItemService.php +++ b/plugins/stripe-php/lib/Service/InvoiceItemService.php @@ -32,7 +32,7 @@ class InvoiceItemService extends AbstractService * no invoice is specified, the item will be on the next invoice created for the * customer specified. * - * @param null|array{amount?: int, currency?: string, customer?: string, customer_account?: string, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], invoice?: string, metadata?: null|array, period?: array{end: int, start: int}, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, subscription?: string, tax_behavior?: string, tax_code?: null|string, tax_rates?: string[], unit_amount_decimal?: string} $params + * @param null|array{amount?: int, currency?: string, customer?: string, customer_account?: string, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], invoice?: string, metadata?: null|array, period?: array{end: int, start: int}, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, quantity_decimal?: string, subscription?: string, tax_behavior?: string, tax_code?: null|string, tax_rates?: string[], unit_amount_decimal?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\InvoiceItem @@ -84,7 +84,7 @@ class InvoiceItemService extends AbstractService * closed. * * @param string $id - * @param null|array{amount?: int, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], metadata?: null|array, period?: array{end: int, start: int}, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, tax_behavior?: string, tax_code?: null|string, tax_rates?: null|string[], unit_amount_decimal?: string} $params + * @param null|array{amount?: int, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], metadata?: null|array, period?: array{end: int, start: int}, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, quantity_decimal?: string, tax_behavior?: string, tax_code?: null|string, tax_rates?: null|string[], unit_amount_decimal?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\InvoiceItem diff --git a/plugins/stripe-php/lib/Service/InvoiceService.php b/plugins/stripe-php/lib/Service/InvoiceService.php index a531c104..89f8d99d 100644 --- a/plugins/stripe-php/lib/Service/InvoiceService.php +++ b/plugins/stripe-php/lib/Service/InvoiceService.php @@ -16,7 +16,7 @@ class InvoiceService extends AbstractService * still a draft. * * @param string $id - * @param null|array{expand?: string[], invoice_metadata?: null|array, lines: (array{amount?: int, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], invoice_item?: string, metadata?: null|array, period?: array{end: int, start: int}, price_data?: array{currency: string, product?: string, product_data?: array{description?: string, images?: string[], metadata?: array, name: string, tax_code?: string, unit_label?: string}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate_data: array{country?: string, description?: string, display_name: string, inclusive: bool, jurisdiction?: string, jurisdiction_level?: string, percentage: float, state?: string, tax_type?: string}, taxability_reason?: string, taxable_amount: int}[], tax_rates?: null|string[]})[]} $params + * @param null|array{expand?: string[], invoice_metadata?: null|array, lines: (array{amount?: int, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], invoice_item?: string, metadata?: null|array, period?: array{end: int, start: int}, price_data?: array{currency: string, product?: string, product_data?: array{description?: string, images?: string[], metadata?: array, name: string, tax_code?: string, unit_label?: string}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, quantity_decimal?: string, tax_amounts?: null|array{amount: int, tax_rate_data: array{country?: string, description?: string, display_name: string, inclusive: bool, jurisdiction?: string, jurisdiction_level?: string, percentage: float, state?: string, tax_type?: string}, taxability_reason?: string, taxable_amount: int}[], tax_rates?: null|string[]})[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\Invoice @@ -94,8 +94,8 @@ class InvoiceService extends AbstractService /** * This endpoint creates a draft invoice for a given customer. The invoice remains - * a draft until you finalize the invoice, which - * allows you to pay or finalize the invoice, + * which allows you to pay or send the invoice to your customers. * * @param null|array{account_tax_ids?: null|string[], application_fee_amount?: int, auto_advance?: bool, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, automatically_finalizes_at?: int, collection_method?: string, currency?: string, custom_fields?: null|array{name: string, value: string}[], customer?: string, customer_account?: string, days_until_due?: int, default_payment_method?: string, default_source?: string, default_tax_rates?: string[], description?: string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], due_date?: int, effective_at?: int, expand?: string[], footer?: string, from_invoice?: array{action: string, invoice: string}, issuer?: array{account?: string, type: string}, metadata?: null|array, number?: string, on_behalf_of?: string, payment_settings?: array{default_mandate?: null|string, payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{transaction_type?: string}, verification_method?: string}, bancontact?: null|array{preferred_language?: string}, card?: null|array{installments?: array{enabled?: bool, plan?: null|array{count?: int, interval?: string, type: string}}, request_three_d_secure?: string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, type?: string}, funding_type?: string}, konbini?: null|array{}, payto?: null|array{mandate_options?: array{amount?: int, purpose?: string}}, sepa_debit?: null|array{}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[]}, verification_method?: string}}, payment_method_types?: null|string[]}, pending_invoice_items_behavior?: string, rendering?: array{amount_tax_display?: null|string, pdf?: array{page_size?: string}, template?: string, template_version?: null|int}, shipping_cost?: array{shipping_rate?: string, shipping_rate_data?: array{delivery_estimate?: array{maximum?: array{unit: string, value: int}, minimum?: array{unit: string, value: int}}, display_name: string, fixed_amount?: array{amount: int, currency: string, currency_options?: array}, metadata?: array, tax_behavior?: string, tax_code?: string, type?: string}}, shipping_details?: array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name: string, phone?: null|string}, statement_descriptor?: string, subscription?: string, transfer_data?: array{amount?: int, destination: string}} $params @@ -139,7 +139,7 @@ class InvoiceService extends AbstractService * invoice creation. Learn * more * - * @param null|array{automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, currency?: string, customer?: string, customer_account?: string, customer_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, shipping?: null|array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name: string, phone?: string}, tax?: array{ip_address?: null|string}, tax_exempt?: null|string, tax_ids?: array{type: string, value: string}[]}, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], invoice_items?: (array{amount?: int, currency?: string, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], invoiceitem?: string, metadata?: null|array, period?: array{end: int, start: int}, price?: string, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_behavior?: string, tax_code?: null|string, tax_rates?: null|string[], unit_amount?: int, unit_amount_decimal?: string})[], issuer?: array{account?: string, type: string}, on_behalf_of?: null|string, preview_mode?: string, schedule?: string, schedule_details?: array{billing_mode?: array{flexible?: array{proration_discounts?: string}, type: string}, end_behavior?: string, phases?: (array{add_invoice_items?: (array{discounts?: array{coupon?: string, discount?: string, promotion_code?: string}[], metadata?: array, period?: array{end: array{timestamp?: int, type: string}, start: array{timestamp?: int, type: string}}, price?: string, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], application_fee_percent?: float, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, billing_cycle_anchor?: string, billing_thresholds?: null|array{amount_gte?: int, reset_billing_cycle_anchor?: bool}, collection_method?: string, currency?: string, default_payment_method?: string, default_tax_rates?: null|string[], description?: null|string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], duration?: array{interval: string, interval_count?: int}, end_date?: array|int|string, invoice_settings?: array{account_tax_ids?: null|string[], days_until_due?: int, issuer?: array{account?: string, type: string}}, items: (array{billing_thresholds?: null|array{usage_gte: int}, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], metadata?: array, plan?: string, price?: string, price_data?: array{currency: string, product: string, recurring: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], metadata?: array, on_behalf_of?: string, proration_behavior?: string, start_date?: array|int|string, transfer_data?: array{amount_percent?: float, destination: string}, trial?: bool, trial_end?: array|int|string})[], proration_behavior?: string}, subscription?: string, subscription_details?: array{billing_cycle_anchor?: array|int|string, billing_mode?: array{flexible?: array{proration_discounts?: string}, type: string}, cancel_at?: null|array|int|string, cancel_at_period_end?: bool, cancel_now?: bool, default_tax_rates?: null|string[], items?: (array{billing_thresholds?: null|array{usage_gte: int}, clear_usage?: bool, deleted?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], id?: string, metadata?: null|array, plan?: string, price?: string, price_data?: array{currency: string, product: string, recurring: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], proration_behavior?: string, proration_date?: int, resume_at?: string, start_date?: int, trial_end?: array|int|string}} $params + * @param null|array{automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, currency?: string, customer?: string, customer_account?: string, customer_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, shipping?: null|array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name: string, phone?: string}, tax?: array{ip_address?: null|string}, tax_exempt?: null|string, tax_ids?: array{type: string, value: string}[]}, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], invoice_items?: (array{amount?: int, currency?: string, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], invoiceitem?: string, metadata?: null|array, period?: array{end: int, start: int}, price?: string, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, quantity_decimal?: string, tax_behavior?: string, tax_code?: null|string, tax_rates?: null|string[], unit_amount?: int, unit_amount_decimal?: string})[], issuer?: array{account?: string, type: string}, on_behalf_of?: null|string, preview_mode?: string, schedule?: string, schedule_details?: array{billing_mode?: array{flexible?: array{proration_discounts?: string}, type: string}, end_behavior?: string, phases?: (array{add_invoice_items?: (array{discounts?: array{coupon?: string, discount?: string, promotion_code?: string}[], metadata?: array, period?: array{end: array{timestamp?: int, type: string}, start: array{timestamp?: int, type: string}}, price?: string, price_data?: array{currency: string, product: string, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], application_fee_percent?: float, automatic_tax?: array{enabled: bool, liability?: array{account?: string, type: string}}, billing_cycle_anchor?: string, billing_thresholds?: null|array{amount_gte?: int, reset_billing_cycle_anchor?: bool}, collection_method?: string, currency?: string, default_payment_method?: string, default_tax_rates?: null|string[], description?: null|string, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], duration?: array{interval: string, interval_count?: int}, end_date?: array|int|string, invoice_settings?: array{account_tax_ids?: null|string[], days_until_due?: int, issuer?: array{account?: string, type: string}}, items: (array{billing_thresholds?: null|array{usage_gte: int}, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], metadata?: array, plan?: string, price?: string, price_data?: array{currency: string, product: string, recurring: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], metadata?: array, on_behalf_of?: string, proration_behavior?: string, start_date?: array|int|string, transfer_data?: array{amount_percent?: float, destination: string}, trial?: bool, trial_end?: array|int|string})[], proration_behavior?: string}, subscription?: string, subscription_details?: array{billing_cycle_anchor?: array|int|string, billing_mode?: array{flexible?: array{proration_discounts?: string}, type: string}, cancel_at?: null|array|int|string, cancel_at_period_end?: bool, cancel_now?: bool, default_tax_rates?: null|string[], items?: (array{billing_thresholds?: null|array{usage_gte: int}, clear_usage?: bool, deleted?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], id?: string, metadata?: null|array, plan?: string, price?: string, price_data?: array{currency: string, product: string, recurring: array{interval: string, interval_count?: int}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, quantity?: int, tax_rates?: null|string[]})[], proration_behavior?: string, proration_date?: int, resume_at?: string, start_date?: int, trial_end?: array|int|string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\Invoice @@ -155,7 +155,7 @@ class InvoiceService extends AbstractService * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to * delete invoices that are no longer in a draft state will fail; once an invoice * has been finalized or if an invoice is for a subscription, it must be voided. + * href="/api/invoices/void">voided. * * @param string $id * @param null|array $params @@ -334,7 +334,7 @@ class InvoiceService extends AbstractService * * @param string $parentId * @param string $id - * @param null|array{amount?: int, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], metadata?: null|array, period?: array{end: int, start: int}, price_data?: array{currency: string, product?: string, product_data?: array{description?: string, images?: string[], metadata?: array, name: string, tax_code?: string, unit_label?: string}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate_data: array{country?: string, description?: string, display_name: string, inclusive: bool, jurisdiction?: string, jurisdiction_level?: string, percentage: float, state?: string, tax_type?: string}, taxability_reason?: string, taxable_amount: int}[], tax_rates?: null|string[]} $params + * @param null|array{amount?: int, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], expand?: string[], metadata?: null|array, period?: array{end: int, start: int}, price_data?: array{currency: string, product?: string, product_data?: array{description?: string, images?: string[], metadata?: array, name: string, tax_code?: string, unit_label?: string}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, quantity_decimal?: string, tax_amounts?: null|array{amount: int, tax_rate_data: array{country?: string, description?: string, display_name: string, inclusive: bool, jurisdiction?: string, jurisdiction_level?: string, percentage: float, state?: string, tax_type?: string}, taxability_reason?: string, taxable_amount: int}[], tax_rates?: null|string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\InvoiceLineItem @@ -351,7 +351,7 @@ class InvoiceService extends AbstractService * is still a draft. * * @param string $id - * @param null|array{expand?: string[], invoice_metadata?: null|array, lines: (array{amount?: int, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], id: string, metadata?: null|array, period?: array{end: int, start: int}, price_data?: array{currency: string, product?: string, product_data?: array{description?: string, images?: string[], metadata?: array, name: string, tax_code?: string, unit_label?: string}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate_data: array{country?: string, description?: string, display_name: string, inclusive: bool, jurisdiction?: string, jurisdiction_level?: string, percentage: float, state?: string, tax_type?: string}, taxability_reason?: string, taxable_amount: int}[], tax_rates?: null|string[]})[]} $params + * @param null|array{expand?: string[], invoice_metadata?: null|array, lines: (array{amount?: int, description?: string, discountable?: bool, discounts?: null|array{coupon?: string, discount?: string, promotion_code?: string}[], id: string, metadata?: null|array, period?: array{end: int, start: int}, price_data?: array{currency: string, product?: string, product_data?: array{description?: string, images?: string[], metadata?: array, name: string, tax_code?: string, unit_label?: string}, tax_behavior?: string, unit_amount?: int, unit_amount_decimal?: string}, pricing?: array{price?: string}, quantity?: int, quantity_decimal?: string, tax_amounts?: null|array{amount: int, tax_rate_data: array{country?: string, description?: string, display_name: string, inclusive: bool, jurisdiction?: string, jurisdiction_level?: string, percentage: float, state?: string, tax_type?: string}, taxability_reason?: string, taxable_amount: int}[], tax_rates?: null|string[]})[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\Invoice @@ -365,15 +365,15 @@ class InvoiceService extends AbstractService /** * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is - * similar to deletion, however it only applies to - * finalized invoices and maintains a papertrail where the invoice can still be + * similar to deletion, however it only applies + * to finalized invoices and maintains a papertrail where the invoice can still be * found. * * Consult with local regulations to determine whether and how an invoice might be * amended, canceled, or voided in the jurisdiction you’re doing business in. You - * might need to issue another invoice or credit note instead. Stripe recommends that you - * consult with your legal counsel for advice specific to your business. + * might need to issue another invoice or credit note instead. Stripe recommends that + * you consult with your legal counsel for advice specific to your business. * * @param string $id * @param null|array{expand?: string[]} $params diff --git a/plugins/stripe-php/lib/Service/Issuing/CardService.php b/plugins/stripe-php/lib/Service/Issuing/CardService.php index 23dfd408..f8176759 100644 --- a/plugins/stripe-php/lib/Service/Issuing/CardService.php +++ b/plugins/stripe-php/lib/Service/Issuing/CardService.php @@ -31,7 +31,7 @@ class CardService extends \Stripe\Service\AbstractService /** * Creates an Issuing Card object. * - * @param null|array{cardholder?: string, currency: string, exp_month?: int, exp_year?: int, expand?: string[], financial_account?: string, metadata?: array, personalization_design?: string, pin?: array{encrypted_number?: string}, replacement_for?: string, replacement_reason?: string, second_line?: null|string, shipping?: array{address: array{city: string, country: string, line1: string, line2?: string, postal_code: string, state?: string}, address_validation?: array{mode: string}, customs?: array{eori_number?: string}, name: string, phone_number?: string, require_signature?: bool, service?: string, type?: string}, spending_controls?: array{allowed_categories?: string[], allowed_merchant_countries?: string[], blocked_categories?: string[], blocked_merchant_countries?: string[], spending_limits?: array{amount: int, categories?: string[], interval: string}[]}, status?: string, type: string} $params + * @param null|array{cardholder?: string, currency: string, exp_month?: int, exp_year?: int, expand?: string[], financial_account?: string, lifecycle_controls?: array{cancel_after: array{payment_count: int}}, metadata?: array, personalization_design?: string, pin?: array{encrypted_number?: string}, replacement_for?: string, replacement_reason?: string, second_line?: null|string, shipping?: array{address: array{city: string, country: string, line1: string, line2?: string, postal_code: string, state?: string}, address_validation?: array{mode: string}, customs?: array{eori_number?: string}, name: string, phone_number?: string, require_signature?: bool, service?: string, type?: string}, spending_controls?: array{allowed_categories?: string[], allowed_merchant_countries?: string[], blocked_categories?: string[], blocked_merchant_countries?: string[], spending_limits?: array{amount: int, categories?: string[], interval: string}[]}, status?: string, type: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\Issuing\Card diff --git a/plugins/stripe-php/lib/Service/PaymentIntentService.php b/plugins/stripe-php/lib/Service/PaymentIntentService.php index ecc1619d..d8d067f9 100644 --- a/plugins/stripe-php/lib/Service/PaymentIntentService.php +++ b/plugins/stripe-php/lib/Service/PaymentIntentService.php @@ -70,9 +70,9 @@ class PaymentIntentService extends AbstractService * status of requires_capture, the remaining * amount_capturable is automatically refunded. * - * You can’t cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead. + * You can directly cancel the PaymentIntent for a Checkout Session only when the + * PaymentIntent has a status of requires_capture. Otherwise, you must + * expire the Checkout Session. * * @param string $id * @param null|array{cancellation_reason?: string, expand?: string[]} $params @@ -144,7 +144,7 @@ class PaymentIntentService extends AbstractService * transition the PaymentIntent to the canceled state. * * @param string $id - * @param null|array{amount_details?: null|array{discount_amount?: null|int, enforce_arithmetic_validation?: bool, line_items?: null|array{discount_amount?: int, payment_method_options?: array{card?: array{commodity_code?: string}, card_present?: array{commodity_code?: string}, klarna?: array{image_url?: string, product_url?: string, reference?: string, subscription_reference?: string}, paypal?: array{category?: string, description?: string, sold_by?: string}}, product_code?: string, product_name: string, quantity: int, tax?: array{total_tax_amount: int}, unit_cost: int, unit_of_measure?: string}[], shipping?: null|array{amount?: null|int, from_postal_code?: null|string, to_postal_code?: null|string}, tax?: null|array{total_tax_amount: int}}, capture_method?: string, confirmation_token?: string, error_on_requires_action?: bool, excluded_payment_method_types?: null|string[], expand?: string[], hooks?: array{inputs?: array{tax?: array{calculation: null|string}}}, mandate?: string, mandate_data?: null|array{customer_acceptance?: array{accepted_at?: int, offline?: array{}, online?: array{ip_address?: string, user_agent?: string}, type: string}}, off_session?: array|bool|string, payment_details?: null|array{customer_reference?: null|string, order_reference?: null|string}, payment_method?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, crypto?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{custom_mandate_url?: null|string, interval_description?: string, payment_schedule?: string, transaction_type?: string}, setup_future_usage?: null|string, target_date?: string, verification_method?: string}, affirm?: null|array{capture_method?: null|string, preferred_locale?: string, setup_future_usage?: string}, afterpay_clearpay?: null|array{capture_method?: null|string, reference?: string, setup_future_usage?: string}, alipay?: null|array{setup_future_usage?: null|string}, alma?: null|array{capture_method?: null|string}, amazon_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, au_becs_debit?: null|array{setup_future_usage?: null|string, target_date?: string}, bacs_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, bancontact?: null|array{preferred_language?: string, setup_future_usage?: null|string}, billie?: null|array{capture_method?: null|string}, blik?: null|array{code?: string, setup_future_usage?: null|string}, boleto?: null|array{expires_after_days?: int, setup_future_usage?: null|string}, card?: null|array{capture_method?: null|string, cvc_token?: string, installments?: array{enabled?: bool, plan?: null|array{count?: int, interval?: string, type: string}}, mandate_options?: array{amount: int, amount_type: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure?: string, require_cvc_recollection?: bool, setup_future_usage?: null|string, statement_descriptor_suffix_kana?: null|string, statement_descriptor_suffix_kanji?: null|string, three_d_secure?: array{ares_trans_status?: string, cryptogram: string, electronic_commerce_indicator?: string, exemption_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id: string, version: string}}, card_present?: null|array{capture_method?: string, request_extended_authorization?: bool, request_incremental_authorization_support?: bool, routing?: array{requested_priority?: string}}, cashapp?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, crypto?: null|array{setup_future_usage?: string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, requested_address_types?: string[], type: string}, funding_type?: string, setup_future_usage?: string}, eps?: null|array{setup_future_usage?: string}, fpx?: null|array{setup_future_usage?: string}, giropay?: null|array{setup_future_usage?: string}, grabpay?: null|array{setup_future_usage?: string}, ideal?: null|array{setup_future_usage?: null|string}, interac_present?: null|array{}, kakao_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, klarna?: null|array{capture_method?: null|string, on_demand?: array{average_amount?: int, maximum_amount?: int, minimum_amount?: int, purchase_interval?: string, purchase_interval_count?: int}, preferred_locale?: string, setup_future_usage?: string, subscriptions?: null|array{interval: string, interval_count?: int, name?: string, next_billing?: array{amount: int, date: string}, reference: string}[]}, konbini?: null|array{confirmation_number?: null|string, expires_after_days?: null|int, expires_at?: null|int, product_description?: null|string, setup_future_usage?: string}, kr_card?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, link?: null|array{capture_method?: null|string, persistent_token?: string, setup_future_usage?: null|string}, mb_way?: null|array{setup_future_usage?: string}, mobilepay?: null|array{capture_method?: null|string, setup_future_usage?: string}, multibanco?: null|array{setup_future_usage?: string}, naver_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, nz_bank_account?: null|array{setup_future_usage?: null|string, target_date?: string}, oxxo?: null|array{expires_after_days?: int, setup_future_usage?: string}, p24?: null|array{setup_future_usage?: string, tos_shown_and_accepted?: bool}, pay_by_bank?: null|array{}, payco?: null|array{capture_method?: null|string}, paynow?: null|array{setup_future_usage?: string}, paypal?: null|array{capture_method?: null|string, preferred_locale?: string, reference?: string, risk_correlation_id?: string, setup_future_usage?: null|string}, payto?: null|array{mandate_options?: array{amount?: null|int, amount_type?: null|string, end_date?: null|string, payment_schedule?: null|string, payments_per_period?: null|int, purpose?: null|string}, setup_future_usage?: null|string}, pix?: null|array{amount_includes_iof?: string, expires_after_seconds?: int, expires_at?: int, setup_future_usage?: string}, promptpay?: null|array{setup_future_usage?: string}, revolut_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, samsung_pay?: null|array{capture_method?: null|string}, satispay?: null|array{capture_method?: null|string}, sepa_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, sofort?: null|array{preferred_language?: null|string, setup_future_usage?: null|string}, swish?: null|array{reference?: null|string, setup_future_usage?: string}, twint?: null|array{setup_future_usage?: string}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, setup_future_usage?: null|string, target_date?: string, transaction_purpose?: null|string, verification_method?: string, preferred_settlement_speed?: null|string}, wechat_pay?: null|array{app_id?: string, client?: string, setup_future_usage?: string}, zip?: null|array{setup_future_usage?: string}}, payment_method_types?: string[], radar_options?: array{session?: string}, receipt_email?: null|string, return_url?: string, setup_future_usage?: null|string, shipping?: null|array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name: string, phone?: string, tracking_number?: string}, use_stripe_sdk?: bool} $params + * @param null|array{amount_details?: null|array{discount_amount?: null|int, enforce_arithmetic_validation?: bool, line_items?: null|array{discount_amount?: int, payment_method_options?: array{card?: array{commodity_code?: string}, card_present?: array{commodity_code?: string}, klarna?: array{image_url?: string, product_url?: string, reference?: string, subscription_reference?: string}, paypal?: array{category?: string, description?: string, sold_by?: string}}, product_code?: string, product_name: string, quantity: int, tax?: array{total_tax_amount: int}, unit_cost: int, unit_of_measure?: string}[], shipping?: null|array{amount?: null|int, from_postal_code?: null|string, to_postal_code?: null|string}, tax?: null|array{total_tax_amount: int}}, capture_method?: string, confirmation_token?: string, error_on_requires_action?: bool, excluded_payment_method_types?: null|string[], expand?: string[], hooks?: array{inputs?: array{tax?: array{calculation: null|string}}}, mandate?: string, mandate_data?: null|array{customer_acceptance?: array{accepted_at?: int, offline?: array{}, online?: array{ip_address?: string, user_agent?: string}, type: string}}, off_session?: array|bool|string, payment_details?: null|array{customer_reference?: null|string, order_reference?: null|string}, payment_method?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, crypto?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, upi?: array{mandate_options?: array{amount?: int, amount_type?: string, description?: string, end_date?: int}}, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{custom_mandate_url?: null|string, interval_description?: string, payment_schedule?: string, transaction_type?: string}, setup_future_usage?: null|string, target_date?: string, verification_method?: string}, affirm?: null|array{capture_method?: null|string, preferred_locale?: string, setup_future_usage?: string}, afterpay_clearpay?: null|array{capture_method?: null|string, reference?: string, setup_future_usage?: string}, alipay?: null|array{setup_future_usage?: null|string}, alma?: null|array{capture_method?: null|string}, amazon_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, au_becs_debit?: null|array{setup_future_usage?: null|string, target_date?: string}, bacs_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, bancontact?: null|array{preferred_language?: string, setup_future_usage?: null|string}, billie?: null|array{capture_method?: null|string}, blik?: null|array{code?: string, setup_future_usage?: null|string}, boleto?: null|array{expires_after_days?: int, setup_future_usage?: null|string}, card?: null|array{capture_method?: null|string, cvc_token?: string, installments?: array{enabled?: bool, plan?: null|array{count?: int, interval?: string, type: string}}, mandate_options?: array{amount: int, amount_type: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure?: string, require_cvc_recollection?: bool, setup_future_usage?: null|string, statement_descriptor_suffix_kana?: null|string, statement_descriptor_suffix_kanji?: null|string, three_d_secure?: array{ares_trans_status?: string, cryptogram: string, electronic_commerce_indicator?: string, exemption_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id: string, version: string}}, card_present?: null|array{capture_method?: string, request_extended_authorization?: bool, request_incremental_authorization_support?: bool, routing?: array{requested_priority?: string}}, cashapp?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, crypto?: null|array{setup_future_usage?: string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, requested_address_types?: string[], type: string}, funding_type?: string, setup_future_usage?: string}, eps?: null|array{setup_future_usage?: string}, fpx?: null|array{setup_future_usage?: string}, giropay?: null|array{setup_future_usage?: string}, grabpay?: null|array{setup_future_usage?: string}, ideal?: null|array{setup_future_usage?: null|string}, interac_present?: null|array{}, kakao_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, klarna?: null|array{capture_method?: null|string, on_demand?: array{average_amount?: int, maximum_amount?: int, minimum_amount?: int, purchase_interval?: string, purchase_interval_count?: int}, preferred_locale?: string, setup_future_usage?: string, subscriptions?: null|array{interval: string, interval_count?: int, name?: string, next_billing?: array{amount: int, date: string}, reference: string}[]}, konbini?: null|array{confirmation_number?: null|string, expires_after_days?: null|int, expires_at?: null|int, product_description?: null|string, setup_future_usage?: string}, kr_card?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, link?: null|array{capture_method?: null|string, persistent_token?: string, setup_future_usage?: null|string}, mb_way?: null|array{setup_future_usage?: string}, mobilepay?: null|array{capture_method?: null|string, setup_future_usage?: string}, multibanco?: null|array{setup_future_usage?: string}, naver_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, nz_bank_account?: null|array{setup_future_usage?: null|string, target_date?: string}, oxxo?: null|array{expires_after_days?: int, setup_future_usage?: string}, p24?: null|array{setup_future_usage?: string, tos_shown_and_accepted?: bool}, pay_by_bank?: null|array{}, payco?: null|array{capture_method?: null|string}, paynow?: null|array{setup_future_usage?: string}, paypal?: null|array{capture_method?: null|string, preferred_locale?: string, reference?: string, risk_correlation_id?: string, setup_future_usage?: null|string}, payto?: null|array{mandate_options?: array{amount?: null|int, amount_type?: null|string, end_date?: null|string, payment_schedule?: null|string, payments_per_period?: null|int, purpose?: null|string}, setup_future_usage?: null|string}, pix?: null|array{amount_includes_iof?: string, expires_after_seconds?: int, expires_at?: int, setup_future_usage?: string}, promptpay?: null|array{setup_future_usage?: string}, revolut_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, samsung_pay?: null|array{capture_method?: null|string}, satispay?: null|array{capture_method?: null|string}, sepa_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, sofort?: null|array{preferred_language?: null|string, setup_future_usage?: null|string}, swish?: null|array{reference?: null|string, setup_future_usage?: string}, twint?: null|array{setup_future_usage?: string}, upi?: null|array{mandate_options?: array{amount?: int, amount_type?: string, description?: string, end_date?: int}, setup_future_usage?: null|string}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, setup_future_usage?: null|string, target_date?: string, transaction_purpose?: null|string, verification_method?: string}, wechat_pay?: null|array{app_id?: string, client?: string, setup_future_usage?: string}, zip?: null|array{setup_future_usage?: string}}, payment_method_types?: string[], radar_options?: array{session?: string}, receipt_email?: null|string, return_url?: string, setup_future_usage?: null|string, shipping?: null|array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name: string, phone?: string, tracking_number?: string}, use_stripe_sdk?: bool} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\PaymentIntent @@ -169,7 +169,7 @@ class PaymentIntentService extends AbstractService * parameters available in the confirm * API when you supply confirm=true. * - * @param null|array{amount: int, amount_details?: array{discount_amount?: null|int, enforce_arithmetic_validation?: bool, line_items?: null|array{discount_amount?: int, payment_method_options?: array{card?: array{commodity_code?: string}, card_present?: array{commodity_code?: string}, klarna?: array{image_url?: string, product_url?: string, reference?: string, subscription_reference?: string}, paypal?: array{category?: string, description?: string, sold_by?: string}}, product_code?: string, product_name: string, quantity: int, tax?: array{total_tax_amount: int}, unit_cost: int, unit_of_measure?: string}[], shipping?: null|array{amount?: null|int, from_postal_code?: null|string, to_postal_code?: null|string}, tax?: null|array{total_tax_amount: int}}, application_fee_amount?: int, automatic_payment_methods?: array{allow_redirects?: string, enabled: bool}, capture_method?: string, confirm?: bool, confirmation_method?: string, confirmation_token?: string, currency: string, customer?: string, customer_account?: string, description?: string, error_on_requires_action?: bool, excluded_payment_method_types?: string[], expand?: string[], hooks?: array{inputs?: array{tax?: array{calculation: null|string}}}, mandate?: string, mandate_data?: null|array{customer_acceptance: array{accepted_at?: int, offline?: array{}, online?: array{ip_address: string, user_agent: string}, type: string}}, metadata?: array, off_session?: array|bool|string, on_behalf_of?: string, payment_details?: array{customer_reference?: null|string, order_reference?: null|string}, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, crypto?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{custom_mandate_url?: null|string, interval_description?: string, payment_schedule?: string, transaction_type?: string}, setup_future_usage?: null|string, target_date?: string, verification_method?: string}, affirm?: null|array{capture_method?: null|string, preferred_locale?: string, setup_future_usage?: string}, afterpay_clearpay?: null|array{capture_method?: null|string, reference?: string, setup_future_usage?: string}, alipay?: null|array{setup_future_usage?: null|string}, alma?: null|array{capture_method?: null|string}, amazon_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, au_becs_debit?: null|array{setup_future_usage?: null|string, target_date?: string}, bacs_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, bancontact?: null|array{preferred_language?: string, setup_future_usage?: null|string}, billie?: null|array{capture_method?: null|string}, blik?: null|array{code?: string, setup_future_usage?: null|string}, boleto?: null|array{expires_after_days?: int, setup_future_usage?: null|string}, card?: null|array{capture_method?: null|string, cvc_token?: string, installments?: array{enabled?: bool, plan?: null|array{count?: int, interval?: string, type: string}}, mandate_options?: array{amount: int, amount_type: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure?: string, require_cvc_recollection?: bool, setup_future_usage?: null|string, statement_descriptor_suffix_kana?: null|string, statement_descriptor_suffix_kanji?: null|string, three_d_secure?: array{ares_trans_status?: string, cryptogram: string, electronic_commerce_indicator?: string, exemption_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id: string, version: string}}, card_present?: null|array{capture_method?: string, request_extended_authorization?: bool, request_incremental_authorization_support?: bool, routing?: array{requested_priority?: string}}, cashapp?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, crypto?: null|array{setup_future_usage?: string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, requested_address_types?: string[], type: string}, funding_type?: string, setup_future_usage?: string}, eps?: null|array{setup_future_usage?: string}, fpx?: null|array{setup_future_usage?: string}, giropay?: null|array{setup_future_usage?: string}, grabpay?: null|array{setup_future_usage?: string}, ideal?: null|array{setup_future_usage?: null|string}, interac_present?: null|array{}, kakao_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, klarna?: null|array{capture_method?: null|string, on_demand?: array{average_amount?: int, maximum_amount?: int, minimum_amount?: int, purchase_interval?: string, purchase_interval_count?: int}, preferred_locale?: string, setup_future_usage?: string, subscriptions?: null|array{interval: string, interval_count?: int, name?: string, next_billing?: array{amount: int, date: string}, reference: string}[]}, konbini?: null|array{confirmation_number?: null|string, expires_after_days?: null|int, expires_at?: null|int, product_description?: null|string, setup_future_usage?: string}, kr_card?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, link?: null|array{capture_method?: null|string, persistent_token?: string, setup_future_usage?: null|string}, mb_way?: null|array{setup_future_usage?: string}, mobilepay?: null|array{capture_method?: null|string, setup_future_usage?: string}, multibanco?: null|array{setup_future_usage?: string}, naver_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, nz_bank_account?: null|array{setup_future_usage?: null|string, target_date?: string}, oxxo?: null|array{expires_after_days?: int, setup_future_usage?: string}, p24?: null|array{setup_future_usage?: string, tos_shown_and_accepted?: bool}, pay_by_bank?: null|array{}, payco?: null|array{capture_method?: null|string}, paynow?: null|array{setup_future_usage?: string}, paypal?: null|array{capture_method?: null|string, preferred_locale?: string, reference?: string, risk_correlation_id?: string, setup_future_usage?: null|string}, payto?: null|array{mandate_options?: array{amount?: null|int, amount_type?: null|string, end_date?: null|string, payment_schedule?: null|string, payments_per_period?: null|int, purpose?: null|string}, setup_future_usage?: null|string}, pix?: null|array{amount_includes_iof?: string, expires_after_seconds?: int, expires_at?: int, setup_future_usage?: string}, promptpay?: null|array{setup_future_usage?: string}, revolut_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, samsung_pay?: null|array{capture_method?: null|string}, satispay?: null|array{capture_method?: null|string}, sepa_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, sofort?: null|array{preferred_language?: null|string, setup_future_usage?: null|string}, swish?: null|array{reference?: null|string, setup_future_usage?: string}, twint?: null|array{setup_future_usage?: string}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, setup_future_usage?: null|string, target_date?: string, transaction_purpose?: null|string, verification_method?: string, preferred_settlement_speed?: null|string}, wechat_pay?: null|array{app_id?: string, client?: string, setup_future_usage?: string}, zip?: null|array{setup_future_usage?: string}}, payment_method_types?: string[], radar_options?: array{session?: string}, receipt_email?: string, return_url?: string, setup_future_usage?: string, shipping?: array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name: string, phone?: string, tracking_number?: string}, statement_descriptor?: string, statement_descriptor_suffix?: string, transfer_data?: array{amount?: int, destination: string}, transfer_group?: string, use_stripe_sdk?: bool} $params + * @param null|array{amount: int, amount_details?: array{discount_amount?: null|int, enforce_arithmetic_validation?: bool, line_items?: null|array{discount_amount?: int, payment_method_options?: array{card?: array{commodity_code?: string}, card_present?: array{commodity_code?: string}, klarna?: array{image_url?: string, product_url?: string, reference?: string, subscription_reference?: string}, paypal?: array{category?: string, description?: string, sold_by?: string}}, product_code?: string, product_name: string, quantity: int, tax?: array{total_tax_amount: int}, unit_cost: int, unit_of_measure?: string}[], shipping?: null|array{amount?: null|int, from_postal_code?: null|string, to_postal_code?: null|string}, tax?: null|array{total_tax_amount: int}}, application_fee_amount?: int, automatic_payment_methods?: array{allow_redirects?: string, enabled: bool}, capture_method?: string, confirm?: bool, confirmation_method?: string, confirmation_token?: string, currency: string, customer?: string, customer_account?: string, description?: string, error_on_requires_action?: bool, excluded_payment_method_types?: string[], expand?: string[], hooks?: array{inputs?: array{tax?: array{calculation: null|string}}}, mandate?: string, mandate_data?: null|array{customer_acceptance: array{accepted_at?: int, offline?: array{}, online?: array{ip_address: string, user_agent: string}, type: string}}, metadata?: array, off_session?: array|bool|string, on_behalf_of?: string, payment_details?: array{customer_reference?: null|string, order_reference?: null|string}, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, crypto?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, upi?: array{mandate_options?: array{amount?: int, amount_type?: string, description?: string, end_date?: int}}, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{custom_mandate_url?: null|string, interval_description?: string, payment_schedule?: string, transaction_type?: string}, setup_future_usage?: null|string, target_date?: string, verification_method?: string}, affirm?: null|array{capture_method?: null|string, preferred_locale?: string, setup_future_usage?: string}, afterpay_clearpay?: null|array{capture_method?: null|string, reference?: string, setup_future_usage?: string}, alipay?: null|array{setup_future_usage?: null|string}, alma?: null|array{capture_method?: null|string}, amazon_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, au_becs_debit?: null|array{setup_future_usage?: null|string, target_date?: string}, bacs_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, bancontact?: null|array{preferred_language?: string, setup_future_usage?: null|string}, billie?: null|array{capture_method?: null|string}, blik?: null|array{code?: string, setup_future_usage?: null|string}, boleto?: null|array{expires_after_days?: int, setup_future_usage?: null|string}, card?: null|array{capture_method?: null|string, cvc_token?: string, installments?: array{enabled?: bool, plan?: null|array{count?: int, interval?: string, type: string}}, mandate_options?: array{amount: int, amount_type: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure?: string, require_cvc_recollection?: bool, setup_future_usage?: null|string, statement_descriptor_suffix_kana?: null|string, statement_descriptor_suffix_kanji?: null|string, three_d_secure?: array{ares_trans_status?: string, cryptogram: string, electronic_commerce_indicator?: string, exemption_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id: string, version: string}}, card_present?: null|array{capture_method?: string, request_extended_authorization?: bool, request_incremental_authorization_support?: bool, routing?: array{requested_priority?: string}}, cashapp?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, crypto?: null|array{setup_future_usage?: string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, requested_address_types?: string[], type: string}, funding_type?: string, setup_future_usage?: string}, eps?: null|array{setup_future_usage?: string}, fpx?: null|array{setup_future_usage?: string}, giropay?: null|array{setup_future_usage?: string}, grabpay?: null|array{setup_future_usage?: string}, ideal?: null|array{setup_future_usage?: null|string}, interac_present?: null|array{}, kakao_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, klarna?: null|array{capture_method?: null|string, on_demand?: array{average_amount?: int, maximum_amount?: int, minimum_amount?: int, purchase_interval?: string, purchase_interval_count?: int}, preferred_locale?: string, setup_future_usage?: string, subscriptions?: null|array{interval: string, interval_count?: int, name?: string, next_billing?: array{amount: int, date: string}, reference: string}[]}, konbini?: null|array{confirmation_number?: null|string, expires_after_days?: null|int, expires_at?: null|int, product_description?: null|string, setup_future_usage?: string}, kr_card?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, link?: null|array{capture_method?: null|string, persistent_token?: string, setup_future_usage?: null|string}, mb_way?: null|array{setup_future_usage?: string}, mobilepay?: null|array{capture_method?: null|string, setup_future_usage?: string}, multibanco?: null|array{setup_future_usage?: string}, naver_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, nz_bank_account?: null|array{setup_future_usage?: null|string, target_date?: string}, oxxo?: null|array{expires_after_days?: int, setup_future_usage?: string}, p24?: null|array{setup_future_usage?: string, tos_shown_and_accepted?: bool}, pay_by_bank?: null|array{}, payco?: null|array{capture_method?: null|string}, paynow?: null|array{setup_future_usage?: string}, paypal?: null|array{capture_method?: null|string, preferred_locale?: string, reference?: string, risk_correlation_id?: string, setup_future_usage?: null|string}, payto?: null|array{mandate_options?: array{amount?: null|int, amount_type?: null|string, end_date?: null|string, payment_schedule?: null|string, payments_per_period?: null|int, purpose?: null|string}, setup_future_usage?: null|string}, pix?: null|array{amount_includes_iof?: string, expires_after_seconds?: int, expires_at?: int, setup_future_usage?: string}, promptpay?: null|array{setup_future_usage?: string}, revolut_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, samsung_pay?: null|array{capture_method?: null|string}, satispay?: null|array{capture_method?: null|string}, sepa_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, sofort?: null|array{preferred_language?: null|string, setup_future_usage?: null|string}, swish?: null|array{reference?: null|string, setup_future_usage?: string}, twint?: null|array{setup_future_usage?: string}, upi?: null|array{mandate_options?: array{amount?: int, amount_type?: string, description?: string, end_date?: int}, setup_future_usage?: null|string}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, setup_future_usage?: null|string, target_date?: string, transaction_purpose?: null|string, verification_method?: string}, wechat_pay?: null|array{app_id?: string, client?: string, setup_future_usage?: string}, zip?: null|array{setup_future_usage?: string}}, payment_method_types?: string[], radar_options?: array{session?: string}, receipt_email?: string, return_url?: string, setup_future_usage?: string, shipping?: array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name: string, phone?: string, tracking_number?: string}, statement_descriptor?: string, statement_descriptor_suffix?: string, transfer_data?: array{amount?: int, destination: string}, transfer_group?: string, use_stripe_sdk?: bool} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\PaymentIntent @@ -276,7 +276,7 @@ class PaymentIntentService extends AbstractService * href="/docs/api/payment_intents/confirm">confirm API instead. * * @param string $id - * @param null|array{amount?: int, amount_details?: null|array{discount_amount?: null|int, enforce_arithmetic_validation?: bool, line_items?: null|array{discount_amount?: int, payment_method_options?: array{card?: array{commodity_code?: string}, card_present?: array{commodity_code?: string}, klarna?: array{image_url?: string, product_url?: string, reference?: string, subscription_reference?: string}, paypal?: array{category?: string, description?: string, sold_by?: string}}, product_code?: string, product_name: string, quantity: int, tax?: array{total_tax_amount: int}, unit_cost: int, unit_of_measure?: string}[], shipping?: null|array{amount?: null|int, from_postal_code?: null|string, to_postal_code?: null|string}, tax?: null|array{total_tax_amount: int}}, application_fee_amount?: null|int, capture_method?: string, currency?: string, customer?: string, customer_account?: string, description?: string, excluded_payment_method_types?: null|string[], expand?: string[], hooks?: array{inputs?: array{tax?: array{calculation: null|string}}}, metadata?: null|array, payment_details?: null|array{customer_reference?: null|string, order_reference?: null|string}, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, crypto?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{custom_mandate_url?: null|string, interval_description?: string, payment_schedule?: string, transaction_type?: string}, setup_future_usage?: null|string, target_date?: string, verification_method?: string}, affirm?: null|array{capture_method?: null|string, preferred_locale?: string, setup_future_usage?: string}, afterpay_clearpay?: null|array{capture_method?: null|string, reference?: string, setup_future_usage?: string}, alipay?: null|array{setup_future_usage?: null|string}, alma?: null|array{capture_method?: null|string}, amazon_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, au_becs_debit?: null|array{setup_future_usage?: null|string, target_date?: string}, bacs_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, bancontact?: null|array{preferred_language?: string, setup_future_usage?: null|string}, billie?: null|array{capture_method?: null|string}, blik?: null|array{code?: string, setup_future_usage?: null|string}, boleto?: null|array{expires_after_days?: int, setup_future_usage?: null|string}, card?: null|array{capture_method?: null|string, cvc_token?: string, installments?: array{enabled?: bool, plan?: null|array{count?: int, interval?: string, type: string}}, mandate_options?: array{amount: int, amount_type: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure?: string, require_cvc_recollection?: bool, setup_future_usage?: null|string, statement_descriptor_suffix_kana?: null|string, statement_descriptor_suffix_kanji?: null|string, three_d_secure?: array{ares_trans_status?: string, cryptogram: string, electronic_commerce_indicator?: string, exemption_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id: string, version: string}}, card_present?: null|array{capture_method?: string, request_extended_authorization?: bool, request_incremental_authorization_support?: bool, routing?: array{requested_priority?: string}}, cashapp?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, crypto?: null|array{setup_future_usage?: string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, requested_address_types?: string[], type: string}, funding_type?: string, setup_future_usage?: string}, eps?: null|array{setup_future_usage?: string}, fpx?: null|array{setup_future_usage?: string}, giropay?: null|array{setup_future_usage?: string}, grabpay?: null|array{setup_future_usage?: string}, ideal?: null|array{setup_future_usage?: null|string}, interac_present?: null|array{}, kakao_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, klarna?: null|array{capture_method?: null|string, on_demand?: array{average_amount?: int, maximum_amount?: int, minimum_amount?: int, purchase_interval?: string, purchase_interval_count?: int}, preferred_locale?: string, setup_future_usage?: string, subscriptions?: null|array{interval: string, interval_count?: int, name?: string, next_billing?: array{amount: int, date: string}, reference: string}[]}, konbini?: null|array{confirmation_number?: null|string, expires_after_days?: null|int, expires_at?: null|int, product_description?: null|string, setup_future_usage?: string}, kr_card?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, link?: null|array{capture_method?: null|string, persistent_token?: string, setup_future_usage?: null|string}, mb_way?: null|array{setup_future_usage?: string}, mobilepay?: null|array{capture_method?: null|string, setup_future_usage?: string}, multibanco?: null|array{setup_future_usage?: string}, naver_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, nz_bank_account?: null|array{setup_future_usage?: null|string, target_date?: string}, oxxo?: null|array{expires_after_days?: int, setup_future_usage?: string}, p24?: null|array{setup_future_usage?: string, tos_shown_and_accepted?: bool}, pay_by_bank?: null|array{}, payco?: null|array{capture_method?: null|string}, paynow?: null|array{setup_future_usage?: string}, paypal?: null|array{capture_method?: null|string, preferred_locale?: string, reference?: string, risk_correlation_id?: string, setup_future_usage?: null|string}, payto?: null|array{mandate_options?: array{amount?: null|int, amount_type?: null|string, end_date?: null|string, payment_schedule?: null|string, payments_per_period?: null|int, purpose?: null|string}, setup_future_usage?: null|string}, pix?: null|array{amount_includes_iof?: string, expires_after_seconds?: int, expires_at?: int, setup_future_usage?: string}, promptpay?: null|array{setup_future_usage?: string}, revolut_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, samsung_pay?: null|array{capture_method?: null|string}, satispay?: null|array{capture_method?: null|string}, sepa_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, sofort?: null|array{preferred_language?: null|string, setup_future_usage?: null|string}, swish?: null|array{reference?: null|string, setup_future_usage?: string}, twint?: null|array{setup_future_usage?: string}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, setup_future_usage?: null|string, target_date?: string, transaction_purpose?: null|string, verification_method?: string, preferred_settlement_speed?: null|string}, wechat_pay?: null|array{app_id?: string, client?: string, setup_future_usage?: string}, zip?: null|array{setup_future_usage?: string}}, payment_method_types?: string[], receipt_email?: null|string, setup_future_usage?: null|string, shipping?: null|array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name: string, phone?: string, tracking_number?: string}, statement_descriptor?: string, statement_descriptor_suffix?: string, transfer_data?: array{amount?: int}, transfer_group?: string} $params + * @param null|array{amount?: int, amount_details?: null|array{discount_amount?: null|int, enforce_arithmetic_validation?: bool, line_items?: null|array{discount_amount?: int, payment_method_options?: array{card?: array{commodity_code?: string}, card_present?: array{commodity_code?: string}, klarna?: array{image_url?: string, product_url?: string, reference?: string, subscription_reference?: string}, paypal?: array{category?: string, description?: string, sold_by?: string}}, product_code?: string, product_name: string, quantity: int, tax?: array{total_tax_amount: int}, unit_cost: int, unit_of_measure?: string}[], shipping?: null|array{amount?: null|int, from_postal_code?: null|string, to_postal_code?: null|string}, tax?: null|array{total_tax_amount: int}}, application_fee_amount?: null|int, capture_method?: string, currency?: string, customer?: string, customer_account?: string, description?: string, excluded_payment_method_types?: null|string[], expand?: string[], hooks?: array{inputs?: array{tax?: array{calculation: null|string}}}, metadata?: null|array, payment_details?: null|array{customer_reference?: null|string, order_reference?: null|string}, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, crypto?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, upi?: array{mandate_options?: array{amount?: int, amount_type?: string, description?: string, end_date?: int}}, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: null|array{mandate_options?: array{custom_mandate_url?: null|string, interval_description?: string, payment_schedule?: string, transaction_type?: string}, setup_future_usage?: null|string, target_date?: string, verification_method?: string}, affirm?: null|array{capture_method?: null|string, preferred_locale?: string, setup_future_usage?: string}, afterpay_clearpay?: null|array{capture_method?: null|string, reference?: string, setup_future_usage?: string}, alipay?: null|array{setup_future_usage?: null|string}, alma?: null|array{capture_method?: null|string}, amazon_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, au_becs_debit?: null|array{setup_future_usage?: null|string, target_date?: string}, bacs_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, bancontact?: null|array{preferred_language?: string, setup_future_usage?: null|string}, billie?: null|array{capture_method?: null|string}, blik?: null|array{code?: string, setup_future_usage?: null|string}, boleto?: null|array{expires_after_days?: int, setup_future_usage?: null|string}, card?: null|array{capture_method?: null|string, cvc_token?: string, installments?: array{enabled?: bool, plan?: null|array{count?: int, interval?: string, type: string}}, mandate_options?: array{amount: int, amount_type: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_extended_authorization?: string, request_incremental_authorization?: string, request_multicapture?: string, request_overcapture?: string, request_three_d_secure?: string, require_cvc_recollection?: bool, setup_future_usage?: null|string, statement_descriptor_suffix_kana?: null|string, statement_descriptor_suffix_kanji?: null|string, three_d_secure?: array{ares_trans_status?: string, cryptogram: string, electronic_commerce_indicator?: string, exemption_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id: string, version: string}}, card_present?: null|array{capture_method?: string, request_extended_authorization?: bool, request_incremental_authorization_support?: bool, routing?: array{requested_priority?: string}}, cashapp?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, crypto?: null|array{setup_future_usage?: string}, customer_balance?: null|array{bank_transfer?: array{eu_bank_transfer?: array{country: string}, requested_address_types?: string[], type: string}, funding_type?: string, setup_future_usage?: string}, eps?: null|array{setup_future_usage?: string}, fpx?: null|array{setup_future_usage?: string}, giropay?: null|array{setup_future_usage?: string}, grabpay?: null|array{setup_future_usage?: string}, ideal?: null|array{setup_future_usage?: null|string}, interac_present?: null|array{}, kakao_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, klarna?: null|array{capture_method?: null|string, on_demand?: array{average_amount?: int, maximum_amount?: int, minimum_amount?: int, purchase_interval?: string, purchase_interval_count?: int}, preferred_locale?: string, setup_future_usage?: string, subscriptions?: null|array{interval: string, interval_count?: int, name?: string, next_billing?: array{amount: int, date: string}, reference: string}[]}, konbini?: null|array{confirmation_number?: null|string, expires_after_days?: null|int, expires_at?: null|int, product_description?: null|string, setup_future_usage?: string}, kr_card?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, link?: null|array{capture_method?: null|string, persistent_token?: string, setup_future_usage?: null|string}, mb_way?: null|array{setup_future_usage?: string}, mobilepay?: null|array{capture_method?: null|string, setup_future_usage?: string}, multibanco?: null|array{setup_future_usage?: string}, naver_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, nz_bank_account?: null|array{setup_future_usage?: null|string, target_date?: string}, oxxo?: null|array{expires_after_days?: int, setup_future_usage?: string}, p24?: null|array{setup_future_usage?: string, tos_shown_and_accepted?: bool}, pay_by_bank?: null|array{}, payco?: null|array{capture_method?: null|string}, paynow?: null|array{setup_future_usage?: string}, paypal?: null|array{capture_method?: null|string, preferred_locale?: string, reference?: string, risk_correlation_id?: string, setup_future_usage?: null|string}, payto?: null|array{mandate_options?: array{amount?: null|int, amount_type?: null|string, end_date?: null|string, payment_schedule?: null|string, payments_per_period?: null|int, purpose?: null|string}, setup_future_usage?: null|string}, pix?: null|array{amount_includes_iof?: string, expires_after_seconds?: int, expires_at?: int, setup_future_usage?: string}, promptpay?: null|array{setup_future_usage?: string}, revolut_pay?: null|array{capture_method?: null|string, setup_future_usage?: null|string}, samsung_pay?: null|array{capture_method?: null|string}, satispay?: null|array{capture_method?: null|string}, sepa_debit?: null|array{mandate_options?: array{reference_prefix?: null|string}, setup_future_usage?: null|string, target_date?: string}, sofort?: null|array{preferred_language?: null|string, setup_future_usage?: null|string}, swish?: null|array{reference?: null|string, setup_future_usage?: string}, twint?: null|array{setup_future_usage?: string}, upi?: null|array{mandate_options?: array{amount?: int, amount_type?: string, description?: string, end_date?: int}, setup_future_usage?: null|string}, us_bank_account?: null|array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, setup_future_usage?: null|string, target_date?: string, transaction_purpose?: null|string, verification_method?: string}, wechat_pay?: null|array{app_id?: string, client?: string, setup_future_usage?: string}, zip?: null|array{setup_future_usage?: string}}, payment_method_types?: string[], receipt_email?: null|string, setup_future_usage?: null|string, shipping?: null|array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name: string, phone?: string, tracking_number?: string}, statement_descriptor?: string, statement_descriptor_suffix?: string, transfer_data?: array{amount?: int}, transfer_group?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\PaymentIntent diff --git a/plugins/stripe-php/lib/Service/PaymentMethodConfigurationService.php b/plugins/stripe-php/lib/Service/PaymentMethodConfigurationService.php index 2f54573e..98ce7a0e 100644 --- a/plugins/stripe-php/lib/Service/PaymentMethodConfigurationService.php +++ b/plugins/stripe-php/lib/Service/PaymentMethodConfigurationService.php @@ -29,7 +29,7 @@ class PaymentMethodConfigurationService extends AbstractService /** * Creates a payment method configuration. * - * @param null|array{acss_debit?: array{display_preference?: array{preference?: string}}, affirm?: array{display_preference?: array{preference?: string}}, afterpay_clearpay?: array{display_preference?: array{preference?: string}}, alipay?: array{display_preference?: array{preference?: string}}, alma?: array{display_preference?: array{preference?: string}}, amazon_pay?: array{display_preference?: array{preference?: string}}, apple_pay?: array{display_preference?: array{preference?: string}}, apple_pay_later?: array{display_preference?: array{preference?: string}}, au_becs_debit?: array{display_preference?: array{preference?: string}}, bacs_debit?: array{display_preference?: array{preference?: string}}, bancontact?: array{display_preference?: array{preference?: string}}, billie?: array{display_preference?: array{preference?: string}}, blik?: array{display_preference?: array{preference?: string}}, boleto?: array{display_preference?: array{preference?: string}}, card?: array{display_preference?: array{preference?: string}}, cartes_bancaires?: array{display_preference?: array{preference?: string}}, cashapp?: array{display_preference?: array{preference?: string}}, crypto?: array{display_preference?: array{preference?: string}}, customer_balance?: array{display_preference?: array{preference?: string}}, eps?: array{display_preference?: array{preference?: string}}, expand?: string[], fpx?: array{display_preference?: array{preference?: string}}, fr_meal_voucher_conecs?: array{display_preference?: array{preference?: string}}, giropay?: array{display_preference?: array{preference?: string}}, google_pay?: array{display_preference?: array{preference?: string}}, grabpay?: array{display_preference?: array{preference?: string}}, ideal?: array{display_preference?: array{preference?: string}}, jcb?: array{display_preference?: array{preference?: string}}, kakao_pay?: array{display_preference?: array{preference?: string}}, klarna?: array{display_preference?: array{preference?: string}}, konbini?: array{display_preference?: array{preference?: string}}, kr_card?: array{display_preference?: array{preference?: string}}, link?: array{display_preference?: array{preference?: string}}, mb_way?: array{display_preference?: array{preference?: string}}, mobilepay?: array{display_preference?: array{preference?: string}}, multibanco?: array{display_preference?: array{preference?: string}}, name?: string, naver_pay?: array{display_preference?: array{preference?: string}}, nz_bank_account?: array{display_preference?: array{preference?: string}}, oxxo?: array{display_preference?: array{preference?: string}}, p24?: array{display_preference?: array{preference?: string}}, parent?: string, pay_by_bank?: array{display_preference?: array{preference?: string}}, payco?: array{display_preference?: array{preference?: string}}, paynow?: array{display_preference?: array{preference?: string}}, paypal?: array{display_preference?: array{preference?: string}}, payto?: array{display_preference?: array{preference?: string}}, pix?: array{display_preference?: array{preference?: string}}, promptpay?: array{display_preference?: array{preference?: string}}, revolut_pay?: array{display_preference?: array{preference?: string}}, samsung_pay?: array{display_preference?: array{preference?: string}}, satispay?: array{display_preference?: array{preference?: string}}, sepa_debit?: array{display_preference?: array{preference?: string}}, sofort?: array{display_preference?: array{preference?: string}}, swish?: array{display_preference?: array{preference?: string}}, twint?: array{display_preference?: array{preference?: string}}, us_bank_account?: array{display_preference?: array{preference?: string}}, wechat_pay?: array{display_preference?: array{preference?: string}}, zip?: array{display_preference?: array{preference?: string}}} $params + * @param null|array{acss_debit?: array{display_preference?: array{preference?: string}}, affirm?: array{display_preference?: array{preference?: string}}, afterpay_clearpay?: array{display_preference?: array{preference?: string}}, alipay?: array{display_preference?: array{preference?: string}}, alma?: array{display_preference?: array{preference?: string}}, amazon_pay?: array{display_preference?: array{preference?: string}}, apple_pay?: array{display_preference?: array{preference?: string}}, apple_pay_later?: array{display_preference?: array{preference?: string}}, au_becs_debit?: array{display_preference?: array{preference?: string}}, bacs_debit?: array{display_preference?: array{preference?: string}}, bancontact?: array{display_preference?: array{preference?: string}}, billie?: array{display_preference?: array{preference?: string}}, blik?: array{display_preference?: array{preference?: string}}, boleto?: array{display_preference?: array{preference?: string}}, card?: array{display_preference?: array{preference?: string}}, cartes_bancaires?: array{display_preference?: array{preference?: string}}, cashapp?: array{display_preference?: array{preference?: string}}, crypto?: array{display_preference?: array{preference?: string}}, customer_balance?: array{display_preference?: array{preference?: string}}, eps?: array{display_preference?: array{preference?: string}}, expand?: string[], fpx?: array{display_preference?: array{preference?: string}}, fr_meal_voucher_conecs?: array{display_preference?: array{preference?: string}}, giropay?: array{display_preference?: array{preference?: string}}, google_pay?: array{display_preference?: array{preference?: string}}, grabpay?: array{display_preference?: array{preference?: string}}, ideal?: array{display_preference?: array{preference?: string}}, jcb?: array{display_preference?: array{preference?: string}}, kakao_pay?: array{display_preference?: array{preference?: string}}, klarna?: array{display_preference?: array{preference?: string}}, konbini?: array{display_preference?: array{preference?: string}}, kr_card?: array{display_preference?: array{preference?: string}}, link?: array{display_preference?: array{preference?: string}}, mb_way?: array{display_preference?: array{preference?: string}}, mobilepay?: array{display_preference?: array{preference?: string}}, multibanco?: array{display_preference?: array{preference?: string}}, name?: string, naver_pay?: array{display_preference?: array{preference?: string}}, nz_bank_account?: array{display_preference?: array{preference?: string}}, oxxo?: array{display_preference?: array{preference?: string}}, p24?: array{display_preference?: array{preference?: string}}, parent?: string, pay_by_bank?: array{display_preference?: array{preference?: string}}, payco?: array{display_preference?: array{preference?: string}}, paynow?: array{display_preference?: array{preference?: string}}, paypal?: array{display_preference?: array{preference?: string}}, payto?: array{display_preference?: array{preference?: string}}, pix?: array{display_preference?: array{preference?: string}}, promptpay?: array{display_preference?: array{preference?: string}}, revolut_pay?: array{display_preference?: array{preference?: string}}, samsung_pay?: array{display_preference?: array{preference?: string}}, satispay?: array{display_preference?: array{preference?: string}}, sepa_debit?: array{display_preference?: array{preference?: string}}, sofort?: array{display_preference?: array{preference?: string}}, swish?: array{display_preference?: array{preference?: string}}, twint?: array{display_preference?: array{preference?: string}}, upi?: array{display_preference?: array{preference?: string}}, us_bank_account?: array{display_preference?: array{preference?: string}}, wechat_pay?: array{display_preference?: array{preference?: string}}, zip?: array{display_preference?: array{preference?: string}}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\PaymentMethodConfiguration @@ -61,7 +61,7 @@ class PaymentMethodConfigurationService extends AbstractService * Update payment method configuration. * * @param string $id - * @param null|array{acss_debit?: array{display_preference?: array{preference?: string}}, active?: bool, affirm?: array{display_preference?: array{preference?: string}}, afterpay_clearpay?: array{display_preference?: array{preference?: string}}, alipay?: array{display_preference?: array{preference?: string}}, alma?: array{display_preference?: array{preference?: string}}, amazon_pay?: array{display_preference?: array{preference?: string}}, apple_pay?: array{display_preference?: array{preference?: string}}, apple_pay_later?: array{display_preference?: array{preference?: string}}, au_becs_debit?: array{display_preference?: array{preference?: string}}, bacs_debit?: array{display_preference?: array{preference?: string}}, bancontact?: array{display_preference?: array{preference?: string}}, billie?: array{display_preference?: array{preference?: string}}, blik?: array{display_preference?: array{preference?: string}}, boleto?: array{display_preference?: array{preference?: string}}, card?: array{display_preference?: array{preference?: string}}, cartes_bancaires?: array{display_preference?: array{preference?: string}}, cashapp?: array{display_preference?: array{preference?: string}}, crypto?: array{display_preference?: array{preference?: string}}, customer_balance?: array{display_preference?: array{preference?: string}}, eps?: array{display_preference?: array{preference?: string}}, expand?: string[], fpx?: array{display_preference?: array{preference?: string}}, fr_meal_voucher_conecs?: array{display_preference?: array{preference?: string}}, giropay?: array{display_preference?: array{preference?: string}}, google_pay?: array{display_preference?: array{preference?: string}}, grabpay?: array{display_preference?: array{preference?: string}}, ideal?: array{display_preference?: array{preference?: string}}, jcb?: array{display_preference?: array{preference?: string}}, kakao_pay?: array{display_preference?: array{preference?: string}}, klarna?: array{display_preference?: array{preference?: string}}, konbini?: array{display_preference?: array{preference?: string}}, kr_card?: array{display_preference?: array{preference?: string}}, link?: array{display_preference?: array{preference?: string}}, mb_way?: array{display_preference?: array{preference?: string}}, mobilepay?: array{display_preference?: array{preference?: string}}, multibanco?: array{display_preference?: array{preference?: string}}, name?: string, naver_pay?: array{display_preference?: array{preference?: string}}, nz_bank_account?: array{display_preference?: array{preference?: string}}, oxxo?: array{display_preference?: array{preference?: string}}, p24?: array{display_preference?: array{preference?: string}}, pay_by_bank?: array{display_preference?: array{preference?: string}}, payco?: array{display_preference?: array{preference?: string}}, paynow?: array{display_preference?: array{preference?: string}}, paypal?: array{display_preference?: array{preference?: string}}, payto?: array{display_preference?: array{preference?: string}}, pix?: array{display_preference?: array{preference?: string}}, promptpay?: array{display_preference?: array{preference?: string}}, revolut_pay?: array{display_preference?: array{preference?: string}}, samsung_pay?: array{display_preference?: array{preference?: string}}, satispay?: array{display_preference?: array{preference?: string}}, sepa_debit?: array{display_preference?: array{preference?: string}}, sofort?: array{display_preference?: array{preference?: string}}, swish?: array{display_preference?: array{preference?: string}}, twint?: array{display_preference?: array{preference?: string}}, us_bank_account?: array{display_preference?: array{preference?: string}}, wechat_pay?: array{display_preference?: array{preference?: string}}, zip?: array{display_preference?: array{preference?: string}}} $params + * @param null|array{acss_debit?: array{display_preference?: array{preference?: string}}, active?: bool, affirm?: array{display_preference?: array{preference?: string}}, afterpay_clearpay?: array{display_preference?: array{preference?: string}}, alipay?: array{display_preference?: array{preference?: string}}, alma?: array{display_preference?: array{preference?: string}}, amazon_pay?: array{display_preference?: array{preference?: string}}, apple_pay?: array{display_preference?: array{preference?: string}}, apple_pay_later?: array{display_preference?: array{preference?: string}}, au_becs_debit?: array{display_preference?: array{preference?: string}}, bacs_debit?: array{display_preference?: array{preference?: string}}, bancontact?: array{display_preference?: array{preference?: string}}, billie?: array{display_preference?: array{preference?: string}}, blik?: array{display_preference?: array{preference?: string}}, boleto?: array{display_preference?: array{preference?: string}}, card?: array{display_preference?: array{preference?: string}}, cartes_bancaires?: array{display_preference?: array{preference?: string}}, cashapp?: array{display_preference?: array{preference?: string}}, crypto?: array{display_preference?: array{preference?: string}}, customer_balance?: array{display_preference?: array{preference?: string}}, eps?: array{display_preference?: array{preference?: string}}, expand?: string[], fpx?: array{display_preference?: array{preference?: string}}, fr_meal_voucher_conecs?: array{display_preference?: array{preference?: string}}, giropay?: array{display_preference?: array{preference?: string}}, google_pay?: array{display_preference?: array{preference?: string}}, grabpay?: array{display_preference?: array{preference?: string}}, ideal?: array{display_preference?: array{preference?: string}}, jcb?: array{display_preference?: array{preference?: string}}, kakao_pay?: array{display_preference?: array{preference?: string}}, klarna?: array{display_preference?: array{preference?: string}}, konbini?: array{display_preference?: array{preference?: string}}, kr_card?: array{display_preference?: array{preference?: string}}, link?: array{display_preference?: array{preference?: string}}, mb_way?: array{display_preference?: array{preference?: string}}, mobilepay?: array{display_preference?: array{preference?: string}}, multibanco?: array{display_preference?: array{preference?: string}}, name?: string, naver_pay?: array{display_preference?: array{preference?: string}}, nz_bank_account?: array{display_preference?: array{preference?: string}}, oxxo?: array{display_preference?: array{preference?: string}}, p24?: array{display_preference?: array{preference?: string}}, pay_by_bank?: array{display_preference?: array{preference?: string}}, payco?: array{display_preference?: array{preference?: string}}, paynow?: array{display_preference?: array{preference?: string}}, paypal?: array{display_preference?: array{preference?: string}}, payto?: array{display_preference?: array{preference?: string}}, pix?: array{display_preference?: array{preference?: string}}, promptpay?: array{display_preference?: array{preference?: string}}, revolut_pay?: array{display_preference?: array{preference?: string}}, samsung_pay?: array{display_preference?: array{preference?: string}}, satispay?: array{display_preference?: array{preference?: string}}, sepa_debit?: array{display_preference?: array{preference?: string}}, sofort?: array{display_preference?: array{preference?: string}}, swish?: array{display_preference?: array{preference?: string}}, twint?: array{display_preference?: array{preference?: string}}, upi?: array{display_preference?: array{preference?: string}}, us_bank_account?: array{display_preference?: array{preference?: string}}, wechat_pay?: array{display_preference?: array{preference?: string}}, zip?: array{display_preference?: array{preference?: string}}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\PaymentMethodConfiguration diff --git a/plugins/stripe-php/lib/Service/PaymentMethodService.php b/plugins/stripe-php/lib/Service/PaymentMethodService.php index f52f947c..e8e91da6 100644 --- a/plugins/stripe-php/lib/Service/PaymentMethodService.php +++ b/plugins/stripe-php/lib/Service/PaymentMethodService.php @@ -70,7 +70,7 @@ class PaymentMethodService extends AbstractService * href="/docs/payments/save-and-reuse">SetupIntent API to collect payment * method details ahead of a future payment. * - * @param null|array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, card?: array{cvc?: string, exp_month?: int, exp_year?: int, networks?: array{preferred?: string}, number?: string, token?: string}, cashapp?: array{}, crypto?: array{}, custom?: array{type: string}, customer?: string, customer_balance?: array{}, eps?: array{bank?: string}, expand?: string[], fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, payment_method?: string, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type?: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}} $params + * @param null|array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, card?: array{cvc?: string, exp_month?: int, exp_year?: int, networks?: array{preferred?: string}, number?: string, token?: string}, cashapp?: array{}, crypto?: array{}, custom?: array{type: string}, customer?: string, customer_balance?: array{}, eps?: array{bank?: string}, expand?: string[], fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, payment_method?: string, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type?: string, upi?: array{mandate_options?: array{amount?: int, amount_type?: string, description?: string, end_date?: int}}, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\PaymentMethod diff --git a/plugins/stripe-php/lib/Service/PayoutService.php b/plugins/stripe-php/lib/Service/PayoutService.php index a6e1b5cb..2fed81c2 100644 --- a/plugins/stripe-php/lib/Service/PayoutService.php +++ b/plugins/stripe-php/lib/Service/PayoutService.php @@ -56,8 +56,8 @@ class PayoutService extends AbstractService * * If you create a manual payout on a Stripe account that uses multiple payment * source types, you need to specify the source type balance that the payout draws - * from. The balance object details available and - * pending amounts by source type. + * from. The balance object details available + * and pending amounts by source type. * * @param null|array{amount: int, currency: string, description?: string, destination?: string, expand?: string[], metadata?: array, method?: string, payout_method?: string, source_type?: string, statement_descriptor?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts diff --git a/plugins/stripe-php/lib/Service/SetupIntentService.php b/plugins/stripe-php/lib/Service/SetupIntentService.php index 65c64e48..5b749e9c 100644 --- a/plugins/stripe-php/lib/Service/SetupIntentService.php +++ b/plugins/stripe-php/lib/Service/SetupIntentService.php @@ -63,7 +63,7 @@ class SetupIntentService extends AbstractService * or the canceled status if the confirmation limit is reached. * * @param string $id - * @param null|array{confirmation_token?: string, expand?: string[], mandate_data?: null|array{customer_acceptance?: array{accepted_at?: int, offline?: array{}, online?: array{ip_address?: string, user_agent?: string}, type: string}}, payment_method?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, crypto?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: array{currency?: string, mandate_options?: array{custom_mandate_url?: null|string, default_for?: string[], interval_description?: string, payment_schedule?: string, transaction_type?: string}, verification_method?: string}, amazon_pay?: array{}, bacs_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, card?: array{mandate_options?: array{amount: int, amount_type: string, currency: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_three_d_secure?: string, three_d_secure?: array{ares_trans_status?: string, cryptogram?: string, electronic_commerce_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id?: string, version?: string}}, card_present?: array{}, klarna?: array{currency?: string, on_demand?: array{average_amount?: int, maximum_amount?: int, minimum_amount?: int, purchase_interval?: string, purchase_interval_count?: int}, preferred_locale?: string, subscriptions?: null|array{interval: string, interval_count?: int, name?: string, next_billing: array{amount: int, date: string}, reference: string}[]}, link?: array{persistent_token?: string}, paypal?: array{billing_agreement_id?: string}, payto?: array{mandate_options?: array{amount?: null|int, amount_type?: null|string, end_date?: null|string, payment_schedule?: null|string, payments_per_period?: null|int, purpose?: null|string, start_date?: null|string}}, sepa_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, us_bank_account?: array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, verification_method?: string}}, return_url?: string, use_stripe_sdk?: bool} $params + * @param null|array{confirmation_token?: string, expand?: string[], mandate_data?: null|array{customer_acceptance?: array{accepted_at?: int, offline?: array{}, online?: array{ip_address?: string, user_agent?: string}, type: string}}, payment_method?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, crypto?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, upi?: array{mandate_options?: array{amount?: int, amount_type?: string, description?: string, end_date?: int}}, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: array{currency?: string, mandate_options?: array{custom_mandate_url?: null|string, default_for?: string[], interval_description?: string, payment_schedule?: string, transaction_type?: string}, verification_method?: string}, amazon_pay?: array{}, bacs_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, card?: array{mandate_options?: array{amount: int, amount_type: string, currency: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_three_d_secure?: string, three_d_secure?: array{ares_trans_status?: string, cryptogram?: string, electronic_commerce_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id?: string, version?: string}}, card_present?: array{}, klarna?: array{currency?: string, on_demand?: array{average_amount?: int, maximum_amount?: int, minimum_amount?: int, purchase_interval?: string, purchase_interval_count?: int}, preferred_locale?: string, subscriptions?: null|array{interval: string, interval_count?: int, name?: string, next_billing: array{amount: int, date: string}, reference: string}[]}, link?: array{persistent_token?: string}, paypal?: array{billing_agreement_id?: string}, payto?: array{mandate_options?: array{amount?: null|int, amount_type?: null|string, end_date?: null|string, payment_schedule?: null|string, payments_per_period?: null|int, purpose?: null|string, start_date?: null|string}}, sepa_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, upi?: array{mandate_options?: array{amount?: int, amount_type?: string, description?: string, end_date?: int}, setup_future_usage?: null|string}, us_bank_account?: array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, verification_method?: string}}, return_url?: string, use_stripe_sdk?: bool} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\SetupIntent @@ -82,7 +82,7 @@ class SetupIntentService extends AbstractService * href="/docs/api/setup_intents/confirm">confirm it to collect any required * permissions to charge the payment method later. * - * @param null|array{attach_to_self?: bool, automatic_payment_methods?: array{allow_redirects?: string, enabled: bool}, confirm?: bool, confirmation_token?: string, customer?: string, customer_account?: string, description?: string, excluded_payment_method_types?: string[], expand?: string[], flow_directions?: string[], mandate_data?: null|array{customer_acceptance: array{accepted_at?: int, offline?: array{}, online?: array{ip_address: string, user_agent: string}, type: string}}, metadata?: array, on_behalf_of?: string, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, crypto?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: array{currency?: string, mandate_options?: array{custom_mandate_url?: null|string, default_for?: string[], interval_description?: string, payment_schedule?: string, transaction_type?: string}, verification_method?: string}, amazon_pay?: array{}, bacs_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, card?: array{mandate_options?: array{amount: int, amount_type: string, currency: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_three_d_secure?: string, three_d_secure?: array{ares_trans_status?: string, cryptogram?: string, electronic_commerce_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id?: string, version?: string}}, card_present?: array{}, klarna?: array{currency?: string, on_demand?: array{average_amount?: int, maximum_amount?: int, minimum_amount?: int, purchase_interval?: string, purchase_interval_count?: int}, preferred_locale?: string, subscriptions?: null|array{interval: string, interval_count?: int, name?: string, next_billing: array{amount: int, date: string}, reference: string}[]}, link?: array{persistent_token?: string}, paypal?: array{billing_agreement_id?: string}, payto?: array{mandate_options?: array{amount?: null|int, amount_type?: null|string, end_date?: null|string, payment_schedule?: null|string, payments_per_period?: null|int, purpose?: null|string, start_date?: null|string}}, sepa_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, us_bank_account?: array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, verification_method?: string}}, payment_method_types?: string[], return_url?: string, single_use?: array{amount: int, currency: string}, usage?: string, use_stripe_sdk?: bool} $params + * @param null|array{attach_to_self?: bool, automatic_payment_methods?: array{allow_redirects?: string, enabled: bool}, confirm?: bool, confirmation_token?: string, customer?: string, customer_account?: string, description?: string, excluded_payment_method_types?: string[], expand?: string[], flow_directions?: string[], mandate_data?: null|array{customer_acceptance: array{accepted_at?: int, offline?: array{}, online?: array{ip_address: string, user_agent: string}, type: string}}, metadata?: array, on_behalf_of?: string, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, crypto?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, upi?: array{mandate_options?: array{amount?: int, amount_type?: string, description?: string, end_date?: int}}, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: array{currency?: string, mandate_options?: array{custom_mandate_url?: null|string, default_for?: string[], interval_description?: string, payment_schedule?: string, transaction_type?: string}, verification_method?: string}, amazon_pay?: array{}, bacs_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, card?: array{mandate_options?: array{amount: int, amount_type: string, currency: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_three_d_secure?: string, three_d_secure?: array{ares_trans_status?: string, cryptogram?: string, electronic_commerce_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id?: string, version?: string}}, card_present?: array{}, klarna?: array{currency?: string, on_demand?: array{average_amount?: int, maximum_amount?: int, minimum_amount?: int, purchase_interval?: string, purchase_interval_count?: int}, preferred_locale?: string, subscriptions?: null|array{interval: string, interval_count?: int, name?: string, next_billing: array{amount: int, date: string}, reference: string}[]}, link?: array{persistent_token?: string}, paypal?: array{billing_agreement_id?: string}, payto?: array{mandate_options?: array{amount?: null|int, amount_type?: null|string, end_date?: null|string, payment_schedule?: null|string, payments_per_period?: null|int, purpose?: null|string, start_date?: null|string}}, sepa_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, upi?: array{mandate_options?: array{amount?: int, amount_type?: string, description?: string, end_date?: int}, setup_future_usage?: null|string}, us_bank_account?: array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, verification_method?: string}}, payment_method_types?: string[], return_url?: string, single_use?: array{amount: int, currency: string}, usage?: string, use_stripe_sdk?: bool} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\SetupIntent @@ -121,7 +121,7 @@ class SetupIntentService extends AbstractService * Updates a SetupIntent object. * * @param string $id - * @param null|array{attach_to_self?: bool, customer?: string, customer_account?: string, description?: string, excluded_payment_method_types?: null|string[], expand?: string[], flow_directions?: string[], metadata?: null|array, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, crypto?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: array{currency?: string, mandate_options?: array{custom_mandate_url?: null|string, default_for?: string[], interval_description?: string, payment_schedule?: string, transaction_type?: string}, verification_method?: string}, amazon_pay?: array{}, bacs_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, card?: array{mandate_options?: array{amount: int, amount_type: string, currency: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_three_d_secure?: string, three_d_secure?: array{ares_trans_status?: string, cryptogram?: string, electronic_commerce_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id?: string, version?: string}}, card_present?: array{}, klarna?: array{currency?: string, on_demand?: array{average_amount?: int, maximum_amount?: int, minimum_amount?: int, purchase_interval?: string, purchase_interval_count?: int}, preferred_locale?: string, subscriptions?: null|array{interval: string, interval_count?: int, name?: string, next_billing: array{amount: int, date: string}, reference: string}[]}, link?: array{persistent_token?: string}, paypal?: array{billing_agreement_id?: string}, payto?: array{mandate_options?: array{amount?: null|int, amount_type?: null|string, end_date?: null|string, payment_schedule?: null|string, payments_per_period?: null|int, purpose?: null|string, start_date?: null|string}}, sepa_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, us_bank_account?: array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, verification_method?: string}}, payment_method_types?: string[]} $params + * @param null|array{attach_to_self?: bool, customer?: string, customer_account?: string, description?: string, excluded_payment_method_types?: null|string[], expand?: string[], flow_directions?: string[], metadata?: null|array, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, crypto?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, upi?: array{mandate_options?: array{amount?: int, amount_type?: string, description?: string, end_date?: int}}, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: array{currency?: string, mandate_options?: array{custom_mandate_url?: null|string, default_for?: string[], interval_description?: string, payment_schedule?: string, transaction_type?: string}, verification_method?: string}, amazon_pay?: array{}, bacs_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, card?: array{mandate_options?: array{amount: int, amount_type: string, currency: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_three_d_secure?: string, three_d_secure?: array{ares_trans_status?: string, cryptogram?: string, electronic_commerce_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id?: string, version?: string}}, card_present?: array{}, klarna?: array{currency?: string, on_demand?: array{average_amount?: int, maximum_amount?: int, minimum_amount?: int, purchase_interval?: string, purchase_interval_count?: int}, preferred_locale?: string, subscriptions?: null|array{interval: string, interval_count?: int, name?: string, next_billing: array{amount: int, date: string}, reference: string}[]}, link?: array{persistent_token?: string}, paypal?: array{billing_agreement_id?: string}, payto?: array{mandate_options?: array{amount?: null|int, amount_type?: null|string, end_date?: null|string, payment_schedule?: null|string, payments_per_period?: null|int, purpose?: null|string, start_date?: null|string}}, sepa_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, upi?: array{mandate_options?: array{amount?: int, amount_type?: string, description?: string, end_date?: int}, setup_future_usage?: null|string}, us_bank_account?: array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, verification_method?: string}}, payment_method_types?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\SetupIntent diff --git a/plugins/stripe-php/lib/Service/SubscriptionService.php b/plugins/stripe-php/lib/Service/SubscriptionService.php index 4d29cde9..6f227641 100644 --- a/plugins/stripe-php/lib/Service/SubscriptionService.php +++ b/plugins/stripe-php/lib/Service/SubscriptionService.php @@ -33,10 +33,10 @@ class SubscriptionService extends AbstractService * subscription or its metadata. * * Any pending invoice items that you’ve created are still charged at the end of - * the period, unless manually deleted. If you’ve - * set the subscription to cancel at the end of the period, any pending prorations - * are also left in place and collected at the end of the period. But if the - * subscription is set to cancel immediately, pending prorations are removed if + * the period, unless manually deleted. If + * you’ve set the subscription to cancel at the end of the period, any pending + * prorations are also left in place and collected at the end of the period. But if + * the subscription is set to cancel immediately, pending prorations are removed if * invoice_now and prorate are both set to true. * * By default, upon subscription cancellation, Stripe stops automatic collection of diff --git a/plugins/stripe-php/lib/Service/TestHelpers/ConfirmationTokenService.php b/plugins/stripe-php/lib/Service/TestHelpers/ConfirmationTokenService.php index 0b90f8c2..dbb75eb0 100644 --- a/plugins/stripe-php/lib/Service/TestHelpers/ConfirmationTokenService.php +++ b/plugins/stripe-php/lib/Service/TestHelpers/ConfirmationTokenService.php @@ -14,7 +14,7 @@ class ConfirmationTokenService extends \Stripe\Service\AbstractService /** * Creates a test mode Confirmation Token server side for your integration tests. * - * @param null|array{expand?: string[], payment_method?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, crypto?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{card?: array{installments?: array{plan: array{count?: int, interval?: string, type: string}}}}, return_url?: string, setup_future_usage?: string, shipping?: array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name: string, phone?: null|string}} $params + * @param null|array{expand?: string[], payment_method?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, crypto?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, upi?: array{mandate_options?: array{amount?: int, amount_type?: string, description?: string, end_date?: int}}, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{card?: array{installments?: array{plan: array{count?: int, interval?: string, type: string}}}}, return_url?: string, setup_future_usage?: string, shipping?: array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name: string, phone?: null|string}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\ConfirmationToken diff --git a/plugins/stripe-php/lib/Service/TestHelpers/Issuing/AuthorizationService.php b/plugins/stripe-php/lib/Service/TestHelpers/Issuing/AuthorizationService.php index a843304d..1aec8802 100644 --- a/plugins/stripe-php/lib/Service/TestHelpers/Issuing/AuthorizationService.php +++ b/plugins/stripe-php/lib/Service/TestHelpers/Issuing/AuthorizationService.php @@ -30,7 +30,7 @@ class AuthorizationService extends \Stripe\Service\AbstractService /** * Create a test-mode authorization. * - * @param null|array{amount?: int, amount_details?: array{atm_fee?: int, cashback_amount?: int}, authorization_method?: string, card: string, currency?: string, expand?: string[], fleet?: array{cardholder_prompt_data?: array{driver_id?: string, odometer?: int, unspecified_id?: string, user_id?: string, vehicle_number?: string}, purchase_type?: string, reported_breakdown?: array{fuel?: array{gross_amount_decimal?: string}, non_fuel?: array{gross_amount_decimal?: string}, tax?: array{local_amount_decimal?: string, national_amount_decimal?: string}}, service_type?: string}, fraud_disputability_likelihood?: string, fuel?: array{industry_product_code?: string, quantity_decimal?: string, type?: string, unit?: string, unit_cost_decimal?: string}, is_amount_controllable?: bool, merchant_amount?: int, merchant_currency?: string, merchant_data?: array{category?: string, city?: string, country?: string, name?: string, network_id?: string, postal_code?: string, state?: string, terminal_id?: string, url?: string}, network_data?: array{acquiring_institution_id?: string}, risk_assessment?: array{card_testing_risk?: array{invalid_account_number_decline_rate_past_hour?: int, invalid_credentials_decline_rate_past_hour?: int, risk_level: string}, fraud_risk?: array{level: string, score?: float}, merchant_dispute_risk?: array{dispute_rate?: int, risk_level: string}}, verification_data?: array{address_line1_check?: string, address_postal_code_check?: string, authentication_exemption?: array{claimed_by: string, type: string}, cvc_check?: string, expiry_check?: string, three_d_secure?: array{result: string}}, wallet?: string} $params + * @param null|array{amount?: int, amount_details?: array{atm_fee?: int, cashback_amount?: int}, authorization_method?: string, card: string, currency?: string, expand?: string[], fleet?: array{cardholder_prompt_data?: array{driver_id?: string, odometer?: int, unspecified_id?: string, user_id?: string, vehicle_number?: string}, purchase_type?: string, reported_breakdown?: array{fuel?: array{gross_amount_decimal?: string}, non_fuel?: array{gross_amount_decimal?: string}, tax?: array{local_amount_decimal?: string, national_amount_decimal?: string}}, service_type?: string}, fraud_disputability_likelihood?: string, fuel?: array{industry_product_code?: string, quantity_decimal?: string, type?: string, unit?: string, unit_cost_decimal?: string}, is_amount_controllable?: bool, merchant_amount?: int, merchant_currency?: string, merchant_data?: array{category?: string, city?: string, country?: string, name?: string, network_id?: string, postal_code?: string, state?: string, terminal_id?: string, url?: string}, network_data?: array{acquiring_institution_id?: string}, risk_assessment?: array{card_testing_risk?: array{invalid_account_number_decline_rate_past_hour?: int, invalid_credentials_decline_rate_past_hour?: int, level: string}, fraud_risk?: array{level: string, score?: float}, merchant_dispute_risk?: array{dispute_rate?: int, level: string}}, verification_data?: array{address_line1_check?: string, address_postal_code_check?: string, authentication_exemption?: array{claimed_by: string, type: string}, cvc_check?: string, expiry_check?: string, three_d_secure?: array{result: string}}, wallet?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\Issuing\Authorization diff --git a/plugins/stripe-php/lib/Service/V2/Core/AccountLinkService.php b/plugins/stripe-php/lib/Service/V2/Core/AccountLinkService.php index 83fd1d72..17b471f9 100644 --- a/plugins/stripe-php/lib/Service/V2/Core/AccountLinkService.php +++ b/plugins/stripe-php/lib/Service/V2/Core/AccountLinkService.php @@ -21,7 +21,7 @@ class AccountLinkService extends \Stripe\Service\AbstractService * * @return \Stripe\V2\Core\AccountLink * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @throws \Stripe\Exception\RateLimitException */ public function create($params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/V2/Core/AccountService.php b/plugins/stripe-php/lib/Service/V2/Core/AccountService.php index 541e4bcb..3665ebf7 100644 --- a/plugins/stripe-php/lib/Service/V2/Core/AccountService.php +++ b/plugins/stripe-php/lib/Service/V2/Core/AccountService.php @@ -29,11 +29,43 @@ class AccountService extends \Stripe\Service\AbstractService * * @return \Stripe\V2\Collection<\Stripe\V2\Core\Account> * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @throws \Stripe\Exception\RateLimitException */ public function all($params = null, $opts = null) { - return $this->requestCollection('get', '/v2/core/accounts', $params, $opts); + return $this->requestCollection('get', '/v2/core/accounts', $params, $opts, [ + 'response_schema' => [ + 'kind' => 'object', + 'fields' => [ + 'data' => [ + 'kind' => 'array', + 'element' => [ + 'kind' => 'object', + 'fields' => [ + 'identity' => [ + 'kind' => 'object', + 'fields' => [ + 'individual' => [ + 'kind' => 'object', + 'fields' => [ + 'relationship' => [ + 'kind' => 'object', + 'fields' => [ + 'percent_ownership' => [ + 'kind' => 'decimal_string', + ], + ], + ], + ], + ], + ], + ], + ], + ], + ], + ], + ], + ]); } /** @@ -47,11 +79,35 @@ class AccountService extends \Stripe\Service\AbstractService * * @return \Stripe\V2\Core\Account * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @throws \Stripe\Exception\RateLimitException */ public function close($id, $params = null, $opts = null) { - return $this->request('post', $this->buildPath('/v2/core/accounts/%s/close', $id), $params, $opts); + return $this->request('post', $this->buildPath('/v2/core/accounts/%s/close', $id), $params, $opts, [ + 'response_schema' => [ + 'kind' => 'object', + 'fields' => [ + 'identity' => [ + 'kind' => 'object', + 'fields' => [ + 'individual' => [ + 'kind' => 'object', + 'fields' => [ + 'relationship' => [ + 'kind' => 'object', + 'fields' => [ + 'percent_ownership' => [ + 'kind' => 'decimal_string', + ], + ], + ], + ], + ], + ], + ], + ], + ], + ]); } /** @@ -61,16 +117,63 @@ class AccountService extends \Stripe\Service\AbstractService * can be configured as any or all of the following configurations: Customer, * Merchant and/or Recipient. * - * @param null|array{account_token?: string, configuration?: array{customer?: array{automatic_indirect_tax?: array{exempt?: string, ip_address?: string}, billing?: array{invoice?: array{custom_fields?: array{name: string, value: string}[], footer?: string, next_sequence?: int, prefix?: string, rendering?: array{amount_tax_display?: string, template?: string}}}, capabilities?: array{automatic_indirect_tax?: array{requested: bool}}, shipping?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name?: string, phone?: string}, test_clock?: string}, merchant?: array{bacs_debit_payments?: array{display_name?: string}, branding?: array{icon?: string, logo?: string, primary_color?: string, secondary_color?: string}, capabilities?: array{ach_debit_payments?: array{requested: bool}, acss_debit_payments?: array{requested: bool}, affirm_payments?: array{requested: bool}, afterpay_clearpay_payments?: array{requested: bool}, alma_payments?: array{requested: bool}, amazon_pay_payments?: array{requested: bool}, au_becs_debit_payments?: array{requested: bool}, bacs_debit_payments?: array{requested: bool}, bancontact_payments?: array{requested: bool}, blik_payments?: array{requested: bool}, boleto_payments?: array{requested: bool}, card_payments?: array{requested: bool}, cartes_bancaires_payments?: array{requested: bool}, cashapp_payments?: array{requested: bool}, eps_payments?: array{requested: bool}, fpx_payments?: array{requested: bool}, gb_bank_transfer_payments?: array{requested: bool}, grabpay_payments?: array{requested: bool}, ideal_payments?: array{requested: bool}, jcb_payments?: array{requested: bool}, jp_bank_transfer_payments?: array{requested: bool}, kakao_pay_payments?: array{requested: bool}, klarna_payments?: array{requested: bool}, konbini_payments?: array{requested: bool}, kr_card_payments?: array{requested: bool}, link_payments?: array{requested: bool}, mobilepay_payments?: array{requested: bool}, multibanco_payments?: array{requested: bool}, mx_bank_transfer_payments?: array{requested: bool}, naver_pay_payments?: array{requested: bool}, oxxo_payments?: array{requested: bool}, p24_payments?: array{requested: bool}, pay_by_bank_payments?: array{requested: bool}, payco_payments?: array{requested: bool}, paynow_payments?: array{requested: bool}, promptpay_payments?: array{requested: bool}, revolut_pay_payments?: array{requested: bool}, samsung_pay_payments?: array{requested: bool}, sepa_bank_transfer_payments?: array{requested: bool}, sepa_debit_payments?: array{requested: bool}, swish_payments?: array{requested: bool}, twint_payments?: array{requested: bool}, us_bank_transfer_payments?: array{requested: bool}, zip_payments?: array{requested: bool}}, card_payments?: array{decline_on?: array{avs_failure?: bool, cvc_failure?: bool}}, konbini_payments?: array{support?: array{email?: string, hours?: array{end_time?: string, start_time?: string}, phone?: string}}, mcc?: string, script_statement_descriptor?: array{kana?: array{descriptor?: string, prefix?: string}, kanji?: array{descriptor?: string, prefix?: string}}, statement_descriptor?: array{descriptor?: string, prefix?: string}, support?: array{address?: array{city?: string, country: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, email?: string, phone?: string, url?: string}}, recipient?: array{capabilities?: array{stripe_balance?: array{stripe_transfers?: array{requested: bool}}}}}, contact_email?: string, contact_phone?: string, dashboard?: string, defaults?: array{currency?: string, locales?: string[], profile?: array{business_url?: string, doing_business_as?: string, product_description?: string}, responsibilities?: array{fees_collector: string, losses_collector: string}}, display_name?: string, identity?: array{attestations?: array{directorship_declaration?: array{date?: string, ip?: string, user_agent?: string}, ownership_declaration?: array{date?: string, ip?: string, user_agent?: string}, persons_provided?: array{directors?: bool, executives?: bool, owners?: bool, ownership_exemption_reason?: string}, representative_declaration?: array{date?: string, ip?: string, user_agent?: string}, terms_of_service?: array{account?: array{date: string, ip: string, user_agent?: string}}}, business_details?: array{address?: array{city?: string, country: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, annual_revenue?: array{amount?: array{value?: int, currency?: string}, fiscal_year_end?: string}, documents?: array{bank_account_ownership_verification?: array{files: string[], type: string}, company_license?: array{files: string[], type: string}, company_memorandum_of_association?: array{files: string[], type: string}, company_ministerial_decree?: array{files: string[], type: string}, company_registration_verification?: array{files: string[], type: string}, company_tax_id_verification?: array{files: string[], type: string}, primary_verification?: array{front_back: array{back?: string, front: string}, type: string}, proof_of_address?: array{files: string[], type: string}, proof_of_registration?: array{files: string[], type: string}, proof_of_ultimate_beneficial_ownership?: array{files: string[], type: string}}, estimated_worker_count?: int, id_numbers?: array{registrar?: string, type: string, value: string}[], monthly_estimated_revenue?: array{amount?: array{value?: int, currency?: string}}, phone?: string, registered_name?: string, registration_date?: array{day: int, month: int, year: int}, script_addresses?: array{kana?: array{city?: string, country: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, kanji?: array{city?: string, country: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}}, script_names?: array{kana?: array{registered_name?: string}, kanji?: array{registered_name?: string}}, structure?: string}, country?: string, entity_type?: string, individual?: array{additional_addresses?: array{city?: string, country: string, line1?: string, line2?: string, postal_code?: string, purpose: string, state?: string, town?: string}[], additional_names?: array{full_name?: string, given_name?: string, purpose: string, surname?: string}[], address?: array{city?: string, country: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, date_of_birth?: array{day: int, month: int, year: int}, documents?: array{company_authorization?: array{files: string[], type: string}, passport?: array{files: string[], type: string}, primary_verification?: array{front_back: array{back?: string, front: string}, type: string}, secondary_verification?: array{front_back: array{back?: string, front: string}, type: string}, visa?: array{files: string[], type: string}}, email?: string, given_name?: string, id_numbers?: array{type: string, value: string}[], legal_gender?: string, metadata?: array, nationalities?: string[], phone?: string, political_exposure?: string, relationship?: array{director?: bool, executive?: bool, owner?: bool, percent_ownership?: string, title?: string}, script_addresses?: array{kana?: array{city?: string, country: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, kanji?: array{city?: string, country: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}}, script_names?: array{kana?: array{given_name?: string, surname?: string}, kanji?: array{given_name?: string, surname?: string}}, surname?: string}}, include?: string[], metadata?: array} $params + * @param null|array{account_token?: string, configuration?: array{customer?: array{automatic_indirect_tax?: array{exempt?: string, ip_address?: string}, billing?: array{invoice?: array{custom_fields?: array{name: string, value: string}[], footer?: string, next_sequence?: int, prefix?: string, rendering?: array{amount_tax_display?: string, template?: string}}}, capabilities?: array{automatic_indirect_tax?: array{requested: bool}}, shipping?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name?: string, phone?: string}, test_clock?: string}, merchant?: array{bacs_debit_payments?: array{display_name?: string}, branding?: array{icon?: string, logo?: string, primary_color?: string, secondary_color?: string}, capabilities?: array{ach_debit_payments?: array{requested: bool}, acss_debit_payments?: array{requested: bool}, affirm_payments?: array{requested: bool}, afterpay_clearpay_payments?: array{requested: bool}, alma_payments?: array{requested: bool}, amazon_pay_payments?: array{requested: bool}, au_becs_debit_payments?: array{requested: bool}, bacs_debit_payments?: array{requested: bool}, bancontact_payments?: array{requested: bool}, blik_payments?: array{requested: bool}, boleto_payments?: array{requested: bool}, card_payments?: array{requested: bool}, cartes_bancaires_payments?: array{requested: bool}, cashapp_payments?: array{requested: bool}, eps_payments?: array{requested: bool}, fpx_payments?: array{requested: bool}, gb_bank_transfer_payments?: array{requested: bool}, grabpay_payments?: array{requested: bool}, ideal_payments?: array{requested: bool}, jcb_payments?: array{requested: bool}, jp_bank_transfer_payments?: array{requested: bool}, kakao_pay_payments?: array{requested: bool}, klarna_payments?: array{requested: bool}, konbini_payments?: array{requested: bool}, kr_card_payments?: array{requested: bool}, link_payments?: array{requested: bool}, mobilepay_payments?: array{requested: bool}, multibanco_payments?: array{requested: bool}, mx_bank_transfer_payments?: array{requested: bool}, naver_pay_payments?: array{requested: bool}, oxxo_payments?: array{requested: bool}, p24_payments?: array{requested: bool}, pay_by_bank_payments?: array{requested: bool}, payco_payments?: array{requested: bool}, paynow_payments?: array{requested: bool}, promptpay_payments?: array{requested: bool}, revolut_pay_payments?: array{requested: bool}, samsung_pay_payments?: array{requested: bool}, sepa_bank_transfer_payments?: array{requested: bool}, sepa_debit_payments?: array{requested: bool}, swish_payments?: array{requested: bool}, twint_payments?: array{requested: bool}, us_bank_transfer_payments?: array{requested: bool}, zip_payments?: array{requested: bool}}, card_payments?: array{decline_on?: array{avs_failure?: bool, cvc_failure?: bool}}, konbini_payments?: array{support?: array{email?: string, hours?: array{end_time?: string, start_time?: string}, phone?: string}}, mcc?: string, script_statement_descriptor?: array{kana?: array{descriptor?: string, prefix?: string}, kanji?: array{descriptor?: string, prefix?: string}}, statement_descriptor?: array{descriptor?: string, prefix?: string}, support?: array{address?: array{city?: string, country: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, email?: string, phone?: string, url?: string}}, recipient?: array{capabilities?: array{stripe_balance?: array{stripe_transfers?: array{requested: bool}}}}}, contact_email?: string, contact_phone?: string, dashboard?: string, defaults?: array{currency?: string, locales?: string[], profile?: array{business_url?: string, doing_business_as?: string, product_description?: string}, responsibilities?: array{fees_collector: string, losses_collector: string}}, display_name?: string, identity?: array{attestations?: array{directorship_declaration?: array{date?: string, ip?: string, user_agent?: string}, ownership_declaration?: array{date?: string, ip?: string, user_agent?: string}, persons_provided?: array{directors?: bool, executives?: bool, owners?: bool, ownership_exemption_reason?: string}, representative_declaration?: array{date?: string, ip?: string, user_agent?: string}, terms_of_service?: array{account?: array{date: string, ip: string, user_agent?: string}}}, business_details?: array{address?: array{city?: string, country: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, annual_revenue?: array{amount?: \Stripe\StripeObject, fiscal_year_end?: string}, documents?: array{bank_account_ownership_verification?: array{files: string[], type: string}, company_license?: array{files: string[], type: string}, company_memorandum_of_association?: array{files: string[], type: string}, company_ministerial_decree?: array{files: string[], type: string}, company_registration_verification?: array{files: string[], type: string}, company_tax_id_verification?: array{files: string[], type: string}, primary_verification?: array{front_back: array{back?: string, front: string}, type: string}, proof_of_address?: array{files: string[], type: string}, proof_of_registration?: array{files: string[], type: string}, proof_of_ultimate_beneficial_ownership?: array{files: string[], type: string}}, estimated_worker_count?: int, id_numbers?: array{registrar?: string, type: string, value: string}[], monthly_estimated_revenue?: array{amount?: \Stripe\StripeObject}, phone?: string, registered_name?: string, registration_date?: array{day: int, month: int, year: int}, script_addresses?: array{kana?: array{city?: string, country: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, kanji?: array{city?: string, country: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}}, script_names?: array{kana?: array{registered_name?: string}, kanji?: array{registered_name?: string}}, structure?: string}, country?: string, entity_type?: string, individual?: array{additional_addresses?: array{city?: string, country: string, line1?: string, line2?: string, postal_code?: string, purpose: string, state?: string, town?: string}[], additional_names?: array{full_name?: string, given_name?: string, purpose: string, surname?: string}[], address?: array{city?: string, country: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, date_of_birth?: array{day: int, month: int, year: int}, documents?: array{company_authorization?: array{files: string[], type: string}, passport?: array{files: string[], type: string}, primary_verification?: array{front_back: array{back?: string, front: string}, type: string}, secondary_verification?: array{front_back: array{back?: string, front: string}, type: string}, visa?: array{files: string[], type: string}}, email?: string, given_name?: string, id_numbers?: array{type: string, value: string}[], legal_gender?: string, metadata?: array, nationalities?: string[], phone?: string, political_exposure?: string, relationship?: array{director?: bool, executive?: bool, owner?: bool, percent_ownership?: string, title?: string}, script_addresses?: array{kana?: array{city?: string, country: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, kanji?: array{city?: string, country: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}}, script_names?: array{kana?: array{given_name?: string, surname?: string}, kanji?: array{given_name?: string, surname?: string}}, surname?: string}}, include?: string[], metadata?: array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\V2\Core\Account * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @throws \Stripe\Exception\RateLimitException */ public function create($params = null, $opts = null) { - return $this->request('post', '/v2/core/accounts', $params, $opts); + return $this->request('post', '/v2/core/accounts', $params, $opts, [ + 'request_schema' => [ + 'kind' => 'object', + 'fields' => [ + 'identity' => [ + 'kind' => 'object', + 'fields' => [ + 'individual' => [ + 'kind' => 'object', + 'fields' => [ + 'relationship' => [ + 'kind' => 'object', + 'fields' => [ + 'percent_ownership' => [ + 'kind' => 'decimal_string', + ], + ], + ], + ], + ], + ], + ], + ], + ], + 'response_schema' => [ + 'kind' => 'object', + 'fields' => [ + 'identity' => [ + 'kind' => 'object', + 'fields' => [ + 'individual' => [ + 'kind' => 'object', + 'fields' => [ + 'relationship' => [ + 'kind' => 'object', + 'fields' => [ + 'percent_ownership' => [ + 'kind' => 'decimal_string', + ], + ], + ], + ], + ], + ], + ], + ], + ], + ]); } /** @@ -82,27 +185,98 @@ class AccountService extends \Stripe\Service\AbstractService * * @return \Stripe\V2\Core\Account * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @throws \Stripe\Exception\RateLimitException */ public function retrieve($id, $params = null, $opts = null) { - return $this->request('get', $this->buildPath('/v2/core/accounts/%s', $id), $params, $opts); + return $this->request('get', $this->buildPath('/v2/core/accounts/%s', $id), $params, $opts, [ + 'response_schema' => [ + 'kind' => 'object', + 'fields' => [ + 'identity' => [ + 'kind' => 'object', + 'fields' => [ + 'individual' => [ + 'kind' => 'object', + 'fields' => [ + 'relationship' => [ + 'kind' => 'object', + 'fields' => [ + 'percent_ownership' => [ + 'kind' => 'decimal_string', + ], + ], + ], + ], + ], + ], + ], + ], + ], + ]); } /** * Updates the details of an Account. * * @param string $id - * @param null|array{account_token?: string, configuration?: array{customer?: array{applied?: bool, automatic_indirect_tax?: array{exempt?: string, ip_address?: string, validate_location?: string}, billing?: array{default_payment_method?: string, invoice?: array{custom_fields?: array{name: string, value: string}[], footer?: string, next_sequence?: int, prefix?: string, rendering?: array{amount_tax_display?: string, template?: string}}}, capabilities?: array{automatic_indirect_tax?: array{requested?: bool}}, shipping?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name?: string, phone?: string}, test_clock?: string}, merchant?: array{applied?: bool, bacs_debit_payments?: array{display_name?: string}, branding?: array{icon?: string, logo?: string, primary_color?: string, secondary_color?: string}, capabilities?: array{ach_debit_payments?: array{requested?: bool}, acss_debit_payments?: array{requested?: bool}, affirm_payments?: array{requested?: bool}, afterpay_clearpay_payments?: array{requested?: bool}, alma_payments?: array{requested?: bool}, amazon_pay_payments?: array{requested?: bool}, au_becs_debit_payments?: array{requested?: bool}, bacs_debit_payments?: array{requested?: bool}, bancontact_payments?: array{requested?: bool}, blik_payments?: array{requested?: bool}, boleto_payments?: array{requested?: bool}, card_payments?: array{requested?: bool}, cartes_bancaires_payments?: array{requested?: bool}, cashapp_payments?: array{requested?: bool}, eps_payments?: array{requested?: bool}, fpx_payments?: array{requested?: bool}, gb_bank_transfer_payments?: array{requested?: bool}, grabpay_payments?: array{requested?: bool}, ideal_payments?: array{requested?: bool}, jcb_payments?: array{requested?: bool}, jp_bank_transfer_payments?: array{requested?: bool}, kakao_pay_payments?: array{requested?: bool}, klarna_payments?: array{requested?: bool}, konbini_payments?: array{requested?: bool}, kr_card_payments?: array{requested?: bool}, link_payments?: array{requested?: bool}, mobilepay_payments?: array{requested?: bool}, multibanco_payments?: array{requested?: bool}, mx_bank_transfer_payments?: array{requested?: bool}, naver_pay_payments?: array{requested?: bool}, oxxo_payments?: array{requested?: bool}, p24_payments?: array{requested?: bool}, pay_by_bank_payments?: array{requested?: bool}, payco_payments?: array{requested?: bool}, paynow_payments?: array{requested?: bool}, promptpay_payments?: array{requested?: bool}, revolut_pay_payments?: array{requested?: bool}, samsung_pay_payments?: array{requested?: bool}, sepa_bank_transfer_payments?: array{requested?: bool}, sepa_debit_payments?: array{requested?: bool}, swish_payments?: array{requested?: bool}, twint_payments?: array{requested?: bool}, us_bank_transfer_payments?: array{requested?: bool}, zip_payments?: array{requested?: bool}}, card_payments?: array{decline_on?: array{avs_failure?: bool, cvc_failure?: bool}}, konbini_payments?: array{support?: array{email?: string, hours?: array{end_time?: string, start_time?: string}, phone?: string}}, mcc?: string, script_statement_descriptor?: array{kana?: array{descriptor?: string, prefix?: string}, kanji?: array{descriptor?: string, prefix?: string}}, statement_descriptor?: array{descriptor?: string, prefix?: string}, support?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, email?: string, phone?: string, url?: string}}, recipient?: array{applied?: bool, capabilities?: array{stripe_balance?: array{stripe_transfers?: array{requested?: bool}}}}}, contact_email?: string, contact_phone?: string, dashboard?: string, defaults?: array{currency?: string, locales?: string[], profile?: array{business_url?: string, doing_business_as?: string, product_description?: string}, responsibilities?: array{fees_collector: string, losses_collector: string}}, display_name?: string, identity?: array{attestations?: array{directorship_declaration?: array{date?: string, ip?: string, user_agent?: string}, ownership_declaration?: array{date?: string, ip?: string, user_agent?: string}, persons_provided?: array{directors?: bool, executives?: bool, owners?: bool, ownership_exemption_reason?: string}, representative_declaration?: array{date?: string, ip?: string, user_agent?: string}, terms_of_service?: array{account?: array{date?: string, ip?: string, user_agent?: string}, crypto_storer?: array{date?: string, ip?: string, user_agent?: string}, storer?: array{date?: string, ip?: string, user_agent?: string}}}, business_details?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, annual_revenue?: array{amount?: array{value?: int, currency?: string}, fiscal_year_end?: string}, documents?: array{bank_account_ownership_verification?: array{files: string[], type: string}, company_license?: array{files: string[], type: string}, company_memorandum_of_association?: array{files: string[], type: string}, company_ministerial_decree?: array{files: string[], type: string}, company_registration_verification?: array{files: string[], type: string}, company_tax_id_verification?: array{files: string[], type: string}, primary_verification?: array{front_back: array{back?: string, front?: string}, type: string}, proof_of_address?: array{files: string[], type: string}, proof_of_registration?: array{files: string[], type: string}, proof_of_ultimate_beneficial_ownership?: array{files: string[], type: string}}, estimated_worker_count?: int, id_numbers?: array{registrar?: string, type: string, value: string}[], monthly_estimated_revenue?: array{amount?: array{value?: int, currency?: string}}, phone?: string, registered_name?: string, registration_date?: array{day: int, month: int, year: int}, script_addresses?: array{kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}}, script_names?: array{kana?: array{registered_name?: string}, kanji?: array{registered_name?: string}}, structure?: string}, country?: string, entity_type?: string, individual?: array{additional_addresses?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, purpose: string, state?: string, town?: string}[], additional_names?: array{full_name?: string, given_name?: string, purpose: string, surname?: string}[], address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, date_of_birth?: array{day: int, month: int, year: int}, documents?: array{company_authorization?: array{files: string[], type: string}, passport?: array{files: string[], type: string}, primary_verification?: array{front_back: array{back?: string, front?: string}, type: string}, secondary_verification?: array{front_back: array{back?: string, front?: string}, type: string}, visa?: array{files: string[], type: string}}, email?: string, given_name?: string, id_numbers?: array{type: string, value: string}[], legal_gender?: string, metadata?: array, nationalities?: string[], phone?: string, political_exposure?: string, relationship?: array{director?: bool, executive?: bool, owner?: bool, percent_ownership?: string, title?: string}, script_addresses?: array{kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}}, script_names?: array{kana?: array{given_name?: string, surname?: string}, kanji?: array{given_name?: string, surname?: string}}, surname?: string}}, include?: string[], metadata?: array} $params + * @param null|array{account_token?: string, configuration?: array{customer?: array{applied?: bool, automatic_indirect_tax?: array{exempt?: string, ip_address?: string, validate_location?: string}, billing?: array{default_payment_method?: string, invoice?: array{custom_fields?: array{name: string, value: string}[], footer?: string, next_sequence?: int, prefix?: string, rendering?: array{amount_tax_display?: string, template?: string}}}, capabilities?: array{automatic_indirect_tax?: array{requested?: bool}}, shipping?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, name?: string, phone?: string}, test_clock?: string}, merchant?: array{applied?: bool, bacs_debit_payments?: array{display_name?: string}, branding?: array{icon?: string, logo?: string, primary_color?: string, secondary_color?: string}, capabilities?: array{ach_debit_payments?: array{requested?: bool}, acss_debit_payments?: array{requested?: bool}, affirm_payments?: array{requested?: bool}, afterpay_clearpay_payments?: array{requested?: bool}, alma_payments?: array{requested?: bool}, amazon_pay_payments?: array{requested?: bool}, au_becs_debit_payments?: array{requested?: bool}, bacs_debit_payments?: array{requested?: bool}, bancontact_payments?: array{requested?: bool}, blik_payments?: array{requested?: bool}, boleto_payments?: array{requested?: bool}, card_payments?: array{requested?: bool}, cartes_bancaires_payments?: array{requested?: bool}, cashapp_payments?: array{requested?: bool}, eps_payments?: array{requested?: bool}, fpx_payments?: array{requested?: bool}, gb_bank_transfer_payments?: array{requested?: bool}, grabpay_payments?: array{requested?: bool}, ideal_payments?: array{requested?: bool}, jcb_payments?: array{requested?: bool}, jp_bank_transfer_payments?: array{requested?: bool}, kakao_pay_payments?: array{requested?: bool}, klarna_payments?: array{requested?: bool}, konbini_payments?: array{requested?: bool}, kr_card_payments?: array{requested?: bool}, link_payments?: array{requested?: bool}, mobilepay_payments?: array{requested?: bool}, multibanco_payments?: array{requested?: bool}, mx_bank_transfer_payments?: array{requested?: bool}, naver_pay_payments?: array{requested?: bool}, oxxo_payments?: array{requested?: bool}, p24_payments?: array{requested?: bool}, pay_by_bank_payments?: array{requested?: bool}, payco_payments?: array{requested?: bool}, paynow_payments?: array{requested?: bool}, promptpay_payments?: array{requested?: bool}, revolut_pay_payments?: array{requested?: bool}, samsung_pay_payments?: array{requested?: bool}, sepa_bank_transfer_payments?: array{requested?: bool}, sepa_debit_payments?: array{requested?: bool}, swish_payments?: array{requested?: bool}, twint_payments?: array{requested?: bool}, us_bank_transfer_payments?: array{requested?: bool}, zip_payments?: array{requested?: bool}}, card_payments?: array{decline_on?: array{avs_failure?: bool, cvc_failure?: bool}}, konbini_payments?: array{support?: array{email?: string, hours?: array{end_time?: string, start_time?: string}, phone?: string}}, mcc?: string, script_statement_descriptor?: array{kana?: array{descriptor?: string, prefix?: string}, kanji?: array{descriptor?: string, prefix?: string}}, statement_descriptor?: array{descriptor?: string, prefix?: string}, support?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, email?: string, phone?: string, url?: string}}, recipient?: array{applied?: bool, capabilities?: array{stripe_balance?: array{stripe_transfers?: array{requested?: bool}}}}}, contact_email?: string, contact_phone?: string, dashboard?: string, defaults?: array{currency?: string, locales?: string[], profile?: array{business_url?: string, doing_business_as?: string, product_description?: string}, responsibilities?: array{fees_collector: string, losses_collector: string}}, display_name?: string, identity?: array{attestations?: array{directorship_declaration?: array{date?: string, ip?: string, user_agent?: string}, ownership_declaration?: array{date?: string, ip?: string, user_agent?: string}, persons_provided?: array{directors?: bool, executives?: bool, owners?: bool, ownership_exemption_reason?: string}, representative_declaration?: array{date?: string, ip?: string, user_agent?: string}, terms_of_service?: array{account?: array{date?: string, ip?: string, user_agent?: string}, crypto_storer?: array{date?: string, ip?: string, user_agent?: string}, storer?: array{date?: string, ip?: string, user_agent?: string}}}, business_details?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, annual_revenue?: array{amount?: \Stripe\StripeObject, fiscal_year_end?: string}, documents?: array{bank_account_ownership_verification?: array{files: string[], type: string}, company_license?: array{files: string[], type: string}, company_memorandum_of_association?: array{files: string[], type: string}, company_ministerial_decree?: array{files: string[], type: string}, company_registration_verification?: array{files: string[], type: string}, company_tax_id_verification?: array{files: string[], type: string}, primary_verification?: array{front_back: array{back?: string, front?: string}, type: string}, proof_of_address?: array{files: string[], type: string}, proof_of_registration?: array{files: string[], type: string}, proof_of_ultimate_beneficial_ownership?: array{files: string[], type: string}}, estimated_worker_count?: int, id_numbers?: array{registrar?: string, type: string, value: string}[], monthly_estimated_revenue?: array{amount?: \Stripe\StripeObject}, phone?: string, registered_name?: string, registration_date?: array{day: int, month: int, year: int}, script_addresses?: array{kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}}, script_names?: array{kana?: array{registered_name?: string}, kanji?: array{registered_name?: string}}, structure?: string}, country?: string, entity_type?: string, individual?: array{additional_addresses?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, purpose: string, state?: string, town?: string}[], additional_names?: array{full_name?: string, given_name?: string, purpose: string, surname?: string}[], address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, date_of_birth?: array{day: int, month: int, year: int}, documents?: array{company_authorization?: array{files: string[], type: string}, passport?: array{files: string[], type: string}, primary_verification?: array{front_back: array{back?: string, front?: string}, type: string}, secondary_verification?: array{front_back: array{back?: string, front?: string}, type: string}, visa?: array{files: string[], type: string}}, email?: string, given_name?: string, id_numbers?: array{type: string, value: string}[], legal_gender?: string, metadata?: array, nationalities?: string[], phone?: string, political_exposure?: string, relationship?: array{director?: bool, executive?: bool, owner?: bool, percent_ownership?: string, title?: string}, script_addresses?: array{kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}}, script_names?: array{kana?: array{given_name?: string, surname?: string}, kanji?: array{given_name?: string, surname?: string}}, surname?: string}}, include?: string[], metadata?: array} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\V2\Core\Account * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @throws \Stripe\Exception\RateLimitException */ public function update($id, $params = null, $opts = null) { - return $this->request('post', $this->buildPath('/v2/core/accounts/%s', $id), $params, $opts); + return $this->request('post', $this->buildPath('/v2/core/accounts/%s', $id), $params, $opts, [ + 'request_schema' => [ + 'kind' => 'object', + 'fields' => [ + 'identity' => [ + 'kind' => 'object', + 'fields' => [ + 'individual' => [ + 'kind' => 'object', + 'fields' => [ + 'relationship' => [ + 'kind' => 'object', + 'fields' => [ + 'percent_ownership' => [ + 'kind' => 'decimal_string', + ], + ], + ], + ], + ], + ], + ], + ], + ], + 'response_schema' => [ + 'kind' => 'object', + 'fields' => [ + 'identity' => [ + 'kind' => 'object', + 'fields' => [ + 'individual' => [ + 'kind' => 'object', + 'fields' => [ + 'relationship' => [ + 'kind' => 'object', + 'fields' => [ + 'percent_ownership' => [ + 'kind' => 'decimal_string', + ], + ], + ], + ], + ], + ], + ], + ], + ], + ]); } protected function getServiceClass($name) diff --git a/plugins/stripe-php/lib/Service/V2/Core/AccountTokenService.php b/plugins/stripe-php/lib/Service/V2/Core/AccountTokenService.php index de59b857..647f1273 100644 --- a/plugins/stripe-php/lib/Service/V2/Core/AccountTokenService.php +++ b/plugins/stripe-php/lib/Service/V2/Core/AccountTokenService.php @@ -14,16 +14,40 @@ class AccountTokenService extends \Stripe\Service\AbstractService /** * Creates an Account Token. * - * @param null|array{contact_email?: string, contact_phone?: string, display_name?: string, identity?: array{attestations?: array{directorship_declaration?: array{attested?: bool}, ownership_declaration?: array{attested?: bool}, persons_provided?: array{directors?: bool, executives?: bool, owners?: bool, ownership_exemption_reason?: string}, representative_declaration?: array{attested?: bool}, terms_of_service?: array{account?: array{shown_and_accepted?: bool}}}, business_details?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, annual_revenue?: array{amount?: array{value?: int, currency?: string}, fiscal_year_end?: string}, documents?: array{bank_account_ownership_verification?: array{files: string[], type: string}, company_license?: array{files: string[], type: string}, company_memorandum_of_association?: array{files: string[], type: string}, company_ministerial_decree?: array{files: string[], type: string}, company_registration_verification?: array{files: string[], type: string}, company_tax_id_verification?: array{files: string[], type: string}, primary_verification?: array{front_back: array{back?: string, front?: string}, type: string}, proof_of_address?: array{files: string[], type: string}, proof_of_registration?: array{files: string[], type: string}, proof_of_ultimate_beneficial_ownership?: array{files: string[], type: string}}, estimated_worker_count?: int, id_numbers?: array{registrar?: string, type: string, value: string}[], monthly_estimated_revenue?: array{amount?: array{value?: int, currency?: string}}, phone?: string, registered_name?: string, registration_date?: array{day: int, month: int, year: int}, script_addresses?: array{kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}}, script_names?: array{kana?: array{registered_name?: string}, kanji?: array{registered_name?: string}}, structure?: string}, entity_type?: string, individual?: array{additional_addresses?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, purpose: string, state?: string, town?: string}[], additional_names?: array{full_name?: string, given_name?: string, purpose: string, surname?: string}[], address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, date_of_birth?: array{day: int, month: int, year: int}, documents?: array{company_authorization?: array{files: string[], type: string}, passport?: array{files: string[], type: string}, primary_verification?: array{front_back: array{back?: string, front?: string}, type: string}, secondary_verification?: array{front_back: array{back?: string, front?: string}, type: string}, visa?: array{files: string[], type: string}}, email?: string, given_name?: string, id_numbers?: array{type: string, value: string}[], legal_gender?: string, metadata?: array, nationalities?: string[], phone?: string, political_exposure?: string, relationship?: array{director?: bool, executive?: bool, owner?: bool, percent_ownership?: string, title?: string}, script_addresses?: array{kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}}, script_names?: array{kana?: array{given_name?: string, surname?: string}, kanji?: array{given_name?: string, surname?: string}}, surname?: string}}} $params + * @param null|array{contact_email?: string, contact_phone?: string, display_name?: string, identity?: array{attestations?: array{directorship_declaration?: array{attested?: bool}, ownership_declaration?: array{attested?: bool}, persons_provided?: array{directors?: bool, executives?: bool, owners?: bool, ownership_exemption_reason?: string}, representative_declaration?: array{attested?: bool}, terms_of_service?: array{account?: array{shown_and_accepted?: bool}}}, business_details?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, annual_revenue?: array{amount?: \Stripe\StripeObject, fiscal_year_end?: string}, documents?: array{bank_account_ownership_verification?: array{files: string[], type: string}, company_license?: array{files: string[], type: string}, company_memorandum_of_association?: array{files: string[], type: string}, company_ministerial_decree?: array{files: string[], type: string}, company_registration_verification?: array{files: string[], type: string}, company_tax_id_verification?: array{files: string[], type: string}, primary_verification?: array{front_back: array{back?: string, front?: string}, type: string}, proof_of_address?: array{files: string[], type: string}, proof_of_registration?: array{files: string[], type: string}, proof_of_ultimate_beneficial_ownership?: array{files: string[], type: string}}, estimated_worker_count?: int, id_numbers?: array{registrar?: string, type: string, value: string}[], monthly_estimated_revenue?: array{amount?: \Stripe\StripeObject}, phone?: string, registered_name?: string, registration_date?: array{day: int, month: int, year: int}, script_addresses?: array{kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}}, script_names?: array{kana?: array{registered_name?: string}, kanji?: array{registered_name?: string}}, structure?: string}, entity_type?: string, individual?: array{additional_addresses?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, purpose: string, state?: string, town?: string}[], additional_names?: array{full_name?: string, given_name?: string, purpose: string, surname?: string}[], address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, date_of_birth?: array{day: int, month: int, year: int}, documents?: array{company_authorization?: array{files: string[], type: string}, passport?: array{files: string[], type: string}, primary_verification?: array{front_back: array{back?: string, front?: string}, type: string}, secondary_verification?: array{front_back: array{back?: string, front?: string}, type: string}, visa?: array{files: string[], type: string}}, email?: string, given_name?: string, id_numbers?: array{type: string, value: string}[], legal_gender?: string, metadata?: array, nationalities?: string[], phone?: string, political_exposure?: string, relationship?: array{director?: bool, executive?: bool, owner?: bool, percent_ownership?: string, title?: string}, script_addresses?: array{kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}}, script_names?: array{kana?: array{given_name?: string, surname?: string}, kanji?: array{given_name?: string, surname?: string}}, surname?: string}}} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\V2\Core\AccountToken * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @throws \Stripe\Exception\RateLimitException */ public function create($params = null, $opts = null) { - return $this->request('post', '/v2/core/account_tokens', $params, $opts); + return $this->request('post', '/v2/core/account_tokens', $params, $opts, [ + 'request_schema' => [ + 'kind' => 'object', + 'fields' => [ + 'identity' => [ + 'kind' => 'object', + 'fields' => [ + 'individual' => [ + 'kind' => 'object', + 'fields' => [ + 'relationship' => [ + 'kind' => 'object', + 'fields' => [ + 'percent_ownership' => [ + 'kind' => 'decimal_string', + ], + ], + ], + ], + ], + ], + ], + ], + ], + ]); } /** @@ -35,7 +59,7 @@ class AccountTokenService extends \Stripe\Service\AbstractService * * @return \Stripe\V2\Core\AccountToken * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @throws \Stripe\Exception\RateLimitException */ public function retrieve($id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/Service/V2/Core/Accounts/PersonService.php b/plugins/stripe-php/lib/Service/V2/Core/Accounts/PersonService.php index f55768b2..dc0fa77a 100644 --- a/plugins/stripe-php/lib/Service/V2/Core/Accounts/PersonService.php +++ b/plugins/stripe-php/lib/Service/V2/Core/Accounts/PersonService.php @@ -20,11 +20,33 @@ class PersonService extends \Stripe\Service\AbstractService * * @return \Stripe\V2\Collection<\Stripe\V2\Core\AccountPerson> * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @throws \Stripe\Exception\RateLimitException */ public function all($id, $params = null, $opts = null) { - return $this->requestCollection('get', $this->buildPath('/v2/core/accounts/%s/persons', $id), $params, $opts); + return $this->requestCollection('get', $this->buildPath('/v2/core/accounts/%s/persons', $id), $params, $opts, [ + 'response_schema' => [ + 'kind' => 'object', + 'fields' => [ + 'data' => [ + 'kind' => 'array', + 'element' => [ + 'kind' => 'object', + 'fields' => [ + 'relationship' => [ + 'kind' => 'object', + 'fields' => [ + 'percent_ownership' => [ + 'kind' => 'decimal_string', + ], + ], + ], + ], + ], + ], + ], + ], + ]); } /** @@ -37,11 +59,34 @@ class PersonService extends \Stripe\Service\AbstractService * * @return \Stripe\V2\Core\AccountPerson * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @throws \Stripe\Exception\RateLimitException */ public function create($id, $params = null, $opts = null) { - return $this->request('post', $this->buildPath('/v2/core/accounts/%s/persons', $id), $params, $opts); + return $this->request('post', $this->buildPath('/v2/core/accounts/%s/persons', $id), $params, $opts, [ + 'request_schema' => [ + 'kind' => 'object', + 'fields' => [ + 'relationship' => [ + 'kind' => 'object', + 'fields' => [ + 'percent_ownership' => ['kind' => 'decimal_string'], + ], + ], + ], + ], + 'response_schema' => [ + 'kind' => 'object', + 'fields' => [ + 'relationship' => [ + 'kind' => 'object', + 'fields' => [ + 'percent_ownership' => ['kind' => 'decimal_string'], + ], + ], + ], + ], + ]); } /** @@ -54,7 +99,7 @@ class PersonService extends \Stripe\Service\AbstractService * * @return \Stripe\V2\DeletedObject * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @throws \Stripe\Exception\RateLimitException */ public function delete($parentId, $id, $params = null, $opts = null) { @@ -71,11 +116,23 @@ class PersonService extends \Stripe\Service\AbstractService * * @return \Stripe\V2\Core\AccountPerson * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @throws \Stripe\Exception\RateLimitException */ public function retrieve($parentId, $id, $params = null, $opts = null) { - return $this->request('get', $this->buildPath('/v2/core/accounts/%s/persons/%s', $parentId, $id), $params, $opts); + return $this->request('get', $this->buildPath('/v2/core/accounts/%s/persons/%s', $parentId, $id), $params, $opts, [ + 'response_schema' => [ + 'kind' => 'object', + 'fields' => [ + 'relationship' => [ + 'kind' => 'object', + 'fields' => [ + 'percent_ownership' => ['kind' => 'decimal_string'], + ], + ], + ], + ], + ]); } /** @@ -88,10 +145,33 @@ class PersonService extends \Stripe\Service\AbstractService * * @return \Stripe\V2\Core\AccountPerson * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @throws \Stripe\Exception\RateLimitException */ public function update($parentId, $id, $params = null, $opts = null) { - return $this->request('post', $this->buildPath('/v2/core/accounts/%s/persons/%s', $parentId, $id), $params, $opts); + return $this->request('post', $this->buildPath('/v2/core/accounts/%s/persons/%s', $parentId, $id), $params, $opts, [ + 'request_schema' => [ + 'kind' => 'object', + 'fields' => [ + 'relationship' => [ + 'kind' => 'object', + 'fields' => [ + 'percent_ownership' => ['kind' => 'decimal_string'], + ], + ], + ], + ], + 'response_schema' => [ + 'kind' => 'object', + 'fields' => [ + 'relationship' => [ + 'kind' => 'object', + 'fields' => [ + 'percent_ownership' => ['kind' => 'decimal_string'], + ], + ], + ], + ], + ]); } } diff --git a/plugins/stripe-php/lib/Service/V2/Core/Accounts/PersonTokenService.php b/plugins/stripe-php/lib/Service/V2/Core/Accounts/PersonTokenService.php index 081fc43a..1b0394a7 100644 --- a/plugins/stripe-php/lib/Service/V2/Core/Accounts/PersonTokenService.php +++ b/plugins/stripe-php/lib/Service/V2/Core/Accounts/PersonTokenService.php @@ -20,11 +20,23 @@ class PersonTokenService extends \Stripe\Service\AbstractService * * @return \Stripe\V2\Core\AccountPersonToken * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @throws \Stripe\Exception\RateLimitException */ public function create($id, $params = null, $opts = null) { - return $this->request('post', $this->buildPath('/v2/core/accounts/%s/person_tokens', $id), $params, $opts); + return $this->request('post', $this->buildPath('/v2/core/accounts/%s/person_tokens', $id), $params, $opts, [ + 'request_schema' => [ + 'kind' => 'object', + 'fields' => [ + 'relationship' => [ + 'kind' => 'object', + 'fields' => [ + 'percent_ownership' => ['kind' => 'decimal_string'], + ], + ], + ], + ], + ]); } /** @@ -37,7 +49,7 @@ class PersonTokenService extends \Stripe\Service\AbstractService * * @return \Stripe\V2\Core\AccountPersonToken * - * @throws \Stripe\Exception\ApiErrorException if the request fails + * @throws \Stripe\Exception\RateLimitException */ public function retrieve($parentId, $id, $params = null, $opts = null) { diff --git a/plugins/stripe-php/lib/SetupAttempt.php b/plugins/stripe-php/lib/SetupAttempt.php index a5d42093..37667353 100644 --- a/plugins/stripe-php/lib/SetupAttempt.php +++ b/plugins/stripe-php/lib/SetupAttempt.php @@ -18,10 +18,10 @@ namespace Stripe; * @property null|Customer|string $customer The value of customer on the SetupIntent at the time of this confirmation. * @property null|string $customer_account The value of customer_account on the SetupIntent at the time of this confirmation. * @property null|string[] $flow_directions

Indicates the directions of money movement for which this payment method is intended to be used.

Include inbound if you intend to use the payment method as the origin to pull funds from. Include outbound if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes.

- * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|Account|string $on_behalf_of The value of on_behalf_of on the SetupIntent at the time of this confirmation. * @property PaymentMethod|string $payment_method ID of the payment method used with this SetupAttempt. - * @property (object{acss_debit?: (object{}&StripeObject), amazon_pay?: (object{}&StripeObject), au_becs_debit?: (object{}&StripeObject), bacs_debit?: (object{}&StripeObject), bancontact?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, preferred_language: null|string, verified_name: null|string}&StripeObject), boleto?: (object{}&StripeObject), card?: (object{brand: null|string, checks: null|(object{address_line1_check: null|string, address_postal_code_check: null|string, cvc_check: null|string}&StripeObject), country: null|string, description?: null|string, exp_month: null|int, exp_year: null|int, fingerprint?: null|string, funding: null|string, iin?: null|string, issuer?: null|string, last4: null|string, network: null|string, three_d_secure: null|(object{authentication_flow: null|string, electronic_commerce_indicator: null|string, result: null|string, result_reason: null|string, transaction_id: null|string, version: null|string}&StripeObject), wallet: null|(object{apple_pay?: (object{}&StripeObject), google_pay?: (object{}&StripeObject), type: string}&StripeObject)}&StripeObject), card_present?: (object{generated_card: null|PaymentMethod|string, offline: null|(object{stored_at: null|int, type: null|string}&StripeObject)}&StripeObject), cashapp?: (object{}&StripeObject), ideal?: (object{bank: null|string, bic: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, verified_name: null|string}&StripeObject), kakao_pay?: (object{}&StripeObject), klarna?: (object{}&StripeObject), kr_card?: (object{}&StripeObject), link?: (object{}&StripeObject), naver_pay?: (object{buyer_id?: string}&StripeObject), nz_bank_account?: (object{}&StripeObject), paypal?: (object{}&StripeObject), payto?: (object{}&StripeObject), revolut_pay?: (object{}&StripeObject), sepa_debit?: (object{}&StripeObject), sofort?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, preferred_language: null|string, verified_name: null|string}&StripeObject), type: string, us_bank_account?: (object{}&StripeObject)}&StripeObject) $payment_method_details + * @property (object{acss_debit?: (object{}&StripeObject), amazon_pay?: (object{}&StripeObject), au_becs_debit?: (object{}&StripeObject), bacs_debit?: (object{}&StripeObject), bancontact?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, preferred_language: null|string, verified_name: null|string}&StripeObject), boleto?: (object{}&StripeObject), card?: (object{brand: null|string, checks: null|(object{address_line1_check: null|string, address_postal_code_check: null|string, cvc_check: null|string}&StripeObject), country: null|string, description?: null|string, exp_month: null|int, exp_year: null|int, fingerprint?: null|string, funding: null|string, iin?: null|string, issuer?: null|string, last4: null|string, network: null|string, three_d_secure: null|(object{authentication_flow: null|string, electronic_commerce_indicator: null|string, result: null|string, result_reason: null|string, transaction_id: null|string, version: null|string}&StripeObject), wallet: null|(object{apple_pay?: (object{}&StripeObject), google_pay?: (object{}&StripeObject), type: string}&StripeObject)}&StripeObject), card_present?: (object{generated_card: null|PaymentMethod|string, offline: null|(object{stored_at: null|int, type: null|string}&StripeObject)}&StripeObject), cashapp?: (object{}&StripeObject), ideal?: (object{bank: null|string, bic: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, verified_name: null|string}&StripeObject), kakao_pay?: (object{}&StripeObject), klarna?: (object{}&StripeObject), kr_card?: (object{}&StripeObject), link?: (object{}&StripeObject), naver_pay?: (object{buyer_id?: string}&StripeObject), nz_bank_account?: (object{}&StripeObject), paypal?: (object{}&StripeObject), payto?: (object{}&StripeObject), revolut_pay?: (object{}&StripeObject), sepa_debit?: (object{}&StripeObject), sofort?: (object{bank_code: null|string, bank_name: null|string, bic: null|string, generated_sepa_debit: null|PaymentMethod|string, generated_sepa_debit_mandate: null|Mandate|string, iban_last4: null|string, preferred_language: null|string, verified_name: null|string}&StripeObject), type: string, upi?: (object{}&StripeObject), us_bank_account?: (object{}&StripeObject)}&StripeObject) $payment_method_details * @property null|(object{advice_code?: string, charge?: string, code?: string, decline_code?: string, doc_url?: string, message?: string, network_advice_code?: string, network_decline_code?: string, param?: string, payment_intent?: PaymentIntent, payment_method?: PaymentMethod, payment_method_type?: string, request_log_url?: string, setup_intent?: SetupIntent, source?: Account|BankAccount|Card|Source, type: string}&StripeObject) $setup_error The error encountered during this attempt to confirm the SetupIntent, if any. * @property SetupIntent|string $setup_intent ID of the SetupIntent that this attempt belongs to. * @property string $status Status of this SetupAttempt, one of requires_confirmation, requires_action, processing, succeeded, failed, or abandoned. diff --git a/plugins/stripe-php/lib/SetupIntent.php b/plugins/stripe-php/lib/SetupIntent.php index d9328de5..aab66799 100644 --- a/plugins/stripe-php/lib/SetupIntent.php +++ b/plugins/stripe-php/lib/SetupIntent.php @@ -42,14 +42,14 @@ namespace Stripe; * @property null|string[] $flow_directions

Indicates the directions of money movement for which this payment method is intended to be used.

Include inbound if you intend to use the payment method as the origin to pull funds from. Include outbound if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes.

* @property null|(object{advice_code?: string, charge?: string, code?: string, decline_code?: string, doc_url?: string, message?: string, network_advice_code?: string, network_decline_code?: string, param?: string, payment_intent?: PaymentIntent, payment_method?: PaymentMethod, payment_method_type?: string, request_log_url?: string, setup_intent?: SetupIntent, source?: Account|BankAccount|Card|Source, type: string}&StripeObject) $last_setup_error The error encountered in the previous SetupIntent confirmation. * @property null|SetupAttempt|string $latest_attempt The most recent SetupAttempt for this SetupIntent. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|Mandate|string $mandate ID of the multi use Mandate generated by the SetupIntent. * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|(object{cashapp_handle_redirect_or_display_qr_code?: (object{hosted_instructions_url: string, mobile_auth_url: string, qr_code: (object{expires_at: int, image_url_png: string, image_url_svg: string}&StripeObject)}&StripeObject), redirect_to_url?: (object{return_url: null|string, url: null|string}&StripeObject), type: string, use_stripe_sdk?: StripeObject, verify_with_microdeposits?: (object{arrival_date: int, hosted_verification_url: string, microdeposit_type: null|string}&StripeObject)}&StripeObject) $next_action If present, this property tells you what actions you need to take in order for your customer to continue payment setup. + * @property null|(object{cashapp_handle_redirect_or_display_qr_code?: (object{hosted_instructions_url: string, mobile_auth_url: string, qr_code: (object{expires_at: int, image_url_png: string, image_url_svg: string}&StripeObject)}&StripeObject), redirect_to_url?: (object{return_url: null|string, url: null|string}&StripeObject), type: string, upi_handle_redirect_or_display_qr_code?: (object{hosted_instructions_url: string, qr_code: (object{expires_at: int, image_url_png: string, image_url_svg: string}&StripeObject)}&StripeObject), use_stripe_sdk?: StripeObject, verify_with_microdeposits?: (object{arrival_date: int, hosted_verification_url: string, microdeposit_type: null|string}&StripeObject)}&StripeObject) $next_action If present, this property tells you what actions you need to take in order for your customer to continue payment setup. * @property null|Account|string $on_behalf_of The account (if any) for which the setup is intended. * @property null|PaymentMethod|string $payment_method ID of the payment method used with this SetupIntent. If the payment method is card_present and isn't a digital wallet, then the generated_card associated with the latest_attempt is attached to the Customer instead. * @property null|(object{id: string, parent: null|string}&StripeObject) $payment_method_configuration_details Information about the payment method configuration used for this Setup Intent. - * @property null|(object{acss_debit?: (object{currency: null|string, mandate_options?: (object{custom_mandate_url?: string, default_for?: string[], interval_description: null|string, payment_schedule: null|string, transaction_type: null|string}&StripeObject), verification_method?: string}&StripeObject), amazon_pay?: (object{}&StripeObject), bacs_debit?: (object{mandate_options?: (object{reference_prefix?: string}&StripeObject)}&StripeObject), card?: (object{mandate_options: null|(object{amount: int, amount_type: string, currency: string, description: null|string, end_date: null|int, interval: string, interval_count: null|int, reference: string, start_date: int, supported_types: null|string[]}&StripeObject), network: null|string, request_three_d_secure: null|string}&StripeObject), card_present?: (object{}&StripeObject), klarna?: (object{currency: null|string, preferred_locale: null|string}&StripeObject), link?: (object{persistent_token: null|string}&StripeObject), paypal?: (object{billing_agreement_id: null|string}&StripeObject), payto?: (object{mandate_options?: (object{amount: null|int, amount_type: null|string, end_date: null|string, payment_schedule: null|string, payments_per_period: null|int, purpose: null|string, start_date: null|string}&StripeObject)}&StripeObject), sepa_debit?: (object{mandate_options?: (object{reference_prefix?: string}&StripeObject)}&StripeObject), us_bank_account?: (object{financial_connections?: (object{filters?: (object{account_subcategories?: string[]}&StripeObject), permissions?: string[], prefetch: null|string[], return_url?: string}&StripeObject), mandate_options?: (object{collection_method?: string}&StripeObject), verification_method?: string}&StripeObject)}&StripeObject) $payment_method_options Payment method-specific configuration for this SetupIntent. + * @property null|(object{acss_debit?: (object{currency: null|string, mandate_options?: (object{custom_mandate_url?: string, default_for?: string[], interval_description: null|string, payment_schedule: null|string, transaction_type: null|string}&StripeObject), verification_method?: string}&StripeObject), amazon_pay?: (object{}&StripeObject), bacs_debit?: (object{mandate_options?: (object{reference_prefix?: string}&StripeObject)}&StripeObject), card?: (object{mandate_options: null|(object{amount: int, amount_type: string, currency: string, description: null|string, end_date: null|int, interval: string, interval_count: null|int, reference: string, start_date: int, supported_types: null|string[]}&StripeObject), network: null|string, request_three_d_secure: null|string}&StripeObject), card_present?: (object{}&StripeObject), klarna?: (object{currency: null|string, preferred_locale: null|string}&StripeObject), link?: (object{persistent_token: null|string}&StripeObject), paypal?: (object{billing_agreement_id: null|string}&StripeObject), payto?: (object{mandate_options?: (object{amount: null|int, amount_type: null|string, end_date: null|string, payment_schedule: null|string, payments_per_period: null|int, purpose: null|string, start_date: null|string}&StripeObject)}&StripeObject), sepa_debit?: (object{mandate_options?: (object{reference_prefix?: string}&StripeObject)}&StripeObject), upi?: (object{mandate_options?: (object{amount: null|int, amount_type: null|string, description: null|string, end_date: null|int}&StripeObject)}&StripeObject), us_bank_account?: (object{financial_connections?: (object{filters?: (object{account_subcategories?: string[]}&StripeObject), permissions?: string[], prefetch: null|string[], return_url?: string}&StripeObject), mandate_options?: (object{collection_method?: string}&StripeObject), verification_method?: string}&StripeObject)}&StripeObject) $payment_method_options Payment method-specific configuration for this SetupIntent. * @property string[] $payment_method_types The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. A list of valid payment method types can be found here. * @property null|Mandate|string $single_use_mandate ID of the single_use Mandate generated by the SetupIntent. * @property string $status Status of this SetupIntent, one of requires_payment_method, requires_confirmation, requires_action, processing, canceled, or succeeded. @@ -79,7 +79,7 @@ class SetupIntent extends ApiResource * href="/docs/api/setup_intents/confirm">confirm it to collect any required * permissions to charge the payment method later. * - * @param null|array{attach_to_self?: bool, automatic_payment_methods?: array{allow_redirects?: string, enabled: bool}, confirm?: bool, confirmation_token?: string, customer?: string, customer_account?: string, description?: string, excluded_payment_method_types?: string[], expand?: string[], flow_directions?: string[], mandate_data?: null|array{customer_acceptance: array{accepted_at?: int, offline?: array{}, online?: array{ip_address: string, user_agent: string}, type: string}}, metadata?: array, on_behalf_of?: string, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, crypto?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: array{currency?: string, mandate_options?: array{custom_mandate_url?: null|string, default_for?: string[], interval_description?: string, payment_schedule?: string, transaction_type?: string}, verification_method?: string}, amazon_pay?: array{}, bacs_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, card?: array{mandate_options?: array{amount: int, amount_type: string, currency: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_three_d_secure?: string, three_d_secure?: array{ares_trans_status?: string, cryptogram?: string, electronic_commerce_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id?: string, version?: string}}, card_present?: array{}, klarna?: array{currency?: string, on_demand?: array{average_amount?: int, maximum_amount?: int, minimum_amount?: int, purchase_interval?: string, purchase_interval_count?: int}, preferred_locale?: string, subscriptions?: null|array{interval: string, interval_count?: int, name?: string, next_billing: array{amount: int, date: string}, reference: string}[]}, link?: array{persistent_token?: string}, paypal?: array{billing_agreement_id?: string}, payto?: array{mandate_options?: array{amount?: null|int, amount_type?: null|string, end_date?: null|string, payment_schedule?: null|string, payments_per_period?: null|int, purpose?: null|string, start_date?: null|string}}, sepa_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, us_bank_account?: array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, verification_method?: string}}, payment_method_types?: string[], return_url?: string, single_use?: array{amount: int, currency: string}, usage?: string, use_stripe_sdk?: bool} $params + * @param null|array{attach_to_self?: bool, automatic_payment_methods?: array{allow_redirects?: string, enabled: bool}, confirm?: bool, confirmation_token?: string, customer?: string, customer_account?: string, description?: string, excluded_payment_method_types?: string[], expand?: string[], flow_directions?: string[], mandate_data?: null|array{customer_acceptance: array{accepted_at?: int, offline?: array{}, online?: array{ip_address: string, user_agent: string}, type: string}}, metadata?: array, on_behalf_of?: string, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, crypto?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, upi?: array{mandate_options?: array{amount?: int, amount_type?: string, description?: string, end_date?: int}}, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: array{currency?: string, mandate_options?: array{custom_mandate_url?: null|string, default_for?: string[], interval_description?: string, payment_schedule?: string, transaction_type?: string}, verification_method?: string}, amazon_pay?: array{}, bacs_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, card?: array{mandate_options?: array{amount: int, amount_type: string, currency: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_three_d_secure?: string, three_d_secure?: array{ares_trans_status?: string, cryptogram?: string, electronic_commerce_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id?: string, version?: string}}, card_present?: array{}, klarna?: array{currency?: string, on_demand?: array{average_amount?: int, maximum_amount?: int, minimum_amount?: int, purchase_interval?: string, purchase_interval_count?: int}, preferred_locale?: string, subscriptions?: null|array{interval: string, interval_count?: int, name?: string, next_billing: array{amount: int, date: string}, reference: string}[]}, link?: array{persistent_token?: string}, paypal?: array{billing_agreement_id?: string}, payto?: array{mandate_options?: array{amount?: null|int, amount_type?: null|string, end_date?: null|string, payment_schedule?: null|string, payments_per_period?: null|int, purpose?: null|string, start_date?: null|string}}, sepa_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, upi?: array{mandate_options?: array{amount?: int, amount_type?: string, description?: string, end_date?: int}, setup_future_usage?: null|string}, us_bank_account?: array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, verification_method?: string}}, payment_method_types?: string[], return_url?: string, single_use?: array{amount: int, currency: string}, usage?: string, use_stripe_sdk?: bool} $params * @param null|array|string $options * * @return SetupIntent the created resource @@ -145,7 +145,7 @@ class SetupIntent extends ApiResource * Updates a SetupIntent object. * * @param string $id the ID of the resource to update - * @param null|array{attach_to_self?: bool, customer?: string, customer_account?: string, description?: string, excluded_payment_method_types?: null|string[], expand?: string[], flow_directions?: string[], metadata?: null|array, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, crypto?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: array{currency?: string, mandate_options?: array{custom_mandate_url?: null|string, default_for?: string[], interval_description?: string, payment_schedule?: string, transaction_type?: string}, verification_method?: string}, amazon_pay?: array{}, bacs_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, card?: array{mandate_options?: array{amount: int, amount_type: string, currency: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_three_d_secure?: string, three_d_secure?: array{ares_trans_status?: string, cryptogram?: string, electronic_commerce_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id?: string, version?: string}}, card_present?: array{}, klarna?: array{currency?: string, on_demand?: array{average_amount?: int, maximum_amount?: int, minimum_amount?: int, purchase_interval?: string, purchase_interval_count?: int}, preferred_locale?: string, subscriptions?: null|array{interval: string, interval_count?: int, name?: string, next_billing: array{amount: int, date: string}, reference: string}[]}, link?: array{persistent_token?: string}, paypal?: array{billing_agreement_id?: string}, payto?: array{mandate_options?: array{amount?: null|int, amount_type?: null|string, end_date?: null|string, payment_schedule?: null|string, payments_per_period?: null|int, purpose?: null|string, start_date?: null|string}}, sepa_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, us_bank_account?: array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, verification_method?: string}}, payment_method_types?: string[]} $params + * @param null|array{attach_to_self?: bool, customer?: string, customer_account?: string, description?: string, excluded_payment_method_types?: null|string[], expand?: string[], flow_directions?: string[], metadata?: null|array, payment_method?: string, payment_method_configuration?: string, payment_method_data?: array{acss_debit?: array{account_number: string, institution_number: string, transit_number: string}, affirm?: array{}, afterpay_clearpay?: array{}, alipay?: array{}, allow_redisplay?: string, alma?: array{}, amazon_pay?: array{}, au_becs_debit?: array{account_number: string, bsb_number: string}, bacs_debit?: array{account_number?: string, sort_code?: string}, bancontact?: array{}, billie?: array{}, billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string, tax_id?: string}, blik?: array{}, boleto?: array{tax_id: string}, cashapp?: array{}, crypto?: array{}, customer_balance?: array{}, eps?: array{bank?: string}, fpx?: array{account_holder_type?: string, bank: string}, giropay?: array{}, grabpay?: array{}, ideal?: array{bank?: string}, interac_present?: array{}, kakao_pay?: array{}, klarna?: array{dob?: array{day: int, month: int, year: int}}, konbini?: array{}, kr_card?: array{}, link?: array{}, mb_way?: array{}, metadata?: array, mobilepay?: array{}, multibanco?: array{}, naver_pay?: array{funding?: string}, nz_bank_account?: array{account_holder_name?: string, account_number: string, bank_code: string, branch_code: string, reference?: string, suffix: string}, oxxo?: array{}, p24?: array{bank?: string}, pay_by_bank?: array{}, payco?: array{}, paynow?: array{}, paypal?: array{}, payto?: array{account_number?: string, bsb_number?: string, pay_id?: string}, pix?: array{}, promptpay?: array{}, radar_options?: array{session?: string}, revolut_pay?: array{}, samsung_pay?: array{}, satispay?: array{}, sepa_debit?: array{iban: string}, sofort?: array{country: string}, swish?: array{}, twint?: array{}, type: string, upi?: array{mandate_options?: array{amount?: int, amount_type?: string, description?: string, end_date?: int}}, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}, wechat_pay?: array{}, zip?: array{}}, payment_method_options?: array{acss_debit?: array{currency?: string, mandate_options?: array{custom_mandate_url?: null|string, default_for?: string[], interval_description?: string, payment_schedule?: string, transaction_type?: string}, verification_method?: string}, amazon_pay?: array{}, bacs_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, card?: array{mandate_options?: array{amount: int, amount_type: string, currency: string, description?: string, end_date?: int, interval: string, interval_count?: int, reference: string, start_date: int, supported_types?: string[]}, moto?: bool, network?: string, request_three_d_secure?: string, three_d_secure?: array{ares_trans_status?: string, cryptogram?: string, electronic_commerce_indicator?: string, network_options?: array{cartes_bancaires?: array{cb_avalgo: string, cb_exemption?: string, cb_score?: int}}, requestor_challenge_indicator?: string, transaction_id?: string, version?: string}}, card_present?: array{}, klarna?: array{currency?: string, on_demand?: array{average_amount?: int, maximum_amount?: int, minimum_amount?: int, purchase_interval?: string, purchase_interval_count?: int}, preferred_locale?: string, subscriptions?: null|array{interval: string, interval_count?: int, name?: string, next_billing: array{amount: int, date: string}, reference: string}[]}, link?: array{persistent_token?: string}, paypal?: array{billing_agreement_id?: string}, payto?: array{mandate_options?: array{amount?: null|int, amount_type?: null|string, end_date?: null|string, payment_schedule?: null|string, payments_per_period?: null|int, purpose?: null|string, start_date?: null|string}}, sepa_debit?: array{mandate_options?: array{reference_prefix?: null|string}}, upi?: array{mandate_options?: array{amount?: int, amount_type?: string, description?: string, end_date?: int}, setup_future_usage?: null|string}, us_bank_account?: array{financial_connections?: array{filters?: array{account_subcategories?: string[]}, permissions?: string[], prefetch?: string[], return_url?: string}, mandate_options?: array{collection_method?: null|string}, networks?: array{requested?: string[]}, verification_method?: string}}, payment_method_types?: string[]} $params * @param null|array|string $opts * * @return SetupIntent the updated resource diff --git a/plugins/stripe-php/lib/ShippingRate.php b/plugins/stripe-php/lib/ShippingRate.php index a213a2eb..ccf357d6 100644 --- a/plugins/stripe-php/lib/ShippingRate.php +++ b/plugins/stripe-php/lib/ShippingRate.php @@ -15,7 +15,7 @@ namespace Stripe; * @property null|(object{maximum: null|(object{unit: string, value: int}&StripeObject), minimum: null|(object{unit: string, value: int}&StripeObject)}&StripeObject) $delivery_estimate The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. * @property null|string $display_name The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. * @property null|(object{amount: int, currency: string, currency_options?: StripeObject}&StripeObject) $fixed_amount - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $tax_behavior Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of inclusive, exclusive, or unspecified. * @property null|string|TaxCode $tax_code A tax code ID. The Shipping tax code is txcd_92010001. diff --git a/plugins/stripe-php/lib/Sigma/ScheduledQueryRun.php b/plugins/stripe-php/lib/Sigma/ScheduledQueryRun.php index 53f84a64..dc0d885a 100644 --- a/plugins/stripe-php/lib/Sigma/ScheduledQueryRun.php +++ b/plugins/stripe-php/lib/Sigma/ScheduledQueryRun.php @@ -16,7 +16,7 @@ namespace Stripe\Sigma; * @property int $data_load_time When the query was run, Sigma contained a snapshot of your Stripe data at this time. * @property null|(object{message: string}&\Stripe\StripeObject) $error * @property null|\Stripe\File $file The file object representing the results of the query. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property int $result_available_until Time at which the result expires and is no longer available for download. * @property string $sql SQL for the query. * @property string $status The query's execution status, which will be completed for successful runs, and canceled, failed, or timed_out otherwise. diff --git a/plugins/stripe-php/lib/Source.php b/plugins/stripe-php/lib/Source.php index dba4cca5..b163f89c 100644 --- a/plugins/stripe-php/lib/Source.php +++ b/plugins/stripe-php/lib/Source.php @@ -38,7 +38,7 @@ namespace Stripe; * @property null|(object{bank_code?: null|string, bank_name?: null|string, bic?: null|string, statement_descriptor?: null|string}&StripeObject) $giropay * @property null|(object{bank?: null|string, bic?: null|string, iban_last4?: null|string, statement_descriptor?: null|string}&StripeObject) $ideal * @property null|(object{background_image_url?: string, client_token?: null|string, first_name?: string, last_name?: string, locale?: string, logo_url?: string, page_title?: string, pay_later_asset_urls_descriptive?: string, pay_later_asset_urls_standard?: string, pay_later_name?: string, pay_later_redirect_url?: string, pay_now_asset_urls_descriptive?: string, pay_now_asset_urls_standard?: string, pay_now_name?: string, pay_now_redirect_url?: string, pay_over_time_asset_urls_descriptive?: string, pay_over_time_asset_urls_standard?: string, pay_over_time_name?: string, pay_over_time_redirect_url?: string, payment_method_categories?: string, purchase_country?: string, purchase_type?: string, redirect_url?: string, shipping_delay?: int, shipping_first_name?: string, shipping_last_name?: string}&StripeObject) $klarna - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|(object{entity?: null|string, reference?: null|string, refund_account_holder_address_city?: null|string, refund_account_holder_address_country?: null|string, refund_account_holder_address_line1?: null|string, refund_account_holder_address_line2?: null|string, refund_account_holder_address_postal_code?: null|string, refund_account_holder_address_state?: null|string, refund_account_holder_name?: null|string, refund_iban?: null|string}&StripeObject) $multibanco * @property null|(object{address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, phone: null|string, verified_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), verified_email: null|string, verified_name: null|string, verified_phone: null|string}&StripeObject) $owner Information about the owner of the payment instrument that may be used or required by particular source types. diff --git a/plugins/stripe-php/lib/SourceMandateNotification.php b/plugins/stripe-php/lib/SourceMandateNotification.php index 91928ab5..8a0db2e3 100644 --- a/plugins/stripe-php/lib/SourceMandateNotification.php +++ b/plugins/stripe-php/lib/SourceMandateNotification.php @@ -15,7 +15,7 @@ namespace Stripe; * @property null|int $amount A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the amount associated with the mandate notification. The amount is expressed in the currency of the underlying source. Required if the notification type is debit_initiated. * @property null|(object{last4?: string}&StripeObject) $bacs_debit * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property string $reason The reason of the mandate notification. Valid reasons are mandate_confirmed or debit_initiated. * @property null|(object{creditor_identifier?: string, last4?: string, mandate_reference?: string}&StripeObject) $sepa_debit * @property Source $source

Source objects allow you to accept a variety of payment methods. They represent a customer's payment instrument, and can be used with the Stripe API just like a Card object: once chargeable, they can be charged, or can be attached to customers.

Stripe doesn't recommend using the deprecated Sources API. We recommend that you adopt the PaymentMethods API. This newer API provides access to our latest features and payment method types.

Related guides: Sources API and Sources & Customers.

diff --git a/plugins/stripe-php/lib/SourceTransaction.php b/plugins/stripe-php/lib/SourceTransaction.php index 79966b75..70e927be 100644 --- a/plugins/stripe-php/lib/SourceTransaction.php +++ b/plugins/stripe-php/lib/SourceTransaction.php @@ -18,7 +18,7 @@ namespace Stripe; * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property null|(object{fingerprint?: string, funding_method?: string, last4?: string, reference?: string, sender_account_number?: string, sender_name?: string, sender_sort_code?: string}&StripeObject) $gbp_credit_transfer - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|(object{available_at?: string, invoices?: string}&StripeObject) $paper_check * @property null|(object{reference?: string, sender_iban?: string, sender_name?: string}&StripeObject) $sepa_credit_transfer * @property string $source The ID of the source this transaction is attached to. diff --git a/plugins/stripe-php/lib/Stripe.php b/plugins/stripe-php/lib/Stripe.php index b09db93c..c36b911e 100644 --- a/plugins/stripe-php/lib/Stripe.php +++ b/plugins/stripe-php/lib/Stripe.php @@ -64,7 +64,7 @@ class Stripe /** @var float Initial delay between retries, in seconds */ private static $initialNetworkRetryDelay = 0.5; - const VERSION = '19.4.1'; + const VERSION = '20.0.0'; /** * @return string the API key used for requests diff --git a/plugins/stripe-php/lib/StripeObject.php b/plugins/stripe-php/lib/StripeObject.php index 58eb1098..6c3b3069 100644 --- a/plugins/stripe-php/lib/StripeObject.php +++ b/plugins/stripe-php/lib/StripeObject.php @@ -296,6 +296,16 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable $values = $values->toArray(); } + // Apply int64_string response coercion on raw values before hydration. + // V2 resource classes declare fieldEncodings() with metadata about which + // fields are int64_string (wire format: JSON string, SDK type: PHP int). + if (\method_exists(static::class, 'fieldEncodings')) { + $encodings = static::fieldEncodings(); + if (!empty($encodings)) { + $values = Util\Int64::coerceResponseValues($values, $encodings); + } + } + // Wipe old state before setting new. This is useful for e.g. updating a // customer, where there is no persistent card parameter. Mark those values // which don't persist as transient @@ -331,7 +341,8 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable // This is necessary in case metadata is empty, as PHP arrays do // not differentiate between lists and hashes, and we consider // empty arrays to be lists. - if (('metadata' === $k) && \is_array($v)) { + // The same applies to the previous_attributes attribute. + if (('metadata' === $k || 'previous_attributes' === $k) && \is_array($v)) { $this->_values[$k] = StripeObject::constructFrom($v, $opts, $apiMode); } else { $this->_values[$k] = Util\Util::convertToStripeObject($v, $opts, $apiMode); diff --git a/plugins/stripe-php/lib/Subscription.php b/plugins/stripe-php/lib/Subscription.php index 90c92231..442b5aaf 100644 --- a/plugins/stripe-php/lib/Subscription.php +++ b/plugins/stripe-php/lib/Subscription.php @@ -37,15 +37,16 @@ namespace Stripe; * @property (object{account_tax_ids: null|(string|TaxId)[], issuer: (object{account?: Account|string, type: string}&StripeObject)}&StripeObject) $invoice_settings * @property Collection $items List of subscription items, each with an attached price. * @property null|Invoice|string $latest_invoice The most recent invoice this subscription has generated over its lifecycle (for example, when it cycles or is updated). - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|int $next_pending_invoice_item_invoice Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at pending_invoice_item_interval. * @property null|Account|string $on_behalf_of The account (if any) the charge was made on behalf of for charges associated with this subscription. See the Connect documentation for details. * @property null|(object{behavior: string, resumes_at: null|int}&StripeObject) $pause_collection If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to paused. Learn more about pausing collection. * @property null|(object{payment_method_options: null|(object{acss_debit: null|(object{mandate_options?: (object{transaction_type: null|string}&StripeObject), verification_method?: string}&StripeObject), bancontact: null|(object{preferred_language: string}&StripeObject), card: null|(object{mandate_options?: (object{amount: null|int, amount_type: null|string, description: null|string}&StripeObject), network: null|string, request_three_d_secure: null|string}&StripeObject), customer_balance: null|(object{bank_transfer?: (object{eu_bank_transfer?: (object{country: string}&StripeObject), type: null|string}&StripeObject), funding_type: null|string}&StripeObject), konbini: null|(object{}&StripeObject), payto: null|(object{mandate_options?: (object{amount: null|int, amount_type: null|string, purpose: null|string}&StripeObject)}&StripeObject), sepa_debit: null|(object{}&StripeObject), us_bank_account: null|(object{financial_connections?: (object{filters?: (object{account_subcategories?: string[]}&StripeObject), permissions?: string[], prefetch: null|string[]}&StripeObject), verification_method?: string}&StripeObject)}&StripeObject), payment_method_types: null|string[], save_default_payment_method: null|string}&StripeObject) $payment_settings Payment settings passed on to invoices created by the subscription. - * @property null|(object{interval: string, interval_count: int}&StripeObject) $pending_invoice_item_interval Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling Create an invoice for the given subscription at the specified interval. + * @property null|(object{interval: string, interval_count: int}&StripeObject) $pending_invoice_item_interval Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling Create an invoice for the given subscription at the specified interval. * @property null|SetupIntent|string $pending_setup_intent You can use this SetupIntent to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments. Learn more in the SCA Migration Guide. * @property null|(object{billing_cycle_anchor: null|int, expires_at: int, subscription_items: null|SubscriptionItem[], trial_end: null|int, trial_from_plan: null|bool}&StripeObject) $pending_update If specified, pending updates that will be applied to the subscription once the latest_invoice has been paid. + * @property null|(object{presentment_currency: string}&StripeObject) $presentment_details * @property null|string|SubscriptionSchedule $schedule The schedule attached to the subscription * @property int $start_date Date when the subscription was first created. The date might differ from the created date due to backdating. * @property string $status

Possible values are incomplete, incomplete_expired, trialing, active, past_due, canceled, unpaid, or paused.

For collection_method=charge_automatically a subscription moves into incomplete if the initial payment attempt fails. A subscription in this status can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into an active status. If the first invoice is not paid within 23 hours, the subscription transitions to incomplete_expired. This is a terminal status, the open invoice will be voided and no further invoices will be generated.

A subscription that is currently in a trial period is trialing and moves to active when the trial period is over.

A subscription can only enter a paused status when a trial ends without a payment method. A paused subscription doesn't generate invoices and can be resumed after your customer adds their payment method. The paused status is different from pausing collection, which still generates invoices and leaves the subscription's status unchanged.

If subscription collection_method=charge_automatically, it becomes past_due when payment is required but cannot be paid (due to failed payment or awaiting additional user actions). Once Stripe has exhausted all payment retry attempts, the subscription will become canceled or unpaid (depending on your subscriptions settings).

If subscription collection_method=send_invoice it becomes past_due when its invoice is not paid by the due date, and canceled or unpaid if it is still not paid by an additional deadline after that. Note that when a subscription has a status of unpaid, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices.

diff --git a/plugins/stripe-php/lib/SubscriptionSchedule.php b/plugins/stripe-php/lib/SubscriptionSchedule.php index bee52936..d4daa917 100644 --- a/plugins/stripe-php/lib/SubscriptionSchedule.php +++ b/plugins/stripe-php/lib/SubscriptionSchedule.php @@ -21,7 +21,7 @@ namespace Stripe; * @property null|string $customer_account ID of the account who owns the subscription schedule. * @property (object{application_fee_percent: null|float, automatic_tax?: (object{disabled_reason: null|string, enabled: bool, liability: null|(object{account?: Account|string, type: string}&StripeObject)}&StripeObject), billing_cycle_anchor: string, billing_thresholds: null|(object{amount_gte: null|int, reset_billing_cycle_anchor: null|bool}&StripeObject), collection_method: null|string, default_payment_method: null|PaymentMethod|string, description: null|string, invoice_settings: (object{account_tax_ids: null|(string|TaxId)[], days_until_due: null|int, issuer: (object{account?: Account|string, type: string}&StripeObject)}&StripeObject), on_behalf_of: null|Account|string, transfer_data: null|(object{amount_percent: null|float, destination: Account|string}&StripeObject)}&StripeObject) $default_settings * @property string $end_behavior Behavior of the subscription schedule and underlying subscription when it ends. Possible values are release or cancel with the default being release. release will end the subscription schedule and keep the underlying subscription running. cancel will end the subscription schedule and cancel the underlying subscription. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property ((object{add_invoice_items: ((object{discounts: ((object{coupon: null|Coupon|string, discount: null|Discount|string, promotion_code: null|PromotionCode|string}&StripeObject))[], metadata: null|StripeObject, period: (object{end: (object{timestamp?: int, type: string}&StripeObject), start: (object{timestamp?: int, type: string}&StripeObject)}&StripeObject), price: Price|string, quantity: null|int, tax_rates?: null|TaxRate[]}&StripeObject))[], application_fee_percent: null|float, automatic_tax?: (object{disabled_reason: null|string, enabled: bool, liability: null|(object{account?: Account|string, type: string}&StripeObject)}&StripeObject), billing_cycle_anchor: null|string, billing_thresholds: null|(object{amount_gte: null|int, reset_billing_cycle_anchor: null|bool}&StripeObject), collection_method: null|string, currency: string, default_payment_method: null|PaymentMethod|string, default_tax_rates?: null|TaxRate[], description: null|string, discounts: ((object{coupon: null|Coupon|string, discount: null|Discount|string, promotion_code: null|PromotionCode|string}&StripeObject))[], end_date: int, invoice_settings: null|(object{account_tax_ids: null|(string|TaxId)[], days_until_due: null|int, issuer: null|(object{account?: Account|string, type: string}&StripeObject)}&StripeObject), items: ((object{billing_thresholds: null|(object{usage_gte: null|int}&StripeObject), discounts: ((object{coupon: null|Coupon|string, discount: null|Discount|string, promotion_code: null|PromotionCode|string}&StripeObject))[], metadata: null|StripeObject, plan: Plan|string, price: Price|string, quantity?: int, tax_rates?: null|TaxRate[]}&StripeObject))[], metadata: null|StripeObject, on_behalf_of: null|Account|string, proration_behavior: string, start_date: int, transfer_data: null|(object{amount_percent: null|float, destination: Account|string}&StripeObject), trial_end: null|int}&StripeObject))[] $phases Configuration for the subscription schedule's phases. * @property null|int $released_at Time at which the subscription schedule was released. Measured in seconds since the Unix epoch. diff --git a/plugins/stripe-php/lib/Tax/Calculation.php b/plugins/stripe-php/lib/Tax/Calculation.php index 7218d9d5..7e624498 100644 --- a/plugins/stripe-php/lib/Tax/Calculation.php +++ b/plugins/stripe-php/lib/Tax/Calculation.php @@ -11,13 +11,13 @@ namespace Stripe\Tax; * * @property null|string $id Unique identifier for the calculation. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount_total Total amount after taxes in the smallest currency unit. + * @property int $amount_total Total amount after taxes in the smallest currency unit. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property null|string $customer The ID of an existing Customer used for the resource. * @property (object{address: null|(object{city: null|string, country: string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), address_source: null|string, ip_address: null|string, tax_ids: (object{type: string, value: string}&\Stripe\StripeObject)[], taxability_override: string}&\Stripe\StripeObject) $customer_details * @property null|int $expires_at Timestamp of date at which the tax calculation will expire. * @property null|\Stripe\Collection $line_items The list of items the customer is purchasing. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|(object{address: (object{city: null|string, country: string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $ship_from_details The details of the ship from location, such as the address. * @property null|(object{amount: int, amount_tax: int, shipping_rate?: string, tax_behavior: string, tax_breakdown?: ((object{amount: int, jurisdiction: (object{country: string, display_name: string, level: string, state: null|string}&\Stripe\StripeObject), sourcing: string, tax_rate_details: null|(object{display_name: string, percentage_decimal: string, tax_type: string}&\Stripe\StripeObject), taxability_reason: string, taxable_amount: int}&\Stripe\StripeObject))[], tax_code: string}&\Stripe\StripeObject) $shipping_cost The shipping cost details for the calculation. * @property int $tax_amount_exclusive The amount of tax to be collected on top of the line item prices. diff --git a/plugins/stripe-php/lib/Tax/CalculationLineItem.php b/plugins/stripe-php/lib/Tax/CalculationLineItem.php index a84e415a..c3f4eb1c 100644 --- a/plugins/stripe-php/lib/Tax/CalculationLineItem.php +++ b/plugins/stripe-php/lib/Tax/CalculationLineItem.php @@ -7,9 +7,9 @@ namespace Stripe\Tax; /** * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount The line item amount in the smallest currency unit. If tax_behavior=inclusive, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. - * @property int $amount_tax The amount of tax calculated for this line item, in the smallest currency unit. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property int $amount The line item amount in the smallest currency unit. If tax_behavior=inclusive, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. + * @property int $amount_tax The amount of tax calculated for this line item, in the smallest currency unit. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $product The ID of an existing Product. * @property int $quantity The number of units of the item being purchased. For reversals, this is the quantity reversed. diff --git a/plugins/stripe-php/lib/Tax/Registration.php b/plugins/stripe-php/lib/Tax/Registration.php index 234048b0..87d5a41b 100644 --- a/plugins/stripe-php/lib/Tax/Registration.php +++ b/plugins/stripe-php/lib/Tax/Registration.php @@ -18,7 +18,7 @@ namespace Stripe\Tax; * @property (object{ae?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), al?: (object{type: string}&\Stripe\StripeObject), am?: (object{type: string}&\Stripe\StripeObject), ao?: (object{type: string}&\Stripe\StripeObject), at?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), au?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), aw?: (object{type: string}&\Stripe\StripeObject), az?: (object{type: string}&\Stripe\StripeObject), ba?: (object{type: string}&\Stripe\StripeObject), bb?: (object{type: string}&\Stripe\StripeObject), bd?: (object{type: string}&\Stripe\StripeObject), be?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), bf?: (object{type: string}&\Stripe\StripeObject), bg?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), bh?: (object{type: string}&\Stripe\StripeObject), bj?: (object{type: string}&\Stripe\StripeObject), bs?: (object{type: string}&\Stripe\StripeObject), by?: (object{type: string}&\Stripe\StripeObject), ca?: (object{province_standard?: (object{province: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), cd?: (object{type: string}&\Stripe\StripeObject), ch?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), cl?: (object{type: string}&\Stripe\StripeObject), cm?: (object{type: string}&\Stripe\StripeObject), co?: (object{type: string}&\Stripe\StripeObject), cr?: (object{type: string}&\Stripe\StripeObject), cv?: (object{type: string}&\Stripe\StripeObject), cy?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), cz?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), de?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), dk?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), ec?: (object{type: string}&\Stripe\StripeObject), ee?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), eg?: (object{type: string}&\Stripe\StripeObject), es?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), et?: (object{type: string}&\Stripe\StripeObject), fi?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), fr?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), gb?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), ge?: (object{type: string}&\Stripe\StripeObject), gn?: (object{type: string}&\Stripe\StripeObject), gr?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), hr?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), hu?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), id?: (object{type: string}&\Stripe\StripeObject), ie?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), in?: (object{type: string}&\Stripe\StripeObject), is?: (object{type: string}&\Stripe\StripeObject), it?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), jp?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), ke?: (object{type: string}&\Stripe\StripeObject), kg?: (object{type: string}&\Stripe\StripeObject), kh?: (object{type: string}&\Stripe\StripeObject), kr?: (object{type: string}&\Stripe\StripeObject), kz?: (object{type: string}&\Stripe\StripeObject), la?: (object{type: string}&\Stripe\StripeObject), lk?: (object{type: string}&\Stripe\StripeObject), lt?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), lu?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), lv?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), ma?: (object{type: string}&\Stripe\StripeObject), md?: (object{type: string}&\Stripe\StripeObject), me?: (object{type: string}&\Stripe\StripeObject), mk?: (object{type: string}&\Stripe\StripeObject), mr?: (object{type: string}&\Stripe\StripeObject), mt?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), mx?: (object{type: string}&\Stripe\StripeObject), my?: (object{type: string}&\Stripe\StripeObject), ng?: (object{type: string}&\Stripe\StripeObject), nl?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), no?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), np?: (object{type: string}&\Stripe\StripeObject), nz?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), om?: (object{type: string}&\Stripe\StripeObject), pe?: (object{type: string}&\Stripe\StripeObject), ph?: (object{type: string}&\Stripe\StripeObject), pl?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), pt?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), ro?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), rs?: (object{type: string}&\Stripe\StripeObject), ru?: (object{type: string}&\Stripe\StripeObject), sa?: (object{type: string}&\Stripe\StripeObject), se?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), sg?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), si?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), sk?: (object{standard?: (object{place_of_supply_scheme: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), sn?: (object{type: string}&\Stripe\StripeObject), sr?: (object{type: string}&\Stripe\StripeObject), th?: (object{type: string}&\Stripe\StripeObject), tj?: (object{type: string}&\Stripe\StripeObject), tr?: (object{type: string}&\Stripe\StripeObject), tw?: (object{type: string}&\Stripe\StripeObject), tz?: (object{type: string}&\Stripe\StripeObject), ua?: (object{type: string}&\Stripe\StripeObject), ug?: (object{type: string}&\Stripe\StripeObject), us?: (object{local_amusement_tax?: (object{jurisdiction: string}&\Stripe\StripeObject), local_lease_tax?: (object{jurisdiction: string}&\Stripe\StripeObject), state: string, state_sales_tax?: (object{elections?: (object{jurisdiction?: string, type: string}&\Stripe\StripeObject)[]}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), uy?: (object{type: string}&\Stripe\StripeObject), uz?: (object{type: string}&\Stripe\StripeObject), vn?: (object{type: string}&\Stripe\StripeObject), za?: (object{type: string}&\Stripe\StripeObject), zm?: (object{type: string}&\Stripe\StripeObject), zw?: (object{type: string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $country_options * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|int $expires_at If set, the registration stops being active at this time. If not set, the registration will be active indefinitely. Measured in seconds since the Unix epoch. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property string $status The status of the registration. This field is present for convenience and can be deduced from active_from and expires_at. */ class Registration extends \Stripe\ApiResource diff --git a/plugins/stripe-php/lib/Tax/Settings.php b/plugins/stripe-php/lib/Tax/Settings.php index 321e5d3a..32293b43 100644 --- a/plugins/stripe-php/lib/Tax/Settings.php +++ b/plugins/stripe-php/lib/Tax/Settings.php @@ -12,7 +12,7 @@ namespace Stripe\Tax; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property (object{provider: string, tax_behavior: null|string, tax_code: null|string}&\Stripe\StripeObject) $defaults * @property null|(object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $head_office The place where your business is located. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property string $status The status of the Tax Settings. * @property (object{active?: (object{}&\Stripe\StripeObject), pending?: (object{missing_fields: null|string[]}&\Stripe\StripeObject)}&\Stripe\StripeObject) $status_details */ diff --git a/plugins/stripe-php/lib/Tax/Transaction.php b/plugins/stripe-php/lib/Tax/Transaction.php index e851a952..43015551 100644 --- a/plugins/stripe-php/lib/Tax/Transaction.php +++ b/plugins/stripe-php/lib/Tax/Transaction.php @@ -16,7 +16,7 @@ namespace Stripe\Tax; * @property null|string $customer The ID of an existing Customer used for the resource. * @property (object{address: null|(object{city: null|string, country: string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), address_source: null|string, ip_address: null|string, tax_ids: (object{type: string, value: string}&\Stripe\StripeObject)[], taxability_override: string}&\Stripe\StripeObject) $customer_details * @property null|\Stripe\Collection $line_items The tax collected or refunded, by line item. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property int $posted_at The Unix timestamp representing when the tax liability is assumed or reduced. * @property string $reference A custom unique identifier, such as 'myOrder_123'. diff --git a/plugins/stripe-php/lib/Tax/TransactionLineItem.php b/plugins/stripe-php/lib/Tax/TransactionLineItem.php index fae64c44..2ed48936 100644 --- a/plugins/stripe-php/lib/Tax/TransactionLineItem.php +++ b/plugins/stripe-php/lib/Tax/TransactionLineItem.php @@ -7,9 +7,9 @@ namespace Stripe\Tax; /** * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount The line item amount in the smallest currency unit. If tax_behavior=inclusive, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. - * @property int $amount_tax The amount of tax calculated for this line item, in the smallest currency unit. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property int $amount The line item amount in the smallest currency unit. If tax_behavior=inclusive, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. + * @property int $amount_tax The amount of tax calculated for this line item, in the smallest currency unit. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $product The ID of an existing Product. * @property int $quantity The number of units of the item being purchased. For reversals, this is the quantity reversed. diff --git a/plugins/stripe-php/lib/TaxId.php b/plugins/stripe-php/lib/TaxId.php index c3caa060..8640b5db 100644 --- a/plugins/stripe-php/lib/TaxId.php +++ b/plugins/stripe-php/lib/TaxId.php @@ -16,7 +16,7 @@ namespace Stripe; * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|Customer|string $customer ID of the customer. * @property null|string $customer_account ID of the Account representing the customer. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|(object{account?: Account|string, application?: Application|string, customer?: Customer|string, customer_account: null|string, type: string}&StripeObject) $owner The account or customer the tax ID belongs to. * @property string $type Type of the tax ID, one of ad_nrt, ae_trn, al_tin, am_tin, ao_tin, ar_cuit, au_abn, au_arn, aw_tin, az_tin, ba_tin, bb_tin, bd_bin, bf_ifu, bg_uic, bh_vat, bj_ifu, bo_tin, br_cnpj, br_cpf, bs_tin, by_tin, ca_bn, ca_gst_hst, ca_pst_bc, ca_pst_mb, ca_pst_sk, ca_qst, cd_nif, ch_uid, ch_vat, cl_tin, cm_niu, cn_tin, co_nit, cr_tin, cv_nif, de_stn, do_rcn, ec_ruc, eg_tin, es_cif, et_tin, eu_oss_vat, eu_vat, gb_vat, ge_vat, gn_nif, hk_br, hr_oib, hu_tin, id_npwp, il_vat, in_gst, is_vat, jp_cn, jp_rn, jp_trn, ke_pin, kg_tin, kh_tin, kr_brn, kz_bin, la_tin, li_uid, li_vat, lk_vat, ma_vat, md_vat, me_pib, mk_vat, mr_nif, mx_rfc, my_frp, my_itn, my_sst, ng_tin, no_vat, no_voec, np_pan, nz_gst, om_vat, pe_ruc, ph_tin, pl_nip, ro_tin, rs_pib, ru_inn, ru_kpp, sa_vat, sg_gst, sg_uen, si_tin, sn_ninea, sr_fin, sv_nit, th_vat, tj_tin, tr_tin, tw_vat, tz_vat, ua_vat, ug_tin, us_ein, uy_ruc, uz_tin, uz_vat, ve_rif, vn_tin, za_vat, zm_tin, or zw_tin. Note that some legacy tax IDs have type unknown * @property string $value Value of the tax ID. diff --git a/plugins/stripe-php/lib/TaxRate.php b/plugins/stripe-php/lib/TaxRate.php index 148745a7..e0eb5bdf 100644 --- a/plugins/stripe-php/lib/TaxRate.php +++ b/plugins/stripe-php/lib/TaxRate.php @@ -21,7 +21,7 @@ namespace Stripe; * @property bool $inclusive This specifies if the tax rate is inclusive or exclusive. * @property null|string $jurisdiction The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice. * @property null|string $jurisdiction_level The level of the jurisdiction that imposes this tax rate. Will be null for manually defined tax rates. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property float $percentage Tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true, this percentage includes the statutory tax rate of non-taxable jurisdictions. * @property null|string $rate_type Indicates the type of tax rate applied to the taxable amount. This value can be null when no tax applies to the location. This field is only present for TaxRates created by Stripe Tax. diff --git a/plugins/stripe-php/lib/Terminal/Configuration.php b/plugins/stripe-php/lib/Terminal/Configuration.php index 68285bac..e37e79a7 100644 --- a/plugins/stripe-php/lib/Terminal/Configuration.php +++ b/plugins/stripe-php/lib/Terminal/Configuration.php @@ -14,7 +14,7 @@ namespace Stripe\Terminal; * @property null|(object{splashscreen?: string|\Stripe\File}&\Stripe\StripeObject) $bbpos_wisepos_e * @property null|(object{enabled: bool}&\Stripe\StripeObject) $cellular * @property null|bool $is_account_default Whether this Configuration is the default for your account - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|string $name String indicating the name of the Configuration object, set by the user * @property null|(object{enabled: null|bool}&\Stripe\StripeObject) $offline * @property null|(object{end_hour: int, start_hour: int}&\Stripe\StripeObject) $reboot_window diff --git a/plugins/stripe-php/lib/Terminal/Location.php b/plugins/stripe-php/lib/Terminal/Location.php index ed55213b..885d710a 100644 --- a/plugins/stripe-php/lib/Terminal/Location.php +++ b/plugins/stripe-php/lib/Terminal/Location.php @@ -18,7 +18,7 @@ namespace Stripe\Terminal; * @property string $display_name The display name of the location. * @property null|string $display_name_kana The Kana variation of the display name of the location. * @property null|string $display_name_kanji The Kanji variation of the display name of the location. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $phone The phone number of the location. */ diff --git a/plugins/stripe-php/lib/Terminal/Reader.php b/plugins/stripe-php/lib/Terminal/Reader.php index 8bf16c18..acb3297c 100644 --- a/plugins/stripe-php/lib/Terminal/Reader.php +++ b/plugins/stripe-php/lib/Terminal/Reader.php @@ -17,7 +17,7 @@ namespace Stripe\Terminal; * @property null|string $ip_address The local IP address of the reader. * @property string $label Custom label given to the reader for easier identification. * @property null|int $last_seen_at The last time this reader reported to Stripe backend. Timestamp is measured in milliseconds since the Unix epoch. Unlike most other Stripe timestamp fields which use seconds, this field uses milliseconds. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|Location|string $location The location identifier of the reader. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $serial_number Serial number of the reader. diff --git a/plugins/stripe-php/lib/TestHelpers/TestClock.php b/plugins/stripe-php/lib/TestHelpers/TestClock.php index 61d86f1d..caf7ca5b 100644 --- a/plugins/stripe-php/lib/TestHelpers/TestClock.php +++ b/plugins/stripe-php/lib/TestHelpers/TestClock.php @@ -14,7 +14,7 @@ namespace Stripe\TestHelpers; * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property int $deletes_after Time at which this clock is scheduled to auto delete. * @property int $frozen_time Time at which all objects belonging to this clock are frozen. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|string $name The custom name supplied at creation. * @property string $status The status of the Test Clock. * @property (object{advancing?: (object{target_frozen_time: int}&\Stripe\StripeObject)}&\Stripe\StripeObject) $status_details diff --git a/plugins/stripe-php/lib/Token.php b/plugins/stripe-php/lib/Token.php index 4aa0182f..4e2b5c3f 100644 --- a/plugins/stripe-php/lib/Token.php +++ b/plugins/stripe-php/lib/Token.php @@ -32,7 +32,7 @@ namespace Stripe; * @property null|Card $card

You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later.

Related guide: Card payments with Sources

* @property null|string $client_ip IP address of the client that generates the token. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property string $type Type of the token: account, bank_account, card, or pii. * @property bool $used Determines if you have already used this token (you can only use tokens once). */ diff --git a/plugins/stripe-php/lib/Topup.php b/plugins/stripe-php/lib/Topup.php index 70028016..8bf9fad0 100644 --- a/plugins/stripe-php/lib/Topup.php +++ b/plugins/stripe-php/lib/Topup.php @@ -19,9 +19,9 @@ namespace Stripe; * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. * @property null|int $expected_availability_date Date the funds are expected to arrive in your Stripe account for payouts. This factors in delays like weekends or bank holidays. May not be specified depending on status of top-up. - * @property null|string $failure_code Error code explaining reason for top-up failure if available (see the errors section for a list of codes). + * @property null|string $failure_code Error code explaining reason for top-up failure if available (see the errors section for a list of codes). * @property null|string $failure_message Message to user further explaining reason for top-up failure if available. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|Source $source The source field is deprecated. It might not always be present in the API response. * @property null|string $statement_descriptor Extra information about a top-up. This will appear on your source's bank statement. It must contain at least one letter. diff --git a/plugins/stripe-php/lib/Transfer.php b/plugins/stripe-php/lib/Transfer.php index 0c4eca5e..4f6a8fbd 100644 --- a/plugins/stripe-php/lib/Transfer.php +++ b/plugins/stripe-php/lib/Transfer.php @@ -26,7 +26,7 @@ namespace Stripe; * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. * @property null|Account|string $destination ID of the Stripe account the transfer was sent to. * @property null|Charge|string $destination_payment If the destination is a Stripe account, this will be the ID of the payment that the destination account received for the transfer. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property Collection $reversals A list of reversals that have been applied to the transfer. * @property bool $reversed Whether the transfer has been fully reversed. If the transfer is only partially reversed, this attribute will still be false. diff --git a/plugins/stripe-php/lib/Treasury/CreditReversal.php b/plugins/stripe-php/lib/Treasury/CreditReversal.php index 5f65a695..7a4ea617 100644 --- a/plugins/stripe-php/lib/Treasury/CreditReversal.php +++ b/plugins/stripe-php/lib/Treasury/CreditReversal.php @@ -14,7 +14,7 @@ namespace Stripe\Treasury; * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property string $financial_account The FinancialAccount to reverse funds from. * @property null|string $hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $network The rails used to reverse the funds. * @property string $received_credit The ReceivedCredit being reversed. diff --git a/plugins/stripe-php/lib/Treasury/DebitReversal.php b/plugins/stripe-php/lib/Treasury/DebitReversal.php index c2c400d2..727f3e69 100644 --- a/plugins/stripe-php/lib/Treasury/DebitReversal.php +++ b/plugins/stripe-php/lib/Treasury/DebitReversal.php @@ -15,7 +15,7 @@ namespace Stripe\Treasury; * @property null|string $financial_account The FinancialAccount to reverse funds from. * @property null|string $hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. * @property null|(object{issuing_dispute: null|string}&\Stripe\StripeObject) $linked_flows Other flows linked to a DebitReversal. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $network The rails used to reverse the funds. * @property string $received_debit The ReceivedDebit being reversed. diff --git a/plugins/stripe-php/lib/Treasury/FinancialAccount.php b/plugins/stripe-php/lib/Treasury/FinancialAccount.php index 5ef63fb2..43e2168c 100644 --- a/plugins/stripe-php/lib/Treasury/FinancialAccount.php +++ b/plugins/stripe-php/lib/Treasury/FinancialAccount.php @@ -17,7 +17,7 @@ namespace Stripe\Treasury; * @property null|FinancialAccountFeatures $features Encodes whether a FinancialAccount has access to a particular Feature, with a status enum and associated status_details. Stripe or the platform can control Features via the requested field. * @property ((object{aba?: (object{account_holder_name: string, account_number?: null|string, account_number_last4: string, bank_name: string, routing_number: string}&\Stripe\StripeObject), supported_networks?: string[], type: string}&\Stripe\StripeObject))[] $financial_addresses The set of credentials that resolve to a FinancialAccount. * @property null|bool $is_default - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $nickname The nickname for the FinancialAccount. * @property null|string[] $pending_features The array of paths to pending Features in the Features hash. diff --git a/plugins/stripe-php/lib/Treasury/InboundTransfer.php b/plugins/stripe-php/lib/Treasury/InboundTransfer.php index 9ed106eb..568b7f02 100644 --- a/plugins/stripe-php/lib/Treasury/InboundTransfer.php +++ b/plugins/stripe-php/lib/Treasury/InboundTransfer.php @@ -20,7 +20,7 @@ namespace Stripe\Treasury; * @property string $financial_account The FinancialAccount that received the funds. * @property null|string $hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. * @property (object{received_debit: null|string}&\Stripe\StripeObject) $linked_flows - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $origin_payment_method The origin payment method to be debited for an InboundTransfer. * @property null|(object{billing_details: (object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), email: null|string, name: null|string}&\Stripe\StripeObject), type: string, us_bank_account?: (object{account_holder_type: null|string, account_type: null|string, bank_name: null|string, fingerprint: null|string, last4: null|string, mandate?: string|\Stripe\Mandate, network: string, routing_number: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $origin_payment_method_details Details about the PaymentMethod for an InboundTransfer. diff --git a/plugins/stripe-php/lib/Treasury/OutboundPayment.php b/plugins/stripe-php/lib/Treasury/OutboundPayment.php index 727de900..9aa119d9 100644 --- a/plugins/stripe-php/lib/Treasury/OutboundPayment.php +++ b/plugins/stripe-php/lib/Treasury/OutboundPayment.php @@ -25,7 +25,7 @@ namespace Stripe\Treasury; * @property int $expected_arrival_date The date when funds are expected to arrive in the destination account. * @property string $financial_account The FinancialAccount that funds were pulled from. * @property null|string $hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|(object{code: string, transaction: string|Transaction}&\Stripe\StripeObject) $returned_details Details about a returned OutboundPayment. Only set when the status is returned. * @property string $statement_descriptor The description that appears on the receiving end for an OutboundPayment (for example, bank statement for external bank transfer). diff --git a/plugins/stripe-php/lib/Treasury/OutboundTransfer.php b/plugins/stripe-php/lib/Treasury/OutboundTransfer.php index 7e01b575..c6311bcb 100644 --- a/plugins/stripe-php/lib/Treasury/OutboundTransfer.php +++ b/plugins/stripe-php/lib/Treasury/OutboundTransfer.php @@ -23,7 +23,7 @@ namespace Stripe\Treasury; * @property int $expected_arrival_date The date when funds are expected to arrive in the destination account. * @property string $financial_account The FinancialAccount that funds were pulled from. * @property null|string $hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|(object{code: string, transaction: string|Transaction}&\Stripe\StripeObject) $returned_details Details about a returned OutboundTransfer. Only set when the status is returned. * @property string $statement_descriptor Information about the OutboundTransfer to be sent to the recipient account. diff --git a/plugins/stripe-php/lib/Treasury/ReceivedCredit.php b/plugins/stripe-php/lib/Treasury/ReceivedCredit.php index 4fb198de..3ecf0551 100644 --- a/plugins/stripe-php/lib/Treasury/ReceivedCredit.php +++ b/plugins/stripe-php/lib/Treasury/ReceivedCredit.php @@ -18,7 +18,7 @@ namespace Stripe\Treasury; * @property null|string $hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. * @property (object{balance?: string, billing_details: (object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), email: null|string, name: null|string}&\Stripe\StripeObject), financial_account?: (object{id: string, network: string}&\Stripe\StripeObject), issuing_card?: string, type: string, us_bank_account?: (object{bank_name: null|string, last4: null|string, routing_number: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $initiating_payment_method_details * @property (object{credit_reversal: null|string, issuing_authorization: null|string, issuing_transaction: null|string, source_flow: null|string, source_flow_details?: null|(object{credit_reversal?: CreditReversal, outbound_payment?: OutboundPayment, outbound_transfer?: OutboundTransfer, payout?: \Stripe\Payout, type: string}&\Stripe\StripeObject), source_flow_type: null|string}&\Stripe\StripeObject) $linked_flows - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property string $network The rails used to send the funds. * @property null|(object{deadline: null|int, restricted_reason: null|string}&\Stripe\StripeObject) $reversal_details Details describing when a ReceivedCredit may be reversed. * @property string $status Status of the ReceivedCredit. ReceivedCredits are created either succeeded (approved) or failed (declined). If a ReceivedCredit is declined, the failure reason can be found in the failure_code field. diff --git a/plugins/stripe-php/lib/Treasury/ReceivedDebit.php b/plugins/stripe-php/lib/Treasury/ReceivedDebit.php index 8753abe8..9d74951d 100644 --- a/plugins/stripe-php/lib/Treasury/ReceivedDebit.php +++ b/plugins/stripe-php/lib/Treasury/ReceivedDebit.php @@ -18,7 +18,7 @@ namespace Stripe\Treasury; * @property null|string $hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. * @property null|(object{balance?: string, billing_details: (object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), email: null|string, name: null|string}&\Stripe\StripeObject), financial_account?: (object{id: string, network: string}&\Stripe\StripeObject), issuing_card?: string, type: string, us_bank_account?: (object{bank_name: null|string, last4: null|string, routing_number: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $initiating_payment_method_details * @property (object{debit_reversal: null|string, inbound_transfer: null|string, issuing_authorization: null|string, issuing_transaction: null|string, payout: null|string, topup: null|string}&\Stripe\StripeObject) $linked_flows - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property string $network The network used for the ReceivedDebit. * @property null|(object{deadline: null|int, restricted_reason: null|string}&\Stripe\StripeObject) $reversal_details Details describing when a ReceivedDebit might be reversed. * @property string $status Status of the ReceivedDebit. ReceivedDebits are created with a status of either succeeded (approved) or failed (declined). The failure reason can be found under the failure_code. diff --git a/plugins/stripe-php/lib/Treasury/Transaction.php b/plugins/stripe-php/lib/Treasury/Transaction.php index e16a9912..e032ae51 100644 --- a/plugins/stripe-php/lib/Treasury/Transaction.php +++ b/plugins/stripe-php/lib/Treasury/Transaction.php @@ -19,7 +19,7 @@ namespace Stripe\Treasury; * @property null|string $flow ID of the flow that created the Transaction. * @property null|(object{credit_reversal?: CreditReversal, debit_reversal?: DebitReversal, inbound_transfer?: InboundTransfer, issuing_authorization?: \Stripe\Issuing\Authorization, outbound_payment?: OutboundPayment, outbound_transfer?: OutboundTransfer, received_credit?: ReceivedCredit, received_debit?: ReceivedDebit, type: string}&\Stripe\StripeObject) $flow_details Details of the flow that created the Transaction. * @property string $flow_type Type of the flow that created the Transaction. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property string $status Status of the Transaction. * @property (object{posted_at: null|int, void_at: null|int}&\Stripe\StripeObject) $status_transitions */ diff --git a/plugins/stripe-php/lib/Treasury/TransactionEntry.php b/plugins/stripe-php/lib/Treasury/TransactionEntry.php index 130b2981..f41b4128 100644 --- a/plugins/stripe-php/lib/Treasury/TransactionEntry.php +++ b/plugins/stripe-php/lib/Treasury/TransactionEntry.php @@ -17,7 +17,7 @@ namespace Stripe\Treasury; * @property null|string $flow Token of the flow associated with the TransactionEntry. * @property null|(object{credit_reversal?: CreditReversal, debit_reversal?: DebitReversal, inbound_transfer?: InboundTransfer, issuing_authorization?: \Stripe\Issuing\Authorization, outbound_payment?: OutboundPayment, outbound_transfer?: OutboundTransfer, received_credit?: ReceivedCredit, received_debit?: ReceivedDebit, type: string}&\Stripe\StripeObject) $flow_details Details of the flow associated with the TransactionEntry. * @property string $flow_type Type of the flow associated with the TransactionEntry. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property string|Transaction $transaction The Transaction associated with this object. * @property string $type The specific money movement that generated the TransactionEntry. */ diff --git a/plugins/stripe-php/lib/Util/ApiVersion.php b/plugins/stripe-php/lib/Util/ApiVersion.php index fe1e30cf..a945efee 100644 --- a/plugins/stripe-php/lib/Util/ApiVersion.php +++ b/plugins/stripe-php/lib/Util/ApiVersion.php @@ -6,6 +6,6 @@ namespace Stripe\Util; class ApiVersion { - const CURRENT = '2026-02-25.clover'; - const CURRENT_MAJOR = 'clover'; + const CURRENT = '2026-03-25.dahlia'; + const CURRENT_MAJOR = 'dahlia'; } diff --git a/plugins/stripe-php/lib/Util/Int64.php b/plugins/stripe-php/lib/Util/Int64.php new file mode 100644 index 00000000..ff2bccbc --- /dev/null +++ b/plugins/stripe-php/lib/Util/Int64.php @@ -0,0 +1,128 @@ + 'object', 'fields' => ['amount' => ['kind' => 'int64_string']]] + * + * @return mixed + */ + public static function coerceRequestParams($params, $schema) + { + if (null === $params) { + return null; + } + + if (!isset($schema['kind'])) { + return $params; + } + + if ('int64_string' === $schema['kind']) { + if (\is_int($params)) { + return (string) $params; + } + + return $params; + } + + if ('array' === $schema['kind'] && isset($schema['items'])) { + if (\is_array($params)) { + $result = []; + foreach ($params as $key => $value) { + $result[$key] = self::coerceRequestParams($value, $schema['items']); + } + + return $result; + } + + return $params; + } + + if ('object' === $schema['kind'] && isset($schema['fields'])) { + if (\is_array($params)) { + $result = $params; + foreach ($schema['fields'] as $field => $fieldSchema) { + if (\array_key_exists($field, $result)) { + $result[$field] = self::coerceRequestParams($result[$field], $fieldSchema); + } + } + + return $result; + } + + return $params; + } + + return $params; + } + + /** + * Coerce inbound response values: convert JSON strings to PHP ints where + * the field encodings indicate an int64_string field. + * + * @param mixed $values + * @param array $encodings e.g. ['amount' => ['kind' => 'int64_string'], 'nested' => ['kind' => 'object', 'fields' => [...]]] + * + * @return mixed + */ + public static function coerceResponseValues($values, $encodings) + { + if (!\is_array($values)) { + return $values; + } + + foreach ($encodings as $field => $encoding) { + if (!\array_key_exists($field, $values)) { + continue; + } + + $value = $values[$field]; + + if (!isset($encoding['kind'])) { + continue; + } + + if ('int64_string' === $encoding['kind']) { + if (\is_string($value) && \is_numeric($value)) { + $values[$field] = (int) $value; + } + } elseif ('array' === $encoding['kind'] && isset($encoding['items'])) { + if (\is_array($value)) { + foreach ($value as $i => $item) { + if (!isset($encoding['items']['kind'])) { + continue; + } + + if ('int64_string' === $encoding['items']['kind']) { + if (\is_string($item) && \is_numeric($item)) { + $values[$field][$i] = (int) $item; + } + } elseif ('object' === $encoding['items']['kind'] && isset($encoding['items']['fields'])) { + if (\is_array($item)) { + $values[$field][$i] = self::coerceResponseValues($item, $encoding['items']['fields']); + } + } + } + } + } elseif ('object' === $encoding['kind'] && isset($encoding['fields'])) { + if (\is_array($value)) { + $values[$field] = self::coerceResponseValues($value, $encoding['fields']); + } + } + } + + return $values; + } +} diff --git a/plugins/stripe-php/lib/Util/Util.php b/plugins/stripe-php/lib/Util/Util.php index 96f92a61..fb20edc6 100644 --- a/plugins/stripe-php/lib/Util/Util.php +++ b/plugins/stripe-php/lib/Util/Util.php @@ -154,11 +154,17 @@ abstract class Util * ApiResource, then it is replaced by the resource's ID. * Also clears out null values. * + * When $serializeNull is true (used for V2 POST request + * bodies), null values in associative arrays are preserved instead of + * stripped. This is necessary because V2 JSON bodies use explicit null + * to signal "delete this field / metadata key". + * * @param mixed $h + * @param bool $serializeNull when true, preserve null values instead of stripping them * * @return mixed */ - public static function objectsToIds($h) + public static function objectsToIds($h, $serializeNull) { if ($h instanceof \Stripe\ApiResource) { return $h->id; @@ -166,7 +172,7 @@ abstract class Util if (static::isList($h)) { $results = []; foreach ($h as $v) { - $results[] = static::objectsToIds($v); + $results[] = static::objectsToIds($v, $serializeNull); } return $results; @@ -175,9 +181,21 @@ abstract class Util $results = []; foreach ($h as $k => $v) { if (null === $v) { + if ($serializeNull) { + $results[$k] = null; + } + continue; } - $results[$k] = static::objectsToIds($v); + $results[$k] = static::objectsToIds($v, $serializeNull); + } + + // If the input was an associative array with string keys but + // all values were stripped, $results is an empty indexed array. + // PHP's json_encode would render that as [] (JSON array) instead + // of {} (JSON object). Cast to object to preserve the type. + if (empty($results) && !empty($h)) { + return (object) $results; } return $results; diff --git a/plugins/stripe-php/lib/V2/Core/Account.php b/plugins/stripe-php/lib/V2/Core/Account.php index 57fc0f53..709238cf 100644 --- a/plugins/stripe-php/lib/V2/Core/Account.php +++ b/plugins/stripe-php/lib/V2/Core/Account.php @@ -21,7 +21,7 @@ namespace Stripe\V2\Core; * @property null|(object{currency?: string, locales?: string[], profile?: (object{business_url?: string, doing_business_as?: string, product_description?: string}&\Stripe\StripeObject), responsibilities: (object{fees_collector?: string, losses_collector?: string, requirements_collector: string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $defaults Default values for settings shared across Account configurations. * @property null|string $display_name A descriptive name for the Account. This name will be surfaced in the Stripe Dashboard and on any invoices sent to the Account. * @property null|(object{entries?: (object{awaiting_action_from: string, description: string, errors: (object{code: string, description: string}&\Stripe\StripeObject)[], impact: (object{restricts_capabilities?: (object{capability: string, configuration: string, deadline: (object{status: string}&\Stripe\StripeObject)}&\Stripe\StripeObject)[]}&\Stripe\StripeObject), minimum_deadline: (object{status: string}&\Stripe\StripeObject), reference?: (object{inquiry?: string, resource?: string, type: string}&\Stripe\StripeObject), requested_reasons: (object{code: string}&\Stripe\StripeObject)[]}&\Stripe\StripeObject)[], minimum_transition_date?: int, summary?: (object{minimum_deadline?: (object{status: string, time?: int}&\Stripe\StripeObject)}&\Stripe\StripeObject)}&\Stripe\StripeObject) $future_requirements Information about the future requirements for the Account that will eventually come into effect, including what information needs to be collected, and by when. - * @property null|(object{attestations?: (object{directorship_declaration?: (object{date?: int, ip?: string, user_agent?: string}&\Stripe\StripeObject), ownership_declaration?: (object{date?: int, ip?: string, user_agent?: string}&\Stripe\StripeObject), persons_provided?: (object{directors?: bool, executives?: bool, owners?: bool, ownership_exemption_reason?: string}&\Stripe\StripeObject), representative_declaration?: (object{date?: int, ip?: string, user_agent?: string}&\Stripe\StripeObject), terms_of_service?: (object{account?: (object{date?: int, ip?: string, user_agent?: string}&\Stripe\StripeObject)}&\Stripe\StripeObject)}&\Stripe\StripeObject), business_details?: (object{address?: (object{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}&\Stripe\StripeObject), annual_revenue?: (object{amount?: (object{value?: int, currency?: string}&\Stripe\StripeObject), fiscal_year_end?: string}&\Stripe\StripeObject), documents?: (object{bank_account_ownership_verification?: (object{files: string[], type: string}&\Stripe\StripeObject), company_license?: (object{files: string[], type: string}&\Stripe\StripeObject), company_memorandum_of_association?: (object{files: string[], type: string}&\Stripe\StripeObject), company_ministerial_decree?: (object{files: string[], type: string}&\Stripe\StripeObject), company_registration_verification?: (object{files: string[], type: string}&\Stripe\StripeObject), company_tax_id_verification?: (object{files: string[], type: string}&\Stripe\StripeObject), primary_verification?: (object{front_back: (object{back?: string, front: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), proof_of_address?: (object{files: string[], type: string}&\Stripe\StripeObject), proof_of_registration?: (object{files: string[], type: string}&\Stripe\StripeObject), proof_of_ultimate_beneficial_ownership?: (object{files: string[], type: string}&\Stripe\StripeObject)}&\Stripe\StripeObject), estimated_worker_count?: int, id_numbers?: (object{registrar?: string, type: string}&\Stripe\StripeObject)[], monthly_estimated_revenue?: (object{amount?: (object{value?: int, currency?: string}&\Stripe\StripeObject)}&\Stripe\StripeObject), phone?: string, registered_name?: string, registration_date?: (object{day: int, month: int, year: int}&\Stripe\StripeObject), script_addresses?: (object{kana?: (object{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}&\Stripe\StripeObject), kanji?: (object{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}&\Stripe\StripeObject)}&\Stripe\StripeObject), script_names?: (object{kana?: (object{registered_name?: string}&\Stripe\StripeObject), kanji?: (object{registered_name?: string}&\Stripe\StripeObject)}&\Stripe\StripeObject), structure?: string}&\Stripe\StripeObject), country?: string, entity_type?: string, individual?: (object{account: string, additional_addresses?: (object{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, purpose: string, state?: string, town?: string}&\Stripe\StripeObject)[], additional_names?: (object{full_name?: string, given_name?: string, purpose: string, surname?: string}&\Stripe\StripeObject)[], additional_terms_of_service?: (object{account?: (object{date?: int, ip?: string, user_agent?: string}&\Stripe\StripeObject)}&\Stripe\StripeObject), address?: (object{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}&\Stripe\StripeObject), created: int, date_of_birth?: (object{day: int, month: int, year: int}&\Stripe\StripeObject), documents?: (object{company_authorization?: (object{files: string[], type: string}&\Stripe\StripeObject), passport?: (object{files: string[], type: string}&\Stripe\StripeObject), primary_verification?: (object{front_back: (object{back?: string, front: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), secondary_verification?: (object{front_back: (object{back?: string, front: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), visa?: (object{files: string[], type: string}&\Stripe\StripeObject)}&\Stripe\StripeObject), email?: string, given_name?: string, id: string, id_numbers?: (object{type: string}&\Stripe\StripeObject)[], legal_gender?: string, metadata?: \Stripe\StripeObject, nationalities?: string[], object: string, phone?: string, political_exposure?: string, relationship?: (object{authorizer?: bool, director?: bool, executive?: bool, legal_guardian?: bool, owner?: bool, percent_ownership?: string, representative?: bool, title?: string}&\Stripe\StripeObject), script_addresses?: (object{kana?: (object{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}&\Stripe\StripeObject), kanji?: (object{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}&\Stripe\StripeObject)}&\Stripe\StripeObject), script_names?: (object{kana?: (object{given_name?: string, surname?: string}&\Stripe\StripeObject), kanji?: (object{given_name?: string, surname?: string}&\Stripe\StripeObject)}&\Stripe\StripeObject), surname?: string, updated: int}&\Stripe\StripeObject)}&\Stripe\StripeObject) $identity Information about the company, individual, and business represented by the Account. + * @property null|(object{attestations?: (object{directorship_declaration?: (object{date?: int, ip?: string, user_agent?: string}&\Stripe\StripeObject), ownership_declaration?: (object{date?: int, ip?: string, user_agent?: string}&\Stripe\StripeObject), persons_provided?: (object{directors?: bool, executives?: bool, owners?: bool, ownership_exemption_reason?: string}&\Stripe\StripeObject), representative_declaration?: (object{date?: int, ip?: string, user_agent?: string}&\Stripe\StripeObject), terms_of_service?: (object{account?: (object{date?: int, ip?: string, user_agent?: string}&\Stripe\StripeObject)}&\Stripe\StripeObject)}&\Stripe\StripeObject), business_details?: (object{address?: (object{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}&\Stripe\StripeObject), annual_revenue?: (object{amount?: \Stripe\StripeObject, fiscal_year_end?: string}&\Stripe\StripeObject), documents?: (object{bank_account_ownership_verification?: (object{files: string[], type: string}&\Stripe\StripeObject), company_license?: (object{files: string[], type: string}&\Stripe\StripeObject), company_memorandum_of_association?: (object{files: string[], type: string}&\Stripe\StripeObject), company_ministerial_decree?: (object{files: string[], type: string}&\Stripe\StripeObject), company_registration_verification?: (object{files: string[], type: string}&\Stripe\StripeObject), company_tax_id_verification?: (object{files: string[], type: string}&\Stripe\StripeObject), primary_verification?: (object{front_back: (object{back?: string, front: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), proof_of_address?: (object{files: string[], type: string}&\Stripe\StripeObject), proof_of_registration?: (object{files: string[], type: string}&\Stripe\StripeObject), proof_of_ultimate_beneficial_ownership?: (object{files: string[], type: string}&\Stripe\StripeObject)}&\Stripe\StripeObject), estimated_worker_count?: int, id_numbers?: (object{registrar?: string, type: string}&\Stripe\StripeObject)[], monthly_estimated_revenue?: (object{amount?: \Stripe\StripeObject}&\Stripe\StripeObject), phone?: string, registered_name?: string, registration_date?: (object{day: int, month: int, year: int}&\Stripe\StripeObject), script_addresses?: (object{kana?: (object{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}&\Stripe\StripeObject), kanji?: (object{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}&\Stripe\StripeObject)}&\Stripe\StripeObject), script_names?: (object{kana?: (object{registered_name?: string}&\Stripe\StripeObject), kanji?: (object{registered_name?: string}&\Stripe\StripeObject)}&\Stripe\StripeObject), structure?: string}&\Stripe\StripeObject), country?: string, entity_type?: string, individual?: (object{account: string, additional_addresses?: (object{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, purpose: string, state?: string, town?: string}&\Stripe\StripeObject)[], additional_names?: (object{full_name?: string, given_name?: string, purpose: string, surname?: string}&\Stripe\StripeObject)[], additional_terms_of_service?: (object{account?: (object{date?: int, ip?: string, user_agent?: string}&\Stripe\StripeObject)}&\Stripe\StripeObject), address?: (object{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}&\Stripe\StripeObject), created: int, date_of_birth?: (object{day: int, month: int, year: int}&\Stripe\StripeObject), documents?: (object{company_authorization?: (object{files: string[], type: string}&\Stripe\StripeObject), passport?: (object{files: string[], type: string}&\Stripe\StripeObject), primary_verification?: (object{front_back: (object{back?: string, front: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), secondary_verification?: (object{front_back: (object{back?: string, front: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), visa?: (object{files: string[], type: string}&\Stripe\StripeObject)}&\Stripe\StripeObject), email?: string, given_name?: string, id: string, id_numbers?: (object{type: string}&\Stripe\StripeObject)[], legal_gender?: string, metadata?: \Stripe\StripeObject, nationalities?: string[], object: string, phone?: string, political_exposure?: string, relationship?: (object{authorizer?: bool, director?: bool, executive?: bool, legal_guardian?: bool, owner?: bool, percent_ownership?: string, representative?: bool, title?: string}&\Stripe\StripeObject), script_addresses?: (object{kana?: (object{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}&\Stripe\StripeObject), kanji?: (object{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}&\Stripe\StripeObject)}&\Stripe\StripeObject), script_names?: (object{kana?: (object{given_name?: string, surname?: string}&\Stripe\StripeObject), kanji?: (object{given_name?: string, surname?: string}&\Stripe\StripeObject)}&\Stripe\StripeObject), surname?: string, updated: int}&\Stripe\StripeObject)}&\Stripe\StripeObject) $identity Information about the company, individual, and business represented by the Account. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|(object{entries?: (object{awaiting_action_from: string, description: string, errors: (object{code: string, description: string}&\Stripe\StripeObject)[], impact: (object{restricts_capabilities?: (object{capability: string, configuration: string, deadline: (object{status: string}&\Stripe\StripeObject)}&\Stripe\StripeObject)[]}&\Stripe\StripeObject), minimum_deadline: (object{status: string}&\Stripe\StripeObject), reference?: (object{inquiry?: string, resource?: string, type: string}&\Stripe\StripeObject), requested_reasons: (object{code: string}&\Stripe\StripeObject)[]}&\Stripe\StripeObject)[], summary?: (object{minimum_deadline?: (object{status: string, time?: int}&\Stripe\StripeObject)}&\Stripe\StripeObject)}&\Stripe\StripeObject) $requirements Information about the active requirements for the Account, including what information needs to be collected, and by when. @@ -30,6 +30,30 @@ class Account extends \Stripe\ApiResource { const OBJECT_NAME = 'v2.core.account'; + public static function fieldEncodings() + { + return [ + 'identity' => [ + 'kind' => 'object', + 'fields' => [ + 'individual' => [ + 'kind' => 'object', + 'fields' => [ + 'relationship' => [ + 'kind' => 'object', + 'fields' => [ + 'percent_ownership' => [ + 'kind' => 'decimal_string', + ], + ], + ], + ], + ], + ], + ], + ]; + } + const DASHBOARD_EXPRESS = 'express'; const DASHBOARD_FULL = 'full'; const DASHBOARD_NONE = 'none'; diff --git a/plugins/stripe-php/lib/V2/Core/AccountPerson.php b/plugins/stripe-php/lib/V2/Core/AccountPerson.php index 0afc0a5b..b0f4e398 100644 --- a/plugins/stripe-php/lib/V2/Core/AccountPerson.php +++ b/plugins/stripe-php/lib/V2/Core/AccountPerson.php @@ -36,6 +36,18 @@ class AccountPerson extends \Stripe\ApiResource { const OBJECT_NAME = 'v2.core.account_person'; + public static function fieldEncodings() + { + return [ + 'relationship' => [ + 'kind' => 'object', + 'fields' => [ + 'percent_ownership' => ['kind' => 'decimal_string'], + ], + ], + ]; + } + const LEGAL_GENDER_FEMALE = 'female'; const LEGAL_GENDER_MALE = 'male'; diff --git a/plugins/stripe-php/lib/V2/Core/EventDestination.php b/plugins/stripe-php/lib/V2/Core/EventDestination.php index b6b5b250..2fb57c24 100644 --- a/plugins/stripe-php/lib/V2/Core/EventDestination.php +++ b/plugins/stripe-php/lib/V2/Core/EventDestination.php @@ -14,7 +14,7 @@ namespace Stripe\V2\Core; * @property string $description An optional description of what the event destination is used for. * @property string[] $enabled_events The list of events to enable for this endpoint. * @property string $event_payload Payload type of events being subscribed to. - * @property null|string[] $events_from Where events should be routed from. + * @property null|string[] $events_from Specifies which accounts' events route to this destination. @self: Receive events from the account that owns the event destination. @accounts: Receive events emitted from other accounts you manage which includes your v1 and v2 accounts. @organization_members: Receive events from accounts directly linked to the organization. @organization_members/@accounts: Receive events from all accounts connected to any platform accounts in the organization. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|\Stripe\StripeObject $metadata Metadata. * @property string $name Event destination name. diff --git a/plugins/stripe-php/lib/V2/Core/EventNotification.php b/plugins/stripe-php/lib/V2/Core/EventNotification.php index 35bc921a..e285f9d3 100644 --- a/plugins/stripe-php/lib/V2/Core/EventNotification.php +++ b/plugins/stripe-php/lib/V2/Core/EventNotification.php @@ -65,7 +65,7 @@ abstract class EventNotification /** * Helper for constructing an Event Notification. Doesn't perform signature validation, so you - * should use \Stripe\BaseStripeClient#parseEventNotification instead for + * should use \Stripe\BaseStripeClient::parseEventNotification instead for * initial handling. This is useful in unit tests and working with EventNotifications that you've * already validated the authenticity of. * @@ -78,6 +78,12 @@ abstract class EventNotification { $json = json_decode($jsonStr, true); + if (isset($json['object']) && 'event' === $json['object']) { + throw new \Stripe\Exception\UnexpectedValueException( + 'You passed a webhook payload to StripeClient::parseEventNotification, which expects an event notification. Use Webhook::constructEvent instead.' + ); + } + $class = UnknownEventNotification::class; $eventNotificationTypes = EventNotificationTypes::v2EventMapping; if (\array_key_exists($json['type'], $eventNotificationTypes)) { diff --git a/plugins/stripe-php/lib/Webhook.php b/plugins/stripe-php/lib/Webhook.php index 6f4e9c3c..1a7dbc2c 100644 --- a/plugins/stripe-php/lib/Webhook.php +++ b/plugins/stripe-php/lib/Webhook.php @@ -32,11 +32,17 @@ abstract class Webhook $jsonError = \json_last_error(); if (null === $data && \JSON_ERROR_NONE !== $jsonError) { $msg = "Invalid payload: {$payload} " - . "(json_last_error() was {$jsonError})"; + . "(json_last_error() was {$jsonError})"; throw new Exception\UnexpectedValueException($msg); } + if (isset($data['object']) && 'v2.core.event' === $data['object']) { + throw new Exception\UnexpectedValueException( + 'You passed an event notification to Webhook::constructEvent, which expects a webhook payload. Use StripeClient::parseEventNotification instead.' + ); + } + return Event::constructFrom($data); } } diff --git a/plugins/stripe-php/lib/WebhookEndpoint.php b/plugins/stripe-php/lib/WebhookEndpoint.php index 70753a6c..d2f6685b 100644 --- a/plugins/stripe-php/lib/WebhookEndpoint.php +++ b/plugins/stripe-php/lib/WebhookEndpoint.php @@ -20,7 +20,7 @@ namespace Stripe; * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $description An optional description of what the webhook is used for. * @property string[] $enabled_events The list of events to enable for this endpoint. ['*'] indicates that all events are enabled, except those that require explicit selection. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $livemode If the object exists in live mode, the value is true. If the object exists in test mode, the value is false. * @property StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $secret The endpoint's secret, used to generate webhook signatures. Only returned at creation. * @property string $status The status of the webhook. It can be enabled or disabled. diff --git a/plugins/stripe-php/lib/version_check.php b/plugins/stripe-php/lib/version_check.php new file mode 100644 index 00000000..a253e2d9 --- /dev/null +++ b/plugins/stripe-php/lib/version_check.php @@ -0,0 +1,9 @@ +',"accordion-toggle":'',accordion:'',"action-next":'',"action-prev":'',"add-file":'',addtag:'',adjustments:'',"ai-prompt":'',ai:'',"align-center":'',"align-justify":'',"align-left":'',"align-none":'',"align-right":'',"alt-text":'',"arrow-left":'',"arrow-right":'',"auto-image-enhancement":'',blur:'',bold:'',bookmark:'',"border-style":'',"border-width":'',box:'',brightness:'',browse:'',camera:'',cancel:'',caption:'',"cell-background-color":'',"cell-border-color":'',"change-case":'',"character-count":'',"checklist-rtl":'',checklist:'',"checkmark-filled":'',checkmark:'',"chevron-down":'',"chevron-left":'',"chevron-right":'',"chevron-up":'',"close-filled":'',close:'',"code-sample":'',"color-levels":'',"color-picker":'',"color-swatch-remove-color":'',"color-swatch":'',"comment-add":'',comment:'',contrast:'',copy:'',crop:'',"cut-column":'',"cut-row":'',cut:'',"document-gear-properties":'',"document-properties":'',drag:'',dropbox:'',"duplicate-column":'',"duplicate-row":'',duplicate:'',"edit-block":'',"edit-image":'',"embed-page":'',embed:'',emoji:'',evernote:'',"export-pdf":'',"export-word":'',export:'',exposure:'',fb:'',feedback:'',fill:'',flickr:'',"flip-horizontally":'',"flip-vertically":'',folder:'',footnote:'',"format-code":'',"format-painter":'',format:'',fullscreen:'',gallery:'',gamma:'',"google-drive":'',"google-photos":'',grayscale:'',help:'',"highlight-bg-color":'',home:'',"horizontal-rule":'',huddle:'',"image-decorative":'',"image-enhancements":'',"image-options":'',image:'',"import-word":'',indent:'',info:'',"insert-character":'',"insert-time":'',instagram:'',invert:'',italic:'',language:'',"line-height":'',line:'',link:'',"list-bull-circle":'',"list-bull-default":'',"list-bull-disc":'',"list-bull-square":'',"list-num-default-rtl":'',"list-num-default":'',"list-num-lower-alpha-rtl":'',"list-num-lower-alpha":'',"list-num-lower-greek-rtl":'',"list-num-lower-greek":'',"list-num-lower-roman-rtl":'',"list-num-lower-roman":'',"list-num-upper-alpha-rtl":'',"list-num-upper-alpha":'',"list-num-upper-roman-rtl":'',"list-num-upper-roman":'',lock:'',ltr:'',"math-equation":'',mentions:'',minus:'',"more-drawer":'',"new-document":'',"new-tab":'',"non-breaking":'',notice:'',onedrive:'',"ordered-list-rtl":'',"ordered-list":'',orientation:'',outdent:'',"page-break":'',paragraph:'',"paste-column-after":'',"paste-column-before":'',"paste-row-after":'',"paste-row-before":'',"paste-text":'',paste:'',"permanent-pen":'',"photo-filter":'',plus:'',preferences:'',preview:'',print:'',quote:'',redo:'',reload:'',"remove-formatting":'',remove:'',"resize-handle":'',resize:'',"restore-draft":'',"revert-changes":'',"revision-history":'',"rotate-left":'',"rotate-right":'',rtl:'',saturation:'',save:'',search:'',"select-all":'',selected:'',send:'',settings:'',sharpen:'',sourcecode:'',"spell-check":'',"strike-through":'',subscript:'',"suggestededits-badge":'',suggestededits:'',superscript:'',"table-caption":'',"table-cell-classes":'',"table-cell-properties":'',"table-cell-select-all":'',"table-cell-select-inner":'',"table-classes":'',"table-delete-column":'',"table-delete-row":'',"table-delete-table":'',"table-insert-column-after":'',"table-insert-column-before":'',"table-insert-row-above":'',"table-insert-row-after":'',"table-left-header":'',"table-merge-cells":'',"table-row-numbering-rtl":'',"table-row-numbering":'',"table-row-properties":'',"table-split-cells":'',"table-top-header":'',table:'',"template-add":'',template:'',"temporary-placeholder":'',"text-color":'',"text-size-decrease":'',"text-size-increase":'',toc:'',"transform-image":'',translate:'',typography:'',underline:'',undo:'',unlink:'',unlock:'',"unordered-list":'',unselected:'',"upload-from-device":'',"upload-from-link":'',upload:'',user:'',"vertical-align":'',vibrance:'',visualblocks:'',visualchars:'',vk:'',warmth:'',warning:'',"zoom-in":'',"zoom-out":''}}); \ No newline at end of file +tinymce.IconManager.add("default",{icons:{"accessibility-check":'',"accordion-toggle":'',accordion:'',"action-next":'',"action-prev":'',"add-file":'',addtag:'',"adjust-length":'',adjustments:'',"ai-assistant":'',"ai-chat-response":'',"ai-model":'',"ai-prompt":'',"ai-review":'',"ai-translate":'',ai:'',"align-center":'',"align-justify":'',"align-left":'',"align-none":'',"align-right":'',"alt-text":'',"arrow-left":'',"arrow-right":'',attachment:'',"auto-image-enhancement":'',blur:'',bold:'',bookmark:'',"border-style":'',"border-width":'',box:'',brightness:'',browse:'',camera:'',cancel:'',caption:'',"cell-background-color":'',"cell-border-color":'',"change-case":'',"change-tone":'',"character-count":'',"chat-commands":'',"chat-reasoning":'',"chat-send":'',"chat-web-search":'',"checklist-rtl":'',checklist:'',"checkmark-filled":'',checkmark:'',"chevron-down":'',"chevron-left":'',"chevron-right":'',"chevron-up":'',"close-filled":'',close:'',"code-sample":'',collapse:'',"color-levels":'',"color-picker":'',"color-swatch-remove-color":'',"color-swatch":'',"comment-add":'',comment:'',"continue-writing":'',contrast:'',copy:'',crop:'',"cut-column":'',"cut-row":'',cut:'',"document-gear-properties":'',"document-properties":'',drag:'',dropbox:'',"duplicate-column":'',"duplicate-row":'',duplicate:'',"edit-block":'',"edit-image":'',"embed-page":'',embed:'',emoji:'',evernote:'',explain:'',"export-pdf":'',"export-word":'',export:'',exposure:'',fb:'',feedback:'',fill:'',"fix-grammar":'',flickr:'',"flip-horizontally":'',"flip-vertically":'',folder:'',footnote:'',"format-code":'',"format-painter":'',format:'',fullscreen:'',gallery:'',gamma:'',"google-drive":'',"google-photos":'',grayscale:'',help:'',"highlight-bg-color":'',"highlight-key-points":'',home:'',"horizontal-rule":'',huddle:'',"image-decorative":'',"image-enhancements":'',"image-options":'',image:'',"import-word":'',"improve-writing":'',indent:'',info:'',"insert-character":'',"insert-time":'',instagram:'',invert:'',italic:'',language:'',"line-height":'',line:'',link:'',"list-bull-circle":'',"list-bull-default":'',"list-bull-disc":'',"list-bull-square":'',"list-num-default-rtl":'',"list-num-default":'',"list-num-lower-alpha-rtl":'',"list-num-lower-alpha":'',"list-num-lower-greek-rtl":'',"list-num-lower-greek":'',"list-num-lower-roman-rtl":'',"list-num-lower-roman":'',"list-num-upper-alpha-rtl":'',"list-num-upper-alpha":'',"list-num-upper-roman-rtl":'',"list-num-upper-roman":'',lock:'',ltr:'',"math-equation":'',mentions:'',minus:'',"more-drawer":'',"new-chat":'',"new-document":'',"new-tab":'',"non-breaking":'',notice:'',onedrive:'',"ordered-list-rtl":'',"ordered-list":'',orientation:'',"other-actions":'',outdent:'',"page-break":'',paragraph:'',"paste-column-after":'',"paste-column-before":'',"paste-row-after":'',"paste-row-before":'',"paste-text":'',paste:'',"permanent-pen":'',"photo-filter":'',pin:'',plus:'',preferences:'',preview:'',print:'',quote:'',reasoning:'',redo:'',reload:'',"remove-formatting":'',remove:'',"resize-handle":'',resize:'',"restore-draft":'',"revert-changes":'',"revision-history":'',"rotate-left":'',"rotate-right":'',rtl:'',saturation:'',save:'',search:'',"select-all":'',selected:'',send:'',settings:'',sharpen:'',"source-close":'',"source-file":'',"source-image":'',"source-link":'',"source-selection":'',sourcecode:'',"spell-check":'',stop:'',"strike-through":'',subscript:'',"suggestededits-badge":'',suggestededits:'',summarize:'',superscript:'',"table-caption":'',"table-cell-classes":'',"table-cell-properties":'',"table-cell-select-all":'',"table-cell-select-inner":'',"table-classes":'',"table-delete-column":'',"table-delete-row":'',"table-delete-table":'',"table-insert-column-after":'',"table-insert-column-before":'',"table-insert-row-above":'',"table-insert-row-after":'',"table-left-header":'',"table-merge-cells":'',"table-row-numbering-rtl":'',"table-row-numbering":'',"table-row-properties":'',"table-split-cells":'',"table-top-header":'',table:'',"template-add":'',template:'',"temporary-placeholder":'',"text-color":'',"text-size-decrease":'',"text-size-increase":'',toc:'',"transform-image":'',translate:'',typography:'',underline:'',undo:'',unlink:'',unlock:'',"unordered-list":'',unpin:'',unselected:'',"upload-from-device":'',"upload-from-link":'',upload:'',user:'',"vertical-align":'',vibrance:'',visualblocks:'',visualchars:'',vk:'',warmth:'',warning:'',"web-search":'',"zoom-in":'',"zoom-out":''}}); \ No newline at end of file diff --git a/plugins/tinymce/models/dom/model.min.js b/plugins/tinymce/models/dom/model.min.js index edb473b7..aab17404 100644 --- a/plugins/tinymce/models/dom/model.min.js +++ b/plugins/tinymce/models/dom/model.min.js @@ -1 +1 @@ -!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.ModelManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=n=e,(r=String).prototype.isPrototypeOf(o)||n.constructor?.name===r.name)?"string":t;var o,n,r})(t)===e,o=e=>t=>typeof t===e,n=e=>t=>e===t,r=t("string"),s=t("object"),l=t("array"),a=n(null),c=o("boolean"),i=n(void 0),m=e=>!(e=>null==e)(e),d=o("function"),u=o("number"),f=()=>{},g=e=>()=>e,h=e=>e,p=(e,t)=>e===t;function b(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const w=e=>t=>!e(t),v=e=>e(),y=g(!1),x=g(!0);class C{tag;value;static singletonNone=new C(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new C(!0,e)}static none(){return C.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?C.some(e(this.value)):C.none()}bind(e){return this.tag?e(this.value):C.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:C.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(e??"Called getOrDie on None")}static from(e){return m(e)?C.some(e):C.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}const S=Array.prototype.slice,T=Array.prototype.indexOf,R=Array.prototype.push,D=(e,t)=>{return o=e,n=t,T.call(o,n)>-1;var o,n},O=(e,t)=>{for(let o=0,n=e.length;o{const o=[];for(let n=0;n{const o=e.length,n=new Array(o);for(let r=0;r{for(let o=0,n=e.length;o{const o=[],n=[];for(let r=0,s=e.length;r{const o=[];for(let n=0,r=e.length;n(((e,t)=>{for(let o=e.length-1;o>=0;o--)t(e[o],o)})(e,((e,n)=>{o=t(o,e,n)})),o),A=(e,t,o)=>(N(e,((e,n)=>{o=t(o,e,n)})),o),L=(e,t)=>((e,t,o)=>{for(let n=0,r=e.length;n{for(let o=0,n=e.length;o{const t=[];for(let o=0,n=e.length;oW(E(e,t)),P=(e,t)=>{for(let o=0,n=e.length;o{const o={};for(let n=0,r=e.length;nt>=0&&tF(e,0),$=e=>F(e,e.length-1),V=(e,t)=>{for(let o=0;o{const o=q(e);for(let n=0,r=o.length;nY(e,((e,o)=>({k:o,v:t(e,o)}))),Y=(e,t)=>{const o={};return G(e,((e,n)=>{const r=t(e,n);o[r.k]=r.v})),o},J=(e,t)=>{const o=[];return G(e,((e,n)=>{o.push(t(e,n))})),o},Q=e=>J(e,h),X=(e,t)=>U.call(e,t),Z=e=>{if(!l(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");const t=[],o={};return N(e,((n,r)=>{const s=q(n);if(1!==s.length)throw new Error("one and only one name per case");const a=s[0],c=n[a];if(void 0!==o[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!l(c))throw new Error("case arguments must be an array");t.push(a),o[a]=(...o)=>{const n=o.length;if(n!==c.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+c.length+" ("+c+"), got "+n);return{fold:(...t)=>{if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);return t[r].apply(null,o)},match:e=>{const n=q(e);if(t.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","));if(!P(t,(e=>D(n,e))))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "));return e[a].apply(null,o)},log:e=>{console.log(e,{constructors:t,constructor:a,params:o})}}}})),o},ee=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}},te=e=>e.slice(0).sort(),oe=(e,t)=>{const o=_(t,(t=>!D(e,t)));o.length>0&&(e=>{throw new Error("Unsupported keys for object: "+te(e).join(", "))})(o)},ne=e=>((e,t)=>((e,t,o)=>{if(0===t.length)throw new Error("You must specify at least one required field.");return((e,t)=>{if(!l(t))throw new Error("The "+e+" fields must be an array. Was: "+t+".");N(t,(t=>{if(!r(t))throw new Error("The value "+t+" in the "+e+" fields was not a string.")}))})("required",t),(e=>{const t=te(e);L(t,((e,o)=>o{throw new Error("The field: "+e+" occurs more than once in the combined fields: ["+t.join(", ")+"].")}))})(t),n=>{const r=q(n);P(t,(e=>D(r,e)))||((e,t)=>{throw new Error("All required keys ("+te(e).join(", ")+") were not specified. Specified keys were: "+te(t).join(", ")+".")})(t,r),e(t,r);const s=_(t,(e=>!o.validate(n[e],e)));return s.length>0&&((e,t)=>{throw new Error("All values need to be of type: "+t+". Keys ("+te(e).join(", ")+") were not.")})(s,o.label),n}})(e,t,{validate:d,label:"function"}))(oe,e),re=e=>{const t=t=>t(e),o=g(e),n=()=>r,r={tag:!0,inner:e,fold:(t,o)=>o(e),isValue:x,isError:y,map:t=>le.value(t(e)),mapError:n,bind:t,exists:t,forall:t,getOr:o,or:n,getOrThunk:o,orThunk:n,getOrDie:o,each:t=>{t(e)},toOptional:()=>C.some(e)};return r},se=e=>{const t=()=>o,o={tag:!1,inner:e,fold:(t,o)=>t(e),isValue:y,isError:x,map:t,mapError:t=>le.error(t(e)),bind:t,exists:y,forall:x,getOr:h,or:h,getOrThunk:v,orThunk:v,getOrDie:(n=String(e),()=>{throw new Error(n)}),each:f,toOptional:C.none};var n;return o},le={value:re,error:se,fromOption:(e,t)=>e.fold((()=>se(t)),re)},ae="undefined"!=typeof window?window:Function("return this;")(),ce=e=>{const t=e.replace(/\./g,"-");return{resolve:e=>t+"-"+e}},ie=(e,t,o=p)=>e.exists((e=>o(e,t))),me=e=>{const t=[],o=e=>{t.push(e)};for(let t=0;te?C.some(t):C.none(),ue=(e,t)=>((e,t)=>{let o=null!=t?t:ae;for(let t=0;t{const e=(e=>{const t=ee(C.none()),o=()=>t.get().each(e);return{clear:()=>{o(),t.set(C.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{o(),t.set(C.some(e))}}})(f);return{...e,on:t=>e.get().each(t)}},ge=(e,t,o)=>""===t||e.length>=t.length&&e.substr(o,o+t.length)===t,he=(e,t,o=0,n)=>{const r=e.indexOf(t,o);return-1!==r&&(!!i(n)||r+t.length<=n)},pe=(e,t)=>ge(e,t,0),be=(e,t)=>ge(e,t,e.length-t.length),we=(e=>t=>t.replace(e,""))(/^\s+|\s+$/g),ve=e=>e.length>0,ye=e=>{let t,o=!1;return(...n)=>(o||(o=!0,t=e.apply(null,n)),t)},xe=["tfoot","thead","tbody","colgroup"],Ce=(e,t,o)=>({element:e,rowspan:t,colspan:o}),Se=(e,t,o)=>({element:e,cells:t,section:o}),Te=(e,t,o)=>({element:e,isNew:t,isLocked:o}),Re=(e,t,o,n)=>({element:e,cells:t,section:o,isNew:n}),De=(e,t,o)=>{const n=e.cells,r=n.slice(0,t),s=n.slice(t),l=r.concat(o).concat(s);return Ee(e,l)},Oe=(e,t,o)=>De(e,t,[o]),ke=(e,t,o)=>{e.cells[t]=o},Ee=(e,t)=>Re(e.element,t,e.section,e.isNew),Ne=(e,t)=>e.cells[t],Be=(e,t)=>Ne(e,t).element,_e=e=>e.cells.length,ze=e=>{const t=B(e,(e=>"colgroup"===e.section));return{rows:t.fail,cols:t.pass}},Ae=(e,t,o)=>{const n=E(e.cells,o);return Re(t(e.element),n,e.section,!0)},Le=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},Me={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return Le(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return Le(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return Le(o)},fromDom:Le,fromPoint:(e,t,o)=>C.from(e.dom.elementFromPoint(t,o)).map(Le)},We=(e,t)=>{const o=e.document.createRange();return o.selectNode(t.dom),o},je=(e,t)=>{const o=e.document.createRange();return Pe(o,t),o},Pe=(e,t)=>e.selectNodeContents(t.dom),Ie=(e,t,o)=>{const n=e.document.createRange();var r;return r=n,t.fold((e=>{r.setStartBefore(e.dom)}),((e,t)=>{r.setStart(e.dom,t)}),(e=>{r.setStartAfter(e.dom)})),((e,t)=>{t.fold((t=>{e.setEndBefore(t.dom)}),((t,o)=>{e.setEnd(t.dom,o)}),(t=>{e.setEndAfter(t.dom)}))})(n,o),n},Fe=(e,t,o,n,r)=>{const s=e.document.createRange();return s.setStart(t.dom,o),s.setEnd(n.dom,r),s},He=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}),$e=Z([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Ve=(e,t,o)=>t(Me.fromDom(o.startContainer),o.startOffset,Me.fromDom(o.endContainer),o.endOffset),qe=(e,t)=>{const o=((e,t)=>t.match({domRange:e=>({ltr:g(e),rtl:C.none}),relative:(t,o)=>({ltr:ye((()=>Ie(e,t,o))),rtl:ye((()=>C.some(Ie(e,o,t))))}),exact:(t,o,n,r)=>({ltr:ye((()=>Fe(e,t,o,n,r))),rtl:ye((()=>C.some(Fe(e,n,r,t,o))))})}))(e,t);return((e,t)=>{const o=t.ltr();return o.collapsed?t.rtl().filter((e=>!1===e.collapsed)).map((e=>$e.rtl(Me.fromDom(e.endContainer),e.endOffset,Me.fromDom(e.startContainer),e.startOffset))).getOrThunk((()=>Ve(0,$e.ltr,o))):Ve(0,$e.ltr,o)})(0,o)},Ue=(e,t)=>qe(e,t).match({ltr:(t,o,n,r)=>{const s=e.document.createRange();return s.setStart(t.dom,o),s.setEnd(n.dom,r),s},rtl:(t,o,n,r)=>{const s=e.document.createRange();return s.setStart(n.dom,r),s.setEnd(t.dom,o),s}});$e.ltr,$e.rtl;const Ge=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},Ke=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,Ye=(e,t)=>{const o=void 0===t?document:t.dom;return Ke(o)?C.none():C.from(o.querySelector(e)).map(Me.fromDom)},Je=(e,t)=>e.dom===t.dom,Qe=(e,t)=>{const o=e.dom,n=t.dom;return o!==n&&o.contains(n)},Xe=Ge,Ze=()=>et(0,0),et=(e,t)=>({major:e,minor:t}),tt={nu:et,detect:(e,t)=>{const o=String(t).toLowerCase();return 0===e.length?Ze():((e,t)=>{const o=((e,t)=>{for(let o=0;oNumber(t.replace(o,"$"+e));return et(n(1),n(2))})(e,o)},unknown:Ze},ot=(e,t)=>{const o=String(t).toLowerCase();return L(e,(e=>e.search(o)))},nt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,rt=e=>t=>he(t,e),st=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>he(e,"edge/")&&he(e,"chrome")&&he(e,"safari")&&he(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,nt],search:e=>he(e,"chrome")&&!he(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>he(e,"msie")||he(e,"trident")},{name:"Opera",versionRegexes:[nt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:rt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:rt("firefox")},{name:"Safari",versionRegexes:[nt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(he(e,"safari")||he(e,"mobile/"))&&he(e,"applewebkit")}],lt=[{name:"Windows",search:rt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>he(e,"iphone")||he(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:rt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:rt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:rt("linux"),versionRegexes:[]},{name:"Solaris",search:rt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:rt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:rt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],at={browsers:g(st),oses:g(lt)},ct="Edge",it="Chromium",mt="Opera",dt="Firefox",ut="Safari",ft=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isEdge:n(ct),isChromium:n(it),isIE:n("IE"),isOpera:n(mt),isFirefox:n(dt),isSafari:n(ut)}},gt=()=>ft({current:void 0,version:tt.unknown()}),ht=ft,pt=(g(ct),g(it),g("IE"),g(mt),g(dt),g(ut),"Windows"),bt="Android",wt="Linux",vt="macOS",yt="Solaris",xt="FreeBSD",Ct="ChromeOS",St=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isWindows:n(pt),isiOS:n("iOS"),isAndroid:n(bt),isMacOS:n(vt),isLinux:n(wt),isSolaris:n(yt),isFreeBSD:n(xt),isChromeOS:n(Ct)}},Tt=()=>St({current:void 0,version:tt.unknown()}),Rt=St,Dt=(g(pt),g("iOS"),g(bt),g(wt),g(vt),g(yt),g(xt),g(Ct),e=>window.matchMedia(e).matches);let Ot=ye((()=>((e,t,o)=>{const n=at.browsers(),r=at.oses(),s=t.bind((e=>((e,t)=>V(t.brands,(t=>{const o=t.brand.toLowerCase();return L(e,(e=>o===e.brand?.toLowerCase())).map((e=>({current:e.name,version:tt.nu(parseInt(t.version,10),0)})))})))(n,e))).orThunk((()=>((e,t)=>ot(e,t).map((e=>{const o=tt.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(n,e))).fold(gt,ht),l=((e,t)=>ot(e,t).map((e=>{const o=tt.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(r,e).fold(Tt,Rt),a=((e,t,o,n)=>{const r=e.isiOS()&&!0===/ipad/i.test(o),s=e.isiOS()&&!r,l=e.isiOS()||e.isAndroid(),a=l||n("(pointer:coarse)"),c=r||!s&&l&&n("(min-device-width:768px)"),i=s||l&&!c,m=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(o),d=!i&&!c&&!m;return{isiPad:g(r),isiPhone:g(s),isTablet:g(c),isPhone:g(i),isTouch:g(a),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:g(m),isDesktop:g(d)}})(l,s,e,o);return{browser:s,os:l,deviceType:a}})(window.navigator.userAgent,C.from(window.navigator.userAgentData),Dt)));const kt=()=>Ot(),Et=Object.getPrototypeOf,Nt=e=>{const t=ue("ownerDocument.defaultView",e);return s(e)&&((e=>((e,t)=>{const o=((e,t)=>ue(e,t))(e,t);if(null==o)throw new Error(e+" not available on this browser");return o})("HTMLElement",e))(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(Et(e).constructor.name))},Bt=e=>e.dom.nodeName.toLowerCase(),_t=e=>e.dom.nodeType,zt=e=>t=>_t(t)===e,At=e=>8===_t(e)||"#comment"===Bt(e),Lt=e=>Mt(e)&&Nt(e.dom),Mt=zt(1),Wt=zt(3),jt=zt(9),Pt=zt(11),It=e=>t=>Mt(t)&&Bt(t)===e,Ft=e=>Me.fromDom(e.dom.ownerDocument),Ht=e=>jt(e)?e:Ft(e),$t=e=>C.from(e.dom.parentNode).map(Me.fromDom),Vt=e=>C.from(e.dom.parentElement).map(Me.fromDom),qt=(e,t)=>{const o=d(t)?t:y;let n=e.dom;const r=[];for(;null!==n.parentNode&&void 0!==n.parentNode;){const e=n.parentNode,t=Me.fromDom(e);if(r.push(t),!0===o(t))break;n=e}return r},Ut=e=>C.from(e.dom.previousSibling).map(Me.fromDom),Gt=e=>C.from(e.dom.nextSibling).map(Me.fromDom),Kt=e=>E(e.dom.childNodes,Me.fromDom),Yt=(e,t)=>{const o=e.dom.childNodes;return C.from(o[t]).map(Me.fromDom)},Jt=e=>Pt(e)&&m(e.dom.host),Qt=e=>Me.fromDom(e.dom.getRootNode()),Xt=e=>Me.fromDom(e.dom.host),Zt=e=>{const t=Me.fromDom((e=>{if(m(e.target)){const t=Me.fromDom(e.target);if(Mt(t)&&m(t.dom.shadowRoot)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return H(t)}}return C.from(e.target)})(e).getOr(e.target)),o=()=>e.stopPropagation(),n=()=>e.preventDefault(),r=(s=n,l=o,(...e)=>s(l.apply(null,e)));var s,l;return((e,t,o,n,r,s,l)=>({target:e,x:t,y:o,stop:n,prevent:r,kill:s,raw:l}))(t,e.clientX,e.clientY,o,n,r,e)},eo=(e,t,o,n)=>{e.dom.removeEventListener(t,o,n)},to=x,oo=(e,t,o)=>((e,t,o,n)=>((e,t,o,n,r)=>{const s=((e,t)=>o=>{e(o)&&t(Zt(o))})(o,n);return e.dom.addEventListener(t,s,r),{unbind:b(eo,e,t,s,r)}})(e,t,o,n,!1))(e,t,to,o),no=Zt,ro=(e,t)=>{$t(e).each((o=>{o.dom.insertBefore(t.dom,e.dom)}))},so=(e,t)=>{Gt(e).fold((()=>{$t(e).each((e=>{ao(e,t)}))}),(e=>{ro(e,t)}))},lo=(e,t)=>{const o=(e=>Yt(e,0))(e);o.fold((()=>{ao(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))},ao=(e,t)=>{e.dom.appendChild(t.dom)},co=(e,t)=>{ro(e,t),ao(t,e)},io=(e,t)=>{N(t,((o,n)=>{const r=0===n?e:t[n-1];so(r,o)}))},mo=(e,t)=>{N(t,(t=>{ao(e,t)}))},uo=(e,t,o)=>{if(!(r(o)||c(o)||u(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")},fo=(e,t,o)=>{uo(e.dom,t,o)},go=(e,t)=>{const o=e.dom;G(t,((e,t)=>{uo(o,t,e)}))},ho=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},po=(e,t)=>C.from(ho(e,t)),bo=(e,t)=>{e.dom.removeAttribute(t)},wo=e=>A(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}),vo=e=>{e.dom.textContent="",N(Kt(e),(e=>{yo(e)}))},yo=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},xo=e=>{const t=Kt(e);t.length>0&&io(e,t),yo(e)},Co=(e,t)=>Me.fromDom(e.dom.cloneNode(t)),So=e=>Co(e,!1),To=e=>Co(e,!0),Ro=(e,t)=>{const o=Me.fromTag(t),n=wo(e);return go(o,n),o},Do=e=>void 0!==e.style&&d(e.style.getPropertyValue),Oo=e=>{const t=Wt(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return(e=>{const t=Qt(e);return Jt(t)?C.some(t):C.none()})(Me.fromDom(t)).fold((()=>o.body.contains(t)),(n=Oo,r=Xt,e=>n(r(e))));var n,r},ko=(e,t,o)=>{if(!r(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);Do(e)&&e.style.setProperty(t,o)},Eo=(e,t,o)=>{const n=e.dom;ko(n,t,o)},No=(e,t)=>{const o=e.dom;G(t,((e,t)=>{ko(o,t,e)}))},Bo=(e,t)=>{const o=e.dom,n=window.getComputedStyle(o).getPropertyValue(t);return""!==n||Oo(e)?n:_o(o,t)},_o=(e,t)=>Do(e)?e.style.getPropertyValue(t):"",zo=(e,t)=>{const o=e.dom,n=_o(o,t);return C.from(n).filter((e=>e.length>0))},Ao=(e,t)=>{((e,t)=>{Do(e)&&e.style.removeProperty(t)})(e.dom,t),ie(po(e,"style").map(we),"")&&bo(e,"style")},Lo=(e,t)=>{const o=o=>{const n=t(o);if(n<=0||null===n){const t=Bo(o,e);return parseFloat(t)||0}return n},n=(e,t)=>A(t,((t,o)=>{const n=Bo(e,o),r=void 0===n?0:parseInt(n,10);return isNaN(r)?t:t+r}),0);return{set:(t,o)=>{if(!u(o)&&!o.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+o);const n=t.dom;Do(n)&&(n.style[e]=o+"px")},get:o,getOuter:o,aggregate:n,max:(e,t,o)=>{const r=n(e,o);return t>r?t-r:0}}},Mo=(e,t,o)=>((e,t)=>(e=>{const t=parseFloat(e);return isNaN(t)?C.none():C.some(t)})(e).getOr(t))(Bo(e,t),o),Wo=Lo("height",(e=>{const t=e.dom;return Oo(e)?t.getBoundingClientRect().height:t.offsetHeight})),jo=e=>Wo.get(e),Po=e=>Wo.getOuter(e),Io=Lo("width",(e=>{const t=e.dom;return Oo(e)?t.getBoundingClientRect().width:t.offsetWidth})),Fo=e=>Io.get(e),Ho=e=>Io.getOuter(e),$o=e=>((e,t)=>{const o=e.dom,n=o.getBoundingClientRect().width||o.offsetWidth;return"border-box"===t?n:((e,t,o,n)=>t-Mo(e,`padding-${o}`,0)-Mo(e,`padding-${n}`,0)-Mo(e,`border-${o}-width`,0)-Mo(e,`border-${n}-width`,0))(e,n,"left","right")})(e,"content-box"),Vo=(e,t)=>({left:e,top:t,translate:(o,n)=>Vo(e+o,t+n)}),qo=Vo,Uo=(e,t)=>void 0!==e?e:void 0!==t?t:0,Go=e=>{const t=e.dom.ownerDocument,o=t.body,n=t.defaultView,r=t.documentElement;if(o===e.dom)return qo(o.offsetLeft,o.offsetTop);const s=Uo(n?.pageYOffset,r.scrollTop),l=Uo(n?.pageXOffset,r.scrollLeft),a=Uo(r.clientTop,o.clientTop),c=Uo(r.clientLeft,o.clientLeft);return Ko(e).translate(l-c,s-a)},Ko=e=>{const t=e.dom,o=t.ownerDocument.body;return o===t?qo(o.offsetLeft,o.offsetTop):Oo(e)?(e=>{const t=e.getBoundingClientRect();return qo(t.left,t.top)})(t):qo(0,0)},Yo=(e=>{const t=t=>e(t)?C.from(t.dom.nodeValue):C.none();return{get:o=>{if(!e(o))throw new Error("Can only get text value of a text node");return t(o).getOr("")},getOption:t,set:(t,o)=>{if(!e(t))throw new Error("Can only set raw text value of a text node");t.dom.nodeValue=o}}})(Wt),Jo=e=>Yo.get(e),Qo=e=>Yo.getOption(e),Xo=(e,t)=>Yo.set(e,t),Zo=(e,t)=>o=>"rtl"===en(o)?t:e,en=e=>"rtl"===Bo(e,"direction")?"rtl":"ltr";var tn=(e,t,o,n,r)=>e(o,n)?C.some(o):d(r)&&r(o)?C.none():t(o,n,r);const on=(e,t,o)=>{let n=e.dom;const r=d(o)?o:y;for(;n.parentNode;){n=n.parentNode;const e=Me.fromDom(n);if(t(e))return C.some(e);if(r(e))break}return C.none()},nn=(e,t,o)=>tn(((e,t)=>t(e)),on,e,t,o),rn=(e,t,o)=>on(e,(e=>Ge(e,t)),o),sn=(e,t)=>(e=>L(e.dom.childNodes,(e=>{return o=Me.fromDom(e),Ge(o,t);var o})).map(Me.fromDom))(e),ln=(e,t)=>Ye(t,e),an=(e,t,o)=>tn(((e,t)=>Ge(e,t)),rn,e,t,o),cn=e=>void 0!==e.dom.classList,mn=(e,t)=>((e,t,o)=>{const n=((e,t)=>{const o=ho(e,t);return void 0===o||""===o?[]:o.split(" ")})(e,t).concat([o]);return fo(e,t,n.join(" ")),!0})(e,"class",t),dn=(e,t)=>{cn(e)?e.dom.classList.add(t):mn(e,t)},un=(e,t)=>cn(e)&&e.dom.classList.contains(t),fn=e=>an(e,"[contenteditable]"),gn=(e,t=!1)=>Oo(e)?e.dom.isContentEditable:fn(e).fold(g(t),(e=>"true"===hn(e))),hn=e=>e.dom.contentEditable,pn=(e,t)=>{let o=[];return N(Kt(e),(e=>{t(e)&&(o=o.concat([e])),o=o.concat(pn(e,t))})),o},bn=(e,t,o)=>((e,o,n)=>_(qt(e,n),(e=>Ge(e,t))))(e,0,o),wn=(e,t)=>(e=>_(Kt(e),(e=>Ge(e,t))))(e),vn=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return Ke(o)?[]:E(o.querySelectorAll(e),Me.fromDom)})(t,e),yn=e=>"img"===Bt(e)?1:Qo(e).fold((()=>Kt(e).length),(e=>e.length)),xn=["img","br"],Cn=e=>Qo(e).filter((e=>0!==e.trim().length||e.indexOf("\xa0")>-1)).isSome()||D(xn,Bt(e))||(e=>Lt(e)&&"false"===ho(e,"contenteditable"))(e),Sn=e=>((e,t)=>{const o=e=>{for(let n=0;nRn(e,Cn),Rn=(e,t)=>{const o=e=>{const n=Kt(e);for(let e=n.length-1;e>=0;e--){const r=n[e];if(t(r))return C.some(r);const s=o(r);if(s.isSome())return s}return C.none()};return o(e)},Dn=(e,t,o,n)=>({start:e,soffset:t,finish:o,foffset:n}),On=Z([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),kn={before:On.before,on:On.on,after:On.after,cata:(e,t,o,n)=>e.fold(t,o,n),getStart:e=>e.fold(h,h,h)},En=Z([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Nn={domRange:En.domRange,relative:En.relative,exact:En.exact,exactFromRange:e=>En.exact(e.start,e.soffset,e.finish,e.foffset),getWin:e=>{const t=(e=>e.match({domRange:e=>Me.fromDom(e.startContainer),relative:(e,t)=>kn.getStart(e),exact:(e,t,o,n)=>e}))(e);return Me.fromDom(Ht(t).dom.defaultView)},range:Dn},Bn=(e,t)=>{const o=Bt(e);return"input"===o?kn.after(e):D(["br","img"],o)?0===t?kn.before(e):kn.after(e):kn.on(e,t)},_n=e=>C.from(e.getSelection()),zn=(e,t)=>{_n(e).each((e=>{e.removeAllRanges(),e.addRange(t)}))},An=(e,t,o,n,r)=>{const s=Fe(e,t,o,n,r);zn(e,s)},Ln=(e,t)=>qe(e,t).match({ltr:(t,o,n,r)=>{An(e,t,o,n,r)},rtl:(t,o,n,r)=>{_n(e).each((s=>{if(s.setBaseAndExtent)s.setBaseAndExtent(t.dom,o,n.dom,r);else if(s.extend)try{((e,t,o,n,r,s)=>{t.collapse(o.dom,n),t.extend(r.dom,s)})(0,s,t,o,n,r)}catch{An(e,n,r,t,o)}else An(e,n,r,t,o)}))}}),Mn=(e,t,o,n,r)=>{const s=((e,t,o,n)=>{const r=Bn(e,t),s=Bn(o,n);return Nn.relative(r,s)})(t,o,n,r);Ln(e,s)},Wn=(e,t,o)=>{const n=((e,t)=>{const o=e.fold(kn.before,Bn,kn.after),n=t.fold(kn.before,Bn,kn.after);return Nn.relative(o,n)})(t,o);Ln(e,n)},jn=e=>{if(e.rangeCount>0){const t=e.getRangeAt(0),o=e.getRangeAt(e.rangeCount-1);return C.some(Dn(Me.fromDom(t.startContainer),t.startOffset,Me.fromDom(o.endContainer),o.endOffset))}return C.none()},Pn=e=>{if(null===e.anchorNode||null===e.focusNode)return jn(e);{const t=Me.fromDom(e.anchorNode),o=Me.fromDom(e.focusNode);return((e,t,o,n)=>{const r=((e,t,o,n)=>{const r=Ft(e).dom.createRange();return r.setStart(e.dom,t),r.setEnd(o.dom,n),r})(e,t,o,n),s=Je(e,o)&&t===n;return r.collapsed&&!s})(t,e.anchorOffset,o,e.focusOffset)?C.some(Dn(t,e.anchorOffset,o,e.focusOffset)):jn(e)}},In=(e,t,o=!0)=>{const n=(o?je:We)(e,t);zn(e,n)},Fn=e=>(e=>_n(e).filter((e=>e.rangeCount>0)).bind(Pn))(e).map((e=>Nn.exact(e.start,e.soffset,e.finish,e.foffset))),Hn=(e,t,o)=>((e,t,o)=>((e,t,o)=>e.caretPositionFromPoint?((e,t,o)=>C.from(e.caretPositionFromPoint?.(t,o)).bind((t=>{if(null===t.offsetNode)return C.none();const o=e.createRange();return o.setStart(t.offsetNode,t.offset),o.collapse(),C.some(o)})))(e,t,o):e.caretRangeFromPoint?((e,t,o)=>C.from(e.caretRangeFromPoint?.(t,o)))(e,t,o):C.none())(e.document,t,o).map((e=>Dn(Me.fromDom(e.startContainer),e.startOffset,Me.fromDom(e.endContainer),e.endOffset))))(e,t,o),$n={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},Vn=(()=>{const e="[0-9]+",t="[eE][+-]?"+e,o=e=>`(?:${e})?`,n=["Infinity",e+"\\."+o(e)+o(t),"\\."+e+o(t),e+o(t)].join("|");return new RegExp(`^([+-]?(?:${n}))(.*)$`)})(),qn=e=>E(e,g(0)),Un=(e,t,o,n,r)=>r(e.slice(0,t)).concat(n).concat(r(e.slice(o))),Gn=e=>(t,o,n,r)=>{if(e(n)){const e=Math.max(r,t[o]-Math.abs(n)),s=Math.abs(e-t[o]);return n>=0?s:-s}return n},Kn=Gn((e=>e<0)),Yn=Gn(x),Jn=()=>{const e=(e,t,o,n)=>{const r=(100+o)/100,s=Math.max(n,(e[t]+o)/r);return E(e,((e,o)=>(o===t?s:e/r)-e))},t=(t,o,n,r,s,l)=>l?e(t,o,r,s):((e,t,o,n,r)=>{const s=Kn(e,t,n,r);return Un(e,t,o+1,[s,0],qn)})(t,o,n,r,s);return{resizeTable:(e,t)=>e(t),clampTableDelta:Kn,calcLeftEdgeDeltas:t,calcMiddleDeltas:(e,o,n,r,s,l,a)=>t(e,n,r,s,l,a),calcRightEdgeDeltas:(t,o,n,r,s,l)=>{if(l)return e(t,n,r,s);{const e=Kn(t,n,r,s);return qn(t.slice(0,n)).concat([e])}},calcRedestributedWidths:(e,t,o,n)=>{if(n){const n=(t+o)/t,r=E(e,(e=>e/n));return{delta:100*n-100,newSizes:r}}return{delta:o,newSizes:e}}}},Qn=()=>{const e=(e,t,o,n,r)=>{const s=Yn(e,n>=0?o:t,n,r);return Un(e,t,o+1,[s,-s],qn)};return{resizeTable:(e,t,o)=>{o&&e(t)},clampTableDelta:(e,t,o,n,r)=>{if(r){if(o>=0)return o;{const t=A(e,((e,t)=>e+t-n),0);return Math.max(-t,o)}}return Kn(e,t,o,n)},calcLeftEdgeDeltas:e,calcMiddleDeltas:(t,o,n,r,s,l)=>e(t,n,r,s,l),calcRightEdgeDeltas:(e,t,o,n,r,s)=>{if(s)return qn(e);{const t=n/e.length;return E(e,g(t))}},calcRedestributedWidths:(e,t,o,n)=>({delta:0,newSizes:e})}},Xn=(e,t,o=0)=>po(e,t).map((e=>parseInt(e,10))).getOr(o),Zn=(e,t)=>Xn(e,t,1),er=e=>It("col")(e)?Xn(e,"span",1)>1:Zn(e,"colspan")>1,tr=(e,t)=>parseInt(Bo(e,t),10),or=g(10),nr=g(10),rr=(e,t)=>sr(e,t,x),sr=(e,t,o)=>j(Kt(e),(e=>Ge(e,t)?o(e)?[e]:[]:sr(e,t,o))),lr=(e,t)=>((e,t,o=y)=>o(t)?C.none():D(e,Bt(t))?C.some(t):rn(t,e.join(","),(e=>Ge(e,"table")||o(e))))(["td","th"],e,t),ar=e=>rr(e,"th,td"),cr=e=>Ge(e,"colgroup")?wn(e,"col"):j(dr(e),(e=>wn(e,"col"))),ir=(e,t)=>an(e,"table",t),mr=e=>rr(e,"tr"),dr=e=>ir(e).fold(g([]),(e=>wn(e,"colgroup"))),ur=It("th"),fr=e=>P(e,(e=>ur(e.element))),gr=(e,t)=>e&&t?"sectionCells":e?"section":"cells",hr=e=>{const t="thead"===e.section,o=ie(pr(e.cells),"th");return"tfoot"===e.section?{type:"footer"}:t||o?{type:"header",subType:gr(t,o)}:{type:"body"}},pr=e=>{const t=_(e,(e=>ur(e.element)));return 0===t.length?C.some("td"):t.length===e.length?C.some("th"):C.none()},br=(e,t)=>E(e,(e=>{if("colgroup"===Bt(e)){const t=E(cr(e),(e=>{const t=Xn(e,"span",1);return Ce(e,1,t)}));return Se(e,t,"colgroup")}{const o=E(ar(e),(e=>{const t=Xn(e,"rowspan",1),o=Xn(e,"colspan",1);return Ce(e,t,o)}));return Se(e,o,t(e))}})),wr=e=>$t(e).map((e=>{const t=Bt(e);return(e=>D(xe,e))(t)?t:"tbody"})).getOr("tbody"),vr=e=>{const t=mr(e),o=[...dr(e),...t];return br(o,wr)},yr="data-snooker-locked-cols",xr=e=>po(e,yr).bind((e=>C.from(e.match(/\d+/g)))).map((e=>I(e,x))),Cr=e=>{const t=A(ze(e).rows,((e,t)=>(N(t.cells,((t,o)=>{t.isLocked&&(e[o]=!0)})),e)),{}),o=J(t,((e,t)=>parseInt(t,10)));return(e=>{const t=S.call(e,0);return t.sort(void 0),t})(o)},Sr=(e,t)=>e+","+t,Tr=(e,t)=>{const o=j(e.all,(e=>e.cells));return _(o,t)},Rr=e=>{const t={},o=[],n=H(e).map((e=>e.element)).bind(ir).bind(xr).getOr({});let r=0,s=0,l=0;const{pass:a,fail:c}=B(e,(e=>"colgroup"===e.section));N(c,(e=>{const a=[];N(e.cells,(e=>{let o=0;for(;void 0!==t[Sr(l,o)];)o++;const r=((e,t)=>X(e,t)&&void 0!==e[t]&&null!==e[t])(n,o.toString()),c=((e,t,o,n,r,s)=>({element:e,rowspan:t,colspan:o,row:n,column:r,isLocked:s}))(e.element,e.rowspan,e.colspan,l,o,r);for(let n=0;n{const t=(e=>{const t={};let o=0;return N(e.cells,(e=>{const n=e.colspan;k(n,(r=>{const s=o+r;t[s]=((e,t,o)=>({element:e,colspan:t,column:o}))(e.element,n,s)})),o+=n})),t})(e),o=((e,t)=>({element:e,columns:t}))(e.element,Q(t));return{colgroups:[o],columns:t}})).getOrThunk((()=>({colgroups:[],columns:{}}))),d=((e,t)=>({rows:e,columns:t}))(r,s);return{grid:d,access:t,all:o,columns:i,colgroups:m}},Dr=e=>{const t=vr(e);return Rr(t)},Or=Rr,kr=(e,t,o)=>C.from(e.access[Sr(t,o)]),Er=(e,t,o)=>{const n=Tr(e,(e=>o(t,e.element)));return n.length>0?C.some(n[0]):C.none()},Nr=Tr,Br=e=>j(e.all,(e=>e.cells)),_r=e=>Q(e.columns),zr=e=>q(e.columns).length>0,Ar=(e,t)=>C.from(e.columns[t]),Lr=(e,t,o)=>Te(o(e.element,t),!0,e.isLocked),Mr=(e,t)=>e.section!==t?Re(e.element,e.cells,t,e.isNew):e,Wr=()=>({transformRow:Mr,transformCell:(e,t,o)=>{const n=o(e.element,t),r="td"!==Bt(n)?(e=>{const t=Ro(e,"td");so(e,t);const o=Kt(e);return mo(t,o),yo(e),t})(n):n;return Te(r,e.isNew,e.isLocked)}}),jr=()=>({transformRow:Mr,transformCell:Lr}),Pr=()=>({transformRow:(e,t)=>Mr(e,"thead"===t?"tbody":t),transformCell:Lr}),Ir=Wr,Fr=jr,Hr=Pr,$r=()=>({transformRow:h,transformCell:Lr}),Vr=(e,t=x)=>{const o=e.grid,n=k(o.columns,h),r=k(o.rows,h);return E(n,(o=>qr((()=>j(r,(t=>kr(e,t,o).filter((e=>e.column===o)).toArray()))),(e=>1===e.colspan&&t(e.element)),(()=>kr(e,0,o)))))},qr=(e,t,o)=>{const n=e();return L(n,t).orThunk((()=>C.from(n[0]).orThunk(o))).map((e=>e.element))},Ur=e=>{const t=e.grid,o=k(t.rows,h),n=k(t.columns,h);return E(o,(t=>qr((()=>j(n,(o=>kr(e,t,o).filter((e=>e.row===t)).fold(g([]),(e=>[e]))))),(e=>1===e.rowspan),(()=>kr(e,t,0)))))},Gr=(e,t)=>({row:e,y:t}),Kr=(e,t)=>({col:e,x:t}),Yr=e=>Go(e).left+Ho(e),Jr=e=>Go(e).left,Qr=(e,t)=>Kr(e,Jr(t)),Xr=(e,t)=>Kr(e,Yr(t)),Zr=e=>Go(e).top,es=(e,t)=>Gr(e,Zr(t)),ts=(e,t)=>Gr(e,Zr(t)+Po(t)),os=(e,t,o)=>{if(0===o.length)return[];const n=E(o.slice(1),((t,o)=>t.map((t=>e(o,t))))),r=o[o.length-1].map((e=>t(o.length-1,e)));return n.concat([r])},ns={delta:h,positions:e=>os(es,ts,e),edge:Zr},rs=Zo({delta:h,edge:Jr,positions:e=>os(Qr,Xr,e)},{delta:e=>-e,edge:Yr,positions:e=>os(Xr,Qr,e)}),ss={delta:(e,t)=>rs(t).delta(e,t),positions:(e,t)=>rs(t).positions(e,t),edge:e=>rs(e).edge(e)},ls=/(\d+(\.\d+)?)%/,as=/(\d+(\.\d+)?)px|em/,cs=It("col"),is=It("tr"),ms=(e,t,o)=>{const n=Vt(e).getOrThunk((()=>(e=>{const t=e.dom.body;if(null==t)throw new Error("Body is not available yet");return Me.fromDom(t)})(Ft(e))));return t(e)/o(n)*100},ds=(e,t)=>{Eo(e,"width",t+"px")},us=(e,t)=>{Eo(e,"width",t+"%")},fs=(e,t)=>{Eo(e,"height",t+"px")},gs=e=>{const t=(e=>{return Mo(t=e,"height",t.dom.offsetHeight)+"px";var t})(e);return t?((e,t,o,n)=>{const r=parseFloat(e);return be(e,"%")&&"table"!==Bt(t)?((e,t,o,n)=>{const r=ir(e).map((e=>{const n=o(e);return Math.floor(t/100*n)})).getOr(t);return n(e,r),r})(t,r,o,n):r})(t,e,jo,fs):jo(e)},hs=(e,t)=>zo(e,t).orThunk((()=>po(e,t).map((e=>e+"px")))),ps=e=>hs(e,"width"),bs=e=>ms(e,Fo,$o),ws=e=>{return cs(e)?Math.round(Fo(e)):Mo(t=e,"width",t.dom.offsetWidth);var t},vs=e=>is(e)?jo(e):((e,t,o)=>o(e)/Zn(e,"rowspan"))(e,0,gs),ys=(e,t,o)=>{Eo(e,"width",t+o)},xs=e=>ms(e,Fo,$o)+"%",Cs=g(ls),Ss=It("col"),Ts=e=>ps(e).getOrThunk((()=>ws(e)+"px")),Rs=e=>{return(t=e,hs(t,"height")).getOrThunk((()=>vs(e)+"px"));var t},Ds=(e,t,o,n,r,s)=>e.filter(n).fold((()=>s(((e,t)=>{if(t<0||t>=e.length-1)return C.none();const o=e[t].fold((()=>{const o=(e=>{const t=S.call(e,0);return t.reverse(),t})(e.slice(0,t));return V(o,((e,t)=>e.map((e=>({value:e,delta:t+1})))))}),(e=>C.some({value:e,delta:0}))),n=e[t+1].fold((()=>{const o=e.slice(t+1);return V(o,((e,t)=>e.map((e=>({value:e,delta:t+1})))))}),(e=>C.some({value:e,delta:1})));return o.bind((e=>n.map((t=>{const o=t.delta+e.delta;return Math.abs(t.value-e.value)/o}))))})(o,t))),(e=>r(e))),Os=(e,t,o,n)=>{const r=Vr(e),s=zr(e)?(e=>E(_r(e),(e=>C.from(e.element))))(e):r,l=[C.some(ss.edge(t))].concat(E(ss.positions(r,t),(e=>e.map((e=>e.x))))),a=w(er);return E(s,((e,t)=>Ds(e,t,l,a,(e=>{if((e=>{const t=kt().browser,o=t.isChromium()||t.isFirefox();return!Ss(e)||o})(e))return o(e);{const e=null!=(s=r[t])?h(s):C.none();return Ds(e,t,l,a,(e=>n(C.some(Math.round(Fo(e))))),n)}var s}),n)))},ks=e=>e.map((e=>e+"px")).getOr(""),Es=(e,t,o)=>Os(e,t,ws,(e=>e.getOrThunk(o.minCellWidth))),Ns=(e,t,o,n)=>{const r=Ur(e),s=E(e.all,(e=>C.some(e.element))),l=[C.some(ns.edge(t))].concat(E(ns.positions(r,t),(e=>e.map((e=>e.y)))));return E(s,((e,t)=>Ds(e,t,l,x,o,n)))},Bs=(e,t)=>()=>Oo(e)?t(e):parseFloat(zo(e,"width").getOr("0")),_s=e=>{const t=Bs(e,(e=>parseFloat(xs(e)))),o=Bs(e,Fo);return{width:t,pixelWidth:o,getWidths:(t,o)=>((e,t,o)=>Os(e,t,bs,(e=>e.fold((()=>o.minCellWidth()),(e=>e/o.pixelWidth()*100)))))(t,e,o),getCellDelta:e=>e/o()*100,singleColumnWidth:(e,t)=>[100-e],minCellWidth:()=>or()/o()*100,setElementWidth:us,adjustTableWidth:o=>{const n=t();us(e,n+o/100*n)},isRelative:!0,label:"percent"}},zs=e=>{const t=Bs(e,Fo);return{width:t,pixelWidth:t,getWidths:(t,o)=>Es(t,e,o),getCellDelta:h,singleColumnWidth:(e,t)=>[Math.max(or(),e+t)-e],minCellWidth:or,setElementWidth:ds,adjustTableWidth:o=>{const n=t()+o;ds(e,n)},isRelative:!1,label:"pixel"}},As=e=>ps(e).fold((()=>(e=>{const t=Bs(e,Fo),o=g(0);return{width:t,pixelWidth:t,getWidths:(t,o)=>Es(t,e,o),getCellDelta:o,singleColumnWidth:g([0]),minCellWidth:o,setElementWidth:f,adjustTableWidth:f,isRelative:!0,label:"none"}})(e)),(t=>((e,t)=>null!==Cs().exec(t)?_s(e):zs(e))(e,t))),Ls=zs,Ms=_s,Ws=(e,t,o,n)=>{o===n?bo(e,t):fo(e,t,o)},js=(e,t,o)=>{$(wn(e,t)).fold((()=>lo(e,o)),(e=>so(e,o)))},Ps=(e,t)=>{const o=[],n=[],r=e=>E(e,(e=>{e.isNew&&o.push(e.element);const t=e.element;return vo(t),N(e.cells,(e=>{e.isNew&&n.push(e.element),Ws(e.element,"colspan",e.colspan,1),Ws(e.element,"rowspan",e.rowspan,1),ao(t,e.element)})),t})),s=e=>j(e,(e=>E(e.cells,(e=>(Ws(e.element,"span",e.colspan,1),e.element))))),l=(t,o)=>{const n=((e,t)=>{const o=sn(e,t).getOrThunk((()=>{const o=Me.fromTag(t,Ft(e).dom);return"thead"===t?js(e,"caption,colgroup",o):"colgroup"===t?js(e,"caption",o):ao(e,o),o}));return vo(o),o})(e,o),l=("colgroup"===o?s:r)(t);mo(n,l)},a=(t,o)=>{t.length>0?l(t,o):(t=>{sn(e,t).each(yo)})(o)},c=[],i=[],m=[],d=[];return N(t,(e=>{switch(e.section){case"thead":c.push(e);break;case"tbody":i.push(e);break;case"tfoot":m.push(e);break;case"colgroup":d.push(e)}})),a(d,"colgroup"),a(c,"thead"),a(i,"tbody"),a(m,"tfoot"),{newRows:o,newCells:n}},Is=(e,t)=>{if(0===e.length)return 0;const o=e[0];return M(e,(e=>!t(o.element,e.element))).getOr(e.length)},Fs=(e,t)=>{const o=E(e,(e=>E(e.cells,y)));return E(e,((n,r)=>{const s=j(n.cells,((n,s)=>{if(!1===o[r][s]){const m=((e,t,o,n)=>{const r=((e,t)=>e[t])(e,t),s="colgroup"===r.section,l=Is(r.cells.slice(o),n),a=s?1:Is(((e,t)=>E(e,(e=>Ne(e,t))))(e.slice(t),o),n);return{colspan:l,rowspan:a}})(e,r,s,t);return((e,t,n,r)=>{for(let s=e;s({element:e,cells:t,section:o,isNew:n}))(n.element,s,n.section,n.isNew)}))},Hs=(e,t,o)=>{const n=[];N(e.colgroups,(r=>{const s=[];for(let n=0;nTe(e.element,o,!1))).getOrThunk((()=>Te(t.colGap(),!0,!1)));s.push(r)}n.push(Re(r.element,s,"colgroup",o))}));for(let r=0;rTe(e.element,o,e.isLocked))).getOrThunk((()=>Te(t.gap(),!0,!1)));s.push(l)}const l=e.all[r],a=Re(l.element,s,l.section,o);n.push(a)}return n},$s=e=>Fs(e,Je),Vs=(e,t)=>V(e.all,(e=>L(e.cells,(e=>Je(t,e.element))))),qs=(e,t,o)=>{const n=E(t.selection,(t=>lr(t).bind((t=>Vs(e,t))).filter(o))),r=me(n);return de(r.length>0,r)},Us=(e,t,o,n,r,s,l,a,c)=>{const i=Dr(s),m=C.from(c?.section).getOrThunk($r);return t(i,l).map((t=>{const o=((e,t)=>Hs(e,t,!1))(i,a),n=e(o,t,Je,r(a),m),s=Cr(n.grid);return{info:t,grid:$s(n.grid),cursor:n.cursor,lockedColumns:s}})).bind((e=>{const t=Ps(s,e.grid),r=C.from(c?.sizing).getOrThunk((()=>As(s))),l=C.from(c?.resize).getOrThunk(Qn);return o(s,e.grid,e.info,{sizing:r,resize:l,section:m}),n(s),bo(s,yr),e.lockedColumns.length>0&&fo(s,yr,e.lockedColumns.join(",")),C.some({cursor:e.cursor,newRows:t.newRows,newCells:t.newCells})}))},Gs=(e,t)=>lr(t.element).bind((o=>Vs(e,o).map((e=>({...e,generators:t.generators,clipboard:t.clipboard}))))),Ks=(e,t)=>qs(e,t,x).map((e=>({cells:e,generators:t.generators,clipboard:t.clipboard}))),Ys=(e,t)=>qs(e,t,x),Js=(e,t)=>qs(e,t,(e=>!e.isLocked)),Qs=(e,t)=>P(t,(t=>((e,t)=>Vs(e,t).exists((e=>!e.isLocked)))(e,t))),Xs=(e,t)=>((e,t)=>t.mergable)(0,t).filter((t=>Qs(e,t.cells))),Zs=(e,t)=>((e,t)=>t.unmergable)(0,t).filter((t=>Qs(e,t))),el={...Z([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])},tl=(e,t,o)=>{const n=((e,t)=>zr(e)?((e,t)=>{const o=_r(e);return E(o,((e,o)=>({element:e.element,width:t[o],colspan:e.colspan})))})(e,t):((e,t)=>{const o=Br(e);return E(o,(e=>{const o=((e,t,o)=>{let n=0;for(let r=e;r{o.setElementWidth(e.element,e.width)}))},ol=(e,t,o,n,r)=>{const s=Dr(e),l=r.getCellDelta(t),a=r.getWidths(s,r),c=o===s.grid.columns-1,i=n.clampTableDelta(a,o,l,r.minCellWidth(),c),m=((e,t,o,n,r)=>{const s=e.slice(0),l=((e,t)=>0===e.length?el.none():1===e.length?el.only(0):0===t?el.left(0,1):t===e.length-1?el.right(t-1,t):t>0&&tn.singleColumnWidth(s[e],o)),((e,t)=>r.calcLeftEdgeDeltas(s,e,t,o,n.minCellWidth(),n.isRelative)),((e,t,l)=>r.calcMiddleDeltas(s,e,t,l,o,n.minCellWidth(),n.isRelative)),((e,t)=>r.calcRightEdgeDeltas(s,e,t,o,n.minCellWidth(),n.isRelative)))})(a,o,i,r,n),d=E(m,((e,t)=>e+a[t]));tl(s,d,r),n.resizeTable(r.adjustTableWidth,i,c)},nl=(e,t,o)=>{const n=Dr(e),r=((e,t)=>Ns(e,t,vs,(e=>e.getOrThunk(nr))))(n,e),s=E(r,((e,n)=>o===n?Math.max(t+e,nr()):e)),l=((e,t)=>E(e.all,((e,o)=>({element:e.element,height:t[o]}))))(n,s);N(l,(e=>{fs(e.element,e.height)})),N(Br(n),(e=>{(e=>{Ao(e,"height")})(e.element)}));const a=z(s,((e,t)=>e+t),0);fs(e,a)},rl=(e,t)=>{if(!er(e)){const o=(e=>ps(e).bind((e=>{return t=e,o=["fixed","relative","empty"],C.from(Vn.exec(t)).bind((e=>{const t=Number(e[1]),n=e[2];return((e,t)=>O(t,(t=>O($n[t],(t=>e===t)))))(n,o)?C.some({value:t,unit:n}):C.none()}));var t,o})))(e);o.each((o=>{const n=o.value/2;ys(e,n,o.unit),ys(t,n,o.unit)}))}},sl=(e,t,o)=>{const n=Xn(e,t,1);1===o||n<=1?bo(e,t):fo(e,t,Math.min(o,n))},ll=(e,t)=>o=>{const n=o.column+o.colspan-1,r=o.column;return n>=e&&r{const n=e[o].element,r=Me.fromTag("td");ao(r,Me.fromTag("br")),(t?ao:lo)(n,r)},cl=It("col"),il=It("colgroup"),ml=e=>"tr"===Bt(e)||il(e),dl=e=>({element:e,colspan:Xn(e,"colspan",1),rowspan:Xn(e,"rowspan",1)}),ul=e=>po(e,"scope").map((e=>e.substr(0,3))),fl=(e,t=dl)=>{const o=o=>{if(ml(o))return il((r={element:o}).element)?e.colgroup(r):e.row(r);{const r=o,s=(t=>cl(t.element)?e.col(t):e.cell(t))(t(r));return n=C.some({item:r,replacement:s}),s}var r};let n=C.none();return{getOrInit:(e,t)=>n.fold((()=>o(e)),(n=>t(e,n.item)?n.replacement:o(e)))}},gl=e=>t=>{const o=[],n=n=>{const r="td"===e?{scope:null}:{},s=t.replace(n,e,r);return o.push({item:n,sub:s}),s};return{replaceOrInit:(e,t)=>{if(ml(e)||cl(e))return e;{const r=e;return((e,t)=>L(o,(o=>t(o.item,e))))(r,t).fold((()=>n(r)),(o=>t(e,o.item)?o.sub:n(r)))}}}},hl=e=>({unmerge:t=>{const o=ul(t);return o.each((e=>fo(t,"scope",e))),()=>{const n=e.cell({element:t,colspan:1,rowspan:1});return Ao(n,"width"),Ao(t,"width"),o.each((e=>fo(n,"scope",e))),n}},merge:e=>(Ao(e[0],"width"),(()=>{const t=me(E(e,ul));if(0===t.length)return C.none();{const e=t[0],o=["row","col"];return O(t,(t=>t!==e&&D(o,t)))?C.none():C.from(e)}})().fold((()=>bo(e[0],"scope")),(t=>fo(e[0],"scope",t+"group"))),g(e[0]))}),pl=Z([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),bl=(e,t,o)=>{const n=o.substring(0,o.length-e.length),r=parseFloat(n);return n===r.toString()?t(r):pl.invalid(o)},wl={...pl,from:e=>be(e,"%")?bl("%",pl.percent,e):be(e,"px")?bl("px",pl.pixels,e):pl.invalid(e)},vl=(e,t,o)=>{const n=wl.from(o),r=P(e,(e=>"0px"===e))?((e,t)=>{const o=e.fold((()=>g("")),(e=>g(e/t+"px")),(()=>g(100/t+"%")));return k(t,o)})(n,e.length):((e,t,o)=>e.fold((()=>t),(e=>((e,t,o)=>{const n=o/t;return E(e,(e=>wl.from(e).fold((()=>e),(e=>e*n+"px"),(e=>e/100*o+"px"))))})(t,o,e)),(e=>((e,t)=>E(e,(e=>wl.from(e).fold((()=>e),(e=>e/t*100+"%"),(e=>e+"%")))))(t,o))))(n,e,t);return Cl(r)},yl=(e,t)=>0===e.length?t:z(e,((e,t)=>wl.from(t).fold(g(0),h,h)+e),0),xl=(e,t)=>wl.from(e).fold(g(e),(e=>e+t+"px"),(e=>e+t+"%")),Cl=e=>{if(0===e.length)return e;const t=z(e,((e,t)=>{const o=wl.from(t).fold((()=>({value:t,remainder:0})),(e=>(e=>{const t=Math.floor(e);return{value:t+"px",remainder:e-t}})(e)),(e=>({value:e+"%",remainder:0})));return{output:[o.value].concat(e.output),remainder:e.remainder+o.remainder}}),{output:[],remainder:0}),o=t.output;return o.slice(0,o.length-1).concat([xl(o[o.length-1],Math.round(t.remainder))])},Sl=wl.from,Tl=(e,t,o)=>{const n=Dr(e),r=n.all,s=Br(n),l=_r(n);t.each((t=>{const o=Sl(t).fold(g("px"),g("px"),g("%")),r=Fo(e),a=((e,t)=>Os(e,t,Ts,ks))(n,e),c=vl(a,r,t);zr(n)?((e,t,o)=>{N(t,((t,n)=>{const r=yl([e[n]],or());Eo(t.element,"width",r+o)}))})(c,l,o):((e,t,o)=>{N(t,(t=>{const n=e.slice(t.column,t.colspan+t.column),r=yl(n,or());Eo(t.element,"width",r+o)}))})(c,s,o),Eo(e,"width",t)})),o.each((t=>{const o=jo(e),l=((e,t)=>Ns(e,t,Rs,ks))(n,e);((e,t,o)=>{N(o,(e=>{Ao(e.element,"height")})),N(t,((t,o)=>{Eo(t.element,"height",e[o])}))})(vl(l,o,t),r,s),Eo(e,"height",t)}))},Rl=e=>ps(e).exists((e=>ls.test(e))),Dl=e=>ps(e).exists((e=>as.test(e))),Ol=e=>ps(e).isNone();var kl=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],El=()=>({up:g({selector:rn,closest:an,predicate:on,all:qt}),down:g({selector:vn,predicate:pn}),styles:g({get:Bo,getRaw:zo,set:Eo,remove:Ao}),attrs:g({get:ho,set:fo,remove:bo,copyTo:(e,t)=>{const o=wo(e);go(t,o)}}),insert:g({before:ro,after:so,afterAll:io,append:ao,appendAll:mo,prepend:lo,wrap:co}),remove:g({unwrap:xo,remove:yo}),create:g({nu:Me.fromTag,clone:e=>Me.fromDom(e.dom.cloneNode(!1)),text:Me.fromText}),query:g({comparePosition:(e,t)=>e.dom.compareDocumentPosition(t.dom),prevSibling:Ut,nextSibling:Gt}),property:g({children:Kt,name:Bt,parent:$t,document:e=>Ht(e).dom,isText:Wt,isComment:At,isElement:Mt,isSpecial:e=>{const t=Bt(e);return D(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],t)},getLanguage:e=>Mt(e)?po(e,"lang"):C.none(),getText:Jo,setText:Xo,isBoundary:e=>!!Mt(e)&&("body"===Bt(e)||D(kl,Bt(e))),isEmptyTag:e=>!!Mt(e)&&D(["br","img","hr","input"],Bt(e)),isNonEditable:e=>Mt(e)&&"false"===ho(e,"contenteditable")}),eq:Je,is:Xe});const Nl=(e,t)=>({item:e,mode:t}),Bl=(e,t,o,n=_l)=>e.property().parent(t).map((e=>Nl(e,n))),_l=(e,t,o,n=zl)=>o.sibling(e,t).map((e=>Nl(e,n))),zl=(e,t,o,n=zl)=>{const r=e.property().children(t);return o.first(r).map((e=>Nl(e,n)))},Al=[{current:Bl,next:_l,fallback:C.none()},{current:_l,next:zl,fallback:C.some(Bl)},{current:zl,next:zl,fallback:C.some(_l)}],Ll=(e,t,o,n,r=Al)=>L(r,(e=>e.current===o)).bind((o=>o.current(e,t,n,o.next).orThunk((()=>o.fallback.bind((o=>Ll(e,t,o,n))))))),Ml=(e,t,o,n,r,s)=>Ll(e,t,n,r).bind((t=>s(t.item)?C.none():o(t.item)?C.some(t.item):Ml(e,t.item,o,t.mode,r,s))),Wl=(e,t)=>({element:e,offset:t}),jl=(e,t,o)=>e.property().isText(t)&&0===e.property().getText(t).trim().length||e.property().isComment(t)?o(t).bind((t=>jl(e,t,o).orThunk((()=>C.some(t))))):C.none(),Pl=(e,t)=>e.property().isText(t)?e.property().getText(t).length:e.property().children(t).length,Il=(e,t)=>{const o=jl(e,t,e.query().prevSibling).getOr(t);if(e.property().isText(o))return Wl(o,Pl(e,o));const n=e.property().children(o);return n.length>0?Il(e,n[n.length-1]):Wl(o,Pl(e,o))},Fl=Il,Hl=El(),$l=e=>t=>0===e.property().children(t).length,Vl=(e,t,o,n)=>Ml(e,t,o,_l,{sibling:(e,t)=>e.query().prevSibling(t),first:e=>e.length>0?C.some(e[e.length-1]):C.none()},n),ql=(e,t,o,n)=>Ml(e,t,o,_l,{sibling:(e,t)=>e.query().nextSibling(t),first:e=>e.length>0?C.some(e[0]):C.none()},n),Ul=El(),Gl=(e,t)=>((e,t,o)=>Vl(e,t,$l(e),o))(Ul,e,t),Kl=(e,t)=>((e,t,o)=>ql(e,t,$l(e),o))(Ul,e,t),Yl=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],Jl=(e,t,o,n)=>{const r=t(e,o);return z(n,((o,n)=>{const r=t(e,n);return Ql(e,o,r)}),r)},Ql=(e,t,o)=>t.bind((t=>o.filter(b(e.eq,t)))),Xl=El(),Zl=(e,t)=>((e,t,o)=>o.length>0?((e,t,o,n)=>n(e,t,o[0],o.slice(1)))(e,t,o,Jl):C.none())(Xl,((t,o)=>e(o)),t),ea=El(),ta=e=>((e,t)=>{const o=e.property().name(t);return D(Yl,o)})(ea,e),oa=e=>((e,t)=>{const o=e.property().name(t);return D(["ol","ul"],o)})(ea,e),na=e=>{const t=It("br"),o=e=>Tn(e).bind((o=>{const n=Gt(o).map((e=>!!ta(e)||!!((e,t)=>D(["br","img","hr","input"],e.property().name(t)))(ea,e)&&"img"!==Bt(e))).getOr(!1);return $t(o).map((r=>{return!0===n||("li"===Bt(s=r)||on(s,oa).isSome())||t(o)||ta(r)&&!Je(e,r)?[]:[Me.fromTag("br")];var s}))})).getOr([]),n=(()=>{const n=j(e,(e=>{const n=Kt(e);return(e=>P(e,(e=>t(e)||Wt(e)&&0===Jo(e).trim().length)))(n)?[]:n.concat(o(e))}));return 0===n.length?[Me.fromTag("br")]:n})();vo(e[0]),mo(e[0],n)},ra=e=>{bo(e,"width"),bo(e,"height")},sa=e=>{const t=xs(e);Tl(e,C.some(t),C.none()),ra(e)},la=e=>{const t=(e=>Fo(e)+"px")(e);Tl(e,C.some(t),C.none()),ra(e)},aa=e=>{Ao(e,"width");const t=cr(e),o=t.length>0?t:ar(e);N(o,(e=>{Ao(e,"width"),ra(e)})),ra(e)},ca={scope:["row","col"]},ia=e=>()=>{const t=Me.fromTag("td",e.dom);return ao(t,Me.fromTag("br",e.dom)),t},ma=e=>()=>Me.fromTag("col",e.dom),da=e=>()=>Me.fromTag("colgroup",e.dom),ua=e=>()=>Me.fromTag("tr",e.dom),fa=(e,t,o)=>{const n=((e,t)=>{const o=Ro(e,t),n=Kt(To(e));return mo(o,n),o})(e,t);return G(o,((e,t)=>{null===e?bo(n,t):fo(n,t,e)})),n},ga=e=>e,ha=(e,t,o)=>{const n=(e,t)=>{((e,t)=>{const o=e.dom,n=t.dom;Do(o)&&Do(n)&&(n.style.cssText=o.style.cssText)})(e.element,t),Ao(t,"height"),1!==e.colspan&&Ao(t,"width")};return{col:o=>{const r=Me.fromTag(Bt(o.element),t.dom);return n(o,r),e(o.element,r),r},colgroup:da(t),row:ua(t),cell:r=>{const s=Me.fromTag(Bt(r.element),t.dom),l=o.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),a=l.length>0?((e,t,o)=>Sn(e).map((n=>{const r=o.join(","),s=bn(n,r,(t=>Je(t,e)));return z(s,((e,t)=>{const o=So(t);return ao(e,o),o}),t)})).getOr(t))(r.element,s,l):s;return ao(a,Me.fromTag("br")),n(r,s),((e,t)=>{G(ca,((o,n)=>po(e,n).filter((e=>D(o,e))).each((e=>fo(t,n,e)))))})(r.element,s),e(r.element,s),s},replace:fa,colGap:ma(t),gap:ia(t)}},pa=e=>({col:ma(e),colgroup:da(e),row:ua(e),cell:ia(e),replace:ga,colGap:ma(e),gap:ia(e)}),ba=e=>Dr(e).grid,wa=(e,t,o,n)=>{const r=ze(e).rows;let s=!0;for(let e=0;e({rowDelta:0,colDelta:_e(e[0])-_e(t[0])}),ya=(e,t)=>({rowDelta:e.length-t.length,colDelta:0}),xa=(e,t,o,n)=>{const r="colgroup"===t.section?o.col:o.cell;return k(e,(e=>Te(r(),!0,n(e))))},Ca=(e,t,o,n)=>{const r=e[e.length-1];return e.concat(k(t,(()=>{const e="colgroup"===r.section?o.colgroup:o.row,t=Ae(r,e,h),s=xa(t.cells.length,t,o,(e=>X(n,e.toString())));return Ee(t,s)})))},Sa=(e,t,o,n)=>E(e,(e=>{const r=xa(t,e,o,y);return De(e,n,r)})),Ta=(e,t,o)=>{const n=t.colDelta<0?Sa:h,r=t.rowDelta<0?Ca:h,s=Cr(e),l=_e(e[0]),a=O(s,(e=>e===l-1)),c=n(e,Math.abs(t.colDelta),o,a?l-1:l),i=Cr(c);return r(c,Math.abs(t.rowDelta),o,I(i,x))},Ra=(e,t,o,n)=>{const r=b(n,Ne(e[t],o).element),s=e[t];return e.length>1&&_e(s)>1&&(o>0&&r(Be(s,o-1))||o0&&r(Be(e[t-1],o))||t_(o,(o=>o>=e.column&&o<=_e(t[0])+e.column)),Oa=(e,t,o,n,r)=>{((e,t,o,n)=>{t>0&&t{const r=e.cells[t-1];let s=0;const l=n();for(;e.cells.length>t+s&&o(r.element,e.cells[t+s].element);)ke(e,t+s,Te(l,!0,e.cells[t+s].isLocked)),s++}))})(t,e,r,n.cell);const s=ya(o,t),l=Ta(o,s,n),a=ya(t,l),c=Ta(t,a,n);return E(c,((t,o)=>De(t,e,l[o].cells)))},ka=(e,t,o,n,r)=>{((e,t,o,n)=>{const r=ze(e).rows;if(t>0&&tA(e,((e,o)=>O(e,(e=>t(e.element,o.element)))?e:e.concat([o])),[]))(r[t-1].cells,o);N(e,(e=>{let s=C.none();for(let l=t;l{ke(a,t,Te(e,!0,c.isLocked))})))}}))}})(t,e,r,n.cell);const s=Cr(t),l=va(t,o),a={...l,colDelta:l.colDelta-s.length},c=Ta(t,a,n),{cols:i,rows:m}=ze(c),d=Cr(c),u=va(o,t),f={...u,colDelta:u.colDelta+d.length},g=(p=n,b=d,E(o,(e=>A(b,((t,o)=>{const n=xa(1,e,p,x)[0];return Oe(t,o,n)}),e)))),h=Ta(g,f,n);var p,b;return[...i,...m.slice(0,e),...h,...m.slice(e,m.length)]},Ea=(e,t,o,n,r)=>{const{rows:s,cols:l}=ze(e),a=s.slice(0,t),c=s.slice(t);return[...l,...a,((e,t,o,n)=>Ae(e,(e=>n(e,o)),t))(s[o],((e,o)=>t>0&&tE(e,(e=>{const s=t>0&&t<_e(e)&&n(Be(e,t-1),Be(e,t)),l=((e,t,o,n,r,s,l)=>{if("colgroup"!==o&&n)return Ne(e,t);{const t=Ne(e,r);return Te(l(t.element,s),!0,!1)}})(e,t,e.section,s,o,n,r);return Oe(e,t,l)})),Ba=(e,t,o,n)=>((e,t,o,n)=>void 0!==Be(e[t],o)&&t>0&&n(Be(e[t-1],o),Be(e[t],o)))(e,t,o,n)||((e,t,o)=>t>0&&o(Be(e,t-1),Be(e,t)))(e[t],o,n),_a=(e,t,o,n)=>{const r=e=>(e=>"row"===e?(e=>Zn(e,"rowspan")>1)(t):er(t))(e)?`${e}group`:e;return e?ur(t)?r(o):null:n&&ur(t)?r("row"===o?"col":"row"):null},za=(e,t,o)=>Te(o(e.element,t),!0,e.isLocked),Aa=(e,t,o,n,r,s,l)=>E(e,((e,a)=>(e=>{const c=e.cells,i=E(c,((e,c)=>{if((e=>O(t,(t=>o(e.element,t.element))))(e)){const t=l(e,a,c)?r(e,o,n):e;return s(t,a,c).each((e=>{var o,n;o=t.element,n={scope:C.from(e)},G(n,((e,t)=>{e.fold((()=>{bo(o,t)}),(e=>{uo(o.dom,t,e)}))}))})),t}return e}));return Re(e.element,i,e.section,e.isNew)})(e))),La=(e,t,o)=>j(e,((n,r)=>Ba(e,r,t,o)?[]:[Ne(n,t)])),Ma=(e,t,o,n,r)=>{const s=ze(e).rows,l=j(t,(e=>La(s,e,n))),a=E(s,(e=>fr(e.cells))),c=((e,t)=>P(t,h)&&fr(e)?x:(e,o,n)=>!("th"===Bt(e.element)&&t[o]))(l,a),i=((e,t)=>(o,n)=>C.some(_a(e,o.element,"row",t[n])))(o,a);return Aa(e,l,n,r,za,i,c)},Wa=(e,t,o,n)=>{const r=ze(e).rows,s=E(t,(e=>Ne(r[e.row],e.column)));return Aa(e,s,o,n,za,C.none,x)},ja=e=>A(e,((e,t)=>O(e,(e=>e.column===t.column))?e:e.concat([t])),[]).sort(((e,t)=>e.column-t.column)),Pa=e=>gn(e,!0),Ia=e=>{0===ar(e).length&&yo(e)},Fa=(e,t)=>({grid:e,cursor:t}),Ha=(e,t,o)=>{const n=((e,t,o)=>{const n=ze(e).rows;return C.from(n[t]?.cells[o]?.element).filter(Pa).orThunk((()=>(e=>V(e,(e=>V(e.cells,(e=>{const t=e.element;return de(Pa(t),t)})))))(n)))})(e,t,o);return Fa(e,n)},$a=e=>A(e,((e,t)=>O(e,(e=>e.row===t.row))?e:e.concat([t])),[]).sort(((e,t)=>e.row-t.row)),Va=(e,t,o,n)=>{const r=t[0].row,s=$a(t),l=z(s,((e,t)=>({grid:Ea(e.grid,r,t.row+e.delta,o,n.getOrInit),delta:e.delta+1})),{grid:e,delta:0}).grid;return Ha(l,r,t[0].column)},qa=(e,t,o,n)=>{const r=$a(t),s=r[r.length-1],l=s.row+s.rowspan,a=z(r,((e,t)=>Ea(e,l,t.row,o,n.getOrInit)),e);return Ha(a,l,t[0].column)},Ua=(e,t,o,n)=>{const r=t.details,s=ja(r),l=s[0].column,a=z(s,((e,t)=>({grid:Na(e.grid,l,t.column+e.delta,o,n.getOrInit),delta:e.delta+1})),{grid:e,delta:0}).grid;return Ha(a,r[0].row,l)},Ga=(e,t,o,n)=>{const r=t.details,s=r[r.length-1],l=s.column+s.colspan,a=ja(r),c=z(a,((e,t)=>Na(e,l,t.column,o,n.getOrInit)),e);return Ha(c,r[0].row,l)},Ka=(e,t,o,n)=>{const r=ja(t),s=E(r,(e=>e.column)),l=Ma(e,s,!0,o,n.replaceOrInit);return Ha(l,t[0].row,t[0].column)},Ya=(e,t,o,n)=>{const r=Wa(e,t,o,n.replaceOrInit);return Ha(r,t[0].row,t[0].column)},Ja=(e,t,o,n)=>{const r=ja(t),s=E(r,(e=>e.column)),l=Ma(e,s,!1,o,n.replaceOrInit);return Ha(l,t[0].row,t[0].column)},Qa=(e,t,o,n)=>{const r=Wa(e,t,o,n.replaceOrInit);return Ha(r,t[0].row,t[0].column)},Xa=(e,t)=>(o,n,r,s,l)=>{const a=$a(n),c=E(a,(e=>e.row)),i=((e,t,o,n,r,s,l)=>{const{cols:a,rows:c}=ze(e),i=c[t[0]],m=j(t,(e=>((e,t,o)=>{const n=e[t];return j(n.cells,((n,r)=>Ba(e,t,r,o)?[]:[n]))})(c,e,r))),d=E(i.cells,((e,t)=>fr(La(c,t,r)))),u=[...c];N(t,(e=>{u[e]=l.transformRow(c[e],o)}));const f=[...a,...u],g=((e,t)=>P(t,h)&&fr(e.cells)?x:(e,o,n)=>!("th"===Bt(e.element)&&t[n]))(i,d),p=((e,t)=>(o,n,r)=>C.some(_a(e,o.element,"col",t[r])))(n,d);return Aa(f,m,r,s,l.transformCell,p,g)})(o,c,e,t,r,s.replaceOrInit,l);return Ha(i,n[0].row,n[0].column)},Za=Xa("thead",!0),ec=Xa("tbody",!1),tc=Xa("tfoot",!1),oc=(e,t,o,n)=>{const r=ja(t.details),s=((e,t)=>j(e,(e=>{const o=e.cells,n=z(t,((e,t)=>t>=0&&t0?[Re(e.element,n,e.section,e.isNew)]:[]})))(e,E(r,(e=>e.column))),l=s.length>0?s[0].cells.length-1:0;return Ha(s,r[0].row,Math.min(r[0].column,l))},nc=(e,t,o,n)=>{const r=$a(t),s=((e,t,o)=>{const{rows:n,cols:r}=ze(e);return[...r,...n.slice(0,t),...n.slice(o+1)]})(e,r[0].row,r[r.length-1].row),l=Math.max(ze(s).rows.length-1,0);return Ha(s,Math.min(t[0].row,l),t[0].column)},rc=(e,t,o,n)=>{const r=t.cells;na(r);const s=((e,t,o,n)=>{const r=ze(e).rows;if(0===r.length)return e;for(let e=t.startRow;e<=t.finishRow;e++)for(let o=t.startCol;o<=t.finishCol;o++){const t=r[e],s=Ne(t,o).isLocked;ke(t,o,Te(n(),!1,s))}return e})(e,t.bounds,0,n.merge(r));return Fa(s,C.from(r[0]))},sc=(e,t,o,n)=>{const r=z(t,((e,t)=>wa(e,t,o,n.unmerge(t))),e);return Fa(r,C.from(t[0]))},lc=(e,t,o,n)=>{const r=((e,t)=>{const o=Dr(e);return Hs(o,t,!0)})(t.clipboard,t.generators);var s,l;return((e,t,o,n,r)=>{const s=Cr(t),l=((e,t,o)=>{const n=_e(t[0]),r=ze(t).cols.length+e.row,s=k(n-e.column,(t=>t+e.column));return{row:r,column:L(s,(e=>P(o,(t=>t!==e)))).getOr(n-1)}})(e,t,s),a=ze(o).rows,c=Da(l,a,s),i=((e,t,o)=>{if(e.row>=t.length||e.column>_e(t[0]))return le.error("invalid start address out of table bounds, row: "+e.row+", column: "+e.column);const n=t.slice(e.row),r=n[0].cells.slice(e.column),s=_e(o[0]),l=o.length;return le.value({rowDelta:n.length-l,colDelta:r.length-s})})(l,t,a);return i.map((e=>{const o={...e,colDelta:e.colDelta-c.length},s=Ta(t,o,n),i=Cr(s),m=Da(l,a,i);return((e,t,o,n,r,s)=>{const l=e.row,a=e.column,c=l+o.length,i=a+_e(o[0])+s.length,m=I(s,x);for(let e=l;eFa(e,C.some(t.element))),(e=>Ha(e,t.row,t.column)))},ac=(e,t,o)=>{const n=((e,t)=>br(e,(()=>t)))(e,o.section),r=Or(n);return Hs(r,t,!0)},cc=(e,t,o,n)=>{const r=ze(e).rows,s=t.cells[0].column,l=r[t.cells[0].row],a=ac(t.clipboard,t.generators,l),c=Oa(s,e,a,t.generators,o);return Ha(c,t.cells[0].row,t.cells[0].column)},ic=(e,t,o,n)=>{const r=ze(e).rows,s=t.cells[t.cells.length-1].column+t.cells[t.cells.length-1].colspan,l=r[t.cells[0].row],a=ac(t.clipboard,t.generators,l),c=Oa(s,e,a,t.generators,o);return Ha(c,t.cells[0].row,s)},mc=(e,t,o,n)=>{const r=ze(e).rows,s=t.cells[0].row,l=r[s],a=ac(t.clipboard,t.generators,l),c=ka(s,e,a,t.generators,o);return Ha(c,t.cells[0].row,t.cells[0].column)},dc=(e,t,o,n)=>{const r=ze(e).rows,s=t.cells[t.cells.length-1].row+t.cells[t.cells.length-1].rowspan,l=r[t.cells[0].row],a=ac(t.clipboard,t.generators,l),c=ka(s,e,a,t.generators,o);return Ha(c,s,t.cells[0].column)},uc=(e,t,o,n)=>((e,t,o,n)=>{const r=Or(t),s=n.getWidths(r,n);tl(r,s,n)})(0,t,0,n.sizing),fc=(e,t,o,n)=>((e,t,o,n,r)=>{const s=Or(t),l=n.getWidths(s,n),a=n.pixelWidth(),{newSizes:c,delta:i}=r.calcRedestributedWidths(l,a,o.pixelDelta,n.isRelative);tl(s,c,n),n.adjustTableWidth(i)})(0,t,o,n.sizing,n.resize),gc=(e,t)=>O(t,(e=>0===e.column&&e.isLocked)),hc=(e,t)=>O(t,(t=>t.column+t.colspan>=e.grid.columns&&t.isLocked)),pc=(e,t)=>{const o=Vr(e),n=ja(t);return A(n,((e,t)=>e+o[t.column].map(Ho).getOr(0)),0)},bc=e=>(t,o)=>Ys(t,o).filter((o=>!(e?gc:hc)(t,o))).map((e=>({details:e,pixelDelta:pc(t,e)}))),wc=(e,t)=>Js(e,t).map((t=>({details:t,pixelDelta:-pc(e,t)}))),vc=e=>(t,o)=>Ks(t,o).filter((o=>!(e?gc:hc)(t,o.cells))),yc=gl("th"),xc=gl("td"),Cc=(e,t,o,n)=>Us(Va,Ys,f,f,fl,e,t,o,n),Sc=(e,t,o,n)=>Us(qa,Ys,f,f,fl,e,t,o,n),Tc=(e,t,o,n)=>Us(Ua,bc(!0),fc,f,fl,e,t,o,n),Rc=(e,t,o,n)=>Us(Ga,bc(!1),fc,f,fl,e,t,o,n),Dc=(e,t,o,n)=>Us(oc,wc,fc,Ia,fl,e,t,o,n),Oc=(e,t,o,n)=>Us(nc,Ys,f,Ia,fl,e,t,o,n),kc=(e,t,o,n)=>Us(Ka,Js,f,f,yc,e,t,o,n),Ec=(e,t,o,n)=>Us(Ja,Js,f,f,xc,e,t,o,n),Nc=(e,t,o,n)=>Us(Za,Ys,f,f,yc,e,t,o,n),Bc=(e,t,o,n)=>Us(ec,Ys,f,f,xc,e,t,o,n),_c=(e,t,o,n)=>Us(tc,Ys,f,f,xc,e,t,o,n),zc=(e,t,o,n)=>Us(Ya,Js,f,f,yc,e,t,o,n),Ac=(e,t,o,n)=>Us(Qa,Js,f,f,xc,e,t,o,n),Lc=(e,t,o,n)=>Us(rc,Xs,uc,f,hl,e,t,o,n),Mc=(e,t,o,n)=>Us(sc,Zs,uc,f,hl,e,t,o,n),Wc=(e,t,o,n)=>Us(lc,Gs,uc,f,fl,e,t,o,n),jc=(e,t,o,n)=>Us(cc,vc(!0),f,f,fl,e,t,o,n),Pc=(e,t,o,n)=>Us(ic,vc(!1),f,f,fl,e,t,o,n),Ic=(e,t,o,n)=>Us(mc,Ks,f,f,fl,e,t,o,n),Fc=(e,t,o,n)=>Us(dc,Ks,f,f,fl,e,t,o,n),Hc=(e,t)=>{const o=Dr(e);return Ys(o,t).bind((e=>{const t=e[e.length-1],n=e[0].column,r=t.column+t.colspan,s=W(E(o.all,(e=>_(e.cells,(e=>e.column>=n&&e.column{const o=Dr(e);return Ys(o,t).bind(pr).getOr("")},Vc=(e,t)=>{const o=Dr(e);return Ys(o,t).bind((e=>{const t=e[e.length-1],n=e[0].row,r=t.row+t.rowspan;return(e=>{const t=E(e,(e=>hr(e).type)),o=D(t,"header"),n=D(t,"footer");if(o||n){const e=D(t,"body");return!o||e||n?o||e||!n?C.none():C.some("footer"):C.some("header")}return C.some("body")})(o.all.slice(n,r))})).getOr("")},qc=(e,t)=>{const o=t.column,n=t.column+t.colspan-1,r=t.row,s=t.row+t.rowspan-1;return o<=e.finishCol&&n>=e.startCol&&r<=e.finishRow&&s>=e.startRow},Uc=(e,t)=>t.column>=e.startCol&&t.column+t.colspan-1<=e.finishCol&&t.row>=e.startRow&&t.row+t.rowspan-1<=e.finishRow,Gc=(e,t,o)=>{const n=Er(e,t,Je),r=Er(e,o,Je);return n.bind((e=>r.map((t=>{return o=e,n=t,{startRow:Math.min(o.row,n.row),startCol:Math.min(o.column,n.column),finishRow:Math.max(o.row+o.rowspan-1,n.row+n.rowspan-1),finishCol:Math.max(o.column+o.colspan-1,n.column+n.colspan-1)};var o,n}))))},Kc=(e,t,o)=>Gc(e,t,o).map((t=>{const o=Nr(e,b(qc,t));return E(o,(e=>e.element))})),Yc=(e,t)=>Er(e,t,((e,t)=>Qe(t,e))).map((e=>e.element)),Jc=(e,t,o)=>{const n=Xc(e);return Kc(n,t,o)},Qc=(e,t,o,n,r)=>{const s=Xc(e),l=Je(e,o)?C.some(t):Yc(s,t),a=Je(e,r)?C.some(n):Yc(s,n);return l.bind((e=>a.bind((t=>Kc(s,e,t)))))},Xc=Dr,Zc={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},ei=(e,t,o,n)=>k(e,(e=>((e,t,o,n)=>{const r=Me.fromTag("tr");for(let s=0;s{let t=[];return{bind:e=>{if(void 0===e)throw new Error("Event bind error: undefined handler");t.push(e)},unbind:e=>{t=_(t,(t=>t!==e))},trigger:(...o)=>{const n={};N(e,((e,t)=>{n[e]=o[t]})),N(t,(e=>{e(n)}))}}},oi=e=>({registry:K(e,(e=>({bind:e.bind,unbind:e.unbind}))),trigger:K(e,(e=>e.trigger))}),ni=ne(["compare","extract","mutate","sink"]),ri=ne(["element","start","stop","destroy"]),si=ne(["forceDrop","drop","move","delayDrop"]),li=()=>{const e=(()=>{const e=oi({move:ti(["info"])});return{onEvent:f,reset:f,events:e.registry}})(),t=(()=>{let e=C.none();const t=oi({move:ti(["info"])});return{onEvent:(o,n)=>{n.extract(o).each((o=>{const r=((t,o)=>{const n=e.map((e=>t.compare(e,o)));return e=C.some(o),n})(n,o);r.each((e=>{t.trigger.move(e)}))}))},reset:()=>{e=C.none()},events:t.registry}})();let o=e;return{on:()=>{o.reset(),o=t},off:()=>{o.reset(),o=e},isOn:()=>o===t,onEvent:(e,t)=>{o.onEvent(e,t)},events:t.events}},ai=ce("ephox-dragster").resolve;var ci=ni({compare:(e,t)=>qo(t.left-e.left,t.top-e.top),extract:e=>C.some(qo(e.x,e.y)),sink:(e,t)=>{const o=(e=>{const t={layerClass:ai("blocker"),...e},o=Me.fromTag("div");return fo(o,"role","presentation"),fo(o,"data-mce-bogus","all"),No(o,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),dn(o,ai("blocker")),dn(o,t.layerClass),{element:g(o),destroy:()=>{yo(o)}}})(t),n=oo(o.element(),"mousedown",e.forceDrop),r=oo(o.element(),"mouseup",e.drop),s=oo(o.element(),"mousemove",e.move),l=oo(o.element(),"mouseout",e.delayDrop);return ri({element:o.element,start:e=>{ao(e,o.element())},stop:()=>{yo(o.element())},destroy:()=>{o.destroy(),r.unbind(),s.unbind(),l.unbind(),n.unbind()}})},mutate:(e,t)=>{e.mutate(t.left,t.top)}});const ii=ce("ephox-snooker").resolve,mi=ii("resizer-bar"),di=ii("resizer-rows"),ui=ii("resizer-cols"),fi=e=>{const t=vn(e.parent(),"."+mi);N(t,yo)},gi=(e,t,o)=>{const n=e.origin();N(t,(t=>{t.each((t=>{const r=o(n,t);dn(r,mi),ao(e.parent(),r)}))}))},hi=(e,t,o,n,r)=>{const s=Go(o),l=t.isResizable,a=n.length>0?ns.positions(n,o):[],c=a.length>0?((e,t)=>j(e.all,((e,o)=>t(e.element)?[o]:[])))(e,l):[];((e,t,o,n)=>{gi(e,t,((e,t)=>{const r=((e,t,o,n)=>{const r=Me.fromTag("div");return No(r,{position:"absolute",left:t+"px",top:o-3.5+"px",height:"7px",width:n+"px"}),go(r,{"data-mce-bogus":"all","data-row":e,role:"presentation"}),r})(t.row,o.left-e.left,t.y-e.top,n);return dn(r,di),r}))})(t,_(a,((e,t)=>O(c,(e=>t===e)))),s,Ho(o));const i=r.length>0?ss.positions(r,o):[],m=i.length>0?((e,t)=>{const o=[];return k(e.grid.columns,(n=>{Ar(e,n).map((e=>e.element)).forall(t)&&o.push(n)})),_(o,(o=>{const n=Nr(e,(e=>e.column===o));return P(n,(e=>t(e.element)))}))})(e,l):[];((e,t,o,n)=>{gi(e,t,((e,t)=>{const r=((e,t,o,n,r)=>{const s=Me.fromTag("div");return No(s,{position:"absolute",left:t-3.5+"px",top:o+"px",height:r+"px",width:"7px"}),go(s,{"data-mce-bogus":"all","data-column":e,role:"presentation"}),s})(t.col,t.x-e.left,o.top-e.top,0,n);return dn(r,ui),r}))})(t,_(i,((e,t)=>O(m,(e=>t===e)))),s,Po(o))},pi=(e,t)=>{if(fi(e),e.isResizable(t)){const o=Dr(t),n=Ur(o),r=Vr(o);hi(o,e,t,n,r)}},bi=(e,t)=>{const o=vn(e.parent(),"."+mi);N(o,t)},wi=e=>{bi(e,(e=>{Eo(e,"display","none")}))},vi=e=>{bi(e,(e=>{Eo(e,"display","block")}))},yi=ii("resizer-bar-dragging"),xi=e=>{const t=(()=>{const e=oi({drag:ti(["xDelta","yDelta","target"])});let t=C.none();const o=(()=>{const e=oi({drag:ti(["xDelta","yDelta"])});return{mutate:(t,o)=>{e.trigger.drag(t,o)},events:e.registry}})();return o.events.drag.bind((o=>{t.each((t=>{e.trigger.drag(o.xDelta,o.yDelta,t)}))})),{assign:e=>{t=C.some(e)},get:()=>t,mutate:o.mutate,events:e.registry}})(),o=((e,t={})=>((e,t,o)=>{let n=!1;const r=oi({start:ti([]),stop:ti([])}),s=li(),l=()=>{m.stop(),s.isOn()&&(s.off(),r.trigger.stop())},c=(e=>{let t=null;const o=()=>{a(t)||(clearTimeout(t),t=null)};return{cancel:o,throttle:(...n)=>{o(),t=setTimeout((()=>{t=null,e.apply(null,n)}),200)}}})(l);s.events.move.bind((o=>{t.mutate(e,o.info)}));const i=e=>(...t)=>{n&&e.apply(null,t)},m=t.sink(si({forceDrop:l,drop:i(l),move:i((e=>{c.cancel(),s.onEvent(e,t)})),delayDrop:i(c.throttle)}),o);return{element:m.element,go:e=>{m.start(e),s.on(),r.trigger.start()},on:()=>{n=!0},off:()=>{n=!1},isActive:()=>n,destroy:()=>{m.destroy()},events:r.registry}})(e,t.mode??ci,t))(t,{});let n=C.none();const r=(e,t)=>C.from(ho(e,t));t.events.drag.bind((e=>{r(e.target,"data-row").each((t=>{const o=tr(e.target,"top");Eo(e.target,"top",o+e.yDelta+"px")})),r(e.target,"data-column").each((t=>{const o=tr(e.target,"left");Eo(e.target,"left",o+e.xDelta+"px")}))}));const s=(e,t)=>tr(e,t)-Xn(e,"data-initial-"+t,0);o.events.stop.bind((()=>{t.get().each((t=>{n.each((o=>{r(t,"data-row").each((e=>{const n=s(t,"top");bo(t,"data-initial-top"),d.trigger.adjustHeight(o,n,parseInt(e,10))})),r(t,"data-column").each((e=>{const n=s(t,"left");bo(t,"data-initial-left"),d.trigger.adjustWidth(o,n,parseInt(e,10))})),pi(e,o)}))}))}));const l=(n,r)=>{d.trigger.startAdjust(),t.assign(n),fo(n,"data-initial-"+r,tr(n,r)),dn(n,yi),Eo(n,"opacity","0.2"),o.go(e.dragContainer())},c=oo(e.parent(),"mousedown",(e=>{var t;t=e.target,un(t,di)&&l(e.target,"top"),(e=>un(e,ui))(e.target)&&l(e.target,"left")})),i=t=>Je(t,e.view()),m=oo(e.view(),"mouseover",(t=>{var r;(r=t.target,an(r,"table",i).filter(gn)).fold((()=>{Oo(t.target)&&!(e=>un(e,"ephox-snooker-resizer-bar")||un(e,"ephox-dragster-blocker"))(t.target)&&fi(e)}),(t=>{o.isActive()&&(n=C.some(t),pi(e,t))}))})),d=oi({adjustHeight:ti(["table","delta","row"]),adjustWidth:ti(["table","delta","column"]),startAdjust:ti([])});return{destroy:()=>{c.unbind(),m.unbind(),o.destroy(),fi(e)},refresh:t=>{pi(e,t)},on:o.on,off:o.off,hideBars:b(wi,e),showBars:b(vi,e),events:d.registry}},Ci=e=>t=>t.options.get(e),Si="100%",Ti=e=>{const t=e.dom,o=t.getParent(e.selection.getStart(),t.isBlock)??e.getBody();return $o(Me.fromDom(o))+"px"},Ri=e=>C.from(e.options.get("table_clone_elements")),Di=Ci("table_header_type"),Oi=Ci("table_column_resizing"),ki=e=>"preservetable"===Oi(e),Ei=e=>"resizetable"===Oi(e),Ni=Ci("table_sizing_mode"),Bi=e=>"relative"===Ni(e),_i=e=>"fixed"===Ni(e),zi=e=>"responsive"===Ni(e),Ai=Ci("table_resize_bars"),Li=Ci("table_style_by_css"),Mi=Ci("table_merge_content_on_paste"),Wi=e=>{const t=e.options,o=t.get("table_default_attributes");return t.isSet("table_default_attributes")?o:((e,t)=>zi(e)||Li(e)?t:_i(e)?{...t,width:Ti(e)}:{...t,width:Si})(e,o)},ji=Ci("table_use_colgroups"),Pi=e=>Me.fromDom(e.getBody()),Ii=e=>t=>Je(t,Pi(e)),Fi=e=>{bo(e,"data-mce-style");const t=e=>bo(e,"data-mce-style");N(ar(e),t),N(cr(e),t),N(mr(e),t)},Hi=e=>Me.fromDom(e.selection.getStart()),$i=e=>e.getBoundingClientRect().width,Vi=e=>e.getBoundingClientRect().height,qi=e=>(t,o)=>{const n=t.dom.getStyle(o,e)||t.dom.getAttrib(o,e);return C.from(n).filter(ve)},Ui=qi("width"),Gi=qi("height"),Ki=e=>nn(e,It("table")).exists(gn),Yi=e=>rn(e,"table"),Ji=(e,t,o)=>{const n=e=>t=>void 0!==o&&o(t)||Je(t,e);return Je(e,t)?C.some({boxes:C.some([e]),start:e,finish:t}):Yi(e).bind((r=>Yi(t).bind((s=>{if(Je(r,s))return C.some({boxes:Jc(r,e,t),start:e,finish:t});if(Qe(r,s)){const o=bn(t,"td,th",n(r)),l=o.length>0?o[o.length-1]:t;return C.some({boxes:Qc(r,e,r,t,s),start:e,finish:l})}if(Qe(s,r)){const o=bn(e,"td,th",n(s)),l=o.length>0?o[o.length-1]:e;return C.some({boxes:Qc(s,e,r,t,s),start:e,finish:l})}return((e,t)=>((e,t,o,n=y)=>{const r=[t].concat(e.up().all(t)),s=[o].concat(e.up().all(o)),l=e=>M(e,n).fold((()=>e),(t=>e.slice(0,t+1))),a=l(r),c=l(s),i=L(a,(t=>O(c,((e,t)=>b(e.eq,t))(e,t))));return{firstpath:a,secondpath:c,shared:i}})(Xl,e,t,void 0))(e,t).shared.bind((l=>an(l,"table",o).bind((o=>{const l=bn(t,"td,th",n(o)),a=l.length>0?l[l.length-1]:t,c=bn(e,"td,th",n(o)),i=c.length>0?c[c.length-1]:e;return C.some({boxes:Qc(o,e,r,t,s),start:i,finish:a})}))))}))))},Qi=(e,t)=>{const o=vn(e,t);return o.length>0?C.some(o):C.none()},Xi=(e,t,o)=>ln(e,t).bind((t=>ln(e,o).bind((e=>Zl(Yi,[t,e]).map((o=>({first:t,last:e,table:o}))))))),Zi=(e,t,o,n,r)=>((e,t)=>L(e,(e=>Ge(e,t))))(e,r).bind((e=>((e,t,o)=>ir(e).bind((n=>((e,t,o,n)=>Er(e,t,Je).bind((t=>{const r=o>0?t.row+t.rowspan-1:t.row,s=n>0?t.column+t.colspan-1:t.column;return kr(e,r+o,s+n).map((e=>e.element))})))(Xc(n),e,t,o))))(e,t,o).bind((e=>((e,t)=>rn(e,"table").bind((o=>ln(o,t).bind((t=>Ji(t,e).bind((e=>e.boxes.map((t=>({boxes:t,start:e.start,finish:e.finish}))))))))))(e,n))))),em=(e,t)=>Qi(e,t),tm=(e,t,o)=>Xi(e,t,o).bind((t=>{const o=t=>Je(e,t),n="thead,tfoot,tbody,table",r=rn(t.first,n,o),s=rn(t.last,n,o);return r.bind((e=>s.bind((o=>Je(e,o)?((e,t,o)=>((e,t,o)=>Gc(e,t,o).bind((t=>((e,t)=>{let o=!0;const n=b(Uc,t);for(let r=t.startRow;r<=t.finishRow;r++)for(let s=t.startCol;s<=t.finishCol;s++)o=o&&kr(e,r,s).exists(n);return o?C.some(t):C.none()})(e,t))))(Xc(e),t,o))(t.table,t.first,t.last):C.none()))))})),om=h,nm=e=>{const t=(e,t)=>po(e,t).exists((e=>parseInt(e,10)>1));return e.length>0&&P(e,(e=>t(e,"rowspan")||t(e,"colspan")))?C.some(e):C.none()},rm=(e,t,o)=>t.length<=1?C.none():tm(e,o.firstSelectedSelector,o.lastSelectedSelector).map((e=>({bounds:e,cells:t}))),sm=(e,t)=>({selection:e,kill:t}),lm=()=>({tag:"none"}),am=e=>({tag:"multiple",elements:e}),cm=e=>({tag:"single",element:e}),im=(e,t,o,n)=>({start:kn.on(e,t),finish:kn.on(o,n)}),mm=(e,t)=>{const o=Ue(e,t);return Dn(Me.fromDom(o.startContainer),o.startOffset,Me.fromDom(o.endContainer),o.endOffset)},dm=im,um=(e,t,o,n,r)=>Je(o,n)?C.none():Ji(o,n,t).bind((t=>{const n=t.boxes.getOr([]);return n.length>1?(r(e,n,t.start,t.finish),C.some(sm(C.some(dm(o,0,o,yn(o))),!0))):C.none()})),fm=Z([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),gm=e=>an(e,"tr"),hm={...fm,verify:(e,t,o,n,r,s,l)=>an(n,"td,th",l).bind((o=>an(t,"td,th",l).map((t=>Je(o,t)?Je(n,o)&&yn(o)===r?s(t):fm.none("in same cell"):Zl(gm,[o,t]).fold((()=>((e,t,o)=>{const n=e.getRect(t),r=e.getRect(o);return r.right>n.left&&r.lefts(t))))))).getOr(fm.none("default")),cata:(e,t,o,n,r)=>e.fold(t,o,n,r)},pm=It("br"),bm=(e,t,o)=>t(e,o).bind((e=>Wt(e)&&0===Jo(e).trim().length?bm(e,t,o):C.some(e))),wm=(e,t,o,n)=>((e,t)=>Yt(e,t).filter(pm).orThunk((()=>Yt(e,t-1).filter(pm))))(t,o).bind((t=>n.traverse(t).fold((()=>bm(t,n.gather,e).map(n.relative)),(e=>(e=>$t(e).bind((t=>{const o=Kt(t);return((e,t)=>M(e,b(Je,t)))(o,e).map((n=>((e,t,o,n)=>({parent:e,children:t,element:o,index:n}))(t,o,e,n)))})))(e).map((e=>kn.on(e.parent,e.index))))))),vm=(e,t)=>({left:e.left,top:e.top+t,right:e.right,bottom:e.bottom+t}),ym=(e,t)=>({left:e.left,top:e.top-t,right:e.right,bottom:e.bottom-t}),xm=(e,t,o)=>({left:e.left+t,top:e.top+o,right:e.right+t,bottom:e.bottom+o}),Cm=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom}),Sm=(e,t)=>C.some(e.getRect(t)),Tm=(e,t,o)=>Mt(t)?Sm(e,t).map(Cm):Wt(t)?((e,t,o)=>o>=0&&o0?e.getRangedRect(t,o-1,t,o):C.none())(e,t,o).map(Cm):C.none(),Rm=(e,t)=>Mt(t)?Sm(e,t).map(Cm):Wt(t)?e.getRangedRect(t,0,t,yn(t)).map(Cm):C.none(),Dm=Z([{none:[]},{retry:["caret"]}]),Om=(e,t,o)=>nn(t,ta).fold(y,(t=>Rm(e,t).exists((e=>((e,t)=>e.leftt.right)(o,e))))),km={point:e=>e.bottom,adjuster:(e,t,o,n,r)=>{const s=vm(r,5);return Math.abs(o.bottom-n.bottom)<1||o.top>r.bottom?Dm.retry(s):o.top===r.bottom?Dm.retry(vm(r,1)):Om(e,t,r)?Dm.retry(xm(s,5,0)):Dm.none()},move:vm,gather:Kl},Em=(e,t,o,n,r)=>0===r?C.some(n):((e,t,o)=>e.elementFromPoint(t,o).filter((e=>"table"===Bt(e))).isSome())(e,n.left,t.point(n))?((e,t,o,n,r)=>Em(e,t,o,t.move(n,5),r))(e,t,o,n,r-1):e.situsFromPoint(n.left,t.point(n)).bind((s=>s.start.fold(C.none,(s=>Rm(e,s).bind((l=>t.adjuster(e,s,l,o,n).fold(C.none,(n=>Em(e,t,o,n,r-1))))).orThunk((()=>C.some(n)))),C.none))),Nm=(e,t,o)=>{const n=e.move(o,5),r=Em(t,e,o,n,100).getOr(n);return((e,t,o)=>e.point(t)>o.getInnerHeight()?C.some(e.point(t)-o.getInnerHeight()):e.point(t)<0?C.some(-e.point(t)):C.none())(e,r,t).fold((()=>t.situsFromPoint(r.left,e.point(r))),(o=>(t.scrollBy(0,o),t.situsFromPoint(r.left,e.point(r)-o))))},Bm={tryUp:b(Nm,{point:e=>e.top,adjuster:(e,t,o,n,r)=>{const s=ym(r,5);return Math.abs(o.top-n.top)<1||o.bottome.getSelection().bind((n=>((e,t,o,n)=>{const r=pm(t)?((e,t,o)=>o.traverse(t).orThunk((()=>bm(t,o.gather,e))).map(o.relative))(e,t,n):wm(e,t,o,n);return r.map((e=>({start:e,finish:e})))})(t,n.finish,n.foffset,o).fold((()=>C.some(Wl(n.finish,n.foffset))),(r=>{const s=e.fromSitus(r);return l=hm.verify(e,n.finish,n.foffset,s.finish,s.foffset,o.failure,t),hm.cata(l,(e=>C.none()),(()=>C.none()),(e=>C.some(Wl(e,0))),(e=>C.some(Wl(e,yn(e)))));var l})))),zm=(e,t,o,n,r,s)=>0===s?C.none():Mm(e,t,o,n,r).bind((l=>{const a=e.fromSitus(l),c=hm.verify(e,o,n,a.finish,a.foffset,r.failure,t);return hm.cata(c,(()=>C.none()),(()=>C.some(l)),(l=>Je(o,l)&&0===n?Am(e,o,n,ym,r):zm(e,t,l,0,r,s-1)),(l=>Je(o,l)&&n===yn(l)?Am(e,o,n,vm,r):zm(e,t,l,yn(l),r,s-1)))})),Am=(e,t,o,n,r)=>Tm(e,t,o).bind((t=>Lm(e,r,n(t,Bm.getJumpSize())))),Lm=(e,t,o)=>{const n=kt().browser;return n.isChromium()||n.isSafari()||n.isFirefox()?t.retry(e,o):C.none()},Mm=(e,t,o,n,r)=>Tm(e,o,n).bind((t=>Lm(e,r,t))),Wm=(e,t,o,n,r)=>an(n,"td,th",t).bind((n=>an(n,"table",t).bind((s=>((e,t)=>on(e,(e=>$t(e).exists((e=>Je(e,t)))),void 0).isSome())(r,s)?((e,t,o)=>_m(e,t,o).bind((n=>zm(e,t,n.element,n.offset,o,20).map(e.fromSitus))))(e,t,o).bind((e=>an(e.finish,"td,th",t).map((t=>({start:n,finish:t,range:e}))))):C.none())))),jm=(e,t,o,n,r,s)=>s(n,t).orThunk((()=>Wm(e,t,o,n,r).map((e=>{const t=e.range;return sm(C.some(dm(t.start,t.soffset,t.finish,t.foffset)),!0)})))),Pm=(e,t)=>an(e,"tr",t).bind((e=>an(e,"table",t).bind((o=>{const n=vn(o,"tr");return Je(e,n[0])?((e,t,o)=>Vl(Ul,e,(e=>Tn(e).isSome()),o))(o,0,t).map((e=>{const t=yn(e);return sm(C.some(dm(e,t,e,t)),!0)})):C.none()})))),Im=(e,t)=>an(e,"tr",t).bind((e=>an(e,"table",t).bind((o=>{const n=vn(o,"tr");return Je(e,n[n.length-1])?((e,t,o)=>ql(Ul,e,(e=>Sn(e).isSome()),o))(o,0,t).map((e=>sm(C.some(dm(e,0,e,0)),!0))):C.none()})))),Fm=(e,t,o,n,r,s,l)=>Wm(e,o,n,r,s).bind((e=>um(t,o,e.start,e.finish,l))),Hm=(e,t)=>an(e,"td,th",t),$m=e=>Vt(e).exists(gn),Vm={traverse:Gt,gather:Kl,relative:kn.before,retry:Bm.tryDown,failure:hm.failedDown},qm={traverse:Ut,gather:Gl,relative:kn.before,retry:Bm.tryUp,failure:hm.failedUp},Um=e=>t=>t===e,Gm=Um(38),Km=Um(40),Ym=e=>e>=37&&e<=40,Jm={isBackward:Um(37),isForward:Um(39)},Qm={isBackward:Um(39),isForward:Um(37)},Xm=e=>({elementFromPoint:(t,o)=>Me.fromPoint(Me.fromDom(e.document),t,o),getRect:e=>e.dom.getBoundingClientRect(),getRangedRect:(t,o,n,r)=>{const s=Nn.exact(t,o,n,r);return((e,t)=>(e=>{const t=e.getClientRects(),o=t.length>0?t[0]:e.getBoundingClientRect();return o.width>0||o.height>0?C.some(o).map(He):C.none()})(Ue(e,t)))(e,s)},getSelection:()=>Fn(e).map((t=>mm(e,t))),fromSitus:t=>{const o=Nn.relative(t.start,t.finish);return mm(e,o)},situsFromPoint:(t,o)=>Hn(e,t,o).map((e=>im(e.start,e.soffset,e.finish,e.foffset))),clearSelection:()=>{(e=>{_n(e).each((e=>e.removeAllRanges()))})(e)},collapseSelection:(t=!1)=>{Fn(e).each((o=>o.fold((e=>e.collapse(t)),((o,n)=>{const r=t?o:n;Wn(e,r,r)}),((o,n,r,s)=>{const l=t?o:r,a=t?n:s;Mn(e,l,a,l,a)}))))},setSelection:t=>{Mn(e,t.start,t.soffset,t.finish,t.foffset)},setRelativeSelection:(t,o)=>{Wn(e,t,o)},selectNode:t=>{In(e,t,!1)},selectContents:t=>{In(e,t)},getInnerHeight:()=>e.innerHeight,getScrollY:()=>(e=>{const t=void 0!==e?e.dom:document,o=t.body.scrollLeft||t.documentElement.scrollLeft,n=t.body.scrollTop||t.documentElement.scrollTop;return qo(o,n)})(Me.fromDom(e.document)).top,scrollBy:(t,o)=>{((e,t,o)=>{const n=(void 0!==o?o.dom:document).defaultView;n&&n.scrollBy(e,t)})(t,o,Me.fromDom(e.document))}}),Zm=(e,t)=>({rows:e,cols:t}),ed=e=>nn(e,Lt).exists(gn),td=(e,t)=>ed(e)||ed(t),od="data-mce-selected",nd="data-mce-first-selected",rd="data-mce-last-selected",sd="["+od+"]",ld={selected:od,selectedSelector:"td["+od+"],th["+od+"]",firstSelected:nd,firstSelectedSelector:"td["+nd+"],th["+nd+"]",lastSelected:rd,lastSelectedSelector:"td["+rd+"],th["+rd+"]"},ad=(e,t,o)=>({element:o,mergable:rm(t,e,ld),unmergable:nm(e),selection:om(e)}),cd=e=>(t,o)=>{const n=Bt(t),r="col"===n||"colgroup"===n?ir(s=t).bind((e=>em(e,ld.firstSelectedSelector))).fold(g(s),(e=>e[0])):t;var s;return an(r,e,o)},id=cd("th,td,caption"),md=cd("th,td"),dd=e=>{return t=e.model.table.getSelectedCells(),E(t,Me.fromDom);var t},ud=(e,t)=>{e.on("BeforeGetContent",(t=>{const o=o=>{t.preventDefault(),(e=>ir(e[0]).map((e=>{const t=((e,t)=>{const o=e=>Ge(e.element,t),n=To(e),r=vr(n),s=As(e),l=Or(r),a=((e,t)=>{const o=e.grid.columns;let n=e.grid.rows,r=o,s=0,l=0;const a=[],c=[];return G(e.access,(e=>{if(a.push(e),t(e)){c.push(e);const t=e.row,o=t+e.rowspan-1,a=e.column,i=a+e.colspan-1;ts&&(s=o),al&&(l=i)}})),((e,t,o,n,r,s)=>({minRow:e,minCol:t,maxRow:o,maxCol:n,allCells:r,selectedCells:s}))(n,r,s,l,a,c)})(l,o),c="th:not("+t+"),td:not("+t+")",i=sr(n,"th,td",(e=>Ge(e,c)));N(i,yo),((e,t,o,n)=>{const r=_(e,(e=>"colgroup"!==e.section)),s=t.grid.columns,l=t.grid.rows;for(let e=0;eo.maxRow||ao.maxCol||(kr(t,e,a).filter(n).isNone()?al(r,l,e):l=!0)}})(r,l,a,o);const m=((e,t,o,n)=>{if(0===n.minCol&&t.grid.columns===n.maxCol+1)return 0;const r=Es(t,e,o),s=A(r,((e,t)=>e+t),0),l=A(r.slice(n.minCol,n.maxCol+1),((e,t)=>e+t),0),a=l/s*o.pixelWidth()-o.pixelWidth();return o.getCellDelta(a)})(e,Dr(e),s,a);return((e,t,o,n)=>{G(o.columns,(e=>{(e.columnt.maxCol)&&yo(e.element)}));const r=_(rr(e,"tr"),(e=>0===e.dom.childElementCount));N(r,yo),t.minCol!==t.maxCol&&t.minRow!==t.maxRow||N(rr(e,"th,td"),(e=>{bo(e,"rowspan"),bo(e,"colspan")})),bo(e,yr),bo(e,"data-snooker-col-series"),As(e).adjustTableWidth(n)})(n,a,l,m),n})(e,sd);return Fi(t),[t]})))(o).each((o=>{const n="text"===t.format?((e,t)=>{const o=e.getDoc(),n=Qt(Me.fromDom(e.getBody())),r=Me.fromTag("div",o);fo(r,"data-mce-bogus","all"),No(r,{position:"fixed",left:"-9999999px",top:"0",overflow:"hidden",opacity:"0"});const s=(e=>Jt(e)?e:Me.fromDom(Ht(e).dom.body))(n);mo(r,t),ao(s,r);const l=r.dom.innerText;return yo(r),l})(e,o):((e,t)=>E(t,(t=>e.selection.serializer.serialize(t.dom,{}))).join(""))(e,o);t.content=n}))};if(!0===t.selection){const t=(e=>_(dd(e),(e=>Ge(e,ld.selectedSelector))))(e);t.length>=1&&o(t)}})),e.on("BeforeSetContent",(o=>{if(!0===o.selection&&!0===o.paste){const n=dd(e);H(n).each((n=>{ir(n).each((r=>{const s=_((e=>{const t=document.createElement("div");return t.innerHTML=e,Kt(Me.fromDom(t))})(o.content),(e=>"meta"!==Bt(e))),l=It("table");if(Mi(e)&&1===s.length&&l(s[0])){o.preventDefault();const l=Me.fromDom(e.getDoc()),a=pa(l),c=((e,t,o)=>({element:e,clipboard:t,generators:o}))(n,s[0],a);t.pasteCells(r,c).each((()=>{e.focus()}))}}))}))}}))},fd=(e,t)=>e.dispatch("NewRow",{node:t}),gd=(e,t)=>e.dispatch("NewCell",{node:t}),hd=(e,t,o)=>{e.dispatch("TableModified",{...o,table:t})},pd={structure:!1,style:!0},bd={structure:!0,style:!1},wd={structure:!0,style:!0},vd=(e,t)=>Bi(e)?Ms(t):_i(e)?Ls(t):As(t),yd=(e,t,o)=>{const n=e=>"table"===Bt(Pi(e)),r=Ri(e),s=Ei(e)?f:rl,l=t=>{switch(Di(e)){case"section":return Ir();case"sectionCells":return Fr();case"cells":return Hr();default:return((e,t)=>{var o;switch((o=Dr(e),V(o.all,(e=>{const t=hr(e);return"header"===t.type?C.from(t.subType):C.none()}))).getOr(t)){case"section":return Wr();case"sectionCells":return jr();case"cells":return Pr()}})(t,"section")}},a=(n,s,a,c)=>(i,m,d=!1)=>{Fi(i);const u=Me.fromDom(e.getDoc()),f=ha(a,u,r),g={sizing:vd(e,i),resize:Ei(e)?Jn():Qn(),section:l(i)};return s(i)?n(i,m,f,g).bind((n=>{t.refresh(i.dom),N(n.newRows,(t=>{fd(e,t.dom)})),N(n.newCells,(t=>{gd(e,t.dom)}));const r=((t,n)=>n.cursor.fold((()=>{const n=ar(t);return H(n).filter(Oo).map((n=>{o.clearSelectedCells(t.dom);const r=e.dom.createRng();return r.selectNode(n.dom),e.selection.setRng(r),fo(n,"data-mce-selected","1"),r}))}),(n=>{const r=Fl(Hl,n),s=e.dom.createRng();return s.setStart(r.element.dom,r.offset),s.setEnd(r.element.dom,r.offset),e.selection.setRng(s),o.clearSelectedCells(t.dom),C.some(s)})))(i,n);return Oo(i)&&(Fi(i),d||hd(e,i.dom,c)),r.map((e=>({rng:e,effect:c})))})):C.none()},c=a(Oc,(t=>!n(e)||ba(t).rows>1),f,bd),i=a(Dc,(t=>!n(e)||ba(t).columns>1),f,bd);return{deleteRow:c,deleteColumn:i,insertRowsBefore:a(Cc,x,f,bd),insertRowsAfter:a(Sc,x,f,bd),insertColumnsBefore:a(Tc,x,s,bd),insertColumnsAfter:a(Rc,x,s,bd),mergeCells:a(Lc,x,f,bd),unmergeCells:a(Mc,x,f,bd),pasteColsBefore:a(jc,x,f,bd),pasteColsAfter:a(Pc,x,f,bd),pasteRowsBefore:a(Ic,x,f,bd),pasteRowsAfter:a(Fc,x,f,bd),pasteCells:a(Wc,x,f,wd),makeCellsHeader:a(zc,x,f,bd),unmakeCellsHeader:a(Ac,x,f,bd),makeColumnsHeader:a(kc,x,f,bd),unmakeColumnsHeader:a(Ec,x,f,bd),makeRowsHeader:a(Nc,x,f,bd),makeRowsBody:a(Bc,x,f,bd),makeRowsFooter:a(_c,x,f,bd),getTableRowType:Vc,getTableCellType:$c,getTableColType:Hc}},xd=(e,t)=>{e.selection.select(t.dom,!0),e.selection.collapse(!0)},Cd=(e,t,o,n,s)=>{const l=(e=>{const t=e.options,o=t.get("table_default_styles");return t.isSet("table_default_styles")?o:((e,t)=>zi(e)||!Li(e)?t:_i(e)?{...t,width:Ti(e)}:{...t,width:Si})(e,o)})(e),a={styles:l,attributes:Wi(e),colGroups:ji(e)};return e.undoManager.ignore((()=>{const r=((e,t,o,n,r,s=Zc)=>{const l=Me.fromTag("table"),a="cells"!==r;No(l,s.styles),go(l,s.attributes),s.colGroups&&ao(l,(e=>{const t=Me.fromTag("colgroup");return k(e,(()=>ao(t,Me.fromTag("col")))),t})(t));const c=Math.min(e,o);if(a&&o>0){const e=Me.fromTag("thead");ao(l,e);const s=ei(o,t,"sectionCells"===r?c:0,n);mo(e,s)}const i=Me.fromTag("tbody");ao(l,i);const m=ei(a?e-c:e,t,a?0:o,n);return mo(i,m),l})(o,t,s,n,Di(e),a);fo(r,"data-mce-id","__mce");const l=(e=>{const t=Me.fromTag("div"),o=Me.fromDom(e.dom.cloneNode(!0));return ao(t,o),(e=>e.dom.innerHTML)(t)})(r);e.insertContent(l),e.addVisual()})),ln(Pi(e),'table[data-mce-id="__mce"]').map((t=>(_i(e)?la(t):zi(e)?aa(t):(Bi(e)||(e=>r(e)&&-1!==e.indexOf("%"))(l.width))&&sa(t),Fi(t),bo(t,"data-mce-id"),((e,t)=>{N(vn(t,"tr"),(t=>{fd(e,t.dom),N(vn(t,"th,td"),(t=>{gd(e,t.dom)}))}))})(e,t),((e,t)=>{ln(t,"td,th").each(b(xd,e))})(e,t),t.dom))).getOrNull()};var Sd=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const Td="x-tinymce/dom-table-",Rd=Td+"rows",Dd=Td+"columns",Od=e=>{const t=Sd.FakeClipboardItem(e);Sd.write([t])},kd=e=>{const t=Sd.read()??[];return V(t,(t=>C.from(t.getType(e))))},Ed=e=>{kd(e).isSome()&&Sd.clear()},Nd=e=>{e.fold(_d,(e=>Od({[Rd]:e})))},Bd=()=>kd(Rd),_d=()=>Ed(Rd),zd=e=>{e.fold(Ld,(e=>Od({[Dd]:e})))},Ad=()=>kd(Dd),Ld=()=>Ed(Dd),Md=e=>id(Hi(e),Ii(e)).filter(Ki),Wd=(e,t)=>{const o=Ii(e),n=e=>ir(e,o),l=t=>(e=>md(Hi(e),Ii(e)).filter(Ki))(e).bind((e=>n(e).map((o=>t(o,e))))),a=t=>{e.focus()},c=(t,o=!1)=>l(((n,r)=>{const s=ad(dd(e),n,r);t(n,s,o).each(a)})),i=()=>l(((t,o)=>((e,t,o)=>{const n=Dr(e);return Ys(n,t).bind((e=>{const t=Hs(n,o,!1),r=ze(t).rows.slice(e[0].row,e[e.length-1].row+e[e.length-1].rowspan),s=j(r,(e=>{const t=_(e.cells,(e=>!e.isLocked));return t.length>0?[{...e,cells:t}]:[]})),l=$s(s);return de(l.length>0,l)})).map((e=>E(e,(e=>{const t=So(e.element);return N(e.cells,(e=>{const o=To(e.element);Ws(o,"colspan",e.colspan,1),Ws(o,"rowspan",e.rowspan,1),ao(t,o)})),t}))))})(t,ad(dd(e),t,o),ha(f,Me.fromDom(e.getDoc()),C.none())))),m=()=>l(((t,o)=>((e,t)=>{const o=Dr(e);return Js(o,t).map((e=>{const t=e[e.length-1],n=e[0].column,r=t.column+t.colspan,s=((e,t,o)=>{if(zr(e)){const n=_(_r(e),ll(t,o)),r=E(n,(e=>{const n=To(e.element);return sl(n,"span",o-t),n})),s=Me.fromTag("colgroup");return mo(s,r),[s]}return[]})(o,n,r),l=((e,t,o)=>E(e.all,(e=>{const n=_(e.cells,ll(t,o)),r=E(n,(e=>{const n=To(e.element);return sl(n,"colspan",o-t),n})),s=Me.fromTag("tr");return mo(s,r),s})))(o,n,r);return[...s,...l]}))})(t,ad(dd(e),t,o)))),d=(t,o)=>o().each((o=>{const n=E(o,(e=>To(e)));l(((o,r)=>{const s=pa(Me.fromDom(e.getDoc())),l=((e,t,o,n)=>({selection:om(e),clipboard:o,generators:n}))(dd(e),0,n,s);t(o,l).each(a)}))})),g=e=>(t,o)=>((e,t)=>X(e,t)?C.from(e[t]):C.none())(o,"type").each((t=>{c(e(t),o.no_events)}));G({mceTableSplitCells:()=>c(t.unmergeCells),mceTableMergeCells:()=>c(t.mergeCells),mceTableInsertRowBefore:()=>c(t.insertRowsBefore),mceTableInsertRowAfter:()=>c(t.insertRowsAfter),mceTableInsertColBefore:()=>c(t.insertColumnsBefore),mceTableInsertColAfter:()=>c(t.insertColumnsAfter),mceTableDeleteCol:()=>c(t.deleteColumn),mceTableDeleteRow:()=>c(t.deleteRow),mceTableCutCol:()=>m().each((e=>{zd(e),c(t.deleteColumn)})),mceTableCutRow:()=>i().each((e=>{Nd(e),c(t.deleteRow)})),mceTableCopyCol:()=>m().each((e=>zd(e))),mceTableCopyRow:()=>i().each((e=>Nd(e))),mceTablePasteColBefore:()=>d(t.pasteColsBefore,Ad),mceTablePasteColAfter:()=>d(t.pasteColsAfter,Ad),mceTablePasteRowBefore:()=>d(t.pasteRowsBefore,Bd),mceTablePasteRowAfter:()=>d(t.pasteRowsAfter,Bd),mceTableDelete:()=>Md(e).each((t=>{ir(t,o).filter(w(o)).each((t=>{const o=Me.fromText("");if(so(t,o),yo(t),e.dom.isEmpty(e.getBody()))e.setContent(""),e.selection.setCursorLocation();else{const t=e.dom.createRng();t.setStart(o.dom,0),t.setEnd(o.dom,0),e.selection.setRng(t),e.nodeChanged()}}))})),mceTableCellToggleClass:(t,o)=>{l((t=>{const n=dd(e),r=P(n,(t=>e.formatter.match("tablecellclass",{value:o},t.dom))),s=r?e.formatter.remove:e.formatter.apply;N(n,(e=>s("tablecellclass",{value:o},e.dom))),hd(e,t.dom,pd)}))},mceTableToggleClass:(t,o)=>{l((t=>{e.formatter.toggle("tableclass",{value:o},t.dom),hd(e,t.dom,pd)}))},mceTableToggleCaption:()=>{Md(e).each((t=>{ir(t,o).each((o=>{sn(o,"caption").fold((()=>{const t=Me.fromTag("caption");ao(t,Me.fromText("Caption")),((e,t)=>{Yt(e,0).fold((()=>{ao(e,t)}),(e=>{ro(e,t)}))})(o,t),e.selection.setCursorLocation(t.dom,0)}),(n=>{It("caption")(t)&&Ye("td",o).each((t=>e.selection.setCursorLocation(t.dom,0))),yo(n)})),hd(e,o.dom,bd)}))}))},mceTableSizingMode:(t,n)=>(t=>Md(e).each((n=>{zi(e)||_i(e)||Bi(e)||ir(n,o).each((o=>{"relative"!==t||Rl(o)?"fixed"!==t||Dl(o)?"responsive"!==t||Ol(o)||aa(o):la(o):sa(o),Fi(o),hd(e,o.dom,bd)}))})))(n),mceTableCellType:g((e=>"th"===e?t.makeCellsHeader:t.unmakeCellsHeader)),mceTableColType:g((e=>"th"===e?t.makeColumnsHeader:t.unmakeColumnsHeader)),mceTableRowType:g((e=>{switch(e){case"header":return t.makeRowsHeader;case"footer":return t.makeRowsFooter;default:return t.makeRowsBody}}))},((t,o)=>e.addCommand(o,t))),e.addCommand("mceInsertTable",((t,o)=>{((e,t,o,n={})=>{const r=e=>u(e)&&e>0;if(r(t)&&r(o)){const r=n.headerRows||0,s=n.headerColumns||0;return Cd(e,o,t,s,r)}console.error("Invalid values for mceInsertTable - rows and columns values are required to insert a table.")})(e,o.rows,o.columns,o.options)})),e.addCommand("mceTableApplyCellStyle",((t,o)=>{const l=e=>"tablecell"+e.toLowerCase().replace("-","");if(!s(o))return;const a=_(dd(e),Ki);if(0===a.length)return;const c=((e,t)=>{const o={};return((e,t,o,n)=>{G(e,((e,r)=>{(t(e,r)?o:n)(e,r)}))})(e,t,(e=>(t,o)=>{e[o]=t})(o),f),o})(o,((t,o)=>e.formatter.has(l(o))&&r(t)));(e=>{for(const t in e)if(U.call(e,t))return!1;return!0})(c)||(G(c,((t,o)=>{const n=l(o);N(a,(o=>{""===t?e.formatter.remove(n,{value:null},o.dom,!0):e.formatter.apply(n,{value:t},o.dom)}))})),n(a[0]).each((t=>hd(e,t.dom,pd))))}))},jd=e=>!un(Me.fromDom(e.target),"ephox-snooker-resizer-bar"),Pd=(e,t)=>{const o=(r=ld.selectedSelector,{get:()=>em(Me.fromDom(e.getBody()),r).fold((()=>md(Hi(e),Ii(e)).fold(lm,cm)),am)}),n=((e,t,o)=>{const n=t=>{bo(t,e.selected),bo(t,e.firstSelected),bo(t,e.lastSelected)},r=t=>{fo(t,e.selected,"1")},s=e=>{l(e),o()},l=t=>{const o=vn(t,`${e.selectedSelector},${e.firstSelectedSelector},${e.lastSelectedSelector}`);N(o,n)};return{clearBeforeUpdate:l,clear:s,selectRange:(o,n,l,a)=>{s(o),N(n,r),fo(l,e.firstSelected,"1"),fo(a,e.lastSelected,"1"),t(n,l,a)},selectedSelector:e.selectedSelector,firstSelectedSelector:e.firstSelectedSelector,lastSelectedSelector:e.lastSelectedSelector}})(ld,((t,o,n)=>{ir(o).each((r=>{const s=E(t,(e=>e.dom)),l=Ri(e),a=ha(f,Me.fromDom(e.getDoc()),l),c=((e,t,o)=>{const n=Dr(e);return Ys(n,t).map((e=>{const t=Hs(n,o,!1),{rows:r}=ze(t),s=((e,t)=>{const o=e.slice(0,t[t.length-1].row+1),n=$s(o);return j(n,(e=>{const o=e.cells.slice(0,t[t.length-1].column+1);return E(o,(e=>e.element))}))})(r,e),l=((e,t)=>{const o=e.slice(t[0].row+t[0].rowspan-1,e.length),n=$s(o);return j(n,(e=>{const o=e.cells.slice(t[0].column+t[0].colspan-1,e.cells.length);return E(o,(e=>e.element))}))})(r,e);return{upOrLeftCells:s,downOrRightCells:l}}))})(r,{selection:dd(e)},a).map((e=>K(e,(e=>E(e,(e=>e.dom)))))).getOrUndefined();((e,t,o,n,r)=>{e.dispatch("TableSelectionChange",{cells:t,start:o,finish:n,otherCells:r})})(e,s,o.dom,n.dom,c)}))}),(()=>(e=>{e.dispatch("TableSelectionClear")})(e)));var r;return e.on("init",(o=>{const r=e.getWin(),s=Pi(e),l=Ii(e),a=((e,t,o,n)=>{const r=((e,t,o,n)=>{const r=fe(),s=r.clear,l=s=>{r.on((r=>{n.clearBeforeUpdate(t),Hm(s.target,o).each((l=>{Ji(r,l,o).each((o=>{const r=o.boxes.getOr([]);if(1===r.length){const e=r[0],o="false"===hn(e),l=ie(fn(s.target),e,Je);o&&l&&n.selectRange(t,r,e,e)}else r.length>1&&(n.selectRange(t,r,o.start,o.finish),e.selectContents(l))}))}))}))};return{clearstate:s,mousedown:e=>{n.clear(t),Hm(e.target,o).filter($m).each(r.set)},mouseover:e=>{l(e)},mouseup:e=>{l(e),s()}}})(Xm(e),t,o,n);return{clearstate:r.clearstate,mousedown:r.mousedown,mouseover:r.mouseover,mouseup:r.mouseup}})(r,s,l,n),c=((e,t,o,n)=>{const r=Xm(e),s=()=>(n.clear(t),C.none());return{keydown:(e,l,a,c,i,m)=>{const d=e.raw,u=d.which,f=!0===d.shiftKey,g=Qi(t,n.selectedSelector).fold((()=>(Ym(u)&&!f&&n.clearBeforeUpdate(t),Ym(u)&&f&&!td(l,c)?C.none:Km(u)&&f?b(Fm,r,t,o,Vm,c,l,n.selectRange):Gm(u)&&f?b(Fm,r,t,o,qm,c,l,n.selectRange):Km(u)?b(jm,r,o,Vm,c,l,Im):Gm(u)?b(jm,r,o,qm,c,l,Pm):C.none)),(e=>{const o=o=>()=>{const s=V(o,(o=>((e,t,o,n,r)=>Zi(n,e,t,r.firstSelectedSelector,r.lastSelectedSelector).map((e=>(r.clearBeforeUpdate(o),r.selectRange(o,e.boxes,e.start,e.finish),e.boxes))))(o.rows,o.cols,t,e,n)));return s.fold((()=>Xi(t,n.firstSelectedSelector,n.lastSelectedSelector).map((e=>{const o=Km(u)||m.isForward(u)?kn.after:kn.before;return r.setRelativeSelection(kn.on(e.first,0),o(e.table)),n.clear(t),sm(C.none(),!0)}))),(e=>C.some(sm(C.none(),!0))))};return Ym(u)&&f&&!td(l,c)?C.none:Km(u)&&f?o([Zm(1,0)]):Gm(u)&&f?o([Zm(-1,0)]):m.isBackward(u)&&f?o([Zm(0,-1),Zm(-1,0)]):m.isForward(u)&&f?o([Zm(0,1),Zm(1,0)]):Ym(u)&&!f?s:C.none}));return g()},keyup:(e,r,s,l,a)=>Qi(t,n.selectedSelector).fold((()=>{const c=e.raw,i=c.which;return!0===c.shiftKey&&Ym(i)&&td(r,l)?((e,t,o,n,r,s,l)=>Je(o,r)&&n===s?C.none():an(o,"td,th",t).bind((o=>an(r,"td,th",t).bind((n=>um(e,t,o,n,l))))))(t,o,r,s,l,a,n.selectRange):C.none()}),C.none)}})(r,s,l,n),i=((e,t,o,n)=>{const r=Xm(e);return(e,s)=>{n.clearBeforeUpdate(t),Ji(e,s,o).each((e=>{const o=e.boxes.getOr([]);n.selectRange(t,o,e.start,e.finish),r.selectContents(s),r.collapseSelection()}))}})(r,s,l,n);e.on("TableSelectorChange",(e=>i(e.start,e.finish)));const m=(t,o)=>{(e=>!0===e.raw.shiftKey)(t)&&(o.kill&&t.kill(),o.selection.each((t=>{const o=Nn.relative(t.start,t.finish),n=Ue(r,o);e.selection.setRng(n)})))},d=e=>0===e.button,u=(()=>{const e=ee(Me.fromDom(s)),t=ee(0);return{touchEnd:o=>{const n=Me.fromDom(o.target);if(It("td")(n)||It("th")(n)){const r=e.get(),s=t.get();Je(r,n)&&o.timeStamp-s<300&&(o.preventDefault(),i(n,n))}e.set(n),t.set(o.timeStamp)}}})();e.on("dragstart",(e=>{a.clearstate()})),e.on("mousedown",(e=>{d(e)&&jd(e)&&a.mousedown(no(e))})),e.on("mouseover",(e=>{var t;(void 0===(t=e).buttons||1&t.buttons)&&jd(e)&&a.mouseover(no(e))})),e.on("mouseup",(e=>{d(e)&&jd(e)&&a.mouseup(no(e))})),e.on("touchend",u.touchEnd),e.on("keyup",(t=>{const o=no(t);if(o.raw.shiftKey&&Ym(o.raw.which)){const t=e.selection.getRng(),n=Me.fromDom(t.startContainer),r=Me.fromDom(t.endContainer);c.keyup(o,n,t.startOffset,r,t.endOffset).each((e=>{m(o,e)}))}})),e.on("keydown",(o=>{const n=no(o);t.hide();const r=e.selection.getRng(),s=Me.fromDom(r.startContainer),l=Me.fromDom(r.endContainer),a=Zo(Jm,Qm)(Me.fromDom(e.selection.getStart()));c.keydown(n,s,r.startOffset,l,r.endOffset,a).each((e=>{m(n,e)})),t.show()})),e.on("NodeChange",(()=>{const t=e.selection,o=Me.fromDom(t.getStart()),r=Me.fromDom(t.getEnd());Zl(ir,[o,r]).fold((()=>n.clear(s)),f)}))})),e.on("PreInit",(()=>{e.serializer.addTempAttr(ld.firstSelected),e.serializer.addTempAttr(ld.lastSelected)})),{getSelectedCells:()=>((e,t)=>{switch(e.tag){case"none":return t();case"single":return(e=>[e.dom])(e.element);case"multiple":return(e=>E(e,(e=>e.dom)))(e.elements)}})(o.get(),g([])),clearSelectedCells:e=>n.clear(Me.fromDom(e))}},Id=e=>m(e)&&"TABLE"===e.nodeName,Fd="bar-",Hd=e=>"false"!==ho(e,"data-mce-resize"),$d=e=>{const t=fe(),o=fe(),n=fe();let r,s,l,a;const c=t=>vd(e,t),i=()=>ki(e)?Qn():Jn(),m=(t,o,n,m)=>{const d=(e=>{return pe(t=e,"corner-")?(e=>e.substring(7))(t):t;var t})(o),u=be(d,"e"),f=pe(d,"n");if(""===s&&sa(t),""===a&&(e=>{const t=(e=>jo(e)+"px")(e);Tl(e,C.none(),C.some(t)),ra(e)})(t),n!==r&&""!==s){Eo(t,"width",s);const o=i(),l=c(t),a=ki(e)||u?(e=>ba(e).columns)(t)-1:0;ol(t,n-r,a,o,l)}else if((e=>/^(\d+(\.\d+)?)%$/.test(e))(s)){const e=parseFloat(s.replace("%",""));Eo(t,"width",n*e/r+"%")}if((e=>/^(\d+(\.\d+)?)px$/.test(e))(s)&&(e=>{const t=Dr(e);zr(t)||N(ar(e),(e=>{const t=Bo(e,"width");Eo(e,"width",t),bo(e,"width")}))})(t),m!==l&&""!==a){Eo(t,"height",a);const e=f?0:(e=>ba(e).rows)(t)-1;nl(t,m-l,e)}};e.on("init",(()=>{const r=((e,t)=>((e,t)=>({parent:g(e),view:g(e),dragContainer:g(e),origin:()=>Go(e),isResizable:t}))(Me.fromDom(e.getBody()),t))(e,Hd);if(n.set(r),(e=>{const t=e.options.get("object_resizing");return D(t.split(","),"table")})(e)&&Ai(e)){const n=((e,t,o)=>{const n=ns,r=ss,s=xi(e),l=oi({beforeResize:ti(["table","type"]),afterResize:ti(["table","type"]),startDrag:ti([])});return s.events.adjustHeight.bind((e=>{const t=e.table;l.trigger.beforeResize(t,"row");const o=n.delta(e.delta,t);nl(t,o,e.row),l.trigger.afterResize(t,"row")})),s.events.startAdjust.bind((e=>{l.trigger.startDrag()})),s.events.adjustWidth.bind((e=>{const n=e.table;l.trigger.beforeResize(n,"col");const s=r.delta(e.delta,n),a=o(n);ol(n,s,e.column,t,a),l.trigger.afterResize(n,"col")})),{on:s.on,off:s.off,refreshBars:s.refresh,hideBars:s.hideBars,showBars:s.showBars,destroy:s.destroy,events:l.registry}})(r,i(),c);e.mode.isReadOnly()||n.on(),n.events.startDrag.bind((o=>{t.set(e.selection.getRng())})),n.events.beforeResize.bind((t=>{const o=t.table.dom;((e,t,o,n,r)=>{e.dispatch("ObjectResizeStart",{target:t,width:o,height:n,origin:r})})(e,o,$i(o),Vi(o),Fd+t.type)})),n.events.afterResize.bind((o=>{const n=o.table,r=n.dom;Fi(n),t.on((t=>{e.selection.setRng(t),e.focus()})),((e,t,o,n,r)=>{e.dispatch("ObjectResized",{target:t,width:o,height:n,origin:r})})(e,r,$i(r),Vi(r),Fd+o.type),e.undoManager.add()})),o.set(n)}})),e.on("ObjectResizeStart",(t=>{const o=t.target;if(Id(o)&&!e.mode.isReadOnly()){const n=Me.fromDom(o);N(e.dom.select(".mce-clonedresizable"),(t=>{e.dom.addClass(t,"mce-"+Oi(e)+"-columns")})),!Dl(n)&&_i(e)?la(n):!Rl(n)&&Bi(e)&&sa(n),Ol(n)&&pe(t.origin,Fd)&&sa(n),r=t.width,s=zi(e)?"":Ui(e,o).getOr(""),l=t.height,a=Gi(e,o).getOr("")}})),e.on("ObjectResized",(t=>{const o=t.target;if(Id(o)){const n=Me.fromDom(o),r=t.origin;(e=>pe(e,"corner-"))(r)&&m(n,r,t.width,t.height),Fi(n),hd(e,n.dom,pd)}}));const d=()=>{o.on((e=>{e.on(),e.showBars()}))},u=()=>{o.on((e=>{e.off(),e.hideBars()}))};return e.on("DisabledStateChange",(e=>{e.state?u():d()})),e.on("SwitchMode",(()=>{e.mode.isReadOnly()?u():d()})),e.on("dragstart dragend",(e=>{"dragstart"===e.type?u():d()})),e.on("remove",(()=>{o.on((e=>{e.destroy()}))})),{refresh:e=>{o.on((t=>t.refreshBars(Me.fromDom(e))))},hide:()=>{o.on((e=>e.hideBars()))},show:()=>{o.on((e=>e.showBars()))}}},Vd=e=>{(e=>{const t=e.options.register;t("table_clone_elements",{processor:"string[]"}),t("table_use_colgroups",{processor:"boolean",default:!0}),t("table_header_type",{processor:e=>{const t=D(["section","cells","sectionCells","auto"],e);return t?{value:e,valid:t}:{valid:!1,message:"Must be one of: section, cells, sectionCells or auto."}},default:"section"}),t("table_sizing_mode",{processor:"string",default:"auto"}),t("table_default_attributes",{processor:"object",default:{border:"1"}}),t("table_default_styles",{processor:"object",default:{"border-collapse":"collapse"}}),t("table_column_resizing",{processor:e=>{const t=D(["preservetable","resizetable"],e);return t?{value:e,valid:t}:{valid:!1,message:"Must be preservetable, or resizetable."}},default:"preservetable"}),t("table_resize_bars",{processor:"boolean",default:!0}),t("table_style_by_css",{processor:"boolean",default:!0}),t("table_merge_content_on_paste",{processor:"boolean",default:!0})})(e);const t=$d(e),o=Pd(e,t),n=yd(e,t,o);return Wd(e,n),((e,t)=>{const o=Ii(e),n=t=>md(Hi(e)).bind((n=>ir(n,o).map((o=>{const r=ad(dd(e),o,n);return t(o,r)})))).getOr("");G({mceTableRowType:()=>n(t.getTableRowType),mceTableCellType:()=>n(t.getTableCellType),mceTableColType:()=>n(t.getTableColType)},((t,o)=>e.addQueryValueHandler(o,t)))})(e,n),ud(e,n),{getSelectedCells:o.getSelectedCells,clearSelectedCells:o.clearSelectedCells}};e.add("dom",(e=>({table:Vd(e)})))}(); \ No newline at end of file +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.ModelManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=n=e,(r=String).prototype.isPrototypeOf(o)||n.constructor?.name===r.name)?"string":t;var o,n,r})(t)===e,o=e=>t=>typeof t===e,n=e=>t=>e===t,r=t("string"),s=t("object"),l=t("array"),a=n(null),c=o("boolean"),i=n(void 0),m=e=>!(e=>null==e)(e),d=o("function"),u=o("number"),f=()=>{},g=e=>()=>e,h=e=>e,p=(e,t)=>e===t;function b(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const w=e=>t=>!e(t),v=e=>e(),y=g(!1),x=g(!0);class C{tag;value;static singletonNone=new C(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new C(!0,e)}static none(){return C.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?C.some(e(this.value)):C.none()}bind(e){return this.tag?e(this.value):C.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:C.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(e??"Called getOrDie on None")}static from(e){return m(e)?C.some(e):C.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}const T=Array.prototype.slice,S=Array.prototype.indexOf,R=Array.prototype.push,D=(e,t)=>{return o=e,n=t,S.call(o,n)>-1;var o,n},O=(e,t)=>{for(let o=0,n=e.length;o{const o=[];for(let n=0;n{const o=e.length,n=new Array(o);for(let r=0;r{for(let o=0,n=e.length;o{const o=[],n=[];for(let r=0,s=e.length;r{const o=[];for(let n=0,r=e.length;n(((e,t)=>{for(let o=e.length-1;o>=0;o--)t(e[o],o)})(e,(e,n)=>{o=t(o,e,n)}),o),A=(e,t,o)=>(_(e,(e,n)=>{o=t(o,e,n)}),o),L=(e,t)=>((e,t,o)=>{for(let n=0,r=e.length;n{for(let o=0,n=e.length;o{const t=[];for(let o=0,n=e.length;oW(E(e,t)),P=(e,t)=>{for(let o=0,n=e.length;o{const o={};for(let n=0,r=e.length;nt>=0&&tF(e,0),$=e=>F(e,e.length-1),V=(e,t)=>{for(let o=0;o{const o=q(e);for(let n=0,r=o.length;nY(e,(e,o)=>({k:o,v:t(e,o)})),Y=(e,t)=>{const o={};return G(e,(e,n)=>{const r=t(e,n);o[r.k]=r.v}),o},J=(e,t)=>{const o=[];return G(e,(e,n)=>{o.push(t(e,n))}),o},Q=e=>J(e,h),X=(e,t)=>U.call(e,t),Z=e=>{if(!l(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");const t=[],o={};return _(e,(n,r)=>{const s=q(n);if(1!==s.length)throw new Error("one and only one name per case");const a=s[0],c=n[a];if(void 0!==o[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!l(c))throw new Error("case arguments must be an array");t.push(a),o[a]=(...o)=>{const n=o.length;if(n!==c.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+c.length+" ("+c+"), got "+n);return{fold:(...t)=>{if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);return t[r].apply(null,o)},match:e=>{const n=q(e);if(t.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","));if(!P(t,e=>D(n,e)))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "));return e[a].apply(null,o)},log:e=>{console.log(e,{constructors:t,constructor:a,params:o})}}}}),o},ee=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}},te=e=>e.slice(0).sort(),oe=(e,t)=>{const o=B(t,t=>!D(e,t));o.length>0&&(e=>{throw new Error("Unsupported keys for object: "+te(e).join(", "))})(o)},ne=e=>((e,t)=>((e,t,o)=>{if(0===t.length)throw new Error("You must specify at least one required field.");return((e,t)=>{if(!l(t))throw new Error("The "+e+" fields must be an array. Was: "+t+".");_(t,t=>{if(!r(t))throw new Error("The value "+t+" in the "+e+" fields was not a string.")})})("required",t),(e=>{const t=te(e);L(t,(e,o)=>o{throw new Error("The field: "+e+" occurs more than once in the combined fields: ["+t.join(", ")+"].")})})(t),n=>{const r=q(n);P(t,e=>D(r,e))||((e,t)=>{throw new Error("All required keys ("+te(e).join(", ")+") were not specified. Specified keys were: "+te(t).join(", ")+".")})(t,r),e(t,r);const s=B(t,e=>!o.validate(n[e],e));return s.length>0&&((e,t)=>{throw new Error("All values need to be of type: "+t+". Keys ("+te(e).join(", ")+") were not.")})(s,o.label),n}})(e,t,{validate:d,label:"function"}))(oe,e),re=e=>{const t=t=>t(e),o=g(e),n=()=>r,r={tag:!0,inner:e,fold:(t,o)=>o(e),isValue:x,isError:y,map:t=>le.value(t(e)),mapError:n,bind:t,exists:t,forall:t,getOr:o,or:n,getOrThunk:o,orThunk:n,getOrDie:o,each:t=>{t(e)},toOptional:()=>C.some(e)};return r},se=e=>{const t=()=>o,o={tag:!1,inner:e,fold:(t,o)=>t(e),isValue:y,isError:x,map:t,mapError:t=>le.error(t(e)),bind:t,exists:y,forall:x,getOr:h,or:h,getOrThunk:v,orThunk:v,getOrDie:(n=String(e),()=>{throw new Error(n)}),each:f,toOptional:C.none};var n;return o},le={value:re,error:se,fromOption:(e,t)=>e.fold(()=>se(t),re)},ae="undefined"!=typeof window?window:Function("return this;")(),ce=e=>{const t=e.replace(/\./g,"-");return{resolve:e=>t+"-"+e}},ie=(e,t,o=p)=>e.exists(e=>o(e,t)),me=e=>{const t=[],o=e=>{t.push(e)};for(let t=0;te?C.some(t):C.none(),ue=(e,t)=>((e,t)=>{let o=null!=t?t:ae;for(let t=0;t{const e=(e=>{const t=ee(C.none()),o=()=>t.get().each(e);return{clear:()=>{o(),t.set(C.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{o(),t.set(C.some(e))}}})(f);return{...e,on:t=>e.get().each(t)}},ge=(e,t,o)=>""===t||e.length>=t.length&&e.substr(o,o+t.length)===t,he=(e,t,o=0,n)=>{const r=e.indexOf(t,o);return-1!==r&&(!!i(n)||r+t.length<=n)},pe=(e,t)=>ge(e,t,0),be=(e,t)=>ge(e,t,e.length-t.length),we=(e=>t=>t.replace(e,""))(/^\s+|\s+$/g),ve=e=>e.length>0,ye=e=>{let t,o=!1;return(...n)=>(o||(o=!0,t=e.apply(null,n)),t)},xe=["tfoot","thead","tbody","colgroup"],Ce=(e,t,o)=>({element:e,rowspan:t,colspan:o}),Te=(e,t,o)=>({element:e,cells:t,section:o}),Se=(e,t,o)=>({element:e,isNew:t,isLocked:o}),Re=(e,t,o,n)=>({element:e,cells:t,section:o,isNew:n}),De=(e,t,o)=>{const n=e.cells,r=n.slice(0,t),s=n.slice(t),l=r.concat(o).concat(s);return Ee(e,l)},Oe=(e,t,o)=>De(e,t,[o]),ke=(e,t,o)=>{e.cells[t]=o},Ee=(e,t)=>Re(e.element,t,e.section,e.isNew),_e=(e,t)=>e.cells[t],Ne=(e,t)=>_e(e,t).element,Be=e=>e.cells.length,ze=e=>{const t=N(e,e=>"colgroup"===e.section);return{rows:t.fail,cols:t.pass}},Ae=(e,t,o)=>{const n=E(e.cells,o);return Re(t(e.element),n,e.section,!0)},Le=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},Me={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return Le(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return Le(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return Le(o)},fromDom:Le,fromPoint:(e,t,o)=>C.from(e.dom.elementFromPoint(t,o)).map(Le)},We=(e,t)=>{const o=e.document.createRange();return o.selectNode(t.dom),o},je=(e,t)=>{const o=e.document.createRange();return Pe(o,t),o},Pe=(e,t)=>e.selectNodeContents(t.dom),Ie=(e,t,o)=>{const n=e.document.createRange();var r;return r=n,t.fold(e=>{r.setStartBefore(e.dom)},(e,t)=>{r.setStart(e.dom,t)},e=>{r.setStartAfter(e.dom)}),((e,t)=>{t.fold(t=>{e.setEndBefore(t.dom)},(t,o)=>{e.setEnd(t.dom,o)},t=>{e.setEndAfter(t.dom)})})(n,o),n},Fe=(e,t,o,n,r)=>{const s=e.document.createRange();return s.setStart(t.dom,o),s.setEnd(n.dom,r),s},He=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}),$e=Z([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Ve=(e,t,o)=>t(Me.fromDom(o.startContainer),o.startOffset,Me.fromDom(o.endContainer),o.endOffset),qe=(e,t)=>{const o=((e,t)=>t.match({domRange:e=>({ltr:g(e),rtl:C.none}),relative:(t,o)=>({ltr:ye(()=>Ie(e,t,o)),rtl:ye(()=>C.some(Ie(e,o,t)))}),exact:(t,o,n,r)=>({ltr:ye(()=>Fe(e,t,o,n,r)),rtl:ye(()=>C.some(Fe(e,n,r,t,o)))})}))(e,t);return((e,t)=>{const o=t.ltr();return o.collapsed?t.rtl().filter(e=>!1===e.collapsed).map(e=>$e.rtl(Me.fromDom(e.endContainer),e.endOffset,Me.fromDom(e.startContainer),e.startOffset)).getOrThunk(()=>Ve(0,$e.ltr,o)):Ve(0,$e.ltr,o)})(0,o)},Ue=(e,t)=>qe(e,t).match({ltr:(t,o,n,r)=>{const s=e.document.createRange();return s.setStart(t.dom,o),s.setEnd(n.dom,r),s},rtl:(t,o,n,r)=>{const s=e.document.createRange();return s.setStart(n.dom,r),s.setEnd(t.dom,o),s}});$e.ltr,$e.rtl;const Ge=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},Ke=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,Ye=(e,t)=>{const o=void 0===t?document:t.dom;return Ke(o)?C.none():C.from(o.querySelector(e)).map(Me.fromDom)},Je=(e,t)=>e.dom===t.dom,Qe=(e,t)=>{const o=e.dom,n=t.dom;return o!==n&&o.contains(n)},Xe=Ge,Ze=()=>et(0,0),et=(e,t)=>({major:e,minor:t}),tt={nu:et,detect:(e,t)=>{const o=String(t).toLowerCase();return 0===e.length?Ze():((e,t)=>{const o=((e,t)=>{for(let o=0;oNumber(t.replace(o,"$"+e));return et(n(1),n(2))})(e,o)},unknown:Ze},ot=(e,t)=>{const o=String(t).toLowerCase();return L(e,e=>e.search(o))},nt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,rt=e=>t=>he(t,e),st=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>he(e,"edge/")&&he(e,"chrome")&&he(e,"safari")&&he(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,nt],search:e=>he(e,"chrome")&&!he(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>he(e,"msie")||he(e,"trident")},{name:"Opera",versionRegexes:[nt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:rt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:rt("firefox")},{name:"Safari",versionRegexes:[nt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(he(e,"safari")||he(e,"mobile/"))&&he(e,"applewebkit")}],lt=[{name:"Windows",search:rt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>he(e,"iphone")||he(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:rt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:rt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:rt("linux"),versionRegexes:[]},{name:"Solaris",search:rt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:rt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:rt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],at={browsers:g(st),oses:g(lt)},ct="Edge",it="Chromium",mt="Opera",dt="Firefox",ut="Safari",ft=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isEdge:n(ct),isChromium:n(it),isIE:n("IE"),isOpera:n(mt),isFirefox:n(dt),isSafari:n(ut)}},gt=()=>ft({current:void 0,version:tt.unknown()}),ht=ft,pt=(g(ct),g(it),g("IE"),g(mt),g(dt),g(ut),"Windows"),bt="Android",wt="Linux",vt="macOS",yt="Solaris",xt="FreeBSD",Ct="ChromeOS",Tt=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isWindows:n(pt),isiOS:n("iOS"),isAndroid:n(bt),isMacOS:n(vt),isLinux:n(wt),isSolaris:n(yt),isFreeBSD:n(xt),isChromeOS:n(Ct)}},St=()=>Tt({current:void 0,version:tt.unknown()}),Rt=Tt,Dt=(g(pt),g("iOS"),g(bt),g(wt),g(vt),g(yt),g(xt),g(Ct),e=>window.matchMedia(e).matches);let Ot=ye(()=>((e,t,o)=>{const n=at.browsers(),r=at.oses(),s=t.bind(e=>((e,t)=>V(t.brands,t=>{const o=t.brand.toLowerCase();return L(e,e=>o===e.brand?.toLowerCase()).map(e=>({current:e.name,version:tt.nu(parseInt(t.version,10),0)}))}))(n,e)).orThunk(()=>((e,t)=>ot(e,t).map(e=>{const o=tt.detect(e.versionRegexes,t);return{current:e.name,version:o}}))(n,e)).fold(gt,ht),l=((e,t)=>ot(e,t).map(e=>{const o=tt.detect(e.versionRegexes,t);return{current:e.name,version:o}}))(r,e).fold(St,Rt),a=((e,t,o,n)=>{const r=e.isiOS()&&!0===/ipad/i.test(o),s=e.isiOS()&&!r,l=e.isiOS()||e.isAndroid(),a=l||n("(pointer:coarse)"),c=r||!s&&l&&n("(min-device-width:768px)"),i=s||l&&!c,m=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(o),d=!i&&!c&&!m;return{isiPad:g(r),isiPhone:g(s),isTablet:g(c),isPhone:g(i),isTouch:g(a),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:g(m),isDesktop:g(d)}})(l,s,e,o);return{browser:s,os:l,deviceType:a}})(window.navigator.userAgent,C.from(window.navigator.userAgentData),Dt));const kt=()=>Ot(),Et=Object.getPrototypeOf,_t=e=>{const t=ue("ownerDocument.defaultView",e);return s(e)&&((e=>((e,t)=>{const o=((e,t)=>ue(e,t))(e,t);if(null==o)throw new Error(e+" not available on this browser");return o})("HTMLElement",e))(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(Et(e).constructor.name))},Nt=e=>e.dom.nodeName.toLowerCase(),Bt=e=>e.dom.nodeType,zt=e=>t=>Bt(t)===e,At=e=>8===Bt(e)||"#comment"===Nt(e),Lt=e=>Mt(e)&&_t(e.dom),Mt=zt(1),Wt=zt(3),jt=zt(9),Pt=zt(11),It=e=>t=>Mt(t)&&Nt(t)===e,Ft=e=>Me.fromDom(e.dom.ownerDocument),Ht=e=>jt(e)?e:Ft(e),$t=e=>C.from(e.dom.parentNode).map(Me.fromDom),Vt=e=>C.from(e.dom.parentElement).map(Me.fromDom),qt=(e,t)=>{const o=d(t)?t:y;let n=e.dom;const r=[];for(;null!==n.parentNode&&void 0!==n.parentNode;){const e=n.parentNode,t=Me.fromDom(e);if(r.push(t),!0===o(t))break;n=e}return r},Ut=e=>C.from(e.dom.previousSibling).map(Me.fromDom),Gt=e=>C.from(e.dom.nextSibling).map(Me.fromDom),Kt=e=>E(e.dom.childNodes,Me.fromDom),Yt=(e,t)=>{const o=e.dom.childNodes;return C.from(o[t]).map(Me.fromDom)},Jt=e=>Pt(e)&&m(e.dom.host),Qt=e=>Me.fromDom(e.dom.getRootNode()),Xt=e=>Me.fromDom(e.dom.host),Zt=e=>{const t=Me.fromDom((e=>{if(m(e.target)){const t=Me.fromDom(e.target);if(Mt(t)&&m(t.dom.shadowRoot)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return H(t)}}return C.from(e.target)})(e).getOr(e.target)),o=()=>e.stopPropagation(),n=()=>e.preventDefault(),r=(s=n,l=o,(...e)=>s(l.apply(null,e)));var s,l;return((e,t,o,n,r,s,l)=>({target:e,x:t,y:o,stop:n,prevent:r,kill:s,raw:l}))(t,e.clientX,e.clientY,o,n,r,e)},eo=(e,t,o,n)=>{e.dom.removeEventListener(t,o,n)},to=x,oo=(e,t,o)=>((e,t,o,n)=>((e,t,o,n,r)=>{const s=((e,t)=>o=>{e(o)&&t(Zt(o))})(o,n);return e.dom.addEventListener(t,s,r),{unbind:b(eo,e,t,s,r)}})(e,t,o,n,!1))(e,t,to,o),no=Zt,ro=(e,t)=>{$t(e).each(o=>{o.dom.insertBefore(t.dom,e.dom)})},so=(e,t)=>{Gt(e).fold(()=>{$t(e).each(e=>{ao(e,t)})},e=>{ro(e,t)})},lo=(e,t)=>{const o=(e=>Yt(e,0))(e);o.fold(()=>{ao(e,t)},o=>{e.dom.insertBefore(t.dom,o.dom)})},ao=(e,t)=>{e.dom.appendChild(t.dom)},co=(e,t)=>{ro(e,t),ao(t,e)},io=(e,t)=>{_(t,(o,n)=>{const r=0===n?e:t[n-1];so(r,o)})},mo=(e,t)=>{_(t,t=>{ao(e,t)})},uo=(e,t,o)=>{if(!(r(o)||c(o)||u(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")},fo=(e,t,o)=>{uo(e.dom,t,o)},go=(e,t)=>{const o=e.dom;G(t,(e,t)=>{uo(o,t,e)})},ho=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},po=(e,t)=>C.from(ho(e,t)),bo=(e,t)=>{e.dom.removeAttribute(t)},wo=e=>A(e.dom.attributes,(e,t)=>(e[t.name]=t.value,e),{}),vo=e=>{e.dom.textContent="",_(Kt(e),e=>{yo(e)})},yo=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},xo=e=>{const t=Kt(e);t.length>0&&io(e,t),yo(e)},Co=(e,t)=>Me.fromDom(e.dom.cloneNode(t)),To=e=>Co(e,!1),So=e=>Co(e,!0),Ro=(e,t)=>{const o=Me.fromTag(t),n=wo(e);return go(o,n),o},Do=e=>void 0!==e.style&&d(e.style.getPropertyValue),Oo=e=>{const t=Wt(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return(e=>{const t=Qt(e);return Jt(t)?C.some(t):C.none()})(Me.fromDom(t)).fold(()=>o.body.contains(t),(n=Oo,r=Xt,e=>n(r(e))));var n,r},ko=(e,t,o)=>{if(!r(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);Do(e)&&e.style.setProperty(t,o)},Eo=(e,t,o)=>{const n=e.dom;ko(n,t,o)},_o=(e,t)=>{const o=e.dom;G(t,(e,t)=>{ko(o,t,e)})},No=(e,t)=>{const o=e.dom,n=window.getComputedStyle(o).getPropertyValue(t);return""!==n||Oo(e)?n:Bo(o,t)},Bo=(e,t)=>Do(e)?e.style.getPropertyValue(t):"",zo=(e,t)=>{const o=e.dom,n=Bo(o,t);return C.from(n).filter(e=>e.length>0)},Ao=(e,t)=>{((e,t)=>{Do(e)&&e.style.removeProperty(t)})(e.dom,t),ie(po(e,"style").map(we),"")&&bo(e,"style")},Lo=(e,t)=>{const o=o=>{const n=t(o);if(n<=0||null===n){const t=No(o,e);return parseFloat(t)||0}return n},n=(e,t)=>A(t,(t,o)=>{const n=No(e,o),r=void 0===n?0:parseInt(n,10);return isNaN(r)?t:t+r},0);return{set:(t,o)=>{if(!u(o)&&!o.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+o);const n=t.dom;Do(n)&&(n.style[e]=o+"px")},get:o,getOuter:o,aggregate:n,max:(e,t,o)=>{const r=n(e,o);return t>r?t-r:0}}},Mo=(e,t,o)=>((e,t)=>(e=>{const t=parseFloat(e);return isNaN(t)?C.none():C.some(t)})(e).getOr(t))(No(e,t),o),Wo=Lo("height",e=>{const t=e.dom;return Oo(e)?t.getBoundingClientRect().height:t.offsetHeight}),jo=e=>Wo.get(e),Po=e=>Wo.getOuter(e),Io=Lo("width",e=>{const t=e.dom;return Oo(e)?t.getBoundingClientRect().width:t.offsetWidth}),Fo=e=>Io.get(e),Ho=e=>Io.getOuter(e),$o=e=>((e,t)=>{const o=e.dom,n=o.getBoundingClientRect().width||o.offsetWidth;return"border-box"===t?n:((e,t,o,n)=>t-Mo(e,`padding-${o}`,0)-Mo(e,`padding-${n}`,0)-Mo(e,`border-${o}-width`,0)-Mo(e,`border-${n}-width`,0))(e,n,"left","right")})(e,"content-box"),Vo=(e,t)=>({left:e,top:t,translate:(o,n)=>Vo(e+o,t+n)}),qo=Vo,Uo=(e,t)=>void 0!==e?e:void 0!==t?t:0,Go=e=>{const t=e.dom.ownerDocument,o=t.body,n=t.defaultView,r=t.documentElement;if(o===e.dom)return qo(o.offsetLeft,o.offsetTop);const s=Uo(n?.pageYOffset,r.scrollTop),l=Uo(n?.pageXOffset,r.scrollLeft),a=Uo(r.clientTop,o.clientTop),c=Uo(r.clientLeft,o.clientLeft);return Ko(e).translate(l-c,s-a)},Ko=e=>{const t=e.dom,o=t.ownerDocument.body;return o===t?qo(o.offsetLeft,o.offsetTop):Oo(e)?(e=>{const t=e.getBoundingClientRect();return qo(t.left,t.top)})(t):qo(0,0)},Yo=(e=>{const t=t=>e(t)?C.from(t.dom.nodeValue):C.none();return{get:o=>{if(!e(o))throw new Error("Can only get text value of a text node");return t(o).getOr("")},getOption:t,set:(t,o)=>{if(!e(t))throw new Error("Can only set raw text value of a text node");t.dom.nodeValue=o}}})(Wt),Jo=e=>Yo.get(e),Qo=e=>Yo.getOption(e),Xo=(e,t)=>Yo.set(e,t),Zo=(e,t)=>o=>"rtl"===en(o)?t:e,en=e=>"rtl"===No(e,"direction")?"rtl":"ltr";var tn=(e,t,o,n,r)=>e(o,n)?C.some(o):d(r)&&r(o)?C.none():t(o,n,r);const on=(e,t,o)=>{let n=e.dom;const r=d(o)?o:y;for(;n.parentNode;){n=n.parentNode;const e=Me.fromDom(n);if(t(e))return C.some(e);if(r(e))break}return C.none()},nn=(e,t,o)=>tn((e,t)=>t(e),on,e,t,o),rn=(e,t,o)=>on(e,e=>Ge(e,t),o),sn=(e,t)=>(e=>L(e.dom.childNodes,e=>{return o=Me.fromDom(e),Ge(o,t);var o}).map(Me.fromDom))(e),ln=(e,t)=>Ye(t,e),an=(e,t,o)=>tn((e,t)=>Ge(e,t),rn,e,t,o),cn=e=>void 0!==e.dom.classList,mn=(e,t)=>((e,t,o)=>{const n=((e,t)=>{const o=ho(e,t);return void 0===o||""===o?[]:o.split(" ")})(e,t).concat([o]);return fo(e,t,n.join(" ")),!0})(e,"class",t),dn=(e,t)=>{cn(e)?e.dom.classList.add(t):mn(e,t)},un=(e,t)=>cn(e)&&e.dom.classList.contains(t),fn=e=>an(e,"[contenteditable]"),gn=(e,t=!1)=>Oo(e)?e.dom.isContentEditable:fn(e).fold(g(t),e=>"true"===hn(e)),hn=e=>e.dom.contentEditable,pn=(e,t)=>{let o=[];return _(Kt(e),e=>{t(e)&&(o=o.concat([e])),o=o.concat(pn(e,t))}),o},bn=(e,t,o)=>((e,o,n)=>B(qt(e,n),e=>Ge(e,t)))(e,0,o),wn=(e,t)=>(e=>B(Kt(e),e=>Ge(e,t)))(e),vn=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return Ke(o)?[]:E(o.querySelectorAll(e),Me.fromDom)})(t,e),yn=e=>"img"===Nt(e)?1:Qo(e).fold(()=>Kt(e).length,e=>e.length),xn=["img","br"],Cn=e=>Qo(e).filter(e=>0!==e.trim().length||e.indexOf("\xa0")>-1).isSome()||D(xn,Nt(e))||(e=>Lt(e)&&"false"===ho(e,"contenteditable"))(e),Tn=e=>((e,t)=>{const o=e=>{for(let n=0;nRn(e,Cn),Rn=(e,t)=>{const o=e=>{const n=Kt(e);for(let e=n.length-1;e>=0;e--){const r=n[e];if(t(r))return C.some(r);const s=o(r);if(s.isSome())return s}return C.none()};return o(e)},Dn=(e,t,o,n)=>({start:e,soffset:t,finish:o,foffset:n}),On=Z([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),kn={before:On.before,on:On.on,after:On.after,cata:(e,t,o,n)=>e.fold(t,o,n),getStart:e=>e.fold(h,h,h)},En=Z([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),_n={domRange:En.domRange,relative:En.relative,exact:En.exact,exactFromRange:e=>En.exact(e.start,e.soffset,e.finish,e.foffset),getWin:e=>{const t=(e=>e.match({domRange:e=>Me.fromDom(e.startContainer),relative:(e,t)=>kn.getStart(e),exact:(e,t,o,n)=>e}))(e);return Me.fromDom(Ht(t).dom.defaultView)},range:Dn},Nn=(e,t)=>{const o=Nt(e);return"input"===o?kn.after(e):D(["br","img"],o)?0===t?kn.before(e):kn.after(e):kn.on(e,t)},Bn=e=>C.from(e.getSelection()),zn=(e,t)=>{Bn(e).each(e=>{e.removeAllRanges(),e.addRange(t)})},An=(e,t,o,n,r)=>{const s=Fe(e,t,o,n,r);zn(e,s)},Ln=(e,t)=>qe(e,t).match({ltr:(t,o,n,r)=>{An(e,t,o,n,r)},rtl:(t,o,n,r)=>{Bn(e).each(s=>{if(s.setBaseAndExtent)s.setBaseAndExtent(t.dom,o,n.dom,r);else if(s.extend)try{((e,t,o,n,r,s)=>{t.collapse(o.dom,n),t.extend(r.dom,s)})(0,s,t,o,n,r)}catch{An(e,n,r,t,o)}else An(e,n,r,t,o)})}}),Mn=(e,t,o,n,r)=>{const s=((e,t,o,n)=>{const r=Nn(e,t),s=Nn(o,n);return _n.relative(r,s)})(t,o,n,r);Ln(e,s)},Wn=(e,t,o)=>{const n=((e,t)=>{const o=e.fold(kn.before,Nn,kn.after),n=t.fold(kn.before,Nn,kn.after);return _n.relative(o,n)})(t,o);Ln(e,n)},jn=e=>{if(e.rangeCount>0){const t=e.getRangeAt(0),o=e.getRangeAt(e.rangeCount-1);return C.some(Dn(Me.fromDom(t.startContainer),t.startOffset,Me.fromDom(o.endContainer),o.endOffset))}return C.none()},Pn=e=>{if(null===e.anchorNode||null===e.focusNode)return jn(e);{const t=Me.fromDom(e.anchorNode),o=Me.fromDom(e.focusNode);return((e,t,o,n)=>{const r=((e,t,o,n)=>{const r=Ft(e).dom.createRange();return r.setStart(e.dom,t),r.setEnd(o.dom,n),r})(e,t,o,n),s=Je(e,o)&&t===n;return r.collapsed&&!s})(t,e.anchorOffset,o,e.focusOffset)?C.some(Dn(t,e.anchorOffset,o,e.focusOffset)):jn(e)}},In=(e,t,o=!0)=>{const n=(o?je:We)(e,t);zn(e,n)},Fn=e=>(e=>Bn(e).filter(e=>e.rangeCount>0).bind(Pn))(e).map(e=>_n.exact(e.start,e.soffset,e.finish,e.foffset)),Hn=(e,t,o)=>((e,t,o)=>((e,t,o)=>e.caretPositionFromPoint?((e,t,o)=>C.from(e.caretPositionFromPoint?.(t,o)).bind(t=>{if(null===t.offsetNode)return C.none();const o=e.createRange();return o.setStart(t.offsetNode,t.offset),o.collapse(),C.some(o)}))(e,t,o):e.caretRangeFromPoint?((e,t,o)=>C.from(e.caretRangeFromPoint?.(t,o)))(e,t,o):C.none())(e.document,t,o).map(e=>Dn(Me.fromDom(e.startContainer),e.startOffset,Me.fromDom(e.endContainer),e.endOffset)))(e,t,o),$n={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},Vn=(()=>{const e="[0-9]+",t="[eE][+-]?"+e,o=e=>`(?:${e})?`,n=["Infinity",e+"\\."+o(e)+o(t),"\\."+e+o(t),e+o(t)].join("|");return new RegExp(`^([+-]?(?:${n}))(.*)$`)})(),qn=e=>E(e,g(0)),Un=(e,t,o,n,r)=>r(e.slice(0,t)).concat(n).concat(r(e.slice(o))),Gn=e=>(t,o,n,r)=>{if(e(n)){const e=Math.max(r,t[o]-Math.abs(n)),s=Math.abs(e-t[o]);return n>=0?s:-s}return n},Kn=Gn(e=>e<0),Yn=Gn(x),Jn=()=>{const e=(e,t,o,n)=>{const r=(100+o)/100,s=Math.max(n,(e[t]+o)/r);return E(e,(e,o)=>(o===t?s:e/r)-e)},t=(t,o,n,r,s,l)=>l?e(t,o,r,s):((e,t,o,n,r)=>{const s=Kn(e,t,n,r);return Un(e,t,o+1,[s,0],qn)})(t,o,n,r,s);return{resizeTable:(e,t)=>e(t),clampTableDelta:Kn,calcLeftEdgeDeltas:t,calcMiddleDeltas:(e,o,n,r,s,l,a)=>t(e,n,r,s,l,a),calcRightEdgeDeltas:(t,o,n,r,s,l)=>{if(l)return e(t,n,r,s);{const e=Kn(t,n,r,s);return qn(t.slice(0,n)).concat([e])}},calcRedestributedWidths:(e,t,o,n)=>{if(n){const n=(t+o)/t,r=E(e,e=>e/n);return{delta:100*n-100,newSizes:r}}return{delta:o,newSizes:e}}}},Qn=()=>{const e=(e,t,o,n,r)=>{const s=Yn(e,n>=0?o:t,n,r);return Un(e,t,o+1,[s,-s],qn)};return{resizeTable:(e,t,o)=>{o&&e(t)},clampTableDelta:(e,t,o,n,r)=>{if(r){if(o>=0)return o;{const t=A(e,(e,t)=>e+t-n,0);return Math.max(-t,o)}}return Kn(e,t,o,n)},calcLeftEdgeDeltas:e,calcMiddleDeltas:(t,o,n,r,s,l)=>e(t,n,r,s,l),calcRightEdgeDeltas:(e,t,o,n,r,s)=>{if(s)return qn(e);{const t=n/e.length;return E(e,g(t))}},calcRedestributedWidths:(e,t,o,n)=>({delta:0,newSizes:e})}},Xn=(e,t,o=0)=>po(e,t).map(e=>parseInt(e,10)).getOr(o),Zn=(e,t)=>Xn(e,t,1),er=e=>It("col")(e)?Xn(e,"span",1)>1:Zn(e,"colspan")>1,tr=(e,t)=>parseInt(No(e,t),10),or=g(10),nr=g(10),rr=(e,t)=>sr(e,t,x),sr=(e,t,o)=>j(Kt(e),e=>Ge(e,t)?o(e)?[e]:[]:sr(e,t,o)),lr=(e,t)=>((e,t,o=y)=>o(t)?C.none():D(e,Nt(t))?C.some(t):rn(t,e.join(","),e=>Ge(e,"table")||o(e)))(["td","th"],e,t),ar=e=>rr(e,"th,td"),cr=e=>Ge(e,"colgroup")?wn(e,"col"):j(dr(e),e=>wn(e,"col")),ir=(e,t)=>an(e,"table",t),mr=e=>rr(e,"tr"),dr=e=>ir(e).fold(g([]),e=>wn(e,"colgroup")),ur=It("th"),fr=e=>P(e,e=>ur(e.element)),gr=(e,t)=>e&&t?"sectionCells":e?"section":"cells",hr=e=>{const t="thead"===e.section,o=ie(pr(e.cells),"th");return"tfoot"===e.section?{type:"footer"}:t||o?{type:"header",subType:gr(t,o)}:{type:"body"}},pr=e=>{const t=B(e,e=>ur(e.element));return 0===t.length?C.some("td"):t.length===e.length?C.some("th"):C.none()},br=(e,t)=>E(e,e=>{if("colgroup"===Nt(e)){const t=E(cr(e),e=>{const t=Xn(e,"span",1);return Ce(e,1,t)});return Te(e,t,"colgroup")}{const o=E(ar(e),e=>{const t=Xn(e,"rowspan",1),o=Xn(e,"colspan",1);return Ce(e,t,o)});return Te(e,o,t(e))}}),wr=e=>$t(e).map(e=>{const t=Nt(e);return(e=>D(xe,e))(t)?t:"tbody"}).getOr("tbody"),vr=e=>{const t=mr(e),o=[...dr(e),...t];return br(o,wr)},yr="data-snooker-locked-cols",xr=e=>po(e,yr).bind(e=>C.from(e.match(/\d+/g))).map(e=>I(e,x)),Cr=e=>{const t=A(ze(e).rows,(e,t)=>(_(t.cells,(t,o)=>{t.isLocked&&(e[o]=!0)}),e),{}),o=J(t,(e,t)=>parseInt(t,10));return(e=>{const t=T.call(e,0);return t.sort(void 0),t})(o)},Tr=(e,t)=>e+","+t,Sr=(e,t)=>{const o=j(e.all,e=>e.cells);return B(o,t)},Rr=e=>{const t={},o=[],n=H(e).map(e=>e.element).bind(ir).bind(xr).getOr({});let r=0,s=0,l=0;const{pass:a,fail:c}=N(e,e=>"colgroup"===e.section);_(c,e=>{const a=[];_(e.cells,e=>{let o=0;for(;void 0!==t[Tr(l,o)];)o++;const r=((e,t)=>X(e,t)&&void 0!==e[t]&&null!==e[t])(n,o.toString()),c=((e,t,o,n,r,s)=>({element:e,rowspan:t,colspan:o,row:n,column:r,isLocked:s}))(e.element,e.rowspan,e.colspan,l,o,r);for(let n=0;n{const t=(e=>{const t={};let o=0;return _(e.cells,e=>{const n=e.colspan;k(n,r=>{const s=o+r;t[s]=((e,t,o)=>({element:e,colspan:t,column:o}))(e.element,n,s)}),o+=n}),t})(e),o=((e,t)=>({element:e,columns:t}))(e.element,Q(t));return{colgroups:[o],columns:t}}).getOrThunk(()=>({colgroups:[],columns:{}})),d=((e,t)=>({rows:e,columns:t}))(r,s);return{grid:d,access:t,all:o,columns:i,colgroups:m}},Dr=e=>{const t=vr(e);return Rr(t)},Or=Rr,kr=(e,t,o)=>C.from(e.access[Tr(t,o)]),Er=(e,t,o)=>{const n=Sr(e,e=>o(t,e.element));return n.length>0?C.some(n[0]):C.none()},_r=Sr,Nr=e=>j(e.all,e=>e.cells),Br=e=>Q(e.columns),zr=e=>q(e.columns).length>0,Ar=(e,t)=>C.from(e.columns[t]),Lr=(e,t,o)=>Se(o(e.element,t),!0,e.isLocked),Mr=(e,t)=>e.section!==t?Re(e.element,e.cells,t,e.isNew):e,Wr=()=>({transformRow:Mr,transformCell:(e,t,o)=>{const n=o(e.element,t),r="td"!==Nt(n)?(e=>{const t=Ro(e,"td");so(e,t);const o=Kt(e);return mo(t,o),yo(e),t})(n):n;return Se(r,e.isNew,e.isLocked)}}),jr=()=>({transformRow:Mr,transformCell:Lr}),Pr=()=>({transformRow:(e,t)=>Mr(e,"thead"===t?"tbody":t),transformCell:Lr}),Ir=Wr,Fr=jr,Hr=Pr,$r=()=>({transformRow:h,transformCell:Lr}),Vr=(e,t=x)=>{const o=e.grid,n=k(o.columns,h),r=k(o.rows,h);return E(n,o=>qr(()=>j(r,t=>kr(e,t,o).filter(e=>e.column===o).toArray()),e=>1===e.colspan&&t(e.element),()=>kr(e,0,o)))},qr=(e,t,o)=>{const n=e();return L(n,t).orThunk(()=>C.from(n[0]).orThunk(o)).map(e=>e.element)},Ur=e=>{const t=e.grid,o=k(t.rows,h),n=k(t.columns,h);return E(o,t=>qr(()=>j(n,o=>kr(e,t,o).filter(e=>e.row===t).fold(g([]),e=>[e])),e=>1===e.rowspan,()=>kr(e,t,0)))},Gr=(e,t)=>({row:e,y:t}),Kr=(e,t)=>({col:e,x:t}),Yr=e=>Go(e).left+Ho(e),Jr=e=>Go(e).left,Qr=(e,t)=>Kr(e,Jr(t)),Xr=(e,t)=>Kr(e,Yr(t)),Zr=e=>Go(e).top,es=(e,t)=>Gr(e,Zr(t)),ts=(e,t)=>Gr(e,Zr(t)+Po(t)),os=(e,t,o)=>{if(0===o.length)return[];const n=E(o.slice(1),(t,o)=>t.map(t=>e(o,t))),r=o[o.length-1].map(e=>t(o.length-1,e));return n.concat([r])},ns={delta:h,positions:e=>os(es,ts,e),edge:Zr},rs=Zo({delta:h,edge:Jr,positions:e=>os(Qr,Xr,e)},{delta:e=>-e,edge:Yr,positions:e=>os(Xr,Qr,e)}),ss={delta:(e,t)=>rs(t).delta(e,t),positions:(e,t)=>rs(t).positions(e,t),edge:e=>rs(e).edge(e)},ls=/(\d+(\.\d+)?)%/,as=/(\d+(\.\d+)?)px|em/,cs=It("col"),is=It("tr"),ms=(e,t,o)=>{const n=Vt(e).getOrThunk(()=>(e=>{const t=e.dom.body;if(null==t)throw new Error("Body is not available yet");return Me.fromDom(t)})(Ft(e)));return t(e)/o(n)*100},ds=(e,t)=>{Eo(e,"width",t+"px")},us=(e,t)=>{Eo(e,"width",t+"%")},fs=(e,t)=>{Eo(e,"height",t+"px")},gs=e=>{const t=(e=>{return Mo(t=e,"height",t.dom.offsetHeight)+"px";var t})(e);return t?((e,t,o,n)=>{const r=parseFloat(e);return be(e,"%")&&"table"!==Nt(t)?((e,t,o,n)=>{const r=ir(e).map(e=>{const n=o(e);return Math.floor(t/100*n)}).getOr(t);return n(e,r),r})(t,r,o,n):r})(t,e,jo,fs):jo(e)},hs=(e,t)=>zo(e,t).orThunk(()=>po(e,t).map(e=>e+"px")),ps=e=>hs(e,"width"),bs=e=>ms(e,Fo,$o),ws=e=>{return cs(e)?Math.round(Fo(e)):Mo(t=e,"width",t.dom.offsetWidth);var t},vs=e=>is(e)?jo(e):((e,t,o)=>o(e)/Zn(e,"rowspan"))(e,0,gs),ys=(e,t,o)=>{Eo(e,"width",t+o)},xs=e=>ms(e,Fo,$o)+"%",Cs=g(ls),Ts=It("col"),Ss=e=>ps(e).getOrThunk(()=>ws(e)+"px"),Rs=e=>{return(t=e,hs(t,"height")).getOrThunk(()=>vs(e)+"px");var t},Ds=(e,t,o,n,r,s)=>e.filter(n).fold(()=>s(((e,t)=>{if(t<0||t>=e.length-1)return C.none();const o=e[t].fold(()=>{const o=(e=>{const t=T.call(e,0);return t.reverse(),t})(e.slice(0,t));return V(o,(e,t)=>e.map(e=>({value:e,delta:t+1})))},e=>C.some({value:e,delta:0})),n=e[t+1].fold(()=>{const o=e.slice(t+1);return V(o,(e,t)=>e.map(e=>({value:e,delta:t+1})))},e=>C.some({value:e,delta:1}));return o.bind(e=>n.map(t=>{const o=t.delta+e.delta;return Math.abs(t.value-e.value)/o}))})(o,t)),e=>r(e)),Os=(e,t,o,n)=>{const r=Vr(e),s=zr(e)?(e=>E(Br(e),e=>C.from(e.element)))(e):r,l=[C.some(ss.edge(t))].concat(E(ss.positions(r,t),e=>e.map(e=>e.x))),a=w(er);return E(s,(e,t)=>Ds(e,t,l,a,e=>{if((e=>{const t=kt().browser,o=t.isChromium()||t.isFirefox();return!Ts(e)||o})(e))return o(e);{const e=null!=(s=r[t])?h(s):C.none();return Ds(e,t,l,a,e=>n(C.some(Math.round(Fo(e)))),n)}var s},n))},ks=e=>e.map(e=>e+"px").getOr(""),Es=(e,t,o)=>Os(e,t,ws,e=>e.getOrThunk(o.minCellWidth)),_s=(e,t,o,n)=>{const r=Ur(e),s=E(e.all,e=>C.some(e.element)),l=[C.some(ns.edge(t))].concat(E(ns.positions(r,t),e=>e.map(e=>e.y)));return E(s,(e,t)=>Ds(e,t,l,x,o,n))},Ns=(e,t)=>()=>Oo(e)?t(e):parseFloat(zo(e,"width").getOr("0")),Bs=e=>{const t=Ns(e,e=>parseFloat(xs(e))),o=Ns(e,Fo);return{width:t,pixelWidth:o,getWidths:(t,o)=>((e,t,o)=>Os(e,t,bs,e=>e.fold(()=>o.minCellWidth(),e=>e/o.pixelWidth()*100)))(t,e,o),getCellDelta:e=>e/o()*100,singleColumnWidth:(e,t)=>[100-e],minCellWidth:()=>or()/o()*100,setElementWidth:us,adjustTableWidth:o=>{const n=t();us(e,n+o/100*n)},isRelative:!0,label:"percent"}},zs=e=>{const t=Ns(e,Fo);return{width:t,pixelWidth:t,getWidths:(t,o)=>Es(t,e,o),getCellDelta:h,singleColumnWidth:(e,t)=>[Math.max(or(),e+t)-e],minCellWidth:or,setElementWidth:ds,adjustTableWidth:o=>{const n=t()+o;ds(e,n)},isRelative:!1,label:"pixel"}},As=e=>ps(e).fold(()=>(e=>{const t=Ns(e,Fo),o=g(0);return{width:t,pixelWidth:t,getWidths:(t,o)=>Es(t,e,o),getCellDelta:o,singleColumnWidth:g([0]),minCellWidth:o,setElementWidth:f,adjustTableWidth:f,isRelative:!0,label:"none"}})(e),t=>((e,t)=>null!==Cs().exec(t)?Bs(e):zs(e))(e,t)),Ls=zs,Ms=Bs,Ws=(e,t,o,n)=>{o===n?bo(e,t):fo(e,t,o)},js=(e,t,o)=>{$(wn(e,t)).fold(()=>lo(e,o),e=>so(e,o))},Ps=(e,t)=>{const o=[],n=[],r=e=>E(e,e=>{e.isNew&&o.push(e.element);const t=e.element;return vo(t),_(e.cells,e=>{e.isNew&&n.push(e.element),Ws(e.element,"colspan",e.colspan,1),Ws(e.element,"rowspan",e.rowspan,1),ao(t,e.element)}),t}),s=e=>j(e,e=>E(e.cells,e=>(Ws(e.element,"span",e.colspan,1),e.element))),l=(t,o)=>{const n=((e,t)=>{const o=sn(e,t).getOrThunk(()=>{const o=Me.fromTag(t,Ft(e).dom);return"thead"===t?js(e,"caption,colgroup",o):"colgroup"===t?js(e,"caption",o):ao(e,o),o});return vo(o),o})(e,o),l=("colgroup"===o?s:r)(t);mo(n,l)},a=(t,o)=>{t.length>0?l(t,o):(t=>{sn(e,t).each(yo)})(o)},c=[],i=[],m=[],d=[];return _(t,e=>{switch(e.section){case"thead":c.push(e);break;case"tbody":i.push(e);break;case"tfoot":m.push(e);break;case"colgroup":d.push(e)}}),a(d,"colgroup"),a(c,"thead"),a(i,"tbody"),a(m,"tfoot"),{newRows:o,newCells:n}},Is=(e,t)=>{if(0===e.length)return 0;const o=e[0];return M(e,e=>!t(o.element,e.element)).getOr(e.length)},Fs=(e,t)=>{const o=E(e,e=>E(e.cells,y));return E(e,(n,r)=>{const s=j(n.cells,(n,s)=>{if(!1===o[r][s]){const m=((e,t,o,n)=>{const r=((e,t)=>e[t])(e,t),s="colgroup"===r.section,l=Is(r.cells.slice(o),n),a=s?1:Is(((e,t)=>E(e,e=>_e(e,t)))(e.slice(t),o),n);return{colspan:l,rowspan:a}})(e,r,s,t);return((e,t,n,r)=>{for(let s=e;s({element:e,cells:t,section:o,isNew:n}))(n.element,s,n.section,n.isNew)})},Hs=(e,t,o)=>{const n=[];_(e.colgroups,r=>{const s=[];for(let n=0;nSe(e.element,o,!1)).getOrThunk(()=>Se(t.colGap(),!0,!1));s.push(r)}n.push(Re(r.element,s,"colgroup",o))});for(let r=0;rSe(e.element,o,e.isLocked)).getOrThunk(()=>Se(t.gap(),!0,!1));s.push(l)}const l=e.all[r],a=Re(l.element,s,l.section,o);n.push(a)}return n},$s=e=>Fs(e,Je),Vs=(e,t)=>V(e.all,e=>L(e.cells,e=>Je(t,e.element))),qs=(e,t,o)=>{const n=E(t.selection,t=>lr(t).bind(t=>Vs(e,t)).filter(o)),r=me(n);return de(r.length>0,r)},Us=(e,t,o,n,r,s,l,a,c)=>{const i=Dr(s),m=C.from(c?.section).getOrThunk($r);return t(i,l).map(t=>{const o=((e,t)=>Hs(e,t,!1))(i,a),n=e(o,t,Je,r(a),m),s=Cr(n.grid);return{info:t,grid:$s(n.grid),cursor:n.cursor,lockedColumns:s}}).bind(e=>{const t=Ps(s,e.grid),r=C.from(c?.sizing).getOrThunk(()=>As(s)),l=C.from(c?.resize).getOrThunk(Qn);return o(s,e.grid,e.info,{sizing:r,resize:l,section:m}),n(s),bo(s,yr),e.lockedColumns.length>0&&fo(s,yr,e.lockedColumns.join(",")),C.some({cursor:e.cursor,newRows:t.newRows,newCells:t.newCells})})},Gs=(e,t)=>lr(t.element).bind(o=>Vs(e,o).map(e=>({...e,generators:t.generators,clipboard:t.clipboard}))),Ks=(e,t)=>qs(e,t,x).map(e=>({cells:e,generators:t.generators,clipboard:t.clipboard})),Ys=(e,t)=>qs(e,t,x),Js=(e,t)=>qs(e,t,e=>!e.isLocked),Qs=(e,t)=>P(t,t=>((e,t)=>Vs(e,t).exists(e=>!e.isLocked))(e,t)),Xs=(e,t)=>((e,t)=>t.mergable)(0,t).filter(t=>Qs(e,t.cells)),Zs=(e,t)=>((e,t)=>t.unmergable)(0,t).filter(t=>Qs(e,t)),el={...Z([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])},tl=(e,t,o)=>{const n=((e,t)=>zr(e)?((e,t)=>{const o=Br(e);return E(o,(e,o)=>({element:e.element,width:t[o],colspan:e.colspan}))})(e,t):((e,t)=>{const o=Nr(e);return E(o,e=>{const o=((e,t,o)=>{let n=0;for(let r=e;r{o.setElementWidth(e.element,e.width)})},ol=(e,t,o,n,r)=>{const s=Dr(e),l=r.getCellDelta(t),a=r.getWidths(s,r),c=o===s.grid.columns-1,i=n.clampTableDelta(a,o,l,r.minCellWidth(),c),m=((e,t,o,n,r)=>{const s=e.slice(0),l=((e,t)=>0===e.length?el.none():1===e.length?el.only(0):0===t?el.left(0,1):t===e.length-1?el.right(t-1,t):t>0&&tn.singleColumnWidth(s[e],o),(e,t)=>r.calcLeftEdgeDeltas(s,e,t,o,n.minCellWidth(),n.isRelative),(e,t,l)=>r.calcMiddleDeltas(s,e,t,l,o,n.minCellWidth(),n.isRelative),(e,t)=>r.calcRightEdgeDeltas(s,e,t,o,n.minCellWidth(),n.isRelative))})(a,o,i,r,n),d=E(m,(e,t)=>e+a[t]);tl(s,d,r),n.resizeTable(r.adjustTableWidth,i,c)},nl=(e,t,o)=>{const n=Dr(e),r=((e,t)=>_s(e,t,vs,e=>e.getOrThunk(nr)))(n,e),s=E(r,(e,n)=>o===n?Math.max(t+e,nr()):e),l=((e,t)=>E(e.all,(e,o)=>({element:e.element,height:t[o]})))(n,s);_(l,e=>{fs(e.element,e.height)}),_(Nr(n),e=>{(e=>{Ao(e,"height")})(e.element)});const a=z(s,(e,t)=>e+t,0);fs(e,a)},rl=(e,t)=>{if(!er(e)){const o=(e=>ps(e).bind(e=>{return t=e,o=["fixed","relative","empty"],C.from(Vn.exec(t)).bind(e=>{const t=Number(e[1]),n=e[2];return((e,t)=>O(t,t=>O($n[t],t=>e===t)))(n,o)?C.some({value:t,unit:n}):C.none()});var t,o}))(e);o.each(o=>{const n=o.value/2;ys(e,n,o.unit),ys(t,n,o.unit)})}},sl=(e,t,o)=>{const n=Xn(e,t,1);1===o||n<=1?bo(e,t):fo(e,t,Math.min(o,n))},ll=(e,t)=>o=>{const n=o.column+o.colspan-1,r=o.column;return n>=e&&r{const n=e[o].element,r=Me.fromTag("td");ao(r,Me.fromTag("br")),(t?ao:lo)(n,r)},cl=It("col"),il=It("colgroup"),ml=e=>"tr"===Nt(e)||il(e),dl=e=>({element:e,colspan:Xn(e,"colspan",1),rowspan:Xn(e,"rowspan",1)}),ul=e=>po(e,"scope").map(e=>e.substr(0,3)),fl=(e,t=dl)=>{const o=o=>{if(ml(o))return il((r={element:o}).element)?e.colgroup(r):e.row(r);{const r=o,s=(t=>cl(t.element)?e.col(t):e.cell(t))(t(r));return n=C.some({item:r,replacement:s}),s}var r};let n=C.none();return{getOrInit:(e,t)=>n.fold(()=>o(e),n=>t(e,n.item)?n.replacement:o(e))}},gl=e=>t=>{const o=[],n=n=>{const r="td"===e?{scope:null}:{},s=t.replace(n,e,r);return o.push({item:n,sub:s}),s};return{replaceOrInit:(e,t)=>{if(ml(e)||cl(e))return e;{const r=e;return((e,t)=>L(o,o=>t(o.item,e)))(r,t).fold(()=>n(r),o=>t(e,o.item)?o.sub:n(r))}}}},hl=e=>({unmerge:t=>{const o=ul(t);return o.each(e=>fo(t,"scope",e)),()=>{const n=e.cell({element:t,colspan:1,rowspan:1});return Ao(n,"width"),Ao(t,"width"),o.each(e=>fo(n,"scope",e)),n}},merge:e=>(Ao(e[0],"width"),(()=>{const t=me(E(e,ul));if(0===t.length)return C.none();{const e=t[0],o=["row","col"];return O(t,t=>t!==e&&D(o,t))?C.none():C.from(e)}})().fold(()=>bo(e[0],"scope"),t=>fo(e[0],"scope",t+"group")),g(e[0]))}),pl=Z([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),bl=(e,t,o)=>{const n=o.substring(0,o.length-e.length),r=parseFloat(n);return n===r.toString()?t(r):pl.invalid(o)},wl={...pl,from:e=>be(e,"%")?bl("%",pl.percent,e):be(e,"px")?bl("px",pl.pixels,e):pl.invalid(e)},vl=(e,t,o)=>{const n=wl.from(o),r=P(e,e=>"0px"===e)?((e,t)=>{const o=e.fold(()=>g(""),e=>g(e/t+"px"),()=>g(100/t+"%"));return k(t,o)})(n,e.length):((e,t,o)=>e.fold(()=>t,e=>((e,t,o)=>{const n=o/t;return E(e,e=>wl.from(e).fold(()=>e,e=>e*n+"px",e=>e/100*o+"px"))})(t,o,e),e=>((e,t)=>E(e,e=>wl.from(e).fold(()=>e,e=>e/t*100+"%",e=>e+"%")))(t,o)))(n,e,t);return Cl(r)},yl=(e,t)=>0===e.length?t:z(e,(e,t)=>wl.from(t).fold(g(0),h,h)+e,0),xl=(e,t)=>wl.from(e).fold(g(e),e=>e+t+"px",e=>e+t+"%"),Cl=e=>{if(0===e.length)return e;const t=z(e,(e,t)=>{const o=wl.from(t).fold(()=>({value:t,remainder:0}),e=>(e=>{const t=Math.floor(e);return{value:t+"px",remainder:e-t}})(e),e=>({value:e+"%",remainder:0}));return{output:[o.value].concat(e.output),remainder:e.remainder+o.remainder}},{output:[],remainder:0}),o=t.output;return o.slice(0,o.length-1).concat([xl(o[o.length-1],Math.round(t.remainder))])},Tl=wl.from,Sl=(e,t,o)=>{const n=Dr(e),r=n.all,s=Nr(n),l=Br(n);t.each(t=>{const o=Tl(t).fold(g("px"),g("px"),g("%")),r=Fo(e),a=((e,t)=>Os(e,t,Ss,ks))(n,e),c=vl(a,r,t);zr(n)?((e,t,o)=>{_(t,(t,n)=>{const r=yl([e[n]],or());Eo(t.element,"width",r+o)})})(c,l,o):((e,t,o)=>{_(t,t=>{const n=e.slice(t.column,t.colspan+t.column),r=yl(n,or());Eo(t.element,"width",r+o)})})(c,s,o),Eo(e,"width",t)}),o.each(t=>{const o=jo(e),l=((e,t)=>_s(e,t,Rs,ks))(n,e);((e,t,o)=>{_(o,e=>{Ao(e.element,"height")}),_(t,(t,o)=>{Eo(t.element,"height",e[o])})})(vl(l,o,t),r,s),Eo(e,"height",t)})},Rl=e=>ps(e).exists(e=>ls.test(e)),Dl=e=>ps(e).exists(e=>as.test(e)),Ol=e=>ps(e).isNone();var kl=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],El=()=>({up:g({selector:rn,closest:an,predicate:on,all:qt}),down:g({selector:vn,predicate:pn}),styles:g({get:No,getRaw:zo,set:Eo,remove:Ao}),attrs:g({get:ho,set:fo,remove:bo,copyTo:(e,t)=>{const o=wo(e);go(t,o)}}),insert:g({before:ro,after:so,afterAll:io,append:ao,appendAll:mo,prepend:lo,wrap:co}),remove:g({unwrap:xo,remove:yo}),create:g({nu:Me.fromTag,clone:e=>Me.fromDom(e.dom.cloneNode(!1)),text:Me.fromText}),query:g({comparePosition:(e,t)=>e.dom.compareDocumentPosition(t.dom),prevSibling:Ut,nextSibling:Gt}),property:g({children:Kt,name:Nt,parent:$t,document:e=>Ht(e).dom,isText:Wt,isComment:At,isElement:Mt,isSpecial:e=>{const t=Nt(e);return D(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],t)},getLanguage:e=>Mt(e)?po(e,"lang"):C.none(),getText:Jo,setText:Xo,isBoundary:e=>!!Mt(e)&&("body"===Nt(e)||D(kl,Nt(e))),isEmptyTag:e=>!!Mt(e)&&D(["br","img","hr","input"],Nt(e)),isNonEditable:e=>Mt(e)&&"false"===ho(e,"contenteditable")}),eq:Je,is:Xe});const _l=(e,t)=>({item:e,mode:t}),Nl=(e,t,o,n=Bl)=>e.property().parent(t).map(e=>_l(e,n)),Bl=(e,t,o,n=zl)=>o.sibling(e,t).map(e=>_l(e,n)),zl=(e,t,o,n=zl)=>{const r=e.property().children(t);return o.first(r).map(e=>_l(e,n))},Al=[{current:Nl,next:Bl,fallback:C.none()},{current:Bl,next:zl,fallback:C.some(Nl)},{current:zl,next:zl,fallback:C.some(Bl)}],Ll=(e,t,o,n,r=Al)=>L(r,e=>e.current===o).bind(o=>o.current(e,t,n,o.next).orThunk(()=>o.fallback.bind(o=>Ll(e,t,o,n)))),Ml=(e,t,o,n,r,s)=>Ll(e,t,n,r).bind(t=>s(t.item)?C.none():o(t.item)?C.some(t.item):Ml(e,t.item,o,t.mode,r,s)),Wl=(e,t)=>({element:e,offset:t}),jl=(e,t,o)=>e.property().isText(t)&&0===e.property().getText(t).trim().length||e.property().isComment(t)?o(t).bind(t=>jl(e,t,o).orThunk(()=>C.some(t))):C.none(),Pl=(e,t)=>e.property().isText(t)?e.property().getText(t).length:e.property().children(t).length,Il=(e,t)=>{const o=jl(e,t,e.query().prevSibling).getOr(t);if(e.property().isText(o))return Wl(o,Pl(e,o));const n=e.property().children(o);return n.length>0?Il(e,n[n.length-1]):Wl(o,Pl(e,o))},Fl=Il,Hl=El(),$l=e=>t=>0===e.property().children(t).length,Vl=(e,t,o,n)=>Ml(e,t,o,Bl,{sibling:(e,t)=>e.query().prevSibling(t),first:e=>e.length>0?C.some(e[e.length-1]):C.none()},n),ql=(e,t,o,n)=>Ml(e,t,o,Bl,{sibling:(e,t)=>e.query().nextSibling(t),first:e=>e.length>0?C.some(e[0]):C.none()},n),Ul=El(),Gl=(e,t)=>((e,t,o)=>Vl(e,t,$l(e),o))(Ul,e,t),Kl=(e,t)=>((e,t,o)=>ql(e,t,$l(e),o))(Ul,e,t),Yl=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],Jl=(e,t,o,n)=>{const r=t(e,o);return z(n,(o,n)=>{const r=t(e,n);return Ql(e,o,r)},r)},Ql=(e,t,o)=>t.bind(t=>o.filter(b(e.eq,t))),Xl=El(),Zl=(e,t)=>((e,t,o)=>o.length>0?((e,t,o,n)=>n(e,t,o[0],o.slice(1)))(e,t,o,Jl):C.none())(Xl,(t,o)=>e(o),t),ea=El(),ta=e=>((e,t)=>{const o=e.property().name(t);return D(Yl,o)})(ea,e),oa=e=>((e,t)=>{const o=e.property().name(t);return D(["ol","ul"],o)})(ea,e),na=e=>{const t=It("br"),o=e=>Sn(e).bind(o=>{const n=Gt(o).map(e=>!!ta(e)||!!((e,t)=>D(["br","img","hr","input"],e.property().name(t)))(ea,e)&&"img"!==Nt(e)).getOr(!1);return $t(o).map(r=>{return!0===n||("li"===Nt(s=r)||on(s,oa).isSome())||t(o)||ta(r)&&!Je(e,r)?[]:[Me.fromTag("br")];var s})}).getOr([]),n=(()=>{const n=j(e,e=>{const n=Kt(e);return(e=>P(e,e=>t(e)||Wt(e)&&0===Jo(e).trim().length))(n)?[]:n.concat(o(e))});return 0===n.length?[Me.fromTag("br")]:n})();vo(e[0]),mo(e[0],n)},ra=e=>{bo(e,"width"),bo(e,"height")},sa=e=>{const t=xs(e);Sl(e,C.some(t),C.none()),ra(e)},la=e=>{const t=(e=>Fo(e)+"px")(e);Sl(e,C.some(t),C.none()),ra(e)},aa=e=>{Ao(e,"width");const t=cr(e),o=t.length>0?t:ar(e);_(o,e=>{Ao(e,"width"),ra(e)}),ra(e)},ca={scope:["row","col"]},ia=e=>()=>{const t=Me.fromTag("td",e.dom);return ao(t,Me.fromTag("br",e.dom)),t},ma=e=>()=>Me.fromTag("col",e.dom),da=e=>()=>Me.fromTag("colgroup",e.dom),ua=e=>()=>Me.fromTag("tr",e.dom),fa=(e,t,o)=>{const n=((e,t)=>{const o=Ro(e,t),n=Kt(So(e));return mo(o,n),o})(e,t);return G(o,(e,t)=>{null===e?bo(n,t):fo(n,t,e)}),n},ga=e=>e,ha=(e,t,o)=>{const n=(e,t)=>{((e,t)=>{const o=e.dom,n=t.dom;Do(o)&&Do(n)&&(n.style.cssText=o.style.cssText)})(e.element,t),Ao(t,"height"),1!==e.colspan&&Ao(t,"width")};return{col:o=>{const r=Me.fromTag(Nt(o.element),t.dom);return n(o,r),e(o.element,r),r},colgroup:da(t),row:ua(t),cell:r=>{const s=Me.fromTag(Nt(r.element),t.dom),l=o.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),a=l.length>0?((e,t,o)=>Tn(e).map(n=>{const r=o.join(","),s=bn(n,r,t=>Je(t,e));return z(s,(e,t)=>{const o=To(t);return ao(e,o),o},t)}).getOr(t))(r.element,s,l):s;return ao(a,Me.fromTag("br")),n(r,s),((e,t)=>{G(ca,(o,n)=>po(e,n).filter(e=>D(o,e)).each(e=>fo(t,n,e)))})(r.element,s),e(r.element,s),s},replace:fa,colGap:ma(t),gap:ia(t)}},pa=e=>({col:ma(e),colgroup:da(e),row:ua(e),cell:ia(e),replace:ga,colGap:ma(e),gap:ia(e)}),ba=e=>Dr(e).grid,wa=(e,t,o,n)=>{const r=ze(e).rows;let s=!0;for(let e=0;e({rowDelta:0,colDelta:Be(e[0])-Be(t[0])}),ya=(e,t)=>({rowDelta:e.length-t.length,colDelta:0}),xa=(e,t,o,n)=>{const r="colgroup"===t.section?o.col:o.cell;return k(e,e=>Se(r(),!0,n(e)))},Ca=(e,t,o,n)=>{const r=e[e.length-1];return e.concat(k(t,()=>{const e="colgroup"===r.section?o.colgroup:o.row,t=Ae(r,e,h),s=xa(t.cells.length,t,o,e=>X(n,e.toString()));return Ee(t,s)}))},Ta=(e,t,o,n)=>E(e,e=>{const r=xa(t,e,o,y);return De(e,n,r)}),Sa=(e,t,o)=>{const n=t.colDelta<0?Ta:h,r=t.rowDelta<0?Ca:h,s=Cr(e),l=Be(e[0]),a=O(s,e=>e===l-1),c=n(e,Math.abs(t.colDelta),o,a?l-1:l),i=Cr(c);return r(c,Math.abs(t.rowDelta),o,I(i,x))},Ra=(e,t,o,n)=>{const r=b(n,_e(e[t],o).element),s=e[t];return e.length>1&&Be(s)>1&&(o>0&&r(Ne(s,o-1))||o0&&r(Ne(e[t-1],o))||tB(o,o=>o>=e.column&&o<=Be(t[0])+e.column),Oa=(e,t,o,n,r)=>{((e,t,o,n)=>{t>0&&t{const r=e.cells[t-1];let s=0;const l=n();for(;e.cells.length>t+s&&o(r.element,e.cells[t+s].element);)ke(e,t+s,Se(l,!0,e.cells[t+s].isLocked)),s++})})(t,e,r,n.cell);const s=ya(o,t),l=Sa(o,s,n),a=ya(t,l),c=Sa(t,a,n);return E(c,(t,o)=>De(t,e,l[o].cells))},ka=(e,t,o,n,r)=>{((e,t,o,n)=>{const r=ze(e).rows;if(t>0&&tA(e,(e,o)=>O(e,e=>t(e.element,o.element))?e:e.concat([o]),[]))(r[t-1].cells,o);_(e,e=>{let s=C.none();for(let l=t;l{ke(a,t,Se(e,!0,c.isLocked))}))}})}})(t,e,r,n.cell);const s=Cr(t),l=va(t,o),a={...l,colDelta:l.colDelta-s.length},c=Sa(t,a,n),{cols:i,rows:m}=ze(c),d=Cr(c),u=va(o,t),f={...u,colDelta:u.colDelta+d.length},g=(p=n,b=d,E(o,e=>A(b,(t,o)=>{const n=xa(1,e,p,x)[0];return Oe(t,o,n)},e))),h=Sa(g,f,n);var p,b;return[...i,...m.slice(0,e),...h,...m.slice(e,m.length)]},Ea=(e,t,o,n,r)=>{const{rows:s,cols:l}=ze(e),a=s.slice(0,t),c=s.slice(t);return[...l,...a,((e,t,o,n)=>Ae(e,e=>n(e,o),t))(s[o],(e,o)=>t>0&&tE(e,e=>{const s=t>0&&t{if("colgroup"!==o&&n)return _e(e,t);{const t=_e(e,r);return Se(l(t.element,s),!0,!1)}})(e,t,e.section,s,o,n,r);return Oe(e,t,l)}),Na=(e,t,o,n)=>((e,t,o,n)=>void 0!==Ne(e[t],o)&&t>0&&n(Ne(e[t-1],o),Ne(e[t],o)))(e,t,o,n)||((e,t,o)=>t>0&&o(Ne(e,t-1),Ne(e,t)))(e[t],o,n),Ba=(e,t,o,n)=>{const r=e=>(e=>"row"===e?(e=>Zn(e,"rowspan")>1)(t):er(t))(e)?`${e}group`:e;return e?ur(t)?r(o):null:n&&ur(t)?r("row"===o?"col":"row"):null},za=(e,t,o)=>Se(o(e.element,t),!0,e.isLocked),Aa=(e,t,o,n,r,s,l)=>E(e,(e,a)=>(e=>{const c=e.cells,i=E(c,(e,c)=>{if((e=>O(t,t=>o(e.element,t.element)))(e)){const t=l(e,a,c)?r(e,o,n):e;return s(t,a,c).each(e=>{var o,n;o=t.element,n={scope:C.from(e)},G(n,(e,t)=>{e.fold(()=>{bo(o,t)},e=>{uo(o.dom,t,e)})})}),t}return e});return Re(e.element,i,e.section,e.isNew)})(e)),La=(e,t,o)=>j(e,(n,r)=>Na(e,r,t,o)?[]:[_e(n,t)]),Ma=(e,t,o,n,r)=>{const s=ze(e).rows,l=j(t,e=>La(s,e,n)),a=E(s,e=>fr(e.cells)),c=((e,t)=>P(t,h)&&fr(e)?x:(e,o,n)=>!("th"===Nt(e.element)&&t[o]))(l,a),i=((e,t)=>(o,n)=>C.some(Ba(e,o.element,"row",t[n])))(o,a);return Aa(e,l,n,r,za,i,c)},Wa=(e,t,o,n)=>{const r=ze(e).rows,s=E(t,e=>_e(r[e.row],e.column));return Aa(e,s,o,n,za,C.none,x)},ja=e=>A(e,(e,t)=>O(e,e=>e.column===t.column)?e:e.concat([t]),[]).sort((e,t)=>e.column-t.column),Pa=e=>gn(e,!0),Ia=e=>{0===ar(e).length&&yo(e)},Fa=(e,t)=>({grid:e,cursor:t}),Ha=(e,t,o)=>{const n=((e,t,o)=>{const n=ze(e).rows;return C.from(n[t]?.cells[o]?.element).filter(Pa).orThunk(()=>(e=>V(e,e=>V(e.cells,e=>{const t=e.element;return de(Pa(t),t)})))(n))})(e,t,o);return Fa(e,n)},$a=e=>A(e,(e,t)=>O(e,e=>e.row===t.row)?e:e.concat([t]),[]).sort((e,t)=>e.row-t.row),Va=(e,t,o,n)=>{const r=t[0].row,s=$a(t),l=z(s,(e,t)=>({grid:Ea(e.grid,r,t.row+e.delta,o,n.getOrInit),delta:e.delta+1}),{grid:e,delta:0}).grid;return Ha(l,r,t[0].column)},qa=(e,t,o,n)=>{const r=$a(t),s=r[r.length-1],l=s.row+s.rowspan,a=z(r,(e,t)=>Ea(e,l,t.row,o,n.getOrInit),e);return Ha(a,l,t[0].column)},Ua=(e,t,o,n)=>{const r=t.details,s=ja(r),l=s[0].column,a=z(s,(e,t)=>({grid:_a(e.grid,l,t.column+e.delta,o,n.getOrInit),delta:e.delta+1}),{grid:e,delta:0}).grid;return Ha(a,r[0].row,l)},Ga=(e,t,o,n)=>{const r=t.details,s=r[r.length-1],l=s.column+s.colspan,a=ja(r),c=z(a,(e,t)=>_a(e,l,t.column,o,n.getOrInit),e);return Ha(c,r[0].row,l)},Ka=(e,t,o,n)=>{const r=ja(t),s=E(r,e=>e.column),l=Ma(e,s,!0,o,n.replaceOrInit);return Ha(l,t[0].row,t[0].column)},Ya=(e,t,o,n)=>{const r=Wa(e,t,o,n.replaceOrInit);return Ha(r,t[0].row,t[0].column)},Ja=(e,t,o,n)=>{const r=ja(t),s=E(r,e=>e.column),l=Ma(e,s,!1,o,n.replaceOrInit);return Ha(l,t[0].row,t[0].column)},Qa=(e,t,o,n)=>{const r=Wa(e,t,o,n.replaceOrInit);return Ha(r,t[0].row,t[0].column)},Xa=(e,t)=>(o,n,r,s,l)=>{const a=$a(n),c=E(a,e=>e.row),i=((e,t,o,n,r,s,l)=>{const{cols:a,rows:c}=ze(e),i=c[t[0]],m=j(t,e=>((e,t,o)=>{const n=e[t];return j(n.cells,(n,r)=>Na(e,t,r,o)?[]:[n])})(c,e,r)),d=E(i.cells,(e,t)=>fr(La(c,t,r))),u=[...c];_(t,e=>{u[e]=l.transformRow(c[e],o)});const f=[...a,...u],g=((e,t)=>P(t,h)&&fr(e.cells)?x:(e,o,n)=>!("th"===Nt(e.element)&&t[n]))(i,d),p=((e,t)=>(o,n,r)=>C.some(Ba(e,o.element,"col",t[r])))(n,d);return Aa(f,m,r,s,l.transformCell,p,g)})(o,c,e,t,r,s.replaceOrInit,l);return Ha(i,n[0].row,n[0].column)},Za=Xa("thead",!0),ec=Xa("tbody",!1),tc=Xa("tfoot",!1),oc=(e,t,o,n)=>{const r=ja(t.details),s=((e,t)=>j(e,e=>{const o=e.cells,n=z(t,(e,t)=>t>=0&&t0?[Re(e.element,n,e.section,e.isNew)]:[]}))(e,E(r,e=>e.column)),l=s.length>0?s[0].cells.length-1:0;return Ha(s,r[0].row,Math.min(r[0].column,l))},nc=(e,t,o,n)=>{const r=$a(t),s=((e,t,o)=>{const{rows:n,cols:r}=ze(e);return[...r,...n.slice(0,t),...n.slice(o+1)]})(e,r[0].row,r[r.length-1].row),l=Math.max(ze(s).rows.length-1,0);return Ha(s,Math.min(t[0].row,l),t[0].column)},rc=(e,t,o,n)=>{const r=t.cells;na(r);const s=((e,t,o,n)=>{const r=ze(e).rows;if(0===r.length)return e;for(let e=t.startRow;e<=t.finishRow;e++)for(let o=t.startCol;o<=t.finishCol;o++){const t=r[e],s=_e(t,o).isLocked;ke(t,o,Se(n(),!1,s))}return e})(e,t.bounds,0,n.merge(r));return Fa(s,C.from(r[0]))},sc=(e,t,o,n)=>{const r=z(t,(e,t)=>wa(e,t,o,n.unmerge(t)),e);return Fa(r,C.from(t[0]))},lc=(e,t,o,n)=>{const r=((e,t)=>{const o=Dr(e);return Hs(o,t,!0)})(t.clipboard,t.generators);var s,l;return((e,t,o,n,r)=>{const s=Cr(t),l=((e,t,o)=>{const n=Be(t[0]),r=ze(t).cols.length+e.row,s=k(n-e.column,t=>t+e.column);return{row:r,column:L(s,e=>P(o,t=>t!==e)).getOr(n-1)}})(e,t,s),a=ze(o).rows,c=Da(l,a,s),i=((e,t,o)=>{if(e.row>=t.length||e.column>Be(t[0]))return le.error("invalid start address out of table bounds, row: "+e.row+", column: "+e.column);const n=t.slice(e.row),r=n[0].cells.slice(e.column),s=Be(o[0]),l=o.length;return le.value({rowDelta:n.length-l,colDelta:r.length-s})})(l,t,a);return i.map(e=>{const o={...e,colDelta:e.colDelta-c.length},s=Sa(t,o,n),i=Cr(s),m=Da(l,a,i);return((e,t,o,n,r,s)=>{const l=e.row,a=e.column,c=l+o.length,i=a+Be(o[0])+s.length,m=I(s,x);for(let e=l;eFa(e,C.some(t.element)),e=>Ha(e,t.row,t.column))},ac=(e,t,o)=>{const n=((e,t)=>br(e,()=>t))(e,o.section),r=Or(n);return Hs(r,t,!0)},cc=(e,t,o,n)=>{const r=ze(e).rows,s=t.cells[0].column,l=r[t.cells[0].row],a=ac(t.clipboard,t.generators,l),c=Oa(s,e,a,t.generators,o);return Ha(c,t.cells[0].row,t.cells[0].column)},ic=(e,t,o,n)=>{const r=ze(e).rows,s=t.cells[t.cells.length-1].column+t.cells[t.cells.length-1].colspan,l=r[t.cells[0].row],a=ac(t.clipboard,t.generators,l),c=Oa(s,e,a,t.generators,o);return Ha(c,t.cells[0].row,s)},mc=(e,t,o,n)=>{const r=ze(e).rows,s=t.cells[0].row,l=r[s],a=ac(t.clipboard,t.generators,l),c=ka(s,e,a,t.generators,o);return Ha(c,t.cells[0].row,t.cells[0].column)},dc=(e,t,o,n)=>{const r=ze(e).rows,s=t.cells[t.cells.length-1].row+t.cells[t.cells.length-1].rowspan,l=r[t.cells[0].row],a=ac(t.clipboard,t.generators,l),c=ka(s,e,a,t.generators,o);return Ha(c,s,t.cells[0].column)},uc=(e,t,o,n)=>((e,t,o,n)=>{const r=Or(t),s=n.getWidths(r,n);tl(r,s,n)})(0,t,0,n.sizing),fc=(e,t,o,n)=>((e,t,o,n,r)=>{const s=Or(t),l=n.getWidths(s,n),a=n.pixelWidth(),{newSizes:c,delta:i}=r.calcRedestributedWidths(l,a,o.pixelDelta,n.isRelative);tl(s,c,n),n.adjustTableWidth(i)})(0,t,o,n.sizing,n.resize),gc=(e,t)=>O(t,e=>0===e.column&&e.isLocked),hc=(e,t)=>O(t,t=>t.column+t.colspan>=e.grid.columns&&t.isLocked),pc=(e,t)=>{const o=Vr(e),n=ja(t);return A(n,(e,t)=>e+o[t.column].map(Ho).getOr(0),0)},bc=e=>(t,o)=>Ys(t,o).filter(o=>!(e?gc:hc)(t,o)).map(e=>({details:e,pixelDelta:pc(t,e)})),wc=(e,t)=>Js(e,t).map(t=>({details:t,pixelDelta:-pc(e,t)})),vc=e=>(t,o)=>Ks(t,o).filter(o=>!(e?gc:hc)(t,o.cells)),yc=gl("th"),xc=gl("td"),Cc=(e,t,o,n)=>Us(Va,Ys,f,f,fl,e,t,o,n),Tc=(e,t,o,n)=>Us(qa,Ys,f,f,fl,e,t,o,n),Sc=(e,t,o,n)=>Us(Ua,bc(!0),fc,f,fl,e,t,o,n),Rc=(e,t,o,n)=>Us(Ga,bc(!1),fc,f,fl,e,t,o,n),Dc=(e,t,o,n)=>Us(oc,wc,fc,Ia,fl,e,t,o,n),Oc=(e,t,o,n)=>Us(nc,Ys,f,Ia,fl,e,t,o,n),kc=(e,t,o,n)=>Us(Ka,Js,f,f,yc,e,t,o,n),Ec=(e,t,o,n)=>Us(Ja,Js,f,f,xc,e,t,o,n),_c=(e,t,o,n)=>Us(Za,Ys,f,f,yc,e,t,o,n),Nc=(e,t,o,n)=>Us(ec,Ys,f,f,xc,e,t,o,n),Bc=(e,t,o,n)=>Us(tc,Ys,f,f,xc,e,t,o,n),zc=(e,t,o,n)=>Us(Ya,Js,f,f,yc,e,t,o,n),Ac=(e,t,o,n)=>Us(Qa,Js,f,f,xc,e,t,o,n),Lc=(e,t,o,n)=>Us(rc,Xs,uc,f,hl,e,t,o,n),Mc=(e,t,o,n)=>Us(sc,Zs,uc,f,hl,e,t,o,n),Wc=(e,t,o,n)=>Us(lc,Gs,uc,f,fl,e,t,o,n),jc=(e,t,o,n)=>Us(cc,vc(!0),f,f,fl,e,t,o,n),Pc=(e,t,o,n)=>Us(ic,vc(!1),f,f,fl,e,t,o,n),Ic=(e,t,o,n)=>Us(mc,Ks,f,f,fl,e,t,o,n),Fc=(e,t,o,n)=>Us(dc,Ks,f,f,fl,e,t,o,n),Hc=(e,t)=>{const o=Dr(e);return Ys(o,t).bind(e=>{const t=e[e.length-1],n=e[0].column,r=t.column+t.colspan,s=W(E(o.all,e=>B(e.cells,e=>e.column>=n&&e.column{const o=Dr(e);return Ys(o,t).bind(pr).getOr("")},Vc=(e,t)=>{const o=Dr(e);return Ys(o,t).bind(e=>{const t=e[e.length-1],n=e[0].row,r=t.row+t.rowspan;return(e=>{const t=E(e,e=>hr(e).type),o=D(t,"header"),n=D(t,"footer");if(o||n){const e=D(t,"body");return!o||e||n?o||e||!n?C.none():C.some("footer"):C.some("header")}return C.some("body")})(o.all.slice(n,r))}).getOr("")},qc=(e,t)=>{const o=t.column,n=t.column+t.colspan-1,r=t.row,s=t.row+t.rowspan-1;return o<=e.finishCol&&n>=e.startCol&&r<=e.finishRow&&s>=e.startRow},Uc=(e,t)=>t.column>=e.startCol&&t.column+t.colspan-1<=e.finishCol&&t.row>=e.startRow&&t.row+t.rowspan-1<=e.finishRow,Gc=(e,t,o)=>{const n=Er(e,t,Je),r=Er(e,o,Je);return n.bind(e=>r.map(t=>{return o=e,n=t,{startRow:Math.min(o.row,n.row),startCol:Math.min(o.column,n.column),finishRow:Math.max(o.row+o.rowspan-1,n.row+n.rowspan-1),finishCol:Math.max(o.column+o.colspan-1,n.column+n.colspan-1)};var o,n}))},Kc=(e,t,o)=>Gc(e,t,o).map(t=>{const o=_r(e,b(qc,t));return E(o,e=>e.element)}),Yc=(e,t)=>Er(e,t,(e,t)=>Qe(t,e)).map(e=>e.element),Jc=(e,t,o)=>{const n=Xc(e);return Kc(n,t,o)},Qc=(e,t,o,n,r)=>{const s=Xc(e),l=Je(e,o)?C.some(t):Yc(s,t),a=Je(e,r)?C.some(n):Yc(s,n);return l.bind(e=>a.bind(t=>Kc(s,e,t)))},Xc=Dr,Zc={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},ei=()=>Me.fromTag("th"),ti=()=>Me.fromTag("td"),oi=(e,t,o,n)=>k(e,e=>((e,t,o,n)=>{const r=Me.fromTag("tr");for(let s=0;s{let t=[];return{bind:e=>{if(void 0===e)throw new Error("Event bind error: undefined handler");t.push(e)},unbind:e=>{t=B(t,t=>t!==e)},trigger:(...o)=>{const n={};_(e,(e,t)=>{n[e]=o[t]}),_(t,e=>{e(n)})}}},ri=e=>({registry:K(e,e=>({bind:e.bind,unbind:e.unbind})),trigger:K(e,e=>e.trigger)}),si=ne(["compare","extract","mutate","sink"]),li=ne(["element","start","stop","destroy"]),ai=ne(["forceDrop","drop","move","delayDrop"]),ci=()=>{const e=(()=>{const e=ri({move:ni(["info"])});return{onEvent:f,reset:f,events:e.registry}})(),t=(()=>{let e=C.none();const t=ri({move:ni(["info"])});return{onEvent:(o,n)=>{n.extract(o).each(o=>{const r=((t,o)=>{const n=e.map(e=>t.compare(e,o));return e=C.some(o),n})(n,o);r.each(e=>{t.trigger.move(e)})})},reset:()=>{e=C.none()},events:t.registry}})();let o=e;return{on:()=>{o.reset(),o=t},off:()=>{o.reset(),o=e},isOn:()=>o===t,onEvent:(e,t)=>{o.onEvent(e,t)},events:t.events}},ii=ce("ephox-dragster").resolve;var mi=si({compare:(e,t)=>qo(t.left-e.left,t.top-e.top),extract:e=>C.some(qo(e.x,e.y)),sink:(e,t)=>{const o=(e=>{const t={layerClass:ii("blocker"),...e},o=Me.fromTag("div");return fo(o,"role","presentation"),fo(o,"data-mce-bogus","all"),_o(o,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),dn(o,ii("blocker")),dn(o,t.layerClass),{element:g(o),destroy:()=>{yo(o)}}})(t),n=oo(o.element(),"mousedown",e.forceDrop),r=oo(o.element(),"mouseup",e.drop),s=oo(o.element(),"mousemove",e.move),l=oo(o.element(),"mouseout",e.delayDrop);return li({element:o.element,start:e=>{ao(e,o.element())},stop:()=>{yo(o.element())},destroy:()=>{o.destroy(),r.unbind(),s.unbind(),l.unbind(),n.unbind()}})},mutate:(e,t)=>{e.mutate(t.left,t.top)}});const di=ce("ephox-snooker").resolve,ui=di("resizer-bar"),fi=di("resizer-rows"),gi=di("resizer-cols"),hi=e=>{const t=vn(e.parent(),"."+ui);_(t,yo)},pi=(e,t,o)=>{const n=e.origin();_(t,t=>{t.each(t=>{const r=o(n,t);dn(r,ui),ao(e.parent(),r)})})},bi=(e,t,o,n,r)=>{const s=Go(o),l=t.isResizable,a=n.length>0?ns.positions(n,o):[],c=a.length>0?((e,t)=>j(e.all,(e,o)=>t(e.element)?[o]:[]))(e,l):[];((e,t,o,n)=>{pi(e,t,(e,t)=>{const r=((e,t,o,n)=>{const r=Me.fromTag("div");return _o(r,{position:"absolute",left:t+"px",top:o-3.5+"px",height:"7px",width:n+"px"}),go(r,{"data-mce-bogus":"all","data-row":e,role:"presentation"}),r})(t.row,o.left-e.left,t.y-e.top,n);return dn(r,fi),r})})(t,B(a,(e,t)=>O(c,e=>t===e)),s,Ho(o));const i=r.length>0?ss.positions(r,o):[],m=i.length>0?((e,t)=>{const o=[];return k(e.grid.columns,n=>{Ar(e,n).map(e=>e.element).forall(t)&&o.push(n)}),B(o,o=>{const n=_r(e,e=>e.column===o);return P(n,e=>t(e.element))})})(e,l):[];((e,t,o,n)=>{pi(e,t,(e,t)=>{const r=((e,t,o,n,r)=>{const s=Me.fromTag("div");return _o(s,{position:"absolute",left:t-3.5+"px",top:o+"px",height:r+"px",width:"7px"}),go(s,{"data-mce-bogus":"all","data-column":e,role:"presentation"}),s})(t.col,t.x-e.left,o.top-e.top,0,n);return dn(r,gi),r})})(t,B(i,(e,t)=>O(m,e=>t===e)),s,Po(o))},wi=(e,t)=>{if(hi(e),e.isResizable(t)){const o=Dr(t),n=Ur(o),r=Vr(o);bi(o,e,t,n,r)}},vi=(e,t)=>{const o=vn(e.parent(),"."+ui);_(o,t)},yi=e=>{vi(e,e=>{Eo(e,"display","none")})},xi=e=>{vi(e,e=>{Eo(e,"display","block")})},Ci=di("resizer-bar-dragging"),Ti=e=>{const t=(()=>{const e=ri({drag:ni(["xDelta","yDelta","target"])});let t=C.none();const o=(()=>{const e=ri({drag:ni(["xDelta","yDelta"])});return{mutate:(t,o)=>{e.trigger.drag(t,o)},events:e.registry}})();return o.events.drag.bind(o=>{t.each(t=>{e.trigger.drag(o.xDelta,o.yDelta,t)})}),{assign:e=>{t=C.some(e)},get:()=>t,mutate:o.mutate,events:e.registry}})(),o=((e,t={})=>((e,t,o)=>{let n=!1;const r=ri({start:ni([]),stop:ni([])}),s=ci(),l=()=>{m.stop(),s.isOn()&&(s.off(),r.trigger.stop())},c=(e=>{let t=null;const o=()=>{a(t)||(clearTimeout(t),t=null)};return{cancel:o,throttle:(...n)=>{o(),t=setTimeout(()=>{t=null,e.apply(null,n)},200)}}})(l);s.events.move.bind(o=>{t.mutate(e,o.info)});const i=e=>(...t)=>{n&&e.apply(null,t)},m=t.sink(ai({forceDrop:l,drop:i(l),move:i(e=>{c.cancel(),s.onEvent(e,t)}),delayDrop:i(c.throttle)}),o);return{element:m.element,go:e=>{m.start(e),s.on(),r.trigger.start()},on:()=>{n=!0},off:()=>{n=!1},isActive:()=>n,destroy:()=>{m.destroy()},events:r.registry}})(e,t.mode??mi,t))(t,{});let n=C.none();const r=(e,t)=>C.from(ho(e,t));t.events.drag.bind(e=>{r(e.target,"data-row").each(t=>{const o=tr(e.target,"top");Eo(e.target,"top",o+e.yDelta+"px")}),r(e.target,"data-column").each(t=>{const o=tr(e.target,"left");Eo(e.target,"left",o+e.xDelta+"px")})});const s=(e,t)=>tr(e,t)-Xn(e,"data-initial-"+t,0);o.events.stop.bind(()=>{t.get().each(t=>{n.each(o=>{r(t,"data-row").each(e=>{const n=s(t,"top");bo(t,"data-initial-top"),d.trigger.adjustHeight(o,n,parseInt(e,10))}),r(t,"data-column").each(e=>{const n=s(t,"left");bo(t,"data-initial-left"),d.trigger.adjustWidth(o,n,parseInt(e,10))}),wi(e,o)})})});const l=(n,r)=>{d.trigger.startAdjust(),t.assign(n),fo(n,"data-initial-"+r,tr(n,r)),dn(n,Ci),Eo(n,"opacity","0.2"),o.go(e.dragContainer())},c=oo(e.parent(),"mousedown",e=>{var t;t=e.target,un(t,fi)&&l(e.target,"top"),(e=>un(e,gi))(e.target)&&l(e.target,"left")}),i=t=>Je(t,e.view()),m=oo(e.view(),"mouseover",t=>{var r;(r=t.target,an(r,"table",i).filter(gn)).fold(()=>{Oo(t.target)&&!(e=>un(e,"ephox-snooker-resizer-bar")||un(e,"ephox-dragster-blocker"))(t.target)&&hi(e)},t=>{o.isActive()&&(n=C.some(t),wi(e,t))})}),d=ri({adjustHeight:ni(["table","delta","row"]),adjustWidth:ni(["table","delta","column"]),startAdjust:ni([])});return{destroy:()=>{c.unbind(),m.unbind(),o.destroy(),hi(e)},refresh:t=>{wi(e,t)},on:o.on,off:o.off,hideBars:b(yi,e),showBars:b(xi,e),events:d.registry}},Si=e=>t=>t.options.get(e),Ri="100%",Di=e=>{const t=e.dom,o=t.getParent(e.selection.getStart(),t.isBlock)??e.getBody();return $o(Me.fromDom(o))+"px"},Oi=e=>C.from(e.options.get("table_clone_elements")),ki=Si("table_header_type"),Ei=Si("table_column_resizing"),_i=e=>"preservetable"===Ei(e),Ni=e=>"resizetable"===Ei(e),Bi=Si("table_sizing_mode"),zi=e=>"relative"===Bi(e),Ai=e=>"fixed"===Bi(e),Li=e=>"responsive"===Bi(e),Mi=Si("table_resize_bars"),Wi=Si("table_style_by_css"),ji=Si("table_merge_content_on_paste"),Pi=Si("table_default_header_rows"),Ii=Si("table_default_header_cols"),Fi=e=>{const t=e.options,o=t.get("table_default_attributes");return t.isSet("table_default_attributes")?o:((e,t)=>Li(e)||Wi(e)?t:Ai(e)?{...t,width:Di(e)}:{...t,width:Ri})(e,o)},Hi=Si("table_use_colgroups"),$i=e=>Me.fromDom(e.getBody()),Vi=e=>t=>Je(t,$i(e)),qi=e=>{bo(e,"data-mce-style");const t=e=>bo(e,"data-mce-style");_(ar(e),t),_(cr(e),t),_(mr(e),t)},Ui=e=>Me.fromDom(e.selection.getStart()),Gi=e=>e.getBoundingClientRect().width,Ki=e=>e.getBoundingClientRect().height,Yi=e=>/^\d+(\.\d+)?$/.test(e)?e+"px":e,Ji=e=>(t,o)=>{const n=t.dom.getStyle(o,e)||t.dom.getAttrib(o,e);return C.from(n).filter(ve).map(Yi)},Qi=Ji("width"),Xi=Ji("height"),Zi=e=>nn(e,It("table")).exists(gn),em=e=>rn(e,"table"),tm=(e,t,o)=>{const n=e=>t=>void 0!==o&&o(t)||Je(t,e);return Je(e,t)?C.some({boxes:C.some([e]),start:e,finish:t}):em(e).bind(r=>em(t).bind(s=>{if(Je(r,s))return C.some({boxes:Jc(r,e,t),start:e,finish:t});if(Qe(r,s)){const o=bn(t,"td,th",n(r)),l=o.length>0?o[o.length-1]:t;return C.some({boxes:Qc(r,e,r,t,s),start:e,finish:l})}if(Qe(s,r)){const o=bn(e,"td,th",n(s)),l=o.length>0?o[o.length-1]:e;return C.some({boxes:Qc(s,e,r,t,s),start:e,finish:l})}return((e,t)=>((e,t,o,n=y)=>{const r=[t].concat(e.up().all(t)),s=[o].concat(e.up().all(o)),l=e=>M(e,n).fold(()=>e,t=>e.slice(0,t+1)),a=l(r),c=l(s),i=L(a,t=>O(c,((e,t)=>b(e.eq,t))(e,t)));return{firstpath:a,secondpath:c,shared:i}})(Xl,e,t,void 0))(e,t).shared.bind(l=>an(l,"table",o).bind(o=>{const l=bn(t,"td,th",n(o)),a=l.length>0?l[l.length-1]:t,c=bn(e,"td,th",n(o)),i=c.length>0?c[c.length-1]:e;return C.some({boxes:Qc(o,e,r,t,s),start:i,finish:a})}))}))},om=(e,t)=>{const o=vn(e,t);return o.length>0?C.some(o):C.none()},nm=(e,t,o)=>ln(e,t).bind(t=>ln(e,o).bind(e=>Zl(em,[t,e]).map(o=>({first:t,last:e,table:o})))),rm=(e,t,o,n,r)=>((e,t)=>L(e,e=>Ge(e,t)))(e,r).bind(e=>((e,t,o)=>ir(e).bind(n=>((e,t,o,n)=>Er(e,t,Je).bind(t=>{const r=o>0?t.row+t.rowspan-1:t.row,s=n>0?t.column+t.colspan-1:t.column;return kr(e,r+o,s+n).map(e=>e.element)}))(Xc(n),e,t,o)))(e,t,o).bind(e=>((e,t)=>rn(e,"table").bind(o=>ln(o,t).bind(t=>tm(t,e).bind(e=>e.boxes.map(t=>({boxes:t,start:e.start,finish:e.finish}))))))(e,n))),sm=(e,t)=>om(e,t),lm=(e,t,o)=>nm(e,t,o).bind(t=>{const o=t=>Je(e,t),n="thead,tfoot,tbody,table",r=rn(t.first,n,o),s=rn(t.last,n,o);return r.bind(e=>s.bind(o=>Je(e,o)?((e,t,o)=>((e,t,o)=>Gc(e,t,o).bind(t=>((e,t)=>{let o=!0;const n=b(Uc,t);for(let r=t.startRow;r<=t.finishRow;r++)for(let s=t.startCol;s<=t.finishCol;s++)o=o&&kr(e,r,s).exists(n);return o?C.some(t):C.none()})(e,t)))(Xc(e),t,o))(t.table,t.first,t.last):C.none()))}),am=h,cm=e=>{const t=(e,t)=>po(e,t).exists(e=>parseInt(e,10)>1);return e.length>0&&P(e,e=>t(e,"rowspan")||t(e,"colspan"))?C.some(e):C.none()},im=(e,t,o)=>t.length<=1?C.none():lm(e,o.firstSelectedSelector,o.lastSelectedSelector).map(e=>({bounds:e,cells:t})),mm=(e,t)=>({selection:e,kill:t}),dm=()=>({tag:"none"}),um=e=>({tag:"multiple",elements:e}),fm=e=>({tag:"single",element:e}),gm=(e,t,o,n)=>({start:kn.on(e,t),finish:kn.on(o,n)}),hm=(e,t)=>{const o=Ue(e,t);return Dn(Me.fromDom(o.startContainer),o.startOffset,Me.fromDom(o.endContainer),o.endOffset)},pm=gm,bm=(e,t,o,n,r)=>Je(o,n)?C.none():tm(o,n,t).bind(t=>{const n=t.boxes.getOr([]);return n.length>1?(r(e,n,t.start,t.finish),C.some(mm(C.some(pm(o,0,o,yn(o))),!0))):C.none()}),wm=Z([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),vm=e=>an(e,"tr"),ym={...wm,verify:(e,t,o,n,r,s,l)=>an(n,"td,th",l).bind(o=>an(t,"td,th",l).map(t=>Je(o,t)?Je(n,o)&&yn(o)===r?s(t):wm.none("in same cell"):Zl(vm,[o,t]).fold(()=>((e,t,o)=>{const n=e.getRect(t),r=e.getRect(o);return r.right>n.left&&r.lefts(t)))).getOr(wm.none("default")),cata:(e,t,o,n,r)=>e.fold(t,o,n,r)},xm=It("br"),Cm=(e,t,o)=>t(e,o).bind(e=>Wt(e)&&0===Jo(e).trim().length?Cm(e,t,o):C.some(e)),Tm=(e,t,o,n)=>((e,t)=>Yt(e,t).filter(xm).orThunk(()=>Yt(e,t-1).filter(xm)))(t,o).bind(t=>n.traverse(t).fold(()=>Cm(t,n.gather,e).map(n.relative),e=>(e=>$t(e).bind(t=>{const o=Kt(t);return((e,t)=>M(e,b(Je,t)))(o,e).map(n=>((e,t,o,n)=>({parent:e,children:t,element:o,index:n}))(t,o,e,n))}))(e).map(e=>kn.on(e.parent,e.index)))),Sm=(e,t)=>({left:e.left,top:e.top+t,right:e.right,bottom:e.bottom+t}),Rm=(e,t)=>({left:e.left,top:e.top-t,right:e.right,bottom:e.bottom-t}),Dm=(e,t,o)=>({left:e.left+t,top:e.top+o,right:e.right+t,bottom:e.bottom+o}),Om=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom}),km=(e,t)=>C.some(e.getRect(t)),Em=(e,t,o)=>Mt(t)?km(e,t).map(Om):Wt(t)?((e,t,o)=>o>=0&&o0?e.getRangedRect(t,o-1,t,o):C.none())(e,t,o).map(Om):C.none(),_m=(e,t)=>Mt(t)?km(e,t).map(Om):Wt(t)?e.getRangedRect(t,0,t,yn(t)).map(Om):C.none(),Nm=Z([{none:[]},{retry:["caret"]}]),Bm=(e,t,o)=>nn(t,ta).fold(y,t=>_m(e,t).exists(e=>((e,t)=>e.leftt.right)(o,e))),zm={point:e=>e.bottom,adjuster:(e,t,o,n,r)=>{const s=Sm(r,5);return Math.abs(o.bottom-n.bottom)<1||o.top>r.bottom?Nm.retry(s):o.top===r.bottom?Nm.retry(Sm(r,1)):Bm(e,t,r)?Nm.retry(Dm(s,5,0)):Nm.none()},move:Sm,gather:Kl},Am=(e,t,o,n,r)=>0===r?C.some(n):((e,t,o)=>e.elementFromPoint(t,o).filter(e=>"table"===Nt(e)).isSome())(e,n.left,t.point(n))?((e,t,o,n,r)=>Am(e,t,o,t.move(n,5),r))(e,t,o,n,r-1):e.situsFromPoint(n.left,t.point(n)).bind(s=>s.start.fold(C.none,s=>_m(e,s).bind(l=>t.adjuster(e,s,l,o,n).fold(C.none,n=>Am(e,t,o,n,r-1))).orThunk(()=>C.some(n)),C.none)),Lm=(e,t,o)=>{const n=e.move(o,5),r=Am(t,e,o,n,100).getOr(n);return((e,t,o)=>e.point(t)>o.getInnerHeight()?C.some(e.point(t)-o.getInnerHeight()):e.point(t)<0?C.some(-e.point(t)):C.none())(e,r,t).fold(()=>t.situsFromPoint(r.left,e.point(r)),o=>(t.scrollBy(0,o),t.situsFromPoint(r.left,e.point(r)-o)))},Mm={tryUp:b(Lm,{point:e=>e.top,adjuster:(e,t,o,n,r)=>{const s=Rm(r,5);return Math.abs(o.top-n.top)<1||o.bottome.getSelection().bind(n=>((e,t,o,n)=>{const r=xm(t)?((e,t,o)=>o.traverse(t).orThunk(()=>Cm(t,o.gather,e)).map(o.relative))(e,t,n):Tm(e,t,o,n);return r.map(e=>({start:e,finish:e}))})(t,n.finish,n.foffset,o).fold(()=>C.some(Wl(n.finish,n.foffset)),r=>{const s=e.fromSitus(r);return l=ym.verify(e,n.finish,n.foffset,s.finish,s.foffset,o.failure,t),ym.cata(l,e=>C.none(),()=>C.none(),e=>C.some(Wl(e,0)),e=>C.some(Wl(e,yn(e))));var l})),jm=(e,t,o,n,r,s)=>0===s?C.none():Fm(e,t,o,n,r).bind(l=>{const a=e.fromSitus(l),c=ym.verify(e,o,n,a.finish,a.foffset,r.failure,t);return ym.cata(c,()=>C.none(),()=>C.some(l),l=>Je(o,l)&&0===n?Pm(e,o,n,Rm,r):jm(e,t,l,0,r,s-1),l=>Je(o,l)&&n===yn(l)?Pm(e,o,n,Sm,r):jm(e,t,l,yn(l),r,s-1))}),Pm=(e,t,o,n,r)=>Em(e,t,o).bind(t=>Im(e,r,n(t,Mm.getJumpSize()))),Im=(e,t,o)=>{const n=kt().browser;return n.isChromium()||n.isSafari()||n.isFirefox()?t.retry(e,o):C.none()},Fm=(e,t,o,n,r)=>Em(e,o,n).bind(t=>Im(e,r,t)),Hm=(e,t,o,n,r)=>an(n,"td,th",t).bind(n=>an(n,"table",t).bind(s=>((e,t)=>on(e,e=>$t(e).exists(e=>Je(e,t)),void 0).isSome())(r,s)?((e,t,o)=>Wm(e,t,o).bind(n=>jm(e,t,n.element,n.offset,o,20).map(e.fromSitus)))(e,t,o).bind(e=>an(e.finish,"td,th",t).map(t=>({start:n,finish:t,range:e}))):C.none())),$m=(e,t,o,n,r,s)=>s(n,t).orThunk(()=>Hm(e,t,o,n,r).map(e=>{const t=e.range;return mm(C.some(pm(t.start,t.soffset,t.finish,t.foffset)),!0)})),Vm=(e,t)=>an(e,"tr",t).bind(e=>an(e,"table",t).bind(o=>{const n=vn(o,"tr");return Je(e,n[0])?((e,t,o)=>Vl(Ul,e,e=>Sn(e).isSome(),o))(o,0,t).map(e=>{const t=yn(e);return mm(C.some(pm(e,t,e,t)),!0)}):C.none()})),qm=(e,t)=>an(e,"tr",t).bind(e=>an(e,"table",t).bind(o=>{const n=vn(o,"tr");return Je(e,n[n.length-1])?((e,t,o)=>ql(Ul,e,e=>Tn(e).isSome(),o))(o,0,t).map(e=>mm(C.some(pm(e,0,e,0)),!0)):C.none()})),Um=(e,t,o,n,r,s,l)=>Hm(e,o,n,r,s).bind(e=>bm(t,o,e.start,e.finish,l)),Gm=(e,t)=>an(e,"td,th",t),Km=e=>Vt(e).exists(gn),Ym={traverse:Gt,gather:Kl,relative:kn.before,retry:Mm.tryDown,failure:ym.failedDown},Jm={traverse:Ut,gather:Gl,relative:kn.before,retry:Mm.tryUp,failure:ym.failedUp},Qm=e=>t=>t===e,Xm=Qm(38),Zm=Qm(40),ed=e=>e>=37&&e<=40,td={isBackward:Qm(37),isForward:Qm(39)},od={isBackward:Qm(39),isForward:Qm(37)},nd=e=>({elementFromPoint:(t,o)=>Me.fromPoint(Me.fromDom(e.document),t,o),getRect:e=>e.dom.getBoundingClientRect(),getRangedRect:(t,o,n,r)=>{const s=_n.exact(t,o,n,r);return((e,t)=>(e=>{const t=e.getClientRects(),o=t.length>0?t[0]:e.getBoundingClientRect();return o.width>0||o.height>0?C.some(o).map(He):C.none()})(Ue(e,t)))(e,s)},getSelection:()=>Fn(e).map(t=>hm(e,t)),fromSitus:t=>{const o=_n.relative(t.start,t.finish);return hm(e,o)},situsFromPoint:(t,o)=>Hn(e,t,o).map(e=>gm(e.start,e.soffset,e.finish,e.foffset)),clearSelection:()=>{(e=>{Bn(e).each(e=>e.removeAllRanges())})(e)},collapseSelection:(t=!1)=>{Fn(e).each(o=>o.fold(e=>e.collapse(t),(o,n)=>{const r=t?o:n;Wn(e,r,r)},(o,n,r,s)=>{const l=t?o:r,a=t?n:s;Mn(e,l,a,l,a)}))},setSelection:t=>{Mn(e,t.start,t.soffset,t.finish,t.foffset)},setRelativeSelection:(t,o)=>{Wn(e,t,o)},selectNode:t=>{In(e,t,!1)},selectContents:t=>{In(e,t)},getInnerHeight:()=>e.innerHeight,getScrollY:()=>(e=>{const t=void 0!==e?e.dom:document,o=t.body.scrollLeft||t.documentElement.scrollLeft,n=t.body.scrollTop||t.documentElement.scrollTop;return qo(o,n)})(Me.fromDom(e.document)).top,scrollBy:(t,o)=>{((e,t,o)=>{const n=(void 0!==o?o.dom:document).defaultView;n&&n.scrollBy(e,t)})(t,o,Me.fromDom(e.document))}}),rd=(e,t)=>({rows:e,cols:t}),sd=e=>nn(e,Lt).exists(gn),ld=(e,t)=>sd(e)||sd(t),ad="data-mce-selected",cd="data-mce-first-selected",id="data-mce-last-selected",md="["+ad+"]",dd={selected:ad,selectedSelector:"td["+ad+"],th["+ad+"]",firstSelected:cd,firstSelectedSelector:"td["+cd+"],th["+cd+"]",lastSelected:id,lastSelectedSelector:"td["+id+"],th["+id+"]"},ud=(e,t,o)=>({element:o,mergable:im(t,e,dd),unmergable:cm(e),selection:am(e)}),fd=e=>(t,o)=>{const n=Nt(t),r="col"===n||"colgroup"===n?ir(s=t).bind(e=>sm(e,dd.firstSelectedSelector)).fold(g(s),e=>e[0]):t;var s;return an(r,e,o)},gd=fd("th,td,caption"),hd=fd("th,td"),pd=e=>{return t=e.model.table.getSelectedCells(),E(t,Me.fromDom);var t},bd=(e,t)=>{e.on("BeforeGetContent",t=>{const o=o=>{t.preventDefault(),(e=>ir(e[0]).map(e=>{const t=((e,t)=>{const o=e=>Ge(e.element,t),n=So(e),r=vr(n),s=As(e),l=Or(r),a=((e,t)=>{const o=e.grid.columns;let n=e.grid.rows,r=o,s=0,l=0;const a=[],c=[];return G(e.access,e=>{if(a.push(e),t(e)){c.push(e);const t=e.row,o=t+e.rowspan-1,a=e.column,i=a+e.colspan-1;ts&&(s=o),al&&(l=i)}}),((e,t,o,n,r,s)=>({minRow:e,minCol:t,maxRow:o,maxCol:n,allCells:r,selectedCells:s}))(n,r,s,l,a,c)})(l,o),c="th:not("+t+"),td:not("+t+")",i=sr(n,"th,td",e=>Ge(e,c));_(i,yo),((e,t,o,n)=>{const r=B(e,e=>"colgroup"!==e.section),s=t.grid.columns,l=t.grid.rows;for(let e=0;eo.maxRow||ao.maxCol||(kr(t,e,a).filter(n).isNone()?al(r,l,e):l=!0)}})(r,l,a,o);const m=((e,t,o,n)=>{if(0===n.minCol&&t.grid.columns===n.maxCol+1)return 0;const r=Es(t,e,o),s=A(r,(e,t)=>e+t,0),l=A(r.slice(n.minCol,n.maxCol+1),(e,t)=>e+t,0),a=l/s*o.pixelWidth()-o.pixelWidth();return o.getCellDelta(a)})(e,Dr(e),s,a);return((e,t,o,n)=>{G(o.columns,e=>{(e.columnt.maxCol)&&yo(e.element)});const r=B(rr(e,"tr"),e=>0===e.dom.childElementCount);_(r,yo),t.minCol!==t.maxCol&&t.minRow!==t.maxRow||_(rr(e,"th,td"),e=>{bo(e,"rowspan"),bo(e,"colspan")}),bo(e,yr),bo(e,"data-snooker-col-series"),As(e).adjustTableWidth(n)})(n,a,l,m),n})(e,md);return qi(t),[t]}))(o).each(o=>{const n="text"===t.format?((e,t)=>{const o=e.getDoc(),n=Qt(Me.fromDom(e.getBody())),r=Me.fromTag("div",o);fo(r,"data-mce-bogus","all"),_o(r,{position:"fixed",left:"-9999999px",top:"0",overflow:"hidden",opacity:"0"});const s=(e=>Jt(e)?e:Me.fromDom(Ht(e).dom.body))(n);mo(r,t),ao(s,r);const l=r.dom.innerText;return yo(r),l})(e,o):((e,t)=>E(t,t=>e.selection.serializer.serialize(t.dom,{})).join(""))(e,o);t.content=n})};if(!0===t.selection){const t=(e=>B(pd(e),e=>Ge(e,dd.selectedSelector)))(e);t.length>=1&&o(t)}}),e.on("BeforeSetContent",o=>{if(!0===o.selection&&!0===o.paste){const n=pd(e);H(n).each(n=>{ir(n).each(r=>{const s=B((e=>{const t=document.createElement("div");return t.innerHTML=e,Kt(Me.fromDom(t))})(o.content),e=>"meta"!==Nt(e)),l=It("table");if(ji(e)&&1===s.length&&l(s[0])){o.preventDefault();const l=Me.fromDom(e.getDoc()),a=pa(l),c=((e,t,o)=>({element:e,clipboard:t,generators:o}))(n,s[0],a);t.pasteCells(r,c).each(()=>{e.focus()})}})})}})},wd=(e,t)=>e.dispatch("NewRow",{node:t}),vd=(e,t)=>e.dispatch("NewCell",{node:t}),yd=(e,t,o)=>{e.dispatch("TableModified",{...o,table:t})},xd={structure:!1,style:!0},Cd={structure:!0,style:!1},Td={structure:!0,style:!0},Sd=(e,t)=>zi(e)?Ms(t):Ai(e)?Ls(t):As(t),Rd=(e,t,o)=>{const n=e=>"table"===Nt($i(e)),r=Oi(e),s=Ni(e)?f:rl,l=t=>{switch(ki(e)){case"section":return Ir();case"sectionCells":return Fr();case"cells":return Hr();default:return((e,t)=>{var o;switch((o=Dr(e),V(o.all,e=>{const t=hr(e);return"header"===t.type?C.from(t.subType):C.none()})).getOr(t)){case"section":return Wr();case"sectionCells":return jr();case"cells":return Pr()}})(t,"section")}},a=(n,s,a,c)=>(i,m,d=!1)=>{qi(i);const u=Me.fromDom(e.getDoc()),f=ha(a,u,r),g={sizing:Sd(e,i),resize:Ni(e)?Jn():Qn(),section:l(i)};return s(i)?n(i,m,f,g).bind(n=>{t.refresh(i.dom),_(n.newRows,t=>{wd(e,t.dom)}),_(n.newCells,t=>{vd(e,t.dom)});const r=((t,n)=>n.cursor.fold(()=>{const n=ar(t);return H(n).filter(Oo).map(n=>{o.clearSelectedCells(t.dom);const r=e.dom.createRng();return r.selectNode(n.dom),e.selection.setRng(r),fo(n,"data-mce-selected","1"),r})},n=>{const r=Fl(Hl,n),s=e.dom.createRng();return s.setStart(r.element.dom,r.offset),s.setEnd(r.element.dom,r.offset),e.selection.setRng(s),o.clearSelectedCells(t.dom),C.some(s)}))(i,n);return Oo(i)&&(qi(i),d||yd(e,i.dom,c)),r.map(e=>({rng:e,effect:c}))}):C.none()},c=a(Oc,t=>!n(e)||ba(t).rows>1,f,Cd),i=a(Dc,t=>!n(e)||ba(t).columns>1,f,Cd);return{deleteRow:c,deleteColumn:i,insertRowsBefore:a(Cc,x,f,Cd),insertRowsAfter:a(Tc,x,f,Cd),insertColumnsBefore:a(Sc,x,s,Cd),insertColumnsAfter:a(Rc,x,s,Cd),mergeCells:a(Lc,x,f,Cd),unmergeCells:a(Mc,x,f,Cd),pasteColsBefore:a(jc,x,f,Cd),pasteColsAfter:a(Pc,x,f,Cd),pasteRowsBefore:a(Ic,x,f,Cd),pasteRowsAfter:a(Fc,x,f,Cd),pasteCells:a(Wc,x,f,Td),makeCellsHeader:a(zc,x,f,Cd),unmakeCellsHeader:a(Ac,x,f,Cd),makeColumnsHeader:a(kc,x,f,Cd),unmakeColumnsHeader:a(Ec,x,f,Cd),makeRowsHeader:a(_c,x,f,Cd),makeRowsBody:a(Nc,x,f,Cd),makeRowsFooter:a(Bc,x,f,Cd),getTableRowType:Vc,getTableCellType:$c,getTableColType:Hc}},Dd=(e,t)=>{e.selection.select(t.dom,!0),e.selection.collapse(!0)},Od=(e,t,o,n,s)=>{const l=(e=>{const t=e.options,o=t.get("table_default_styles");return t.isSet("table_default_styles")?o:((e,t)=>Li(e)||!Wi(e)?t:Ai(e)?{...t,width:Di(e)}:{...t,width:Ri})(e,o)})(e),a={styles:l,attributes:Fi(e),colGroups:Hi(e)};return e.undoManager.ignore(()=>{const r=((e,t,o,n,r,s=Zc)=>{const l=Me.fromTag("table"),a="cells"!==r;_o(l,s.styles),go(l,s.attributes),s.colGroups&&ao(l,(e=>{const t=Me.fromTag("colgroup");return k(e,()=>ao(t,Me.fromTag("col"))),t})(t));const c=Math.min(e,o);if(a&&o>0){const e=Me.fromTag("thead");ao(l,e);const s=oi(o,t,"sectionCells"===r?c:0,n);mo(e,s)}const i=Me.fromTag("tbody");ao(l,i);const m=oi(a?e-c:e,t,a?0:o,n);return mo(i,m),l})(o,t,s,n,ki(e),a);fo(r,"data-mce-id","__mce");const l=(e=>{const t=Me.fromTag("div"),o=Me.fromDom(e.dom.cloneNode(!0));return ao(t,o),(e=>e.dom.innerHTML)(t)})(r);e.insertContent(l),e.addVisual()}),ln($i(e),'table[data-mce-id="__mce"]').map(t=>(Ai(e)?la(t):Li(e)?aa(t):(zi(e)||(e=>r(e)&&-1!==e.indexOf("%"))(l.width))&&sa(t),qi(t),bo(t,"data-mce-id"),((e,t)=>{_(vn(t,"tr"),t=>{wd(e,t.dom),_(vn(t,"th,td"),t=>{vd(e,t.dom)})})})(e,t),((e,t)=>{ln(t,"td,th").each(b(Dd,e))})(e,t),t.dom)).getOrNull()};var kd=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const Ed="x-tinymce/dom-table-",_d=Ed+"rows",Nd=Ed+"columns",Bd=e=>{const t=kd.FakeClipboardItem(e);kd.write([t])},zd=e=>{const t=kd.read()??[];return V(t,t=>C.from(t.getType(e)))},Ad=e=>{zd(e).isSome()&&kd.clear()},Ld=e=>{e.fold(Wd,e=>Bd({[_d]:e}))},Md=()=>zd(_d),Wd=()=>Ad(_d),jd=e=>{e.fold(Id,e=>Bd({[Nd]:e}))},Pd=()=>zd(Nd),Id=()=>Ad(Nd),Fd=e=>gd(Ui(e),Vi(e)).filter(Zi),Hd=(e,t)=>{const o=Vi(e),n=e=>ir(e,o),l=t=>(e=>hd(Ui(e),Vi(e)).filter(Zi))(e).bind(e=>n(e).map(o=>t(o,e))),a=t=>{e.focus()},c=(t,o=!1)=>l((n,r)=>{const s=ud(pd(e),n,r);t(n,s,o).each(a)}),i=()=>l((t,o)=>((e,t,o)=>{const n=Dr(e);return Ys(n,t).bind(e=>{const t=Hs(n,o,!1),r=ze(t).rows.slice(e[0].row,e[e.length-1].row+e[e.length-1].rowspan),s=j(r,e=>{const t=B(e.cells,e=>!e.isLocked);return t.length>0?[{...e,cells:t}]:[]}),l=$s(s);return de(l.length>0,l)}).map(e=>E(e,e=>{const t=To(e.element);return _(e.cells,e=>{const o=So(e.element);Ws(o,"colspan",e.colspan,1),Ws(o,"rowspan",e.rowspan,1),ao(t,o)}),t}))})(t,ud(pd(e),t,o),ha(f,Me.fromDom(e.getDoc()),C.none()))),m=()=>l((t,o)=>((e,t)=>{const o=Dr(e);return Js(o,t).map(e=>{const t=e[e.length-1],n=e[0].column,r=t.column+t.colspan,s=((e,t,o)=>{if(zr(e)){const n=B(Br(e),ll(t,o)),r=E(n,e=>{const n=So(e.element);return sl(n,"span",o-t),n}),s=Me.fromTag("colgroup");return mo(s,r),[s]}return[]})(o,n,r),l=((e,t,o)=>E(e.all,e=>{const n=B(e.cells,ll(t,o)),r=E(n,e=>{const n=So(e.element);return sl(n,"colspan",o-t),n}),s=Me.fromTag("tr");return mo(s,r),s}))(o,n,r);return[...s,...l]})})(t,ud(pd(e),t,o))),d=(t,o)=>o().each(o=>{const n=E(o,e=>So(e));l((o,r)=>{const s=pa(Me.fromDom(e.getDoc())),l=((e,t,o,n)=>({selection:am(e),clipboard:o,generators:n}))(pd(e),0,n,s);t(o,l).each(a)})}),g=e=>(t,o)=>((e,t)=>X(e,t)?C.from(e[t]):C.none())(o,"type").each(t=>{c(e(t),o.no_events)});G({mceTableSplitCells:()=>c(t.unmergeCells),mceTableMergeCells:()=>c(t.mergeCells),mceTableInsertRowBefore:()=>c(t.insertRowsBefore),mceTableInsertRowAfter:()=>c(t.insertRowsAfter),mceTableInsertColBefore:()=>c(t.insertColumnsBefore),mceTableInsertColAfter:()=>c(t.insertColumnsAfter),mceTableDeleteCol:()=>c(t.deleteColumn),mceTableDeleteRow:()=>c(t.deleteRow),mceTableCutCol:()=>m().each(e=>{jd(e),c(t.deleteColumn)}),mceTableCutRow:()=>i().each(e=>{Ld(e),c(t.deleteRow)}),mceTableCopyCol:()=>m().each(e=>jd(e)),mceTableCopyRow:()=>i().each(e=>Ld(e)),mceTablePasteColBefore:()=>d(t.pasteColsBefore,Pd),mceTablePasteColAfter:()=>d(t.pasteColsAfter,Pd),mceTablePasteRowBefore:()=>d(t.pasteRowsBefore,Md),mceTablePasteRowAfter:()=>d(t.pasteRowsAfter,Md),mceTableDelete:()=>Fd(e).each(t=>{ir(t,o).filter(w(o)).each(t=>{const o=Me.fromText("");if(so(t,o),yo(t),e.dom.isEmpty(e.getBody()))e.setContent(""),e.selection.setCursorLocation();else{const t=e.dom.createRng();t.setStart(o.dom,0),t.setEnd(o.dom,0),e.selection.setRng(t),e.nodeChanged()}})}),mceTableCellToggleClass:(t,o)=>{l(t=>{const n=pd(e),r=P(n,t=>e.formatter.match("tablecellclass",{value:o},t.dom)),s=r?e.formatter.remove:e.formatter.apply;_(n,e=>s("tablecellclass",{value:o},e.dom)),yd(e,t.dom,xd)})},mceTableToggleClass:(t,o)=>{l(t=>{e.formatter.toggle("tableclass",{value:o},t.dom),yd(e,t.dom,xd)})},mceTableToggleCaption:()=>{Fd(e).each(t=>{ir(t,o).each(o=>{sn(o,"caption").fold(()=>{const t=Me.fromTag("caption");ao(t,Me.fromText("Caption")),((e,t)=>{Yt(e,0).fold(()=>{ao(e,t)},e=>{ro(e,t)})})(o,t),e.selection.setCursorLocation(t.dom,0)},n=>{It("caption")(t)&&Ye("td",o).each(t=>e.selection.setCursorLocation(t.dom,0)),yo(n)}),yd(e,o.dom,Cd)})})},mceTableSizingMode:(t,n)=>(t=>Fd(e).each(n=>{Li(e)||Ai(e)||zi(e)||ir(n,o).each(o=>{"relative"!==t||Rl(o)?"fixed"!==t||Dl(o)?"responsive"!==t||Ol(o)||aa(o):la(o):sa(o),qi(o),yd(e,o.dom,Cd)})}))(n),mceTableCellType:g(e=>"th"===e?t.makeCellsHeader:t.unmakeCellsHeader),mceTableColType:g(e=>"th"===e?t.makeColumnsHeader:t.unmakeColumnsHeader),mceTableRowType:g(e=>{switch(e){case"header":return t.makeRowsHeader;case"footer":return t.makeRowsFooter;default:return t.makeRowsBody}})},(t,o)=>e.addCommand(o,t)),e.addCommand("mceInsertTable",(t,o)=>{((e,t,o,n={})=>{const r=e=>u(e)&&e>0;if(r(t)&&r(o)){const r=n.headerRows??Pi(e),s=n.headerColumns??Ii(e);return Od(e,o,t,s,r)}console.error("Invalid values for mceInsertTable - rows and columns values are required to insert a table.")})(e,o.rows,o.columns,o.options)}),e.addCommand("mceTableApplyCellStyle",(t,o)=>{const l=e=>"tablecell"+e.toLowerCase().replace("-","");if(!s(o))return;const a=B(pd(e),Zi);if(0===a.length)return;const c=((e,t)=>{const o={};return((e,t,o,n)=>{G(e,(e,r)=>{(t(e,r)?o:n)(e,r)})})(e,t,(e=>(t,o)=>{e[o]=t})(o),f),o})(o,(t,o)=>e.formatter.has(l(o))&&r(t));(e=>{for(const t in e)if(U.call(e,t))return!1;return!0})(c)||(G(c,(t,o)=>{const n=l(o);_(a,o=>{""===t?e.formatter.remove(n,{value:null},o.dom,!0):e.formatter.apply(n,{value:t},o.dom)})}),n(a[0]).each(t=>yd(e,t.dom,xd)))})},$d=e=>!un(Me.fromDom(e.target),"ephox-snooker-resizer-bar"),Vd=(e,t)=>{const o=(r=dd.selectedSelector,{get:()=>sm(Me.fromDom(e.getBody()),r).fold(()=>hd(Ui(e),Vi(e)).fold(dm,fm),um)}),n=((e,t,o)=>{const n=t=>{bo(t,e.selected),bo(t,e.firstSelected),bo(t,e.lastSelected)},r=t=>{fo(t,e.selected,"1")},s=e=>{l(e),o()},l=t=>{const o=vn(t,`${e.selectedSelector},${e.firstSelectedSelector},${e.lastSelectedSelector}`);_(o,n)};return{clearBeforeUpdate:l,clear:s,selectRange:(o,n,l,a)=>{s(o),_(n,r),fo(l,e.firstSelected,"1"),fo(a,e.lastSelected,"1"),t(n,l,a)},selectedSelector:e.selectedSelector,firstSelectedSelector:e.firstSelectedSelector,lastSelectedSelector:e.lastSelectedSelector}})(dd,(t,o,n)=>{ir(o).each(r=>{const s=E(t,e=>e.dom),l=Oi(e),a=ha(f,Me.fromDom(e.getDoc()),l),c=((e,t,o)=>{const n=Dr(e);return Ys(n,t).map(e=>{const t=Hs(n,o,!1),{rows:r}=ze(t),s=((e,t)=>{const o=e.slice(0,t[t.length-1].row+1),n=$s(o);return j(n,e=>{const o=e.cells.slice(0,t[t.length-1].column+1);return E(o,e=>e.element)})})(r,e),l=((e,t)=>{const o=e.slice(t[0].row+t[0].rowspan-1,e.length),n=$s(o);return j(n,e=>{const o=e.cells.slice(t[0].column+t[0].colspan-1,e.cells.length);return E(o,e=>e.element)})})(r,e);return{upOrLeftCells:s,downOrRightCells:l}})})(r,{selection:pd(e)},a).map(e=>K(e,e=>E(e,e=>e.dom))).getOrUndefined();((e,t,o,n,r)=>{e.dispatch("TableSelectionChange",{cells:t,start:o,finish:n,otherCells:r})})(e,s,o.dom,n.dom,c)})},()=>(e=>{e.dispatch("TableSelectionClear")})(e));var r;return e.on("init",o=>{const r=e.getWin(),s=$i(e),l=Vi(e),a=((e,t,o,n)=>{const r=((e,t,o,n)=>{const r=fe(),s=r.clear,l=s=>{r.on(r=>{n.clearBeforeUpdate(t),Gm(s.target,o).each(l=>{tm(r,l,o).each(o=>{const r=o.boxes.getOr([]);if(1===r.length){const e=r[0],o="false"===hn(e),l=ie(fn(s.target),e,Je);o&&l&&n.selectRange(t,r,e,e)}else r.length>1&&(n.selectRange(t,r,o.start,o.finish),e.selectContents(l))})})})};return{clearstate:s,mousedown:e=>{n.clear(t),Gm(e.target,o).filter(Km).each(r.set)},mouseover:e=>{l(e)},mouseup:e=>{l(e),s()}}})(nd(e),t,o,n);return{clearstate:r.clearstate,mousedown:r.mousedown,mouseover:r.mouseover,mouseup:r.mouseup}})(r,s,l,n),c=((e,t,o,n)=>{const r=nd(e),s=()=>(n.clear(t),C.none());return{keydown:(e,l,a,c,i,m)=>{const d=e.raw,u=d.which,f=!0===d.shiftKey,g=om(t,n.selectedSelector).fold(()=>(ed(u)&&!f&&n.clearBeforeUpdate(t),ed(u)&&f&&!ld(l,c)?C.none:Zm(u)&&f?b(Um,r,t,o,Ym,c,l,n.selectRange):Xm(u)&&f?b(Um,r,t,o,Jm,c,l,n.selectRange):Zm(u)?b($m,r,o,Ym,c,l,qm):Xm(u)?b($m,r,o,Jm,c,l,Vm):C.none),e=>{const o=o=>()=>{const s=V(o,o=>((e,t,o,n,r)=>rm(n,e,t,r.firstSelectedSelector,r.lastSelectedSelector).map(e=>(r.clearBeforeUpdate(o),r.selectRange(o,e.boxes,e.start,e.finish),e.boxes)))(o.rows,o.cols,t,e,n));return s.fold(()=>nm(t,n.firstSelectedSelector,n.lastSelectedSelector).map(e=>{const o=Zm(u)||m.isForward(u)?kn.after:kn.before;return r.setRelativeSelection(kn.on(e.first,0),o(e.table)),n.clear(t),mm(C.none(),!0)}),e=>C.some(mm(C.none(),!0)))};return ed(u)&&f&&!ld(l,c)?C.none:Zm(u)&&f?o([rd(1,0)]):Xm(u)&&f?o([rd(-1,0)]):m.isBackward(u)&&f?o([rd(0,-1),rd(-1,0)]):m.isForward(u)&&f?o([rd(0,1),rd(1,0)]):ed(u)&&!f?s:C.none});return g()},keyup:(e,r,s,l,a)=>om(t,n.selectedSelector).fold(()=>{const c=e.raw,i=c.which;return!0===c.shiftKey&&ed(i)&&ld(r,l)?((e,t,o,n,r,s,l)=>Je(o,r)&&n===s?C.none():an(o,"td,th",t).bind(o=>an(r,"td,th",t).bind(n=>bm(e,t,o,n,l))))(t,o,r,s,l,a,n.selectRange):C.none()},C.none)}})(r,s,l,n),i=((e,t,o,n)=>{const r=nd(e);return(e,s)=>{n.clearBeforeUpdate(t),tm(e,s,o).each(e=>{const o=e.boxes.getOr([]);n.selectRange(t,o,e.start,e.finish),r.selectContents(s),r.collapseSelection()})}})(r,s,l,n);e.on("TableSelectorChange",e=>i(e.start,e.finish));const m=(t,o)=>{(e=>!0===e.raw.shiftKey)(t)&&(o.kill&&t.kill(),o.selection.each(t=>{const o=_n.relative(t.start,t.finish),n=Ue(r,o);e.selection.setRng(n)}))},d=e=>0===e.button,u=(()=>{const e=ee(Me.fromDom(s)),t=ee(0);return{touchEnd:o=>{const n=Me.fromDom(o.target);if(It("td")(n)||It("th")(n)){const r=e.get(),s=t.get();Je(r,n)&&o.timeStamp-s<300&&(o.preventDefault(),i(n,n))}e.set(n),t.set(o.timeStamp)}}})();e.on("dragstart",e=>{a.clearstate()}),e.on("mousedown",e=>{d(e)&&$d(e)&&a.mousedown(no(e))}),e.on("mouseover",e=>{var t;(void 0===(t=e).buttons||1&t.buttons)&&$d(e)&&a.mouseover(no(e))}),e.on("mouseup",e=>{d(e)&&$d(e)&&a.mouseup(no(e))}),e.on("touchend",u.touchEnd),e.on("keyup",t=>{const o=no(t);if(o.raw.shiftKey&&ed(o.raw.which)){const t=e.selection.getRng(),n=Me.fromDom(t.startContainer),r=Me.fromDom(t.endContainer);c.keyup(o,n,t.startOffset,r,t.endOffset).each(e=>{m(o,e)})}}),e.on("keydown",o=>{const n=no(o);t.hide();const r=e.selection.getRng(),s=Me.fromDom(r.startContainer),l=Me.fromDom(r.endContainer),a=Zo(td,od)(Me.fromDom(e.selection.getStart()));c.keydown(n,s,r.startOffset,l,r.endOffset,a).each(e=>{m(n,e)}),t.show()}),e.on("NodeChange",()=>{const t=e.selection,o=Me.fromDom(t.getStart()),r=Me.fromDom(t.getEnd());Zl(ir,[o,r]).fold(()=>n.clear(s),f)})}),e.on("PreInit",()=>{e.serializer.addTempAttr(dd.firstSelected),e.serializer.addTempAttr(dd.lastSelected)}),{getSelectedCells:()=>((e,t)=>{switch(e.tag){case"none":return t();case"single":return(e=>[e.dom])(e.element);case"multiple":return(e=>E(e,e=>e.dom))(e.elements)}})(o.get(),g([])),clearSelectedCells:e=>n.clear(Me.fromDom(e))}},qd=e=>m(e)&&"TABLE"===e.nodeName,Ud="bar-",Gd=e=>"false"!==ho(e,"data-mce-resize"),Kd=e=>{const t=fe(),o=fe(),n=fe();let r,s,l,a;const c=t=>Sd(e,t),i=()=>_i(e)?Qn():Jn(),m=(t,o,n,m)=>{const d=(e=>{return pe(t=e,"corner-")?(e=>e.substring(7))(t):t;var t})(o),u=be(d,"e"),f=pe(d,"n");if(""===s&&sa(t),""===a&&(e=>{const t=(e=>jo(e)+"px")(e);Sl(e,C.none(),C.some(t)),ra(e)})(t),n!==r&&""!==s){Eo(t,"width",s);const o=i(),l=c(t),a=_i(e)||u?(e=>ba(e).columns)(t)-1:0;ol(t,n-r,a,o,l)}else if((e=>/^(\d+(\.\d+)?)%$/.test(e))(s)){const e=parseFloat(s.replace("%",""));Eo(t,"width",n*e/r+"%")}if((e=>/^(\d+(\.\d+)?)px$/.test(e))(s)&&(e=>{const t=Dr(e);zr(t)||_(ar(e),e=>{const t=No(e,"width");Eo(e,"width",t),bo(e,"width")})})(t),m!==l&&""!==a){Eo(t,"height",a);const e=f?0:(e=>ba(e).rows)(t)-1;nl(t,m-l,e)}};e.on("init",()=>{const r=((e,t)=>((e,t)=>({parent:g(e),view:g(e),dragContainer:g(e),origin:()=>Go(e),isResizable:t}))(Me.fromDom(e.getBody()),t))(e,Gd);if(n.set(r),(e=>{const t=e.options.get("object_resizing");return D(t.split(","),"table")})(e)&&Mi(e)){const n=((e,t,o)=>{const n=ns,r=ss,s=Ti(e),l=ri({beforeResize:ni(["table","type"]),afterResize:ni(["table","type"]),startDrag:ni([])});return s.events.adjustHeight.bind(e=>{const t=e.table;l.trigger.beforeResize(t,"row");const o=n.delta(e.delta,t);nl(t,o,e.row),l.trigger.afterResize(t,"row")}),s.events.startAdjust.bind(e=>{l.trigger.startDrag()}),s.events.adjustWidth.bind(e=>{const n=e.table;l.trigger.beforeResize(n,"col");const s=r.delta(e.delta,n),a=o(n);ol(n,s,e.column,t,a),l.trigger.afterResize(n,"col")}),{on:s.on,off:s.off,refreshBars:s.refresh,hideBars:s.hideBars,showBars:s.showBars,destroy:s.destroy,events:l.registry}})(r,i(),c);e.mode.isReadOnly()||n.on(),n.events.startDrag.bind(o=>{t.set(e.selection.getRng())}),n.events.beforeResize.bind(t=>{const o=t.table.dom;((e,t,o,n,r)=>{e.dispatch("ObjectResizeStart",{target:t,width:o,height:n,origin:r})})(e,o,Gi(o),Ki(o),Ud+t.type)}),n.events.afterResize.bind(o=>{const n=o.table,r=n.dom;qi(n),t.on(t=>{e.selection.setRng(t),e.focus()}),((e,t,o,n,r)=>{e.dispatch("ObjectResized",{target:t,width:o,height:n,origin:r})})(e,r,Gi(r),Ki(r),Ud+o.type),e.undoManager.add()}),o.set(n)}}),e.on("ObjectResizeStart",t=>{const o=t.target;if(qd(o)&&!e.mode.isReadOnly()){const n=Me.fromDom(o);_(e.dom.select(".mce-clonedresizable"),t=>{e.dom.addClass(t,"mce-"+Ei(e)+"-columns")}),!Dl(n)&&Ai(e)?la(n):!Rl(n)&&zi(e)&&sa(n),Ol(n)&&pe(t.origin,Ud)&&sa(n),r=t.width,s=Li(e)?"":Qi(e,o).getOr(""),l=t.height,a=Xi(e,o).getOr("")}}),e.on("ObjectResized",t=>{const o=t.target;if(qd(o)){const n=Me.fromDom(o),r=t.origin;(e=>pe(e,"corner-"))(r)&&m(n,r,t.width,t.height),qi(n),yd(e,n.dom,xd)}});const d=()=>{o.on(e=>{e.on(),e.showBars()})},u=()=>{o.on(e=>{e.off(),e.hideBars()})};return e.on("DisabledStateChange",e=>{e.state?u():d()}),e.on("SwitchMode",()=>{e.mode.isReadOnly()?u():d()}),e.on("dragstart dragend",e=>{"dragstart"===e.type?u():d()}),e.on("remove",()=>{o.on(e=>{e.destroy()})}),{refresh:e=>{o.on(t=>t.refreshBars(Me.fromDom(e)))},hide:()=>{o.on(e=>e.hideBars())},show:()=>{o.on(e=>e.showBars())}}},Yd=e=>{(e=>{const t=e.options.register;t("table_clone_elements",{processor:"string[]"}),t("table_use_colgroups",{processor:"boolean",default:!0}),t("table_header_type",{processor:e=>{const t=D(["section","cells","sectionCells","auto"],e);return t?{value:e,valid:t}:{valid:!1,message:"Must be one of: section, cells, sectionCells or auto."}},default:"section"}),t("table_sizing_mode",{processor:"string",default:"auto"}),t("table_default_attributes",{processor:"object",default:{border:"1"}}),t("table_default_styles",{processor:"object",default:{"border-collapse":"collapse"}}),t("table_column_resizing",{processor:e=>{const t=D(["preservetable","resizetable"],e);return t?{value:e,valid:t}:{valid:!1,message:"Must be preservetable, or resizetable."}},default:"preservetable"}),t("table_resize_bars",{processor:"boolean",default:!0}),t("table_style_by_css",{processor:"boolean",default:!0}),t("table_merge_content_on_paste",{processor:"boolean",default:!0}),t("table_default_header_rows",{processor:"number",default:0}),t("table_default_header_cols",{processor:"number",default:0})})(e);const t=Kd(e),o=Vd(e,t),n=Rd(e,t,o);return Hd(e,n),((e,t)=>{const o=Vi(e),n=t=>hd(Ui(e)).bind(n=>ir(n,o).map(o=>{const r=ud(pd(e),o,n);return t(o,r)})).getOr("");G({mceTableRowType:()=>n(t.getTableRowType),mceTableCellType:()=>n(t.getTableCellType),mceTableColType:()=>n(t.getTableColType)},(t,o)=>e.addQueryValueHandler(o,t))})(e,n),bd(e,n),{getSelectedCells:o.getSelectedCells,clearSelectedCells:o.clearSelectedCells}};e.add("dom",e=>({table:Yd(e)}))}(); \ No newline at end of file diff --git a/plugins/tinymce/notices.txt b/plugins/tinymce/notices.txt index 2109267e..63e7fe65 100644 --- a/plugins/tinymce/notices.txt +++ b/plugins/tinymce/notices.txt @@ -4,7 +4,7 @@ Below is a list of third party libraries that this software uses: dompurify owner: Mario Heiderich repo: https://github.com/cure53/DOMPurify -version: 3.2.6 +version: 3.3.2 license: MPL-2.0 OR Apache-2.0 prismjs diff --git a/plugins/tinymce/plugins/accordion/plugin.min.js b/plugins/tinymce/plugins/accordion/plugin.min.js index c8ec02ba..acd31f1c 100644 --- a/plugins/tinymce/plugins/accordion/plugin.min.js +++ b/plugins/tinymce/plugins/accordion/plugin.min.js @@ -1 +1 @@ -!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>typeof t===e,o=e=>"string"===(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=n=e,(r=String).prototype.isPrototypeOf(o)||n.constructor?.name===r.name)?"string":t;var o,n,r})(e),n=t("boolean"),r=e=>null==e,s=e=>!r(e),a=t("function"),i=t("number"),c=e=>()=>e,d=(e,t)=>e===t,l=c(!1);class m{tag;value;static singletonNone=new m(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new m(!0,e)}static none(){return m.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?m.some(e(this.value)):m.none()}bind(e){return this.tag?e(this.value):m.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:m.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(e??"Called getOrDie on None")}static from(e){return s(e)?m.some(e):m.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}const u=Array.prototype.indexOf,p=(e,t)=>{return o=e,n=t,u.call(o,n)>-1;var o,n},g=(e,t)=>{const o=e.length,n=new Array(o);for(let r=0;r{for(let o=0,n=e.length;oe.replace(b,""));var b;const w=(e,t)=>({element:e,offset:t}),N=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},T={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return N(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return N(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return N(o)},fromDom:N,fromPoint:(e,t,o)=>m.from(e.dom.elementFromPoint(t,o)).map(N)},A=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},C=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,S=A,x=e=>e.dom.nodeName.toLowerCase(),D=e=>e.dom.nodeType,E=e=>t=>D(t)===e,O=E(1),M=E(3),P=E(9),R=E(11),k=e=>m.from(e.dom.parentNode).map(T.fromDom),B=e=>m.from(e.dom.nextSibling).map(T.fromDom),L=e=>g(e.dom.childNodes,T.fromDom),$=e=>T.fromDom(e.dom.host),V=(e,t)=>{k(e).each((o=>{o.dom.insertBefore(t.dom,e.dom)}))},I=(e,t)=>{B(e).fold((()=>{k(e).each((e=>{j(e,t)}))}),(e=>{V(e,t)}))},j=(e,t)=>{e.dom.appendChild(t.dom)},q=(e,t)=>{h(t,((o,n)=>{const r=0===n?e:t[n-1];I(r,o)}))},H=(e,t,r)=>{if(!(o(r)||n(r)||i(r)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",r,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,r+"")},z=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},F=(e,t)=>m.from(z(e,t)),K=(e,t)=>{e.dom.removeAttribute(t)},U=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},Y=e=>void 0!==e.style&&a(e.style.getPropertyValue),_=e=>{const t=M(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return(e=>{const t=(e=>T.fromDom(e.dom.getRootNode()))(e);return R(o=t)&&s(o.dom.host)?m.some(t):m.none();var o})(T.fromDom(t)).fold((()=>o.body.contains(t)),(n=_,r=$,e=>n(r(e))));var n,r},G=(e,t)=>Y(e)?e.style.getPropertyValue(t):"",J=(e=>{const t=t=>e(t)?m.from(t.dom.nodeValue):m.none();return{get:o=>{if(!e(o))throw new Error("Can only get text value of a text node");return t(o).getOr("")},getOption:t,set:(t,o)=>{if(!e(t))throw new Error("Can only set raw text value of a text node");t.dom.nodeValue=o}}})(M),Q=(e,t,o)=>{let n=e.dom;const r=a(o)?o:l;for(;n.parentNode;){n=n.parentNode;const e=T.fromDom(n);if(t(e))return m.some(e);if(r(e))break}return m.none()},W=(e,t,o)=>Q(e,(e=>A(e,t)),o),X=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return C(o)?m.none():m.from(o.querySelector(e)).map(T.fromDom)})(t,e),Z=(e,t)=>{let o=[];return h(L(e),(e=>{t(e)&&(o=o.concat([e])),o=o.concat(Z(e,t))})),o};var ee=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"];const te=(e,t,o)=>e.property().isText(t)&&0===e.property().getText(t).trim().length||e.property().isComment(t)?o(t).bind((t=>te(e,t,o).orThunk((()=>m.some(t))))):m.none(),oe=(e,t)=>e.property().isText(t)?e.property().getText(t).length:e.property().children(t).length,ne=(e,t)=>{const o=te(e,t,e.query().prevSibling).getOr(t);if(e.property().isText(o))return w(o,oe(e,o));const n=e.property().children(o);return n.length>0?ne(e,n[n.length-1]):w(o,oe(e,o))},re=ne,se={up:c({selector:W,closest:(e,t,o)=>((e,t,o,n,r)=>((e,t)=>A(e,t))(o,n)?m.some(o):a(r)&&r(o)?m.none():t(o,n,r))(0,W,e,t,o),predicate:Q,all:(e,t)=>{const o=a(t)?t:l;let n=e.dom;const r=[];for(;null!==n.parentNode&&void 0!==n.parentNode;){const e=n.parentNode,t=T.fromDom(e);if(r.push(t),!0===o(t))break;n=e}return r}}),down:c({selector:(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return C(o)?[]:g(o.querySelectorAll(e),T.fromDom)})(t,e),predicate:Z}),styles:c({get:(e,t)=>{const o=e.dom,n=window.getComputedStyle(o).getPropertyValue(t);return""!==n||_(e)?n:G(o,t)},getRaw:(e,t)=>{const o=e.dom,n=G(o,t);return m.from(n).filter((e=>e.length>0))},set:(e,t,n)=>{((e,t,n)=>{if(!o(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);Y(e)&&e.style.setProperty(t,n)})(e.dom,t,n)},remove:(e,t)=>{((e,t)=>{Y(e)&&e.style.removeProperty(t)})(e.dom,t),((e,t,o=d)=>e.exists((e=>o(e,t))))(F(e,"style").map(v),"")&&K(e,"style")}}),attrs:c({get:z,set:(e,t,o)=>{H(e.dom,t,o)},remove:K,copyTo:(e,t)=>{const o=(n=e.dom.attributes,r=(e,t)=>(e[t.name]=t.value,e),s={},h(n,((e,t)=>{s=r(s,e)})),s);var n,r,s;((e,t)=>{const o=e.dom;((e,t)=>{const o=f(e);for(let n=0,r=o.length;n{H(o,t,e)}))})(t,o)}}),insert:c({before:V,after:I,afterAll:q,append:j,appendAll:(e,t)=>{h(t,(t=>{j(e,t)}))},prepend:(e,t)=>{(e=>(e=>{const t=e.dom.childNodes;return m.from(t[0]).map(T.fromDom)})(e))(e).fold((()=>{j(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))},wrap:(e,t)=>{V(e,t),j(t,e)}}),remove:c({unwrap:e=>{const t=L(e);t.length>0&&q(e,t),U(e)},remove:U}),create:c({nu:T.fromTag,clone:e=>T.fromDom(e.dom.cloneNode(!1)),text:T.fromText}),query:c({comparePosition:(e,t)=>e.dom.compareDocumentPosition(t.dom),prevSibling:e=>m.from(e.dom.previousSibling).map(T.fromDom),nextSibling:B}),property:c({children:L,name:x,parent:k,document:e=>{return(t=e,P(t)?t:T.fromDom(t.dom.ownerDocument)).dom;var t},isText:M,isComment:e=>8===D(e)||"#comment"===x(e),isElement:O,isSpecial:e=>{const t=x(e);return p(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],t)},getLanguage:e=>O(e)?F(e,"lang"):m.none(),getText:e=>J.get(e),setText:(e,t)=>J.set(e,t),isBoundary:e=>!!O(e)&&("body"===x(e)||p(ee,x(e))),isEmptyTag:e=>!!O(e)&&p(["br","img","hr","input"],x(e)),isNonEditable:e=>O(e)&&"false"===z(e,"contenteditable")}),eq:(e,t)=>e.dom===t.dom,is:S},ae=e=>e.options.get("disabled"),ie="details",ce="mce-accordion",de="mce-accordion-summary",le="mce-accordion-body",me="div",ue="data-mce-accordion-open";var pe=tinymce.util.Tools.resolve("tinymce.util.Tools");const ge=e=>"SUMMARY"===e?.nodeName,he=e=>"DETAILS"===e?.nodeName,fe=e=>e.hasAttribute("open"),ye=e=>{const t=e.selection.getNode();return ge(t)||Boolean(e.dom.getParent(t,ge))},ve=e=>!ye(e)&&e.dom.isEditable(e.selection.getNode())&&!e.mode.isReadOnly(),be=e=>m.from(e.dom.getParent(e.selection.getNode(),he)),we=e=>(e.innerHTML='
',e),Ne=e=>we(e.dom.create("p")),Te=e=>t=>{((e,t)=>{if(ge(t?.lastChild)){const o=Ne(e);t.appendChild(o),e.selection.setCursorLocation(o,0)}})(e,t),((e,t)=>{if(!ge(t?.firstChild)){const o=(e=>we(e.dom.create("summary")))(e);t.prepend(o),e.selection.setCursorLocation(o,0)}})(e,t)},Ae=e=>{if(!ve(e))return;const t=T.fromDom(e.getBody()),o=(e=>{const t=(new Date).getTime(),o=Math.floor(window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967295*1e9);return y++,e+"_"+o+y+String(t)})("acc"),n=e.dom.encode(e.selection.getRng().toString()||e.translate("Accordion summary...")),r=e.dom.encode(e.translate("Accordion body...")),s=`${n}`,a=`<${me} class="${le}">

${r}

`;e.undoManager.transact((()=>{e.insertContent([`
`,s,a,"
"].join("")),X(t,`[data-mce-id="${o}"]`).each((t=>{K(t,"data-mce-id"),X(t,"summary").each((t=>{const o=e.dom.createRng(),n=re(se,t);o.setStart(n.element.dom,n.offset),o.setEnd(n.element.dom,n.offset),e.selection.setRng(o)}))}))}))},Ce=(e,t,o)=>{const n=o??!fe(t);return e||t.setAttribute(ue,n?"open":"closed"),n?t.setAttribute("open","open"):t.removeAttribute("open"),n},Se=e=>{e.addCommand("InsertAccordion",(()=>Ae(e))),e.addCommand("ToggleAccordion",((t,o)=>((e,t)=>{ae(e)||be(e).each((o=>{((e,t,o)=>{e.dispatch("ToggledAccordion",{element:t,state:o})})(e,o,Ce(e.readonly,o,t))}))})(e,o))),e.addCommand("ToggleAllAccordions",((t,o)=>((e,t)=>{const o=Array.from(e.getBody().querySelectorAll("details"));0!==o.length&&(h(o,(o=>Ce(e.readonly,o,t??!fe(o)))),((e,t,o)=>{e.dispatch("ToggledAllAccordions",{elements:t,state:o})})(e,o,t))})(e,o))),e.addCommand("RemoveAccordion",(()=>(e=>{e.mode.isReadOnly()||be(e).each((t=>{const{nextSibling:o}=t;o?(e.selection.select(o,!0),e.selection.collapse(!0)):((e,t)=>{const o=Ne(e);t.insertAdjacentElement("afterend",o),e.selection.setCursorLocation(o,0)})(e,t),t.remove()}))})(e)))};var xe=tinymce.util.Tools.resolve("tinymce.html.Node");const De=e=>{Ee(e,"open")&&Oe(e,"open","open")},Ee=(e,t)=>void 0!==e.attr(t),Oe=(e,t,o)=>{e.attr(t,o)},Me=e=>e.attr("class")?.split(" ")??[],Pe=(e,t)=>{const o=new Set([...Me(e),...t]),n=Array.from(o);n.length>0&&e.attr("class",n.join(" "))},Re=(e,t)=>{const o=(e=>{const o=[];for(let r=0,s=e.length;r0?o.join(" "):null)},ke=e=>e.name===ie&&p(Me(e),ce),Be=e=>{const t=e.children();let o,n;const s=[];for(let e=0;e{const t=new xe("br",1);t.attr("data-mce-bogus","1"),e.empty(),e.append(t)};var $e=tinymce.util.Tools.resolve("tinymce.util.VK");const Ve=e=>{(e=>{e.on("keydown",(t=>{(!t.shiftKey&&t.keyCode===$e.ENTER&&ye(e)||(e=>{const t=e.selection.getRng();return he(t.startContainer)&&t.collapsed&&0===t.startOffset})(e))&&(t.preventDefault(),e.execCommand("ToggleAccordion"))}))})(e),e.on("ExecCommand",(t=>{const o=t.command.toLowerCase();"delete"!==o&&"forwarddelete"!==o||!(e=>be(e).isSome())(e)||(e=>{pe.each(pe.grep(e.dom.select("details",e.getBody())),Te(e))})(e)}))};var Ie=tinymce.util.Tools.resolve("tinymce.Env");const je=e=>t=>{const o=()=>t.setEnabled(ve(e));return e.on("NodeChange",o),()=>e.off("NodeChange",o)};e.add("accordion",(e=>{(e=>{const t=()=>e.execCommand("InsertAccordion");e.ui.registry.addButton("accordion",{icon:"accordion",tooltip:"Insert accordion",onSetup:je(e),onAction:t}),e.ui.registry.addMenuItem("accordion",{icon:"accordion",text:"Accordion",onSetup:je(e),onAction:t}),e.ui.registry.addToggleButton("accordiontoggle",{icon:"accordion-toggle",tooltip:"Toggle accordion",onAction:()=>e.execCommand("ToggleAccordion"),context:"any"}),e.ui.registry.addToggleButton("accordionremove",{icon:"remove",tooltip:"Delete accordion",onAction:()=>e.execCommand("RemoveAccordion")}),e.ui.registry.addContextToolbar("accordion",{predicate:t=>e.dom.is(t,"details")&&e.getBody().contains(t)&&e.dom.isEditable(t.parentNode),items:"accordiontoggle accordionremove",scope:"node",position:"node"})})(e),Se(e),Ve(e),(e=>{e.on("PreInit",(()=>{const{serializer:t,parser:o}=e;o.addNodeFilter(ie,(e=>{for(let t=0;t0)for(let e=0;e{const t=new Set([de]);for(let o=0;o{Ie.browser.isSafari()&&e.on("click",(t=>{if(ge(t.target)){const o=t.target,n=e.selection.getRng();n.collapsed&&n.startContainer===o.parentNode&&0===n.startOffset&&e.selection.setCursorLocation(o,0)}}))})(e)}))}(); \ No newline at end of file +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>typeof t===e,o=e=>"string"===(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=n=e,(r=String).prototype.isPrototypeOf(o)||n.constructor?.name===r.name)?"string":t;var o,n,r})(e),n=t("boolean"),r=e=>null==e,s=e=>!r(e),a=t("function"),i=t("number"),c=e=>()=>e,d=(e,t)=>e===t,l=c(!1);class m{tag;value;static singletonNone=new m(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new m(!0,e)}static none(){return m.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?m.some(e(this.value)):m.none()}bind(e){return this.tag?e(this.value):m.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:m.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(e??"Called getOrDie on None")}static from(e){return s(e)?m.some(e):m.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}const u=Array.prototype.indexOf,p=(e,t)=>{return o=e,n=t,u.call(o,n)>-1;var o,n},g=(e,t)=>{const o=e.length,n=new Array(o);for(let r=0;r{for(let o=0,n=e.length;oe.replace(b,""));var b;const w=(e,t)=>({element:e,offset:t}),N=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},T={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return N(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return N(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return N(o)},fromDom:N,fromPoint:(e,t,o)=>m.from(e.dom.elementFromPoint(t,o)).map(N)},A=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},C=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,S=A,x=e=>e.dom.nodeName.toLowerCase(),D=e=>e.dom.nodeType,E=e=>t=>D(t)===e,O=E(1),M=E(3),P=E(9),R=E(11),k=e=>m.from(e.dom.parentNode).map(T.fromDom),B=e=>m.from(e.dom.nextSibling).map(T.fromDom),L=e=>g(e.dom.childNodes,T.fromDom),$=e=>T.fromDom(e.dom.host),V=(e,t)=>{k(e).each(o=>{o.dom.insertBefore(t.dom,e.dom)})},I=(e,t)=>{B(e).fold(()=>{k(e).each(e=>{j(e,t)})},e=>{V(e,t)})},j=(e,t)=>{e.dom.appendChild(t.dom)},q=(e,t)=>{h(t,(o,n)=>{const r=0===n?e:t[n-1];I(r,o)})},H=(e,t,r)=>{if(!(o(r)||n(r)||i(r)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",r,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,r+"")},z=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},F=(e,t)=>m.from(z(e,t)),K=(e,t)=>{e.dom.removeAttribute(t)},U=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},Y=e=>void 0!==e.style&&a(e.style.getPropertyValue),_=e=>{const t=M(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return(e=>{const t=(e=>T.fromDom(e.dom.getRootNode()))(e);return R(o=t)&&s(o.dom.host)?m.some(t):m.none();var o})(T.fromDom(t)).fold(()=>o.body.contains(t),(n=_,r=$,e=>n(r(e))));var n,r},G=(e,t)=>Y(e)?e.style.getPropertyValue(t):"",J=(e=>{const t=t=>e(t)?m.from(t.dom.nodeValue):m.none();return{get:o=>{if(!e(o))throw new Error("Can only get text value of a text node");return t(o).getOr("")},getOption:t,set:(t,o)=>{if(!e(t))throw new Error("Can only set raw text value of a text node");t.dom.nodeValue=o}}})(M),Q=(e,t,o)=>{let n=e.dom;const r=a(o)?o:l;for(;n.parentNode;){n=n.parentNode;const e=T.fromDom(n);if(t(e))return m.some(e);if(r(e))break}return m.none()},W=(e,t,o)=>Q(e,e=>A(e,t),o),X=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return C(o)?m.none():m.from(o.querySelector(e)).map(T.fromDom)})(t,e),Z=(e,t)=>{let o=[];return h(L(e),e=>{t(e)&&(o=o.concat([e])),o=o.concat(Z(e,t))}),o};var ee=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"];const te=(e,t,o)=>e.property().isText(t)&&0===e.property().getText(t).trim().length||e.property().isComment(t)?o(t).bind(t=>te(e,t,o).orThunk(()=>m.some(t))):m.none(),oe=(e,t)=>e.property().isText(t)?e.property().getText(t).length:e.property().children(t).length,ne=(e,t)=>{const o=te(e,t,e.query().prevSibling).getOr(t);if(e.property().isText(o))return w(o,oe(e,o));const n=e.property().children(o);return n.length>0?ne(e,n[n.length-1]):w(o,oe(e,o))},re=ne,se={up:c({selector:W,closest:(e,t,o)=>((e,t,o,n,r)=>((e,t)=>A(e,t))(o,n)?m.some(o):a(r)&&r(o)?m.none():t(o,n,r))(0,W,e,t,o),predicate:Q,all:(e,t)=>{const o=a(t)?t:l;let n=e.dom;const r=[];for(;null!==n.parentNode&&void 0!==n.parentNode;){const e=n.parentNode,t=T.fromDom(e);if(r.push(t),!0===o(t))break;n=e}return r}}),down:c({selector:(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return C(o)?[]:g(o.querySelectorAll(e),T.fromDom)})(t,e),predicate:Z}),styles:c({get:(e,t)=>{const o=e.dom,n=window.getComputedStyle(o).getPropertyValue(t);return""!==n||_(e)?n:G(o,t)},getRaw:(e,t)=>{const o=e.dom,n=G(o,t);return m.from(n).filter(e=>e.length>0)},set:(e,t,n)=>{((e,t,n)=>{if(!o(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);Y(e)&&e.style.setProperty(t,n)})(e.dom,t,n)},remove:(e,t)=>{((e,t)=>{Y(e)&&e.style.removeProperty(t)})(e.dom,t),((e,t,o=d)=>e.exists(e=>o(e,t)))(F(e,"style").map(v),"")&&K(e,"style")}}),attrs:c({get:z,set:(e,t,o)=>{H(e.dom,t,o)},remove:K,copyTo:(e,t)=>{const o=(n=e.dom.attributes,r=(e,t)=>(e[t.name]=t.value,e),s={},h(n,(e,t)=>{s=r(s,e)}),s);var n,r,s;((e,t)=>{const o=e.dom;((e,t)=>{const o=f(e);for(let n=0,r=o.length;n{H(o,t,e)})})(t,o)}}),insert:c({before:V,after:I,afterAll:q,append:j,appendAll:(e,t)=>{h(t,t=>{j(e,t)})},prepend:(e,t)=>{(e=>(e=>{const t=e.dom.childNodes;return m.from(t[0]).map(T.fromDom)})(e))(e).fold(()=>{j(e,t)},o=>{e.dom.insertBefore(t.dom,o.dom)})},wrap:(e,t)=>{V(e,t),j(t,e)}}),remove:c({unwrap:e=>{const t=L(e);t.length>0&&q(e,t),U(e)},remove:U}),create:c({nu:T.fromTag,clone:e=>T.fromDom(e.dom.cloneNode(!1)),text:T.fromText}),query:c({comparePosition:(e,t)=>e.dom.compareDocumentPosition(t.dom),prevSibling:e=>m.from(e.dom.previousSibling).map(T.fromDom),nextSibling:B}),property:c({children:L,name:x,parent:k,document:e=>{return(t=e,P(t)?t:T.fromDom(t.dom.ownerDocument)).dom;var t},isText:M,isComment:e=>8===D(e)||"#comment"===x(e),isElement:O,isSpecial:e=>{const t=x(e);return p(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],t)},getLanguage:e=>O(e)?F(e,"lang"):m.none(),getText:e=>J.get(e),setText:(e,t)=>J.set(e,t),isBoundary:e=>!!O(e)&&("body"===x(e)||p(ee,x(e))),isEmptyTag:e=>!!O(e)&&p(["br","img","hr","input"],x(e)),isNonEditable:e=>O(e)&&"false"===z(e,"contenteditable")}),eq:(e,t)=>e.dom===t.dom,is:S},ae=e=>e.options.get("disabled"),ie="details",ce="mce-accordion",de="mce-accordion-summary",le="mce-accordion-body",me="div",ue="data-mce-accordion-open";var pe=tinymce.util.Tools.resolve("tinymce.util.Tools");const ge=e=>"SUMMARY"===e?.nodeName,he=e=>"DETAILS"===e?.nodeName,fe=e=>e.hasAttribute("open"),ye=e=>{const t=e.selection.getNode();return ge(t)||Boolean(e.dom.getParent(t,ge))},ve=e=>!ye(e)&&e.dom.isEditable(e.selection.getNode())&&!e.mode.isReadOnly(),be=e=>m.from(e.dom.getParent(e.selection.getNode(),he)),we=e=>(e.innerHTML='
',e),Ne=e=>we(e.dom.create("p")),Te=e=>t=>{((e,t)=>{if(ge(t?.lastChild)){const o=Ne(e);t.appendChild(o),e.selection.setCursorLocation(o,0)}})(e,t),((e,t)=>{if(!ge(t?.firstChild)){const o=(e=>we(e.dom.create("summary")))(e);t.prepend(o),e.selection.setCursorLocation(o,0)}})(e,t)},Ae=e=>{if(!ve(e))return;const t=T.fromDom(e.getBody()),o=(e=>{const t=(new Date).getTime(),o=Math.floor(window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967295*1e9);return y++,e+"_"+o+y+String(t)})("acc"),n=e.dom.encode(e.selection.getRng().toString()||e.translate("Accordion summary...")),r=e.dom.encode(e.translate("Accordion body...")),s=`${n}`,a=`<${me} class="${le}">

${r}

`;e.undoManager.transact(()=>{e.insertContent([`
`,s,a,"
"].join("")),X(t,`[data-mce-id="${o}"]`).each(t=>{K(t,"data-mce-id"),X(t,"summary").each(t=>{const o=e.dom.createRng(),n=re(se,t);o.setStart(n.element.dom,n.offset),o.setEnd(n.element.dom,n.offset),e.selection.setRng(o)})})})},Ce=(e,t,o)=>{const n=o??!fe(t);return e||t.setAttribute(ue,n?"open":"closed"),n?t.setAttribute("open","open"):t.removeAttribute("open"),n},Se=e=>{e.addCommand("InsertAccordion",()=>Ae(e)),e.addCommand("ToggleAccordion",(t,o)=>((e,t)=>{ae(e)||be(e).each(o=>{((e,t,o)=>{e.dispatch("ToggledAccordion",{element:t,state:o})})(e,o,Ce(e.readonly,o,t))})})(e,o)),e.addCommand("ToggleAllAccordions",(t,o)=>((e,t)=>{const o=Array.from(e.getBody().querySelectorAll("details"));0!==o.length&&(h(o,o=>Ce(e.readonly,o,t??!fe(o))),((e,t,o)=>{e.dispatch("ToggledAllAccordions",{elements:t,state:o})})(e,o,t))})(e,o)),e.addCommand("RemoveAccordion",()=>(e=>{e.mode.isReadOnly()||be(e).each(t=>{const{nextSibling:o}=t;o?(e.selection.select(o,!0),e.selection.collapse(!0)):((e,t)=>{const o=Ne(e);t.insertAdjacentElement("afterend",o),e.selection.setCursorLocation(o,0)})(e,t),t.remove()})})(e))};var xe=tinymce.util.Tools.resolve("tinymce.html.Node");const De=e=>{Ee(e,"open")&&Oe(e,"open","open")},Ee=(e,t)=>void 0!==e.attr(t),Oe=(e,t,o)=>{e.attr(t,o)},Me=e=>e.attr("class")?.split(" ")??[],Pe=(e,t)=>{const o=new Set([...Me(e),...t]),n=Array.from(o);n.length>0&&e.attr("class",n.join(" "))},Re=(e,t)=>{const o=((e,t)=>{const o=[];for(let n=0,r=e.length;n!t.has(e));e.attr("class",o.length>0?o.join(" "):null)},ke=e=>e.name===ie&&p(Me(e),ce),Be=e=>e.name===me&&p(Me(e),le),Le=e=>{const t=e.children();let o,n;const s=[];for(let e=0;e{const t=new xe("br",1);t.attr("data-mce-bogus","1"),e.empty(),e.append(t)};var Ve=tinymce.util.Tools.resolve("tinymce.util.VK");const Ie=e=>{(e=>{e.on("keydown",t=>{(!t.shiftKey&&t.keyCode===Ve.ENTER&&ye(e)||(e=>{const t=e.selection.getRng();return he(t.startContainer)&&t.collapsed&&0===t.startOffset})(e))&&(t.preventDefault(),e.execCommand("ToggleAccordion"))})})(e),e.on("ExecCommand",t=>{const o=t.command.toLowerCase();"delete"!==o&&"forwarddelete"!==o||!(e=>be(e).isSome())(e)||(e=>{pe.each(pe.grep(e.dom.select("details",e.getBody())),Te(e))})(e)})};var je=tinymce.util.Tools.resolve("tinymce.Env");const qe=e=>t=>{const o=()=>t.setEnabled(ve(e));return e.on("NodeChange",o),()=>e.off("NodeChange",o)};e.add("accordion",e=>{(e=>{const t=()=>e.execCommand("InsertAccordion");e.ui.registry.addButton("accordion",{icon:"accordion",tooltip:"Insert accordion",onSetup:qe(e),onAction:t}),e.ui.registry.addMenuItem("accordion",{icon:"accordion",text:"Accordion",onSetup:qe(e),onAction:t}),e.ui.registry.addToggleButton("accordiontoggle",{icon:"accordion-toggle",tooltip:"Toggle accordion",onAction:()=>e.execCommand("ToggleAccordion"),context:"any"}),e.ui.registry.addToggleButton("accordionremove",{icon:"remove",tooltip:"Delete accordion",onAction:()=>e.execCommand("RemoveAccordion")}),e.ui.registry.addContextToolbar("accordion",{predicate:t=>e.dom.is(t,"details")&&e.getBody().contains(t)&&e.dom.isEditable(t.parentNode),items:"accordiontoggle accordionremove",scope:"node",position:"node"})})(e),Se(e),Ie(e),(e=>{e.on("PreInit",()=>{const{serializer:t,parser:o}=e;o.addNodeFilter(ie,e=>{for(let t=0;t0)for(let e=0;e{const t=new Set([de]);for(let o=0;o{je.browser.isSafari()&&e.on("click",t=>{if(ge(t.target)){const o=t.target,n=e.selection.getRng();n.collapsed&&n.startContainer===o.parentNode&&0===n.startOffset&&e.selection.setCursorLocation(o,0)}})})(e)})}(); \ No newline at end of file diff --git a/plugins/tinymce/plugins/advlist/plugin.min.js b/plugins/tinymce/plugins/advlist/plugin.min.js index 8d5581f0..ce5b5143 100644 --- a/plugins/tinymce/plugins/advlist/plugin.min.js +++ b/plugins/tinymce/plugins/advlist/plugin.min.js @@ -1 +1 @@ -!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(t,e,s)=>{const r="UL"===e?"InsertUnorderedList":"InsertOrderedList";t.execCommand(r,!1,!1===s?null:{"list-style-type":s})},s=t=>e=>e.options.get(t),r=s("advlist_number_styles"),n=s("advlist_bullet_styles"),l=t=>null==t,i=t=>!l(t);class o{tag;value;static singletonNone=new o(!1);constructor(t,e){this.tag=t,this.value=e}static some(t){return new o(!0,t)}static none(){return o.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?o.some(t(this.value)):o.none()}bind(t){return this.tag?t(this.value):o.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:o.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(t??"Called getOrDie on None")}static from(t){return i(t)?o.some(t):o.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}const a=Array.prototype.indexOf,u=Object.keys;var d=tinymce.util.Tools.resolve("tinymce.util.Tools");const c=t=>e=>i(e)&&t.test(e.nodeName),h=c(/^(OL|UL|DL)$/),g=c(/^(TH|TD)$/),p=t=>l(t)||"default"===t?"":t,m=(t,e)=>s=>((t,e)=>{const s=t.selection.getNode();return e({parents:t.dom.getParents(s),element:s}),t.on("NodeChange",e),()=>t.off("NodeChange",e)})(t,(r=>((t,r)=>{const n=t.selection.getStart(!0);s.setActive(((t,e,s)=>((t,e,s)=>{for(let e=0,n=t.length;ee.nodeName===s&&((t,e)=>t.dom.isChildOf(e,t.getBody()))(t,e))))(t,r,e)),s.setEnabled(!((t,e)=>{const s=t.dom.getParent(e,"ol,ul,dl");return((t,e)=>null!==e&&!t.dom.isEditable(e))(t,s)||!t.selection.isEditable()})(t,n))})(t,r.parents))),v=(t,s,r,n,l,i)=>{const c={"lower-latin":"lower-alpha","upper-latin":"upper-alpha","lower-alpha":"lower-latin","upper-alpha":"upper-latin"},h=(g=t=>{return e=i,s=t,a.call(e,s)>-1;var e,s},((t,e)=>{const s={};return((t,e)=>{const s=u(t);for(let r=0,n=s.length;r{const n=e(t,r);s[n.k]=n.v})),s})(c,((t,e)=>({k:e,v:g(t)}))));var g;t.ui.registry.addSplitButton(s,{tooltip:r,chevronTooltip:r,icon:"OL"===l?"ordered-list":"unordered-list",presets:"listpreview",columns:"OL"===l?3:4,fetch:t=>{t(d.map(i,(t=>{const e="OL"===l?"num":"bull",s="decimal"===t?"default":t,r=p(t),n=(t=>t.replace(/\-/g," ").replace(/\b\w/g,(t=>t.toUpperCase())))(t);return{type:"choiceitem",value:r,icon:"list-"+e+"-"+s,text:n}})))},onAction:()=>t.execCommand(n),onItemAction:(s,r)=>{e(t,l,r)},select:e=>{const s=(t=>{const e=t.dom.getParent(t.selection.getNode(),"ol,ul"),s=t.dom.getStyle(e,"listStyleType");return o.from(s)})(t);return s.exists((t=>e===t||c[t]===e&&!h[e]))},onSetup:m(t,l)})},y=(t,s,r,n,l,i)=>{i.length>1?v(t,s,r,n,l,i):((t,s,r,n,l,i)=>{t.ui.registry.addToggleButton(s,{active:!1,tooltip:r,icon:"OL"===l?"ordered-list":"unordered-list",onSetup:m(t,l),onAction:()=>t.queryCommandState(n)||""===i?t.execCommand(n):e(t,l,i)})})(t,s,r,n,l,p(i[0]))};t.add("advlist",(t=>{t.hasPlugin("lists")?((t=>{const e=t.options.register;e("advlist_number_styles",{processor:"string[]",default:"default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman".split(",")}),e("advlist_bullet_styles",{processor:"string[]",default:"default,disc,circle,square".split(",")})})(t),(t=>{y(t,"numlist","Numbered list","InsertOrderedList","OL",r(t)),y(t,"bullist","Bullet list","InsertUnorderedList","UL",n(t))})(t),(t=>{t.addCommand("ApplyUnorderedListStyle",((s,r)=>{e(t,"UL",r["list-style-type"])})),t.addCommand("ApplyOrderedListStyle",((s,r)=>{e(t,"OL",r["list-style-type"])}))})(t)):console.error("Please use the Lists plugin together with the List Styles plugin.")}))}(); \ No newline at end of file +!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(t,e,s)=>{const r="UL"===e?"InsertUnorderedList":"InsertOrderedList";t.execCommand(r,!1,!1===s?null:{"list-style-type":s})},s=t=>e=>e.options.get(t),r=s("advlist_number_styles"),n=s("advlist_bullet_styles"),l=t=>null==t,i=t=>!l(t);class o{tag;value;static singletonNone=new o(!1);constructor(t,e){this.tag=t,this.value=e}static some(t){return new o(!0,t)}static none(){return o.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?o.some(t(this.value)):o.none()}bind(t){return this.tag?t(this.value):o.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:o.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(t??"Called getOrDie on None")}static from(t){return i(t)?o.some(t):o.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}const a=Array.prototype.indexOf,u=Object.keys;var d=tinymce.util.Tools.resolve("tinymce.util.Tools");const c=t=>e=>i(e)&&t.test(e.nodeName),h=c(/^(OL|UL|DL)$/),g=c(/^(TH|TD)$/),p=t=>l(t)||"default"===t?"":t,m=(t,e)=>s=>((t,e)=>{const s=t.selection.getNode();return e({parents:t.dom.getParents(s),element:s}),t.on("NodeChange",e),()=>t.off("NodeChange",e)})(t,r=>((t,r)=>{const n=t.selection.getStart(!0);s.setActive(((t,e,s)=>((t,e,s)=>{for(let r=0,n=t.length;rh(t)&&!/\btox\-/.test(t.className),g).exists(e=>e.nodeName===s&&((t,e)=>t.dom.isChildOf(e,t.getBody()))(t,e)))(t,r,e)),s.setEnabled(!((t,e)=>{const s=t.dom.getParent(e,"ol,ul,dl");return((t,e)=>null!==e&&!t.dom.isEditable(e))(t,s)||!t.selection.isEditable()})(t,n))})(t,r.parents)),v=(t,s,r,n,l,i)=>{const c={"lower-latin":"lower-alpha","upper-latin":"upper-alpha","lower-alpha":"lower-latin","upper-alpha":"upper-latin"},h=(g=t=>{return e=i,s=t,a.call(e,s)>-1;var e,s},((t,e)=>{const s={};return((t,e)=>{const s=u(t);for(let r=0,n=s.length;r{const n=e(t,r);s[n.k]=n.v}),s})(c,(t,e)=>({k:e,v:g(t)})));var g;t.ui.registry.addSplitButton(s,{tooltip:r,chevronTooltip:r,icon:"OL"===l?"ordered-list":"unordered-list",presets:"listpreview",columns:"OL"===l?3:4,fetch:t=>{t(d.map(i,t=>{const e="OL"===l?"num":"bull",s="decimal"===t?"default":t,r=p(t),n=(t=>t.replace(/\-/g," ").replace(/\b\w/g,t=>t.toUpperCase()))(t);return{type:"choiceitem",value:r,icon:"list-"+e+"-"+s,text:n}}))},onAction:()=>t.execCommand(n),onItemAction:(s,r)=>{e(t,l,r)},select:e=>{const s=(t=>{const e=t.dom.getParent(t.selection.getNode(),"ol,ul"),s=t.dom.getStyle(e,"listStyleType");return o.from(s)})(t);return s.exists(t=>e===t||c[t]===e&&!h[e])},onSetup:m(t,l)})},y=(t,s,r,n,l,i)=>{i.length>1?v(t,s,r,n,l,i):((t,s,r,n,l,i)=>{t.ui.registry.addToggleButton(s,{active:!1,tooltip:r,icon:"OL"===l?"ordered-list":"unordered-list",onSetup:m(t,l),onAction:()=>t.queryCommandState(n)||""===i?t.execCommand(n):e(t,l,i)})})(t,s,r,n,l,p(i[0]))};t.add("advlist",t=>{t.hasPlugin("lists")?((t=>{const e=t.options.register;e("advlist_number_styles",{processor:"string[]",default:"default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman".split(",")}),e("advlist_bullet_styles",{processor:"string[]",default:"default,disc,circle,square".split(",")})})(t),(t=>{y(t,"numlist","Numbered list","InsertOrderedList","OL",r(t)),y(t,"bullist","Bullet list","InsertUnorderedList","UL",n(t))})(t),(t=>{t.addCommand("ApplyUnorderedListStyle",(s,r)=>{e(t,"UL",r["list-style-type"])}),t.addCommand("ApplyOrderedListStyle",(s,r)=>{e(t,"OL",r["list-style-type"])})})(t)):console.error("Please use the Lists plugin together with the List Styles plugin.")})}(); \ No newline at end of file diff --git a/plugins/tinymce/plugins/anchor/plugin.min.js b/plugins/tinymce/plugins/anchor/plugin.min.js index c52c6d78..f517505b 100644 --- a/plugins/tinymce/plugins/anchor/plugin.min.js +++ b/plugins/tinymce/plugins/anchor/plugin.min.js @@ -1 +1 @@ -!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),o=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=e=>e.options.get("allow_html_in_named_anchor");const a="a:not([href])",r=e=>!e,i=e=>e.getAttribute("id")||e.getAttribute("name")||"",l=e=>(e=>"a"===e.nodeName.toLowerCase())(e)&&!e.getAttribute("href")&&""!==i(e),s=e=>e.dom.getParent(e.selection.getStart(),a),d=(e,a)=>{const r=s(e);r?((e,t,o)=>{o.removeAttribute("name"),o.id=t,e.addVisual(),e.undoManager.add()})(e,a,r):((e,a)=>{e.undoManager.transact((()=>{n(e)||e.selection.collapse(!0),e.selection.isCollapsed()?e.insertContent(e.dom.createHTML("a",{id:a})):((e=>{const n=e.dom;t(n).walk(e.selection.getRng(),(e=>{o.each(e,(e=>{var t;l(t=e)&&!t.firstChild&&n.remove(e,!1)}))}))})(e),e.formatter.remove("namedAnchor",void 0,void 0,!0),e.formatter.apply("namedAnchor",{value:a}),e.addVisual())}))})(e,a),e.focus()},c=e=>(e=>r(e.attr("href"))&&!r(e.attr("id")||e.attr("name")))(e)&&!e.firstChild,m=e=>t=>{for(let o=0;ot=>{const o=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",o),o(),()=>{e.off("NodeChange",o)}};e.add("anchor",(e=>{(e=>{(0,e.options.register)("allow_html_in_named_anchor",{processor:"boolean",default:!1})})(e),(e=>{e.on("PreInit",(()=>{e.parser.addNodeFilter("a",m("false")),e.serializer.addNodeFilter("a",m(null))}))})(e),(e=>{e.addCommand("mceAnchor",(()=>{(e=>{const t=(e=>{const t=s(e);return t?i(t):""})(e);e.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:t=>{((e,t)=>/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)?(d(e,t),!0):(e.windowManager.alert("ID should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),!1))(e,t.getData().id)&&t.close()}})})(e)}))})(e),(e=>{const t=()=>e.execCommand("mceAnchor");e.ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:t,onSetup:t=>{const o=e.selection.selectorChangedWithUnbind("a:not([href])",t.setActive).unbind,n=u(e)(t);return()=>{o(),n()}}}),e.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:t,onSetup:u(e)})})(e),e.on("PreInit",(()=>{(e=>{e.formatter.register("namedAnchor",{inline:"a",selector:a,remove:"all",split:!0,deep:!0,attributes:{id:"%value"},onmatch:(e,t,o)=>l(e)})})(e)}))}))}(); \ No newline at end of file +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),o=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=e=>e.options.get("allow_html_in_named_anchor");const a="a:not([href])",r=e=>!e,i=e=>e.getAttribute("id")||e.getAttribute("name")||"",l=e=>(e=>"a"===e.nodeName.toLowerCase())(e)&&!e.getAttribute("href")&&""!==i(e),s=e=>e.dom.getParent(e.selection.getStart(),a),d=(e,a)=>{const r=s(e);r?((e,t,o)=>{o.removeAttribute("name"),o.id=t,e.addVisual(),e.undoManager.add()})(e,a,r):((e,a)=>{e.undoManager.transact(()=>{n(e)||e.selection.collapse(!0),e.selection.isCollapsed()?e.insertContent(e.dom.createHTML("a",{id:a})):((e=>{const n=e.dom;t(n).walk(e.selection.getRng(),e=>{o.each(e,e=>{var t;l(t=e)&&!t.firstChild&&n.remove(e,!1)})})})(e),e.formatter.remove("namedAnchor",void 0,void 0,!0),e.formatter.apply("namedAnchor",{value:a}),e.addVisual())})})(e,a),e.focus()},c=e=>(e=>r(e.attr("href"))&&!r(e.attr("id")||e.attr("name")))(e)&&!e.firstChild,m=e=>t=>{for(let o=0;ot=>{const o=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",o),o(),()=>{e.off("NodeChange",o)}};e.add("anchor",e=>{(e=>{(0,e.options.register)("allow_html_in_named_anchor",{processor:"boolean",default:!1})})(e),(e=>{e.on("PreInit",()=>{e.parser.addNodeFilter("a",m("false")),e.serializer.addNodeFilter("a",m(null))})})(e),(e=>{e.addCommand("mceAnchor",()=>{(e=>{const t=(e=>{const t=s(e);return t?i(t):""})(e);e.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:t=>{((e,t)=>/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)?(d(e,t),!0):(e.windowManager.alert("ID should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),!1))(e,t.getData().id)&&t.close()}})})(e)})})(e),(e=>{const t=()=>e.execCommand("mceAnchor");e.ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:t,onSetup:t=>{const o=e.selection.selectorChangedWithUnbind("a:not([href])",t.setActive).unbind,n=u(e)(t);return()=>{o(),n()}}}),e.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:t,onSetup:u(e)})})(e),e.on("PreInit",()=>{(e=>{e.formatter.register("namedAnchor",{inline:"a",selector:a,remove:"all",split:!0,deep:!0,attributes:{id:"%value"},onmatch:(e,t,o)=>l(e)})})(e)})})}(); \ No newline at end of file diff --git a/plugins/tinymce/plugins/autolink/plugin.min.js b/plugins/tinymce/plugins/autolink/plugin.min.js index d0c573f5..2bf7f280 100644 --- a/plugins/tinymce/plugins/autolink/plugin.min.js +++ b/plugins/tinymce/plugins/autolink/plugin.min.js @@ -1 +1 @@ -!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>"string"===(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(n=o=e,(r=String).prototype.isPrototypeOf(n)||o.constructor?.name===r.name)?"string":t;var n,o,r})(e);const n=e=>undefined===e;const o=e=>!(e=>null==e)(e),r=Object.hasOwnProperty,a=e=>"\ufeff"===e,s=e=>t=>t.options.get(e),l=s("autolink_pattern"),c=s("link_default_target"),i=s("link_default_protocol"),d=s("allow_unsafe_link_target");var u=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker");const f=e=>/^[(\[{ \u00a0]$/.test(e),g=(e,t,n)=>{for(let o=t-1;o>=0;o--){const t=e.charAt(o);if(!a(t)&&n(t))return o}return-1},m=(e,t)=>{const o=e.schema.getVoidElements(),a=l(e),{dom:s,selection:c}=e;if(null!==s.getParent(c.getNode(),"a[href]")||e.mode.isReadOnly())return null;const d=c.getRng(),m=u(s,(e=>{return s.isBlock(e)||(t=o,n=e.nodeName.toLowerCase(),r.call(t,n))||"false"===s.getContentEditable(e)||null!==s.getParent(e,"a[href]");var t,n})),{container:k,offset:p}=((e,t)=>{let n=e,o=t;for(;1===n.nodeType&&n.childNodes[o];)n=n.childNodes[o],o=3===n.nodeType?n.data.length:n.childNodes.length;return{container:n,offset:o}})(d.endContainer,d.endOffset),y=s.getParent(k,s.isBlock)??s.getRoot(),w=m.backwards(k,p+t,((e,t)=>{const n=e.data,o=g(n,t,(r=f,e=>!r(e)));var r,a;return-1===o||(a=n[o],/[?!,.;:]/.test(a))?o:o+1}),y);if(!w)return null;let h=w.container;const _=m.backwards(w.container,w.offset,((e,t)=>{h=e;const n=g(e.data,t,f);return-1===n?n:n+1}),y),v=s.createRng();_?v.setStart(_.container,_.offset):v.setStart(h,0),v.setEnd(w.container,w.offset);const A=v.toString().replace(/\uFEFF/g,"").match(a);if(A){let t=A[0];return b="www.",(C=t).length>=4&&C.substr(0,4)===b?t=i(e)+"://"+t:((e,t,o=0,r)=>{const a=e.indexOf(t,o);return-1!==a&&(!!n(r)||a+t.length<=r)})(t,"@")&&!(e=>/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(e))(t)&&(t="mailto:"+t),{rng:v,url:t}}var C,b;return null},k=(e,n)=>{const{dom:o,selection:r}=e,{rng:a,url:s}=n,l=r.getBookmark();r.setRng(a);const i="createlink",u={command:i,ui:!1,value:s};if(!e.dispatch("BeforeExecCommand",u).isDefaultPrevented()){e.getDoc().execCommand(i,!1,s),e.dispatch("ExecCommand",u);const n=c(e);if(t(n)){const t=r.getNode();o.setAttrib(t,"target",n),"_blank"!==n||d(e)||o.setAttrib(t,"rel","noopener")}}r.moveToBookmark(l),e.nodeChanged()},p=e=>{const t=m(e,-1);o(t)&&k(e,t)},y=p;e.add("autolink",(e=>{(e=>{const t=e.options.register;t("autolink_pattern",{processor:"regexp",default:new RegExp("^"+/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g.source+"$","i")}),t("link_default_target",{processor:"string"}),t("link_default_protocol",{processor:"string",default:"https"})})(e),(e=>{e.on("keydown",(t=>{13!==t.keyCode||t.isDefaultPrevented()||(e=>{const t=m(e,0);o(t)&&k(e,t)})(e)})),e.on("keyup",(t=>{32===t.keyCode?p(e):(48===t.keyCode&&t.shiftKey||221===t.keyCode)&&y(e)}))})(e)}))}(); \ No newline at end of file +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>"string"===(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(n=o=e,(r=String).prototype.isPrototypeOf(n)||o.constructor?.name===r.name)?"string":t;var n,o,r})(e);const n=e=>undefined===e;const o=e=>!(e=>null==e)(e),r=Object.hasOwnProperty,a=e=>"\ufeff"===e,s=e=>t=>t.options.get(e),l=s("autolink_pattern"),c=s("link_default_target"),i=s("link_default_protocol"),d=s("allow_unsafe_link_target");var u=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker");const f=e=>3===e.nodeType,g=e=>1===e.nodeType,m=e=>/^[(\[{ \u00a0]$/.test(e),k=(e,t,n)=>{for(let o=t-1;o>=0;o--){const t=e.charAt(o);if(!a(t)&&n(t))return o}return-1},p=(e,t)=>{const o=e.schema.getVoidElements(),a=l(e),{dom:s,selection:c}=e;if(null!==s.getParent(c.getNode(),"a[href]")||e.mode.isReadOnly())return null;const d=c.getRng(),p=u(s,e=>{return s.isBlock(e)||(t=o,n=e.nodeName.toLowerCase(),r.call(t,n))||"false"===s.getContentEditable(e)||null!==s.getParent(e,"a[href]");var t,n}),{container:y,offset:w}=((e,t)=>{let n=e,o=t;for(;g(n)&&n.childNodes[o];)n=n.childNodes[o],o=f(n)?n.data.length:n.childNodes.length;return{container:n,offset:o}})(d.endContainer,d.endOffset),h=s.getParent(y,s.isBlock)??s.getRoot(),_=p.backwards(y,w+t,(e,t)=>{const n=e.data,o=k(n,t,(r=m,e=>!r(e)));var r,a;return-1===o||(a=n[o],/[?!,.;:]/.test(a))?o:o+1},h);if(!_)return null;let v=_.container;const A=p.backwards(_.container,_.offset,(e,t)=>{v=e;const n=k(e.data,t,m);return-1===n?n:n+1},h),C=s.createRng();A?C.setStart(A.container,A.offset):C.setStart(v,0),C.setEnd(_.container,_.offset);const b=C.toString().replace(/\uFEFF/g,"").match(a);if(b){let t=b[0];return $="www.",(P=t).length>=4&&P.substr(0,4)===$?t=i(e)+"://"+t:((e,t,o=0,r)=>{const a=e.indexOf(t,o);return-1!==a&&(!!n(r)||a+t.length<=r)})(t,"@")&&!(e=>/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(e))(t)&&(t="mailto:"+t),{rng:C,url:t}}var P,$;return null},y=(e,n)=>{const{dom:o,selection:r}=e,{rng:a,url:s}=n,l=r.getBookmark();r.setRng(a);const i="createlink",u={command:i,ui:!1,value:s};if(!e.dispatch("BeforeExecCommand",u).isDefaultPrevented()){e.getDoc().execCommand(i,!1,s),e.dispatch("ExecCommand",u);const n=c(e);if(t(n)){const t=r.getNode();o.setAttrib(t,"target",n),"_blank"!==n||d(e)||o.setAttrib(t,"rel","noopener")}}r.moveToBookmark(l),e.nodeChanged()},w=e=>{const t=p(e,-1);o(t)&&y(e,t)},h=w;e.add("autolink",e=>{(e=>{const t=e.options.register;t("autolink_pattern",{processor:"regexp",default:new RegExp("^"+/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g.source+"$","i")}),t("link_default_target",{processor:"string"}),t("link_default_protocol",{processor:"string",default:"https"})})(e),(e=>{e.on("keydown",t=>{13!==t.keyCode||t.isDefaultPrevented()||(e=>{const t=p(e,0);o(t)&&y(e,t)})(e)}),e.on("keyup",t=>{32===t.keyCode?w(e):(48===t.keyCode&&t.shiftKey||221===t.keyCode)&&h(e)})})(e)})}(); \ No newline at end of file diff --git a/plugins/tinymce/plugins/autoresize/plugin.min.js b/plugins/tinymce/plugins/autoresize/plugin.min.js index 88586562..756832e2 100644 --- a/plugins/tinymce/plugins/autoresize/plugin.min.js +++ b/plugins/tinymce/plugins/autoresize/plugin.min.js @@ -1 +1 @@ -!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env");const o=e=>t=>t.options.get(e),s=o("min_height"),n=o("max_height"),i=o("autoresize_overflow_padding"),r=o("autoresize_bottom_margin"),g=(e,t)=>{const o=e.getBody();o&&(o.style.overflowY=t?"":"hidden",t||(o.scrollTop=0))},l=(e,t,o,s)=>{const n=parseInt(e.getStyle(t,o,s)??"",10);return isNaN(n)?0:n},a=(e,o,r,c)=>{const d=e.dom,h=e.getDoc();if(!h)return;if((e=>e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen())(e))return void g(e,!0);const m=h.documentElement,u=c?c():i(e),f=s(e)??e.getElement().offsetHeight;let p=f;const y=l(d,m,"margin-top",!0),S=l(d,m,"margin-bottom",!0);let C=m.offsetHeight+y+S+u;C<0&&(C=0);const H=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight;C+H>f&&(p=C+H);const b=n(e);b&&p>b?(p=b,g(e,!0)):g(e,!1);const w=o.get();if(w.set&&(e.dom.setStyles(e.getDoc().documentElement,{"min-height":0}),e.dom.setStyles(e.getBody(),{"min-height":"inherit"})),p!==w.totalHeight&&(C-u!==w.contentHeight||!w.set)){const s=p-w.totalHeight;if(d.setStyle(e.getContainer(),"height",p+"px"),o.set({totalHeight:p,contentHeight:C,set:!0}),(e=>{e.dispatch("ResizeEditor")})(e),t.browser.isSafari()&&(t.os.isMacOS()||t.os.isiOS())){const t=e.getWin();t.scrollTo(t.pageXOffset,t.pageYOffset)}e.hasFocus()&&(e=>{if("setcontent"===e?.type.toLowerCase()){const t=e;return!0===t.selection||!0===t.paste}return!1})(r)&&e.selection.scrollIntoView(),(t.browser.isSafari()||t.browser.isChromium())&&s<0&&a(e,o,r,c)}};e.add("autoresize",(e=>{if((e=>{const t=e.options.register;t("autoresize_overflow_padding",{processor:"number",default:1}),t("autoresize_bottom_margin",{processor:"number",default:50})})(e),e.options.isSet("resize")||e.options.set("resize",!1),!e.inline){const o=(()=>{let e={totalHeight:0,contentHeight:0,set:!1};return{get:()=>e,set:t=>{e=t}}})();((e,t)=>{e.addCommand("mceAutoResize",(()=>{a(e,t)}))})(e,o),((e,o)=>{const s=()=>r(e);e.on("init",(n=>{const r=i(e),g=e.dom;g.setStyles(e.getDoc().documentElement,{height:"auto"}),t.browser.isEdge()||t.browser.isIE()?g.setStyles(e.getBody(),{paddingLeft:r,paddingRight:r,"min-height":0}):g.setStyles(e.getBody(),{paddingLeft:r,paddingRight:r}),a(e,o,n,s)})),e.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",(t=>{a(e,o,t,s)}))})(e,o)}}))}(); \ No newline at end of file +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env");const o=e=>t=>t.options.get(e),s=o("min_height"),n=o("max_height"),i=o("autoresize_overflow_padding"),r=o("autoresize_bottom_margin"),g=(e,t)=>{const o=e.getBody();o&&(o.style.overflowY=t?"":"hidden",t||(o.scrollTop=0))},l=(e,t,o,s)=>{const n=parseInt(e.getStyle(t,o,s)??"",10);return isNaN(n)?0:n},a=(e,o,r,c)=>{const d=e.dom,h=e.getDoc();if(!h)return;if((e=>e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen())(e))return void g(e,!0);const m=h.documentElement,u=c?c():i(e),f=s(e)??e.getElement().offsetHeight;let p=f;const y=l(d,m,"margin-top",!0),S=l(d,m,"margin-bottom",!0);let C=m.offsetHeight+y+S+u;C<0&&(C=0);const H=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight;C+H>f&&(p=C+H);const b=n(e);b&&p>b?(p=b,g(e,!0)):g(e,!1);const w=o.get();if(w.set&&(e.dom.setStyles(e.getDoc().documentElement,{"min-height":0}),e.dom.setStyles(e.getBody(),{"min-height":"inherit"})),p!==w.totalHeight&&(C-u!==w.contentHeight||!w.set)){const s=p-w.totalHeight;if(d.setStyle(e.getContainer(),"height",p+"px"),o.set({totalHeight:p,contentHeight:C,set:!0}),(e=>{e.dispatch("ResizeEditor")})(e),t.browser.isSafari()&&(t.os.isMacOS()||t.os.isiOS())){const t=e.getWin();t.scrollTo(t.pageXOffset,t.pageYOffset)}e.hasFocus()&&(e=>{if("setcontent"===e?.type.toLowerCase()){const t=e;return!0===t.selection||!0===t.paste}return!1})(r)&&e.selection.scrollIntoView(),(t.browser.isSafari()||t.browser.isChromium())&&s<0&&a(e,o,r,c)}};e.add("autoresize",e=>{if((e=>{const t=e.options.register;t("autoresize_overflow_padding",{processor:"number",default:1}),t("autoresize_bottom_margin",{processor:"number",default:50})})(e),e.options.isSet("resize")||e.options.set("resize",!1),!e.inline){const o=(()=>{let e={totalHeight:0,contentHeight:0,set:!1};return{get:()=>e,set:t=>{e=t}}})();((e,t)=>{e.addCommand("mceAutoResize",()=>{a(e,t)})})(e,o),((e,o)=>{const s=()=>r(e);e.on("init",n=>{const r=i(e),g=e.dom;g.setStyles(e.getDoc().documentElement,{height:"auto"}),t.browser.isEdge()||t.browser.isIE()?g.setStyles(e.getBody(),{paddingLeft:r,paddingRight:r,"min-height":0}):g.setStyles(e.getBody(),{paddingLeft:r,paddingRight:r}),a(e,o,n,s)}),e.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",t=>{a(e,o,t,s)})})(e,o)}})}(); \ No newline at end of file diff --git a/plugins/tinymce/plugins/autosave/plugin.min.js b/plugins/tinymce/plugins/autosave/plugin.min.js index 1d22b82f..3ab020c6 100644 --- a/plugins/tinymce/plugins/autosave/plugin.min.js +++ b/plugins/tinymce/plugins/autosave/plugin.min.js @@ -1 +1 @@ -!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=t=>"string"===(t=>{const e=typeof t;return null===t?"null":"object"===e&&Array.isArray(t)?"array":"object"===e&&(r=o=t,(a=String).prototype.isPrototypeOf(r)||o.constructor?.name===a.name)?"string":e;var r,o,a})(t);const r=t=>undefined===t;var o=tinymce.util.Tools.resolve("tinymce.util.Delay"),a=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),s=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=t=>{const e=/^(\d+)([ms]?)$/.exec(t);return(e&&e[2]?{s:1e3,m:6e4}[e[2]]:1)*parseInt(t,10)},i=t=>e=>e.options.get(t),u=i("autosave_ask_before_unload"),c=i("autosave_restore_when_empty"),l=i("autosave_interval"),m=i("autosave_retention"),d=t=>{const e=document.location;return t.options.get("autosave_prefix").replace(/{path}/g,e.pathname).replace(/{query}/g,e.search).replace(/{hash}/g,e.hash).replace(/{id}/g,t.id)},f=(t,e)=>{if(r(e))return t.dom.isEmpty(t.getBody());{const r=s.trim(e);if(""===r)return!0;{const e=(new DOMParser).parseFromString(r,"text/html");return t.dom.isEmpty(e)}}},v=t=>{const e=parseInt(a.getItem(d(t)+"time")??"0",10)||0;return!((new Date).getTime()-e>m(t)&&(p(t,!1),1))},p=(t,e)=>{const r=d(t);a.removeItem(r+"draft"),a.removeItem(r+"time"),!1!==e&&(t=>{t.dispatch("RemoveDraft")})(t)},y=t=>{const e=d(t);!f(t)&&t.isDirty()&&(a.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),a.setItem(e+"time",(new Date).getTime().toString()),(t=>{t.dispatch("StoreDraft")})(t))},g=t=>{const e=d(t);v(t)&&(t.setContent(a.getItem(e+"draft")??"",{format:"raw"}),(t=>{t.dispatch("RestoreDraft")})(t))};var D=tinymce.util.Tools.resolve("tinymce.EditorManager");const h=t=>e=>{const r=()=>v(t)&&!t.mode.isReadOnly();e.setEnabled(r());const o=()=>e.setEnabled(r());return t.on("StoreDraft RestoreDraft RemoveDraft",o),()=>t.off("StoreDraft RestoreDraft RemoveDraft",o)};t.add("autosave",(t=>((t=>{const r=t.options.register,o=t=>{const r=e(t);return r?{value:n(t),valid:r}:{valid:!1,message:"Must be a string."}};r("autosave_ask_before_unload",{processor:"boolean",default:!0}),r("autosave_prefix",{processor:"string",default:"tinymce-autosave-{path}{query}{hash}-{id}-"}),r("autosave_restore_when_empty",{processor:"boolean",default:!1}),r("autosave_interval",{processor:o,default:"30s"}),r("autosave_retention",{processor:o,default:"20m"})})(t),(t=>{t.editorManager.on("BeforeUnload",(t=>{let e;s.each(D.get(),(t=>{t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&u(t)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))})),e&&(t.preventDefault(),t.returnValue=e)}))})(t),(t=>{(t=>{const e=l(t);o.setEditorInterval(t,(()=>{y(t)}),e)})(t);const e=()=>{(t=>{t.undoManager.transact((()=>{g(t),p(t)})),t.focus()})(t)};t.ui.registry.addButton("restoredraft",{tooltip:"Restore last draft",icon:"restore-draft",onAction:e,onSetup:h(t)}),t.ui.registry.addMenuItem("restoredraft",{text:"Restore last draft",icon:"restore-draft",onAction:e,onSetup:h(t)})})(t),t.on("init",(()=>{c(t)&&t.dom.isEmpty(t.getBody())&&g(t)})),(t=>({hasDraft:()=>v(t),storeDraft:()=>y(t),restoreDraft:()=>g(t),removeDraft:e=>p(t,e),isEmpty:e=>f(t,e)}))(t))))}(); \ No newline at end of file +!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=t=>"string"===(t=>{const e=typeof t;return null===t?"null":"object"===e&&Array.isArray(t)?"array":"object"===e&&(r=o=t,(a=String).prototype.isPrototypeOf(r)||o.constructor?.name===a.name)?"string":e;var r,o,a})(t);const r=t=>undefined===t;var o=tinymce.util.Tools.resolve("tinymce.util.Delay"),a=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),s=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=t=>{const e=/^(\d+)([ms]?)$/.exec(t);return(e&&e[2]?{s:1e3,m:6e4}[e[2]]:1)*parseInt(t,10)},i=t=>e=>e.options.get(t),u=i("autosave_ask_before_unload"),c=i("autosave_restore_when_empty"),l=i("autosave_interval"),m=i("autosave_retention"),d=t=>{const e=document.location;return t.options.get("autosave_prefix").replace(/{path}/g,e.pathname).replace(/{query}/g,e.search).replace(/{hash}/g,e.hash).replace(/{id}/g,t.id)},f=(t,e)=>{if(r(e))return t.dom.isEmpty(t.getBody());{const r=s.trim(e);if(""===r)return!0;{const e=(new DOMParser).parseFromString(r,"text/html");return t.dom.isEmpty(e)}}},v=t=>{const e=parseInt(a.getItem(d(t)+"time")??"0",10)||0;return!((new Date).getTime()-e>m(t)&&(p(t,!1),1))},p=(t,e)=>{const r=d(t);a.removeItem(r+"draft"),a.removeItem(r+"time"),!1!==e&&(t=>{t.dispatch("RemoveDraft")})(t)},y=t=>{const e=d(t);!f(t)&&t.isDirty()&&(a.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),a.setItem(e+"time",(new Date).getTime().toString()),(t=>{t.dispatch("StoreDraft")})(t))},g=t=>{const e=d(t);v(t)&&(t.setContent(a.getItem(e+"draft")??"",{format:"raw"}),(t=>{t.dispatch("RestoreDraft")})(t))};var D=tinymce.util.Tools.resolve("tinymce.EditorManager");const h=t=>e=>{const r=()=>v(t)&&!t.mode.isReadOnly();e.setEnabled(r());const o=()=>e.setEnabled(r());return t.on("StoreDraft RestoreDraft RemoveDraft",o),()=>t.off("StoreDraft RestoreDraft RemoveDraft",o)};t.add("autosave",t=>((t=>{const r=t.options.register,o=t=>{const r=e(t);return r?{value:n(t),valid:r}:{valid:!1,message:"Must be a string."}};r("autosave_ask_before_unload",{processor:"boolean",default:!0}),r("autosave_prefix",{processor:"string",default:"tinymce-autosave-{path}{query}{hash}-{id}-"}),r("autosave_restore_when_empty",{processor:"boolean",default:!1}),r("autosave_interval",{processor:o,default:"30s"}),r("autosave_retention",{processor:o,default:"20m"})})(t),(t=>{t.editorManager.on("BeforeUnload",t=>{let e;s.each(D.get(),t=>{t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&u(t)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))}),e&&(t.preventDefault(),t.returnValue=e)})})(t),(t=>{(t=>{const e=l(t);o.setEditorInterval(t,()=>{y(t)},e)})(t);const e=()=>{(t=>{t.undoManager.transact(()=>{g(t),p(t)}),t.focus()})(t)};t.ui.registry.addButton("restoredraft",{tooltip:"Restore last draft",icon:"restore-draft",onAction:e,onSetup:h(t)}),t.ui.registry.addMenuItem("restoredraft",{text:"Restore last draft",icon:"restore-draft",onAction:e,onSetup:h(t)})})(t),t.on("init",()=>{c(t)&&t.dom.isEmpty(t.getBody())&&g(t)}),(t=>({hasDraft:()=>v(t),storeDraft:()=>y(t),restoreDraft:()=>g(t),removeDraft:e=>p(t,e),isEmpty:e=>f(t,e)}))(t)))}(); \ No newline at end of file diff --git a/plugins/tinymce/plugins/charmap/plugin.min.js b/plugins/tinymce/plugins/charmap/plugin.min.js index 87f3eda7..6a0b0c27 100644 --- a/plugins/tinymce/plugins/charmap/plugin.min.js +++ b/plugins/tinymce/plugins/charmap/plugin.min.js @@ -1 +1 @@ -!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=(e,t)=>{const r=((e,t)=>e.dispatch("insertCustomChar",{chr:t}))(e,t).chr;e.execCommand("mceInsertContent",!1,r)},r=e=>t=>e===t,a=e=>"array"===(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(r=a=e,(n=String).prototype.isPrototypeOf(r)||a.constructor?.name===n.name)?"string":t;var r,a,n})(e);const n=r(null),i=r(void 0),o=e=>"function"==typeof e,s=()=>false;class l{tag;value;static singletonNone=new l(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new l(!0,e)}static none(){return l.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?l.some(e(this.value)):l.none()}bind(e){return this.tag?e(this.value):l.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:l.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(e??"Called getOrDie on None")}static from(e){return null==e?l.none():l.some(e)}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Array.prototype.slice;const c=Array.prototype.push,u=(e,t)=>{const r=e.length,a=new Array(r);for(let n=0;n{let t=e;return{get:()=>t,set:e=>{t=e}}},h=(e,t,r=0,a)=>{const n=e.indexOf(t,r);return-1!==n&&(!!i(a)||n+t.length<=a)},m=String.fromCodePoint;var p=tinymce.util.Tools.resolve("tinymce.util.Tools");const d=e=>t=>t.options.get(e),f=d("charmap"),y=d("charmap_append"),b=p.isArray,w="User Defined",v=e=>{return b(e)?(t=e,p.grep(t,(e=>b(e)&&2===e.length))):"function"==typeof e?e():[];var t},k=e=>{const t=((e,t)=>{const r=f(e);r&&(t=[{name:w,characters:v(r)}]);const a=y(e);if(a){const e=p.grep(t,(e=>e.name===w));return e.length?(e[0].characters=[...e[0].characters,...v(a)],t):t.concat({name:w,characters:v(a)})}return t})(e,[{name:"Currency",characters:[[36,"dollar sign"],[162,"cent sign"],[8364,"euro sign"],[163,"pound sign"],[165,"yen sign"],[164,"currency sign"],[8352,"euro-currency sign"],[8353,"colon sign"],[8354,"cruzeiro sign"],[8355,"french franc sign"],[8356,"lira sign"],[8357,"mill sign"],[8358,"naira sign"],[8359,"peseta sign"],[8360,"rupee sign"],[8361,"won sign"],[8362,"new sheqel sign"],[8363,"dong sign"],[8365,"kip sign"],[8366,"tugrik sign"],[8367,"drachma sign"],[8368,"german penny symbol"],[8369,"peso sign"],[8370,"guarani sign"],[8371,"austral sign"],[8372,"hryvnia sign"],[8373,"cedi sign"],[8374,"livre tournois sign"],[8375,"spesmilo sign"],[8376,"tenge sign"],[8377,"indian rupee sign"],[8378,"turkish lira sign"],[8379,"nordic mark sign"],[8380,"manat sign"],[8381,"ruble sign"],[20870,"yen character"],[20803,"yuan character"],[22291,"yuan character, in hong kong and taiwan"],[22278,"yen/yuan character variant one"]]},{name:"Text",characters:[[169,"copyright sign"],[174,"registered sign"],[8482,"trade mark sign"],[8240,"per mille sign"],[181,"micro sign"],[183,"middle dot"],[8226,"bullet"],[8230,"three dot leader"],[8242,"minutes / feet"],[8243,"seconds / inches"],[167,"section sign"],[182,"paragraph sign"],[223,"sharp s / ess-zed"]]},{name:"Quotations",characters:[[8249,"single left-pointing angle quotation mark"],[8250,"single right-pointing angle quotation mark"],[171,"left pointing guillemet"],[187,"right pointing guillemet"],[8216,"left single quotation mark"],[8217,"right single quotation mark"],[8220,"left double quotation mark"],[8221,"right double quotation mark"],[8218,"single low-9 quotation mark"],[8222,"double low-9 quotation mark"],[60,"less-than sign"],[62,"greater-than sign"],[8804,"less-than or equal to"],[8805,"greater-than or equal to"],[8211,"en dash"],[8212,"em dash"],[175,"macron"],[8254,"overline"],[164,"currency sign"],[166,"broken bar"],[168,"diaeresis"],[161,"inverted exclamation mark"],[191,"turned question mark"],[710,"circumflex accent"],[732,"small tilde"],[176,"degree sign"],[8722,"minus sign"],[177,"plus-minus sign"],[247,"division sign"],[8260,"fraction slash"],[215,"multiplication sign"],[185,"superscript one"],[178,"superscript two"],[179,"superscript three"],[188,"fraction one quarter"],[189,"fraction one half"],[190,"fraction three quarters"]]},{name:"Mathematical",characters:[[402,"function / florin"],[8747,"integral"],[8721,"n-ary sumation"],[8734,"infinity"],[8730,"square root"],[8764,"similar to"],[8773,"approximately equal to"],[8776,"almost equal to"],[8800,"not equal to"],[8801,"identical to"],[8712,"element of"],[8713,"not an element of"],[8715,"contains as member"],[8719,"n-ary product"],[8743,"logical and"],[8744,"logical or"],[172,"not sign"],[8745,"intersection"],[8746,"union"],[8706,"partial differential"],[8704,"for all"],[8707,"there exists"],[8709,"diameter"],[8711,"backward difference"],[8727,"asterisk operator"],[8733,"proportional to"],[8736,"angle"]]},{name:"Extended Latin",characters:[[192,"A - grave"],[193,"A - acute"],[194,"A - circumflex"],[195,"A - tilde"],[196,"A - diaeresis"],[197,"A - ring above"],[256,"A - macron"],[198,"ligature AE"],[199,"C - cedilla"],[200,"E - grave"],[201,"E - acute"],[202,"E - circumflex"],[203,"E - diaeresis"],[274,"E - macron"],[204,"I - grave"],[205,"I - acute"],[206,"I - circumflex"],[207,"I - diaeresis"],[298,"I - macron"],[208,"ETH"],[209,"N - tilde"],[210,"O - grave"],[211,"O - acute"],[212,"O - circumflex"],[213,"O - tilde"],[214,"O - diaeresis"],[216,"O - slash"],[332,"O - macron"],[338,"ligature OE"],[352,"S - caron"],[217,"U - grave"],[218,"U - acute"],[219,"U - circumflex"],[220,"U - diaeresis"],[362,"U - macron"],[221,"Y - acute"],[376,"Y - diaeresis"],[562,"Y - macron"],[222,"THORN"],[224,"a - grave"],[225,"a - acute"],[226,"a - circumflex"],[227,"a - tilde"],[228,"a - diaeresis"],[229,"a - ring above"],[257,"a - macron"],[230,"ligature ae"],[231,"c - cedilla"],[232,"e - grave"],[233,"e - acute"],[234,"e - circumflex"],[235,"e - diaeresis"],[275,"e - macron"],[236,"i - grave"],[237,"i - acute"],[238,"i - circumflex"],[239,"i - diaeresis"],[299,"i - macron"],[240,"eth"],[241,"n - tilde"],[242,"o - grave"],[243,"o - acute"],[244,"o - circumflex"],[245,"o - tilde"],[246,"o - diaeresis"],[248,"o slash"],[333,"o macron"],[339,"ligature oe"],[353,"s - caron"],[249,"u - grave"],[250,"u - acute"],[251,"u - circumflex"],[252,"u - diaeresis"],[363,"u - macron"],[253,"y - acute"],[254,"thorn"],[255,"y - diaeresis"],[563,"y - macron"],[913,"Alpha"],[914,"Beta"],[915,"Gamma"],[916,"Delta"],[917,"Epsilon"],[918,"Zeta"],[919,"Eta"],[920,"Theta"],[921,"Iota"],[922,"Kappa"],[923,"Lambda"],[924,"Mu"],[925,"Nu"],[926,"Xi"],[927,"Omicron"],[928,"Pi"],[929,"Rho"],[931,"Sigma"],[932,"Tau"],[933,"Upsilon"],[934,"Phi"],[935,"Chi"],[936,"Psi"],[937,"Omega"],[945,"alpha"],[946,"beta"],[947,"gamma"],[948,"delta"],[949,"epsilon"],[950,"zeta"],[951,"eta"],[952,"theta"],[953,"iota"],[954,"kappa"],[955,"lambda"],[956,"mu"],[957,"nu"],[958,"xi"],[959,"omicron"],[960,"pi"],[961,"rho"],[962,"final sigma"],[963,"sigma"],[964,"tau"],[965,"upsilon"],[966,"phi"],[967,"chi"],[968,"psi"],[969,"omega"]]},{name:"Symbols",characters:[[8501,"alef symbol"],[982,"pi symbol"],[8476,"real part symbol"],[978,"upsilon - hook symbol"],[8472,"Weierstrass p"],[8465,"imaginary part"]]},{name:"Arrows",characters:[[8592,"leftwards arrow"],[8593,"upwards arrow"],[8594,"rightwards arrow"],[8595,"downwards arrow"],[8596,"left right arrow"],[8629,"carriage return"],[8656,"leftwards double arrow"],[8657,"upwards double arrow"],[8658,"rightwards double arrow"],[8659,"downwards double arrow"],[8660,"left right double arrow"],[8756,"therefore"],[8834,"subset of"],[8835,"superset of"],[8836,"not a subset of"],[8838,"subset of or equal to"],[8839,"superset of or equal to"],[8853,"circled plus"],[8855,"circled times"],[8869,"perpendicular"],[8901,"dot operator"],[8968,"left ceiling"],[8969,"right ceiling"],[8970,"left floor"],[8971,"right floor"],[9001,"left-pointing angle bracket"],[9002,"right-pointing angle bracket"],[9674,"lozenge"],[9824,"black spade suit"],[9827,"black club suit"],[9829,"black heart suit"],[9830,"black diamond suit"],[8194,"en space"],[8195,"em space"],[8201,"thin space"],[8204,"zero width non-joiner"],[8205,"zero width joiner"],[8206,"left-to-right mark"],[8207,"right-to-left mark"]]}]);return t.length>1?[{name:"All",characters:(r=t,n=e=>e.characters,(e=>{const t=[];for(let r=0,n=e.length;r{const r=[],a=t.toLowerCase();return(e=>{for(let n=0,i=e.length;n!!h(m(e).toLowerCase(),r)||h(t.toLowerCase(),r)||h(t.toLowerCase().replace(/\s+/g,""),r))((t=e[n])[0],t[1],a)&&r.push(t);var t})(e.characters),u(r,(e=>({text:e[1],value:m(e[0]),icon:m(e[0])})))},C="pattern",x=(e,r)=>{const a=()=>[{label:"Search",type:"input",name:C},{type:"collection",name:"results"}],i=1===r.length?g(w):g("All"),o=(e=>{let t=null;const r=()=>{n(t)||(clearTimeout(t),t=null)};return{cancel:r,throttle:(...a)=>{r(),t=setTimeout((()=>{t=null,e.apply(null,a)}),40)}}})((e=>{const t=e.getData().pattern;((e,t)=>{var a,n;(a=r,n=e=>e.name===i.get(),((e,t,r)=>{for(let a=0,n=e.length;a{const a=A(r,t);e.setData({results:a})}))})(e,t)})),c={title:"Special Character",size:"normal",body:1===r.length?{type:"panel",items:a()}:{type:"tabpanel",tabs:u(r,(e=>({title:e.name,name:e.name,items:a()})))},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{pattern:"",results:A(r[0],"")},onAction:(r,a)=>{"results"===a.name&&(t(e,a.value),r.close())},onTabChange:(e,t)=>{i.set(t.newTabName),o.throttle(e)},onChange:(e,t)=>{t.name===C&&o.throttle(e)}};e.windowManager.open(c).focus(C)},q=e=>t=>{const r=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",r),r(),()=>{e.off("NodeChange",r)}};e.add("charmap",(e=>{(e=>{const t=e.options.register,r=e=>o(e)||a(e);t("charmap",{processor:r}),t("charmap_append",{processor:r})})(e);const r=k(e);return((e,t)=>{e.addCommand("mceShowCharmap",(()=>{x(e,t)}))})(e,r),(e=>{const t=()=>e.execCommand("mceShowCharmap");e.ui.registry.addButton("charmap",{icon:"insert-character",tooltip:"Special character",onAction:t,onSetup:q(e)}),e.ui.registry.addMenuItem("charmap",{icon:"insert-character",text:"Special character...",onAction:t,onSetup:q(e)})})(e),((e,t)=>{e.ui.registry.addAutocompleter("charmap",{trigger:":",columns:"auto",minChars:2,fetch:(e,r)=>new Promise(((r,a)=>{r(A(t,e))})),onAction:(t,r,a)=>{e.selection.setRng(r),e.insertContent(a),t.hide()}})})(e,r[0]),(e=>({getCharMap:()=>k(e),insertChar:r=>{t(e,r)}}))(e)}))}(); \ No newline at end of file +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=(e,t)=>{const r=((e,t)=>e.dispatch("insertCustomChar",{chr:t}))(e,t).chr;e.execCommand("mceInsertContent",!1,r)},r=e=>t=>e===t,a=e=>"array"===(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(r=a=e,(n=String).prototype.isPrototypeOf(r)||a.constructor?.name===n.name)?"string":t;var r,a,n})(e);const n=r(null),i=r(void 0),o=e=>"function"==typeof e,s=()=>false;class l{tag;value;static singletonNone=new l(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new l(!0,e)}static none(){return l.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?l.some(e(this.value)):l.none()}bind(e){return this.tag?e(this.value):l.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:l.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(e??"Called getOrDie on None")}static from(e){return null==e?l.none():l.some(e)}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Array.prototype.slice;const c=Array.prototype.push,u=(e,t)=>{const r=e.length,a=new Array(r);for(let n=0;n{let t=e;return{get:()=>t,set:e=>{t=e}}},h=(e,t,r=0,a)=>{const n=e.indexOf(t,r);return-1!==n&&(!!i(a)||n+t.length<=a)},m=String.fromCodePoint;var p=tinymce.util.Tools.resolve("tinymce.util.Tools");const d=e=>t=>t.options.get(e),f=d("charmap"),y=d("charmap_append"),b=p.isArray,w="User Defined",v=e=>{return b(e)?(t=e,p.grep(t,e=>b(e)&&2===e.length)):"function"==typeof e?e():[];var t},k=e=>{const t=((e,t)=>{const r=f(e);r&&(t=[{name:w,characters:v(r)}]);const a=y(e);if(a){const e=p.grep(t,e=>e.name===w);return e.length?(e[0].characters=[...e[0].characters,...v(a)],t):t.concat({name:w,characters:v(a)})}return t})(e,[{name:"Currency",characters:[[36,"dollar sign"],[162,"cent sign"],[8364,"euro sign"],[163,"pound sign"],[165,"yen sign"],[164,"currency sign"],[8352,"euro-currency sign"],[8353,"colon sign"],[8354,"cruzeiro sign"],[8355,"french franc sign"],[8356,"lira sign"],[8357,"mill sign"],[8358,"naira sign"],[8359,"peseta sign"],[8360,"rupee sign"],[8361,"won sign"],[8362,"new sheqel sign"],[8363,"dong sign"],[8365,"kip sign"],[8366,"tugrik sign"],[8367,"drachma sign"],[8368,"german penny symbol"],[8369,"peso sign"],[8370,"guarani sign"],[8371,"austral sign"],[8372,"hryvnia sign"],[8373,"cedi sign"],[8374,"livre tournois sign"],[8375,"spesmilo sign"],[8376,"tenge sign"],[8377,"indian rupee sign"],[8378,"turkish lira sign"],[8379,"nordic mark sign"],[8380,"manat sign"],[8381,"ruble sign"],[20870,"yen character"],[20803,"yuan character"],[22291,"yuan character, in hong kong and taiwan"],[22278,"yen/yuan character variant one"]]},{name:"Text",characters:[[169,"copyright sign"],[174,"registered sign"],[8482,"trade mark sign"],[8240,"per mille sign"],[181,"micro sign"],[183,"middle dot"],[8226,"bullet"],[8230,"three dot leader"],[8242,"minutes / feet"],[8243,"seconds / inches"],[167,"section sign"],[182,"paragraph sign"],[223,"sharp s / ess-zed"]]},{name:"Quotations",characters:[[8249,"single left-pointing angle quotation mark"],[8250,"single right-pointing angle quotation mark"],[171,"left pointing guillemet"],[187,"right pointing guillemet"],[8216,"left single quotation mark"],[8217,"right single quotation mark"],[8220,"left double quotation mark"],[8221,"right double quotation mark"],[8218,"single low-9 quotation mark"],[8222,"double low-9 quotation mark"],[60,"less-than sign"],[62,"greater-than sign"],[8804,"less-than or equal to"],[8805,"greater-than or equal to"],[8211,"en dash"],[8212,"em dash"],[175,"macron"],[8254,"overline"],[164,"currency sign"],[166,"broken bar"],[168,"diaeresis"],[161,"inverted exclamation mark"],[191,"turned question mark"],[710,"circumflex accent"],[732,"small tilde"],[176,"degree sign"],[8722,"minus sign"],[177,"plus-minus sign"],[247,"division sign"],[8260,"fraction slash"],[215,"multiplication sign"],[185,"superscript one"],[178,"superscript two"],[179,"superscript three"],[188,"fraction one quarter"],[189,"fraction one half"],[190,"fraction three quarters"]]},{name:"Mathematical",characters:[[402,"function / florin"],[8747,"integral"],[8721,"n-ary sumation"],[8734,"infinity"],[8730,"square root"],[8764,"similar to"],[8773,"approximately equal to"],[8776,"almost equal to"],[8800,"not equal to"],[8801,"identical to"],[8712,"element of"],[8713,"not an element of"],[8715,"contains as member"],[8719,"n-ary product"],[8743,"logical and"],[8744,"logical or"],[172,"not sign"],[8745,"intersection"],[8746,"union"],[8706,"partial differential"],[8704,"for all"],[8707,"there exists"],[8709,"diameter"],[8711,"backward difference"],[8727,"asterisk operator"],[8733,"proportional to"],[8736,"angle"]]},{name:"Extended Latin",characters:[[192,"A - grave"],[193,"A - acute"],[194,"A - circumflex"],[195,"A - tilde"],[196,"A - diaeresis"],[197,"A - ring above"],[256,"A - macron"],[198,"ligature AE"],[199,"C - cedilla"],[200,"E - grave"],[201,"E - acute"],[202,"E - circumflex"],[203,"E - diaeresis"],[274,"E - macron"],[204,"I - grave"],[205,"I - acute"],[206,"I - circumflex"],[207,"I - diaeresis"],[298,"I - macron"],[208,"ETH"],[209,"N - tilde"],[210,"O - grave"],[211,"O - acute"],[212,"O - circumflex"],[213,"O - tilde"],[214,"O - diaeresis"],[216,"O - slash"],[332,"O - macron"],[338,"ligature OE"],[352,"S - caron"],[217,"U - grave"],[218,"U - acute"],[219,"U - circumflex"],[220,"U - diaeresis"],[362,"U - macron"],[221,"Y - acute"],[376,"Y - diaeresis"],[562,"Y - macron"],[222,"THORN"],[224,"a - grave"],[225,"a - acute"],[226,"a - circumflex"],[227,"a - tilde"],[228,"a - diaeresis"],[229,"a - ring above"],[257,"a - macron"],[230,"ligature ae"],[231,"c - cedilla"],[232,"e - grave"],[233,"e - acute"],[234,"e - circumflex"],[235,"e - diaeresis"],[275,"e - macron"],[236,"i - grave"],[237,"i - acute"],[238,"i - circumflex"],[239,"i - diaeresis"],[299,"i - macron"],[240,"eth"],[241,"n - tilde"],[242,"o - grave"],[243,"o - acute"],[244,"o - circumflex"],[245,"o - tilde"],[246,"o - diaeresis"],[248,"o slash"],[333,"o macron"],[339,"ligature oe"],[353,"s - caron"],[249,"u - grave"],[250,"u - acute"],[251,"u - circumflex"],[252,"u - diaeresis"],[363,"u - macron"],[253,"y - acute"],[254,"thorn"],[255,"y - diaeresis"],[563,"y - macron"],[913,"Alpha"],[914,"Beta"],[915,"Gamma"],[916,"Delta"],[917,"Epsilon"],[918,"Zeta"],[919,"Eta"],[920,"Theta"],[921,"Iota"],[922,"Kappa"],[923,"Lambda"],[924,"Mu"],[925,"Nu"],[926,"Xi"],[927,"Omicron"],[928,"Pi"],[929,"Rho"],[931,"Sigma"],[932,"Tau"],[933,"Upsilon"],[934,"Phi"],[935,"Chi"],[936,"Psi"],[937,"Omega"],[945,"alpha"],[946,"beta"],[947,"gamma"],[948,"delta"],[949,"epsilon"],[950,"zeta"],[951,"eta"],[952,"theta"],[953,"iota"],[954,"kappa"],[955,"lambda"],[956,"mu"],[957,"nu"],[958,"xi"],[959,"omicron"],[960,"pi"],[961,"rho"],[962,"final sigma"],[963,"sigma"],[964,"tau"],[965,"upsilon"],[966,"phi"],[967,"chi"],[968,"psi"],[969,"omega"]]},{name:"Symbols",characters:[[8501,"alef symbol"],[982,"pi symbol"],[8476,"real part symbol"],[978,"upsilon - hook symbol"],[8472,"Weierstrass p"],[8465,"imaginary part"]]},{name:"Arrows",characters:[[8592,"leftwards arrow"],[8593,"upwards arrow"],[8594,"rightwards arrow"],[8595,"downwards arrow"],[8596,"left right arrow"],[8629,"carriage return"],[8656,"leftwards double arrow"],[8657,"upwards double arrow"],[8658,"rightwards double arrow"],[8659,"downwards double arrow"],[8660,"left right double arrow"],[8756,"therefore"],[8834,"subset of"],[8835,"superset of"],[8836,"not a subset of"],[8838,"subset of or equal to"],[8839,"superset of or equal to"],[8853,"circled plus"],[8855,"circled times"],[8869,"perpendicular"],[8901,"dot operator"],[8968,"left ceiling"],[8969,"right ceiling"],[8970,"left floor"],[8971,"right floor"],[9001,"left-pointing angle bracket"],[9002,"right-pointing angle bracket"],[9674,"lozenge"],[9824,"black spade suit"],[9827,"black club suit"],[9829,"black heart suit"],[9830,"black diamond suit"],[8194,"en space"],[8195,"em space"],[8201,"thin space"],[8204,"zero width non-joiner"],[8205,"zero width joiner"],[8206,"left-to-right mark"],[8207,"right-to-left mark"]]}]);return t.length>1?[{name:"All",characters:(r=t,n=e=>e.characters,(e=>{const t=[];for(let r=0,n=e.length;r{const r=[],a=t.toLowerCase();return((e,t)=>{for(let r=0,a=e.length;r{((e,t,r)=>!!h(m(e).toLowerCase(),r)||h(t.toLowerCase(),r)||h(t.toLowerCase().replace(/\s+/g,""),r))(e[0],e[1],a)&&r.push(e)}),u(r,e=>({text:e[1],value:m(e[0]),icon:m(e[0])}))},C="pattern",x=(e,r)=>{const a=()=>[{label:"Search",type:"input",name:C},{type:"collection",name:"results"}],i=1===r.length?g(w):g("All"),o=(e=>{let t=null;const r=()=>{n(t)||(clearTimeout(t),t=null)};return{cancel:r,throttle:(...a)=>{r(),t=setTimeout(()=>{t=null,e.apply(null,a)},40)}}})(e=>{const t=e.getData().pattern;((e,t)=>{var a,n;(a=r,n=e=>e.name===i.get(),((e,t,r)=>{for(let a=0,n=e.length;a{const a=A(r,t);e.setData({results:a})})})(e,t)}),c={title:"Special Character",size:"normal",body:1===r.length?{type:"panel",items:a()}:{type:"tabpanel",tabs:u(r,e=>({title:e.name,name:e.name,items:a()}))},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{pattern:"",results:A(r[0],"")},onAction:(r,a)=>{"results"===a.name&&(t(e,a.value),r.close())},onTabChange:(e,t)=>{i.set(t.newTabName),o.throttle(e)},onChange:(e,t)=>{t.name===C&&o.throttle(e)}};e.windowManager.open(c).focus(C)},q=e=>t=>{const r=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",r),r(),()=>{e.off("NodeChange",r)}};e.add("charmap",e=>{(e=>{const t=e.options.register,r=e=>o(e)||a(e);t("charmap",{processor:r}),t("charmap_append",{processor:r})})(e);const r=k(e);return((e,t)=>{e.addCommand("mceShowCharmap",()=>{x(e,t)})})(e,r),(e=>{const t=()=>e.execCommand("mceShowCharmap");e.ui.registry.addButton("charmap",{icon:"insert-character",tooltip:"Special character",onAction:t,onSetup:q(e)}),e.ui.registry.addMenuItem("charmap",{icon:"insert-character",text:"Special character...",onAction:t,onSetup:q(e)})})(e),((e,t)=>{e.ui.registry.addAutocompleter("charmap",{trigger:":",columns:"auto",minChars:2,fetch:(e,r)=>new Promise((r,a)=>{r(A(t,e))}),onAction:(t,r,a)=>{e.selection.setRng(r),e.insertContent(a),t.hide()}})})(e,r[0]),(e=>({getCharMap:()=>k(e),insertChar:r=>{t(e,r)}}))(e)})}(); \ No newline at end of file diff --git a/plugins/tinymce/plugins/code/plugin.min.js b/plugins/tinymce/plugins/code/plugin.min.js index 97e34645..0830e78b 100644 --- a/plugins/tinymce/plugins/code/plugin.min.js +++ b/plugins/tinymce/plugins/code/plugin.min.js @@ -1 +1 @@ -!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("code",(e=>((e=>{e.addCommand("mceCodeEditor",(()=>{(e=>{const o=(e=>e.getContent({source_view:!0}))(e);e.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code",spellcheck:!1}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:o},onSubmit:o=>{((e,o)=>{e.focus(),e.undoManager.transact((()=>{e.setContent(o)})),e.selection.setCursorLocation(),e.nodeChanged()})(e,o.getData().code),o.close()}})})(e)}))})(e),(e=>{const o=()=>e.execCommand("mceCodeEditor");e.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:o}),e.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:o})})(e),{})))}(); \ No newline at end of file +!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("code",e=>((e=>{e.addCommand("mceCodeEditor",()=>{(e=>{const o=(e=>e.getContent({source_view:!0}))(e);e.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code",spellcheck:!1}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:o},onSubmit:o=>{((e,o)=>{e.focus(),e.undoManager.transact(()=>{e.setContent(o)}),e.selection.setCursorLocation(),e.nodeChanged()})(e,o.getData().code),o.close()}})})(e)})})(e),(e=>{const o=()=>e.execCommand("mceCodeEditor");e.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:o}),e.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:o})})(e),{}))}(); \ No newline at end of file diff --git a/plugins/tinymce/plugins/codesample/plugin.min.js b/plugins/tinymce/plugins/codesample/plugin.min.js index eb42f5cd..c3a1f21b 100644 --- a/plugins/tinymce/plugins/codesample/plugin.min.js +++ b/plugins/tinymce/plugins/codesample/plugin.min.js @@ -1,4 +1,4 @@ -!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>!(e=>null==e)(e),n=()=>{};class a{tag;value;static singletonNone=new a(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new a(!0,e)}static none(){return a.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?a.some(e(this.value)):a.none()}bind(e){return this.tag?e(this.value):a.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:a.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(e??"Called getOrDie on None")}static from(e){return t(e)?a.some(e):a.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}const s="undefined"!=typeof window?window:Function("return this;")(),r=(i=/^\s+|\s+$/g,e=>e.replace(i,""));var i,o=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils");const l=function(){const e=window.Prism;window.Prism={manual:!0};var t=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,a={},s={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof r?new r(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=d.reach);x+=_.value.length,_=_.next){var F=_.value;if(t.length>e.length)return;if(!(F instanceof r)){var A,S=1;if(y){if(!(A=i(v,x,e,m))||A.index>=e.length)break;var $=A.index,z=A.index+A[0].length,E=x;for(E+=_.value.length;$>=E;)E+=(_=_.next).value.length;if(x=E-=_.value.length,_.value instanceof r)continue;for(var C=_;C!==t.tail&&(Ed.reach&&(d.reach=O);var P=_.prev;if(B&&(P=u(t,P,B),x+=B.length),c(t,P,S),_=u(t,P,new r(g,f?s.tokenize(j,f):j,w,j)),T&&u(t,_,T),S>1){var N={cause:g+","+b,reach:O};o(e,t,n,_.prev,x,N),d&&N.reach>d.reach&&(d.reach=N.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function u(e,t,n){var a=t.next,s={value:n,prev:t,next:a};return t.next=s,a.prev=s,e.length++,s}function c(e,t,n){for(var a=t.next,s=0;s"+r.content+""},!e.document)return e.addEventListener?(s.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),a=n.language,r=n.code,i=n.immediateClose;e.postMessage(s.highlight(r,s.languages[a],a)),i&&e.close()}),!1),s):s;var d=s.util.currentScript();function g(){s.manual||s.highlightAll()}if(d&&(s.filename=d.src,d.hasAttribute("data-manual")&&(s.manual=!0)),!s.manual){var p=document.readyState;"loading"===p||"interactive"===p&&d&&d.defer?document.addEventListener("DOMContentLoaded",g):window.requestAnimationFrame?window.requestAnimationFrame(g):window.setTimeout(g,16)}return s}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{}); +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>!(e=>null==e)(e),n=()=>{};class a{tag;value;static singletonNone=new a(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new a(!0,e)}static none(){return a.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?a.some(e(this.value)):a.none()}bind(e){return this.tag?e(this.value):a.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:a.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(e??"Called getOrDie on None")}static from(e){return t(e)?a.some(e):a.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}const s="undefined"!=typeof window?window:Function("return this;")(),r=(i=/^\s+|\s+$/g,e=>e.replace(i,""));var i,o=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils");const l=function(){const e=window.Prism;window.Prism={manual:!0};var t=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,a={},s={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof r?new r(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=d.reach);x+=_.value.length,_=_.next){var F=_.value;if(t.length>e.length)return;if(!(F instanceof r)){var A,S=1;if(y){if(!(A=i(v,x,e,m))||A.index>=e.length)break;var $=A.index,z=A.index+A[0].length,E=x;for(E+=_.value.length;$>=E;)E+=(_=_.next).value.length;if(x=E-=_.value.length,_.value instanceof r)continue;for(var C=_;C!==t.tail&&(Ed.reach&&(d.reach=O);var P=_.prev;if(B&&(P=u(t,P,B),x+=B.length),c(t,P,S),_=u(t,P,new r(g,f?s.tokenize(j,f):j,w,j)),T&&u(t,_,T),S>1){var N={cause:g+","+b,reach:O};o(e,t,n,_.prev,x,N),d&&N.reach>d.reach&&(d.reach=N.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function u(e,t,n){var a=t.next,s={value:n,prev:t,next:a};return t.next=s,a.prev=s,e.length++,s}function c(e,t,n){for(var a=t.next,s=0;s"+r.content+""},!e.document)return e.addEventListener?(s.disableWorkerMessageHandler||e.addEventListener("message",function(t){var n=JSON.parse(t.data),a=n.language,r=n.code,i=n.immediateClose;e.postMessage(s.highlight(r,s.languages[a],a)),i&&e.close()},!1),s):s;var d=s.util.currentScript();function g(){s.manual||s.highlightAll()}if(d&&(s.filename=d.src,d.hasAttribute("data-manual")&&(s.manual=!0)),!s.manual){var p=document.readyState;"loading"===p||"interactive"===p&&d&&d.defer?document.addEventListener("DOMContentLoaded",g):window.requestAnimationFrame?window.requestAnimationFrame(g):window.setTimeout(g,16)}return s}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{}); /** * Prism: Lightweight, robust, elegant syntax highlighting * @@ -6,4 +6,4 @@ * @author Lea Verou * @namespace * @public - */return t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,a,s,r){if(n.language===a){var i=n.tokenStack=[];n.code=n.code.replace(s,(function(e){if("function"==typeof r&&!r(e))return e;for(var s,o=i.length;-1!==n.code.indexOf(s=t(a,o));)++o;return i[o]=e,s})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,a){if(n.language===a&&n.tokenStack){n.grammar=e.languages[a];var s=0,r=Object.keys(n.tokenStack);!function i(o){for(var l=0;l=r.length);l++){var u=o[l];if("string"==typeof u||u.content&&"string"==typeof u.content){var c=r[s],d=n.tokenStack[c],g="string"==typeof u?u:u.content,p=t(a,c),b=g.indexOf(p);if(b>-1){++s;var h=g.substring(0,b),f=new e.Token(a,e.tokenize(d,n.grammar),"language-"+a,d),m=g.substring(b+p.length),y=[];h&&y.push.apply(y,i([h])),y.push(f),m&&y.push.apply(y,i([m])),"string"==typeof u?o.splice.apply(o,[l,1].concat(y)):u.content=y}}else u.content&&i(u.content)}return o}(n.tokens)}}}})}(t),t.languages.c=t.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),t.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),t.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},t.languages.c.string],char:t.languages.c.char,comment:t.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:t.languages.c}}}}),t.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete t.languages.c.boolean,function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(t),function(e){function t(e,t){return e.replace(/<<(\d+)>>/g,(function(e,n){return"(?:"+t[+n]+")"}))}function n(e,n,a){return RegExp(t(e,n),a||"")}function a(e,t){for(var n=0;n>/g,(function(){return"(?:"+e+")"}));return e.replace(/<>/g,"[^\\s\\S]")}var s="bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",r="class enum interface record struct",i="add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",o="abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield";function l(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var u=l(r),c=RegExp(l(s+" "+r+" "+i+" "+o)),d=l(r+" "+i+" "+o),g=l(s+" "+r+" "+o),p=a(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),b=a(/\((?:[^()]|<>)*\)/.source,2),h=/@?\b[A-Za-z_]\w*\b/.source,f=t(/<<0>>(?:\s*<<1>>)?/.source,[h,p]),m=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[d,f]),y=/\[\s*(?:,\s*)*\]/.source,w=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[m,y]),k=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[p,b,y]),v=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[k]),_=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[v,m,y]),x={keyword:c,punctuation:/[<>()?,.:[\]]/},F=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,A=/"(?:\\.|[^\\"\r\n])*"/.source,S=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;e.languages.csharp=e.languages.extend("clike",{string:[{pattern:n(/(^|[^$\\])<<0>>/.source,[S]),lookbehind:!0,greedy:!0},{pattern:n(/(^|[^@$\\])<<0>>/.source,[A]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:n(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[m]),lookbehind:!0,inside:x},{pattern:n(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[h,_]),lookbehind:!0,inside:x},{pattern:n(/(\busing\s+)<<0>>(?=\s*=)/.source,[h]),lookbehind:!0},{pattern:n(/(\b<<0>>\s+)<<1>>/.source,[u,f]),lookbehind:!0,inside:x},{pattern:n(/(\bcatch\s*\(\s*)<<0>>/.source,[m]),lookbehind:!0,inside:x},{pattern:n(/(\bwhere\s+)<<0>>/.source,[h]),lookbehind:!0},{pattern:n(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[w]),lookbehind:!0,inside:x},{pattern:n(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[_,g,h]),inside:x}],keyword:c,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),e.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:n(/([(,]\s*)<<0>>(?=\s*:)/.source,[h]),lookbehind:!0,alias:"punctuation"}}),e.languages.insertBefore("csharp","class-name",{namespace:{pattern:n(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[h]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:n(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[b]),lookbehind:!0,alias:"class-name",inside:x},"return-type":{pattern:n(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[_,m]),inside:x,alias:"class-name"},"constructor-invocation":{pattern:n(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[_]),lookbehind:!0,inside:x,alias:"class-name"},"generic-method":{pattern:n(/<<0>>\s*<<1>>(?=\s*\()/.source,[h,p]),inside:{function:n(/^<<0>>/.source,[h]),generic:{pattern:RegExp(p),alias:"class-name",inside:x}}},"type-list":{pattern:n(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[u,f,h,_,c.source,b,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:n(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[f,b]),lookbehind:!0,greedy:!0,inside:e.languages.csharp},keyword:c,"class-name":{pattern:RegExp(_),greedy:!0,inside:x},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var $=A+"|"+F,z=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[$]),E=a(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[z]),2),C=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,j=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[m,E]);e.languages.insertBefore("csharp","class-name",{attribute:{pattern:n(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[C,j]),lookbehind:!0,greedy:!0,inside:{target:{pattern:n(/^<<0>>(?=\s*:)/.source,[C]),alias:"keyword"},"attribute-arguments":{pattern:n(/\(<<0>>*\)/.source,[E]),inside:e.languages.csharp},"class-name":{pattern:RegExp(m),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var B=/:[^}\r\n]+/.source,T=a(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[z]),2),O=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[T,B]),P=a(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[$]),2),N=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[P,B]);function R(t,a){return{interpolation:{pattern:n(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[t]),lookbehind:!0,inside:{"format-string":{pattern:n(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[a,B]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:n(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[O]),lookbehind:!0,greedy:!0,inside:R(O,T)},{pattern:n(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[N]),lookbehind:!0,greedy:!0,inside:R(N,P)}],char:{pattern:RegExp(F),greedy:!0}}),e.languages.dotnet=e.languages.cs=e.languages.csharp}(t),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(t),function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,a={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[a,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:a.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:a.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":a,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:a.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:a.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,(function(){return t.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(t),t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,t.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(e,n){var a={};a["language-"+n]={pattern:/(^$)/i,lookbehind:!0,inside:t.languages[n]},a.cdata=/^$/i;var s={"included-cdata":{pattern://i,inside:a}};s["language-"+n]={pattern:/[\s\S]+/,inside:t.languages[n]};var r={};r[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:s},t.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(e,n){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:t.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,function(e){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,n=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],a=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,s=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,r=/[{}\[\](),:;]/;e.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:a,operator:s,punctuation:r};var i={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:e.languages.php},o=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:i}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:i}}];e.languages.insertBefore("php","variable",{string:o,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:o,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,number:a,operator:s,punctuation:r}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),e.hooks.add("before-tokenize",(function(t){/<\?/.test(t.code)&&e.languages["markup-templating"].buildPlaceholders(t,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g)})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"php")}))}(t),t.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},t.languages.python["string-interpolation"].inside.interpolation.inside.rest=t.languages.python,t.languages.py=t.languages.python,function(e){e.languages.ruby=e.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===||[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),e.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete e.languages.ruby.function;var n="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",a=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;e.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+n+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+a),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+a+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),e.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+n),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+n),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete e.languages.ruby.string,e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),e.languages.rb=e.languages.ruby}(t),window.Prism=e,t}(),u=e=>t=>t.options.get(e),c=u("codesample_languages"),d=u("codesample_global_prismjs"),g=e=>s.Prism&&d(e)?s.Prism:l,p=e=>t(e)&&"PRE"===e.nodeName&&-1!==e.className.indexOf("language-"),b=e=>{const t=e.selection?e.selection.getNode():null;return p(t)?a.some(t):a.none()},h=e=>{const t=(e=>c(e)||[{text:"HTML/XML",value:"markup"},{text:"JavaScript",value:"javascript"},{text:"CSS",value:"css"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"}])(e),n=(s=t,(e=>0""),(e=>e.value));var s;const r=((e,t)=>b(e).fold((()=>t),(e=>{const n=e.className.match(/language-(\w+)/);return n?n[1]:t})))(e,n),i=(e=>b(e).bind((e=>a.from(e.textContent))).getOr(""))(e);e.windowManager.open({title:"Insert/Edit Code Sample",size:"large",body:{type:"panel",items:[{type:"listbox",name:"language",label:"Language",items:t},{type:"textarea",name:"code",label:"Code view",spellcheck:!1}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{language:r,code:i},onSubmit:t=>{const n=t.getData();((e,t,n)=>{const a=e.dom;e.undoManager.transact((()=>{const s=b(e);return n=o.DOM.encode(n),s.fold((()=>{e.insertContent('
'+n+"
");const s=a.select("#__new")[0];a.setAttrib(s,"id",null),e.selection.select(s)}),(s=>{a.setAttrib(s,"class","language-"+t),s.innerHTML=n,g(e).highlightElement(s),e.selection.select(s)}))}))})(e,n.language,n.code),t.close()}})};var f=tinymce.util.Tools.resolve("tinymce.util.Tools");const m=(e,t=n)=>n=>{const a=()=>{n.setEnabled(e.selection.isEditable()),t(n)};return e.on("NodeChange",a),a(),()=>{e.off("NodeChange",a)}};e.add("codesample",(e=>{(e=>{const t=e.options.register;t("codesample_languages",{processor:"object[]"}),t("codesample_global_prismjs",{processor:"boolean",default:!1})})(e),(e=>{e.on("PreProcess",(t=>{const n=e.dom,a=n.select("pre[contenteditable=false]",t.node);f.each(f.grep(a,p),(e=>{const t=e.textContent;let a;for(n.setAttrib(e,"class",r(n.getAttrib(e,"class"))),n.setAttrib(e,"contentEditable",null),n.setAttrib(e,"data-mce-highlighted",null);a=e.firstChild;)e.removeChild(a);n.add(e,"code").textContent=t}))})),e.on("SetContent",(()=>{const t=e.dom,n=f.grep(t.select("pre"),(e=>p(e)&&"true"!==t.getAttrib(e,"data-mce-highlighted")));n.length&&e.undoManager.transact((()=>{f.each(n,(n=>{f.each(t.select("br",n),(n=>{t.replace(e.getDoc().createTextNode("\n"),n)})),n.innerHTML=t.encode(n.textContent??""),g(e).highlightElement(n),t.setAttrib(n,"data-mce-highlighted",!0),n.className=r(n.className)}))}))})),e.on("PreInit",(()=>{e.parser.addNodeFilter("pre",(e=>{for(let t=0,n=e.length;t{const t=()=>e.execCommand("codesample");e.ui.registry.addToggleButton("codesample",{icon:"code-sample",tooltip:"Insert/edit code sample",onAction:t,onSetup:m(e,(t=>{t.setActive((e=>{const t=e.selection.getStart();return e.dom.is(t,'pre[class*="language-"]')})(e))}))}),e.ui.registry.addMenuItem("codesample",{text:"Code sample...",icon:"code-sample",onAction:t,onSetup:m(e)})})(e),(e=>{e.addCommand("codesample",(()=>{const t=e.selection.getNode();e.selection.isCollapsed()||p(t)?h(e):e.formatter.toggle("code")}))})(e),e.on("dblclick",(t=>{p(t.target)&&h(e)}))}))}(); \ No newline at end of file + */return t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,a,s,r){if(n.language===a){var i=n.tokenStack=[];n.code=n.code.replace(s,function(e){if("function"==typeof r&&!r(e))return e;for(var s,o=i.length;-1!==n.code.indexOf(s=t(a,o));)++o;return i[o]=e,s}),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,a){if(n.language===a&&n.tokenStack){n.grammar=e.languages[a];var s=0,r=Object.keys(n.tokenStack);!function i(o){for(var l=0;l=r.length);l++){var u=o[l];if("string"==typeof u||u.content&&"string"==typeof u.content){var c=r[s],d=n.tokenStack[c],g="string"==typeof u?u:u.content,p=t(a,c),b=g.indexOf(p);if(b>-1){++s;var h=g.substring(0,b),f=new e.Token(a,e.tokenize(d,n.grammar),"language-"+a,d),m=g.substring(b+p.length),y=[];h&&y.push.apply(y,i([h])),y.push(f),m&&y.push.apply(y,i([m])),"string"==typeof u?o.splice.apply(o,[l,1].concat(y)):u.content=y}}else u.content&&i(u.content)}return o}(n.tokens)}}}})}(t),t.languages.c=t.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),t.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),t.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},t.languages.c.string],char:t.languages.c.char,comment:t.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:t.languages.c}}}}),t.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete t.languages.c.boolean,function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(t),function(e){function t(e,t){return e.replace(/<<(\d+)>>/g,function(e,n){return"(?:"+t[+n]+")"})}function n(e,n,a){return RegExp(t(e,n),a||"")}function a(e,t){for(var n=0;n>/g,function(){return"(?:"+e+")"});return e.replace(/<>/g,"[^\\s\\S]")}var s="bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",r="class enum interface record struct",i="add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",o="abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield";function l(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var u=l(r),c=RegExp(l(s+" "+r+" "+i+" "+o)),d=l(r+" "+i+" "+o),g=l(s+" "+r+" "+o),p=a(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),b=a(/\((?:[^()]|<>)*\)/.source,2),h=/@?\b[A-Za-z_]\w*\b/.source,f=t(/<<0>>(?:\s*<<1>>)?/.source,[h,p]),m=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[d,f]),y=/\[\s*(?:,\s*)*\]/.source,w=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[m,y]),k=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[p,b,y]),v=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[k]),_=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[v,m,y]),x={keyword:c,punctuation:/[<>()?,.:[\]]/},F=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,A=/"(?:\\.|[^\\"\r\n])*"/.source,S=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;e.languages.csharp=e.languages.extend("clike",{string:[{pattern:n(/(^|[^$\\])<<0>>/.source,[S]),lookbehind:!0,greedy:!0},{pattern:n(/(^|[^@$\\])<<0>>/.source,[A]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:n(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[m]),lookbehind:!0,inside:x},{pattern:n(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[h,_]),lookbehind:!0,inside:x},{pattern:n(/(\busing\s+)<<0>>(?=\s*=)/.source,[h]),lookbehind:!0},{pattern:n(/(\b<<0>>\s+)<<1>>/.source,[u,f]),lookbehind:!0,inside:x},{pattern:n(/(\bcatch\s*\(\s*)<<0>>/.source,[m]),lookbehind:!0,inside:x},{pattern:n(/(\bwhere\s+)<<0>>/.source,[h]),lookbehind:!0},{pattern:n(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[w]),lookbehind:!0,inside:x},{pattern:n(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[_,g,h]),inside:x}],keyword:c,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),e.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:n(/([(,]\s*)<<0>>(?=\s*:)/.source,[h]),lookbehind:!0,alias:"punctuation"}}),e.languages.insertBefore("csharp","class-name",{namespace:{pattern:n(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[h]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:n(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[b]),lookbehind:!0,alias:"class-name",inside:x},"return-type":{pattern:n(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[_,m]),inside:x,alias:"class-name"},"constructor-invocation":{pattern:n(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[_]),lookbehind:!0,inside:x,alias:"class-name"},"generic-method":{pattern:n(/<<0>>\s*<<1>>(?=\s*\()/.source,[h,p]),inside:{function:n(/^<<0>>/.source,[h]),generic:{pattern:RegExp(p),alias:"class-name",inside:x}}},"type-list":{pattern:n(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[u,f,h,_,c.source,b,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:n(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[f,b]),lookbehind:!0,greedy:!0,inside:e.languages.csharp},keyword:c,"class-name":{pattern:RegExp(_),greedy:!0,inside:x},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var $=A+"|"+F,z=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[$]),E=a(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[z]),2),C=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,j=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[m,E]);e.languages.insertBefore("csharp","class-name",{attribute:{pattern:n(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[C,j]),lookbehind:!0,greedy:!0,inside:{target:{pattern:n(/^<<0>>(?=\s*:)/.source,[C]),alias:"keyword"},"attribute-arguments":{pattern:n(/\(<<0>>*\)/.source,[E]),inside:e.languages.csharp},"class-name":{pattern:RegExp(m),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var B=/:[^}\r\n]+/.source,T=a(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[z]),2),O=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[T,B]),P=a(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[$]),2),N=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[P,B]);function R(t,a){return{interpolation:{pattern:n(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[t]),lookbehind:!0,inside:{"format-string":{pattern:n(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[a,B]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:n(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[O]),lookbehind:!0,greedy:!0,inside:R(O,T)},{pattern:n(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[N]),lookbehind:!0,greedy:!0,inside:R(N,P)}],char:{pattern:RegExp(F),greedy:!0}}),e.languages.dotnet=e.languages.cs=e.languages.csharp}(t),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(t),function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,a={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[a,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:a.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:a.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":a,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:a.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:a.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})}(t),t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,t.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(e,n){var a={};a["language-"+n]={pattern:/(^$)/i,lookbehind:!0,inside:t.languages[n]},a.cdata=/^$/i;var s={"included-cdata":{pattern://i,inside:a}};s["language-"+n]={pattern:/[\s\S]+/,inside:t.languages[n]};var r={};r[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:s},t.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(e,n){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:t.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,function(e){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,n=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],a=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,s=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,r=/[{}\[\](),:;]/;e.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:a,operator:s,punctuation:r};var i={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:e.languages.php},o=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:i}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:i}}];e.languages.insertBefore("php","variable",{string:o,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:o,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,number:a,operator:s,punctuation:r}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),e.hooks.add("before-tokenize",function(t){/<\?/.test(t.code)&&e.languages["markup-templating"].buildPlaceholders(t,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g)}),e.hooks.add("after-tokenize",function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"php")})}(t),t.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},t.languages.python["string-interpolation"].inside.interpolation.inside.rest=t.languages.python,t.languages.py=t.languages.python,function(e){e.languages.ruby=e.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===||[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),e.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete e.languages.ruby.function;var n="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",a=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;e.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+n+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+a),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+a+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),e.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+n),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+n),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete e.languages.ruby.string,e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),e.languages.rb=e.languages.ruby}(t),window.Prism=e,t}(),u=e=>t=>t.options.get(e),c=u("codesample_languages"),d=u("codesample_global_prismjs"),g=e=>s.Prism&&d(e)?s.Prism:l,p=e=>t(e)&&"PRE"===e.nodeName&&-1!==e.className.indexOf("language-"),b=e=>{const t=e.selection?e.selection.getNode():null;return p(t)?a.some(t):a.none()},h=e=>{const t=(e=>c(e)||[{text:"HTML/XML",value:"markup"},{text:"JavaScript",value:"javascript"},{text:"CSS",value:"css"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"}])(e),n=(s=t,(e=>0"",e=>e.value);var s;const r=((e,t)=>b(e).fold(()=>t,e=>{const n=e.className.match(/language-(\w+)/);return n?n[1]:t}))(e,n),i=(e=>b(e).bind(e=>a.from(e.textContent)).getOr(""))(e);e.windowManager.open({title:"Insert/Edit Code Sample",size:"large",body:{type:"panel",items:[{type:"listbox",name:"language",label:"Language",items:t},{type:"textarea",name:"code",label:"Code view",spellcheck:!1}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{language:r,code:i},onSubmit:t=>{const n=t.getData();((e,t,n)=>{const a=e.dom;e.undoManager.transact(()=>{const s=b(e);return n=o.DOM.encode(n),s.fold(()=>{e.insertContent('
'+n+"
");const s=a.select("#__new")[0];a.setAttrib(s,"id",null),e.selection.select(s)},s=>{a.setAttrib(s,"class","language-"+t),s.innerHTML=n,g(e).highlightElement(s),e.selection.select(s)})})})(e,n.language,n.code),t.close()}})};var f=tinymce.util.Tools.resolve("tinymce.util.Tools");const m=(e,t=n)=>n=>{const a=()=>{n.setEnabled(e.selection.isEditable()),t(n)};return e.on("NodeChange",a),a(),()=>{e.off("NodeChange",a)}};e.add("codesample",e=>{(e=>{const t=e.options.register;t("codesample_languages",{processor:"object[]"}),t("codesample_global_prismjs",{processor:"boolean",default:!1})})(e),(e=>{e.on("PreProcess",t=>{const n=e.dom,a=n.select("pre[contenteditable=false]",t.node);f.each(f.grep(a,p),e=>{const t=e.textContent;let a;for(n.setAttrib(e,"class",r(n.getAttrib(e,"class"))),n.setAttrib(e,"contentEditable",null),n.setAttrib(e,"data-mce-highlighted",null);a=e.firstChild;)e.removeChild(a);n.add(e,"code").textContent=t})}),e.on("SetContent",()=>{const t=e.dom,n=f.grep(t.select("pre"),e=>p(e)&&"true"!==t.getAttrib(e,"data-mce-highlighted"));n.length&&e.undoManager.transact(()=>{f.each(n,n=>{f.each(t.select("br",n),n=>{t.replace(e.getDoc().createTextNode("\n"),n)}),n.innerHTML=t.encode(n.textContent??""),g(e).highlightElement(n),t.setAttrib(n,"data-mce-highlighted",!0),n.className=r(n.className)})})}),e.on("PreInit",()=>{e.parser.addNodeFilter("pre",e=>{for(let t=0,n=e.length;t{const t=()=>e.execCommand("codesample");e.ui.registry.addToggleButton("codesample",{icon:"code-sample",tooltip:"Insert/edit code sample",onAction:t,onSetup:m(e,t=>{t.setActive((e=>{const t=e.selection.getStart();return e.dom.is(t,'pre[class*="language-"]')})(e))})}),e.ui.registry.addMenuItem("codesample",{text:"Code sample...",icon:"code-sample",onAction:t,onSetup:m(e)})})(e),(e=>{e.addCommand("codesample",()=>{const t=e.selection.getNode();e.selection.isCollapsed()||p(t)?h(e):e.formatter.toggle("code")})})(e),e.on("dblclick",t=>{p(t.target)&&h(e)})})}(); \ No newline at end of file diff --git a/plugins/tinymce/plugins/directionality/plugin.min.js b/plugins/tinymce/plugins/directionality/plugin.min.js index c44bb8b5..f13de829 100644 --- a/plugins/tinymce/plugins/directionality/plugin.min.js +++ b/plugins/tinymce/plugins/directionality/plugin.min.js @@ -1 +1 @@ -!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=t=>e=>typeof e===t,r=t=>"string"===(t=>{const e=typeof t;return null===t?"null":"object"===e&&Array.isArray(t)?"array":"object"===e&&(r=o=t,(n=String).prototype.isPrototypeOf(r)||o.constructor?.name===n.name)?"string":e;var r,o,n})(t),o=e("boolean"),n=t=>!(t=>null==t)(t),i=e("function"),s=e("number"),l=()=>false;class a{tag;value;static singletonNone=new a(!1);constructor(t,e){this.tag=t,this.value=e}static some(t){return new a(!0,t)}static none(){return a.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?a.some(t(this.value)):a.none()}bind(t){return this.tag?t(this.value):a.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:a.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(t??"Called getOrDie on None")}static from(t){return n(t)?a.some(t):a.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Array.prototype.slice;const u=(t,e)=>{for(let r=0,o=t.length;r{if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},d=c,h=(t,e)=>{const r=t.dom;if(1!==r.nodeType)return!1;{const t=r;if(void 0!==t.matches)return t.matches(e);if(void 0!==t.msMatchesSelector)return t.msMatchesSelector(e);if(void 0!==t.webkitMatchesSelector)return t.webkitMatchesSelector(e);if(void 0!==t.mozMatchesSelector)return t.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}},m=t=>e=>(t=>t.dom.nodeType)(e)===t,g=m(1),f=m(3),v=m(11),y=t=>d(t.dom.host),p=(t,e)=>{t.dom.removeAttribute(e)},w=t=>{const e=f(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;const r=e.ownerDocument;return(t=>{const e=(t=>d(t.dom.getRootNode()))(t);return v(r=e)&&n(r.dom.host)?a.some(e):a.none();var r})(d(e)).fold((()=>r.body.contains(e)),(o=w,i=y,t=>o(i(t))));var o,i},b=t=>"rtl"===((t,e)=>{const r=t.dom,o=window.getComputedStyle(r).getPropertyValue(e);return""!==o||w(t)?o:((t,e)=>(t=>void 0!==t.style&&i(t.style.getPropertyValue))(t)?t.style.getPropertyValue(e):"")(r,e)})(t,"direction")?"rtl":"ltr",S=(t,e)=>(t=>((t,e)=>{const r=[];for(let o=0,n=t.length;o{const r=t.length,o=new Array(r);for(let n=0;nh(t,e))))(t),N=t=>g(t)&&"li"===t.dom.nodeName.toLowerCase();const A=(t,e,n)=>{u(e,(e=>{const c=d(e),m=N(c),f=((t,e)=>{return(e?(r=t,o="ol,ul",((t,e,r)=>{let n=t.dom;const s=i(r)?r:l;for(;n.parentNode;){n=n.parentNode;const t=d(n);if(h(t,o))return a.some(t);if(s(t))break}return a.none()})(r,0,n)):a.some(t)).getOr(t);var r,o,n})(c,m);var v;(v=f,(t=>a.from(t.dom.parentNode).map(d))(v).filter(g)).each((e=>{if(t.setStyle(f.dom,"direction",null),b(e)===n?p(f,"dir"):((t,e,n)=>{((t,e,n)=>{if(!(r(n)||o(n)||s(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")})(t.dom,e,n)})(f,"dir",n),b(f)!==n&&t.setStyle(f.dom,"direction",n),m){const e=S(f,"li[dir],li[style]");u(e,(e=>{p(e,"dir"),t.setStyle(e.dom,"direction",null)}))}}))}))},T=(t,e)=>{t.selection.isEditable()&&(A(t.dom,t.selection.getSelectedBlocks(),e),t.nodeChanged())},C=(t,e)=>r=>{const o=o=>{const n=d(o.element);r.setActive(b(n)===e),r.setEnabled(t.selection.isEditable())};return t.on("NodeChange",o),r.setEnabled(t.selection.isEditable()),()=>t.off("NodeChange",o)};t.add("directionality",(t=>{(t=>{t.addCommand("mceDirectionLTR",(()=>{T(t,"ltr")})),t.addCommand("mceDirectionRTL",(()=>{T(t,"rtl")}))})(t),(t=>{t.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:()=>t.execCommand("mceDirectionLTR"),onSetup:C(t,"ltr")}),t.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:()=>t.execCommand("mceDirectionRTL"),onSetup:C(t,"rtl")})})(t)}))}(); \ No newline at end of file +!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=t=>e=>typeof e===t,r=t=>"string"===(t=>{const e=typeof t;return null===t?"null":"object"===e&&Array.isArray(t)?"array":"object"===e&&(r=o=t,(n=String).prototype.isPrototypeOf(r)||o.constructor?.name===n.name)?"string":e;var r,o,n})(t),o=e("boolean"),n=t=>!(t=>null==t)(t),i=e("function"),s=e("number"),l=(t,e)=>t===e,a=()=>false;class c{tag;value;static singletonNone=new c(!1);constructor(t,e){this.tag=t,this.value=e}static some(t){return new c(!0,t)}static none(){return c.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?c.some(t(this.value)):c.none()}bind(t){return this.tag?t(this.value):c.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:c.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(t??"Called getOrDie on None")}static from(t){return n(t)?c.some(t):c.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Array.prototype.slice;const u=(t,e)=>{for(let r=0,o=t.length;rt.replace(m,""));var m;const h=t=>t.length>0,g=t=>{if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},f=g,y=(t,e)=>{const r=t.dom;if(1!==r.nodeType)return!1;{const t=r;if(void 0!==t.matches)return t.matches(e);if(void 0!==t.msMatchesSelector)return t.msMatchesSelector(e);if(void 0!==t.webkitMatchesSelector)return t.webkitMatchesSelector(e);if(void 0!==t.mozMatchesSelector)return t.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}},v=t=>e=>(t=>t.dom.nodeType)(e)===t,p=v(1),w=v(3),b=v(11),S=t=>f(t.dom.host),A=(t,e)=>{const r=t.dom.getAttribute(e);return null===r?void 0:r},N=(t,e)=>{t.dom.removeAttribute(e)},T=t=>void 0!==t.style&&i(t.style.getPropertyValue),C=t=>{const e=w(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;const r=e.ownerDocument;return(t=>{const e=(t=>f(t.dom.getRootNode()))(t);return b(r=e)&&n(r.dom.host)?c.some(e):c.none();var r})(f(e)).fold(()=>r.body.contains(e),(o=C,i=S,t=>o(i(t))));var o,i},k=t=>"rtl"===((t,e)=>{const r=t.dom,o=window.getComputedStyle(r).getPropertyValue(e);return""!==o||C(t)?o:((t,e)=>T(t)?t.style.getPropertyValue(e):"")(r,e)})(t,"direction")?"rtl":"ltr",x=(t,e)=>(t=>((t,e)=>{const r=[];for(let o=0,n=t.length;o{const r=t.length,o=new Array(r);for(let n=0;ny(t,e)))(t),D=t=>p(t)&&"li"===t.dom.nodeName.toLowerCase();const O=(t,e,n)=>{u(e,e=>{const m=f(e),g=D(m),v=((t,e)=>{return(e?(r=t,o="ol,ul",((t,e,r)=>{let o=t.dom;const n=i(r)?r:a;for(;o.parentNode;){o=o.parentNode;const t=f(o);if(e(t))return c.some(t);if(n(t))break}return c.none()})(r,t=>y(t,o),n)):c.some(t)).getOr(t);var r,o,n})(m,g),p=A(v,"dir"),w=c.from(t.getStyle(v.dom,"direction",!1)).filter(h);if(p===n||w.exists(t=>t===n)?(N(v,"dir"),S="direction",((t,e)=>{T(t)&&t.style.removeProperty(e)})((b=v).dom,S),((t,e,r=l)=>t.exists(t=>r(t,e)))((t=>c.from(A(t,"style")))(b).map(d),"")&&N(b,"style")):p!==n&&(((t,e,n)=>{((t,e,n)=>{if(!(r(n)||o(n)||s(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")})(t.dom,e,n)})(v,"dir",n),(w.exists(t=>t!==n)||k(v)!==n)&&t.setStyle(v.dom,"direction",n)),g){const e=x(v,"li[dir],li[style]");u(e,e=>{N(e,"dir"),t.setStyle(e.dom,"direction",null)})}var b,S})},M=(t,e)=>{t.selection.isEditable()&&(O(t.dom,t.selection.getSelectedBlocks(),e),t.nodeChanged())};t.add("directionality",t=>{(t=>{t.addCommand("mceDirectionLTR",()=>{M(t,"ltr")}),t.addCommand("mceDirectionRTL",()=>{M(t,"rtl")})})(t),(t=>{const e=e=>r=>{const o=o=>{const n=t.dom.isBlock(o.element)?o.element:t.dom.getParent(o.element,t.dom.isBlock);if(n){const o=t.dom.getStyle(n,"direction")||t.dom.getAttrib(n,"dir");r.setActive(o===e)}};return t.on("NodeChange",o),()=>t.off("NodeChange",o)};t.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",context:"editable",onAction:()=>t.execCommand("mceDirectionLTR"),onSetup:e("ltr")}),t.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",context:"editable",onAction:()=>t.execCommand("mceDirectionRTL"),onSetup:e("rtl")})})(t)})}(); \ No newline at end of file diff --git a/plugins/tinymce/plugins/emoticons/plugin.min.js b/plugins/tinymce/plugins/emoticons/plugin.min.js index 717f4021..bb09395a 100644 --- a/plugins/tinymce/plugins/emoticons/plugin.min.js +++ b/plugins/tinymce/plugins/emoticons/plugin.min.js @@ -1 +1 @@ -!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=t=>e=>t===e,o=e(null),n=e(void 0),s=t=>"function"==typeof t;const r=()=>{},a=()=>!1;class i{tag;value;static singletonNone=new i(!1);constructor(t,e){this.tag=t,this.value=e}static some(t){return new i(!0,t)}static none(){return i.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?i.some(t(this.value)):i.none()}bind(t){return this.tag?t(this.value):i.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:i.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(t??"Called getOrDie on None")}static from(t){return null==t?i.none():i.some(t)}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Array.prototype.slice;const l=(t,e)=>{const o=t.length,n=new Array(o);for(let s=0;s{const o=c(t);for(let n=0,s=o.length;nu.call(t,e),d=t=>{let e=t;return{get:()=>e,set:t=>{e=t}}},h=(p=(t,e)=>e,(...t)=>{if(0===t.length)throw new Error("Can't merge zero objects");const e={};for(let o=0;o{const t=(t=>{const e=d(i.none()),o=()=>e.get().each(t);return{clear:()=>{o(),e.set(i.none())},isSet:()=>e.get().isSome(),get:()=>e.get(),set:t=>{o(),e.set(i.some(t))}}})(r);return{...t,on:e=>t.get().each(e)}},f=(t,e,o=0,s)=>{const r=t.indexOf(e,o);return-1!==r&&(!!n(s)||r+e.length<=s)};var v=tinymce.util.Tools.resolve("tinymce.Resource");const b=t=>e=>e.options.get(t),w=b("emoticons_database"),j=b("emoticons_database_url"),C=b("emoticons_database_id"),_=b("emoticons_append"),A=b("emoticons_images_url"),k="All",O={symbols:"Symbols",people:"People",animals_and_nature:"Animals and Nature",food_and_drink:"Food and Drink",activity:"Activity",travel_and_places:"Travel and Places",objects:"Objects",flags:"Flags",user:"User Defined"},x=(t,e)=>m(t,e)?t[e]:e,E=t=>{const e=_(t);return o=t=>({keywords:[],category:"user",...t}),((t,e)=>{const o={};return g(t,((t,n)=>{const s=e(t,n);o[s.k]=s.v})),o})(e,((t,e)=>({k:e,v:o(t)})));var o},L=(t,e)=>f(t.title.toLowerCase(),e)||(t=>{for(let n=0,s=t.length;n{const n=[],s=e.toLowerCase(),r=o.fold((()=>a),(t=>e=>e>=t));for(let o=0;o{const n={pattern:"",results:S(e.listAll(),"",i.some(300))},s=d(k),r=(t=>{let e=null;const n=()=>{o(e)||(clearTimeout(e),e=null)};return{cancel:n,throttle:(...o)=>{n(),e=setTimeout((()=>{e=null,t.apply(null,o)}),200)}}})((t=>{(t=>{const o=t.getData(),n=s.get(),r=e.listCategory(n),a=S(r,o[N],n===k?i.some(300):i.none());t.setData({results:a})})(t)})),a={label:"Search",type:"input",name:N},c={type:"collection",name:"results"},u=()=>({title:"Emojis",size:"normal",body:{type:"tabpanel",tabs:l(e.listCategories(),(t=>({title:t,name:t,items:[a,c]})))},initialData:n,onTabChange:(t,e)=>{s.set(e.newTabName),r.throttle(t)},onChange:r.throttle,onAction:(e,o)=>{"results"===o.name&&(((t,e)=>{t.insertContent(e)})(t,o.value),e.close())},buttons:[{type:"cancel",text:"Close",primary:!0}]}),g=t.windowManager.open(u());g.focus(N),e.hasLoaded()||(g.block("Loading emojis..."),e.waitForLoad().then((()=>{g.redial(u()),r.throttle(g),g.focus(N),g.unblock()})).catch((t=>{g.redial({title:"Emojis",body:{type:"panel",items:[{type:"alertbanner",level:"error",icon:"warning",text:"Could not load emojis"}]},buttons:[{type:"cancel",text:"Close",primary:!0}],initialData:{pattern:"",results:[]}}),g.focus(N),g.unblock()})))},D=t=>e=>{const o=()=>{e.setEnabled(t.selection.isEditable())};return t.on("NodeChange",o),o(),()=>{t.off("NodeChange",o)}};t.add("emoticons",((t,e)=>{((t,e)=>{const o=t.options.register;o("emoticons_database",{processor:"string",default:"emojis"}),o("emoticons_database_url",{processor:"string",default:`${e}/js/${w(t)}${t.suffix}.js`}),o("emoticons_database_id",{processor:"string",default:"tinymce.plugins.emoticons"}),o("emoticons_append",{processor:"object",default:{}}),o("emoticons_images_url",{processor:"string",default:"https://cdnjs.cloudflare.com/ajax/libs/twemoji/15.1.0/72x72/"})})(t,e);const o=((t,e,o)=>{const n=y(),s=y(),r=A(t),a=t=>{return o="=4&&e.substr(0,4)===o?t.char.replace(/src="([^"]+)"/,((t,e)=>`src="${r}${e}"`)):t.char;var e,o};t.on("init",(()=>{v.load(o,e).then((e=>{const o=E(t);(t=>{const e={},o=[];g(t,((t,n)=>{const s={title:n,keywords:t.keywords,char:a(t),category:x(O,t.category)},r=void 0!==e[s.category]?e[s.category]:[];e[s.category]=r.concat([s]),o.push(s)})),n.set(e),s.set(o)})(h(e,o))}),(t=>{console.log(`Failed to load emojis: ${t}`),n.set({}),s.set([])}))}));const l=()=>s.get().getOr([]),u=()=>n.isSet()&&s.isSet();return{listCategories:()=>[k].concat(c(n.get().getOr({}))),hasLoaded:u,waitForLoad:()=>u()?Promise.resolve(!0):new Promise(((t,o)=>{let n=15;const s=setInterval((()=>{u()?(clearInterval(s),t(!0)):(n--,n<0&&(console.log("Could not load emojis from url: "+e),clearInterval(s),o(!1)))}),100)})),listAll:l,listCategory:t=>t===k?l():n.get().bind((e=>i.from(e[t]))).getOr([])}})(t,j(t),C(t));return((t,e)=>{t.addCommand("mceEmoticons",(()=>T(t,e)))})(t,o),(t=>{const e=()=>t.execCommand("mceEmoticons");t.ui.registry.addButton("emoticons",{tooltip:"Emojis",icon:"emoji",onAction:e,onSetup:D(t)}),t.ui.registry.addMenuItem("emoticons",{text:"Emojis...",icon:"emoji",onAction:e,onSetup:D(t)})})(t),((t,e)=>{t.ui.registry.addAutocompleter("emoticons",{trigger:":",columns:"auto",minChars:2,fetch:(t,o)=>e.waitForLoad().then((()=>{const n=e.listAll();return S(n,t,i.some(o))})),onAction:(e,o,n)=>{t.selection.setRng(o),t.insertContent(n),e.hide()}})})(t,o),(t=>{t.on("PreInit",(()=>{t.parser.addAttributeFilter("data-emoticon",(t=>{(t=>{for(let o=0,n=t.length;oo.waitForLoad().then((()=>o.listAll()))}}))}(); \ No newline at end of file +!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=t=>e=>t===e,o=e(null),n=e(void 0),s=t=>"function"==typeof t;const r=()=>{},a=()=>!1;class i{tag;value;static singletonNone=new i(!1);constructor(t,e){this.tag=t,this.value=e}static some(t){return new i(!0,t)}static none(){return i.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?i.some(t(this.value)):i.none()}bind(t){return this.tag?t(this.value):i.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:i.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(t??"Called getOrDie on None")}static from(t){return null==t?i.none():i.some(t)}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Array.prototype.slice;const l=(t,e)=>{const o=t.length,n=new Array(o);for(let s=0;s{const o=c(t);for(let n=0,s=o.length;nu.call(t,e),d=t=>{let e=t;return{get:()=>e,set:t=>{e=t}}},h=(p=(t,e)=>e,(...t)=>{if(0===t.length)throw new Error("Can't merge zero objects");const e={};for(let o=0;o{const t=(t=>{const e=d(i.none()),o=()=>e.get().each(t);return{clear:()=>{o(),e.set(i.none())},isSet:()=>e.get().isSome(),get:()=>e.get(),set:t=>{o(),e.set(i.some(t))}}})(r);return{...t,on:e=>t.get().each(e)}},f=(t,e,o=0,s)=>{const r=t.indexOf(e,o);return-1!==r&&(!!n(s)||r+e.length<=s)};var v=tinymce.util.Tools.resolve("tinymce.Resource");const b=t=>e=>e.options.get(t),w=b("emoticons_database"),j=b("emoticons_database_url"),C=b("emoticons_database_id"),_=b("emoticons_append"),A=b("emoticons_images_url"),k="All",O={symbols:"Symbols",people:"People",animals_and_nature:"Animals and Nature",food_and_drink:"Food and Drink",activity:"Activity",travel_and_places:"Travel and Places",objects:"Objects",flags:"Flags",user:"User Defined"},x=(t,e)=>m(t,e)?t[e]:e,E=t=>{const e=_(t);return o=t=>({keywords:[],category:"user",...t}),((t,e)=>{const o={};return g(t,(t,n)=>{const s=e(t,n);o[s.k]=s.v}),o})(e,(t,e)=>({k:e,v:o(t)}));var o},L=(t,e)=>f(t.title.toLowerCase(),e)||((t,e)=>{for(let o=0,n=t.length;of(t.toLowerCase(),e)),S=(t,e,o)=>{const n=[],s=e.toLowerCase(),r=o.fold(()=>a,t=>e=>e>=t);for(let o=0;o{const n={pattern:"",results:S(e.listAll(),"",i.some(300))},s=d(k),r=(t=>{let e=null;const n=()=>{o(e)||(clearTimeout(e),e=null)};return{cancel:n,throttle:(...o)=>{n(),e=setTimeout(()=>{e=null,t.apply(null,o)},200)}}})(t=>{(t=>{const o=t.getData(),n=s.get(),r=e.listCategory(n),a=S(r,o[N],n===k?i.some(300):i.none());t.setData({results:a})})(t)}),a={label:"Search",type:"input",name:N},c={type:"collection",name:"results"},u=()=>({title:"Emojis",size:"normal",body:{type:"tabpanel",tabs:l(e.listCategories(),t=>({title:t,name:t,items:[a,c]}))},initialData:n,onTabChange:(t,e)=>{s.set(e.newTabName),r.throttle(t)},onChange:r.throttle,onAction:(e,o)=>{"results"===o.name&&(((t,e)=>{t.insertContent(e)})(t,o.value),e.close())},buttons:[{type:"cancel",text:"Close",primary:!0}]}),g=t.windowManager.open(u());g.focus(N),e.hasLoaded()||(g.block("Loading emojis..."),e.waitForLoad().then(()=>{g.redial(u()),r.throttle(g),g.focus(N),g.unblock()}).catch(t=>{g.redial({title:"Emojis",body:{type:"panel",items:[{type:"alertbanner",level:"error",icon:"warning",text:"Could not load emojis"}]},buttons:[{type:"cancel",text:"Close",primary:!0}],initialData:{pattern:"",results:[]}}),g.focus(N),g.unblock()}))},D=t=>e=>{const o=()=>{e.setEnabled(t.selection.isEditable())};return t.on("NodeChange",o),o(),()=>{t.off("NodeChange",o)}};t.add("emoticons",(t,e)=>{((t,e)=>{const o=t.options.register;o("emoticons_database",{processor:"string",default:"emojis"}),o("emoticons_database_url",{processor:"string",default:`${e}/js/${w(t)}${t.suffix}.js`}),o("emoticons_database_id",{processor:"string",default:"tinymce.plugins.emoticons"}),o("emoticons_append",{processor:"object",default:{}}),o("emoticons_images_url",{processor:"string",default:"https://cdnjs.cloudflare.com/ajax/libs/twemoji/15.1.0/72x72/"})})(t,e);const o=((t,e,o)=>{const n=y(),s=y(),r=A(t),a=t=>{return o="=4&&e.substr(0,4)===o?t.char.replace(/src="([^"]+)"/,(t,e)=>`src="${r}${e}"`):t.char;var e,o};t.on("init",()=>{v.load(o,e).then(e=>{const o=E(t);(t=>{const e={},o=[];g(t,(t,n)=>{const s={title:n,keywords:t.keywords,char:a(t),category:x(O,t.category)},r=void 0!==e[s.category]?e[s.category]:[];e[s.category]=r.concat([s]),o.push(s)}),n.set(e),s.set(o)})(h(e,o))},t=>{console.log(`Failed to load emojis: ${t}`),n.set({}),s.set([])})});const l=()=>s.get().getOr([]),u=()=>n.isSet()&&s.isSet();return{listCategories:()=>[k].concat(c(n.get().getOr({}))),hasLoaded:u,waitForLoad:()=>u()?Promise.resolve(!0):new Promise((t,o)=>{let n=15;const s=setInterval(()=>{u()?(clearInterval(s),t(!0)):(n--,n<0&&(console.log("Could not load emojis from url: "+e),clearInterval(s),o(!1)))},100)}),listAll:l,listCategory:t=>t===k?l():n.get().bind(e=>i.from(e[t])).getOr([])}})(t,j(t),C(t));return((t,e)=>{t.addCommand("mceEmoticons",()=>T(t,e))})(t,o),(t=>{const e=()=>t.execCommand("mceEmoticons");t.ui.registry.addButton("emoticons",{tooltip:"Emojis",icon:"emoji",onAction:e,onSetup:D(t)}),t.ui.registry.addMenuItem("emoticons",{text:"Emojis...",icon:"emoji",onAction:e,onSetup:D(t)})})(t),((t,e)=>{t.ui.registry.addAutocompleter("emoticons",{trigger:":",columns:"auto",minChars:2,fetch:(t,o)=>e.waitForLoad().then(()=>{const n=e.listAll();return S(n,t,i.some(o))}),onAction:(e,o,n)=>{t.selection.setRng(o),t.insertContent(n),e.hide()}})})(t,o),(t=>{t.on("PreInit",()=>{t.parser.addAttributeFilter("data-emoticon",t=>{((t,e)=>{for(let o=0,n=t.length;o{t.attr("data-mce-resize","false"),t.attr("data-mce-placeholder","1")})})})})(t),{getAllEmojis:()=>o.waitForLoad().then(()=>o.listAll())}})}(); \ No newline at end of file diff --git a/plugins/tinymce/plugins/fullscreen/plugin.min.js b/plugins/tinymce/plugins/fullscreen/plugin.min.js index cf8f6496..803649cf 100644 --- a/plugins/tinymce/plugins/fullscreen/plugin.min.js +++ b/plugins/tinymce/plugins/fullscreen/plugin.min.js @@ -1 +1 @@ -!function(){"use strict";const e=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(n=r=e,(o=String).prototype.isPrototypeOf(n)||r.constructor?.name===o.name)?"string":t;var n,r,o})(t)===e,t=e=>t=>typeof t===e,n=e=>t=>e===t,r=e("string"),o=e("object"),s=e("array"),i=n(null),l=t("boolean"),a=n(void 0),c=e=>!(e=>null==e)(e),u=t("function"),d=t("number"),m=()=>{},h=e=>()=>e;function g(e,...t){return(...n)=>{const r=t.concat(n);return e.apply(null,r)}}const p=h(!1),f=h(!0);class v{tag;value;static singletonNone=new v(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new v(!0,e)}static none(){return v.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?v.some(e(this.value)):v.none()}bind(e){return this.tag?e(this.value):v.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:v.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(e??"Called getOrDie on None")}static from(e){return c(e)?v.some(e):v.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}const w=Array.prototype.push,y=(e,t)=>{const n=e.length,r=new Array(n);for(let o=0;o{for(let n=0,r=e.length;n{const n=[];for(let r=0,o=e.length;r((e,t,n)=>{for(let r=0,o=e.length;r{let t=e;return{get:()=>t,set:e=>{t=e}}},O="undefined"!=typeof window?window:Function("return this;")(),k=(e,t)=>((e,t)=>{let n=null!=t?t:O;for(let t=0;t{const t=F(v.none()),n=()=>t.get().each(e);return{clear:()=>{n(),t.set(v.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{n(),t.set(v.some(e))}}},C=()=>T((e=>e.unbind())),A=(e,t,n=0,r)=>{const o=e.indexOf(t,n);return-1!==o&&(!!a(r)||o+t.length<=r)};var R=tinymce.util.Tools.resolve("tinymce.PluginManager");const L=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},M=L,P=(e,t)=>{const n=e.dom;if(1!==n.nodeType)return!1;{const e=n;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},D=()=>N(0,0),N=(e,t)=>({major:e,minor:t}),H={nu:N,detect:(e,t)=>{const n=String(t).toLowerCase();return 0===e.length?D():((e,t)=>{const n=((e,t)=>{for(let n=0;nNumber(t.replace(n,"$"+e));return N(r(1),r(2))})(e,n)},unknown:D},V=(e,t)=>{const n=String(t).toLowerCase();return x(e,(e=>e.search(n)))},W=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,q=e=>t=>A(t,e),B=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>A(e,"edge/")&&A(e,"chrome")&&A(e,"safari")&&A(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,W],search:e=>A(e,"chrome")&&!A(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>A(e,"msie")||A(e,"trident")},{name:"Opera",versionRegexes:[W,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:q("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:q("firefox")},{name:"Safari",versionRegexes:[W,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(A(e,"safari")||A(e,"mobile/"))&&A(e,"applewebkit")}],I=[{name:"Windows",search:q("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>A(e,"iphone")||A(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:q("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:q("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:q("linux"),versionRegexes:[]},{name:"Solaris",search:q("sunos"),versionRegexes:[]},{name:"FreeBSD",search:q("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:q("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],j={browsers:h(B),oses:h(I)},_="Edge",z="Chromium",K="Opera",$="Firefox",U="Safari",X=e=>{const t=e.current,n=e.version,r=e=>()=>t===e;return{current:t,version:n,isEdge:r(_),isChromium:r(z),isIE:r("IE"),isOpera:r(K),isFirefox:r($),isSafari:r(U)}},Y=()=>X({current:void 0,version:H.unknown()}),G=X,J=(h(_),h(z),h("IE"),h(K),h($),h(U),"Windows"),Q="Android",Z="Linux",ee="macOS",te="Solaris",ne="FreeBSD",re="ChromeOS",oe=e=>{const t=e.current,n=e.version,r=e=>()=>t===e;return{current:t,version:n,isWindows:r(J),isiOS:r("iOS"),isAndroid:r(Q),isMacOS:r(ee),isLinux:r(Z),isSolaris:r(te),isFreeBSD:r(ne),isChromeOS:r(re)}},se=()=>oe({current:void 0,version:H.unknown()}),ie=oe,le=(h(J),h("iOS"),h(Q),h(Z),h(ee),h(te),h(ne),h(re),(e,t,n)=>{const r=j.browsers(),o=j.oses(),s=t.bind((e=>((e,t)=>((e,t)=>{for(let n=0;n{const n=t.brand.toLowerCase();return x(e,(e=>n===e.brand?.toLowerCase())).map((e=>({current:e.name,version:H.nu(parseInt(t.version,10),0)})))})))(r,e))).orThunk((()=>((e,t)=>V(e,t).map((e=>{const n=H.detect(e.versionRegexes,t);return{current:e.name,version:n}})))(r,e))).fold(Y,G),i=((e,t)=>V(e,t).map((e=>{const n=H.detect(e.versionRegexes,t);return{current:e.name,version:n}})))(o,e).fold(se,ie),l=((e,t,n,r)=>{const o=e.isiOS()&&!0===/ipad/i.test(n),s=e.isiOS()&&!o,i=e.isiOS()||e.isAndroid(),l=i||r("(pointer:coarse)"),a=o||!s&&i&&r("(min-device-width:768px)"),c=s||i&&!a,u=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(n),d=!c&&!a&&!u;return{isiPad:h(o),isiPhone:h(s),isTablet:h(a),isPhone:h(c),isTouch:h(l),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:h(u),isDesktop:h(d)}})(i,s,e,n);return{browser:s,os:i,deviceType:l}}),ae=e=>window.matchMedia(e).matches;let ce=(e=>{let t,n=!1;return(...r)=>(n||(n=!0,t=e.apply(null,r)),t)})((()=>le(window.navigator.userAgent,v.from(window.navigator.userAgentData),ae)));const ue=Object.getPrototypeOf,de=e=>{const t=k("ownerDocument.defaultView",e);return o(e)&&((e=>((e,t)=>{const n=((e,t)=>k(e,t))(e,t);if(null==n)throw new Error(e+" not available on this browser");return n})("HTMLElement",e))(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(ue(e).constructor.name))},me=e=>t=>(e=>e.dom.nodeType)(t)===e,he=me(1),ge=me(3),pe=me(11),fe=e=>M(e.dom.ownerDocument),ve=e=>y(e.dom.childNodes,M),we=e=>{const t=(e=>M(e.dom.getRootNode()))(e);return pe(n=t)&&c(n.dom.host)?v.some(t):v.none();var n},ye=e=>M(e.dom.host),be=e=>{const t=M((e=>{if(c(e.target)){const t=M(e.target);if(he(t)&&c(t.dom.shadowRoot)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return(e=>0e.stopPropagation(),r=()=>e.preventDefault(),o=(s=r,i=n,(...e)=>s(i.apply(null,e)));var s,i;return((e,t,n,r,o,s,i)=>({target:e,x:t,y:n,stop:r,prevent:o,kill:s,raw:i}))(t,e.clientX,e.clientY,n,r,o,e)},Se=(e,t,n,r)=>{e.dom.removeEventListener(t,n,r)},xe=f,Ee=(e,t,n)=>((e,t,n,r)=>((e,t,n,r,o)=>{const s=((e,t)=>n=>{e(n)&&t(be(n))})(n,r);return e.dom.addEventListener(t,s,o),{unbind:g(Se,e,t,s,o)}})(e,t,n,r,!1))(e,t,xe,n),Fe=(e,t)=>{const n=e.dom.getAttribute(t);return null===n?void 0:n},Oe=(e,t)=>{e.dom.removeAttribute(t)},ke=e=>void 0!==e.style&&u(e.style.getPropertyValue),Te=e=>{const t=ge(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const n=t.ownerDocument;return we(M(t)).fold((()=>n.body.contains(t)),(r=Te,o=ye,e=>r(o(e))));var r,o},Ce=(e,t,n)=>{if(!r(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);ke(e)&&e.style.setProperty(t,n)},Ae=(e,t,n)=>{const r=e.dom;Ce(r,t,n)},Re=(e,t)=>{const n=e.dom;((e,t)=>{const n=E(e);for(let r=0,o=n.length;r{Ce(n,t,e)}))},Le=(e,t)=>{const n=e.dom,r=window.getComputedStyle(n).getPropertyValue(t);return""!==r||Te(e)?r:Me(n,t)},Me=(e,t)=>ke(e)?e.style.getPropertyValue(t):"",Pe=(e,t)=>({left:e,top:t,translate:(n,r)=>Pe(e+n,t+r)}),De=Pe,Ne=(e,t,n)=>((e,t,n)=>S(((e,t)=>{const n=u(t)?t:p;let r=e.dom;const o=[];for(;null!==r.parentNode&&void 0!==r.parentNode;){const e=r.parentNode,t=M(e);if(o.push(t),!0===n(t))break;r=e}return o})(e,n),t))(e,(e=>P(e,t)),n),He=(e,t)=>(e=>{return S((e=>v.from(e.dom.parentNode).map(M))(n=e).map(ve).map((e=>S(e,(e=>{return t=e,!(n.dom===t.dom);var t})))).getOr([]),(e=>P(e,t)));var n})(e),Ve=e=>{const t=void 0===e?window:e;return ce().browser.isFirefox()?v.none():v.from(t.visualViewport)},We=(e,t,n,r)=>({x:e,y:t,width:n,height:r,right:e+n,bottom:t+r}),qe=e=>{const t=void 0===e?window:e,n=t.document,r=(e=>{const t=void 0!==e?e.dom:document,n=t.body.scrollLeft||t.documentElement.scrollLeft,r=t.body.scrollTop||t.documentElement.scrollTop;return De(n,r)})(M(n));return Ve(t).fold((()=>{const e=t.document.documentElement,n=e.clientWidth,o=e.clientHeight;return We(r.left,r.top,n,o)}),(e=>We(Math.max(e.pageLeft,r.left),Math.max(e.pageTop,r.top),e.width,e.height)))},Be=(e,t,n)=>Ve(n).map((n=>{const r=e=>t(be(e));return n.addEventListener(e,r),{unbind:()=>n.removeEventListener(e,r)}})).getOrThunk((()=>({unbind:m})));var Ie=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),je=tinymce.util.Tools.resolve("tinymce.Env");const _e=(e,t)=>{e.dispatch("FullscreenStateChanged",{state:t}),e.dispatch("ResizeEditor")},ze=e=>e.options.get("fullscreen_native");const Ke=e=>{return e.dom===(void 0!==(t=fe(e).dom).fullscreenElement?t.fullscreenElement:void 0!==t.msFullscreenElement?t.msFullscreenElement:void 0!==t.webkitFullscreenElement?t.webkitFullscreenElement:null);var t},$e="data-ephox-mobile-fullscreen-style",Ue="position:absolute!important;",Xe="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",Ye=je.os.isAndroid(),Ge=(e,t,n)=>{const o=t=>n=>{const o=Fe(n,"style"),s=void 0===o?"no-styles":o.trim();s!==t&&(((e,t,n)=>{((e,t,n)=>{if(!(r(n)||l(n)||d(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")})(e.dom,t,n)})(n,$e,s),Re(n,e.parseStyle(t)))},i=Ne(t,"*"),a=(e=>{const t=[];for(let n=0,r=e.length;nHe(e,"*:not(.tox-silver-sink)")))),c=(e=>{const t=Le(e,"background-color");return void 0!==t&&""!==t?"background-color:"+t+"!important":"background-color:rgb(255,255,255)!important;"})(n);b(a,o("display:none!important;")),b(i,o(Ue+Xe+c)),o((!0===Ye?"":Ue)+Xe+c)(t)},Je=Ie.DOM,Qe=Ve().fold((()=>({bind:m,unbind:m})),(e=>{const t=(()=>{const e=T(m);return{...e,on:t=>e.get().each(t)}})(),n=C(),r=C(),o=(e=>{let t=null;return{cancel:()=>{i(t)||(clearTimeout(t),t=null)},throttle:(...n)=>{i(t)&&(t=setTimeout((()=>{t=null,e.apply(null,n)}),50))}}})((()=>{document.body.scrollTop=0,document.documentElement.scrollTop=0,window.requestAnimationFrame((()=>{t.on((t=>Re(t,{top:e.offsetTop+"px",left:e.offsetLeft+"px",height:e.height+"px",width:e.width+"px"})))}))}));return{bind:e=>{t.set(e),o.throttle(),n.set(Be("resize",o.throttle)),r.set(Be("scroll",o.throttle))},unbind:()=>{t.on((()=>{n.clear(),r.clear()})),t.clear()}}})),Ze=(e,t)=>{const n=document.body,r=document.documentElement,o=e.getContainer(),s=M(o),i=(l=s,v.from(l.dom.nextSibling).map(M)).filter((e=>(e=>he(e)&&de(e.dom))(e)&&(e=>(e=>void 0!==e.dom.classList)(e)&&e.dom.classList.contains("tox-silver-sink"))(e)));var l;const a=(e=>{const t=M(e.getElement());return we(t).map(ye).getOrThunk((()=>(e=>{const t=e.dom.body;if(null==t)throw new Error("Body is not available yet");return M(t)})(fe(t))))})(e),c=t.get(),u=M(e.getBody()),d=je.deviceType.isTouch(),m=o.style,h=e.iframeElement,g=h?.style,p=e=>{e(n,"tox-fullscreen"),e(r,"tox-fullscreen"),e(o,"tox-fullscreen"),we(s).map((e=>ye(e).dom)).each((t=>{e(t,"tox-fullscreen"),e(t,"tox-shadowhost")}))},f=()=>{d&&(e=>{const t=(e=>{const t=document;return 1!==(n=t).nodeType&&9!==n.nodeType&&11!==n.nodeType||0===n.childElementCount?[]:y(t.querySelectorAll(e),M);var n})("["+$e+"]");b(t,(t=>{const n=Fe(t,$e);n&&"no-styles"!==n?Re(t,e.parseStyle(n)):Oe(t,"style"),Oe(t,$e)}))})(e.dom),p(Je.removeClass),Qe.unbind(),v.from(t.get()).each((e=>e.fullscreenChangeHandler.unbind()))};if(c)c.fullscreenChangeHandler.unbind(),ze(e)&&Ke(a)&&(e=>{const t=e.dom;t.exitFullscreen?t.exitFullscreen():t.msExitFullscreen?t.msExitFullscreen():t.webkitCancelFullScreen&&t.webkitCancelFullScreen()})(fe(a)),g.width=c.iframeWidth,g.height=c.iframeHeight,m.width=c.containerWidth,m.height=c.containerHeight,m.top=c.containerTop,m.left=c.containerLeft,S=i,x=c.sinkCssPosition,E=(e,t)=>{Ae(e,"position",t)},S.isSome()&&x.isSome()?v.some(E(S.getOrDie(),x.getOrDie())):v.none(),f(),w=c.scrollPos,window.scrollTo(w.x,w.y),t.set(null),_e(e,!1),e.off("remove",f);else{const n=Ee(fe(a),void 0!==document.fullscreenElement?"fullscreenchange":void 0!==document.msFullscreenElement?"MSFullscreenChange":void 0!==document.webkitFullscreenElement?"webkitfullscreenchange":"fullscreenchange",(n=>{ze(e)&&(Ke(a)||null===t.get()||Ze(e,t))})),r={scrollPos:qe(window),containerWidth:m.width,containerHeight:m.height,containerTop:m.top,containerLeft:m.left,iframeWidth:g.width,iframeHeight:g.height,fullscreenChangeHandler:n,sinkCssPosition:i.map((e=>Le(e,"position")))};d&&Ge(e.dom,s,u),g.width=g.height="100%",m.width=m.height="",p(Je.addClass),i.each((e=>{Ae(e,"position","fixed")})),Qe.bind(s),e.on("remove",f),t.set(r),ze(e)&&(e=>{const t=e.dom;t.requestFullscreen?t.requestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():t.webkitRequestFullScreen&&t.webkitRequestFullScreen()})(a),_e(e,!0)}var w,S,x,E};var et=tinymce.util.Tools.resolve("tinymce.util.VK");const tt=(e,t)=>n=>{n.setActive(null!==t.get());const r=e=>n.setActive(e.state);return e.on("FullscreenStateChanged",r),()=>e.off("FullscreenStateChanged",r)};R.add("fullscreen",(e=>{const t=F(null);return e.inline||((e=>{(0,e.options.register)("fullscreen_native",{processor:"boolean",default:!1})})(e),((e,t)=>{e.addCommand("mceFullScreen",(()=>{Ze(e,t)}))})(e,t),((e,t)=>{const n=()=>e.execCommand("mceFullScreen");e.ui.registry.addToggleMenuItem("fullscreen",{text:"Fullscreen",icon:"fullscreen",shortcut:"Meta+Shift+F",onAction:n,onSetup:tt(e,t),context:"any"}),e.ui.registry.addToggleButton("fullscreen",{tooltip:"Fullscreen",icon:"fullscreen",onAction:n,onSetup:tt(e,t),shortcut:"Meta+Shift+F",context:"any"})})(e,t),((e,t)=>{e.on("init",(()=>{e.on("keydown",(e=>{e.keyCode!==et.TAB||e.metaKey||e.ctrlKey||!t.get()||e.preventDefault()}))}))})(e,t),e.addShortcut("Meta+Shift+F","","mceFullScreen")),(e=>({isFullscreen:()=>null!==e.get()}))(t)}))}(); \ No newline at end of file +!function(){"use strict";const e=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(n=r=e,(o=String).prototype.isPrototypeOf(n)||r.constructor?.name===o.name)?"string":t;var n,r,o})(t)===e,t=e=>t=>typeof t===e,n=e=>t=>e===t,r=e("string"),o=e("object"),s=e("array"),i=n(null),l=t("boolean"),a=n(void 0),c=e=>!(e=>null==e)(e),u=t("function"),d=t("number"),m=()=>{},h=e=>()=>e;function g(e,...t){return(...n)=>{const r=t.concat(n);return e.apply(null,r)}}const p=h(!1),f=h(!0);class v{tag;value;static singletonNone=new v(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new v(!0,e)}static none(){return v.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?v.some(e(this.value)):v.none()}bind(e){return this.tag?e(this.value):v.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:v.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(e??"Called getOrDie on None")}static from(e){return c(e)?v.some(e):v.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}const w=Array.prototype.push,y=(e,t)=>{const n=e.length,r=new Array(n);for(let o=0;o{for(let n=0,r=e.length;n{const n=[];for(let r=0,o=e.length;r((e,t,n)=>{for(let r=0,o=e.length;r{let t=e;return{get:()=>t,set:e=>{t=e}}},O="undefined"!=typeof window?window:Function("return this;")(),k=(e,t)=>((e,t)=>{let n=null!=t?t:O;for(let t=0;t{const t=F(v.none()),n=()=>t.get().each(e);return{clear:()=>{n(),t.set(v.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{n(),t.set(v.some(e))}}},C=()=>T(e=>e.unbind()),A=(e,t,n=0,r)=>{const o=e.indexOf(t,n);return-1!==o&&(!!a(r)||o+t.length<=r)};var R=tinymce.util.Tools.resolve("tinymce.PluginManager");const L=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},M=L,P=(e,t)=>{const n=e.dom;if(1!==n.nodeType)return!1;{const e=n;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},D=()=>N(0,0),N=(e,t)=>({major:e,minor:t}),H={nu:N,detect:(e,t)=>{const n=String(t).toLowerCase();return 0===e.length?D():((e,t)=>{const n=((e,t)=>{for(let n=0;nNumber(t.replace(n,"$"+e));return N(r(1),r(2))})(e,n)},unknown:D},V=(e,t)=>{const n=String(t).toLowerCase();return x(e,e=>e.search(n))},W=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,q=e=>t=>A(t,e),B=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>A(e,"edge/")&&A(e,"chrome")&&A(e,"safari")&&A(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,W],search:e=>A(e,"chrome")&&!A(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>A(e,"msie")||A(e,"trident")},{name:"Opera",versionRegexes:[W,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:q("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:q("firefox")},{name:"Safari",versionRegexes:[W,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(A(e,"safari")||A(e,"mobile/"))&&A(e,"applewebkit")}],I=[{name:"Windows",search:q("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>A(e,"iphone")||A(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:q("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:q("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:q("linux"),versionRegexes:[]},{name:"Solaris",search:q("sunos"),versionRegexes:[]},{name:"FreeBSD",search:q("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:q("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],j={browsers:h(B),oses:h(I)},_="Edge",z="Chromium",K="Opera",$="Firefox",U="Safari",X=e=>{const t=e.current,n=e.version,r=e=>()=>t===e;return{current:t,version:n,isEdge:r(_),isChromium:r(z),isIE:r("IE"),isOpera:r(K),isFirefox:r($),isSafari:r(U)}},Y=()=>X({current:void 0,version:H.unknown()}),G=X,J=(h(_),h(z),h("IE"),h(K),h($),h(U),"Windows"),Q="Android",Z="Linux",ee="macOS",te="Solaris",ne="FreeBSD",re="ChromeOS",oe=e=>{const t=e.current,n=e.version,r=e=>()=>t===e;return{current:t,version:n,isWindows:r(J),isiOS:r("iOS"),isAndroid:r(Q),isMacOS:r(ee),isLinux:r(Z),isSolaris:r(te),isFreeBSD:r(ne),isChromeOS:r(re)}},se=()=>oe({current:void 0,version:H.unknown()}),ie=oe,le=(h(J),h("iOS"),h(Q),h(Z),h(ee),h(te),h(ne),h(re),(e,t,n)=>{const r=j.browsers(),o=j.oses(),s=t.bind(e=>((e,t)=>((e,t)=>{for(let n=0;n{const n=t.brand.toLowerCase();return x(e,e=>n===e.brand?.toLowerCase()).map(e=>({current:e.name,version:H.nu(parseInt(t.version,10),0)}))}))(r,e)).orThunk(()=>((e,t)=>V(e,t).map(e=>{const n=H.detect(e.versionRegexes,t);return{current:e.name,version:n}}))(r,e)).fold(Y,G),i=((e,t)=>V(e,t).map(e=>{const n=H.detect(e.versionRegexes,t);return{current:e.name,version:n}}))(o,e).fold(se,ie),l=((e,t,n,r)=>{const o=e.isiOS()&&!0===/ipad/i.test(n),s=e.isiOS()&&!o,i=e.isiOS()||e.isAndroid(),l=i||r("(pointer:coarse)"),a=o||!s&&i&&r("(min-device-width:768px)"),c=s||i&&!a,u=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(n),d=!c&&!a&&!u;return{isiPad:h(o),isiPhone:h(s),isTablet:h(a),isPhone:h(c),isTouch:h(l),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:h(u),isDesktop:h(d)}})(i,s,e,n);return{browser:s,os:i,deviceType:l}}),ae=e=>window.matchMedia(e).matches;let ce=(e=>{let t,n=!1;return(...r)=>(n||(n=!0,t=e.apply(null,r)),t)})(()=>le(window.navigator.userAgent,v.from(window.navigator.userAgentData),ae));const ue=Object.getPrototypeOf,de=e=>{const t=k("ownerDocument.defaultView",e);return o(e)&&((e=>((e,t)=>{const n=((e,t)=>k(e,t))(e,t);if(null==n)throw new Error(e+" not available on this browser");return n})("HTMLElement",e))(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(ue(e).constructor.name))},me=e=>t=>(e=>e.dom.nodeType)(t)===e,he=me(1),ge=me(3),pe=me(11),fe=e=>M(e.dom.ownerDocument),ve=e=>y(e.dom.childNodes,M),we=e=>{const t=(e=>M(e.dom.getRootNode()))(e);return pe(n=t)&&c(n.dom.host)?v.some(t):v.none();var n},ye=e=>M(e.dom.host),be=e=>{const t=M((e=>{if(c(e.target)){const t=M(e.target);if(he(t)&&c(t.dom.shadowRoot)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return(e=>0e.stopPropagation(),r=()=>e.preventDefault(),o=(s=r,i=n,(...e)=>s(i.apply(null,e)));var s,i;return((e,t,n,r,o,s,i)=>({target:e,x:t,y:n,stop:r,prevent:o,kill:s,raw:i}))(t,e.clientX,e.clientY,n,r,o,e)},Se=(e,t,n,r)=>{e.dom.removeEventListener(t,n,r)},xe=f,Ee=(e,t,n)=>((e,t,n,r)=>((e,t,n,r,o)=>{const s=((e,t)=>n=>{e(n)&&t(be(n))})(n,r);return e.dom.addEventListener(t,s,o),{unbind:g(Se,e,t,s,o)}})(e,t,n,r,!1))(e,t,xe,n),Fe=(e,t)=>{const n=e.dom.getAttribute(t);return null===n?void 0:n},Oe=(e,t)=>{e.dom.removeAttribute(t)},ke=e=>void 0!==e.style&&u(e.style.getPropertyValue),Te=e=>{const t=ge(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const n=t.ownerDocument;return we(M(t)).fold(()=>n.body.contains(t),(r=Te,o=ye,e=>r(o(e))));var r,o},Ce=(e,t,n)=>{if(!r(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);ke(e)&&e.style.setProperty(t,n)},Ae=(e,t,n)=>{const r=e.dom;Ce(r,t,n)},Re=(e,t)=>{const n=e.dom;((e,t)=>{const n=E(e);for(let r=0,o=n.length;r{Ce(n,t,e)})},Le=(e,t)=>{const n=e.dom,r=window.getComputedStyle(n).getPropertyValue(t);return""!==r||Te(e)?r:Me(n,t)},Me=(e,t)=>ke(e)?e.style.getPropertyValue(t):"",Pe=(e,t)=>({left:e,top:t,translate:(n,r)=>Pe(e+n,t+r)}),De=Pe,Ne=(e,t,n)=>((e,t,n)=>S(((e,t)=>{const n=u(t)?t:p;let r=e.dom;const o=[];for(;null!==r.parentNode&&void 0!==r.parentNode;){const e=r.parentNode,t=M(e);if(o.push(t),!0===n(t))break;r=e}return o})(e,n),t))(e,e=>P(e,t),n),He=(e,t)=>(e=>{return S((e=>v.from(e.dom.parentNode).map(M))(n=e).map(ve).map(e=>S(e,e=>{return t=e,!(n.dom===t.dom);var t})).getOr([]),e=>P(e,t));var n})(e),Ve=e=>{const t=void 0===e?window:e;return ce().browser.isFirefox()?v.none():v.from(t.visualViewport)},We=(e,t,n,r)=>({x:e,y:t,width:n,height:r,right:e+n,bottom:t+r}),qe=e=>{const t=void 0===e?window:e,n=t.document,r=(e=>{const t=void 0!==e?e.dom:document,n=t.body.scrollLeft||t.documentElement.scrollLeft,r=t.body.scrollTop||t.documentElement.scrollTop;return De(n,r)})(M(n));return Ve(t).fold(()=>{const e=t.document.documentElement,n=e.clientWidth,o=e.clientHeight;return We(r.left,r.top,n,o)},e=>We(Math.max(e.pageLeft,r.left),Math.max(e.pageTop,r.top),e.width,e.height))},Be=(e,t,n)=>Ve(n).map(n=>{const r=e=>t(be(e));return n.addEventListener(e,r),{unbind:()=>n.removeEventListener(e,r)}}).getOrThunk(()=>({unbind:m}));var Ie=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),je=tinymce.util.Tools.resolve("tinymce.Env");const _e=(e,t)=>{e.dispatch("FullscreenStateChanged",{state:t}),e.dispatch("ResizeEditor")},ze=e=>e.options.get("fullscreen_native");const Ke=e=>{return e.dom===(void 0!==(t=fe(e).dom).fullscreenElement?t.fullscreenElement:void 0!==t.msFullscreenElement?t.msFullscreenElement:void 0!==t.webkitFullscreenElement?t.webkitFullscreenElement:null);var t},$e="data-ephox-mobile-fullscreen-style",Ue="position:absolute!important;",Xe="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",Ye=je.os.isAndroid(),Ge=(e,t,n)=>{const o=t=>n=>{const o=Fe(n,"style"),s=void 0===o?"no-styles":o.trim();s!==t&&(((e,t,n)=>{((e,t,n)=>{if(!(r(n)||l(n)||d(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")})(e.dom,t,n)})(n,$e,s),Re(n,e.parseStyle(t)))},i=Ne(t,"*"),a=(e=>{const t=[];for(let n=0,r=e.length;nHe(e,"*:not(.tox-silver-sink)"))),c=(e=>{const t=Le(e,"background-color");return void 0!==t&&""!==t?"background-color:"+t+"!important":"background-color:rgb(255,255,255)!important;"})(n);b(a,o("display:none!important;")),b(i,o(Ue+Xe+c)),o((!0===Ye?"":Ue)+Xe+c)(t)},Je=Ie.DOM,Qe=Ve().fold(()=>({bind:m,unbind:m}),e=>{const t=(()=>{const e=T(m);return{...e,on:t=>e.get().each(t)}})(),n=C(),r=C(),o=(e=>{let t=null;return{cancel:()=>{i(t)||(clearTimeout(t),t=null)},throttle:(...n)=>{i(t)&&(t=setTimeout(()=>{t=null,e.apply(null,n)},50))}}})(()=>{document.body.scrollTop=0,document.documentElement.scrollTop=0,window.requestAnimationFrame(()=>{t.on(t=>Re(t,{top:e.offsetTop+"px",left:e.offsetLeft+"px",height:e.height+"px",width:e.width+"px"}))})});return{bind:e=>{t.set(e),o.throttle(),n.set(Be("resize",o.throttle)),r.set(Be("scroll",o.throttle))},unbind:()=>{t.on(()=>{n.clear(),r.clear()}),t.clear()}}}),Ze=(e,t)=>{const n=document.body,r=document.documentElement,o=e.getContainer(),s=M(o),i=(l=s,v.from(l.dom.nextSibling).map(M)).filter(e=>(e=>he(e)&&de(e.dom))(e)&&(e=>(e=>void 0!==e.dom.classList)(e)&&e.dom.classList.contains("tox-silver-sink"))(e));var l;const a=(e=>{const t=M(e.getElement());return we(t).map(ye).getOrThunk(()=>(e=>{const t=e.dom.body;if(null==t)throw new Error("Body is not available yet");return M(t)})(fe(t)))})(e),c=t.get(),u=M(e.getBody()),d=je.deviceType.isTouch(),m=o.style,h=e.iframeElement,g=h?.style,p=e=>{e(n,"tox-fullscreen"),e(r,"tox-fullscreen"),e(o,"tox-fullscreen"),we(s).map(e=>ye(e).dom).each(t=>{e(t,"tox-fullscreen"),e(t,"tox-shadowhost")})},f=()=>{d&&(e=>{const t=(e=>{const t=document;return 1!==(n=t).nodeType&&9!==n.nodeType&&11!==n.nodeType||0===n.childElementCount?[]:y(t.querySelectorAll(e),M);var n})("["+$e+"]");b(t,t=>{const n=Fe(t,$e);n&&"no-styles"!==n?Re(t,e.parseStyle(n)):Oe(t,"style"),Oe(t,$e)})})(e.dom),p(Je.removeClass),Qe.unbind(),v.from(t.get()).each(e=>e.fullscreenChangeHandler.unbind())};if(c)c.fullscreenChangeHandler.unbind(),ze(e)&&Ke(a)&&(e=>{const t=e.dom;t.exitFullscreen?t.exitFullscreen():t.msExitFullscreen?t.msExitFullscreen():t.webkitCancelFullScreen&&t.webkitCancelFullScreen()})(fe(a)),g.width=c.iframeWidth,g.height=c.iframeHeight,m.width=c.containerWidth,m.height=c.containerHeight,m.top=c.containerTop,m.left=c.containerLeft,S=i,x=c.sinkCssPosition,E=(e,t)=>{Ae(e,"position",t)},S.isSome()&&x.isSome()?v.some(E(S.getOrDie(),x.getOrDie())):v.none(),f(),w=c.scrollPos,window.scrollTo(w.x,w.y),t.set(null),_e(e,!1),e.off("remove",f);else{const n=Ee(fe(a),void 0!==document.fullscreenElement?"fullscreenchange":void 0!==document.msFullscreenElement?"MSFullscreenChange":void 0!==document.webkitFullscreenElement?"webkitfullscreenchange":"fullscreenchange",n=>{ze(e)&&(Ke(a)||null===t.get()||Ze(e,t))}),r={scrollPos:qe(window),containerWidth:m.width,containerHeight:m.height,containerTop:m.top,containerLeft:m.left,iframeWidth:g.width,iframeHeight:g.height,fullscreenChangeHandler:n,sinkCssPosition:i.map(e=>Le(e,"position"))};d&&Ge(e.dom,s,u),g.width=g.height="100%",m.width=m.height="",p(Je.addClass),i.each(e=>{Ae(e,"position","fixed")}),Qe.bind(s),e.on("remove",f),t.set(r),ze(e)&&(e=>{const t=e.dom;t.requestFullscreen?t.requestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():t.webkitRequestFullScreen&&t.webkitRequestFullScreen()})(a),_e(e,!0)}var w,S,x,E};var et=tinymce.util.Tools.resolve("tinymce.util.VK");const tt=(e,t)=>n=>{n.setActive(null!==t.get());const r=e=>n.setActive(e.state);return e.on("FullscreenStateChanged",r),()=>e.off("FullscreenStateChanged",r)};R.add("fullscreen",e=>{const t=F(null);return e.inline||((e=>{(0,e.options.register)("fullscreen_native",{processor:"boolean",default:!1})})(e),((e,t)=>{e.addCommand("mceFullScreen",()=>{Ze(e,t)})})(e,t),((e,t)=>{const n=()=>e.execCommand("mceFullScreen");e.ui.registry.addToggleMenuItem("fullscreen",{text:"Fullscreen",icon:"fullscreen",shortcut:"Meta+Shift+F",onAction:n,onSetup:tt(e,t),context:"any"}),e.ui.registry.addToggleButton("fullscreen",{tooltip:"Fullscreen",icon:"fullscreen",onAction:n,onSetup:tt(e,t),shortcut:"Meta+Shift+F",context:"any"})})(e,t),((e,t)=>{e.on("init",()=>{e.on("keydown",e=>{e.keyCode!==et.TAB||e.metaKey||e.ctrlKey||!t.get()||e.preventDefault()})})})(e,t),e.addShortcut("Meta+Shift+F","","mceFullScreen")),(e=>({isFullscreen:()=>null!==e.get()}))(t)})}(); \ No newline at end of file diff --git a/plugins/tinymce/plugins/help/plugin.min.js b/plugins/tinymce/plugins/help/plugin.min.js index e969915d..a0595d6a 100644 --- a/plugins/tinymce/plugins/help/plugin.min.js +++ b/plugins/tinymce/plugins/help/plugin.min.js @@ -1 +1 @@ -!function(){"use strict";const e=e=>"string"===(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(n=a=e,(r=String).prototype.isPrototypeOf(n)||a.constructor?.name===r.name)?"string":t;var n,a,r})(e);const t=e=>undefined===e;const n=e=>"function"==typeof e,a=()=>false;class r{tag;value;static singletonNone=new r(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new r(!0,e)}static none(){return r.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?r.some(e(this.value)):r.none()}bind(e){return this.tag?e(this.value):r.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:r.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(e??"Called getOrDie on None")}static from(e){return null==e?r.none():r.some(e)}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}const o=Array.prototype.slice,i=Array.prototype.indexOf,s=(e,t)=>{const n=e.length,a=new Array(n);for(let r=0;r{const n=[];for(let a=0,r=e.length;a{const n=o.call(e,0);return n.sort(t),n};n(Array.from)&&Array.from;const l=Object.keys,u=Object.hasOwnProperty,p=(e,t)=>u.call(e,t);let y=0;const h=e=>{const t=(new Date).getTime(),n=Math.floor(window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967295*1e9);return y++,e+"_"+n+y+String(t)};var d=tinymce.util.Tools.resolve("tinymce.PluginManager");const g=e=>t=>t.options.get(e),k=g("help_tabs"),v=g("forced_plugins");var b=tinymce.util.Tools.resolve("tinymce.Resource"),f=tinymce.util.Tools.resolve("tinymce.util.I18n");const A=(e,t)=>b.load(`tinymce.html-i18n.help-keynav.${t}`,`${e}/js/i18n/keynav/${t}.js`),w=e=>A(e,f.getCode()).catch((()=>A(e,"en")));var C=tinymce.util.Tools.resolve("tinymce.Env");const S=e=>{const t=C.os.isMacOS()||C.os.isiOS(),n=t?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl ",access:"Shift + Alt "},a=e.split("+"),r=s(a,(e=>{const t=e.toLowerCase().trim();return p(n,t)?n[t]:e}));return t?r.join("").replace(/\s/,""):r.join("+")},M=[{shortcuts:["Meta + B"],action:"Bold"},{shortcuts:["Meta + I"],action:"Italic"},{shortcuts:["Meta + U"],action:"Underline"},{shortcuts:["Meta + A"],action:"Select all"},{shortcuts:["Meta + Y","Meta + Shift + Z"],action:"Redo"},{shortcuts:["Meta + Z"],action:"Undo"},{shortcuts:["Access + 1"],action:"Heading 1"},{shortcuts:["Access + 2"],action:"Heading 2"},{shortcuts:["Access + 3"],action:"Heading 3"},{shortcuts:["Access + 4"],action:"Heading 4"},{shortcuts:["Access + 5"],action:"Heading 5"},{shortcuts:["Access + 6"],action:"Heading 6"},{shortcuts:["Access + 7"],action:"Paragraph"},{shortcuts:["Access + 8"],action:"Div"},{shortcuts:["Access + 9"],action:"Address"},{shortcuts:["Alt + 0"],action:"Open help dialog"},{shortcuts:["Alt + F9"],action:"Focus to menubar"},{shortcuts:["Alt + F10"],action:"Focus to toolbar"},{shortcuts:["Alt + F11"],action:"Focus to element path"},{shortcuts:["Alt + F12"],action:"Focus to notification"},{shortcuts:["Ctrl + F9"],action:"Focus to contextual toolbar"},{shortcuts:["Shift + Enter"],action:"Open popup menu for split buttons"},{shortcuts:["Meta + K"],action:"Insert link (if link plugin activated)"},{shortcuts:["Meta + S"],action:"Save (if save plugin activated)"},{shortcuts:["Meta + F"],action:"Find (if searchreplace plugin activated)"},{shortcuts:["Meta + Shift + F"],action:"Switch to or from fullscreen mode"}],_=()=>({name:"shortcuts",title:"Handy Shortcuts",items:[{type:"table",header:["Action","Shortcut"],cells:s(M,(e=>{const t=s(e.shortcuts,S).join(" or ");return[e.action,t]}))}]}),x=s([{key:"accordion",name:"Accordion"},{key:"anchor",name:"Anchor"},{key:"autolink",name:"Autolink"},{key:"autoresize",name:"Autoresize"},{key:"autosave",name:"Autosave"},{key:"charmap",name:"Character Map"},{key:"code",name:"Code"},{key:"codesample",name:"Code Sample"},{key:"colorpicker",name:"Color Picker"},{key:"directionality",name:"Directionality"},{key:"emoticons",name:"Emoticons"},{key:"fullscreen",name:"Full Screen"},{key:"help",name:"Help"},{key:"image",name:"Image"},{key:"importcss",name:"Import CSS"},{key:"insertdatetime",name:"Insert Date/Time"},{key:"link",name:"Link"},{key:"lists",name:"Lists"},{key:"advlist",name:"List Styles"},{key:"media",name:"Media"},{key:"nonbreaking",name:"Nonbreaking"},{key:"pagebreak",name:"Page Break"},{key:"preview",name:"Preview"},{key:"quickbars",name:"Quick Toolbars"},{key:"save",name:"Save"},{key:"searchreplace",name:"Search and Replace"},{key:"table",name:"Table"},{key:"textcolor",name:"Text Color"},{key:"visualblocks",name:"Visual Blocks"},{key:"visualchars",name:"Visual Characters"},{key:"wordcount",name:"Word Count"},{key:"a11ychecker",name:"Accessibility Checker",type:"premium"},{key:"typography",name:"Advanced Typography",type:"premium",slug:"advanced-typography"},{key:"ai",name:"AI Assistant",type:"premium"},{key:"casechange",name:"Case Change",type:"premium"},{key:"checklist",name:"Checklist",type:"premium"},{key:"advcode",name:"Enhanced Code Editor",type:"premium"},{key:"mediaembed",name:"Enhanced Media Embed",type:"premium",slug:"introduction-to-mediaembed"},{key:"advtable",name:"Enhanced Tables",type:"premium"},{key:"exportpdf",name:"Export to PDF",type:"premium"},{key:"exportword",name:"Export to Word",type:"premium"},{key:"footnotes",name:"Footnotes",type:"premium"},{key:"formatpainter",name:"Format Painter",type:"premium"},{key:"editimage",name:"Image Editing",type:"premium"},{key:"uploadcare",name:"Image Optimizer Powered by Uploadcare",type:"premium"},{key:"importword",name:"Import from Word",type:"premium"},{key:"inlinecss",name:"Inline CSS",type:"premium",slug:"inline-css"},{key:"linkchecker",name:"Link Checker",type:"premium"},{key:"math",name:"Math",type:"premium"},{key:"markdown",name:"Markdown",type:"premium"},{key:"mentions",name:"Mentions",type:"premium"},{key:"mergetags",name:"Merge Tags",type:"premium"},{key:"pageembed",name:"Page Embed",type:"premium"},{key:"permanentpen",name:"Permanent Pen",type:"premium"},{key:"powerpaste",name:"PowerPaste",type:"premium",slug:"introduction-to-powerpaste"},{key:"revisionhistory",name:"Revision History",type:"premium"},{key:"tinymcespellchecker",name:"Spell Checker",type:"premium",slug:"introduction-to-tiny-spellchecker"},{key:"suggestededits",name:"Suggested Edits",type:"premium"},{key:"autocorrect",name:"Spelling Autocorrect",type:"premium"},{key:"tableofcontents",name:"Table of Contents",type:"premium"},{key:"fullpagehtml",name:"Fullpage HTML",type:"premium"},{key:"advtemplate",name:"Templates",type:"premium",slug:"advanced-templates"},{key:"tinycomments",name:"Tiny Comments",type:"premium",slug:"introduction-to-tiny-comments"},{key:"tinydrive",name:"Tiny Drive",type:"premium",slug:"tinydrive-introduction"}],(e=>({...e,type:e.type||"opensource",slug:e.slug||e.key}))),T=e=>{const o=e=>`${e.name}`,u=(e,t)=>{return(i=x,s=e=>e.key===t,((e,t,n)=>{for(let a=0,o=e.length;a((e,t)=>{const a=e.plugins[t].getMetadata;if(n(a)){const e=a();return{name:e.name,html:o(e)}}return{name:t,html:t}})(e,t)),(e=>{const t="premium"===e.type?`${e.name}*`:e.name;return{name:t,html:o({name:t,url:`https://www.tiny.cloud/docs/tinymce/${tinymce.majorVersion}/${e.slug}/`})}}));var i,s},p=e=>{const n=(e=>{const n=l(e.plugins),a=v(e),r=t(a)?["onboarding","licensekeymanager"]:a.concat(["onboarding","licensekeymanager"]);return m(n,(e=>!(((e,t)=>i.call(e,t))(r,e)>-1)))})(e),a=c(s(n,(t=>u(e,t))),((e,t)=>e.name.localeCompare(t.name))),r=s(a,(e=>"
  • "+e.html+"
  • ")),o=r.length,p=r.join("");return"

    "+f.translate(["Plugins installed ({0}):",o])+"

      "+p+"
    "},y={type:"htmlpanel",presets:"document",html:[(e=>null==e?"":"
    "+p(e)+"
    ")(e),(()=>{const e=m(x,(({type:e})=>"premium"===e)),t=c(s(e,(e=>e.name)),((e,t)=>e.localeCompare(t))),n=s(t,(e=>`
  • ${e}
  • `)).join("");return"

    "+f.translate("Premium plugins:")+"

    "})()].join("")};return{name:"plugins",title:"Plugins",items:[y]}};var O=tinymce.util.Tools.resolve("tinymce.EditorManager");const F=(t,n,a)=>()=>{(async(t,n,a)=>{const o=_(),i=await(async e=>({name:"keyboardnav",title:"Keyboard Navigation",items:[{type:"htmlpanel",presets:"document",html:await w(e)}]}))(a),m=T(t),c=(()=>{var e,t;const n='TinyMCE '+(e=O.majorVersion,t=O.minorVersion,(0===e.indexOf("@")?"X.X.X":e+"."+t)+"");return{name:"versions",title:"Version",items:[{type:"htmlpanel",html:"

    "+f.translate(["You are using {0}",n])+"

    ",presets:"document"}]}})(),u={[o.name]:o,[i.name]:i,[m.name]:m,[c.name]:c,...n.get()};return r.from(k(t)).fold((()=>(e=>{const t=l(e),n=t.indexOf("versions");return-1!==n&&(t.splice(n,1),t.push("versions")),{tabs:e,names:t}})(u)),(t=>((t,n)=>{const a={},r=s(t,(t=>{if(e(t))return p(n,t)&&(a[t]=n[t]),t;{const e=t.name??h("tab-name");return a[e]=t,e}}));return{tabs:a,names:r}})(t,u)))})(t,n,a).then((({tabs:e,names:n})=>{const a={type:"tabpanel",tabs:(e=>{const t=[],n=e=>{t.push(e)};for(let t=0;t{return p(n=e,a=t)?r.from(n[a]):r.none();var n,a})))};t.windowManager.open({title:"Help",size:"medium",body:a,buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{}})}))};d.add("help",((e,t)=>{const n=(()=>{let e={};return{get:()=>e,set:t=>{e=t}}})(),a=(e=>({addTab:t=>{const n=t.name??h("tab-name"),a=e.get();a[n]=t,e.set(a)}}))(n);(e=>{(0,e.options.register)("help_tabs",{processor:"array"})})(e);const r=F(e,n,t);return((e,t)=>{e.ui.registry.addButton("help",{icon:"help",tooltip:"Help",onAction:t,context:"any"}),e.ui.registry.addMenuItem("help",{text:"Help",icon:"help",shortcut:"Alt+0",onAction:t,context:"any"})})(e,r),((e,t)=>{e.addCommand("mceHelp",t)})(e,r),e.shortcuts.add("Alt+0","Open help dialog","mceHelp"),((e,t)=>{e.on("init",(()=>{w(t)}))})(e,t),a}))}(); \ No newline at end of file +!function(){"use strict";const e=e=>"string"===(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(n=a=e,(r=String).prototype.isPrototypeOf(n)||a.constructor?.name===r.name)?"string":t;var n,a,r})(e);const t=e=>undefined===e;const n=e=>"function"==typeof e,a=()=>false;class r{tag;value;static singletonNone=new r(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new r(!0,e)}static none(){return r.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?r.some(e(this.value)):r.none()}bind(e){return this.tag?e(this.value):r.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:r.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(e??"Called getOrDie on None")}static from(e){return null==e?r.none():r.some(e)}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}const o=Array.prototype.slice,i=Array.prototype.indexOf,s=(e,t)=>{const n=e.length,a=new Array(n);for(let r=0;r{const n=[];for(let a=0,r=e.length;a{const n=o.call(e,0);return n.sort(t),n};n(Array.from)&&Array.from;const l=Object.keys,u=Object.hasOwnProperty,p=(e,t)=>u.call(e,t);let y=0;const h=e=>{const t=(new Date).getTime(),n=Math.floor(window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967295*1e9);return y++,e+"_"+n+y+String(t)};var d=tinymce.util.Tools.resolve("tinymce.PluginManager");const g=e=>t=>t.options.get(e),k=g("help_tabs"),v=g("forced_plugins");var b=tinymce.util.Tools.resolve("tinymce.Resource"),f=tinymce.util.Tools.resolve("tinymce.util.I18n");const A=(e,t)=>b.load(`tinymce.html-i18n.help-keynav.${t}`,`${e}/js/i18n/keynav/${t}.js`),w=e=>A(e,f.getCode()).catch(()=>A(e,"en"));var C=tinymce.util.Tools.resolve("tinymce.Env");const M=e=>{const t=C.os.isMacOS()||C.os.isiOS(),n=t?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl ",access:"Shift + Alt "},a=e.split("+"),r=s(a,e=>{const t=e.toLowerCase().trim();return p(n,t)?n[t]:e});return t?r.join("").replace(/\s/,""):r.join("+")},S=[{shortcuts:["Meta + B"],action:"Bold"},{shortcuts:["Meta + I"],action:"Italic"},{shortcuts:["Meta + U"],action:"Underline"},{shortcuts:["Meta + A"],action:"Select all"},{shortcuts:["Meta + Y","Meta + Shift + Z"],action:"Redo"},{shortcuts:["Meta + Z"],action:"Undo"},{shortcuts:["Access + 1"],action:"Heading 1"},{shortcuts:["Access + 2"],action:"Heading 2"},{shortcuts:["Access + 3"],action:"Heading 3"},{shortcuts:["Access + 4"],action:"Heading 4"},{shortcuts:["Access + 5"],action:"Heading 5"},{shortcuts:["Access + 6"],action:"Heading 6"},{shortcuts:["Access + 7"],action:"Paragraph"},{shortcuts:["Access + 8"],action:"Div"},{shortcuts:["Access + 9"],action:"Address"},{shortcuts:["Alt + 0"],action:"Open help dialog"},{shortcuts:["Alt + F9"],action:"Focus to menubar"},{shortcuts:["Alt + F10"],action:"Focus to toolbar"},{shortcuts:["Alt + F11"],action:"Focus to element path"},{shortcuts:["Alt + F12"],action:"Focus to notification"},{shortcuts:["Ctrl + F9"],action:"Focus to contextual toolbar"},{shortcuts:["Shift + Enter"],action:"Open popup menu for split buttons"},{shortcuts:["Meta + K"],action:"Insert link (if link plugin activated)"},{shortcuts:["Meta + S"],action:"Save (if save plugin activated)"},{shortcuts:["Meta + F"],action:"Find (if searchreplace plugin activated)"},{shortcuts:["Meta + Shift + F"],action:"Switch to or from fullscreen mode"}],_=()=>({name:"shortcuts",title:"Handy Shortcuts",items:[{type:"table",header:["Action","Shortcut"],cells:s(S,e=>{const t=s(e.shortcuts,M).join(" or ");return[e.action,t]})}]}),x=s([{key:"accordion",name:"Accordion"},{key:"anchor",name:"Anchor"},{key:"autolink",name:"Autolink"},{key:"autoresize",name:"Autoresize"},{key:"autosave",name:"Autosave"},{key:"charmap",name:"Character Map"},{key:"code",name:"Code"},{key:"codesample",name:"Code Sample"},{key:"colorpicker",name:"Color Picker"},{key:"directionality",name:"Directionality"},{key:"emoticons",name:"Emoticons"},{key:"fullscreen",name:"Full Screen"},{key:"help",name:"Help"},{key:"image",name:"Image"},{key:"importcss",name:"Import CSS"},{key:"insertdatetime",name:"Insert Date/Time"},{key:"link",name:"Link"},{key:"lists",name:"Lists"},{key:"advlist",name:"List Styles"},{key:"media",name:"Media"},{key:"nonbreaking",name:"Nonbreaking"},{key:"pagebreak",name:"Page Break"},{key:"preview",name:"Preview"},{key:"quickbars",name:"Quick Toolbars"},{key:"save",name:"Save"},{key:"searchreplace",name:"Search and Replace"},{key:"table",name:"Table"},{key:"textcolor",name:"Text Color"},{key:"visualblocks",name:"Visual Blocks"},{key:"visualchars",name:"Visual Characters"},{key:"wordcount",name:"Word Count"},{key:"a11ychecker",name:"Accessibility Checker",type:"premium"},{key:"typography",name:"Advanced Typography",type:"premium",slug:"advanced-typography"},{key:"ai",name:"AI Assistant",type:"premium"},{key:"casechange",name:"Case Change",type:"premium"},{key:"checklist",name:"Checklist",type:"premium"},{key:"advcode",name:"Enhanced Code Editor",type:"premium"},{key:"mediaembed",name:"Enhanced Media Embed",type:"premium",slug:"introduction-to-mediaembed"},{key:"advtable",name:"Enhanced Tables",type:"premium"},{key:"exportpdf",name:"Export to PDF",type:"premium"},{key:"exportword",name:"Export to Word",type:"premium"},{key:"footnotes",name:"Footnotes",type:"premium"},{key:"formatpainter",name:"Format Painter",type:"premium"},{key:"editimage",name:"Image Editing",type:"premium"},{key:"uploadcare",name:"Image Optimizer Powered by Uploadcare",type:"premium"},{key:"importword",name:"Import from Word",type:"premium"},{key:"inlinecss",name:"Inline CSS",type:"premium",slug:"inline-css"},{key:"linkchecker",name:"Link Checker",type:"premium"},{key:"math",name:"Math",type:"premium"},{key:"markdown",name:"Markdown",type:"premium"},{key:"mentions",name:"Mentions",type:"premium"},{key:"mergetags",name:"Merge Tags",type:"premium"},{key:"pageembed",name:"Page Embed",type:"premium"},{key:"permanentpen",name:"Permanent Pen",type:"premium"},{key:"powerpaste",name:"PowerPaste",type:"premium",slug:"introduction-to-powerpaste"},{key:"revisionhistory",name:"Revision History",type:"premium"},{key:"tinymcespellchecker",name:"Spell Checker",type:"premium",slug:"introduction-to-tiny-spellchecker"},{key:"suggestededits",name:"Suggested Edits",type:"premium"},{key:"tinymceai",name:"TinyMCE AI",type:"premium"},{key:"autocorrect",name:"Spelling Autocorrect",type:"premium"},{key:"tableofcontents",name:"Table of Contents",type:"premium"},{key:"fullpagehtml",name:"Fullpage HTML",type:"premium"},{key:"advtemplate",name:"Templates",type:"premium",slug:"advanced-templates"},{key:"tinycomments",name:"Tiny Comments",type:"premium",slug:"introduction-to-tiny-comments"},{key:"tinydrive",name:"Tiny Drive",type:"premium",slug:"tinydrive-introduction"}],e=>({...e,type:e.type||"opensource",slug:e.slug||e.key})),T=e=>{const o=e=>`${e.name}`,u=(e,t)=>{return(i=x,s=e=>e.key===t,((e,t,n)=>{for(let a=0,o=e.length;a((e,t)=>{const a=e.plugins[t].getMetadata;if(n(a)){const e=a();return{name:e.name,html:o(e)}}return{name:t,html:t}})(e,t),e=>{const t="premium"===e.type?`${e.name}*`:e.name;return{name:t,html:o({name:t,url:`https://www.tiny.cloud/docs/tinymce/${tinymce.majorVersion}/${e.slug}/`})}});var i,s},p=e=>{const n=(e=>{const n=l(e.plugins),a=v(e),r=t(a)?["onboarding","licensekeymanager"]:a.concat(["onboarding","licensekeymanager"]);return m(n,e=>!(((e,t)=>i.call(e,t))(r,e)>-1))})(e),a=c(s(n,t=>u(e,t)),(e,t)=>e.name.localeCompare(t.name)),r=s(a,e=>"
  • "+e.html+"
  • "),o=r.length,p=r.join("");return"

    "+f.translate(["Plugins installed ({0}):",o])+"

      "+p+"
    "},y={type:"htmlpanel",presets:"document",html:[(e=>null==e?"":"
    "+p(e)+"
    ")(e),(()=>{const e=m(x,({type:e})=>"premium"===e),t=c(s(e,e=>e.name),(e,t)=>e.localeCompare(t)),n=s(t,e=>`
  • ${e}
  • `).join("");return"

    "+f.translate("Premium plugins:")+"

    "})()].join("")};return{name:"plugins",title:"Plugins",items:[y]}};var O=tinymce.util.Tools.resolve("tinymce.EditorManager");const E=(t,n,a)=>()=>{(async(t,n,a)=>{const o=_(),i=await(async e=>({name:"keyboardnav",title:"Keyboard Navigation",items:[{type:"htmlpanel",presets:"document",html:await w(e)}]}))(a),m=T(t),c=(()=>{var e,t;const n='TinyMCE '+(e=O.majorVersion,t=O.minorVersion,(0===e.indexOf("@")?"X.X.X":e+"."+t)+"");return{name:"versions",title:"Version",items:[{type:"htmlpanel",html:"

    "+f.translate(["You are using {0}",n])+"

    ",presets:"document"}]}})(),u={[o.name]:o,[i.name]:i,[m.name]:m,[c.name]:c,...n.get()};return r.from(k(t)).fold(()=>(e=>{const t=l(e),n=t.indexOf("versions");return-1!==n&&(t.splice(n,1),t.push("versions")),{tabs:e,names:t}})(u),t=>((t,n)=>{const a={},r=s(t,t=>{if(e(t))return p(n,t)&&(a[t]=n[t]),t;{const e=t.name??h("tab-name");return a[e]=t,e}});return{tabs:a,names:r}})(t,u))})(t,n,a).then(({tabs:e,names:n})=>{const a={type:"tabpanel",tabs:(e=>{const t=[],n=e=>{t.push(e)};for(let t=0;t{return p(n=e,a=t)?r.from(n[a]):r.none();var n,a}))};t.windowManager.open({title:"Help",size:"medium",body:a,buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{}})})};d.add("help",(e,t)=>{const n=(()=>{let e={};return{get:()=>e,set:t=>{e=t}}})(),a=(e=>({addTab:t=>{const n=t.name??h("tab-name"),a=e.get();a[n]=t,e.set(a)}}))(n);(e=>{(0,e.options.register)("help_tabs",{processor:"array"})})(e);const r=E(e,n,t);return((e,t)=>{e.ui.registry.addButton("help",{icon:"help",tooltip:"Help",onAction:t,context:"any"}),e.ui.registry.addMenuItem("help",{text:"Help",icon:"help",shortcut:"Alt+0",onAction:t,context:"any"})})(e,r),((e,t)=>{e.addCommand("mceHelp",t)})(e,r),e.shortcuts.add("Alt+0","Open help dialog","mceHelp"),((e,t)=>{e.on("init",()=>{w(t)})})(e,t),a})}(); \ No newline at end of file diff --git a/plugins/tinymce/plugins/image/plugin.min.js b/plugins/tinymce/plugins/image/plugin.min.js index 6128300c..c1035c60 100644 --- a/plugins/tinymce/plugins/image/plugin.min.js +++ b/plugins/tinymce/plugins/image/plugin.min.js @@ -1 +1 @@ -!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=Object.getPrototypeOf,a=(e,t,a)=>!!a(e,t.prototype)||e.constructor?.name===t.name,i=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&a(e,String,((e,t)=>t.isPrototypeOf(e)))?"string":t})(t)===e,s=e=>t=>typeof t===e,r=i("string"),o=i("object"),n=e=>((e,i)=>o(e)&&a(e,i,((e,a)=>t(e)===a)))(e,Object),l=i("array"),c=e=>null===e;const m=s("boolean"),d=e=>!(e=>null==e)(e),g=s("function"),p=s("number"),u=()=>{};class h{tag;value;static singletonNone=new h(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new h(!0,e)}static none(){return h.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?h.some(e(this.value)):h.none()}bind(e){return this.tag?e(this.value):h.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:h.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(e??"Called getOrDie on None")}static from(e){return d(e)?h.some(e):h.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Array.prototype.slice;const b=Array.prototype.push,y=e=>{const t=[];for(let a=0,i=e.length;af.call(e,t),w=(D=(e,t)=>n(e)&&n(t)?w(e,t):t,(...e)=>{if(0===e.length)throw new Error("Can't merge zero objects");const t={};for(let a=0;ae.length>0,C=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},I=C,U=(e,t,a)=>{((e,t,a)=>{if(!(r(a)||m(a)||p(a)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",a,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,a+"")})(e.dom,t,a)};var S=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),x=tinymce.util.Tools.resolve("tinymce.util.URI");const N=e=>t=>t.options.get(e),T=N("image_dimensions"),E=N("image_advtab"),L=N("image_uploadtab"),O=N("image_prepend_url"),j=N("image_class_list"),M=N("image_description"),R=N("image_title"),k=N("image_caption"),z=N("image_list"),B=N("a11y_advanced_options"),P=N("automatic_uploads"),H=(e,t)=>Math.max(parseInt(e,10),parseInt(t,10)),F=e=>(e&&(e=e.replace(/px$/,"")),e),G=e=>(e.length>0&&/^[0-9]+$/.test(e)&&(e+="px"),e),W=e=>"IMG"===e.nodeName&&(e.hasAttribute("data-mce-object")||e.hasAttribute("data-mce-placeholder")),$=(e,t)=>{const a=e.options.get;return x.isDomSafe(t,"img",{allow_html_data_urls:a("allow_html_data_urls"),allow_script_urls:a("allow_script_urls"),allow_svg_data_urls:a("allow_svg_data_urls")})},V=S.DOM,K=e=>e.style.marginLeft&&e.style.marginRight&&e.style.marginLeft===e.style.marginRight?F(e.style.marginLeft):"",Z=e=>e.style.marginTop&&e.style.marginBottom&&e.style.marginTop===e.style.marginBottom?F(e.style.marginTop):"",q=e=>e.style.borderWidth?F(e.style.borderWidth):"",J=(e,t)=>e.hasAttribute(t)?e.getAttribute(t)??"":"",Q=e=>null!==e.parentNode&&"FIGURE"===e.parentNode.nodeName,X=(e,t,a)=>{""===a||null===a?e.removeAttribute(t):e.setAttribute(t,a)},Y=(e,t)=>{const a=e.getAttribute("style"),i=t(null!==a?a:"");i.length>0?(e.setAttribute("style",i),e.setAttribute("data-mce-style",i)):e.removeAttribute("style")},ee=(e,t)=>(e,a,i)=>{const s=e.style;s[a]?(s[a]=G(i),Y(e,t)):X(e,a,i)},te=(e,t)=>e.style[t]?F(e.style[t]):J(e,t),ae=(e,t)=>{const a=G(t);e.style.marginLeft=a,e.style.marginRight=a},ie=(e,t)=>{const a=G(t);e.style.marginTop=a,e.style.marginBottom=a},se=(e,t)=>{const a=G(t);e.style.borderWidth=a},re=(e,t)=>{e.style.borderStyle=t},oe=e=>e.style.borderStyle??"",ne=e=>d(e)&&"FIGURE"===e.nodeName,le=e=>{const t=V.getAttrib(e,"alt"),a=V.getAttrib(e,"role");return e.hasAttribute("alt")&&0===t.length||"presentation"===a||"none"===a},ce=e=>le(e)?"":J(e,"alt"),me=(e,t)=>{const a=document.createElement("img");return X(a,"style",t.style),(K(a)||""!==t.hspace)&&ae(a,t.hspace),(Z(a)||""!==t.vspace)&&ie(a,t.vspace),(q(a)||""!==t.border)&&se(a,t.border),(oe(a)||""!==t.borderStyle)&&re(a,t.borderStyle),e(a.getAttribute("style")??"")},de=(e,t)=>({src:J(t,"src"),alt:ce(t),title:J(t,"title"),width:te(t,"width"),height:te(t,"height"),class:J(t,"class"),style:e(J(t,"style")),caption:Q(t),hspace:K(t),vspace:Z(t),border:q(t),borderStyle:oe(t),isDecorative:le(t)}),ge=(e,t,a,i,s)=>{a[i]!==t[i]&&s(e,i,String(a[i]))},pe=(e,t,a)=>{if(a){V.setAttrib(e,"role","presentation");const t=I(e);U(t,"alt","")}else{if(c(t)){I(e).dom.removeAttribute("alt")}else{const a=I(e);U(a,"alt",t)}"presentation"===V.getAttrib(e,"role")&&V.setAttrib(e,"role","")}},ue=(e,t)=>(a,i,s)=>{e(a,s),Y(a,t)},he=(e,t,a)=>{const i=de(e,a);ge(a,i,t,"caption",((e,t,a)=>(e=>{Q(e)?(e=>{const t=e.parentNode;d(t)&&(V.insertAfter(e,t),V.remove(t))})(e):(e=>{const t=V.create("figure",{class:"image"});V.insertAfter(t,e),t.appendChild(e),t.appendChild(V.create("figcaption",{contentEditable:"true"},"Caption")),t.contentEditable="false"})(e)})(e))),ge(a,i,t,"src",X),ge(a,i,t,"title",X),ge(a,i,t,"width",ee(0,e)),ge(a,i,t,"height",ee(0,e)),ge(a,i,t,"class",X),ge(a,i,t,"style",ue(((e,t)=>X(e,"style",t)),e)),ge(a,i,t,"hspace",ue(ae,e)),ge(a,i,t,"vspace",ue(ie,e)),ge(a,i,t,"border",ue(se,e)),ge(a,i,t,"borderStyle",ue(re,e)),((e,t,a)=>{a.alt===t.alt&&a.isDecorative===t.isDecorative||pe(e,a.alt,a.isDecorative)})(a,i,t)},be=(e,t)=>{const a=(e=>{if(e.margin){const t=String(e.margin).split(" ");switch(t.length){case 1:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[0],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[0];break;case 2:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[1];break;case 3:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[1];break;case 4:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[3]}delete e.margin}return e})(e.dom.styles.parse(t)),i=e.dom.styles.parse(e.dom.styles.serialize(a));return e.dom.styles.serialize(i)},ye=e=>{const t=e.selection.getNode(),a=e.dom.getParent(t,"figure.image");return a?e.dom.select("img",a)[0]:t&&("IMG"!==t.nodeName||W(t))?null:t},ve=(e,t)=>{const a=e.dom,i=(t=>{const a={};var i;return((e,t,a,i)=>{((e,t)=>{const a=v(e);for(let i=0,s=a.length;i{(t(e,s)?a:i)(e,s)}))})(t,((t,a)=>!e.schema.isValidChild(a,"figure")),(i=a,(e,t)=>{i[t]=e}),u),a})(e.schema.getTextBlockElements()),s=a.getParent(t.parentNode,(e=>{return t=i,a=e.nodeName,A(t,a)&&void 0!==t[a]&&null!==t[a];var t,a}),e.getBody());return s?a.split(s,t)??t:t},fe=(e,t)=>{const a=((t,a)=>{const i=document.createElement("img");if(he((t=>be(e,t)),{...a,caption:!1},i),pe(i,a.alt,a.isDecorative),a.caption){const e=V.create("figure",{class:"image"});return e.appendChild(i),e.appendChild(V.create("figcaption",{contentEditable:"true"},"Caption")),e.contentEditable="false",e}return i})(0,t);e.dom.setAttrib(a,"data-mce-id","__mcenew"),e.focus(),e.insertContent(a.outerHTML);const i=e.dom.select('*[data-mce-id="__mcenew"]')[0];if(e.dom.setAttrib(i,"data-mce-id",null),ne(i)){const t=ve(e,i);e.selection.select(t)}else e.selection.select(i)},Ae=(e,t)=>{const a=ye(e);if(a){const i={...de((t=>be(e,t)),a),...t},s=((e,t)=>{const a=t.src;return{...t,src:$(e,a)?a:""}})(e,i);i.src?((e,t)=>{const a=ye(e);if(a)if(he((t=>be(e,t)),t,a),((e,t)=>{e.dom.setAttrib(t,"src",t.getAttribute("src"))})(e,a),ne(a.parentNode)){e.dom.setStyle(a,"float","");const t=a.parentNode;ve(e,t),e.selection.select(a.parentNode)}else e.selection.select(a),((e,t,a)=>{const i=()=>{a.onload=a.onerror=null,e.selection&&(e.selection.select(a),e.nodeChanged())};a.onload=()=>{t.width||t.height||!T(e)||e.dom.setAttribs(a,{width:String(a.clientWidth),height:String(a.clientHeight)}),i()},a.onerror=i})(e,t,a)})(e,s):((e,t)=>{if(t){const a=e.dom.is(t.parentNode,"figure.image")?t.parentNode:t;e.dom.remove(a),e.focus(),e.nodeChanged(),e.dom.isEmpty(e.getBody())&&(e.setContent(""),e.selection.setCursorLocation())}})(e,a)}else t.src&&fe(e,{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1,...t})};var we=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),De=tinymce.util.Tools.resolve("tinymce.util.Tools");const _e=e=>r(e.value)?e.value:"",Ce=(e,t)=>{const a=[];return De.each(e,(e=>{const i=(e=>r(e.text)?e.text:r(e.title)?e.title:"")(e);if(void 0!==e.menu){const s=Ce(e.menu,t);a.push({text:i,items:s})}else{const s=t(e);a.push({text:i,value:s})}})),a},Ie=(e=_e)=>t=>t?h.from(t).map((t=>Ce(t,e))):h.none(),Ue=(e,t)=>(e=>{for(let i=0;iA(e,"items"))(a=e[i])?Ue(a.items,t):a.value===t?h.some(a):h.none();if(s.isSome())return s}var a;return h.none()})(e),Se=Ie,xe=(e,t)=>e.bind((e=>Ue(e,t))),Ne=e=>{const t=Se((t=>e.convertURL(t.value||t.url||"","src"))),a=new Promise((a=>{((e,t)=>{const a=z(e);r(a)?fetch(a).then((e=>{e.ok&&e.json().then(t)})):g(a)?a(t):t(a)})(e,(e=>{a(t(e).map((e=>y([[{text:"None",value:""}],e]))))}))})),i=(w=j(e),Ie(_e)(w)),s=E(e),o=L(e),n=(e=>_(e.options.get("images_upload_url")))(e),l=(e=>d(e.options.get("images_upload_handler")))(e),c=(e=>{const t=ye(e);return t?de((t=>be(e,t)),t):{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}})(e),m=M(e),p=R(e),u=T(e),b=k(e),v=B(e),f=P(e),A=h.some(O(e)).filter((e=>r(e)&&e.length>0));var w;return a.then((e=>({image:c,imageList:e,classList:i,hasAdvTab:s,hasUploadTab:o,hasUploadUrl:n,hasUploadHandler:l,hasDescription:m,hasImageTitle:p,hasDimensions:u,hasImageCaption:b,prependURL:A,hasAccessibilityOptions:v,automaticUploads:f})))},Te=e=>{const t=e.imageList.map((e=>({name:"images",type:"listbox",label:"Image list",items:e}))),a={name:"alt",type:"input",label:"Alternative description",enabled:!(e.hasAccessibilityOptions&&e.image.isDecorative)},i=e.classList.map((e=>({name:"classes",type:"listbox",label:"Class",items:e})));return y([[{name:"src",type:"urlinput",filetype:"image",label:"Source",picker_text:"Browse files"}],t.toArray(),e.hasAccessibilityOptions&&e.hasDescription?[{type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]}]:[],e.hasDescription?[a]:[],e.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],e.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[{...(s=e.classList.isSome()&&e.hasImageCaption,s?{type:"grid",columns:2}:{type:"panel"}),items:y([i.toArray(),e.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])}]]);var s},Ee=e=>({title:"General",name:"general",items:Te(e)}),Le=Te,Oe=e=>({src:{value:e.src,meta:{}},images:e.src,alt:e.alt,title:e.title,dimensions:{width:e.width,height:e.height},classes:e.class,caption:e.caption,style:e.style,vspace:e.vspace,border:e.border,hspace:e.hspace,borderstyle:e.borderStyle,fileinput:[],isDecorative:e.isDecorative}),je=(e,t)=>({src:e.src.value,alt:null!==e.alt&&0!==e.alt.length||!t?e.alt:null,title:e.title,width:e.dimensions.width,height:e.dimensions.height,class:e.classes,style:e.style,caption:e.caption,hspace:e.hspace,vspace:e.vspace,border:e.border,borderStyle:e.borderstyle,isDecorative:e.isDecorative}),Me=(e,t,a,i)=>{((e,t)=>{const a=t.getData();((e,t)=>/^(?:[a-zA-Z]+:)?\/\//.test(t)?h.none():e.prependURL.bind((e=>t.substring(0,e.length)!==e?h.some(e+t):h.none())))(e,a.src.value).each((e=>{t.setData({src:{value:e,meta:a.src.meta}})}))})(t,i),((e,t)=>{const a=t.getData(),i=a.src.meta;if(void 0!==i){const s=w({},a);((e,t,a)=>{e.hasDescription&&r(a.alt)&&(t.alt=a.alt),e.hasAccessibilityOptions&&(t.isDecorative=a.isDecorative||t.isDecorative||!1),e.hasImageTitle&&r(a.title)&&(t.title=a.title),e.hasDimensions&&(r(a.width)&&(t.dimensions.width=a.width),r(a.height)&&(t.dimensions.height=a.height)),r(a.class)&&xe(e.classList,a.class).each((e=>{t.classes=e.value})),e.hasImageCaption&&m(a.caption)&&(t.caption=a.caption),e.hasAdvTab&&(r(a.style)&&(t.style=a.style),r(a.vspace)&&(t.vspace=a.vspace),r(a.border)&&(t.border=a.border),r(a.hspace)&&(t.hspace=a.hspace),r(a.borderstyle)&&(t.borderstyle=a.borderstyle))})(e,s,i),t.setData(s)}})(t,i),((e,t,a,i)=>{const s=i.getData(),r=s.src.value,o=s.src.meta||{};o.width||o.height||!t.hasDimensions||(_(r)?e.imageSize(r).then((e=>{a.open&&i.setData({dimensions:e})})).catch((e=>console.error(e))):i.setData({dimensions:{width:"",height:""}}))})(e,t,a,i),((e,t,a)=>{const i=a.getData(),s=xe(e.imageList,i.src.value);t.prevImage=s,a.setData({images:s.map((e=>e.value)).getOr("")})})(t,a,i)},Re=(e,t,a,i)=>{const s=i.getData();var r;i.block("Uploading image"),(r=s.fileinput,(e=>0{i.unblock()}),(s=>{const r=URL.createObjectURL(s),o=()=>{i.unblock(),URL.revokeObjectURL(r)},n=s=>{i.setData({src:{value:s,meta:{}}}),i.showTab("general"),Me(e,t,a,i),i.focus("src")};var l;(l=s,new Promise(((e,t)=>{const a=new FileReader;a.onload=()=>{e(a.result)},a.onerror=()=>{t(a.error?.message)},a.readAsDataURL(l)}))).then((a=>{const l=e.createBlobCache(s,r,a);t.automaticUploads?e.uploadImage(l).then((e=>{n(e.url),o()})).catch((t=>{o(),e.alertErr(t,(()=>{i.focus("fileinput")}))})):(e.addToBlobCache(l),n(l.blobUri()),i.unblock())}))}))},ke=(e,t,a)=>(i,s)=>{"src"===s.name?Me(e,t,a,i):"images"===s.name?((e,t,a,i)=>{const s=i.getData(),r=xe(t.imageList,s.images);r.each((e=>{const t=""===s.alt||a.prevImage.map((e=>e.text===s.alt)).getOr(!1);t?""===e.value?i.setData({src:e,alt:a.prevAlt}):i.setData({src:e,alt:e.text}):i.setData({src:e})})),a.prevImage=r,Me(e,t,a,i)})(e,t,a,i):"alt"===s.name?a.prevAlt=i.getData().alt:"fileinput"===s.name?Re(e,t,a,i):"isDecorative"===s.name&&i.setEnabled("alt",!i.getData().isDecorative)},ze=e=>()=>{e.open=!1},Be=e=>e.hasAdvTab||e.hasUploadUrl||e.hasUploadHandler?{type:"tabpanel",tabs:y([[Ee(e)],e.hasAdvTab?[{title:"Advanced",name:"advanced",items:[{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace",inputMode:"numeric"},{type:"input",label:"Horizontal space",name:"hspace",inputMode:"numeric"},{type:"input",label:"Border width",name:"border",inputMode:"numeric"},{type:"listbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]}]:[],e.hasUploadTab&&(e.hasUploadUrl||e.hasUploadHandler)?[{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}]:[]])}:{type:"panel",items:Le(e)},Pe=(e,t,a)=>i=>{const s=w(Oe(t.image),i.getData()),r={...s,style:me(a.normalizeCss,je(s,!1))};e.execCommand("mceUpdateImage",!1,je(r,t.hasAccessibilityOptions)),e.editorUpload.uploadImagesAuto(),i.close()},He=e=>t=>$(e,t)?(e=>new Promise((t=>{const a=document.createElement("img"),i=e=>{a.parentNode&&a.parentNode.removeChild(a),t(e)};a.addEventListener("load",(()=>{const e={width:H(a.width,a.clientWidth),height:H(a.height,a.clientHeight)};i(Promise.resolve(e))})),a.addEventListener("error",(()=>{i(Promise.reject(`Failed to get image dimensions for: ${e}`))}));const s=a.style;s.visibility="hidden",s.position="fixed",s.bottom=s.left="0px",s.width=s.height="auto",document.body.appendChild(a),a.src=e})))(e.documentBaseURI.toAbsolute(t)).then((e=>({width:String(e.width),height:String(e.height)}))):Promise.resolve({width:"",height:""}),Fe=e=>(t,a,i)=>e.editorUpload.blobCache.create({blob:t,blobUri:a,name:t.name?.replace(/\.[^\.]+$/,""),filename:t.name,base64:i.split(",")[1]}),Ge=e=>t=>{e.editorUpload.blobCache.add(t)},We=e=>(t,a)=>{e.windowManager.alert(t,a)},$e=e=>t=>be(e,t),Ve=e=>t=>e.dom.parseStyle(t),Ke=e=>(t,a)=>e.dom.serializeStyle(t,a),Ze=e=>t=>we(e).upload([t],!1).then((e=>0===e.length?Promise.reject("Failed to upload image"):!1===e[0].status?Promise.reject(e[0].error?.message):e[0])),qe=e=>{const t={imageSize:He(e),addToBlobCache:Ge(e),createBlobCache:Fe(e),alertErr:We(e),normalizeCss:$e(e),parseStyle:Ve(e),serializeStyle:Ke(e),uploadImage:Ze(e)};return{open:()=>{Ne(e).then((a=>{const i=(e=>({prevImage:xe(e.imageList,e.image.src),prevAlt:e.image.alt,open:!0}))(a);return{title:"Insert/Edit Image",size:"normal",body:Be(a),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Oe(a.image),onSubmit:Pe(e,a,t),onChange:ke(t,a,i),onClose:ze(i)}})).then(e.windowManager.open)}}},Je=e=>{const t=e.attr("class");return d(t)&&/\bimage\b/.test(t)},Qe=e=>t=>{let a=t.length;const i=t=>{t.attr("contenteditable",e?"true":null)};for(;a--;){const s=t[a];Je(s)&&(s.attr("contenteditable",e?"false":null),De.each(s.getAll("figcaption"),i))}},Xe=e=>t=>{const a=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",a),a(),()=>{e.off("NodeChange",a)}};e.add("image",(e=>{(e=>{const t=e.options.register;t("image_dimensions",{processor:"boolean",default:!0}),t("image_advtab",{processor:"boolean",default:!1}),t("image_uploadtab",{processor:"boolean",default:!0}),t("image_prepend_url",{processor:"string",default:""}),t("image_class_list",{processor:"object[]"}),t("image_description",{processor:"boolean",default:!0}),t("image_title",{processor:"boolean",default:!1}),t("image_caption",{processor:"boolean",default:!1}),t("image_list",{processor:e=>{const t=!1===e||r(e)||((e,t)=>{if(l(e)){for(let a=0,i=e.length;a{e.on("PreInit",(()=>{e.parser.addNodeFilter("figure",Qe(!0)),e.serializer.addNodeFilter("figure",Qe(!1))}))})(e),(e=>{e.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:qe(e).open,onSetup:t=>{t.setActive(d(ye(e)));const a=e.selection.selectorChangedWithUnbind("img:not([data-mce-object]):not([data-mce-placeholder]),figure.image",t.setActive).unbind,i=Xe(e)(t);return()=>{a(),i()}}}),e.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:qe(e).open,onSetup:Xe(e)}),e.ui.registry.addContextMenu("image",{update:t=>e.selection.isEditable()&&(ne(t)||"IMG"===t.nodeName&&!W(t))?["image"]:[]})})(e),(e=>{e.addCommand("mceImage",qe(e).open),e.addCommand("mceUpdateImage",((t,a)=>{e.undoManager.transact((()=>Ae(e,a)))}))})(e)}))}(); \ No newline at end of file +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=Object.getPrototypeOf,a=(e,t,a)=>!!a(e,t.prototype)||e.constructor?.name===t.name,i=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&a(e,String,(e,t)=>t.isPrototypeOf(e))?"string":t})(t)===e,s=e=>t=>typeof t===e,r=i("string"),o=i("object"),n=e=>((e,i)=>o(e)&&a(e,i,(e,a)=>t(e)===a))(e,Object),l=i("array"),c=e=>null===e;const m=s("boolean"),d=e=>!(e=>null==e)(e),g=s("function"),p=s("number"),u=()=>{};class h{tag;value;static singletonNone=new h(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new h(!0,e)}static none(){return h.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?h.some(e(this.value)):h.none()}bind(e){return this.tag?e(this.value):h.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:h.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(e??"Called getOrDie on None")}static from(e){return d(e)?h.some(e):h.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Array.prototype.slice;const b=Array.prototype.push,y=e=>{const t=[];for(let a=0,i=e.length;af.call(e,t),w=(D=(e,t)=>n(e)&&n(t)?w(e,t):t,(...e)=>{if(0===e.length)throw new Error("Can't merge zero objects");const t={};for(let a=0;ae.length>0,C=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},I=C,S=(e,t,a)=>{((e,t,a)=>{if(!(r(a)||m(a)||p(a)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",a,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,a+"")})(e.dom,t,a)};var U=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),x=tinymce.util.Tools.resolve("tinymce.util.URI");const N=e=>t=>t.options.get(e),E=N("image_dimensions"),T=N("image_advtab"),L=N("image_uploadtab"),O=N("image_prepend_url"),j=N("image_class_list"),M=N("image_description"),R=N("image_title"),k=N("image_caption"),P=N("image_list"),z=N("a11y_advanced_options"),B=N("automatic_uploads"),F=(e,t)=>Math.max(parseInt(e,10),parseInt(t,10)),H=e=>(e&&(e=e.replace(/px$/,"")),e),G=e=>(e.length>0&&/^[0-9]+$/.test(e)&&(e+="px"),e),W=e=>"IMG"===e.nodeName&&(e.hasAttribute("data-mce-object")||e.hasAttribute("data-mce-placeholder")),$=(e,t)=>{const a=e.options.get;return x.isDomSafe(t,"img",{allow_html_data_urls:a("allow_html_data_urls"),allow_script_urls:a("allow_script_urls"),allow_svg_data_urls:a("allow_svg_data_urls")})},V=U.DOM,K=e=>e.style.marginLeft&&e.style.marginRight&&e.style.marginLeft===e.style.marginRight?H(e.style.marginLeft):"",Z=e=>e.style.marginTop&&e.style.marginBottom&&e.style.marginTop===e.style.marginBottom?H(e.style.marginTop):"",q=e=>e.style.borderWidth?H(e.style.borderWidth):"",J=(e,t)=>e.hasAttribute(t)?e.getAttribute(t)??"":"",Q=e=>null!==e.parentNode&&"FIGURE"===e.parentNode.nodeName,X=(e,t,a)=>{""===a||null===a?e.removeAttribute(t):e.setAttribute(t,a)},Y=(e,t)=>{const a=e.getAttribute("style"),i=t(null!==a?a:"");i.length>0?(e.setAttribute("style",i),e.setAttribute("data-mce-style",i)):e.removeAttribute("style")},ee=(e,t)=>(e,a,i)=>{const s=e.style;s[a]?(s[a]=G(i),Y(e,t)):X(e,a,i)},te=(e,t)=>e.style[t]?H(e.style[t]):J(e,t),ae=(e,t)=>{const a=G(t);e.style.marginLeft=a,e.style.marginRight=a},ie=(e,t)=>{const a=G(t);e.style.marginTop=a,e.style.marginBottom=a},se=(e,t)=>{const a=G(t);e.style.borderWidth=a},re=(e,t)=>{e.style.borderStyle=t},oe=e=>e.style.borderStyle??"",ne=e=>d(e)&&"FIGURE"===e.nodeName,le=e=>{const t=V.getAttrib(e,"alt"),a=V.getAttrib(e,"role");return e.hasAttribute("alt")&&0===t.length||"presentation"===a||"none"===a},ce=e=>le(e)?"":J(e,"alt"),me=(e,t)=>{const a=document.createElement("img");return X(a,"style",t.style),(K(a)||""!==t.hspace)&&ae(a,t.hspace),(Z(a)||""!==t.vspace)&&ie(a,t.vspace),(q(a)||""!==t.border)&&se(a,t.border),(oe(a)||""!==t.borderStyle)&&re(a,t.borderStyle),e(a.getAttribute("style")??"")},de=(e,t)=>({src:J(t,"src"),alt:ce(t),title:J(t,"title"),width:te(t,"width"),height:te(t,"height"),class:J(t,"class"),style:e(J(t,"style")),caption:Q(t),hspace:K(t),vspace:Z(t),border:q(t),borderStyle:oe(t),isDecorative:le(t)}),ge=(e,t,a,i,s)=>{a[i]!==t[i]&&s(e,i,String(a[i]))},pe=(e,t,a)=>{if(a){V.setAttrib(e,"role","presentation");const t=I(e);S(t,"alt","")}else{if(c(t)){I(e).dom.removeAttribute("alt")}else{const a=I(e);S(a,"alt",t)}"presentation"===V.getAttrib(e,"role")&&V.setAttrib(e,"role","")}},ue=(e,t)=>(a,i,s)=>{e(a,s),Y(a,t)},he=(e,t,a)=>{const i=de(e,a);ge(a,i,t,"caption",(e,t,a)=>(e=>{Q(e)?(e=>{const t=e.parentNode;d(t)&&(V.insertAfter(e,t),V.remove(t))})(e):(e=>{const t=V.create("figure",{class:"image"});V.insertAfter(t,e),t.appendChild(e),t.appendChild(V.create("figcaption",{contentEditable:"true"},"Caption")),t.contentEditable="false"})(e)})(e)),ge(a,i,t,"src",X),ge(a,i,t,"title",X),ge(a,i,t,"width",ee(0,e)),ge(a,i,t,"height",ee(0,e)),ge(a,i,t,"class",X),ge(a,i,t,"style",ue((e,t)=>X(e,"style",t),e)),ge(a,i,t,"hspace",ue(ae,e)),ge(a,i,t,"vspace",ue(ie,e)),ge(a,i,t,"border",ue(se,e)),ge(a,i,t,"borderStyle",ue(re,e)),((e,t,a)=>{a.alt===t.alt&&a.isDecorative===t.isDecorative||pe(e,a.alt,a.isDecorative)})(a,i,t)},be=(e,t)=>{const a=(e=>{if(e.margin){const t=String(e.margin).split(" ");switch(t.length){case 1:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[0],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[0];break;case 2:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[1];break;case 3:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[1];break;case 4:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[3]}delete e.margin}return e})(e.dom.styles.parse(t)),i=e.dom.styles.parse(e.dom.styles.serialize(a));return e.dom.styles.serialize(i)},ye=e=>{const t=e.selection.getNode(),a=e.dom.getParent(t,"figure.image");return a?e.dom.select("img",a)[0]:t&&("IMG"!==t.nodeName||W(t))?null:t},ve=(e,t)=>{const a=e.dom,i=(t=>{const a={};var i;return((e,t,a,i)=>{((e,t)=>{const a=v(e);for(let i=0,s=a.length;i{(t(e,s)?a:i)(e,s)})})(t,(t,a)=>!e.schema.isValidChild(a,"figure"),(i=a,(e,t)=>{i[t]=e}),u),a})(e.schema.getTextBlockElements()),s=a.getParent(t.parentNode,e=>{return t=i,a=e.nodeName,A(t,a)&&void 0!==t[a]&&null!==t[a];var t,a},e.getBody());return s?a.split(s,t)??t:t},fe=(e,t)=>{const a=((t,a)=>{const i=document.createElement("img");if(he(t=>be(e,t),{...a,caption:!1},i),pe(i,a.alt,a.isDecorative),a.caption){const e=V.create("figure",{class:"image"});return e.appendChild(i),e.appendChild(V.create("figcaption",{contentEditable:"true"},"Caption")),e.contentEditable="false",e}return i})(0,t);e.dom.setAttrib(a,"data-mce-id","__mcenew"),e.focus(),e.insertContent(a.outerHTML);const i=e.dom.select('*[data-mce-id="__mcenew"]')[0];if(e.dom.setAttrib(i,"data-mce-id",null),ne(i)){const t=ve(e,i);e.selection.select(t)}else e.selection.select(i)},Ae=(e,t)=>{const a=ye(e);if(a){const i={...de(t=>be(e,t),a),...t},s=((e,t)=>{const a=t.src;return{...t,src:$(e,a)?a:""}})(e,i);i.src?((e,t)=>{const a=ye(e);if(a)if(he(t=>be(e,t),t,a),((e,t)=>{e.dom.setAttrib(t,"src",t.getAttribute("src"))})(e,a),ne(a.parentNode)){e.dom.setStyle(a,"float","");const t=a.parentNode;ve(e,t),e.selection.select(a.parentNode)}else e.selection.select(a),((e,t,a)=>{const i=()=>{a.onload=a.onerror=null,e.selection&&(e.selection.select(a),e.nodeChanged())};a.onload=()=>{t.width||t.height||!E(e)||e.dom.setAttribs(a,{width:String(a.clientWidth),height:String(a.clientHeight)}),i()},a.onerror=i})(e,t,a)})(e,s):((e,t)=>{if(t){const a=e.dom.is(t.parentNode,"figure.image")?t.parentNode:t;e.dom.remove(a),e.focus(),e.nodeChanged(),e.dom.isEmpty(e.getBody())&&(e.setContent(""),e.selection.setCursorLocation())}})(e,a)}else t.src&&fe(e,{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1,...t})};var we=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),De=tinymce.util.Tools.resolve("tinymce.util.Tools");const _e=e=>r(e.value)?e.value:"",Ce=(e,t)=>{const a=[];return De.each(e,e=>{const i=(e=>r(e.text)?e.text:r(e.title)?e.title:"")(e);if(void 0!==e.menu){const s=Ce(e.menu,t);a.push({text:i,items:s})}else{const s=t(e);a.push({text:i,value:s})}}),a},Ie=(e=_e)=>t=>t?h.from(t).map(t=>Ce(t,e)):h.none(),Se=(e,t)=>((e,t)=>{for(let a=0;a(e=>A(e,"items"))(e)?Se(e.items,t):e.value===t?h.some(e):h.none()),Ue=Ie,xe=(e,t)=>e.bind(e=>Se(e,t)),Ne=e=>{const t=Ue(t=>e.convertURL(t.value||t.url||"","src")),a=new Promise(a=>{((e,t)=>{const a=P(e);r(a)?fetch(a).then(e=>{e.ok&&e.json().then(t)}):g(a)?a(t):t(a)})(e,e=>{a(t(e).map(e=>y([[{text:"None",value:""}],e])))})}),i=(t,a)=>{e.windowManager.alert(t,a)},s=(D=j(e),Ie(_e)(D)),o=T(e),n=L(e),l=(e=>_(e.options.get("images_upload_url")))(e),c=(e=>d(e.options.get("images_upload_handler")))(e),m=(e=>{const t=ye(e);return t?de(t=>be(e,t),t):{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}})(e),p=M(e),u=R(e),b=E(e),v=k(e),f=z(e),A=B(e),w=h.some(O(e)).filter(e=>r(e)&&e.length>0);var D;return a.then(e=>({alertErr:i,image:m,imageList:e,classList:s,hasAdvTab:o,hasUploadTab:n,hasUploadUrl:l,hasUploadHandler:c,hasDescription:p,hasImageTitle:u,hasDimensions:b,hasImageCaption:v,prependURL:w,hasAccessibilityOptions:f,automaticUploads:A}))},Ee=e=>{const t=e.imageList.map(e=>({name:"images",type:"listbox",label:"Image list",items:e})),a={name:"alt",type:"input",label:"Alternative description",enabled:!(e.hasAccessibilityOptions&&e.image.isDecorative)},i=e.classList.map(e=>({name:"classes",type:"listbox",label:"Class",items:e}));return y([[{name:"src",type:"urlinput",filetype:"image",label:"Source",picker_text:"Browse files"}],t.toArray(),e.hasAccessibilityOptions&&e.hasDescription?[{type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]}]:[],e.hasDescription?[a]:[],e.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],e.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[{...(s=e.classList.isSome()&&e.hasImageCaption,s?{type:"grid",columns:2}:{type:"panel"}),items:y([i.toArray(),e.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])}]]);var s},Te=e=>({title:"General",name:"general",items:Ee(e)}),Le=Ee,Oe=e=>({src:{value:e.src,meta:{}},images:e.src,alt:e.alt,title:e.title,dimensions:{width:e.width,height:e.height},classes:e.class,caption:e.caption,style:e.style,vspace:e.vspace,border:e.border,hspace:e.hspace,borderstyle:e.borderStyle,fileinput:[],isDecorative:e.isDecorative}),je=(e,t)=>({src:e.src.value,alt:null!==e.alt&&0!==e.alt.length||!t?e.alt:null,title:e.title,width:e.dimensions.width,height:e.dimensions.height,class:e.classes,style:e.style,caption:e.caption,hspace:e.hspace,vspace:e.vspace,border:e.border,borderStyle:e.borderstyle,isDecorative:e.isDecorative}),Me=(e,t,a,i)=>{((e,t)=>{const a=t.getData();((e,t)=>/^(?:[a-zA-Z]+:)?\/\//.test(t)?h.none():e.prependURL.bind(e=>t.substring(0,e.length)!==e?h.some(e+t):h.none()))(e,a.src.value).each(e=>{t.setData({src:{value:e,meta:a.src.meta}})})})(t,i),((e,t)=>{const a=t.getData(),i=a.src.meta;if(void 0!==i){const s=w({},a);((e,t,a)=>{e.hasDescription&&r(a.alt)&&(t.alt=a.alt),e.hasAccessibilityOptions&&(t.isDecorative=a.isDecorative||t.isDecorative||!1),e.hasImageTitle&&r(a.title)&&(t.title=a.title),e.hasDimensions&&(r(a.width)&&(t.dimensions.width=a.width),r(a.height)&&(t.dimensions.height=a.height)),r(a.class)&&xe(e.classList,a.class).each(e=>{t.classes=e.value}),e.hasImageCaption&&m(a.caption)&&(t.caption=a.caption),e.hasAdvTab&&(r(a.style)&&(t.style=a.style),r(a.vspace)&&(t.vspace=a.vspace),r(a.border)&&(t.border=a.border),r(a.hspace)&&(t.hspace=a.hspace),r(a.borderstyle)&&(t.borderstyle=a.borderstyle))})(e,s,i),t.setData(s)}})(t,i),((e,t,a,i)=>{const s=i.getData(),r=s.src.value,o=s.src.meta||{};o.width||o.height||!t.hasDimensions||(_(r)?e.imageSize(r).then(e=>{a.open&&i.setData({dimensions:e})}).catch(e=>console.error(e)):i.setData({dimensions:{width:"",height:""}}))})(e,t,a,i),((e,t,a)=>{const i=a.getData(),s=xe(e.imageList,i.src.value);t.prevImage=s,a.setData({images:s.map(e=>e.value).getOr("")})})(t,a,i)},Re=(e,t,a,i)=>{const s=i.getData();var r;i.block("Uploading image"),(r=s.fileinput,(e=>0{i.unblock()},s=>{const r=URL.createObjectURL(s),o=()=>{i.unblock(),URL.revokeObjectURL(r)},n=s=>{i.setData({src:{value:s,meta:{}}}),i.showTab("general"),Me(e,t,a,i),i.focus("src")};var l;(l=s,new Promise((e,t)=>{const a=new FileReader;a.onload=()=>{e(a.result)},a.onerror=()=>{t(a.error?.message)},a.readAsDataURL(l)})).then(a=>{const l=e.createBlobCache(s,r,a);t.automaticUploads?e.uploadImage(l).then(e=>{n(e.url),o()}).catch(e=>{o(),t.alertErr(e,()=>{i.focus("fileinput")})}):(e.addToBlobCache(l),n(l.blobUri()),i.unblock())})})},ke=(e,t,a)=>(i,s)=>{"src"===s.name?Me(e,t,a,i):"images"===s.name?((e,t,a,i)=>{const s=i.getData(),r=xe(t.imageList,s.images);r.each(e=>{const t=""===s.alt||a.prevImage.map(e=>e.text===s.alt).getOr(!1);t?""===e.value?i.setData({src:e,alt:a.prevAlt}):i.setData({src:e,alt:e.text}):i.setData({src:e})}),a.prevImage=r,Me(e,t,a,i)})(e,t,a,i):"alt"===s.name?a.prevAlt=i.getData().alt:"fileinput"===s.name?Re(e,t,a,i):"isDecorative"===s.name&&i.setEnabled("alt",!i.getData().isDecorative)},Pe=e=>()=>{e.open=!1},ze=e=>{return e.hasAdvTab||e.hasUploadUrl||e.hasUploadHandler?{type:"tabpanel",tabs:y([[Te(e)],e.hasAdvTab?[{title:"Advanced",name:"advanced",items:[{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace",inputMode:"numeric"},{type:"input",label:"Horizontal space",name:"hspace",inputMode:"numeric"},{type:"input",label:"Border width",name:"border",inputMode:"numeric"},{type:"listbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]}]:[],e.hasUploadTab&&(e.hasUploadUrl||e.hasUploadHandler)?[(t=()=>new Promise(t=>e.alertErr("Selected images do not have allowed extensions",t)),{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput",onInvalidFiles:t}]})]:[]])}:{type:"panel",items:Le(e)};var t},Be=(e,t,a)=>i=>{const s=w(Oe(t.image),i.getData()),r={...s,style:me(a.normalizeCss,je(s,!1))};e.execCommand("mceUpdateImage",!1,je(r,t.hasAccessibilityOptions)),e.editorUpload.uploadImagesAuto(),i.close()},Fe=e=>t=>$(e,t)?(e=>new Promise(t=>{const a=document.createElement("img"),i=e=>{a.parentNode&&a.parentNode.removeChild(a),t(e)};a.addEventListener("load",()=>{const e={width:F(a.width,a.clientWidth),height:F(a.height,a.clientHeight)};i(Promise.resolve(e))}),a.addEventListener("error",()=>{i(Promise.reject(`Failed to get image dimensions for: ${e}`))});const s=a.style;s.visibility="hidden",s.position="fixed",s.bottom=s.left="0px",s.width=s.height="auto",document.body.appendChild(a),a.src=e}))(e.documentBaseURI.toAbsolute(t)).then(e=>({width:String(e.width),height:String(e.height)})):Promise.resolve({width:"",height:""}),He=e=>(t,a,i)=>e.editorUpload.blobCache.create({blob:t,blobUri:a,name:t.name?.replace(/\.[^\.]+$/,""),filename:t.name,base64:i.split(",")[1]}),Ge=e=>t=>{e.editorUpload.blobCache.add(t)},We=e=>t=>be(e,t),$e=e=>t=>e.dom.parseStyle(t),Ve=e=>(t,a)=>e.dom.serializeStyle(t,a),Ke=e=>t=>we(e).upload([t],!1).then(e=>0===e.length?Promise.reject("Failed to upload image"):!1===e[0].status?Promise.reject(e[0].error?.message):e[0]),Ze=e=>{const t={imageSize:Fe(e),addToBlobCache:Ge(e),createBlobCache:He(e),normalizeCss:We(e),parseStyle:$e(e),serializeStyle:Ve(e),uploadImage:Ke(e)};return{open:()=>{Ne(e).then(a=>{const i=(e=>({prevImage:xe(e.imageList,e.image.src),prevAlt:e.image.alt,open:!0}))(a);return{title:"Insert/Edit Image",size:"normal",body:ze(a),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Oe(a.image),onSubmit:Be(e,a,t),onChange:ke(t,a,i),onClose:Pe(i)}}).then(e.windowManager.open)}}},qe=e=>{const t=e.attr("class");return d(t)&&/\bimage\b/.test(t)},Je=e=>t=>{let a=t.length;const i=t=>{t.attr("contenteditable",e?"true":null)};for(;a--;){const s=t[a];qe(s)&&(s.attr("contenteditable",e?"false":null),De.each(s.getAll("figcaption"),i))}},Qe=e=>t=>{const a=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",a),a(),()=>{e.off("NodeChange",a)}};e.add("image",e=>{(e=>{const t=e.options.register;t("image_dimensions",{processor:"boolean",default:!0}),t("image_advtab",{processor:"boolean",default:!1}),t("image_uploadtab",{processor:"boolean",default:!0}),t("image_prepend_url",{processor:"string",default:""}),t("image_class_list",{processor:"object[]"}),t("image_description",{processor:"boolean",default:!0}),t("image_title",{processor:"boolean",default:!1}),t("image_caption",{processor:"boolean",default:!1}),t("image_list",{processor:e=>{const t=!1===e||r(e)||((e,t)=>{if(l(e)){for(let a=0,i=e.length;a{e.on("PreInit",()=>{e.parser.addNodeFilter("figure",Je(!0)),e.serializer.addNodeFilter("figure",Je(!1))})})(e),(e=>{e.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:Ze(e).open,onSetup:t=>{t.setActive(d(ye(e)));const a=e.selection.selectorChangedWithUnbind("img:not([data-mce-object]):not([data-mce-placeholder]),figure.image",t.setActive).unbind,i=Qe(e)(t);return()=>{a(),i()}}}),e.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:Ze(e).open,onSetup:Qe(e)}),e.ui.registry.addContextMenu("image",{update:t=>e.selection.isEditable()&&(ne(t)||"IMG"===t.nodeName&&!W(t))?["image"]:[]})})(e),(e=>{e.addCommand("mceImage",Ze(e).open),e.addCommand("mceUpdateImage",(t,a)=>{e.undoManager.transact(()=>Ae(e,a))})})(e)})}(); \ No newline at end of file diff --git a/plugins/tinymce/plugins/importcss/plugin.min.js b/plugins/tinymce/plugins/importcss/plugin.min.js index dd1597ba..48eba96e 100644 --- a/plugins/tinymce/plugins/importcss/plugin.min.js +++ b/plugins/tinymce/plugins/importcss/plugin.min.js @@ -1 +1 @@ -!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(s=r=e,(o=String).prototype.isPrototypeOf(s)||r.constructor?.name===o.name)?"string":t;var s,r,o})(t)===e,s=t("string"),r=t("object"),o=t("array"),n=e=>"function"==typeof e;Array.prototype.slice;const c=Array.prototype.push;n(Array.from)&&Array.from;var i=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),l=tinymce.util.Tools.resolve("tinymce.EditorManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),p=tinymce.util.Tools.resolve("tinymce.util.Tools");const u=e=>t=>t.options.get(e),m=u("importcss_merge_classes"),f=u("importcss_exclusive"),y=u("importcss_selector_converter"),h=u("importcss_selector_filter"),d=u("importcss_groups"),g=u("importcss_append"),_=u("importcss_file_filter"),v=u("skin"),b=u("skin_url"),x=/^\.(?:ephox|tiny-pageembed|mce)(?:[.-]+\w+)+$/,T=e=>s(e)?t=>-1!==t.indexOf(e):e instanceof RegExp?t=>e.test(t):e,S=(e,t)=>{let s={};const r=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(t);if(!r)return;const o=r[1],n=r[2].substr(1).split(".").join(" "),c=p.makeMap("a,img");return r[1]?(s={title:t},e.schema.getTextBlockElements()[o]?s.block=o:e.schema.getBlockElements()[o]||c[o.toLowerCase()]?s.selector=o:s.inline=o):r[2]&&(s={inline:"span",title:t.substr(1),classes:n}),m(e)?s.classes=n:s.attributes={class:n},s},A=(e,t)=>null===t||f(e),k=e=>{e.on("init",(()=>{const t=(()=>{const e=[],t=[],s={};return{addItemToGroup:(e,r)=>{s[e]?s[e].push(r):(t.push(e),s[e]=[r])},addItem:t=>{e.push(t)},toFormats:()=>{return(r=t,n=e=>{const t=s[e];return 0===t.length?[]:[{title:e,items:t}]},(e=>{const t=[];for(let s=0,r=e.length;s{const s=e.length,r=new Array(s);for(let o=0;op.map(e,(e=>p.extend({},e,{original:e,selectors:{},filter:T(e.filter)}))))(d(e)),m=(t,s)=>{if(((e,t,s,r)=>!(A(e,s)?t in r:t in s.selectors))(e,t,s,r)){((e,t,s,r)=>{A(e,s)?r[t]=!0:s.selectors[t]=!0})(e,t,s,r);const o=((e,t,s,r)=>{let o;const n=y(e);return o=r&&r.selector_converter?r.selector_converter:n||(()=>S(e,s)),o.call(t,s,r)})(e,e.plugins.importcss,t,s);if(o){const t=o.name||i.DOM.uniqueId();return e.formatter.register(t,o),{title:o.title,format:t}}}return null};p.each(((e,t,r)=>{const o=[],n={},c=(t,n)=>{let i,u=t.href;if(u=(e=>{const t=a.cacheSuffix;return s(e)&&(e=e.replace("?"+t,"").replace("&"+t,"")),e})(u),u&&(!r||r(u,n))&&!((e,t)=>{const s=v(e);if(s){const r=b(e),o=r?e.documentBaseURI.toAbsolute(r):l.baseURL+"/skins/ui/"+s,n=l.baseURL+"/skins/content/",c=e.editorManager.suffix;return t===o+"/content"+(e.inline?".inline":"")+`${c}.css`||-1!==t.indexOf(n)}return!1})(e,u)){p.each(t.imports,(e=>{c(e,!0)}));try{i=t.cssRules||t.rules}catch{}p.each(i,(e=>{e.styleSheet&&e.styleSheet?c(e.styleSheet,!0):e.selectorText&&p.each(e.selectorText.split(","),(e=>{o.push(p.trim(e))}))}))}};p.each(e.contentCSS,(e=>{n[e]=!0})),r||(r=(e,t)=>t||n[e]);try{p.each(t.styleSheets,(e=>{c(e)}))}catch{}return o})(e,e.getDoc(),T(_(e))),(e=>{if(!x.test(e)&&(!n||n(e))){const s=((e,t)=>p.grep(e,(e=>!e.filter||e.filter(t))))(u,e);if(s.length>0)p.each(s,(s=>{const r=m(e,s);r&&t.addItemToGroup(s.title,r)}));else{const s=m(e,null);s&&t.addItem(s)}}}));const f=t.toFormats();e.dispatch("addStyleModifications",{items:f,replace:!g(e)})}))};e.add("importcss",(e=>((e=>{const t=e.options.register,o=e=>s(e)||n(e)||r(e);t("importcss_merge_classes",{processor:"boolean",default:!0}),t("importcss_exclusive",{processor:"boolean",default:!0}),t("importcss_selector_converter",{processor:"function"}),t("importcss_selector_filter",{processor:o}),t("importcss_file_filter",{processor:o}),t("importcss_groups",{processor:"object[]"}),t("importcss_append",{processor:"boolean",default:!1})})(e),k(e),(e=>({convertSelectorToFormat:t=>S(e,t)}))(e))))}(); \ No newline at end of file +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(s=r=e,(o=String).prototype.isPrototypeOf(s)||r.constructor?.name===o.name)?"string":t;var s,r,o})(t)===e,s=t("string"),r=t("object"),o=t("array"),n=e=>"function"==typeof e;Array.prototype.slice;const c=Array.prototype.push;n(Array.from)&&Array.from;var i=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),l=tinymce.util.Tools.resolve("tinymce.EditorManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),p=tinymce.util.Tools.resolve("tinymce.util.Tools");const u=e=>t=>t.options.get(e),m=u("importcss_merge_classes"),f=u("importcss_exclusive"),y=u("importcss_selector_converter"),h=u("importcss_selector_filter"),d=u("importcss_groups"),g=u("importcss_append"),_=u("importcss_file_filter"),v=u("skin"),b=u("skin_url"),x=/^\.(?:ephox|tiny-pageembed|mce)(?:[.-]+\w+)+$/,T=e=>s(e)?t=>-1!==t.indexOf(e):e instanceof RegExp?t=>e.test(t):e,S=(e,t)=>{let s={};const r=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(t);if(!r)return;const o=r[1],n=r[2].substr(1).split(".").join(" "),c=p.makeMap("a,img");return r[1]?(s={title:t},e.schema.getTextBlockElements()[o]?s.block=o:e.schema.getBlockElements()[o]||c[o.toLowerCase()]?s.selector=o:s.inline=o):r[2]&&(s={inline:"span",title:t.substr(1),classes:n}),m(e)?s.classes=n:s.attributes={class:n},s},A=(e,t)=>null===t||f(e),k=e=>{e.on("init",()=>{const t=(()=>{const e=[],t=[],s={};return{addItemToGroup:(e,r)=>{s[e]?s[e].push(r):(t.push(e),s[e]=[r])},addItem:t=>{e.push(t)},toFormats:()=>{return(r=t,n=e=>{const t=s[e];return 0===t.length?[]:[{title:e,items:t}]},(e=>{const t=[];for(let s=0,r=e.length;s{const s=e.length,r=new Array(s);for(let o=0;op.map(e,e=>p.extend({},e,{original:e,selectors:{},filter:T(e.filter)})))(d(e)),m=(t,s)=>{if(((e,t,s,r)=>!(A(e,s)?t in r:t in s.selectors))(e,t,s,r)){((e,t,s,r)=>{A(e,s)?r[t]=!0:s.selectors[t]=!0})(e,t,s,r);const o=((e,t,s,r)=>{let o;const n=y(e);return o=r&&r.selector_converter?r.selector_converter:n||(()=>S(e,s)),o.call(t,s,r)})(e,e.plugins.importcss,t,s);if(o){const t=o.name||i.DOM.uniqueId();return e.formatter.register(t,o),{title:o.title,format:t}}}return null};p.each(((e,t,r)=>{const o=[],n={},c=(t,n)=>{let i,u=t.href;if(u=(e=>{const t=a.cacheSuffix;return s(e)&&(e=e.replace("?"+t,"").replace("&"+t,"")),e})(u),u&&(!r||r(u,n))&&!((e,t)=>{const s=v(e);if(s){const r=b(e),o=r?e.documentBaseURI.toAbsolute(r):l.baseURL+"/skins/ui/"+s,n=l.baseURL+"/skins/content/",c=e.editorManager.suffix;return t===o+"/content"+(e.inline?".inline":"")+`${c}.css`||-1!==t.indexOf(n)}return!1})(e,u)){p.each(t.imports,e=>{c(e,!0)});try{i=t.cssRules||t.rules}catch{}p.each(i,e=>{e.styleSheet&&e.styleSheet?c(e.styleSheet,!0):e.selectorText&&p.each(e.selectorText.split(","),e=>{o.push(p.trim(e))})})}};p.each(e.contentCSS,e=>{n[e]=!0}),r||(r=(e,t)=>t||n[e]);try{p.each(t.styleSheets,e=>{c(e)})}catch{}return o})(e,e.getDoc(),T(_(e))),e=>{if(!x.test(e)&&(!n||n(e))){const s=((e,t)=>p.grep(e,e=>!e.filter||e.filter(t)))(u,e);if(s.length>0)p.each(s,s=>{const r=m(e,s);r&&t.addItemToGroup(s.title,r)});else{const s=m(e,null);s&&t.addItem(s)}}});const f=t.toFormats();e.dispatch("addStyleModifications",{items:f,replace:!g(e)})})};e.add("importcss",e=>((e=>{const t=e.options.register,o=e=>s(e)||n(e)||r(e);t("importcss_merge_classes",{processor:"boolean",default:!0}),t("importcss_exclusive",{processor:"boolean",default:!0}),t("importcss_selector_converter",{processor:"function"}),t("importcss_selector_filter",{processor:o}),t("importcss_file_filter",{processor:o}),t("importcss_groups",{processor:"object[]"}),t("importcss_append",{processor:"boolean",default:!1})})(e),k(e),(e=>({convertSelectorToFormat:t=>S(e,t)}))(e)))}(); \ No newline at end of file diff --git a/plugins/tinymce/plugins/insertdatetime/plugin.min.js b/plugins/tinymce/plugins/insertdatetime/plugin.min.js index 9e671dd3..de73d6f0 100644 --- a/plugins/tinymce/plugins/insertdatetime/plugin.min.js +++ b/plugins/tinymce/plugins/insertdatetime/plugin.min.js @@ -1 +1 @@ -!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>t.options.get(e),a=t("insertdatetime_dateformat"),n=t("insertdatetime_timeformat"),r=t("insertdatetime_formats"),s=t("insertdatetime_element"),i="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),o="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),l="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),m="January February March April May June July August September October November December".split(" "),c=(e,t)=>{if((e=""+e).length(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+a.getFullYear())).replace("%y",""+a.getYear())).replace("%m",c(a.getMonth()+1,2))).replace("%d",c(a.getDate(),2))).replace("%H",""+c(a.getHours(),2))).replace("%M",""+c(a.getMinutes(),2))).replace("%S",""+c(a.getSeconds(),2))).replace("%I",""+((a.getHours()+11)%12+1))).replace("%p",a.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(m[a.getMonth()]))).replace("%b",""+e.translate(l[a.getMonth()]))).replace("%A",""+e.translate(o[a.getDay()]))).replace("%a",""+e.translate(i[a.getDay()]))).replace("%%","%"),u=(e,t)=>{if(s(e)&&e.selection.isEditable()){const a=d(e,t);let n;n=/%[HMSIp]/.test(t)?d(e,"%Y-%m-%dT%H:%M"):d(e,"%Y-%m-%d");const r=e.dom.getParent(e.selection.getStart(),"time");r?((e,t,a,n)=>{const r=e.dom.create("time",{datetime:a},n);e.dom.replace(r,t),e.selection.select(r,!0),e.selection.collapse(!1)})(e,r,n,a):e.insertContent('")}else e.insertContent(d(e,t))};var p=tinymce.util.Tools.resolve("tinymce.util.Tools");const g=e=>t=>{const a=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",a),a(),()=>{e.off("NodeChange",a)}};e.add("insertdatetime",(e=>{(e=>{const t=e.options.register;t("insertdatetime_dateformat",{processor:"string",default:e.translate("%Y-%m-%d")}),t("insertdatetime_timeformat",{processor:"string",default:e.translate("%H:%M:%S")}),t("insertdatetime_formats",{processor:"string[]",default:["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"]}),t("insertdatetime_element",{processor:"boolean",default:!1})})(e),(e=>{e.addCommand("mceInsertDate",((t,n)=>{u(e,n??a(e))})),e.addCommand("mceInsertTime",((t,a)=>{u(e,a??n(e))}))})(e),(e=>{const t=r(e),a=(e=>{let t=e;return{get:()=>t,set:e=>{t=e}}})((e=>{const t=r(e);return t.length>0?t[0]:n(e)})(e)),s=t=>e.execCommand("mceInsertDate",!1,t);e.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",chevronTooltip:"Insert date/time menu",select:e=>e===a.get(),fetch:a=>{a(p.map(t,(t=>({type:"choiceitem",text:d(e,t),value:t}))))},onAction:e=>{s(a.get())},onItemAction:(e,t)=>{a.set(t),s(t)},onSetup:g(e)});const i=e=>()=>{a.set(e),s(e)};e.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:()=>p.map(t,(t=>({type:"menuitem",text:d(e,t),onAction:i(t)}))),onSetup:g(e)})})(e)}))}(); \ No newline at end of file +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>t.options.get(e),a=t("insertdatetime_dateformat"),n=t("insertdatetime_timeformat"),r=t("insertdatetime_formats"),s=t("insertdatetime_element"),i="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),o="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),l="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),m="January February March April May June July August September October November December".split(" "),c=(e,t)=>{if((e=""+e).length(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+a.getFullYear())).replace("%y",""+a.getYear())).replace("%m",c(a.getMonth()+1,2))).replace("%d",c(a.getDate(),2))).replace("%H",""+c(a.getHours(),2))).replace("%M",""+c(a.getMinutes(),2))).replace("%S",""+c(a.getSeconds(),2))).replace("%I",""+((a.getHours()+11)%12+1))).replace("%p",a.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(m[a.getMonth()]))).replace("%b",""+e.translate(l[a.getMonth()]))).replace("%A",""+e.translate(o[a.getDay()]))).replace("%a",""+e.translate(i[a.getDay()]))).replace("%%","%"),u=(e,t)=>{if(s(e)&&e.selection.isEditable()){const a=d(e,t);let n;n=/%[HMSIp]/.test(t)?d(e,"%Y-%m-%dT%H:%M"):d(e,"%Y-%m-%d");const r=e.dom.getParent(e.selection.getStart(),"time");r?((e,t,a,n)=>{const r=e.dom.create("time",{datetime:a},n);e.dom.replace(r,t),e.selection.select(r,!0),e.selection.collapse(!1)})(e,r,n,a):e.insertContent('")}else e.insertContent(d(e,t))};var p=tinymce.util.Tools.resolve("tinymce.util.Tools");const g=e=>t=>{const a=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",a),a(),()=>{e.off("NodeChange",a)}};e.add("insertdatetime",e=>{(e=>{const t=e.options.register;t("insertdatetime_dateformat",{processor:"string",default:e.translate("%Y-%m-%d")}),t("insertdatetime_timeformat",{processor:"string",default:e.translate("%H:%M:%S")}),t("insertdatetime_formats",{processor:"string[]",default:["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"]}),t("insertdatetime_element",{processor:"boolean",default:!1})})(e),(e=>{e.addCommand("mceInsertDate",(t,n)=>{u(e,n??a(e))}),e.addCommand("mceInsertTime",(t,a)=>{u(e,a??n(e))})})(e),(e=>{const t=r(e),a=(e=>{let t=e;return{get:()=>t,set:e=>{t=e}}})((e=>{const t=r(e);return t.length>0?t[0]:n(e)})(e)),s=t=>e.execCommand("mceInsertDate",!1,t);e.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",chevronTooltip:"Insert date/time menu",select:e=>e===a.get(),fetch:a=>{a(p.map(t,t=>({type:"choiceitem",text:d(e,t),value:t})))},onAction:e=>{s(a.get())},onItemAction:(e,t)=>{a.set(t),s(t)},onSetup:g(e)});const i=e=>()=>{a.set(e),s(e)};e.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:()=>p.map(t,t=>({type:"menuitem",text:d(e,t),onAction:i(t)})),onSetup:g(e)})})(e)})}(); \ No newline at end of file diff --git a/plugins/tinymce/plugins/link/plugin.min.js b/plugins/tinymce/plugins/link/plugin.min.js index 81e121d2..04e158e1 100644 --- a/plugins/tinymce/plugins/link/plugin.min.js +++ b/plugins/tinymce/plugins/link/plugin.min.js @@ -1 +1 @@ -!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(n=o=e,(r=String).prototype.isPrototypeOf(n)||o.constructor?.name===r.name)?"string":t;var n,o,r})(t)===e,n=e=>t=>typeof t===e,o=t("string"),r=t("object"),l=t("array"),a=e=>null===e;const s=n("boolean"),i=e=>!(e=>null==e)(e),c=n("function"),u=(e,t)=>{if(l(e)){for(let n=0,o=e.length;n{},d=e=>e,m=(e,t)=>e===t;class h{tag;value;static singletonNone=new h(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new h(!0,e)}static none(){return h.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?h.some(e(this.value)):h.none()}bind(e){return this.tag?e(this.value):h.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:h.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(e??"Called getOrDie on None")}static from(e){return i(e)?h.some(e):h.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Array.prototype.slice;const p=Array.prototype.indexOf,f=Array.prototype.push,k=e=>{const t=[];for(let n=0,o=e.length;n{for(let n=0;ny.call(e,t),_=(e,t,n=m)=>e.exists((e=>n(e,t))),w=e=>{const t=[],n=e=>{t.push(e)};for(let t=0;te?h.some(t):h.none(),O=e=>t=>t.options.get(e),A=O("link_assume_external_targets"),S=O("link_context_toolbar"),N=O("link_list"),E=O("link_default_target"),R=O("link_default_protocol"),T=O("link_target_list"),L=O("link_rel_list"),P=O("link_class_list"),U=O("link_title"),B=O("allow_unsafe_link_target"),D=O("link_quicklink"),M=O("link_attributes_postprocess"),j=O("files_upload_handler"),I=O("link_uploadtab"),F=O("documents_file_types");var K=tinymce.util.Tools.resolve("tinymce.util.URI"),q=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),$=tinymce.util.Tools.resolve("tinymce.util.Tools");const V=e=>i(e)&&"a"===e.nodeName.toLowerCase(),z=e=>V(e)&&!!J(e),G=(e,t)=>{if(e.collapsed)return[];{const n=e.cloneContents(),o=n.firstChild,r=new q(o,n),l=[];let a=o;do{t(a)&&l.push(a)}while(a=r.next());return l}},H=e=>/^\w+:/i.test(e),J=e=>e.getAttribute("data-mce-href")??e.getAttribute("href")??"",W=(e,t)=>{const n=["noopener"],o=e?e.split(/\s+/):[],r=e=>e.filter((e=>-1===$.inArray(n,e))),l=t?(e=>(e=r(e)).length>0?e.concat(n):n)(o):r(o);return l.length>0?(e=>$.trim(e.sort().join(" ")))(l):""},Q=(e,t)=>(t=t||Z(e.selection.getRng())[0]||e.selection.getNode(),oe(t)?h.from(e.dom.select("a[href]",t)[0]):h.from(e.dom.getParent(t,"a[href]"))),X=(e,t)=>Q(e,t).isSome(),Y=(e,t)=>t.fold((()=>e.getContent({format:"text"})),(e=>e.innerText||e.textContent||"")).replace(/\uFEFF/g,""),Z=e=>G(e,z),ee=e=>$.grep(e,z),te=e=>ee(e).length>0,ne=e=>{const t=e.schema.getTextInlineElements();if(Q(e).exists((e=>e.hasAttribute("data-mce-block"))))return!1;const n=e.selection.getRng();return!!n.collapsed||0===G(n,(e=>1===e.nodeType&&!V(e)&&!x(t,e.nodeName.toLowerCase()))).length},oe=e=>i(e)&&"FIGURE"===e.nodeName&&/\bimage\b/i.test(e.className),re=(e,t,n)=>{const o=e.selection.getNode(),r=Q(e,o),l=((e,t)=>{const n={...t};if(0===L(e).length&&!B(e)){const e=W(n.rel,"_blank"===n.target);n.rel=e||null}return h.from(n.target).isNone()&&!1===T(e)&&(n.target=E(e)),n.href=((e,t)=>"http"!==t&&"https"!==t||H(e)?e:t+"://"+e)(n.href,A(e)),n})(e,(e=>{return t=["title","rel","class","target"],n=(t,n)=>(e[n].each((e=>{t[n]=e.length>0?e:null})),t),o={href:e.href},((e,t)=>{for(let n=0,o=e.length;n{o=n(o,e)})),o;var t,n,o})(n)),a=M(e);i(a)&&a(l),e.undoManager.transact((()=>{n.href===t.href&&t.attach(),r.fold((()=>{((e,t,n,o)=>{const r=e.dom;oe(t)?ce(r,t,o):n.fold((()=>{e.execCommand("mceInsertLink",!1,o);const t=e.selection.getEnd(),n=r.createRng();n.setStartAfter(t),n.setEndAfter(t),e.selection.setRng(n)}),(t=>{e.insertContent(r.createHTML("a",o,r.encode(t)))}))})(e,o,n.text,l)}),(t=>{e.focus(),((e,t,n,o)=>{n.each((e=>{x(t,"innerText")?t.innerText=e:t.textContent=e})),e.dom.setAttribs(t,o);const r=e.dom.createRng();r.setStartAfter(t),r.setEndAfter(t),e.selection.setRng(r)})(e,t,n.text,l)}))}))},le=e=>{const{class:t,href:n,rel:o,target:r,text:l,title:s}=e;return(e=>{const t={};var n;return((e,t,n,o)=>{((e,t)=>{const n=v(e);for(let o=0,r=n.length;o{(t(e,r)?n:o)(e,r)}))})(e,((e,t)=>!1===a(e)),(n=t,(e,t)=>{n[t]=e}),g),t})({class:t.getOrNull(),href:n,rel:o.getOrNull(),target:r.getOrNull(),text:l.getOrNull(),title:s.getOrNull()})},ae=(e,t,n)=>{const o=((e,t)=>{const n=e.options.get,o={allow_html_data_urls:n("allow_html_data_urls"),allow_script_urls:n("allow_script_urls"),allow_svg_data_urls:n("allow_svg_data_urls")},r=t.href;return{...t,href:K.isDomSafe(r,"a",o)?r:""}})(e,n);e.hasPlugin("rtc",!0)?e.execCommand("createlink",!1,le(o)):re(e,t,o)},se=e=>{e.hasPlugin("rtc",!0)?e.execCommand("unlink"):(e=>{e.undoManager.transact((()=>{const t=e.selection.getNode();oe(t)?ie(e,t):(e=>{const t=e.dom,n=e.selection,o=n.getBookmark(),r=n.getRng().cloneRange(),l=t.getParent(r.startContainer,"a[href]",e.getBody()),a=t.getParent(r.endContainer,"a[href]",e.getBody());l&&r.setStartBefore(l),a&&r.setEndAfter(a),n.setRng(r),e.execCommand("unlink"),n.moveToBookmark(o)})(e),e.focus()}))})(e)},ie=(e,t)=>{const n=e.dom.select("img",t)[0];if(n){const o=e.dom.getParents(n,"a[href]",t)[0];o&&(o.parentNode?.insertBefore(n,o),e.dom.remove(o))}},ce=(e,t,n)=>{const o=e.select("img",t)[0];if(o){const t=e.create("a",n);o.parentNode?.insertBefore(t,o),t.appendChild(o)}},ue=e=>o(e.value)?e.value:"",ge=(e,t)=>{const n=[];return $.each(e,(e=>{const r=(e=>o(e.text)?e.text:o(e.title)?e.title:"")(e);if(void 0!==e.menu){const o=ge(e.menu,t);n.push({text:r,items:o})}else{const o=t(e);n.push({text:r,value:o})}})),n},de=(e=ue)=>t=>h.from(t).map((t=>ge(t,e))),me=e=>de(ue)(e),he=de,pe=(e,t)=>n=>({name:e,type:"listbox",label:t,items:n}),fe=ue,ke=(e,t)=>b(t,(t=>(e=>{return x(t=e,n="items")&&void 0!==t[n]&&null!==t[n];var t,n})(t)?ke(e,t.items):C(t.value===e,t))),be=(e,t)=>{const n={text:e.text,title:e.title},o=(e,o)=>{const r=(l=t,a=o,"link"===a?l.link:"anchor"===a?l.anchor:h.none()).getOr([]);var l,a;return((e,t,n,o)=>{const r=o[t],l=e.length>0;return void 0!==r?ke(r,n).map((t=>({url:{value:t.value,meta:{text:l?e:t.text,attach:g}},text:l?e:t.text}))):h.none()})(n.text,o,r,e)};return{onChange:(e,t)=>{const r=t.name;return"url"===r?(e=>{const t=(o=e.url,C(n.text.length<=0,h.from(o.meta?.text).getOr(o.value)));var o;const r=(e=>C(n.title.length<=0,h.from(e.meta?.title).getOr("")))(e.url);return t.isSome()||r.isSome()?h.some({...t.map((e=>({text:e}))).getOr({}),...r.map((e=>({title:e}))).getOr({})}):h.none()})(e()):((e,t)=>p.call(e,t))(["anchor","link"],r)>-1?o(e(),r):"text"===r||"title"===r?(n[r]=e()[r],h.none()):h.none()}}};var ve=tinymce.util.Tools.resolve("tinymce.util.Delay");const ye=e=>{const t=e.href;return t.indexOf("@")>0&&-1===t.indexOf("/")&&-1===t.indexOf("mailto:")?h.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:e=>({...e,href:"mailto:"+t})}):h.none()},xe=(e,t)=>n=>{const o=n.href;return 1===e&&!H(o)||0===e&&/^\s*www(\.|\d\.)/i.test(o)?h.some({message:`The URL you entered seems to be an external link. Do you want to add the required ${t}:// prefix?`,preprocess:e=>({...e,href:t+"://"+o})}):h.none()},_e=e=>{const t=e.dom.select("a:not([href])"),n=k(((e,t)=>{const n=e.length,o=new Array(n);for(let r=0;r{const t=e.name||e.id;return t?[{text:t,value:"#"+t}]:[]})));return n.length>0?h.some([{text:"None",value:""}].concat(n)):h.none()},we=e=>{const t=P(e);return t.length>0?me(t):h.none()},Ce=e=>{try{return h.some(JSON.parse(e))}catch{return h.none()}},Oe=(e,t)=>{const n=L(e);if(n.length>0){const o=_(t,"_blank"),r=e=>W(fe(e),o);return(!1===B(e)?he(r):me)(n)}return h.none()},Ae=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Se=e=>{const t=T(e);return l(t)?me(t).orThunk((()=>h.some(Ae))):!1===t?h.none():h.some(Ae)},Ne=(e,t,n)=>{const o=e.getAttrib(t,n);return null!==o&&o.length>0?h.some(o):h.none()},Ee=(e,t)=>(e=>{const t=t=>e.convertURL(t.value||t.url||"","href"),n=N(e);return new Promise((e=>{o(n)?fetch(n).then((e=>e.ok?e.text().then(Ce):Promise.reject())).then(e,(()=>e(h.none()))):c(n)?n((t=>e(h.some(t)))):e(h.from(n))})).then((e=>e.bind(he(t)).map((e=>e.length>0?[{text:"None",value:""}].concat(e):e))))})(e).then((n=>{const o=(e=>i(e.options.get("files_upload_handler")))(e)&&(e=>i(e.options.get("documents_file_types")))(e)&&I(e),r=((e,t)=>{const n=e.dom,o=ne(e)?h.some(Y(e.selection,t)):h.none(),r=t.bind((e=>h.from(n.getAttrib(e,"href")))),l=t.bind((e=>h.from(n.getAttrib(e,"target")))),a=t.bind((e=>Ne(n,e,"rel"))),s=t.bind((e=>Ne(n,e,"class")));return{url:r,text:o,title:t.bind((e=>Ne(n,e,"title"))),target:l,rel:a,linkClass:s}})(e,t);return{anchor:r,catalogs:{targets:Se(e),rels:Oe(e,r.target),classes:we(e),anchor:_e(e),link:n},hasUploadPanel:o,optNode:t,flags:{titleEnabled:U(e)}}})),Re=e=>({title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput",buttonLabel:"Browse for a file",dropAreaLabel:"Drop a file here",allowedFileTypes:e.map((e=>e.mimeType)).join(","),allowedFileExtensions:k(e.map((e=>e.extensions)))}]}),Te=e=>(t,n)=>j(e)(t,n),Le=(e,t)=>{const n=t.getData();var o;t.block("Uploading file"),(o=n.fileinput,(e=>0{t.unblock()}),(n=>{const o=URL.createObjectURL(n),r=()=>{t.unblock(),URL.revokeObjectURL(o)};var l;(l=n,new Promise(((e,t)=>{const n=new FileReader;n.onload=()=>{e(n.result)},n.onerror=()=>{t(new Error(n.error?.message??"Failed to convert blob to a data url"))},n.readAsDataURL(l)}))).then((t=>{const r=e.getExistingBlobInfo((e=>h.from(e.split(",")[1]).getOr(""))(t),n.type),l=r&&r.filename()===n.name?r:e.createBlobCache(n,o,t);return e.addToBlobCache(l),e.uploadFile(l,d)})).then((e=>{(({url:e,fileName:n})=>{t.setData({text:n,title:n,url:{value:e,meta:{}}}),t.showTab("general"),t.focus("url")})(e),r()})).catch((n=>{r(),e.alertErr(n,(()=>{t.focus("fileinput")}))}))}))},Pe=e=>(t,n,o)=>e.editorUpload.blobCache.create({blob:t,blobUri:n,name:t.name?.replace(/\.[^\.]+$/,""),filename:t.name,base64:o.split(",")[1]}),Ue=e=>t=>{e.editorUpload.blobCache.add(t)},Be=e=>(t,n)=>e.editorUpload.blobCache.getByData(t,n),De=e=>(t,n)=>{e.windowManager.alert(t,n)},Me=e=>{const t=(e=>{const t=Q(e);return Ee(e,t)})(e);t.then((t=>{const n=((e,t)=>n=>{const o=n.getData();if(!o.url.value)return se(e),void n.close();const r=e=>h.from(o[e]).filter((n=>!_(t.anchor[e],n))),l={href:o.url.value,text:r("text"),target:r("target"),rel:r("rel"),class:r("linkClass"),title:r("title")},a={href:o.url.value,attach:void 0!==o.url.meta&&o.url.meta.attach?o.url.meta.attach:g};((e,t)=>b([ye,xe(A(e),R(e))],(e=>e(t))).fold((()=>Promise.resolve(t)),(n=>new Promise((o=>{((e,t,n)=>{const o=e.selection.getRng();ve.setEditorTimeout(e,(()=>{e.windowManager.confirm(t,(t=>{e.selection.setRng(o),n(t)}))}))})(e,n.message,(e=>{o(e?n.preprocess(t):t)}))})))))(e,l).then((t=>{ae(e,a,t)})),n.close()})(e,t);return((e,t,n)=>{const o=e.anchor.text.map((()=>({name:"text",type:"input",label:"Text to display"}))).toArray(),r=e.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],l=((e,t)=>{const n=e.anchor,o=n.url.getOr("");return{url:{value:o,meta:{original:{value:o}}},text:n.text.getOr(""),title:n.title.getOr(""),anchor:o,link:o,rel:n.rel.getOr(""),target:n.target.or(t).getOr(""),linkClass:n.linkClass.getOr(""),fileinput:[]}})(e,h.from(E(n))),a=e.catalogs,s=be(l,a),i=((e,t,n,o,r,l)=>{const a=k([[{name:"url",type:"urlinput",filetype:"file",label:"URL",picker_text:"Browse links"}],t,n,w([o.anchor.map(pe("anchor","Anchors")),o.rels.map(pe("rel","Rel")),o.targets.map(pe("target","Open link in...")),o.link.map(pe("link","Link list")),o.classes.map(pe("linkClass","Class"))])]);return r?{type:"tabpanel",tabs:k([[{title:"General",name:"general",items:a}],[Re(l)]])}:{type:"panel",items:a}})(0,o,r,a,e.hasUploadPanel,F(n)),c={addToBlobCache:Ue(n),createBlobCache:Pe(n),alertErr:De(n),uploadFile:Te(n),getExistingBlobInfo:Be(n)};return{title:"Insert/Edit Link",size:"normal",body:i,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:l,onChange:(e,{name:t})=>{"fileinput"===t?Le(c,e):s.onChange(e.getData,{name:t}).each((t=>{e.setData(t)}))},onSubmit:t}})(t,n,e)})).then((t=>{e.windowManager.open(t)}))};var je=tinymce.util.Tools.resolve("tinymce.util.VK");const Ie=(e,t)=>{if(t){const o=J(t);if(/^#/.test(o)){const t=e.dom.select(`${o},[name="${n=o,((e,t)=>((e,t)=>""===t||e.length>=t.length&&e.substr(0,0+t.length)===t)(e,t))(n,"#")?(e=>e.substring(1))(n):n}"]`);t.length&&e.selection.scrollIntoView(t[0],!0)}else(e=>{const t=document.createElement("a");t.target="_blank",t.href=e,t.rel="noreferrer noopener";const n=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});document.dispatchEvent(n),((e,t)=>{document.body.appendChild(e),e.dispatchEvent(t),document.body.removeChild(e)})(t,n)})(t.href)}var n},Fe=(e,t)=>{const n=ee(e.dom.getParents(t));return C(1===n.length,n[0])},Ke=e=>e.selection.isCollapsed()||(e=>{const t=e.selection.getRng(),n=t.startContainer;return z(n)&&t.startContainer===t.endContainer&&1===e.dom.select("img",n).length})(e)?Fe(e,e.selection.getStart()):(e=>{const t=Z(e.selection.getRng());return C(t.length>0,t[0]).or(Fe(e,e.selection.getNode()))})(e),qe=e=>()=>{e.execCommand("mceLink",!1,{dialog:!0})},$e=(e,t)=>(e.on("NodeChange",t),()=>e.off("NodeChange",t)),Ve=e=>t=>{const n=()=>{t.setActive(!e.mode.isReadOnly()&&X(e,e.selection.getNode())),t.setEnabled(e.selection.isEditable())};return n(),$e(e,n)},ze=e=>t=>{const n=()=>{t.setEnabled(e.selection.isEditable())};return n(),$e(e,n)},Ge=e=>t=>{const n=e.dom.getParents(e.selection.getStart()),o=n=>{t.setEnabled((t=>{return te(t)||(n=e.selection.getRng(),Z(n).length>0);var n})(n)&&e.selection.isEditable())};return o(n),$e(e,(e=>o(e.parents)))},He=e=>{const t=(e=>{const t=(()=>{const e=(e=>{const t=(e=>{let t=e;return{get:()=>t,set:e=>{t=e}}})(h.none()),n=()=>t.get().each(e);return{clear:()=>{n(),t.set(h.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{n(),t.set(h.some(e))}}})(g);return{...e,on:t=>e.get().each(t)}})(),n=()=>t.get().or(Ke(e));return e.on("contextmenu",(n=>{Fe(e,n.target).each(t.set)})),e.on("SelectionChange",(()=>{t.isSet()||Ke(e).each(t.set)})),e.on("click",(n=>{t.clear();const o=ee(e.dom.getParents(n.target));1===o.length&&je.metaKeyPressed(n)&&(n.preventDefault(),Ie(e,o[0]))})),e.on("keydown",(o=>{t.clear(),!o.isDefaultPrevented()&&13===o.keyCode&&(e=>!0===e.altKey&&!1===e.shiftKey&&!1===e.ctrlKey&&!1===e.metaKey)(o)&&n().each((t=>{o.preventDefault(),Ie(e,t)}))})),{gotoSelectedLink:()=>n().each((t=>Ie(e,t)))}})(e);((e,t)=>{e.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Meta+K",onAction:qe(e),onSetup:Ve(e)}),e.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:t.gotoSelectedLink,onSetup:Ge(e)}),e.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:()=>se(e),onSetup:Ge(e)})})(e,t),((e,t)=>{e.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:t.gotoSelectedLink,onSetup:Ge(e)}),e.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:qe(e),onSetup:ze(e)}),e.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:()=>se(e),onSetup:Ge(e)})})(e,t),(e=>{e.ui.registry.addContextMenu("link",{update:t=>e.dom.isEditable(t)?te(e.dom.getParents(t,"a"))?"link unlink openlink":"link":""})})(e),((e,t)=>{const n=t=>{const n=e.selection.getNode();return t.setEnabled(X(e,n)&&e.selection.isEditable()),g};e.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Ve(e)},label:"Link",predicate:t=>S(e)&&X(e,t),initValue:()=>Q(e).fold((()=>""),J),commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:t=>{const n=e.selection.getNode();return t.setActive(X(e,n)),Ve(e)(t)},onAction:t=>{const n=t.getValue(),o=(t=>{const n=Q(e),o=ne(e);if(n.isNone()&&o){const o=Y(e.selection,n);return C(0===o.length,t)}return h.none()})(n);ae(e,{href:n,attach:g},{href:n,text:o,title:h.none(),rel:h.none(),target:h.from(E(e)),class:h.none()}),(e=>{e.selection.collapse(!1)})(e),t.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:n,onAction:t=>{se(e),t.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:n,onAction:e=>{t.gotoSelectedLink(),e.hide()}}]})})(e,t)};e.add("link",(e=>{(e=>{const t=e.options.register;t("link_assume_external_targets",{processor:e=>{const t=o(e)||s(e);return t?!0===e?{value:1,valid:t}:"http"===e||"https"===e?{value:e,valid:t}:{value:0,valid:t}:{valid:!1,message:"Must be a string or a boolean."}},default:!1}),t("link_context_toolbar",{processor:"boolean",default:!1}),t("link_list",{processor:e=>o(e)||c(e)||u(e,r)}),t("link_default_target",{processor:"string"}),t("link_default_protocol",{processor:"string",default:"https"}),t("link_target_list",{processor:e=>s(e)||u(e,r),default:!0}),t("link_rel_list",{processor:"object[]",default:[]}),t("link_class_list",{processor:"object[]",default:[]}),t("link_title",{processor:"boolean",default:!0}),t("allow_unsafe_link_target",{processor:"boolean",default:!1}),t("link_quicklink",{processor:"boolean",default:!1}),t("link_attributes_postprocess",{processor:"function"}),t("files_upload_handler",{processor:"function"}),t("link_uploadtab",{processor:"boolean",default:!0})})(e),(e=>{e.addCommand("mceLink",((t,n)=>{!0!==n?.dialog&&D(e)?e.dispatch("contexttoolbar-show",{toolbarKey:"quicklink"}):Me(e)}))})(e),He(e),(e=>{e.addShortcut("Meta+K","",(()=>{e.execCommand("mceLink")}))})(e)}))}(); \ No newline at end of file +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(n=o=e,(r=String).prototype.isPrototypeOf(n)||o.constructor?.name===r.name)?"string":t;var n,o,r})(t)===e,n=e=>t=>typeof t===e,o=t("string"),r=t("object"),l=t("array"),a=e=>null===e;const s=n("boolean"),i=e=>!(e=>null==e)(e),c=n("function"),u=(e,t)=>{if(l(e)){for(let n=0,o=e.length;n{},g=e=>e,m=(e,t)=>e===t;class h{tag;value;static singletonNone=new h(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new h(!0,e)}static none(){return h.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?h.some(e(this.value)):h.none()}bind(e){return this.tag?e(this.value):h.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:h.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(e??"Called getOrDie on None")}static from(e){return i(e)?h.some(e):h.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Array.prototype.slice;const p=Array.prototype.indexOf,f=Array.prototype.push,k=e=>{const t=[];for(let n=0,o=e.length;n{for(let n=0;ny.call(e,t),_=(e,t,n=m)=>e.exists(e=>n(e,t)),w=e=>{const t=[],n=e=>{t.push(e)};for(let t=0;te?h.some(t):h.none(),O=e=>t=>t.options.get(e),A=O("link_assume_external_targets"),S=O("link_context_toolbar"),E=O("link_list"),N=O("link_default_target"),R=O("link_default_protocol"),T=O("link_target_list"),L=O("link_rel_list"),P=O("link_class_list"),U=O("link_title"),B=O("allow_unsafe_link_target"),D=O("link_quicklink"),M=O("link_attributes_postprocess"),F=O("files_upload_handler"),I=O("link_uploadtab"),j=O("documents_file_types");var K=tinymce.util.Tools.resolve("tinymce.util.URI"),q=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),$=tinymce.util.Tools.resolve("tinymce.util.Tools");const V=e=>i(e)&&"a"===e.nodeName.toLowerCase(),z=e=>V(e)&&!!J(e),G=(e,t)=>{if(e.collapsed)return[];{const n=e.cloneContents(),o=n.firstChild,r=new q(o,n),l=[];let a=o;do{t(a)&&l.push(a)}while(a=r.next());return l}},H=e=>/^\w+:/i.test(e),J=e=>e.getAttribute("data-mce-href")??e.getAttribute("href")??"",W=(e,t)=>{const n=["noopener"],o=e?e.split(/\s+/):[],r=e=>e.filter(e=>-1===$.inArray(n,e)),l=t?(e=>(e=r(e)).length>0?e.concat(n):n)(o):r(o);return l.length>0?(e=>$.trim(e.sort().join(" ")))(l):""},Q=(e,t)=>(t=t||Z(e.selection.getRng())[0]||e.selection.getNode(),oe(t)?h.from(e.dom.select("a[href]",t)[0]):h.from(e.dom.getParent(t,"a[href]"))),X=(e,t)=>Q(e,t).isSome(),Y=(e,t)=>t.fold(()=>e.getContent({format:"text"}),e=>e.innerText||e.textContent||"").replace(/\uFEFF/g,""),Z=e=>G(e,z),ee=e=>$.grep(e,z),te=e=>ee(e).length>0,ne=e=>{const t=e.schema.getTextInlineElements();if(Q(e).exists(e=>e.hasAttribute("data-mce-block")))return!1;const n=e.selection.getRng();return!!n.collapsed||0===G(n,e=>1===e.nodeType&&!V(e)&&!x(t,e.nodeName.toLowerCase())).length},oe=e=>i(e)&&"FIGURE"===e.nodeName&&/\bimage\b/i.test(e.className),re=(e,t,n)=>{const o=e.selection.getNode(),r=Q(e,o),l=((e,t)=>{const n={...t};if(0===L(e).length&&!B(e)){const e=W(n.rel,"_blank"===n.target);n.rel=e||null}return h.from(n.target).isNone()&&!1===T(e)&&(n.target=N(e)),n.href=((e,t)=>"http"!==t&&"https"!==t||H(e)?e:t+"://"+e)(n.href,A(e)),n})(e,(e=>{return t=["title","rel","class","target"],n=(t,n)=>(e[n].each(e=>{t[n]=e.length>0?e:null}),t),o={href:e.href},((e,t)=>{for(let n=0,o=e.length;n{o=n(o,e)}),o;var t,n,o})(n)),a=M(e);i(a)&&a(l),e.undoManager.transact(()=>{n.href===t.href&&t.attach(),r.fold(()=>{((e,t,n,o)=>{const r=e.dom;oe(t)?ce(r,t,o):n.fold(()=>{e.execCommand("mceInsertLink",!1,o);const t=e.selection.getEnd(),n=r.createRng();n.setStartAfter(t),n.setEndAfter(t),e.selection.setRng(n)},t=>{e.insertContent(r.createHTML("a",o,r.encode(t)))})})(e,o,n.text,l)},t=>{e.focus(),((e,t,n,o)=>{n.each(e=>{x(t,"innerText")?t.innerText=e:t.textContent=e}),e.dom.setAttribs(t,o);const r=e.dom.createRng();r.setStartAfter(t),r.setEndAfter(t),e.selection.setRng(r)})(e,t,n.text,l)})})},le=e=>{const{class:t,href:n,rel:o,target:r,text:l,title:s}=e;return(e=>{const t={};var n;return((e,t,n,o)=>{((e,t)=>{const n=v(e);for(let o=0,r=n.length;o{(t(e,r)?n:o)(e,r)})})(e,(e,t)=>!1===a(e),(n=t,(e,t)=>{n[t]=e}),d),t})({class:t.getOrNull(),href:n,rel:o.getOrNull(),target:r.getOrNull(),text:l.getOrNull(),title:s.getOrNull()})},ae=(e,t,n)=>{const o=((e,t)=>{const n=e.options.get,o={allow_html_data_urls:n("allow_html_data_urls"),allow_script_urls:n("allow_script_urls"),allow_svg_data_urls:n("allow_svg_data_urls")},r=t.href;return{...t,href:K.isDomSafe(r,"a",o)?r:""}})(e,n);e.hasPlugin("rtc",!0)?e.execCommand("createlink",!1,le(o)):re(e,t,o)},se=e=>{e.hasPlugin("rtc",!0)?e.execCommand("unlink"):(e=>{e.undoManager.transact(()=>{const t=e.selection.getNode();oe(t)?ie(e,t):(e=>{const t=e.dom,n=e.selection,o=n.getRng().cloneRange(),r=n.getBookmark(),l=t.getParent(o.startContainer,"a[href]",e.getBody()),a=t.getParent(o.endContainer,"a[href]",e.getBody());l&&o.setStartBefore(l),a&&o.setEndAfter(a),n.setRng(o),e.execCommand("unlink"),n.moveToBookmark(r)})(e),e.focus()})})(e)},ie=(e,t)=>{const n=e.dom.select("img",t)[0];if(n){const o=e.dom.getParents(n,"a[href]",t)[0];o&&(o.parentNode?.insertBefore(n,o),e.dom.remove(o))}},ce=(e,t,n)=>{const o=e.select("img",t)[0];if(o){const t=e.create("a",n);o.parentNode?.insertBefore(t,o),t.appendChild(o)}},ue=e=>o(e.value)?e.value:"",de=(e,t)=>{const n=[];return $.each(e,e=>{const r=(e=>o(e.text)?e.text:o(e.title)?e.title:"")(e);if(void 0!==e.menu){const o=de(e.menu,t);n.push({text:r,items:o})}else{const o=t(e);n.push({text:r,value:o})}}),n},ge=(e=ue)=>t=>h.from(t).map(t=>de(t,e)),me=e=>ge(ue)(e),he=ge,pe=(e,t)=>n=>({name:e,type:"listbox",label:t,items:n}),fe=ue,ke=(e,t)=>b(t,t=>(e=>{return x(t=e,n="items")&&void 0!==t[n]&&null!==t[n];var t,n})(t)?ke(e,t.items):C(t.value===e,t)),be=(e,t)=>{const n={text:e.text,title:e.title},o=(e,o)=>{const r=(l=t,a=o,"link"===a?l.link:"anchor"===a?l.anchor:h.none()).getOr([]);var l,a;return((e,t,n,o)=>{const r=o[t],l=e.length>0;return void 0!==r?ke(r,n).map(t=>({url:{value:t.value,meta:{text:l?e:t.text,attach:d}},text:l?e:t.text})):h.none()})(n.text,o,r,e)};return{onChange:(e,t)=>{const r=t.name;return"url"===r?(e=>{const t=(o=e.url,C(n.text.length<=0,h.from(o.meta?.text).getOr(o.value)));var o;const r=(e=>C(n.title.length<=0,h.from(e.meta?.title).getOr("")))(e.url);return t.isSome()||r.isSome()?h.some({...t.map(e=>({text:e})).getOr({}),...r.map(e=>({title:e})).getOr({})}):h.none()})(e()):((e,t)=>p.call(e,t))(["anchor","link"],r)>-1?o(e(),r):"text"===r||"title"===r?(n[r]=e()[r],h.none()):h.none()}}};var ve=tinymce.util.Tools.resolve("tinymce.util.Delay");const ye=e=>{const t=e.href;return t.indexOf("@")>0&&-1===t.indexOf("/")&&-1===t.indexOf("mailto:")?h.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:e=>({...e,href:"mailto:"+t})}):h.none()},xe=(e,t)=>n=>{const o=n.href;return 1===e&&!H(o)||0===e&&/^\s*www(\.|\d\.)/i.test(o)?h.some({message:`The URL you entered seems to be an external link. Do you want to add the required ${t}:// prefix?`,preprocess:e=>({...e,href:t+"://"+o})}):h.none()},_e=e=>{const t=e.dom.select("a:not([href])"),n=k(((e,t)=>{const n=e.length,o=new Array(n);for(let r=0;r{const t=e.name||e.id;return t?[{text:t,value:"#"+t}]:[]}));return n.length>0?h.some([{text:"None",value:""}].concat(n)):h.none()},we=e=>{const t=P(e);return t.length>0?me(t):h.none()},Ce=e=>{try{return h.some(JSON.parse(e))}catch{return h.none()}},Oe=(e,t)=>{const n=L(e);if(n.length>0){const o=_(t,"_blank"),r=e=>W(fe(e),o);return(!1===B(e)?he(r):me)(n)}return h.none()},Ae=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Se=e=>{const t=T(e);return l(t)?me(t).orThunk(()=>h.some(Ae)):!1===t?h.none():h.some(Ae)},Ee=(e,t,n)=>{const o=e.getAttrib(t,n);return null!==o&&o.length>0?h.some(o):h.none()},Ne=(e,t)=>(e=>{const t=t=>e.convertURL(t.value||t.url||"","href"),n=E(e);return new Promise(e=>{o(n)?fetch(n).then(e=>e.ok?e.text().then(Ce):Promise.reject()).then(e,()=>e(h.none())):c(n)?n(t=>e(h.some(t))):e(h.from(n))}).then(e=>e.bind(he(t)).map(e=>e.length>0?[{text:"None",value:""}].concat(e):e))})(e).then(n=>{const o=(e=>i(e.options.get("files_upload_handler")))(e)&&(e=>i(e.options.get("documents_file_types")))(e)&&I(e),r=((e,t)=>{const n=e.dom,o=ne(e)?h.some(Y(e.selection,t)):h.none(),r=t.bind(e=>h.from(n.getAttrib(e,"href"))),l=t.bind(e=>h.from(n.getAttrib(e,"target"))),a=t.bind(e=>Ee(n,e,"rel")),s=t.bind(e=>Ee(n,e,"class"));return{url:r,text:o,title:t.bind(e=>Ee(n,e,"title")),target:l,rel:a,linkClass:s}})(e,t);return{anchor:r,catalogs:{targets:Se(e),rels:Oe(e,r.target),classes:we(e),anchor:_e(e),link:n},hasUploadPanel:o,optNode:t,flags:{titleEnabled:U(e)}}}),Re=(e,t)=>({title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput",buttonLabel:"Browse for a file",dropAreaLabel:"Drop a file here",allowedFileTypes:e.map(e=>e.mimeType).join(","),allowedFileExtensions:k(e.map(e=>e.extensions)),onInvalidFiles:t}]}),Te=e=>(t,n)=>F(e)(t,n),Le=(e,t)=>{const n=t.getData();var o;t.block("Uploading file"),(o=n.fileinput,(e=>0{t.unblock()},n=>{const o=URL.createObjectURL(n),r=()=>{t.unblock(),URL.revokeObjectURL(o)};var l;(l=n,new Promise((e,t)=>{const n=new FileReader;n.onload=()=>{e(n.result)},n.onerror=()=>{t(new Error(n.error?.message??"Failed to convert blob to a data url"))},n.readAsDataURL(l)})).then(t=>{const r=e.getExistingBlobInfo((e=>h.from(e.split(",")[1]).getOr(""))(t),n.type),l=r&&r.filename()===n.name?r:e.createBlobCache(n,o,t);return e.addToBlobCache(l),e.uploadFile(l,g)}).then(e=>{(({url:e,fileName:n})=>{t.setData({text:n,title:n,url:{value:e,meta:{}}}),t.showTab("general"),t.focus("url")})(e),r()}).catch(n=>{r(),e.alertErr(n,()=>{t.focus("fileinput")})})})},Pe=e=>(t,n,o)=>e.editorUpload.blobCache.create({blob:t,blobUri:n,name:t.name?.replace(/\.[^\.]+$/,""),filename:t.name,base64:o.split(",")[1],allowEmptyFile:!0}),Ue=e=>t=>{e.editorUpload.blobCache.add(t)},Be=e=>(t,n)=>e.editorUpload.blobCache.getByData(t,n),De=e=>(t,n)=>{e.windowManager.alert(t,n)},Me=(e,t,n)=>{const o=e.anchor.text.map(()=>({name:"text",type:"input",label:"Text to display"})).toArray(),r=e.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],l=((e,t)=>{const n=e.anchor,o=n.url.getOr("");return{url:{value:o,meta:{original:{value:o}}},text:n.text.getOr(""),title:n.title.getOr(""),anchor:o,link:o,rel:n.rel.getOr(""),target:n.target.or(t).getOr(""),linkClass:n.linkClass.getOr(""),fileinput:[]}})(e,h.from(N(n))),a=e.catalogs,s=be(l,a),i={addToBlobCache:Ue(n),createBlobCache:Pe(n),alertErr:De(n),uploadFile:Te(n),getExistingBlobInfo:Be(n)},c=((e,t,n,o,r,l)=>{const a=k([[{name:"url",type:"urlinput",filetype:"file",label:"URL",picker_text:"Browse links"}],t,n,w([o.anchor.map(pe("anchor","Anchors")),o.rels.map(pe("rel","Rel")),o.targets.map(pe("target","Open link in...")),o.link.map(pe("link","Link list")),o.classes.map(pe("linkClass","Class"))])]);return r?{type:"tabpanel",tabs:k([[{title:"General",name:"general",items:a}],[Re(l,()=>new Promise(e=>i.alertErr("Selected files do not have allowed extensions",e)))]])}:{type:"panel",items:a}})(0,o,r,a,e.hasUploadPanel,j(n));return{title:"Insert/Edit Link",size:"normal",body:c,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:l,onChange:(e,{name:t})=>{"fileinput"===t?Le(i,e):s.onChange(e.getData,{name:t}).each(t=>{e.setData(t)})},onSubmit:t}},Fe=e=>{const t=(e=>{const t=Q(e);return Ne(e,t)})(e);t.then(t=>{const n=((e,t)=>n=>{const o=n.getData();if(!o.url.value)return se(e),void n.close();const r=e=>h.from(o[e]).filter(n=>!_(t.anchor[e],n)),l={href:o.url.value,text:r("text"),target:r("target"),rel:r("rel"),class:r("linkClass"),title:r("title")},a={href:o.url.value,attach:void 0!==o.url.meta&&o.url.meta.attach?o.url.meta.attach:d};((e,t)=>b([ye,xe(A(e),R(e))],e=>e(t)).fold(()=>Promise.resolve(t),n=>new Promise(o=>{((e,t,n)=>{const o=e.selection.getRng();ve.setEditorTimeout(e,()=>{e.windowManager.confirm(t,t=>{e.selection.setRng(o),n(t)})})})(e,n.message,e=>{o(e?n.preprocess(t):t)})})))(e,l).then(t=>{ae(e,a,t)}),n.close()})(e,t);return Me(t,n,e)}).then(t=>{e.windowManager.open(t)})};var Ie=tinymce.util.Tools.resolve("tinymce.util.VK");const je=(e,t)=>{if(t){const o=J(t);if(/^#/.test(o)){const t=e.dom.select(`${o},[name="${n=o,((e,t)=>((e,t)=>""===t||e.length>=t.length&&e.substr(0,0+t.length)===t)(e,t))(n,"#")?(e=>e.substring(1))(n):n}"]`);t.length&&e.selection.scrollIntoView(t[0],!0)}else(e=>{const t=document.createElement("a");t.target="_blank",t.href=e,t.rel="noreferrer noopener";const n=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});document.dispatchEvent(n),((e,t)=>{document.body.appendChild(e),e.dispatchEvent(t),document.body.removeChild(e)})(t,n)})(t.href)}var n},Ke=(e,t)=>{const n=ee(e.dom.getParents(t));return C(1===n.length,n[0])},qe=e=>e.selection.isCollapsed()||(e=>{const t=e.selection.getRng(),n=t.startContainer;return z(n)&&t.startContainer===t.endContainer&&1===e.dom.select("img",n).length})(e)?Ke(e,e.selection.getStart()):(e=>{const t=Z(e.selection.getRng());return C(t.length>0,t[0]).or(Ke(e,e.selection.getNode()))})(e),$e=e=>()=>{e.execCommand("mceLink",!1,{dialog:!0})},Ve=(e,t)=>(e.on("NodeChange",t),()=>e.off("NodeChange",t)),ze=e=>t=>{const n=()=>{t.setActive(!e.mode.isReadOnly()&&X(e,e.selection.getNode())),t.setEnabled(e.selection.isEditable())};return n(),Ve(e,n)},Ge=e=>t=>{const n=()=>{t.setEnabled(e.selection.isEditable())};return n(),Ve(e,n)},He=e=>t=>{const n=e.dom.getParents(e.selection.getStart()),o=n=>{t.setEnabled((t=>{return te(t)||(n=e.selection.getRng(),Z(n).length>0);var n})(n)&&e.selection.isEditable())};return o(n),Ve(e,e=>o(e.parents))},Je=e=>{const t=(e=>{const t=(()=>{const e=(e=>{const t=(e=>{let t=e;return{get:()=>t,set:e=>{t=e}}})(h.none()),n=()=>t.get().each(e);return{clear:()=>{n(),t.set(h.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{n(),t.set(h.some(e))}}})(d);return{...e,on:t=>e.get().each(t)}})(),n=()=>t.get().or(qe(e));return e.on("contextmenu",n=>{Ke(e,n.target).each(t.set)}),e.on("SelectionChange",()=>{t.isSet()||qe(e).each(t.set)}),e.on("click",n=>{t.clear();const o=ee(e.dom.getParents(n.target));1===o.length&&Ie.metaKeyPressed(n)&&(n.preventDefault(),je(e,o[0]))}),e.on("keydown",o=>{t.clear(),!o.isDefaultPrevented()&&13===o.keyCode&&(e=>!0===e.altKey&&!1===e.shiftKey&&!1===e.ctrlKey&&!1===e.metaKey)(o)&&n().each(t=>{o.preventDefault(),je(e,t)})}),{gotoSelectedLink:()=>n().each(t=>je(e,t))}})(e);((e,t)=>{e.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Meta+K",onAction:$e(e),onSetup:ze(e)}),e.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:t.gotoSelectedLink,onSetup:He(e)}),e.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:()=>se(e),onSetup:He(e)})})(e,t),((e,t)=>{e.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:t.gotoSelectedLink,onSetup:He(e)}),e.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:$e(e),onSetup:Ge(e)}),e.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:()=>se(e),onSetup:He(e)})})(e,t),(e=>{e.ui.registry.addContextMenu("link",{update:t=>e.dom.isEditable(t)?te(e.dom.getParents(t,"a"))?"link unlink openlink":"link":""})})(e),((e,t)=>{const n=t=>{const n=e.selection.getNode();return t.setEnabled(X(e,n)&&e.selection.isEditable()),d};e.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:ze(e)},label:"Link",predicate:t=>S(e)&&X(e,t),initValue:()=>Q(e).fold(()=>"",J),commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:t=>{const n=e.selection.getNode();return t.setActive(X(e,n)),ze(e)(t)},onAction:t=>{const n=t.getValue(),o=(t=>{const n=Q(e),o=ne(e);if(n.isNone()&&o){const o=Y(e.selection,n);return C(0===o.length,t)}return h.none()})(n);ae(e,{href:n,attach:d},{href:n,text:o,title:h.none(),rel:h.none(),target:h.from(N(e)),class:h.none()}),(e=>{e.selection.collapse(!1)})(e),t.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:n,onAction:t=>{se(e),t.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:n,onAction:e=>{t.gotoSelectedLink(),e.hide()}}]})})(e,t)};e.add("link",e=>{(e=>{const t=e.options.register;t("link_assume_external_targets",{processor:e=>{const t=o(e)||s(e);return t?!0===e?{value:1,valid:t}:"http"===e||"https"===e?{value:e,valid:t}:{value:0,valid:t}:{valid:!1,message:"Must be a string or a boolean."}},default:!1}),t("link_context_toolbar",{processor:"boolean",default:!1}),t("link_list",{processor:e=>o(e)||c(e)||u(e,r)}),t("link_default_target",{processor:"string"}),t("link_default_protocol",{processor:"string",default:"https"}),t("link_target_list",{processor:e=>s(e)||u(e,r),default:!0}),t("link_rel_list",{processor:"object[]",default:[]}),t("link_class_list",{processor:"object[]",default:[]}),t("link_title",{processor:"boolean",default:!0}),t("allow_unsafe_link_target",{processor:"boolean",default:!1}),t("link_quicklink",{processor:"boolean",default:!1}),t("link_attributes_postprocess",{processor:"function"}),t("files_upload_handler",{processor:"function"}),t("link_uploadtab",{processor:"boolean",default:!0})})(e),(e=>{e.addCommand("mceLink",(t,n)=>{!0!==n?.dialog&&D(e)?e.dispatch("contexttoolbar-show",{toolbarKey:"quicklink"}):Fe(e)})})(e),Je(e),(e=>{e.addShortcut("Meta+K","",()=>{e.execCommand("mceLink")})})(e)})}(); \ No newline at end of file diff --git a/plugins/tinymce/plugins/lists/plugin.min.js b/plugins/tinymce/plugins/lists/plugin.min.js index 4f7b4b64..02293c0f 100644 --- a/plugins/tinymce/plugins/lists/plugin.min.js +++ b/plugins/tinymce/plugins/lists/plugin.min.js @@ -1 +1 @@ -!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=t=>!(t=>null==t)(t),r=t=>"function"==typeof t;const s=(t,e)=>t===e,n=()=>false;class o{tag;value;static singletonNone=new o(!1);constructor(t,e){this.tag=t,this.value=e}static some(t){return new o(!0,t)}static none(){return o.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?o.some(t(this.value)):o.none()}bind(t){return this.tag?t(this.value):o.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:o.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(t??"Called getOrDie on None")}static from(t){return e(t)?o.some(t):o.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}const a=Array.prototype.slice,i=(t,e,r)=>{for(let s=0,n=t.length;st.exists((t=>r(t,e))),u=(c=/^\s+|\s+$/g,t=>t.replace(c,""));var c;const d=t=>{const e=(t=>{const e=a.call(t,0);return e.reverse(),e})(u(t).split("")),r=((t,e)=>{const r=t.length,s=new Array(r);for(let n=0;n{const r=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0)+1;return Math.pow(26,e)*r}));return s=(t,e)=>t+e,n=0,((t,e)=>{for(let r=0,s=t.length;r{n=s(n,t)})),n;var s,n},g=t=>{if(--t<0)return"";{const e=t%26,r=Math.floor(t/26);return g(r)+String.fromCharCode("A".charCodeAt(0)+e)}},m=t=>{const e=parseInt(t.start,10);return l(t.listStyleType,"upper-alpha")?g(e):l(t.listStyleType,"lower-alpha")?g(e).toLowerCase():t.start},h=t=>t.options.get("forced_root_block");const p=t=>r=>e(r)&&t.test(r.nodeName),y=p(/^(OL|UL|DL)$/),v=p(/^(TH|TD)$/),f=p(/^(LI|DT|DD)$/),b=(t,e)=>i(t,y,v).exists((t=>t.nodeName===e&&!(t=>/\btox\-/.test(t.className))(t))),L=(t,e)=>{const r=t.selection.getNode();return e({parents:t.dom.getParents(r),element:r}),t.on("NodeChange",e),()=>t.off("NodeChange",e)},S=(t,e)=>{const r=t.dom.getParent(e,"ol,ul,dl");return((t,e)=>null!==e&&!t.dom.isEditable(e))(t,r)||!t.selection.isEditable()},C=t=>e(t)&&"ol"===t.nodeName.toLowerCase(),A=["OL","UL","DL"],T=A.join(","),N=(t,e)=>{const r=e||t.selection.getStart(!0);return t.dom.getParent(r,T,w(t,r))},w=(t,e)=>{const r=t.dom.getParents(e,t.dom.isBlock),s=(o=e=>(e=>e.nodeName.toLowerCase()!==h(t))(e)&&O(t.schema,e),i(r,o,n));var o;return s.getOr(t.getBody())},O=(t,e)=>!y(e)&&!f(e)&&(r=>{for(let n=0,o=r.length;nr=>(r.setEnabled(t.selection.isEditable()),L(t,(s=>{r.setActive(b(s.parents,e)),r.setEnabled(!S(t,s.element)&&t.selection.isEditable())}))),D=(t,e)=>r=>L(t,(s=>r.setEnabled(b(s.parents,e)&&!S(t,s.element))));t.add("lists",(t=>((t=>{t.addCommand("mceListProps",(()=>{(t=>{const e=N(t);C(e)&&!S(t,e)&&t.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:m({start:t.dom.getAttrib(e,"start","1"),listStyleType:o.from(t.dom.getStyle(e,"list-style-type"))})},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:e=>{(t=>{switch((t=>/^[0-9]+$/.test(t)?2:/^[A-Z]+$/.test(t)?0:/^[a-z]+$/.test(t)?1:t.length>0?4:3)(t)){case 2:return o.some({listStyleType:o.none(),start:t});case 0:return o.some({listStyleType:o.some("upper-alpha"),start:d(t).toString()});case 1:return o.some({listStyleType:o.some("lower-alpha"),start:d(t).toString()});case 3:return o.some({listStyleType:o.none(),start:""});case 4:return o.none()}})(e.getData().start).each((e=>{t.execCommand("mceListUpdate",!1,{attrs:{start:"1"===e.start?"":e.start},styles:{"list-style-type":e.listStyleType.getOr("")}})})),e.close()}})})(t)}))})(t),(t=>{const e=e=>()=>t.execCommand(e);t.hasPlugin("advlist")||(t.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:e("InsertOrderedList"),onSetup:x(t,"OL")}),t.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:e("InsertUnorderedList"),onSetup:x(t,"UL")}))})(t),(t=>{const e={text:"List properties...",icon:"ordered-list",onAction:()=>t.execCommand("mceListProps"),onSetup:D(t,"OL")};t.ui.registry.addMenuItem("listprops",e),t.ui.registry.addContextMenu("lists",{update:e=>{const r=N(t,e);return C(r)?["listprops"]:[]}})})(t),(t=>({backspaceDelete:e=>{t.execCommand("mceListBackspaceDelete",!1,e)}}))(t))))}(); \ No newline at end of file +!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=t=>!(t=>null==t)(t),s=t=>"function"==typeof t;const r=(t,e)=>t===e,n=()=>false;class o{tag;value;static singletonNone=new o(!1);constructor(t,e){this.tag=t,this.value=e}static some(t){return new o(!0,t)}static none(){return o.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?o.some(t(this.value)):o.none()}bind(t){return this.tag?t(this.value):o.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:o.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(t??"Called getOrDie on None")}static from(t){return e(t)?o.some(t):o.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}const a=Array.prototype.slice,i=(t,e,s)=>{for(let r=0,n=t.length;rt.exists(t=>s(t,e)),u=(c=/^\s+|\s+$/g,t=>t.replace(c,""));var c;const d=t=>{const e=(t=>{const e=a.call(t,0);return e.reverse(),e})(u(t).split("")),s=((t,e)=>{const s=t.length,r=new Array(s);for(let n=0;n{const s=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0)+1;return Math.pow(26,e)*s});return r=(t,e)=>t+e,n=0,((t,e)=>{for(let s=0,r=t.length;s{n=r(n,t)}),n;var r,n},g=t=>{if(--t<0)return"";{const e=t%26,s=Math.floor(t/26);return g(s)+String.fromCharCode("A".charCodeAt(0)+e)}},m=t=>{const e=parseInt(t.start,10);return l(t.listStyleType,"upper-alpha")?g(e):l(t.listStyleType,"lower-alpha")?g(e).toLowerCase():t.start},h=t=>t.options.get("forced_root_block");const p=t=>s=>e(s)&&t.test(s.nodeName),y=p(/^(OL|UL|DL)$/),v=p(/^(TH|TD)$/),f=p(/^(LI|DT|DD)$/),b=(t,e)=>i(t,y,v).exists(t=>t.nodeName===e&&!(t=>/\btox\-/.test(t.className))(t)),C=(t,e)=>{const s=t.selection.getNode();return e({parents:t.dom.getParents(s),element:s}),t.on("NodeChange",e),()=>t.off("NodeChange",e)},L=(t,e)=>{const s=t.dom.getParent(e,"ol,ul,dl");return((t,e)=>null!==e&&!t.dom.isEditable(e))(t,s)||!t.selection.isEditable()},S=t=>e(t)&&"ol"===t.nodeName.toLowerCase(),A=["OL","UL","DL"],T=A.join(","),N=(t,e)=>{const s=e||t.selection.getStart(!0);return t.dom.getParent(s,T,w(t,s,t.selection.isCollapsed()))},w=(t,e,s)=>{const r=t.dom.getParents(e,t.dom.isBlock),o=(a=e=>(!s||(e=>e.nodeName.toLowerCase()!==h(t))(e))&&O(t.schema,e),i(r,a,n));var a;return o.getOr(t.getBody())},O=(t,e)=>!y(e)&&!f(e)&&((t,e)=>{for(let s=0,r=t.length;st.isValidChild(e.nodeName,s)),x=(t,e)=>s=>(s.setEnabled(t.selection.isEditable()),C(t,r=>{s.setActive(b(r.parents,e)),s.setEnabled(!L(t,r.element)&&t.selection.isEditable())})),D=(t,e)=>s=>C(t,r=>s.setEnabled(b(r.parents,e)&&!L(t,r.element)));t.add("lists",t=>((t=>{t.addCommand("mceListProps",()=>{(t=>{const e=N(t);S(e)&&!L(t,e)&&t.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:m({start:t.dom.getAttrib(e,"start","1"),listStyleType:o.from(t.dom.getStyle(e,"list-style-type"))})},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:e=>{(t=>{switch((t=>/^[0-9]+$/.test(t)?2:/^[A-Z]+$/.test(t)?0:/^[a-z]+$/.test(t)?1:t.length>0?4:3)(t)){case 2:return o.some({listStyleType:o.none(),start:t});case 0:return o.some({listStyleType:o.some("upper-alpha"),start:d(t).toString()});case 1:return o.some({listStyleType:o.some("lower-alpha"),start:d(t).toString()});case 3:return o.some({listStyleType:o.none(),start:""});case 4:return o.none()}})(e.getData().start).each(e=>{t.execCommand("mceListUpdate",!1,{attrs:{start:"1"===e.start?"":e.start},styles:{"list-style-type":e.listStyleType.getOr("")}})}),e.close()}})})(t)})})(t),(t=>{const e=e=>()=>t.execCommand(e);t.hasPlugin("advlist")||(t.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:e("InsertOrderedList"),onSetup:x(t,"OL")}),t.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:e("InsertUnorderedList"),onSetup:x(t,"UL")}))})(t),(t=>{const e={text:"List properties...",icon:"ordered-list",onAction:()=>t.execCommand("mceListProps"),onSetup:D(t,"OL")};t.ui.registry.addMenuItem("listprops",e),t.ui.registry.addContextMenu("lists",{update:e=>{const s=N(t,e);return S(s)?["listprops"]:[]}})})(t),(t=>({backspaceDelete:e=>{t.execCommand("mceListBackspaceDelete",!1,e)}}))(t)))}(); \ No newline at end of file diff --git a/plugins/tinymce/plugins/media/plugin.min.js b/plugins/tinymce/plugins/media/plugin.min.js index 0e1ce5e7..c2bea5b1 100644 --- a/plugins/tinymce/plugins/media/plugin.min.js +++ b/plugins/tinymce/plugins/media/plugin.min.js @@ -1 +1 @@ -!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(r=o=e,(a=String).prototype.isPrototypeOf(r)||o.constructor?.name===a.name)?"string":t;var r,o,a})(t)===e,r=t("string"),o=t("object"),a=t("array"),s=e=>!(e=>null==e)(e),i=e=>"function"==typeof e;class n{tag;value;static singletonNone=new n(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new n(!0,e)}static none(){return n.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?n.some(e(this.value)):n.none()}bind(e){return this.tag?e(this.value):n.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:n.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(e??"Called getOrDie on None")}static from(e){return s(e)?n.some(e):n.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Array.prototype.slice;const c=Array.prototype.push,l=(e,t)=>{for(let r=0,o=e.length;r{const t=[];for(let r=0,o=e.length;rp(e,t)?n.from(e[t]):n.none(),p=(e,t)=>d.call(e,t),g=e=>t=>t.options.get(e),b=g("audio_template_callback"),w=g("video_template_callback"),f=g("iframe_template_callback"),y=g("media_live_embeds"),v=g("media_filter_html"),x=g("media_url_resolver"),_=g("media_alt_source"),k=g("media_poster"),j=g("media_dimensions");var A=tinymce.util.Tools.resolve("tinymce.util.Tools"),O=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),S=tinymce.util.Tools.resolve("tinymce.html.DomParser");const $=O.DOM,C=e=>e.replace(/px$/,""),T=e=>{const t=e.attr("style"),r=t?$.parseStyle(t):{};return{type:"ephox-embed-iri",source:e.attr("data-ephox-embed-iri"),altsource:"",poster:"",width:h(r,"max-width").map(C).getOr(""),height:h(r,"max-height").map(C).getOr("")}},z=(e,t)=>{let r={};for(let o=S({validate:!1,forced_root_block:!1},t).parse(e);o;o=o.walk())if(1===o.type){const e=o.name;if(o.attr("data-ephox-embed-iri")){r=T(o);break}r.source||"param"!==e||(r.source=o.attr("movie")),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(r.type||(r.type=e),r=A.extend(o.attributes.map,r)),"source"===e&&(r.source?r.altsource||(r.altsource=o.attr("src")):r.source=o.attr("src")),"img"!==e||r.poster||(r.poster=o.attr("src"))}return r.source=r.source||r.src||"",r.altsource=r.altsource||"",r.poster=r.poster||"",r},D=e=>{const t=e.toLowerCase().split(".").pop()??"";return h({mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"},t).getOr("")};var F=tinymce.util.Tools.resolve("tinymce.html.Node"),M=tinymce.util.Tools.resolve("tinymce.html.Serializer");const N=(e,t={})=>S({forced_root_block:!1,validate:!1,allow_conditional_comments:!0,...t},e),P=O.DOM,R=e=>/^[0-9.]+$/.test(e)?e+"px":e,E=(e,t)=>{const r=t.attr("style"),o=r?P.parseStyle(r):{};s(e.width)&&(o["max-width"]=R(e.width)),s(e.height)&&(o["max-height"]=R(e.height)),t.attr("style",P.serializeStyle(o))},U=["source","altsource"],L=(e,t,r,o)=>{let a=0,s=0;const i=N(o);i.addNodeFilter("source",(e=>a=e.length));const n=i.parse(e);for(let e=n;e;e=e.walk())if(1===e.type){const o=e.name;if(e.attr("data-ephox-embed-iri")){E(t,e);break}switch(o){case"video":case"object":case"embed":case"img":case"iframe":void 0!==t.height&&void 0!==t.width&&(e.attr("width",t.width),e.attr("height",t.height))}if(r)switch(o){case"video":e.attr("poster",t.poster),e.attr("src",null);for(let r=a;r<2;r++)if(t[U[r]]){const o=new F("source",1);o.attr("src",t[U[r]]),o.attr("type",t[U[r]+"mime"]||null),e.append(o)}break;case"iframe":e.attr("src",t.source);break;case"object":const r=e.getAll("img").length>0;if(t.poster&&!r){e.attr("src",t.poster);const r=new F("img",1);r.attr("src",t.poster),r.attr("width",t.width),r.attr("height",t.height),e.append(r)}break;case"source":if(s<2&&(e.attr("src",t[U[s]]),e.attr("type",t[U[s]+"mime"]||null),!t[U[s]])){e.remove();continue}s++;break;case"img":t.poster||e.remove()}}return M({},o).serialize(n)},I=[{regex:/youtu\.be\/([\w\-_\?&=.]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$2?$4",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)\?h=(\w+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?h=$2&title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)\?h=(\w+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?h=$3&title=0&byline=0",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?title=0&byline=0",allowFullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0},{regex:/dai\.ly\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],B=(e,t)=>{const r=(e=>{const t=e.match(/^(https?:\/\/|www\.)(.+)$/i);return t&&t.length>1?"www."===t[1]?"https://":t[1]:"https://"})(t),o=e.regex.exec(t);let a=r+e.url;if(s(o))for(let e=0;eo[e]?o[e]:""));return a.replace(/\?$/,"")},G=e=>{const t=I.filter((t=>t.regex.test(e)));return t.length>0?A.extend({},t[0],{url:B(t[0],e)}):null},W=(e,t)=>{const r=A.extend({},t);if(!r.source&&(A.extend(r,z(r.embed??"",e.schema)),!r.source))return"";r.altsource||(r.altsource=""),r.poster||(r.poster=""),r.source=e.convertURL(r.source,"source"),r.altsource=e.convertURL(r.altsource,"source"),r.sourcemime=D(r.source),r.altsourcemime=D(r.altsource),r.poster=e.convertURL(r.poster,"poster");const o=G(r.source);if(o&&(r.source=o.url,r.type=o.type,r.allowfullscreen=o.allowFullscreen,r.width=r.width||String(o.w),r.height=r.height||String(o.h)),r.embed)return L(r.embed,r,!0,e.schema);{const t=b(e),o=w(e),a=f(e);return r.width=r.width||"300",r.height=r.height||"150",A.each(r,((t,o)=>{r[o]=e.dom.encode(""+t)})),"iframe"===r.type?((e,t)=>{if(t)return t(e);{const t=e.allowfullscreen?' allowFullscreen="1"':"";return'"}})(r,a):"application/x-shockwave-flash"===r.sourcemime?(e=>{let t='';return e.poster&&(t+=''),t+="",t})(r):-1!==r.sourcemime.indexOf("audio")?((e,t)=>t?t(e):'")(r,t):((e,t)=>t?t(e):'")(r,o)}},q=e=>e.hasAttribute("data-mce-object")||e.hasAttribute("data-ephox-embed-iri"),H={},J=e=>t=>W(e,t),K=(e,t)=>{const r=x(e);return r?((e,t,r)=>new Promise(((o,a)=>{const s=r=>(r.html&&(H[e.source]=r),o({url:e.source,html:r.html?r.html:t(e)}));H[e.source]?s(H[e.source]):r({url:e.source}).then(s).catch(a)})))(t,J(e),r):((e,t)=>Promise.resolve({html:t(e),url:e.source}))(t,J(e))},Q=(e,t)=>{const r={};return h(e,"dimensions").each((e=>{l(["width","height"],(o=>{h(t,o).orThunk((()=>h(e,o))).each((e=>r[o]=e))}))})),r},V=(e,t)=>{const r=t&&"dimensions"!==t?((e,t)=>h(t,e).bind((e=>h(e,"meta"))))(t,e).getOr({}):{},a=((e,t,r)=>a=>{const s=()=>h(e,a),i=()=>h(t,a),c=e=>h(e,"value").bind((e=>e.length>0?n.some(e):n.none()));return{[a]:(a===r?s().bind((e=>o(e)?c(e).orThunk(i):i().orThunk((()=>n.from(e))))):i().orThunk((()=>s().bind((e=>o(e)?c(e):n.from(e)))))).getOr("")}})(e,r,t);return{...a("source"),...a("altsource"),...a("poster"),...a("embed"),...Q(e,r)}},X=e=>{const t={...e,source:{value:h(e,"source").getOr("")},altsource:{value:h(e,"altsource").getOr("")},poster:{value:h(e,"poster").getOr("")}};return l(["width","height"],(r=>{h(e,r).each((e=>{const o=t.dimensions||{};o[r]=e,t.dimensions=o}))})),t},Y=e=>t=>{const r=t&&t.msg?"Media embed handler error: "+t.msg:"Media embed handler threw unknown error.";e.notificationManager.open({type:"error",text:r})},Z=(e,t)=>o=>{if(r(o.url)&&o.url.trim().length>0){const r=o.html,a={...z(r,t.schema),source:o.url,embed:r};e.setData(X(a))}},ee=(e,t)=>{const r=e.dom.select("*[data-mce-object]");e.insertContent(t),((e,t)=>{const r=e.dom.select("*[data-mce-object]");for(let e=0;e=0;o--)t[e]===r[o]&&r.splice(o,1);e.selection.select(r[0])})(e,r),e.nodeChanged()},te=(e,t)=>s(t)&&"ephox-embed-iri"===t&&s(G(e)),re=(e,t)=>((e,t)=>e.width!==t.width||e.height!==t.height)(e,t)&&te(t.source,e.type),oe=e=>{const t=(e=>{const t=e.selection.getNode(),r=q(t)?e.serializer.serialize(t,{selection:!0}):"",o=z(r,e.schema),a=(()=>{if(te(o.source,o.type)){const r=e.dom.getRect(t);return{width:r.w.toString().replace(/px$/,""),height:r.h.toString().replace(/px$/,"")}}return{}})();return{embed:r,...o,...a}})(e),r=(e=>{let t=e;return{get:()=>t,set:e=>{t=e}}})(t),o=X(t),a=j(e)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],s={title:"General",name:"general",items:m([[{name:"source",type:"urlinput",filetype:"media",label:"Source",picker_text:"Browse files"}],a])},i=[];_(e)&&i.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),k(e)&&i.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});const n={title:"Advanced",name:"advanced",items:i},c=[s,{title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]}];i.length>0&&c.push(n);const l={type:"tabpanel",tabs:c},u=e.windowManager.open({title:"Insert/Edit Media",size:"normal",body:l,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:t=>{const o=V(t.getData());((e,t,r)=>{var o;t.embed=re(e,t)&&j(r)?W(r,{...t,embed:""}):L(t.embed??"",t,!1,r.schema),t.embed&&(e.source===t.source||(o=t.source,p(H,o)))?ee(r,t.embed):K(r,t).then((e=>{ee(r,e.html)})).catch(Y(r))})(r.get(),o,e),t.close()},onChange:(t,o)=>{switch(o.name){case"source":((t,r)=>{const o=V(r.getData(),"source");t.source!==o.source&&(Z(u,e)({url:o.source,html:""}),K(e,o).then(Z(u,e)).catch(Y(e)))})(r.get(),t);break;case"embed":(t=>{const r=V(t.getData()),o=z(r.embed??"",e.schema);t.setData(X(o))})(t);break;case"dimensions":case"altsource":case"poster":((t,r,o)=>{const a=V(t.getData(),r),s=re(o,a)&&j(e)?{...a,embed:""}:a,i=W(e,s);t.setData(X({...s,embed:i}))})(t,o.name,r.get())}r.set(V(t.getData()))},initialData:o})};var ae=tinymce.util.Tools.resolve("tinymce.Env");const se=e=>{const t=e.name;return"iframe"===t||"video"===t||"audio"===t},ie=(e,t,r,o=null)=>{const a=e.attr(r);return s(a)?a:p(t,r)?null:o},ne=(e,t,r)=>{const o="img"===t.name||"video"===e.name,a=o?"300":null,s="audio"===e.name?"30":"150",i=o?s:null;t.attr({width:ie(e,r,"width",a),height:ie(e,r,"height",i)})},ce=(e,t)=>{const r=t.name,o=new F("img",1);return me(e,t,o),ne(t,o,{}),o.attr({style:t.attr("style"),src:ae.transparentSrc,"data-mce-object":r,class:"mce-object mce-object-"+r}),o},le=(e,t)=>{const r=t.name,o=new F("span",1);o.attr({contentEditable:"false",style:t.attr("style"),"data-mce-object":r,class:"mce-preview-object mce-object-"+r}),me(e,t,o);const a=e.dom.parseStyle(t.attr("style")??""),i=new F(r,1);if(ne(t,i,a),i.attr({src:t.attr("src"),style:t.attr("style"),class:t.attr("class")}),"iframe"===r)i.attr({allowfullscreen:t.attr("allowfullscreen"),frameborder:"0",sandbox:t.attr("sandbox"),referrerpolicy:t.attr("referrerpolicy")});else{l(["controls","crossorigin","currentTime","loop","muted","poster","preload"],(e=>{i.attr(e,t.attr(e))}));const a=o.attr("data-mce-html");s(a)&&((e,t,r,o)=>{const a=N(e.schema).parse(o,{context:t});for(;a.firstChild;)r.append(a.firstChild)})(e,r,i,unescape(a))}const n=new F("span",1);return n.attr("class","mce-shim"),o.append(i),o.append(n),o},me=(e,t,r)=>{const o=t.attributes??[];let a=o.length;for(;a--;){const t=o[a].name;let n=o[a].value;"width"===t||"height"===t||"style"===t||(i="data-mce-",(s=t).length>=9&&s.substr(0,9)===i)||("data"!==t&&"src"!==t||(n=e.convertURL(n,t)),r.attr("data-mce-p-"+t,n))}var s,i;const n=M({inner:!0},e.schema),c=new F("div",1);l(t.children(),(e=>c.append(e)));const m=n.serialize(c);m&&(r.attr("data-mce-html",escape(m)),r.empty())},ue=e=>{const t=e.attr("class");return r(t)&&/\btiny-pageembed\b/.test(t)},de=e=>{let t=e;for(;t=t.parent;)if(t.attr("data-ephox-embed-iri")||ue(t))return!0;return!1},he=(e,t,r)=>{const o=(0,e.options.get)("xss_sanitization"),a=v(e);return N(e.schema,{sanitize:o,validate:a}).parse(r,{context:t})},pe=e=>t=>{const r=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",r),r(),()=>{e.off("NodeChange",r)}};e.add("media",(e=>((e=>{const t=e.options.register;t("audio_template_callback",{processor:"function"}),t("video_template_callback",{processor:"function"}),t("iframe_template_callback",{processor:"function"}),t("media_live_embeds",{processor:"boolean",default:!0}),t("media_filter_html",{processor:"boolean",default:!0}),t("media_url_resolver",{processor:"function"}),t("media_alt_source",{processor:"boolean",default:!0}),t("media_poster",{processor:"boolean",default:!0}),t("media_dimensions",{processor:"boolean",default:!0})})(e),(e=>{e.addCommand("mceMedia",(()=>{oe(e)}))})(e),(e=>{const t=()=>e.execCommand("mceMedia");e.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:t,onSetup:t=>{const r=e.selection;t.setActive(q(r.getNode()));const o=r.selectorChangedWithUnbind("img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]",t.setActive).unbind,a=pe(e)(t);return()=>{o(),a()}}}),e.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:t,onSetup:pe(e)})})(e),(e=>{e.on("ResolveName",(e=>{let t;1===e.target.nodeType&&(t=e.target.getAttribute("data-mce-object"))&&(e.name=t)}))})(e),(e=>{e.on("PreInit",(()=>{const{schema:t,serializer:r,parser:o}=e,a=t.getBoolAttrs();l("webkitallowfullscreen mozallowfullscreen".split(" "),(e=>{a[e]={}})),((e,t)=>{const r=u(e);for(let o=0,a=r.length;o{const o=t.getElementRule(r);o&&l(e,(e=>{o.attributes[e]={},o.attributesOrder.push(e)}))})),o.addNodeFilter("iframe,video,audio,object,embed",(e=>t=>{let r,o=t.length;for(;o--;)r=t[o],r.parent&&(r.parent.attr("data-mce-object")||(se(r)&&y(e)?de(r)||r.replace(le(e,r)):de(r)||r.replace(ce(e,r))))})(e)),r.addAttributeFilter("data-mce-object",((t,r)=>{let o=t.length;for(;o--;){const a=t[o];if(!a.parent)continue;const s=a.attr(r),i=new F(s,1);if("audio"!==s){const e=a.attr("class");e&&-1!==e.indexOf("mce-preview-object")&&a.firstChild?i.attr({width:a.firstChild.attr("width"),height:a.firstChild.attr("height")}):i.attr({width:a.attr("width"),height:a.attr("height")})}i.attr({style:a.attr("style")});const n=a.attributes??[];let c=n.length;for(;c--;){const e=n[c].name;0===e.indexOf("data-mce-p-")&&i.attr(e.substr(11),n[c].value)}const m=a.attr("data-mce-html");if(m){const t=he(e,s,unescape(m));l(t.children(),(e=>i.append(e)))}a.replace(i)}}))})),e.on("SetContent",(()=>{const t=e.dom;l(t.select("span.mce-preview-object"),(e=>{0===t.select("span.mce-shim",e).length&&t.add(e,"span",{class:"mce-shim"})}))}))})(e),(e=>{e.on("mousedown",(t=>{const r=e.dom.getParent(t.target,".mce-preview-object");r&&"2"===e.dom.getAttrib(r,"data-mce-selected")&&t.stopImmediatePropagation()})),e.on("click keyup touchend",(()=>{const t=e.selection.getNode();t&&e.dom.hasClass(t,"mce-preview-object")&&e.dom.getAttrib(t,"data-mce-selected")&&t.setAttribute("data-mce-selected","2")})),e.on("ObjectResized",(t=>{const r=t.target;if(r.getAttribute("data-mce-object")){let o=r.getAttribute("data-mce-html");o&&(o=unescape(o),r.setAttribute("data-mce-html",escape(L(o,{width:String(t.width),height:String(t.height)},!1,e.schema))))}}))})(e),(e=>({showDialog:()=>{oe(e)}}))(e))))}(); \ No newline at end of file +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(r=o=e,(a=String).prototype.isPrototypeOf(r)||o.constructor?.name===a.name)?"string":t;var r,o,a})(t)===e,r=t("string"),o=t("object"),a=t("array"),s=e=>!(e=>null==e)(e),i=e=>"function"==typeof e;class n{tag;value;static singletonNone=new n(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new n(!0,e)}static none(){return n.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?n.some(e(this.value)):n.none()}bind(e){return this.tag?e(this.value):n.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:n.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(e??"Called getOrDie on None")}static from(e){return s(e)?n.some(e):n.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Array.prototype.slice;const c=Array.prototype.push,l=(e,t)=>{for(let r=0,o=e.length;r{const t=[];for(let r=0,o=e.length;rp(e,t)?n.from(e[t]):n.none(),p=(e,t)=>d.call(e,t),g=(e,t)=>((e,t)=>""===t||e.length>=t.length&&e.substr(0,0+t.length)===t)(e,t),b=e=>t=>t.options.get(e),w=b("audio_template_callback"),f=b("video_template_callback"),y=b("iframe_template_callback"),v=b("media_live_embeds"),x=b("media_filter_html"),_=b("media_url_resolver"),k=b("media_alt_source"),j=b("media_poster"),A=b("media_dimensions");var O=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),$=tinymce.util.Tools.resolve("tinymce.html.DomParser");const C=S.DOM,T=e=>e.replace(/px$/,""),z=e=>{const t=e.attr("style"),r=t?C.parseStyle(t):{};return{type:"ephox-embed-iri",source:e.attr("data-ephox-embed-iri"),altsource:"",poster:"",width:h(r,"max-width").map(T).getOr(""),height:h(r,"max-height").map(T).getOr("")}},D=(e,t)=>{let r={};for(let o=$({validate:!1,forced_root_block:!1},t).parse(e);o;o=o.walk())if(1===o.type){const e=o.name;if(o.attr("data-ephox-embed-iri")){r=z(o);break}r.source||"param"!==e||(r.source=o.attr("movie")),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(r.type||(r.type=e),r=O.extend(o.attributes.map,r)),"source"===e&&(r.source?r.altsource||(r.altsource=o.attr("src")):r.source=o.attr("src")),"img"!==e||r.poster||(r.poster=o.attr("src"))}return r.source=r.source||r.src||"",r.altsource=r.altsource||"",r.poster=r.poster||"",r},F=e=>{const t=e.toLowerCase().split(".").pop()??"";return h({mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"},t).getOr("")};var M=tinymce.util.Tools.resolve("tinymce.html.Node"),N=tinymce.util.Tools.resolve("tinymce.html.Serializer");const P=(e,t={})=>$({forced_root_block:!1,validate:!1,allow_conditional_comments:!0,...t},e),R=S.DOM,E=e=>/^[0-9.]+$/.test(e)?e+"px":e,U=(e,t)=>{const r=t.attr("style"),o=r?R.parseStyle(r):{};s(e.width)&&(o["max-width"]=E(e.width)),s(e.height)&&(o["max-height"]=E(e.height)),t.attr("style",R.serializeStyle(o))},L=["source","altsource"],I=(e,t,r,o)=>{let a=0,s=0;const i=P(o);i.addNodeFilter("source",e=>a=e.length);const n=i.parse(e);for(let e=n;e;e=e.walk())if(1===e.type){const o=e.name;if(e.attr("data-ephox-embed-iri")){U(t,e);break}switch(o){case"video":case"object":case"embed":case"img":case"iframe":void 0!==t.height&&void 0!==t.width&&(e.attr("width",t.width),e.attr("height",t.height))}if(r)switch(o){case"video":e.attr("poster",t.poster),e.attr("src",null);for(let r=a;r<2;r++)if(t[L[r]]){const o=new M("source",1);o.attr("src",t[L[r]]),o.attr("type",t[L[r]+"mime"]||null),e.append(o)}break;case"iframe":e.attr("src",t.source);break;case"object":const r=e.getAll("img").length>0;if(t.poster&&!r){e.attr("src",t.poster);const r=new M("img",1);r.attr("src",t.poster),r.attr("width",t.width),r.attr("height",t.height),e.append(r)}break;case"source":if(s<2&&(e.attr("src",t[L[s]]),e.attr("type",t[L[s]+"mime"]||null),!t[L[s]])){e.remove();continue}s++;break;case"img":t.poster||e.remove()}}return N({},o).serialize(n)},B=[{regex:/youtu\.be\/([\w\-_\?&=.]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$2?$4",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)\?h=(\w+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?h=$2&title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)\?h=(\w+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?h=$3&title=0&byline=0",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?title=0&byline=0",allowFullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0},{regex:/dai\.ly\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],G=(e,t)=>{const r=(e=>{const t=e.match(/^(https?:\/\/|www\.)(.+)$/i);return t&&t.length>1?"www."===t[1]?"https://":t[1]:"https://"})(t),o=e.regex.exec(t);let a=r+e.url;if(s(o))for(let e=0;eo[e]?o[e]:"");return a.replace(/\?$/,"")},W=e=>{const t=B.filter(t=>t.regex.test(e));return t.length>0?O.extend({},t[0],{url:G(t[0],e)}):null},q=(e,t)=>{const r=O.extend({},t);if(!r.source&&(O.extend(r,D(r.embed??"",e.schema)),!r.source))return"";r.altsource||(r.altsource=""),r.poster||(r.poster=""),r.source=e.convertURL(r.source,"source"),r.altsource=e.convertURL(r.altsource,"source"),r.sourcemime=F(r.source),r.altsourcemime=F(r.altsource),r.poster=e.convertURL(r.poster,"poster");const o=W(r.source);if(o&&(r.source=o.url,r.type=o.type,r.allowfullscreen=o.allowFullscreen,r.width=r.width||String(o.w),r.height=r.height||String(o.h)),r.embed)return I(r.embed,r,!0,e.schema);{const t=w(e),o=f(e),a=y(e);return r.width=r.width||"300",r.height=r.height||"150",O.each(r,(t,o)=>{r[o]=e.dom.encode(""+t)}),"iframe"===r.type?((e,t)=>{if(t)return t(e);{const t=e.allowfullscreen?' allowFullscreen="1"':"";return'"}})(r,a):"application/x-shockwave-flash"===r.sourcemime?(e=>{let t='';return e.poster&&(t+=''),t+="",t})(r):-1!==r.sourcemime.indexOf("audio")?((e,t)=>t?t(e):'")(r,t):((e,t)=>t?t(e):'")(r,o)}},H=e=>e.hasAttribute("data-mce-object")||e.hasAttribute("data-ephox-embed-iri"),J={},K=e=>t=>q(e,t),Q=(e,t)=>{const r=_(e);return r?((e,t,r)=>new Promise((o,a)=>{const s=r=>(r.html&&(J[e.source]=r),o({url:e.source,html:r.html?r.html:t(e)}));J[e.source]?s(J[e.source]):r({url:e.source}).then(s).catch(a)}))(t,K(e),r):((e,t)=>Promise.resolve({html:t(e),url:e.source}))(t,K(e))},V=(e,t)=>{const r={};return h(e,"dimensions").each(e=>{l(["width","height"],o=>{h(t,o).orThunk(()=>h(e,o)).each(e=>r[o]=e)})}),r},X=(e,t)=>{const r=t&&"dimensions"!==t?((e,t)=>h(t,e).bind(e=>h(e,"meta")))(t,e).getOr({}):{},a=((e,t,r)=>a=>{const s=()=>h(e,a),i=()=>h(t,a),c=e=>h(e,"value").bind(e=>e.length>0?n.some(e):n.none());return{[a]:(a===r?s().bind(e=>o(e)?c(e).orThunk(i):i().orThunk(()=>n.from(e))):i().orThunk(()=>s().bind(e=>o(e)?c(e):n.from(e)))).getOr("")}})(e,r,t);return{...a("source"),...a("altsource"),...a("poster"),...a("embed"),...V(e,r)}},Y=e=>{const t={...e,source:{value:h(e,"source").getOr("")},altsource:{value:h(e,"altsource").getOr("")},poster:{value:h(e,"poster").getOr("")}};return l(["width","height"],r=>{h(e,r).each(e=>{const o=t.dimensions||{};o[r]=e,t.dimensions=o})}),t},Z=e=>t=>{const r=t&&t.msg?"Media embed handler error: "+t.msg:"Media embed handler threw unknown error.";e.notificationManager.open({type:"error",text:r})},ee=(e,t)=>o=>{if(r(o.url)&&o.url.trim().length>0){const r=o.html,a={...D(r,t.schema),source:o.url,embed:r};e.setData(Y(a))}},te=(e,t)=>{const r=e.dom.select("*[data-mce-object]");e.insertContent(t),((e,t)=>{const r=e.dom.select("*[data-mce-object]");for(let e=0;e=0;o--)t[e]===r[o]&&r.splice(o,1);e.selection.select(r[0])})(e,r),e.nodeChanged()},re=(e,t)=>s(t)&&"ephox-embed-iri"===t&&s(W(e)),oe=(e,t)=>((e,t)=>e.width!==t.width||e.height!==t.height)(e,t)&&re(t.source,e.type),ae=e=>{const t=(e=>{const t=e.selection.getNode(),r=H(t)?e.serializer.serialize(t,{selection:!0}):"",o=D(r,e.schema),a=(()=>{if(re(o.source,o.type)){const r=e.dom.getRect(t);return{width:r.w.toString().replace(/px$/,""),height:r.h.toString().replace(/px$/,"")}}return{}})();return{embed:r,...o,...a}})(e),r=(e=>{let t=e;return{get:()=>t,set:e=>{t=e}}})(t),o=Y(t),a=A(e)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],s={title:"General",name:"general",items:m([[{name:"source",type:"urlinput",filetype:"media",label:"Source",picker_text:"Browse files"}],a])},i=[];k(e)&&i.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),j(e)&&i.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});const n={title:"Advanced",name:"advanced",items:i},c=[s,{title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]}];i.length>0&&c.push(n);const l={type:"tabpanel",tabs:c},u=e.windowManager.open({title:"Insert/Edit Media",size:"normal",body:l,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:t=>{const o=X(t.getData());((e,t,r)=>{var o;t.embed=oe(e,t)&&A(r)?q(r,{...t,embed:""}):I(t.embed??"",t,!1,r.schema),t.embed&&(e.source===t.source||(o=t.source,p(J,o)))?te(r,t.embed):Q(r,t).then(e=>{te(r,e.html)}).catch(Z(r))})(r.get(),o,e),t.close()},onChange:(t,o)=>{switch(o.name){case"source":((t,r)=>{const o=X(r.getData(),"source");t.source!==o.source&&(ee(u,e)({url:o.source,html:""}),Q(e,o).then(ee(u,e)).catch(Z(e)))})(r.get(),t);break;case"embed":(t=>{const r=X(t.getData()),o=D(r.embed??"",e.schema);t.setData(Y(o))})(t);break;case"dimensions":case"altsource":case"poster":((t,r,o)=>{const a=X(t.getData(),r),s=oe(o,a)&&A(e)?{...a,embed:""}:a,i=q(e,s);t.setData(Y({...s,embed:i}))})(t,o.name,r.get())}r.set(X(t.getData()))},initialData:o})};var se=tinymce.util.Tools.resolve("tinymce.Env");const ie=e=>{const t=e.name;return"iframe"===t||"video"===t||"audio"===t},ne=(e,t,r,o=null)=>{const a=e.attr(r);return s(a)?a:p(t,r)?null:o},ce=(e,t,r)=>{const o="img"===t.name||"video"===e.name,a=o?"300":null,s="audio"===e.name?"30":"150",i=o?s:null;t.attr({width:ne(e,r,"width",a),height:ne(e,r,"height",i)})},le=(e,t)=>{const r=t.name,o=new M("img",1);return ue(e,t,o),ce(t,o,{}),o.attr({style:t.attr("style"),src:se.transparentSrc,"data-mce-object":r,class:"mce-object mce-object-"+r}),o},me=(e,t)=>{const r=t.name,o=new M("span",1);o.attr({contentEditable:"false",style:t.attr("style"),"data-mce-object":r,class:"mce-preview-object mce-object-"+r}),ue(e,t,o);const a=e.dom.parseStyle(t.attr("style")??""),i=new M(r,1);if(ce(t,i,a),i.attr({src:t.attr("src"),style:t.attr("style"),class:t.attr("class")}),"iframe"===r)i.attr({allowfullscreen:t.attr("allowfullscreen"),frameborder:"0",sandbox:t.attr("sandbox"),referrerpolicy:t.attr("referrerpolicy")});else{l(["controls","crossorigin","currentTime","loop","muted","poster","preload"],e=>{i.attr(e,t.attr(e))});const a=o.attr("data-mce-html");s(a)&&((e,t,r,o)=>{const a=P(e.schema).parse(o,{context:t});for(;a.firstChild;)r.append(a.firstChild)})(e,r,i,unescape(a))}const n=new M("span",1);return n.attr("class","mce-shim"),o.append(i),o.append(n),o},ue=(e,t,r)=>{const o=t.attributes??[];let a=o.length;for(;a--;){const t=o[a].name;let s=o[a].value;"width"===t||"height"===t||"style"===t||g(t,"data-mce-")||("data"!==t&&"src"!==t||(s=e.convertURL(s,t)),r.attr("data-mce-p-"+t,s))}const s=N({inner:!0},e.schema),i=new M("div",1);l(t.children(),e=>i.append(e));const n=s.serialize(i);n&&(r.attr("data-mce-html",escape(n)),r.empty())},de=e=>{const t=e.attr("class");return r(t)&&/\btiny-pageembed\b/.test(t)},he=e=>{let t=e;for(;t=t.parent;)if(t.attr("data-ephox-embed-iri")||de(t))return!0;return!1},pe=(e,t,r)=>{const o=(0,e.options.get)("xss_sanitization"),a=x(e);return P(e.schema,{sanitize:o,validate:a}).parse(r,{context:t})},ge=e=>t=>{const r=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",r),r(),()=>{e.off("NodeChange",r)}};e.add("media",e=>((e=>{const t=e.options.register;t("audio_template_callback",{processor:"function"}),t("video_template_callback",{processor:"function"}),t("iframe_template_callback",{processor:"function"}),t("media_live_embeds",{processor:"boolean",default:!0}),t("media_filter_html",{processor:"boolean",default:!0}),t("media_url_resolver",{processor:"function"}),t("media_alt_source",{processor:"boolean",default:!0}),t("media_poster",{processor:"boolean",default:!0}),t("media_dimensions",{processor:"boolean",default:!0})})(e),(e=>{e.addCommand("mceMedia",()=>{ae(e)})})(e),(e=>{const t=()=>e.execCommand("mceMedia");e.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:t,onSetup:t=>{const r=e.selection;t.setActive(H(r.getNode()));const o=r.selectorChangedWithUnbind("img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]",t.setActive).unbind,a=ge(e)(t);return()=>{o(),a()}}}),e.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:t,onSetup:ge(e)})})(e),(e=>{e.on("ResolveName",e=>{let t;1===e.target.nodeType&&(t=e.target.getAttribute("data-mce-object"))&&(e.name=t)})})(e),(e=>{e.on("PreInit",()=>{const{schema:t,serializer:r,parser:o}=e,a=t.getBoolAttrs();l("webkitallowfullscreen mozallowfullscreen".split(" "),e=>{a[e]={}}),((e,t)=>{const r=u(e);for(let o=0,a=r.length;o{const o=t.getElementRule(r);o&&l(e,e=>{o.attributes[e]={},o.attributesOrder.push(e)})}),o.addNodeFilter("iframe,video,audio,object,embed",(e=>t=>{let r,o=t.length;for(;o--;)r=t[o],r.parent&&(r.parent.attr("data-mce-object")||(ie(r)&&v(e)?he(r)||r.replace(me(e,r)):he(r)||r.replace(le(e,r))))})(e)),r.addAttributeFilter("data-mce-object",(t,r)=>{let o=t.length;for(;o--;){const a=t[o];if(!a.parent)continue;const s=a.attr(r),i=new M(s,1);if("audio"!==s){const e=a.attr("class");e&&-1!==e.indexOf("mce-preview-object")&&a.firstChild?i.attr({width:a.firstChild.attr("width"),height:a.firstChild.attr("height")}):i.attr({width:a.attr("width"),height:a.attr("height")})}i.attr({style:a.attr("style")});const n=a.attributes??[];let c=n.length;for(;c--;){const e=n[c].name;0===e.indexOf("data-mce-p-")&&i.attr(e.substr(11),n[c].value)}const m=a.attr("data-mce-html");if(m){const t=pe(e,s,unescape(m));l(t.children(),e=>i.append(e))}a.replace(i)}})}),e.on("SetContent",()=>{const t=e.dom;l(t.select("span.mce-preview-object"),e=>{0===t.select("span.mce-shim",e).length&&t.add(e,"span",{class:"mce-shim"})})})})(e),(e=>{e.on("mousedown",t=>{const r=e.dom.getParent(t.target,".mce-preview-object");r&&"2"===e.dom.getAttrib(r,"data-mce-selected")&&t.stopImmediatePropagation()}),e.on("click keyup touchend",()=>{const t=e.selection.getNode();t&&e.dom.hasClass(t,"mce-preview-object")&&e.dom.getAttrib(t,"data-mce-selected")&&t.setAttribute("data-mce-selected","2")}),e.on("ObjectResized",t=>{const r=t.target;if(r.getAttribute("data-mce-object")){let o=r.getAttribute("data-mce-html");o&&(o=unescape(o),r.setAttribute("data-mce-html",escape(I(o,{width:String(t.width),height:String(t.height)},!1,e.schema))))}})})(e),(e=>({showDialog:()=>{ae(e)}}))(e)))}(); \ No newline at end of file diff --git a/plugins/tinymce/plugins/nonbreaking/plugin.min.js b/plugins/tinymce/plugins/nonbreaking/plugin.min.js index c33bce1b..7f880cec 100644 --- a/plugins/tinymce/plugins/nonbreaking/plugin.min.js +++ b/plugins/tinymce/plugins/nonbreaking/plugin.min.js @@ -1 +1 @@ -!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=n=>e=>typeof e===n,o=e("boolean"),a=e("number"),t=n=>e=>e.options.get(n),i=t("nonbreaking_force_tab"),s=t("nonbreaking_wrap"),r=(n,e)=>{let o="";for(let a=0;a{const o=s(n)||n.plugins.visualchars?`${r(" ",e)}`:r(" ",e);n.undoManager.transact((()=>n.insertContent(o)))};var l=tinymce.util.Tools.resolve("tinymce.util.VK");const u=n=>e=>{const o=()=>{e.setEnabled(n.selection.isEditable())};return n.on("NodeChange",o),o(),()=>{n.off("NodeChange",o)}};n.add("nonbreaking",(n=>{(n=>{const e=n.options.register;e("nonbreaking_force_tab",{processor:n=>o(n)?{value:n?3:0,valid:!0}:a(n)?{value:n,valid:!0}:{valid:!1,message:"Must be a boolean or number."},default:!1}),e("nonbreaking_wrap",{processor:"boolean",default:!0})})(n),(n=>{n.addCommand("mceNonBreaking",(()=>{c(n,1)}))})(n),(n=>{const e=()=>n.execCommand("mceNonBreaking");n.ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:e,onSetup:u(n)}),n.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:e,onSetup:u(n)})})(n),(n=>{const e=i(n);e>0&&n.on("keydown",(o=>{if(o.keyCode===l.TAB&&!o.isDefaultPrevented()){if(o.shiftKey)return;o.preventDefault(),o.stopImmediatePropagation(),c(n,e)}}))})(n)}))}(); \ No newline at end of file +!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=n=>e=>typeof e===n,o=e("boolean"),a=e("number"),t=n=>e=>e.options.get(n),i=t("nonbreaking_force_tab"),s=t("nonbreaking_wrap"),r=(n,e)=>{let o="";for(let a=0;a{const o=s(n)||n.plugins.visualchars?`${r(" ",e)}`:r(" ",e);n.undoManager.transact(()=>n.insertContent(o))};var l=tinymce.util.Tools.resolve("tinymce.util.VK");const u=n=>e=>{const o=()=>{e.setEnabled(n.selection.isEditable())};return n.on("NodeChange",o),o(),()=>{n.off("NodeChange",o)}};n.add("nonbreaking",n=>{(n=>{const e=n.options.register;e("nonbreaking_force_tab",{processor:n=>o(n)?{value:n?3:0,valid:!0}:a(n)?{value:n,valid:!0}:{valid:!1,message:"Must be a boolean or number."},default:!1}),e("nonbreaking_wrap",{processor:"boolean",default:!0})})(n),(n=>{n.addCommand("mceNonBreaking",()=>{c(n,1)})})(n),(n=>{const e=()=>n.execCommand("mceNonBreaking");n.ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:e,onSetup:u(n)}),n.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:e,onSetup:u(n)})})(n),(n=>{const e=i(n);e>0&&n.on("keydown",o=>{if(o.keyCode===l.TAB&&!o.isDefaultPrevented()){if(o.shiftKey)return;o.preventDefault(),o.stopImmediatePropagation(),c(n,e)}})})(n)})}(); \ No newline at end of file diff --git a/plugins/tinymce/plugins/pagebreak/plugin.min.js b/plugins/tinymce/plugins/pagebreak/plugin.min.js index 8cf44f24..ed407a23 100644 --- a/plugins/tinymce/plugins/pagebreak/plugin.min.js +++ b/plugins/tinymce/plugins/pagebreak/plugin.min.js @@ -1 +1 @@ -!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.Env");const t=e=>a=>a.options.get(e),n=t("pagebreak_separator"),o=t("pagebreak_split_block"),r="mce-pagebreak",s=e=>{const t=``;return e?`

    ${t}

    `:t},c=e=>a=>{const t=()=>{a.setEnabled(e.selection.isEditable())};return e.on("NodeChange",t),t(),()=>{e.off("NodeChange",t)}};e.add("pagebreak",(e=>{(e=>{const a=e.options.register;a("pagebreak_separator",{processor:"string",default:"\x3c!-- pagebreak --\x3e"}),a("pagebreak_split_block",{processor:"boolean",default:!1})})(e),(e=>{e.addCommand("mcePageBreak",(()=>{e.insertContent(s(o(e)))}))})(e),(e=>{const a=()=>e.execCommand("mcePageBreak");e.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:a,onSetup:c(e)}),e.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:a,onSetup:c(e)})})(e),(e=>{const a=n(e),t=()=>o(e),c=new RegExp(a.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,(e=>"\\"+e)),"gi");e.on("BeforeSetContent",(e=>{e.content=e.content.replace(c,s(t()))})),e.on("PreInit",(()=>{e.serializer.addNodeFilter("img",(n=>{let o,s,c=n.length;for(;c--;)if(o=n[c],s=o.attr("class"),s&&-1!==s.indexOf(r)){const n=o.parent;if(n&&e.schema.getBlockElements()[n.name]&&t()){n.type=3,n.value=a,n.raw=!0,o.remove();continue}o.type=3,o.value=a,o.raw=!0}}))}))})(e),(e=>{e.on("ResolveName",(a=>{"IMG"===a.target.nodeName&&e.dom.hasClass(a.target,r)&&(a.name="pagebreak")}))})(e)}))}(); \ No newline at end of file +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.Env");const t=e=>a=>a.options.get(e),n=t("pagebreak_separator"),o=t("pagebreak_split_block"),r="mce-pagebreak",s=e=>{const t=``;return e?`

    ${t}

    `:t},c=e=>a=>{const t=()=>{a.setEnabled(e.selection.isEditable())};return e.on("NodeChange",t),t(),()=>{e.off("NodeChange",t)}};e.add("pagebreak",e=>{(e=>{const a=e.options.register;a("pagebreak_separator",{processor:"string",default:"\x3c!-- pagebreak --\x3e"}),a("pagebreak_split_block",{processor:"boolean",default:!1})})(e),(e=>{e.addCommand("mcePageBreak",()=>{e.insertContent(s(o(e)))})})(e),(e=>{const a=()=>e.execCommand("mcePageBreak");e.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:a,onSetup:c(e)}),e.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:a,onSetup:c(e)})})(e),(e=>{const a=n(e),t=()=>o(e),c=new RegExp(a.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,e=>"\\"+e),"gi");e.on("BeforeSetContent",e=>{e.content=e.content.replace(c,s(t()))}),e.on("PreInit",()=>{e.serializer.addNodeFilter("img",n=>{let o,s,c=n.length;for(;c--;)if(o=n[c],s=o.attr("class"),s&&-1!==s.indexOf(r)){const n=o.parent;if(n&&e.schema.getBlockElements()[n.name]&&t()){n.type=3,n.value=a,n.raw=!0,o.remove();continue}o.type=3,o.value=a,o.raw=!0}})})})(e),(e=>{e.on("ResolveName",a=>{"IMG"===a.target.nodeName&&e.dom.hasClass(a.target,r)&&(a.name="pagebreak")})})(e)})}(); \ No newline at end of file diff --git a/plugins/tinymce/plugins/preview/plugin.min.js b/plugins/tinymce/plugins/preview/plugin.min.js index a9d8d88c..4867cd73 100644 --- a/plugins/tinymce/plugins/preview/plugin.min.js +++ b/plugins/tinymce/plugins/preview/plugin.min.js @@ -1 +1 @@ -!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>undefined===e;const r=e=>"function"==typeof e;const n=e=>()=>e,s=e=>e,o=n(!1);class i{tag;value;static singletonNone=new i(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new i(!0,e)}static none(){return i.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?i.some(e(this.value)):i.none()}bind(e){return this.tag?e(this.value):i.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:i.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(e??"Called getOrDie on None")}static from(e){return null==e?i.none():i.some(e)}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Array.prototype.slice;const a=Array.prototype.indexOf,c=(e,t)=>((e,t,r)=>{for(let n=0,s=e.length;n{const r=[];return((e,t)=>{const r=u(e);for(let n=0,s=r.length;n{r.push(t(e,n))})),r},d=(e,r,n=0,s)=>{const o=e.indexOf(r,n);return-1!==o&&(!!t(s)||o+r.length<=s)},m=()=>h(0,0),h=(e,t)=>({major:e,minor:t}),g={nu:h,detect:(e,t)=>{const r=String(t).toLowerCase();return 0===e.length?m():((e,t)=>{const r=((e,t)=>{for(let r=0;rNumber(t.replace(r,"$"+e));return h(n(1),n(2))})(e,r)},unknown:m},v=(e,t)=>{const r=String(t).toLowerCase();return c(e,(e=>e.search(r)))},p=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,f=e=>t=>d(t,e),w=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>d(e,"edge/")&&d(e,"chrome")&&d(e,"safari")&&d(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,p],search:e=>d(e,"chrome")&&!d(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>d(e,"msie")||d(e,"trident")},{name:"Opera",versionRegexes:[p,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:f("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:f("firefox")},{name:"Safari",versionRegexes:[p,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(d(e,"safari")||d(e,"mobile/"))&&d(e,"applewebkit")}],y=[{name:"Windows",search:f("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>d(e,"iphone")||d(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:f("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:f("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:f("linux"),versionRegexes:[]},{name:"Solaris",search:f("sunos"),versionRegexes:[]},{name:"FreeBSD",search:f("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:f("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],x={browsers:n(w),oses:n(y)},S="Edge",b="Chromium",O="Opera",A="Firefox",C="Safari",R=e=>{const t=e.current,r=e.version,n=e=>()=>t===e;return{current:t,version:r,isEdge:n(S),isChromium:n(b),isIE:n("IE"),isOpera:n(O),isFirefox:n(A),isSafari:n(C)}},k=()=>R({current:void 0,version:g.unknown()}),D=R,E=(n(S),n(b),n("IE"),n(O),n(A),n(C),"Windows"),I="Android",T="Linux",L="macOS",P="Solaris",$="FreeBSD",_="ChromeOS",B=e=>{const t=e.current,r=e.version,n=e=>()=>t===e;return{current:t,version:r,isWindows:n(E),isiOS:n("iOS"),isAndroid:n(I),isMacOS:n(L),isLinux:n(T),isSolaris:n(P),isFreeBSD:n($),isChromeOS:n(_)}},N=()=>B({current:void 0,version:g.unknown()}),F=B,M=(n(E),n("iOS"),n(I),n(T),n(L),n(P),n($),n(_),(e,t,r)=>{const s=x.browsers(),o=x.oses(),a=t.bind((e=>((e,t)=>((e,t)=>{for(let r=0;r{const r=t.brand.toLowerCase();return c(e,(e=>r===e.brand?.toLowerCase())).map((e=>({current:e.name,version:g.nu(parseInt(t.version,10),0)})))})))(s,e))).orThunk((()=>((e,t)=>v(e,t).map((e=>{const r=g.detect(e.versionRegexes,t);return{current:e.name,version:r}})))(s,e))).fold(k,D),u=((e,t)=>v(e,t).map((e=>{const r=g.detect(e.versionRegexes,t);return{current:e.name,version:r}})))(o,e).fold(N,F),l=((e,t,r,s)=>{const o=e.isiOS()&&!0===/ipad/i.test(r),i=e.isiOS()&&!o,a=e.isiOS()||e.isAndroid(),c=a||s("(pointer:coarse)"),u=o||!i&&a&&s("(min-device-width:768px)"),l=i||a&&!u,d=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(r),m=!l&&!u&&!d;return{isiPad:n(o),isiPhone:n(i),isTablet:n(u),isPhone:n(l),isTouch:n(c),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:n(d),isDesktop:n(m)}})(u,a,e,r);return{browser:a,os:u,deviceType:l}}),j=e=>window.matchMedia(e).matches;let U=(e=>{let t,r=!1;return(...n)=>(r||(r=!0,t=e.apply(null,n)),t)})((()=>M(window.navigator.userAgent,i.from(window.navigator.userAgentData),j)));const W=()=>U();var K=tinymce.util.Tools.resolve("tinymce.dom.ScriptLoader"),V=tinymce.util.Tools.resolve("tinymce.util.Tools");const z=e=>t=>t.options.get(e),Y=z("content_style"),q=z("content_css_cors"),G=z("body_class"),H=z("body_id"),J=e=>{var t;return((e,t)=>{const r=e.length,n=new Array(r);for(let s=0;s{const n=[],s=r(t)?e=>((e,t)=>{for(let r=0,n=e.length;rt(r,e))):e=>((e,t)=>((e,t)=>a.call(e,t))(e,t)>-1)(n,e);for(let t=0,r=e.length;t{const r=l(K.ScriptLoader.getScriptAttributes(t),((t,r)=>` ${e.dom.encode(r)}="${e.dom.encode(t)}"`));return`