Version Description
- 2020-10-13 =
- Fix - UPS connect redirect prompt
- Fix - Allow UPS label purchase without payment method
- Fix - PHP implode arguments order
- Fix - Validate insurance value as both string and number
- Tweak - Adjusted messaging on label pointers
- Tweak - Update carrier logo
- Tweak - Plugin rename
- Add - Link to print the customs form for all shipments that need it
Download this release
Release Info
Developer | cshultz88 |
Plugin | WooCommerce Services |
Version | 1.25.0 |
Comparing to | |
See all releases |
Code changes from version 1.24.3 to 1.25.0
- classes/class-wc-connect-api-client-live.php +7 -7
- classes/class-wc-connect-api-client.php +12 -12
- classes/class-wc-connect-debug-tools.php +4 -4
- classes/class-wc-connect-extension-compatibility.php +1 -1
- classes/class-wc-connect-help-view.php +5 -5
- classes/class-wc-connect-nux.php +54 -16
- classes/class-wc-connect-options.php +7 -7
- classes/class-wc-connect-paypal-ec.php +2 -2
- classes/class-wc-connect-privacy.php +2 -2
- classes/class-wc-connect-service-settings-store.php +1 -1
- classes/class-wc-connect-settings-pages.php +6 -5
- classes/class-wc-connect-shipping-label.php +18 -0
- classes/class-wc-connect-shipping-method.php +3 -3
- classes/class-wc-connect-stripe.php +3 -3
- classes/class-wc-connect-taxjar-integration.php +1 -1
- classes/class-wc-rest-connect-shipping-label-controller.php +1 -0
- dist/chunks/295a2240a399d69fb7e8.min.js +0 -1
- dist/chunks/{55d86b44c8592d62c9ba.css → 2b8a69d8be5791453fd6.css} +0 -0
- dist/chunks/{55d86b44c8592d62c9ba.min.js → 2b8a69d8be5791453fd6.min.js} +1 -1
- dist/chunks/{8d827ef9f423b897385e.css → 3ed05dfa5e09a976a3dd.css} +0 -0
- dist/chunks/{8d827ef9f423b897385e.min.js → 3ed05dfa5e09a976a3dd.min.js} +1 -1
- dist/chunks/{e00b4c31a2566d6025f4.css → 45b16821d45485e02d04.css} +0 -0
- dist/chunks/{e00b4c31a2566d6025f4.min.js → 45b16821d45485e02d04.min.js} +1 -1
- dist/chunks/{295a2240a399d69fb7e8.css → 78a3522dc7a19158d37f.css} +0 -0
- dist/chunks/78a3522dc7a19158d37f.min.js +1 -0
- dist/chunks/{3ea9563c44a821018d8f.css → 79ab4180ca5c01bfa81b.css} +0 -0
- dist/chunks/{3ea9563c44a821018d8f.min.js → 79ab4180ca5c01bfa81b.min.js} +1 -1
- dist/chunks/{bcadb68537fa6f7b8eb8.css → a4e6e6c5332389e456d3.css} +0 -0
- dist/chunks/{bcadb68537fa6f7b8eb8.min.js → a4e6e6c5332389e456d3.min.js} +1 -1
- dist/chunks/{4ac1c307f4052717e1a8.css → deb6e682893bf6d661d0.css} +0 -0
- dist/chunks/{4ac1c307f4052717e1a8.min.js → deb6e682893bf6d661d0.min.js} +0 -0
- dist/chunks/{d99a250da0e3b29ee6dd.css → e211e5f3ac08c6eb420b.css} +0 -0
- dist/chunks/{d99a250da0e3b29ee6dd.min.js → e211e5f3ac08c6eb420b.min.js} +1 -1
- dist/images/224d57e46d3ace2d89e5c790bd828d32.png +0 -0
- dist/images/41e119813ea7cd89e927349d8d4ad824.png +0 -0
- dist/{woocommerce-services-1.24.3.css → woocommerce-services-1.25.0.css} +0 -0
- dist/{woocommerce-services-1.24.3.js → woocommerce-services-1.25.0.js} +0 -1
classes/class-wc-connect-api-client-live.php
CHANGED
@@ -20,21 +20,21 @@ if ( ! class_exists( 'WC_Connect_API_Client_Live' ) ) {
|
|
20 |
if ( ! class_exists( 'Jetpack_Data' ) ) {
|
21 |
return new WP_Error(
|
22 |
'jetpack_data_class_not_found',
|
23 |
-
__( 'Unable to send request to WooCommerce
|
24 |
);
|
25 |
}
|
26 |
|
27 |
if ( ! method_exists( 'Jetpack_Data', 'get_access_token' ) ) {
|
28 |
return new WP_Error(
|
29 |
'jetpack_data_get_access_token_not_found',
|
30 |
-
__( 'Unable to send request to WooCommerce
|
31 |
);
|
32 |
}
|
33 |
|
34 |
if ( ! is_array( $body ) ) {
|
35 |
return new WP_Error(
|
36 |
'request_body_should_be_array',
|
37 |
-
__( 'Unable to send request to WooCommerce
|
38 |
);
|
39 |
}
|
40 |
|
@@ -50,7 +50,7 @@ if ( ! class_exists( 'WC_Connect_API_Client_Live' ) ) {
|
|
50 |
if ( ! $body ) {
|
51 |
return new WP_Error(
|
52 |
'unable_to_json_encode_body',
|
53 |
-
__( 'Unable to encode body for request to WooCommerce
|
54 |
);
|
55 |
}
|
56 |
}
|
@@ -84,7 +84,7 @@ if ( ! class_exists( 'WC_Connect_API_Client_Live' ) ) {
|
|
84 |
return new WP_Error(
|
85 |
'wcc_server_error',
|
86 |
sprintf(
|
87 |
-
__( 'Error: The WooCommerce
|
88 |
$response_code
|
89 |
)
|
90 |
);
|
@@ -102,7 +102,7 @@ if ( ! class_exists( 'WC_Connect_API_Client_Live' ) ) {
|
|
102 |
return new WP_Error(
|
103 |
'wcc_server_empty_response',
|
104 |
sprintf(
|
105 |
-
__( 'Error: The WooCommerce
|
106 |
$response_code
|
107 |
)
|
108 |
);
|
@@ -116,7 +116,7 @@ if ( ! class_exists( 'WC_Connect_API_Client_Live' ) ) {
|
|
116 |
'wcc_server_error_response',
|
117 |
sprintf(
|
118 |
/* translators: %1$s: error code, %2$s: error message, %3$d: HTTP response code */
|
119 |
-
__( 'Error: The WooCommerce
|
120 |
$error,
|
121 |
$message,
|
122 |
$response_code
|
20 |
if ( ! class_exists( 'Jetpack_Data' ) ) {
|
21 |
return new WP_Error(
|
22 |
'jetpack_data_class_not_found',
|
23 |
+
__( 'Unable to send request to WooCommerce Shipping & Tax server. Jetpack_Data was not found.', 'woocommerce-services' )
|
24 |
);
|
25 |
}
|
26 |
|
27 |
if ( ! method_exists( 'Jetpack_Data', 'get_access_token' ) ) {
|
28 |
return new WP_Error(
|
29 |
'jetpack_data_get_access_token_not_found',
|
30 |
+
__( 'Unable to send request to WooCommerce Shipping & Tax server. Jetpack_Data does not implement get_access_token.', 'woocommerce-services' )
|
31 |
);
|
32 |
}
|
33 |
|
34 |
if ( ! is_array( $body ) ) {
|
35 |
return new WP_Error(
|
36 |
'request_body_should_be_array',
|
37 |
+
__( 'Unable to send request to WooCommerce Shipping & Tax server. Body must be an array.', 'woocommerce-services' )
|
38 |
);
|
39 |
}
|
40 |
|
50 |
if ( ! $body ) {
|
51 |
return new WP_Error(
|
52 |
'unable_to_json_encode_body',
|
53 |
+
__( 'Unable to encode body for request to WooCommerce Shipping & Tax server.', 'woocommerce-services' )
|
54 |
);
|
55 |
}
|
56 |
}
|
84 |
return new WP_Error(
|
85 |
'wcc_server_error',
|
86 |
sprintf(
|
87 |
+
__( 'Error: The WooCommerce Shipping & Tax server returned HTTP code: %d', 'woocommerce-services' ),
|
88 |
$response_code
|
89 |
)
|
90 |
);
|
102 |
return new WP_Error(
|
103 |
'wcc_server_empty_response',
|
104 |
sprintf(
|
105 |
+
__( 'Error: The WooCommerce Shipping & Tax server returned ( %d ) and an empty response body.', 'woocommerce-services' ),
|
106 |
$response_code
|
107 |
)
|
108 |
);
|
116 |
'wcc_server_error_response',
|
117 |
sprintf(
|
118 |
/* translators: %1$s: error code, %2$s: error message, %3$d: HTTP response code */
|
119 |
+
__( 'Error: The WooCommerce Shipping & Tax server returned: %1$s %2$s ( %3$d )', 'woocommerce-services' ),
|
120 |
$error,
|
121 |
$message,
|
122 |
$response_code
|
classes/class-wc-connect-api-client.php
CHANGED
@@ -31,7 +31,7 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
|
|
31 |
}
|
32 |
|
33 |
/**
|
34 |
-
* Requests the available services for this site from the WooCommerce
|
35 |
*
|
36 |
* @return array|WP_Error
|
37 |
*/
|
@@ -51,7 +51,7 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
|
|
51 |
}
|
52 |
|
53 |
/**
|
54 |
-
* Validates the settings for a given service with the WooCommerce
|
55 |
*
|
56 |
* @param $service_slug
|
57 |
* @param $service_settings
|
@@ -61,7 +61,7 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
|
|
61 |
public function validate_service_settings( $service_slug, $service_settings ) {
|
62 |
// Make sure the service slug only contains underscores or letters
|
63 |
if ( 1 === preg_match( '/[^a-z_]/i', $service_slug ) ) {
|
64 |
-
return new WP_Error( 'invalid_service_slug', __( 'Invalid WooCommerce
|
65 |
}
|
66 |
|
67 |
return $this->request( 'POST', "/services/{$service_slug}/settings", array( 'service_settings' => $service_settings ) );
|
@@ -136,7 +136,7 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
|
|
136 |
}
|
137 |
|
138 |
/**
|
139 |
-
* Gets shipping rates (for checkout) from the WooCommerce
|
140 |
*
|
141 |
* @param $services All settings for all services we want rates for
|
142 |
* @param $package Package provided to WC_Shipping_Method::calculate_shipping()
|
@@ -182,7 +182,7 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
|
|
182 |
}
|
183 |
|
184 |
/**
|
185 |
-
* Asks the WooCommerce
|
186 |
*
|
187 |
* @return mixed|WP_Error
|
188 |
*/
|
@@ -191,7 +191,7 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
|
|
191 |
}
|
192 |
|
193 |
/**
|
194 |
-
* Gets shipping rates (for labels) from the WooCommerce
|
195 |
*
|
196 |
* @param array $request - array(
|
197 |
* 'packages' => array(
|
@@ -312,7 +312,7 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
|
|
312 |
}
|
313 |
|
314 |
/**
|
315 |
-
* Tests the connection to the WooCommerce
|
316 |
*
|
317 |
* @return true|WP_Error
|
318 |
*/
|
@@ -385,7 +385,7 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
|
|
385 |
}
|
386 |
|
387 |
/**
|
388 |
-
* Sends a request to the WooCommerce
|
389 |
*
|
390 |
* @param $method
|
391 |
* @param $path
|
@@ -465,7 +465,7 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
|
|
465 |
}
|
466 |
|
467 |
/**
|
468 |
-
* Generates headers for our request to the WooCommerce
|
469 |
*
|
470 |
* @return array|WP_Error
|
471 |
*/
|
@@ -492,14 +492,14 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
|
|
492 |
if ( ! $token || empty( $token->secret ) ) {
|
493 |
return new WP_Error(
|
494 |
'missing_token',
|
495 |
-
__( 'Unable to send request to WooCommerce
|
496 |
);
|
497 |
}
|
498 |
|
499 |
if ( false === strpos( $token->secret, '.' ) ) {
|
500 |
return new WP_Error(
|
501 |
'invalid_token',
|
502 |
-
__( 'Unable to send request to WooCommerce
|
503 |
);
|
504 |
}
|
505 |
|
@@ -535,7 +535,7 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
|
|
535 |
if ( $local_time < time() - 600 || $local_time > time() + 300 ) {
|
536 |
return new WP_Error(
|
537 |
'invalid_signature',
|
538 |
-
__( 'Unable to send request to WooCommerce
|
539 |
);
|
540 |
}
|
541 |
|
31 |
}
|
32 |
|
33 |
/**
|
34 |
+
* Requests the available services for this site from the WooCommerce Shipping & Tax Server
|
35 |
*
|
36 |
* @return array|WP_Error
|
37 |
*/
|
51 |
}
|
52 |
|
53 |
/**
|
54 |
+
* Validates the settings for a given service with the WooCommerce Shipping & Tax Server
|
55 |
*
|
56 |
* @param $service_slug
|
57 |
* @param $service_settings
|
61 |
public function validate_service_settings( $service_slug, $service_settings ) {
|
62 |
// Make sure the service slug only contains underscores or letters
|
63 |
if ( 1 === preg_match( '/[^a-z_]/i', $service_slug ) ) {
|
64 |
+
return new WP_Error( 'invalid_service_slug', __( 'Invalid WooCommerce Shipping & Tax service slug provided', 'woocommerce-services' ) );
|
65 |
}
|
66 |
|
67 |
return $this->request( 'POST', "/services/{$service_slug}/settings", array( 'service_settings' => $service_settings ) );
|
136 |
}
|
137 |
|
138 |
/**
|
139 |
+
* Gets shipping rates (for checkout) from the WooCommerce Shipping & Tax Server
|
140 |
*
|
141 |
* @param $services All settings for all services we want rates for
|
142 |
* @param $package Package provided to WC_Shipping_Method::calculate_shipping()
|
182 |
}
|
183 |
|
184 |
/**
|
185 |
+
* Asks the WooCommerce Shipping & Tax server for an array of payment methods
|
186 |
*
|
187 |
* @return mixed|WP_Error
|
188 |
*/
|
191 |
}
|
192 |
|
193 |
/**
|
194 |
+
* Gets shipping rates (for labels) from the WooCommerce Shipping & Tax Server
|
195 |
*
|
196 |
* @param array $request - array(
|
197 |
* 'packages' => array(
|
312 |
}
|
313 |
|
314 |
/**
|
315 |
+
* Tests the connection to the WooCommerce Shipping & Tax Server
|
316 |
*
|
317 |
* @return true|WP_Error
|
318 |
*/
|
385 |
}
|
386 |
|
387 |
/**
|
388 |
+
* Sends a request to the WooCommerce Shipping & Tax Server
|
389 |
*
|
390 |
* @param $method
|
391 |
* @param $path
|
465 |
}
|
466 |
|
467 |
/**
|
468 |
+
* Generates headers for our request to the WooCommerce Shipping & Tax Server
|
469 |
*
|
470 |
* @return array|WP_Error
|
471 |
*/
|
492 |
if ( ! $token || empty( $token->secret ) ) {
|
493 |
return new WP_Error(
|
494 |
'missing_token',
|
495 |
+
__( 'Unable to send request to WooCommerce Shipping & Tax server. Jetpack Token is missing', 'woocommerce-services' )
|
496 |
);
|
497 |
}
|
498 |
|
499 |
if ( false === strpos( $token->secret, '.' ) ) {
|
500 |
return new WP_Error(
|
501 |
'invalid_token',
|
502 |
+
__( 'Unable to send request to WooCommerce Shipping & Tax server. Jetpack Token is malformed.', 'woocommerce-services' )
|
503 |
);
|
504 |
}
|
505 |
|
535 |
if ( $local_time < time() - 600 || $local_time > time() + 300 ) {
|
536 |
return new WP_Error(
|
537 |
'invalid_signature',
|
538 |
+
__( 'Unable to send request to WooCommerce Shipping & Tax server. The timestamp generated for the signature is too old.', 'woocommerce-services' )
|
539 |
);
|
540 |
}
|
541 |
|
classes/class-wc-connect-debug-tools.php
CHANGED
@@ -17,9 +17,9 @@ if ( ! class_exists( 'WC_Connect_Debug_Tools' ) ) {
|
|
17 |
|
18 |
function woocommerce_debug_tools( $tools ) {
|
19 |
$tools['test_wcc_connection'] = array(
|
20 |
-
'name' => __( 'Test your WooCommerce
|
21 |
'button' => __( 'Test Connection', 'woocommerce-services' ),
|
22 |
-
'desc' => __( 'This will test your WooCommerce
|
23 |
'callback' => array( $this, 'test_connection' ),
|
24 |
);
|
25 |
return $tools;
|
@@ -28,9 +28,9 @@ if ( ! class_exists( 'WC_Connect_Debug_Tools' ) ) {
|
|
28 |
function test_connection() {
|
29 |
$test_request = $this->api_client->auth_test();
|
30 |
if ( $test_request && ! is_wp_error( $test_request ) && $test_request->authorized ) {
|
31 |
-
echo '<div class="updated inline"><p>' . __( 'Your site is succesfully communicating to the WooCommerce
|
32 |
} else {
|
33 |
-
echo '<div class="error inline"><p>' . __( 'ERROR: Your site has a problem connecting to the WooCommerce
|
34 |
}
|
35 |
}
|
36 |
|
17 |
|
18 |
function woocommerce_debug_tools( $tools ) {
|
19 |
$tools['test_wcc_connection'] = array(
|
20 |
+
'name' => __( 'Test your WooCommerce Shipping & Tax connection', 'woocommerce-services' ),
|
21 |
'button' => __( 'Test Connection', 'woocommerce-services' ),
|
22 |
+
'desc' => __( 'This will test your WooCommerce Shipping & Tax connection to ensure everything is working correctly', 'woocommerce-services' ),
|
23 |
'callback' => array( $this, 'test_connection' ),
|
24 |
);
|
25 |
return $tools;
|
28 |
function test_connection() {
|
29 |
$test_request = $this->api_client->auth_test();
|
30 |
if ( $test_request && ! is_wp_error( $test_request ) && $test_request->authorized ) {
|
31 |
+
echo '<div class="updated inline"><p>' . __( 'Your site is succesfully communicating to the WooCommerce Shipping & Tax API.', 'woocommerce-services' ) . '</p></div>';
|
32 |
} else {
|
33 |
+
echo '<div class="error inline"><p>' . __( 'ERROR: Your site has a problem connecting to the WooCommerce Shipping & Tax API. Please make sure your Jetpack connection is working.', 'woocommerce-services' ) . '</p></div>';
|
34 |
}
|
35 |
}
|
36 |
|
classes/class-wc-connect-extension-compatibility.php
CHANGED
@@ -18,7 +18,7 @@ if ( ! class_exists( 'WC_Connect_Extension_Compatibility' ) ) {
|
|
18 |
}
|
19 |
|
20 |
/**
|
21 |
-
* Checks if WooCommerce
|
22 |
*
|
23 |
* @param $order_id - order ID
|
24 |
* @return boolean true if WCS should send the tracking info, false otherwise
|
18 |
}
|
19 |
|
20 |
/**
|
21 |
+
* Checks if WooCommerce Shipping & Tax should email the tracking details, or if another extension is taking care of that already
|
22 |
*
|
23 |
* @param $order_id - order ID
|
24 |
* @return boolean true if WCS should send the tracking info, false otherwise
|
classes/class-wc-connect-help-view.php
CHANGED
@@ -113,9 +113,9 @@ if ( ! class_exists( 'WC_Connect_Help_View' ) ) {
|
|
113 |
}
|
114 |
$health_items['jetpack'] = $health_item;
|
115 |
|
116 |
-
// Lastly, do the WooCommerce
|
117 |
// Check that we have schema
|
118 |
-
// Check that we are able to talk to the WooCommerce
|
119 |
$schemas = $this->service_schemas_store->get_service_schemas();
|
120 |
$last_fetch_timestamp = $this->service_schemas_store->get_last_fetch_timestamp();
|
121 |
if ( isset( $_GET['refresh'] ) && 'failed' === $_GET['refresh'] ) {
|
@@ -217,7 +217,7 @@ if ( ! class_exists( 'WC_Connect_Help_View' ) ) {
|
|
217 |
}
|
218 |
|
219 |
/**
|
220 |
-
* Gets the last 10 lines from the WooCommerce
|
221 |
*/
|
222 |
protected function get_debug_log_data( $feature = '' ) {
|
223 |
$data = new stdClass;
|
@@ -289,7 +289,7 @@ if ( ! class_exists( 'WC_Connect_Help_View' ) ) {
|
|
289 |
if ( ! is_array( $tabs ) ) {
|
290 |
$tabs = array();
|
291 |
}
|
292 |
-
$tabs[ 'connect' ] = _x( 'WooCommerce
|
293 |
return $tabs;
|
294 |
}
|
295 |
|
@@ -326,7 +326,7 @@ if ( ! class_exists( 'WC_Connect_Help_View' ) ) {
|
|
326 |
|
327 |
?>
|
328 |
<h2>
|
329 |
-
<?php _e( 'WooCommerce
|
330 |
</h2>
|
331 |
<?php
|
332 |
|
113 |
}
|
114 |
$health_items['jetpack'] = $health_item;
|
115 |
|
116 |
+
// Lastly, do the WooCommerce Shipping & Tax health check
|
117 |
// Check that we have schema
|
118 |
+
// Check that we are able to talk to the WooCommerce Shipping & Tax server
|
119 |
$schemas = $this->service_schemas_store->get_service_schemas();
|
120 |
$last_fetch_timestamp = $this->service_schemas_store->get_last_fetch_timestamp();
|
121 |
if ( isset( $_GET['refresh'] ) && 'failed' === $_GET['refresh'] ) {
|
217 |
}
|
218 |
|
219 |
/**
|
220 |
+
* Gets the last 10 lines from the WooCommerce Shipping & Tax log by feature, if it exists
|
221 |
*/
|
222 |
protected function get_debug_log_data( $feature = '' ) {
|
223 |
$data = new stdClass;
|
289 |
if ( ! is_array( $tabs ) ) {
|
290 |
$tabs = array();
|
291 |
}
|
292 |
+
$tabs[ 'connect' ] = _x( 'WooCommerce Shipping & Tax', 'The WooCommerce Shipping & Tax brandname', 'woocommerce-services' );
|
293 |
return $tabs;
|
294 |
}
|
295 |
|
326 |
|
327 |
?>
|
328 |
<h2>
|
329 |
+
<?php _e( 'WooCommerce Shipping & Tax Status', 'woocommerce-services' ); ?>
|
330 |
</h2>
|
331 |
<?php
|
332 |
|
classes/class-wc-connect-nux.php
CHANGED
@@ -71,6 +71,7 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
|
|
71 |
|
72 |
private function init_pointers() {
|
73 |
add_filter( 'wc_services_pointer_post.php', array( $this, 'register_order_page_labels_pointer' ) );
|
|
|
74 |
}
|
75 |
|
76 |
public function show_pointers( $hook ) {
|
@@ -146,24 +147,61 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
|
|
146 |
// If the user is not new to labels, we should just dismiss this pointer
|
147 |
if ( ! $this->is_new_labels_user() ) {
|
148 |
$this->dismiss_pointer( 'wc_services_labels_metabox' );
|
|
|
149 |
return $pointers;
|
150 |
}
|
151 |
|
152 |
-
if ( $this->shipping_label->should_show_meta_box() ) {
|
153 |
-
$pointers
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
),
|
163 |
-
'
|
164 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
}
|
166 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
return $pointers;
|
168 |
}
|
169 |
|
@@ -486,7 +524,7 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
|
|
486 |
|
487 |
$jetpack_status = $this->get_jetpack_install_status();
|
488 |
$button_text = __( 'Connect', 'woocommerce-services' );
|
489 |
-
$banner_title = __( 'Connect Jetpack to activate WooCommerce
|
490 |
$image_url = plugins_url( 'images/wcs-notice.png', dirname( __FILE__ ) );
|
491 |
|
492 |
switch ( $jetpack_status ) {
|
@@ -500,7 +538,7 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
|
|
500 |
|
501 |
$country = WC()->countries->get_base_country();
|
502 |
/* translators: %s: list of features, potentially comma separated */
|
503 |
-
$description_base = __( "WooCommerce
|
504 |
$feature_list = $this->get_feature_list_for_country( $country );
|
505 |
$banner_content = array(
|
506 |
'title' => $banner_title,
|
@@ -576,11 +614,11 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
|
|
576 |
|
577 |
$country = WC()->countries->get_base_country();
|
578 |
/* translators: %s: list of features, potentially comma separated */
|
579 |
-
$description_base = __( "WooCommerce
|
580 |
$feature_list = $this->get_feature_list_for_country( $country );
|
581 |
|
582 |
$this->show_nux_banner( array(
|
583 |
-
'title' => __( 'Connect your store to activate WooCommerce
|
584 |
'description' => esc_html( sprintf( $description_base, $feature_list ) ),
|
585 |
'button_text' => __( 'Connect', 'woocommerce-services' ),
|
586 |
'button_link' => add_query_arg( array(
|
71 |
|
72 |
private function init_pointers() {
|
73 |
add_filter( 'wc_services_pointer_post.php', array( $this, 'register_order_page_labels_pointer' ) );
|
74 |
+
add_filter( 'wc_services_pointer_post.php', array( $this, 'register_new_carrier_dhl_pointer' ) );
|
75 |
}
|
76 |
|
77 |
public function show_pointers( $hook ) {
|
147 |
// If the user is not new to labels, we should just dismiss this pointer
|
148 |
if ( ! $this->is_new_labels_user() ) {
|
149 |
$this->dismiss_pointer( 'wc_services_labels_metabox' );
|
150 |
+
|
151 |
return $pointers;
|
152 |
}
|
153 |
|
154 |
+
if ( ! $this->shipping_label->should_show_meta_box() ) {
|
155 |
+
return $pointers;
|
156 |
+
}
|
157 |
+
|
158 |
+
$supported_carriers = array( 'USPS' );
|
159 |
+
if ( $this->shipping_label->is_dhl_express_available() ) {
|
160 |
+
$supported_carriers[] = 'DHL';
|
161 |
+
}
|
162 |
+
|
163 |
+
$pointers[] = array(
|
164 |
+
'id' => 'wc_services_labels_metabox',
|
165 |
+
'target' => '#woocommerce-order-label .button',
|
166 |
+
'options' => array(
|
167 |
+
'content' => sprintf( '<h3>%s</h3><p>%s</p>',
|
168 |
+
__( 'Discounted Shipping Labels' ,'woocommerce-services' ),
|
169 |
+
sprintf( __( "When you're ready, purchase and print discounted labels from %s right here.", 'woocommerce-services' ), implode(' or ', $supported_carriers) )
|
170 |
),
|
171 |
+
'position' => array( 'edge' => 'top', 'align' => 'left' ),
|
172 |
+
),
|
173 |
+
'dim' => true,
|
174 |
+
);
|
175 |
+
|
176 |
+
return $pointers;
|
177 |
+
}
|
178 |
+
|
179 |
+
public function register_new_carrier_dhl_pointer( $pointers ) {
|
180 |
+
// new user? no need to show this alert, `wc_services_labels_metabox` will take care of communicating about DHL
|
181 |
+
if ( $this->is_new_labels_user() ) {
|
182 |
+
$this->dismiss_pointer( 'wc_services_new_carrier_dhl_express' );
|
183 |
+
|
184 |
+
return $pointers;
|
185 |
}
|
186 |
|
187 |
+
// existing user? figure out if the order supports DHL, then let them know DHL is a new carrier!
|
188 |
+
if ( ! $this->shipping_label->is_order_dhl_express_eligible() ) {
|
189 |
+
return $pointers;
|
190 |
+
}
|
191 |
+
|
192 |
+
$pointers[] = array(
|
193 |
+
'id' => 'wc_services_new_carrier_dhl_express',
|
194 |
+
'target' => '#woocommerce-order-label .button',
|
195 |
+
'options' => array(
|
196 |
+
'content' => sprintf( '<h3>%s</h3><p>%s</p>',
|
197 |
+
__( 'Discounted DHL Shipping Labels' ,'woocommerce-services' ),
|
198 |
+
__( "WooCommerce Shipping now supports DHL labels for international shipments. Purchase and print discounted labels from DHL and USPS right here.", 'woocommerce-services' )
|
199 |
+
),
|
200 |
+
'position' => array( 'edge' => 'top', 'align' => 'left' ),
|
201 |
+
),
|
202 |
+
'dim' => true,
|
203 |
+
);
|
204 |
+
|
205 |
return $pointers;
|
206 |
}
|
207 |
|
524 |
|
525 |
$jetpack_status = $this->get_jetpack_install_status();
|
526 |
$button_text = __( 'Connect', 'woocommerce-services' );
|
527 |
+
$banner_title = __( 'Connect Jetpack to activate WooCommerce Shipping & Tax', 'woocommerce-services' );
|
528 |
$image_url = plugins_url( 'images/wcs-notice.png', dirname( __FILE__ ) );
|
529 |
|
530 |
switch ( $jetpack_status ) {
|
538 |
|
539 |
$country = WC()->countries->get_base_country();
|
540 |
/* translators: %s: list of features, potentially comma separated */
|
541 |
+
$description_base = __( "WooCommerce Shipping & Tax is almost ready to go! Once you connect Jetpack you'll have access to %s.", 'woocommerce-services' );
|
542 |
$feature_list = $this->get_feature_list_for_country( $country );
|
543 |
$banner_content = array(
|
544 |
'title' => $banner_title,
|
614 |
|
615 |
$country = WC()->countries->get_base_country();
|
616 |
/* translators: %s: list of features, potentially comma separated */
|
617 |
+
$description_base = __( "WooCommerce Shipping & Tax is almost ready to go! Once you connect your store you'll have access to %s.", 'woocommerce-services' );
|
618 |
$feature_list = $this->get_feature_list_for_country( $country );
|
619 |
|
620 |
$this->show_nux_banner( array(
|
621 |
+
'title' => __( 'Connect your store to activate WooCommerce Shipping & Tax', 'woocommerce-services' ),
|
622 |
'description' => esc_html( sprintf( $description_base, $feature_list ) ),
|
623 |
'button_text' => __( 'Connect', 'woocommerce-services' ),
|
624 |
'button_link' => add_query_arg( array(
|
classes/class-wc-connect-options.php
CHANGED
@@ -57,7 +57,7 @@ if ( ! class_exists( 'WC_Connect_Options' ) ) {
|
|
57 |
}
|
58 |
|
59 |
/**
|
60 |
-
* Deletes all options created by WooCommerce
|
61 |
*/
|
62 |
public static function delete_all_options() {
|
63 |
if ( defined( 'WOOCOMMERCE_CONNECT_DEV_SERVER_URL' ) ) {
|
@@ -100,7 +100,7 @@ if ( ! class_exists( 'WC_Connect_Options' ) ) {
|
|
100 |
}
|
101 |
}
|
102 |
|
103 |
-
trigger_error( sprintf( 'Invalid WooCommerce
|
104 |
return $default;
|
105 |
}
|
106 |
|
@@ -121,7 +121,7 @@ if ( ! class_exists( 'WC_Connect_Options' ) ) {
|
|
121 |
return self::update_grouped_option( $group, $name, $value );
|
122 |
}
|
123 |
}
|
124 |
-
trigger_error( sprintf( 'Invalid WooCommerce
|
125 |
return false;
|
126 |
}
|
127 |
|
@@ -137,7 +137,7 @@ if ( ! class_exists( 'WC_Connect_Options' ) ) {
|
|
137 |
$result = true;
|
138 |
$names = (array) $names;
|
139 |
if ( ! self::is_valid( $names ) ) {
|
140 |
-
trigger_error( sprintf( 'Invalid WooCommerce
|
141 |
return false;
|
142 |
}
|
143 |
foreach ( array_intersect( $names, self::get_option_names( 'non_compact' ) ) as $name ) {
|
@@ -167,7 +167,7 @@ if ( ! class_exists( 'WC_Connect_Options' ) ) {
|
|
167 |
$option_name = self::get_shipping_method_option_name( $name, $service_id, $service_instance );
|
168 |
|
169 |
if ( ! $option_name ) {
|
170 |
-
trigger_error( sprintf( 'Invalid WooCommerce
|
171 |
return $default;
|
172 |
}
|
173 |
|
@@ -188,7 +188,7 @@ if ( ! class_exists( 'WC_Connect_Options' ) ) {
|
|
188 |
$option_name = self::get_shipping_method_option_name( $name, $service_id, $service_instance );
|
189 |
|
190 |
if ( ! $option_name ) {
|
191 |
-
trigger_error( sprintf( 'Invalid WooCommerce
|
192 |
return false;
|
193 |
}
|
194 |
|
@@ -208,7 +208,7 @@ if ( ! class_exists( 'WC_Connect_Options' ) ) {
|
|
208 |
$option_name = self::get_shipping_method_option_name( $name, $service_id, $service_instance );
|
209 |
|
210 |
if ( ! $option_name ) {
|
211 |
-
trigger_error( sprintf( 'Invalid WooCommerce
|
212 |
return false;
|
213 |
}
|
214 |
|
57 |
}
|
58 |
|
59 |
/**
|
60 |
+
* Deletes all options created by WooCommerce Shipping & Tax, including shipping method options
|
61 |
*/
|
62 |
public static function delete_all_options() {
|
63 |
if ( defined( 'WOOCOMMERCE_CONNECT_DEV_SERVER_URL' ) ) {
|
100 |
}
|
101 |
}
|
102 |
|
103 |
+
trigger_error( sprintf( 'Invalid WooCommerce Shipping & Tax option name: %s', $name ), E_USER_WARNING );
|
104 |
return $default;
|
105 |
}
|
106 |
|
121 |
return self::update_grouped_option( $group, $name, $value );
|
122 |
}
|
123 |
}
|
124 |
+
trigger_error( sprintf( 'Invalid WooCommerce Shipping & Tax option name: %s', $name ), E_USER_WARNING );
|
125 |
return false;
|
126 |
}
|
127 |
|
137 |
$result = true;
|
138 |
$names = (array) $names;
|
139 |
if ( ! self::is_valid( $names ) ) {
|
140 |
+
trigger_error( sprintf( 'Invalid WooCommerce Shipping & Tax option names: %s', print_r( $names, 1 ) ), E_USER_WARNING );
|
141 |
return false;
|
142 |
}
|
143 |
foreach ( array_intersect( $names, self::get_option_names( 'non_compact' ) ) as $name ) {
|
167 |
$option_name = self::get_shipping_method_option_name( $name, $service_id, $service_instance );
|
168 |
|
169 |
if ( ! $option_name ) {
|
170 |
+
trigger_error( sprintf( 'Invalid WooCommerce Shipping & Tax shipping method option name: %s', $name ), E_USER_WARNING );
|
171 |
return $default;
|
172 |
}
|
173 |
|
188 |
$option_name = self::get_shipping_method_option_name( $name, $service_id, $service_instance );
|
189 |
|
190 |
if ( ! $option_name ) {
|
191 |
+
trigger_error( sprintf( 'Invalid WooCommerce Shipping & Tax shipping method option name: %s', $name ), E_USER_WARNING );
|
192 |
return false;
|
193 |
}
|
194 |
|
208 |
$option_name = self::get_shipping_method_option_name( $name, $service_id, $service_instance );
|
209 |
|
210 |
if ( ! $option_name ) {
|
211 |
+
trigger_error( sprintf( 'Invalid WooCommerce Shipping & Tax shipping method option name: %s', $name ), E_USER_WARNING );
|
212 |
return false;
|
213 |
}
|
214 |
|
classes/class-wc-connect-paypal-ec.php
CHANGED
@@ -265,7 +265,7 @@ if ( ! class_exists( 'WC_Connect_PayPal_EC' ) ) {
|
|
265 |
array( 'reroute_requests' => 'no', 'nonce' => wp_create_nonce( 'reroute_requests' ) ),
|
266 |
wc_gateway_ppec()->get_admin_setting_link()
|
267 |
);
|
268 |
-
$api_creds_template = __( 'Payments will be authenticated by WooCommerce
|
269 |
if ( empty( $settings->api_username ) ) {
|
270 |
$api_creds_text = sprintf( $api_creds_template, add_query_arg( 'environment', 'live', $reset_link ) );
|
271 |
$form_fields['api_credentials']['description'] = $api_creds_text;
|
@@ -283,7 +283,7 @@ if ( ! class_exists( 'WC_Connect_PayPal_EC' ) ) {
|
|
283 |
array( 'reroute_requests' => 'yes', 'nonce' => wp_create_nonce( 'reroute_requests' ) ),
|
284 |
wc_gateway_ppec()->get_admin_setting_link()
|
285 |
);
|
286 |
-
$api_creds_template = __( 'To authenticate payments with WooCommerce
|
287 |
if ( empty( $settings->api_username ) ) {
|
288 |
$api_creds_text = sprintf( $api_creds_template, add_query_arg( 'environment', 'live', $reset_link ) );
|
289 |
$form_fields['api_credentials']['description'] .= '<br /><br />' . $api_creds_text;
|
265 |
array( 'reroute_requests' => 'no', 'nonce' => wp_create_nonce( 'reroute_requests' ) ),
|
266 |
wc_gateway_ppec()->get_admin_setting_link()
|
267 |
);
|
268 |
+
$api_creds_template = __( 'Payments will be authenticated by WooCommerce Shipping & Tax and directed to the following email address. To disable this feature and link a PayPal account, <a href="%s">click here</a>.', 'woocommerce-services' );
|
269 |
if ( empty( $settings->api_username ) ) {
|
270 |
$api_creds_text = sprintf( $api_creds_template, add_query_arg( 'environment', 'live', $reset_link ) );
|
271 |
$form_fields['api_credentials']['description'] = $api_creds_text;
|
283 |
array( 'reroute_requests' => 'yes', 'nonce' => wp_create_nonce( 'reroute_requests' ) ),
|
284 |
wc_gateway_ppec()->get_admin_setting_link()
|
285 |
);
|
286 |
+
$api_creds_template = __( 'To authenticate payments with WooCommerce Shipping & Tax, <a href="%s">click here</a>.', 'woocommerce-services' );
|
287 |
if ( empty( $settings->api_username ) ) {
|
288 |
$api_creds_text = sprintf( $api_creds_template, add_query_arg( 'environment', 'live', $reset_link ) );
|
289 |
$form_fields['api_credentials']['description'] .= '<br /><br />' . $api_creds_text;
|
classes/class-wc-connect-privacy.php
CHANGED
@@ -33,7 +33,7 @@ class WC_Connect_Privacy {
|
|
33 |
return;
|
34 |
}
|
35 |
|
36 |
-
$title = __( 'WooCommerce
|
37 |
$content = wpautop(
|
38 |
sprintf(
|
39 |
wp_kses(
|
@@ -63,7 +63,7 @@ class WC_Connect_Privacy {
|
|
63 |
|
64 |
?>
|
65 |
<div class="notice notice-warning" style="position: relative;">
|
66 |
-
<p><?php esc_html_e( 'Warning: Erasing personal data will cause the ability to reprint or refund WooCommerce
|
67 |
</div>
|
68 |
<?php
|
69 |
}
|
33 |
return;
|
34 |
}
|
35 |
|
36 |
+
$title = __( 'WooCommerce Shipping & Tax', 'woocommerce-services' );
|
37 |
$content = wpautop(
|
38 |
sprintf(
|
39 |
wp_kses(
|
63 |
|
64 |
?>
|
65 |
<div class="notice notice-warning" style="position: relative;">
|
66 |
+
<p><?php esc_html_e( 'Warning: Erasing personal data will cause the ability to reprint or refund WooCommerce Shipping & Tax shipping labels to be lost on the affected orders.', 'woocommerce-services' ); ?></p>
|
67 |
</div>
|
68 |
<?php
|
69 |
}
|
classes/class-wc-connect-service-settings-store.php
CHANGED
@@ -321,7 +321,7 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
|
|
321 |
}
|
322 |
|
323 |
/**
|
324 |
-
* Returns the service type and id for each enabled WooCommerce
|
325 |
*
|
326 |
* Shipping services also include instance_id and shipping zone id
|
327 |
*
|
321 |
}
|
322 |
|
323 |
/**
|
324 |
+
* Returns the service type and id for each enabled WooCommerce Shipping & Tax service
|
325 |
*
|
326 |
* Shipping services also include instance_id and shipping zone id
|
327 |
*
|
classes/class-wc-connect-settings-pages.php
CHANGED
@@ -21,7 +21,7 @@ if ( ! class_exists( 'WC_Connect_Settings_Pages' ) ) {
|
|
21 |
|
22 |
public function __construct( WC_Connect_API_Client $api_client ) {
|
23 |
$this->id = 'connect';
|
24 |
-
$this->label = _x( 'WooCommerce
|
25 |
$this->continents = new WC_Connect_Continents();
|
26 |
$this->api_client = $api_client;
|
27 |
|
@@ -39,7 +39,7 @@ if ( ! class_exists( 'WC_Connect_Settings_Pages' ) ) {
|
|
39 |
$shipping_tabs = array();
|
40 |
}
|
41 |
|
42 |
-
$shipping_tabs[ 'woocommerce-services-settings' ] = __( 'WooCommerce
|
43 |
return $shipping_tabs;
|
44 |
}
|
45 |
|
@@ -69,7 +69,7 @@ if ( ! class_exists( 'WC_Connect_Settings_Pages' ) ) {
|
|
69 |
if ( WC_Connect_Jetpack::is_active() ) {
|
70 |
$message = __( 'Note: Jetpack is connected, but development mode is also enabled on this site. Please disable development mode.', 'woocommerce-services' );
|
71 |
} else {
|
72 |
-
$message = __( 'Note: Jetpack development mode is enabled on this site. This site will not be able to obtain payment methods from WooCommerce
|
73 |
}
|
74 |
?>
|
75 |
<div class="wc-connect-admin-dev-notice">
|
@@ -81,7 +81,8 @@ if ( ! class_exists( 'WC_Connect_Settings_Pages' ) ) {
|
|
81 |
}
|
82 |
|
83 |
$extra_args = array();
|
84 |
-
|
|
|
85 |
$extra_args[ 'carriers' ] = $carriers_response->carriers;
|
86 |
}
|
87 |
|
@@ -103,7 +104,7 @@ if ( ! class_exists( 'WC_Connect_Settings_Pages' ) ) {
|
|
103 |
if ( $translated_carrier_name ) {
|
104 |
?>
|
105 |
<h2>
|
106 |
-
<a href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=shipping§ion=woocommerce-services-settings' ) ); ?>"><?php esc_html_e( 'WooCommerce
|
107 |
<span><?php echo esc_html( $translated_carrier_name ); ?></span>
|
108 |
</h2>
|
109 |
<?php
|
21 |
|
22 |
public function __construct( WC_Connect_API_Client $api_client ) {
|
23 |
$this->id = 'connect';
|
24 |
+
$this->label = _x( 'WooCommerce Shipping', 'The WooCommerce Shipping & Tax brandname', 'woocommerce-services' );
|
25 |
$this->continents = new WC_Connect_Continents();
|
26 |
$this->api_client = $api_client;
|
27 |
|
39 |
$shipping_tabs = array();
|
40 |
}
|
41 |
|
42 |
+
$shipping_tabs[ 'woocommerce-services-settings' ] = __( 'WooCommerce Shipping', 'woocommerce-services' );
|
43 |
return $shipping_tabs;
|
44 |
}
|
45 |
|
69 |
if ( WC_Connect_Jetpack::is_active() ) {
|
70 |
$message = __( 'Note: Jetpack is connected, but development mode is also enabled on this site. Please disable development mode.', 'woocommerce-services' );
|
71 |
} else {
|
72 |
+
$message = __( 'Note: Jetpack development mode is enabled on this site. This site will not be able to obtain payment methods from WooCommerce Shipping & Tax production servers.', 'woocommerce-services' );
|
73 |
}
|
74 |
?>
|
75 |
<div class="wc-connect-admin-dev-notice">
|
81 |
}
|
82 |
|
83 |
$extra_args = array();
|
84 |
+
$carriers_response = $this->api_client->get_carrier_accounts();
|
85 |
+
if ( ! is_wp_error( $carriers_response ) && $carriers_response ) {
|
86 |
$extra_args[ 'carriers' ] = $carriers_response->carriers;
|
87 |
}
|
88 |
|
104 |
if ( $translated_carrier_name ) {
|
105 |
?>
|
106 |
<h2>
|
107 |
+
<a href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=shipping§ion=woocommerce-services-settings' ) ); ?>"><?php esc_html_e( 'WooCommerce Shipping & Tax', 'woocommerce-services' ); ?></a> >
|
108 |
<span><?php echo esc_html( $translated_carrier_name ); ?></span>
|
109 |
</h2>
|
110 |
<?php
|
classes/class-wc-connect-shipping-label.php
CHANGED
@@ -320,6 +320,24 @@ if ( ! class_exists( 'WC_Connect_Shipping_Label' ) ) {
|
|
320 |
return in_array( $currency_code, $this->supported_currencies );
|
321 |
}
|
322 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
323 |
public function should_show_meta_box() {
|
324 |
if ( null === $this->show_metabox ) {
|
325 |
$this->show_metabox = $this->calculate_should_show_meta_box();
|
320 |
return in_array( $currency_code, $this->supported_currencies );
|
321 |
}
|
322 |
|
323 |
+
public function is_dhl_express_available() {
|
324 |
+
$dhl_express = $this->service_schemas_store->get_service_schema_by_id( 'dhlexpress' );
|
325 |
+
|
326 |
+
return !! $dhl_express;
|
327 |
+
}
|
328 |
+
|
329 |
+
public function is_order_dhl_express_eligible() {
|
330 |
+
if( ! $this-> is_dhl_express_available() ) return false;
|
331 |
+
|
332 |
+
$order = wc_get_order();
|
333 |
+
if ( ! $order ) return false;
|
334 |
+
|
335 |
+
$origin = $this->get_origin_address();
|
336 |
+
$destination = $this->get_destination_address( $order );
|
337 |
+
|
338 |
+
return $origin['country'] !== $destination['country'];
|
339 |
+
}
|
340 |
+
|
341 |
public function should_show_meta_box() {
|
342 |
if ( null === $this->show_metabox ) {
|
343 |
$this->show_metabox = $this->calculate_should_show_meta_box();
|
classes/class-wc-connect-shipping-method.php
CHANGED
@@ -302,7 +302,7 @@ if ( ! class_exists( 'WC_Connect_Shipping_Method' ) ) {
|
|
302 |
}
|
303 |
|
304 |
$this->debug( sprintf(
|
305 |
-
'WooCommerce
|
306 |
admin_url( 'admin.php?page=wc-status&tab=connect' )
|
307 |
) );
|
308 |
|
@@ -325,7 +325,7 @@ if ( ! class_exists( 'WC_Connect_Shipping_Method' ) ) {
|
|
325 |
return;
|
326 |
}
|
327 |
|
328 |
-
// TODO: Request rates for all WooCommerce
|
329 |
// the current shipping zone to avoid each method making an independent request
|
330 |
$services = array(
|
331 |
array(
|
@@ -611,7 +611,7 @@ if ( ! class_exists( 'WC_Connect_Shipping_Method' ) ) {
|
|
611 |
) );
|
612 |
|
613 |
if ( ! is_wp_error( $method_classes ) && ! empty( $method_classes ) ) {
|
614 |
-
$class_names = implode( wp_list_pluck( $method_classes, 'name' )
|
615 |
} else {
|
616 |
$class_names = 'No shipping classes found';
|
617 |
}
|
302 |
}
|
303 |
|
304 |
$this->debug( sprintf(
|
305 |
+
'WooCommerce Shipping & Tax debug mode is on - to hide these messages, turn debug mode off in the <a href="%s" style="text-decoration: underline;">settings</a>.',
|
306 |
admin_url( 'admin.php?page=wc-status&tab=connect' )
|
307 |
) );
|
308 |
|
325 |
return;
|
326 |
}
|
327 |
|
328 |
+
// TODO: Request rates for all WooCommerce Shipping & Tax powered methods in
|
329 |
// the current shipping zone to avoid each method making an independent request
|
330 |
$services = array(
|
331 |
array(
|
611 |
) );
|
612 |
|
613 |
if ( ! is_wp_error( $method_classes ) && ! empty( $method_classes ) ) {
|
614 |
+
$class_names = implode( ', ', wp_list_pluck( $method_classes, 'name' ) );
|
615 |
} else {
|
616 |
$class_names = 'No shipping classes found';
|
617 |
}
|
classes/class-wc-connect-stripe.php
CHANGED
@@ -49,7 +49,7 @@ if ( ! class_exists( 'WC_Connect_Stripe' ) ) {
|
|
49 |
}
|
50 |
|
51 |
if ( substr( $return_url, 0, 8 ) !== 'https://' ) {
|
52 |
-
return new WP_Error( 'invalid_url_protocol', __( 'Your site must be served over HTTPS in order to connect your Stripe account via WooCommerce
|
53 |
}
|
54 |
|
55 |
$result = $this->api->get_stripe_oauth_init( $return_url );
|
@@ -349,9 +349,9 @@ if ( ! class_exists( 'WC_Connect_Stripe' ) ) {
|
|
349 |
|
350 |
// Display a different title based on the connection status.
|
351 |
if ( $this->is_connected() ) {
|
352 |
-
$title = __( 'Stripe Account (connected to WooCommerce
|
353 |
} else {
|
354 |
-
$title = __( 'Connect via WooCommerce
|
355 |
}
|
356 |
|
357 |
$new_settings = array(
|
49 |
}
|
50 |
|
51 |
if ( substr( $return_url, 0, 8 ) !== 'https://' ) {
|
52 |
+
return new WP_Error( 'invalid_url_protocol', __( 'Your site must be served over HTTPS in order to connect your Stripe account via WooCommerce Shipping & Tax', 'woocommerce-services' ) );
|
53 |
}
|
54 |
|
55 |
$result = $this->api->get_stripe_oauth_init( $return_url );
|
349 |
|
350 |
// Display a different title based on the connection status.
|
351 |
if ( $this->is_connected() ) {
|
352 |
+
$title = __( 'Stripe Account (connected to WooCommerce Shipping & Tax)', 'woocommerce-services' );
|
353 |
} else {
|
354 |
+
$title = __( 'Connect via WooCommerce Shipping & Tax', 'woocommerce-services' );
|
355 |
}
|
356 |
|
357 |
$new_settings = array(
|
classes/class-wc-connect-taxjar-integration.php
CHANGED
@@ -134,7 +134,7 @@ class WC_Connect_TaxJar_Integration {
|
|
134 |
'title' => __( 'Automated taxes', 'woocommerce-services' ),
|
135 |
'id' => self::OPTION_NAME, // TODO: save in `wc_connect_options`?
|
136 |
'desc_tip' => $this->get_tax_tooltip(),
|
137 |
-
'desc' => $enabled ? '<p>' . __( 'Powered by WooCommerce
|
138 |
'default' => 'no',
|
139 |
'type' => 'select',
|
140 |
'class' => 'wc-enhanced-select',
|
134 |
'title' => __( 'Automated taxes', 'woocommerce-services' ),
|
135 |
'id' => self::OPTION_NAME, // TODO: save in `wc_connect_options`?
|
136 |
'desc_tip' => $this->get_tax_tooltip(),
|
137 |
+
'desc' => $enabled ? '<p>' . __( 'Powered by WooCommerce Tax.', 'woocommerce-services' ) . '</p>' : '',
|
138 |
'default' => 'no',
|
139 |
'type' => 'select',
|
140 |
'class' => 'wc-enhanced-select',
|
classes/class-wc-rest-connect-shipping-label-controller.php
CHANGED
@@ -93,6 +93,7 @@ class WC_REST_Connect_Shipping_Label_Controller extends WC_REST_Connect_Base_Con
|
|
93 |
'carrier_id' => $label_data->label->carrier_id,
|
94 |
'service_name' => $service_names[ $index ],
|
95 |
'status' => $label_data->label->status,
|
|
|
96 |
);
|
97 |
|
98 |
$package = $settings[ 'packages' ][ $index ];
|
93 |
'carrier_id' => $label_data->label->carrier_id,
|
94 |
'service_name' => $service_names[ $index ],
|
95 |
'status' => $label_data->label->status,
|
96 |
+
'commercial_invoice_url' => $label_data->label->commercial_invoice_url,
|
97 |
);
|
98 |
|
99 |
$package = $settings[ 'packages' ][ $index ];
|
dist/chunks/295a2240a399d69fb7e8.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[147],{537:function(e,t,n){"use strict";n.d(t,"i",function(){return O}),n.d(t,"s",function(){return p}),n.d(t,"r",function(){return m}),n.d(t,"q",function(){return g}),n.d(t,"g",function(){return E}),n.d(t,"u",function(){return v}),n.d(t,"t",function(){return I}),n.d(t,"l",function(){return _}),n.d(t,"e",function(){return h}),n.d(t,"k",function(){return j}),n.d(t,"o",function(){return S}),n.d(t,"m",function(){return P}),n.d(t,"f",function(){return L}),n.d(t,"n",function(){return N}),n.d(t,"p",function(){return M}),n.d(t,"d",function(){return T}),n.d(t,"b",function(){return w}),n.d(t,"h",function(){return D}),n.d(t,"c",function(){return V}),n.d(t,"j",function(){return G}),n.d(t,"a",function(){return x});var r=n(1),i=n(35),a=n(544),o=n(532),c=n(552),u=n(543),s=n(541),d=n(565),f=n(575),l=n(563),b=n(566),O=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",n,"shippingLabel",t],null)},p=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=O(e,t,n);return r&&r.loaded},m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=O(e,t,n);return r&&r.isFetching},g=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=O(e,t,n);return r&&r.error},E=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=O(e,t,n);return r&&r.loaded?r.labels:[]},v=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=O(e,t,n);return r&&r.fulfillOrder},I=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=O(e,t,n);return r&&r.emailDetails},_=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=O(e,t,n);return r&&r.refreshedLabelStatus},h=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=O(e,t,n);return r&&r.form},j=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),a=h(e,t,n);if(!a)return null;var c=a.rates,u=c.values,s=c.available,d=[],f=0,l=0,b=function(e){if(!(e in s))return"continue";var t=u[e],n=t.serviceId,a=t.signatureRequired,o=s[e].default.rates,c=null,b=null;a in s[e]&&(c=s[e][a].rates,b=Object(r.find)(c,function(e){return n===e.service_id})||null);var O=Object(r.find)(o,function(e){return n===e.service_id});if(O){var p=O.retail_rate-O.rate,m=O.rate,g={title:O.title,retailRate:O.retail_rate,rateWithDiscount:m,addons:[],carrierId:O.carrier_id,carrierTitle:O.title.split("-")[0].trim()};null!==b&&(g.addons=[{title:Object(i.translate)("Signature Required"),rate:b.rate-O.rate}],m=b.rate),d.push(g),f+=Object(r.round)(p,2),l+=m}};for(var O in u)b(O);return d.length?{prices:d,discount:f,total:l}:null},S=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),i=h(e,t,n);if(Object(r.isEmpty)(i))return!1;var a=Object(d.a)(i.origin),c=Object(d.a)(i.destination);return!("US"!==a.country||!Object(r.includes)(f.d,a.state))||(!("US"!==c.country||!Object(r.includes)(f.d,c.state))||a.country!==c.country&&(!Object(r.includes)(f.b,a.country)||!Object(r.includes)(f.b,c.country)))},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return[h(e,t,n)]}),C=function(e,t,n,a){var o=t.values,c=Object(d.a)(t),u=c.phone,s=c.postcode,b=c.state,O=c.country,p={};return["name","address","city","postcode","country"].forEach(function(e){o[e]||(p[e]=Object(i.translate)("This field is required"))}),Object(r.includes)(f.a,O)&&!/^\d{5}(?:-\d{4})?$/.test(s)&&(p.postcode=Object(i.translate)("Invalid ZIP/Postal code format")),!b&&Object(l.j)(e,O,n)&&(p.state=Object(i.translate)("This field is required")),a&&(u?10!==u.split(/\D+/g).join("").replace(/^1/,"").length&&(p.phone=Object(i.translate)("Customs forms require a 10-digit phone number. Please edit your phone number so it has at most 10 digits.")):p.phone=Object(i.translate)("Please enter a phone number for your origin address. It's required because this shipment requires a customs form.")),p},y=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=e.isNormalized,o=e.isUnverifiable,c=e.normalized,u=e.ignoreValidation,s=e.fieldErrors;if((a||o)&&!c&&s)return s;if(a&&!c)return{address:Object(i.translate)("This address is not recognized. Please try another.")};var d=C(t,e,n,r);return u&&Object.keys(d).forEach(function(e){u[e]&&delete d[e]}),d},R=function(e,t,n,a){var o=Object(r.uniq)(Object(r.flatten)(Object(r.map)(e,function(e){return Object(r.map)(e.items,"product_id")}))),c=Object(r.zipObject)(o,Object(r.fill)(Array(o.length),0));Object(r.forEach)(e,function(e){Object(r.forEach)(e.items,function(e){var n=e.quantity,r=e.product_id;return c[r]+=n*t.items[r].value})});var u={};return Object(r.forEach)(Object(r.pick)(t.items,o),function(e,t){e.tariffNumber&&6===e.tariffNumber.length&&(u[e.tariffNumber]||(u[e.tariffNumber]=0),u[e.tariffNumber]+=c[t])}),{packages:Object(r.mapValues)(e,function(e){var o={};"other"!==e.contentsType||e.contentsExplanation||(o.contentsExplanation=Object(i.translate)("Please describe what kind of goods this package contains")),"other"!==e.restrictionType||e.restrictionComments||(o.restrictionComments=Object(i.translate)("Please describe what kind of restrictions this package must have"));var c=new Set;return Object(r.forEach)(e.items,function(e){var n=e.product_id,r=t.items[n].tariffNumber;2500<u[r]&&c.add(r)}),e.itn?/^(?:(?:AES X\d{14})|(?:NOEEI 30\.\d{1,2}(?:\([a-z]\)(?:\(\d\))?)?))$/.test(e.itn)||(o.itn=Object(i.translate)("Invalid format")):"CA"!==n&&(Object(r.isEmpty)(c)?Object(r.includes)(f.c,n)&&(o.itn=Object(i.translate)("International Transaction Number is required for shipments to %(country)s",{args:{country:a}})):o.itn=Object(i.translate)("International Transaction Number is required for shipping items valued over $2,500 per tariff number. Products with tariff number %(code)s add up to more than $2,500.",{args:{code:c.values().next().value}})),o}),items:Object(r.mapValues)(Object(r.pick)(t.items,o),function(e,n){var a={};return e.description||(a.description=Object(i.translate)("This field is required")),t.ignoreWeightValidation[n]||(Object(r.isNil)(e.weight)||""===e.weight?a.weight=Object(i.translate)("This field is required"):parseFloat(e.weight)>0||(a.weight=Object(i.translate)("Weight must be greater than zero"))),t.ignoreValueValidation[n]||(Object(r.isNil)(e.value)||""===e.value?a.value=Object(i.translate)("This field is required"):parseFloat(e.value)>0||(a.value=Object(i.translate)("Declared value must be greater than zero"))),e.tariffNumber&&6!==e.tariffNumber.length&&(a.tariffNumber=Object(i.translate)("The tariff number must be 6 digits long")),a})}},P=function(e){var t=e.values,n=e.available,i=Object(r.map)(n,function(e,n){return t[n]});return!Object(r.isEmpty)(i)&&Object(r.every)(i)},k=function(e){var t=e.values,n=e.available;return Object(r.mapValues)(n,function(e,n){if(!Object(r.isEmpty)(e.default.errors)){var a=e.default.errors.map(function(e){return e.userMessage||e.message}).filter(Boolean);return a.length?a:["We couldn't get a rate for this package, please try again."]}return t[n]&&t[n].serviceId?[]:Object(r.isEmpty)(e.default.rates)?[Object(i.translate)("No rates available, please double check dimensions and weight or try using different packaging.")]:[Object(i.translate)("Please choose a rate")]})},A=function(e){var t={};return e||(t.paperSize=Object(i.translate)("This field is required")),t},L=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);if(!p(e,t,n))return{};var a=O(e,t,n),c=a.form,u=a.paperSize;if(Object(r.isEmpty)(c))return{};var s,d=c.destination.values.country,f=Object(l.g)(e,d,n),b=S(e,t,n);return{origin:y(c.origin,e,n,b),destination:y(c.destination,e,n),packages:(s=c.packages.selected,Object(r.mapValues)(s,function(e){var t={};"not_selected"===e.box_id&&(t.box_id=Object(i.translate)("Please select a package"));var n=function(e){return!Object(r.isFinite)(e)||0>=e};return n(e.weight)&&(t.weight=Object(i.translate)("Invalid weight")),Object(r.some)([e.length,e.width,e.height],n)&&(t.dimensions=Object(i.translate)("Package dimensions must be greater than zero")),t})),customs:R(c.packages.selected,c.customs,d,f),rates:k(c.rates),sidebar:A(u)}},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return[O(e,t,n)]}),N=Object(a.a)(function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(o.a)(e),i=O(e,t,r).form,a="origin"===n&&S(e,t,r),c=C(e,i[n],r,a);return 0===Object.keys(c).length},function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(o.a)(e);return[O(e,t,r).form[n]]}),M=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),i=h(e,t,n);if(!i)return!1;var a=Object(r.uniq)(Object(r.flatten)(Object(r.map)(i.packages.selected,function(e){return Object(r.map)(e.items,"product_id")})));return!Object(r.some)(a.map(function(e){return Object(r.isNil)(i.customs.items[e].tariffNumber)||i.customs.ignoreWeightValidation[e]||i.customs.ignoreValueValidation[e]}))},T=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),i=h(e,t,n);if(!i)return null;var a=L(e,t,n);return i.origin.isNormalized&&Object(r.isEqual)(i.origin.values,i.origin.normalized)&&!Object(c.a)(a.origin)?i.destination.isNormalized&&Object(r.isEqual)(i.destination.values,i.destination.normalized)&&!Object(c.a)(a.destination)?Object(c.a)(a.packages)?"packages":!S(e,t,n)||!Object(c.a)(a.customs)&&M(e,t,n)?Object(c.a)(a.rates)?"rates":null:"customs":"destination":"origin"},w=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),i=h(e,t,n);return!Object(r.isEmpty)(i)&&!T(e,t,n)&&!i.origin.normalizationInProgress&&!i.destination.normalizationInProgress&&!i.rates.retrievalInProgress&&!Object(r.isEmpty)(i.rates.available)},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return[h(e,t,n),T(e,t,n)]}),D=Object(a.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(o.a)(e),n=Object(l.d)(e,t);return Object(b.b)(e,t)?Object(r.pick)(n,f.a):Object(r.pick)(n,f.b)},[l.d,b.b]),V=Object(a.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(o.a)(e),n=Object(l.d)(e,t);return Object(b.b)(e,t)?n:Object(r.pick)(n,f.b)},[l.d,b.b]),G=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);if(!Object(l.j)(e,t,n))return null;var i=Object(l.i)(e,t,n),a={};return i.forEach(function(e){var t=e.code,n=e.name;return a[t]=n}),"US"!==t||Object(b.b)(e,n)?a:Object(r.omit)(a,f.d)},[l.i,b.b]),x=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return p(e,t,n)&&Object(u.d)(e,n)&&Object(s.i)(e,n)&&Object(l.b)(e,n)}},538:function(e,t,n){"use strict";n.d(t,"i",function(){return r}),n.d(t,"k",function(){return i}),n.d(t,"l",function(){return a}),n.d(t,"m",function(){return o}),n.d(t,"j",function(){return c}),n.d(t,"h",function(){return u}),n.d(t,"n",function(){return s}),n.d(t,"o",function(){return d}),n.d(t,"p",function(){return f}),n.d(t,"q",function(){return l}),n.d(t,"r",function(){return b}),n.d(t,"s",function(){return O}),n.d(t,"t",function(){return p}),n.d(t,"u",function(){return m}),n.d(t,"v",function(){return g}),n.d(t,"x",function(){return E}),n.d(t,"w",function(){return v}),n.d(t,"y",function(){return I}),n.d(t,"z",function(){return _}),n.d(t,"A",function(){return h}),n.d(t,"B",function(){return j}),n.d(t,"C",function(){return S}),n.d(t,"D",function(){return C}),n.d(t,"I",function(){return y}),n.d(t,"E",function(){return R}),n.d(t,"J",function(){return P}),n.d(t,"G",function(){return k}),n.d(t,"H",function(){return A}),n.d(t,"K",function(){return L}),n.d(t,"L",function(){return N}),n.d(t,"M",function(){return M}),n.d(t,"N",function(){return T}),n.d(t,"O",function(){return w}),n.d(t,"P",function(){return D}),n.d(t,"Q",function(){return V}),n.d(t,"R",function(){return G}),n.d(t,"S",function(){return x}),n.d(t,"T",function(){return U}),n.d(t,"U",function(){return W}),n.d(t,"F",function(){return F}),n.d(t,"V",function(){return B}),n.d(t,"W",function(){return z}),n.d(t,"X",function(){return H}),n.d(t,"Y",function(){return q}),n.d(t,"Z",function(){return K}),n.d(t,"ab",function(){return Q}),n.d(t,"bb",function(){return J}),n.d(t,"Vb",function(){return Y}),n.d(t,"cb",function(){return Z}),n.d(t,"db",function(){return X}),n.d(t,"eb",function(){return $}),n.d(t,"fb",function(){return ee}),n.d(t,"gb",function(){return te}),n.d(t,"hb",function(){return ne}),n.d(t,"ib",function(){return re}),n.d(t,"jb",function(){return ie}),n.d(t,"kb",function(){return ae}),n.d(t,"lb",function(){return oe}),n.d(t,"mb",function(){return ce}),n.d(t,"nb",function(){return ue}),n.d(t,"ob",function(){return se}),n.d(t,"pb",function(){return de}),n.d(t,"qb",function(){return fe}),n.d(t,"rb",function(){return le}),n.d(t,"sb",function(){return be}),n.d(t,"ub",function(){return Oe}),n.d(t,"tb",function(){return pe}),n.d(t,"vb",function(){return me}),n.d(t,"wb",function(){return ge}),n.d(t,"xb",function(){return Ee}),n.d(t,"yb",function(){return ve}),n.d(t,"zb",function(){return Ie}),n.d(t,"Ab",function(){return _e}),n.d(t,"Bb",function(){return he}),n.d(t,"Cb",function(){return je}),n.d(t,"Db",function(){return Se}),n.d(t,"Eb",function(){return Ce}),n.d(t,"Gb",function(){return ye}),n.d(t,"Hb",function(){return Re}),n.d(t,"Ib",function(){return Pe}),n.d(t,"Jb",function(){return ke}),n.d(t,"Kb",function(){return Ae}),n.d(t,"Lb",function(){return Le}),n.d(t,"Mb",function(){return Ne}),n.d(t,"Nb",function(){return Me}),n.d(t,"Ob",function(){return Te}),n.d(t,"Pb",function(){return we}),n.d(t,"Qb",function(){return De}),n.d(t,"Fb",function(){return Ve}),n.d(t,"Sb",function(){return Ge}),n.d(t,"Rb",function(){return xe}),n.d(t,"Tb",function(){return Ue}),n.d(t,"Ub",function(){return We}),n.d(t,"Wb",function(){return Fe}),n.d(t,"Xb",function(){return Be}),n.d(t,"Yb",function(){return ze}),n.d(t,"a",function(){return He}),n.d(t,"g",function(){return qe}),n.d(t,"e",function(){return Ke}),n.d(t,"f",function(){return Qe}),n.d(t,"c",function(){return Je}),n.d(t,"d",function(){return Ye}),n.d(t,"b",function(){return Ze});var r="WOOCOMMERCE_SERVICES_LABELS_INIT_FORM",i="WOOCOMMERCE_SERVICES_LABELS_RESTORE_PRISTINE",a="WOOCOMMERCE_SERVICES_LABELS_SET_FORM_DATA_VALUE",o="WOOCOMMERCE_SERVICES_LABELS_SET_FORM_META_PROPERTY",c="WOOCOMMERCE_SERVICES_LABELS_OPEN_ADD_CARD_DIALOG",u="WOOCOMMERCE_SERVICES_LABELS_CLOSE_ADD_CARD_DIALOG",s="WOOCOMMERCE_SERVICES_PACKAGES_ADD_PACKAGE",d="WOOCOMMERCE_SERVICES_PACKAGES_DISMISS_MODAL",f="WOOCOMMERCE_SERVICES_PACKAGES_EDIT_PACKAGE",l="WOOCOMMERCE_SERVICES_PACKAGES_INIT_PACKAGES_FORM",b="WOOCOMMERCE_SERVICES_PACKAGES_REMOVE_PACKAGE",O="WOOCOMMERCE_SERVICES_PACKAGES_REMOVE_PREDEFINED",p="WOOCOMMERCE_SERVICES_PACKAGES_SAVE_PACKAGE",m="WOOCOMMERCE_SERVICES_PACKAGES_SAVE_PREDEFINED",g="WOOCOMMERCE_SERVICES_PACKAGES_SET_ADD_MODE",E="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_FETCH_ERROR",v="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_FETCHING",I="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_SAVING",_="WOOCOMMERCE_SERVICES_PACKAGES_SET_MODAL_ERROR",h="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_ALL_PREDEFINED",j="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_OUTER_DIMENSIONS",S="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_PREDEFINED",C="WOOCOMMERCE_SERVICES_PACKAGES_UPDATE_PACKAGES_FIELD",y="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADD_ITEMS",R="WOOCOMMERCE_SERVICES_SERVICE_SETTINGS_UPDATE_FIELD",P="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADD_PACKAGE",k="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADDRESS_NORMALIZATION_COMPLETED",A="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADDRESS_NORMALIZATION_IN_PROGRESS",L="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLEAR_AVAILABLE_RATES",N="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_ADD_ITEM",M="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_DETAILS_DIALOG",T="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_ITEM_MOVE",w="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_REFUND_DIALOG",D="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_REPRINT_DIALOG",V="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CONFIRM_ADDRESS_SUGGESTION",G="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CONFIRM_REPRINT",x="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EDIT_ADDRESS",U="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EDIT_UNVERIFIABLE_ADDRESS",W="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EXIT_PRINTING_FLOW",F="WOOCOMMERCE_SERVICES_SHIPPING_EXIT_TRACKING_FLOW",B="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_INIT",z="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_MOVE_ITEM",H="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_ADD_ITEM",q="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_DETAILS_DIALOG",K="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_ITEM_MOVE",Q="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_PACKAGE",J="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_PRINTING_FLOW",Y="WOOCOMMERCE_SERVICES_SHIPPING_OPEN_TRACKING_FLOW",Z="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_REFUND_DIALOG",X="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_REPRINT_DIALOG",$="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_PURCHASE_REQUEST",ee="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_PURCHASE_RESPONSE",te="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_RATES_RETRIEVAL_COMPLETED",ne="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_RATES_RETRIEVAL_IN_PROGRESS",re="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REFUND_REQUEST",ie="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REFUND_RESPONSE",ae="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REMOVE_IGNORE_VALIDATION",oe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REMOVE_PACKAGE",ce="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REPRINT_DIALOG_ERROR",ue="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REPRINT_DIALOG_READY",se="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SAVE_CUSTOMS",de="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SAVE_PACKAGES",fe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SELECT_NORMALIZED_ADDRESS",le="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ABANDON_ON_NON_DELIVERY",be="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ADDED_ITEM",Oe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CONTENTS_TYPE",pe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CONTENTS_EXPLANATION",me="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_DESCRIPTION",ge="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_ORIGIN_COUNTRY",Ee="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_TARIFF_NUMBER",ve="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_VALUE",Ie="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_WEIGHT",_e="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_EMAIL_DETAILS",he="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_FETCH_ERROR",je="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_FULFILL_ORDER",Se="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_IS_FETCHING",Ce="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ITN",ye="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_PACKAGE_TYPE",Re="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RATES",Pe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RESTRICTION_COMMENTS",ke="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RESTRICTION_TYPE",Ae="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_TARGET_PACKAGE",Le="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SHOW_PRINT_CONFIRMATION",Ne="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_STATUS_RESPONSE",Me="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_STATUS_RETRIEVAL_IN_PROGRESS",Te="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_TOGGLE_STEP",we="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_ADDRESS_VALUE",De="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_PACKAGE_WEIGHT",Ve="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_PACKAGE_SIGNATURE",Ge="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_RATE",xe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_PAPER_SIZE",Ue="WOOCOMMERCE_SERVICES_SHIPPING_METHOD_SCHEMA_REQUEST",We="WOOCOMMERCE_SERVICES_SHIPPING_METHOD_SCHEMA_REQUEST_SUCCESS",Fe="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_SETTINGS_REQUEST",Be="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_SETTINGS_REQUEST_SUCCESS",ze="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_UPDATE",He="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_CONNECTION_SUCCESS",qe="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_UPDATE_SETTINGS",Ke="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_TOGGLE_IS_SAVING",Qe="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_TOGGLE_SHOW_UPS_INVOICE_FIELDS",Je="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_ENABLE_CANCEL_CONNECTION_DIALOG",Ye="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_ENABLE_DISCONNECT_DIALOG",Ze="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_DISCONNECT_CARRIER"},539:function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"a",function(){return i});var r="LOADING",i="ERROR"},540:function(e,t,n){"use strict";n.d(t,"q",function(){return R}),n.d(t,"U",function(){return P}),n.d(t,"x",function(){return M}),n.d(t,"A",function(){return T}),n.d(t,"o",function(){return w}),n.d(t,"p",function(){return D}),n.d(t,"V",function(){return V}),n.d(t,"C",function(){return G}),n.d(t,"m",function(){return x}),n.d(t,"n",function(){return U}),n.d(t,"g",function(){return W}),n.d(t,"T",function(){return F}),n.d(t,"W",function(){return B}),n.d(t,"w",function(){return z}),n.d(t,"v",function(){return H}),n.d(t,"s",function(){return q}),n.d(t,"d",function(){return K}),n.d(t,"S",function(){return Q}),n.d(t,"t",function(){return J}),n.d(t,"b",function(){return Y}),n.d(t,"E",function(){return Z}),n.d(t,"a",function(){return X}),n.d(t,"P",function(){return $}),n.d(t,"i",function(){return ee}),n.d(t,"G",function(){return te}),n.d(t,"F",function(){return ne}),n.d(t,"R",function(){return re}),n.d(t,"Q",function(){return ie}),n.d(t,"D",function(){return ae}),n.d(t,"O",function(){return oe}),n.d(t,"H",function(){return ce}),n.d(t,"J",function(){return ue}),n.d(t,"L",function(){return se}),n.d(t,"K",function(){return de}),n.d(t,"I",function(){return fe}),n.d(t,"h",function(){return le}),n.d(t,"Y",function(){return be}),n.d(t,"M",function(){return Oe}),n.d(t,"N",function(){return pe}),n.d(t,"B",function(){return je}),n.d(t,"j",function(){return Se}),n.d(t,"y",function(){return Ce}),n.d(t,"r",function(){return ye}),n.d(t,"e",function(){return Re}),n.d(t,"k",function(){return Pe}),n.d(t,"z",function(){return ke}),n.d(t,"f",function(){return Ae}),n.d(t,"l",function(){return Le}),n.d(t,"X",function(){return Ne}),n.d(t,"u",function(){return Me}),n.d(t,"c",function(){return Te});var r=n(110),i=n.n(r),a=n(36),o=n.n(a),c=n(35),u=n(1),s=n(547),d=Object(u.memoize)(function(){if(Object(u.get)(window,"navigator.msSaveOrOpenBlob"))return"ie";if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream)return"addon";if(Object(u.includes)(navigator.userAgent,"Firefox"))return"addon";if(navigator.mimeTypes["application/pdf"])return"native";var e=function(e){try{return new ActiveXObject(e)}catch(t){}};return!(!e("AcroPDF.PDF")&&!e("PDF.PdfCtrl"))&&"addon"}),f=null,l=function(e){return new Promise(function(t,n){f&&document.body.removeChild(f),(f=document.createElement("iframe")).src=e,f.style.position="fixed",f.style.left="-999px",f.onload=function(){t()},f.onerror=function(e){n(e)},document.body.appendChild(f)})},b=function(e,t){var n=function(e,t){for(var n=atob(e),r=n.length,i=new Uint8Array(new ArrayBuffer(r)),a=0;a<r;a++)i[a]=n.charCodeAt(a);return new Blob([i],{type:t})}(e.b64Content,e.mimeType),r="ie"!==d()?URL.createObjectURL(n):null;switch(d()){case"native":return l(r).then(function(){f.contentWindow.print(),URL.revokeObjectURL(r)});case"addon":var i=window.open(r);return setTimeout(function(){return URL.revokeObjectURL(r)},1e3),i?Promise.resolve():Promise.reject(new Error("Unable to open label PDF in new tab"));case"ie":return window.navigator.msSaveOrOpenBlob(n,t)?Promise.resolve():Promise.reject(new Error("Unable to download the PDF"));default:return l(r),setTimeout(function(){return URL.revokeObjectURL(r)},0),Promise.resolve()}},O=n(549),p=n(552),m=n(538),g=function(e,t,n,r,i){n({type:m.H,group:i,orderId:e,siteId:t});return s.c(t,s.d.addressNormalization(),{address:r,type:i}).then(function(r){n({type:m.G,siteId:t,orderId:e,group:i,requestSuccess:!0,fieldErrors:r.field_errors,normalized:r.normalized,isTrivialNormalization:r.is_trivial_normalization})}).catch(function(r){throw n(O.a(Object(c.translate)("Error validating %(group)s address: %(error)s",{args:{group:i,error:r}}))),n({type:m.G,siteId:t,orderId:e,group:i,requestSuccess:!1}),r})},E=n(604),v=n(537),I=n(687),_=n(638),h=n(541),j=n(543),S=n(565),C="label-image-download-failed",y="label-image-download-printing",R=function(e,t){return function(n){n({type:m.Db,orderId:e,siteId:t,isFetching:!0}),s.b(t,s.d.orderLabels(e)).then(function(r){n(o()({type:m.V,siteId:t,orderId:e},r))}).catch(function(r){n({type:m.Bb,orderId:e,siteId:t,error:!0}),console.error(r)}).then(function(){return n({type:m.Db,orderId:e,siteId:t,isFetching:!1})})}},P=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return{type:m.Ob,siteId:t,orderId:e,stepName:n,expanded:r}},k=function(e,t,n,r){var i=r(),a=Object(v.i)(i,e,t).form,o=Object(v.d)(i,e,t);o&&!a[o].expanded&&n(P(e,t,o))},A=function(e,t){var n=Object(u.pick)(e,["id","box_id","service_id","length","width","height","weight","signature","is_letter"]);return t&&(n.contents_type=e.contentsType||"merchandise","other"===e.contentsType&&(n.contents_explanation=e.contentsExplanation),n.restriction_type=e.restrictionType||"none","other"===e.restrictionType&&(n.restriction_comments=e.restrictionComments),n.non_delivery_option=e.abandonOnNonDelivery?"abandon":"return",n.itn=e.itn||"",n.items=Object(u.uniqBy)(e.items,"product_id").map(function(n){var r=n.product_id,i=Object(u.sumBy)(Object(u.filter)(e.items,{product_id:r}),"quantity");return{description:t[r].description,quantity:i,value:i*t[r].value,weight:i*t[r].weight,hs_tariff_number:t[r].tariffNumber||"",origin_country:t[r].originCountry,product_id:r}})),n},L=function(e,t){return{type:m.K,orderId:e,siteId:t}},N=function e(t,n,r,i){var a=i(),o=Object(v.d)(a,t,n);if(o&&"rates"!==o)k(t,n,r,i);else{var d=Object(v.i)(a,t,n).form,f=d.origin,l=d.destination,b=d.packages,p=d.customs;r(O.c("wcs-label-rates"));var g=Object(v.o)(i(),t,n)?p.items:null,E=Object(u.map)(b.selected,function(e){return A(e,g)});(function(e,t,n,r,i,a){var o={origin:r,destination:i,packages:a};return n({type:m.hb,requestData:o,siteId:t,orderId:e}),new Promise(function(r,i){var a=null,c=function(c){c||(n({type:m.gb,requestData:o,siteId:t,orderId:e}),a?setTimeout(function(){return i(a)},0):setTimeout(r,0))};c(!0),s.c(t,s.d.getLabelRates(e),o).then(function(r){n({type:m.Hb,rates:r.rates,requestData:o,siteId:t,orderId:e})}).catch(function(e){return a=e}).then(function(){return c(!1)})})})(t,n,r,f.values,l.values,E).then(function(){return k(t,n,r,i)}).catch(function(a){console.error(a),r(O.a(a.toString(),{id:"wcs-label-rates",button:Object(c.translate)("Retry"),onClick:function(){return e(t,n,r,i)}}))})}},M=function(e,t){return function(n,r){var i,a=Object(v.i)(r(),e,t).form,o=a.origin,c=a.destination,u=Object(v.f)(r(),e,t),s=[];o.ignoreValidation||Object(p.a)(u.origin)||o.isNormalized||o.normalizationInProgress||s.push(g(e,t,n,o.values,"origin")),(o.ignoreValidation||Object(p.a)(u.origin))&&n(P(e,t,"origin")),c.ignoreValidation||Object(p.a)(u.destination)||c.isNormalized||c.normalizationInProgress||s.push(g(e,t,n,c.values,"destination")),(c.ignoreValidation||Object(p.a)(u.destination))&&n(P(e,t,"destination")),(i=s,Promise.all(i.map(function(e){return e.catch(function(e){return e})}))).then(function(){return N(e,t,n,r)}),n({type:m.bb,orderId:e,siteId:t})}},T=function(e,t){return function(n){n({type:m.Vb,orderId:e,siteId:t})}},w=function(e,t,n){return function(r,i){r({type:m.U,orderId:e,siteId:t,force:n}),Object(v.i)(i(),e,t).form.needsPrintConfirmation&&r(L(e,t))}},D=function(e,t){return function(n){n({type:m.F,orderId:e,siteId:t})}},V=function(e,t,n,r,i){return{type:m.Pb,siteId:t,orderId:e,group:n,name:r,value:i}},G=function(e,t,n,r){return{type:m.qb,siteId:t,orderId:e,group:n,selectNormalized:r}},x=function(e,t,n){return{type:m.S,siteId:t,orderId:e,group:n}},U=function(e,t,n){return{type:m.T,siteId:t,orderId:e,group:n}},W=function(e,t,n){return function(r,i){r({type:m.Q,siteId:t,orderId:e,group:n}),N(e,t,r,i)}},F=function(e,t,n){return function(r,i){var a=Object(v.i)(i(),e,t).form[n];if(a.ignoreValidation){r(function(e,t,n){return{type:m.kb,siteId:t,orderId:e,group:n}}(e,t,n));var o=Object(v.f)(i(),e,t);if(Object(p.a)(o[n]))return;a=Object(v.i)(i(),e,t).form[n]}return g(e,t,r,Object(v.i)(i(),e,t).form[n].values,n).then(function(){var a=Object(v.i)(i(),e,t).form[n],o=a.values,c=a.normalized,s=a.expanded;Object(u.isEqual)(o,c)&&(s&&r(P(e,t,n)),N(e,t,r,i))})}},B=function(e,t,n,r){return{type:m.Qb,siteId:t,orderId:e,packageId:n,value:r}},z=function(e,t,n){return{type:m.ab,siteId:t,orderId:e,openedPackageId:n}},H=function(e,t,n){return{type:m.Z,siteId:t,orderId:e,movedItemIndex:n}},q=function(e,t,n,r,i){return{type:m.W,siteId:t,orderId:e,originPackageId:n,movedItemIndex:r,targetPackageId:i}},K=function(e,t){return{type:m.N,siteId:t,orderId:e}},Q=function(e,t,n){return{type:m.Kb,targetPackageId:n,siteId:t,orderId:e}},J=function(e,t){return{type:m.X,siteId:t,orderId:e}},Y=function(e,t){return{type:m.L,siteId:t,orderId:e}},Z=function(e,t,n,r,i){return{type:m.sb,siteId:t,orderId:e,sourcePackageId:n,movedItemIndex:r,added:i}},X=function(e,t,n){return{type:m.I,siteId:t,orderId:e,targetPackageId:n}},$=function(e,t,n,r){return function(i,a){var o=Object(h.a)(a(),t)[r];i({type:m.Gb,siteId:t,orderId:e,packageId:n,boxTypeId:r,box:o})}},ee=function(e,t){return function(n,r){n(P(e,t,"packages")),n(function(e,t){return{type:m.pb,siteId:t,orderId:e}}(e,t)),N(e,t,n,r)}},te=function(e,t,n,r){return{type:m.ub,siteId:t,orderId:e,packageId:n,contentsType:r}},ne=function(e,t,n,r){return{type:m.tb,siteId:t,orderId:e,packageId:n,contentsExplanation:r}},re=function(e,t,n,r){return{type:m.Jb,siteId:t,orderId:e,packageId:n,restrictionType:r}},ie=function(e,t,n,r){return{type:m.Ib,siteId:t,orderId:e,packageId:n,restrictionComments:r}},ae=function(e,t,n,r){return{type:m.rb,siteId:t,orderId:e,packageId:n,abandonOnNonDelivery:r}},oe=function(e,t,n,r){return{type:m.Eb,siteId:t,orderId:e,packageId:n,itn:r}},ce=function(e,t,n,r){return{type:m.vb,siteId:t,orderId:e,productId:n,description:r}},ue=function(e,t,n,r){return{type:m.xb,siteId:t,orderId:e,productId:n,tariffNumber:r}},se=function(e,t,n,r){return{type:m.zb,siteId:t,orderId:e,productId:n,weight:r}},de=function(e,t,n,r){return{type:m.yb,siteId:t,orderId:e,productId:n,value:r}},fe=function(e,t,n,r){return{type:m.wb,siteId:t,orderId:e,productId:n,originCountry:r}},le=function(e,t){return function(n,r){n(P(e,t,"customs")),n(function(e,t){return{type:m.ob,siteId:t,orderId:e}}(e,t)),N(e,t,n,r)}},be=function(e,t,n,r,i){return{type:m.Sb,siteId:t,orderId:e,packageId:n,serviceId:r,signatureRequired:i}},Oe=function(e,t,n){return{type:m.Ab,siteId:t,orderId:e,value:n}},pe=function(e,t,n){return{type:m.Cb,siteId:t,orderId:e,value:n}},me=function(e,t,n,r){return{type:m.fb,orderId:e,siteId:t,response:n,error:r}},ge=function(e,t,n,r,i){n(me(e,t,null,!0));var a={button:Object(c.translate)("Go to Credit Cards settings."),onClick:function(){window.open("admin.php?page=wc-settings&tab=shipping§ion=woocommerce-services-settings")}};n(O.a(i.toString(),a)),n(L(e,t)),N(e,t,n,r,u.noop)},Ee=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"order-#".concat(e,"-label")+(t?"-reprint":"")+".pdf"},ve=function(e,t,n,r,i,a){n(w(e,t,!0)),n(L(e,t)),i||(Object(v.t)(r(),e,t)&&n(Object(I.a)(t,e,{note:Object(c.translate)("Your order has been shipped. The tracking number is %(trackingNumbers)s.","Your order consisting of %(packageCount)d packages has been shipped. The tracking numbers are %(trackingNumbers)s.",{args:{packageCount:a.length,trackingNumbers:a.map(function(e){var t=e.tracking,n={usps:"USPS",ups:"UPS"}[e.carrier_id||""];return n?"".concat(t," (").concat(n,")"):t}).join(", ")},count:a.length}),customer_note:!0})),Object(v.u)(r(),e,t)&&n(Object(_.f)(t,{id:e,status:"completed"})))},Ie=function(e){return O.d(Object(c.translate)("Your shipping label was purchased successfully","Your %(count)d shipping labels were purchased successfully",{count:e,args:{count:e}}))},_e=function(e,t){var n=Object(c.translate)('Your shipping label was purchased successfully, but could not be printed automatically. Click "Reprint" to try again.','Your shipping labels were purchased successfully, but some of them could not be printed automatically. Click "Reprint" to try again.',{count:e});return O.a(n,{id:C,button:Object(c.translate)("Reprint"),onClick:t})};var he=function e(t,n,r,a,o){var f=Object(u.find)(o,{status:"PURCHASE_ERROR"});f?ge(t,n,r,a,f.error):Object(u.every)(o,{status:"PURCHASED"})?(r(me(t,n,o,!1)),function e(t,n,r,a,o){var u=arguments,f=1===o.length?[{labelId:o[0].label_id}]:o.map(function(e,t){return{caption:Object(c.translate)("PACKAGE %(num)d (OF %(total)d)",{args:{num:t+1,total:o.length}}),labelId:e.label_id}}),l=Object(v.i)(a(),t,n).paperSize,p=Object(E.b)(l,f),g=function(){r(Ie(f.length))},I=function(){r(O.c(C)),r(O.b(Object(c.translate)("Printing\u2026"),{id:y})),e.apply(void 0,i()(u))},_=!1;s.b(n,p).then(function(e){r(O.c(y)),"addon"===d()?(g(),r({type:m.Lb,orderId:t,siteId:n,fileData:e,labels:o})):b(e,Ee(t)).then(function(){g()}).catch(function(e){r(O.a(e.toString())),_=!0}).then(function(){ve(t,n,r,a,_,o)})}).catch(function(){r(w(t,n,!0)),r(L(t,n)),r(O.c(y)),r(_e(o.length,I))})}(t,n,r,a,o)):setTimeout(function(){var i=o.map(function(e){return"PURCHASED"===e.status?e:function e(t,n,r,i){var a=1e3;return 0===i&&(a=2e3),s.b(n,s.d.labelStatus(t,r)).then(function(e){return e.label}).catch(function(o){if(!Object(u.includes)(o,"cURL error 28")||i>=3)throw o;return new Promise(function(o){setTimeout(function(){return o(e(t,n,r,i+1))},a)})})}(t,n,e.label_id,0)});Promise.all(i).then(function(i){return e(t,n,r,a,i)}).catch(function(e){return ge(t,n,r,a,e)})},1e3)},je=function(e,t){return function(n,r){var i=null,a=null,c=function(e){return i=e},d=function(e){a=e.labels},f=function(o){o?n({type:m.eb,orderId:e,siteId:t}):i?ge(e,t,n,r,i):he(e,t,n,r,a)},l=Object(v.i)(r(),e,t).form,b=[];if(!l.origin.isNormalized){var p=g(e,t,n,l.origin.values,"origin");b.push(p)}if(!l.destination.isNormalized){var E=g(e,t,n,l.destination.values,"destination");b.push(E)}Promise.all(b).then(function(n){if(Object(u.every)(n)){l=Object(v.i)(r(),e,t).form;var i=Object(v.o)(r(),e,t)?l.customs.items:null,a={async:!0,origin:Object(S.a)(l.origin),destination:Object(S.a)(l.destination),packages:Object(u.map)(l.packages.selected,function(e,t){var n=l.rates.values[t],r=n.serviceId,a=n.signatureRequired,c=a in l.rates.available[t]?a:"default",s=A(e,i),d=Object(u.find)(l.rates.available[t][c].rates,function(e){return r===e.service_id});return o()({},s,{shipment_id:d.shipment_id,rate_id:d.rate_id,service_id:r,carrier_id:d.carrier_id,service_name:d.title,products:Object(u.flatten)(e.items.map(function(e){return Object(u.fill)(new Array(e.quantity),e.product_id)}))})})},b=Object(j.e)(r(),t);Object(u.isBoolean)(b)&&(a.email_receipt=b),f(!0),s.c(t,s.d.orderLabels(e),a).then(d).catch(c).then(function(){return f(!1)})}}).catch(function(e){console.error(e),n(O.a(e.toString()))})}},Se=function(e,t){return function(n,r){var i=Object(v.i)(r(),e,t);b(i.form.fileData,Ee(e)).then(function(){n(w(e,t,!0)),n(L(e,t)),ve(e,t,n,r,!1,i.form.labelsToPrint)}).catch(function(e){return n(O.a(e.toString()))})}},Ce=function(e,t,n){return{type:m.cb,labelId:n,siteId:t,orderId:e}},ye=function(e,t){return function(n,r){var i=Object(v.i)(r(),e,t).labels.map(function(r){if(!r.statusUpdated&&!function(e){return Object(u.get)(e,"statusRetrivalInProgress",!1)}(r)){var i=r.label_id,a=null,o=null;return n({type:m.Nb,orderId:e,labelId:i}),s.b(t,s.d.labelStatus(e,i)).then(function(e){o=e.label}).catch(function(e){return a=e}).then(function(){if(n({type:m.Mb,orderId:e,siteId:t,labelId:i,response:o,error:a}),a)throw a})}});Promise.all(i).catch(function(e){n(O.a("Failed to retrieve shipping label refund status: ".concat(e)))})}},Re=function(e,t){return{type:m.O,orderId:e,siteId:t}},Pe=function(e,t){return function(n,r){var i=Object(v.i)(r(),e,t).refundDialog.labelId,a=null,o=null,u=function(r){r?n({type:m.ib,orderId:e,siteId:t}):(n({type:m.jb,response:o,error:a,orderId:e,siteId:t}),n(a?O.a(a.toString()):O.d(Object(c.translate)("The refund request has been sent successfully."),{duration:5e3})))};u(!0),s.c(t,s.d.labelRefund(e,i)).then(function(e){o=e.refund}).catch(function(e){a=e}).then(function(){return u(!1)})}},ke=function e(t,n,r){return function(i,a){i({type:m.db,labelId:r,orderId:t,siteId:n}),i(O.c("wcs-reprint-label"));var o=Object(v.i)(a(),t,n),u=Object(E.b)(o.paperSize,[{labelId:r}]);s.b(n,u).then(function(e){var c=Object(v.i)(a(),t,n);o.paperSize===c.paperSize&&i({type:m.nb,labelId:r,orderId:t,siteId:n,fileData:e})}).catch(function(a){i({type:m.mb,labelId:r,orderId:t,siteId:n}),i(O.a(a.toString(),{id:"wcs-reprint-label",button:Object(c.translate)("Retry"),onClick:function(){return i(e(t,n,r))}}))})}},Ae=function(e,t){return{type:m.P,orderId:e,siteId:t}},Le=function(e,t){return function(n,r){n({type:m.R,orderId:e,siteId:t});var i=Object(v.i)(r(),e,t);b(i.reprintDialog.fileData,Ee(e,!0)).catch(function(e){console.error(e),n(O.a(e.toString()))}).then(function(){return n(Ae(e,t))})}},Ne=function(e,t,n){return function(r,i){r({type:m.Rb,siteId:t,orderId:e,value:n});var a=Object(v.i)(i(),e,t);null!=a.reprintDialog&&r(ke(e,t,a.reprintDialog.labelId))}},Me=function(e,t,n){return{type:m.Y,labelId:n,siteId:t,orderId:e}},Te=function(e,t){return{type:m.M,orderId:e,siteId:t}}},541:function(e,t,n){"use strict";n.d(t,"e",function(){return O}),n.d(t,"b",function(){return m}),n.d(t,"d",function(){return g}),n.d(t,"a",function(){return E}),n.d(t,"c",function(){return v}),n.d(t,"f",function(){return I}),n.d(t,"i",function(){return _}),n.d(t,"h",function(){return h}),n.d(t,"g",function(){return j});var r=n(110),i=n.n(r),a=n(36),o=n.n(a),c=n(1),u=n(35),s=n(544),d=n(532),f=n(575),l=n(565),b=n(537),O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e);return Object(c.get)(e,["extensions","woocommerce","woocommerceServices",t,"packages"],null)},p=function(e){return e&&e.predefinedSchema?Object.keys(e.predefinedSchema):[]},m=Object(s.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=O(e,t);if(!n||!n.predefinedSchema||!n.packages)return null;var r=[];Object(c.forEach)(n.predefinedSchema,function(e,t){var i=(n.packages.predefined||{})[t]||[];Object(c.forEach)(e,function(e){var n=e.definitions;Object(c.forEach)(n,function(e){Object(c.includes)(i,e.id)&&r.push(o()({},e,{serviceId:t}))})})});var i=(n.packages.custom||[]).map(function(e,t){return o()({},e,{index:t})});return Object(c.orderBy)(r.concat(i),"name")},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=O(e,t);if(!n||!n.packages)return[];var r=p(n);return[].concat(i()(n.packages.custom||[]),i()(r.map(function(e){return(n.packages.predefined||{})[e]})))}),g=Object(s.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(d.a)(e),r=O(e,n);if(!r||!r.predefinedSchema||!r.packages)return null;var i=Object(b.e)(e,t,n),a=Object(l.a)(i.origin).country,o=Object(l.a)(i.destination).country,s=f.a.includes(a)&&!f.a.includes(o),p={custom:{title:Object(u.translate)("Custom Packages"),definitions:r.packages.custom}};return Object(c.forEach)(r.predefinedSchema,function(e,t){var n=(r.packages.predefined||{})[t]||[];Object(c.forEach)(e,function(e,t){var r=e.definitions,i={title:e.title,definitions:[]};Object(c.forEach)(r,function(e){s&&!1===e.can_ship_international||Object(c.includes)(n,e.id)&&i.definitions.push(e)}),i.definitions.length&&(p[t]=i)})}),p},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(d.a)(e),r=O(e,n);if(!r||!r.packages)return[];var a=p(r),o=Object(b.e)(e,t,n),c=Object(l.a)(o.origin).country,u=Object(l.a)(o.destination).country;return[].concat(i()(r.packages.custom||[]),i()(a.map(function(e){return(r.packages.predefined||{})[e]})),[c,u])}),E=Object(s.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=O(e,t);if(!n||!n.predefinedSchema||!n.packages)return null;var r={};return Object(c.forEach)(n.packages.custom,function(e){r[e.name]=e}),Object(c.forEach)(n.predefinedSchema,function(e){Object(c.forEach)(e,function(e){var t=e.definitions;Object(c.forEach)(t,function(e){r[e.id]=e})})}),r},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=O(e,t);if(!n||!n.packages)return[];var r=p(n);return[].concat(i()(n.packages.custom||[]),i()(r.map(function(e){return(n.packages.predefined||{})[e]})))}),v=Object(s.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=O(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return null;var r={},i=n.predefinedSchema,a=n.currentlyEditingPredefinedPackages;return Object(c.forEach)(i,function(e,t){var n=a[t]||[];Object(c.forEach)(e,function(e,i){var a={groupId:i,serviceId:t,title:e.title,packages:[],total:e.definitions.length,selected:0};Object(c.forEach)(e.definitions,function(e){var r=Object(c.includes)(n,e.id);r&&a.selected++,a.packages.push(o()({},e,{selected:r,serviceId:t}))}),r["".concat(t,"-").concat(i)]=a})}),r},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=O(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return[];var r=p(n);return i()(r.map(function(e){return n.currentlyEditingPredefinedPackages[e]}))}),I=Object(s.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=0,r=0,i=O(e,t);if(!i||!i.currentlyEditingPredefinedPackages)return{added:n,removed:r};var a=i.packages&&i.packages.predefined?i.packages.predefined:{},o=i.currentlyEditingPredefinedPackages;return Object.keys(o).forEach(function(e){var t=a[e],r=o[e];t?r.forEach(function(e){Object(c.includes)(t,e)||n++}):n+=r.length}),Object.keys(a).forEach(function(e){var t=a[e],n=o[e];n?t.forEach(function(e){Object(c.includes)(n,e)||r++}):r+=t.length}),{added:n,removed:r}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=O(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return[];var r=p(n);return[].concat(i()(r.map(function(e){return n.packages&&n.packages.predefined&&n.packages.predefined[e]})),i()(r.map(function(e){return n.currentlyEditingPredefinedPackages[e]})))}),_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=O(e,t);return n&&n.isLoaded},h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=O(e,t);return n&&n.isFetching},j=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=O(e,t);return n&&n.isFetchError}},543:function(e,t,n){"use strict";n.d(t,"f",function(){return o}),n.d(t,"g",function(){return c}),n.d(t,"h",function(){return u}),n.d(t,"i",function(){return s}),n.d(t,"d",function(){return d}),n.d(t,"c",function(){return f}),n.d(t,"b",function(){return l}),n.d(t,"a",function(){return b}),n.d(t,"n",function(){return O}),n.d(t,"o",function(){return p}),n.d(t,"e",function(){return m}),n.d(t,"q",function(){return g}),n.d(t,"p",function(){return E}),n.d(t,"k",function(){return v}),n.d(t,"l",function(){return I}),n.d(t,"m",function(){return _}),n.d(t,"j",function(){return h});var r=n(1),i=n(532),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"labelSettings"],null)},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=a(e,t);return n&&n.data},c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=a(e,t);return n&&n.meta},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=a(e,t);return n&&n.storeOptions},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.user},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.isLoaded},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.isFetching},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.isFetchError},b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.enabled},O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.selected_payment_method_id},p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.pristine},m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.email_receipts},g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.can_manage_payments},E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.can_edit_settings},v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.paper_size},I=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.payment_methods},_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.warnings&&n.warnings.payment_methods},h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return{masterUserName:n&&n.master_user_name,masterUserLogin:n&&n.master_user_login,masterUserEmail:n&&n.master_user_email,masterUserWpcomLogin:n&&n.master_user_wpcom_login}}},544:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var r=n(1),i=n(606),a=n.n(i),o=(n(112),function(e){return e}),c=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.join()},u=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return e.map(function(e){return e.apply(void 0,[t].concat(r))})}};function s(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c,s=Object(r.memoize)(e,i);return Array.isArray(n)&&(n=u(n)),Object.assign(function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];var c=n.apply(void 0,[e].concat(i));return Array.isArray(c)||(c=[c]),t&&!a()(c,t)&&s.cache.clear(),t=c,s.apply(void 0,[e].concat(i))},{memoizedSelector:s})}},547:function(e,t,n){"use strict";n.d(t,"d",function(){return r}),n.d(t,"c",function(){return v}),n.d(t,"b",function(){return I}),n.d(t,"a",function(){return _});var r={};n.r(r),n.d(r,"accountSettings",function(){return a}),n.d(r,"packages",function(){return o}),n.d(r,"orderLabels",function(){return c}),n.d(r,"getLabelRates",function(){return u}),n.d(r,"labelStatus",function(){return s}),n.d(r,"labelRefund",function(){return d}),n.d(r,"labelsPrint",function(){return f}),n.d(r,"labelTestPrint",function(){return l}),n.d(r,"addressNormalization",function(){return b}),n.d(r,"serviceSettings",function(){return O}),n.d(r,"shippingCarrier",function(){return p}),n.d(r,"shippingCarriers",function(){return m}),n.d(r,"shippingCarrierDelete",function(){return g});var i=n(561),a="connect/account/settings",o="connect/packages",c=function(e){return"connect/label/".concat(e)},u=function(e){return"connect/label/".concat(e,"/rates")},s=function(e,t){return"connect/label/".concat(e,"/").concat(t)},d=function(e,t){return"connect/label/".concat(e,"/").concat(t,"/refund")},f=function(){return"connect/label/print"},l=function(){return"connect/label/preview"},b=function(){return"connect/normalize-address"},O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"connect/services/".concat(e,"/").concat(t)},p=function(){return"connect/shipping/carrier"},m=function(){return"connect/shipping/carriers"},g=function(e){return"connect/shipping/carrier/".concat(e)},E=function(e){if(e&&e.message)throw e.message;if(e&&e.data&&e.data.message)throw e.data.message;throw e},v=function(e,t,n){return Object(i.a)(e).post(t,n,"wc/v1").catch(E)},I=function(e,t){return Object(i.a)(e).get(t,"wc/v1").catch(E)},_=function(e,t){return Object(i.a)(e).del(t,"wc/v1").catch(E)}},549:function(e,t,n){"use strict";n.d(t,"c",function(){return u}),n.d(t,"d",function(){return d}),n.d(t,"a",function(){return f}),n.d(t,"b",function(){return l});var r=n(533),i=n.n(r),a=n(1),o={debounce:a.debounce,isPlainObject:a.isPlainObject,uniqueId:a.uniqueId},c=(n(46),o.uniqueId);function u(e){return{noticeId:e,type:"NOTICE_REMOVE"}}function s(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.id,a=i()(n,["id"]);return{type:"NOTICE_CREATE",notice:Object.assign({showDismiss:!0},a,{noticeId:r||c(),status:e,text:t})}}var d=s.bind(null,"is-success"),f=s.bind(null,"is-error"),l=s.bind(null,"is-info");s.bind(null,"is-warning"),s.bind(null,"is-plain")},552:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(1),i=function e(t){return!!t&&(Object(r.isArray)(t)?Object(r.some)(t,e):!Object(r.isPlainObject)(t)||Object(r.some)(Object(r.values)(t),e))}},555:function(e,t,n){"use strict";n.r(t),n.d(t,"addPackage",function(){return o}),n.d(t,"removePackage",function(){return c}),n.d(t,"editPackage",function(){return u}),n.d(t,"dismissModal",function(){return s}),n.d(t,"savePackage",function(){return d}),n.d(t,"updatePackagesField",function(){return f}),n.d(t,"toggleOuterDimensions",function(){return l}),n.d(t,"toggleAll",function(){return b}),n.d(t,"togglePackage",function(){return O}),n.d(t,"savePredefinedPackages",function(){return p}),n.d(t,"removePredefinedPackage",function(){return m}),n.d(t,"setModalErrors",function(){return g}),n.d(t,"setIsSaving",function(){return E}),n.d(t,"setIsFetching",function(){return v}),n.d(t,"setIsFetchError",function(){return I}),n.d(t,"setAddMode",function(){return _}),n.d(t,"fetchSettings",function(){return h}),n.d(t,"submit",function(){return j});var r=n(547),i=n(538),a=n(541),o=function(e){return{type:i.n,siteId:e}},c=function(e,t){return{type:i.r,index:t,siteId:e}},u=function(e,t){return{type:i.p,package:t,siteId:e}},s=function(e){return{type:i.o,siteId:e}},d=function(e,t){return{type:i.t,packageData:t,siteId:e}},f=function(e,t){return{type:i.D,values:t,siteId:e}},l=function(e){return{type:i.B,siteId:e}},b=function(e,t,n,r){return{type:i.A,serviceId:t,groupId:n,checked:r,siteId:e}},O=function(e,t,n){return{type:i.C,serviceId:t,packageId:n,siteId:e}},p=function(e){return{type:i.u,siteId:e}},m=function(e,t,n){return{type:i.s,serviceId:t,packageId:n,siteId:e}},g=function(e,t){return{type:i.z,value:t,siteId:e}},E=function(e,t){return{type:i.y,isSaving:t,siteId:e}},v=function(e,t){return{type:i.w,isFetching:t,siteId:e}},I=function(e,t){return{type:i.x,isFetchError:t,siteId:e}},_=function(e,t){return{type:i.v,siteId:e,mode:t}},h=function(e){return function(t,n){var o=Object(a.e)(n(),e);o&&(o.packages||o.isFetching)||(t(v(e,!0)),r.b(e,r.d.packages).then(function(n){var r=n.formData,a=n.formSchema,o=n.storeOptions;t({type:i.q,packages:r,dimensionUnit:o.dimension_unit,weightUnit:o.weight_unit,packageSchema:a.custom.items,predefinedSchema:a.predefined,siteId:e})}).catch(function(n){console.error(n),t(I(e,!0))}).then(function(){return t(v(e,!1))}))}},j=function(e,t,n){return function(i,o){var c=Object(a.e)(o(),e);i(E(e,!0)),r.c(e,r.d.packages,c.packages).then(t).catch(n).then(function(){return i(E(e,!1))})}}},556:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(535);function i(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Date.now();return{type:r.j,siteId:e,originalAction:t,data:n,time:i}}},563:function(e,t,n){"use strict";n.d(t,"b",function(){return u}),n.d(t,"c",function(){return s}),n.d(t,"a",function(){return d}),n.d(t,"e",function(){return l}),n.d(t,"f",function(){return O}),n.d(t,"g",function(){return p}),n.d(t,"i",function(){return m}),n.d(t,"h",function(){return g}),n.d(t,"j",function(){return E}),n.d(t,"d",function(){return v});var r=n(1),i=n(544),a=n(532),o=n(539),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"data","locations"])},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.isArray)(c(e,t))},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return o.b===c(e,t)},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return o.a===c(e,t)},f=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a=r[e],o=u(t,a);return[o,o&&c(t,a)]}},l=Object(i.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);if(!u(e,t))return[];var n=c(e,t).map(function(e){return Object(r.omit)(e,"countries")});return Object(r.sortBy)(n,"name")},f(0)),b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);if(!u(e,t))return[];var n=Object(r.flatMap)(c(e,t),"countries");return Object(r.sortBy)(n,"name")},O=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);if(!u(e,n))return[];var i=Object(r.find)(c(e,n),{code:t});if(!i)return[];var o=i.countries.map(function(e){return Object(r.omit)(e,"states")});return Object(r.sortBy)(o,"name")},f(1)),p=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);if(!u(e,n))return t;var i=Object(r.find)(Object(r.flatMap)(c(e,n),"countries"),{code:t});return i?i.name:t},f(1)),m=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);if(!u(e,n))return[];var i=Object(r.find)(Object(r.flatMap)(c(e,n),"countries"),{code:t});return i?Object(r.sortBy)(i.states,"name"):[]},f(1)),g=Object(i.a)(function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(a.a)(e);if(!u(e,i))return n;var o=Object(r.find)(Object(r.flatMap)(c(e,i),"countries"),{code:t});if(!o)return n;var s=Object(r.find)(o.states,{code:n});return s?s.name:n},f(2)),E=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return!Object(r.isEmpty)(m(e,t,n))},v=Object(i.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=b(e,t),r={};return n.forEach(function(e){var t=e.code,n=e.name;return r[t]=n}),r},f(0))},565:function(e,t,n){"use strict";var r=n(1);t.a=function(e){return Object(r.isPlainObject)(e)&&(e.isNormalized&&e.selectNormalized&&e.normalized?e.normalized:e.values)||{}}},566:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i});var r=function(){return!0},i=function(){return!0}},567:function(e,t,n){"use strict";n.d(t,"d",function(){return o}),n.d(t,"a",function(){return u}),n.d(t,"e",function(){return s}),n.d(t,"c",function(){return d}),n.d(t,"b",function(){return f});var r=n(547),i=n(538),a=n(543),o=function(e,t,n){return{type:i.l,siteId:e,key:t,value:n}},c=function(e,t,n){return{type:i.m,siteId:e,key:t,value:n}},u=function(e){return function(t){t(c(e,"isFetching",!0)),r.b(e,r.d.accountSettings).then(function(n){var r=n.storeOptions,a=n.formMeta,o=n.formData,c=n.userMeta;t(function(e,t,n,r,a){return{type:i.i,siteId:e,storeOptions:t,formData:n,formMeta:r,userMeta:a}}(e,r,o,a,c))}).catch(function(n){t(c(e,"isFetchError",!0)),console.error(n)}).then(function(){return t(c(e,"isFetching",!1))})}},s=function(e,t,n){return function(i,o){i(c(e,"isSaving",!0)),i(c(e,"pristine",!0)),r.c(e,r.d.accountSettings,Object(a.f)(o())).then(t).catch(function(t){return i(c(e,"pristine",!1)),n(t)}).then(function(){i(c(e,"isSaving",!1))})}},d=function(e){return{type:i.k,siteId:e}},f=function(e){return{type:i.j,siteId:e}}},568:function(e,t,n){"use strict";n.d(t,"b",function(){return c}),n.d(t,"a",function(){return u}),n.d(t,"c",function(){return s});var r=n(1),i=n(532),a=n(539),o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"shippingMethodSchemas"],{})},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return Object(r.isObject)(o(e,n)[t])},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return c(e,t,n)?o(e,n)[t]:null},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return a.b===o(e,n)[t]}},575:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i}),n.d(t,"d",function(){return a}),n.d(t,"c",function(){return o});var r=["US","PR","VI","GU","AS","UM","MH","FM","MP"],i=["US","PR","VI"],a=["AA","AE","AP"],o=["IR","SY","KP","CU","SD"]},576:function(e,t,n){"use strict";n.d(t,"c",function(){return s}),n.d(t,"a",function(){return d}),n.d(t,"b",function(){return f});var r=n(1),i=n(532),a=n(584),o=n(539),c=n(566),u=n(585),s=function(e,t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZoneMethods"])}(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e));return Object(r.isObject)(n)?n[t]:null},d=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),o=Object(a.b)(e,n);if(!Object(r.isArray)(o))return!1;var d=Object(r.find)(o,{id:t});if(!d||!Object(r.isArray)(d.methodIds))return!1;if(!Object(c.a)(e,n))return!0;var f=d.methodIds.map(function(t){var i=s(e,t,n);return i&&Object(r.startsWith)(i.methodType,"wc_services")?i:null}).filter(Boolean);return Object(r.every)(f,function(t){var r=t.id;return Object(u.a)(e,r,n)})},f=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),d=Object(a.b)(e,n);if(!Object(r.isArray)(d))return!1;var f=Object(r.find)(d,{id:t});if(!f)return!1;if(o.b===f.methodIds)return!0;if(!Object(c.a)(e,n)||!Object(r.isArray)(f.methodIds))return!1;var l=f.methodIds.map(function(t){var i=s(e,t,n);return i&&Object(r.startsWith)(i.methodType,"wc_services")?i:null}).filter(Boolean);return Object(r.some)(l,function(t){var r=t.id;return Object(u.b)(e,r,n)})}},584:function(e,t,n){"use strict";n.d(t,"b",function(){return c}),n.d(t,"a",function(){return u});var r=n(1),i=n(532),a=(n(539),n(576)),o=n(610),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZones"])},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return Object(r.isArray)(n)&&Object(r.every)(n,function(n){return Object(a.a)(e,n.id,t)})&&Object(r.every)(n,function(n){return Object(o.a)(e,n.id,t)})}},585:function(e,t,n){"use strict";n.d(t,"a",function(){return c}),n.d(t,"b",function(){return u});var r=n(1),i=n(532),a=n(539),o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"shippingZoneMethodSettings"],{})},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!0===o(e,n)[t]},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return a.b===o(e,n)[t]}},592:function(e,t,n){"use strict";var r,i=n(34),a=n.n(i),o=n(36),c=n.n(o),u=n(1),s=n(46),d=Object(s.b)({},(r={},a()(r,"NOTICE_CREATE",function(e,t){var n=t.notice;return c()({},e,a()({},n.noticeId,n))}),a()(r,"NOTICE_REMOVE",function(e,t){var n=t.noticeId;return e.hasOwnProperty(n)?Object(u.omit)(e,n):e}),a()(r,"ROUTE_SET",function(e){return Object(u.reduce)(e,function(e,t,n){if(!t.isPersistent&&!t.displayOnNextPage)return e;var r=t;return r.displayOnNextPage&&(r=c()({},r,{displayOnNextPage:!1})),e[n]=r,e},{})}),r)),f=Object(s.b)({},a()({},"NOTICE_CREATE",function(e,t){var n=t.notice;return c()({},e,a()({},n.noticeId,Date.now()))}));t.a=Object(s.a)({items:d,lastTimeShown:f})},593:function(e,t,n){"use strict";n.d(t,"d",function(){return i}),n.d(t,"b",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"e",function(){return c}),n.d(t,"c",function(){return u});var r=n(535);function i(e){return{type:r.d,actionList:e}}function a(){return{type:r.b}}function o(e){return{type:r.a,actionList:e}}function c(e){return{type:r.e,actionList:e}}function u(e,t){return{type:r.c,actionList:e,error:t}}},602:function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"b",function(){return c});n(1);var r=n(659),i=n.n(r),a=document.implementation&&document.implementation.createHTMLDocument?document.implementation.createHTMLDocument("").createElement("textarea"):document.createElement("textarea");function o(e){return"string"!==typeof e||-1===e.indexOf("&")?e:function(e){a.innerHTML=e;var t=a.textContent;return a.innerHTML="",t}(e)}function c(e){return i()(e)}String.fromCharCode(160)},604:function(e,t,n){"use strict";n.d(t,"a",function(){return u}),n.d(t,"b",function(){return d});var r=n(35),i=n(605),a=n(1),o=n(547),c={a4:{name:Object(r.translate)("A4"),exclude:function(e){return Object(a.includes)(["US","CA","MX","DO"],e)}},label:{name:Object(r.translate)('Label (4"x6")')},legal:{name:Object(r.translate)("Legal")},letter:{name:Object(r.translate)("Letter")}},u=function(e){return Object(a.reduce)(c,function(t,n,r){var i=n.name,a=n.exclude;return a&&a(e)||(t[r]=i),t},{})},s=function(e,t,n){if(!c[e])throw new Error("Invalid paper size: ".concat(e));var r={paper_size:e,label_id_csv:Object(a.filter)(Object(a.map)(t,"labelId")).join(","),caption_csv:Object(a.filter)(Object(a.map)(t,function(e){return e.caption?encodeURIComponent(e.caption):null})).join(","),json:!0};return n+"?"+Object(i.stringify)(r)},d=function(e,t){return s(e,t,o.d.labelsPrint())}},607:function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"c",function(){return o}),n.d(t,"a",function(){return c});var r=n(1),i=n(532),a=(n(636),function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!1===Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","isLoading",t])}),o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!0===Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","isLoading",t])},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","items",t],null)}},608:function(e,t,n){"use strict";n.d(t,"a",function(){return m});var r,i=n(36),a=n.n(i),o=n(533),c=n.n(o),u=n(653),s=n.n(u),d=n(1),f=n(46),l=n(112),b=function(e){return Object(d.get)(e,"meta.dataLayer.data",void 0)},O=function(e){return Object(d.get)(e,"meta.dataLayer.error",void 0)},p=function(e){return Object(d.get)(e,"meta.dataLayer.progress",void 0)},m=(Object(f.d)("meta.dataLayer.requestKey",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=(arguments.length>1?arguments[1]:void 0).meta,n=(t=void 0===t?{}:t).dataLayer,r=(n=void 0===n?{}:n).lastUpdated,i=n.pendingSince,o=n.status;return Object.assign(a()({},e),{status:o},r&&{lastUpdated:r},i&&{pendingSince:i})}),r=function(e){return function(t,n){if(!0!==Object(d.get)(n,"meta.dataLayer.trackRequest")||p(n))return e(t,n);var r=function(e){var t=e.meta,n=c()(e,["meta"]),r=Object(d.get)(t,"dataLayer.requestKey");return r||s()(n)}(n),i=function(e){return void 0!==O(e)?"failure":void 0!==b(e)?"success":"pending"}(n),o=Object.assign({requestKey:r,status:i},"pending"===i?{pendingSince:Date.now()}:{lastUpdated:Date.now()});e(a()({},t,{dispatch:function(e){return t.dispatch(Object(d.merge)(e,{meta:{dataLayer:o}}))}}),n)}},function(e){return e.fetch||Object(l.a)("fetch handler is not defined: no request will ever be issued"),e.onSuccess||Object(l.a)("onSuccess handler is not defined: response to the request is being ignored"),e.onError||Object(l.a)("onError handler is not defined: error during the request is being ignored"),r(function(t,n){var r=function(e,t){var n=e.fetch,r=void 0===n?d.noop:n,i=e.onSuccess,a=void 0===i?d.noop:i,o=e.onError,c=void 0===o?d.noop:o,u=e.onProgress,s=void 0===u?d.noop:u,f=e.fromApi,l=void 0===f?d.identity:f,m=O(t);if(m)return c(t,m);var g=b(t);if(g)try{return a(t,l(g))}catch(v){return c(t,v)}var E=p(t);return E?s(t,E):r(t)}(e,n);if(r)return Array.isArray(r)?r.map(t.dispatch):t.dispatch(r)})})},609:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=function(e,t){return Object(r.isArray)(e)?e.concat(t):void 0},a=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length>1?r.mergeWith.apply(void 0,[Object.create(null)].concat(t,[i])):t[0]}},610:function(e,t,n){"use strict";n.d(t,"c",function(){return o}),n.d(t,"a",function(){return c}),n.d(t,"b",function(){return u});var r=n(1),i=n(532),a=n(539),o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZoneLocations"])},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),a=o(e,n);return a&&Object(r.isObject)(a[t])},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return o(e,n)&&a.b===o(e,n)[t]}},611:function(e,t,n){"use strict";n.d(t,"a",function(){return c});var r=n(547),i=n(556),a=n(538),o=n(585),c=function(e,t,n){return function(c,u){if(!Object(o.a)(u(),n,e)&&!Object(o.b)(u(),n,e)){var s={type:a.Wb,instanceId:n,siteId:e};return c(s),r.b(e,r.d.serviceSettings(t,n)).then(function(t){return c(function(e,t,n){return{type:a.Xb,siteId:e,instanceId:t,data:n}}(e,n,t))}).catch(function(t){return c(Object(i.a)(e,s,t))})}}}},612:function(e,t,n){"use strict";t.a=function(e,t){return function e(t,n,r){if(void 0===n||null===n||!t)return n;switch((t=function(e,t){if(e.$ref){var n=e.$ref.match(/^#\/definitions\/(.+)/);n&&t[n[1]]&&(e=t[n[1]])}return e}(t,r)).type){case"number":if(""===n)return;return isNaN(n)?n:parseFloat(n);case"boolean":return-1!==["true","True","TRUE","1",1,!0].indexOf(n)||-1===["false","False","FALSE","0",0,!1].indexOf(n)&&void 0;case"string":return n?n.toString():"";case"object":var i={};return Object.keys(n).forEach(function(a){var o=(t.properties||{})[a];i[a]=e(o,n[a],r)}),i;case"array":return n.map(function(n){return e(t.items,n,r)});default:return n}}({type:"object",properties:e.properties},t,e.definitions)}},616:function(e,t,n){"use strict";n.d(t,"a",function(){return s}),n.d(t,"c",function(){return d}),n.d(t,"b",function(){return f});var r=n(1),i=n(532),a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!1===Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","notes","isLoading",t])},o=n(607),c=n(537),u=n(566),s={CUSTOMER_NOTE:"CUSTOMER_NOTE",INTERNAL_NOTE:"INTERNAL_NOTE",LABEL_PURCHASING:"LABEL_PURCHASING",LABEL_PURCHASED:"LABEL_PURCHASED",LABEL_REFUND_REQUESTED:"LABEL_REFUND_REQUESTED",LABEL_REFUND_COMPLETED:"LABEL_REFUND_COMPLETED",LABEL_REFUND_REJECTED:"LABEL_REFUND_REJECTED",REFUND_NOTE:"REFUND_NOTE"},d=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!!a(e,t,n)&&(!(u.a(e,n)&&!Object(c.q)(e,t,n))||Object(c.s)(e,t,n))},f=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),d=Object(o.a)(e,t,n),f=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);if(!a(e,t,n))return[];var o=Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","notes","items"],{});return Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","notes","orders",t],[]).map(function(e){return o[e]})}(e,t,n).filter(function(e){return!1===e.customer_note}).map(function(e){return{key:e.id,type:s.INTERNAL_NOTE,timestamp:new Date(e.date_created_gmt+"Z").getTime(),content:e.note}});if(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","refunds",t,"items"],[])}(e,t,n).forEach(function(e){f.push({key:e.id,type:s.REFUND_NOTE,timestamp:new Date(e.date_created_gmt+"Z").getTime(),amount:e.amount,reason:e.reason,currency:d.currency})}),u.a(e,n)){var l=Object(c.g)(e,t,n);Object(r.filter)(l,function(e){return-1!==["PURCHASED","ANONYMIZED","PURCHASE_IN_PROGRESS"].indexOf(e.status)}).forEach(function(e,t,n){var r=n.length-1-t;if(e.refund)switch(e.refund.status){case"complete":f.push({key:e.label_id,type:s.LABEL_REFUND_COMPLETED,timestamp:e.refund.refund_date,serviceName:e.service_name,labelIndex:r,amount:parseFloat(e.refund.amount)||e.refundable_amount,currency:e.currency});break;case"rejected":f.push({key:e.label_id,type:s.LABEL_REFUND_REJECTED,timestamp:e.refund.refund_date,serviceName:e.service_name,labelIndex:r});break;default:f.push({key:e.label_id,type:s.LABEL_REFUND_REQUESTED,timestamp:e.refund.request_date,serviceName:e.service_name,labelIndex:r,amount:parseFloat(e.refund.amount)||e.refundable_amount,currency:e.currency})}if("PURCHASE_IN_PROGRESS"===e.status)return f.push({key:e.label_id,type:s.LABEL_PURCHASING,labelIndex:r,labelId:e.label_id,serviceName:e.service_name,carrierId:e.carrier_id});f.push({key:e.label_id,type:s.LABEL_PURCHASED,timestamp:e.created_date,createdDate:e.created_date,usedDate:e.used_date,expiryDate:e.expiry_date,labelIndex:r,labelId:e.label_id,productNames:e.product_names,packageName:e.package_name,receiptId:e.main_receipt_id,serviceName:e.service_name,tracking:e.tracking,carrierId:e.carrier_id,amount:e.rate,refundableAmount:e.refundable_amount,currency:e.currency,anonymized:"ANONYMIZED"===e.status,showDetails:!e.refund||"rejected"===e.refund.status||"unknown"===e.refund.status})})}return f}},619:function(e,t,n){var r={"./af":[392,3],"./af.js":[392,3],"./ar":[399,4],"./ar-dz":[393,5],"./ar-dz.js":[393,5],"./ar-kw":[394,6],"./ar-kw.js":[394,6],"./ar-ly":[395,7],"./ar-ly.js":[395,7],"./ar-ma":[396,8],"./ar-ma.js":[396,8],"./ar-sa":[397,9],"./ar-sa.js":[397,9],"./ar-tn":[398,10],"./ar-tn.js":[398,10],"./ar.js":[399,4],"./az":[400,11],"./az.js":[400,11],"./be":[401,12],"./be.js":[401,12],"./bg":[402,13],"./bg.js":[402,13],"./bm":[403,14],"./bm.js":[403,14],"./bn":[404,15],"./bn.js":[404,15],"./bo":[405,16],"./bo.js":[405,16],"./br":[406,17],"./br.js":[406,17],"./bs":[407,18],"./bs.js":[407,18],"./ca":[408,19],"./ca.js":[408,19],"./cs":[409,20],"./cs.js":[409,20],"./cv":[410,21],"./cv.js":[410,21],"./cy":[411,22],"./cy.js":[411,22],"./da":[412,23],"./da.js":[412,23],"./de":[415,24],"./de-at":[413,25],"./de-at.js":[413,25],"./de-ch":[414,26],"./de-ch.js":[414,26],"./de.js":[415,24],"./dv":[416,27],"./dv.js":[416,27],"./el":[417,28],"./el.js":[417,28],"./en-au":[418,29],"./en-au.js":[418,29],"./en-ca":[419,30],"./en-ca.js":[419,30],"./en-gb":[420,31],"./en-gb.js":[420,31],"./en-ie":[421,32],"./en-ie.js":[421,32],"./en-il":[422,33],"./en-il.js":[422,33],"./en-in":[423,34],"./en-in.js":[423,34],"./en-nz":[424,35],"./en-nz.js":[424,35],"./en-sg":[425,36],"./en-sg.js":[425,36],"./eo":[426,37],"./eo.js":[426,37],"./es":[429,38],"./es-do":[427,39],"./es-do.js":[427,39],"./es-us":[428,40],"./es-us.js":[428,40],"./es.js":[429,38],"./et":[430,41],"./et.js":[430,41],"./eu":[431,42],"./eu.js":[431,42],"./fa":[432,43],"./fa.js":[432,43],"./fi":[433,44],"./fi.js":[433,44],"./fil":[434,45],"./fil.js":[434,45],"./fo":[435,46],"./fo.js":[435,46],"./fr":[438,47],"./fr-ca":[436,48],"./fr-ca.js":[436,48],"./fr-ch":[437,49],"./fr-ch.js":[437,49],"./fr.js":[438,47],"./fy":[439,50],"./fy.js":[439,50],"./ga":[440,51],"./ga.js":[440,51],"./gd":[441,52],"./gd.js":[441,52],"./gl":[442,53],"./gl.js":[442,53],"./gom-deva":[443,54],"./gom-deva.js":[443,54],"./gom-latn":[444,55],"./gom-latn.js":[444,55],"./gu":[445,56],"./gu.js":[445,56],"./he":[446,57],"./he.js":[446,57],"./hi":[447,58],"./hi.js":[447,58],"./hr":[448,59],"./hr.js":[448,59],"./hu":[449,60],"./hu.js":[449,60],"./hy-am":[450,61],"./hy-am.js":[450,61],"./id":[451,62],"./id.js":[451,62],"./is":[452,63],"./is.js":[452,63],"./it":[454,64],"./it-ch":[453,65],"./it-ch.js":[453,65],"./it.js":[454,64],"./ja":[455,66],"./ja.js":[455,66],"./jv":[456,67],"./jv.js":[456,67],"./ka":[457,68],"./ka.js":[457,68],"./kk":[458,69],"./kk.js":[458,69],"./km":[459,70],"./km.js":[459,70],"./kn":[460,71],"./kn.js":[460,71],"./ko":[461,72],"./ko.js":[461,72],"./ku":[462,73],"./ku.js":[462,73],"./ky":[463,74],"./ky.js":[463,74],"./lb":[464,75],"./lb.js":[464,75],"./lo":[465,76],"./lo.js":[465,76],"./lt":[466,77],"./lt.js":[466,77],"./lv":[467,78],"./lv.js":[467,78],"./me":[468,79],"./me.js":[468,79],"./mi":[469,80],"./mi.js":[469,80],"./mk":[470,81],"./mk.js":[470,81],"./ml":[471,82],"./ml.js":[471,82],"./mn":[472,83],"./mn.js":[472,83],"./mr":[473,84],"./mr.js":[473,84],"./ms":[475,85],"./ms-my":[474,86],"./ms-my.js":[474,86],"./ms.js":[475,85],"./mt":[476,87],"./mt.js":[476,87],"./my":[477,88],"./my.js":[477,88],"./nb":[478,89],"./nb.js":[478,89],"./ne":[479,90],"./ne.js":[479,90],"./nl":[481,91],"./nl-be":[480,92],"./nl-be.js":[480,92],"./nl.js":[481,91],"./nn":[482,93],"./nn.js":[482,93],"./oc-lnc":[483,94],"./oc-lnc.js":[483,94],"./pa-in":[484,95],"./pa-in.js":[484,95],"./pl":[485,96],"./pl.js":[485,96],"./pt":[487,97],"./pt-br":[486,98],"./pt-br.js":[486,98],"./pt.js":[487,97],"./ro":[488,99],"./ro.js":[488,99],"./ru":[489,100],"./ru.js":[489,100],"./sd":[490,101],"./sd.js":[490,101],"./se":[491,102],"./se.js":[491,102],"./si":[492,103],"./si.js":[492,103],"./sk":[493,104],"./sk.js":[493,104],"./sl":[494,105],"./sl.js":[494,105],"./sq":[495,106],"./sq.js":[495,106],"./sr":[497,107],"./sr-cyrl":[496,108],"./sr-cyrl.js":[496,108],"./sr.js":[497,107],"./ss":[498,109],"./ss.js":[498,109],"./sv":[499,110],"./sv.js":[499,110],"./sw":[500,111],"./sw.js":[500,111],"./ta":[501,112],"./ta.js":[501,112],"./te":[502,113],"./te.js":[502,113],"./tet":[503,114],"./tet.js":[503,114],"./tg":[504,115],"./tg.js":[504,115],"./th":[505,116],"./th.js":[505,116],"./tk":[506,117],"./tk.js":[506,117],"./tl-ph":[507,118],"./tl-ph.js":[507,118],"./tlh":[508,119],"./tlh.js":[508,119],"./tr":[509,120],"./tr.js":[509,120],"./tzl":[510,121],"./tzl.js":[510,121],"./tzm":[512,122],"./tzm-latn":[511,123],"./tzm-latn.js":[511,123],"./tzm.js":[512,122],"./ug-cn":[513,124],"./ug-cn.js":[513,124],"./uk":[514,125],"./uk.js":[514,125],"./ur":[515,126],"./ur.js":[515,126],"./uz":[517,127],"./uz-latn":[516,128],"./uz-latn.js":[516,128],"./uz.js":[517,127],"./vi":[518,129],"./vi.js":[518,129],"./x-pseudo":[519,130],"./x-pseudo.js":[519,130],"./yo":[520,131],"./yo.js":[520,131],"./zh-cn":[521,132],"./zh-cn.js":[521,132],"./zh-hk":[522,133],"./zh-hk.js":[522,133],"./zh-mo":[523,134],"./zh-mo.js":[523,134],"./zh-tw":[524,135],"./zh-tw.js":[524,135]};function i(e){if(!n.o(r,e))return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=r[e],i=t[0];return n.e(t[1]).then(function(){return n.t(i,7)})}i.keys=function(){return Object.keys(r)},i.id=619,e.exports=i},620:function(e,t,n){"use strict";(function(e){var n={env:e?"production":"development",wpcom_concierge_schedule_id:1,languages:[],google_adwords_conversion_id:"",google_adwords_conversion_id_jetpack:""},r=function(e){if(e in n)return n[e];throw new Error("config key `"+e+"` does not exist")};r.isEnabled=function(){return!0},t.a=r}).call(this,n(111))},633:function(e,t,n){"use strict";var r=n(34),i=n.n(r),a=n(110),o=n.n(a),c=n(1),u=n(35),s=n(535),d=n(593),f=n(543),l=n(541),b=n(567),O=n(555),p=n(532),m=n(538);n(561),n(556),n(576),n(611),n(620);var g=n(547),E=n(36),v=n.n(E);function I(e,t,n,r){Object(c.isFunction)(n)?I(e,t,n(e,t,r),r):Object(c.isObject)(n)&&e(v()({},n,r))}var _,h=n(568),j=n(612),S=function(e,t){var n=Object(l.e)(e,t);return!n||n.pristine?[]:[{description:Object(u.translate)("Saving label settings"),onStep:function(e,n){e(Object(O.submit)(t,function(){return e(Object(d.e)(n))},function(){return e(Object(d.c)(n))}))}}]},C=function(e,t){var n=Object(p.a)(e);return t?o()(S(e,n)):[].concat(o()(function(e,t){var n=Object(f.g)(e,t);return!n||n.pristine||!n.can_edit_settings&&n.can_manage_payments?[]:[{description:Object(u.translate)("Saving label settings"),onStep:function(e,n){e(Object(b.e)(t,function(){return e(Object(d.e)(n))},function(){return e(Object(d.c)(n))}))}}]}(e,n)),o()(S(e,n)))};t.a=(_={},i()(_,s.L,[function(e,t){var n=t.successAction,r=t.failureAction,i=t.onlyPackages,a=function(e){e(n),e(Object(d.b)())},o=C(e.getState(),i);e.dispatch(Object(c.isEmpty)(o)?a:Object(d.d)({nextSteps:o,onSuccess:a,onFailure:function(e){e(r),e(Object(d.b)())}}))}]),i()(_,m.Yb,[function(e,t){var n=e.dispatch,r=e.getState,i=t.siteId,a=t.methodId,o=t.methodType,c=t.method,u=t.successAction,d=t.failureAction,f=Object(h.a)(r(),o,i).formSchema,l=Object(j.a)(f,c);g.c(i,g.d.serviceSettings(o,a),l).then(function(e){n(function(e,t,n){return{type:s.Pb,siteId:e,data:t,originatingAction:n}}(i,e,t)),I(n,r,u,{sentData:l,receivedData:e})}).catch(function(e){return I(n,r,d,{error:e})})}]),_)},634:function(e,t,n){"use strict";n.d(t,"b",function(){return N}),n.d(t,"a",function(){return A});var r=n(114),i=n.n(r),a=n(107),o=n.n(a),c=n(108),u=n.n(c),s=n(528),d=n.n(s),f=n(527),l=n.n(f),b=n(531),O=n.n(b),p=n(529),m=n.n(p),g=n(34),E=n.n(g),v=n(10),I=n.n(v),_=n(109),h=n(163),j=n.n(h),S=n(47),C=n.n(S),y=n(1),R=n(544),P=Object(R.a)(function(e){return Object(y.get)(e,"ui.language.localeSlug",null)},function(e){return e.ui.language}),k=C()("calypso:localized-moment"),A=I.a.createContext(j.a),L=function(e){function t(){var e,n;o()(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=d()(this,(e=l()(t)).call.apply(e,[this].concat(i))),E()(O()(n),"state",{moment:j.a,momentLocale:j.a.locale()}),n}return m()(t,e),u()(t,[{key:"checkAndLoad",value:function(){var e=i()(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((r=this.props.currentLocale)!==t){e.next=3;break}return e.abrupt("return");case 3:if("en"!==r){e.next=7;break}this.loadingLocalePromise=Promise.resolve(),e.next=19;break;case 7:return k("Loading moment locale for %s",r),e.prev=8,this.loadingLocalePromise=n(619)("./".concat(r)),e.next=12,this.loadingLocalePromise;case 12:e.next=18;break;case 14:return e.prev=14,e.t0=e.catch(8),k("Failed to load moment locale for %s",r,e.t0),e.abrupt("return");case 18:k("Loaded moment locale for %s",r);case 19:r===this.props.currentLocale&&(j.a.locale()!==r&&j.a.locale(r),this.setState({momentLocale:r}));case 20:case"end":return e.stop()}},e,this,[[8,14]])}));return function(t){return e.apply(this,arguments)}}()},{key:"componentDidMount",value:function(){this.checkAndLoad(j.a.locale())}},{key:"componentDidUpdate",value:function(e){this.checkAndLoad(e.currentLocale)}},{key:"render",value:function(){return I.a.createElement(A.Provider,{value:this.state},this.props.children)}}]),t}(I.a.Component),N=Object(_.b)(function(e){return{currentLocale:P(e)}})(L)},635:function(e,t,n){"use strict";var r=n(533),i=n.n(r),a=n(75),o=n(46),c=function(e,t,n,r,c,u){var s=Object(a.b)();return u&&!u.endsWith("/")&&(u+="/"),u&&u.startsWith("/")&&(u=u.substr(1)),-1!==s.indexOf("?")&&(t=t.replace("?","&")),Object(o.c)(function(e){var t=e.url,n=e.method,r=e.headers,a=e.queryParams,o=e.body,c=e.withCredentials,u=e.onSuccess,s=e.onFailure,d=i()(e,["url","method","headers","queryParams","body","withCredentials","onSuccess","onFailure"]),f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:"HTTP_REQUEST",url:t,method:n,headers:r,queryParams:a,body:o,withCredentials:c,onSuccess:u||f,onFailure:s||f,options:d}}({url:s+u+t,method:e,headers:[["X-WP-Nonce",Object(a.c)()],["Content-Type","application/json"]],body:r&&JSON.stringify(r),withCredentials:!0},c),{meta:{localApiRequest:!0}})};t.a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"wc/v1";return{get:function(e){return c("GET",e,0,null,t,n)},getWithHeaders:function(e){return function(e,t,n,r,i,a){return c(e,t+"&_envelope",0,r,i,a)}("GET",e,0,null,t,n)},post:function(e,r){return c("POST",e,0,r||{},t,n)},put:function(e,r){return c("PUT",e,0,r||{},t,n)},del:function(e){return c("DELETE",e,0,null,t,n)}}}},636:function(e,t,n){"use strict";n.d(t,"a",function(){return u}),n.d(t,"b",function(){return s}),n.d(t,"c",function(){return d}),n.d(t,"d",function(){return f}),n.d(t,"e",function(){return l}),n.d(t,"f",function(){return b});var r=n(36),i=n.n(r),a=n(1),o=n(688),c=n(637),u={page:1,per_page:50,search:"",status:"any"};function s(e){return e.status&&(e.status=Object(c.a)(e.status)),Object(a.omitBy)(e,function(e,t){return u[t]===e})}function d(){var e=s(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});return JSON.stringify(e)}function f(e){for(var t=i()({},e),n=0,r=["line_items","fee_lines","coupon_lines","shipping_lines"];n<r.length;n++){var o=r[n];e[o]&&(t[o]=e[o].map(function(e){return Object(a.isFinite)(e.id)?e:Object(a.omit)(e,"id")}))}return t}function l(e){Object(a.forEach)(["cart_tax","discount_total","discount_tax","shipping_total","shipping_tax","total","total_tax"],function(t){(Object(a.isFinite)(e[t])||e[t])&&(e[t]=Object(o.b)(e[t],e.currency))});var t=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];return t.map(function(t){return Object(a.forEach)(n,function(e){(Object(a.isFinite)(t[e])||t[e])&&(t[e]=t[e].toString())}),Object(a.forEach)(r,function(n){(Object(a.isFinite)(t[n])||t[n])&&(t[n]=Object(o.b)(t[n],e.currency))}),Object(a.forEach)(i,function(e){(Object(a.isFinite)(t[e])||t[e])&&(t[e]=parseInt(t[e]))}),Object(a.forEach)(c,function(n){(Object(a.isFinite)(t[n])||t[n])&&(t[n]=Object(o.a)(t[n],e.currency))}),t})};return Object(a.isEmpty)(e.line_items)||(e.line_items=t(e.line_items,["name","tax_class"],["subtotal","subtotal_tax","total","total_tax"],["product_id","variation_id","quantity"],["price"])),Object(a.isEmpty)(e.shipping_lines)||(e.shipping_lines=t(e.shipping_lines,["method_title","method_id"],["total","total_tax"])),Object(a.isEmpty)(e.fee_lines)||(e.fee_lines=t(e.fee_lines,["name","tax_class","tax_status"],["total","total_tax"])),Object(a.isEmpty)(e.coupon_lines)||(e.coupon_lines=t(e.coupon_lines,["code"],["discount","discount_tax"])),Object(a.isEmpty)(e.refunds)||(e.refunds=t(e.refunds,["reason"],["total"])),e.billing&&""===e.billing.email&&delete e.billing.email,e}function b(e){var t=e.status,n=void 0===t?"":t;window.jQuery&&(n&&window.jQuery("#order_status").val("wc-"+n).trigger("change"),window.jQuery("#woocommerce-order-notes").length&&window.jQuery.get(window.location.href,function(e){var t=window.jQuery(e).find("#woocommerce-order-notes");window.jQuery("#woocommerce-order-notes").html(t.html())}))}},637:function(e,t,n){"use strict";n.d(t,"a",function(){return s}),n.d(t,"b",function(){return d});n(35),n(1);var r="unpaid",i="unfulfilled",a="finished",o=["on-hold","pending"],c=["processing"],u=["cancelled","completed","failed","refunded"];function s(e){return r===e?o.join(","):i===e?c.join(","):a===e?u.join(","):e}function d(e){return-1!==u.indexOf(e)}},638:function(e,t,n){"use strict";n.d(t,"a",function(){return u}),n.d(t,"b",function(){return s}),n.d(t,"d",function(){return d}),n.d(t,"j",function(){return f}),n.d(t,"e",function(){return l}),n.d(t,"c",function(){return b}),n.d(t,"i",function(){return O}),n.d(t,"f",function(){return p}),n.d(t,"g",function(){return m}),n.d(t,"h",function(){return g});var r=n(533),i=n.n(r),a=(n(36),n(1)),o=n(636),c=(n(637),n(535)),u=function(e,t,n){return{type:c.q,siteId:e,orderId:t,error:n}},s=function(e,t){return{type:c.r,siteId:e,orderId:t}},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:c.n,siteId:e,query:Object(o.b)(t),error:n}},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Object(a.isArray)(n)?{type:c.o,siteId:e,query:Object(o.b)(t),total:r,orders:n}:d(e,t,n)},l=function(e,t){return{type:c.F,siteId:e,orderId:t}},b=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:c.G,siteId:e,orderId:t,error:n}},O=function(e,t,n){return"undefined"===typeof n.id?b(e,t,n):{type:c.H,siteId:e,orderId:t,order:n}},p=function(e,t){var n=t.id,r=i()(t,["id"]),u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.noop,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.noop;return r=Object(o.e)(Object(o.d)(r)),{type:c.I,siteId:e,orderId:n,order:r,onFailure:s,onSuccess:u}},m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:c.J,siteId:e,orderId:t,error:n}},g=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return"undefined"===typeof n.id?m(e,t,n):(Object(o.f)(n),{type:c.K,siteId:e,orderId:t,order:n})}},639:function(e,t,n){"use strict";n.d(t,"a",function(){return r});n(36),n(1);function r(e){if(!e.data)throw new Error("Failure at remote site.",e);return e}},651:function(e,t,n){"use strict";var r=n(110),i=n.n(r),a=n(36),o=n.n(a),c=n(1),u=n(538),s={modalErrors:{},pristine:!0},d=function(e){return null===e||""===Object(c.trim)(e)},f={};f[u.n]=function(e){var t=e.packages&&e.packages.predefined?e.packages.predefined:{},n=o()({},e,{showModal:!0,mode:"add-custom",currentlyEditingPredefinedPackages:Object(c.cloneDeep)(t)});return"edit"!==e.mode&&n.packageData||(n.packageData={is_user_defined:!0}),n},f[u.p]=function(e,t){return Object.assign({},e,{showModal:!0,modalReadOnly:!1,mode:"edit",packageData:t.package,showOuterDimensions:!1})},f[u.o]=function(e){return Object.assign({},e,{modalErrors:{},showModal:!1,showOuterDimensions:!1})},f[u.z]=function(e,t){return Object.assign({},e,{modalErrors:t.value})},f[u.D]=function(e,t){var n=Object.assign({},e.packageData,t.values),r=Object(c.omitBy)(n,d);return Object.assign({},e,{packageData:r,pristine:!1})},f[u.t]=function(e,t){var n=t.packageData,r=e.packages.custom||[];(n.box_weight&&(n.box_weight=Number.parseFloat(n.box_weight)),n.max_weight&&(n.max_weight=Number.parseFloat(n.max_weight)),"index"in n)?r[n.index]=Object(c.omit)(n,"index"):r.push(n);return e=f[u.o](e),o()({},e,{mode:"add-custom",packageData:{is_user_defined:!0},packages:o()({},e.packages,{custom:r}),pristine:!1})},f[u.B]=function(e){return o()({},e,{showOuterDimensions:!0})},f[u.r]=function(e,t){var n=i()(e.packages.custom);return n.splice(t.index,1),o()({},e,{packages:o()({},e.packages,{custom:n}),pristine:!1,showModal:!1})},f[u.A]=function(e,t){var n=t.serviceId,r=t.groupId,i=t.checked,a=e.predefinedSchema[n][r].definitions.map(function(e){return e.id}),u=e.currentlyEditingPredefinedPackages[n],s=i?Object(c.uniq)(Object(c.concat)(u,a)):Object(c.difference)(u,a),d=o()({},e.currentlyEditingPredefinedPackages);return d[n]=s,o()({},e,{currentlyEditingPredefinedPackages:d,pristine:!1})},f[u.C]=function(e,t){var n=t.serviceId,r=t.packageId,a=o()({},e.currentlyEditingPredefinedPackages),c=i()(a[n]||[]),u=c.indexOf(r);return-1===u?c.push(r):c.splice(u,1),a[n]=c,o()({},e,{currentlyEditingPredefinedPackages:a,pristine:!1})},f[u.s]=function(e,t){var n=t.serviceId,r=t.packageId,a=o()({},e.packages.predefined),c=i()(a[n]||[]),u=c.indexOf(r);return-1!==u&&c.splice(u,1),a[n]=c,o()({},e,{packages:o()({},e.packages,{predefined:a}),pristine:!1})},f[u.u]=function(e){var t=e.currentlyEditingPredefinedPackages;return e=f[u.o](e),o()({},e,{packages:o()({},e.packages,{predefined:t}),pristine:!1})},f[u.v]=function(e,t){var n=t.mode;return o()({},e,{mode:n})},f[u.y]=function(e,t){return Object.assign({},e,{isSaving:t.isSaving,pristine:!t.isSaving})},f[u.w]=function(e,t){var n=t.isFetching;return o()({},e,{isFetching:n})},f[u.x]=function(e,t){var n=t.isFetchError;return o()({},e,{isFetchError:n})},f[u.q]=function(e,t){var n=t.packages,r=t.dimensionUnit,i=t.weightUnit,a=t.packageSchema,c=t.predefinedSchema;return o()({},e,{packages:n,dimensionUnit:r,weightUnit:i,packageSchema:a,predefinedSchema:c,packageData:e.packageData||{is_user_defined:!0},isLoaded:!0})};t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;return"function"===typeof f[t.type]?f[t.type](e,t):e}},652:function(e,t,n){"use strict";var r=n(34),i=n.n(r),a=n(36),o=n.n(a),c=n(538),u={meta:{error:!1,fieldsStatus:!1,isSaving:!1,isFetching:!1,isLoaded:!1,isFetchError:!1,pristine:!0},data:null,pristineData:null},s={};s[c.i]=function(e,t){var n=t.storeOptions,r=t.formData,i=t.formMeta,a=t.userMeta;return o()({},e,{storeOptions:n,meta:o()({},e.meta,i,{pristine:!0,isLoaded:!0,user:a}),data:o()({},e.data,r)})},s[c.l]=function(e,t){var n=t.key,r=t.value,a=e.meta.pristine?e.data:e.pristineData;return o()({},e,{meta:o()({},e.meta,{pristine:!1}),data:o()({},e.data,i()({},n,r)),pristineData:a})},s[c.m]=function(e,t){var n=t.key,r=t.value;return o()({},e,{meta:o()({},e.meta,i()({},n,r))})},s[c.k]=function(e){return e.meta.pristine?e:o()({},e,{meta:o()({},e.meta,{pristine:!0}),data:e.pristineData,pristineData:null})},s[c.j]=function(e){return o()({},e,{addCardDialog:!0})},s[c.h]=function(e){return o()({},e,{addCardDialog:null})};t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;return s[t.type]?s[t.type](e,t):e}},657:function(e,t,n){"use strict";var r,i=n(110),a=n.n(i),o=n(36),c=n.n(o),u=n(118),s=n.n(u),d=n(34),f=n.n(d),l=n(47),b=n.n(l),O=n(593),p=n(535),m=b()("woocommerce:action-list");t.a=(r={},f()(r,p.d,[function(e,t){var n=e.dispatch,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),i=t.actionList,a=i.prevSteps,o=i.currentStep,u=i.nextSteps||[],d=s()(u),f=d[0],l=d.slice(1);if(o)return void m("[handleStepNext] Warning: Attempting before current step finishes. Ignoring.");if(!f)return void m("[handleStepNext] Warning: Attempting with no nextSteps left. Ignoring.");var b=c()({},i,{prevSteps:a,currentStep:c()({},f,{startTime:r}),nextSteps:l});n(Object(O.a)(b)),f.onStep(n,b)}]),f()(r,p.e,[function(e,t){var n=e.dispatch,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),i=t.actionList,o=i.prevSteps,u=i.currentStep,s=i.nextSteps;if(!u)return void m("[handleStepSuccess] Warning: Attempting with no current step. Ignoring.");var d=c()({},i,{prevSteps:[].concat(a()(o||[]),[c()({},u,{endTime:r})]),currentStep:null,nextSteps:s});n(Object(O.a)(d)),s&&s.length>0?n(Object(O.d)(d)):i.onSuccess&&i.onSuccess(n,d)}]),f()(r,p.c,[function(e,t){var n=e.dispatch,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),i=t.actionList,o=t.error,u=i.prevSteps,s=i.currentStep,d=i.nextSteps;if(!s)return void m("[handleStepFailure] Warning: Attempting with no current step. Ignoring.");var f=c()({},i,{prevSteps:[].concat(a()(u||[]),[c()({},s,{endTime:r,error:o})]),currentStep:null,nextSteps:d});n(Object(O.a)(f)),i.onFailure&&i.onFailure(n,f)}]),r)},658:function(e,t,n){"use strict";var r,i=n(34),a=n.n(i),o=n(46),c=n(535),u=n(539),s=n(602);t.a=Object(o.b)(null,(r={},a()(r,c.k,function(){return u.b}),a()(r,c.l,function(e,t){return t.data.map(function(e){return{code:e.code,name:Object(s.a)(e.name),countries:e.countries.map(function(e){return{code:e.code,name:Object(s.a)(e.name),states:e.states.map(function(e){return{code:e.code,name:Object(s.a)(e.name)}})}})}})}),a()(r,c.j,function(e,t){var n=t.originalAction.type;return c.k===n?u.a:e}),r))},687:function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o}),n.d(t,"c",function(){return c}),n.d(t,"d",function(){return u}),n.d(t,"e",function(){return s});var r=n(535),i=n(636),a=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return{type:r.y,siteId:e,orderId:t,note:n,onSuccess:i,onFailure:a}},o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{type:r.z,siteId:e,orderId:t,error:n}},c=function(e,t,n){return Object(i.f)({}),{type:r.A,siteId:e,orderId:t,note:n}},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{type:r.w,siteId:e,orderId:t,error:n}},s=function(e,t,n){return{type:r.x,siteId:e,orderId:t,notes:n}}},688:function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return a});var r=n(583);function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",n=Object(r.getCurrencyDefaults)(t).precision;return"number"!==typeof e&&(e=parseFloat(e)),isNaN(e)?0:Math.round(e*Math.pow(10,n))/Math.pow(10,n)}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",n=Object(r.getCurrencyDefaults)(t).precision;return"number"!==typeof e&&(e=parseFloat(e)),isNaN(e)?"":e.toFixed(n)}},690:function(e,t,n){"use strict";var r=n(78),i=n.n(r);t.a=function(e){var t=(e.outer_dimensions?e.outer_dimensions.match(/([-.0-9]+).+?([-.0-9]+).+?([-.0-9]+)/):e.inner_dimensions.match(/([-.0-9]+).+?([-.0-9]+).+?([-.0-9]+)/)).slice(1).map(Number),n=i()(t,3);return{length:n[0],width:n[1],height:n[2]}}},691:function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o}),n.d(t,"c",function(){return c});var r=n(556),i=n(535);function a(e){return{type:i.k,siteId:e}}function o(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=a(e);return Object(r.a)(e,n,t)}function c(e,t){return{type:i.l,siteId:e,data:t}}},715:function(e){e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","properties":{"data":{"items":{"properties":{"CTA":{"properties":{"hook":{"type":"string"},"message":{"type":"string"},"primary":{"type":"boolean"}},"type":"object"},"content":{"properties":{"classes":{"type":"string"},"description":{"type":"string"},"emblem":{"type":"null"},"icon":{"type":"string"},"message":{"type":"string"}},"type":"object"},"feature_class":{"type":"string"},"id":{"type":"string"},"jitm_stats_url":{"type":"string"},"template":{"type":"string"},"ttl":{"type":"integer"},"url":{"type":"string"}},"type":"object"},"type":"array"}},"type":"object"}')},716:function(e,t,n){},792:function(e,t,n){"use strict";n.r(t);var r=n(36),i=n.n(r),a=n(34),o=n.n(a),c=n(10),u=n.n(c),s=n(107),d=n.n(s),f=n(108),l=n.n(f),b=n(528),O=n.n(b),p=n(527),m=n.n(p),g=n(531),E=n.n(g),v=n(529),I=n.n(v),_=n(12),h=n.n(_),j=n(30),S=n(109),C=n(35),y=n(526),R=n.n(y),P=n(534),k=n.n(P),A=n(1),L=n(542),N=n(540),M=n(532),T=n(537),w=n(543),D=n(616),V=n(638),G=n(607),x=n(530),U=n.n(x),W=n(689),F=n(634),B=Object(W.a)(function(e){return function(t){return u.a.createElement(F.a.Consumer,null,function(n){return u.a.createElement(e,U()({},t,n))})}},"WithLocalizedMoment"),z=u.a.lazy(function(){return Promise.all([n.e(1),n.e(138),n.e(2),n.e(149)]).then(n.bind(null,789))}),H=u.a.lazy(function(){return Promise.all([n.e(1),n.e(136),n.e(2),n.e(154)]).then(n.bind(null,787))}),q=function(e){function t(){var e,n;d()(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=O()(this,(e=m()(t)).call.apply(e,[this].concat(i))),o()(E()(n),"renderLabelButton",function(e,t){var r=n.props,i=r.loaded,a=r.translate,o=r.items,s=r.orderId,d=r.siteId,f=R()("shipping-label__new-label-button",{"is-placeholder":!i});return i?wcConnectData.wcs_server_connection?e.length?t<o?u.a.createElement("div",{className:"shipping-label__multiple-buttons-container"},u.a.createElement(L.a,{className:f,primary:!0,busy:!i,disabled:!i,onClick:n.handleCreateLabelButtonClick},a("Create shipping label")),u.a.createElement(L.a,{onClick:n.handleTrackPackagesButtonClick},a("Track Package","Track Packages",{count:e.length})),u.a.createElement(c.Suspense,{fallback:u.a.createElement("div",null)},u.a.createElement(z,{orderId:s,siteId:d}),u.a.createElement(H,{orderId:s,siteId:d}))):u.a.createElement("div",null,u.a.createElement("span",{className:"shipping-label__redo-shipping-button"},u.a.createElement(L.a,{borderless:!0,onClick:n.handleCreateLabelButtonClick},a("Create new label"))),u.a.createElement(L.a,{onClick:n.handleTrackPackagesButtonClick},a("Track Package","Track Packages",{count:e.length})),u.a.createElement(c.Suspense,{fallback:u.a.createElement("div",null)},u.a.createElement(z,{orderId:s,siteId:d}),u.a.createElement(H,{orderId:s,siteId:d}))):u.a.createElement("div",null,u.a.createElement(L.a,{className:f,primary:!0,busy:!i,disabled:!i,onClick:n.handleCreateLabelButtonClick},a("Create shipping label")),u.a.createElement(c.Suspense,{fallback:u.a.createElement("div",null)},u.a.createElement(z,{orderId:s,siteId:d}))):u.a.createElement(L.a,null,a("Connection error: unable to create label at this time")):u.a.createElement(L.a,{className:"shipping-label__button-loading",primary:!0,busy:!0,disabled:!0})}),o()(E()(n),"handleCreateLabelButtonClick",function(){var e=n.props,t=e.orderId,r=e.siteId;n.props.openPrintingFlow(t,r)}),o()(E()(n),"handleTrackPackagesButtonClick",function(){var e=n.props,t=e.orderId,r=e.siteId;n.props.openTrackingFlow(t,r)}),n}return I()(t,e),l()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.siteId,n=e.orderId,r=e.orderLoading,i=e.orderLoaded;t&&n&&!r&&!i&&this.props.fetchOrder(t,n)}},{key:"render",value:function(){var e,t=this.props,n=t.loaded,r=t.labelsEnabled,i=t.items,a=t.translate,o=t.events,c=t.moment,s=!n||r,d=Object(A.filter)(o,{type:"LABEL_PURCHASED"}),f=Object(A.filter)(o,{type:"LABEL_REFUND_REQUESTED"}),l=Object(A.differenceBy)(d,f,"labelIndex"),b=Object(A.sumBy)(l,function(e){return e.productNames.length}),O=!1;l.length>0&&i<=b&&(O=!0,e=c(Object(A.maxBy)(l,"createdDate").createdDate).format("ll"));return u.a.createElement("div",{className:"shipping-label__container"},u.a.createElement("div",{className:"shipping-label__banner-fulfilled-message"},u.a.createElement(k.a,{size:36,icon:"shipping"}),n&&(O?u.a.createElement("em",null,a("%(itemCount)d item was fulfilled on {{span}}%(createdDate)s{{/span}}","%(itemCount)d items were fulfilled on {{span}}%(createdDate)s{{/span}}",{count:i,args:{createdDate:e,itemCount:i},components:{span:u.a.createElement("span",{className:"shipping-label__banner-fulfilled-date"})}})):u.a.createElement("em",null,a("%(itemCount)d item is ready to be fulfilled","%(itemCount)d items are ready to be fulfilled",{count:i,args:{itemCount:i}})))),u.a.createElement("div",null,s&&this.renderLabelButton(l,b)))}}]),t}(c.Component);o()(q,"propTypes",{orderId:h.a.number.isRequired});var K,Q=Object(S.b)(function(e,t){var n=t.orderId,r=Object(M.a)(e);return{siteId:r,loaded:Object(T.a)(e,n,r),events:Object(D.b)(e,n),orderLoading:Object(G.c)(e,n,r),orderLoaded:Object(G.b)(e,n,r),labelsEnabled:Object(w.a)(e,r)}},function(e){return i()({},Object(j.b)({openPrintingFlow:N.x,openTrackingFlow:N.A,setEmailDetailsOption:N.M,setFulfillOrderOption:N.N,fetchOrder:V.e},e))})(Object(C.localize)(B(q))),J=n(25),Y=n.n(J),Z=n(538),X=(K={},o()(K,Z.fb,function(e){e.error||window.wc_shipment_tracking_refresh&&window.wc_shipment_tracking_refresh()}),o()(K,Z.bb,function(){var e=Y()("#woocommerce-order-label");e.pointer&&e.pointer().pointer("close")}),K),$=function(){return function(e){return function(t){e(t);var n=X[t.type];n&&n(t)}}},ee=n(592),te=n(110),ne=n.n(te),re=n(46),ie=n(535),ae=n(690),oe=function(e){return Boolean(e&&e.name&&e.address&&e.city&&e.postcode&&e.country)},ce=function(e){if(!e)return{loaded:!1,isFetching:!1,error:!1,fulfillOrder:!1,emailDetails:!1};var t=e.formData,n=e.labelsData,r=e.paperSize,i=e.storeOptions,a=e.canChangeCountries,o=Boolean(t.origin_normalized||t.origin.phone),c=oe(t.origin),u=oe(t.destination),s={};return Object(A.forEach)(t.selected_packages,function(e){e.items.map(function(e){var n=e.product_id,r=e.weight,i=e.name,a=e.attributes,o=e.description,c=e.value,u=e.hs_tariff_number,d=e.origin_country,f=a?" ("+a+")":"",l=i.substring(i.indexOf("-")+1).trim()+f;s[n]={defaultDescription:l,description:o||l,weight:r,value:c,tariffNumber:u,originCountry:d||t.origin.country}})}),{loaded:!0,isFetching:!1,error:!1,fulfillOrder:!1,emailDetails:!1,refreshedLabelStatus:!1,labels:n||[],paperSize:r,storeOptions:i,form:{orderId:t.order_id,origin:{values:t.origin,isNormalized:o,normalized:o?t.origin:null,ignoreValidation:c?null:Object(A.mapValues)(t.origin,function(){return!0}),selectNormalized:!0,normalizationInProgress:!1,allowChangeCountry:Boolean(a)},destination:{values:t.destination,isNormalized:Boolean(t.destination_normalized),normalized:t.destination_normalized?t.destination:null,ignoreValidation:u?null:Object(A.mapValues)(t.destination,function(){return!0}),selectNormalized:!0,normalizationInProgress:!1,allowChangeCountry:Boolean(a)},packages:{all:t.all_packages,flatRateGroups:t.flat_rate_groups,selected:t.selected_packages,isPacked:t.is_packed,saved:!0},customs:{items:s,ignoreWeightValidation:Object(A.mapValues)(s,function(e){var t=e.weight;return!t||!parseFloat(t)}),ignoreValueValidation:Object(A.mapValues)(s,function(e){var t=e.value;return!t||!parseFloat(t)})},rates:{values:Object(A.isEmpty)(t.rates.selected)?Object(A.mapValues)(t.packages,function(){return{serviceId:"",signatureRequired:!1}}):t.rates.selected,available:{},retrievalInProgress:!1},rateOptions:{}},openedPackageId:Object.keys(t.selected_packages)[0]||""}},ue=n(637),se=function(e,t){for(var n=0;n<=t.length;n++)if(-1===t.indexOf(e+n))return e+n},de={};de[Z.V]=function(e,t){return i()({},e,ce(Object(A.omit)(t,"type","siteId")))},de[Z.Db]=function(e,t){var n=t.isFetching;return i()({},e,{isFetching:n})},de[Z.Bb]=function(e,t){var n=t.error;return i()({},e,{error:n})},de[Z.bb]=function(e){return i()({},e,{showPurchaseDialog:!0})},de[Z.Vb]=function(e){return i()({},e,{showTrackingDialog:!0})},de[Z.U]=function(e,t){return!t.force&&e.form.isSubmitting?e:i()({},e,{showPurchaseDialog:!1,form:i()({},e.form,{isSubmitting:!1})})},de[Z.F]=function(e){return i()({},e,{showTrackingDialog:!1})},de[Z.Ob]=function(e,t){var n=t.stepName,r=t.expanded,a=void 0===r?null:r;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{expanded:Object(A.isBoolean)(a)?a:!e.form[n].expanded})))})},de[Z.Pb]=function(e,t){var n=t.group,r=t.name,a=t.value,c=i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{values:i()({},e.form[n].values,o()({},r,a)),isNormalized:!1,isUnverifiable:!1,normalized:null})))});return"country"===r?de[Z.Pb](c,{group:n,name:"state",value:""}):(e.form[n].ignoreValidation&&(c.form[n].ignoreValidation=i()({},e.form[n].ignoreValidation,o()({},r,!1))),c)},de[Z.kb]=function(e,t){var n=t.group;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{ignoreValidation:null})))})},de[Z.H]=function(e,t){var n=t.group;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{normalizationInProgress:!0})))})},de[Z.G]=function(e,t){var n=t.group,r=t.requestSuccess,a=t.fieldErrors,c=t.normalized,u=t.isTrivialNormalization,s=i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{isNormalized:r,normalizationInProgress:!1,fieldErrors:a,selectNormalized:r&&!a,normalized:c})))});return u&&(s.form[n].values=c),s},de[Z.qb]=function(e,t){var n=t.group,r=t.selectNormalized;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{selectNormalized:r})))})},de[Z.S]=function(e,t){var n=t.group;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{selectNormalized:!1,normalized:null,isNormalized:!1,isUnverifiable:!1})))})},de[Z.T]=function(e,t){var n=t.group;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{selectNormalized:!1,normalized:null,isNormalized:!1,isUnverifiable:!0})))})},de[Z.Q]=function(e,t){var n=t.group,r=i()({},e.form[n],{expanded:!1,isNormalized:!0});return r.selectNormalized&&r.normalized?r.values=r.normalized:r.normalized=r.values,i()({},e,{form:i()({},e.form,o()({},n,r))})},de[Z.Qb]=function(e,t){var n=t.packageId,r=t.value,a=i()({},e.form.packages.selected);return a[n]=i()({},a[n],{weight:parseFloat(r),isUserSpecifiedWeight:!0}),i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:a,saved:!1}),rates:i()({},e.form.rates,{values:i()({},e.form.rates.values,o()({},n,{serviceId:"",signatureRequired:!1})),available:{}})})})},de[Z.Fb]=function(e,t){var n=t.packageId,r=t.signature,a=i()({},e.form.packages.selected);return a[n]=i()({},a[n],{signature:r}),i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:a,saved:!1}),rates:i()({},e.form.rates,{values:i()({},e.form.rates.values,o()({},n,{serviceId:"",signatureRequired:!1})),available:{}})})})},de[Z.ab]=function(e,t){var n=t.openedPackageId;return i()({},e,{openedPackageId:n})},de[Z.Z]=function(e,t){var n=t.movedItemIndex;return i()({},e,{showItemMoveDialog:!0,targetPackageId:e.openedPackageId,movedItemIndex:n})},de[Z.W]=function(e,t){var n=t.originPackageId,r=t.movedItemIndex,a=t.targetPackageId;if(-1===r||n===a||void 0===n)return e;var o=i()({},e.form.packages.selected),c=null,u=e.openedPackageId,s=ne()(o[n].items),d=s.splice(r,1)[0];if(o[n]=i()({},o[n],{items:s,weight:Object(A.round)(o[n].weight-d.weight,8)}),"individual"===a){var f=Object.keys(o);c=se("client_individual_",f);var l=d.height,b=d.length,O=d.width,p=d.weight;o[c]={height:l,length:b,width:O,weight:p,id:c,box_id:"individual",items:[d]}}else if("new"===a){var m=Object.keys(o);o[c=se("client_custom_",m)]={height:0,length:0,width:0,weight:d.weight,id:c,box_id:"not_selected",items:[d]}}else if(a){var g=ne()(o[a].items);g.push(d),o[a]=i()({},o[a],{items:g,weight:Object(A.round)(o[a].weight+d.weight,8)})}return 0===o[n].items.length&&(delete o[n],u=c||a),i()({},e,{openedPackageId:u,addedPackageId:c,movedItemIndex:-1,showItemMoveDialog:!1,form:i()({},e.form,{needsPrintConfirmation:!1,packages:i()({},e.form.packages,{selected:o,saved:!1}),rates:i()({},e.form.rates,{values:Object(A.mapValues)(o,function(){return{serviceId:"",signatureRequired:!1}}),available:{}})})})},de[Z.N]=function(e){return i()({},e,{movedItemIndex:-1,showItemMoveDialog:!1})},de[Z.Kb]=function(e,t){var n=t.targetPackageId;return i()({},e,{targetPackageId:n})},de[Z.X]=function(e){return i()({},e,{showAddItemDialog:!0,addedItems:{}})},de[Z.L]=function(e){return i()({},e,{showAddItemDialog:!1})},de[Z.sb]=function(e,t){var n,r=t.sourcePackageId,a=t.movedItemIndex;if(t.added){var c=e.addedItems[r]||[];n=Object(A.includes)(c,a)?c:[].concat(ne()(c),[a])}else n=Object(A.without)(e.addedItems[r],a);return i()({},e,{addedItems:i()({},e.addedItems,o()({},r,n))})},de[Z.I]=function(e,t){var n=t.targetPackageId;return Object(A.each)(e.addedItems,function(t,r){Object(A.sortBy)(t,function(e){return-e}).forEach(function(t){e=de[Z.W](e,{originPackageId:r,movedItemIndex:t,targetPackageId:n})})}),i()({},e,{showAddItemDialog:!1})},de[Z.J]=function(e){var t=i()({},e.form.packages.selected),n=Object.keys(t),r=se("client_custom_",n),a=r;return t[r]={height:0,length:0,width:0,id:r,weight:0,box_id:"not_selected",items:[]},i()({},e,{openedPackageId:a,addedPackageId:r,form:i()({},e.form,{needsPrintConfirmation:!1,packages:i()({},e.form.packages,{selected:t,saved:!1}),rates:i()({},e.form.rates,{values:Object(A.mapValues)(t,function(){return{serviceId:"",signatureRequired:!1}}),available:{}})})})},de[Z.lb]=function(e,t){var n=t.packageId,r=i()({},e.form.packages.selected),a=r[n].items;delete r[n];var o=Object.keys(r)[0]||"",c=i()({},r[o]);return c.items=c.items.concat(a),r[o]=c,i()({},e,{openedPackageId:o,form:i()({},e.form,{needsPrintConfirmation:!1,packages:i()({},e.form.packages,{selected:r,saved:!1}),rates:i()({},e.form.rates,{values:Object(A.mapValues)(r,function(){return{serviceId:"",signatureRequired:!1}}),available:{}})})})},de[Z.Gb]=function(e,t){var n=t.box,r=t.packageId,a=t.boxTypeId,o=i()({},e.form.packages.selected),c=o[r],u=Object(A.round)(c.isUserSpecifiedWeight?c.weight:(n?n.box_weight:0)+Object(A.sumBy)(c.items,"weight"),8);if("not_selected"!==a&&n){var s=Object(ae.a)(n),d=s.length,f=s.width,l=s.height;o[r]=i()({},Object(A.omit)(c,"service_id"),{height:l,length:d,width:f,weight:u,box_id:a,is_letter:n.is_letter})}else o[r]=i()({},Object(A.omit)(c,"service_id"),{height:0,length:0,width:0,weight:u,box_id:a});return i()({},e,{form:i()({},e.form,{needsPrintConfirmation:!1,packages:i()({},e.form.packages,{selected:o,saved:!1}),rates:i()({},e.form.rates,{values:Object(A.mapValues)(o,function(){return{serviceId:"",signatureRequired:!1}}),available:{}})})})},de[Z.pb]=function(e){return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{saved:!0})})})},de[Z.ub]=function(e,t){var n=t.packageId,r=t.contentsType;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{contentsType:r})))})})})},de[Z.tb]=function(e,t){var n=t.packageId,r=t.contentsExplanation;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{contentsExplanation:r})))})})})},de[Z.Jb]=function(e,t){var n=t.packageId,r=t.restrictionType;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{restrictionType:r})))})})})},de[Z.Ib]=function(e,t){var n=t.packageId,r=t.restrictionComments;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{restrictionComments:r})))})})})},de[Z.rb]=function(e,t){var n=t.packageId,r=t.abandonOnNonDelivery;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{abandonOnNonDelivery:Boolean(r)})))})})})},de[Z.Eb]=function(e,t){var n=t.packageId,r=t.itn;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{itn:r})))})})})},de[Z.vb]=function(e,t){var n=t.productId,r=t.description;return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:i()({},e.form.customs.items,o()({},n,i()({},e.form.customs.items[n],{description:r})))})})})},de[Z.xb]=function(e,t){var n=t.productId,r=t.tariffNumber;return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:i()({},e.form.customs.items,o()({},n,i()({},e.form.customs.items[n],{tariffNumber:r.replace(/\D/g,"").substr(0,6)})))})})})},de[Z.zb]=function(e,t){var n=t.productId,r=t.weight;return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:i()({},e.form.customs.items,o()({},n,i()({},e.form.customs.items[n],{weight:r}))),ignoreWeightValidation:i()({},e.form.customs.ignoreWeightValidation,o()({},n,!1))})})})},de[Z.yb]=function(e,t){var n=t.productId,r=t.value;return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:i()({},e.form.customs.items,o()({},n,i()({},e.form.customs.items[n],{value:r}))),ignoreValueValidation:i()({},e.form.customs.ignoreValueValidation,o()({},n,!1))})})})},de[Z.wb]=function(e,t){var n=t.productId,r=t.originCountry;return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:i()({},e.form.customs.items,o()({},n,i()({},e.form.customs.items[n],{originCountry:r})))})})})},de[Z.ob]=function(e){return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:Object(A.mapValues)(e.form.customs.items,function(e){return i()({},e,{tariffNumber:e.tariffNumber||""})}),ignoreWeightValidation:{},ignoreValueValidation:{}})})})},de[Z.Sb]=function(e,t){var n=t.packageId,r=t.serviceId,a=t.signatureRequired,o=i()({},e.form.rates.values);return o[n]={serviceId:r,signatureRequired:a},i()({},e,{form:i()({},e.form,{rates:i()({},e.form.rates,{values:o})})})},de[Z.Rb]=function(e,t){var n=t.value;return i()({},e,{paperSize:n})},de[Z.Ab]=function(e,t){var n=t.value;return i()({},e,{emailDetails:n})},de[Z.Cb]=function(e,t){var n=t.value;return i()({},e,{fulfillOrder:n})},de[Z.eb]=function(e){return i()({},e,{form:i()({},e.form,{isSubmitting:!0})})},de[Z.fb]=function(e,t){var n=t.response;return t.error?i()({},e,{form:i()({},e.form,{isSubmitting:!1})}):i()({},e,{labels:[].concat(ne()(n.map(function(e){return i()({},e,{statusUpdated:!0})})),ne()(e.labels))})},de[Z.Lb]=function(e,t){var n=t.fileData,r=t.labels;return i()({},e,{form:i()({},e.form,{needsPrintConfirmation:!0,fileData:n,labelsToPrint:r,isSubmitting:!1})})},de[Z.hb]=function(e,t){var n=t.requestData;return i()({},e,{form:i()({},e.form,{rates:i()({},e.form.rates,{retrievalInProgress:n})})})},de[Z.Hb]=function(e,t){var n=t.rates,r=t.requestData;return Object(A.isEqual)(r,e.form.rates.retrievalInProgress)?i()({},e,{form:i()({},e.form,{rates:{values:Object(A.mapValues)(n,function(e){var t=Object(A.get)(e,"rates",[]),n=1===t.length?t[0]:Object(A.find)(t,function(e){return e.is_selected});return n?n.service_id:""}),available:n}})}):e},de[Z.gb]=function(e,t){var n=t.requestData;return Object(A.isEqual)(n,e.form.rates.retrievalInProgress)?i()({},e,{form:i()({},e.form,{rates:i()({},e.form.rates,{retrievalInProgress:null})})}):e},de[Z.K]=function(e){return i()({},e,{form:i()({},e.form,{needsPrintConfirmation:!1,rates:i()({},e.form.rates,{available:{}})})})},de[Z.cb]=function(e,t){var n=t.labelId;return i()({},e,{refundDialog:{labelId:n}})},de[Z.O]=function(e){return e.refundDialog.isSubmitting?e:i()({},e,{refundDialog:null})},de[Z.Nb]=function(e,t){var n=t.labelId,r=Object(A.findIndex)(e.labels,{label_id:n}),a=i()({},e.labels[r],{statusRetrivalInProgress:!0}),o=i()({},e,{labels:ne()(e.labels)});return o.labels[r]=a,o},de[Z.Mb]=function(e,t){var n=t.labelId,r=t.response;t.error&&(r={});var a=Object(A.findIndex)(e.labels,{label_id:n}),o=i()({},e.labels[a],r,{statusUpdated:!0,statusRetrivalInProgress:!1}),c=i()({},e,{labels:ne()(e.labels),refreshedLabelStatus:!0});return c.labels[a]=o,c},de[Z.ib]=function(e){return i()({},e,{refundDialog:i()({},e.refundDialog,{isSubmitting:!0})})},de[Z.jb]=function(e,t){var n=t.response;if(t.error)return i()({},e,{refundDialog:i()({},e.refundDialog,{isSubmitting:!1})});var r=Object(A.findIndex)(e.labels,{label_id:e.refundDialog.labelId}),a=i()({},e.labels[r],{refund:n}),o=i()({},e,{refundDialog:null,labels:ne()(e.labels)});return o.labels[r]=a,o},de[Z.db]=function(e,t){var n=t.labelId;return i()({},e,{reprintDialog:{labelId:n,isFetching:!0}})},de[Z.nb]=function(e,t){var n=t.labelId,r=t.fileData;return Object(A.get)(e,"reprintDialog.labelId")!==n?e:i()({},e,{reprintDialog:{labelId:n,fileData:r,isFetching:!1}})},de[Z.mb]=function(e,t){var n=t.labelId;return Object(A.get)(e,"reprintDialog.labelId")!==n?e:i()({},e,{reprintDialog:{labelId:n,isFetching:!1}})},de[Z.P]=function(e){return i()({},e,{reprintDialog:null})},de[Z.R]=function(e){return i()({},e,{reprintDialog:i()({},e.reprintDialog,{isFetching:!0})})},de[Z.Y]=function(e,t){var n=t.labelId;return i()({},e,{detailsDialog:{labelId:n}})},de[Z.M]=function(e){return i()({},e,{detailsDialog:null})},de[ie.H]=function(e,t){var n=t.order.status;return i()({},e,{fulfillOrder:!Object(ue.b)(n),emailDetails:Object(ue.b)(n)})};var fe=Object(re.d)("orderId",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ce(),t=arguments.length>1?arguments[1]:void 0;return de[t.type]?de[t.type](e,t):e}),le=n(651),be=n(652),Oe=n(636);var pe=Object(re.a)({isSending:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=t.type,r=t.orderId;switch(n){case ie.s:return i()({},e,o()({},r,!0));case ie.u:case ie.t:return i()({},e,o()({},r,!1));default:return e}}});var me=Object(re.a)({isLoading:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.v:case ie.x:case ie.w:return Object.assign({},e,o()({},t.orderId,ie.v===t.type));default:return e}},isSaving:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.y:case ie.z:case ie.A:return Object.assign({},e,o()({},t.orderId,ie.y===t.type));default:return e}},items:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.x:var n=Object(A.keyBy)(t.notes,"id");return Object.assign({},e,n);case ie.A:var r=t.note;return Object.assign({},e,o()({},r.id,r));default:return e}},orders:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.x:var n=t.notes.map(function(e){return e.id});return Object.assign({},e,o()({},t.orderId,n));case ie.A:var r=t.note,i=t.orderId,a=[].concat(ne()(e[i]||[]),[r.id]);return Object.assign({},e,o()({},i,a));default:return e}}});var ge=Object(re.d)("orderId",Object(re.a)({isSaving:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.C:case ie.E:case ie.D:return ie.C===t.type;default:return e}},items:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.B:return t.refunds;case ie.E:return[].concat(ne()(e),[t.refund]);default:return e}}}));var Ee=Object(re.a)({invoice:pe,isDeleting:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.p:case ie.q:case ie.r:return Object.assign({},e,o()({},t.orderId,ie.p===t.type));default:return e}},isQueryLoading:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.m:case ie.o:case ie.n:var n=Object(Oe.c)(t.query);return Object.assign({},e,o()({},n,ie.m===t.type));default:return e}},isLoading:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.F:case ie.H:case ie.G:return Object.assign({},e,o()({},t.orderId,ie.F===t.type));default:return e}},isUpdating:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=Object(A.isFinite)(t.orderId)?t.orderId:JSON.stringify(t.orderId);switch(t.type){case ie.I:case ie.K:case ie.J:return Object.assign({},e,o()({},n,ie.I===t.type));default:return e}},items:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case ie.o:return e=Object(A.keyBy)(n.orders,"id"),Object.assign({},t,e);case ie.H:case ie.K:return e=o()({},n.order.id,n.order),Object.assign({},t,e);default:return t}},queries:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.o:var n=t.orders.map(function(e){return e.id}),r=Object(Oe.c)(t.query);return Object.assign({},e,o()({},r,n));default:return e}},refunds:ge,total:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.o:var n=Object(Oe.c)(Object(A.omit)(t.query,"page"));return Object.assign({},e,o()({},n,t.total));default:return e}},notes:me}),ve=n(47),Ie=n.n(ve),_e=n(605),he=n(608),je=n(549);function Se(e){return{type:ie.f,siteId:e}}var Ce=function(e){return Object(A.get)(e,"ui.route.path.current",null)},ye=n(712),Re=n.n(ye),Pe=n(113),ke=n.n(Pe),Ae=function(e){function t(e){var n;return d()(this,t),(n=O()(this,m()(t).call(this,"Failed to validate with JSON schema"))).schemaErrors=e,n}return I()(t,e),t}(Re()(Error)),Le=function(e){function t(e,n,r){var i;return d()(this,t),(i=O()(this,m()(t).call(this,e.message))).inputData=n,i.transformer=r,i}return I()(t,e),t}(Re()(Error));var Ne,Me,Te,we=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:A.identity,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(a){return t||function(){var a=Object.assign({greedy:!0,verbose:!0},i),o=ke()(e,a),c=ke.a.filter(Object.assign({},e,e.type&&"object"===e.type&&{additionalProperties:!1}));n=function(e){if(!o(e))throw new Ae(o.errors);return c(e)},t=function(e){try{return r(e)}catch(t){throw new Le(t,e,r)}}}(),t(n(a))}},De=n(715),Ve=n(533),Ge=n.n(Ve),xe=function(e){var t=e.apiVersion,n=e.apiNamespace,r=e.body,a=e.method,o=e.path,c=e.query,u=void 0===c?{}:c,s=e.formData,d=e.onSuccess,f=e.onFailure,l=e.onProgress,b=Ge()(e,["apiVersion","apiNamespace","body","method","path","query","formData","onSuccess","onFailure","onProgress"]),O=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,p=n?{apiNamespace:n}:{apiVersion:t};return{type:"WPCOM_HTTP_REQUEST",body:r,method:a,path:o,query:i()({},u,p),formData:s,onSuccess:d||O,onFailure:f||O,onProgress:l||O,options:b}},Ue=n(562),We=n(609),Fe={},Be=new Set,ze={hasInitializedSites:!1,hasInitializedSection:!1,lastSection:null,lastSite:null},He=["/jetpack/connect/user-type","/jetpack/connect/site-type","/jetpack/connect/site-topic"],qe=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(t)})},Ke=function(e){return e.data.map(function(e){return{message:qe(e.content.message),description:qe(e.content.description),featureClass:e.feature_class,callToAction:qe(e.CTA.message),id:e.id}})},Qe=function(e){return function(t,n){if(ze.hasInitializedSites&&ze.hasInitializedSection){var r=ze.lastSite;if(Object(Ue.c)(n(),r)){var a=Ce(n());Object(A.some)(He,function(e){return Object(A.startsWith)(a,e)})||t(xe({apiNamespace:"rest",method:"GET",path:"/v1.1/jetpack-blogs/".concat(r,"/rest-api/"),query:{path:"/jetpack/v4/jitm",query:JSON.stringify({message_path:"calypso:".concat(ze.lastSection,":admin_notices")}),http_envelope:1}},i()({},e,{messagePath:ze.lastSection})))}}}},Je=function(e,t){return function(n,r){n(function(e,t,n){return{type:"JITM_SET",keyedPath:t+e,jitms:n.map(function(e){return i()({},e,{lastUpdated:Date.now()})})}}(e.siteId||e.site_id||Object(M.a)(r()),e.messagePath,t))}},Ye=function(e){return function(t,n){t(function(e,t){return{type:"JITM_SET",keyedPath:t+e,jitms:[]}}(e.siteId||e.site_id||Object(M.a)(n()),e.messagePath))}};Me="state/data-layer/wpcom/sites/jitm/index.js",Ne={},o()(Ne,"SECTION_SET",[Object(he.a)({fetch:function(e){var t=Object(A.get)(e,["section","name"]);if(!ze.hasInitializedSection||!e.section||ze.lastSection!==t){switch(e.isLoading){case!1:return void(ze.hasInitializedSection=!0);case!0:return void(ze.hasInitializedSection=!1)}return ze.lastSection=t,Qe(e)}},onSuccess:Je,onError:Ye,fromApi:we(De,Ke)})]),o()(Ne,"SELECTED_SITE_SET",[Object(he.a)({fetch:function(e){if(!ze.hasInitializedSites||ze.lastSite!==e.siteId)return ze.hasInitializedSites=!!e.siteId,ze.lastSite=e.siteId,Qe(e)},onSuccess:Je,onError:Ye,fromApi:we(De,Ke)})]),o()(Ne,"JITM_DISMISS",[Object(he.a)({fetch:function(e){return xe({apiNamespace:"rest",method:"POST",path:"/jetpack-blogs/".concat(e.siteId,"/rest-api/"),query:{path:"/jetpack/v4/jitm",body:JSON.stringify({feature_class:e.featureClass,id:e.id}),http_envelope:1,json:!1}},e)},onSuccess:A.noop,onError:A.noop})]),Te=Ne,Be.has(Me)||(Be.add(Me),Fe=Object(We.a)(Fe,Te));var Ze,Xe=n(635),$e=n(639),et=Ie()("woocommerce:orders");function tt(e,t){if(et("API Error: ",t),e.failureAction)return i()({},e.failureAction,{error:t})}var nt,rt=(Ze={},o()(Ze,ie.p,[Object(he.a)({fetch:function(e){var t=e.siteId,n=e.orderId;return Object(Xe.a)(t,e).del("orders/".concat(n))},onSuccess:function(e){return function(t){var n=e.siteId,r=e.siteSlug,i=e.orderId;t(Object(V.b)(n,i)),t(Se(n)),t({type:"NAVIGATE",path:"/store/orders/".concat(r)}),t(Object(je.d)(Object(C.translate)("Order deleted."),{duration:8e3}))}},onError:function(e,t){return function(n){var r=e.siteId,i=e.orderId;n(Object(V.a)(r,i,t)),n(Object(je.a)(Object(C.translate)("Unable to delete order."),{duration:8e3}))}},fromApi:$e.a})]),o()(Ze,ie.F,[Object(he.a)({fetch:function(e){var t=e.siteId,n=e.orderId;return e.failureAction=Object(V.c)(t,n),Object(Xe.a)(t,e).get("orders/".concat(n))},onSuccess:function(e,t){var n=t.data,r=e.siteId,i=e.orderId;return Object(V.i)(r,i,n)},onError:tt})]),o()(Ze,ie.I,[Object(he.a)({fetch:function(e){var t=e.siteId,n=e.orderId,r=e.order;return Object(A.isFinite)(n)?Object(Xe.a)(t,e).post("orders/".concat(n),r):Object(Xe.a)(t,e).post("orders",r)},onSuccess:function(e,t){var n=t.data;return function(t){var r=e.siteId,i=e.orderId;"function"===typeof e.onSuccess&&"undefined"!==typeof n.id&&e.onSuccess(t,n.id),t(Se(r)),t(Object(V.h)(r,i,n))}},onError:function(e,t){return function(n){var r=e.siteId,i=e.orderId;"function"===typeof e.onFailure&&e.onFailure(n),et("API Error: ",t),n(Object(V.g)(r,i,t))}}})]),o()(Ze,ie.m,[Object(he.a)({fetch:function(e){var t=e.siteId,n=e.query,r=Object(_e.stringify)(Object(A.omitBy)(n,function(e){return""===e}));return e.failureAction=Object(V.d)(t,n),Object(Xe.a)(t,e).getWithHeaders("orders?".concat(r))},onSuccess:function(e,t){var n=t.data,r=e.siteId,i=e.query,a=n.body,o=n.headers,c=Number(o["X-WP-Total"]);return Object(V.j)(r,i,a,c)},onError:tt})]),Ze),it=n(687),at=(nt={},o()(nt,ie.v,[Object(he.a)({fetch:function(e){var t=e.siteId,n=e.orderId;return Object(Xe.a)(t,e).get("orders/".concat(n,"/notes"))},onSuccess:function(e,t){var n=t.data;return function(t){var r=e.siteId,i=e.orderId;t(Object(it.e)(r,i,n)),e.onSuccess&&t(e.onSuccess)}},onError:function(e,t){return function(n){var r=e.siteId,i=e.orderId;n(Object(it.d)(r,i,t)),e.onFailure&&n(e.onFailure)}},fromApi:$e.a})]),o()(nt,ie.y,[Object(he.a)({fetch:function(e){var t=e.siteId,n=e.orderId,r=e.note;return Object(Xe.a)(t,e).post("orders/".concat(n,"/notes"),r)},onSuccess:function(e,t){var n=t.data;return function(t){var r=e.siteId,i=e.orderId;t(Object(it.c)(r,i,n)),e.onSuccess&&t(e.onSuccess)}},onError:function(e,t){return function(n){var r=e.siteId,i=e.orderId;n(Object(it.b)(r,i,t)),e.onFailure&&n(e.onFailure)}},fromApi:$e.a})]),nt),ot=n(657),ct=n(633),ut=n(116),st=n(691),dt=o()({},ie.k,[Object(he.a)({fetch:function(e){var t=e.siteId;return Object(Xe.a)(t,e,"/wc/v3").get("data/continents")},onSuccess:function(e,t){var n=e.siteId,r=t.data;return Object(st.c)(n,r)},onError:function(e,t){var n=e.siteId;return Object(st.b)(n,t)}})]),ft=n(658),lt=(n(716),u.a.lazy(function(){return Promise.all([n.e(1),n.e(136),n.e(2),n.e(137),n.e(152)]).then(n.bind(null,796))}));t.default=function(e){var t=e.order,n=e.accountSettings,r=e.packagesSettings,a=e.shippingLabelData,s=e.continents,d=e.context,f=e.items,l=t?t.id:null,b=void 0!==n;return{getReducer:function(){return Object(re.a)({extensions:Object(re.a)({woocommerce:Object(re.a)({woocommerceServices:Object(re.a)({1:Object(re.a)({shippingLabel:fe,packages:le.a,labelSettings:be.a})}),sites:Object(re.a)({1:Object(re.a)({orders:Ee,data:Object(re.a)({locations:ft.a})})})})}),notices:ee.a,ui:function(){return{selectedSiteId:1}}})},getInitialState:function(){var e={extensions:{woocommerce:{sites:{1:{orders:{notes:{isLoading:o()({},l,!1)}}}}}}};return b?function(e){var c=n.storeOptions,u=n.formMeta,d=n.userMeta,f=n.formData,b=r.formData,O=r.storeOptions.dimension_unit,p=r.storeOptions.weight_unit,m=r.formSchema.custom?r.formSchema.custom.items:void 0,g=r.formSchema.predefined;return e.extensions.woocommerce.woocommerceServices={1:{shippingLabel:o()({},l,ce(a)),labelSettings:{storeOptions:c,meta:i()({},u,{pristine:!0,isLoaded:!0,user:d}),data:i()({},f)},packages:{modalErrors:{},pristine:!0,packages:b,dimensionUnit:O,weightUnit:p,packageSchema:m,predefinedSchema:g,packageData:{is_user_defined:!0},isLoaded:!0}}},e.extensions.woocommerce.sites[1].orders.isLoading=o()({},l,!1),e.extensions.woocommerce.sites[1].orders.items=o()({},l,t),e.extensions.woocommerce.sites[1].data={locations:s},e}(e):e},getStateForPersisting:function(){return null},getStateKey:function(){return"wcs-label-".concat(l)},getMiddlewares:function(){return[$,Object(ut.b)(Object(We.a)(ct.a,ot.a,rt,at,dt))]},View:function(){return"shipment_tracking"===d?u.a.createElement(c.Suspense,{fallback:u.a.createElement("div",null)},u.a.createElement(lt,{orderId:l})):u.a.createElement(Q,{orderId:l,items:f})}}}}}]);
|
|
dist/chunks/{55d86b44c8592d62c9ba.css → 2b8a69d8be5791453fd6.css}
RENAMED
File without changes
|
dist/chunks/{55d86b44c8592d62c9ba.min.js → 2b8a69d8be5791453fd6.min.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[152],{601:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),a=n.n(r),s=n(528),l=n.n(s),c=n(527),u=n.n(c),d=n(529),p=n.n(d),m=n(34),h=n.n(m),f=n(10),b=n.n(f),g=n(12),v=n.n(g),y=n(526),E=n.n(y),k=n(1),w=n(534),C=n.n(w),I=(n(629),function(e){function t(){return o()(this,t),l()(this,u()(t).apply(this,arguments))}return p()(t,e),a()(t,[{key:"render",value:function(){var e=E()("external-link",this.props.className,{"icon-first":!!this.props.showIconFirst},{"has-icon":!!this.props.icon}),t=Object(k.assign)({},Object(k.omit)(this.props,"icon","iconSize","showIconFirst","iconClassName"),{className:e,rel:"external"});t.target&&(t.rel=t.rel.concat(" noopener noreferrer"));var n=b.a.createElement(C.a,{className:this.props.iconClassName,icon:"external",size:this.props.iconSize});return b.a.createElement("a",t,this.props.icon&&this.props.showIconFirst&&n,this.props.children,this.props.icon&&!this.props.showIconFirst&&n)}}]),t}(f.Component));h()(I,"defaultProps",{iconSize:18,showIconFirst:!1}),h()(I,"propTypes",{className:v.a.string,href:v.a.string,onClick:v.a.func,icon:v.a.bool,iconSize:v.a.number,target:v.a.string,showIconFirst:v.a.bool,iconClassName:v.a.string}),t.a=I},629:function(e,t,n){},632:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),a=n.n(r),s=n(528),l=n.n(s),c=n(527),u=n.n(c),d=n(531),p=n.n(d),m=n(529),h=n.n(m),f=n(34),b=n.n(f),g=n(12),v=n.n(g),y=n(10),E=n.n(y),k=n(76),w=n.n(k),C=n(109),I=n(47),R=n.n(I),O=n(526),N=n.n(O),_=n(662),D=n.n(_),j=n(1),P=n(628),L=n(78),q=n.n(L),S=n(672),x=n.n(S),T=R()("calypso:popover:util");function M(){var e={};return e.top=window.scrollY,e.left=window.scrollX,e.width=window.innerWidth,e.height=window.innerHeight,e.right=e.left+e.width,e.bottom=e.top+e.height,T("viewport: %o",e),e}var A={top:"bottom",bottom:"top",left:"right",right:"left"},z={top:"right",left:"top",bottom:"left",right:"bottom"},F=M();function U(){F=M()}var V=!1,B=function(){if(V)return T("window events already bound");V=!0,T("bind handlers to `resize` and `scroll` events"),window.addEventListener("resize",U,!0),window.addEventListener("scroll",U,!0)},W=function(){if(!V)return T("window events are not bound");V=!1,T("unbind handlers to `resize` and `scroll` events"),window.removeEventListener("resize",U,!0),window.removeEventListener("scroll",U,!0)},H=function(e,t,n){var i=x()(n),o=t.clientHeight,r=t.clientWidth,a={top:i.top-o,bottom:F.height-i.bottom-o,left:i.left-r,right:F.width-i.right-r},s=e.split(/\s+/),l=q()(s,1)[0],c=q()(s,2)[1],u=function(e,t){for(var n,i=[e,A[e],z[e],A[z[e]]],o=-1/0,r=0,a=i.length;r<a;r++){var s=i[r],l=t[s];if(l>0)return s;l>o&&(o=l,n=e)}return n}(l,a);return c!==u&&c!==A[u]||(c=null),function(e,t,n,i,o,r){for(var a,s="top"===e||"bottom"===e,l=t?[s?"".concat(e," ").concat(t):"".concat(t," ").concat(e),e,s?"".concat(e," ").concat(A[t]):"".concat(A[t]," ").concat(e)]:[e,s?"".concat(e," ").concat(z[e]):"".concat(z[e]," ").concat(e),s?"".concat(e," ").concat(A[z[e]]):"".concat(A[z[e]]," ").concat(e)],c=0,u=o*r,d=0,p=l.length;d<p;d++){var m=l[d],h=K(m,n,i),f=h.left+o,b=h.top+r,g=Math.min(h.top<F.top?b-F.top:F.bottom-h.top,r),v=Math.min(h.left<F.left?f-F.left:F.right-h.left,o),y=v*g;if(y===u)return m;y>c&&(c=y,a=m)}return a}(u,c,t,n,r,o)||e};function K(e,t,n,i){var o=x()(t);if(!o)throw new Error("could not get bounding client rect of Tip element");var r=o.width,a=o.height,s=x()(n);if(!s)throw new Error("could not get bounding client rect of `target`");var l=s.width,c=s.height,u=function(e,t){var n=t.body||t.getElementsByTagName("body")[0],i=t.documentElement||n.parentNode,o=i.clientTop||n.clientTop||0,r=i.clientLeft||n.clientLeft||0,a=window.pageYOffset||i.scrollTop,s=window.pageXOffset||i.scrollLeft;return{top:e.top+a-o,left:e.left+s-r}}(s,document);if(!u)throw new Error("could not determine page offset of `target`");var d={};switch(e){case"top":d={top:u.top-a,left:i&&i.left?u.left+i.left:u.left+l/2-r/2};break;case"bottom":d={top:u.top+c,left:i&&i.left?u.left+i.left:u.left+l/2-r/2};break;case"right":d={top:u.top+c/2-a/2,left:u.left+l};break;case"left":d={top:u.top+c/2-a/2,left:u.left-r};break;case"top left":d={top:u.top-a,left:u.left+l/2-r+15};break;case"top right":d={top:u.top-a,left:u.left+l/2-15};break;case"bottom left":d={top:u.top+c,left:u.left+l/2-r+15};break;case"bottom right":d={top:u.top+c,left:u.left+l/2-15};break;case"left top":d={top:u.top+c/2-a,left:u.left-r};break;case"left bottom":d={top:u.top+c/2,left:u.left-r};break;case"right top":d={top:u.top+c/2-a,left:u.left+l};break;case"right bottom":d={top:u.top+c/2,left:u.left+l};break;default:throw new Error('invalid position "'.concat(e,'"'))}return d}var Y=function(){},J=R()("calypso:popover"),X=new Set,G=function(e){function t(e){var n;return o()(this,t),n=l()(this,u()(t).call(this,e)),b()(p()(n),"isUpdatingPosition",!1),n.setPopoverId(e.id),n.setDOMBehavior=n.setDOMBehavior.bind(p()(n)),n.setPosition=n.setPosition.bind(p()(n)),n.onClickout=n.onClickout.bind(p()(n)),n.onKeydown=n.onKeydown.bind(p()(n)),n.onWindowChange=n.onWindowChange.bind(p()(n)),n.state={show:e.isVisible,left:-99999,top:-99999,positionClass:n.getPositionClass(e.position)},n}return h()(t,e),a()(t,[{key:"componentDidMount",value:function(){this.state.show&&(this.bindEscKeyListener(),this.bindDebouncedReposition(),B())}},{key:"componentWillReceiveProps",value:function(e){if(this.domContext=w.a.findDOMNode(e.context),!e.isVisible)return null;this.setPosition()}},{key:"componentDidUpdate",value:function(e,t){var n=this,i=this.props.isVisible;return!t.show&&this.state.show&&(this.bindEscKeyListener(),this.bindDebouncedReposition(),B()),i!==e.isVisible&&(i?this.show():this.hide()),this.domContainer&&this.domContext&&i?void(this.isUpdatingPosition||(this.debug("requesting to update position after render completes"),requestAnimationFrame(function(){X.has(n.id)&&n.domContainer&&n.domContext&&i?(n.setPosition(),n.isUpdatingPosition=!1):n.isUpdatingPosition=!1}),this.isUpdatingPosition=!0)):null}},{key:"componentWillUnmount",value:function(){this.debug("unmounting .... "),this.unbindClickoutHandler(),this.unbindDebouncedReposition(),this.unbindEscKeyListener(),W(),X.delete(this.id),J("current popover instances: ",X.size)}},{key:"bindEscKeyListener",value:function(){if(!this.props.closeOnEsc)return null;this.debug("adding escKey listener ..."),document.addEventListener("keydown",this.onKeydown,!0)}},{key:"unbindEscKeyListener",value:function(){if(!this.props.closeOnEsc)return null;this.debug("unbinding `escKey` listener ..."),document.removeEventListener("keydown",this.onKeydown,!0)}},{key:"onKeydown",value:function(e){if(27!==e.keyCode)return null;this.close(!0)}},{key:"bindClickoutHandler",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.domContainer;return e?this._clickoutHandlerReference?(this.debug("clickout event already bound"),null):(this.debug("binding `clickout` event"),void(this._clickoutHandlerReference=D()(e,this.onClickout))):(this.debug("no element to bind clickout "),null)}},{key:"unbindClickoutHandler",value:function(){this._clickoutHandlerReference&&(this.debug("unbinding `clickout` listener ..."),this._clickoutHandlerReference(),this._clickoutHandlerReference=null)}},{key:"onClickout",value:function(e){var t=this.domContext&&this.domContext.contains&&!this.domContext.contains(e.target);if(this.props.ignoreContext&&t){var n=w.a.findDOMNode(this.props.ignoreContext);t=t&&n&&n.contains&&!n.contains(e.target)}t&&this.close()}},{key:"bindDebouncedReposition",value:function(){window.addEventListener("scroll",this.onWindowChange,!0),window.addEventListener("resize",this.onWindowChange,!0)}},{key:"unbindDebouncedReposition",value:function(){this.willReposition&&(window.cancelAnimationFrame(this.willReposition),this.willReposition=null),window.removeEventListener("scroll",this.onWindowChange,!0),window.removeEventListener("resize",this.onWindowChange,!0),this.debug("unbinding `debounce reposition` ...")}},{key:"onWindowChange",value:function(){this.willReposition=window.requestAnimationFrame(this.setPosition)}},{key:"setDOMBehavior",value:function(e){if(!e)return this.unbindClickoutHandler(),null;this.debug("setting DOM behavior"),this.bindClickoutHandler(e),this.domContainer=e,this.domContext=w.a.findDOMNode(this.props.context),this.setPosition()}},{key:"getPositionClass",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.position;return"is-".concat(e.replace(/\s+/g,"-"))}},{key:"adjustRtlPosition",value:function(e){if(this.props.isRtl)switch(e){case"top right":case"right top":return"top left";case"right":return"left";case"bottom right":case"right bottom":return"bottom left";case"bottom left":case"left bottom":return"bottom right";case"left":return"right";case"top left":case"left top":return"top right"}return e}},{key:"computePosition",value:function(){if(!this.props.isVisible)return null;var e=this.domContainer,t=this.domContext,n=this.props,i=n.position,o=n.relativePosition;if(!e||!t)return this.debug("[WARN] no DOM elements to work"),null;var r=i;this.debug("position: %o",r),this.props.autoRtl&&(r=this.adjustRtlPosition(r),this.debug("RTL adjusted position: %o",r)),this.props.autoPosition&&(r=H(r,e,t),this.debug("suggested position: %o",r));var a=Object.assign({},function(e,t){var n=x()(t).width;return e.left=Math.max(0,Math.min(e.left,F.width-n)),e}(K(r,e,t,o),e),{positionClass:this.getPositionClass(r)});return this.debug("updating reposition: ",a),a}},{key:"debug",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];J.apply(void 0,["[%s] ".concat(e),this.id].concat(n))}},{key:"setPopoverId",value:function(e){this.id=e||"pop__".concat(Object(j.uniqueId)()),X.add(this.id),this.debug("creating ..."),J("current popover instances: ",X.size)}},{key:"setPosition",value:function(){var e;if(this.debug("updating position"),!(e=this.props.customPosition?Object.assign({positionClass:this.getPositionClass(this.constructor.defaultProps.position)},this.props.customPosition):this.computePosition()))return null;this.willReposition=null,this.setState(e)}},{key:"getStylePosition",value:function(){var e=this.state;return{left:e.left,top:e.top}}},{key:"show",value:function(){var e=this;if(!this.props.showDelay)return this.setState({show:!0}),null;this.debug("showing in %o","".concat(this.props.showDelay,"ms")),this.clearShowTimer(),this._openDelayTimer=setTimeout(function(){e.setState({show:!0})},this.props.showDelay)}},{key:"hide",value:function(){this.unbindClickoutHandler(),this.unbindDebouncedReposition(),this.unbindEscKeyListener(),W(),this.setState({show:!1}),this.clearShowTimer()}},{key:"clearShowTimer",value:function(){if(!this._openDelayTimer)return null;clearTimeout(this._openDelayTimer),this._openDelayTimer=null}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.props.isVisible)return this.debug("popover should be already closed"),null;this.props.onClose(e)}},{key:"render",value:function(){if(!this.state.show)return this.debug("is hidden. return no render"),null;if(!this.props.context)return this.debug("No `context` to tie. return no render"),null;var e=N()("popover",this.props.className,this.state.positionClass);return this.debug("rendering ..."),E.a.createElement(P.a,{className:this.props.rootClassName},E.a.createElement("div",{style:this.getStylePosition(),className:e},E.a.createElement("div",{className:"popover__arrow"}),E.a.createElement("div",{ref:this.setDOMBehavior,className:"popover__inner"},this.props.children)))}}]),t}(y.Component);b()(G,"propTypes",{autoPosition:v.a.bool,autoRtl:v.a.bool,className:v.a.string,closeOnEsc:v.a.bool,id:v.a.string,ignoreContext:v.a.shape({getDOMNode:v.a.function}),isRtl:v.a.bool,isVisible:v.a.bool,position:v.a.oneOf(["top","top right","right","bottom right","bottom","bottom left","left","top left"]),rootClassName:v.a.string,showDelay:v.a.number,onClose:v.a.func,onShow:v.a.func,relativePosition:v.a.shape({left:v.a.number}),customPosition:v.a.shape({top:v.a.number,left:v.a.number,positionClass:v.a.oneOf(["top","right","bottom","left"])})}),b()(G,"defaultProps",{autoPosition:!0,autoRtl:!0,className:"",closeOnEsc:!0,isRtl:!1,isVisible:!1,position:"top",showDelay:0,onClose:Y,onShow:Y});t.a=Object(C.b)(function(e){return{isRtl:document.body.classList.contains("rtl")}})(G)},676:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),a=n.n(r),s=n(528),l=n.n(s),c=n(527),u=n.n(c),d=n(529),p=n.n(d),m=n(10),h=n(12),f=n.n(h),b=n(109),g=n(30),v=n(567),y=n(543),E=function(e){function t(){return o()(this,t),l()(this,u()(t).apply(this,arguments))}return p()(t,e),a()(t,[{key:"fetch",value:function(e){var t=e.siteId,n=e.loaded,i=e.fetching,o=e.error;n||i||o||this.props.fetchSettings(t)}},{key:"UNSAFE_componentWillMount",value:function(){this.fetch(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.fetch(e)}},{key:"render",value:function(){return null}}]),t}(m.Component);E.propTypes={siteId:f.a.number.isRequired},t.a=Object(b.b)(function(e){return{loaded:Object(y.d)(e),fetching:Object(y.c)(e),error:Object(y.b)(e)}},function(e){return Object(g.b)({fetchSettings:v.a},e)})(E)},677:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),a=n.n(r),s=n(528),l=n.n(s),c=n(527),u=n.n(c),d=n(529),p=n.n(d),m=n(10),h=n(12),f=n.n(h),b=n(109),g=n(30),v=n(555),y=n(541),E=function(e){function t(){return o()(this,t),l()(this,u()(t).apply(this,arguments))}return p()(t,e),a()(t,[{key:"fetch",value:function(e){var t=e.siteId,n=e.loaded,i=e.fetching,o=e.error;n||i||o||this.props.fetchSettings(t)}},{key:"UNSAFE_componentWillMount",value:function(){this.fetch(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.fetch(e)}},{key:"render",value:function(){return null}}]),t}(m.Component);E.propTypes={siteId:f.a.number.isRequired},t.a=Object(b.b)(function(e){return{loaded:Object(y.i)(e),fetching:Object(y.h)(e),error:Object(y.g)(e)}},function(e){return Object(g.b)({fetchSettings:v.fetchSettings},e)})(E)},682:function(e,t,n){},683:function(e,t,n){},685:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),a=n.n(r),s=n(528),l=n.n(s),c=n(527),u=n.n(c),d=n(531),p=n.n(d),m=n(529),h=n.n(m),f=n(34),b=n.n(f),g=n(109),v=n(35),y=n(12),E=n.n(y),k=n(10),w=n.n(k),C=n(1),I=(n(682),n(616)),R=n(534),O=n.n(R),N=n(583),_=n.n(N),D=n(30),j=n(790),P=n(526),L=n.n(P),q=n(542),S=n(632),x=function(e){return"HR"===e.tagName},T=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(p()(n),"menu",w.a.createRef()),b()(p()(n),"_setPropsOnChild",function(e){if(null==e)return e;var t=n._onClose.bind(p()(n),e.props.action),i=t;return e.props.onClick&&(i=Object(C.over)([e.props.onClick,t])),w.a.cloneElement(e,{onClick:i})}),b()(p()(n),"_onShow",function(){var e=n.menu.current;n._previouslyFocusedElement=document.activeElement,e&&e.focus()}),b()(p()(n),"_getClosestSibling",function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=n.menu.current,o=i.firstChild,r=i.lastChild;if(t||(o=i.lastChild,r=i.firstChild),e===i)return o;var a=e[t?"nextSibling":"previousSibling"]||r;return x(a)?n._getClosestSibling(a,t):a}),b()(p()(n),"_onKeyDown",function(e){var t,i=e.target,o=!1;switch(e.keyCode){case 9:n.props.onClose(),o=!0;break;case 38:t=n._getClosestSibling(i,!1),o=!0;break;case 40:t=n._getClosestSibling(i,!0),o=!0}t&&t.focus(),o&&e.preventDefault()}),b()(p()(n),"_onClose",function(e){n._previouslyFocusedElement&&(n._previouslyFocusedElement.focus(),n._previouslyFocusedElement=null),n.props.onClose&&n.props.onClose(e)}),n}return h()(t,e),a()(t,[{key:"componentWillUnmount",value:function(){this._previouslyFocusedElement=null}},{key:"render",value:function(){var e=this.props,t=e.popoverComponent,n=e.autoPosition,i=e.className,o=e.context,r=e.customPosition,a=e.isVisible,s=e.popoverTitle,l=e.position,c=e.rootClassName;return w.a.createElement(t,{onClose:this._onClose,onShow:this._onShow,autoPosition:n,className:i,context:o,customPosition:r,isVisible:a,popoverTitle:s,position:l,rootClassName:c},w.a.createElement("div",{ref:this.menu,role:"menu",className:"popover__menu",onKeyDown:this._onKeyDown,tabIndex:"-1"},w.a.Children.map(this.props.children,this._setPropsOnChild,this)))}}]),t}(k.Component);b()(T,"propTypes",{autoPosition:E.a.bool,isVisible:E.a.bool.isRequired,onClose:E.a.func.isRequired,position:E.a.string,className:E.a.string,rootClassName:E.a.string,popoverComponent:E.a.func,popoverTitle:E.a.string,customPosition:E.a.object}),b()(T,"defaultProps",{autoPosition:!0,position:"top",popoverComponent:S.a});var M=T,A=(n(683),function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(p()(n),"state",{isMenuVisible:!1}),b()(p()(n),"popoverContext",w.a.createRef()),b()(p()(n),"handleClick",function(e){var t=n.props.onClick,i=n.state.isMenuVisible;t(e),i?n.hideMenu():n.showMenu()}),b()(p()(n),"hideMenu",function(){return n.toggleMenu(!1)}),b()(p()(n),"showMenu",function(){return n.toggleMenu(!0)}),n}return h()(t,e),a()(t,[{key:"toggleMenu",value:function(e){this.props.disabled||(this.setState({isMenuVisible:e}),this.props.onToggle(e))}},{key:"render",value:function(){var e=this.props,t=e.toggleTitle,n=e.translate,i=e.position,o=e.children,r=e.disabled,a=e.className,s=e.popoverClassName,l=this.state.isMenuVisible,c=L()("ellipsis-menu",a,{"is-menu-visible":l,"is-disabled":r}),u=L()("ellipsis-menu__menu","popover",s);return w.a.createElement("span",{className:c},w.a.createElement(q.a,{ref:this.popoverContext,onClick:this.handleClick,title:t||n("Toggle menu"),borderless:!0,disabled:r,className:"ellipsis-menu__toggle"},w.a.createElement(O.a,{icon:"ellipsis",className:"ellipsis-menu__toggle-icon"})),w.a.createElement(M,{isVisible:l,onClose:this.hideMenu,position:i,context:this.popoverContext.current,className:u},o))}}]),t}(k.Component));b()(A,"propTypes",{translate:E.a.func,toggleTitle:E.a.string,position:E.a.string,disabled:E.a.bool,onClick:E.a.func,onToggle:E.a.func,popoverClassName:E.a.string}),b()(A,"defaultProps",{onClick:C.noop,onToggle:C.noop});var z=Object(v.localize)(A),F=n(530),U=n.n(F),V=n(601),B=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(p()(n),"handleMouseOver",function(e){n.props.focusOnHover&&e.target.focus(),n.props.onMouseOver()}),n}return h()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,i=e.href,o=e.icon,r=e.isSelected,a=e.isExternalLink,s=Object(C.omit)(this.props,"icon","focusOnHover","isSelected","isExternalLink","className","itemComponent"),l=L()("popover__menu-item",n,{"is-selected":r}),c=this.props.itemComponent;return a&&i?(c=V.a,s.icon=!0):i&&(c="a"),w.a.createElement(c,U()({role:"menuitem",onMouseOver:this.handleMouseOver,tabIndex:"-1",className:l},s),o&&w.a.createElement(O.a,{icon:o,size:18}),t)}}]),t}(k.Component);b()(B,"propTypes",{href:E.a.string,className:E.a.string,isSelected:E.a.bool,icon:E.a.string,focusOnHover:E.a.bool,onMouseOver:E.a.func,isExternalLink:E.a.bool,itemComponent:E.a.oneOfType([E.a.func,E.a.string])}),b()(B,"defaultProps",{isSelected:!1,focusOnHover:!0,onMouseOver:C.noop,itemComponent:"button"});var W=n(551),H=n(548),K=n(540),Y=n(537),J=function(e){var t=e.orderId,n=e.siteId,i=e.refundDialog,o=e.createdDate,r=e.refundableAmount,a=e.currency,s=e.labelId,l=e.translate,c=e.moment,u=function(){return _()(r,a)},d=function(){return e.closeRefundDialog(t,n)},p=[{action:"cancel",label:l("Cancel"),onClick:d},{action:"confirm",onClick:function(){return e.confirmRefund(t,n)},isPrimary:!0,disabled:i&&i.isSubmitting,additionalClassNames:i&&i.isSubmitting?"is-busy":"",label:l("Refund label (-%(amount)s)",{args:{amount:u()}})}];return w.a.createElement(W.a,{additionalClassNames:"label-refund-modal woocommerce wcc-root",isVisible:Boolean(i&&i.labelId===s),onClose:d,buttons:p},w.a.createElement(H.a,null,l("Request a refund")),w.a.createElement("p",null,l("You can request a refund for a shipping label that has not been used to ship a package. It will take at least 14 days to process.")),w.a.createElement("dl",null,w.a.createElement("dt",null,l("Purchase date")),w.a.createElement("dd",null,c(o).format("LLL")),w.a.createElement("dt",null,l("Amount eligible for refund")),w.a.createElement("dd",null,u())))};J.propTypes={siteId:E.a.number.isRequired,orderId:E.a.number.isRequired,refundDialog:E.a.object,createdDate:E.a.number,refundableAmount:E.a.number,currency:E.a.string,labelId:E.a.number,closeRefundDialog:E.a.func.isRequired,confirmRefund:E.a.func.isRequired};var X=Object(g.b)(function(e,t){var n=t.orderId,i=t.siteId,o=Object(Y.s)(e,n,i),r=Object(Y.i)(e,n,i);return{refundDialog:o?r.refundDialog:{}}},function(e){return Object(D.b)({closeRefundDialog:K.e,confirmRefund:K.k},e)})(Object(v.localize)(J)),G=n(600),Q=n(604),Z=function(e){var t=e.orderId,n=e.siteId,i=e.reprintDialog,o=e.paperSize,r=e.storeOptions,a=e.labelId,s=e.translate,l=function(){return e.closeReprintDialog(t,n)},c=[{action:"cancel",label:s("Cancel"),onClick:l},{action:"confirm",onClick:function(){return e.confirmReprint(t,n)},isPrimary:!0,disabled:i&&!i.fileData,additionalClassNames:i&&i.isFetching?"is-busy":"",label:s("Print")}];return w.a.createElement(W.a,{isVisible:Boolean(i&&i.labelId===a),onClose:l,buttons:c,additionalClassNames:"label-reprint-modal woocommerce wcc-root"},w.a.createElement(H.a,null,s("Reprint shipping label")),w.a.createElement("p",null,s("If there was a printing error when you purchased the label, you can print it again.")),w.a.createElement("p",{className:"shipping-label__reprint-modal-notice"},s("NOTE: If you already used the label in a package, printing and using it again is a violation of our terms of service and may result in criminal charges.")),w.a.createElement(G.a,{id:"paper_size",valuesMap:Object(Q.a)(r.origin_country),title:s("Paper size"),value:o,updateValue:function(i){return e.updatePaperSize(t,n,i)}}))};Z.propTypes={siteId:E.a.number.isRequired,orderId:E.a.number.isRequired,reprintDialog:E.a.object,paperSize:E.a.string.isRequired,storeOptions:E.a.object.isRequired,labelId:E.a.number,closeReprintDialog:E.a.func.isRequired,confirmReprint:E.a.func.isRequired};var $=Object(g.b)(function(e,t){var n=t.orderId,i=t.siteId,o=Object(Y.s)(e,n,i),r=Object(Y.i)(e,n,i);return{reprintDialog:o?r.reprintDialog:{},paperSize:r.paperSize,storeOptions:o?r.storeOptions:{}}},function(e){return Object(D.b)({closeReprintDialog:K.f,confirmReprint:K.l,updatePaperSize:K.X},e)})(Object(v.localize)(Z)),ee=n(645),te=n(543),ne=function(e){var t=e.orderId,n=e.siteId,i=e.isVisible,o=e.labelIndex,r=e.serviceName,a=e.packageName,s=e.productNames,l=e.canManagePayments,c=e.receiptId,u=e.translate,d=function(){return e.closeDetailsDialog(t,n)},p=[{action:"close",label:u("Close"),onClick:d}];return w.a.createElement(W.a,{additionalClassNames:"label-details-modal woocommerce wcc-root",isVisible:i,onClose:d,buttons:p},w.a.createElement(H.a,{className:"shipping-label__label-details-modal-heading"},w.a.createElement("span",{className:"shipping-label__label-details-modal-heading-title"},u("Label #%(labelIndex)s details",{args:{labelIndex:o+1}})),l&&c?w.a.createElement("a",{href:"".concat(Object(ee.a)(),"/me/purchases/billing/").concat(c),target:"_blank",rel:"noopener noreferrer"},u("Receipt")):null),w.a.createElement("dl",null,w.a.createElement("dt",null,u("Service")),w.a.createElement("dd",null,r),w.a.createElement("dt",null,u("Package")),w.a.createElement("dd",null,a),w.a.createElement("dt",null,u("Items")),w.a.createElement("dd",null,w.a.createElement("ul",null,s.map(function(e,t){return w.a.createElement("li",{key:t},e)})))))};ne.propTypes={siteId:E.a.number.isRequired,orderId:E.a.number.isRequired,isVisible:E.a.bool,serviceName:E.a.string,packageName:E.a.string,productNames:E.a.array,closeDetailsDialog:E.a.func.isRequired,receiptId:E.a.number};var ie=Object(g.b)(function(e,t){var n=t.orderId,i=t.siteId,o=t.labelId,r=Object(Y.s)(e,n,i),a=Object(Y.i)(e,n,i).detailsDialog;return{isVisible:Boolean(r&&a&&a.labelId===o),canManagePayments:Object(te.q)(e,i)}},function(e){return Object(D.b)({closeDetailsDialog:K.c},e)})(Object(v.localize)(ne)),oe={usps:function(e){return"https://tools.usps.com/go/TrackConfirmAction.action?tLabels=".concat(e)},fedex:function(e){return"https://www.fedex.com/apps/fedextrack/?action=track&tracknumbers=".concat(e)},ups:function(e){return"https://www.ups.com/track?loc=en_US&tracknum=".concat(e)},dhlexpress:function(e){return"https://www.dhl.com/en/express/tracking.html?AWB=".concat(e,"&brand=DHL")}},re=function(e){var t=e.tracking,n=e.carrierId,i=e.translate;if(!t)return w.a.createElement("span",null,i("N/A"));var o=oe[n](t);return o?w.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:o},t," ",w.a.createElement(O.a,{icon:"external",size:12})):w.a.createElement("span",null,t)};re.propTypes={tracking:E.a.string,carrierId:E.a.string};var ae=Object(v.localize)(re),se=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(p()(n),"renderRefund",function(e,t){var i=n.props,o=i.orderId,r=i.siteId,a=i.translate;if(t)return w.a.createElement(j.a,{position:"top left",text:a("Labels older than 30 days cannot be refunded.")},w.a.createElement("button",{className:"popover__menu-item shipping-label__item-menu-reprint-expired",role:"menuitem",tabIndex:"-1"},w.a.createElement(O.a,{icon:"refund",size:18}),w.a.createElement("span",null," ",a("Request refund")," ")));return w.a.createElement(B,{onClick:function(){n.props.openRefundDialog(o,r,e)},icon:"refund"},a("Request refund"))}),b()(p()(n),"renderReprint",function(e,t){var i=n.props,o=i.orderId,r=i.siteId,a=i.translate;if(t)return w.a.createElement(j.a,{position:"top left",text:a("Label images older than 180 days are deleted by our technology partners for general security and data privacy concerns.")},w.a.createElement("button",{className:"popover__menu-item shipping-label__item-menu-reprint-expired",role:"menuitem",tabIndex:"-1"},w.a.createElement(O.a,{icon:"print",size:18}),w.a.createElement("span",null," ",a("Reprint")," ")));return w.a.createElement(B,{onClick:function(){n.props.openReprintDialog(o,r,e)},icon:"print"},a("Reprint"))}),b()(p()(n),"renderLabelDetails",function(e){var t=n.props,i=t.orderId,o=t.siteId,r=t.translate;return w.a.createElement(B,{onClick:function(){n.props.openDetailsDialog(i,o,e)},icon:"info-outline"},r("View details"))}),b()(p()(n),"renderPickup",function(e){var t=n.props.translate,i={usps:"https://tools.usps.com/schedule-pickup-steps.htm",fedex:"https://www.fedex.com/en-us/shipping/schedule-manage-pickups.html",ups:"https://wwwapps.ups.com/pickup/request"};if(!i.hasOwnProperty(e))return null;return w.a.createElement(B,{onClick:function(){window.open(i[e],"_blank")},icon:"external"},t("Schedule a pickup"))}),n}return h()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.label,n=t.labelIndex,i=t.serviceName,o=t.packageName,r=t.productNames,a=t.receiptId,s=t.labelId,l=t.createdDate,c=t.refundableAmount,u=t.currency,d=t.showDetails,p=t.expiryDate,m=t.anonymized,h=t.usedDate,f=t.tracking,b=t.carrierId,g=e.siteId,v=e.orderId,y=e.translate,E=e.isModal,k=(new Date).getTime(),C=!1,I=!1;(m||h||p&&p<k)&&(C=!0);var R=(new Date).setDate((new Date).getDate()-30);return(m||h||l&&l<R)&&(I=!0),w.a.createElement("div",{className:"shipping-label__item"},w.a.createElement("p",{className:"shipping-label__item-detail"},y("%(service)s label (#%(labelIndex)d)",{args:{service:i,labelIndex:n+1}}),d&&w.a.createElement("span",null,!E&&w.a.createElement(z,{position:"bottom left"},this.renderLabelDetails(s),this.renderPickup(b),this.renderRefund(s,I),this.renderReprint(s,C)),w.a.createElement(ie,{siteId:g,orderId:v,labelIndex:n,serviceName:i,packageName:o,productNames:r,receiptId:a,labelId:s}),w.a.createElement(X,{siteId:g,orderId:v,createdDate:l,refundableAmount:c,currency:u,labelId:s}),w.a.createElement($,{siteId:g,orderId:v,labelId:s}))),d&&w.a.createElement("p",{className:"shipping-label__item-tracking"},y("Tracking #: {{trackingLink/}}",{components:{trackingLink:w.a.createElement(ae,{carrierId:b,tracking:f})}})))}}]),t}(k.Component);se.propTypes={siteId:E.a.number.isRequired,orderId:E.a.number.isRequired,label:E.a.shape({serviceName:E.a.string.isRequired,labelIndex:E.a.number.isRequired,packageName:E.a.string.isRequired,productNames:E.a.string.isRequired,receiptId:E.a.number.isRequired,labelId:E.a.number.isRequired,createdDate:E.a.string.isRequired,refundableAmount:E.a.number.isRequired,currency:E.a.string.isRequired,showDetails:E.a.bool.isRequired,expiryDate:E.a.string.isRequired,anonymized:E.a.bool.isRequired,usedDate:E.a.string.isRequired,tracking:E.a.string.isRequired,carrierId:E.a.number.isRequired}).isRequired,isModal:E.a.bool.isRequired,openRefundDialog:E.a.func.isRequired,openReprintDialog:E.a.func.isRequired,openDetailsDialog:E.a.func.isRequired};var le=Object(g.b)(null,function(e){return Object(D.b)({openRefundDialog:K.y,openReprintDialog:K.z,openDetailsDialog:K.u},e)})(Object(v.localize)(se)),ce=function(e){function t(){return o()(this,t),l()(this,u()(t).apply(this,arguments))}return h()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.label,n=e.translate,i=t.serviceName,o=t.labelIndex;return w.a.createElement("div",{className:"shipping-label__item"},w.a.createElement("p",{className:"shipping-label__item-detail"},n("%(service)s label (#%(labelIndex)d)",{args:{service:i,labelIndex:o+1}}),w.a.createElement("br",null),n("Purchasing\u2026")))}}]),t}(se);se.propTypes={label:E.a.object.isRequired};var ue=Object(v.localize)(ce),de=n(602),pe=function(e){function t(){var e,n,i;o()(this,t);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=l()(this,(e=u()(t)).call.apply(e,[this].concat(a))),b()(p()(i),"eventPropsByType",(n={},b()(n,I.a.INTERNAL_NOTE,function(e){return{icon:"aside",heading:(0,i.props.translate)("Internal note"),content:Object(de.a)(Object(de.b)(e.content))}}),b()(n,I.a.CUSTOMER_NOTE,function(e){return{icon:"mail",heading:(0,i.props.translate)("Note sent to customer"),content:Object(de.a)(Object(de.b)(e.content))}}),b()(n,I.a.LABEL_PURCHASING,function(e){return{icon:"sync",content:w.a.createElement(ue,{label:e,orderId:i.props.orderId,siteId:i.props.siteId})}}),b()(n,I.a.LABEL_PURCHASED,function(e){return{icon:"print",content:w.a.createElement(le,{label:e,orderId:i.props.orderId,siteId:i.props.siteId,isModal:i.props.isModal})}}),b()(n,I.a.LABEL_REFUND_REQUESTED,function(e){var t=i.props.translate;return{icon:"time",content:w.a.createElement("div",null,t("%(service)s label (#%(labelNum)d) refund requested (%(amount)s)",{args:{service:e.serviceName,labelNum:e.labelIndex+1,amount:_()(e.amount,e.currency)}}))}}),b()(n,I.a.LABEL_REFUND_COMPLETED,function(e){var t=i.props.translate;return{icon:"refund",content:w.a.createElement("div",null,t("%(service)s label (#%(labelNum)d) refunded (%(amount)s)",{args:{service:e.serviceName,labelNum:e.labelIndex+1,amount:_()(e.amount,e.currency)}}))}}),b()(n,I.a.LABEL_REFUND_REJECTED,function(e){var t=i.props.translate;return{icon:"cross-small",content:w.a.createElement("div",null,t("%(service)s label (#%(labelNum)d) refund rejected",{service:e.serviceName,args:{labelNum:e.labelIndex+1}}))}}),b()(n,I.a.REFUND_NOTE,function(e){var t=i.props.translate;return{icon:"credit-card",heading:t("Refund"),content:w.a.createElement("div",null,t("Refunded %(amount)s",{args:{amount:_()(e.amount,e.currency)}}),w.a.createElement("br",null),e.reason)}}),b()(n,void 0,function(){return{}}),n)),b()(p()(i),"renderDefaultEvent",function(e){return{icon:"aside",heading:(0,i.props.translate)("Note"),content:e.content}}),i}return h()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.moment,n=e.event,i=(this.eventPropsByType[n.type]||this.renderDefaultEvent)(n),o=i.icon,r=i.heading,a=i.content;return w.a.createElement("div",{className:"order-activity-log__note"},w.a.createElement("div",{className:"order-activity-log__note-meta"},w.a.createElement("span",{className:"order-activity-log__note-time"},t(n.timestamp).format("LT")),o&&w.a.createElement(O.a,{icon:o,size:24})),w.a.createElement("div",{className:"order-activity-log__note-body"},w.a.createElement("div",{className:"order-activity-log__note-type"},r),w.a.createElement("div",{className:"order-activity-log__note-content"},a)))}}]),t}(k.Component);b()(pe,"propTypes",{customer_note:E.a.bool,date_created_gmt:E.a.string,note:E.a.string.isRequired}),b()(pe,"propTypes",{event:E.a.object}),b()(pe,"defaultProps",{event:{}});var me=Object(v.localize)(pe),he=n(599),fe=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(p()(n),"onClick",function(){n.props.onClick(n.props.date)}),n}return h()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.count,n=e.date,i=e.isOpen,o=e.moment,r=e.translate,a=o(n,"YYYYMMDD").format("ll"),s=w.a.createElement("div",null,w.a.createElement("h3",null,a),w.a.createElement("small",null,r("%(count)s event","%(count)s events",{count:t,args:{count:t}})));return w.a.createElement("div",{className:"order-activity-log__day"},w.a.createElement(he.a,{onClick:this.onClick,className:"order-activity-log__day-header",expanded:i,header:s,screenReaderText:r("Show notes from %(date)s",{args:{date:a}})},this.props.children))}}]),t}(k.Component);b()(fe,"propTypes",{count:E.a.number.isRequired,date:E.a.string.isRequired,isOpen:E.a.bool.isRequired,onClick:E.a.func.isRequired});var be=Object(v.localize)(fe);var ge=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(p()(n),"toggleOpenDay",function(e){n.setState(function(){return{openDay:e}})}),b()(p()(n),"renderNotes",function(){var e=n.props,t=e.days,i=e.eventsByDay,o=e.translate;return t.length?w.a.createElement("div",null,t.map(function(e){var t=i[e];return w.a.createElement(be,{key:e,count:t.length,date:e,isOpen:e===n.state.openDay,onClick:n.toggleOpenDay},t.map(function(e){return w.a.createElement(me,{key:"".concat(e.type,"-").concat(e.key),event:e,orderId:n.props.orderId,siteId:n.props.siteId,isModal:n.props.isModal})}))})):w.a.createElement("p",null,o("No activity yet"))}),b()(p()(n),"renderPlaceholder",function(){return w.a.createElement("div",{className:"is-placeholder"},w.a.createElement(be,{count:0,date:"",isOpen:!0,index:1,onClick:C.noop},w.a.createElement(me,null)))}),n}return h()(t,e),a()(t,[{key:"UNSAFE_componentWillMount",value:function(){this.setState({openDay:Object(C.last)(Object(C.keys)(this.props.eventsByDay))})}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=Object(C.last)(Object(C.keys)(e.eventsByDay));this.props.eventsByDay[t]||this.setState({openDay:t})}},{key:"render",value:function(){return this.props.isLoaded?this.renderNotes():this.renderPlaceholder()}}]),t}(k.Component);b()(ge,"propTypes",{orderId:E.a.number.isRequired,siteId:E.a.number.isRequired});t.a=Object(g.b)(function(e,t){var n=t.orderId||!1,i=Object(I.c)(e,n),o=Object(I.b)(e,n),r=o.length?function(e){var t={};return e.forEach(function(e){var n=Object(v.moment)(e.timestamp).format("YYYYMMDD");t[n]?t[n].push(e):t[n]=[e]}),Object(C.keys)(t).forEach(function(e){t[e]=Object(C.sortBy)(t[e],["timestamp","key"]).reverse()}),t}(o):{},a=r?Object(C.keys)(r):[];return a.sort().reverse(),{isLoaded:i,days:a,events:o,eventsByDay:r}})(Object(v.localize)(ge))},796:function(e,t,n){"use strict";n.r(t);var i=n(36),o=n.n(i),r=n(107),a=n.n(r),s=n(108),l=n.n(s),c=n(528),u=n.n(c),d=n(527),p=n.n(d),m=n(531),h=n.n(m),f=n(529),b=n.n(f),g=n(34),v=n.n(g),y=n(10),E=n.n(y),k=n(12),w=n.n(k),C=n(30),I=n(109),R=n(35),O=n(676),N=n(677),_=n(691),D=n(563),j=function(e){function t(){var e,n;a()(this,t);for(var i=arguments.length,o=new Array(i),r=0;r<i;r++)o[r]=arguments[r];return n=u()(this,(e=p()(t)).call.apply(e,[this].concat(o))),v()(h()(n),"fetch",function(){var e=n.props,t=e.fetchLocations,i=e.loadingLocations,o=e.locationsLoaded,r=e.siteId;!i&&!o&&t(r)}),v()(h()(n),"componentDidMount",function(){n.fetch()}),v()(h()(n),"componentDidUpdate",function(){n.fetch()}),v()(h()(n),"render",function(){return null}),n}return b()(t,e),t}(y.Component);v()(j,"propTypes",{fetchLocations:w.a.func,siteId:w.a.number.isRequired,loadingLocations:w.a.bool.isRequired,locationsLoaded:w.a.bool.isRequired});var P=Object(I.b)(function(e){return{loadingLocations:Object(D.c)(e),locationsLoaded:Object(D.b)(e)}},function(e){return Object(C.b)({fetchLocations:_.a},e)})(j),L=n(540),q=n(537),S=function(e){function t(){return a()(this,t),u()(this,p()(t).apply(this,arguments))}return b()(t,e),l()(t,[{key:"fetch",value:function(e){var t=e.orderId,n=e.siteId,i=e.loaded,o=e.fetching,r=e.error,a=e.refreshedLabelStatus;i||o||r?i&&!a&&this.props.fetchLabelsStatus(t,n):this.props.fetchLabelsData(t,n)}},{key:"UNSAFE_componentWillMount",value:function(){this.fetch(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.fetch(e)}},{key:"render",value:function(){var e=this.props.siteId;return E.a.createElement("div",null,E.a.createElement(O.a,{siteId:e}),E.a.createElement(N.a,{siteId:e}),E.a.createElement(P,{siteId:e}))}}]),t}(y.Component);S.propTypes={siteId:w.a.number.isRequired,orderId:w.a.number.isRequired};var x=Object(I.b)(function(e,t){var n=t.orderId;return{loaded:Object(q.s)(e,n),fetching:Object(q.r)(e,n),error:Object(q.q)(e,n),refreshedLabelStatus:Object(q.l)(e,n)}},function(e){return Object(C.b)({fetchLabelsData:L.q,fetchLabelsStatus:L.r},e)})(S),T=n(631),M=n(590),A=n(532),z=n(685),F=n(616),U=n(607),V=n(638),B=function(e){function t(){var e,n;a()(this,t);for(var i=arguments.length,o=new Array(i),r=0;r<i;r++)o[r]=arguments[r];return n=u()(this,(e=p()(t)).call.apply(e,[this].concat(o))),v()(h()(n),"renderActivityLog",function(){var e=n.props,t=e.siteId,i=e.orderId,o=e.events,r=e.translate;return 0===o.length?r("No tracking information available at this time"):E.a.createElement("div",{className:"shipment-tracking__dummy-class order-activity-log"},E.a.createElement(z.a,{orderId:i,siteId:t}))}),n}return b()(t,e),l()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.siteId,n=e.orderId,i=e.orderLoading,o=e.orderLoaded;t&&n&&!i&&!o&&this.props.fetchOrder(t,n)}},{key:"render",value:function(){var e=this.props,t=e.siteId,n=e.orderId;return E.a.createElement("div",{className:"shipment-tracking__container"},E.a.createElement(T.a,{notices:M.a.list}),E.a.createElement(x,{orderId:n,siteId:t,origin:"tracking"}),this.renderActivityLog())}}]),t}(y.Component);v()(B,"propTypes",{orderId:w.a.number.isRequired});t.default=Object(I.b)(function(e,t){var n=t.orderId,i=Object(A.a)(e);return{siteId:i,events:Object(F.b)(e,n),orderLoading:Object(U.c)(e,n,i),orderLoaded:Object(U.b)(e,n,i)}},function(e){return o()({},Object(C.b)({fetchOrder:V.e},e))})(Object(R.localize)(B))}}]);
|
1 |
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[152],{601:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),a=n.n(r),s=n(528),l=n.n(s),c=n(527),u=n.n(c),d=n(529),p=n.n(d),m=n(34),h=n.n(m),f=n(10),b=n.n(f),v=n(12),g=n.n(v),y=n(526),k=n.n(y),E=n(1),w=n(534),C=n.n(w),I=(n(629),function(e){function t(){return o()(this,t),l()(this,u()(t).apply(this,arguments))}return p()(t,e),a()(t,[{key:"render",value:function(){var e=k()("external-link",this.props.className,{"icon-first":!!this.props.showIconFirst},{"has-icon":!!this.props.icon}),t=Object(E.assign)({},Object(E.omit)(this.props,"icon","iconSize","showIconFirst","iconClassName"),{className:e,rel:"external"});t.target&&(t.rel=t.rel.concat(" noopener noreferrer"));var n=b.a.createElement(C.a,{className:this.props.iconClassName,icon:"external",size:this.props.iconSize});return b.a.createElement("a",t,this.props.icon&&this.props.showIconFirst&&n,this.props.children,this.props.icon&&!this.props.showIconFirst&&n)}}]),t}(f.Component));h()(I,"defaultProps",{iconSize:18,showIconFirst:!1}),h()(I,"propTypes",{className:g.a.string,href:g.a.string,onClick:g.a.func,icon:g.a.bool,iconSize:g.a.number,target:g.a.string,showIconFirst:g.a.bool,iconClassName:g.a.string}),t.a=I},629:function(e,t,n){},632:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),a=n.n(r),s=n(528),l=n.n(s),c=n(527),u=n.n(c),d=n(531),p=n.n(d),m=n(529),h=n.n(m),f=n(34),b=n.n(f),v=n(12),g=n.n(v),y=n(10),k=n.n(y),E=n(76),w=n.n(E),C=n(109),I=n(47),R=n.n(I),O=n(526),N=n.n(O),_=n(662),D=n.n(_),j=n(1),P=n(628),L=n(78),q=n.n(L),S=n(672),x=n.n(S),T=R()("calypso:popover:util");function M(){var e={};return e.top=window.scrollY,e.left=window.scrollX,e.width=window.innerWidth,e.height=window.innerHeight,e.right=e.left+e.width,e.bottom=e.top+e.height,T("viewport: %o",e),e}var A={top:"bottom",bottom:"top",left:"right",right:"left"},z={top:"right",left:"top",bottom:"left",right:"bottom"},U=M();function F(){U=M()}var V=!1,B=function(){if(V)return T("window events already bound");V=!0,T("bind handlers to `resize` and `scroll` events"),window.addEventListener("resize",F,!0),window.addEventListener("scroll",F,!0)},W=function(){if(!V)return T("window events are not bound");V=!1,T("unbind handlers to `resize` and `scroll` events"),window.removeEventListener("resize",F,!0),window.removeEventListener("scroll",F,!0)},H=function(e,t,n){var i=x()(n),o=t.clientHeight,r=t.clientWidth,a={top:i.top-o,bottom:U.height-i.bottom-o,left:i.left-r,right:U.width-i.right-r},s=e.split(/\s+/),l=q()(s,1)[0],c=q()(s,2)[1],u=function(e,t){for(var n,i=[e,A[e],z[e],A[z[e]]],o=-1/0,r=0,a=i.length;r<a;r++){var s=i[r],l=t[s];if(l>0)return s;l>o&&(o=l,n=e)}return n}(l,a);return c!==u&&c!==A[u]||(c=null),function(e,t,n,i,o,r){for(var a,s="top"===e||"bottom"===e,l=t?[s?"".concat(e," ").concat(t):"".concat(t," ").concat(e),e,s?"".concat(e," ").concat(A[t]):"".concat(A[t]," ").concat(e)]:[e,s?"".concat(e," ").concat(z[e]):"".concat(z[e]," ").concat(e),s?"".concat(e," ").concat(A[z[e]]):"".concat(A[z[e]]," ").concat(e)],c=0,u=o*r,d=0,p=l.length;d<p;d++){var m=l[d],h=K(m,n,i),f=h.left+o,b=h.top+r,v=Math.min(h.top<U.top?b-U.top:U.bottom-h.top,r),g=Math.min(h.left<U.left?f-U.left:U.right-h.left,o),y=g*v;if(y===u)return m;y>c&&(c=y,a=m)}return a}(u,c,t,n,r,o)||e};function K(e,t,n,i){var o=x()(t);if(!o)throw new Error("could not get bounding client rect of Tip element");var r=o.width,a=o.height,s=x()(n);if(!s)throw new Error("could not get bounding client rect of `target`");var l=s.width,c=s.height,u=function(e,t){var n=t.body||t.getElementsByTagName("body")[0],i=t.documentElement||n.parentNode,o=i.clientTop||n.clientTop||0,r=i.clientLeft||n.clientLeft||0,a=window.pageYOffset||i.scrollTop,s=window.pageXOffset||i.scrollLeft;return{top:e.top+a-o,left:e.left+s-r}}(s,document);if(!u)throw new Error("could not determine page offset of `target`");var d={};switch(e){case"top":d={top:u.top-a,left:i&&i.left?u.left+i.left:u.left+l/2-r/2};break;case"bottom":d={top:u.top+c,left:i&&i.left?u.left+i.left:u.left+l/2-r/2};break;case"right":d={top:u.top+c/2-a/2,left:u.left+l};break;case"left":d={top:u.top+c/2-a/2,left:u.left-r};break;case"top left":d={top:u.top-a,left:u.left+l/2-r+15};break;case"top right":d={top:u.top-a,left:u.left+l/2-15};break;case"bottom left":d={top:u.top+c,left:u.left+l/2-r+15};break;case"bottom right":d={top:u.top+c,left:u.left+l/2-15};break;case"left top":d={top:u.top+c/2-a,left:u.left-r};break;case"left bottom":d={top:u.top+c/2,left:u.left-r};break;case"right top":d={top:u.top+c/2-a,left:u.left+l};break;case"right bottom":d={top:u.top+c/2,left:u.left+l};break;default:throw new Error('invalid position "'.concat(e,'"'))}return d}var Y=function(){},J=R()("calypso:popover"),X=new Set,G=function(e){function t(e){var n;return o()(this,t),n=l()(this,u()(t).call(this,e)),b()(p()(n),"isUpdatingPosition",!1),n.setPopoverId(e.id),n.setDOMBehavior=n.setDOMBehavior.bind(p()(n)),n.setPosition=n.setPosition.bind(p()(n)),n.onClickout=n.onClickout.bind(p()(n)),n.onKeydown=n.onKeydown.bind(p()(n)),n.onWindowChange=n.onWindowChange.bind(p()(n)),n.state={show:e.isVisible,left:-99999,top:-99999,positionClass:n.getPositionClass(e.position)},n}return h()(t,e),a()(t,[{key:"componentDidMount",value:function(){this.state.show&&(this.bindEscKeyListener(),this.bindDebouncedReposition(),B())}},{key:"componentWillReceiveProps",value:function(e){if(this.domContext=w.a.findDOMNode(e.context),!e.isVisible)return null;this.setPosition()}},{key:"componentDidUpdate",value:function(e,t){var n=this,i=this.props.isVisible;return!t.show&&this.state.show&&(this.bindEscKeyListener(),this.bindDebouncedReposition(),B()),i!==e.isVisible&&(i?this.show():this.hide()),this.domContainer&&this.domContext&&i?void(this.isUpdatingPosition||(this.debug("requesting to update position after render completes"),requestAnimationFrame(function(){X.has(n.id)&&n.domContainer&&n.domContext&&i?(n.setPosition(),n.isUpdatingPosition=!1):n.isUpdatingPosition=!1}),this.isUpdatingPosition=!0)):null}},{key:"componentWillUnmount",value:function(){this.debug("unmounting .... "),this.unbindClickoutHandler(),this.unbindDebouncedReposition(),this.unbindEscKeyListener(),W(),X.delete(this.id),J("current popover instances: ",X.size)}},{key:"bindEscKeyListener",value:function(){if(!this.props.closeOnEsc)return null;this.debug("adding escKey listener ..."),document.addEventListener("keydown",this.onKeydown,!0)}},{key:"unbindEscKeyListener",value:function(){if(!this.props.closeOnEsc)return null;this.debug("unbinding `escKey` listener ..."),document.removeEventListener("keydown",this.onKeydown,!0)}},{key:"onKeydown",value:function(e){if(27!==e.keyCode)return null;this.close(!0)}},{key:"bindClickoutHandler",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.domContainer;return e?this._clickoutHandlerReference?(this.debug("clickout event already bound"),null):(this.debug("binding `clickout` event"),void(this._clickoutHandlerReference=D()(e,this.onClickout))):(this.debug("no element to bind clickout "),null)}},{key:"unbindClickoutHandler",value:function(){this._clickoutHandlerReference&&(this.debug("unbinding `clickout` listener ..."),this._clickoutHandlerReference(),this._clickoutHandlerReference=null)}},{key:"onClickout",value:function(e){var t=this.domContext&&this.domContext.contains&&!this.domContext.contains(e.target);if(this.props.ignoreContext&&t){var n=w.a.findDOMNode(this.props.ignoreContext);t=t&&n&&n.contains&&!n.contains(e.target)}t&&this.close()}},{key:"bindDebouncedReposition",value:function(){window.addEventListener("scroll",this.onWindowChange,!0),window.addEventListener("resize",this.onWindowChange,!0)}},{key:"unbindDebouncedReposition",value:function(){this.willReposition&&(window.cancelAnimationFrame(this.willReposition),this.willReposition=null),window.removeEventListener("scroll",this.onWindowChange,!0),window.removeEventListener("resize",this.onWindowChange,!0),this.debug("unbinding `debounce reposition` ...")}},{key:"onWindowChange",value:function(){this.willReposition=window.requestAnimationFrame(this.setPosition)}},{key:"setDOMBehavior",value:function(e){if(!e)return this.unbindClickoutHandler(),null;this.debug("setting DOM behavior"),this.bindClickoutHandler(e),this.domContainer=e,this.domContext=w.a.findDOMNode(this.props.context),this.setPosition()}},{key:"getPositionClass",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.position;return"is-".concat(e.replace(/\s+/g,"-"))}},{key:"adjustRtlPosition",value:function(e){if(this.props.isRtl)switch(e){case"top right":case"right top":return"top left";case"right":return"left";case"bottom right":case"right bottom":return"bottom left";case"bottom left":case"left bottom":return"bottom right";case"left":return"right";case"top left":case"left top":return"top right"}return e}},{key:"computePosition",value:function(){if(!this.props.isVisible)return null;var e=this.domContainer,t=this.domContext,n=this.props,i=n.position,o=n.relativePosition;if(!e||!t)return this.debug("[WARN] no DOM elements to work"),null;var r=i;this.debug("position: %o",r),this.props.autoRtl&&(r=this.adjustRtlPosition(r),this.debug("RTL adjusted position: %o",r)),this.props.autoPosition&&(r=H(r,e,t),this.debug("suggested position: %o",r));var a=Object.assign({},function(e,t){var n=x()(t).width;return e.left=Math.max(0,Math.min(e.left,U.width-n)),e}(K(r,e,t,o),e),{positionClass:this.getPositionClass(r)});return this.debug("updating reposition: ",a),a}},{key:"debug",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];J.apply(void 0,["[%s] ".concat(e),this.id].concat(n))}},{key:"setPopoverId",value:function(e){this.id=e||"pop__".concat(Object(j.uniqueId)()),X.add(this.id),this.debug("creating ..."),J("current popover instances: ",X.size)}},{key:"setPosition",value:function(){var e;if(this.debug("updating position"),!(e=this.props.customPosition?Object.assign({positionClass:this.getPositionClass(this.constructor.defaultProps.position)},this.props.customPosition):this.computePosition()))return null;this.willReposition=null,this.setState(e)}},{key:"getStylePosition",value:function(){var e=this.state;return{left:e.left,top:e.top}}},{key:"show",value:function(){var e=this;if(!this.props.showDelay)return this.setState({show:!0}),null;this.debug("showing in %o","".concat(this.props.showDelay,"ms")),this.clearShowTimer(),this._openDelayTimer=setTimeout(function(){e.setState({show:!0})},this.props.showDelay)}},{key:"hide",value:function(){this.unbindClickoutHandler(),this.unbindDebouncedReposition(),this.unbindEscKeyListener(),W(),this.setState({show:!1}),this.clearShowTimer()}},{key:"clearShowTimer",value:function(){if(!this._openDelayTimer)return null;clearTimeout(this._openDelayTimer),this._openDelayTimer=null}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.props.isVisible)return this.debug("popover should be already closed"),null;this.props.onClose(e)}},{key:"render",value:function(){if(!this.state.show)return this.debug("is hidden. return no render"),null;if(!this.props.context)return this.debug("No `context` to tie. return no render"),null;var e=N()("popover",this.props.className,this.state.positionClass);return this.debug("rendering ..."),k.a.createElement(P.a,{className:this.props.rootClassName},k.a.createElement("div",{style:this.getStylePosition(),className:e},k.a.createElement("div",{className:"popover__arrow"}),k.a.createElement("div",{ref:this.setDOMBehavior,className:"popover__inner"},this.props.children)))}}]),t}(y.Component);b()(G,"propTypes",{autoPosition:g.a.bool,autoRtl:g.a.bool,className:g.a.string,closeOnEsc:g.a.bool,id:g.a.string,ignoreContext:g.a.shape({getDOMNode:g.a.function}),isRtl:g.a.bool,isVisible:g.a.bool,position:g.a.oneOf(["top","top right","right","bottom right","bottom","bottom left","left","top left"]),rootClassName:g.a.string,showDelay:g.a.number,onClose:g.a.func,onShow:g.a.func,relativePosition:g.a.shape({left:g.a.number}),customPosition:g.a.shape({top:g.a.number,left:g.a.number,positionClass:g.a.oneOf(["top","right","bottom","left"])})}),b()(G,"defaultProps",{autoPosition:!0,autoRtl:!0,className:"",closeOnEsc:!0,isRtl:!1,isVisible:!1,position:"top",showDelay:0,onClose:Y,onShow:Y});t.a=Object(C.b)(function(e){return{isRtl:document.body.classList.contains("rtl")}})(G)},676:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),a=n.n(r),s=n(528),l=n.n(s),c=n(527),u=n.n(c),d=n(529),p=n.n(d),m=n(10),h=n(12),f=n.n(h),b=n(109),v=n(30),g=n(567),y=n(543),k=function(e){function t(){return o()(this,t),l()(this,u()(t).apply(this,arguments))}return p()(t,e),a()(t,[{key:"fetch",value:function(e){var t=e.siteId,n=e.loaded,i=e.fetching,o=e.error;n||i||o||this.props.fetchSettings(t)}},{key:"UNSAFE_componentWillMount",value:function(){this.fetch(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.fetch(e)}},{key:"render",value:function(){return null}}]),t}(m.Component);k.propTypes={siteId:f.a.number.isRequired},t.a=Object(b.b)(function(e){return{loaded:Object(y.d)(e),fetching:Object(y.c)(e),error:Object(y.b)(e)}},function(e){return Object(v.b)({fetchSettings:g.a},e)})(k)},677:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),a=n.n(r),s=n(528),l=n.n(s),c=n(527),u=n.n(c),d=n(529),p=n.n(d),m=n(10),h=n(12),f=n.n(h),b=n(109),v=n(30),g=n(555),y=n(541),k=function(e){function t(){return o()(this,t),l()(this,u()(t).apply(this,arguments))}return p()(t,e),a()(t,[{key:"fetch",value:function(e){var t=e.siteId,n=e.loaded,i=e.fetching,o=e.error;n||i||o||this.props.fetchSettings(t)}},{key:"UNSAFE_componentWillMount",value:function(){this.fetch(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.fetch(e)}},{key:"render",value:function(){return null}}]),t}(m.Component);k.propTypes={siteId:f.a.number.isRequired},t.a=Object(b.b)(function(e){return{loaded:Object(y.i)(e),fetching:Object(y.h)(e),error:Object(y.g)(e)}},function(e){return Object(v.b)({fetchSettings:g.fetchSettings},e)})(k)},682:function(e,t,n){},683:function(e,t,n){},685:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),a=n.n(r),s=n(528),l=n.n(s),c=n(527),u=n.n(c),d=n(531),p=n.n(d),m=n(529),h=n.n(m),f=n(34),b=n.n(f),v=n(109),g=n(35),y=n(12),k=n.n(y),E=n(10),w=n.n(E),C=n(1),I=(n(682),n(616)),R=n(534),O=n.n(R),N=n(583),_=n.n(N),D=n(30),j=n(790),P=n(526),L=n.n(P),q=n(542),S=n(632),x=function(e){return"HR"===e.tagName},T=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(p()(n),"menu",w.a.createRef()),b()(p()(n),"_setPropsOnChild",function(e){if(null==e)return e;var t=n._onClose.bind(p()(n),e.props.action),i=t;return e.props.onClick&&(i=Object(C.over)([e.props.onClick,t])),w.a.cloneElement(e,{onClick:i})}),b()(p()(n),"_onShow",function(){var e=n.menu.current;n._previouslyFocusedElement=document.activeElement,e&&e.focus()}),b()(p()(n),"_getClosestSibling",function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=n.menu.current,o=i.firstChild,r=i.lastChild;if(t||(o=i.lastChild,r=i.firstChild),e===i)return o;var a=e[t?"nextSibling":"previousSibling"]||r;return x(a)?n._getClosestSibling(a,t):a}),b()(p()(n),"_onKeyDown",function(e){var t,i=e.target,o=!1;switch(e.keyCode){case 9:n.props.onClose(),o=!0;break;case 38:t=n._getClosestSibling(i,!1),o=!0;break;case 40:t=n._getClosestSibling(i,!0),o=!0}t&&t.focus(),o&&e.preventDefault()}),b()(p()(n),"_onClose",function(e){n._previouslyFocusedElement&&(n._previouslyFocusedElement.focus(),n._previouslyFocusedElement=null),n.props.onClose&&n.props.onClose(e)}),n}return h()(t,e),a()(t,[{key:"componentWillUnmount",value:function(){this._previouslyFocusedElement=null}},{key:"render",value:function(){var e=this.props,t=e.popoverComponent,n=e.autoPosition,i=e.className,o=e.context,r=e.customPosition,a=e.isVisible,s=e.popoverTitle,l=e.position,c=e.rootClassName;return w.a.createElement(t,{onClose:this._onClose,onShow:this._onShow,autoPosition:n,className:i,context:o,customPosition:r,isVisible:a,popoverTitle:s,position:l,rootClassName:c},w.a.createElement("div",{ref:this.menu,role:"menu",className:"popover__menu",onKeyDown:this._onKeyDown,tabIndex:"-1"},w.a.Children.map(this.props.children,this._setPropsOnChild,this)))}}]),t}(E.Component);b()(T,"propTypes",{autoPosition:k.a.bool,isVisible:k.a.bool.isRequired,onClose:k.a.func.isRequired,position:k.a.string,className:k.a.string,rootClassName:k.a.string,popoverComponent:k.a.func,popoverTitle:k.a.string,customPosition:k.a.object}),b()(T,"defaultProps",{autoPosition:!0,position:"top",popoverComponent:S.a});var M=T,A=(n(683),function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(p()(n),"state",{isMenuVisible:!1}),b()(p()(n),"popoverContext",w.a.createRef()),b()(p()(n),"handleClick",function(e){var t=n.props.onClick,i=n.state.isMenuVisible;t(e),i?n.hideMenu():n.showMenu()}),b()(p()(n),"hideMenu",function(){return n.toggleMenu(!1)}),b()(p()(n),"showMenu",function(){return n.toggleMenu(!0)}),n}return h()(t,e),a()(t,[{key:"toggleMenu",value:function(e){this.props.disabled||(this.setState({isMenuVisible:e}),this.props.onToggle(e))}},{key:"render",value:function(){var e=this.props,t=e.toggleTitle,n=e.translate,i=e.position,o=e.children,r=e.disabled,a=e.className,s=e.popoverClassName,l=this.state.isMenuVisible,c=L()("ellipsis-menu",a,{"is-menu-visible":l,"is-disabled":r}),u=L()("ellipsis-menu__menu","popover",s);return w.a.createElement("span",{className:c},w.a.createElement(q.a,{ref:this.popoverContext,onClick:this.handleClick,title:t||n("Toggle menu"),borderless:!0,disabled:r,className:"ellipsis-menu__toggle"},w.a.createElement(O.a,{icon:"ellipsis",className:"ellipsis-menu__toggle-icon"})),w.a.createElement(M,{isVisible:l,onClose:this.hideMenu,position:i,context:this.popoverContext.current,className:u},o))}}]),t}(E.Component));b()(A,"propTypes",{translate:k.a.func,toggleTitle:k.a.string,position:k.a.string,disabled:k.a.bool,onClick:k.a.func,onToggle:k.a.func,popoverClassName:k.a.string}),b()(A,"defaultProps",{onClick:C.noop,onToggle:C.noop});var z=Object(g.localize)(A),U=n(530),F=n.n(U),V=n(601),B=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(p()(n),"handleMouseOver",function(e){n.props.focusOnHover&&e.target.focus(),n.props.onMouseOver()}),n}return h()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,i=e.href,o=e.icon,r=e.isSelected,a=e.isExternalLink,s=Object(C.omit)(this.props,"icon","focusOnHover","isSelected","isExternalLink","className","itemComponent"),l=L()("popover__menu-item",n,{"is-selected":r}),c=this.props.itemComponent;return a&&i?(c=V.a,s.icon=!0):i&&(c="a"),w.a.createElement(c,F()({role:"menuitem",onMouseOver:this.handleMouseOver,tabIndex:"-1",className:l},s),o&&w.a.createElement(O.a,{icon:o,size:18}),t)}}]),t}(E.Component);b()(B,"propTypes",{href:k.a.string,className:k.a.string,isSelected:k.a.bool,icon:k.a.string,focusOnHover:k.a.bool,onMouseOver:k.a.func,isExternalLink:k.a.bool,itemComponent:k.a.oneOfType([k.a.func,k.a.string])}),b()(B,"defaultProps",{isSelected:!1,focusOnHover:!0,onMouseOver:C.noop,itemComponent:"button"});var W=n(551),H=n(548),K=n(540),Y=n(537),J=function(e){var t=e.orderId,n=e.siteId,i=e.refundDialog,o=e.createdDate,r=e.refundableAmount,a=e.currency,s=e.labelId,l=e.translate,c=e.moment,u=function(){return _()(r,a)},d=function(){return e.closeRefundDialog(t,n)},p=[{action:"cancel",label:l("Cancel"),onClick:d},{action:"confirm",onClick:function(){return e.confirmRefund(t,n)},isPrimary:!0,disabled:i&&i.isSubmitting,additionalClassNames:i&&i.isSubmitting?"is-busy":"",label:l("Refund label (-%(amount)s)",{args:{amount:u()}})}];return w.a.createElement(W.a,{additionalClassNames:"label-refund-modal woocommerce wcc-root",isVisible:Boolean(i&&i.labelId===s),onClose:d,buttons:p},w.a.createElement(H.a,null,l("Request a refund")),w.a.createElement("p",null,l("You can request a refund for a shipping label that has not been used to ship a package. It will take at least 14 days to process.")),w.a.createElement("dl",null,w.a.createElement("dt",null,l("Purchase date")),w.a.createElement("dd",null,c(o).format("LLL")),w.a.createElement("dt",null,l("Amount eligible for refund")),w.a.createElement("dd",null,u())))};J.propTypes={siteId:k.a.number.isRequired,orderId:k.a.number.isRequired,refundDialog:k.a.object,createdDate:k.a.number,refundableAmount:k.a.number,currency:k.a.string,labelId:k.a.number,closeRefundDialog:k.a.func.isRequired,confirmRefund:k.a.func.isRequired};var X=Object(v.b)(function(e,t){var n=t.orderId,i=t.siteId,o=Object(Y.s)(e,n,i),r=Object(Y.i)(e,n,i);return{refundDialog:o?r.refundDialog:{}}},function(e){return Object(D.b)({closeRefundDialog:K.e,confirmRefund:K.k},e)})(Object(g.localize)(J)),G=n(600),Q=n(604),Z=function(e){var t=e.orderId,n=e.siteId,i=e.reprintDialog,o=e.paperSize,r=e.storeOptions,a=e.labelId,s=e.translate,l=function(){return e.closeReprintDialog(t,n)},c=[{action:"cancel",label:s("Cancel"),onClick:l},{action:"confirm",onClick:function(){return e.confirmReprint(t,n)},isPrimary:!0,disabled:i&&!i.fileData,additionalClassNames:i&&i.isFetching?"is-busy":"",label:s("Print")}];return w.a.createElement(W.a,{isVisible:Boolean(i&&i.labelId===a),onClose:l,buttons:c,additionalClassNames:"label-reprint-modal woocommerce wcc-root"},w.a.createElement(H.a,null,s("Reprint shipping label")),w.a.createElement("p",null,s("If there was a printing error when you purchased the label, you can print it again.")),w.a.createElement("p",{className:"shipping-label__reprint-modal-notice"},s("NOTE: If you already used the label in a package, printing and using it again is a violation of our terms of service and may result in criminal charges.")),w.a.createElement(G.a,{id:"paper_size",valuesMap:Object(Q.a)(r.origin_country),title:s("Paper size"),value:o,updateValue:function(i){return e.updatePaperSize(t,n,i)}}))};Z.propTypes={siteId:k.a.number.isRequired,orderId:k.a.number.isRequired,reprintDialog:k.a.object,paperSize:k.a.string.isRequired,storeOptions:k.a.object.isRequired,labelId:k.a.number,closeReprintDialog:k.a.func.isRequired,confirmReprint:k.a.func.isRequired};var $=Object(v.b)(function(e,t){var n=t.orderId,i=t.siteId,o=Object(Y.s)(e,n,i),r=Object(Y.i)(e,n,i);return{reprintDialog:o?r.reprintDialog:{},paperSize:r.paperSize,storeOptions:o?r.storeOptions:{}}},function(e){return Object(D.b)({closeReprintDialog:K.f,confirmReprint:K.l,updatePaperSize:K.X},e)})(Object(g.localize)(Z)),ee=n(645),te=n(543),ne=function(e){var t=e.orderId,n=e.siteId,i=e.isVisible,o=e.labelIndex,r=e.serviceName,a=e.packageName,s=e.productNames,l=e.canManagePayments,c=e.receiptId,u=e.translate,d=function(){return e.closeDetailsDialog(t,n)},p=[{action:"close",label:u("Close"),onClick:d}];return w.a.createElement(W.a,{additionalClassNames:"label-details-modal woocommerce wcc-root",isVisible:i,onClose:d,buttons:p},w.a.createElement(H.a,{className:"shipping-label__label-details-modal-heading"},w.a.createElement("span",{className:"shipping-label__label-details-modal-heading-title"},u("Label #%(labelIndex)s details",{args:{labelIndex:o+1}})),l&&c?w.a.createElement("a",{href:"".concat(Object(ee.a)(),"/me/purchases/billing/").concat(c),target:"_blank",rel:"noopener noreferrer"},u("Receipt")):null),w.a.createElement("dl",null,w.a.createElement("dt",null,u("Service")),w.a.createElement("dd",null,r),w.a.createElement("dt",null,u("Package")),w.a.createElement("dd",null,a),w.a.createElement("dt",null,u("Items")),w.a.createElement("dd",null,w.a.createElement("ul",null,s.map(function(e,t){return w.a.createElement("li",{key:t},e)})))))};ne.propTypes={siteId:k.a.number.isRequired,orderId:k.a.number.isRequired,isVisible:k.a.bool,serviceName:k.a.string,packageName:k.a.string,productNames:k.a.array,closeDetailsDialog:k.a.func.isRequired,receiptId:k.a.number};var ie=Object(v.b)(function(e,t){var n=t.orderId,i=t.siteId,o=t.labelId,r=Object(Y.s)(e,n,i),a=Object(Y.i)(e,n,i).detailsDialog;return{isVisible:Boolean(r&&a&&a.labelId===o),canManagePayments:Object(te.q)(e,i)}},function(e){return Object(D.b)({closeDetailsDialog:K.c},e)})(Object(g.localize)(ne)),oe={usps:function(e){return"https://tools.usps.com/go/TrackConfirmAction.action?tLabels=".concat(e)},fedex:function(e){return"https://www.fedex.com/apps/fedextrack/?action=track&tracknumbers=".concat(e)},ups:function(e){return"https://www.ups.com/track?loc=en_US&tracknum=".concat(e)},dhlexpress:function(e){return"https://www.dhl.com/en/express/tracking.html?AWB=".concat(e,"&brand=DHL")}},re=function(e){var t=e.tracking,n=e.carrierId,i=e.translate;if(!t)return w.a.createElement("span",null,i("N/A"));var o=oe[n](t);return o?w.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:o},t," ",w.a.createElement(O.a,{icon:"external",size:12})):w.a.createElement("span",null,t)};re.propTypes={tracking:k.a.string,carrierId:k.a.string};var ae=Object(g.localize)(re),se=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(p()(n),"renderRefund",function(e,t){var i=n.props,o=i.orderId,r=i.siteId,a=i.translate;if(t)return w.a.createElement(j.a,{position:"top left",text:a("Labels older than 30 days cannot be refunded.")},w.a.createElement("button",{className:"popover__menu-item shipping-label__item-menu-reprint-expired",role:"menuitem",tabIndex:"-1"},w.a.createElement(O.a,{icon:"refund",size:18}),w.a.createElement("span",null," ",a("Request refund")," ")));return w.a.createElement(B,{onClick:function(){n.props.openRefundDialog(o,r,e)},icon:"refund"},a("Request refund"))}),b()(p()(n),"renderReprint",function(e,t){var i=n.props,o=i.orderId,r=i.siteId,a=i.translate;if(t)return w.a.createElement(j.a,{position:"top left",text:a("Label images older than 180 days are deleted by our technology partners for general security and data privacy concerns.")},w.a.createElement("button",{className:"popover__menu-item shipping-label__item-menu-reprint-expired",role:"menuitem",tabIndex:"-1"},w.a.createElement(O.a,{icon:"print",size:18}),w.a.createElement("span",null," ",a("Reprint")," ")));return w.a.createElement(B,{onClick:function(){n.props.openReprintDialog(o,r,e)},icon:"print"},a("Reprint shipping label"))}),b()(p()(n),"renderLabelDetails",function(e){var t=n.props,i=t.orderId,o=t.siteId,r=t.translate;return w.a.createElement(B,{onClick:function(){n.props.openDetailsDialog(i,o,e)},icon:"info-outline"},r("View details"))}),b()(p()(n),"renderPickup",function(e){var t=n.props.translate,i={usps:"https://tools.usps.com/schedule-pickup-steps.htm",fedex:"https://www.fedex.com/en-us/shipping/schedule-manage-pickups.html",ups:"https://wwwapps.ups.com/pickup/request"};if(!i.hasOwnProperty(e))return null;return w.a.createElement(B,{onClick:function(){window.open(i[e],"_blank")},icon:"external"},t("Schedule a pickup"))}),n}return h()(t,e),a()(t,[{key:"renderCommercialInvoiceLink",value:function(){var e=this.props,t=e.translate,n=e.label.commercialInvoiceUrl;if(!n)return null;return w.a.createElement(B,{onClick:function(){window.open(n)},icon:"print"},t("Print customs form"))}},{key:"render",value:function(){var e=this.props,t=e.label,n=t.labelIndex,i=t.serviceName,o=t.packageName,r=t.productNames,a=t.receiptId,s=t.labelId,l=t.createdDate,c=t.refundableAmount,u=t.currency,d=t.showDetails,p=t.expiryDate,m=t.anonymized,h=t.usedDate,f=t.tracking,b=t.carrierId,v=t.commercialInvoiceUrl,g=e.siteId,y=e.orderId,k=e.translate,E=e.isModal,C=(new Date).getTime(),I=!1,R=!1;(m||h||p&&p<C)&&(I=!0);var O=(new Date).setDate((new Date).getDate()-30);return(m||h||l&&l<O)&&(R=!0),w.a.createElement("div",{className:"shipping-label__item"},w.a.createElement("p",{className:"shipping-label__item-detail"},k("%(service)s label (#%(labelIndex)d)",{args:{service:i,labelIndex:n+1}}),d&&w.a.createElement("span",null,!E&&w.a.createElement(z,{position:"bottom left"},this.renderLabelDetails(s),this.renderPickup(b),this.renderRefund(s,R),this.renderReprint(s,I),this.renderCommercialInvoiceLink(v)),w.a.createElement(ie,{siteId:g,orderId:y,labelIndex:n,serviceName:i,packageName:o,productNames:r,receiptId:a,labelId:s}),w.a.createElement(X,{siteId:g,orderId:y,createdDate:l,refundableAmount:c,currency:u,labelId:s}),w.a.createElement($,{siteId:g,orderId:y,labelId:s}))),d&&w.a.createElement("p",{className:"shipping-label__item-tracking"},k("Tracking #: {{trackingLink/}}",{components:{trackingLink:w.a.createElement(ae,{carrierId:b,tracking:f})}})))}}]),t}(E.Component);se.propTypes={siteId:k.a.number.isRequired,orderId:k.a.number.isRequired,label:k.a.shape({serviceName:k.a.string.isRequired,labelIndex:k.a.number.isRequired,packageName:k.a.string.isRequired,productNames:k.a.string.isRequired,receiptId:k.a.number.isRequired,labelId:k.a.number.isRequired,createdDate:k.a.string.isRequired,refundableAmount:k.a.number.isRequired,currency:k.a.string.isRequired,showDetails:k.a.bool.isRequired,expiryDate:k.a.string.isRequired,anonymized:k.a.bool.isRequired,usedDate:k.a.string.isRequired,tracking:k.a.string.isRequired,carrierId:k.a.number.isRequired,commercialInvoiceUrl:k.a.string}).isRequired,isModal:k.a.bool.isRequired,openRefundDialog:k.a.func.isRequired,openReprintDialog:k.a.func.isRequired,openDetailsDialog:k.a.func.isRequired};var le=Object(v.b)(null,function(e){return Object(D.b)({openRefundDialog:K.y,openReprintDialog:K.z,openDetailsDialog:K.u},e)})(Object(g.localize)(se)),ce=function(e){function t(){return o()(this,t),l()(this,u()(t).apply(this,arguments))}return h()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.label,n=e.translate,i=t.serviceName,o=t.labelIndex;return w.a.createElement("div",{className:"shipping-label__item"},w.a.createElement("p",{className:"shipping-label__item-detail"},n("%(service)s label (#%(labelIndex)d)",{args:{service:i,labelIndex:o+1}}),w.a.createElement("br",null),n("Purchasing\u2026")))}}]),t}(se);se.propTypes={label:k.a.object.isRequired};var ue=Object(g.localize)(ce),de=n(602),pe=function(e){function t(){var e,n,i;o()(this,t);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=l()(this,(e=u()(t)).call.apply(e,[this].concat(a))),b()(p()(i),"eventPropsByType",(n={},b()(n,I.a.INTERNAL_NOTE,function(e){return{icon:"aside",heading:(0,i.props.translate)("Internal note"),content:Object(de.a)(Object(de.b)(e.content))}}),b()(n,I.a.CUSTOMER_NOTE,function(e){return{icon:"mail",heading:(0,i.props.translate)("Note sent to customer"),content:Object(de.a)(Object(de.b)(e.content))}}),b()(n,I.a.LABEL_PURCHASING,function(e){return{icon:"sync",content:w.a.createElement(ue,{label:e,orderId:i.props.orderId,siteId:i.props.siteId})}}),b()(n,I.a.LABEL_PURCHASED,function(e){return{icon:"print",content:w.a.createElement(le,{label:e,orderId:i.props.orderId,siteId:i.props.siteId,isModal:i.props.isModal})}}),b()(n,I.a.LABEL_REFUND_REQUESTED,function(e){var t=i.props.translate;return{icon:"time",content:w.a.createElement("div",null,t("%(service)s label (#%(labelNum)d) refund requested (%(amount)s)",{args:{service:e.serviceName,labelNum:e.labelIndex+1,amount:_()(e.amount,e.currency)}}))}}),b()(n,I.a.LABEL_REFUND_COMPLETED,function(e){var t=i.props.translate;return{icon:"refund",content:w.a.createElement("div",null,t("%(service)s label (#%(labelNum)d) refunded (%(amount)s)",{args:{service:e.serviceName,labelNum:e.labelIndex+1,amount:_()(e.amount,e.currency)}}))}}),b()(n,I.a.LABEL_REFUND_REJECTED,function(e){var t=i.props.translate;return{icon:"cross-small",content:w.a.createElement("div",null,t("%(service)s label (#%(labelNum)d) refund rejected",{service:e.serviceName,args:{labelNum:e.labelIndex+1}}))}}),b()(n,I.a.REFUND_NOTE,function(e){var t=i.props.translate;return{icon:"credit-card",heading:t("Refund"),content:w.a.createElement("div",null,t("Refunded %(amount)s",{args:{amount:_()(e.amount,e.currency)}}),w.a.createElement("br",null),e.reason)}}),b()(n,void 0,function(){return{}}),n)),b()(p()(i),"renderDefaultEvent",function(e){return{icon:"aside",heading:(0,i.props.translate)("Note"),content:e.content}}),i}return h()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.moment,n=e.event,i=(this.eventPropsByType[n.type]||this.renderDefaultEvent)(n),o=i.icon,r=i.heading,a=i.content;return w.a.createElement("div",{className:"order-activity-log__note"},w.a.createElement("div",{className:"order-activity-log__note-meta"},w.a.createElement("span",{className:"order-activity-log__note-time"},t(n.timestamp).format("LT")),o&&w.a.createElement(O.a,{icon:o,size:24})),w.a.createElement("div",{className:"order-activity-log__note-body"},w.a.createElement("div",{className:"order-activity-log__note-type"},r),w.a.createElement("div",{className:"order-activity-log__note-content"},a)))}}]),t}(E.Component);b()(pe,"propTypes",{customer_note:k.a.bool,date_created_gmt:k.a.string,note:k.a.string.isRequired}),b()(pe,"propTypes",{event:k.a.object}),b()(pe,"defaultProps",{event:{}});var me=Object(g.localize)(pe),he=n(599),fe=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(p()(n),"onClick",function(){n.props.onClick(n.props.date)}),n}return h()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.count,n=e.date,i=e.isOpen,o=e.moment,r=e.translate,a=o(n,"YYYYMMDD").format("ll"),s=w.a.createElement("div",null,w.a.createElement("h3",null,a),w.a.createElement("small",null,r("%(count)s event","%(count)s events",{count:t,args:{count:t}})));return w.a.createElement("div",{className:"order-activity-log__day"},w.a.createElement(he.a,{onClick:this.onClick,className:"order-activity-log__day-header",expanded:i,header:s,screenReaderText:r("Show notes from %(date)s",{args:{date:a}})},this.props.children))}}]),t}(E.Component);b()(fe,"propTypes",{count:k.a.number.isRequired,date:k.a.string.isRequired,isOpen:k.a.bool.isRequired,onClick:k.a.func.isRequired});var be=Object(g.localize)(fe);var ve=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(p()(n),"toggleOpenDay",function(e){n.setState(function(){return{openDay:e}})}),b()(p()(n),"renderNotes",function(){var e=n.props,t=e.days,i=e.eventsByDay,o=e.translate;return t.length?w.a.createElement("div",null,t.map(function(e){var t=i[e];return w.a.createElement(be,{key:e,count:t.length,date:e,isOpen:e===n.state.openDay,onClick:n.toggleOpenDay},t.map(function(e){return w.a.createElement(me,{key:"".concat(e.type,"-").concat(e.key),event:e,orderId:n.props.orderId,siteId:n.props.siteId,isModal:n.props.isModal})}))})):w.a.createElement("p",null,o("No activity yet"))}),b()(p()(n),"renderPlaceholder",function(){return w.a.createElement("div",{className:"is-placeholder"},w.a.createElement(be,{count:0,date:"",isOpen:!0,index:1,onClick:C.noop},w.a.createElement(me,null)))}),n}return h()(t,e),a()(t,[{key:"UNSAFE_componentWillMount",value:function(){this.setState({openDay:Object(C.last)(Object(C.keys)(this.props.eventsByDay))})}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=Object(C.last)(Object(C.keys)(e.eventsByDay));this.props.eventsByDay[t]||this.setState({openDay:t})}},{key:"render",value:function(){return this.props.isLoaded?this.renderNotes():this.renderPlaceholder()}}]),t}(E.Component);b()(ve,"propTypes",{orderId:k.a.number.isRequired,siteId:k.a.number.isRequired});t.a=Object(v.b)(function(e,t){var n=t.orderId||!1,i=Object(I.c)(e,n),o=Object(I.b)(e,n),r=o.length?function(e){var t={};return e.forEach(function(e){var n=Object(g.moment)(e.timestamp).format("YYYYMMDD");t[n]?t[n].push(e):t[n]=[e]}),Object(C.keys)(t).forEach(function(e){t[e]=Object(C.sortBy)(t[e],["timestamp","key"]).reverse()}),t}(o):{},a=r?Object(C.keys)(r):[];return a.sort().reverse(),{isLoaded:i,days:a,events:o,eventsByDay:r}})(Object(g.localize)(ve))},796:function(e,t,n){"use strict";n.r(t);var i=n(36),o=n.n(i),r=n(107),a=n.n(r),s=n(108),l=n.n(s),c=n(528),u=n.n(c),d=n(527),p=n.n(d),m=n(531),h=n.n(m),f=n(529),b=n.n(f),v=n(34),g=n.n(v),y=n(10),k=n.n(y),E=n(12),w=n.n(E),C=n(30),I=n(109),R=n(35),O=n(676),N=n(677),_=n(691),D=n(563),j=function(e){function t(){var e,n;a()(this,t);for(var i=arguments.length,o=new Array(i),r=0;r<i;r++)o[r]=arguments[r];return n=u()(this,(e=p()(t)).call.apply(e,[this].concat(o))),g()(h()(n),"fetch",function(){var e=n.props,t=e.fetchLocations,i=e.loadingLocations,o=e.locationsLoaded,r=e.siteId;!i&&!o&&t(r)}),g()(h()(n),"componentDidMount",function(){n.fetch()}),g()(h()(n),"componentDidUpdate",function(){n.fetch()}),g()(h()(n),"render",function(){return null}),n}return b()(t,e),t}(y.Component);g()(j,"propTypes",{fetchLocations:w.a.func,siteId:w.a.number.isRequired,loadingLocations:w.a.bool.isRequired,locationsLoaded:w.a.bool.isRequired});var P=Object(I.b)(function(e){return{loadingLocations:Object(D.c)(e),locationsLoaded:Object(D.b)(e)}},function(e){return Object(C.b)({fetchLocations:_.a},e)})(j),L=n(540),q=n(537),S=function(e){function t(){return a()(this,t),u()(this,p()(t).apply(this,arguments))}return b()(t,e),l()(t,[{key:"fetch",value:function(e){var t=e.orderId,n=e.siteId,i=e.loaded,o=e.fetching,r=e.error,a=e.refreshedLabelStatus;i||o||r?i&&!a&&this.props.fetchLabelsStatus(t,n):this.props.fetchLabelsData(t,n)}},{key:"UNSAFE_componentWillMount",value:function(){this.fetch(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.fetch(e)}},{key:"render",value:function(){var e=this.props.siteId;return k.a.createElement("div",null,k.a.createElement(O.a,{siteId:e}),k.a.createElement(N.a,{siteId:e}),k.a.createElement(P,{siteId:e}))}}]),t}(y.Component);S.propTypes={siteId:w.a.number.isRequired,orderId:w.a.number.isRequired};var x=Object(I.b)(function(e,t){var n=t.orderId;return{loaded:Object(q.s)(e,n),fetching:Object(q.r)(e,n),error:Object(q.q)(e,n),refreshedLabelStatus:Object(q.l)(e,n)}},function(e){return Object(C.b)({fetchLabelsData:L.q,fetchLabelsStatus:L.r},e)})(S),T=n(631),M=n(590),A=n(532),z=n(685),U=n(616),F=n(607),V=n(638),B=function(e){function t(){var e,n;a()(this,t);for(var i=arguments.length,o=new Array(i),r=0;r<i;r++)o[r]=arguments[r];return n=u()(this,(e=p()(t)).call.apply(e,[this].concat(o))),g()(h()(n),"renderActivityLog",function(){var e=n.props,t=e.siteId,i=e.orderId,o=e.events,r=e.translate;return 0===o.length?r("No tracking information available at this time"):k.a.createElement("div",{className:"shipment-tracking__dummy-class order-activity-log"},k.a.createElement(z.a,{orderId:i,siteId:t}))}),n}return b()(t,e),l()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.siteId,n=e.orderId,i=e.orderLoading,o=e.orderLoaded;t&&n&&!i&&!o&&this.props.fetchOrder(t,n)}},{key:"render",value:function(){var e=this.props,t=e.siteId,n=e.orderId;return k.a.createElement("div",{className:"shipment-tracking__container"},k.a.createElement(T.a,{notices:M.a.list}),k.a.createElement(x,{orderId:n,siteId:t,origin:"tracking"}),this.renderActivityLog())}}]),t}(y.Component);g()(B,"propTypes",{orderId:w.a.number.isRequired});t.default=Object(I.b)(function(e,t){var n=t.orderId,i=Object(A.a)(e);return{siteId:i,events:Object(U.b)(e,n),orderLoading:Object(F.c)(e,n,i),orderLoaded:Object(F.b)(e,n,i)}},function(e){return o()({},Object(C.b)({fetchOrder:V.e},e))})(Object(R.localize)(B))}}]);
|
dist/chunks/{8d827ef9f423b897385e.css → 3ed05dfa5e09a976a3dd.css}
RENAMED
File without changes
|
dist/chunks/{8d827ef9f423b897385e.min.js → 3ed05dfa5e09a976a3dd.min.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[148],{542:function(e,t,n){"use strict";n.d(t,"a",function(){return _});var r=n(530),a=n.n(r),o=n(533),i=n.n(o),s=n(107),c=n.n(s),l=n(108),u=n.n(l),p=n(528),f=n.n(p),d=n(527),m=n.n(d),h=n(529),g=n.n(h),y=n(34),b=n.n(y),v=n(10),E=n.n(v),k=n(12),T=n.n(k),w=n(526),N=n.n(w),_=function(e){function t(){return c()(this,t),f()(this,m()(t).apply(this,arguments))}return g()(t,e),u()(t,[{key:"render",value:function(){var e=N()("button",this.props.className,{"is-compact":this.props.compact,"is-primary":this.props.primary,"is-scary":this.props.scary,"is-busy":this.props.busy,"is-borderless":this.props.borderless});if(this.props.href){var t=this.props,n=(t.compact,t.primary,t.scary,t.busy,t.borderless,t.type,i()(t,["compact","primary","scary","busy","borderless","type"])),r=n.target?(n.rel||"").replace(/noopener|noreferrer/g,"")+" noopener noreferrer":n.rel;return E.a.createElement("a",a()({},n,{rel:r,className:e}))}var o=this.props,s=(o.compact,o.primary,o.scary,o.busy,o.borderless,o.target,o.rel,i()(o,["compact","primary","scary","busy","borderless","target","rel"]));return E.a.createElement("button",a()({},s,{className:e}))}}]),t}(v.PureComponent);b()(_,"propTypes",{compact:T.a.bool,primary:T.a.bool,scary:T.a.bool,busy:T.a.bool,type:T.a.string,href:T.a.string,borderless:T.a.bool,target:T.a.string,rel:T.a.string}),b()(_,"defaultProps",{type:"button"})},544:function(e,t,n){"use strict";n.d(t,"a",function(){return l});var r=n(1),a=n(606),o=n.n(a),i=(n(112),function(e){return e}),s=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.join()},c=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return e.map(function(e){return e.apply(void 0,[t].concat(r))})}};function l(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s,l=Object(r.memoize)(e,a);return Array.isArray(n)&&(n=c(n)),Object.assign(function(e){for(var r=arguments.length,a=new Array(r>1?r-1:0),i=1;i<r;i++)a[i-1]=arguments[i];var s=n.apply(void 0,[e].concat(a));return Array.isArray(s)||(s=[s]),t&&!o()(s,t)&&l.cache.clear(),t=s,l.apply(void 0,[e].concat(a))},{memoizedSelector:l})}},545:function(e,t,n){"use strict";var r=n(530),a=n.n(r),o=n(533),i=n.n(o),s=n(10),c=n.n(s),l=n(526),u=n.n(l);t.a=function(e){var t=e.className,n=e.children,r=i()(e,["className","children"]);return c.a.createElement("fieldset",a()({},r,{className:u()(t,"form-fieldset")}),n)}},546:function(e,t,n){"use strict";var r=n(530),a=n.n(r),o=n(533),i=n.n(o),s=n(36),c=n.n(s),l=n(10),u=n.n(l),p=n(12),f=n.n(p),d=n(526),m=n.n(d),h=n(35),g=n(1),y=function(e){var t=e.children,n=e.required,r=e.optional,o=e.translate,s=e.className,l=i()(e,["children","required","optional","translate","className"]);return t=u.a.Children.toArray(t)||[],n&&t.push(function(e){return u.a.createElement("small",{className:"form-label__required"},e("Required"))}(o)),r&&t.push(function(e){return u.a.createElement("small",{className:"form-label__optional"},e("Optional"))}(o)),u.a.createElement("label",a()({},Object(g.omit)(l,"moment","numberFormat"),{className:m()(s,"form-label")}),t.length?t.map(function(e,t){return Object(g.isObject)(e)?c()({},e,{key:t}):e}):null)};y.propTypes={required:f.a.bool},t.a=Object(h.localize)(y)},548:function(e,t,n){"use strict";var r=n(530),a=n.n(r),o=n(533),i=n.n(o),s=n(10),c=n.n(s),l=n(526),u=n.n(l);t.a=function(e){var t=e.className,n=e.children,r=i()(e,["className","children"]);return c.a.createElement("h3",a()({},r,{className:u()(t,"form-section-heading")}),n)}},549:function(e,t,n){"use strict";n.d(t,"c",function(){return c}),n.d(t,"d",function(){return u}),n.d(t,"a",function(){return p}),n.d(t,"b",function(){return f});var r=n(533),a=n.n(r),o=n(1),i={debounce:o.debounce,isPlainObject:o.isPlainObject,uniqueId:o.uniqueId},s=(n(46),i.uniqueId);function c(e){return{noticeId:e,type:"NOTICE_REMOVE"}}function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.id,o=a()(n,["id"]);return{type:"NOTICE_CREATE",notice:Object.assign({showDismiss:!0},o,{noticeId:r||s(),status:e,text:t})}}var u=l.bind(null,"is-success"),p=l.bind(null,"is-error"),f=l.bind(null,"is-info");l.bind(null,"is-warning"),l.bind(null,"is-plain")},554:function(e,t,n){"use strict";var r=n(530),a=n.n(r),o=n(533),i=n.n(o),s=n(10),c=n.n(s),l=n(526),u=n.n(l);t.a=function(e){var t=e.className,n=e.children,r=i()(e,["className","children"]);return c.a.createElement("legend",a()({},r,{className:u()(t,"form-legend")}),n)}},558:function(e,t,n){"use strict";n.d(t,"a",function(){return N});var r=n(530),a=n.n(r),o=n(107),i=n.n(o),s=n(108),c=n.n(s),l=n(528),u=n.n(l),p=n(527),f=n.n(p),d=n(529),m=n.n(d),h=n(34),g=n.n(h),y=n(10),b=n.n(y),v=n(12),E=n.n(v),k=n(526),T=n.n(k),w=n(1),N=function(e){function t(){return i()(this,t),u()(this,f()(t).apply(this,arguments))}return m()(t,e),c()(t,[{key:"render",value:function(){var e=T()(this.props.className,"form-setting-explanation",{"no-validate":this.props.noValidate,"is-indented":this.props.isIndented});return b.a.createElement("p",a()({},Object(w.omit)(this.props,"className","noValidate","isIndented"),{className:e}),this.props.children)}}]),t}(b.a.Component);g()(N,"displayName","FormSettingExplanation"),g()(N,"propTypes",{noValidate:E.a.bool,isIndented:E.a.bool,className:E.a.string}),g()(N,"defaultProps",{noValidate:!1,isIndented:!1})},559:function(e,t,n){"use strict";var r=n(530),a=n.n(r),o=n(533),i=n.n(o),s=n(107),c=n.n(s),l=n(108),u=n.n(l),p=n(528),f=n.n(p),d=n(527),m=n.n(d),h=n(529),g=n.n(h),y=n(34),b=n.n(y),v=n(10),E=n.n(v),k=n(526),T=n.n(k),w=n(534),N=n.n(w),_=n(12),O=n.n(_),x=function(e){var t=e.className,n=e.compact,r=e.displayAsLink,a=e.highlight,o=e.href,i=e.onClick;return T()("card",t,{"is-card-link":r||!!o,"is-clickable":!!i,"is-compact":n,"is-highlight":a},!!a&&"is-"+a)},S=function(e){function t(){return c()(this,t),f()(this,m()(t).apply(this,arguments))}return g()(t,e),u()(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=(e.compact,e.displayAsLink),r=(e.highlight,e.tagName),o=e.href,s=e.target,c=i()(e,["children","compact","displayAsLink","highlight","tagName","href","target"]);return o?E.a.createElement("a",a()({},c,{href:o,target:s,className:x(this.props)}),E.a.createElement(N.a,{className:"card__link-indicator",icon:s?"external":"chevron-right"}),t):E.a.createElement(r,a()({},c,{className:x(this.props)}),n&&E.a.createElement(N.a,{className:"card__link-indicator",icon:s?"external":"chevron-right"}),t)}}]),t}(v.PureComponent);b()(S,"propTypes",{className:O.a.string,displayAsLink:O.a.bool,href:O.a.string,tagName:O.a.oneOfType([O.a.func,O.a.string]).isRequired,target:O.a.string,compact:O.a.bool,highlight:O.a.oneOf([!1,"error","info","success","warning"])}),b()(S,"defaultProps",{tagName:"div",highlight:!1}),t.a=S},560:function(e,t,n){"use strict";n.d(t,"a",function(){return u});var r=n(530),a=n.n(r),o=n(10),i=n.n(o),s=n(526),c=n.n(s),l=n(559);function u(e){return i.a.createElement(l.a,a()({},e,{className:c()(e.className,"is-compact")}),e.children)}},564:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var r=n(10),a=n.n(r);n(577);function o(e){var t=e.children;return a.a.createElement("span",{className:"screen-reader-text"},t)}},577:function(e,t,n){},588:function(e,t,n){"use strict";var r=n(10),a=n.n(r),o=n(12),i=n.n(o),s=n(526),c=n.n(s),l=n(560),u=n(548),p=function(e){var t=e.heading,n=e.children;return a.a.createElement(l.a,{className:"settings-group-card"},t&&a.a.createElement(u.a,{className:"settings-group-card__heading"},t),a.a.createElement("div",{className:c()("settings-group-card__content",{"is-full-width":!t})},n))};p.propTypes={heading:i.a.node},t.a=p},592:function(e,t,n){"use strict";var r,a=n(34),o=n.n(a),i=n(36),s=n.n(i),c=n(1),l=n(46),u=Object(l.b)({},(r={},o()(r,"NOTICE_CREATE",function(e,t){var n=t.notice;return s()({},e,o()({},n.noticeId,n))}),o()(r,"NOTICE_REMOVE",function(e,t){var n=t.noticeId;return e.hasOwnProperty(n)?Object(c.omit)(e,n):e}),o()(r,"ROUTE_SET",function(e){return Object(c.reduce)(e,function(e,t,n){if(!t.isPersistent&&!t.displayOnNextPage)return e;var r=t;return r.displayOnNextPage&&(r=s()({},r,{displayOnNextPage:!1})),e[n]=r,e},{})}),r)),p=Object(l.b)({},o()({},"NOTICE_CREATE",function(e,t){var n=t.notice;return s()({},e,o()({},n.noticeId,Date.now()))}));t.a=Object(l.a)({items:u,lastTimeShown:p})},594:function(e,t,n){"use strict";var r=n(661),a=["a","strong","em","u","tt","s"],o=["target","href"];t.a=function(e){return{__html:Object(r.sanitize)(e,{ALLOWED_TAGS:a,ALLOWED_ATTR:o})}}},621:function(e,t,n){"use strict";var r=n(10),a=n.n(r),o=n(12),i=n.n(o),s=n(558),c=n(594),l=function(e){var t=e.text;return t?a.a.createElement(s.a,{dangerouslySetInnerHTML:Object(c.a)(t)}):null};l.propTypes={text:i.a.string},t.a=l},675:function(e,t,n){"use strict";n.d(t,"a",function(){return N});var r=n(107),a=n.n(r),o=n(108),i=n.n(o),s=n(528),c=n.n(s),l=n(527),u=n.n(l),p=n(531),f=n.n(p),d=n(529),m=n.n(d),h=n(34),g=n.n(h),y=n(10),b=n.n(y),v=n(12),E=n.n(v),k=n(526),T=n.n(k),w=n(1),N=function(e){function t(){var e,n;a()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=c()(this,(e=u()(t)).call.apply(e,[this].concat(o))),g()(f()(n),"onKeyDown",function(e){n.props.disabled||("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.props.onChange(!n.props.checked)),n.props.onKeyDown(e))}),g()(f()(n),"onClick",function(e){e&&e.stopPropagation&&e.stopPropagation(),n.props.disabled||n.props.onChange(!n.props.checked)}),g()(f()(n),"onLabelClick",function(e){if(!n.props.disabled){var t=e.target.nodeName.toLowerCase();"a"!==t&&"input"!==t&&"select"!==t&&(e.preventDefault(),n.props.onChange(!n.props.checked))}}),n}return m()(t,e),i()(t,[{key:"componentWillMount",value:function(){this.id=this.constructor.idNum++}},{key:"render",value:function(){var e=this.props.id||"toggle-"+this.id,t=T()("form-toggle__wrapper",this.props.wrapperClassName,{"is-disabled":this.props.disabled}),n=T()("form-toggle",this.props.className,{"is-toggling":this.props.toggling});return b.a.createElement("span",{className:t},b.a.createElement("input",{id:e,className:n,type:"checkbox",checked:this.props.checked,readOnly:!0,disabled:this.props.disabled}),b.a.createElement("label",{className:"form-toggle__label",htmlFor:e},b.a.createElement("span",{className:"form-toggle__switch",onClick:this.onClick,onKeyDown:this.onKeyDown,role:"checkbox","aria-checked":this.props.checked,"aria-label":this.props["aria-label"],tabIndex:this.props.disabled?-1:0}),this.props.children&&b.a.createElement("span",{className:"form-toggle__label-content",onClick:this.onLabelClick},this.props.children)))}}]),t}(y.PureComponent);g()(N,"propTypes",{onChange:E.a.func,onKeyDown:E.a.func,checked:E.a.bool,disabled:E.a.bool,id:E.a.string,className:E.a.string,wrapperClassName:E.a.string,toggling:E.a.bool,"aria-label":E.a.string}),g()(N,"defaultProps",{checked:!1,disabled:!1,onKeyDown:w.noop,onChange:w.noop}),g()(N,"idNum",0)},686:function(e,t,n){"use strict";n.d(t,"c",function(){return r}),n.d(t,"b",function(){return l}),n.d(t,"a",function(){return u});var r={};n.r(r),n.d(r,"labelsPrint",function(){return o}),n.d(r,"labelTestPrint",function(){return i}),n.d(r,"selfHelp",function(){return s});var a=n(75),o=function(){return"".concat("wc/v1/connect/","label/print")},i=function(){return"".concat("wc/v1/connect/","label/preview")},s=function(){return"".concat("wc/v1/connect/","self-help")},c=function(e){if(e.data.message)throw e.data.message;throw JSON.stringify(e)},l=function(e,t){return Object(a.a)().post(e,t).catch(c)},u=function(e,t){return Object(a.a)().createGetUrlWithNonce(e,t)}},767:function(e,t,n){},768:function(e,t,n){var r;r=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),a=document.createRange();a.selectNodeContents(e),r.removeAllRanges(),r.addRange(a),t=r.toString()}return t}},function(e,t){function n(){}n.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function a(){r.off(e,a),t.apply(n,arguments)}return a._=t,this.on(e,a,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,a=n.length;r<a;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],a=[];if(r&&t)for(var o=0,i=r.length;o<i;o++)r[o].fn!==t&&r[o].fn._!==t&&a.push(r[o]);return a.length?n[e]=a:delete n[e],this}},e.exports=n,e.exports.TinyEmitter=n},function(e,t,n){var r=n(3),a=n(4);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!r.string(t))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(e))return function(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}(e,t,n);if(r.nodeList(e))return function(e,t,n){return Array.prototype.forEach.call(e,function(e){e.addEventListener(t,n)}),{destroy:function(){Array.prototype.forEach.call(e,function(e){e.removeEventListener(t,n)})}}}(e,t,n);if(r.string(e))return function(e,t,n){return a(document.body,e,t,n)}(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"===typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},function(e,t,n){var r=n(5);function a(e,t,n,a,o){var i=function(e,t,n,a){return function(n){n.delegateTarget=r(n.target,t),n.delegateTarget&&a.call(e,n)}}.apply(this,arguments);return e.addEventListener(n,i,o),{destroy:function(){e.removeEventListener(n,i,o)}}}e.exports=function(e,t,n,r,o){return"function"===typeof e.addEventListener?a.apply(null,arguments):"function"===typeof n?a.bind(null,document).apply(null,arguments):("string"===typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,function(e){return a(e,t,n,r,o)}))}},function(e,t){var n=9;if("undefined"!==typeof Element&&!Element.prototype.matches){var r=Element.prototype;r.matches=r.matchesSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector||r.webkitMatchesSelector}e.exports=function(e,t){for(;e&&e.nodeType!==n;){if("function"===typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},function(e,t,n){"use strict";n.r(t);var r=n(0),a=n.n(r),o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.resolveOptions(t),this.initSelection()}return i(e,[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var e=this,t="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[t?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=a()(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=a()(this.target),this.copyText()}},{key:"copyText",value:function(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(e){if(void 0!==e){if(!e||"object"!==("undefined"===typeof e?"undefined":o(e))||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function(){return this._target}}]),e}(),c=n(1),l=n.n(c),u=n(2),p=n.n(u),f="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var m=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.resolveOptions(n),r.listenClick(e),r}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,l.a),d(t,[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"===typeof e.action?e.action:this.defaultAction,this.target="function"===typeof e.target?e.target:this.defaultTarget,this.text="function"===typeof e.text?e.text:this.defaultText,this.container="object"===f(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=p()(e,"click",function(e){return t.onClick(e)})}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new s({action:this.action(t),target:this.target(t),text:this.text(t),container:this.container,trigger:t,emitter:this})}},{key:"defaultAction",value:function(e){return h("action",e)}},{key:"defaultTarget",value:function(e){var t=h("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return h("text",e)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"===typeof e?[e]:e,n=!!document.queryCommandSupported;return t.forEach(function(e){n=n&&!!document.queryCommandSupported(e)}),n}}]),t}();function h(e,t){var n="data-clipboard-"+e;if(t.hasAttribute(n))return t.getAttribute(n)}t.default=m}]).default},e.exports=r()},769:function(e,t,n){},793:function(e,t,n){"use strict";n.r(t);var r,a=n(10),o=n.n(a),i=(n(767),n(34)),s=n.n(i),c=n(36),l=n.n(c),u=n(1),p=n.n(u),f=n(35),d=n(686),m=n(549),h=function(e){return{type:"PLUGIN_STATUS_LOGGING_TOGGLE",value:e}},g=function(e){return{type:"PLUGIN_STATUS_DEBUG_TOGGLE",value:e}},y=function(){return function(e,t){var n=t().status,r={wcc_debug_on:n.debug_enabled,wcc_logging_on:n.logging_enabled};d.b(d.c.selfHelp(),r).then(function(){return e(Object(m.d)(Object(f.translate)("Your changes have been saved."),{duration:5e3}))}).catch(function(t){p.a.isString(t)&&e(Object(m.a)(t)),p.a.isObject(t)&&e(Object(m.a)(Object(f.translate)("There was a problem when saving your preferences. Please try again.")))})}},b=(r={},s()(r,"PLUGIN_STATUS_DEBUG_TOGGLE",function(e,t){var n=t.value;return l()({},e,{debug_enabled:n})}),s()(r,"PLUGIN_STATUS_LOGGING_TOGGLE",function(e,t){var n=t.value;return l()({},e,{logging_enabled:n})}),r),v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return b[t.type]?b[t.type](e,t):e},E=n(109),k=n(30),T=n(545),w=n(554),N=n(631),_=n(558),O=n(12),x=n.n(O),S=n(534),A=n.n(S),C=n(526),j=n.n(C),L=function(e){var t,n,r=e.title,a=e.subtitle,i=e.state,s=e.message,c=e.children;switch(i){case"success":n="is-success",t="checkmark-circle";break;case"warning":n="is-warning",t="notice";break;case"error":default:n="is-error",t="notice"}return o.a.createElement(T.a,null,o.a.createElement(w.a,null,o.a.createElement("span",null,r),a?o.a.createElement("span",{className:"plugin-status__indicator-subtitle"},a):null),o.a.createElement("div",{className:j()("plugin-status__indicator",n)},o.a.createElement("div",{className:"plugin-status__indicator-icon-and-message"},o.a.createElement("div",{className:"plugin-status__indicator-icon"},o.a.createElement(A.a,{icon:t})),o.a.createElement("div",{className:"plugin-status__indicator-message"},s)),c))};L.propTypes={title:x.a.string,subtitle:x.a.string,state:x.a.string,message:x.a.string};var P=L,I=n(588),R=Object(E.b)(function(e){return{healthItems:e.status.health_items}})(Object(f.localize)(function(e){var t=e.translate,n=e.moment,r=e.healthItems,a=t("Health",{context:"This section displays the overall health of WooCommerce Services and the things it depends on"}),i=function(e,r,a){return o.a.createElement(P,{title:e,state:r.state,message:r.message},a?function(e){var r=e.timestamp,a="admin.php?page=wc-status&tab=connect&refresh=true";return r?o.a.createElement(_.a,null,t("Last updated %s. {{a}}Refresh{{/a}}",{args:n(1e3*r).fromNow(),components:{a:o.a.createElement("a",{href:a})}})):o.a.createElement(_.a,null,o.a.createElement("a",{href:a},t("Refresh")))}(r):null)};return o.a.createElement(I.a,{heading:a},i(t("WooCommerce"),r.woocommerce,!1),i(t("Jetpack"),r.jetpack,!1),i(t("WooCommerce Services Data"),r.woocommerce_services,!0))})),D=n(107),G=n.n(D),M=n(108),F=n.n(M),q=n(528),H=n.n(q),V=n(527),U=n.n(V),K=n(531),z=n.n(K),W=n(529),B=n.n(W),J=n(530),Y=n.n(J),X=n(533),Q=n.n(X),Z=n(76),$=n.n(Z),ee=n(768),te=n.n(ee),ne=n(542);function re(e){var t=e.className,n=e.text,r=e.onCopy,a=void 0===r?u.noop:r,i=Q()(e,["className","text","onCopy"]),s=o.a.useRef(),c=o.a.useRef(),l=o.a.useRef();return o.a.useEffect(function(){c.current=function(){return n},l.current=a},[n,a]),o.a.useEffect(function(){var e=$.a.findDOMNode(s.current),t=new te.a(e,{text:function(){return c.current()}});return t.on("success",function(){return l.current()}),function(){return t.destroy()}},[]),o.a.createElement(ne.a,Y()({},i,{ref:s,className:j()("clipboard-button",t)}))}re.propTypes={className:x.a.string,text:x.a.string,onCopy:x.a.func};var ae=re,oe=n(546),ie=function(e){var t=e.className,n=e.isError,r=e.isValid,a=e.children,i=Q()(e,["className","isError","isValid","children"]);return o.a.createElement("textarea",Y()({},i,{className:j()(t,"form-textarea",{"is-error":n,"is-valid":r})}),a)},se=n(590),ce=function(e){function t(){var e,n;G()(this,t);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return n=H()(this,(e=U()(t)).call.apply(e,[this].concat(a))),s()(z()(n),"onCopy",function(){var e=n.props.translate;se.a.success(e("Log tail copied to clipboard"),{duration:2e3})}),n}return B()(t,e),F()(t,[{key:"render",value:function(){var e=this.props,t=e.key,n=e.title,r=e.tail,a=e.url,i=e.count,s=e.translate,c="wcs-log-".concat(t);return o.a.createElement(T.a,null,o.a.createElement(oe.a,{htmlFor:c},n),o.a.createElement(ie,{id:c,name:c,readOnly:!0,value:r}),o.a.createElement(_.a,{className:"plugin-status__log-explanation"},o.a.createElement("span",{className:"plugin-status__log-explanation-span"},s("Last %s entry. {{a}}Show full log{{/a}}","Last %s entries. {{a}}Show full log{{/a}}",{args:[i],count:i,components:{a:o.a.createElement("a",{href:a})}})),o.a.createElement(ae,{text:r,onCopy:this.onCopy,compact:!0},s("Copy for support"))))}}]),t}(a.Component);ce.propTypes={title:x.a.string,logKey:x.a.string};var le=Object(E.b)(function(e,t){var n=t.logKey;return e.status.logs[n]})(Object(f.localize)(ce)),ue=Object(E.b)(function(e){return{services:e.status.services}})(Object(f.localize)(function(e){var t=e.translate,n=e.moment,r=e.services;if(!1===r)return null;var a=function(e,r){return o.a.createElement(P,{key:r,title:e.title,subtitle:e.subtitle,state:e.state,message:e.message},function(e){var r=e.timestamp,a=e.url;return r>0?o.a.createElement(_.a,null,t("Request was made %s - check logs below or {{a}}edit service settings{{/a}}",{args:n(1e3*r).fromNow(),components:{a:o.a.createElement("a",{href:a})}})):o.a.createElement(_.a,null,o.a.createElement("a",{href:a},t("Edit service settings")))}(e))};return o.a.createElement(I.a,{heading:t("Services")},r.length?r.map(a):o.a.createElement(_.a,null,t("No services configured. {{a}}Add a shipping service{{/a}}",{components:{a:o.a.createElement("a",{href:"admin.php?page=wc-settings&tab=shipping"})}})))})),pe=(n(769),n(675)),fe=function(e){var t=e.className,n=e.children,r=Q()(e,["className","children"]);return o.a.createElement(pe.a,Y()({},r,{className:j()(t,"is-compact")}),n)},de=n(621),me=n(661),he=function(e){return{__html:Object(me.sanitize)(e,{ALLOWED_TAGS:["a","strong","em","u","tt","s"],ALLOWED_ATTR:["target","href"]})}},ge=function(e){function t(){var e,n;G()(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=H()(this,(e=U()(t)).call.apply(e,[this].concat(a))),s()(z()(n),"renderToggleText",function(e){return e?o.a.createElement("span",{className:"toggle__text",dangerouslySetInnerHTML:he(e)}):null}),s()(z()(n),"handleChangeEvent",function(){var e=n.props,t=e.updateValue,r=e.checked,a=e.saveForm,o=e.saveOnToggle;t(!r),o&&a&&a()}),n}return B()(t,e),F()(t,[{key:"render",value:function(){var e=this.props,t=e.id,n=e.title,r=e.description,a=e.trueText,i=e.falseText,s=e.checked,c=e.placeholder,l=e.className;return o.a.createElement(T.a,{className:l},o.a.createElement(oe.a,{htmlFor:t,dangerouslySetInnerHTML:he(n)}),o.a.createElement(fe,{id:t,name:t,placeholder:c,checked:s,onChange:this.handleChangeEvent}),this.renderToggleText(s?a:i),o.a.createElement(de.a,{text:r}))}}]),t}(a.Component);s()(ge,"propTypes",{id:x.a.string.isRequired,title:x.a.string,description:x.a.string,trueText:x.a.string.isRequired,falseText:x.a.string.isRequired,saveOnToggle:x.a.bool,checked:x.a.bool,saveForm:x.a.func,updateValue:x.a.func,className:x.a.string}),s()(ge,"defaultProps",{checked:!1});var ye=ge,be=Object(E.b)(function(e){return{loggingEnabled:Boolean(e.status.logging_enabled),debugEnabled:Boolean(e.status.debug_enabled)}},function(e){return{actions:Object(k.b)({toggleLogging:h,toggleDebug:g,save:y},e)}})(Object(f.localize)(function(e){var t=e.actions,n=e.loggingEnabled,r=e.debugEnabled,a=e.translate;return o.a.createElement("div",null,o.a.createElement(N.a,{id:"notices",notices:se.a.list}),o.a.createElement(R,null),o.a.createElement(ue,null),o.a.createElement(I.a,{heading:a("Debug")},o.a.createElement(ye,{id:"wcs-toggle-debug",checked:r,title:a("Debug"),description:a("Display troubleshooting information on the Cart and Checkout pages."),trueText:a("Enabled"),falseText:a("Disabled"),saveOnToggle:!0,saveForm:t.save,updateValue:t.toggleDebug}),o.a.createElement(ye,{id:"wcs-toggle-logging",checked:n,title:a("Logging"),description:a("Write diagnostic messages to log files. Helpful when contacting support."),trueText:a("Enabled"),falseText:a("Disabled"),saveOnToggle:!0,saveForm:t.save,updateValue:t.toggleLogging}),o.a.createElement(le,{logKey:"shipping",title:a("Shipping Log")}),o.a.createElement(le,{logKey:"taxes",title:a("Taxes Log")}),o.a.createElement(le,{logKey:"other",title:a("Other Log")})),o.a.createElement(I.a,{heading:a("Support")},o.a.createElement(T.a,null,o.a.createElement(w.a,null,a("Need help?")),o.a.createElement("p",{className:"plugin-status__help-description"},a("Our team is here for you. View our {{docsA}}support docs{{/docsA}} or {{ticketA}}open a support ticket{{/ticketA}}.",{components:{docsA:o.a.createElement("a",{href:"https://docs.woocommerce.com/document/woocommerce-services/",target:"_blank",rel:"noopener noreferrer"}),ticketA:o.a.createElement("a",{href:"https://woocommerce.com/my-account/create-a-ticket/",target:"_blank",rel:"noopener noreferrer"})}})))))})),ve=n(592),Ee=n(46);t.default=function(e){var t=e.formData;return{getReducer:function(){return Object(Ee.a)({status:v,notices:ve.a})},getInitialState:function(){return{status:t}},getStateForPersisting:function(){return null},getStateKey:function(){return"wcs-admin-status"},View:function(){return o.a.createElement(be,null)}}}}}]);
|
1 |
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[148],{542:function(e,t,n){"use strict";n.d(t,"a",function(){return _});var r=n(530),a=n.n(r),i=n(533),o=n.n(i),s=n(107),c=n.n(s),l=n(108),u=n.n(l),p=n(528),f=n.n(p),d=n(527),h=n.n(d),m=n(529),g=n.n(m),y=n(34),b=n.n(y),v=n(10),E=n.n(v),k=n(12),T=n.n(k),w=n(526),N=n.n(w),_=function(e){function t(){return c()(this,t),f()(this,h()(t).apply(this,arguments))}return g()(t,e),u()(t,[{key:"render",value:function(){var e=N()("button",this.props.className,{"is-compact":this.props.compact,"is-primary":this.props.primary,"is-scary":this.props.scary,"is-busy":this.props.busy,"is-borderless":this.props.borderless});if(this.props.href){var t=this.props,n=(t.compact,t.primary,t.scary,t.busy,t.borderless,t.type,o()(t,["compact","primary","scary","busy","borderless","type"])),r=n.target?(n.rel||"").replace(/noopener|noreferrer/g,"")+" noopener noreferrer":n.rel;return E.a.createElement("a",a()({},n,{rel:r,className:e}))}var i=this.props,s=(i.compact,i.primary,i.scary,i.busy,i.borderless,i.target,i.rel,o()(i,["compact","primary","scary","busy","borderless","target","rel"]));return E.a.createElement("button",a()({},s,{className:e}))}}]),t}(v.PureComponent);b()(_,"propTypes",{compact:T.a.bool,primary:T.a.bool,scary:T.a.bool,busy:T.a.bool,type:T.a.string,href:T.a.string,borderless:T.a.bool,target:T.a.string,rel:T.a.string}),b()(_,"defaultProps",{type:"button"})},544:function(e,t,n){"use strict";n.d(t,"a",function(){return l});var r=n(1),a=n(606),i=n.n(a),o=(n(112),function(e){return e}),s=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.join()},c=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return e.map(function(e){return e.apply(void 0,[t].concat(r))})}};function l(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s,l=Object(r.memoize)(e,a);return Array.isArray(n)&&(n=c(n)),Object.assign(function(e){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];var s=n.apply(void 0,[e].concat(a));return Array.isArray(s)||(s=[s]),t&&!i()(s,t)&&l.cache.clear(),t=s,l.apply(void 0,[e].concat(a))},{memoizedSelector:l})}},545:function(e,t,n){"use strict";var r=n(530),a=n.n(r),i=n(533),o=n.n(i),s=n(10),c=n.n(s),l=n(526),u=n.n(l);t.a=function(e){var t=e.className,n=e.children,r=o()(e,["className","children"]);return c.a.createElement("fieldset",a()({},r,{className:u()(t,"form-fieldset")}),n)}},546:function(e,t,n){"use strict";var r=n(530),a=n.n(r),i=n(533),o=n.n(i),s=n(36),c=n.n(s),l=n(10),u=n.n(l),p=n(12),f=n.n(p),d=n(526),h=n.n(d),m=n(35),g=n(1),y=function(e){var t=e.children,n=e.required,r=e.optional,i=e.translate,s=e.className,l=o()(e,["children","required","optional","translate","className"]);return t=u.a.Children.toArray(t)||[],n&&t.push(function(e){return u.a.createElement("small",{className:"form-label__required"},e("Required"))}(i)),r&&t.push(function(e){return u.a.createElement("small",{className:"form-label__optional"},e("Optional"))}(i)),u.a.createElement("label",a()({},Object(g.omit)(l,"moment","numberFormat"),{className:h()(s,"form-label")}),t.length?t.map(function(e,t){return Object(g.isObject)(e)?c()({},e,{key:t}):e}):null)};y.propTypes={required:f.a.bool},t.a=Object(m.localize)(y)},548:function(e,t,n){"use strict";var r=n(530),a=n.n(r),i=n(533),o=n.n(i),s=n(10),c=n.n(s),l=n(526),u=n.n(l);t.a=function(e){var t=e.className,n=e.children,r=o()(e,["className","children"]);return c.a.createElement("h3",a()({},r,{className:u()(t,"form-section-heading")}),n)}},549:function(e,t,n){"use strict";n.d(t,"c",function(){return c}),n.d(t,"d",function(){return u}),n.d(t,"a",function(){return p}),n.d(t,"b",function(){return f});var r=n(533),a=n.n(r),i=n(1),o={debounce:i.debounce,isPlainObject:i.isPlainObject,uniqueId:i.uniqueId},s=(n(46),o.uniqueId);function c(e){return{noticeId:e,type:"NOTICE_REMOVE"}}function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.id,i=a()(n,["id"]);return{type:"NOTICE_CREATE",notice:Object.assign({showDismiss:!0},i,{noticeId:r||s(),status:e,text:t})}}var u=l.bind(null,"is-success"),p=l.bind(null,"is-error"),f=l.bind(null,"is-info");l.bind(null,"is-warning"),l.bind(null,"is-plain")},554:function(e,t,n){"use strict";var r=n(530),a=n.n(r),i=n(533),o=n.n(i),s=n(10),c=n.n(s),l=n(526),u=n.n(l);t.a=function(e){var t=e.className,n=e.children,r=o()(e,["className","children"]);return c.a.createElement("legend",a()({},r,{className:u()(t,"form-legend")}),n)}},558:function(e,t,n){"use strict";n.d(t,"a",function(){return N});var r=n(530),a=n.n(r),i=n(107),o=n.n(i),s=n(108),c=n.n(s),l=n(528),u=n.n(l),p=n(527),f=n.n(p),d=n(529),h=n.n(d),m=n(34),g=n.n(m),y=n(10),b=n.n(y),v=n(12),E=n.n(v),k=n(526),T=n.n(k),w=n(1),N=function(e){function t(){return o()(this,t),u()(this,f()(t).apply(this,arguments))}return h()(t,e),c()(t,[{key:"render",value:function(){var e=T()(this.props.className,"form-setting-explanation",{"no-validate":this.props.noValidate,"is-indented":this.props.isIndented});return b.a.createElement("p",a()({},Object(w.omit)(this.props,"className","noValidate","isIndented"),{className:e}),this.props.children)}}]),t}(b.a.Component);g()(N,"displayName","FormSettingExplanation"),g()(N,"propTypes",{noValidate:E.a.bool,isIndented:E.a.bool,className:E.a.string}),g()(N,"defaultProps",{noValidate:!1,isIndented:!1})},559:function(e,t,n){"use strict";var r=n(530),a=n.n(r),i=n(533),o=n.n(i),s=n(107),c=n.n(s),l=n(108),u=n.n(l),p=n(528),f=n.n(p),d=n(527),h=n.n(d),m=n(529),g=n.n(m),y=n(34),b=n.n(y),v=n(10),E=n.n(v),k=n(526),T=n.n(k),w=n(534),N=n.n(w),_=n(12),O=n.n(_),x=function(e){var t=e.className,n=e.compact,r=e.displayAsLink,a=e.highlight,i=e.href,o=e.onClick;return T()("card",t,{"is-card-link":r||!!i,"is-clickable":!!o,"is-compact":n,"is-highlight":a},!!a&&"is-"+a)},S=function(e){function t(){return c()(this,t),f()(this,h()(t).apply(this,arguments))}return g()(t,e),u()(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=(e.compact,e.displayAsLink),r=(e.highlight,e.tagName),i=e.href,s=e.target,c=o()(e,["children","compact","displayAsLink","highlight","tagName","href","target"]);return i?E.a.createElement("a",a()({},c,{href:i,target:s,className:x(this.props)}),E.a.createElement(N.a,{className:"card__link-indicator",icon:s?"external":"chevron-right"}),t):E.a.createElement(r,a()({},c,{className:x(this.props)}),n&&E.a.createElement(N.a,{className:"card__link-indicator",icon:s?"external":"chevron-right"}),t)}}]),t}(v.PureComponent);b()(S,"propTypes",{className:O.a.string,displayAsLink:O.a.bool,href:O.a.string,tagName:O.a.oneOfType([O.a.func,O.a.string]).isRequired,target:O.a.string,compact:O.a.bool,highlight:O.a.oneOf([!1,"error","info","success","warning"])}),b()(S,"defaultProps",{tagName:"div",highlight:!1}),t.a=S},560:function(e,t,n){"use strict";n.d(t,"a",function(){return u});var r=n(530),a=n.n(r),i=n(10),o=n.n(i),s=n(526),c=n.n(s),l=n(559);function u(e){return o.a.createElement(l.a,a()({},e,{className:c()(e.className,"is-compact")}),e.children)}},564:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(10),a=n.n(r);n(577);function i(e){var t=e.children;return a.a.createElement("span",{className:"screen-reader-text"},t)}},577:function(e,t,n){},588:function(e,t,n){"use strict";var r=n(10),a=n.n(r),i=n(12),o=n.n(i),s=n(526),c=n.n(s),l=n(560),u=n(548),p=function(e){var t=e.heading,n=e.children;return a.a.createElement(l.a,{className:"settings-group-card"},t&&a.a.createElement(u.a,{className:"settings-group-card__heading"},t),a.a.createElement("div",{className:c()("settings-group-card__content",{"is-full-width":!t})},n))};p.propTypes={heading:o.a.node},t.a=p},592:function(e,t,n){"use strict";var r,a=n(34),i=n.n(a),o=n(36),s=n.n(o),c=n(1),l=n(46),u=Object(l.b)({},(r={},i()(r,"NOTICE_CREATE",function(e,t){var n=t.notice;return s()({},e,i()({},n.noticeId,n))}),i()(r,"NOTICE_REMOVE",function(e,t){var n=t.noticeId;return e.hasOwnProperty(n)?Object(c.omit)(e,n):e}),i()(r,"ROUTE_SET",function(e){return Object(c.reduce)(e,function(e,t,n){if(!t.isPersistent&&!t.displayOnNextPage)return e;var r=t;return r.displayOnNextPage&&(r=s()({},r,{displayOnNextPage:!1})),e[n]=r,e},{})}),r)),p=Object(l.b)({},i()({},"NOTICE_CREATE",function(e,t){var n=t.notice;return s()({},e,i()({},n.noticeId,Date.now()))}));t.a=Object(l.a)({items:u,lastTimeShown:p})},594:function(e,t,n){"use strict";var r=n(661),a=["a","strong","em","u","tt","s"],i=["target","href"];t.a=function(e){return{__html:Object(r.sanitize)(e,{ALLOWED_TAGS:a,ALLOWED_ATTR:i})}}},621:function(e,t,n){"use strict";var r=n(10),a=n.n(r),i=n(12),o=n.n(i),s=n(558),c=n(594),l=function(e){var t=e.text;return t?a.a.createElement(s.a,{dangerouslySetInnerHTML:Object(c.a)(t)}):null};l.propTypes={text:o.a.string},t.a=l},675:function(e,t,n){"use strict";n.d(t,"a",function(){return N});var r=n(107),a=n.n(r),i=n(108),o=n.n(i),s=n(528),c=n.n(s),l=n(527),u=n.n(l),p=n(531),f=n.n(p),d=n(529),h=n.n(d),m=n(34),g=n.n(m),y=n(10),b=n.n(y),v=n(12),E=n.n(v),k=n(526),T=n.n(k),w=n(1),N=function(e){function t(){var e,n;a()(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=c()(this,(e=u()(t)).call.apply(e,[this].concat(i))),g()(f()(n),"onKeyDown",function(e){n.props.disabled||("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.props.onChange(!n.props.checked)),n.props.onKeyDown(e))}),g()(f()(n),"onClick",function(e){e&&e.stopPropagation&&e.stopPropagation(),n.props.disabled||n.props.onChange(!n.props.checked)}),g()(f()(n),"onLabelClick",function(e){if(!n.props.disabled){var t=e.target.nodeName.toLowerCase();"a"!==t&&"input"!==t&&"select"!==t&&(e.preventDefault(),n.props.onChange(!n.props.checked))}}),n}return h()(t,e),o()(t,[{key:"componentWillMount",value:function(){this.id=this.constructor.idNum++}},{key:"render",value:function(){var e=this.props.id||"toggle-"+this.id,t=T()("form-toggle__wrapper",this.props.wrapperClassName,{"is-disabled":this.props.disabled}),n=T()("form-toggle",this.props.className,{"is-toggling":this.props.toggling});return b.a.createElement("span",{className:t},b.a.createElement("input",{id:e,className:n,type:"checkbox",checked:this.props.checked,readOnly:!0,disabled:this.props.disabled}),b.a.createElement("label",{className:"form-toggle__label",htmlFor:e},b.a.createElement("span",{className:"form-toggle__switch",onClick:this.onClick,onKeyDown:this.onKeyDown,role:"checkbox","aria-checked":this.props.checked,"aria-label":this.props["aria-label"],tabIndex:this.props.disabled?-1:0}),this.props.children&&b.a.createElement("span",{className:"form-toggle__label-content",onClick:this.onLabelClick},this.props.children)))}}]),t}(y.PureComponent);g()(N,"propTypes",{onChange:E.a.func,onKeyDown:E.a.func,checked:E.a.bool,disabled:E.a.bool,id:E.a.string,className:E.a.string,wrapperClassName:E.a.string,toggling:E.a.bool,"aria-label":E.a.string}),g()(N,"defaultProps",{checked:!1,disabled:!1,onKeyDown:w.noop,onChange:w.noop}),g()(N,"idNum",0)},686:function(e,t,n){"use strict";n.d(t,"c",function(){return r}),n.d(t,"b",function(){return l}),n.d(t,"a",function(){return u});var r={};n.r(r),n.d(r,"labelsPrint",function(){return i}),n.d(r,"labelTestPrint",function(){return o}),n.d(r,"selfHelp",function(){return s});var a=n(75),i=function(){return"".concat("wc/v1/connect/","label/print")},o=function(){return"".concat("wc/v1/connect/","label/preview")},s=function(){return"".concat("wc/v1/connect/","self-help")},c=function(e){if(e.data.message)throw e.data.message;throw JSON.stringify(e)},l=function(e,t){return Object(a.a)().post(e,t).catch(c)},u=function(e,t){return Object(a.a)().createGetUrlWithNonce(e,t)}},767:function(e,t,n){},768:function(e,t,n){var r;r=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),a=document.createRange();a.selectNodeContents(e),r.removeAllRanges(),r.addRange(a),t=r.toString()}return t}},function(e,t){function n(){}n.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function a(){r.off(e,a),t.apply(n,arguments)}return a._=t,this.on(e,a,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,a=n.length;r<a;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],a=[];if(r&&t)for(var i=0,o=r.length;i<o;i++)r[i].fn!==t&&r[i].fn._!==t&&a.push(r[i]);return a.length?n[e]=a:delete n[e],this}},e.exports=n,e.exports.TinyEmitter=n},function(e,t,n){var r=n(3),a=n(4);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!r.string(t))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(e))return function(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}(e,t,n);if(r.nodeList(e))return function(e,t,n){return Array.prototype.forEach.call(e,function(e){e.addEventListener(t,n)}),{destroy:function(){Array.prototype.forEach.call(e,function(e){e.removeEventListener(t,n)})}}}(e,t,n);if(r.string(e))return function(e,t,n){return a(document.body,e,t,n)}(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"===typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},function(e,t,n){var r=n(5);function a(e,t,n,a,i){var o=function(e,t,n,a){return function(n){n.delegateTarget=r(n.target,t),n.delegateTarget&&a.call(e,n)}}.apply(this,arguments);return e.addEventListener(n,o,i),{destroy:function(){e.removeEventListener(n,o,i)}}}e.exports=function(e,t,n,r,i){return"function"===typeof e.addEventListener?a.apply(null,arguments):"function"===typeof n?a.bind(null,document).apply(null,arguments):("string"===typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,function(e){return a(e,t,n,r,i)}))}},function(e,t){var n=9;if("undefined"!==typeof Element&&!Element.prototype.matches){var r=Element.prototype;r.matches=r.matchesSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector||r.webkitMatchesSelector}e.exports=function(e,t){for(;e&&e.nodeType!==n;){if("function"===typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},function(e,t,n){"use strict";n.r(t);var r=n(0),a=n.n(r),i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.resolveOptions(t),this.initSelection()}return o(e,[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var e=this,t="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[t?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=a()(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=a()(this.target),this.copyText()}},{key:"copyText",value:function(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(e){if(void 0!==e){if(!e||"object"!==("undefined"===typeof e?"undefined":i(e))||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function(){return this._target}}]),e}(),c=n(1),l=n.n(c),u=n(2),p=n.n(u),f="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var h=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.resolveOptions(n),r.listenClick(e),r}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,l.a),d(t,[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"===typeof e.action?e.action:this.defaultAction,this.target="function"===typeof e.target?e.target:this.defaultTarget,this.text="function"===typeof e.text?e.text:this.defaultText,this.container="object"===f(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=p()(e,"click",function(e){return t.onClick(e)})}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new s({action:this.action(t),target:this.target(t),text:this.text(t),container:this.container,trigger:t,emitter:this})}},{key:"defaultAction",value:function(e){return m("action",e)}},{key:"defaultTarget",value:function(e){var t=m("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return m("text",e)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"===typeof e?[e]:e,n=!!document.queryCommandSupported;return t.forEach(function(e){n=n&&!!document.queryCommandSupported(e)}),n}}]),t}();function m(e,t){var n="data-clipboard-"+e;if(t.hasAttribute(n))return t.getAttribute(n)}t.default=h}]).default},e.exports=r()},769:function(e,t,n){},793:function(e,t,n){"use strict";n.r(t);var r,a=n(10),i=n.n(a),o=(n(767),n(34)),s=n.n(o),c=n(36),l=n.n(c),u=n(1),p=n.n(u),f=n(35),d=n(686),h=n(549),m=function(e){return{type:"PLUGIN_STATUS_LOGGING_TOGGLE",value:e}},g=function(e){return{type:"PLUGIN_STATUS_DEBUG_TOGGLE",value:e}},y=function(){return function(e,t){var n=t().status,r={wcc_debug_on:n.debug_enabled,wcc_logging_on:n.logging_enabled};d.b(d.c.selfHelp(),r).then(function(){return e(Object(h.d)(Object(f.translate)("Your changes have been saved."),{duration:5e3}))}).catch(function(t){p.a.isString(t)&&e(Object(h.a)(t)),p.a.isObject(t)&&e(Object(h.a)(Object(f.translate)("There was a problem when saving your preferences. Please try again.")))})}},b=(r={},s()(r,"PLUGIN_STATUS_DEBUG_TOGGLE",function(e,t){var n=t.value;return l()({},e,{debug_enabled:n})}),s()(r,"PLUGIN_STATUS_LOGGING_TOGGLE",function(e,t){var n=t.value;return l()({},e,{logging_enabled:n})}),r),v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return b[t.type]?b[t.type](e,t):e},E=n(109),k=n(30),T=n(545),w=n(554),N=n(631),_=n(558),O=n(12),x=n.n(O),S=n(534),A=n.n(S),C=n(526),j=n.n(C),L=function(e){var t,n,r=e.title,a=e.subtitle,o=e.state,s=e.message,c=e.children;switch(o){case"success":n="is-success",t="checkmark-circle";break;case"warning":n="is-warning",t="notice";break;case"error":default:n="is-error",t="notice"}return i.a.createElement(T.a,null,i.a.createElement(w.a,null,i.a.createElement("span",null,r),a?i.a.createElement("span",{className:"plugin-status__indicator-subtitle"},a):null),i.a.createElement("div",{className:j()("plugin-status__indicator",n)},i.a.createElement("div",{className:"plugin-status__indicator-icon-and-message"},i.a.createElement("div",{className:"plugin-status__indicator-icon"},i.a.createElement(A.a,{icon:t})),i.a.createElement("div",{className:"plugin-status__indicator-message"},s)),c))};L.propTypes={title:x.a.string,subtitle:x.a.string,state:x.a.string,message:x.a.string};var P=L,I=n(588),R=Object(E.b)(function(e){return{healthItems:e.status.health_items}})(Object(f.localize)(function(e){var t=e.translate,n=e.moment,r=e.healthItems,a=t("Health",{context:"This section displays the overall health of WooCommerce Shipping & Tax and the things it depends on"}),o=function(e,r,a){return i.a.createElement(P,{title:e,state:r.state,message:r.message},a?function(e){var r=e.timestamp,a="admin.php?page=wc-status&tab=connect&refresh=true";return r?i.a.createElement(_.a,null,t("Last updated %s. {{a}}Refresh{{/a}}",{args:n(1e3*r).fromNow(),components:{a:i.a.createElement("a",{href:a})}})):i.a.createElement(_.a,null,i.a.createElement("a",{href:a},t("Refresh")))}(r):null)};return i.a.createElement(I.a,{heading:a},o(t("WooCommerce"),r.woocommerce,!1),o(t("Jetpack"),r.jetpack,!1),o(t("WooCommerce Shipping & Tax Data"),r.woocommerce_services,!0))})),D=n(107),G=n.n(D),M=n(108),F=n.n(M),q=n(528),H=n.n(q),V=n(527),U=n.n(V),K=n(531),z=n.n(K),W=n(529),B=n.n(W),J=n(530),Y=n.n(J),X=n(533),Q=n.n(X),Z=n(76),$=n.n(Z),ee=n(768),te=n.n(ee),ne=n(542);function re(e){var t=e.className,n=e.text,r=e.onCopy,a=void 0===r?u.noop:r,o=Q()(e,["className","text","onCopy"]),s=i.a.useRef(),c=i.a.useRef(),l=i.a.useRef();return i.a.useEffect(function(){c.current=function(){return n},l.current=a},[n,a]),i.a.useEffect(function(){var e=$.a.findDOMNode(s.current),t=new te.a(e,{text:function(){return c.current()}});return t.on("success",function(){return l.current()}),function(){return t.destroy()}},[]),i.a.createElement(ne.a,Y()({},o,{ref:s,className:j()("clipboard-button",t)}))}re.propTypes={className:x.a.string,text:x.a.string,onCopy:x.a.func};var ae=re,ie=n(546),oe=function(e){var t=e.className,n=e.isError,r=e.isValid,a=e.children,o=Q()(e,["className","isError","isValid","children"]);return i.a.createElement("textarea",Y()({},o,{className:j()(t,"form-textarea",{"is-error":n,"is-valid":r})}),a)},se=n(590),ce=function(e){function t(){var e,n;G()(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=H()(this,(e=U()(t)).call.apply(e,[this].concat(a))),s()(z()(n),"onCopy",function(){var e=n.props.translate;se.a.success(e("Log tail copied to clipboard"),{duration:2e3})}),n}return B()(t,e),F()(t,[{key:"render",value:function(){var e=this.props,t=e.key,n=e.title,r=e.tail,a=e.url,o=e.count,s=e.translate,c="wcs-log-".concat(t);return i.a.createElement(T.a,null,i.a.createElement(ie.a,{htmlFor:c},n),i.a.createElement(oe,{id:c,name:c,readOnly:!0,value:r}),i.a.createElement(_.a,{className:"plugin-status__log-explanation"},i.a.createElement("span",{className:"plugin-status__log-explanation-span"},s("Last %s entry. {{a}}Show full log{{/a}}","Last %s entries. {{a}}Show full log{{/a}}",{args:[o],count:o,components:{a:i.a.createElement("a",{href:a})}})),i.a.createElement(ae,{text:r,onCopy:this.onCopy,compact:!0},s("Copy for support"))))}}]),t}(a.Component);ce.propTypes={title:x.a.string,logKey:x.a.string};var le=Object(E.b)(function(e,t){var n=t.logKey;return e.status.logs[n]})(Object(f.localize)(ce)),ue=Object(E.b)(function(e){return{services:e.status.services}})(Object(f.localize)(function(e){var t=e.translate,n=e.moment,r=e.services;if(!1===r)return null;var a=function(e,r){return i.a.createElement(P,{key:r,title:e.title,subtitle:e.subtitle,state:e.state,message:e.message},function(e){var r=e.timestamp,a=e.url;return r>0?i.a.createElement(_.a,null,t("Request was made %s - check logs below or {{a}}edit service settings{{/a}}",{args:n(1e3*r).fromNow(),components:{a:i.a.createElement("a",{href:a})}})):i.a.createElement(_.a,null,i.a.createElement("a",{href:a},t("Edit service settings")))}(e))};return i.a.createElement(I.a,{heading:t("Services")},r.length?r.map(a):i.a.createElement(_.a,null,t("No services configured. {{a}}Add a shipping service{{/a}}",{components:{a:i.a.createElement("a",{href:"admin.php?page=wc-settings&tab=shipping"})}})))})),pe=(n(769),n(675)),fe=function(e){var t=e.className,n=e.children,r=Q()(e,["className","children"]);return i.a.createElement(pe.a,Y()({},r,{className:j()(t,"is-compact")}),n)},de=n(621),he=n(661),me=function(e){return{__html:Object(he.sanitize)(e,{ALLOWED_TAGS:["a","strong","em","u","tt","s"],ALLOWED_ATTR:["target","href"]})}},ge=function(e){function t(){var e,n;G()(this,t);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return n=H()(this,(e=U()(t)).call.apply(e,[this].concat(a))),s()(z()(n),"renderToggleText",function(e){return e?i.a.createElement("span",{className:"toggle__text",dangerouslySetInnerHTML:me(e)}):null}),s()(z()(n),"handleChangeEvent",function(){var e=n.props,t=e.updateValue,r=e.checked,a=e.saveForm,i=e.saveOnToggle;t(!r),i&&a&&a()}),n}return B()(t,e),F()(t,[{key:"render",value:function(){var e=this.props,t=e.id,n=e.title,r=e.description,a=e.trueText,o=e.falseText,s=e.checked,c=e.placeholder,l=e.className;return i.a.createElement(T.a,{className:l},i.a.createElement(ie.a,{htmlFor:t,dangerouslySetInnerHTML:me(n)}),i.a.createElement(fe,{id:t,name:t,placeholder:c,checked:s,onChange:this.handleChangeEvent}),this.renderToggleText(s?a:o),i.a.createElement(de.a,{text:r}))}}]),t}(a.Component);s()(ge,"propTypes",{id:x.a.string.isRequired,title:x.a.string,description:x.a.string,trueText:x.a.string.isRequired,falseText:x.a.string.isRequired,saveOnToggle:x.a.bool,checked:x.a.bool,saveForm:x.a.func,updateValue:x.a.func,className:x.a.string}),s()(ge,"defaultProps",{checked:!1});var ye=ge,be=Object(E.b)(function(e){return{loggingEnabled:Boolean(e.status.logging_enabled),debugEnabled:Boolean(e.status.debug_enabled)}},function(e){return{actions:Object(k.b)({toggleLogging:m,toggleDebug:g,save:y},e)}})(Object(f.localize)(function(e){var t=e.actions,n=e.loggingEnabled,r=e.debugEnabled,a=e.translate;return i.a.createElement("div",null,i.a.createElement(N.a,{id:"notices",notices:se.a.list}),i.a.createElement(R,null),i.a.createElement(ue,null),i.a.createElement(I.a,{heading:a("Debug")},i.a.createElement(ye,{id:"wcs-toggle-debug",checked:r,title:a("Debug"),description:a("Display troubleshooting information on the Cart and Checkout pages."),trueText:a("Enabled"),falseText:a("Disabled"),saveOnToggle:!0,saveForm:t.save,updateValue:t.toggleDebug}),i.a.createElement(ye,{id:"wcs-toggle-logging",checked:n,title:a("Logging"),description:a("Write diagnostic messages to log files. Helpful when contacting support."),trueText:a("Enabled"),falseText:a("Disabled"),saveOnToggle:!0,saveForm:t.save,updateValue:t.toggleLogging}),i.a.createElement(le,{logKey:"shipping",title:a("Shipping Log")}),i.a.createElement(le,{logKey:"taxes",title:a("Taxes Log")}),i.a.createElement(le,{logKey:"other",title:a("Other Log")})),i.a.createElement(I.a,{heading:a("Support")},i.a.createElement(T.a,null,i.a.createElement(w.a,null,a("Need help?")),i.a.createElement("p",{className:"plugin-status__help-description"},a("Our team is here for you. View our {{docsA}}support docs{{/docsA}} or {{ticketA}}open a support ticket{{/ticketA}}.",{components:{docsA:i.a.createElement("a",{href:"https://docs.woocommerce.com/document/woocommerce-services/",target:"_blank",rel:"noopener noreferrer"}),ticketA:i.a.createElement("a",{href:"https://woocommerce.com/my-account/create-a-ticket/",target:"_blank",rel:"noopener noreferrer"})}})))))})),ve=n(592),Ee=n(46);t.default=function(e){var t=e.formData;return{getReducer:function(){return Object(Ee.a)({status:v,notices:ve.a})},getInitialState:function(){return{status:t}},getStateForPersisting:function(){return null},getStateKey:function(){return"wcs-admin-status"},View:function(){return i.a.createElement(be,null)}}}}}]);
|
dist/chunks/{e00b4c31a2566d6025f4.css → 45b16821d45485e02d04.css}
RENAMED
File without changes
|
dist/chunks/{e00b4c31a2566d6025f4.min.js → 45b16821d45485e02d04.min.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[154],{601:function(e,t,n){"use strict";var i=n(107),o=n.n(i),a=n(108),r=n.n(a),s=n(528),l=n.n(s),c=n(527),u=n.n(c),d=n(529),p=n.n(d),m=n(34),h=n.n(m),f=n(10),b=n.n(f),g=n(12),v=n.n(g),y=n(526),k=n.n(y),E=n(1),w=n(534),C=n.n(w),R=(n(629),function(e){function t(){return o()(this,t),l()(this,u()(t).apply(this,arguments))}return p()(t,e),r()(t,[{key:"render",value:function(){var e=k()("external-link",this.props.className,{"icon-first":!!this.props.showIconFirst},{"has-icon":!!this.props.icon}),t=Object(E.assign)({},Object(E.omit)(this.props,"icon","iconSize","showIconFirst","iconClassName"),{className:e,rel:"external"});t.target&&(t.rel=t.rel.concat(" noopener noreferrer"));var n=b.a.createElement(C.a,{className:this.props.iconClassName,icon:"external",size:this.props.iconSize});return b.a.createElement("a",t,this.props.icon&&this.props.showIconFirst&&n,this.props.children,this.props.icon&&!this.props.showIconFirst&&n)}}]),t}(f.Component));h()(R,"defaultProps",{iconSize:18,showIconFirst:!1}),h()(R,"propTypes",{className:v.a.string,href:v.a.string,onClick:v.a.func,icon:v.a.bool,iconSize:v.a.number,target:v.a.string,showIconFirst:v.a.bool,iconClassName:v.a.string}),t.a=R},629:function(e,t,n){},632:function(e,t,n){"use strict";var i=n(107),o=n.n(i),a=n(108),r=n.n(a),s=n(528),l=n.n(s),c=n(527),u=n.n(c),d=n(531),p=n.n(d),m=n(529),h=n.n(m),f=n(34),b=n.n(f),g=n(12),v=n.n(g),y=n(10),k=n.n(y),E=n(76),w=n.n(E),C=n(109),R=n(47),N=n.n(R),_=n(526),I=n.n(_),D=n(662),O=n.n(D),P=n(1),x=n(628),j=n(78),T=n.n(j),q=n(672),L=n.n(q),S=N()("calypso:popover:util");function M(){var e={};return e.top=window.scrollY,e.left=window.scrollX,e.width=window.innerWidth,e.height=window.innerHeight,e.right=e.left+e.width,e.bottom=e.top+e.height,S("viewport: %o",e),e}var z={top:"bottom",bottom:"top",left:"right",right:"left"},A={top:"right",left:"top",bottom:"left",right:"bottom"},V=M();function F(){V=M()}var B=!1,H=function(){if(B)return S("window events already bound");B=!0,S("bind handlers to `resize` and `scroll` events"),window.addEventListener("resize",F,!0),window.addEventListener("scroll",F,!0)},U=function(){if(!B)return S("window events are not bound");B=!1,S("unbind handlers to `resize` and `scroll` events"),window.removeEventListener("resize",F,!0),window.removeEventListener("scroll",F,!0)},W=function(e,t,n){var i=L()(n),o=t.clientHeight,a=t.clientWidth,r={top:i.top-o,bottom:V.height-i.bottom-o,left:i.left-a,right:V.width-i.right-a},s=e.split(/\s+/),l=T()(s,1)[0],c=T()(s,2)[1],u=function(e,t){for(var n,i=[e,z[e],A[e],z[A[e]]],o=-1/0,a=0,r=i.length;a<r;a++){var s=i[a],l=t[s];if(l>0)return s;l>o&&(o=l,n=e)}return n}(l,r);return c!==u&&c!==z[u]||(c=null),function(e,t,n,i,o,a){for(var r,s="top"===e||"bottom"===e,l=t?[s?"".concat(e," ").concat(t):"".concat(t," ").concat(e),e,s?"".concat(e," ").concat(z[t]):"".concat(z[t]," ").concat(e)]:[e,s?"".concat(e," ").concat(A[e]):"".concat(A[e]," ").concat(e),s?"".concat(e," ").concat(z[A[e]]):"".concat(z[A[e]]," ").concat(e)],c=0,u=o*a,d=0,p=l.length;d<p;d++){var m=l[d],h=K(m,n,i),f=h.left+o,b=h.top+a,g=Math.min(h.top<V.top?b-V.top:V.bottom-h.top,a),v=Math.min(h.left<V.left?f-V.left:V.right-h.left,o),y=v*g;if(y===u)return m;y>c&&(c=y,r=m)}return r}(u,c,t,n,a,o)||e};function K(e,t,n,i){var o=L()(t);if(!o)throw new Error("could not get bounding client rect of Tip element");var a=o.width,r=o.height,s=L()(n);if(!s)throw new Error("could not get bounding client rect of `target`");var l=s.width,c=s.height,u=function(e,t){var n=t.body||t.getElementsByTagName("body")[0],i=t.documentElement||n.parentNode,o=i.clientTop||n.clientTop||0,a=i.clientLeft||n.clientLeft||0,r=window.pageYOffset||i.scrollTop,s=window.pageXOffset||i.scrollLeft;return{top:e.top+r-o,left:e.left+s-a}}(s,document);if(!u)throw new Error("could not determine page offset of `target`");var d={};switch(e){case"top":d={top:u.top-r,left:i&&i.left?u.left+i.left:u.left+l/2-a/2};break;case"bottom":d={top:u.top+c,left:i&&i.left?u.left+i.left:u.left+l/2-a/2};break;case"right":d={top:u.top+c/2-r/2,left:u.left+l};break;case"left":d={top:u.top+c/2-r/2,left:u.left-a};break;case"top left":d={top:u.top-r,left:u.left+l/2-a+15};break;case"top right":d={top:u.top-r,left:u.left+l/2-15};break;case"bottom left":d={top:u.top+c,left:u.left+l/2-a+15};break;case"bottom right":d={top:u.top+c,left:u.left+l/2-15};break;case"left top":d={top:u.top+c/2-r,left:u.left-a};break;case"left bottom":d={top:u.top+c/2,left:u.left-a};break;case"right top":d={top:u.top+c/2-r,left:u.left+l};break;case"right bottom":d={top:u.top+c/2,left:u.left+l};break;default:throw new Error('invalid position "'.concat(e,'"'))}return d}var Y=function(){},J=N()("calypso:popover"),X=new Set,G=function(e){function t(e){var n;return o()(this,t),n=l()(this,u()(t).call(this,e)),b()(p()(n),"isUpdatingPosition",!1),n.setPopoverId(e.id),n.setDOMBehavior=n.setDOMBehavior.bind(p()(n)),n.setPosition=n.setPosition.bind(p()(n)),n.onClickout=n.onClickout.bind(p()(n)),n.onKeydown=n.onKeydown.bind(p()(n)),n.onWindowChange=n.onWindowChange.bind(p()(n)),n.state={show:e.isVisible,left:-99999,top:-99999,positionClass:n.getPositionClass(e.position)},n}return h()(t,e),r()(t,[{key:"componentDidMount",value:function(){this.state.show&&(this.bindEscKeyListener(),this.bindDebouncedReposition(),H())}},{key:"componentWillReceiveProps",value:function(e){if(this.domContext=w.a.findDOMNode(e.context),!e.isVisible)return null;this.setPosition()}},{key:"componentDidUpdate",value:function(e,t){var n=this,i=this.props.isVisible;return!t.show&&this.state.show&&(this.bindEscKeyListener(),this.bindDebouncedReposition(),H()),i!==e.isVisible&&(i?this.show():this.hide()),this.domContainer&&this.domContext&&i?void(this.isUpdatingPosition||(this.debug("requesting to update position after render completes"),requestAnimationFrame(function(){X.has(n.id)&&n.domContainer&&n.domContext&&i?(n.setPosition(),n.isUpdatingPosition=!1):n.isUpdatingPosition=!1}),this.isUpdatingPosition=!0)):null}},{key:"componentWillUnmount",value:function(){this.debug("unmounting .... "),this.unbindClickoutHandler(),this.unbindDebouncedReposition(),this.unbindEscKeyListener(),U(),X.delete(this.id),J("current popover instances: ",X.size)}},{key:"bindEscKeyListener",value:function(){if(!this.props.closeOnEsc)return null;this.debug("adding escKey listener ..."),document.addEventListener("keydown",this.onKeydown,!0)}},{key:"unbindEscKeyListener",value:function(){if(!this.props.closeOnEsc)return null;this.debug("unbinding `escKey` listener ..."),document.removeEventListener("keydown",this.onKeydown,!0)}},{key:"onKeydown",value:function(e){if(27!==e.keyCode)return null;this.close(!0)}},{key:"bindClickoutHandler",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.domContainer;return e?this._clickoutHandlerReference?(this.debug("clickout event already bound"),null):(this.debug("binding `clickout` event"),void(this._clickoutHandlerReference=O()(e,this.onClickout))):(this.debug("no element to bind clickout "),null)}},{key:"unbindClickoutHandler",value:function(){this._clickoutHandlerReference&&(this.debug("unbinding `clickout` listener ..."),this._clickoutHandlerReference(),this._clickoutHandlerReference=null)}},{key:"onClickout",value:function(e){var t=this.domContext&&this.domContext.contains&&!this.domContext.contains(e.target);if(this.props.ignoreContext&&t){var n=w.a.findDOMNode(this.props.ignoreContext);t=t&&n&&n.contains&&!n.contains(e.target)}t&&this.close()}},{key:"bindDebouncedReposition",value:function(){window.addEventListener("scroll",this.onWindowChange,!0),window.addEventListener("resize",this.onWindowChange,!0)}},{key:"unbindDebouncedReposition",value:function(){this.willReposition&&(window.cancelAnimationFrame(this.willReposition),this.willReposition=null),window.removeEventListener("scroll",this.onWindowChange,!0),window.removeEventListener("resize",this.onWindowChange,!0),this.debug("unbinding `debounce reposition` ...")}},{key:"onWindowChange",value:function(){this.willReposition=window.requestAnimationFrame(this.setPosition)}},{key:"setDOMBehavior",value:function(e){if(!e)return this.unbindClickoutHandler(),null;this.debug("setting DOM behavior"),this.bindClickoutHandler(e),this.domContainer=e,this.domContext=w.a.findDOMNode(this.props.context),this.setPosition()}},{key:"getPositionClass",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.position;return"is-".concat(e.replace(/\s+/g,"-"))}},{key:"adjustRtlPosition",value:function(e){if(this.props.isRtl)switch(e){case"top right":case"right top":return"top left";case"right":return"left";case"bottom right":case"right bottom":return"bottom left";case"bottom left":case"left bottom":return"bottom right";case"left":return"right";case"top left":case"left top":return"top right"}return e}},{key:"computePosition",value:function(){if(!this.props.isVisible)return null;var e=this.domContainer,t=this.domContext,n=this.props,i=n.position,o=n.relativePosition;if(!e||!t)return this.debug("[WARN] no DOM elements to work"),null;var a=i;this.debug("position: %o",a),this.props.autoRtl&&(a=this.adjustRtlPosition(a),this.debug("RTL adjusted position: %o",a)),this.props.autoPosition&&(a=W(a,e,t),this.debug("suggested position: %o",a));var r=Object.assign({},function(e,t){var n=L()(t).width;return e.left=Math.max(0,Math.min(e.left,V.width-n)),e}(K(a,e,t,o),e),{positionClass:this.getPositionClass(a)});return this.debug("updating reposition: ",r),r}},{key:"debug",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];J.apply(void 0,["[%s] ".concat(e),this.id].concat(n))}},{key:"setPopoverId",value:function(e){this.id=e||"pop__".concat(Object(P.uniqueId)()),X.add(this.id),this.debug("creating ..."),J("current popover instances: ",X.size)}},{key:"setPosition",value:function(){var e;if(this.debug("updating position"),!(e=this.props.customPosition?Object.assign({positionClass:this.getPositionClass(this.constructor.defaultProps.position)},this.props.customPosition):this.computePosition()))return null;this.willReposition=null,this.setState(e)}},{key:"getStylePosition",value:function(){var e=this.state;return{left:e.left,top:e.top}}},{key:"show",value:function(){var e=this;if(!this.props.showDelay)return this.setState({show:!0}),null;this.debug("showing in %o","".concat(this.props.showDelay,"ms")),this.clearShowTimer(),this._openDelayTimer=setTimeout(function(){e.setState({show:!0})},this.props.showDelay)}},{key:"hide",value:function(){this.unbindClickoutHandler(),this.unbindDebouncedReposition(),this.unbindEscKeyListener(),U(),this.setState({show:!1}),this.clearShowTimer()}},{key:"clearShowTimer",value:function(){if(!this._openDelayTimer)return null;clearTimeout(this._openDelayTimer),this._openDelayTimer=null}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.props.isVisible)return this.debug("popover should be already closed"),null;this.props.onClose(e)}},{key:"render",value:function(){if(!this.state.show)return this.debug("is hidden. return no render"),null;if(!this.props.context)return this.debug("No `context` to tie. return no render"),null;var e=I()("popover",this.props.className,this.state.positionClass);return this.debug("rendering ..."),k.a.createElement(x.a,{className:this.props.rootClassName},k.a.createElement("div",{style:this.getStylePosition(),className:e},k.a.createElement("div",{className:"popover__arrow"}),k.a.createElement("div",{ref:this.setDOMBehavior,className:"popover__inner"},this.props.children)))}}]),t}(y.Component);b()(G,"propTypes",{autoPosition:v.a.bool,autoRtl:v.a.bool,className:v.a.string,closeOnEsc:v.a.bool,id:v.a.string,ignoreContext:v.a.shape({getDOMNode:v.a.function}),isRtl:v.a.bool,isVisible:v.a.bool,position:v.a.oneOf(["top","top right","right","bottom right","bottom","bottom left","left","top left"]),rootClassName:v.a.string,showDelay:v.a.number,onClose:v.a.func,onShow:v.a.func,relativePosition:v.a.shape({left:v.a.number}),customPosition:v.a.shape({top:v.a.number,left:v.a.number,positionClass:v.a.oneOf(["top","right","bottom","left"])})}),b()(G,"defaultProps",{autoPosition:!0,autoRtl:!0,className:"",closeOnEsc:!0,isRtl:!1,isVisible:!1,position:"top",showDelay:0,onClose:Y,onShow:Y});t.a=Object(C.b)(function(e){return{isRtl:document.body.classList.contains("rtl")}})(G)},682:function(e,t,n){},683:function(e,t,n){},685:function(e,t,n){"use strict";var i=n(107),o=n.n(i),a=n(108),r=n.n(a),s=n(528),l=n.n(s),c=n(527),u=n.n(c),d=n(531),p=n.n(d),m=n(529),h=n.n(m),f=n(34),b=n.n(f),g=n(109),v=n(35),y=n(12),k=n.n(y),E=n(10),w=n.n(E),C=n(1),R=(n(682),n(616)),N=n(534),_=n.n(N),I=n(583),D=n.n(I),O=n(30),P=n(790),x=n(526),j=n.n(x),T=n(542),q=n(632),L=function(e){return"HR"===e.tagName},S=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,a=new Array(i),r=0;r<i;r++)a[r]=arguments[r];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(a))),b()(p()(n),"menu",w.a.createRef()),b()(p()(n),"_setPropsOnChild",function(e){if(null==e)return e;var t=n._onClose.bind(p()(n),e.props.action),i=t;return e.props.onClick&&(i=Object(C.over)([e.props.onClick,t])),w.a.cloneElement(e,{onClick:i})}),b()(p()(n),"_onShow",function(){var e=n.menu.current;n._previouslyFocusedElement=document.activeElement,e&&e.focus()}),b()(p()(n),"_getClosestSibling",function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=n.menu.current,o=i.firstChild,a=i.lastChild;if(t||(o=i.lastChild,a=i.firstChild),e===i)return o;var r=e[t?"nextSibling":"previousSibling"]||a;return L(r)?n._getClosestSibling(r,t):r}),b()(p()(n),"_onKeyDown",function(e){var t,i=e.target,o=!1;switch(e.keyCode){case 9:n.props.onClose(),o=!0;break;case 38:t=n._getClosestSibling(i,!1),o=!0;break;case 40:t=n._getClosestSibling(i,!0),o=!0}t&&t.focus(),o&&e.preventDefault()}),b()(p()(n),"_onClose",function(e){n._previouslyFocusedElement&&(n._previouslyFocusedElement.focus(),n._previouslyFocusedElement=null),n.props.onClose&&n.props.onClose(e)}),n}return h()(t,e),r()(t,[{key:"componentWillUnmount",value:function(){this._previouslyFocusedElement=null}},{key:"render",value:function(){var e=this.props,t=e.popoverComponent,n=e.autoPosition,i=e.className,o=e.context,a=e.customPosition,r=e.isVisible,s=e.popoverTitle,l=e.position,c=e.rootClassName;return w.a.createElement(t,{onClose:this._onClose,onShow:this._onShow,autoPosition:n,className:i,context:o,customPosition:a,isVisible:r,popoverTitle:s,position:l,rootClassName:c},w.a.createElement("div",{ref:this.menu,role:"menu",className:"popover__menu",onKeyDown:this._onKeyDown,tabIndex:"-1"},w.a.Children.map(this.props.children,this._setPropsOnChild,this)))}}]),t}(E.Component);b()(S,"propTypes",{autoPosition:k.a.bool,isVisible:k.a.bool.isRequired,onClose:k.a.func.isRequired,position:k.a.string,className:k.a.string,rootClassName:k.a.string,popoverComponent:k.a.func,popoverTitle:k.a.string,customPosition:k.a.object}),b()(S,"defaultProps",{autoPosition:!0,position:"top",popoverComponent:q.a});var M=S,z=(n(683),function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,a=new Array(i),r=0;r<i;r++)a[r]=arguments[r];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(a))),b()(p()(n),"state",{isMenuVisible:!1}),b()(p()(n),"popoverContext",w.a.createRef()),b()(p()(n),"handleClick",function(e){var t=n.props.onClick,i=n.state.isMenuVisible;t(e),i?n.hideMenu():n.showMenu()}),b()(p()(n),"hideMenu",function(){return n.toggleMenu(!1)}),b()(p()(n),"showMenu",function(){return n.toggleMenu(!0)}),n}return h()(t,e),r()(t,[{key:"toggleMenu",value:function(e){this.props.disabled||(this.setState({isMenuVisible:e}),this.props.onToggle(e))}},{key:"render",value:function(){var e=this.props,t=e.toggleTitle,n=e.translate,i=e.position,o=e.children,a=e.disabled,r=e.className,s=e.popoverClassName,l=this.state.isMenuVisible,c=j()("ellipsis-menu",r,{"is-menu-visible":l,"is-disabled":a}),u=j()("ellipsis-menu__menu","popover",s);return w.a.createElement("span",{className:c},w.a.createElement(T.a,{ref:this.popoverContext,onClick:this.handleClick,title:t||n("Toggle menu"),borderless:!0,disabled:a,className:"ellipsis-menu__toggle"},w.a.createElement(_.a,{icon:"ellipsis",className:"ellipsis-menu__toggle-icon"})),w.a.createElement(M,{isVisible:l,onClose:this.hideMenu,position:i,context:this.popoverContext.current,className:u},o))}}]),t}(E.Component));b()(z,"propTypes",{translate:k.a.func,toggleTitle:k.a.string,position:k.a.string,disabled:k.a.bool,onClick:k.a.func,onToggle:k.a.func,popoverClassName:k.a.string}),b()(z,"defaultProps",{onClick:C.noop,onToggle:C.noop});var A=Object(v.localize)(z),V=n(530),F=n.n(V),B=n(601),H=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,a=new Array(i),r=0;r<i;r++)a[r]=arguments[r];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(a))),b()(p()(n),"handleMouseOver",function(e){n.props.focusOnHover&&e.target.focus(),n.props.onMouseOver()}),n}return h()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,i=e.href,o=e.icon,a=e.isSelected,r=e.isExternalLink,s=Object(C.omit)(this.props,"icon","focusOnHover","isSelected","isExternalLink","className","itemComponent"),l=j()("popover__menu-item",n,{"is-selected":a}),c=this.props.itemComponent;return r&&i?(c=B.a,s.icon=!0):i&&(c="a"),w.a.createElement(c,F()({role:"menuitem",onMouseOver:this.handleMouseOver,tabIndex:"-1",className:l},s),o&&w.a.createElement(_.a,{icon:o,size:18}),t)}}]),t}(E.Component);b()(H,"propTypes",{href:k.a.string,className:k.a.string,isSelected:k.a.bool,icon:k.a.string,focusOnHover:k.a.bool,onMouseOver:k.a.func,isExternalLink:k.a.bool,itemComponent:k.a.oneOfType([k.a.func,k.a.string])}),b()(H,"defaultProps",{isSelected:!1,focusOnHover:!0,onMouseOver:C.noop,itemComponent:"button"});var U=n(551),W=n(548),K=n(540),Y=n(537),J=function(e){var t=e.orderId,n=e.siteId,i=e.refundDialog,o=e.createdDate,a=e.refundableAmount,r=e.currency,s=e.labelId,l=e.translate,c=e.moment,u=function(){return D()(a,r)},d=function(){return e.closeRefundDialog(t,n)},p=[{action:"cancel",label:l("Cancel"),onClick:d},{action:"confirm",onClick:function(){return e.confirmRefund(t,n)},isPrimary:!0,disabled:i&&i.isSubmitting,additionalClassNames:i&&i.isSubmitting?"is-busy":"",label:l("Refund label (-%(amount)s)",{args:{amount:u()}})}];return w.a.createElement(U.a,{additionalClassNames:"label-refund-modal woocommerce wcc-root",isVisible:Boolean(i&&i.labelId===s),onClose:d,buttons:p},w.a.createElement(W.a,null,l("Request a refund")),w.a.createElement("p",null,l("You can request a refund for a shipping label that has not been used to ship a package. It will take at least 14 days to process.")),w.a.createElement("dl",null,w.a.createElement("dt",null,l("Purchase date")),w.a.createElement("dd",null,c(o).format("LLL")),w.a.createElement("dt",null,l("Amount eligible for refund")),w.a.createElement("dd",null,u())))};J.propTypes={siteId:k.a.number.isRequired,orderId:k.a.number.isRequired,refundDialog:k.a.object,createdDate:k.a.number,refundableAmount:k.a.number,currency:k.a.string,labelId:k.a.number,closeRefundDialog:k.a.func.isRequired,confirmRefund:k.a.func.isRequired};var X=Object(g.b)(function(e,t){var n=t.orderId,i=t.siteId,o=Object(Y.s)(e,n,i),a=Object(Y.i)(e,n,i);return{refundDialog:o?a.refundDialog:{}}},function(e){return Object(O.b)({closeRefundDialog:K.e,confirmRefund:K.k},e)})(Object(v.localize)(J)),G=n(600),Q=n(604),Z=function(e){var t=e.orderId,n=e.siteId,i=e.reprintDialog,o=e.paperSize,a=e.storeOptions,r=e.labelId,s=e.translate,l=function(){return e.closeReprintDialog(t,n)},c=[{action:"cancel",label:s("Cancel"),onClick:l},{action:"confirm",onClick:function(){return e.confirmReprint(t,n)},isPrimary:!0,disabled:i&&!i.fileData,additionalClassNames:i&&i.isFetching?"is-busy":"",label:s("Print")}];return w.a.createElement(U.a,{isVisible:Boolean(i&&i.labelId===r),onClose:l,buttons:c,additionalClassNames:"label-reprint-modal woocommerce wcc-root"},w.a.createElement(W.a,null,s("Reprint shipping label")),w.a.createElement("p",null,s("If there was a printing error when you purchased the label, you can print it again.")),w.a.createElement("p",{className:"shipping-label__reprint-modal-notice"},s("NOTE: If you already used the label in a package, printing and using it again is a violation of our terms of service and may result in criminal charges.")),w.a.createElement(G.a,{id:"paper_size",valuesMap:Object(Q.a)(a.origin_country),title:s("Paper size"),value:o,updateValue:function(i){return e.updatePaperSize(t,n,i)}}))};Z.propTypes={siteId:k.a.number.isRequired,orderId:k.a.number.isRequired,reprintDialog:k.a.object,paperSize:k.a.string.isRequired,storeOptions:k.a.object.isRequired,labelId:k.a.number,closeReprintDialog:k.a.func.isRequired,confirmReprint:k.a.func.isRequired};var $=Object(g.b)(function(e,t){var n=t.orderId,i=t.siteId,o=Object(Y.s)(e,n,i),a=Object(Y.i)(e,n,i);return{reprintDialog:o?a.reprintDialog:{},paperSize:a.paperSize,storeOptions:o?a.storeOptions:{}}},function(e){return Object(O.b)({closeReprintDialog:K.f,confirmReprint:K.l,updatePaperSize:K.X},e)})(Object(v.localize)(Z)),ee=n(645),te=n(543),ne=function(e){var t=e.orderId,n=e.siteId,i=e.isVisible,o=e.labelIndex,a=e.serviceName,r=e.packageName,s=e.productNames,l=e.canManagePayments,c=e.receiptId,u=e.translate,d=function(){return e.closeDetailsDialog(t,n)},p=[{action:"close",label:u("Close"),onClick:d}];return w.a.createElement(U.a,{additionalClassNames:"label-details-modal woocommerce wcc-root",isVisible:i,onClose:d,buttons:p},w.a.createElement(W.a,{className:"shipping-label__label-details-modal-heading"},w.a.createElement("span",{className:"shipping-label__label-details-modal-heading-title"},u("Label #%(labelIndex)s details",{args:{labelIndex:o+1}})),l&&c?w.a.createElement("a",{href:"".concat(Object(ee.a)(),"/me/purchases/billing/").concat(c),target:"_blank",rel:"noopener noreferrer"},u("Receipt")):null),w.a.createElement("dl",null,w.a.createElement("dt",null,u("Service")),w.a.createElement("dd",null,a),w.a.createElement("dt",null,u("Package")),w.a.createElement("dd",null,r),w.a.createElement("dt",null,u("Items")),w.a.createElement("dd",null,w.a.createElement("ul",null,s.map(function(e,t){return w.a.createElement("li",{key:t},e)})))))};ne.propTypes={siteId:k.a.number.isRequired,orderId:k.a.number.isRequired,isVisible:k.a.bool,serviceName:k.a.string,packageName:k.a.string,productNames:k.a.array,closeDetailsDialog:k.a.func.isRequired,receiptId:k.a.number};var ie=Object(g.b)(function(e,t){var n=t.orderId,i=t.siteId,o=t.labelId,a=Object(Y.s)(e,n,i),r=Object(Y.i)(e,n,i).detailsDialog;return{isVisible:Boolean(a&&r&&r.labelId===o),canManagePayments:Object(te.q)(e,i)}},function(e){return Object(O.b)({closeDetailsDialog:K.c},e)})(Object(v.localize)(ne)),oe={usps:function(e){return"https://tools.usps.com/go/TrackConfirmAction.action?tLabels=".concat(e)},fedex:function(e){return"https://www.fedex.com/apps/fedextrack/?action=track&tracknumbers=".concat(e)},ups:function(e){return"https://www.ups.com/track?loc=en_US&tracknum=".concat(e)},dhlexpress:function(e){return"https://www.dhl.com/en/express/tracking.html?AWB=".concat(e,"&brand=DHL")}},ae=function(e){var t=e.tracking,n=e.carrierId,i=e.translate;if(!t)return w.a.createElement("span",null,i("N/A"));var o=oe[n](t);return o?w.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:o},t," ",w.a.createElement(_.a,{icon:"external",size:12})):w.a.createElement("span",null,t)};ae.propTypes={tracking:k.a.string,carrierId:k.a.string};var re=Object(v.localize)(ae),se=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,a=new Array(i),r=0;r<i;r++)a[r]=arguments[r];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(a))),b()(p()(n),"renderRefund",function(e,t){var i=n.props,o=i.orderId,a=i.siteId,r=i.translate;if(t)return w.a.createElement(P.a,{position:"top left",text:r("Labels older than 30 days cannot be refunded.")},w.a.createElement("button",{className:"popover__menu-item shipping-label__item-menu-reprint-expired",role:"menuitem",tabIndex:"-1"},w.a.createElement(_.a,{icon:"refund",size:18}),w.a.createElement("span",null," ",r("Request refund")," ")));return w.a.createElement(H,{onClick:function(){n.props.openRefundDialog(o,a,e)},icon:"refund"},r("Request refund"))}),b()(p()(n),"renderReprint",function(e,t){var i=n.props,o=i.orderId,a=i.siteId,r=i.translate;if(t)return w.a.createElement(P.a,{position:"top left",text:r("Label images older than 180 days are deleted by our technology partners for general security and data privacy concerns.")},w.a.createElement("button",{className:"popover__menu-item shipping-label__item-menu-reprint-expired",role:"menuitem",tabIndex:"-1"},w.a.createElement(_.a,{icon:"print",size:18}),w.a.createElement("span",null," ",r("Reprint")," ")));return w.a.createElement(H,{onClick:function(){n.props.openReprintDialog(o,a,e)},icon:"print"},r("Reprint"))}),b()(p()(n),"renderLabelDetails",function(e){var t=n.props,i=t.orderId,o=t.siteId,a=t.translate;return w.a.createElement(H,{onClick:function(){n.props.openDetailsDialog(i,o,e)},icon:"info-outline"},a("View details"))}),b()(p()(n),"renderPickup",function(e){var t=n.props.translate,i={usps:"https://tools.usps.com/schedule-pickup-steps.htm",fedex:"https://www.fedex.com/en-us/shipping/schedule-manage-pickups.html",ups:"https://wwwapps.ups.com/pickup/request"};if(!i.hasOwnProperty(e))return null;return w.a.createElement(H,{onClick:function(){window.open(i[e],"_blank")},icon:"external"},t("Schedule a pickup"))}),n}return h()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.label,n=t.labelIndex,i=t.serviceName,o=t.packageName,a=t.productNames,r=t.receiptId,s=t.labelId,l=t.createdDate,c=t.refundableAmount,u=t.currency,d=t.showDetails,p=t.expiryDate,m=t.anonymized,h=t.usedDate,f=t.tracking,b=t.carrierId,g=e.siteId,v=e.orderId,y=e.translate,k=e.isModal,E=(new Date).getTime(),C=!1,R=!1;(m||h||p&&p<E)&&(C=!0);var N=(new Date).setDate((new Date).getDate()-30);return(m||h||l&&l<N)&&(R=!0),w.a.createElement("div",{className:"shipping-label__item"},w.a.createElement("p",{className:"shipping-label__item-detail"},y("%(service)s label (#%(labelIndex)d)",{args:{service:i,labelIndex:n+1}}),d&&w.a.createElement("span",null,!k&&w.a.createElement(A,{position:"bottom left"},this.renderLabelDetails(s),this.renderPickup(b),this.renderRefund(s,R),this.renderReprint(s,C)),w.a.createElement(ie,{siteId:g,orderId:v,labelIndex:n,serviceName:i,packageName:o,productNames:a,receiptId:r,labelId:s}),w.a.createElement(X,{siteId:g,orderId:v,createdDate:l,refundableAmount:c,currency:u,labelId:s}),w.a.createElement($,{siteId:g,orderId:v,labelId:s}))),d&&w.a.createElement("p",{className:"shipping-label__item-tracking"},y("Tracking #: {{trackingLink/}}",{components:{trackingLink:w.a.createElement(re,{carrierId:b,tracking:f})}})))}}]),t}(E.Component);se.propTypes={siteId:k.a.number.isRequired,orderId:k.a.number.isRequired,label:k.a.shape({serviceName:k.a.string.isRequired,labelIndex:k.a.number.isRequired,packageName:k.a.string.isRequired,productNames:k.a.string.isRequired,receiptId:k.a.number.isRequired,labelId:k.a.number.isRequired,createdDate:k.a.string.isRequired,refundableAmount:k.a.number.isRequired,currency:k.a.string.isRequired,showDetails:k.a.bool.isRequired,expiryDate:k.a.string.isRequired,anonymized:k.a.bool.isRequired,usedDate:k.a.string.isRequired,tracking:k.a.string.isRequired,carrierId:k.a.number.isRequired}).isRequired,isModal:k.a.bool.isRequired,openRefundDialog:k.a.func.isRequired,openReprintDialog:k.a.func.isRequired,openDetailsDialog:k.a.func.isRequired};var le=Object(g.b)(null,function(e){return Object(O.b)({openRefundDialog:K.y,openReprintDialog:K.z,openDetailsDialog:K.u},e)})(Object(v.localize)(se)),ce=function(e){function t(){return o()(this,t),l()(this,u()(t).apply(this,arguments))}return h()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.label,n=e.translate,i=t.serviceName,o=t.labelIndex;return w.a.createElement("div",{className:"shipping-label__item"},w.a.createElement("p",{className:"shipping-label__item-detail"},n("%(service)s label (#%(labelIndex)d)",{args:{service:i,labelIndex:o+1}}),w.a.createElement("br",null),n("Purchasing\u2026")))}}]),t}(se);se.propTypes={label:k.a.object.isRequired};var ue=Object(v.localize)(ce),de=n(602),pe=function(e){function t(){var e,n,i;o()(this,t);for(var a=arguments.length,r=new Array(a),s=0;s<a;s++)r[s]=arguments[s];return i=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(p()(i),"eventPropsByType",(n={},b()(n,R.a.INTERNAL_NOTE,function(e){return{icon:"aside",heading:(0,i.props.translate)("Internal note"),content:Object(de.a)(Object(de.b)(e.content))}}),b()(n,R.a.CUSTOMER_NOTE,function(e){return{icon:"mail",heading:(0,i.props.translate)("Note sent to customer"),content:Object(de.a)(Object(de.b)(e.content))}}),b()(n,R.a.LABEL_PURCHASING,function(e){return{icon:"sync",content:w.a.createElement(ue,{label:e,orderId:i.props.orderId,siteId:i.props.siteId})}}),b()(n,R.a.LABEL_PURCHASED,function(e){return{icon:"print",content:w.a.createElement(le,{label:e,orderId:i.props.orderId,siteId:i.props.siteId,isModal:i.props.isModal})}}),b()(n,R.a.LABEL_REFUND_REQUESTED,function(e){var t=i.props.translate;return{icon:"time",content:w.a.createElement("div",null,t("%(service)s label (#%(labelNum)d) refund requested (%(amount)s)",{args:{service:e.serviceName,labelNum:e.labelIndex+1,amount:D()(e.amount,e.currency)}}))}}),b()(n,R.a.LABEL_REFUND_COMPLETED,function(e){var t=i.props.translate;return{icon:"refund",content:w.a.createElement("div",null,t("%(service)s label (#%(labelNum)d) refunded (%(amount)s)",{args:{service:e.serviceName,labelNum:e.labelIndex+1,amount:D()(e.amount,e.currency)}}))}}),b()(n,R.a.LABEL_REFUND_REJECTED,function(e){var t=i.props.translate;return{icon:"cross-small",content:w.a.createElement("div",null,t("%(service)s label (#%(labelNum)d) refund rejected",{service:e.serviceName,args:{labelNum:e.labelIndex+1}}))}}),b()(n,R.a.REFUND_NOTE,function(e){var t=i.props.translate;return{icon:"credit-card",heading:t("Refund"),content:w.a.createElement("div",null,t("Refunded %(amount)s",{args:{amount:D()(e.amount,e.currency)}}),w.a.createElement("br",null),e.reason)}}),b()(n,void 0,function(){return{}}),n)),b()(p()(i),"renderDefaultEvent",function(e){return{icon:"aside",heading:(0,i.props.translate)("Note"),content:e.content}}),i}return h()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.moment,n=e.event,i=(this.eventPropsByType[n.type]||this.renderDefaultEvent)(n),o=i.icon,a=i.heading,r=i.content;return w.a.createElement("div",{className:"order-activity-log__note"},w.a.createElement("div",{className:"order-activity-log__note-meta"},w.a.createElement("span",{className:"order-activity-log__note-time"},t(n.timestamp).format("LT")),o&&w.a.createElement(_.a,{icon:o,size:24})),w.a.createElement("div",{className:"order-activity-log__note-body"},w.a.createElement("div",{className:"order-activity-log__note-type"},a),w.a.createElement("div",{className:"order-activity-log__note-content"},r)))}}]),t}(E.Component);b()(pe,"propTypes",{customer_note:k.a.bool,date_created_gmt:k.a.string,note:k.a.string.isRequired}),b()(pe,"propTypes",{event:k.a.object}),b()(pe,"defaultProps",{event:{}});var me=Object(v.localize)(pe),he=n(599),fe=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,a=new Array(i),r=0;r<i;r++)a[r]=arguments[r];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(a))),b()(p()(n),"onClick",function(){n.props.onClick(n.props.date)}),n}return h()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.count,n=e.date,i=e.isOpen,o=e.moment,a=e.translate,r=o(n,"YYYYMMDD").format("ll"),s=w.a.createElement("div",null,w.a.createElement("h3",null,r),w.a.createElement("small",null,a("%(count)s event","%(count)s events",{count:t,args:{count:t}})));return w.a.createElement("div",{className:"order-activity-log__day"},w.a.createElement(he.a,{onClick:this.onClick,className:"order-activity-log__day-header",expanded:i,header:s,screenReaderText:a("Show notes from %(date)s",{args:{date:r}})},this.props.children))}}]),t}(E.Component);b()(fe,"propTypes",{count:k.a.number.isRequired,date:k.a.string.isRequired,isOpen:k.a.bool.isRequired,onClick:k.a.func.isRequired});var be=Object(v.localize)(fe);var ge=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,a=new Array(i),r=0;r<i;r++)a[r]=arguments[r];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(a))),b()(p()(n),"toggleOpenDay",function(e){n.setState(function(){return{openDay:e}})}),b()(p()(n),"renderNotes",function(){var e=n.props,t=e.days,i=e.eventsByDay,o=e.translate;return t.length?w.a.createElement("div",null,t.map(function(e){var t=i[e];return w.a.createElement(be,{key:e,count:t.length,date:e,isOpen:e===n.state.openDay,onClick:n.toggleOpenDay},t.map(function(e){return w.a.createElement(me,{key:"".concat(e.type,"-").concat(e.key),event:e,orderId:n.props.orderId,siteId:n.props.siteId,isModal:n.props.isModal})}))})):w.a.createElement("p",null,o("No activity yet"))}),b()(p()(n),"renderPlaceholder",function(){return w.a.createElement("div",{className:"is-placeholder"},w.a.createElement(be,{count:0,date:"",isOpen:!0,index:1,onClick:C.noop},w.a.createElement(me,null)))}),n}return h()(t,e),r()(t,[{key:"UNSAFE_componentWillMount",value:function(){this.setState({openDay:Object(C.last)(Object(C.keys)(this.props.eventsByDay))})}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=Object(C.last)(Object(C.keys)(e.eventsByDay));this.props.eventsByDay[t]||this.setState({openDay:t})}},{key:"render",value:function(){return this.props.isLoaded?this.renderNotes():this.renderPlaceholder()}}]),t}(E.Component);b()(ge,"propTypes",{orderId:k.a.number.isRequired,siteId:k.a.number.isRequired});t.a=Object(g.b)(function(e,t){var n=t.orderId||!1,i=Object(R.c)(e,n),o=Object(R.b)(e,n),a=o.length?function(e){var t={};return e.forEach(function(e){var n=Object(v.moment)(e.timestamp).format("YYYYMMDD");t[n]?t[n].push(e):t[n]=[e]}),Object(C.keys)(t).forEach(function(e){t[e]=Object(C.sortBy)(t[e],["timestamp","key"]).reverse()}),t}(o):{},r=a?Object(C.keys)(a):[];return r.sort().reverse(),{isLoaded:i,days:r,events:o,eventsByDay:a}})(Object(v.localize)(ge))},787:function(e,t,n){"use strict";n.r(t);var i=n(10),o=n.n(i),a=n(12),r=n.n(a),s=n(109),l=n(30),c=n(35),u=n(534),d=n.n(u),p=n(551),m=n(548),h=n(540),f=n(542),b=n(537),g=n(685),v=function(e){var t=e.loaded,n=e.translate;if(!t)return null;var i=function(){return e.exitTrackingFlow(e.orderId,e.siteId,!1)};return o.a.createElement(p.a,{additionalClassNames:"woocommerce tracking-modal wcc-root",isVisible:e.showTrackingDialog,onClose:i},o.a.createElement("div",{className:"tracking-modal__content"},o.a.createElement("div",{className:"tracking-modal__header"},o.a.createElement(m.a,null,n("Which package would you like to track?")),o.a.createElement(f.a,{className:"tracking-modal__close-button",onClick:i},o.a.createElement(d.a,{icon:"cross"}))),o.a.createElement("div",{className:"tracking-modal__body"},o.a.createElement("div",{className:"tracking-modal__main-section"},o.a.createElement("div",{className:"shipment-tracking__dummy-class order-activity-log"},o.a.createElement(g.a,{orderId:e.orderId,siteId:e.siteId,isModal:!0}))))))};v.propTypes={siteId:r.a.number.isRequired,orderId:r.a.number.isRequired};t.default=Object(s.b)(function(e,t){var n=t.orderId,i=t.siteId,o=Object(b.s)(e,n,i),a=Object(b.i)(e,n,i);return{loaded:o,form:o&&a.form,showTrackingDialog:a.showTrackingDialog,isCustomsFormRequired:Object(b.o)(e,n,i)}},function(e){return Object(l.b)({exitTrackingFlow:h.p},e)})(Object(c.localize)(v))}}]);
|
1 |
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[154],{601:function(e,t,n){"use strict";var i=n(107),o=n.n(i),a=n(108),r=n.n(a),s=n(528),l=n.n(s),c=n(527),u=n.n(c),d=n(529),p=n.n(d),m=n(34),h=n.n(m),f=n(10),b=n.n(f),g=n(12),v=n.n(g),y=n(526),k=n.n(y),E=n(1),w=n(534),C=n.n(w),R=(n(629),function(e){function t(){return o()(this,t),l()(this,u()(t).apply(this,arguments))}return p()(t,e),r()(t,[{key:"render",value:function(){var e=k()("external-link",this.props.className,{"icon-first":!!this.props.showIconFirst},{"has-icon":!!this.props.icon}),t=Object(E.assign)({},Object(E.omit)(this.props,"icon","iconSize","showIconFirst","iconClassName"),{className:e,rel:"external"});t.target&&(t.rel=t.rel.concat(" noopener noreferrer"));var n=b.a.createElement(C.a,{className:this.props.iconClassName,icon:"external",size:this.props.iconSize});return b.a.createElement("a",t,this.props.icon&&this.props.showIconFirst&&n,this.props.children,this.props.icon&&!this.props.showIconFirst&&n)}}]),t}(f.Component));h()(R,"defaultProps",{iconSize:18,showIconFirst:!1}),h()(R,"propTypes",{className:v.a.string,href:v.a.string,onClick:v.a.func,icon:v.a.bool,iconSize:v.a.number,target:v.a.string,showIconFirst:v.a.bool,iconClassName:v.a.string}),t.a=R},629:function(e,t,n){},632:function(e,t,n){"use strict";var i=n(107),o=n.n(i),a=n(108),r=n.n(a),s=n(528),l=n.n(s),c=n(527),u=n.n(c),d=n(531),p=n.n(d),m=n(529),h=n.n(m),f=n(34),b=n.n(f),g=n(12),v=n.n(g),y=n(10),k=n.n(y),E=n(76),w=n.n(E),C=n(109),R=n(47),I=n.n(R),N=n(526),_=n.n(N),D=n(662),O=n.n(D),P=n(1),x=n(628),j=n(78),T=n.n(j),q=n(672),L=n.n(q),S=I()("calypso:popover:util");function M(){var e={};return e.top=window.scrollY,e.left=window.scrollX,e.width=window.innerWidth,e.height=window.innerHeight,e.right=e.left+e.width,e.bottom=e.top+e.height,S("viewport: %o",e),e}var z={top:"bottom",bottom:"top",left:"right",right:"left"},A={top:"right",left:"top",bottom:"left",right:"bottom"},V=M();function F(){V=M()}var B=!1,U=function(){if(B)return S("window events already bound");B=!0,S("bind handlers to `resize` and `scroll` events"),window.addEventListener("resize",F,!0),window.addEventListener("scroll",F,!0)},H=function(){if(!B)return S("window events are not bound");B=!1,S("unbind handlers to `resize` and `scroll` events"),window.removeEventListener("resize",F,!0),window.removeEventListener("scroll",F,!0)},W=function(e,t,n){var i=L()(n),o=t.clientHeight,a=t.clientWidth,r={top:i.top-o,bottom:V.height-i.bottom-o,left:i.left-a,right:V.width-i.right-a},s=e.split(/\s+/),l=T()(s,1)[0],c=T()(s,2)[1],u=function(e,t){for(var n,i=[e,z[e],A[e],z[A[e]]],o=-1/0,a=0,r=i.length;a<r;a++){var s=i[a],l=t[s];if(l>0)return s;l>o&&(o=l,n=e)}return n}(l,r);return c!==u&&c!==z[u]||(c=null),function(e,t,n,i,o,a){for(var r,s="top"===e||"bottom"===e,l=t?[s?"".concat(e," ").concat(t):"".concat(t," ").concat(e),e,s?"".concat(e," ").concat(z[t]):"".concat(z[t]," ").concat(e)]:[e,s?"".concat(e," ").concat(A[e]):"".concat(A[e]," ").concat(e),s?"".concat(e," ").concat(z[A[e]]):"".concat(z[A[e]]," ").concat(e)],c=0,u=o*a,d=0,p=l.length;d<p;d++){var m=l[d],h=K(m,n,i),f=h.left+o,b=h.top+a,g=Math.min(h.top<V.top?b-V.top:V.bottom-h.top,a),v=Math.min(h.left<V.left?f-V.left:V.right-h.left,o),y=v*g;if(y===u)return m;y>c&&(c=y,r=m)}return r}(u,c,t,n,a,o)||e};function K(e,t,n,i){var o=L()(t);if(!o)throw new Error("could not get bounding client rect of Tip element");var a=o.width,r=o.height,s=L()(n);if(!s)throw new Error("could not get bounding client rect of `target`");var l=s.width,c=s.height,u=function(e,t){var n=t.body||t.getElementsByTagName("body")[0],i=t.documentElement||n.parentNode,o=i.clientTop||n.clientTop||0,a=i.clientLeft||n.clientLeft||0,r=window.pageYOffset||i.scrollTop,s=window.pageXOffset||i.scrollLeft;return{top:e.top+r-o,left:e.left+s-a}}(s,document);if(!u)throw new Error("could not determine page offset of `target`");var d={};switch(e){case"top":d={top:u.top-r,left:i&&i.left?u.left+i.left:u.left+l/2-a/2};break;case"bottom":d={top:u.top+c,left:i&&i.left?u.left+i.left:u.left+l/2-a/2};break;case"right":d={top:u.top+c/2-r/2,left:u.left+l};break;case"left":d={top:u.top+c/2-r/2,left:u.left-a};break;case"top left":d={top:u.top-r,left:u.left+l/2-a+15};break;case"top right":d={top:u.top-r,left:u.left+l/2-15};break;case"bottom left":d={top:u.top+c,left:u.left+l/2-a+15};break;case"bottom right":d={top:u.top+c,left:u.left+l/2-15};break;case"left top":d={top:u.top+c/2-r,left:u.left-a};break;case"left bottom":d={top:u.top+c/2,left:u.left-a};break;case"right top":d={top:u.top+c/2-r,left:u.left+l};break;case"right bottom":d={top:u.top+c/2,left:u.left+l};break;default:throw new Error('invalid position "'.concat(e,'"'))}return d}var Y=function(){},J=I()("calypso:popover"),X=new Set,G=function(e){function t(e){var n;return o()(this,t),n=l()(this,u()(t).call(this,e)),b()(p()(n),"isUpdatingPosition",!1),n.setPopoverId(e.id),n.setDOMBehavior=n.setDOMBehavior.bind(p()(n)),n.setPosition=n.setPosition.bind(p()(n)),n.onClickout=n.onClickout.bind(p()(n)),n.onKeydown=n.onKeydown.bind(p()(n)),n.onWindowChange=n.onWindowChange.bind(p()(n)),n.state={show:e.isVisible,left:-99999,top:-99999,positionClass:n.getPositionClass(e.position)},n}return h()(t,e),r()(t,[{key:"componentDidMount",value:function(){this.state.show&&(this.bindEscKeyListener(),this.bindDebouncedReposition(),U())}},{key:"componentWillReceiveProps",value:function(e){if(this.domContext=w.a.findDOMNode(e.context),!e.isVisible)return null;this.setPosition()}},{key:"componentDidUpdate",value:function(e,t){var n=this,i=this.props.isVisible;return!t.show&&this.state.show&&(this.bindEscKeyListener(),this.bindDebouncedReposition(),U()),i!==e.isVisible&&(i?this.show():this.hide()),this.domContainer&&this.domContext&&i?void(this.isUpdatingPosition||(this.debug("requesting to update position after render completes"),requestAnimationFrame(function(){X.has(n.id)&&n.domContainer&&n.domContext&&i?(n.setPosition(),n.isUpdatingPosition=!1):n.isUpdatingPosition=!1}),this.isUpdatingPosition=!0)):null}},{key:"componentWillUnmount",value:function(){this.debug("unmounting .... "),this.unbindClickoutHandler(),this.unbindDebouncedReposition(),this.unbindEscKeyListener(),H(),X.delete(this.id),J("current popover instances: ",X.size)}},{key:"bindEscKeyListener",value:function(){if(!this.props.closeOnEsc)return null;this.debug("adding escKey listener ..."),document.addEventListener("keydown",this.onKeydown,!0)}},{key:"unbindEscKeyListener",value:function(){if(!this.props.closeOnEsc)return null;this.debug("unbinding `escKey` listener ..."),document.removeEventListener("keydown",this.onKeydown,!0)}},{key:"onKeydown",value:function(e){if(27!==e.keyCode)return null;this.close(!0)}},{key:"bindClickoutHandler",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.domContainer;return e?this._clickoutHandlerReference?(this.debug("clickout event already bound"),null):(this.debug("binding `clickout` event"),void(this._clickoutHandlerReference=O()(e,this.onClickout))):(this.debug("no element to bind clickout "),null)}},{key:"unbindClickoutHandler",value:function(){this._clickoutHandlerReference&&(this.debug("unbinding `clickout` listener ..."),this._clickoutHandlerReference(),this._clickoutHandlerReference=null)}},{key:"onClickout",value:function(e){var t=this.domContext&&this.domContext.contains&&!this.domContext.contains(e.target);if(this.props.ignoreContext&&t){var n=w.a.findDOMNode(this.props.ignoreContext);t=t&&n&&n.contains&&!n.contains(e.target)}t&&this.close()}},{key:"bindDebouncedReposition",value:function(){window.addEventListener("scroll",this.onWindowChange,!0),window.addEventListener("resize",this.onWindowChange,!0)}},{key:"unbindDebouncedReposition",value:function(){this.willReposition&&(window.cancelAnimationFrame(this.willReposition),this.willReposition=null),window.removeEventListener("scroll",this.onWindowChange,!0),window.removeEventListener("resize",this.onWindowChange,!0),this.debug("unbinding `debounce reposition` ...")}},{key:"onWindowChange",value:function(){this.willReposition=window.requestAnimationFrame(this.setPosition)}},{key:"setDOMBehavior",value:function(e){if(!e)return this.unbindClickoutHandler(),null;this.debug("setting DOM behavior"),this.bindClickoutHandler(e),this.domContainer=e,this.domContext=w.a.findDOMNode(this.props.context),this.setPosition()}},{key:"getPositionClass",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.position;return"is-".concat(e.replace(/\s+/g,"-"))}},{key:"adjustRtlPosition",value:function(e){if(this.props.isRtl)switch(e){case"top right":case"right top":return"top left";case"right":return"left";case"bottom right":case"right bottom":return"bottom left";case"bottom left":case"left bottom":return"bottom right";case"left":return"right";case"top left":case"left top":return"top right"}return e}},{key:"computePosition",value:function(){if(!this.props.isVisible)return null;var e=this.domContainer,t=this.domContext,n=this.props,i=n.position,o=n.relativePosition;if(!e||!t)return this.debug("[WARN] no DOM elements to work"),null;var a=i;this.debug("position: %o",a),this.props.autoRtl&&(a=this.adjustRtlPosition(a),this.debug("RTL adjusted position: %o",a)),this.props.autoPosition&&(a=W(a,e,t),this.debug("suggested position: %o",a));var r=Object.assign({},function(e,t){var n=L()(t).width;return e.left=Math.max(0,Math.min(e.left,V.width-n)),e}(K(a,e,t,o),e),{positionClass:this.getPositionClass(a)});return this.debug("updating reposition: ",r),r}},{key:"debug",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];J.apply(void 0,["[%s] ".concat(e),this.id].concat(n))}},{key:"setPopoverId",value:function(e){this.id=e||"pop__".concat(Object(P.uniqueId)()),X.add(this.id),this.debug("creating ..."),J("current popover instances: ",X.size)}},{key:"setPosition",value:function(){var e;if(this.debug("updating position"),!(e=this.props.customPosition?Object.assign({positionClass:this.getPositionClass(this.constructor.defaultProps.position)},this.props.customPosition):this.computePosition()))return null;this.willReposition=null,this.setState(e)}},{key:"getStylePosition",value:function(){var e=this.state;return{left:e.left,top:e.top}}},{key:"show",value:function(){var e=this;if(!this.props.showDelay)return this.setState({show:!0}),null;this.debug("showing in %o","".concat(this.props.showDelay,"ms")),this.clearShowTimer(),this._openDelayTimer=setTimeout(function(){e.setState({show:!0})},this.props.showDelay)}},{key:"hide",value:function(){this.unbindClickoutHandler(),this.unbindDebouncedReposition(),this.unbindEscKeyListener(),H(),this.setState({show:!1}),this.clearShowTimer()}},{key:"clearShowTimer",value:function(){if(!this._openDelayTimer)return null;clearTimeout(this._openDelayTimer),this._openDelayTimer=null}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.props.isVisible)return this.debug("popover should be already closed"),null;this.props.onClose(e)}},{key:"render",value:function(){if(!this.state.show)return this.debug("is hidden. return no render"),null;if(!this.props.context)return this.debug("No `context` to tie. return no render"),null;var e=_()("popover",this.props.className,this.state.positionClass);return this.debug("rendering ..."),k.a.createElement(x.a,{className:this.props.rootClassName},k.a.createElement("div",{style:this.getStylePosition(),className:e},k.a.createElement("div",{className:"popover__arrow"}),k.a.createElement("div",{ref:this.setDOMBehavior,className:"popover__inner"},this.props.children)))}}]),t}(y.Component);b()(G,"propTypes",{autoPosition:v.a.bool,autoRtl:v.a.bool,className:v.a.string,closeOnEsc:v.a.bool,id:v.a.string,ignoreContext:v.a.shape({getDOMNode:v.a.function}),isRtl:v.a.bool,isVisible:v.a.bool,position:v.a.oneOf(["top","top right","right","bottom right","bottom","bottom left","left","top left"]),rootClassName:v.a.string,showDelay:v.a.number,onClose:v.a.func,onShow:v.a.func,relativePosition:v.a.shape({left:v.a.number}),customPosition:v.a.shape({top:v.a.number,left:v.a.number,positionClass:v.a.oneOf(["top","right","bottom","left"])})}),b()(G,"defaultProps",{autoPosition:!0,autoRtl:!0,className:"",closeOnEsc:!0,isRtl:!1,isVisible:!1,position:"top",showDelay:0,onClose:Y,onShow:Y});t.a=Object(C.b)(function(e){return{isRtl:document.body.classList.contains("rtl")}})(G)},682:function(e,t,n){},683:function(e,t,n){},685:function(e,t,n){"use strict";var i=n(107),o=n.n(i),a=n(108),r=n.n(a),s=n(528),l=n.n(s),c=n(527),u=n.n(c),d=n(531),p=n.n(d),m=n(529),h=n.n(m),f=n(34),b=n.n(f),g=n(109),v=n(35),y=n(12),k=n.n(y),E=n(10),w=n.n(E),C=n(1),R=(n(682),n(616)),I=n(534),N=n.n(I),_=n(583),D=n.n(_),O=n(30),P=n(790),x=n(526),j=n.n(x),T=n(542),q=n(632),L=function(e){return"HR"===e.tagName},S=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,a=new Array(i),r=0;r<i;r++)a[r]=arguments[r];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(a))),b()(p()(n),"menu",w.a.createRef()),b()(p()(n),"_setPropsOnChild",function(e){if(null==e)return e;var t=n._onClose.bind(p()(n),e.props.action),i=t;return e.props.onClick&&(i=Object(C.over)([e.props.onClick,t])),w.a.cloneElement(e,{onClick:i})}),b()(p()(n),"_onShow",function(){var e=n.menu.current;n._previouslyFocusedElement=document.activeElement,e&&e.focus()}),b()(p()(n),"_getClosestSibling",function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=n.menu.current,o=i.firstChild,a=i.lastChild;if(t||(o=i.lastChild,a=i.firstChild),e===i)return o;var r=e[t?"nextSibling":"previousSibling"]||a;return L(r)?n._getClosestSibling(r,t):r}),b()(p()(n),"_onKeyDown",function(e){var t,i=e.target,o=!1;switch(e.keyCode){case 9:n.props.onClose(),o=!0;break;case 38:t=n._getClosestSibling(i,!1),o=!0;break;case 40:t=n._getClosestSibling(i,!0),o=!0}t&&t.focus(),o&&e.preventDefault()}),b()(p()(n),"_onClose",function(e){n._previouslyFocusedElement&&(n._previouslyFocusedElement.focus(),n._previouslyFocusedElement=null),n.props.onClose&&n.props.onClose(e)}),n}return h()(t,e),r()(t,[{key:"componentWillUnmount",value:function(){this._previouslyFocusedElement=null}},{key:"render",value:function(){var e=this.props,t=e.popoverComponent,n=e.autoPosition,i=e.className,o=e.context,a=e.customPosition,r=e.isVisible,s=e.popoverTitle,l=e.position,c=e.rootClassName;return w.a.createElement(t,{onClose:this._onClose,onShow:this._onShow,autoPosition:n,className:i,context:o,customPosition:a,isVisible:r,popoverTitle:s,position:l,rootClassName:c},w.a.createElement("div",{ref:this.menu,role:"menu",className:"popover__menu",onKeyDown:this._onKeyDown,tabIndex:"-1"},w.a.Children.map(this.props.children,this._setPropsOnChild,this)))}}]),t}(E.Component);b()(S,"propTypes",{autoPosition:k.a.bool,isVisible:k.a.bool.isRequired,onClose:k.a.func.isRequired,position:k.a.string,className:k.a.string,rootClassName:k.a.string,popoverComponent:k.a.func,popoverTitle:k.a.string,customPosition:k.a.object}),b()(S,"defaultProps",{autoPosition:!0,position:"top",popoverComponent:q.a});var M=S,z=(n(683),function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,a=new Array(i),r=0;r<i;r++)a[r]=arguments[r];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(a))),b()(p()(n),"state",{isMenuVisible:!1}),b()(p()(n),"popoverContext",w.a.createRef()),b()(p()(n),"handleClick",function(e){var t=n.props.onClick,i=n.state.isMenuVisible;t(e),i?n.hideMenu():n.showMenu()}),b()(p()(n),"hideMenu",function(){return n.toggleMenu(!1)}),b()(p()(n),"showMenu",function(){return n.toggleMenu(!0)}),n}return h()(t,e),r()(t,[{key:"toggleMenu",value:function(e){this.props.disabled||(this.setState({isMenuVisible:e}),this.props.onToggle(e))}},{key:"render",value:function(){var e=this.props,t=e.toggleTitle,n=e.translate,i=e.position,o=e.children,a=e.disabled,r=e.className,s=e.popoverClassName,l=this.state.isMenuVisible,c=j()("ellipsis-menu",r,{"is-menu-visible":l,"is-disabled":a}),u=j()("ellipsis-menu__menu","popover",s);return w.a.createElement("span",{className:c},w.a.createElement(T.a,{ref:this.popoverContext,onClick:this.handleClick,title:t||n("Toggle menu"),borderless:!0,disabled:a,className:"ellipsis-menu__toggle"},w.a.createElement(N.a,{icon:"ellipsis",className:"ellipsis-menu__toggle-icon"})),w.a.createElement(M,{isVisible:l,onClose:this.hideMenu,position:i,context:this.popoverContext.current,className:u},o))}}]),t}(E.Component));b()(z,"propTypes",{translate:k.a.func,toggleTitle:k.a.string,position:k.a.string,disabled:k.a.bool,onClick:k.a.func,onToggle:k.a.func,popoverClassName:k.a.string}),b()(z,"defaultProps",{onClick:C.noop,onToggle:C.noop});var A=Object(v.localize)(z),V=n(530),F=n.n(V),B=n(601),U=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,a=new Array(i),r=0;r<i;r++)a[r]=arguments[r];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(a))),b()(p()(n),"handleMouseOver",function(e){n.props.focusOnHover&&e.target.focus(),n.props.onMouseOver()}),n}return h()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,i=e.href,o=e.icon,a=e.isSelected,r=e.isExternalLink,s=Object(C.omit)(this.props,"icon","focusOnHover","isSelected","isExternalLink","className","itemComponent"),l=j()("popover__menu-item",n,{"is-selected":a}),c=this.props.itemComponent;return r&&i?(c=B.a,s.icon=!0):i&&(c="a"),w.a.createElement(c,F()({role:"menuitem",onMouseOver:this.handleMouseOver,tabIndex:"-1",className:l},s),o&&w.a.createElement(N.a,{icon:o,size:18}),t)}}]),t}(E.Component);b()(U,"propTypes",{href:k.a.string,className:k.a.string,isSelected:k.a.bool,icon:k.a.string,focusOnHover:k.a.bool,onMouseOver:k.a.func,isExternalLink:k.a.bool,itemComponent:k.a.oneOfType([k.a.func,k.a.string])}),b()(U,"defaultProps",{isSelected:!1,focusOnHover:!0,onMouseOver:C.noop,itemComponent:"button"});var H=n(551),W=n(548),K=n(540),Y=n(537),J=function(e){var t=e.orderId,n=e.siteId,i=e.refundDialog,o=e.createdDate,a=e.refundableAmount,r=e.currency,s=e.labelId,l=e.translate,c=e.moment,u=function(){return D()(a,r)},d=function(){return e.closeRefundDialog(t,n)},p=[{action:"cancel",label:l("Cancel"),onClick:d},{action:"confirm",onClick:function(){return e.confirmRefund(t,n)},isPrimary:!0,disabled:i&&i.isSubmitting,additionalClassNames:i&&i.isSubmitting?"is-busy":"",label:l("Refund label (-%(amount)s)",{args:{amount:u()}})}];return w.a.createElement(H.a,{additionalClassNames:"label-refund-modal woocommerce wcc-root",isVisible:Boolean(i&&i.labelId===s),onClose:d,buttons:p},w.a.createElement(W.a,null,l("Request a refund")),w.a.createElement("p",null,l("You can request a refund for a shipping label that has not been used to ship a package. It will take at least 14 days to process.")),w.a.createElement("dl",null,w.a.createElement("dt",null,l("Purchase date")),w.a.createElement("dd",null,c(o).format("LLL")),w.a.createElement("dt",null,l("Amount eligible for refund")),w.a.createElement("dd",null,u())))};J.propTypes={siteId:k.a.number.isRequired,orderId:k.a.number.isRequired,refundDialog:k.a.object,createdDate:k.a.number,refundableAmount:k.a.number,currency:k.a.string,labelId:k.a.number,closeRefundDialog:k.a.func.isRequired,confirmRefund:k.a.func.isRequired};var X=Object(g.b)(function(e,t){var n=t.orderId,i=t.siteId,o=Object(Y.s)(e,n,i),a=Object(Y.i)(e,n,i);return{refundDialog:o?a.refundDialog:{}}},function(e){return Object(O.b)({closeRefundDialog:K.e,confirmRefund:K.k},e)})(Object(v.localize)(J)),G=n(600),Q=n(604),Z=function(e){var t=e.orderId,n=e.siteId,i=e.reprintDialog,o=e.paperSize,a=e.storeOptions,r=e.labelId,s=e.translate,l=function(){return e.closeReprintDialog(t,n)},c=[{action:"cancel",label:s("Cancel"),onClick:l},{action:"confirm",onClick:function(){return e.confirmReprint(t,n)},isPrimary:!0,disabled:i&&!i.fileData,additionalClassNames:i&&i.isFetching?"is-busy":"",label:s("Print")}];return w.a.createElement(H.a,{isVisible:Boolean(i&&i.labelId===r),onClose:l,buttons:c,additionalClassNames:"label-reprint-modal woocommerce wcc-root"},w.a.createElement(W.a,null,s("Reprint shipping label")),w.a.createElement("p",null,s("If there was a printing error when you purchased the label, you can print it again.")),w.a.createElement("p",{className:"shipping-label__reprint-modal-notice"},s("NOTE: If you already used the label in a package, printing and using it again is a violation of our terms of service and may result in criminal charges.")),w.a.createElement(G.a,{id:"paper_size",valuesMap:Object(Q.a)(a.origin_country),title:s("Paper size"),value:o,updateValue:function(i){return e.updatePaperSize(t,n,i)}}))};Z.propTypes={siteId:k.a.number.isRequired,orderId:k.a.number.isRequired,reprintDialog:k.a.object,paperSize:k.a.string.isRequired,storeOptions:k.a.object.isRequired,labelId:k.a.number,closeReprintDialog:k.a.func.isRequired,confirmReprint:k.a.func.isRequired};var $=Object(g.b)(function(e,t){var n=t.orderId,i=t.siteId,o=Object(Y.s)(e,n,i),a=Object(Y.i)(e,n,i);return{reprintDialog:o?a.reprintDialog:{},paperSize:a.paperSize,storeOptions:o?a.storeOptions:{}}},function(e){return Object(O.b)({closeReprintDialog:K.f,confirmReprint:K.l,updatePaperSize:K.X},e)})(Object(v.localize)(Z)),ee=n(645),te=n(543),ne=function(e){var t=e.orderId,n=e.siteId,i=e.isVisible,o=e.labelIndex,a=e.serviceName,r=e.packageName,s=e.productNames,l=e.canManagePayments,c=e.receiptId,u=e.translate,d=function(){return e.closeDetailsDialog(t,n)},p=[{action:"close",label:u("Close"),onClick:d}];return w.a.createElement(H.a,{additionalClassNames:"label-details-modal woocommerce wcc-root",isVisible:i,onClose:d,buttons:p},w.a.createElement(W.a,{className:"shipping-label__label-details-modal-heading"},w.a.createElement("span",{className:"shipping-label__label-details-modal-heading-title"},u("Label #%(labelIndex)s details",{args:{labelIndex:o+1}})),l&&c?w.a.createElement("a",{href:"".concat(Object(ee.a)(),"/me/purchases/billing/").concat(c),target:"_blank",rel:"noopener noreferrer"},u("Receipt")):null),w.a.createElement("dl",null,w.a.createElement("dt",null,u("Service")),w.a.createElement("dd",null,a),w.a.createElement("dt",null,u("Package")),w.a.createElement("dd",null,r),w.a.createElement("dt",null,u("Items")),w.a.createElement("dd",null,w.a.createElement("ul",null,s.map(function(e,t){return w.a.createElement("li",{key:t},e)})))))};ne.propTypes={siteId:k.a.number.isRequired,orderId:k.a.number.isRequired,isVisible:k.a.bool,serviceName:k.a.string,packageName:k.a.string,productNames:k.a.array,closeDetailsDialog:k.a.func.isRequired,receiptId:k.a.number};var ie=Object(g.b)(function(e,t){var n=t.orderId,i=t.siteId,o=t.labelId,a=Object(Y.s)(e,n,i),r=Object(Y.i)(e,n,i).detailsDialog;return{isVisible:Boolean(a&&r&&r.labelId===o),canManagePayments:Object(te.q)(e,i)}},function(e){return Object(O.b)({closeDetailsDialog:K.c},e)})(Object(v.localize)(ne)),oe={usps:function(e){return"https://tools.usps.com/go/TrackConfirmAction.action?tLabels=".concat(e)},fedex:function(e){return"https://www.fedex.com/apps/fedextrack/?action=track&tracknumbers=".concat(e)},ups:function(e){return"https://www.ups.com/track?loc=en_US&tracknum=".concat(e)},dhlexpress:function(e){return"https://www.dhl.com/en/express/tracking.html?AWB=".concat(e,"&brand=DHL")}},ae=function(e){var t=e.tracking,n=e.carrierId,i=e.translate;if(!t)return w.a.createElement("span",null,i("N/A"));var o=oe[n](t);return o?w.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:o},t," ",w.a.createElement(N.a,{icon:"external",size:12})):w.a.createElement("span",null,t)};ae.propTypes={tracking:k.a.string,carrierId:k.a.string};var re=Object(v.localize)(ae),se=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,a=new Array(i),r=0;r<i;r++)a[r]=arguments[r];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(a))),b()(p()(n),"renderRefund",function(e,t){var i=n.props,o=i.orderId,a=i.siteId,r=i.translate;if(t)return w.a.createElement(P.a,{position:"top left",text:r("Labels older than 30 days cannot be refunded.")},w.a.createElement("button",{className:"popover__menu-item shipping-label__item-menu-reprint-expired",role:"menuitem",tabIndex:"-1"},w.a.createElement(N.a,{icon:"refund",size:18}),w.a.createElement("span",null," ",r("Request refund")," ")));return w.a.createElement(U,{onClick:function(){n.props.openRefundDialog(o,a,e)},icon:"refund"},r("Request refund"))}),b()(p()(n),"renderReprint",function(e,t){var i=n.props,o=i.orderId,a=i.siteId,r=i.translate;if(t)return w.a.createElement(P.a,{position:"top left",text:r("Label images older than 180 days are deleted by our technology partners for general security and data privacy concerns.")},w.a.createElement("button",{className:"popover__menu-item shipping-label__item-menu-reprint-expired",role:"menuitem",tabIndex:"-1"},w.a.createElement(N.a,{icon:"print",size:18}),w.a.createElement("span",null," ",r("Reprint")," ")));return w.a.createElement(U,{onClick:function(){n.props.openReprintDialog(o,a,e)},icon:"print"},r("Reprint shipping label"))}),b()(p()(n),"renderLabelDetails",function(e){var t=n.props,i=t.orderId,o=t.siteId,a=t.translate;return w.a.createElement(U,{onClick:function(){n.props.openDetailsDialog(i,o,e)},icon:"info-outline"},a("View details"))}),b()(p()(n),"renderPickup",function(e){var t=n.props.translate,i={usps:"https://tools.usps.com/schedule-pickup-steps.htm",fedex:"https://www.fedex.com/en-us/shipping/schedule-manage-pickups.html",ups:"https://wwwapps.ups.com/pickup/request"};if(!i.hasOwnProperty(e))return null;return w.a.createElement(U,{onClick:function(){window.open(i[e],"_blank")},icon:"external"},t("Schedule a pickup"))}),n}return h()(t,e),r()(t,[{key:"renderCommercialInvoiceLink",value:function(){var e=this.props,t=e.translate,n=e.label.commercialInvoiceUrl;if(!n)return null;return w.a.createElement(U,{onClick:function(){window.open(n)},icon:"print"},t("Print customs form"))}},{key:"render",value:function(){var e=this.props,t=e.label,n=t.labelIndex,i=t.serviceName,o=t.packageName,a=t.productNames,r=t.receiptId,s=t.labelId,l=t.createdDate,c=t.refundableAmount,u=t.currency,d=t.showDetails,p=t.expiryDate,m=t.anonymized,h=t.usedDate,f=t.tracking,b=t.carrierId,g=t.commercialInvoiceUrl,v=e.siteId,y=e.orderId,k=e.translate,E=e.isModal,C=(new Date).getTime(),R=!1,I=!1;(m||h||p&&p<C)&&(R=!0);var N=(new Date).setDate((new Date).getDate()-30);return(m||h||l&&l<N)&&(I=!0),w.a.createElement("div",{className:"shipping-label__item"},w.a.createElement("p",{className:"shipping-label__item-detail"},k("%(service)s label (#%(labelIndex)d)",{args:{service:i,labelIndex:n+1}}),d&&w.a.createElement("span",null,!E&&w.a.createElement(A,{position:"bottom left"},this.renderLabelDetails(s),this.renderPickup(b),this.renderRefund(s,I),this.renderReprint(s,R),this.renderCommercialInvoiceLink(g)),w.a.createElement(ie,{siteId:v,orderId:y,labelIndex:n,serviceName:i,packageName:o,productNames:a,receiptId:r,labelId:s}),w.a.createElement(X,{siteId:v,orderId:y,createdDate:l,refundableAmount:c,currency:u,labelId:s}),w.a.createElement($,{siteId:v,orderId:y,labelId:s}))),d&&w.a.createElement("p",{className:"shipping-label__item-tracking"},k("Tracking #: {{trackingLink/}}",{components:{trackingLink:w.a.createElement(re,{carrierId:b,tracking:f})}})))}}]),t}(E.Component);se.propTypes={siteId:k.a.number.isRequired,orderId:k.a.number.isRequired,label:k.a.shape({serviceName:k.a.string.isRequired,labelIndex:k.a.number.isRequired,packageName:k.a.string.isRequired,productNames:k.a.string.isRequired,receiptId:k.a.number.isRequired,labelId:k.a.number.isRequired,createdDate:k.a.string.isRequired,refundableAmount:k.a.number.isRequired,currency:k.a.string.isRequired,showDetails:k.a.bool.isRequired,expiryDate:k.a.string.isRequired,anonymized:k.a.bool.isRequired,usedDate:k.a.string.isRequired,tracking:k.a.string.isRequired,carrierId:k.a.number.isRequired,commercialInvoiceUrl:k.a.string}).isRequired,isModal:k.a.bool.isRequired,openRefundDialog:k.a.func.isRequired,openReprintDialog:k.a.func.isRequired,openDetailsDialog:k.a.func.isRequired};var le=Object(g.b)(null,function(e){return Object(O.b)({openRefundDialog:K.y,openReprintDialog:K.z,openDetailsDialog:K.u},e)})(Object(v.localize)(se)),ce=function(e){function t(){return o()(this,t),l()(this,u()(t).apply(this,arguments))}return h()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.label,n=e.translate,i=t.serviceName,o=t.labelIndex;return w.a.createElement("div",{className:"shipping-label__item"},w.a.createElement("p",{className:"shipping-label__item-detail"},n("%(service)s label (#%(labelIndex)d)",{args:{service:i,labelIndex:o+1}}),w.a.createElement("br",null),n("Purchasing\u2026")))}}]),t}(se);se.propTypes={label:k.a.object.isRequired};var ue=Object(v.localize)(ce),de=n(602),pe=function(e){function t(){var e,n,i;o()(this,t);for(var a=arguments.length,r=new Array(a),s=0;s<a;s++)r[s]=arguments[s];return i=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(p()(i),"eventPropsByType",(n={},b()(n,R.a.INTERNAL_NOTE,function(e){return{icon:"aside",heading:(0,i.props.translate)("Internal note"),content:Object(de.a)(Object(de.b)(e.content))}}),b()(n,R.a.CUSTOMER_NOTE,function(e){return{icon:"mail",heading:(0,i.props.translate)("Note sent to customer"),content:Object(de.a)(Object(de.b)(e.content))}}),b()(n,R.a.LABEL_PURCHASING,function(e){return{icon:"sync",content:w.a.createElement(ue,{label:e,orderId:i.props.orderId,siteId:i.props.siteId})}}),b()(n,R.a.LABEL_PURCHASED,function(e){return{icon:"print",content:w.a.createElement(le,{label:e,orderId:i.props.orderId,siteId:i.props.siteId,isModal:i.props.isModal})}}),b()(n,R.a.LABEL_REFUND_REQUESTED,function(e){var t=i.props.translate;return{icon:"time",content:w.a.createElement("div",null,t("%(service)s label (#%(labelNum)d) refund requested (%(amount)s)",{args:{service:e.serviceName,labelNum:e.labelIndex+1,amount:D()(e.amount,e.currency)}}))}}),b()(n,R.a.LABEL_REFUND_COMPLETED,function(e){var t=i.props.translate;return{icon:"refund",content:w.a.createElement("div",null,t("%(service)s label (#%(labelNum)d) refunded (%(amount)s)",{args:{service:e.serviceName,labelNum:e.labelIndex+1,amount:D()(e.amount,e.currency)}}))}}),b()(n,R.a.LABEL_REFUND_REJECTED,function(e){var t=i.props.translate;return{icon:"cross-small",content:w.a.createElement("div",null,t("%(service)s label (#%(labelNum)d) refund rejected",{service:e.serviceName,args:{labelNum:e.labelIndex+1}}))}}),b()(n,R.a.REFUND_NOTE,function(e){var t=i.props.translate;return{icon:"credit-card",heading:t("Refund"),content:w.a.createElement("div",null,t("Refunded %(amount)s",{args:{amount:D()(e.amount,e.currency)}}),w.a.createElement("br",null),e.reason)}}),b()(n,void 0,function(){return{}}),n)),b()(p()(i),"renderDefaultEvent",function(e){return{icon:"aside",heading:(0,i.props.translate)("Note"),content:e.content}}),i}return h()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.moment,n=e.event,i=(this.eventPropsByType[n.type]||this.renderDefaultEvent)(n),o=i.icon,a=i.heading,r=i.content;return w.a.createElement("div",{className:"order-activity-log__note"},w.a.createElement("div",{className:"order-activity-log__note-meta"},w.a.createElement("span",{className:"order-activity-log__note-time"},t(n.timestamp).format("LT")),o&&w.a.createElement(N.a,{icon:o,size:24})),w.a.createElement("div",{className:"order-activity-log__note-body"},w.a.createElement("div",{className:"order-activity-log__note-type"},a),w.a.createElement("div",{className:"order-activity-log__note-content"},r)))}}]),t}(E.Component);b()(pe,"propTypes",{customer_note:k.a.bool,date_created_gmt:k.a.string,note:k.a.string.isRequired}),b()(pe,"propTypes",{event:k.a.object}),b()(pe,"defaultProps",{event:{}});var me=Object(v.localize)(pe),he=n(599),fe=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,a=new Array(i),r=0;r<i;r++)a[r]=arguments[r];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(a))),b()(p()(n),"onClick",function(){n.props.onClick(n.props.date)}),n}return h()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.count,n=e.date,i=e.isOpen,o=e.moment,a=e.translate,r=o(n,"YYYYMMDD").format("ll"),s=w.a.createElement("div",null,w.a.createElement("h3",null,r),w.a.createElement("small",null,a("%(count)s event","%(count)s events",{count:t,args:{count:t}})));return w.a.createElement("div",{className:"order-activity-log__day"},w.a.createElement(he.a,{onClick:this.onClick,className:"order-activity-log__day-header",expanded:i,header:s,screenReaderText:a("Show notes from %(date)s",{args:{date:r}})},this.props.children))}}]),t}(E.Component);b()(fe,"propTypes",{count:k.a.number.isRequired,date:k.a.string.isRequired,isOpen:k.a.bool.isRequired,onClick:k.a.func.isRequired});var be=Object(v.localize)(fe);var ge=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,a=new Array(i),r=0;r<i;r++)a[r]=arguments[r];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(a))),b()(p()(n),"toggleOpenDay",function(e){n.setState(function(){return{openDay:e}})}),b()(p()(n),"renderNotes",function(){var e=n.props,t=e.days,i=e.eventsByDay,o=e.translate;return t.length?w.a.createElement("div",null,t.map(function(e){var t=i[e];return w.a.createElement(be,{key:e,count:t.length,date:e,isOpen:e===n.state.openDay,onClick:n.toggleOpenDay},t.map(function(e){return w.a.createElement(me,{key:"".concat(e.type,"-").concat(e.key),event:e,orderId:n.props.orderId,siteId:n.props.siteId,isModal:n.props.isModal})}))})):w.a.createElement("p",null,o("No activity yet"))}),b()(p()(n),"renderPlaceholder",function(){return w.a.createElement("div",{className:"is-placeholder"},w.a.createElement(be,{count:0,date:"",isOpen:!0,index:1,onClick:C.noop},w.a.createElement(me,null)))}),n}return h()(t,e),r()(t,[{key:"UNSAFE_componentWillMount",value:function(){this.setState({openDay:Object(C.last)(Object(C.keys)(this.props.eventsByDay))})}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=Object(C.last)(Object(C.keys)(e.eventsByDay));this.props.eventsByDay[t]||this.setState({openDay:t})}},{key:"render",value:function(){return this.props.isLoaded?this.renderNotes():this.renderPlaceholder()}}]),t}(E.Component);b()(ge,"propTypes",{orderId:k.a.number.isRequired,siteId:k.a.number.isRequired});t.a=Object(g.b)(function(e,t){var n=t.orderId||!1,i=Object(R.c)(e,n),o=Object(R.b)(e,n),a=o.length?function(e){var t={};return e.forEach(function(e){var n=Object(v.moment)(e.timestamp).format("YYYYMMDD");t[n]?t[n].push(e):t[n]=[e]}),Object(C.keys)(t).forEach(function(e){t[e]=Object(C.sortBy)(t[e],["timestamp","key"]).reverse()}),t}(o):{},r=a?Object(C.keys)(a):[];return r.sort().reverse(),{isLoaded:i,days:r,events:o,eventsByDay:a}})(Object(v.localize)(ge))},787:function(e,t,n){"use strict";n.r(t);var i=n(10),o=n.n(i),a=n(12),r=n.n(a),s=n(109),l=n(30),c=n(35),u=n(534),d=n.n(u),p=n(551),m=n(548),h=n(540),f=n(542),b=n(537),g=n(685),v=function(e){var t=e.loaded,n=e.translate;if(!t)return null;var i=function(){return e.exitTrackingFlow(e.orderId,e.siteId,!1)};return o.a.createElement(p.a,{additionalClassNames:"woocommerce tracking-modal wcc-root",isVisible:e.showTrackingDialog,onClose:i},o.a.createElement("div",{className:"tracking-modal__content"},o.a.createElement("div",{className:"tracking-modal__header"},o.a.createElement(m.a,null,n("Which package would you like to track?")),o.a.createElement(f.a,{className:"tracking-modal__close-button",onClick:i},o.a.createElement(d.a,{icon:"cross"}))),o.a.createElement("div",{className:"tracking-modal__body"},o.a.createElement("div",{className:"tracking-modal__main-section"},o.a.createElement("div",{className:"shipment-tracking__dummy-class order-activity-log"},o.a.createElement(g.a,{orderId:e.orderId,siteId:e.siteId,isModal:!0}))))))};v.propTypes={siteId:r.a.number.isRequired,orderId:r.a.number.isRequired};t.default=Object(s.b)(function(e,t){var n=t.orderId,i=t.siteId,o=Object(b.s)(e,n,i),a=Object(b.i)(e,n,i);return{loaded:o,form:o&&a.form,showTrackingDialog:a.showTrackingDialog,isCustomsFormRequired:Object(b.o)(e,n,i)}},function(e){return Object(l.b)({exitTrackingFlow:h.p},e)})(Object(c.localize)(v))}}]);
|
dist/chunks/{295a2240a399d69fb7e8.css → 78a3522dc7a19158d37f.css}
RENAMED
File without changes
|
dist/chunks/78a3522dc7a19158d37f.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[147],{537:function(e,t,n){"use strict";n.d(t,"i",function(){return m}),n.d(t,"s",function(){return O}),n.d(t,"r",function(){return p}),n.d(t,"q",function(){return g}),n.d(t,"g",function(){return E}),n.d(t,"u",function(){return v}),n.d(t,"t",function(){return I}),n.d(t,"l",function(){return _}),n.d(t,"e",function(){return h}),n.d(t,"k",function(){return j}),n.d(t,"o",function(){return S}),n.d(t,"m",function(){return P}),n.d(t,"f",function(){return L}),n.d(t,"n",function(){return N}),n.d(t,"p",function(){return M}),n.d(t,"d",function(){return w}),n.d(t,"b",function(){return T}),n.d(t,"h",function(){return D}),n.d(t,"c",function(){return V}),n.d(t,"j",function(){return G}),n.d(t,"a",function(){return x});var r=n(1),i=n(35),a=n(544),o=n(532),c=n(552),u=n(543),s=n(541),d=n(565),f=n(575),l=n(563),b=n(566),m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",n,"shippingLabel",t],null)},O=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=m(e,t,n);return r&&r.loaded},p=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=m(e,t,n);return r&&r.isFetching},g=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=m(e,t,n);return r&&r.error},E=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=m(e,t,n);return r&&r.loaded?r.labels:[]},v=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=m(e,t,n);return r&&r.fulfillOrder},I=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=m(e,t,n);return r&&r.emailDetails},_=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=m(e,t,n);return r&&r.refreshedLabelStatus},h=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=m(e,t,n);return r&&r.form},j=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),a=h(e,t,n);if(!a)return null;var c=a.rates,u=c.values,s=c.available,d=[],f=0,l=0,b=function(e){if(!(e in s))return"continue";var t=u[e],n=t.serviceId,a=t.signatureRequired,o=s[e].default.rates,c=null,b=null;a in s[e]&&(c=s[e][a].rates,b=Object(r.find)(c,function(e){return n===e.service_id})||null);var m=Object(r.find)(o,function(e){return n===e.service_id});if(m){var O=m.retail_rate-m.rate,p=m.rate,g={title:m.title,retailRate:m.retail_rate,rateWithDiscount:p,addons:[],carrierId:m.carrier_id,carrierTitle:m.title.split("-")[0].trim()};null!==b&&(g.addons=[{title:Object(i.translate)("Signature Required"),rate:b.rate-m.rate}],p=b.rate),d.push(g),f+=Object(r.round)(O,2),l+=p}};for(var m in u)b(m);return d.length?{prices:d,discount:f,total:l}:null},S=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),i=h(e,t,n);if(Object(r.isEmpty)(i))return!1;var a=Object(d.a)(i.origin),c=Object(d.a)(i.destination);return!("US"!==a.country||!Object(r.includes)(f.d,a.state))||(!("US"!==c.country||!Object(r.includes)(f.d,c.state))||a.country!==c.country&&(!Object(r.includes)(f.b,a.country)||!Object(r.includes)(f.b,c.country)))},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return[h(e,t,n)]}),C=function(e,t,n,a){var o=t.values,c=Object(d.a)(t),u=c.phone,s=c.postcode,b=c.state,m=c.country,O={};return["name","address","city","postcode","country"].forEach(function(e){o[e]||(O[e]=Object(i.translate)("This field is required"))}),Object(r.includes)(f.a,m)&&!/^\d{5}(?:-\d{4})?$/.test(s)&&(O.postcode=Object(i.translate)("Invalid ZIP/Postal code format")),!b&&Object(l.j)(e,m,n)&&(O.state=Object(i.translate)("This field is required")),a&&(u?10!==u.split(/\D+/g).join("").replace(/^1/,"").length&&(O.phone=Object(i.translate)("Customs forms require a 10-digit phone number. Please edit your phone number so it has at most 10 digits.")):O.phone=Object(i.translate)("Please enter a phone number for your origin address. It's required because this shipment requires a customs form.")),O},y=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=e.isNormalized,o=e.isUnverifiable,c=e.normalized,u=e.ignoreValidation,s=e.fieldErrors;if((a||o)&&!c&&s)return s;if(a&&!c)return{address:Object(i.translate)("This address is not recognized. Please try another.")};var d=C(t,e,n,r);return u&&Object.keys(d).forEach(function(e){u[e]&&delete d[e]}),d},R=function(e,t,n,a){var o=Object(r.uniq)(Object(r.flatten)(Object(r.map)(e,function(e){return Object(r.map)(e.items,"product_id")}))),c=Object(r.zipObject)(o,Object(r.fill)(Array(o.length),0));Object(r.forEach)(e,function(e){Object(r.forEach)(e.items,function(e){var n=e.quantity,r=e.product_id;return c[r]+=n*t.items[r].value})});var u={};return Object(r.forEach)(Object(r.pick)(t.items,o),function(e,t){e.tariffNumber&&6===e.tariffNumber.length&&(u[e.tariffNumber]||(u[e.tariffNumber]=0),u[e.tariffNumber]+=c[t])}),{packages:Object(r.mapValues)(e,function(e){var o={};"other"!==e.contentsType||e.contentsExplanation||(o.contentsExplanation=Object(i.translate)("Please describe what kind of goods this package contains")),"other"!==e.restrictionType||e.restrictionComments||(o.restrictionComments=Object(i.translate)("Please describe what kind of restrictions this package must have"));var c=new Set;return Object(r.forEach)(e.items,function(e){var n=e.product_id,r=t.items[n].tariffNumber;2500<u[r]&&c.add(r)}),e.itn?/^(?:(?:AES X\d{14})|(?:NOEEI 30\.\d{1,2}(?:\([a-z]\)(?:\(\d\))?)?))$/.test(e.itn)||(o.itn=Object(i.translate)("Invalid format")):"CA"!==n&&(Object(r.isEmpty)(c)?Object(r.includes)(f.c,n)&&(o.itn=Object(i.translate)("International Transaction Number is required for shipments to %(country)s",{args:{country:a}})):o.itn=Object(i.translate)("International Transaction Number is required for shipping items valued over $2,500 per tariff number. Products with tariff number %(code)s add up to more than $2,500.",{args:{code:c.values().next().value}})),o}),items:Object(r.mapValues)(Object(r.pick)(t.items,o),function(e,n){var a={};return e.description||(a.description=Object(i.translate)("This field is required")),t.ignoreWeightValidation[n]||(Object(r.isNil)(e.weight)||""===e.weight?a.weight=Object(i.translate)("This field is required"):parseFloat(e.weight)>0||(a.weight=Object(i.translate)("Weight must be greater than zero"))),t.ignoreValueValidation[n]||(Object(r.isNil)(e.value)||""===e.value?a.value=Object(i.translate)("This field is required"):parseFloat(e.value)>0||(a.value=Object(i.translate)("Declared value must be greater than zero"))),e.tariffNumber&&6!==e.tariffNumber.length&&(a.tariffNumber=Object(i.translate)("The tariff number must be 6 digits long")),a})}},P=function(e){var t=e.values,n=e.available,i=Object(r.map)(n,function(e,n){return t[n]});return!Object(r.isEmpty)(i)&&Object(r.every)(i)},k=function(e){var t=e.values,n=e.available;return Object(r.mapValues)(n,function(e,n){if(!Object(r.isEmpty)(e.default.errors)){var a=e.default.errors.map(function(e){return e.userMessage||e.message}).filter(Boolean);return a.length?a:["We couldn't get a rate for this package, please try again."]}return t[n]&&t[n].serviceId?[]:Object(r.isEmpty)(e.default.rates)?[Object(i.translate)("No rates available, please double check dimensions and weight or try using different packaging.")]:[Object(i.translate)("Please choose a rate")]})},A=function(e){var t={};return e||(t.paperSize=Object(i.translate)("This field is required")),t},L=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);if(!O(e,t,n))return{};var a=m(e,t,n),c=a.form,u=a.paperSize;if(Object(r.isEmpty)(c))return{};var s,d=c.destination.values.country,f=Object(l.g)(e,d,n),b=S(e,t,n);return{origin:y(c.origin,e,n,b),destination:y(c.destination,e,n),packages:(s=c.packages.selected,Object(r.mapValues)(s,function(e){var t={};"not_selected"===e.box_id&&(t.box_id=Object(i.translate)("Please select a package"));var n=function(e){return!Object(r.isFinite)(e)||0>=e};return n(e.weight)&&(t.weight=Object(i.translate)("Invalid weight")),Object(r.some)([e.length,e.width,e.height],n)&&(t.dimensions=Object(i.translate)("Package dimensions must be greater than zero")),t})),customs:R(c.packages.selected,c.customs,d,f),rates:k(c.rates),sidebar:A(u)}},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return[m(e,t,n)]}),N=Object(a.a)(function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(o.a)(e),i=m(e,t,r).form,a="origin"===n&&S(e,t,r),c=C(e,i[n],r,a);return 0===Object.keys(c).length},function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(o.a)(e);return[m(e,t,r).form[n]]}),M=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),i=h(e,t,n);if(!i)return!1;var a=Object(r.uniq)(Object(r.flatten)(Object(r.map)(i.packages.selected,function(e){return Object(r.map)(e.items,"product_id")})));return!Object(r.some)(a.map(function(e){return Object(r.isNil)(i.customs.items[e].tariffNumber)||i.customs.ignoreWeightValidation[e]||i.customs.ignoreValueValidation[e]}))},w=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),i=h(e,t,n);if(!i)return null;var a=L(e,t,n);return i.origin.isNormalized&&Object(r.isEqual)(i.origin.values,i.origin.normalized)&&!Object(c.a)(a.origin)?i.destination.isNormalized&&Object(r.isEqual)(i.destination.values,i.destination.normalized)&&!Object(c.a)(a.destination)?Object(c.a)(a.packages)?"packages":!S(e,t,n)||!Object(c.a)(a.customs)&&M(e,t,n)?Object(c.a)(a.rates)?"rates":null:"customs":"destination":"origin"},T=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),i=h(e,t,n);return!Object(r.isEmpty)(i)&&!w(e,t,n)&&!i.origin.normalizationInProgress&&!i.destination.normalizationInProgress&&!i.rates.retrievalInProgress&&!Object(r.isEmpty)(i.rates.available)},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return[h(e,t,n),w(e,t,n)]}),D=Object(a.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(o.a)(e),n=Object(l.d)(e,t);return Object(b.b)(e,t)?Object(r.pick)(n,f.a):Object(r.pick)(n,f.b)},[l.d,b.b]),V=Object(a.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(o.a)(e),n=Object(l.d)(e,t);return Object(b.b)(e,t)?n:Object(r.pick)(n,f.b)},[l.d,b.b]),G=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);if(!Object(l.j)(e,t,n))return null;var i=Object(l.i)(e,t,n),a={};return i.forEach(function(e){var t=e.code,n=e.name;return a[t]=n}),"US"!==t||Object(b.b)(e,n)?a:Object(r.omit)(a,f.d)},[l.i,b.b]),x=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return O(e,t,n)&&Object(u.d)(e,n)&&Object(s.i)(e,n)&&Object(l.b)(e,n)}},538:function(e,t,n){"use strict";n.d(t,"i",function(){return r}),n.d(t,"k",function(){return i}),n.d(t,"l",function(){return a}),n.d(t,"m",function(){return o}),n.d(t,"j",function(){return c}),n.d(t,"h",function(){return u}),n.d(t,"n",function(){return s}),n.d(t,"o",function(){return d}),n.d(t,"p",function(){return f}),n.d(t,"q",function(){return l}),n.d(t,"r",function(){return b}),n.d(t,"s",function(){return m}),n.d(t,"t",function(){return O}),n.d(t,"u",function(){return p}),n.d(t,"v",function(){return g}),n.d(t,"x",function(){return E}),n.d(t,"w",function(){return v}),n.d(t,"y",function(){return I}),n.d(t,"z",function(){return _}),n.d(t,"A",function(){return h}),n.d(t,"B",function(){return j}),n.d(t,"C",function(){return S}),n.d(t,"D",function(){return C}),n.d(t,"I",function(){return y}),n.d(t,"E",function(){return R}),n.d(t,"J",function(){return P}),n.d(t,"G",function(){return k}),n.d(t,"H",function(){return A}),n.d(t,"K",function(){return L}),n.d(t,"L",function(){return N}),n.d(t,"M",function(){return M}),n.d(t,"N",function(){return w}),n.d(t,"O",function(){return T}),n.d(t,"P",function(){return D}),n.d(t,"Q",function(){return V}),n.d(t,"R",function(){return G}),n.d(t,"S",function(){return x}),n.d(t,"T",function(){return U}),n.d(t,"U",function(){return W}),n.d(t,"F",function(){return F}),n.d(t,"V",function(){return B}),n.d(t,"W",function(){return z}),n.d(t,"X",function(){return H}),n.d(t,"Y",function(){return q}),n.d(t,"Z",function(){return K}),n.d(t,"ab",function(){return Q}),n.d(t,"bb",function(){return J}),n.d(t,"Vb",function(){return Y}),n.d(t,"cb",function(){return Z}),n.d(t,"db",function(){return X}),n.d(t,"eb",function(){return $}),n.d(t,"fb",function(){return ee}),n.d(t,"gb",function(){return te}),n.d(t,"hb",function(){return ne}),n.d(t,"ib",function(){return re}),n.d(t,"jb",function(){return ie}),n.d(t,"kb",function(){return ae}),n.d(t,"lb",function(){return oe}),n.d(t,"mb",function(){return ce}),n.d(t,"nb",function(){return ue}),n.d(t,"ob",function(){return se}),n.d(t,"pb",function(){return de}),n.d(t,"qb",function(){return fe}),n.d(t,"rb",function(){return le}),n.d(t,"sb",function(){return be}),n.d(t,"ub",function(){return me}),n.d(t,"tb",function(){return Oe}),n.d(t,"vb",function(){return pe}),n.d(t,"wb",function(){return ge}),n.d(t,"xb",function(){return Ee}),n.d(t,"yb",function(){return ve}),n.d(t,"zb",function(){return Ie}),n.d(t,"Ab",function(){return _e}),n.d(t,"Bb",function(){return he}),n.d(t,"Cb",function(){return je}),n.d(t,"Db",function(){return Se}),n.d(t,"Eb",function(){return Ce}),n.d(t,"Gb",function(){return ye}),n.d(t,"Hb",function(){return Re}),n.d(t,"Ib",function(){return Pe}),n.d(t,"Jb",function(){return ke}),n.d(t,"Kb",function(){return Ae}),n.d(t,"Lb",function(){return Le}),n.d(t,"Mb",function(){return Ne}),n.d(t,"Nb",function(){return Me}),n.d(t,"Ob",function(){return we}),n.d(t,"Pb",function(){return Te}),n.d(t,"Qb",function(){return De}),n.d(t,"Fb",function(){return Ve}),n.d(t,"Sb",function(){return Ge}),n.d(t,"Rb",function(){return xe}),n.d(t,"Tb",function(){return Ue}),n.d(t,"Ub",function(){return We}),n.d(t,"Wb",function(){return Fe}),n.d(t,"Xb",function(){return Be}),n.d(t,"Yb",function(){return ze}),n.d(t,"a",function(){return He}),n.d(t,"g",function(){return qe}),n.d(t,"e",function(){return Ke}),n.d(t,"f",function(){return Qe}),n.d(t,"c",function(){return Je}),n.d(t,"d",function(){return Ye}),n.d(t,"b",function(){return Ze});var r="WOOCOMMERCE_SERVICES_LABELS_INIT_FORM",i="WOOCOMMERCE_SERVICES_LABELS_RESTORE_PRISTINE",a="WOOCOMMERCE_SERVICES_LABELS_SET_FORM_DATA_VALUE",o="WOOCOMMERCE_SERVICES_LABELS_SET_FORM_META_PROPERTY",c="WOOCOMMERCE_SERVICES_LABELS_OPEN_ADD_CARD_DIALOG",u="WOOCOMMERCE_SERVICES_LABELS_CLOSE_ADD_CARD_DIALOG",s="WOOCOMMERCE_SERVICES_PACKAGES_ADD_PACKAGE",d="WOOCOMMERCE_SERVICES_PACKAGES_DISMISS_MODAL",f="WOOCOMMERCE_SERVICES_PACKAGES_EDIT_PACKAGE",l="WOOCOMMERCE_SERVICES_PACKAGES_INIT_PACKAGES_FORM",b="WOOCOMMERCE_SERVICES_PACKAGES_REMOVE_PACKAGE",m="WOOCOMMERCE_SERVICES_PACKAGES_REMOVE_PREDEFINED",O="WOOCOMMERCE_SERVICES_PACKAGES_SAVE_PACKAGE",p="WOOCOMMERCE_SERVICES_PACKAGES_SAVE_PREDEFINED",g="WOOCOMMERCE_SERVICES_PACKAGES_SET_ADD_MODE",E="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_FETCH_ERROR",v="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_FETCHING",I="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_SAVING",_="WOOCOMMERCE_SERVICES_PACKAGES_SET_MODAL_ERROR",h="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_ALL_PREDEFINED",j="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_OUTER_DIMENSIONS",S="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_PREDEFINED",C="WOOCOMMERCE_SERVICES_PACKAGES_UPDATE_PACKAGES_FIELD",y="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADD_ITEMS",R="WOOCOMMERCE_SERVICES_SERVICE_SETTINGS_UPDATE_FIELD",P="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADD_PACKAGE",k="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADDRESS_NORMALIZATION_COMPLETED",A="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADDRESS_NORMALIZATION_IN_PROGRESS",L="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLEAR_AVAILABLE_RATES",N="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_ADD_ITEM",M="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_DETAILS_DIALOG",w="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_ITEM_MOVE",T="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_REFUND_DIALOG",D="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_REPRINT_DIALOG",V="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CONFIRM_ADDRESS_SUGGESTION",G="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CONFIRM_REPRINT",x="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EDIT_ADDRESS",U="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EDIT_UNVERIFIABLE_ADDRESS",W="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EXIT_PRINTING_FLOW",F="WOOCOMMERCE_SERVICES_SHIPPING_EXIT_TRACKING_FLOW",B="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_INIT",z="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_MOVE_ITEM",H="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_ADD_ITEM",q="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_DETAILS_DIALOG",K="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_ITEM_MOVE",Q="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_PACKAGE",J="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_PRINTING_FLOW",Y="WOOCOMMERCE_SERVICES_SHIPPING_OPEN_TRACKING_FLOW",Z="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_REFUND_DIALOG",X="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_REPRINT_DIALOG",$="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_PURCHASE_REQUEST",ee="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_PURCHASE_RESPONSE",te="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_RATES_RETRIEVAL_COMPLETED",ne="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_RATES_RETRIEVAL_IN_PROGRESS",re="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REFUND_REQUEST",ie="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REFUND_RESPONSE",ae="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REMOVE_IGNORE_VALIDATION",oe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REMOVE_PACKAGE",ce="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REPRINT_DIALOG_ERROR",ue="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REPRINT_DIALOG_READY",se="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SAVE_CUSTOMS",de="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SAVE_PACKAGES",fe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SELECT_NORMALIZED_ADDRESS",le="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ABANDON_ON_NON_DELIVERY",be="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ADDED_ITEM",me="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CONTENTS_TYPE",Oe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CONTENTS_EXPLANATION",pe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_DESCRIPTION",ge="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_ORIGIN_COUNTRY",Ee="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_TARIFF_NUMBER",ve="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_VALUE",Ie="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_WEIGHT",_e="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_EMAIL_DETAILS",he="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_FETCH_ERROR",je="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_FULFILL_ORDER",Se="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_IS_FETCHING",Ce="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ITN",ye="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_PACKAGE_TYPE",Re="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RATES",Pe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RESTRICTION_COMMENTS",ke="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RESTRICTION_TYPE",Ae="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_TARGET_PACKAGE",Le="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SHOW_PRINT_CONFIRMATION",Ne="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_STATUS_RESPONSE",Me="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_STATUS_RETRIEVAL_IN_PROGRESS",we="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_TOGGLE_STEP",Te="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_ADDRESS_VALUE",De="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_PACKAGE_WEIGHT",Ve="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_PACKAGE_SIGNATURE",Ge="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_RATE",xe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_PAPER_SIZE",Ue="WOOCOMMERCE_SERVICES_SHIPPING_METHOD_SCHEMA_REQUEST",We="WOOCOMMERCE_SERVICES_SHIPPING_METHOD_SCHEMA_REQUEST_SUCCESS",Fe="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_SETTINGS_REQUEST",Be="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_SETTINGS_REQUEST_SUCCESS",ze="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_UPDATE",He="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_CONNECTION_SUCCESS",qe="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_UPDATE_SETTINGS",Ke="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_TOGGLE_IS_SAVING",Qe="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_TOGGLE_SHOW_UPS_INVOICE_FIELDS",Je="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_ENABLE_CANCEL_CONNECTION_DIALOG",Ye="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_ENABLE_DISCONNECT_DIALOG",Ze="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_DISCONNECT_CARRIER"},539:function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"a",function(){return i});var r="LOADING",i="ERROR"},540:function(e,t,n){"use strict";n.d(t,"q",function(){return R}),n.d(t,"U",function(){return P}),n.d(t,"x",function(){return M}),n.d(t,"A",function(){return w}),n.d(t,"o",function(){return T}),n.d(t,"p",function(){return D}),n.d(t,"V",function(){return V}),n.d(t,"C",function(){return G}),n.d(t,"m",function(){return x}),n.d(t,"n",function(){return U}),n.d(t,"g",function(){return W}),n.d(t,"T",function(){return F}),n.d(t,"W",function(){return B}),n.d(t,"w",function(){return z}),n.d(t,"v",function(){return H}),n.d(t,"s",function(){return q}),n.d(t,"d",function(){return K}),n.d(t,"S",function(){return Q}),n.d(t,"t",function(){return J}),n.d(t,"b",function(){return Y}),n.d(t,"E",function(){return Z}),n.d(t,"a",function(){return X}),n.d(t,"P",function(){return $}),n.d(t,"i",function(){return ee}),n.d(t,"G",function(){return te}),n.d(t,"F",function(){return ne}),n.d(t,"R",function(){return re}),n.d(t,"Q",function(){return ie}),n.d(t,"D",function(){return ae}),n.d(t,"O",function(){return oe}),n.d(t,"H",function(){return ce}),n.d(t,"J",function(){return ue}),n.d(t,"L",function(){return se}),n.d(t,"K",function(){return de}),n.d(t,"I",function(){return fe}),n.d(t,"h",function(){return le}),n.d(t,"Y",function(){return be}),n.d(t,"M",function(){return me}),n.d(t,"N",function(){return Oe}),n.d(t,"B",function(){return je}),n.d(t,"j",function(){return Se}),n.d(t,"y",function(){return Ce}),n.d(t,"r",function(){return ye}),n.d(t,"e",function(){return Re}),n.d(t,"k",function(){return Pe}),n.d(t,"z",function(){return ke}),n.d(t,"f",function(){return Ae}),n.d(t,"l",function(){return Le}),n.d(t,"X",function(){return Ne}),n.d(t,"u",function(){return Me}),n.d(t,"c",function(){return we});var r=n(110),i=n.n(r),a=n(36),o=n.n(a),c=n(35),u=n(1),s=n(547),d=Object(u.memoize)(function(){if(Object(u.get)(window,"navigator.msSaveOrOpenBlob"))return"ie";if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream)return"addon";if(Object(u.includes)(navigator.userAgent,"Firefox"))return"addon";if(navigator.mimeTypes["application/pdf"])return"native";var e=function(e){try{return new ActiveXObject(e)}catch(t){}};return!(!e("AcroPDF.PDF")&&!e("PDF.PdfCtrl"))&&"addon"}),f=null,l=function(e){return new Promise(function(t,n){f&&document.body.removeChild(f),(f=document.createElement("iframe")).src=e,f.style.position="fixed",f.style.left="-999px",f.onload=function(){t()},f.onerror=function(e){n(e)},document.body.appendChild(f)})},b=function(e,t){var n=function(e,t){for(var n=atob(e),r=n.length,i=new Uint8Array(new ArrayBuffer(r)),a=0;a<r;a++)i[a]=n.charCodeAt(a);return new Blob([i],{type:t})}(e.b64Content,e.mimeType),r="ie"!==d()?URL.createObjectURL(n):null;switch(d()){case"native":return l(r).then(function(){f.contentWindow.print(),URL.revokeObjectURL(r)});case"addon":var i=window.open(r);return setTimeout(function(){return URL.revokeObjectURL(r)},1e3),i?Promise.resolve():Promise.reject(new Error("Unable to open label PDF in new tab"));case"ie":return window.navigator.msSaveOrOpenBlob(n,t)?Promise.resolve():Promise.reject(new Error("Unable to download the PDF"));default:return l(r),setTimeout(function(){return URL.revokeObjectURL(r)},0),Promise.resolve()}},m=n(549),O=n(552),p=n(538),g=function(e,t,n,r,i){n({type:p.H,group:i,orderId:e,siteId:t});return s.c(t,s.d.addressNormalization(),{address:r,type:i}).then(function(r){n({type:p.G,siteId:t,orderId:e,group:i,requestSuccess:!0,fieldErrors:r.field_errors,normalized:r.normalized,isTrivialNormalization:r.is_trivial_normalization})}).catch(function(r){throw n(m.a(Object(c.translate)("Error validating %(group)s address: %(error)s",{args:{group:i,error:r}}))),n({type:p.G,siteId:t,orderId:e,group:i,requestSuccess:!1}),r})},E=n(604),v=n(537),I=n(687),_=n(638),h=n(541),j=n(543),S=n(565),C="label-image-download-failed",y="label-image-download-printing",R=function(e,t){return function(n){n({type:p.Db,orderId:e,siteId:t,isFetching:!0}),s.b(t,s.d.orderLabels(e)).then(function(r){n(o()({type:p.V,siteId:t,orderId:e},r))}).catch(function(r){n({type:p.Bb,orderId:e,siteId:t,error:!0}),console.error(r)}).then(function(){return n({type:p.Db,orderId:e,siteId:t,isFetching:!1})})}},P=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return{type:p.Ob,siteId:t,orderId:e,stepName:n,expanded:r}},k=function(e,t,n,r){var i=r(),a=Object(v.i)(i,e,t).form,o=Object(v.d)(i,e,t);o&&!a[o].expanded&&n(P(e,t,o))},A=function(e,t){var n=Object(u.pick)(e,["id","box_id","service_id","length","width","height","weight","signature","is_letter"]);return t&&(n.contents_type=e.contentsType||"merchandise","other"===e.contentsType&&(n.contents_explanation=e.contentsExplanation),n.restriction_type=e.restrictionType||"none","other"===e.restrictionType&&(n.restriction_comments=e.restrictionComments),n.non_delivery_option=e.abandonOnNonDelivery?"abandon":"return",n.itn=e.itn||"",n.items=Object(u.uniqBy)(e.items,"product_id").map(function(n){var r=n.product_id,i=Object(u.sumBy)(Object(u.filter)(e.items,{product_id:r}),"quantity");return{description:t[r].description,quantity:i,value:i*t[r].value,weight:i*t[r].weight,hs_tariff_number:t[r].tariffNumber||"",origin_country:t[r].originCountry,product_id:r}})),n},L=function(e,t){return{type:p.K,orderId:e,siteId:t}},N=function e(t,n,r,i){var a=i(),o=Object(v.d)(a,t,n);if(o&&"rates"!==o)k(t,n,r,i);else{var d=Object(v.i)(a,t,n).form,f=d.origin,l=d.destination,b=d.packages,O=d.customs;r(m.c("wcs-label-rates"));var g=Object(v.o)(i(),t,n)?O.items:null,E=Object(u.map)(b.selected,function(e){return A(e,g)});(function(e,t,n,r,i,a){var o={origin:r,destination:i,packages:a};return n({type:p.hb,requestData:o,siteId:t,orderId:e}),new Promise(function(r,i){var a=null,c=function(c){c||(n({type:p.gb,requestData:o,siteId:t,orderId:e}),a?setTimeout(function(){return i(a)},0):setTimeout(r,0))};c(!0),s.c(t,s.d.getLabelRates(e),o).then(function(r){n({type:p.Hb,rates:r.rates,requestData:o,siteId:t,orderId:e})}).catch(function(e){return a=e}).then(function(){return c(!1)})})})(t,n,r,f.values,l.values,E).then(function(){return k(t,n,r,i)}).catch(function(a){console.error(a),r(m.a(a.toString(),{id:"wcs-label-rates",button:Object(c.translate)("Retry"),onClick:function(){return e(t,n,r,i)}}))})}},M=function(e,t){return function(n,r){var i,a=Object(v.i)(r(),e,t).form,o=a.origin,c=a.destination,u=Object(v.f)(r(),e,t),s=[];o.ignoreValidation||Object(O.a)(u.origin)||o.isNormalized||o.normalizationInProgress||s.push(g(e,t,n,o.values,"origin")),(o.ignoreValidation||Object(O.a)(u.origin))&&n(P(e,t,"origin")),c.ignoreValidation||Object(O.a)(u.destination)||c.isNormalized||c.normalizationInProgress||s.push(g(e,t,n,c.values,"destination")),(c.ignoreValidation||Object(O.a)(u.destination))&&n(P(e,t,"destination")),(i=s,Promise.all(i.map(function(e){return e.catch(function(e){return e})}))).then(function(){return N(e,t,n,r)}),n({type:p.bb,orderId:e,siteId:t})}},w=function(e,t){return function(n){n({type:p.Vb,orderId:e,siteId:t})}},T=function(e,t,n){return function(r,i){r({type:p.U,orderId:e,siteId:t,force:n}),Object(v.i)(i(),e,t).form.needsPrintConfirmation&&r(L(e,t))}},D=function(e,t){return function(n){n({type:p.F,orderId:e,siteId:t})}},V=function(e,t,n,r,i){return{type:p.Pb,siteId:t,orderId:e,group:n,name:r,value:i}},G=function(e,t,n,r){return{type:p.qb,siteId:t,orderId:e,group:n,selectNormalized:r}},x=function(e,t,n){return{type:p.S,siteId:t,orderId:e,group:n}},U=function(e,t,n){return{type:p.T,siteId:t,orderId:e,group:n}},W=function(e,t,n){return function(r,i){r({type:p.Q,siteId:t,orderId:e,group:n}),N(e,t,r,i)}},F=function(e,t,n){return function(r,i){var a=Object(v.i)(i(),e,t).form[n];if(a.ignoreValidation){r(function(e,t,n){return{type:p.kb,siteId:t,orderId:e,group:n}}(e,t,n));var o=Object(v.f)(i(),e,t);if(Object(O.a)(o[n]))return;a=Object(v.i)(i(),e,t).form[n]}return g(e,t,r,Object(v.i)(i(),e,t).form[n].values,n).then(function(){var a=Object(v.i)(i(),e,t).form[n],o=a.values,c=a.normalized,s=a.expanded;Object(u.isEqual)(o,c)&&(s&&r(P(e,t,n)),N(e,t,r,i))})}},B=function(e,t,n,r){return{type:p.Qb,siteId:t,orderId:e,packageId:n,value:r}},z=function(e,t,n){return{type:p.ab,siteId:t,orderId:e,openedPackageId:n}},H=function(e,t,n){return{type:p.Z,siteId:t,orderId:e,movedItemIndex:n}},q=function(e,t,n,r,i){return{type:p.W,siteId:t,orderId:e,originPackageId:n,movedItemIndex:r,targetPackageId:i}},K=function(e,t){return{type:p.N,siteId:t,orderId:e}},Q=function(e,t,n){return{type:p.Kb,targetPackageId:n,siteId:t,orderId:e}},J=function(e,t){return{type:p.X,siteId:t,orderId:e}},Y=function(e,t){return{type:p.L,siteId:t,orderId:e}},Z=function(e,t,n,r,i){return{type:p.sb,siteId:t,orderId:e,sourcePackageId:n,movedItemIndex:r,added:i}},X=function(e,t,n){return{type:p.I,siteId:t,orderId:e,targetPackageId:n}},$=function(e,t,n,r){return function(i,a){var o=Object(h.a)(a(),t)[r];i({type:p.Gb,siteId:t,orderId:e,packageId:n,boxTypeId:r,box:o})}},ee=function(e,t){return function(n,r){n(P(e,t,"packages")),n(function(e,t){return{type:p.pb,siteId:t,orderId:e}}(e,t)),N(e,t,n,r)}},te=function(e,t,n,r){return{type:p.ub,siteId:t,orderId:e,packageId:n,contentsType:r}},ne=function(e,t,n,r){return{type:p.tb,siteId:t,orderId:e,packageId:n,contentsExplanation:r}},re=function(e,t,n,r){return{type:p.Jb,siteId:t,orderId:e,packageId:n,restrictionType:r}},ie=function(e,t,n,r){return{type:p.Ib,siteId:t,orderId:e,packageId:n,restrictionComments:r}},ae=function(e,t,n,r){return{type:p.rb,siteId:t,orderId:e,packageId:n,abandonOnNonDelivery:r}},oe=function(e,t,n,r){return{type:p.Eb,siteId:t,orderId:e,packageId:n,itn:r}},ce=function(e,t,n,r){return{type:p.vb,siteId:t,orderId:e,productId:n,description:r}},ue=function(e,t,n,r){return{type:p.xb,siteId:t,orderId:e,productId:n,tariffNumber:r}},se=function(e,t,n,r){return{type:p.zb,siteId:t,orderId:e,productId:n,weight:r}},de=function(e,t,n,r){return{type:p.yb,siteId:t,orderId:e,productId:n,value:r}},fe=function(e,t,n,r){return{type:p.wb,siteId:t,orderId:e,productId:n,originCountry:r}},le=function(e,t){return function(n,r){n(P(e,t,"customs")),n(function(e,t){return{type:p.ob,siteId:t,orderId:e}}(e,t)),N(e,t,n,r)}},be=function(e,t,n,r,i,a){return{type:p.Sb,siteId:t,carrierId:i,orderId:e,packageId:n,serviceId:r,signatureRequired:a}},me=function(e,t,n){return{type:p.Ab,siteId:t,orderId:e,value:n}},Oe=function(e,t,n){return{type:p.Cb,siteId:t,orderId:e,value:n}},pe=function(e,t,n,r){return{type:p.fb,orderId:e,siteId:t,response:n,error:r}},ge=function(e,t,n,r,i){n(pe(e,t,null,!0));var a={button:Object(c.translate)("Go to Credit Cards settings."),onClick:function(){window.open("admin.php?page=wc-settings&tab=shipping§ion=woocommerce-services-settings")}};n(m.a(i.toString(),a)),n(L(e,t)),N(e,t,n,r,u.noop)},Ee=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"order-#".concat(e,"-label")+(t?"-reprint":"")+".pdf"},ve=function(e,t,n,r,i,a){n(T(e,t,!0)),n(L(e,t)),i||(Object(v.t)(r(),e,t)&&n(Object(I.a)(t,e,{note:Object(c.translate)("Your order has been shipped. The tracking number is %(trackingNumbers)s.","Your order consisting of %(packageCount)d packages has been shipped. The tracking numbers are %(trackingNumbers)s.",{args:{packageCount:a.length,trackingNumbers:a.map(function(e){var t=e.tracking,n={usps:"USPS",ups:"UPS"}[e.carrier_id||""];return n?"".concat(t," (").concat(n,")"):t}).join(", ")},count:a.length}),customer_note:!0})),Object(v.u)(r(),e,t)&&n(Object(_.f)(t,{id:e,status:"completed"})))},Ie=function(e){return m.d(Object(c.translate)("Your shipping label was purchased successfully","Your %(count)d shipping labels were purchased successfully",{count:e,args:{count:e}}))},_e=function(e,t){var n=Object(c.translate)('Your shipping label was purchased successfully, but could not be printed automatically. Click "Reprint" to try again.','Your shipping labels were purchased successfully, but some of them could not be printed automatically. Click "Reprint" to try again.',{count:e});return m.a(n,{id:C,button:Object(c.translate)("Reprint"),onClick:t})};var he=function e(t,n,r,a,o){var f=Object(u.find)(o,{status:"PURCHASE_ERROR"});f?ge(t,n,r,a,f.error):Object(u.every)(o,{status:"PURCHASED"})?(r(pe(t,n,o,!1)),function e(t,n,r,a,o){var u=arguments,f=1===o.length?[{labelId:o[0].label_id}]:o.map(function(e,t){return{caption:Object(c.translate)("PACKAGE %(num)d (OF %(total)d)",{args:{num:t+1,total:o.length}}),labelId:e.label_id}}),l=Object(v.i)(a(),t,n).paperSize,O=Object(E.b)(l,f),g=function(){r(Ie(f.length))},I=function(){r(m.c(C)),r(m.b(Object(c.translate)("Printing\u2026"),{id:y})),e.apply(void 0,i()(u))},_=!1,h=o.map(function(e){return e.commercial_invoice_url}).filter(function(e){return e});if(h&&0<h.length){r(m.b(Object(c.translate)("Note: A customs form will open in a new tab and must be printed and included on this international shipment."),{}));var j=!0,S=!1,R=void 0;try{for(var P,k=h[Symbol.iterator]();!(j=(P=k.next()).done);j=!0){var A=P.value;window.open(A)}}catch(N){S=!0,R=N}finally{try{j||null==k.return||k.return()}finally{if(S)throw R}}}s.b(n,O).then(function(e){r(m.c(y)),"addon"===d()?(g(),r({type:p.Lb,orderId:t,siteId:n,fileData:e,labels:o})):b(e,Ee(t)).then(function(){g()}).catch(function(e){r(m.a(e.toString())),_=!0}).then(function(){ve(t,n,r,a,_,o)})}).catch(function(){r(T(t,n,!0)),r(L(t,n)),r(m.c(y)),r(_e(o.length,I))})}(t,n,r,a,o)):setTimeout(function(){var i=o.map(function(e){return"PURCHASED"===e.status?e:function e(t,n,r,i){var a=1e3;return 0===i&&(a=2e3),s.b(n,s.d.labelStatus(t,r)).then(function(e){return e.label}).catch(function(o){if(!Object(u.includes)(o,"cURL error 28")||i>=3)throw o;return new Promise(function(o){setTimeout(function(){return o(e(t,n,r,i+1))},a)})})}(t,n,e.label_id,0)});Promise.all(i).then(function(i){return e(t,n,r,a,i)}).catch(function(e){return ge(t,n,r,a,e)})},1e3)},je=function(e,t){return function(n,r){var i=null,a=null,c=function(e){return i=e},d=function(e){a=e.labels},f=function(o){o?n({type:p.eb,orderId:e,siteId:t}):i?ge(e,t,n,r,i):he(e,t,n,r,a)},l=Object(v.i)(r(),e,t).form,b=[];if(!l.origin.isNormalized){var O=g(e,t,n,l.origin.values,"origin");b.push(O)}if(!l.destination.isNormalized){var E=g(e,t,n,l.destination.values,"destination");b.push(E)}Promise.all(b).then(function(n){if(Object(u.every)(n)){l=Object(v.i)(r(),e,t).form;var i=Object(v.o)(r(),e,t)?l.customs.items:null,a={async:!0,origin:Object(S.a)(l.origin),destination:Object(S.a)(l.destination),packages:Object(u.map)(l.packages.selected,function(e,t){var n=l.rates.values[t],r=n.serviceId,a=n.signatureRequired,c=a in l.rates.available[t]?a:"default",s=A(e,i),d=Object(u.find)(l.rates.available[t][c].rates,function(e){return r===e.service_id});return o()({},s,{shipment_id:d.shipment_id,rate_id:d.rate_id,service_id:r,carrier_id:d.carrier_id,service_name:d.title,products:Object(u.flatten)(e.items.map(function(e){return Object(u.fill)(new Array(e.quantity),e.product_id)}))})})},b=Object(j.e)(r(),t);Object(u.isBoolean)(b)&&(a.email_receipt=b),f(!0),s.c(t,s.d.orderLabels(e),a).then(d).catch(c).then(function(){return f(!1)})}}).catch(function(e){console.error(e),n(m.a(e.toString()))})}},Se=function(e,t){return function(n,r){var i=Object(v.i)(r(),e,t);b(i.form.fileData,Ee(e)).then(function(){n(T(e,t,!0)),n(L(e,t)),ve(e,t,n,r,!1,i.form.labelsToPrint)}).catch(function(e){return n(m.a(e.toString()))})}},Ce=function(e,t,n){return{type:p.cb,labelId:n,siteId:t,orderId:e}},ye=function(e,t){return function(n,r){var i=Object(v.i)(r(),e,t).labels.map(function(r){if(!r.statusUpdated&&!function(e){return Object(u.get)(e,"statusRetrivalInProgress",!1)}(r)){var i=r.label_id,a=null,o=null;return n({type:p.Nb,orderId:e,labelId:i}),s.b(t,s.d.labelStatus(e,i)).then(function(e){o=e.label}).catch(function(e){return a=e}).then(function(){if(n({type:p.Mb,orderId:e,siteId:t,labelId:i,response:o,error:a}),a)throw a})}});Promise.all(i).catch(function(e){n(m.a("Failed to retrieve shipping label refund status: ".concat(e)))})}},Re=function(e,t){return{type:p.O,orderId:e,siteId:t}},Pe=function(e,t){return function(n,r){var i=Object(v.i)(r(),e,t).refundDialog.labelId,a=null,o=null,u=function(r){r?n({type:p.ib,orderId:e,siteId:t}):(n({type:p.jb,response:o,error:a,orderId:e,siteId:t}),n(a?m.a(a.toString()):m.d(Object(c.translate)("The refund request has been sent successfully."),{duration:5e3})))};u(!0),s.c(t,s.d.labelRefund(e,i)).then(function(e){o=e.refund}).catch(function(e){a=e}).then(function(){return u(!1)})}},ke=function e(t,n,r){return function(i,a){i({type:p.db,labelId:r,orderId:t,siteId:n}),i(m.c("wcs-reprint-label"));var o=Object(v.i)(a(),t,n),u=Object(E.b)(o.paperSize,[{labelId:r}]);s.b(n,u).then(function(e){var c=Object(v.i)(a(),t,n);o.paperSize===c.paperSize&&i({type:p.nb,labelId:r,orderId:t,siteId:n,fileData:e})}).catch(function(a){i({type:p.mb,labelId:r,orderId:t,siteId:n}),i(m.a(a.toString(),{id:"wcs-reprint-label",button:Object(c.translate)("Retry"),onClick:function(){return i(e(t,n,r))}}))})}},Ae=function(e,t){return{type:p.P,orderId:e,siteId:t}},Le=function(e,t){return function(n,r){n({type:p.R,orderId:e,siteId:t});var i=Object(v.i)(r(),e,t);b(i.reprintDialog.fileData,Ee(e,!0)).catch(function(e){console.error(e),n(m.a(e.toString()))}).then(function(){return n(Ae(e,t))})}},Ne=function(e,t,n){return function(r,i){r({type:p.Rb,siteId:t,orderId:e,value:n});var a=Object(v.i)(i(),e,t);null!=a.reprintDialog&&r(ke(e,t,a.reprintDialog.labelId))}},Me=function(e,t,n){return{type:p.Y,labelId:n,siteId:t,orderId:e}},we=function(e,t){return{type:p.M,orderId:e,siteId:t}}},541:function(e,t,n){"use strict";n.d(t,"e",function(){return m}),n.d(t,"b",function(){return p}),n.d(t,"d",function(){return g}),n.d(t,"a",function(){return E}),n.d(t,"c",function(){return v}),n.d(t,"f",function(){return I}),n.d(t,"i",function(){return _}),n.d(t,"h",function(){return h}),n.d(t,"g",function(){return j});var r=n(110),i=n.n(r),a=n(36),o=n.n(a),c=n(1),u=n(35),s=n(544),d=n(532),f=n(575),l=n(565),b=n(537),m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e);return Object(c.get)(e,["extensions","woocommerce","woocommerceServices",t,"packages"],null)},O=function(e){return e&&e.predefinedSchema?Object.keys(e.predefinedSchema):[]},p=Object(s.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=m(e,t);if(!n||!n.predefinedSchema||!n.packages)return null;var r=[];Object(c.forEach)(n.predefinedSchema,function(e,t){var i=(n.packages.predefined||{})[t]||[];Object(c.forEach)(e,function(e){var n=e.definitions;Object(c.forEach)(n,function(e){Object(c.includes)(i,e.id)&&r.push(o()({},e,{serviceId:t}))})})});var i=(n.packages.custom||[]).map(function(e,t){return o()({},e,{index:t})});return Object(c.orderBy)(r.concat(i),"name")},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=m(e,t);if(!n||!n.packages)return[];var r=O(n);return[].concat(i()(n.packages.custom||[]),i()(r.map(function(e){return(n.packages.predefined||{})[e]})))}),g=Object(s.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(d.a)(e),r=m(e,n);if(!r||!r.predefinedSchema||!r.packages)return null;var i=Object(b.e)(e,t,n),a=Object(l.a)(i.origin).country,o=Object(l.a)(i.destination).country,s=f.a.includes(a)&&!f.a.includes(o),O={custom:{title:Object(u.translate)("Custom Packages"),definitions:r.packages.custom}};return Object(c.forEach)(r.predefinedSchema,function(e,t){var n=(r.packages.predefined||{})[t]||[];Object(c.forEach)(e,function(e,t){var r=e.definitions,i={title:e.title,definitions:[]};Object(c.forEach)(r,function(e){s&&!1===e.can_ship_international||Object(c.includes)(n,e.id)&&i.definitions.push(e)}),i.definitions.length&&(O[t]=i)})}),O},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(d.a)(e),r=m(e,n);if(!r||!r.packages)return[];var a=O(r),o=Object(b.e)(e,t,n),c=Object(l.a)(o.origin).country,u=Object(l.a)(o.destination).country;return[].concat(i()(r.packages.custom||[]),i()(a.map(function(e){return(r.packages.predefined||{})[e]})),[c,u])}),E=Object(s.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=m(e,t);if(!n||!n.predefinedSchema||!n.packages)return null;var r={};return Object(c.forEach)(n.packages.custom,function(e){r[e.name]=e}),Object(c.forEach)(n.predefinedSchema,function(e){Object(c.forEach)(e,function(e){var t=e.definitions;Object(c.forEach)(t,function(e){r[e.id]=e})})}),r},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=m(e,t);if(!n||!n.packages)return[];var r=O(n);return[].concat(i()(n.packages.custom||[]),i()(r.map(function(e){return(n.packages.predefined||{})[e]})))}),v=Object(s.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=m(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return null;var r={},i=n.predefinedSchema,a=n.currentlyEditingPredefinedPackages;return Object(c.forEach)(i,function(e,t){var n=a[t]||[];Object(c.forEach)(e,function(e,i){var a={groupId:i,serviceId:t,title:e.title,packages:[],total:e.definitions.length,selected:0};Object(c.forEach)(e.definitions,function(e){var r=Object(c.includes)(n,e.id);r&&a.selected++,a.packages.push(o()({},e,{selected:r,serviceId:t}))}),r["".concat(t,"-").concat(i)]=a})}),r},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=m(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return[];var r=O(n);return i()(r.map(function(e){return n.currentlyEditingPredefinedPackages[e]}))}),I=Object(s.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=0,r=0,i=m(e,t);if(!i||!i.currentlyEditingPredefinedPackages)return{added:n,removed:r};var a=i.packages&&i.packages.predefined?i.packages.predefined:{},o=i.currentlyEditingPredefinedPackages;return Object.keys(o).forEach(function(e){var t=a[e],r=o[e];t?r.forEach(function(e){Object(c.includes)(t,e)||n++}):n+=r.length}),Object.keys(a).forEach(function(e){var t=a[e],n=o[e];n?t.forEach(function(e){Object(c.includes)(n,e)||r++}):r+=t.length}),{added:n,removed:r}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=m(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return[];var r=O(n);return[].concat(i()(r.map(function(e){return n.packages&&n.packages.predefined&&n.packages.predefined[e]})),i()(r.map(function(e){return n.currentlyEditingPredefinedPackages[e]})))}),_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=m(e,t);return n&&n.isLoaded},h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=m(e,t);return n&&n.isFetching},j=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=m(e,t);return n&&n.isFetchError}},543:function(e,t,n){"use strict";n.d(t,"f",function(){return o}),n.d(t,"g",function(){return c}),n.d(t,"h",function(){return u}),n.d(t,"i",function(){return s}),n.d(t,"d",function(){return d}),n.d(t,"c",function(){return f}),n.d(t,"b",function(){return l}),n.d(t,"a",function(){return b}),n.d(t,"n",function(){return m}),n.d(t,"o",function(){return O}),n.d(t,"e",function(){return p}),n.d(t,"q",function(){return g}),n.d(t,"p",function(){return E}),n.d(t,"k",function(){return v}),n.d(t,"l",function(){return I}),n.d(t,"m",function(){return _}),n.d(t,"j",function(){return h});var r=n(1),i=n(532),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"labelSettings"],null)},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=a(e,t);return n&&n.data},c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=a(e,t);return n&&n.meta},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=a(e,t);return n&&n.storeOptions},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.user},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.isLoaded},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.isFetching},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.isFetchError},b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.enabled},m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.selected_payment_method_id},O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.pristine},p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.email_receipts},g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.can_manage_payments},E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.can_edit_settings},v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.paper_size},I=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.payment_methods},_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.warnings&&n.warnings.payment_methods},h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return{masterUserName:n&&n.master_user_name,masterUserLogin:n&&n.master_user_login,masterUserEmail:n&&n.master_user_email,masterUserWpcomLogin:n&&n.master_user_wpcom_login}}},544:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var r=n(1),i=n(606),a=n.n(i),o=(n(112),function(e){return e}),c=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.join()},u=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return e.map(function(e){return e.apply(void 0,[t].concat(r))})}};function s(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c,s=Object(r.memoize)(e,i);return Array.isArray(n)&&(n=u(n)),Object.assign(function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];var c=n.apply(void 0,[e].concat(i));return Array.isArray(c)||(c=[c]),t&&!a()(c,t)&&s.cache.clear(),t=c,s.apply(void 0,[e].concat(i))},{memoizedSelector:s})}},547:function(e,t,n){"use strict";n.d(t,"d",function(){return r}),n.d(t,"c",function(){return v}),n.d(t,"b",function(){return I}),n.d(t,"a",function(){return _});var r={};n.r(r),n.d(r,"accountSettings",function(){return a}),n.d(r,"packages",function(){return o}),n.d(r,"orderLabels",function(){return c}),n.d(r,"getLabelRates",function(){return u}),n.d(r,"labelStatus",function(){return s}),n.d(r,"labelRefund",function(){return d}),n.d(r,"labelsPrint",function(){return f}),n.d(r,"labelTestPrint",function(){return l}),n.d(r,"addressNormalization",function(){return b}),n.d(r,"serviceSettings",function(){return m}),n.d(r,"shippingCarrier",function(){return O}),n.d(r,"shippingCarriers",function(){return p}),n.d(r,"shippingCarrierDelete",function(){return g});var i=n(561),a="connect/account/settings",o="connect/packages",c=function(e){return"connect/label/".concat(e)},u=function(e){return"connect/label/".concat(e,"/rates")},s=function(e,t){return"connect/label/".concat(e,"/").concat(t)},d=function(e,t){return"connect/label/".concat(e,"/").concat(t,"/refund")},f=function(){return"connect/label/print"},l=function(){return"connect/label/preview"},b=function(){return"connect/normalize-address"},m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"connect/services/".concat(e,"/").concat(t)},O=function(){return"connect/shipping/carrier"},p=function(){return"connect/shipping/carriers"},g=function(e){return"connect/shipping/carrier/".concat(e)},E=function(e){if(e&&e.message)throw e.message;if(e&&e.data&&e.data.message)throw e.data.message;throw e},v=function(e,t,n){return Object(i.a)(e).post(t,n,"wc/v1").catch(E)},I=function(e,t){return Object(i.a)(e).get(t,"wc/v1").catch(E)},_=function(e,t){return Object(i.a)(e).del(t,"wc/v1").catch(E)}},549:function(e,t,n){"use strict";n.d(t,"c",function(){return u}),n.d(t,"d",function(){return d}),n.d(t,"a",function(){return f}),n.d(t,"b",function(){return l});var r=n(533),i=n.n(r),a=n(1),o={debounce:a.debounce,isPlainObject:a.isPlainObject,uniqueId:a.uniqueId},c=(n(46),o.uniqueId);function u(e){return{noticeId:e,type:"NOTICE_REMOVE"}}function s(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.id,a=i()(n,["id"]);return{type:"NOTICE_CREATE",notice:Object.assign({showDismiss:!0},a,{noticeId:r||c(),status:e,text:t})}}var d=s.bind(null,"is-success"),f=s.bind(null,"is-error"),l=s.bind(null,"is-info");s.bind(null,"is-warning"),s.bind(null,"is-plain")},552:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(1),i=function e(t){return!!t&&(Object(r.isArray)(t)?Object(r.some)(t,e):!Object(r.isPlainObject)(t)||Object(r.some)(Object(r.values)(t),e))}},555:function(e,t,n){"use strict";n.r(t),n.d(t,"addPackage",function(){return o}),n.d(t,"removePackage",function(){return c}),n.d(t,"editPackage",function(){return u}),n.d(t,"dismissModal",function(){return s}),n.d(t,"savePackage",function(){return d}),n.d(t,"updatePackagesField",function(){return f}),n.d(t,"toggleOuterDimensions",function(){return l}),n.d(t,"toggleAll",function(){return b}),n.d(t,"togglePackage",function(){return m}),n.d(t,"savePredefinedPackages",function(){return O}),n.d(t,"removePredefinedPackage",function(){return p}),n.d(t,"setModalErrors",function(){return g}),n.d(t,"setIsSaving",function(){return E}),n.d(t,"setIsFetching",function(){return v}),n.d(t,"setIsFetchError",function(){return I}),n.d(t,"setAddMode",function(){return _}),n.d(t,"fetchSettings",function(){return h}),n.d(t,"submit",function(){return j});var r=n(547),i=n(538),a=n(541),o=function(e){return{type:i.n,siteId:e}},c=function(e,t){return{type:i.r,index:t,siteId:e}},u=function(e,t){return{type:i.p,package:t,siteId:e}},s=function(e){return{type:i.o,siteId:e}},d=function(e,t){return{type:i.t,packageData:t,siteId:e}},f=function(e,t){return{type:i.D,values:t,siteId:e}},l=function(e){return{type:i.B,siteId:e}},b=function(e,t,n,r){return{type:i.A,serviceId:t,groupId:n,checked:r,siteId:e}},m=function(e,t,n){return{type:i.C,serviceId:t,packageId:n,siteId:e}},O=function(e){return{type:i.u,siteId:e}},p=function(e,t,n){return{type:i.s,serviceId:t,packageId:n,siteId:e}},g=function(e,t){return{type:i.z,value:t,siteId:e}},E=function(e,t){return{type:i.y,isSaving:t,siteId:e}},v=function(e,t){return{type:i.w,isFetching:t,siteId:e}},I=function(e,t){return{type:i.x,isFetchError:t,siteId:e}},_=function(e,t){return{type:i.v,siteId:e,mode:t}},h=function(e){return function(t,n){var o=Object(a.e)(n(),e);o&&(o.packages||o.isFetching)||(t(v(e,!0)),r.b(e,r.d.packages).then(function(n){var r=n.formData,a=n.formSchema,o=n.storeOptions;t({type:i.q,packages:r,dimensionUnit:o.dimension_unit,weightUnit:o.weight_unit,packageSchema:a.custom.items,predefinedSchema:a.predefined,siteId:e})}).catch(function(n){console.error(n),t(I(e,!0))}).then(function(){return t(v(e,!1))}))}},j=function(e,t,n){return function(i,o){var c=Object(a.e)(o(),e);i(E(e,!0)),r.c(e,r.d.packages,c.packages).then(t).catch(n).then(function(){return i(E(e,!1))})}}},556:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(535);function i(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Date.now();return{type:r.j,siteId:e,originalAction:t,data:n,time:i}}},563:function(e,t,n){"use strict";n.d(t,"b",function(){return u}),n.d(t,"c",function(){return s}),n.d(t,"a",function(){return d}),n.d(t,"e",function(){return l}),n.d(t,"f",function(){return m}),n.d(t,"g",function(){return O}),n.d(t,"i",function(){return p}),n.d(t,"h",function(){return g}),n.d(t,"j",function(){return E}),n.d(t,"d",function(){return v});var r=n(1),i=n(544),a=n(532),o=n(539),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"data","locations"])},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.isArray)(c(e,t))},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return o.b===c(e,t)},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return o.a===c(e,t)},f=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a=r[e],o=u(t,a);return[o,o&&c(t,a)]}},l=Object(i.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);if(!u(e,t))return[];var n=c(e,t).map(function(e){return Object(r.omit)(e,"countries")});return Object(r.sortBy)(n,"name")},f(0)),b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);if(!u(e,t))return[];var n=Object(r.flatMap)(c(e,t),"countries");return Object(r.sortBy)(n,"name")},m=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);if(!u(e,n))return[];var i=Object(r.find)(c(e,n),{code:t});if(!i)return[];var o=i.countries.map(function(e){return Object(r.omit)(e,"states")});return Object(r.sortBy)(o,"name")},f(1)),O=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);if(!u(e,n))return t;var i=Object(r.find)(Object(r.flatMap)(c(e,n),"countries"),{code:t});return i?i.name:t},f(1)),p=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);if(!u(e,n))return[];var i=Object(r.find)(Object(r.flatMap)(c(e,n),"countries"),{code:t});return i?Object(r.sortBy)(i.states,"name"):[]},f(1)),g=Object(i.a)(function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(a.a)(e);if(!u(e,i))return n;var o=Object(r.find)(Object(r.flatMap)(c(e,i),"countries"),{code:t});if(!o)return n;var s=Object(r.find)(o.states,{code:n});return s?s.name:n},f(2)),E=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return!Object(r.isEmpty)(p(e,t,n))},v=Object(i.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=b(e,t),r={};return n.forEach(function(e){var t=e.code,n=e.name;return r[t]=n}),r},f(0))},565:function(e,t,n){"use strict";var r=n(1);t.a=function(e){return Object(r.isPlainObject)(e)&&(e.isNormalized&&e.selectNormalized&&e.normalized?e.normalized:e.values)||{}}},566:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i});var r=function(){return!0},i=function(){return!0}},567:function(e,t,n){"use strict";n.d(t,"d",function(){return o}),n.d(t,"a",function(){return u}),n.d(t,"e",function(){return s}),n.d(t,"c",function(){return d}),n.d(t,"b",function(){return f});var r=n(547),i=n(538),a=n(543),o=function(e,t,n){return{type:i.l,siteId:e,key:t,value:n}},c=function(e,t,n){return{type:i.m,siteId:e,key:t,value:n}},u=function(e){return function(t){t(c(e,"isFetching",!0)),r.b(e,r.d.accountSettings).then(function(n){var r=n.storeOptions,a=n.formMeta,o=n.formData,c=n.userMeta;t(function(e,t,n,r,a){return{type:i.i,siteId:e,storeOptions:t,formData:n,formMeta:r,userMeta:a}}(e,r,o,a,c))}).catch(function(n){t(c(e,"isFetchError",!0)),console.error(n)}).then(function(){return t(c(e,"isFetching",!1))})}},s=function(e,t,n){return function(i,o){i(c(e,"isSaving",!0)),i(c(e,"pristine",!0)),r.c(e,r.d.accountSettings,Object(a.f)(o())).then(t).catch(function(t){return i(c(e,"pristine",!1)),n(t)}).then(function(){i(c(e,"isSaving",!1))})}},d=function(e){return{type:i.k,siteId:e}},f=function(e){return{type:i.j,siteId:e}}},568:function(e,t,n){"use strict";n.d(t,"b",function(){return c}),n.d(t,"a",function(){return u}),n.d(t,"c",function(){return s});var r=n(1),i=n(532),a=n(539),o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"shippingMethodSchemas"],{})},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return Object(r.isObject)(o(e,n)[t])},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return c(e,t,n)?o(e,n)[t]:null},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return a.b===o(e,n)[t]}},575:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i}),n.d(t,"d",function(){return a}),n.d(t,"c",function(){return o});var r=["US","PR","VI","GU","AS","UM","MH","FM","MP"],i=["US","PR","VI"],a=["AA","AE","AP"],o=["IR","SY","KP","CU","SD"]},576:function(e,t,n){"use strict";n.d(t,"c",function(){return s}),n.d(t,"a",function(){return d}),n.d(t,"b",function(){return f});var r=n(1),i=n(532),a=n(584),o=n(539),c=n(566),u=n(585),s=function(e,t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZoneMethods"])}(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e));return Object(r.isObject)(n)?n[t]:null},d=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),o=Object(a.b)(e,n);if(!Object(r.isArray)(o))return!1;var d=Object(r.find)(o,{id:t});if(!d||!Object(r.isArray)(d.methodIds))return!1;if(!Object(c.a)(e,n))return!0;var f=d.methodIds.map(function(t){var i=s(e,t,n);return i&&Object(r.startsWith)(i.methodType,"wc_services")?i:null}).filter(Boolean);return Object(r.every)(f,function(t){var r=t.id;return Object(u.a)(e,r,n)})},f=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),d=Object(a.b)(e,n);if(!Object(r.isArray)(d))return!1;var f=Object(r.find)(d,{id:t});if(!f)return!1;if(o.b===f.methodIds)return!0;if(!Object(c.a)(e,n)||!Object(r.isArray)(f.methodIds))return!1;var l=f.methodIds.map(function(t){var i=s(e,t,n);return i&&Object(r.startsWith)(i.methodType,"wc_services")?i:null}).filter(Boolean);return Object(r.some)(l,function(t){var r=t.id;return Object(u.b)(e,r,n)})}},584:function(e,t,n){"use strict";n.d(t,"b",function(){return c}),n.d(t,"a",function(){return u});var r=n(1),i=n(532),a=(n(539),n(576)),o=n(610),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZones"])},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return Object(r.isArray)(n)&&Object(r.every)(n,function(n){return Object(a.a)(e,n.id,t)})&&Object(r.every)(n,function(n){return Object(o.a)(e,n.id,t)})}},585:function(e,t,n){"use strict";n.d(t,"a",function(){return c}),n.d(t,"b",function(){return u});var r=n(1),i=n(532),a=n(539),o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"shippingZoneMethodSettings"],{})},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!0===o(e,n)[t]},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return a.b===o(e,n)[t]}},592:function(e,t,n){"use strict";var r,i=n(34),a=n.n(i),o=n(36),c=n.n(o),u=n(1),s=n(46),d=Object(s.b)({},(r={},a()(r,"NOTICE_CREATE",function(e,t){var n=t.notice;return c()({},e,a()({},n.noticeId,n))}),a()(r,"NOTICE_REMOVE",function(e,t){var n=t.noticeId;return e.hasOwnProperty(n)?Object(u.omit)(e,n):e}),a()(r,"ROUTE_SET",function(e){return Object(u.reduce)(e,function(e,t,n){if(!t.isPersistent&&!t.displayOnNextPage)return e;var r=t;return r.displayOnNextPage&&(r=c()({},r,{displayOnNextPage:!1})),e[n]=r,e},{})}),r)),f=Object(s.b)({},a()({},"NOTICE_CREATE",function(e,t){var n=t.notice;return c()({},e,a()({},n.noticeId,Date.now()))}));t.a=Object(s.a)({items:d,lastTimeShown:f})},593:function(e,t,n){"use strict";n.d(t,"d",function(){return i}),n.d(t,"b",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"e",function(){return c}),n.d(t,"c",function(){return u});var r=n(535);function i(e){return{type:r.d,actionList:e}}function a(){return{type:r.b}}function o(e){return{type:r.a,actionList:e}}function c(e){return{type:r.e,actionList:e}}function u(e,t){return{type:r.c,actionList:e,error:t}}},602:function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"b",function(){return c});n(1);var r=n(659),i=n.n(r),a=document.implementation&&document.implementation.createHTMLDocument?document.implementation.createHTMLDocument("").createElement("textarea"):document.createElement("textarea");function o(e){return"string"!==typeof e||-1===e.indexOf("&")?e:function(e){a.innerHTML=e;var t=a.textContent;return a.innerHTML="",t}(e)}function c(e){return i()(e)}String.fromCharCode(160)},604:function(e,t,n){"use strict";n.d(t,"a",function(){return u}),n.d(t,"b",function(){return d});var r=n(35),i=n(605),a=n(1),o=n(547),c={a4:{name:Object(r.translate)("A4"),exclude:function(e){return Object(a.includes)(["US","CA","MX","DO"],e)}},label:{name:Object(r.translate)('Label (4"x6")')},legal:{name:Object(r.translate)("Legal")},letter:{name:Object(r.translate)("Letter")}},u=function(e){return Object(a.reduce)(c,function(t,n,r){var i=n.name,a=n.exclude;return a&&a(e)||(t[r]=i),t},{})},s=function(e,t,n){if(!c[e])throw new Error("Invalid paper size: ".concat(e));var r={paper_size:e,label_id_csv:Object(a.filter)(Object(a.map)(t,"labelId")).join(","),caption_csv:Object(a.filter)(Object(a.map)(t,function(e){return e.caption?encodeURIComponent(e.caption):null})).join(","),json:!0};return n+"?"+Object(i.stringify)(r)},d=function(e,t){return s(e,t,o.d.labelsPrint())}},607:function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"c",function(){return o}),n.d(t,"a",function(){return c});var r=n(1),i=n(532),a=(n(636),function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!1===Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","isLoading",t])}),o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!0===Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","isLoading",t])},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","items",t],null)}},608:function(e,t,n){"use strict";n.d(t,"a",function(){return p});var r,i=n(36),a=n.n(i),o=n(533),c=n.n(o),u=n(653),s=n.n(u),d=n(1),f=n(46),l=n(112),b=function(e){return Object(d.get)(e,"meta.dataLayer.data",void 0)},m=function(e){return Object(d.get)(e,"meta.dataLayer.error",void 0)},O=function(e){return Object(d.get)(e,"meta.dataLayer.progress",void 0)},p=(Object(f.d)("meta.dataLayer.requestKey",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=(arguments.length>1?arguments[1]:void 0).meta,n=(t=void 0===t?{}:t).dataLayer,r=(n=void 0===n?{}:n).lastUpdated,i=n.pendingSince,o=n.status;return Object.assign(a()({},e),{status:o},r&&{lastUpdated:r},i&&{pendingSince:i})}),r=function(e){return function(t,n){if(!0!==Object(d.get)(n,"meta.dataLayer.trackRequest")||O(n))return e(t,n);var r=function(e){var t=e.meta,n=c()(e,["meta"]),r=Object(d.get)(t,"dataLayer.requestKey");return r||s()(n)}(n),i=function(e){return void 0!==m(e)?"failure":void 0!==b(e)?"success":"pending"}(n),o=Object.assign({requestKey:r,status:i},"pending"===i?{pendingSince:Date.now()}:{lastUpdated:Date.now()});e(a()({},t,{dispatch:function(e){return t.dispatch(Object(d.merge)(e,{meta:{dataLayer:o}}))}}),n)}},function(e){return e.fetch||Object(l.a)("fetch handler is not defined: no request will ever be issued"),e.onSuccess||Object(l.a)("onSuccess handler is not defined: response to the request is being ignored"),e.onError||Object(l.a)("onError handler is not defined: error during the request is being ignored"),r(function(t,n){var r=function(e,t){var n=e.fetch,r=void 0===n?d.noop:n,i=e.onSuccess,a=void 0===i?d.noop:i,o=e.onError,c=void 0===o?d.noop:o,u=e.onProgress,s=void 0===u?d.noop:u,f=e.fromApi,l=void 0===f?d.identity:f,p=m(t);if(p)return c(t,p);var g=b(t);if(g)try{return a(t,l(g))}catch(v){return c(t,v)}var E=O(t);return E?s(t,E):r(t)}(e,n);if(r)return Array.isArray(r)?r.map(t.dispatch):t.dispatch(r)})})},609:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=function(e,t){return Object(r.isArray)(e)?e.concat(t):void 0},a=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length>1?r.mergeWith.apply(void 0,[Object.create(null)].concat(t,[i])):t[0]}},610:function(e,t,n){"use strict";n.d(t,"c",function(){return o}),n.d(t,"a",function(){return c}),n.d(t,"b",function(){return u});var r=n(1),i=n(532),a=n(539),o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZoneLocations"])},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),a=o(e,n);return a&&Object(r.isObject)(a[t])},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return o(e,n)&&a.b===o(e,n)[t]}},611:function(e,t,n){"use strict";n.d(t,"a",function(){return c});var r=n(547),i=n(556),a=n(538),o=n(585),c=function(e,t,n){return function(c,u){if(!Object(o.a)(u(),n,e)&&!Object(o.b)(u(),n,e)){var s={type:a.Wb,instanceId:n,siteId:e};return c(s),r.b(e,r.d.serviceSettings(t,n)).then(function(t){return c(function(e,t,n){return{type:a.Xb,siteId:e,instanceId:t,data:n}}(e,n,t))}).catch(function(t){return c(Object(i.a)(e,s,t))})}}}},612:function(e,t,n){"use strict";t.a=function(e,t){return function e(t,n,r){if(void 0===n||null===n||!t)return n;switch((t=function(e,t){if(e.$ref){var n=e.$ref.match(/^#\/definitions\/(.+)/);n&&t[n[1]]&&(e=t[n[1]])}return e}(t,r)).type){case"number":if(""===n)return;return isNaN(n)?n:parseFloat(n);case"boolean":return-1!==["true","True","TRUE","1",1,!0].indexOf(n)||-1===["false","False","FALSE","0",0,!1].indexOf(n)&&void 0;case"string":return n?n.toString():"";case"object":var i={};return Object.keys(n).forEach(function(a){var o=(t.properties||{})[a];i[a]=e(o,n[a],r)}),i;case"array":return n.map(function(n){return e(t.items,n,r)});default:return n}}({type:"object",properties:e.properties},t,e.definitions)}},616:function(e,t,n){"use strict";n.d(t,"a",function(){return s}),n.d(t,"c",function(){return d}),n.d(t,"b",function(){return f});var r=n(1),i=n(532),a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!1===Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","notes","isLoading",t])},o=n(607),c=n(537),u=n(566),s={CUSTOMER_NOTE:"CUSTOMER_NOTE",INTERNAL_NOTE:"INTERNAL_NOTE",LABEL_PURCHASING:"LABEL_PURCHASING",LABEL_PURCHASED:"LABEL_PURCHASED",LABEL_REFUND_REQUESTED:"LABEL_REFUND_REQUESTED",LABEL_REFUND_COMPLETED:"LABEL_REFUND_COMPLETED",LABEL_REFUND_REJECTED:"LABEL_REFUND_REJECTED",REFUND_NOTE:"REFUND_NOTE"},d=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!!a(e,t,n)&&(!(u.a(e,n)&&!Object(c.q)(e,t,n))||Object(c.s)(e,t,n))},f=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),d=Object(o.a)(e,t,n),f=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);if(!a(e,t,n))return[];var o=Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","notes","items"],{});return Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","notes","orders",t],[]).map(function(e){return o[e]})}(e,t,n).filter(function(e){return!1===e.customer_note}).map(function(e){return{key:e.id,type:s.INTERNAL_NOTE,timestamp:new Date(e.date_created_gmt+"Z").getTime(),content:e.note}});if(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","refunds",t,"items"],[])}(e,t,n).forEach(function(e){f.push({key:e.id,type:s.REFUND_NOTE,timestamp:new Date(e.date_created_gmt+"Z").getTime(),amount:e.amount,reason:e.reason,currency:d.currency})}),u.a(e,n)){var l=Object(c.g)(e,t,n);Object(r.filter)(l,function(e){return-1!==["PURCHASED","ANONYMIZED","PURCHASE_IN_PROGRESS"].indexOf(e.status)}).forEach(function(e,t,n){var r=n.length-1-t;if(e.refund)switch(e.refund.status){case"complete":f.push({key:e.label_id,type:s.LABEL_REFUND_COMPLETED,timestamp:e.refund.refund_date,serviceName:e.service_name,labelIndex:r,amount:parseFloat(e.refund.amount)||e.refundable_amount,currency:e.currency});break;case"rejected":f.push({key:e.label_id,type:s.LABEL_REFUND_REJECTED,timestamp:e.refund.refund_date,serviceName:e.service_name,labelIndex:r});break;default:f.push({key:e.label_id,type:s.LABEL_REFUND_REQUESTED,timestamp:e.refund.request_date,serviceName:e.service_name,labelIndex:r,amount:parseFloat(e.refund.amount)||e.refundable_amount,currency:e.currency})}if("PURCHASE_IN_PROGRESS"===e.status)return f.push({key:e.label_id,type:s.LABEL_PURCHASING,labelIndex:r,labelId:e.label_id,serviceName:e.service_name,carrierId:e.carrier_id});f.push({key:e.label_id,type:s.LABEL_PURCHASED,timestamp:e.created_date,createdDate:e.created_date,usedDate:e.used_date,expiryDate:e.expiry_date,labelIndex:r,labelId:e.label_id,productNames:e.product_names,packageName:e.package_name,receiptId:e.main_receipt_id,serviceName:e.service_name,tracking:e.tracking,carrierId:e.carrier_id,amount:e.rate,refundableAmount:e.refundable_amount,currency:e.currency,anonymized:"ANONYMIZED"===e.status,showDetails:!e.refund||"rejected"===e.refund.status||"unknown"===e.refund.status,commercialInvoiceUrl:e.commercial_invoice_url})})}return f}},619:function(e,t,n){var r={"./af":[392,3],"./af.js":[392,3],"./ar":[399,4],"./ar-dz":[393,5],"./ar-dz.js":[393,5],"./ar-kw":[394,6],"./ar-kw.js":[394,6],"./ar-ly":[395,7],"./ar-ly.js":[395,7],"./ar-ma":[396,8],"./ar-ma.js":[396,8],"./ar-sa":[397,9],"./ar-sa.js":[397,9],"./ar-tn":[398,10],"./ar-tn.js":[398,10],"./ar.js":[399,4],"./az":[400,11],"./az.js":[400,11],"./be":[401,12],"./be.js":[401,12],"./bg":[402,13],"./bg.js":[402,13],"./bm":[403,14],"./bm.js":[403,14],"./bn":[404,15],"./bn.js":[404,15],"./bo":[405,16],"./bo.js":[405,16],"./br":[406,17],"./br.js":[406,17],"./bs":[407,18],"./bs.js":[407,18],"./ca":[408,19],"./ca.js":[408,19],"./cs":[409,20],"./cs.js":[409,20],"./cv":[410,21],"./cv.js":[410,21],"./cy":[411,22],"./cy.js":[411,22],"./da":[412,23],"./da.js":[412,23],"./de":[415,24],"./de-at":[413,25],"./de-at.js":[413,25],"./de-ch":[414,26],"./de-ch.js":[414,26],"./de.js":[415,24],"./dv":[416,27],"./dv.js":[416,27],"./el":[417,28],"./el.js":[417,28],"./en-au":[418,29],"./en-au.js":[418,29],"./en-ca":[419,30],"./en-ca.js":[419,30],"./en-gb":[420,31],"./en-gb.js":[420,31],"./en-ie":[421,32],"./en-ie.js":[421,32],"./en-il":[422,33],"./en-il.js":[422,33],"./en-in":[423,34],"./en-in.js":[423,34],"./en-nz":[424,35],"./en-nz.js":[424,35],"./en-sg":[425,36],"./en-sg.js":[425,36],"./eo":[426,37],"./eo.js":[426,37],"./es":[429,38],"./es-do":[427,39],"./es-do.js":[427,39],"./es-us":[428,40],"./es-us.js":[428,40],"./es.js":[429,38],"./et":[430,41],"./et.js":[430,41],"./eu":[431,42],"./eu.js":[431,42],"./fa":[432,43],"./fa.js":[432,43],"./fi":[433,44],"./fi.js":[433,44],"./fil":[434,45],"./fil.js":[434,45],"./fo":[435,46],"./fo.js":[435,46],"./fr":[438,47],"./fr-ca":[436,48],"./fr-ca.js":[436,48],"./fr-ch":[437,49],"./fr-ch.js":[437,49],"./fr.js":[438,47],"./fy":[439,50],"./fy.js":[439,50],"./ga":[440,51],"./ga.js":[440,51],"./gd":[441,52],"./gd.js":[441,52],"./gl":[442,53],"./gl.js":[442,53],"./gom-deva":[443,54],"./gom-deva.js":[443,54],"./gom-latn":[444,55],"./gom-latn.js":[444,55],"./gu":[445,56],"./gu.js":[445,56],"./he":[446,57],"./he.js":[446,57],"./hi":[447,58],"./hi.js":[447,58],"./hr":[448,59],"./hr.js":[448,59],"./hu":[449,60],"./hu.js":[449,60],"./hy-am":[450,61],"./hy-am.js":[450,61],"./id":[451,62],"./id.js":[451,62],"./is":[452,63],"./is.js":[452,63],"./it":[454,64],"./it-ch":[453,65],"./it-ch.js":[453,65],"./it.js":[454,64],"./ja":[455,66],"./ja.js":[455,66],"./jv":[456,67],"./jv.js":[456,67],"./ka":[457,68],"./ka.js":[457,68],"./kk":[458,69],"./kk.js":[458,69],"./km":[459,70],"./km.js":[459,70],"./kn":[460,71],"./kn.js":[460,71],"./ko":[461,72],"./ko.js":[461,72],"./ku":[462,73],"./ku.js":[462,73],"./ky":[463,74],"./ky.js":[463,74],"./lb":[464,75],"./lb.js":[464,75],"./lo":[465,76],"./lo.js":[465,76],"./lt":[466,77],"./lt.js":[466,77],"./lv":[467,78],"./lv.js":[467,78],"./me":[468,79],"./me.js":[468,79],"./mi":[469,80],"./mi.js":[469,80],"./mk":[470,81],"./mk.js":[470,81],"./ml":[471,82],"./ml.js":[471,82],"./mn":[472,83],"./mn.js":[472,83],"./mr":[473,84],"./mr.js":[473,84],"./ms":[475,85],"./ms-my":[474,86],"./ms-my.js":[474,86],"./ms.js":[475,85],"./mt":[476,87],"./mt.js":[476,87],"./my":[477,88],"./my.js":[477,88],"./nb":[478,89],"./nb.js":[478,89],"./ne":[479,90],"./ne.js":[479,90],"./nl":[481,91],"./nl-be":[480,92],"./nl-be.js":[480,92],"./nl.js":[481,91],"./nn":[482,93],"./nn.js":[482,93],"./oc-lnc":[483,94],"./oc-lnc.js":[483,94],"./pa-in":[484,95],"./pa-in.js":[484,95],"./pl":[485,96],"./pl.js":[485,96],"./pt":[487,97],"./pt-br":[486,98],"./pt-br.js":[486,98],"./pt.js":[487,97],"./ro":[488,99],"./ro.js":[488,99],"./ru":[489,100],"./ru.js":[489,100],"./sd":[490,101],"./sd.js":[490,101],"./se":[491,102],"./se.js":[491,102],"./si":[492,103],"./si.js":[492,103],"./sk":[493,104],"./sk.js":[493,104],"./sl":[494,105],"./sl.js":[494,105],"./sq":[495,106],"./sq.js":[495,106],"./sr":[497,107],"./sr-cyrl":[496,108],"./sr-cyrl.js":[496,108],"./sr.js":[497,107],"./ss":[498,109],"./ss.js":[498,109],"./sv":[499,110],"./sv.js":[499,110],"./sw":[500,111],"./sw.js":[500,111],"./ta":[501,112],"./ta.js":[501,112],"./te":[502,113],"./te.js":[502,113],"./tet":[503,114],"./tet.js":[503,114],"./tg":[504,115],"./tg.js":[504,115],"./th":[505,116],"./th.js":[505,116],"./tk":[506,117],"./tk.js":[506,117],"./tl-ph":[507,118],"./tl-ph.js":[507,118],"./tlh":[508,119],"./tlh.js":[508,119],"./tr":[509,120],"./tr.js":[509,120],"./tzl":[510,121],"./tzl.js":[510,121],"./tzm":[512,122],"./tzm-latn":[511,123],"./tzm-latn.js":[511,123],"./tzm.js":[512,122],"./ug-cn":[513,124],"./ug-cn.js":[513,124],"./uk":[514,125],"./uk.js":[514,125],"./ur":[515,126],"./ur.js":[515,126],"./uz":[517,127],"./uz-latn":[516,128],"./uz-latn.js":[516,128],"./uz.js":[517,127],"./vi":[518,129],"./vi.js":[518,129],"./x-pseudo":[519,130],"./x-pseudo.js":[519,130],"./yo":[520,131],"./yo.js":[520,131],"./zh-cn":[521,132],"./zh-cn.js":[521,132],"./zh-hk":[522,133],"./zh-hk.js":[522,133],"./zh-mo":[523,134],"./zh-mo.js":[523,134],"./zh-tw":[524,135],"./zh-tw.js":[524,135]};function i(e){if(!n.o(r,e))return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=r[e],i=t[0];return n.e(t[1]).then(function(){return n.t(i,7)})}i.keys=function(){return Object.keys(r)},i.id=619,e.exports=i},620:function(e,t,n){"use strict";(function(e){var n={env:e?"production":"development",wpcom_concierge_schedule_id:1,languages:[],google_adwords_conversion_id:"",google_adwords_conversion_id_jetpack:""},r=function(e){if(e in n)return n[e];throw new Error("config key `"+e+"` does not exist")};r.isEnabled=function(){return!0},t.a=r}).call(this,n(111))},633:function(e,t,n){"use strict";var r=n(34),i=n.n(r),a=n(110),o=n.n(a),c=n(1),u=n(35),s=n(535),d=n(593),f=n(543),l=n(541),b=n(567),m=n(555),O=n(532),p=n(538);n(561),n(556),n(576),n(611),n(620);var g=n(547),E=n(36),v=n.n(E);function I(e,t,n,r){Object(c.isFunction)(n)?I(e,t,n(e,t,r),r):Object(c.isObject)(n)&&e(v()({},n,r))}var _,h=n(568),j=n(612),S=function(e,t){var n=Object(l.e)(e,t);return!n||n.pristine?[]:[{description:Object(u.translate)("Saving label settings"),onStep:function(e,n){e(Object(m.submit)(t,function(){return e(Object(d.e)(n))},function(){return e(Object(d.c)(n))}))}}]},C=function(e,t){var n=Object(O.a)(e);return t?o()(S(e,n)):[].concat(o()(function(e,t){var n=Object(f.g)(e,t);return!n||n.pristine||!n.can_edit_settings&&n.can_manage_payments?[]:[{description:Object(u.translate)("Saving label settings"),onStep:function(e,n){e(Object(b.e)(t,function(){return e(Object(d.e)(n))},function(){return e(Object(d.c)(n))}))}}]}(e,n)),o()(S(e,n)))};t.a=(_={},i()(_,s.L,[function(e,t){var n=t.successAction,r=t.failureAction,i=t.onlyPackages,a=function(e){e(n),e(Object(d.b)())},o=C(e.getState(),i);e.dispatch(Object(c.isEmpty)(o)?a:Object(d.d)({nextSteps:o,onSuccess:a,onFailure:function(e){e(r),e(Object(d.b)())}}))}]),i()(_,p.Yb,[function(e,t){var n=e.dispatch,r=e.getState,i=t.siteId,a=t.methodId,o=t.methodType,c=t.method,u=t.successAction,d=t.failureAction,f=Object(h.a)(r(),o,i).formSchema,l=Object(j.a)(f,c);g.c(i,g.d.serviceSettings(o,a),l).then(function(e){n(function(e,t,n){return{type:s.Pb,siteId:e,data:t,originatingAction:n}}(i,e,t)),I(n,r,u,{sentData:l,receivedData:e})}).catch(function(e){return I(n,r,d,{error:e})})}]),_)},634:function(e,t,n){"use strict";n.d(t,"b",function(){return N}),n.d(t,"a",function(){return A});var r=n(114),i=n.n(r),a=n(107),o=n.n(a),c=n(108),u=n.n(c),s=n(528),d=n.n(s),f=n(527),l=n.n(f),b=n(531),m=n.n(b),O=n(529),p=n.n(O),g=n(34),E=n.n(g),v=n(10),I=n.n(v),_=n(109),h=n(163),j=n.n(h),S=n(47),C=n.n(S),y=n(1),R=n(544),P=Object(R.a)(function(e){return Object(y.get)(e,"ui.language.localeSlug",null)},function(e){return e.ui.language}),k=C()("calypso:localized-moment"),A=I.a.createContext(j.a),L=function(e){function t(){var e,n;o()(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=d()(this,(e=l()(t)).call.apply(e,[this].concat(i))),E()(m()(n),"state",{moment:j.a,momentLocale:j.a.locale()}),n}return p()(t,e),u()(t,[{key:"checkAndLoad",value:function(){var e=i()(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((r=this.props.currentLocale)!==t){e.next=3;break}return e.abrupt("return");case 3:if("en"!==r){e.next=7;break}this.loadingLocalePromise=Promise.resolve(),e.next=19;break;case 7:return k("Loading moment locale for %s",r),e.prev=8,this.loadingLocalePromise=n(619)("./".concat(r)),e.next=12,this.loadingLocalePromise;case 12:e.next=18;break;case 14:return e.prev=14,e.t0=e.catch(8),k("Failed to load moment locale for %s",r,e.t0),e.abrupt("return");case 18:k("Loaded moment locale for %s",r);case 19:r===this.props.currentLocale&&(j.a.locale()!==r&&j.a.locale(r),this.setState({momentLocale:r}));case 20:case"end":return e.stop()}},e,this,[[8,14]])}));return function(t){return e.apply(this,arguments)}}()},{key:"componentDidMount",value:function(){this.checkAndLoad(j.a.locale())}},{key:"componentDidUpdate",value:function(e){this.checkAndLoad(e.currentLocale)}},{key:"render",value:function(){return I.a.createElement(A.Provider,{value:this.state},this.props.children)}}]),t}(I.a.Component),N=Object(_.b)(function(e){return{currentLocale:P(e)}})(L)},635:function(e,t,n){"use strict";var r=n(533),i=n.n(r),a=n(75),o=n(46),c=function(e,t,n,r,c,u){var s=Object(a.b)();return u&&!u.endsWith("/")&&(u+="/"),u&&u.startsWith("/")&&(u=u.substr(1)),-1!==s.indexOf("?")&&(t=t.replace("?","&")),Object(o.c)(function(e){var t=e.url,n=e.method,r=e.headers,a=e.queryParams,o=e.body,c=e.withCredentials,u=e.onSuccess,s=e.onFailure,d=i()(e,["url","method","headers","queryParams","body","withCredentials","onSuccess","onFailure"]),f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:"HTTP_REQUEST",url:t,method:n,headers:r,queryParams:a,body:o,withCredentials:c,onSuccess:u||f,onFailure:s||f,options:d}}({url:s+u+t,method:e,headers:[["X-WP-Nonce",Object(a.c)()],["Content-Type","application/json"]],body:r&&JSON.stringify(r),withCredentials:!0},c),{meta:{localApiRequest:!0}})};t.a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"wc/v1";return{get:function(e){return c("GET",e,0,null,t,n)},getWithHeaders:function(e){return function(e,t,n,r,i,a){return c(e,t+"&_envelope",0,r,i,a)}("GET",e,0,null,t,n)},post:function(e,r){return c("POST",e,0,r||{},t,n)},put:function(e,r){return c("PUT",e,0,r||{},t,n)},del:function(e){return c("DELETE",e,0,null,t,n)}}}},636:function(e,t,n){"use strict";n.d(t,"a",function(){return u}),n.d(t,"b",function(){return s}),n.d(t,"c",function(){return d}),n.d(t,"d",function(){return f}),n.d(t,"e",function(){return l}),n.d(t,"f",function(){return b});var r=n(36),i=n.n(r),a=n(1),o=n(688),c=n(637),u={page:1,per_page:50,search:"",status:"any"};function s(e){return e.status&&(e.status=Object(c.a)(e.status)),Object(a.omitBy)(e,function(e,t){return u[t]===e})}function d(){var e=s(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});return JSON.stringify(e)}function f(e){for(var t=i()({},e),n=0,r=["line_items","fee_lines","coupon_lines","shipping_lines"];n<r.length;n++){var o=r[n];e[o]&&(t[o]=e[o].map(function(e){return Object(a.isFinite)(e.id)?e:Object(a.omit)(e,"id")}))}return t}function l(e){Object(a.forEach)(["cart_tax","discount_total","discount_tax","shipping_total","shipping_tax","total","total_tax"],function(t){(Object(a.isFinite)(e[t])||e[t])&&(e[t]=Object(o.b)(e[t],e.currency))});var t=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];return t.map(function(t){return Object(a.forEach)(n,function(e){(Object(a.isFinite)(t[e])||t[e])&&(t[e]=t[e].toString())}),Object(a.forEach)(r,function(n){(Object(a.isFinite)(t[n])||t[n])&&(t[n]=Object(o.b)(t[n],e.currency))}),Object(a.forEach)(i,function(e){(Object(a.isFinite)(t[e])||t[e])&&(t[e]=parseInt(t[e]))}),Object(a.forEach)(c,function(n){(Object(a.isFinite)(t[n])||t[n])&&(t[n]=Object(o.a)(t[n],e.currency))}),t})};return Object(a.isEmpty)(e.line_items)||(e.line_items=t(e.line_items,["name","tax_class"],["subtotal","subtotal_tax","total","total_tax"],["product_id","variation_id","quantity"],["price"])),Object(a.isEmpty)(e.shipping_lines)||(e.shipping_lines=t(e.shipping_lines,["method_title","method_id"],["total","total_tax"])),Object(a.isEmpty)(e.fee_lines)||(e.fee_lines=t(e.fee_lines,["name","tax_class","tax_status"],["total","total_tax"])),Object(a.isEmpty)(e.coupon_lines)||(e.coupon_lines=t(e.coupon_lines,["code"],["discount","discount_tax"])),Object(a.isEmpty)(e.refunds)||(e.refunds=t(e.refunds,["reason"],["total"])),e.billing&&""===e.billing.email&&delete e.billing.email,e}function b(e){var t=e.status,n=void 0===t?"":t;window.jQuery&&(n&&window.jQuery("#order_status").val("wc-"+n).trigger("change"),window.jQuery("#woocommerce-order-notes").length&&window.jQuery.get(window.location.href,function(e){var t=window.jQuery(e).find("#woocommerce-order-notes");window.jQuery("#woocommerce-order-notes").html(t.html())}))}},637:function(e,t,n){"use strict";n.d(t,"a",function(){return s}),n.d(t,"b",function(){return d});n(35),n(1);var r="unpaid",i="unfulfilled",a="finished",o=["on-hold","pending"],c=["processing"],u=["cancelled","completed","failed","refunded"];function s(e){return r===e?o.join(","):i===e?c.join(","):a===e?u.join(","):e}function d(e){return-1!==u.indexOf(e)}},638:function(e,t,n){"use strict";n.d(t,"a",function(){return u}),n.d(t,"b",function(){return s}),n.d(t,"d",function(){return d}),n.d(t,"j",function(){return f}),n.d(t,"e",function(){return l}),n.d(t,"c",function(){return b}),n.d(t,"i",function(){return m}),n.d(t,"f",function(){return O}),n.d(t,"g",function(){return p}),n.d(t,"h",function(){return g});var r=n(533),i=n.n(r),a=(n(36),n(1)),o=n(636),c=(n(637),n(535)),u=function(e,t,n){return{type:c.q,siteId:e,orderId:t,error:n}},s=function(e,t){return{type:c.r,siteId:e,orderId:t}},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:c.n,siteId:e,query:Object(o.b)(t),error:n}},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Object(a.isArray)(n)?{type:c.o,siteId:e,query:Object(o.b)(t),total:r,orders:n}:d(e,t,n)},l=function(e,t){return{type:c.F,siteId:e,orderId:t}},b=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:c.G,siteId:e,orderId:t,error:n}},m=function(e,t,n){return"undefined"===typeof n.id?b(e,t,n):{type:c.H,siteId:e,orderId:t,order:n}},O=function(e,t){var n=t.id,r=i()(t,["id"]),u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.noop,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.noop;return r=Object(o.e)(Object(o.d)(r)),{type:c.I,siteId:e,orderId:n,order:r,onFailure:s,onSuccess:u}},p=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:c.J,siteId:e,orderId:t,error:n}},g=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return"undefined"===typeof n.id?p(e,t,n):(Object(o.f)(n),{type:c.K,siteId:e,orderId:t,order:n})}},639:function(e,t,n){"use strict";n.d(t,"a",function(){return r});n(36),n(1);function r(e){if(!e.data)throw new Error("Failure at remote site.",e);return e}},651:function(e,t,n){"use strict";var r=n(110),i=n.n(r),a=n(36),o=n.n(a),c=n(1),u=n(538),s={modalErrors:{},pristine:!0},d=function(e){return null===e||""===Object(c.trim)(e)},f={};f[u.n]=function(e){var t=e.packages&&e.packages.predefined?e.packages.predefined:{},n=o()({},e,{showModal:!0,mode:"add-custom",currentlyEditingPredefinedPackages:Object(c.cloneDeep)(t)});return"edit"!==e.mode&&n.packageData||(n.packageData={is_user_defined:!0}),n},f[u.p]=function(e,t){return Object.assign({},e,{showModal:!0,modalReadOnly:!1,mode:"edit",packageData:t.package,showOuterDimensions:!1})},f[u.o]=function(e){return Object.assign({},e,{modalErrors:{},showModal:!1,showOuterDimensions:!1})},f[u.z]=function(e,t){return Object.assign({},e,{modalErrors:t.value})},f[u.D]=function(e,t){var n=Object.assign({},e.packageData,t.values),r=Object(c.omitBy)(n,d);return Object.assign({},e,{packageData:r,pristine:!1})},f[u.t]=function(e,t){var n=t.packageData,r=e.packages.custom||[];(n.box_weight&&(n.box_weight=Number.parseFloat(n.box_weight)),n.max_weight&&(n.max_weight=Number.parseFloat(n.max_weight)),"index"in n)?r[n.index]=Object(c.omit)(n,"index"):r.push(n);return e=f[u.o](e),o()({},e,{mode:"add-custom",packageData:{is_user_defined:!0},packages:o()({},e.packages,{custom:r}),pristine:!1})},f[u.B]=function(e){return o()({},e,{showOuterDimensions:!0})},f[u.r]=function(e,t){var n=i()(e.packages.custom);return n.splice(t.index,1),o()({},e,{packages:o()({},e.packages,{custom:n}),pristine:!1,showModal:!1})},f[u.A]=function(e,t){var n=t.serviceId,r=t.groupId,i=t.checked,a=e.predefinedSchema[n][r].definitions.map(function(e){return e.id}),u=e.currentlyEditingPredefinedPackages[n],s=i?Object(c.uniq)(Object(c.concat)(u,a)):Object(c.difference)(u,a),d=o()({},e.currentlyEditingPredefinedPackages);return d[n]=s,o()({},e,{currentlyEditingPredefinedPackages:d,pristine:!1})},f[u.C]=function(e,t){var n=t.serviceId,r=t.packageId,a=o()({},e.currentlyEditingPredefinedPackages),c=i()(a[n]||[]),u=c.indexOf(r);return-1===u?c.push(r):c.splice(u,1),a[n]=c,o()({},e,{currentlyEditingPredefinedPackages:a,pristine:!1})},f[u.s]=function(e,t){var n=t.serviceId,r=t.packageId,a=o()({},e.packages.predefined),c=i()(a[n]||[]),u=c.indexOf(r);return-1!==u&&c.splice(u,1),a[n]=c,o()({},e,{packages:o()({},e.packages,{predefined:a}),pristine:!1})},f[u.u]=function(e){var t=e.currentlyEditingPredefinedPackages;return e=f[u.o](e),o()({},e,{packages:o()({},e.packages,{predefined:t}),pristine:!1})},f[u.v]=function(e,t){var n=t.mode;return o()({},e,{mode:n})},f[u.y]=function(e,t){return Object.assign({},e,{isSaving:t.isSaving,pristine:!t.isSaving})},f[u.w]=function(e,t){var n=t.isFetching;return o()({},e,{isFetching:n})},f[u.x]=function(e,t){var n=t.isFetchError;return o()({},e,{isFetchError:n})},f[u.q]=function(e,t){var n=t.packages,r=t.dimensionUnit,i=t.weightUnit,a=t.packageSchema,c=t.predefinedSchema;return o()({},e,{packages:n,dimensionUnit:r,weightUnit:i,packageSchema:a,predefinedSchema:c,packageData:e.packageData||{is_user_defined:!0},isLoaded:!0})};t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;return"function"===typeof f[t.type]?f[t.type](e,t):e}},652:function(e,t,n){"use strict";var r=n(34),i=n.n(r),a=n(36),o=n.n(a),c=n(538),u={meta:{error:!1,fieldsStatus:!1,isSaving:!1,isFetching:!1,isLoaded:!1,isFetchError:!1,pristine:!0},data:null,pristineData:null},s={};s[c.i]=function(e,t){var n=t.storeOptions,r=t.formData,i=t.formMeta,a=t.userMeta;return o()({},e,{storeOptions:n,meta:o()({},e.meta,i,{pristine:!0,isLoaded:!0,user:a}),data:o()({},e.data,r)})},s[c.l]=function(e,t){var n=t.key,r=t.value,a=e.meta.pristine?e.data:e.pristineData;return o()({},e,{meta:o()({},e.meta,{pristine:!1}),data:o()({},e.data,i()({},n,r)),pristineData:a})},s[c.m]=function(e,t){var n=t.key,r=t.value;return o()({},e,{meta:o()({},e.meta,i()({},n,r))})},s[c.k]=function(e){return e.meta.pristine?e:o()({},e,{meta:o()({},e.meta,{pristine:!0}),data:e.pristineData,pristineData:null})},s[c.j]=function(e){return o()({},e,{addCardDialog:!0})},s[c.h]=function(e){return o()({},e,{addCardDialog:null})};t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;return s[t.type]?s[t.type](e,t):e}},657:function(e,t,n){"use strict";var r,i=n(110),a=n.n(i),o=n(36),c=n.n(o),u=n(118),s=n.n(u),d=n(34),f=n.n(d),l=n(47),b=n.n(l),m=n(593),O=n(535),p=b()("woocommerce:action-list");t.a=(r={},f()(r,O.d,[function(e,t){var n=e.dispatch,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),i=t.actionList,a=i.prevSteps,o=i.currentStep,u=i.nextSteps||[],d=s()(u),f=d[0],l=d.slice(1);if(o)return void p("[handleStepNext] Warning: Attempting before current step finishes. Ignoring.");if(!f)return void p("[handleStepNext] Warning: Attempting with no nextSteps left. Ignoring.");var b=c()({},i,{prevSteps:a,currentStep:c()({},f,{startTime:r}),nextSteps:l});n(Object(m.a)(b)),f.onStep(n,b)}]),f()(r,O.e,[function(e,t){var n=e.dispatch,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),i=t.actionList,o=i.prevSteps,u=i.currentStep,s=i.nextSteps;if(!u)return void p("[handleStepSuccess] Warning: Attempting with no current step. Ignoring.");var d=c()({},i,{prevSteps:[].concat(a()(o||[]),[c()({},u,{endTime:r})]),currentStep:null,nextSteps:s});n(Object(m.a)(d)),s&&s.length>0?n(Object(m.d)(d)):i.onSuccess&&i.onSuccess(n,d)}]),f()(r,O.c,[function(e,t){var n=e.dispatch,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),i=t.actionList,o=t.error,u=i.prevSteps,s=i.currentStep,d=i.nextSteps;if(!s)return void p("[handleStepFailure] Warning: Attempting with no current step. Ignoring.");var f=c()({},i,{prevSteps:[].concat(a()(u||[]),[c()({},s,{endTime:r,error:o})]),currentStep:null,nextSteps:d});n(Object(m.a)(f)),i.onFailure&&i.onFailure(n,f)}]),r)},658:function(e,t,n){"use strict";var r,i=n(34),a=n.n(i),o=n(46),c=n(535),u=n(539),s=n(602);t.a=Object(o.b)(null,(r={},a()(r,c.k,function(){return u.b}),a()(r,c.l,function(e,t){return t.data.map(function(e){return{code:e.code,name:Object(s.a)(e.name),countries:e.countries.map(function(e){return{code:e.code,name:Object(s.a)(e.name),states:e.states.map(function(e){return{code:e.code,name:Object(s.a)(e.name)}})}})}})}),a()(r,c.j,function(e,t){var n=t.originalAction.type;return c.k===n?u.a:e}),r))},687:function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o}),n.d(t,"c",function(){return c}),n.d(t,"d",function(){return u}),n.d(t,"e",function(){return s});var r=n(535),i=n(636),a=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return{type:r.y,siteId:e,orderId:t,note:n,onSuccess:i,onFailure:a}},o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{type:r.z,siteId:e,orderId:t,error:n}},c=function(e,t,n){return Object(i.f)({}),{type:r.A,siteId:e,orderId:t,note:n}},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{type:r.w,siteId:e,orderId:t,error:n}},s=function(e,t,n){return{type:r.x,siteId:e,orderId:t,notes:n}}},688:function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return a});var r=n(583);function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",n=Object(r.getCurrencyDefaults)(t).precision;return"number"!==typeof e&&(e=parseFloat(e)),isNaN(e)?0:Math.round(e*Math.pow(10,n))/Math.pow(10,n)}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",n=Object(r.getCurrencyDefaults)(t).precision;return"number"!==typeof e&&(e=parseFloat(e)),isNaN(e)?"":e.toFixed(n)}},690:function(e,t,n){"use strict";var r=n(78),i=n.n(r);t.a=function(e){var t=(e.outer_dimensions?e.outer_dimensions.match(/([-.0-9]+).+?([-.0-9]+).+?([-.0-9]+)/):e.inner_dimensions.match(/([-.0-9]+).+?([-.0-9]+).+?([-.0-9]+)/)).slice(1).map(Number),n=i()(t,3);return{length:n[0],width:n[1],height:n[2]}}},691:function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o}),n.d(t,"c",function(){return c});var r=n(556),i=n(535);function a(e){return{type:i.k,siteId:e}}function o(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=a(e);return Object(r.a)(e,n,t)}function c(e,t){return{type:i.l,siteId:e,data:t}}},715:function(e){e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","properties":{"data":{"items":{"properties":{"CTA":{"properties":{"hook":{"type":"string"},"message":{"type":"string"},"primary":{"type":"boolean"}},"type":"object"},"content":{"properties":{"classes":{"type":"string"},"description":{"type":"string"},"emblem":{"type":"null"},"icon":{"type":"string"},"message":{"type":"string"}},"type":"object"},"feature_class":{"type":"string"},"id":{"type":"string"},"jitm_stats_url":{"type":"string"},"template":{"type":"string"},"ttl":{"type":"integer"},"url":{"type":"string"}},"type":"object"},"type":"array"}},"type":"object"}')},716:function(e,t,n){},792:function(e,t,n){"use strict";n.r(t);var r=n(36),i=n.n(r),a=n(34),o=n.n(a),c=n(10),u=n.n(c),s=n(107),d=n.n(s),f=n(108),l=n.n(f),b=n(528),m=n.n(b),O=n(527),p=n.n(O),g=n(531),E=n.n(g),v=n(529),I=n.n(v),_=n(12),h=n.n(_),j=n(30),S=n(109),C=n(35),y=n(526),R=n.n(y),P=n(534),k=n.n(P),A=n(1),L=n(542),N=n(540),M=n(532),w=n(537),T=n(543),D=n(616),V=n(638),G=n(607),x=n(530),U=n.n(x),W=n(689),F=n(634),B=Object(W.a)(function(e){return function(t){return u.a.createElement(F.a.Consumer,null,function(n){return u.a.createElement(e,U()({},t,n))})}},"WithLocalizedMoment"),z=u.a.lazy(function(){return Promise.all([n.e(1),n.e(138),n.e(2),n.e(149)]).then(n.bind(null,789))}),H=u.a.lazy(function(){return Promise.all([n.e(1),n.e(136),n.e(2),n.e(154)]).then(n.bind(null,787))}),q=function(e){function t(){var e,n;d()(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=m()(this,(e=p()(t)).call.apply(e,[this].concat(i))),o()(E()(n),"renderLabelButton",function(e,t){var r=n.props,i=r.loaded,a=r.translate,o=r.items,s=r.orderId,d=r.siteId,f=R()("shipping-label__new-label-button",{"is-placeholder":!i});return i?wcConnectData.wcs_server_connection?e.length?t<o?u.a.createElement("div",{className:"shipping-label__multiple-buttons-container"},u.a.createElement(L.a,{className:f,primary:!0,busy:!i,disabled:!i,onClick:n.handleCreateLabelButtonClick},a("Create shipping label")),u.a.createElement(L.a,{onClick:n.handleTrackPackagesButtonClick},a("Track Package","Track Packages",{count:e.length})),u.a.createElement(c.Suspense,{fallback:u.a.createElement("div",null)},u.a.createElement(z,{orderId:s,siteId:d}),u.a.createElement(H,{orderId:s,siteId:d}))):u.a.createElement("div",null,u.a.createElement("span",{className:"shipping-label__redo-shipping-button"},u.a.createElement(L.a,{borderless:!0,onClick:n.handleCreateLabelButtonClick},a("Create new label"))),u.a.createElement(L.a,{onClick:n.handleTrackPackagesButtonClick},a("Track Package","Track Packages",{count:e.length})),u.a.createElement(c.Suspense,{fallback:u.a.createElement("div",null)},u.a.createElement(z,{orderId:s,siteId:d}),u.a.createElement(H,{orderId:s,siteId:d}))):u.a.createElement("div",null,u.a.createElement(L.a,{className:f,primary:!0,busy:!i,disabled:!i,onClick:n.handleCreateLabelButtonClick},a("Create shipping label")),u.a.createElement(c.Suspense,{fallback:u.a.createElement("div",null)},u.a.createElement(z,{orderId:s,siteId:d}))):u.a.createElement(L.a,null,a("Connection error: unable to create label at this time")):u.a.createElement(L.a,{className:"shipping-label__button-loading",primary:!0,busy:!0,disabled:!0})}),o()(E()(n),"handleCreateLabelButtonClick",function(){var e=n.props,t=e.orderId,r=e.siteId;n.props.openPrintingFlow(t,r)}),o()(E()(n),"handleTrackPackagesButtonClick",function(){var e=n.props,t=e.orderId,r=e.siteId;n.props.openTrackingFlow(t,r)}),n}return I()(t,e),l()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.siteId,n=e.orderId,r=e.orderLoading,i=e.orderLoaded;t&&n&&!r&&!i&&this.props.fetchOrder(t,n)}},{key:"render",value:function(){var e,t=this.props,n=t.loaded,r=t.labelsEnabled,i=t.items,a=t.translate,o=t.events,c=t.moment,s=!n||r,d=Object(A.filter)(o,{type:"LABEL_PURCHASED"}),f=Object(A.filter)(o,{type:"LABEL_REFUND_REQUESTED"}),l=Object(A.differenceBy)(d,f,"labelIndex"),b=Object(A.sumBy)(l,function(e){return e.productNames.length}),m=!1;l.length>0&&i<=b&&(m=!0,e=c(Object(A.maxBy)(l,"createdDate").createdDate).format("ll"));return u.a.createElement("div",{className:"shipping-label__container"},u.a.createElement("div",{className:"shipping-label__banner-fulfilled-message"},u.a.createElement(k.a,{size:36,icon:"shipping"}),n&&(m?u.a.createElement("em",null,a("%(itemCount)d item was fulfilled on {{span}}%(createdDate)s{{/span}}","%(itemCount)d items were fulfilled on {{span}}%(createdDate)s{{/span}}",{count:i,args:{createdDate:e,itemCount:i},components:{span:u.a.createElement("span",{className:"shipping-label__banner-fulfilled-date"})}})):u.a.createElement("em",null,a("%(itemCount)d item is ready to be fulfilled","%(itemCount)d items are ready to be fulfilled",{count:i,args:{itemCount:i}})))),u.a.createElement("div",null,s&&this.renderLabelButton(l,b)))}}]),t}(c.Component);o()(q,"propTypes",{orderId:h.a.number.isRequired});var K,Q=Object(S.b)(function(e,t){var n=t.orderId,r=Object(M.a)(e);return{siteId:r,loaded:Object(w.a)(e,n,r),events:Object(D.b)(e,n),orderLoading:Object(G.c)(e,n,r),orderLoaded:Object(G.b)(e,n,r),labelsEnabled:Object(T.a)(e,r)}},function(e){return i()({},Object(j.b)({openPrintingFlow:N.x,openTrackingFlow:N.A,setEmailDetailsOption:N.M,setFulfillOrderOption:N.N,fetchOrder:V.e},e))})(Object(C.localize)(B(q))),J=n(25),Y=n.n(J),Z=n(538),X=(K={},o()(K,Z.fb,function(e){e.error||window.wc_shipment_tracking_refresh&&window.wc_shipment_tracking_refresh()}),o()(K,Z.bb,function(){var e=Y()("#woocommerce-order-label");e.pointer&&e.pointer().pointer("close")}),K),$=function(){return function(e){return function(t){e(t);var n=X[t.type];n&&n(t)}}},ee=n(592),te=n(110),ne=n.n(te),re=n(46),ie=n(535),ae=n(690),oe=function(e){return Boolean(e&&e.name&&e.address&&e.city&&e.postcode&&e.country)},ce=function(e){if(!e)return{loaded:!1,isFetching:!1,error:!1,fulfillOrder:!1,emailDetails:!1};var t=e.formData,n=e.labelsData,r=e.paperSize,i=e.storeOptions,a=e.canChangeCountries,o=Boolean(t.origin_normalized||t.origin.phone),c=oe(t.origin),u=oe(t.destination),s={};return Object(A.forEach)(t.selected_packages,function(e){e.items.map(function(e){var n=e.product_id,r=e.weight,i=e.name,a=e.attributes,o=e.description,c=e.value,u=e.hs_tariff_number,d=e.origin_country,f=a?" ("+a+")":"",l=i.substring(i.indexOf("-")+1).trim()+f;s[n]={defaultDescription:l,description:o||l,weight:r,value:c,tariffNumber:u,originCountry:d||t.origin.country}})}),{loaded:!0,isFetching:!1,error:!1,fulfillOrder:!1,emailDetails:!1,refreshedLabelStatus:!1,labels:n||[],paperSize:r,storeOptions:i,form:{orderId:t.order_id,origin:{values:t.origin,isNormalized:o,normalized:o?t.origin:null,ignoreValidation:c?null:Object(A.mapValues)(t.origin,function(){return!0}),selectNormalized:!0,normalizationInProgress:!1,allowChangeCountry:Boolean(a)},destination:{values:t.destination,isNormalized:Boolean(t.destination_normalized),normalized:t.destination_normalized?t.destination:null,ignoreValidation:u?null:Object(A.mapValues)(t.destination,function(){return!0}),selectNormalized:!0,normalizationInProgress:!1,allowChangeCountry:Boolean(a)},packages:{all:t.all_packages,flatRateGroups:t.flat_rate_groups,selected:t.selected_packages,isPacked:t.is_packed,saved:!0},customs:{items:s,ignoreWeightValidation:Object(A.mapValues)(s,function(e){var t=e.weight;return!t||!parseFloat(t)}),ignoreValueValidation:Object(A.mapValues)(s,function(e){var t=e.value;return!t||!parseFloat(t)})},rates:{values:Object(A.isEmpty)(t.rates.selected)?Object(A.mapValues)(t.packages,function(){return{serviceId:"",signatureRequired:!1}}):t.rates.selected,available:{},retrievalInProgress:!1},rateOptions:{}},openedPackageId:Object.keys(t.selected_packages)[0]||""}},ue=n(637),se=function(e,t){for(var n=0;n<=t.length;n++)if(-1===t.indexOf(e+n))return e+n},de={};de[Z.V]=function(e,t){return i()({},e,ce(Object(A.omit)(t,"type","siteId")))},de[Z.Db]=function(e,t){var n=t.isFetching;return i()({},e,{isFetching:n})},de[Z.Bb]=function(e,t){var n=t.error;return i()({},e,{error:n})},de[Z.bb]=function(e){return i()({},e,{showPurchaseDialog:!0})},de[Z.Vb]=function(e){return i()({},e,{showTrackingDialog:!0})},de[Z.U]=function(e,t){return!t.force&&e.form.isSubmitting?e:i()({},e,{showPurchaseDialog:!1,form:i()({},e.form,{isSubmitting:!1})})},de[Z.F]=function(e){return i()({},e,{showTrackingDialog:!1})},de[Z.Ob]=function(e,t){var n=t.stepName,r=t.expanded,a=void 0===r?null:r;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{expanded:Object(A.isBoolean)(a)?a:!e.form[n].expanded})))})},de[Z.Pb]=function(e,t){var n=t.group,r=t.name,a=t.value,c=i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{values:i()({},e.form[n].values,o()({},r,a)),isNormalized:!1,isUnverifiable:!1,normalized:null})))});return"country"===r?de[Z.Pb](c,{group:n,name:"state",value:""}):(e.form[n].ignoreValidation&&(c.form[n].ignoreValidation=i()({},e.form[n].ignoreValidation,o()({},r,!1))),c)},de[Z.kb]=function(e,t){var n=t.group;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{ignoreValidation:null})))})},de[Z.H]=function(e,t){var n=t.group;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{normalizationInProgress:!0})))})},de[Z.G]=function(e,t){var n=t.group,r=t.requestSuccess,a=t.fieldErrors,c=t.normalized,u=t.isTrivialNormalization,s=i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{isNormalized:r,normalizationInProgress:!1,fieldErrors:a,selectNormalized:r&&!a,normalized:c})))});return u&&(s.form[n].values=c),s},de[Z.qb]=function(e,t){var n=t.group,r=t.selectNormalized;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{selectNormalized:r})))})},de[Z.S]=function(e,t){var n=t.group;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{selectNormalized:!1,normalized:null,isNormalized:!1,isUnverifiable:!1})))})},de[Z.T]=function(e,t){var n=t.group;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{selectNormalized:!1,normalized:null,isNormalized:!1,isUnverifiable:!0})))})},de[Z.Q]=function(e,t){var n=t.group,r=i()({},e.form[n],{expanded:!1,isNormalized:!0});return r.selectNormalized&&r.normalized?r.values=r.normalized:r.normalized=r.values,i()({},e,{form:i()({},e.form,o()({},n,r))})},de[Z.Qb]=function(e,t){var n=t.packageId,r=t.value,a=i()({},e.form.packages.selected);return a[n]=i()({},a[n],{weight:parseFloat(r),isUserSpecifiedWeight:!0}),i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:a,saved:!1}),rates:i()({},e.form.rates,{values:i()({},e.form.rates.values,o()({},n,{serviceId:"",signatureRequired:!1})),available:{}})})})},de[Z.Fb]=function(e,t){var n=t.packageId,r=t.signature,a=i()({},e.form.packages.selected);return a[n]=i()({},a[n],{signature:r}),i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:a,saved:!1}),rates:i()({},e.form.rates,{values:i()({},e.form.rates.values,o()({},n,{serviceId:"",signatureRequired:!1})),available:{}})})})},de[Z.ab]=function(e,t){var n=t.openedPackageId;return i()({},e,{openedPackageId:n})},de[Z.Z]=function(e,t){var n=t.movedItemIndex;return i()({},e,{showItemMoveDialog:!0,targetPackageId:e.openedPackageId,movedItemIndex:n})},de[Z.W]=function(e,t){var n=t.originPackageId,r=t.movedItemIndex,a=t.targetPackageId;if(-1===r||n===a||void 0===n)return e;var o=i()({},e.form.packages.selected),c=null,u=e.openedPackageId,s=ne()(o[n].items),d=s.splice(r,1)[0];if(o[n]=i()({},o[n],{items:s,weight:Object(A.round)(o[n].weight-d.weight,8)}),"individual"===a){var f=Object.keys(o);c=se("client_individual_",f);var l=d.height,b=d.length,m=d.width,O=d.weight;o[c]={height:l,length:b,width:m,weight:O,id:c,box_id:"individual",items:[d]}}else if("new"===a){var p=Object.keys(o);o[c=se("client_custom_",p)]={height:0,length:0,width:0,weight:d.weight,id:c,box_id:"not_selected",items:[d]}}else if(a){var g=ne()(o[a].items);g.push(d),o[a]=i()({},o[a],{items:g,weight:Object(A.round)(o[a].weight+d.weight,8)})}return 0===o[n].items.length&&(delete o[n],u=c||a),i()({},e,{openedPackageId:u,addedPackageId:c,movedItemIndex:-1,showItemMoveDialog:!1,form:i()({},e.form,{needsPrintConfirmation:!1,packages:i()({},e.form.packages,{selected:o,saved:!1}),rates:i()({},e.form.rates,{values:Object(A.mapValues)(o,function(){return{serviceId:"",signatureRequired:!1}}),available:{}})})})},de[Z.N]=function(e){return i()({},e,{movedItemIndex:-1,showItemMoveDialog:!1})},de[Z.Kb]=function(e,t){var n=t.targetPackageId;return i()({},e,{targetPackageId:n})},de[Z.X]=function(e){return i()({},e,{showAddItemDialog:!0,addedItems:{}})},de[Z.L]=function(e){return i()({},e,{showAddItemDialog:!1})},de[Z.sb]=function(e,t){var n,r=t.sourcePackageId,a=t.movedItemIndex;if(t.added){var c=e.addedItems[r]||[];n=Object(A.includes)(c,a)?c:[].concat(ne()(c),[a])}else n=Object(A.without)(e.addedItems[r],a);return i()({},e,{addedItems:i()({},e.addedItems,o()({},r,n))})},de[Z.I]=function(e,t){var n=t.targetPackageId;return Object(A.each)(e.addedItems,function(t,r){Object(A.sortBy)(t,function(e){return-e}).forEach(function(t){e=de[Z.W](e,{originPackageId:r,movedItemIndex:t,targetPackageId:n})})}),i()({},e,{showAddItemDialog:!1})},de[Z.J]=function(e){var t=i()({},e.form.packages.selected),n=Object.keys(t),r=se("client_custom_",n),a=r;return t[r]={height:0,length:0,width:0,id:r,weight:0,box_id:"not_selected",items:[]},i()({},e,{openedPackageId:a,addedPackageId:r,form:i()({},e.form,{needsPrintConfirmation:!1,packages:i()({},e.form.packages,{selected:t,saved:!1}),rates:i()({},e.form.rates,{values:Object(A.mapValues)(t,function(){return{serviceId:"",signatureRequired:!1}}),available:{}})})})},de[Z.lb]=function(e,t){var n=t.packageId,r=i()({},e.form.packages.selected),a=r[n].items;delete r[n];var o=Object.keys(r)[0]||"",c=i()({},r[o]);return c.items=c.items.concat(a),r[o]=c,i()({},e,{openedPackageId:o,form:i()({},e.form,{needsPrintConfirmation:!1,packages:i()({},e.form.packages,{selected:r,saved:!1}),rates:i()({},e.form.rates,{values:Object(A.mapValues)(r,function(){return{serviceId:"",signatureRequired:!1}}),available:{}})})})},de[Z.Gb]=function(e,t){var n=t.box,r=t.packageId,a=t.boxTypeId,o=i()({},e.form.packages.selected),c=o[r],u=Object(A.round)(c.isUserSpecifiedWeight?c.weight:(n?n.box_weight:0)+Object(A.sumBy)(c.items,"weight"),8);if("not_selected"!==a&&n){var s=Object(ae.a)(n),d=s.length,f=s.width,l=s.height;o[r]=i()({},Object(A.omit)(c,"service_id"),{height:l,length:d,width:f,weight:u,box_id:a,is_letter:n.is_letter})}else o[r]=i()({},Object(A.omit)(c,"service_id"),{height:0,length:0,width:0,weight:u,box_id:a});return i()({},e,{form:i()({},e.form,{needsPrintConfirmation:!1,packages:i()({},e.form.packages,{selected:o,saved:!1}),rates:i()({},e.form.rates,{values:Object(A.mapValues)(o,function(){return{serviceId:"",signatureRequired:!1}}),available:{}})})})},de[Z.pb]=function(e){return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{saved:!0})})})},de[Z.ub]=function(e,t){var n=t.packageId,r=t.contentsType;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{contentsType:r})))})})})},de[Z.tb]=function(e,t){var n=t.packageId,r=t.contentsExplanation;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{contentsExplanation:r})))})})})},de[Z.Jb]=function(e,t){var n=t.packageId,r=t.restrictionType;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{restrictionType:r})))})})})},de[Z.Ib]=function(e,t){var n=t.packageId,r=t.restrictionComments;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{restrictionComments:r})))})})})},de[Z.rb]=function(e,t){var n=t.packageId,r=t.abandonOnNonDelivery;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{abandonOnNonDelivery:Boolean(r)})))})})})},de[Z.Eb]=function(e,t){var n=t.packageId,r=t.itn;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{itn:r})))})})})},de[Z.vb]=function(e,t){var n=t.productId,r=t.description;return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:i()({},e.form.customs.items,o()({},n,i()({},e.form.customs.items[n],{description:r})))})})})},de[Z.xb]=function(e,t){var n=t.productId,r=t.tariffNumber;return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:i()({},e.form.customs.items,o()({},n,i()({},e.form.customs.items[n],{tariffNumber:r.replace(/\D/g,"").substr(0,6)})))})})})},de[Z.zb]=function(e,t){var n=t.productId,r=t.weight;return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:i()({},e.form.customs.items,o()({},n,i()({},e.form.customs.items[n],{weight:r}))),ignoreWeightValidation:i()({},e.form.customs.ignoreWeightValidation,o()({},n,!1))})})})},de[Z.yb]=function(e,t){var n=t.productId,r=t.value;return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:i()({},e.form.customs.items,o()({},n,i()({},e.form.customs.items[n],{value:r}))),ignoreValueValidation:i()({},e.form.customs.ignoreValueValidation,o()({},n,!1))})})})},de[Z.wb]=function(e,t){var n=t.productId,r=t.originCountry;return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:i()({},e.form.customs.items,o()({},n,i()({},e.form.customs.items[n],{originCountry:r})))})})})},de[Z.ob]=function(e){return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:Object(A.mapValues)(e.form.customs.items,function(e){return i()({},e,{tariffNumber:e.tariffNumber||""})}),ignoreWeightValidation:{},ignoreValueValidation:{}})})})},de[Z.Sb]=function(e,t){var n=t.packageId,r=t.serviceId,a=t.carrierId,o=t.signatureRequired,c=i()({},e.form.rates.values);return c[n]={serviceId:r,carrierId:a,signatureRequired:o},i()({},e,{form:i()({},e.form,{rates:i()({},e.form.rates,{values:c})})})},de[Z.Rb]=function(e,t){var n=t.value;return i()({},e,{paperSize:n})},de[Z.Ab]=function(e,t){var n=t.value;return i()({},e,{emailDetails:n})},de[Z.Cb]=function(e,t){var n=t.value;return i()({},e,{fulfillOrder:n})},de[Z.eb]=function(e){return i()({},e,{form:i()({},e.form,{isSubmitting:!0})})},de[Z.fb]=function(e,t){var n=t.response;return t.error?i()({},e,{form:i()({},e.form,{isSubmitting:!1})}):i()({},e,{labels:[].concat(ne()(n.map(function(e){return i()({},e,{statusUpdated:!0})})),ne()(e.labels))})},de[Z.Lb]=function(e,t){var n=t.fileData,r=t.labels;return i()({},e,{form:i()({},e.form,{needsPrintConfirmation:!0,fileData:n,labelsToPrint:r,isSubmitting:!1})})},de[Z.hb]=function(e,t){var n=t.requestData;return i()({},e,{form:i()({},e.form,{rates:i()({},e.form.rates,{retrievalInProgress:n})})})},de[Z.Hb]=function(e,t){var n=t.rates,r=t.requestData;return Object(A.isEqual)(r,e.form.rates.retrievalInProgress)?i()({},e,{form:i()({},e.form,{rates:{values:Object(A.mapValues)(n,function(e){var t=Object(A.get)(e,"rates",[]),n=1===t.length?t[0]:Object(A.find)(t,function(e){return e.is_selected});return n?n.service_id:""}),available:n}})}):e},de[Z.gb]=function(e,t){var n=t.requestData;return Object(A.isEqual)(n,e.form.rates.retrievalInProgress)?i()({},e,{form:i()({},e.form,{rates:i()({},e.form.rates,{retrievalInProgress:null})})}):e},de[Z.K]=function(e){return i()({},e,{form:i()({},e.form,{needsPrintConfirmation:!1,rates:i()({},e.form.rates,{available:{}})})})},de[Z.cb]=function(e,t){var n=t.labelId;return i()({},e,{refundDialog:{labelId:n}})},de[Z.O]=function(e){return e.refundDialog.isSubmitting?e:i()({},e,{refundDialog:null})},de[Z.Nb]=function(e,t){var n=t.labelId,r=Object(A.findIndex)(e.labels,{label_id:n}),a=i()({},e.labels[r],{statusRetrivalInProgress:!0}),o=i()({},e,{labels:ne()(e.labels)});return o.labels[r]=a,o},de[Z.Mb]=function(e,t){var n=t.labelId,r=t.response;t.error&&(r={});var a=Object(A.findIndex)(e.labels,{label_id:n}),o=i()({},e.labels[a],r,{statusUpdated:!0,statusRetrivalInProgress:!1}),c=i()({},e,{labels:ne()(e.labels),refreshedLabelStatus:!0});return c.labels[a]=o,c},de[Z.ib]=function(e){return i()({},e,{refundDialog:i()({},e.refundDialog,{isSubmitting:!0})})},de[Z.jb]=function(e,t){var n=t.response;if(t.error)return i()({},e,{refundDialog:i()({},e.refundDialog,{isSubmitting:!1})});var r=Object(A.findIndex)(e.labels,{label_id:e.refundDialog.labelId}),a=i()({},e.labels[r],{refund:n}),o=i()({},e,{refundDialog:null,labels:ne()(e.labels)});return o.labels[r]=a,o},de[Z.db]=function(e,t){var n=t.labelId;return i()({},e,{reprintDialog:{labelId:n,isFetching:!0}})},de[Z.nb]=function(e,t){var n=t.labelId,r=t.fileData;return Object(A.get)(e,"reprintDialog.labelId")!==n?e:i()({},e,{reprintDialog:{labelId:n,fileData:r,isFetching:!1}})},de[Z.mb]=function(e,t){var n=t.labelId;return Object(A.get)(e,"reprintDialog.labelId")!==n?e:i()({},e,{reprintDialog:{labelId:n,isFetching:!1}})},de[Z.P]=function(e){return i()({},e,{reprintDialog:null})},de[Z.R]=function(e){return i()({},e,{reprintDialog:i()({},e.reprintDialog,{isFetching:!0})})},de[Z.Y]=function(e,t){var n=t.labelId;return i()({},e,{detailsDialog:{labelId:n}})},de[Z.M]=function(e){return i()({},e,{detailsDialog:null})},de[ie.H]=function(e,t){var n=t.order.status;return i()({},e,{fulfillOrder:!Object(ue.b)(n),emailDetails:Object(ue.b)(n)})};var fe=Object(re.d)("orderId",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ce(),t=arguments.length>1?arguments[1]:void 0;return de[t.type]?de[t.type](e,t):e}),le=n(651),be=n(652),me=n(636);var Oe=Object(re.a)({isSending:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=t.type,r=t.orderId;switch(n){case ie.s:return i()({},e,o()({},r,!0));case ie.u:case ie.t:return i()({},e,o()({},r,!1));default:return e}}});var pe=Object(re.a)({isLoading:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.v:case ie.x:case ie.w:return Object.assign({},e,o()({},t.orderId,ie.v===t.type));default:return e}},isSaving:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.y:case ie.z:case ie.A:return Object.assign({},e,o()({},t.orderId,ie.y===t.type));default:return e}},items:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.x:var n=Object(A.keyBy)(t.notes,"id");return Object.assign({},e,n);case ie.A:var r=t.note;return Object.assign({},e,o()({},r.id,r));default:return e}},orders:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.x:var n=t.notes.map(function(e){return e.id});return Object.assign({},e,o()({},t.orderId,n));case ie.A:var r=t.note,i=t.orderId,a=[].concat(ne()(e[i]||[]),[r.id]);return Object.assign({},e,o()({},i,a));default:return e}}});var ge=Object(re.d)("orderId",Object(re.a)({isSaving:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.C:case ie.E:case ie.D:return ie.C===t.type;default:return e}},items:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.B:return t.refunds;case ie.E:return[].concat(ne()(e),[t.refund]);default:return e}}}));var Ee=Object(re.a)({invoice:Oe,isDeleting:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.p:case ie.q:case ie.r:return Object.assign({},e,o()({},t.orderId,ie.p===t.type));default:return e}},isQueryLoading:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.m:case ie.o:case ie.n:var n=Object(me.c)(t.query);return Object.assign({},e,o()({},n,ie.m===t.type));default:return e}},isLoading:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.F:case ie.H:case ie.G:return Object.assign({},e,o()({},t.orderId,ie.F===t.type));default:return e}},isUpdating:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=Object(A.isFinite)(t.orderId)?t.orderId:JSON.stringify(t.orderId);switch(t.type){case ie.I:case ie.K:case ie.J:return Object.assign({},e,o()({},n,ie.I===t.type));default:return e}},items:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case ie.o:return e=Object(A.keyBy)(n.orders,"id"),Object.assign({},t,e);case ie.H:case ie.K:return e=o()({},n.order.id,n.order),Object.assign({},t,e);default:return t}},queries:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.o:var n=t.orders.map(function(e){return e.id}),r=Object(me.c)(t.query);return Object.assign({},e,o()({},r,n));default:return e}},refunds:ge,total:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.o:var n=Object(me.c)(Object(A.omit)(t.query,"page"));return Object.assign({},e,o()({},n,t.total));default:return e}},notes:pe}),ve=n(47),Ie=n.n(ve),_e=n(605),he=n(608),je=n(549);function Se(e){return{type:ie.f,siteId:e}}var Ce=function(e){return Object(A.get)(e,"ui.route.path.current",null)},ye=n(712),Re=n.n(ye),Pe=n(113),ke=n.n(Pe),Ae=function(e){function t(e){var n;return d()(this,t),(n=m()(this,p()(t).call(this,"Failed to validate with JSON schema"))).schemaErrors=e,n}return I()(t,e),t}(Re()(Error)),Le=function(e){function t(e,n,r){var i;return d()(this,t),(i=m()(this,p()(t).call(this,e.message))).inputData=n,i.transformer=r,i}return I()(t,e),t}(Re()(Error));var Ne,Me,we,Te=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:A.identity,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(a){return t||function(){var a=Object.assign({greedy:!0,verbose:!0},i),o=ke()(e,a),c=ke.a.filter(Object.assign({},e,e.type&&"object"===e.type&&{additionalProperties:!1}));n=function(e){if(!o(e))throw new Ae(o.errors);return c(e)},t=function(e){try{return r(e)}catch(t){throw new Le(t,e,r)}}}(),t(n(a))}},De=n(715),Ve=n(533),Ge=n.n(Ve),xe=function(e){var t=e.apiVersion,n=e.apiNamespace,r=e.body,a=e.method,o=e.path,c=e.query,u=void 0===c?{}:c,s=e.formData,d=e.onSuccess,f=e.onFailure,l=e.onProgress,b=Ge()(e,["apiVersion","apiNamespace","body","method","path","query","formData","onSuccess","onFailure","onProgress"]),m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,O=n?{apiNamespace:n}:{apiVersion:t};return{type:"WPCOM_HTTP_REQUEST",body:r,method:a,path:o,query:i()({},u,O),formData:s,onSuccess:d||m,onFailure:f||m,onProgress:l||m,options:b}},Ue=n(562),We=n(609),Fe={},Be=new Set,ze={hasInitializedSites:!1,hasInitializedSection:!1,lastSection:null,lastSite:null},He=["/jetpack/connect/user-type","/jetpack/connect/site-type","/jetpack/connect/site-topic"],qe=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(t)})},Ke=function(e){return e.data.map(function(e){return{message:qe(e.content.message),description:qe(e.content.description),featureClass:e.feature_class,callToAction:qe(e.CTA.message),id:e.id}})},Qe=function(e){return function(t,n){if(ze.hasInitializedSites&&ze.hasInitializedSection){var r=ze.lastSite;if(Object(Ue.c)(n(),r)){var a=Ce(n());Object(A.some)(He,function(e){return Object(A.startsWith)(a,e)})||t(xe({apiNamespace:"rest",method:"GET",path:"/v1.1/jetpack-blogs/".concat(r,"/rest-api/"),query:{path:"/jetpack/v4/jitm",query:JSON.stringify({message_path:"calypso:".concat(ze.lastSection,":admin_notices")}),http_envelope:1}},i()({},e,{messagePath:ze.lastSection})))}}}},Je=function(e,t){return function(n,r){n(function(e,t,n){return{type:"JITM_SET",keyedPath:t+e,jitms:n.map(function(e){return i()({},e,{lastUpdated:Date.now()})})}}(e.siteId||e.site_id||Object(M.a)(r()),e.messagePath,t))}},Ye=function(e){return function(t,n){t(function(e,t){return{type:"JITM_SET",keyedPath:t+e,jitms:[]}}(e.siteId||e.site_id||Object(M.a)(n()),e.messagePath))}};Me="state/data-layer/wpcom/sites/jitm/index.js",Ne={},o()(Ne,"SECTION_SET",[Object(he.a)({fetch:function(e){var t=Object(A.get)(e,["section","name"]);if(!ze.hasInitializedSection||!e.section||ze.lastSection!==t){switch(e.isLoading){case!1:return void(ze.hasInitializedSection=!0);case!0:return void(ze.hasInitializedSection=!1)}return ze.lastSection=t,Qe(e)}},onSuccess:Je,onError:Ye,fromApi:Te(De,Ke)})]),o()(Ne,"SELECTED_SITE_SET",[Object(he.a)({fetch:function(e){if(!ze.hasInitializedSites||ze.lastSite!==e.siteId)return ze.hasInitializedSites=!!e.siteId,ze.lastSite=e.siteId,Qe(e)},onSuccess:Je,onError:Ye,fromApi:Te(De,Ke)})]),o()(Ne,"JITM_DISMISS",[Object(he.a)({fetch:function(e){return xe({apiNamespace:"rest",method:"POST",path:"/jetpack-blogs/".concat(e.siteId,"/rest-api/"),query:{path:"/jetpack/v4/jitm",body:JSON.stringify({feature_class:e.featureClass,id:e.id}),http_envelope:1,json:!1}},e)},onSuccess:A.noop,onError:A.noop})]),we=Ne,Be.has(Me)||(Be.add(Me),Fe=Object(We.a)(Fe,we));var Ze,Xe=n(635),$e=n(639),et=Ie()("woocommerce:orders");function tt(e,t){if(et("API Error: ",t),e.failureAction)return i()({},e.failureAction,{error:t})}var nt,rt=(Ze={},o()(Ze,ie.p,[Object(he.a)({fetch:function(e){var t=e.siteId,n=e.orderId;return Object(Xe.a)(t,e).del("orders/".concat(n))},onSuccess:function(e){return function(t){var n=e.siteId,r=e.siteSlug,i=e.orderId;t(Object(V.b)(n,i)),t(Se(n)),t({type:"NAVIGATE",path:"/store/orders/".concat(r)}),t(Object(je.d)(Object(C.translate)("Order deleted."),{duration:8e3}))}},onError:function(e,t){return function(n){var r=e.siteId,i=e.orderId;n(Object(V.a)(r,i,t)),n(Object(je.a)(Object(C.translate)("Unable to delete order."),{duration:8e3}))}},fromApi:$e.a})]),o()(Ze,ie.F,[Object(he.a)({fetch:function(e){var t=e.siteId,n=e.orderId;return e.failureAction=Object(V.c)(t,n),Object(Xe.a)(t,e).get("orders/".concat(n))},onSuccess:function(e,t){var n=t.data,r=e.siteId,i=e.orderId;return Object(V.i)(r,i,n)},onError:tt})]),o()(Ze,ie.I,[Object(he.a)({fetch:function(e){var t=e.siteId,n=e.orderId,r=e.order;return Object(A.isFinite)(n)?Object(Xe.a)(t,e).post("orders/".concat(n),r):Object(Xe.a)(t,e).post("orders",r)},onSuccess:function(e,t){var n=t.data;return function(t){var r=e.siteId,i=e.orderId;"function"===typeof e.onSuccess&&"undefined"!==typeof n.id&&e.onSuccess(t,n.id),t(Se(r)),t(Object(V.h)(r,i,n))}},onError:function(e,t){return function(n){var r=e.siteId,i=e.orderId;"function"===typeof e.onFailure&&e.onFailure(n),et("API Error: ",t),n(Object(V.g)(r,i,t))}}})]),o()(Ze,ie.m,[Object(he.a)({fetch:function(e){var t=e.siteId,n=e.query,r=Object(_e.stringify)(Object(A.omitBy)(n,function(e){return""===e}));return e.failureAction=Object(V.d)(t,n),Object(Xe.a)(t,e).getWithHeaders("orders?".concat(r))},onSuccess:function(e,t){var n=t.data,r=e.siteId,i=e.query,a=n.body,o=n.headers,c=Number(o["X-WP-Total"]);return Object(V.j)(r,i,a,c)},onError:tt})]),Ze),it=n(687),at=(nt={},o()(nt,ie.v,[Object(he.a)({fetch:function(e){var t=e.siteId,n=e.orderId;return Object(Xe.a)(t,e).get("orders/".concat(n,"/notes"))},onSuccess:function(e,t){var n=t.data;return function(t){var r=e.siteId,i=e.orderId;t(Object(it.e)(r,i,n)),e.onSuccess&&t(e.onSuccess)}},onError:function(e,t){return function(n){var r=e.siteId,i=e.orderId;n(Object(it.d)(r,i,t)),e.onFailure&&n(e.onFailure)}},fromApi:$e.a})]),o()(nt,ie.y,[Object(he.a)({fetch:function(e){var t=e.siteId,n=e.orderId,r=e.note;return Object(Xe.a)(t,e).post("orders/".concat(n,"/notes"),r)},onSuccess:function(e,t){var n=t.data;return function(t){var r=e.siteId,i=e.orderId;t(Object(it.c)(r,i,n)),e.onSuccess&&t(e.onSuccess)}},onError:function(e,t){return function(n){var r=e.siteId,i=e.orderId;n(Object(it.b)(r,i,t)),e.onFailure&&n(e.onFailure)}},fromApi:$e.a})]),nt),ot=n(657),ct=n(633),ut=n(116),st=n(691),dt=o()({},ie.k,[Object(he.a)({fetch:function(e){var t=e.siteId;return Object(Xe.a)(t,e,"/wc/v3").get("data/continents")},onSuccess:function(e,t){var n=e.siteId,r=t.data;return Object(st.c)(n,r)},onError:function(e,t){var n=e.siteId;return Object(st.b)(n,t)}})]),ft=n(658),lt=(n(716),u.a.lazy(function(){return Promise.all([n.e(1),n.e(136),n.e(2),n.e(137),n.e(152)]).then(n.bind(null,796))}));t.default=function(e){var t=e.order,n=e.accountSettings,r=e.packagesSettings,a=e.shippingLabelData,s=e.continents,d=e.context,f=e.items,l=t?t.id:null,b=void 0!==n;return{getReducer:function(){return Object(re.a)({extensions:Object(re.a)({woocommerce:Object(re.a)({woocommerceServices:Object(re.a)({1:Object(re.a)({shippingLabel:fe,packages:le.a,labelSettings:be.a})}),sites:Object(re.a)({1:Object(re.a)({orders:Ee,data:Object(re.a)({locations:ft.a})})})})}),notices:ee.a,ui:function(){return{selectedSiteId:1}}})},getInitialState:function(){var e={extensions:{woocommerce:{sites:{1:{orders:{notes:{isLoading:o()({},l,!1)}}}}}}};return b?function(e){var c=n.storeOptions,u=n.formMeta,d=n.userMeta,f=n.formData,b=r.formData,m=r.storeOptions.dimension_unit,O=r.storeOptions.weight_unit,p=r.formSchema.custom?r.formSchema.custom.items:void 0,g=r.formSchema.predefined;return e.extensions.woocommerce.woocommerceServices={1:{shippingLabel:o()({},l,ce(a)),labelSettings:{storeOptions:c,meta:i()({},u,{pristine:!0,isLoaded:!0,user:d}),data:i()({},f)},packages:{modalErrors:{},pristine:!0,packages:b,dimensionUnit:m,weightUnit:O,packageSchema:p,predefinedSchema:g,packageData:{is_user_defined:!0},isLoaded:!0}}},e.extensions.woocommerce.sites[1].orders.isLoading=o()({},l,!1),e.extensions.woocommerce.sites[1].orders.items=o()({},l,t),e.extensions.woocommerce.sites[1].data={locations:s},e}(e):e},getStateForPersisting:function(){return null},getStateKey:function(){return"wcs-label-".concat(l)},getMiddlewares:function(){return[$,Object(ut.b)(Object(We.a)(ct.a,ot.a,rt,at,dt))]},View:function(){return"shipment_tracking"===d?u.a.createElement(c.Suspense,{fallback:u.a.createElement("div",null)},u.a.createElement(lt,{orderId:l})):u.a.createElement(Q,{orderId:l,items:f})}}}}}]);
|
dist/chunks/{3ea9563c44a821018d8f.css → 79ab4180ca5c01bfa81b.css}
RENAMED
File without changes
|
dist/chunks/{3ea9563c44a821018d8f.min.js → 79ab4180ca5c01bfa81b.min.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[146,139],{532:function(e,t,n){"use strict";n.d(t,"a",function(){return r});n(1),n(562);function r(e){return e.ui.selectedSiteId}},535:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a}),n.d(t,"d",function(){return i}),n.d(t,"e",function(){return c}),n.d(t,"c",function(){return o}),n.d(t,"f",function(){return s}),n.d(t,"h",function(){return u}),n.d(t,"g",function(){return l}),n.d(t,"j",function(){return d}),n.d(t,"i",function(){return E}),n.d(t,"k",function(){return f}),n.d(t,"l",function(){return m}),n.d(t,"p",function(){return p}),n.d(t,"q",function(){return O}),n.d(t,"r",function(){return _}),n.d(t,"s",function(){return g}),n.d(t,"t",function(){return b}),n.d(t,"u",function(){return h}),n.d(t,"y",function(){return v}),n.d(t,"z",function(){return C}),n.d(t,"A",function(){return S}),n.d(t,"v",function(){return I}),n.d(t,"w",function(){return j}),n.d(t,"x",function(){return R}),n.d(t,"C",function(){return N}),n.d(t,"E",function(){return y}),n.d(t,"D",function(){return P}),n.d(t,"B",function(){return M}),n.d(t,"F",function(){return T}),n.d(t,"G",function(){return A}),n.d(t,"H",function(){return k}),n.d(t,"I",function(){return L}),n.d(t,"J",function(){return D}),n.d(t,"K",function(){return w}),n.d(t,"m",function(){return W}),n.d(t,"n",function(){return U}),n.d(t,"o",function(){return x}),n.d(t,"L",function(){return G}),n.d(t,"M",function(){return V}),n.d(t,"N",function(){return H}),n.d(t,"O",function(){return F}),n.d(t,"P",function(){return B}),n.d(t,"Q",function(){return q}),n.d(t,"R",function(){return z}),n.d(t,"S",function(){return Z}),n.d(t,"T",function(){return K}),n.d(t,"W",function(){return Q}),n.d(t,"X",function(){return Y}),n.d(t,"U",function(){return $}),n.d(t,"V",function(){return X}),n.d(t,"ab",function(){return J}),n.d(t,"bb",function(){return ee}),n.d(t,"Y",function(){return te}),n.d(t,"Z",function(){return ne}),n.d(t,"gb",function(){return re}),n.d(t,"hb",function(){return ae}),n.d(t,"ib",function(){return ie}),n.d(t,"jb",function(){return ce}),n.d(t,"kb",function(){return oe}),n.d(t,"lb",function(){return se}),n.d(t,"mb",function(){return ue}),n.d(t,"nb",function(){return le}),n.d(t,"ob",function(){return de}),n.d(t,"pb",function(){return Ee}),n.d(t,"qb",function(){return fe}),n.d(t,"rb",function(){return me}),n.d(t,"sb",function(){return pe}),n.d(t,"tb",function(){return Oe}),n.d(t,"ub",function(){return _e}),n.d(t,"vb",function(){return ge}),n.d(t,"wb",function(){return be}),n.d(t,"xb",function(){return he}),n.d(t,"yb",function(){return ve}),n.d(t,"zb",function(){return Ce}),n.d(t,"Bb",function(){return Se}),n.d(t,"Ab",function(){return Ie}),n.d(t,"Cb",function(){return je}),n.d(t,"Db",function(){return Re}),n.d(t,"Eb",function(){return Ne}),n.d(t,"Fb",function(){return ye}),n.d(t,"Gb",function(){return Pe}),n.d(t,"Hb",function(){return Me}),n.d(t,"Ib",function(){return Te}),n.d(t,"Jb",function(){return Ae}),n.d(t,"Kb",function(){return ke}),n.d(t,"Lb",function(){return Le}),n.d(t,"Mb",function(){return De}),n.d(t,"Nb",function(){return we}),n.d(t,"Ob",function(){return We}),n.d(t,"Pb",function(){return Ue}),n.d(t,"Qb",function(){return xe}),n.d(t,"Rb",function(){return Ge}),n.d(t,"Sb",function(){return Ve}),n.d(t,"eb",function(){return He}),n.d(t,"fb",function(){return Fe}),n.d(t,"cb",function(){return Be}),n.d(t,"db",function(){return qe});var r="WOOCOMMERCE_ACTION_LIST_ANNOTATE",a="WOOCOMMERCE_ACTION_LIST_CLEAR",i="WOOCOMMERCE_ACTION_LIST_STEP_NEXT",c="WOOCOMMERCE_ACTION_LIST_STEP_SUCCESS",o="WOOCOMMERCE_ACTION_LIST_STEP_FAILURE",s="WOOCOMMERCE_COUNT_REQUEST",u="WOOCOMMERCE_COUNT_REQUEST_SUCCESS",l="WOOCOMMERCE_COUNT_REQUEST_FAILURE",d="WOOCOMMERCE_ERROR_SET",E="WOOCOMMERCE_ERROR_CLEAR",f="WOOCOMMERCE_LOCATIONS_REQUEST",m="WOOCOMMERCE_LOCATIONS_REQUEST_SUCCESS",p="WOOCOMMERCE_ORDER_DELETE",O="WOOCOMMERCE_ORDER_DELETE_FAILURE",_="WOOCOMMERCE_ORDER_DELETE_SUCCESS",g="WOOCOMMERCE_ORDER_INVOICE_SEND",b="WOOCOMMERCE_ORDER_INVOICE_SEND_FAILURE",h="WOOCOMMERCE_ORDER_INVOICE_SEND_SUCCESS",v="WOOCOMMERCE_ORDER_NOTE_CREATE",C="WOOCOMMERCE_ORDER_NOTE_CREATE_FAILURE",S="WOOCOMMERCE_ORDER_NOTE_CREATE_SUCCESS",I="WOOCOMMERCE_ORDER_NOTES_REQUEST",j="WOOCOMMERCE_ORDER_NOTES_REQUEST_FAILURE",R="WOOCOMMERCE_ORDER_NOTES_REQUEST_SUCCESS",N="WOOCOMMERCE_ORDER_REFUND_CREATE",y="WOOCOMMERCE_ORDER_REFUND_CREATE_SUCCESS",P="WOOCOMMERCE_ORDER_REFUND_CREATE_FAILURE",M="WOOCOMMERCE_ORDER_REFUNDS_REQUEST_SUCCESS",T="WOOCOMMERCE_ORDER_REQUEST",A="WOOCOMMERCE_ORDER_REQUEST_FAILURE",k="WOOCOMMERCE_ORDER_REQUEST_SUCCESS",L="WOOCOMMERCE_ORDER_UPDATE",D="WOOCOMMERCE_ORDER_UPDATE_FAILURE",w="WOOCOMMERCE_ORDER_UPDATE_SUCCESS",W="WOOCOMMERCE_ORDERS_REQUEST",U="WOOCOMMERCE_ORDERS_REQUEST_FAILURE",x="WOOCOMMERCE_ORDERS_REQUEST_SUCCESS",G="WOOCOMMERCE_SERVICES_SHIPPING_ACTION_LIST_CREATE",V="WOOCOMMERCE_SETTINGS_PRODUCTS_CHANGE_SETTING",H="WOOCOMMERCE_SETTINGS_PRODUCTS_REQUEST",F="WOOCOMMERCE_SETTINGS_PRODUCTS_REQUEST_SUCCESS",B="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST",q="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST_FAILURE",z="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST_SUCCESS",Z="WOOCOMMERCE_SETTINGS_STRIPE_CONNECT_ACCOUNT_CLEAR_COMPLETED_NOTIFICATION",K="WOOCOMMERCE_SETTINGS_STRIPE_CONNECT_ACCOUNT_CLEAR_ERROR",Q="WOOCOMMERCE_SETTINGS_STRIPE_CONNECT_ACCOUNT_DETAILS_REQUEST",Y="WOOCOMMERCE_SETTINGS_STRIPE_CONNECT_ACCOUNT_DETAILS_UPDATE",$="WOOCOMMERCE_SETTINGS_STRIPE_CONNECT_ACCOUNT_DEAUTHORIZE",X="WOOCOMMERCE_SETTINGS_STRIPE_CONNECT_ACCOUNT_DEAUTHORIZE_COMPLETE",J="WOOCOMMERCE_SETTINGS_STRIPE_CONNECT_ACCOUNT_DEAUTHORIZE_OAUTH_INIT",ee="WOOCOMMERCE_SETTINGS_STRIPE_CONNECT_ACCOUNT_OAUTH_INIT_COMPLETE",te="WOOCOMMERCE_SETTINGS_STRIPE_CONNECT_ACCOUNT_OAUTH_CONNECT",ne="WOOCOMMERCE_SETTINGS_STRIPE_CONNECT_ACCOUNT_OAUTH_CONNECT_COMPLETE",re="WOOCOMMERCE_SHIPPING_ZONE_ADD",ae="WOOCOMMERCE_SHIPPING_ZONE_CANCEL",ie="WOOCOMMERCE_SHIPPING_ZONE_CLOSE",ce="WOOCOMMERCE_SHIPPING_ZONE_DELETED",oe="WOOCOMMERCE_SHIPPING_ZONE_EDIT_NAME",se="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_CANCEL",ue="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_CLOSE",le="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_EDIT",de="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_EDIT_POSTCODE",Ee="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_POSTCODE",fe="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_STATE",me="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_WHOLE_COUNTRY",pe="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_CONTINENT",Oe="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_COUNTRY",_e="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_STATE",ge="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_UPDATED",be="WOOCOMMERCE_SHIPPING_ZONE_METHODS_REQUEST",he="WOOCOMMERCE_SHIPPING_ZONE_METHODS_REQUEST_SUCCESS",ve="WOOCOMMERCE_SHIPPING_ZONE_METHOD_ADD",Ce="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CANCEL",Se="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CLOSE",Ie="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CHANGE_TYPE",je="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CREATE",Re="WOOCOMMERCE_SHIPPING_ZONE_METHOD_DELETE",Ne="WOOCOMMERCE_SHIPPING_ZONE_METHOD_DELETED",ye="WOOCOMMERCE_SHIPPING_ZONE_METHOD_EDIT_TITLE",Pe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_OPEN",Me="WOOCOMMERCE_SHIPPING_ZONE_METHOD_REMOVE",Te="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_CONDITION",Ae="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_COST",ke="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_MIN_COST",Le="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_TAXABLE",De="WOOCOMMERCE_SHIPPING_ZONE_METHOD_TOGGLE_ENABLED",we="WOOCOMMERCE_SHIPPING_ZONE_METHOD_TOGGLE_OPENED_ENABLED",We="WOOCOMMERCE_SHIPPING_ZONE_METHOD_UPDATE",Ue="WOOCOMMERCE_SHIPPING_ZONE_METHOD_UPDATED",xe="WOOCOMMERCE_SHIPPING_ZONE_OPEN",Ge="WOOCOMMERCE_SHIPPING_ZONE_REMOVE",Ve="WOOCOMMERCE_SHIPPING_ZONE_UPDATED",He="WOOCOMMERCE_SHIPPING_ZONES_REQUEST",Fe="WOOCOMMERCE_SHIPPING_ZONES_REQUEST_SUCCESS",Be="WOOCOMMERCE_SHIPPING_CLASSES_REQUEST",qe="WOOCOMMERCE_SHIPPING_CLASSES_REQUEST_SUCCESS"},537:function(e,t,n){"use strict";n.d(t,"i",function(){return m}),n.d(t,"s",function(){return p}),n.d(t,"r",function(){return O}),n.d(t,"q",function(){return _}),n.d(t,"g",function(){return g}),n.d(t,"u",function(){return b}),n.d(t,"t",function(){return h}),n.d(t,"l",function(){return v}),n.d(t,"e",function(){return C}),n.d(t,"k",function(){return S}),n.d(t,"o",function(){return I}),n.d(t,"m",function(){return y}),n.d(t,"f",function(){return T}),n.d(t,"n",function(){return A}),n.d(t,"p",function(){return k}),n.d(t,"d",function(){return L}),n.d(t,"b",function(){return D}),n.d(t,"h",function(){return w}),n.d(t,"c",function(){return W}),n.d(t,"j",function(){return U}),n.d(t,"a",function(){return x});var r=n(1),a=n(35),i=n(544),c=n(532),o=n(552),s=n(543),u=n(541),l=n(565),d=n(575),E=n(563),f=n(566),m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",n,"shippingLabel",t],null)},p=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=m(e,t,n);return r&&r.loaded},O=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=m(e,t,n);return r&&r.isFetching},_=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=m(e,t,n);return r&&r.error},g=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=m(e,t,n);return r&&r.loaded?r.labels:[]},b=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=m(e,t,n);return r&&r.fulfillOrder},h=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=m(e,t,n);return r&&r.emailDetails},v=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=m(e,t,n);return r&&r.refreshedLabelStatus},C=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=m(e,t,n);return r&&r.form},S=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),i=C(e,t,n);if(!i)return null;var o=i.rates,s=o.values,u=o.available,l=[],d=0,E=0,f=function(e){if(!(e in u))return"continue";var t=s[e],n=t.serviceId,i=t.signatureRequired,c=u[e].default.rates,o=null,f=null;i in u[e]&&(o=u[e][i].rates,f=Object(r.find)(o,function(e){return n===e.service_id})||null);var m=Object(r.find)(c,function(e){return n===e.service_id});if(m){var p=m.retail_rate-m.rate,O=m.rate,_={title:m.title,retailRate:m.retail_rate,rateWithDiscount:O,addons:[],carrierId:m.carrier_id,carrierTitle:m.title.split("-")[0].trim()};null!==f&&(_.addons=[{title:Object(a.translate)("Signature Required"),rate:f.rate-m.rate}],O=f.rate),l.push(_),d+=Object(r.round)(p,2),E+=O}};for(var m in s)f(m);return l.length?{prices:l,discount:d,total:E}:null},I=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=C(e,t,n);if(Object(r.isEmpty)(a))return!1;var i=Object(l.a)(a.origin),o=Object(l.a)(a.destination);return!("US"!==i.country||!Object(r.includes)(d.d,i.state))||(!("US"!==o.country||!Object(r.includes)(d.d,o.state))||i.country!==o.country&&(!Object(r.includes)(d.b,i.country)||!Object(r.includes)(d.b,o.country)))},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);return[C(e,t,n)]}),j=function(e,t,n,i){var c=t.values,o=Object(l.a)(t),s=o.phone,u=o.postcode,f=o.state,m=o.country,p={};return["name","address","city","postcode","country"].forEach(function(e){c[e]||(p[e]=Object(a.translate)("This field is required"))}),Object(r.includes)(d.a,m)&&!/^\d{5}(?:-\d{4})?$/.test(u)&&(p.postcode=Object(a.translate)("Invalid ZIP/Postal code format")),!f&&Object(E.j)(e,m,n)&&(p.state=Object(a.translate)("This field is required")),i&&(s?10!==s.split(/\D+/g).join("").replace(/^1/,"").length&&(p.phone=Object(a.translate)("Customs forms require a 10-digit phone number. Please edit your phone number so it has at most 10 digits.")):p.phone=Object(a.translate)("Please enter a phone number for your origin address. It's required because this shipment requires a customs form.")),p},R=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=e.isNormalized,c=e.isUnverifiable,o=e.normalized,s=e.ignoreValidation,u=e.fieldErrors;if((i||c)&&!o&&u)return u;if(i&&!o)return{address:Object(a.translate)("This address is not recognized. Please try another.")};var l=j(t,e,n,r);return s&&Object.keys(l).forEach(function(e){s[e]&&delete l[e]}),l},N=function(e,t,n,i){var c=Object(r.uniq)(Object(r.flatten)(Object(r.map)(e,function(e){return Object(r.map)(e.items,"product_id")}))),o=Object(r.zipObject)(c,Object(r.fill)(Array(c.length),0));Object(r.forEach)(e,function(e){Object(r.forEach)(e.items,function(e){var n=e.quantity,r=e.product_id;return o[r]+=n*t.items[r].value})});var s={};return Object(r.forEach)(Object(r.pick)(t.items,c),function(e,t){e.tariffNumber&&6===e.tariffNumber.length&&(s[e.tariffNumber]||(s[e.tariffNumber]=0),s[e.tariffNumber]+=o[t])}),{packages:Object(r.mapValues)(e,function(e){var c={};"other"!==e.contentsType||e.contentsExplanation||(c.contentsExplanation=Object(a.translate)("Please describe what kind of goods this package contains")),"other"!==e.restrictionType||e.restrictionComments||(c.restrictionComments=Object(a.translate)("Please describe what kind of restrictions this package must have"));var o=new Set;return Object(r.forEach)(e.items,function(e){var n=e.product_id,r=t.items[n].tariffNumber;2500<s[r]&&o.add(r)}),e.itn?/^(?:(?:AES X\d{14})|(?:NOEEI 30\.\d{1,2}(?:\([a-z]\)(?:\(\d\))?)?))$/.test(e.itn)||(c.itn=Object(a.translate)("Invalid format")):"CA"!==n&&(Object(r.isEmpty)(o)?Object(r.includes)(d.c,n)&&(c.itn=Object(a.translate)("International Transaction Number is required for shipments to %(country)s",{args:{country:i}})):c.itn=Object(a.translate)("International Transaction Number is required for shipping items valued over $2,500 per tariff number. Products with tariff number %(code)s add up to more than $2,500.",{args:{code:o.values().next().value}})),c}),items:Object(r.mapValues)(Object(r.pick)(t.items,c),function(e,n){var i={};return e.description||(i.description=Object(a.translate)("This field is required")),t.ignoreWeightValidation[n]||(Object(r.isNil)(e.weight)||""===e.weight?i.weight=Object(a.translate)("This field is required"):parseFloat(e.weight)>0||(i.weight=Object(a.translate)("Weight must be greater than zero"))),t.ignoreValueValidation[n]||(Object(r.isNil)(e.value)||""===e.value?i.value=Object(a.translate)("This field is required"):parseFloat(e.value)>0||(i.value=Object(a.translate)("Declared value must be greater than zero"))),e.tariffNumber&&6!==e.tariffNumber.length&&(i.tariffNumber=Object(a.translate)("The tariff number must be 6 digits long")),i})}},y=function(e){var t=e.values,n=e.available,a=Object(r.map)(n,function(e,n){return t[n]});return!Object(r.isEmpty)(a)&&Object(r.every)(a)},P=function(e){var t=e.values,n=e.available;return Object(r.mapValues)(n,function(e,n){if(!Object(r.isEmpty)(e.default.errors)){var i=e.default.errors.map(function(e){return e.userMessage||e.message}).filter(Boolean);return i.length?i:["We couldn't get a rate for this package, please try again."]}return t[n]&&t[n].serviceId?[]:Object(r.isEmpty)(e.default.rates)?[Object(a.translate)("No rates available, please double check dimensions and weight or try using different packaging.")]:[Object(a.translate)("Please choose a rate")]})},M=function(e){var t={};return e||(t.paperSize=Object(a.translate)("This field is required")),t},T=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);if(!p(e,t,n))return{};var i=m(e,t,n),o=i.form,s=i.paperSize;if(Object(r.isEmpty)(o))return{};var u,l=o.destination.values.country,d=Object(E.g)(e,l,n),f=I(e,t,n);return{origin:R(o.origin,e,n,f),destination:R(o.destination,e,n),packages:(u=o.packages.selected,Object(r.mapValues)(u,function(e){var t={};"not_selected"===e.box_id&&(t.box_id=Object(a.translate)("Please select a package"));var n=function(e){return!Object(r.isFinite)(e)||0>=e};return n(e.weight)&&(t.weight=Object(a.translate)("Invalid weight")),Object(r.some)([e.length,e.width,e.height],n)&&(t.dimensions=Object(a.translate)("Package dimensions must be greater than zero")),t})),customs:N(o.packages.selected,o.customs,l,d),rates:P(o.rates),sidebar:M(s)}},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);return[m(e,t,n)]}),A=Object(i.a)(function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(c.a)(e),a=m(e,t,r).form,i="origin"===n&&I(e,t,r),o=j(e,a[n],r,i);return 0===Object.keys(o).length},function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(c.a)(e);return[m(e,t,r).form[n]]}),k=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=C(e,t,n);if(!a)return!1;var i=Object(r.uniq)(Object(r.flatten)(Object(r.map)(a.packages.selected,function(e){return Object(r.map)(e.items,"product_id")})));return!Object(r.some)(i.map(function(e){return Object(r.isNil)(a.customs.items[e].tariffNumber)||a.customs.ignoreWeightValidation[e]||a.customs.ignoreValueValidation[e]}))},L=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=C(e,t,n);if(!a)return null;var i=T(e,t,n);return a.origin.isNormalized&&Object(r.isEqual)(a.origin.values,a.origin.normalized)&&!Object(o.a)(i.origin)?a.destination.isNormalized&&Object(r.isEqual)(a.destination.values,a.destination.normalized)&&!Object(o.a)(i.destination)?Object(o.a)(i.packages)?"packages":!I(e,t,n)||!Object(o.a)(i.customs)&&k(e,t,n)?Object(o.a)(i.rates)?"rates":null:"customs":"destination":"origin"},D=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=C(e,t,n);return!Object(r.isEmpty)(a)&&!L(e,t,n)&&!a.origin.normalizationInProgress&&!a.destination.normalizationInProgress&&!a.rates.retrievalInProgress&&!Object(r.isEmpty)(a.rates.available)},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);return[C(e,t,n),L(e,t,n)]}),w=Object(i.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(c.a)(e),n=Object(E.d)(e,t);return Object(f.b)(e,t)?Object(r.pick)(n,d.a):Object(r.pick)(n,d.b)},[E.d,f.b]),W=Object(i.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(c.a)(e),n=Object(E.d)(e,t);return Object(f.b)(e,t)?n:Object(r.pick)(n,d.b)},[E.d,f.b]),U=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);if(!Object(E.j)(e,t,n))return null;var a=Object(E.i)(e,t,n),i={};return a.forEach(function(e){var t=e.code,n=e.name;return i[t]=n}),"US"!==t||Object(f.b)(e,n)?i:Object(r.omit)(i,d.d)},[E.i,f.b]),x=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);return p(e,t,n)&&Object(s.d)(e,n)&&Object(u.i)(e,n)&&Object(E.b)(e,n)}},538:function(e,t,n){"use strict";n.d(t,"i",function(){return r}),n.d(t,"k",function(){return a}),n.d(t,"l",function(){return i}),n.d(t,"m",function(){return c}),n.d(t,"j",function(){return o}),n.d(t,"h",function(){return s}),n.d(t,"n",function(){return u}),n.d(t,"o",function(){return l}),n.d(t,"p",function(){return d}),n.d(t,"q",function(){return E}),n.d(t,"r",function(){return f}),n.d(t,"s",function(){return m}),n.d(t,"t",function(){return p}),n.d(t,"u",function(){return O}),n.d(t,"v",function(){return _}),n.d(t,"x",function(){return g}),n.d(t,"w",function(){return b}),n.d(t,"y",function(){return h}),n.d(t,"z",function(){return v}),n.d(t,"A",function(){return C}),n.d(t,"B",function(){return S}),n.d(t,"C",function(){return I}),n.d(t,"D",function(){return j}),n.d(t,"I",function(){return R}),n.d(t,"E",function(){return N}),n.d(t,"J",function(){return y}),n.d(t,"G",function(){return P}),n.d(t,"H",function(){return M}),n.d(t,"K",function(){return T}),n.d(t,"L",function(){return A}),n.d(t,"M",function(){return k}),n.d(t,"N",function(){return L}),n.d(t,"O",function(){return D}),n.d(t,"P",function(){return w}),n.d(t,"Q",function(){return W}),n.d(t,"R",function(){return U}),n.d(t,"S",function(){return x}),n.d(t,"T",function(){return G}),n.d(t,"U",function(){return V}),n.d(t,"F",function(){return H}),n.d(t,"V",function(){return F}),n.d(t,"W",function(){return B}),n.d(t,"X",function(){return q}),n.d(t,"Y",function(){return z}),n.d(t,"Z",function(){return Z}),n.d(t,"ab",function(){return K}),n.d(t,"bb",function(){return Q}),n.d(t,"Vb",function(){return Y}),n.d(t,"cb",function(){return $}),n.d(t,"db",function(){return X}),n.d(t,"eb",function(){return J}),n.d(t,"fb",function(){return ee}),n.d(t,"gb",function(){return te}),n.d(t,"hb",function(){return ne}),n.d(t,"ib",function(){return re}),n.d(t,"jb",function(){return ae}),n.d(t,"kb",function(){return ie}),n.d(t,"lb",function(){return ce}),n.d(t,"mb",function(){return oe}),n.d(t,"nb",function(){return se}),n.d(t,"ob",function(){return ue}),n.d(t,"pb",function(){return le}),n.d(t,"qb",function(){return de}),n.d(t,"rb",function(){return Ee}),n.d(t,"sb",function(){return fe}),n.d(t,"ub",function(){return me}),n.d(t,"tb",function(){return pe}),n.d(t,"vb",function(){return Oe}),n.d(t,"wb",function(){return _e}),n.d(t,"xb",function(){return ge}),n.d(t,"yb",function(){return be}),n.d(t,"zb",function(){return he}),n.d(t,"Ab",function(){return ve}),n.d(t,"Bb",function(){return Ce}),n.d(t,"Cb",function(){return Se}),n.d(t,"Db",function(){return Ie}),n.d(t,"Eb",function(){return je}),n.d(t,"Gb",function(){return Re}),n.d(t,"Hb",function(){return Ne}),n.d(t,"Ib",function(){return ye}),n.d(t,"Jb",function(){return Pe}),n.d(t,"Kb",function(){return Me}),n.d(t,"Lb",function(){return Te}),n.d(t,"Mb",function(){return Ae}),n.d(t,"Nb",function(){return ke}),n.d(t,"Ob",function(){return Le}),n.d(t,"Pb",function(){return De}),n.d(t,"Qb",function(){return we}),n.d(t,"Fb",function(){return We}),n.d(t,"Sb",function(){return Ue}),n.d(t,"Rb",function(){return xe}),n.d(t,"Tb",function(){return Ge}),n.d(t,"Ub",function(){return Ve}),n.d(t,"Wb",function(){return He}),n.d(t,"Xb",function(){return Fe}),n.d(t,"Yb",function(){return Be}),n.d(t,"a",function(){return qe}),n.d(t,"g",function(){return ze}),n.d(t,"e",function(){return Ze}),n.d(t,"f",function(){return Ke}),n.d(t,"c",function(){return Qe}),n.d(t,"d",function(){return Ye}),n.d(t,"b",function(){return $e});var r="WOOCOMMERCE_SERVICES_LABELS_INIT_FORM",a="WOOCOMMERCE_SERVICES_LABELS_RESTORE_PRISTINE",i="WOOCOMMERCE_SERVICES_LABELS_SET_FORM_DATA_VALUE",c="WOOCOMMERCE_SERVICES_LABELS_SET_FORM_META_PROPERTY",o="WOOCOMMERCE_SERVICES_LABELS_OPEN_ADD_CARD_DIALOG",s="WOOCOMMERCE_SERVICES_LABELS_CLOSE_ADD_CARD_DIALOG",u="WOOCOMMERCE_SERVICES_PACKAGES_ADD_PACKAGE",l="WOOCOMMERCE_SERVICES_PACKAGES_DISMISS_MODAL",d="WOOCOMMERCE_SERVICES_PACKAGES_EDIT_PACKAGE",E="WOOCOMMERCE_SERVICES_PACKAGES_INIT_PACKAGES_FORM",f="WOOCOMMERCE_SERVICES_PACKAGES_REMOVE_PACKAGE",m="WOOCOMMERCE_SERVICES_PACKAGES_REMOVE_PREDEFINED",p="WOOCOMMERCE_SERVICES_PACKAGES_SAVE_PACKAGE",O="WOOCOMMERCE_SERVICES_PACKAGES_SAVE_PREDEFINED",_="WOOCOMMERCE_SERVICES_PACKAGES_SET_ADD_MODE",g="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_FETCH_ERROR",b="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_FETCHING",h="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_SAVING",v="WOOCOMMERCE_SERVICES_PACKAGES_SET_MODAL_ERROR",C="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_ALL_PREDEFINED",S="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_OUTER_DIMENSIONS",I="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_PREDEFINED",j="WOOCOMMERCE_SERVICES_PACKAGES_UPDATE_PACKAGES_FIELD",R="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADD_ITEMS",N="WOOCOMMERCE_SERVICES_SERVICE_SETTINGS_UPDATE_FIELD",y="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADD_PACKAGE",P="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADDRESS_NORMALIZATION_COMPLETED",M="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADDRESS_NORMALIZATION_IN_PROGRESS",T="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLEAR_AVAILABLE_RATES",A="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_ADD_ITEM",k="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_DETAILS_DIALOG",L="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_ITEM_MOVE",D="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_REFUND_DIALOG",w="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_REPRINT_DIALOG",W="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CONFIRM_ADDRESS_SUGGESTION",U="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CONFIRM_REPRINT",x="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EDIT_ADDRESS",G="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EDIT_UNVERIFIABLE_ADDRESS",V="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EXIT_PRINTING_FLOW",H="WOOCOMMERCE_SERVICES_SHIPPING_EXIT_TRACKING_FLOW",F="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_INIT",B="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_MOVE_ITEM",q="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_ADD_ITEM",z="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_DETAILS_DIALOG",Z="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_ITEM_MOVE",K="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_PACKAGE",Q="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_PRINTING_FLOW",Y="WOOCOMMERCE_SERVICES_SHIPPING_OPEN_TRACKING_FLOW",$="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_REFUND_DIALOG",X="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_REPRINT_DIALOG",J="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_PURCHASE_REQUEST",ee="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_PURCHASE_RESPONSE",te="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_RATES_RETRIEVAL_COMPLETED",ne="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_RATES_RETRIEVAL_IN_PROGRESS",re="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REFUND_REQUEST",ae="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REFUND_RESPONSE",ie="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REMOVE_IGNORE_VALIDATION",ce="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REMOVE_PACKAGE",oe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REPRINT_DIALOG_ERROR",se="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REPRINT_DIALOG_READY",ue="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SAVE_CUSTOMS",le="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SAVE_PACKAGES",de="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SELECT_NORMALIZED_ADDRESS",Ee="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ABANDON_ON_NON_DELIVERY",fe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ADDED_ITEM",me="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CONTENTS_TYPE",pe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CONTENTS_EXPLANATION",Oe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_DESCRIPTION",_e="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_ORIGIN_COUNTRY",ge="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_TARIFF_NUMBER",be="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_VALUE",he="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_WEIGHT",ve="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_EMAIL_DETAILS",Ce="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_FETCH_ERROR",Se="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_FULFILL_ORDER",Ie="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_IS_FETCHING",je="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ITN",Re="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_PACKAGE_TYPE",Ne="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RATES",ye="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RESTRICTION_COMMENTS",Pe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RESTRICTION_TYPE",Me="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_TARGET_PACKAGE",Te="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SHOW_PRINT_CONFIRMATION",Ae="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_STATUS_RESPONSE",ke="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_STATUS_RETRIEVAL_IN_PROGRESS",Le="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_TOGGLE_STEP",De="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_ADDRESS_VALUE",we="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_PACKAGE_WEIGHT",We="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_PACKAGE_SIGNATURE",Ue="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_RATE",xe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_PAPER_SIZE",Ge="WOOCOMMERCE_SERVICES_SHIPPING_METHOD_SCHEMA_REQUEST",Ve="WOOCOMMERCE_SERVICES_SHIPPING_METHOD_SCHEMA_REQUEST_SUCCESS",He="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_SETTINGS_REQUEST",Fe="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_SETTINGS_REQUEST_SUCCESS",Be="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_UPDATE",qe="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_CONNECTION_SUCCESS",ze="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_UPDATE_SETTINGS",Ze="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_TOGGLE_IS_SAVING",Ke="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_TOGGLE_SHOW_UPS_INVOICE_FIELDS",Qe="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_ENABLE_CANCEL_CONNECTION_DIALOG",Ye="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_ENABLE_DISCONNECT_DIALOG",$e="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_DISCONNECT_CARRIER"},539:function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"a",function(){return a});var r="LOADING",a="ERROR"},541:function(e,t,n){"use strict";n.d(t,"e",function(){return m}),n.d(t,"b",function(){return O}),n.d(t,"d",function(){return _}),n.d(t,"a",function(){return g}),n.d(t,"c",function(){return b}),n.d(t,"f",function(){return h}),n.d(t,"i",function(){return v}),n.d(t,"h",function(){return C}),n.d(t,"g",function(){return S});var r=n(110),a=n.n(r),i=n(36),c=n.n(i),o=n(1),s=n(35),u=n(544),l=n(532),d=n(575),E=n(565),f=n(537),m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e);return Object(o.get)(e,["extensions","woocommerce","woocommerceServices",t,"packages"],null)},p=function(e){return e&&e.predefinedSchema?Object.keys(e.predefinedSchema):[]},O=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=m(e,t);if(!n||!n.predefinedSchema||!n.packages)return null;var r=[];Object(o.forEach)(n.predefinedSchema,function(e,t){var a=(n.packages.predefined||{})[t]||[];Object(o.forEach)(e,function(e){var n=e.definitions;Object(o.forEach)(n,function(e){Object(o.includes)(a,e.id)&&r.push(c()({},e,{serviceId:t}))})})});var a=(n.packages.custom||[]).map(function(e,t){return c()({},e,{index:t})});return Object(o.orderBy)(r.concat(a),"name")},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=m(e,t);if(!n||!n.packages)return[];var r=p(n);return[].concat(a()(n.packages.custom||[]),a()(r.map(function(e){return(n.packages.predefined||{})[e]})))}),_=Object(u.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(l.a)(e),r=m(e,n);if(!r||!r.predefinedSchema||!r.packages)return null;var a=Object(f.e)(e,t,n),i=Object(E.a)(a.origin).country,c=Object(E.a)(a.destination).country,u=d.a.includes(i)&&!d.a.includes(c),p={custom:{title:Object(s.translate)("Custom Packages"),definitions:r.packages.custom}};return Object(o.forEach)(r.predefinedSchema,function(e,t){var n=(r.packages.predefined||{})[t]||[];Object(o.forEach)(e,function(e,t){var r=e.definitions,a={title:e.title,definitions:[]};Object(o.forEach)(r,function(e){u&&!1===e.can_ship_international||Object(o.includes)(n,e.id)&&a.definitions.push(e)}),a.definitions.length&&(p[t]=a)})}),p},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(l.a)(e),r=m(e,n);if(!r||!r.packages)return[];var i=p(r),c=Object(f.e)(e,t,n),o=Object(E.a)(c.origin).country,s=Object(E.a)(c.destination).country;return[].concat(a()(r.packages.custom||[]),a()(i.map(function(e){return(r.packages.predefined||{})[e]})),[o,s])}),g=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=m(e,t);if(!n||!n.predefinedSchema||!n.packages)return null;var r={};return Object(o.forEach)(n.packages.custom,function(e){r[e.name]=e}),Object(o.forEach)(n.predefinedSchema,function(e){Object(o.forEach)(e,function(e){var t=e.definitions;Object(o.forEach)(t,function(e){r[e.id]=e})})}),r},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=m(e,t);if(!n||!n.packages)return[];var r=p(n);return[].concat(a()(n.packages.custom||[]),a()(r.map(function(e){return(n.packages.predefined||{})[e]})))}),b=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=m(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return null;var r={},a=n.predefinedSchema,i=n.currentlyEditingPredefinedPackages;return Object(o.forEach)(a,function(e,t){var n=i[t]||[];Object(o.forEach)(e,function(e,a){var i={groupId:a,serviceId:t,title:e.title,packages:[],total:e.definitions.length,selected:0};Object(o.forEach)(e.definitions,function(e){var r=Object(o.includes)(n,e.id);r&&i.selected++,i.packages.push(c()({},e,{selected:r,serviceId:t}))}),r["".concat(t,"-").concat(a)]=i})}),r},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=m(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return[];var r=p(n);return a()(r.map(function(e){return n.currentlyEditingPredefinedPackages[e]}))}),h=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=0,r=0,a=m(e,t);if(!a||!a.currentlyEditingPredefinedPackages)return{added:n,removed:r};var i=a.packages&&a.packages.predefined?a.packages.predefined:{},c=a.currentlyEditingPredefinedPackages;return Object.keys(c).forEach(function(e){var t=i[e],r=c[e];t?r.forEach(function(e){Object(o.includes)(t,e)||n++}):n+=r.length}),Object.keys(i).forEach(function(e){var t=i[e],n=c[e];n?t.forEach(function(e){Object(o.includes)(n,e)||r++}):r+=t.length}),{added:n,removed:r}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=m(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return[];var r=p(n);return[].concat(a()(r.map(function(e){return n.packages&&n.packages.predefined&&n.packages.predefined[e]})),a()(r.map(function(e){return n.currentlyEditingPredefinedPackages[e]})))}),v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=m(e,t);return n&&n.isLoaded},C=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=m(e,t);return n&&n.isFetching},S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=m(e,t);return n&&n.isFetchError}},542:function(e,t,n){"use strict";n.d(t,"a",function(){return j});var r=n(530),a=n.n(r),i=n(533),c=n.n(i),o=n(107),s=n.n(o),u=n(108),l=n.n(u),d=n(528),E=n.n(d),f=n(527),m=n.n(f),p=n(529),O=n.n(p),_=n(34),g=n.n(_),b=n(10),h=n.n(b),v=n(12),C=n.n(v),S=n(526),I=n.n(S),j=function(e){function t(){return s()(this,t),E()(this,m()(t).apply(this,arguments))}return O()(t,e),l()(t,[{key:"render",value:function(){var e=I()("button",this.props.className,{"is-compact":this.props.compact,"is-primary":this.props.primary,"is-scary":this.props.scary,"is-busy":this.props.busy,"is-borderless":this.props.borderless});if(this.props.href){var t=this.props,n=(t.compact,t.primary,t.scary,t.busy,t.borderless,t.type,c()(t,["compact","primary","scary","busy","borderless","type"])),r=n.target?(n.rel||"").replace(/noopener|noreferrer/g,"")+" noopener noreferrer":n.rel;return h.a.createElement("a",a()({},n,{rel:r,className:e}))}var i=this.props,o=(i.compact,i.primary,i.scary,i.busy,i.borderless,i.target,i.rel,c()(i,["compact","primary","scary","busy","borderless","target","rel"]));return h.a.createElement("button",a()({},o,{className:e}))}}]),t}(b.PureComponent);g()(j,"propTypes",{compact:C.a.bool,primary:C.a.bool,scary:C.a.bool,busy:C.a.bool,type:C.a.string,href:C.a.string,borderless:C.a.bool,target:C.a.string,rel:C.a.string}),g()(j,"defaultProps",{type:"button"})},543:function(e,t,n){"use strict";n.d(t,"f",function(){return c}),n.d(t,"g",function(){return o}),n.d(t,"h",function(){return s}),n.d(t,"i",function(){return u}),n.d(t,"d",function(){return l}),n.d(t,"c",function(){return d}),n.d(t,"b",function(){return E}),n.d(t,"a",function(){return f}),n.d(t,"n",function(){return m}),n.d(t,"o",function(){return p}),n.d(t,"e",function(){return O}),n.d(t,"q",function(){return _}),n.d(t,"p",function(){return g}),n.d(t,"k",function(){return b}),n.d(t,"l",function(){return h}),n.d(t,"m",function(){return v}),n.d(t,"j",function(){return C});var r=n(1),a=n(532),i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"labelSettings"],null)},c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=i(e,t);return n&&n.data},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=i(e,t);return n&&n.meta},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=i(e,t);return n&&n.storeOptions},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=o(e,t);return n&&n.user},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=o(e,t);return n&&n.isLoaded},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=o(e,t);return n&&n.isFetching},E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=o(e,t);return n&&n.isFetchError},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=c(e,t);return n&&n.enabled},m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=c(e,t);return n&&n.selected_payment_method_id},p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=o(e,t);return n&&n.pristine},O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=c(e,t);return n&&n.email_receipts},_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=o(e,t);return n&&n.can_manage_payments},g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=o(e,t);return n&&n.can_edit_settings},b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=c(e,t);return n&&n.paper_size},h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=o(e,t);return n&&n.payment_methods},v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=o(e,t);return n&&n.warnings&&n.warnings.payment_methods},C=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=o(e,t);return{masterUserName:n&&n.master_user_name,masterUserLogin:n&&n.master_user_login,masterUserEmail:n&&n.master_user_email,masterUserWpcomLogin:n&&n.master_user_wpcom_login}}},544:function(e,t,n){"use strict";n.d(t,"a",function(){return u});var r=n(1),a=n(606),i=n.n(a),c=(n(112),function(e){return e}),o=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.join()},s=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return e.map(function(e){return e.apply(void 0,[t].concat(r))})}};function u(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,u=Object(r.memoize)(e,a);return Array.isArray(n)&&(n=s(n)),Object.assign(function(e){for(var r=arguments.length,a=new Array(r>1?r-1:0),c=1;c<r;c++)a[c-1]=arguments[c];var o=n.apply(void 0,[e].concat(a));return Array.isArray(o)||(o=[o]),t&&!i()(o,t)&&u.cache.clear(),t=o,u.apply(void 0,[e].concat(a))},{memoizedSelector:u})}},546:function(e,t,n){"use strict";var r=n(530),a=n.n(r),i=n(533),c=n.n(i),o=n(36),s=n.n(o),u=n(10),l=n.n(u),d=n(12),E=n.n(d),f=n(526),m=n.n(f),p=n(35),O=n(1),_=function(e){var t=e.children,n=e.required,r=e.optional,i=e.translate,o=e.className,u=c()(e,["children","required","optional","translate","className"]);return t=l.a.Children.toArray(t)||[],n&&t.push(function(e){return l.a.createElement("small",{className:"form-label__required"},e("Required"))}(i)),r&&t.push(function(e){return l.a.createElement("small",{className:"form-label__optional"},e("Optional"))}(i)),l.a.createElement("label",a()({},Object(O.omit)(u,"moment","numberFormat"),{className:m()(o,"form-label")}),t.length?t.map(function(e,t){return Object(O.isObject)(e)?s()({},e,{key:t}):e}):null)};_.propTypes={required:E.a.bool},t.a=Object(p.localize)(_)},547:function(e,t,n){"use strict";n.d(t,"d",function(){return r}),n.d(t,"c",function(){return b}),n.d(t,"b",function(){return h}),n.d(t,"a",function(){return v});var r={};n.r(r),n.d(r,"accountSettings",function(){return i}),n.d(r,"packages",function(){return c}),n.d(r,"orderLabels",function(){return o}),n.d(r,"getLabelRates",function(){return s}),n.d(r,"labelStatus",function(){return u}),n.d(r,"labelRefund",function(){return l}),n.d(r,"labelsPrint",function(){return d}),n.d(r,"labelTestPrint",function(){return E}),n.d(r,"addressNormalization",function(){return f}),n.d(r,"serviceSettings",function(){return m}),n.d(r,"shippingCarrier",function(){return p}),n.d(r,"shippingCarriers",function(){return O}),n.d(r,"shippingCarrierDelete",function(){return _});var a=n(561),i="connect/account/settings",c="connect/packages",o=function(e){return"connect/label/".concat(e)},s=function(e){return"connect/label/".concat(e,"/rates")},u=function(e,t){return"connect/label/".concat(e,"/").concat(t)},l=function(e,t){return"connect/label/".concat(e,"/").concat(t,"/refund")},d=function(){return"connect/label/print"},E=function(){return"connect/label/preview"},f=function(){return"connect/normalize-address"},m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"connect/services/".concat(e,"/").concat(t)},p=function(){return"connect/shipping/carrier"},O=function(){return"connect/shipping/carriers"},_=function(e){return"connect/shipping/carrier/".concat(e)},g=function(e){if(e&&e.message)throw e.message;if(e&&e.data&&e.data.message)throw e.data.message;throw e},b=function(e,t,n){return Object(a.a)(e).post(t,n,"wc/v1").catch(g)},h=function(e,t){return Object(a.a)(e).get(t,"wc/v1").catch(g)},v=function(e,t){return Object(a.a)(e).del(t,"wc/v1").catch(g)}},549:function(e,t,n){"use strict";n.d(t,"c",function(){return s}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return d}),n.d(t,"b",function(){return E});var r=n(533),a=n.n(r),i=n(1),c={debounce:i.debounce,isPlainObject:i.isPlainObject,uniqueId:i.uniqueId},o=(n(46),c.uniqueId);function s(e){return{noticeId:e,type:"NOTICE_REMOVE"}}function u(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.id,i=a()(n,["id"]);return{type:"NOTICE_CREATE",notice:Object.assign({showDismiss:!0},i,{noticeId:r||o(),status:e,text:t})}}var l=u.bind(null,"is-success"),d=u.bind(null,"is-error"),E=u.bind(null,"is-info");u.bind(null,"is-warning"),u.bind(null,"is-plain")},552:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),a=function e(t){return!!t&&(Object(r.isArray)(t)?Object(r.some)(t,e):!Object(r.isPlainObject)(t)||Object(r.some)(Object(r.values)(t),e))}},555:function(e,t,n){"use strict";n.r(t),n.d(t,"addPackage",function(){return c}),n.d(t,"removePackage",function(){return o}),n.d(t,"editPackage",function(){return s}),n.d(t,"dismissModal",function(){return u}),n.d(t,"savePackage",function(){return l}),n.d(t,"updatePackagesField",function(){return d}),n.d(t,"toggleOuterDimensions",function(){return E}),n.d(t,"toggleAll",function(){return f}),n.d(t,"togglePackage",function(){return m}),n.d(t,"savePredefinedPackages",function(){return p}),n.d(t,"removePredefinedPackage",function(){return O}),n.d(t,"setModalErrors",function(){return _}),n.d(t,"setIsSaving",function(){return g}),n.d(t,"setIsFetching",function(){return b}),n.d(t,"setIsFetchError",function(){return h}),n.d(t,"setAddMode",function(){return v}),n.d(t,"fetchSettings",function(){return C}),n.d(t,"submit",function(){return S});var r=n(547),a=n(538),i=n(541),c=function(e){return{type:a.n,siteId:e}},o=function(e,t){return{type:a.r,index:t,siteId:e}},s=function(e,t){return{type:a.p,package:t,siteId:e}},u=function(e){return{type:a.o,siteId:e}},l=function(e,t){return{type:a.t,packageData:t,siteId:e}},d=function(e,t){return{type:a.D,values:t,siteId:e}},E=function(e){return{type:a.B,siteId:e}},f=function(e,t,n,r){return{type:a.A,serviceId:t,groupId:n,checked:r,siteId:e}},m=function(e,t,n){return{type:a.C,serviceId:t,packageId:n,siteId:e}},p=function(e){return{type:a.u,siteId:e}},O=function(e,t,n){return{type:a.s,serviceId:t,packageId:n,siteId:e}},_=function(e,t){return{type:a.z,value:t,siteId:e}},g=function(e,t){return{type:a.y,isSaving:t,siteId:e}},b=function(e,t){return{type:a.w,isFetching:t,siteId:e}},h=function(e,t){return{type:a.x,isFetchError:t,siteId:e}},v=function(e,t){return{type:a.v,siteId:e,mode:t}},C=function(e){return function(t,n){var c=Object(i.e)(n(),e);c&&(c.packages||c.isFetching)||(t(b(e,!0)),r.b(e,r.d.packages).then(function(n){var r=n.formData,i=n.formSchema,c=n.storeOptions;t({type:a.q,packages:r,dimensionUnit:c.dimension_unit,weightUnit:c.weight_unit,packageSchema:i.custom.items,predefinedSchema:i.predefined,siteId:e})}).catch(function(n){console.error(n),t(h(e,!0))}).then(function(){return t(b(e,!1))}))}},S=function(e,t,n){return function(a,c){var o=Object(i.e)(c(),e);a(g(e,!0)),r.c(e,r.d.packages,o.packages).then(t).catch(n).then(function(){return a(g(e,!1))})}}},556:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(535);function a(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Date.now();return{type:r.j,siteId:e,originalAction:t,data:n,time:a}}},557:function(e,t,n){"use strict";n.d(t,"a",function(){return R});var r=n(530),a=n.n(r),i=n(107),c=n.n(i),o=n(108),s=n.n(o),u=n(528),l=n.n(u),d=n(527),E=n.n(d),f=n(531),m=n.n(f),p=n(529),O=n.n(p),_=n(34),g=n.n(_),b=n(10),h=n.n(b),v=n(12),C=n.n(v),S=n(526),I=n.n(S),j=n(1),R=function(e){function t(){var e;return c()(this,t),(e=l()(this,E()(t).apply(this,arguments))).selectOnFocus=e.selectOnFocus.bind(m()(e)),e}return O()(t,e),s()(t,[{key:"focus",value:function(){this.refs.textField.focus()}},{key:"selectOnFocus",value:function(e){this.props.selectOnFocus&&e.target.select()}},{key:"render",value:function(){var e=this.props.inputRef,t=Object(j.omit)(this.props,"isError","isValid","selectOnFocus","inputRef"),n=I()("form-text-input",this.props.className,{"is-error":this.props.isError,"is-valid":this.props.isValid});return h.a.createElement("input",a()({type:"text"},t,{ref:e||"textField",className:n,onClick:this.selectOnFocus}))}}]),t}(b.PureComponent);g()(R,"propTypes",{isError:C.a.bool,isValid:C.a.bool,selectOnFocus:C.a.bool,className:C.a.string})},561:function(e,t,n){"use strict";var r=n(75);t.a=r.a},562:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a}),n.d(t,"c",function(){return i});var r=function(){return{}},a=function(){return""},i=function(){return!0}},563:function(e,t,n){"use strict";n.d(t,"b",function(){return s}),n.d(t,"c",function(){return u}),n.d(t,"a",function(){return l}),n.d(t,"e",function(){return E}),n.d(t,"f",function(){return m}),n.d(t,"g",function(){return p}),n.d(t,"i",function(){return O}),n.d(t,"h",function(){return _}),n.d(t,"j",function(){return g}),n.d(t,"d",function(){return b});var r=n(1),a=n(544),i=n(532),c=n(539),o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"data","locations"])},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.isArray)(o(e,t))},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return c.b===o(e,t)},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return c.a===o(e,t)},d=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];var i=r[e],c=s(t,i);return[c,c&&o(t,i)]}},E=Object(a.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);if(!s(e,t))return[];var n=o(e,t).map(function(e){return Object(r.omit)(e,"countries")});return Object(r.sortBy)(n,"name")},d(0)),f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);if(!s(e,t))return[];var n=Object(r.flatMap)(o(e,t),"countries");return Object(r.sortBy)(n,"name")},m=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);if(!s(e,n))return[];var a=Object(r.find)(o(e,n),{code:t});if(!a)return[];var c=a.countries.map(function(e){return Object(r.omit)(e,"states")});return Object(r.sortBy)(c,"name")},d(1)),p=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);if(!s(e,n))return t;var a=Object(r.find)(Object(r.flatMap)(o(e,n),"countries"),{code:t});return a?a.name:t},d(1)),O=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);if(!s(e,n))return[];var a=Object(r.find)(Object(r.flatMap)(o(e,n),"countries"),{code:t});return a?Object(r.sortBy)(a.states,"name"):[]},d(1)),_=Object(a.a)(function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(i.a)(e);if(!s(e,a))return n;var c=Object(r.find)(Object(r.flatMap)(o(e,a),"countries"),{code:t});if(!c)return n;var u=Object(r.find)(c.states,{code:n});return u?u.name:n},d(2)),g=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!Object(r.isEmpty)(O(e,t,n))},b=Object(a.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=f(e,t),r={};return n.forEach(function(e){var t=e.code,n=e.name;return r[t]=n}),r},d(0))},565:function(e,t,n){"use strict";var r=n(1);t.a=function(e){return Object(r.isPlainObject)(e)&&(e.isNormalized&&e.selectNormalized&&e.normalized?e.normalized:e.values)||{}}},566:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a});var r=function(){return!0},a=function(){return!0}},567:function(e,t,n){"use strict";n.d(t,"d",function(){return c}),n.d(t,"a",function(){return s}),n.d(t,"e",function(){return u}),n.d(t,"c",function(){return l}),n.d(t,"b",function(){return d});var r=n(547),a=n(538),i=n(543),c=function(e,t,n){return{type:a.l,siteId:e,key:t,value:n}},o=function(e,t,n){return{type:a.m,siteId:e,key:t,value:n}},s=function(e){return function(t){t(o(e,"isFetching",!0)),r.b(e,r.d.accountSettings).then(function(n){var r=n.storeOptions,i=n.formMeta,c=n.formData,o=n.userMeta;t(function(e,t,n,r,i){return{type:a.i,siteId:e,storeOptions:t,formData:n,formMeta:r,userMeta:i}}(e,r,c,i,o))}).catch(function(n){t(o(e,"isFetchError",!0)),console.error(n)}).then(function(){return t(o(e,"isFetching",!1))})}},u=function(e,t,n){return function(a,c){a(o(e,"isSaving",!0)),a(o(e,"pristine",!0)),r.c(e,r.d.accountSettings,Object(i.f)(c())).then(t).catch(function(t){return a(o(e,"pristine",!1)),n(t)}).then(function(){a(o(e,"isSaving",!1))})}},l=function(e){return{type:a.k,siteId:e}},d=function(e){return{type:a.j,siteId:e}}},568:function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s}),n.d(t,"c",function(){return u});var r=n(1),a=n(532),i=n(539),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"shippingMethodSchemas"],{})},o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return Object(r.isObject)(c(e,n)[t])},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return o(e,t,n)?c(e,n)[t]:null},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return i.b===c(e,n)[t]}},575:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a}),n.d(t,"d",function(){return i}),n.d(t,"c",function(){return c});var r=["US","PR","VI","GU","AS","UM","MH","FM","MP"],a=["US","PR","VI"],i=["AA","AE","AP"],c=["IR","SY","KP","CU","SD"]},576:function(e,t,n){"use strict";n.d(t,"c",function(){return u}),n.d(t,"a",function(){return l}),n.d(t,"b",function(){return d});var r=n(1),a=n(532),i=n(584),c=n(539),o=n(566),s=n(585),u=function(e,t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZoneMethods"])}(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e));return Object(r.isObject)(n)?n[t]:null},l=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),c=Object(i.b)(e,n);if(!Object(r.isArray)(c))return!1;var l=Object(r.find)(c,{id:t});if(!l||!Object(r.isArray)(l.methodIds))return!1;if(!Object(o.a)(e,n))return!0;var d=l.methodIds.map(function(t){var a=u(e,t,n);return a&&Object(r.startsWith)(a.methodType,"wc_services")?a:null}).filter(Boolean);return Object(r.every)(d,function(t){var r=t.id;return Object(s.a)(e,r,n)})},d=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),l=Object(i.b)(e,n);if(!Object(r.isArray)(l))return!1;var d=Object(r.find)(l,{id:t});if(!d)return!1;if(c.b===d.methodIds)return!0;if(!Object(o.a)(e,n)||!Object(r.isArray)(d.methodIds))return!1;var E=d.methodIds.map(function(t){var a=u(e,t,n);return a&&Object(r.startsWith)(a.methodType,"wc_services")?a:null}).filter(Boolean);return Object(r.some)(E,function(t){var r=t.id;return Object(s.b)(e,r,n)})}},580:function(e,t,n){"use strict";var r=n(530),a=n.n(r),i=n(533),c=n.n(i),o=n(107),s=n.n(o),u=n(108),l=n.n(u),d=n(528),E=n.n(d),f=n(527),m=n.n(f),p=n(531),O=n.n(p),_=n(529),g=n.n(_),b=n(34),h=n.n(b),v=n(526),C=n.n(v),S=n(35),I=n(1),j=n(10),R=n.n(j),N=n(542),y=function(e){function t(){var e,n;s()(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=E()(this,(e=m()(t)).call.apply(e,[this].concat(a))),h()(O()(n),"getDefaultButtonAction",function(){return n.props.isSubmitting?n.props.translate("Saving\u2026"):n.props.translate("Save Settings")}),n}return g()(t,e),l()(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.isPrimary,i=c()(e,["children","className","isPrimary"]),o=C()(n,"form-button");return R.a.createElement(N.a,a()({},Object(I.omit)(i,["isSubmitting","moment","numberFormat","translate"]),{primary:r,className:o}),j.Children.count(t)?t:this.getDefaultButtonAction())}}]),t}(R.a.Component);h()(y,"defaultProps",{isSubmitting:!1,isPrimary:!0,type:"submit"}),t.a=Object(S.localize)(y)},584:function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var r=n(1),a=n(532),i=(n(539),n(576)),c=n(610),o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZones"])},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=o(e,t);return Object(r.isArray)(n)&&Object(r.every)(n,function(n){return Object(i.a)(e,n.id,t)})&&Object(r.every)(n,function(n){return Object(c.a)(e,n.id,t)})}},585:function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"b",function(){return s});var r=n(1),a=n(532),i=n(539),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"shippingZoneMethodSettings"],{})},o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return!0===c(e,n)[t]},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return i.b===c(e,n)[t]}},586:function(e,t,n){"use strict";var r=n(10),a=n.n(r),i=n(12),c=n.n(i),o=n(545),s=n(546),u=n(557),l=n(550),d=n(558),E=function(e){var t=e.id,n=e.title,r=e.description,i=e.value,c=e.placeholder,E=e.updateValue,f=e.error,m=e.className;return a.a.createElement(o.a,{className:m},a.a.createElement(s.a,{htmlFor:t},n),a.a.createElement(u.a,{id:t,name:t,placeholder:c,value:i,onChange:function(e){return E(e.target.value)},isError:Boolean(f)}),f&&"string"===typeof f&&a.a.createElement(l.a,{text:f}),!f&&r&&a.a.createElement(d.a,null,r))};E.propTypes={id:c.a.string.isRequired,title:c.a.node,description:c.a.string,value:c.a.string.isRequired,updateValue:c.a.func,error:c.a.oneOfType([c.a.string,c.a.bool]),className:c.a.string},t.a=E},589:function(e,t,n){"use strict";n.d(t,"a",function(){return I});var r=n(533),a=n.n(r),i=n(107),c=n.n(i),o=n(108),s=n.n(o),u=n(528),l=n.n(u),d=n(527),E=n.n(d),f=n(529),m=n.n(f),p=n(34),O=n.n(p),_=n(10),g=n.n(_),b=n(12),h=n.n(b),v=n(526),C=n.n(v),S=n(557),I=function(e){function t(){return c()(this,t),l()(this,E()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){var e=this.props,t=e.noWrap,n=e.prefix,r=e.suffix,i=a()(e,["noWrap","prefix","suffix"]);return g.a.createElement("div",{className:C()("form-text-input-with-affixes",{"no-wrap":t})},n&&g.a.createElement("span",{className:"form-text-input-with-affixes__prefix"},n),g.a.createElement(S.a,i),r&&g.a.createElement("span",{className:"form-text-input-with-affixes__suffix"},r))}}]),t}(g.a.Component);O()(I,"displayName","FormTextInputWithAffixes"),O()(I,"propTypes",{noWrap:h.a.bool,prefix:h.a.node,suffix:h.a.node})},592:function(e,t,n){"use strict";var r,a=n(34),i=n.n(a),c=n(36),o=n.n(c),s=n(1),u=n(46),l=Object(u.b)({},(r={},i()(r,"NOTICE_CREATE",function(e,t){var n=t.notice;return o()({},e,i()({},n.noticeId,n))}),i()(r,"NOTICE_REMOVE",function(e,t){var n=t.noticeId;return e.hasOwnProperty(n)?Object(s.omit)(e,n):e}),i()(r,"ROUTE_SET",function(e){return Object(s.reduce)(e,function(e,t,n){if(!t.isPersistent&&!t.displayOnNextPage)return e;var r=t;return r.displayOnNextPage&&(r=o()({},r,{displayOnNextPage:!1})),e[n]=r,e},{})}),r)),d=Object(u.b)({},i()({},"NOTICE_CREATE",function(e,t){var n=t.notice;return o()({},e,i()({},n.noticeId,Date.now()))}));t.a=Object(u.a)({items:l,lastTimeShown:d})},593:function(e,t,n){"use strict";n.d(t,"d",function(){return a}),n.d(t,"b",function(){return i}),n.d(t,"a",function(){return c}),n.d(t,"e",function(){return o}),n.d(t,"c",function(){return s});var r=n(535);function a(e){return{type:r.d,actionList:e}}function i(){return{type:r.b}}function c(e){return{type:r.a,actionList:e}}function o(e){return{type:r.e,actionList:e}}function s(e,t){return{type:r.c,actionList:e,error:t}}},602:function(e,t,n){"use strict";n.d(t,"a",function(){return c}),n.d(t,"b",function(){return o});n(1);var r=n(659),a=n.n(r),i=document.implementation&&document.implementation.createHTMLDocument?document.implementation.createHTMLDocument("").createElement("textarea"):document.createElement("textarea");function c(e){return"string"!==typeof e||-1===e.indexOf("&")?e:function(e){i.innerHTML=e;var t=i.textContent;return i.innerHTML="",t}(e)}function o(e){return a()(e)}String.fromCharCode(160)},604:function(e,t,n){"use strict";n.d(t,"a",function(){return s}),n.d(t,"b",function(){return l});var r=n(35),a=n(605),i=n(1),c=n(547),o={a4:{name:Object(r.translate)("A4"),exclude:function(e){return Object(i.includes)(["US","CA","MX","DO"],e)}},label:{name:Object(r.translate)('Label (4"x6")')},legal:{name:Object(r.translate)("Legal")},letter:{name:Object(r.translate)("Letter")}},s=function(e){return Object(i.reduce)(o,function(t,n,r){var a=n.name,i=n.exclude;return i&&i(e)||(t[r]=a),t},{})},u=function(e,t,n){if(!o[e])throw new Error("Invalid paper size: ".concat(e));var r={paper_size:e,label_id_csv:Object(i.filter)(Object(i.map)(t,"labelId")).join(","),caption_csv:Object(i.filter)(Object(i.map)(t,function(e){return e.caption?encodeURIComponent(e.caption):null})).join(","),json:!0};return n+"?"+Object(a.stringify)(r)},l=function(e,t){return u(e,t,c.d.labelsPrint())}},609:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(1),a=function(e,t){return Object(r.isArray)(e)?e.concat(t):void 0},i=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length>1?r.mergeWith.apply(void 0,[Object.create(null)].concat(t,[a])):t[0]}},610:function(e,t,n){"use strict";n.d(t,"c",function(){return c}),n.d(t,"a",function(){return o}),n.d(t,"b",function(){return s});var r=n(1),a=n(532),i=n(539),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZoneLocations"])},o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),i=c(e,n);return i&&Object(r.isObject)(i[t])},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return c(e,n)&&i.b===c(e,n)[t]}},611:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var r=n(547),a=n(556),i=n(538),c=n(585),o=function(e,t,n){return function(o,s){if(!Object(c.a)(s(),n,e)&&!Object(c.b)(s(),n,e)){var u={type:i.Wb,instanceId:n,siteId:e};return o(u),r.b(e,r.d.serviceSettings(t,n)).then(function(t){return o(function(e,t,n){return{type:i.Xb,siteId:e,instanceId:t,data:n}}(e,n,t))}).catch(function(t){return o(Object(a.a)(e,u,t))})}}}},612:function(e,t,n){"use strict";t.a=function(e,t){return function e(t,n,r){if(void 0===n||null===n||!t)return n;switch((t=function(e,t){if(e.$ref){var n=e.$ref.match(/^#\/definitions\/(.+)/);n&&t[n[1]]&&(e=t[n[1]])}return e}(t,r)).type){case"number":if(""===n)return;return isNaN(n)?n:parseFloat(n);case"boolean":return-1!==["true","True","TRUE","1",1,!0].indexOf(n)||-1===["false","False","FALSE","0",0,!1].indexOf(n)&&void 0;case"string":return n?n.toString():"";case"object":var a={};return Object.keys(n).forEach(function(i){var c=(t.properties||{})[i];a[i]=e(c,n[i],r)}),a;case"array":return n.map(function(n){return e(t.items,n,r)});default:return n}}({type:"object",properties:e.properties},t,e.definitions)}},613:function(e,t,n){"use strict";var r=n(530),a=n.n(r),i=n(10),c=n.n(i),o=n(12),s=n.n(o),u=n(526),l=n.n(u),d=n(534),E=n.n(d),f=n(1),m=function(e){var t=e.className,n=e.disabled,r=e.checked,i=e.partialChecked,o=Object(f.omit)(e,["className","partialChecked"]);return c.a.createElement("span",{className:l()(t,"form-checkbox",{"is-disabled":n})},c.a.createElement("input",a()({},o,{type:"checkbox"})),r&&c.a.createElement(E.a,{icon:"checkmark",size:14}),!r&&i&&c.a.createElement(E.a,{icon:"minus-small",size:16}))};m.propTypes={checked:s.a.bool.isRequired,partialChecked:s.a.bool,onChange:s.a.func.isRequired,className:s.a.string},t.a=m},615:function(e,t,n){"use strict";var r=n(530),a=n.n(r),i=n(533),c=n.n(i),o=n(10),s=n.n(o),u=n(526),l=n.n(u);t.a=function(e){var t=e.className,n=c()(e,["className"]);return s.a.createElement("input",a()({},n,{type:"checkbox",className:l()(t,"form-checkbox")}))}},619:function(e,t,n){var r={"./af":[392,3],"./af.js":[392,3],"./ar":[399,4],"./ar-dz":[393,5],"./ar-dz.js":[393,5],"./ar-kw":[394,6],"./ar-kw.js":[394,6],"./ar-ly":[395,7],"./ar-ly.js":[395,7],"./ar-ma":[396,8],"./ar-ma.js":[396,8],"./ar-sa":[397,9],"./ar-sa.js":[397,9],"./ar-tn":[398,10],"./ar-tn.js":[398,10],"./ar.js":[399,4],"./az":[400,11],"./az.js":[400,11],"./be":[401,12],"./be.js":[401,12],"./bg":[402,13],"./bg.js":[402,13],"./bm":[403,14],"./bm.js":[403,14],"./bn":[404,15],"./bn.js":[404,15],"./bo":[405,16],"./bo.js":[405,16],"./br":[406,17],"./br.js":[406,17],"./bs":[407,18],"./bs.js":[407,18],"./ca":[408,19],"./ca.js":[408,19],"./cs":[409,20],"./cs.js":[409,20],"./cv":[410,21],"./cv.js":[410,21],"./cy":[411,22],"./cy.js":[411,22],"./da":[412,23],"./da.js":[412,23],"./de":[415,24],"./de-at":[413,25],"./de-at.js":[413,25],"./de-ch":[414,26],"./de-ch.js":[414,26],"./de.js":[415,24],"./dv":[416,27],"./dv.js":[416,27],"./el":[417,28],"./el.js":[417,28],"./en-au":[418,29],"./en-au.js":[418,29],"./en-ca":[419,30],"./en-ca.js":[419,30],"./en-gb":[420,31],"./en-gb.js":[420,31],"./en-ie":[421,32],"./en-ie.js":[421,32],"./en-il":[422,33],"./en-il.js":[422,33],"./en-in":[423,34],"./en-in.js":[423,34],"./en-nz":[424,35],"./en-nz.js":[424,35],"./en-sg":[425,36],"./en-sg.js":[425,36],"./eo":[426,37],"./eo.js":[426,37],"./es":[429,38],"./es-do":[427,39],"./es-do.js":[427,39],"./es-us":[428,40],"./es-us.js":[428,40],"./es.js":[429,38],"./et":[430,41],"./et.js":[430,41],"./eu":[431,42],"./eu.js":[431,42],"./fa":[432,43],"./fa.js":[432,43],"./fi":[433,44],"./fi.js":[433,44],"./fil":[434,45],"./fil.js":[434,45],"./fo":[435,46],"./fo.js":[435,46],"./fr":[438,47],"./fr-ca":[436,48],"./fr-ca.js":[436,48],"./fr-ch":[437,49],"./fr-ch.js":[437,49],"./fr.js":[438,47],"./fy":[439,50],"./fy.js":[439,50],"./ga":[440,51],"./ga.js":[440,51],"./gd":[441,52],"./gd.js":[441,52],"./gl":[442,53],"./gl.js":[442,53],"./gom-deva":[443,54],"./gom-deva.js":[443,54],"./gom-latn":[444,55],"./gom-latn.js":[444,55],"./gu":[445,56],"./gu.js":[445,56],"./he":[446,57],"./he.js":[446,57],"./hi":[447,58],"./hi.js":[447,58],"./hr":[448,59],"./hr.js":[448,59],"./hu":[449,60],"./hu.js":[449,60],"./hy-am":[450,61],"./hy-am.js":[450,61],"./id":[451,62],"./id.js":[451,62],"./is":[452,63],"./is.js":[452,63],"./it":[454,64],"./it-ch":[453,65],"./it-ch.js":[453,65],"./it.js":[454,64],"./ja":[455,66],"./ja.js":[455,66],"./jv":[456,67],"./jv.js":[456,67],"./ka":[457,68],"./ka.js":[457,68],"./kk":[458,69],"./kk.js":[458,69],"./km":[459,70],"./km.js":[459,70],"./kn":[460,71],"./kn.js":[460,71],"./ko":[461,72],"./ko.js":[461,72],"./ku":[462,73],"./ku.js":[462,73],"./ky":[463,74],"./ky.js":[463,74],"./lb":[464,75],"./lb.js":[464,75],"./lo":[465,76],"./lo.js":[465,76],"./lt":[466,77],"./lt.js":[466,77],"./lv":[467,78],"./lv.js":[467,78],"./me":[468,79],"./me.js":[468,79],"./mi":[469,80],"./mi.js":[469,80],"./mk":[470,81],"./mk.js":[470,81],"./ml":[471,82],"./ml.js":[471,82],"./mn":[472,83],"./mn.js":[472,83],"./mr":[473,84],"./mr.js":[473,84],"./ms":[475,85],"./ms-my":[474,86],"./ms-my.js":[474,86],"./ms.js":[475,85],"./mt":[476,87],"./mt.js":[476,87],"./my":[477,88],"./my.js":[477,88],"./nb":[478,89],"./nb.js":[478,89],"./ne":[479,90],"./ne.js":[479,90],"./nl":[481,91],"./nl-be":[480,92],"./nl-be.js":[480,92],"./nl.js":[481,91],"./nn":[482,93],"./nn.js":[482,93],"./oc-lnc":[483,94],"./oc-lnc.js":[483,94],"./pa-in":[484,95],"./pa-in.js":[484,95],"./pl":[485,96],"./pl.js":[485,96],"./pt":[487,97],"./pt-br":[486,98],"./pt-br.js":[486,98],"./pt.js":[487,97],"./ro":[488,99],"./ro.js":[488,99],"./ru":[489,100],"./ru.js":[489,100],"./sd":[490,101],"./sd.js":[490,101],"./se":[491,102],"./se.js":[491,102],"./si":[492,103],"./si.js":[492,103],"./sk":[493,104],"./sk.js":[493,104],"./sl":[494,105],"./sl.js":[494,105],"./sq":[495,106],"./sq.js":[495,106],"./sr":[497,107],"./sr-cyrl":[496,108],"./sr-cyrl.js":[496,108],"./sr.js":[497,107],"./ss":[498,109],"./ss.js":[498,109],"./sv":[499,110],"./sv.js":[499,110],"./sw":[500,111],"./sw.js":[500,111],"./ta":[501,112],"./ta.js":[501,112],"./te":[502,113],"./te.js":[502,113],"./tet":[503,114],"./tet.js":[503,114],"./tg":[504,115],"./tg.js":[504,115],"./th":[505,116],"./th.js":[505,116],"./tk":[506,117],"./tk.js":[506,117],"./tl-ph":[507,118],"./tl-ph.js":[507,118],"./tlh":[508,119],"./tlh.js":[508,119],"./tr":[509,120],"./tr.js":[509,120],"./tzl":[510,121],"./tzl.js":[510,121],"./tzm":[512,122],"./tzm-latn":[511,123],"./tzm-latn.js":[511,123],"./tzm.js":[512,122],"./ug-cn":[513,124],"./ug-cn.js":[513,124],"./uk":[514,125],"./uk.js":[514,125],"./ur":[515,126],"./ur.js":[515,126],"./uz":[517,127],"./uz-latn":[516,128],"./uz-latn.js":[516,128],"./uz.js":[517,127],"./vi":[518,129],"./vi.js":[518,129],"./x-pseudo":[519,130],"./x-pseudo.js":[519,130],"./yo":[520,131],"./yo.js":[520,131],"./zh-cn":[521,132],"./zh-cn.js":[521,132],"./zh-hk":[522,133],"./zh-hk.js":[522,133],"./zh-mo":[523,134],"./zh-mo.js":[523,134],"./zh-tw":[524,135],"./zh-tw.js":[524,135]};function a(e){if(!n.o(r,e))return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=r[e],a=t[0];return n.e(t[1]).then(function(){return n.t(a,7)})}a.keys=function(){return Object.keys(r)},a.id=619,e.exports=a},620:function(e,t,n){"use strict";(function(e){var n={env:e?"production":"development",wpcom_concierge_schedule_id:1,languages:[],google_adwords_conversion_id:"",google_adwords_conversion_id_jetpack:""},r=function(e){if(e in n)return n[e];throw new Error("config key `"+e+"` does not exist")};r.isEnabled=function(){return!0},t.a=r}).call(this,n(111))},633:function(e,t,n){"use strict";var r=n(34),a=n.n(r),i=n(110),c=n.n(i),o=n(1),s=n(35),u=n(535),l=n(593),d=n(543),E=n(541),f=n(567),m=n(555),p=n(532),O=n(538);n(561),n(556),n(576),n(611),n(620);var _=n(547),g=n(36),b=n.n(g);function h(e,t,n,r){Object(o.isFunction)(n)?h(e,t,n(e,t,r),r):Object(o.isObject)(n)&&e(b()({},n,r))}var v,C=n(568),S=n(612),I=function(e,t){var n=Object(E.e)(e,t);return!n||n.pristine?[]:[{description:Object(s.translate)("Saving label settings"),onStep:function(e,n){e(Object(m.submit)(t,function(){return e(Object(l.e)(n))},function(){return e(Object(l.c)(n))}))}}]},j=function(e,t){var n=Object(p.a)(e);return t?c()(I(e,n)):[].concat(c()(function(e,t){var n=Object(d.g)(e,t);return!n||n.pristine||!n.can_edit_settings&&n.can_manage_payments?[]:[{description:Object(s.translate)("Saving label settings"),onStep:function(e,n){e(Object(f.e)(t,function(){return e(Object(l.e)(n))},function(){return e(Object(l.c)(n))}))}}]}(e,n)),c()(I(e,n)))};t.a=(v={},a()(v,u.L,[function(e,t){var n=t.successAction,r=t.failureAction,a=t.onlyPackages,i=function(e){e(n),e(Object(l.b)())},c=j(e.getState(),a);e.dispatch(Object(o.isEmpty)(c)?i:Object(l.d)({nextSteps:c,onSuccess:i,onFailure:function(e){e(r),e(Object(l.b)())}}))}]),a()(v,O.Yb,[function(e,t){var n=e.dispatch,r=e.getState,a=t.siteId,i=t.methodId,c=t.methodType,o=t.method,s=t.successAction,l=t.failureAction,d=Object(C.a)(r(),c,a).formSchema,E=Object(S.a)(d,o);_.c(a,_.d.serviceSettings(c,i),E).then(function(e){n(function(e,t,n){return{type:u.Pb,siteId:e,data:t,originatingAction:n}}(a,e,t)),h(n,r,s,{sentData:E,receivedData:e})}).catch(function(e){return h(n,r,l,{error:e})})}]),v)},634:function(e,t,n){"use strict";n.d(t,"b",function(){return A}),n.d(t,"a",function(){return M});var r=n(114),a=n.n(r),i=n(107),c=n.n(i),o=n(108),s=n.n(o),u=n(528),l=n.n(u),d=n(527),E=n.n(d),f=n(531),m=n.n(f),p=n(529),O=n.n(p),_=n(34),g=n.n(_),b=n(10),h=n.n(b),v=n(109),C=n(163),S=n.n(C),I=n(47),j=n.n(I),R=n(1),N=n(544),y=Object(N.a)(function(e){return Object(R.get)(e,"ui.language.localeSlug",null)},function(e){return e.ui.language}),P=j()("calypso:localized-moment"),M=h.a.createContext(S.a),T=function(e){function t(){var e,n;c()(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=l()(this,(e=E()(t)).call.apply(e,[this].concat(a))),g()(m()(n),"state",{moment:S.a,momentLocale:S.a.locale()}),n}return O()(t,e),s()(t,[{key:"checkAndLoad",value:function(){var e=a()(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((r=this.props.currentLocale)!==t){e.next=3;break}return e.abrupt("return");case 3:if("en"!==r){e.next=7;break}this.loadingLocalePromise=Promise.resolve(),e.next=19;break;case 7:return P("Loading moment locale for %s",r),e.prev=8,this.loadingLocalePromise=n(619)("./".concat(r)),e.next=12,this.loadingLocalePromise;case 12:e.next=18;break;case 14:return e.prev=14,e.t0=e.catch(8),P("Failed to load moment locale for %s",r,e.t0),e.abrupt("return");case 18:P("Loaded moment locale for %s",r);case 19:r===this.props.currentLocale&&(S.a.locale()!==r&&S.a.locale(r),this.setState({momentLocale:r}));case 20:case"end":return e.stop()}},e,this,[[8,14]])}));return function(t){return e.apply(this,arguments)}}()},{key:"componentDidMount",value:function(){this.checkAndLoad(S.a.locale())}},{key:"componentDidUpdate",value:function(e){this.checkAndLoad(e.currentLocale)}},{key:"render",value:function(){return h.a.createElement(M.Provider,{value:this.state},this.props.children)}}]),t}(h.a.Component),A=Object(v.b)(function(e){return{currentLocale:y(e)}})(T)},646:function(e,t,n){"use strict";var r=n(10),a=n.n(r),i=n(12),c=n.n(i),o=n(35),s=n(1),u=n(534),l=n.n(u),d=n(526),E=n.n(d),f=function(e){var t=e.isPlaceholder,n=e.data,r=e.dimensionUnit,i=e.prefixActions,c=(e.hasError,e.children),o=e.translate;if(t)return a.a.createElement("div",{className:"packages__packages-row placeholder"},a.a.createElement("div",{className:"packages__packages-row-icon"},a.a.createElement(l.a,{icon:"product",size:18})),a.a.createElement("div",{className:"packages__packages-row-details"},a.a.createElement("div",{className:"packages__packages-row-details-name"},a.a.createElement("span",null))),a.a.createElement("div",{className:"packages__packages-row-dimensions"},a.a.createElement("span",null)),a.a.createElement("div",{className:"packages__packages-row-actions"},c));var u,d=function(){return a.a.createElement("div",{className:"packages__packages-row-actions"},c)};return a.a.createElement("div",{className:E()("packages__packages-row",{prefixed:i})},i?d():null,a.a.createElement("div",{className:"packages__packages-row-icon"},function(e){var t=e?"mail":"product";return a.a.createElement(l.a,{icon:t,size:18})}(n.is_letter)),a.a.createElement("div",{className:"packages__packages-row-details"},a.a.createElement("div",{className:"packages__packages-row-details-name"},(u=n.name)&&""!==Object(s.trim)(u)?u:o("Untitled"))),a.a.createElement("div",{className:"packages__packages-row-dimensions"},n.inner_dimensions," ",r),i?null:d())};f.propTypes={siteId:c.a.number.isRequired,isPlaceholder:c.a.bool,data:c.a.shape({name:c.a.string,is_letter:c.a.bool,inner_dimensions:c.a.string}).isRequired,prefixActions:c.a.bool,dimensionUnit:c.a.string},t.a=Object(o.localize)(f)},647:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(535);function a(e,t,n){return{type:r.L,successAction:e,failureAction:t,onlyPackages:n||!1}}},651:function(e,t,n){"use strict";var r=n(110),a=n.n(r),i=n(36),c=n.n(i),o=n(1),s=n(538),u={modalErrors:{},pristine:!0},l=function(e){return null===e||""===Object(o.trim)(e)},d={};d[s.n]=function(e){var t=e.packages&&e.packages.predefined?e.packages.predefined:{},n=c()({},e,{showModal:!0,mode:"add-custom",currentlyEditingPredefinedPackages:Object(o.cloneDeep)(t)});return"edit"!==e.mode&&n.packageData||(n.packageData={is_user_defined:!0}),n},d[s.p]=function(e,t){return Object.assign({},e,{showModal:!0,modalReadOnly:!1,mode:"edit",packageData:t.package,showOuterDimensions:!1})},d[s.o]=function(e){return Object.assign({},e,{modalErrors:{},showModal:!1,showOuterDimensions:!1})},d[s.z]=function(e,t){return Object.assign({},e,{modalErrors:t.value})},d[s.D]=function(e,t){var n=Object.assign({},e.packageData,t.values),r=Object(o.omitBy)(n,l);return Object.assign({},e,{packageData:r,pristine:!1})},d[s.t]=function(e,t){var n=t.packageData,r=e.packages.custom||[];(n.box_weight&&(n.box_weight=Number.parseFloat(n.box_weight)),n.max_weight&&(n.max_weight=Number.parseFloat(n.max_weight)),"index"in n)?r[n.index]=Object(o.omit)(n,"index"):r.push(n);return e=d[s.o](e),c()({},e,{mode:"add-custom",packageData:{is_user_defined:!0},packages:c()({},e.packages,{custom:r}),pristine:!1})},d[s.B]=function(e){return c()({},e,{showOuterDimensions:!0})},d[s.r]=function(e,t){var n=a()(e.packages.custom);return n.splice(t.index,1),c()({},e,{packages:c()({},e.packages,{custom:n}),pristine:!1,showModal:!1})},d[s.A]=function(e,t){var n=t.serviceId,r=t.groupId,a=t.checked,i=e.predefinedSchema[n][r].definitions.map(function(e){return e.id}),s=e.currentlyEditingPredefinedPackages[n],u=a?Object(o.uniq)(Object(o.concat)(s,i)):Object(o.difference)(s,i),l=c()({},e.currentlyEditingPredefinedPackages);return l[n]=u,c()({},e,{currentlyEditingPredefinedPackages:l,pristine:!1})},d[s.C]=function(e,t){var n=t.serviceId,r=t.packageId,i=c()({},e.currentlyEditingPredefinedPackages),o=a()(i[n]||[]),s=o.indexOf(r);return-1===s?o.push(r):o.splice(s,1),i[n]=o,c()({},e,{currentlyEditingPredefinedPackages:i,pristine:!1})},d[s.s]=function(e,t){var n=t.serviceId,r=t.packageId,i=c()({},e.packages.predefined),o=a()(i[n]||[]),s=o.indexOf(r);return-1!==s&&o.splice(s,1),i[n]=o,c()({},e,{packages:c()({},e.packages,{predefined:i}),pristine:!1})},d[s.u]=function(e){var t=e.currentlyEditingPredefinedPackages;return e=d[s.o](e),c()({},e,{packages:c()({},e.packages,{predefined:t}),pristine:!1})},d[s.v]=function(e,t){var n=t.mode;return c()({},e,{mode:n})},d[s.y]=function(e,t){return Object.assign({},e,{isSaving:t.isSaving,pristine:!t.isSaving})},d[s.w]=function(e,t){var n=t.isFetching;return c()({},e,{isFetching:n})},d[s.x]=function(e,t){var n=t.isFetchError;return c()({},e,{isFetchError:n})},d[s.q]=function(e,t){var n=t.packages,r=t.dimensionUnit,a=t.weightUnit,i=t.packageSchema,o=t.predefinedSchema;return c()({},e,{packages:n,dimensionUnit:r,weightUnit:a,packageSchema:i,predefinedSchema:o,packageData:e.packageData||{is_user_defined:!0},isLoaded:!0})};t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;return"function"===typeof d[t.type]?d[t.type](e,t):e}},652:function(e,t,n){"use strict";var r=n(34),a=n.n(r),i=n(36),c=n.n(i),o=n(538),s={meta:{error:!1,fieldsStatus:!1,isSaving:!1,isFetching:!1,isLoaded:!1,isFetchError:!1,pristine:!0},data:null,pristineData:null},u={};u[o.i]=function(e,t){var n=t.storeOptions,r=t.formData,a=t.formMeta,i=t.userMeta;return c()({},e,{storeOptions:n,meta:c()({},e.meta,a,{pristine:!0,isLoaded:!0,user:i}),data:c()({},e.data,r)})},u[o.l]=function(e,t){var n=t.key,r=t.value,i=e.meta.pristine?e.data:e.pristineData;return c()({},e,{meta:c()({},e.meta,{pristine:!1}),data:c()({},e.data,a()({},n,r)),pristineData:i})},u[o.m]=function(e,t){var n=t.key,r=t.value;return c()({},e,{meta:c()({},e.meta,a()({},n,r))})},u[o.k]=function(e){return e.meta.pristine?e:c()({},e,{meta:c()({},e.meta,{pristine:!0}),data:e.pristineData,pristineData:null})},u[o.j]=function(e){return c()({},e,{addCardDialog:!0})},u[o.h]=function(e){return c()({},e,{addCardDialog:null})};t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;return u[t.type]?u[t.type](e,t):e}},657:function(e,t,n){"use strict";var r,a=n(110),i=n.n(a),c=n(36),o=n.n(c),s=n(118),u=n.n(s),l=n(34),d=n.n(l),E=n(47),f=n.n(E),m=n(593),p=n(535),O=f()("woocommerce:action-list");t.a=(r={},d()(r,p.d,[function(e,t){var n=e.dispatch,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),a=t.actionList,i=a.prevSteps,c=a.currentStep,s=a.nextSteps||[],l=u()(s),d=l[0],E=l.slice(1);if(c)return void O("[handleStepNext] Warning: Attempting before current step finishes. Ignoring.");if(!d)return void O("[handleStepNext] Warning: Attempting with no nextSteps left. Ignoring.");var f=o()({},a,{prevSteps:i,currentStep:o()({},d,{startTime:r}),nextSteps:E});n(Object(m.a)(f)),d.onStep(n,f)}]),d()(r,p.e,[function(e,t){var n=e.dispatch,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),a=t.actionList,c=a.prevSteps,s=a.currentStep,u=a.nextSteps;if(!s)return void O("[handleStepSuccess] Warning: Attempting with no current step. Ignoring.");var l=o()({},a,{prevSteps:[].concat(i()(c||[]),[o()({},s,{endTime:r})]),currentStep:null,nextSteps:u});n(Object(m.a)(l)),u&&u.length>0?n(Object(m.d)(l)):a.onSuccess&&a.onSuccess(n,l)}]),d()(r,p.c,[function(e,t){var n=e.dispatch,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),a=t.actionList,c=t.error,s=a.prevSteps,u=a.currentStep,l=a.nextSteps;if(!u)return void O("[handleStepFailure] Warning: Attempting with no current step. Ignoring.");var d=o()({},a,{prevSteps:[].concat(i()(s||[]),[o()({},u,{endTime:r,error:c})]),currentStep:null,nextSteps:l});n(Object(m.a)(d)),a.onFailure&&a.onFailure(n,d)}]),r)},658:function(e,t,n){"use strict";var r,a=n(34),i=n.n(a),c=n(46),o=n(535),s=n(539),u=n(602);t.a=Object(c.b)(null,(r={},i()(r,o.k,function(){return s.b}),i()(r,o.l,function(e,t){return t.data.map(function(e){return{code:e.code,name:Object(u.a)(e.name),countries:e.countries.map(function(e){return{code:e.code,name:Object(u.a)(e.name),states:e.states.map(function(e){return{code:e.code,name:Object(u.a)(e.name)}})}})}})}),i()(r,o.j,function(e,t){var n=t.originalAction.type;return o.k===n?s.a:e}),r))},673:function(e,t,n){"use strict";n.d(t,"a",function(){return T});n(530);var r=n(107),a=n.n(r),i=n(108),c=n.n(i),o=n(528),s=n.n(o),u=n(527),l=n.n(u),d=(n(531),n(529)),E=n.n(d),f=n(34),m=n.n(f),p=n(12),O=n.n(p),_=n(10),g=n(47),b=n.n(g),h=(n(674),n(35)),v=n.n(h),C=n(1),S=b()("calypso:protect-form"),I=[],j=0;function R(e){if(I.length){S("unsaved form changes detected");var t=v.a.translate("You have unsaved changes.");return(e||window.event).returnValue=t,t}}function N(){0===j&&window.addEventListener("beforeunload",R),j++}function y(){0===--j&&window.removeEventListener("beforeunload",R)}function P(e){Object(C.includes)(I,e)||I.push(e)}function M(e){I=Object(C.without)(I,e)}var T=function(e){function t(){return a()(this,t),s()(this,l()(t).apply(this,arguments))}return E()(t,e),c()(t,[{key:"componentDidMount",value:function(){N(),this.props.isChanged&&P(this)}},{key:"componentWillUnmount",value:function(){y(),M(this)}},{key:"componentWillReceiveProps",value:function(e){e.isChanged!==this.props.isChanged&&(e.isChanged?P(this):M(this))}},{key:"render",value:function(){return null}}]),t}(_.Component);m()(T,"propTypes",{isChanged:O.a.bool.isRequired})},675:function(e,t,n){"use strict";n.d(t,"a",function(){return I});var r=n(107),a=n.n(r),i=n(108),c=n.n(i),o=n(528),s=n.n(o),u=n(527),l=n.n(u),d=n(531),E=n.n(d),f=n(529),m=n.n(f),p=n(34),O=n.n(p),_=n(10),g=n.n(_),b=n(12),h=n.n(b),v=n(526),C=n.n(v),S=n(1),I=function(e){function t(){var e,n;a()(this,t);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return n=s()(this,(e=l()(t)).call.apply(e,[this].concat(i))),O()(E()(n),"onKeyDown",function(e){n.props.disabled||("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.props.onChange(!n.props.checked)),n.props.onKeyDown(e))}),O()(E()(n),"onClick",function(e){e&&e.stopPropagation&&e.stopPropagation(),n.props.disabled||n.props.onChange(!n.props.checked)}),O()(E()(n),"onLabelClick",function(e){if(!n.props.disabled){var t=e.target.nodeName.toLowerCase();"a"!==t&&"input"!==t&&"select"!==t&&(e.preventDefault(),n.props.onChange(!n.props.checked))}}),n}return m()(t,e),c()(t,[{key:"componentWillMount",value:function(){this.id=this.constructor.idNum++}},{key:"render",value:function(){var e=this.props.id||"toggle-"+this.id,t=C()("form-toggle__wrapper",this.props.wrapperClassName,{"is-disabled":this.props.disabled}),n=C()("form-toggle",this.props.className,{"is-toggling":this.props.toggling});return g.a.createElement("span",{className:t},g.a.createElement("input",{id:e,className:n,type:"checkbox",checked:this.props.checked,readOnly:!0,disabled:this.props.disabled}),g.a.createElement("label",{className:"form-toggle__label",htmlFor:e},g.a.createElement("span",{className:"form-toggle__switch",onClick:this.onClick,onKeyDown:this.onKeyDown,role:"checkbox","aria-checked":this.props.checked,"aria-label":this.props["aria-label"],tabIndex:this.props.disabled?-1:0}),this.props.children&&g.a.createElement("span",{className:"form-toggle__label-content",onClick:this.onLabelClick},this.props.children)))}}]),t}(_.PureComponent);O()(I,"propTypes",{onChange:h.a.func,onKeyDown:h.a.func,checked:h.a.bool,disabled:h.a.bool,id:h.a.string,className:h.a.string,wrapperClassName:h.a.string,toggling:h.a.bool,"aria-label":h.a.string}),O()(I,"defaultProps",{checked:!1,disabled:!1,onKeyDown:S.noop,onChange:S.noop}),O()(I,"idNum",0)},676:function(e,t,n){"use strict";var r=n(107),a=n.n(r),i=n(108),c=n.n(i),o=n(528),s=n.n(o),u=n(527),l=n.n(u),d=n(529),E=n.n(d),f=n(10),m=n(12),p=n.n(m),O=n(109),_=n(30),g=n(567),b=n(543),h=function(e){function t(){return a()(this,t),s()(this,l()(t).apply(this,arguments))}return E()(t,e),c()(t,[{key:"fetch",value:function(e){var t=e.siteId,n=e.loaded,r=e.fetching,a=e.error;n||r||a||this.props.fetchSettings(t)}},{key:"UNSAFE_componentWillMount",value:function(){this.fetch(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.fetch(e)}},{key:"render",value:function(){return null}}]),t}(f.Component);h.propTypes={siteId:p.a.number.isRequired},t.a=Object(O.b)(function(e){return{loaded:Object(b.d)(e),fetching:Object(b.c)(e),error:Object(b.b)(e)}},function(e){return Object(_.b)({fetchSettings:g.a},e)})(h)},677:function(e,t,n){"use strict";var r=n(107),a=n.n(r),i=n(108),c=n.n(i),o=n(528),s=n.n(o),u=n(527),l=n.n(u),d=n(529),E=n.n(d),f=n(10),m=n(12),p=n.n(m),O=n(109),_=n(30),g=n(555),b=n(541),h=function(e){function t(){return a()(this,t),s()(this,l()(t).apply(this,arguments))}return E()(t,e),c()(t,[{key:"fetch",value:function(e){var t=e.siteId,n=e.loaded,r=e.fetching,a=e.error;n||r||a||this.props.fetchSettings(t)}},{key:"UNSAFE_componentWillMount",value:function(){this.fetch(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.fetch(e)}},{key:"render",value:function(){return null}}]),t}(f.Component);h.propTypes={siteId:p.a.number.isRequired},t.a=Object(O.b)(function(e){return{loaded:Object(b.i)(e),fetching:Object(b.h)(e),error:Object(b.g)(e)}},function(e){return Object(_.b)({fetchSettings:g.fetchSettings},e)})(h)},678:function(e,t,n){"use strict";var r=n(10),a=n.n(r),i=n(12),c=n.n(i),o=n(679),s=n.n(o),u=n(680),l=n.n(u),d=n(681),E=n.n(d),f={ups:s.a,usps:l.a,dhlexpress:E.a},m=function(e){var t=e.carrier,n=e.size;if(!t||!f[t.toLowerCase()])return a.a.createElement("span",null);var r="".concat(function(e){switch(e){case"small":return 24;case"big":return 40;case"medium":default:return 30}}(n),"px");return a.a.createElement("div",{style:{width:r},className:"carrier-icon"},a.a.createElement("img",{src:f[t.toLowerCase()],alt:t,className:"carrier-icon__logo"}))};m.propTypes={carrier:c.a.string.isRequired,size:c.a.number},t.a=m},679:function(e,t,n){e.exports=n.p+"images/881843a7135b8abd4794bd2d33dc8b3c.png"},680:function(e,t,n){e.exports=n.p+"images/41c6838923ebde874f7fc71db18dcae5.png"},681:function(e,t,n){e.exports=n.p+"images/41e119813ea7cd89e927349d8d4ad824.png"},684:function(e,t,n){"use strict";var r=n(36),a=n.n(r),i=n(10),c=n.n(i),o=n(12),s=n.n(o),u=n(109),l=n(35),d=n(1),E=n(534),f=n.n(E),m=n(34),p=n.n(m),O=n(107),_=n.n(O),g=n(108),b=n.n(g),h=n(528),v=n.n(h),C=n(527),S=n.n(C),I=n(529),j=n.n(I),R=n(30),N=n(526),y=n.n(N),P=n(557),M=n(589);function T(e){return Object(d.get)(e,["currentUser","id"])}function A(e){var t=T(e);return t?function(e,t){return e.users.items[t]}(e,t):null}var k=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n){var r=A(n);return Object(d.get)(r,e,t)}};k("localeSlug"),k("localeVariant"),k("user_ip_country_code");k("date"),k("username"),k("email");k("email_verified",!1);var L=n(532),D=n(562);function w(e){var t=Object(L.a)(e);return t||1!==function(e){var t=A(e);return t?t.site_count||0:null}(e)||(t=function(e){var t=A(e);return Object(d.get)(t,"primary_blog",null)}(e)),Object(D.a)(e,t)}var W=n(539),U=function(e,t){return Object(d.get)(e,["extensions","woocommerce","sites",t,"settings","products"])},x=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(L.a)(e);return Object(d.isArray)(U(e,t))},G=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(L.a)(e);return W.b===U(e,t)};function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(L.a)(e),n=U(e,t);return Object(d.find)(n,function(e){return"woocommerce_dimension_unit"===e.id})||{}}var H=n(561),F=n(556),B=n(535),q=function(e){return function(t,n){if(!x(n(),e)&&!G(n(),e)){var r={type:B.N,siteId:e};return t(r),Object(H.a)(e).get("settings/products").then(function(n){t({type:B.O,siteId:e,data:n})}).catch(function(n){t(Object(F.a)(e,r,n))})}}},z=function(e){function t(){return _()(this,t),v()(this,S()(t).apply(this,arguments))}return j()(t,e),b()(t,[{key:"componentDidMount",value:function(){var e=this.props.siteId;e&&this.props.fetchSettingsProducts(e)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.siteId!==this.props.siteId&&this.props.fetchSettingsProducts(e.siteId)}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.noWrap,r=e.dimensions,a=e.onChange,i=e.translate,o=e.dimensionsUnit,s=y()("form-dimensions-input",t,{"no-wrap":n});return c.a.createElement("div",{className:s},c.a.createElement(P.a,{name:"length",placeholder:i("L",{comment:"Length placeholder for dimensions input"}),type:"number",value:r&&r.length||"",onChange:a,className:"form-dimensions-input__length"}),c.a.createElement(P.a,{name:"width",placeholder:i("W",{comment:"Width placeholder for dimensions input"}),type:"number",value:r&&r.width||"",onChange:a,className:"form-dimensions-input__width"}),c.a.createElement(M.a,{name:"height",placeholder:i("H",{comment:"Height placeholder for dimensions input"}),suffix:o,type:"number",noWrap:n,value:r&&r.height||"",onChange:a,className:"form-dimensions-input__height"}))}}]),t}(i.Component);p()(z,"propTypes",{className:s.a.string,dimensions:s.a.shape({width:s.a.string,height:s.a.string,length:s.a.string}),dimensionsUnit:s.a.string,onChange:s.a.func.isRequired,noWrap:s.a.bool}),p()(z,"defaultProps",{value:"",className:"",onChange:d.noop,noWrap:!1});var Z=Object(u.b)(function(e,t){var n=t.dimensionsUnit,r=w(e);if(!n){var a=r&&V(e,r.ID);n=a&&a.value||"in"}return{siteId:r&&r.ID,dimensionsUnit:n}},function(e){return Object(R.b)({fetchSettingsProducts:q},e)})(Object(l.localize)(z)),K=n(545),Q=n(546),Y=n(579),$=n(550),X=/^\.\d+$/,J=/^\d+\.$/,ee=function(e){return e=Object(d.trim)(e),X.test(e)?e="0"+e:J.test(e)&&(e=e.slice(0,e.length-1)),e},te=/^\s*(\S+)\s*x\s*(\S+)\s*x\s*(\S+)\s*$/,ne=/^\s*(\S+)?\s*x\s*(\S+)?\s*x\s*(\S+)?\s*$/,re=function(e){return isNaN(e)?"":0>=e?"":e},ae=function(e){return Object(d.trim)(e)},ie=ee,ce=function(e){var t=te.exec(e);return t?[t[1],t[2],t[3]].map(ee).join(" x "):e},oe=function(e){var t="",n="",r="",a=ne.exec(e);return a&&4===a.length&&(t=re(a[1]),n=re(a[2]),r=re(a[3])),{length:t,width:n,height:r}},se=function(e){var t=e.siteId,n=e.form,r=e.setModalErrors,a=e.updatePackagesField,i=e.translate,o=n.mode,s=n.modalErrors,u=n.dimensionUnit,l=n.weightUnit,E=n.packageData,f=E.name,m=E.inner_dimensions,O=E.box_weight,_=E.is_letter,g=function(e,n){r(t,Object(d.omit)(s,e)),a(t,p()({},e,n))},b=function(e){var t=e.target.name,n=e.target.value;g(t,n)},h=function(e,t){var n=t||i("Invalid value."),r=""===Object(d.trim)(E[e])?i("This field is required."):n;return s[e]?c.a.createElement($.a,{text:r}):null},v=function(e){a(t,{is_letter:"envelope"===e.target.value})};return c.a.createElement("div",{className:"packages__properties-group"},"add-custom"===o?c.a.createElement(K.a,null,c.a.createElement(Q.a,{htmlFor:"package_type"},i("Type of package")),c.a.createElement(Y.a,{id:"package_type",onChange:v,value:_?"envelope":"box"},c.a.createElement("option",{value:"box"},i("Box")),c.a.createElement("option",{value:"envelope"},i("Envelope")))):null,c.a.createElement(K.a,null,c.a.createElement(Q.a,{htmlFor:"name"},i("Package name")),c.a.createElement(P.a,{id:"name",name:"name",placeholder:i("Unique package name"),value:f||"",onChange:b,isError:s.name}),h("name",i("This field must be unique"))),c.a.createElement(K.a,{className:"packages__add-package-weight-group"},c.a.createElement("div",{className:"packages__add-package-weight"},c.a.createElement(Q.a,null,i("Dimensions (L x W x H)")),function(e,t,n,r){var a=oe(t),i=a.length,o=a.width,s=a.height;return c.a.createElement(Z,{dimensionsUnit:n,dimensions:{width:o,height:s,length:i},onChange:function(t){var n=t.target.name,a=t.target.value;r(e,["length"===n?a:i,"width"===n?a:o,"height"===n?a:s].join(" x "))}})}("inner_dimensions",m,u,g),h("inner_dimensions")),c.a.createElement("div",{className:"packages__add-package-weight"},c.a.createElement(Q.a,{htmlFor:"box_weight"},i("Weight of empty package")),c.a.createElement(M.a,{id:"box_weight",name:"box_weight",placeholder:i("0.0"),value:O||"",onChange:b,isError:s.box_weight,type:"number",noWrap:!0,suffix:l}),h("box_weight"))))};se.propTypes={siteId:s.a.number.isRequired,form:s.a.object.isRequired,updatePackagesField:s.a.func.isRequired,packageData:s.a.shape({name:s.a.string.isRequired,inner_dimensions:s.a.string.isRequired,box_weight:s.a.number.isRequired,is_user_defined:s.a.bool.isRequired,is_letter:s.a.bool.isRequired}),setModalErrors:s.a.func.isRequired};var ue=Object(l.localize)(se),le=n(113),de=n.n(le),Ee=Object(d.memoize)(function(e){return de()(e,{greedy:!0})}),fe=function(e){return e&&""!==Object(d.trim)(e)?e:null},me=function(e,t){return e=fe(e),Object(d.some)(t,function(t){return t===e})?null:e},pe=/^\d+(\.\d+)?$/,Oe=function(e){return pe.test(e)?Number.parseFloat(e):null},_e=function(e,t,n){var r,a=Ee(n);return a(function(e,t){var n=Oe(e.box_weight),r=Oe(e.max_weight);n&&r&&r<=n&&(r=null);var a={name:me(e.name,t),inner_dimensions:e.inner_dimensions,outer_dimensions:fe(e.outer_dimensions),box_weight:n,max_weight:r};return Object(d.omitBy)(a,function(e){return null===e})}(e,t)),r=a.errors,Object(d.reduce)(r,function(e,t){if(t.field){var n,r=t.field.replace("data.","");Object.assign(e,(n={},p()(n,r,!0),p()(n,"any",!0),n))}return e},{})},ge=n(551),be=n(548),he=n(580),ve=function(e){var t=e.className,n=e.disabled,r=e.id,a=e.onToggle,i=e.readOnly,o=e.selectedElements,s=e.totalElements,u=o&&o===s,l=o&&o<s,d=y()("bulk-select__box",{"is-checked":u}),E=y()("bulk-select__some-checked-icon",{"is-disabled":n}),m=y()("bulk-select",t);return c.a.createElement("span",{className:m},c.a.createElement("span",{className:"bulk-select__container"},c.a.createElement("input",{id:r,type:"checkbox",className:d,onChange:function(e){i||a(!(l||u),e)},checked:u,disabled:n}),l?c.a.createElement(f.a,{className:E,icon:"minus-small",size:18}):null))};ve.propTypes={totalElements:s.a.number.isRequired,selectedElements:s.a.number.isRequired,onToggle:s.a.func,readOnly:s.a.bool,className:s.a.string,disabled:s.a.bool};var Ce=ve,Se=n(599),Ie=n(615),je=n(646),Re=n(541),Ne=function(e){var t=e.siteId,n=e.form,r=e.toggleAll,a=e.togglePackage,i=e.currentlyEditingPredefinedPackages,o=e.translate,s=n.dimensionUnit,u=function(e){var n="group-".concat(e.serviceId,"-").concat(e.groupId);return c.a.createElement("div",{className:"packages__group-header"},c.a.createElement("label",{htmlFor:n,onClick:function(e){return e.stopPropagation()}},c.a.createElement(Ce,{id:n,totalElements:e.total,selectedElements:e.selected,onToggle:function(n,a){a.stopPropagation(),r(t,e.serviceId,e.groupId,a.target.checked)},className:"packages__group-header-checkbox"}),e.title))};return c.a.createElement("div",null,function(){var e=[];return Object(d.forEach)(i,function(n,r){var i,l,d=(i=n.selected,l=n.total,i===l?o("All packages selected"):o("%(selectedCount)d package selected","%(selectedCount)d packages selected",{count:i,args:{selectedCount:i}}));e.push(c.a.createElement(Se.a,{className:"packages__predefined-packages",key:r,header:u(n),summary:d,expandedSummary:d,clickableHeader:!0,expanded:!1,screenReaderText:o("Expand Services"),icon:"chevron-down"},function(e){return e.packages.map(function(e,n){return c.a.createElement(je.a,{key:n,siteId:t,data:e,dimensionUnit:s,prefixActions:!0},c.a.createElement(Ie.a,{checked:e.selected,onChange:function(){return a(t,e.serviceId,e.id)}}))})}(n)))}),e}())};Ne.propTypes={siteId:s.a.number.isRequired,toggleAll:s.a.func.isRequired,togglePackage:s.a.func.isRequired,form:s.a.shape({dimensionUnit:s.a.string}).isRequired};var ye=Object(u.b)(function(e){return{currentlyEditingPredefinedPackages:Object(Re.c)(e)}})(Object(l.localize)(Ne)),Pe=n(531),Me=n.n(Pe),Te=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=v()(this,(e=S()(t)).call.apply(e,[this].concat(a))),p()(Me()(n),"handleKeyEvent",function(e){switch(e.keyCode){case 13:case 32:e.preventDefault(),document.activeElement.click()}}),n}return j()(t,e),b()(t,[{key:"render",value:function(){var e=y()({"segmented-control__item":!0,"is-selected":this.props.selected}),t=y()("segmented-control__link",p()({},"item-index-".concat(this.props.index),null!=this.props.index));return c.a.createElement("li",{className:e},c.a.createElement("a",{href:this.props.path,className:t,onClick:this.props.onClick,title:this.props.title,"data-e2e-value":this.props.value,role:"radio",tabIndex:0,"aria-checked":this.props.selected,onKeyDown:this.handleKeyEvent},c.a.createElement("span",{className:"segmented-control__text"},this.props.children)))}}]),t}(c.a.Component);p()(Te,"propTypes",{children:s.a.node.isRequired,path:s.a.string,selected:s.a.bool,title:s.a.string,value:s.a.string,onClick:s.a.func,index:s.a.number}),p()(Te,"defaultProps",{selected:!1});var Ae=Te,ke=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=v()(this,(e=S()(t)).call.apply(e,[this].concat(a))),p()(Me()(n),"state",{selected:n.props.initialSelected||n.props.options[0].value}),n}return j()(t,e),b()(t,[{key:"renderOptions",value:function(){var e=this;return this.props.options.map(function(t,n){return c.a.createElement(Ae,{index:n,key:n,onClick:function(){e.setState({selected:t.value}),e.props.onSelect&&e.props.onSelect(t)},path:t.path,selected:e.state.selected===t.value,value:t.value},t.label)})}},{key:"render",value:function(){var e={"is-compact":this.props.compact,"is-primary":this.props.primary};return c.a.createElement("ul",{className:y()("segmented-control",e,this.props.className),style:this.props.style,role:"radiogroup"},this.renderOptions())}}]),t}(c.a.Component);p()(ke,"propTypes",{className:s.a.string,compact:s.a.bool,initialSelected:s.a.string,onSelect:s.a.func,options:s.a.arrayOf(s.a.shape({value:s.a.string.isRequired,label:s.a.string.isRequired,path:s.a.string})).isRequired,style:s.a.object});var Le=n(647),De=n(549),we=n(555),We=function(e){var t,n=e.siteId,r=e.form,a=e.predefinedPackagesSummary,i=e.setModalErrors,o=e.savePackage,s=e.savePredefinedPackages,u=e.dismissModal,l=e.removePackage,E=e.setAddMode,m=e.updatePackagesField,p=e.translate,O=r.showModal,_=r.mode,g=r.packages,b=r.packageSchema,h=r.predefinedSchema,v=r.packageData,C=v.index,S=g.custom,I="edit"===_,j="add-custom"===_,R="add-predefined"===_,N=function(){var t={duration:5e3};e.createWcsShippingSaveActionList(function(){return"function"===typeof e.onSaveSuccess&&"name"in v&&e.onSaveSuccess(v.name),e.successNotice(p("Your shipping packages have been saved."),t)},function(){return e.errorNotice(p("Unable to save your shipping packages. Please try again."),t)},!0)},y=function(){u(n)},P=p(I?"Edit package":"Add a package"),M=j||R,T=j||I,A=R;t=j||R&&0===a.removed?p("Add package","Add packages",{count:j?1:a.added}):p("Done");var k=[c.a.createElement(he.a,{onClick:function(){if(R)return s(n),void(e.persistOnSave&&N());var t="number"===typeof v.index?S[v.index].name:null,r=Object(d.concat)(Object(d.difference)(S.map(function(e){return e.name}),[t]),Object(d.flatten)(Object(d.map)(h,function(e){return Object(d.map)(e,function(e){return e.definitions})})),["individual"]),a=Object.assign({},v,{name:ae(v.name),inner_dimensions:ce(v.inner_dimensions),outer_dimensions:ce(v.outer_dimensions),box_weight:ie(v.box_weight),max_weight:0}),c=_e(a,r,b);if(c.any)return m(n,a),void i(n,c);o(n,a),e.persistOnSave&&N()}},t),c.a.createElement(he.a,{onClick:y,isPrimary:!1},p("Cancel"))];return I&&k.unshift({action:"delete",label:c.a.createElement("span",null,p("{{icon/}} Delete this package",{components:{icon:c.a.createElement(f.a,{icon:"trash"})}})),onClick:function(){return l(n,C)},additionalClassNames:"packages__delete is-scary is-borderless"}),c.a.createElement(ge.a,{isVisible:O,additionalClassNames:"packages__add-edit-dialog woocommerce wcc-root",onClose:y,buttons:k},c.a.createElement(be.a,{className:"packages__add-edit-title"},P),M&&c.a.createElement(ke,{primary:!0,className:"packages__mode-select",initialSelected:_,onSelect:function(e){E(n,e.value)},options:[{value:"add-custom",label:"Custom package"},{value:"add-predefined",label:"Service package"}]}),T&&c.a.createElement(ue,e),A&&c.a.createElement(ye,e))};We.propTypes={siteId:s.a.number.isRequired,dismissModal:s.a.func.isRequired,form:s.a.object.isRequired,updatePackagesField:s.a.func.isRequired,savePackage:s.a.func.isRequired,packageData:s.a.shape({index:s.a.number.isRequired}),setModalErrors:s.a.func.isRequired,removePackage:s.a.func.isRequired,setAddMode:s.a.func.isRequired};t.a=Object(u.b)(function(e){return{predefinedPackagesSummary:Object(Re.f)(e)}},function(e){return Object(R.b)(a()({createWcsShippingSaveActionList:Le.a,errorNotice:De.a,successNotice:De.d},we),e)})(Object(l.localize)(We))},770:function(e,t,n){},771:function(e,t,n){},791:function(e,t,n){"use strict";n.r(t);var r=n(10),a=n.n(r),i=n(107),c=n.n(i),o=n(108),s=n.n(o),u=n(528),l=n.n(u),d=n(527),E=n.n(d),f=n(531),m=n.n(f),p=n(529),O=n.n(p),_=n(34),g=n.n(_),b=n(109),h=n(30),v=n(35),C=n.n(v),S=n(542),I=n(631),j=n(12),R=n.n(j),N=n(526),y=n.n(N),P=n(1),M=n(559),T=n(530),A=n.n(T),k=n(560),L=n(533),D=n.n(L),w={en:{symbol:"K",grouping:",",decimal:"."},es:{symbol:" mil",grouping:".",decimal:","},"pt-br":{symbol:" mil",grouping:".",decimal:","},de:{symbol:" Tsd.",grouping:".",decimal:","},fr:{symbol:" k",grouping:" ",decimal:","},he:{symbol:"K",grouping:",",decimal:"."},ja:{symbol:"\u4e07",unitValue:1e4,grouping:",",decimal:"."},nl:{symbol:"K",grouping:".",decimal:","},tr:{symbol:" B",grouping:".",decimal:","},id:{symbol:" rb",grouping:".",decimal:","},"zh-cn":{symbol:"\u4e07",unitValue:1e4,grouping:",",decimal:"."},"zh-tw":{symbol:"\u842c",unitValue:1e4,grouping:",",decimal:"."},ko:{symbol:"\ucc9c",grouping:",",decimal:"."},ar:{symbol:" \u0623\u0644\u0641",grouping:"\u066c",decimal:"\u066b"},sv:{symbol:" tn",grouping:" ",decimal:","}};n(770);var W=function(e){var t=e.count,n=e.compact,r=e.numberFormat,i=e.primary,c=D()(e,["count","compact","numberFormat","primary"]);return a.a.createElement("span",A()({className:y()("count",{"is-primary":i})},Object(P.omit)(c,["translate","moment"])),n&&function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:C.a.getLocaleSlug();if(isNaN(e)||!w[t])return null;var n=w[t],r=n.decimal,a=n.grouping,i=n.symbol,c=n.unitValue,o=void 0===c?1e3:c,s=e<0?"-":"",u=Math.abs(e);if(u<o)return"".concat(s).concat(u);var l=u<10*o?1:0,d=Object(v.numberFormat)(u/o,{decimals:l,thousandsSep:a,decPoint:r});return"".concat(s).concat(d).concat(i)}(t)||r(t))};W.propTypes={count:R.a.number.isRequired,numberFormat:R.a.func,primary:R.a.bool,compact:R.a.bool},W.defaultProps={primary:!1,compact:!1};var U=Object(v.localize)(W),x=(n(771),function(e){function t(){return c()(this,t),l()(this,E()(t).apply(this,arguments))}return O()(t,e),s()(t,[{key:"render",value:function(){var e="number"===typeof this.props.count,t=!(this.props.label||e||this.props.children),n=y()(this.props.className,"section-header",{"is-empty":t}),r={id:this.props.id};return a.a.createElement(k.a,A()({className:n,href:this.props.href},r),a.a.createElement("div",{className:"section-header__label"},a.a.createElement("span",{className:"section-header__label-text"},this.props.label),e&&a.a.createElement(U,{count:this.props.count})),a.a.createElement("div",{className:"section-header__actions"},this.props.children))}}]),t}(r.PureComponent));g()(x,"defaultProps",{label:"",href:null});var G=function(e){function t(){return c()(this,t),l()(this,E()(t).apply(this,arguments))}return O()(t,e),s()(t,[{key:"render",value:function(){var e=this.props,t=e.label,n=e.description,r=e.children,i=a.a.createElement("div",null,a.a.createElement("div",{className:"extended-header__header"},t),a.a.createElement("div",{className:"extended-header__header-description"},n));return a.a.createElement(x,{className:"extended-header",label:i},r)}}]),t}(r.Component),V=n(675),H=n(36),F=n.n(H),B=n(534),q=n.n(B),z=n(604),Z=n(615),K=n(545),Q=n(546),Y=n(579),$=n(553),X=n(640),J={alipay:"Alipay",amex:"American Express",bancontact:"Bancontact","brazil-tef":"Transfer\xeancia banc\xe1ria",diners:"Diners Club",discover:"Discover",eps:"eps",giropay:"Giropay",ideal:"iDEAL",jcb:"JCB",mastercard:"Mastercard",p24:"Przelewy24",paypal:"PayPal",placeholder:"",unionpay:"UnionPay",visa:"Visa",wechat:C.a.translate("WeChat Pay",{comment:"Name for WeChat Pay - https://pay.weixin.qq.com/"}),sofort:"Sofort"},ee=Object(P.keys)(J),te=function(e){function t(){return c()(this,t),l()(this,E()(t).apply(this,arguments))}return O()(t,e),s()(t,[{key:"render",value:function(){var e=this.props,t=e.altText,n=e.className,r=e.isCompact,i=e.type,c=y()("payment-logo","is-".concat(i),{"is-compact":r},n);return a.a.createElement("div",{className:c,"aria-label":t||J[i]||""})}}]),t}(a.a.Component);g()(te,"propTypes",{className:R.a.string,type:R.a.oneOf(ee),altText:R.a.string,isCompact:R.a.bool});var ne=te,re=function(e,t,n){var r={amex:e("American Express"),discover:e("Discover"),mastercard:e("MasterCard"),visa:e("VISA"),paypal:e("PayPal")};return r[t]?n?e("%(card)s ****%(digits)s",{args:{card:r[t],digits:n}}):r[t]:null},ae=function(e){var t=e.translate,n=e.selected,r=e.isLoading,i=e.type,c=e.digits,o=e.name,s=e.expiry,u=e.onSelect;if(r)return a.a.createElement(k.a,{className:"label-settings__card"},a.a.createElement(Z.a,{className:"label-settings__card-checkbox"}),a.a.createElement(ne,{className:"label-settings__card-logo",type:"placeholder",altText:""}),a.a.createElement("div",{className:"label-settings__card-details"},a.a.createElement("p",{className:"label-settings__card-number"}),a.a.createElement("p",{className:"label-settings__card-name"})),a.a.createElement("div",{className:"label-settings__card-date"},a.a.createElement("p",null)));var l=re(t,i,c),d=l?i:"placeholder",E=l||i;return a.a.createElement(k.a,{className:"label-settings__card",onClick:u},a.a.createElement(Z.a,{className:"label-settings__card-checkbox",checked:n,onChange:u}),a.a.createElement(ne,{className:"label-settings__card-logo",type:d,altText:l}),a.a.createElement("div",{className:"label-settings__card-details"},a.a.createElement("p",{className:"label-settings__card-number"},E),a.a.createElement("p",{className:"label-settings__card-name"},o)),a.a.createElement("div",{className:"label-settings__card-date"},t("Expires %(date)s",{args:{date:s},context:"date is of the form MM/YY"})))};ae.propTypes={selected:R.a.bool.isRequired,isLoading:R.a.bool,type:R.a.string,digits:R.a.string,name:R.a.string,expiry:R.a.string,onSelect:R.a.func};var ie=Object(v.localize)(ae),ce=n(645),oe=n(567),se=n(543),ue=function(){return null},le=function(){return null},de=function(e){function t(){var e,n;c()(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=l()(this,(e=E()(t)).call.apply(e,[this].concat(i))),g()(m()(n),"renderPaymentPermissionNotice",function(){var e=n.props,t=e.canEditPayments,r=e.canEditSettings,i=e.masterUserName,c=e.masterUserLogin,o=e.translate;return!r||t?null:a.a.createElement($.a,{showDismiss:!1},o("Only the site owner can manage shipping label payment methods. Please contact %(ownerName)s (%(ownerLogin)s) to manage payment methods.",{args:{ownerName:i,ownerLogin:c}}))}),g()(m()(n),"refetchSettings",function(){n.props.fetchSettings(n.props.siteId)}),g()(m()(n),"renderPaymentWarningNotice",function(){var e=n.props,t=e.paymentMethodsWarning,r=e.translate;if(t)return a.a.createElement($.a,{status:"is-warning",showDismiss:!1,text:t},a.a.createElement(X.a,{onClick:n.refetchSettings},r("Retry")))}),g()(m()(n),"renderSettingsPermissionNotice",function(){var e=n.props,t=e.canEditSettings,r=e.masterUserName,i=e.masterUserLogin,c=e.translate;return t?null:a.a.createElement($.a,{showDismiss:!1},c("Only the site owner can change these settings. Please contact %(ownerName)s (%(ownerLogin)s) to change the shipping label settings.",{args:{ownerName:r,ownerLogin:i}}))}),g()(m()(n),"renderAddCardExternalInfo",function(){var e=n.props,t=e.masterUserWpcomLogin,r=e.masterUserEmail,i=e.translate;return t?a.a.createElement("p",null,i("Credit cards are retrieved from the following WordPress.com account: %(wpcomLogin)s <%(wpcomEmail)s>",{args:{wpcomLogin:t,wpcomEmail:r}})):null}),g()(m()(n),"onVisibilityChange",function(){document.hidden||n.refetchSettings(),n.addCreditCardWindow&&n.addCreditCardWindow.closed&&document.removeEventListener("visibilitychange",n.onVisibilityChange)}),g()(m()(n),"renderPaymentsSection",function(){var e=n.props,t=e.siteId,r=e.canEditPayments,i=e.paymentMethods,c=e.selectedPaymentMethod,o=e.isReloading,s=e.translate;if(!n.state.expanded){var u;if(c){var l=Object(P.find)(i,{payment_method_id:c}),d=l.card_type,E=l.card_digits;u=s("We'll charge the credit card on your account (%(card)s) to pay for the labels you print",{args:{card:re(s,d,E)}})}else u=s("To purchase shipping labels, add a credit card.");return a.a.createElement("div",null,n.renderPaymentPermissionNotice(),a.a.createElement("p",{className:"label-settings__credit-card-description"},u),r&&a.a.createElement("p",{className:"label-settings__credit-card-description"},a.a.createElement(S.a,{onClick:function(e){e.preventDefault(),n.setState({expanded:!0})},borderless:!0},s("Choose a different card"))))}var f,m;i.length?(f=s("To purchase shipping labels, choose a credit card you have on file or add a new card."),m=s("Add another credit card")):(f=s("To purchase shipping labels, add a credit card."),m=s("Add a credit card"));return a.a.createElement("div",null,n.renderPaymentPermissionNotice(),a.a.createElement("p",{className:"label-settings__credit-card-description"},f),!o&&n.renderPaymentWarningNotice(),a.a.createElement(ue,null),o?a.a.createElement("div",{className:"label-settings__placeholder"},a.a.createElement(ie,{selected:!1,isLoading:!0}),a.a.createElement(ie,{selected:!1,isLoading:!0})):i.map(function(e,t){return a.a.createElement(ie,{key:t,selected:c===e.payment_method_id,type:e.card_type,name:e.name,digits:e.card_digits,expiry:e.expiry,onSelect:function(){return t=e.payment_method_id,n.props.setValue("selected_payment_method_id",t);var t}})}),a.a.createElement(le,{siteId:t}),a.a.createElement(S.a,{className:"label-settings__internal",onClick:function(){n.props.openAddCardDialog(t)},compact:!0},m),a.a.createElement("div",{className:"label-settings__credit-card-description label-settings__external"},n.renderAddCardExternalInfo(),a.a.createElement(S.a,{onClick:function(){n.addCreditCardWindow=window.open(Object(ce.a)()+"/me/purchases/add-credit-card"),document.addEventListener("visibilitychange",n.onVisibilityChange)},compact:!0},m," ",a.a.createElement(q.a,{icon:"external"}))))}),g()(m()(n),"renderEmailReceiptsSection",function(){var e=n.props,t=e.emailReceipts,r=e.translate,i=e.masterUserName,c=e.masterUserLogin,o=e.masterUserEmail,s=e.canEditSettings,u=e.canEditPayments;if(!Object(P.isBoolean)(t))return null;return a.a.createElement(K.a,null,a.a.createElement(Q.a,{className:"label-settings__cards-label"},r("Email Receipts")),a.a.createElement(Q.a,null,a.a.createElement(Z.a,{checked:t,onChange:function(){return n.props.setValue("email_receipts",!t)},disabled:!u&&!s}),a.a.createElement("span",{className:"label-settings__credit-card-description"},r("Email the label purchase receipts to %(ownerName)s (%(ownerLogin)s) at %(ownerEmail)s",{args:{ownerName:i,ownerLogin:c,ownerEmail:o}}))))}),g()(m()(n),"renderContent",function(){var e=n.props,t=e.canEditSettings,r=e.isLoading,i=e.paperSize,c=e.storeOptions,o=e.translate;if(r)return n.renderPlaceholder();var s=Object(z.a)(c.origin_country);return a.a.createElement("div",null,a.a.createElement(K.a,null,n.renderSettingsPermissionNotice(),a.a.createElement(Q.a,{className:"label-settings__cards-label"},o("Paper size")),a.a.createElement(Y.a,{onChange:function(e){return n.props.setValue("paper_size",e.target.value)},value:i,disabled:!t},Object.keys(s).map(function(e){return a.a.createElement("option",{value:e,key:e},s[e])}))),a.a.createElement(K.a,null,a.a.createElement(Q.a,{className:"label-settings__cards-label"},o("Payment")),n.renderPaymentsSection()),n.renderEmailReceiptsSection())}),n}return O()(t,e),s()(t,[{key:"UNSAFE_componentWillMount",value:function(){this.setState({expanded:this.isExpanded(this.props)})}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.selectedPaymentMethod!==this.props.selectedPaymentMethod&&this.setState({expanded:this.isExpanded(e)})}},{key:"isExpanded",value:function(e){var t=e.canEditPayments,n=e.pristine,r=e.selectedPaymentMethod;return t&&(!r||!n)}},{key:"renderPlaceholder",value:function(){return a.a.createElement("div",{className:"label-settings__placeholder"},a.a.createElement(K.a,null,a.a.createElement(Q.a,{className:"label-settings__cards-label"},a.a.createElement("span",null)),a.a.createElement(Y.a,null)),a.a.createElement(K.a,null,a.a.createElement(Q.a,{className:"label-settings__cards-label"},a.a.createElement("span",null)),a.a.createElement("p",{className:"label-settings__credit-card-description"}),a.a.createElement(ie,{selected:!1,isLoading:!0}),a.a.createElement(ie,{selected:!1,isLoading:!0}),a.a.createElement(S.a,{compact:!0})))}},{key:"render",value:function(){return a.a.createElement("div",{className:"label-settings__labels-container"},this.renderContent())}}]),t}(r.Component);de.propTypes={siteId:R.a.number.isRequired,setValue:R.a.func.isRequired};var Ee=Object(b.b)(function(e,t){var n=t.siteId;return F()({isLoading:Object(se.c)(e,n)&&!Object(se.d)(e,n),isReloading:Object(se.c)(e,n)&&Object(se.d)(e,n),pristine:Object(se.o)(e,n),paymentMethods:Object(se.l)(e,n),paymentMethodsWarning:Object(se.m)(e,n),selectedPaymentMethod:Object(se.n)(e,n),paperSize:Object(se.k)(e,n),storeOptions:Object(se.h)(e,n),canEditPayments:Object(se.q)(e,n),canEditSettings:Object(se.q)(e,n)||Object(se.p)(e,n),emailReceipts:Object(se.e)(e,n)},Object(se.j)(e,n))},function(e){return Object(h.b)({openAddCardDialog:oe.b,fetchSettings:oe.a},e)})(Object(v.localize)(de)),fe=n(676),me=n(532),pe=function(e){function t(){var e,n;c()(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=l()(this,(e=E()(t)).call.apply(e,[this].concat(i))),g()(m()(n),"setValue",function(e,t){n.props.onChange(),n.props.setFormDataValue(n.props.siteId,e,t)}),g()(m()(n),"onEnabledToggle",function(){n.props.onChange(),n.props.setFormDataValue(n.props.siteId,"enabled",!n.props.labelsEnabled)}),g()(m()(n),"renderContent",function(){var e=n.props,t=e.isFetchError,r=e.siteId,i=e.translate;return t?a.a.createElement("p",null,i("Unable to get your settings. Please refresh the page to try again.")):a.a.createElement(Ee,{siteId:r,setValue:n.setValue})}),n}return O()(t,e),s()(t,[{key:"componentWillUnmount",value:function(){this.props.restorePristineSettings(this.props.siteId)}},{key:"render",value:function(){var e=this.props,t=e.formMeta,n=e.canManagePayments,r=e.canEditSettings,i=e.labelsEnabled,c=e.siteId,o=e.translate;if(!t)return a.a.createElement(fe.a,{siteId:c});var s=Object(P.isBoolean)(i),u=Object(P.isBoolean)(i)&&!i;return a.a.createElement("div",null,a.a.createElement(fe.a,{siteId:c}),a.a.createElement(G,{label:o("Shipping Labels"),description:o("Print shipping labels yourself and save a trip to the post office")},s&&a.a.createElement(V.a,{checked:i,onChange:this.onEnabledToggle,disabled:Boolean(!n&&!r)})),a.a.createElement(M.a,{className:y()("label-settings__labels-container",{hidden:u})},this.renderContent()))}}]),t}(r.Component);pe.propTypes={onChange:R.a.func.isRequired,submit:R.a.func};var Oe=Object(b.b)(function(e){return{siteId:Object(me.a)(e),formMeta:Object(se.g)(e),labelsEnabled:Object(se.a)(e),isFetchError:Object(se.b)(e),canManagePayments:Object(se.q)(e),canEditSettings:Object(se.p)(e)}},function(e){return Object(h.b)({setFormDataValue:oe.d,restorePristineSettings:oe.c},e)})(Object(v.localize)(pe)),_e=n(590),ge=n(684),be=n(646),he=n(677),ve=n(555),Ce=n(541),Se=function(e){function t(){var e,n;c()(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=l()(this,(e=E()(t)).call.apply(e,[this].concat(i))),g()(m()(n),"renderListHeader",function(e){var t=n.props.translate;return e&&e.length?a.a.createElement("div",{className:"packages__packages-row packages__packages-header"},a.a.createElement("div",{className:"packages__packages-row-icon"}),a.a.createElement("div",{className:"packages__packages-row-details"},t("Name")),a.a.createElement("div",{className:"packages__packages-row-dimensions"},t("Dimensions")),a.a.createElement("div",{className:"packages__packages-row-actions"})):null}),g()(m()(n),"renderListItem",function(e,t){var r=n.props,i=r.siteId,c=r.isFetching,o=r.form,s=r.translate,u=o.dimensionUnit,l=null;if(e.is_user_defined){l=a.a.createElement(S.a,{compact:!0,onClick:function(){n.props.onChange(),n.props.editPackage(i,e)}},s("Edit"))}else{l=a.a.createElement(S.a,{compact:!0,onClick:function(){n.props.onChange(),n.props.removePredefinedPackage(i,e.serviceId,e.id)}},s("Remove"))}return a.a.createElement(be.a,{key:t,siteId:i,isPlaceholder:c,data:e,dimensionUnit:u},l)}),n}return O()(t,e),s()(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.isFetching,r=t.fetchError,i=t.siteId,c=t.allSelectedPackages,o=t.translate;if(r)return null;var s=n?[{},{},{}]:c;return a.a.createElement("div",null,a.a.createElement(he.a,{siteId:i}),a.a.createElement(G,{label:o("Packaging"),description:o("Add boxes, envelopes, and other packages you use most frequently")},a.a.createElement(S.a,{onClick:function(){e.props.onChange(),e.props.addPackage(i)},disabled:n},o("Add package"))),a.a.createElement(M.a,{className:"packages__packages"},this.renderListHeader(s),s.map(this.renderListItem),!n&&a.a.createElement(ge.a,this.props)))}}]),t}(r.Component);Se.propTypes={addPackage:R.a.func.isRequired,removePackage:R.a.func.isRequired,editPackage:R.a.func.isRequired,dismissModal:R.a.func.isRequired,onChange:R.a.func.isRequired,savePackage:R.a.func.isRequired,updatePackagesField:R.a.func.isRequired,toggleOuterDimensions:R.a.func.isRequired,setModalErrors:R.a.func.isRequired,showModal:R.a.bool,form:R.a.shape({packages:R.a.object,dimensionUnit:R.a.string,weightUnit:R.a.string,packageSchema:R.a.object,predefinedSchema:R.a.oneOfType([R.a.object,R.a.array])}).isRequired};var Ie=Object(b.b)(function(e){var t=Object(me.a)(e),n=Object(Ce.e)(e,t)||{};return{siteId:t,isFetching:!n.packages||n.isFetching,fetchError:Object(Ce.g)(e,t),form:n,allSelectedPackages:Object(Ce.b)(e,t)||[]}},function(e){return F()({},Object(h.b)(ve,e))})(Object(v.localize)(Se)),je=n(678),Re=n(551),Ne=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(me.a)(e),n=arguments.length>2?arguments[2]:void 0;return Object(P.get)(e,["extensions","woocommerce","woocommerceServices",t,"carrierAccounts",n],null)},ye=/(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/,Pe=/^(?:(?:(?:https?|ftp):)?\/\/)*(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[\/?#]\S*)?$/i,Me=n(547),Te=n(549),Ae=n(538),ke=function(e,t,n,r){return{type:Ae.g,siteId:e,carrier:t,fieldName:n,newValue:r}},Le=function(e,t){return{type:Ae.e,siteId:e,carrier:t}},De=function(e,t){return{type:Ae.f,siteId:e,carrier:t}},we=function(e,t,n){return{type:Ae.c,siteId:e,carrier:t,show:n}},We=function(e,t,n){return{type:Ae.d,siteId:e,carrier:t,show:n}},Ue=function(e,t,n){return function(r){return r(Le(e,t)),Me.a(e,Me.d.shippingCarrierDelete(n)).then(function(){r(Object(Te.d)(Object(v.translate)("Your carrier account was disconnected succesfully."))),r(Le(e,t)),r(We(e,t,!1)),r({type:Ae.b,siteId:e,carrier:t})}).catch(function(){r(Le(e,t)),r(Object(Te.a)(Object(v.translate)("There was an error trying to disconnect your carrier account")))})}},xe=function(e,t,n){return function(r){return r(Le(e,t)),Me.c(e,Me.d.shippingCarrier(),n).then(function(){r(function(e,t){return{type:Ae.a,siteId:e,carrier:t}}(e,t)),r(Le(e,t)),r(Object(Te.d)(Object(v.translate)("Your carrier account was connected succesfully.")))}).catch(function(){r(Le(e,t)),r(Object(Te.a)(Object(v.translate)("There was an error connecting to your UPS account. Please check that all of the information entered matches your UPS account and try to connect again.")))})}},Ge=function(e){var t=e.data,n=e.disconnected,r=e.isSaving,i=e.translate,c=e.siteId,o=e.showDisconnectDialog;n&&(delete t.id,delete t.account);var s,u,l=function(){e.setVisibilityDisconnectCarrierDialog(c,t.carrier,!0)},d=function(){e.setVisibilityDisconnectCarrierDialog(c,t.carrier,!1)};return a.a.createElement("div",{className:"carrier-accounts__list-item"},(u=t.carrier,a.a.createElement("div",{className:"carrier-accounts__list-item-carrier-icon"},a.a.createElement(je.a,{carrier:u,size:18}))),function(e){var t=e&&""!==Object(P.trim)(e)?e:i("Untitled");return a.a.createElement("div",{className:"carrier-accounts__list-item-name"},a.a.createElement("span",null,t))}(t.carrier),(s=t.account,a.a.createElement("div",{className:"carrier-accounts__list-item-credentials"},a.a.createElement("span",null,s))),function(e){return a.a.createElement("div",{className:"carrier-accounts__list-item-actions"},e?a.a.createElement(S.a,{onClick:l,compact:!0,scary:!0,borderless:!0},i("Disconnect")):a.a.createElement("a",{href:"/wp-admin/admin.php?page=wc-settings&tab=shipping§ion=woocommerce-services-settings&carrier=UPS",className:"button is-compact"},i("Connect")))}(t.account),a.a.createElement(Re.a,{isVisible:o,additionalClassNames:"carrier-accounts__settings-cancel-dialog",onClose:d,buttons:[a.a.createElement(S.a,{compact:!0,primary:!0,disabled:r,onClick:function(){return e.setVisibilityDisconnectCarrierDialog(c,t.carrier,!1)}},i("Cancel")),a.a.createElement(S.a,{compact:!0,primary:!0,scary:!0,disabled:r,busy:r,onClick:function(){return e.disconnectCarrier(c,t.carrier,t.id)}},i("Disconnect"))]},a.a.createElement("div",{className:"carrier-accounts__settings-cancel-dialog-header"},a.a.createElement("h2",{className:"carrier-accounts__settings-cancel-dialog-title"},i("Disconnect your UPS account")),a.a.createElement("button",{className:"carrier-accounts__settings-cancel-dialog-close-button",onClick:d},a.a.createElement(q.a,{icon:"cross"}))),a.a.createElement("p",{className:"carrier-accounts__settings-cancel-dialog-description"},i("This will remove the connection with UPS. All of your UPS account information will be deleted and you won\u2019t see UPS rates when purchasing shipping labels."))))};Ge.propTypes={siteId:R.a.number.isRequired,data:R.a.shape({id:R.a.string,carrier:R.a.string.isRequired,account:R.a.string}).isRequired};var Ve=Object(b.b)(function(e,t){var n=t.siteId,r=t.data.carrier,a=Ne(e,n,r);return{disconnected:a.disconnected,isSaving:a.isSaving,showDisconnectDialog:a.showDisconnectDialog}},function(e){return Object(h.b)({setVisibilityDisconnectCarrierDialog:We,disconnectCarrier:Ue},e)})(Object(v.localize)(Ge)),He=function(e){function t(){var e,n;c()(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=l()(this,(e=E()(t)).call.apply(e,[this].concat(i))),g()(m()(n),"renderListHeader",function(e){var t=n.props.translate;return a.a.createElement("div",{className:"carrier-accounts__header"},a.a.createElement("div",{className:"carrier-accounts__header-icon"}),a.a.createElement("div",{className:"carrier-accounts__header-name"},t("Name")),Object(P.some)(e,"account")&&a.a.createElement("div",{className:"carrier-accounts__header-credentials"},t("Credentials")),a.a.createElement("div",{className:"carrier-accounts__header-actions"}))}),g()(m()(n),"renderListItem",function(e,t){var r=n.props,i=r.siteId,c=r.isFetching;return a.a.createElement(Ve,{key:t,siteId:i,isPlaceholder:c,data:e})}),n}return O()(t,e),s()(t,[{key:"render",value:function(){var e=this.props.translate,t=this.props.carriers||[];return Object(P.isEmpty)(t)?a.a.createElement("div",null):a.a.createElement("div",null,a.a.createElement(G,{label:e("Carrier account"),description:e("Set up your own carrier account by adding your credentials here")}),a.a.createElement(M.a,{className:"carrier-accounts__list"},this.renderListHeader(t),t.map(this.renderListItem)))}}]),t}(r.Component);He.propTypes={siteId:R.a.number.isRequired,carriers:R.a.arrayOf(R.a.shape({id:R.a.string,carrier:R.a.string.isRequired,account:R.a.string}))};var Fe=Object(v.localize)(He),Be=n(600),qe=n(613),ze=n(586),Ze=n(537),Ke=n(563),Qe=n(602),Ye=function(e){var t=e.carrier,n=e.countryNames,r=e.fieldErrors,i=e.isConnectionSuccess,c=e.isFormValid,o=e.isSaving,s=e.showCancelConnectionDialog,u=e.showUPSInvoiceFields,l=e.siteId,d=e.stateNames,E=e.translate,f=e.values;if(i){var m=new URL(window.location.href);m.searchParams.delete("carrier"),window.location.href=m.href}var p=function(e){return f[e]?Object(Qe.a)(f[e]):""},O=function(n){return function(r){return e.updateCarrierSettings(l,t,n,r)}},_=function(){e.setVisibilityCancelConnectionDialog(l,t,!1)};return a.a.createElement("div",{className:"carrier-accounts__settings-container"},void 0,a.a.createElement("div",{className:"carrier-accounts__settings"},a.a.createElement("div",{className:"carrier-accounts__settings-info"},a.a.createElement("h4",{className:"carrier-accounts__settings-subheader-above-description"},E("Connect your UPS account")),a.a.createElement("p",{className:"carrier-accounts__settings-subheader-description"},E("Set up your own UPS carrier account to compare rates and print labels from multiple carriers in WooCommerce Services. Learn more about adding {{a}}carrier accounts{{/a}}.",{components:{a:a.a.createElement("a",{href:"https://docs.woocommerce.com/document/using-your-own-ups-account-in-woocommerce-shipping/"})}})),a.a.createElement("p",{className:"carrier-accounts__settings-subheader-description"},E("If you need a UPS account number, go to {{a}}UPS.com{{/a}} to create a new account.",{components:{a:a.a.createElement("a",{href:"https://ups.com/"})}}))),a.a.createElement("div",{className:"carrier-accounts__settings-form"},a.a.createElement(k.a,null,a.a.createElement("h4",{className:"carrier-accounts__settings-subheader"},E("General information")),a.a.createElement("p",{className:"carrier-accounts__settings-subheader-description"},E("This is the account number and address from your UPS profile"))),a.a.createElement(k.a,{className:"carrier-accounts__settings-account-number"},a.a.createElement(ze.a,{id:"account_number",title:E("Account number"),value:p("account_number"),updateValue:O("account_number"),error:r.account_number})),a.a.createElement(k.a,{className:"carrier-accounts__settings-address"},a.a.createElement(ze.a,{id:"name",title:E("Name"),value:p("name"),updateValue:O("name"),error:r.name}),a.a.createElement(ze.a,{id:"street1",title:E("Address"),value:p("street1"),updateValue:O("street1"),error:r.street1}),a.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},a.a.createElement(ze.a,{id:"street2",title:E("Address 2 (optional)"),value:p("street2"),updateValue:O("street2"),error:r.street2}),a.a.createElement(ze.a,{id:"city",title:E("City"),value:p("city"),updateValue:O("city"),error:r.city})),a.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},d?a.a.createElement(Be.a,{id:"state",title:E("State"),value:p("state"),valuesMap:F()({"":e.translate("Select one\u2026")},d),updateValue:O("state"),error:r.state}):a.a.createElement(ze.a,{id:"state",title:E("State"),value:p("state"),updateValue:O("state"),error:r.state}),a.a.createElement(Be.a,{id:"country",title:E("Country"),value:p("country"),valuesMap:n,updateValue:O("country"),error:r.country})),a.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},a.a.createElement(ze.a,{id:"postal_code",title:E("ZIP/Postal code"),value:p("postal_code"),updateValue:O("postal_code"),error:r.postal_code}),a.a.createElement(ze.a,{id:"phone",title:E("Phone"),value:p("phone"),updateValue:O("phone"),error:r.phone})),a.a.createElement(ze.a,{id:"email",title:E("Email"),value:p("email"),updateValue:O("email"),error:r.email})),a.a.createElement(k.a,{className:"carrier-accounts__settings-company-info"},a.a.createElement("div",{className:"carrier-accounts__settings-header"},a.a.createElement("h4",{className:"carrier-accounts__settings-subheader"},E("Company information")),a.a.createElement("p",{className:"carrier-accounts__settings-subheader-description"},E("This is the company info you used to create your UPS account"))),a.a.createElement(ze.a,{id:"company",title:E("Company name"),value:p("company"),updateValue:O("company"),error:r.company}),a.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},a.a.createElement(ze.a,{id:"title",title:E("Job title"),value:p("title"),updateValue:O("title"),error:r.title}),a.a.createElement(ze.a,{id:"website",title:E("Company website"),value:p("website"),updateValue:O("website"),error:r.website}))),a.a.createElement(k.a,{className:"carrier-accounts__settings-ups-info"},a.a.createElement("div",{className:"carrier-accounts__settings-header"},a.a.createElement("h4",{className:"carrier-accounts__settings-subheader"},E("UPS account information")),a.a.createElement(qe.a,{id:"enable_ups_invoice_fields",checked:u,onChange:function(){e.toggleShowUPSInvoiceFields(l,t)}}),a.a.createElement("span",null,E("I have been issued an invoice from UPS within the past 90 days"))),u&&a.a.createElement("div",{className:"carrier-accounts__settings-ups-invoice"},a.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},a.a.createElement(ze.a,{id:"invoice_number",title:E("UPS invoice number"),value:p("invoice_number"),updateValue:O("invoice_number"),error:r.invoice_number}),a.a.createElement(ze.a,{id:"invoice_date",title:E("UPS invoice date"),value:p("invoice_date"),updateValue:O("invoice_date"),error:r.invoice_date,placeholder:"YYYY-MM-DD"})),a.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},a.a.createElement(ze.a,{id:"invoice_amount",title:E("UPS invoice amount"),value:p("invoice_amount"),updateValue:O("invoice_amount"),error:r.invoice_amount}),a.a.createElement(ze.a,{id:"invoice_currency",title:E("UPS invoice currency"),value:p("invoice_currency"),updateValue:O("invoice_currency"),error:r.invoice_currency})),a.a.createElement(ze.a,{id:"invoice_control_id",title:E("UPS invoice control id"),value:p("invoice_control_id"),updateValue:O("invoice_control_id"),error:r.invoice_control_id}))),a.a.createElement(k.a,{className:"carrier-accounts__settings-actions"},a.a.createElement(S.a,{compact:!0,primary:!0,onClick:function(){e.submitCarrierSettings(l,t,f)},disabled:!c||o,busy:o},E("Connect")),a.a.createElement(S.a,{compact:!0,onClick:function(){e.setVisibilityCancelConnectionDialog(l,t,!0)}},E("Cancel")))),a.a.createElement(Re.a,{isVisible:s,additionalClassNames:"carrier-accounts__settings-cancel-dialog",onClose:_,buttons:[a.a.createElement(S.a,{compact:!0,onClick:_},E("Cancel")),a.a.createElement(S.a,{compact:!0,primary:!0,scary:!0,onClick:function(){return history.back()}},E("Ok"))]},a.a.createElement("div",{className:"carrier-accounts__settings-cancel-dialog-header"},a.a.createElement("h2",{className:"carrier-accounts__settings-cancel-dialog-title"},E("Cancel connection")),a.a.createElement("button",{className:"carrier-accounts__settings-cancel-dialog-close-button",onClick:_},a.a.createElement(q.a,{icon:"cross"}))),a.a.createElement("p",{className:"carrier-accounts__settings-cancel-dialog-description"},E("This action will delete any information entered on the form.")))))};Ye.propTypes={carrier:R.a.string.isRequired};var $e=Object(b.b)(function(e,t){var n=t.siteId,r=t.carrier,a=Ne(e,n,r),i=a.isSaving,c=a.settings,o=c.values,s=c.showCancelConnectionDialog,u=c.showUPSInvoiceFields,l=c.isConnectionSuccess,d=function(e,t,n){var r=Ne(e,t,n).settings,a=r.fieldErrors,i=r.ignoreValidation,c=r.requiredFields,o=r.values;if(Object(P.isEmpty)(o))return{};var s=!0,u=!1,l=void 0;try{for(var d,E=c[Symbol.iterator]();!(s=(d=E.next()).done);s=!0){var f=d.value,m=o[f];!m||"string"===typeof m&&""===m.trim()?a[f]=Object(v.translate)("This field is required"):delete a[f]}}catch(p){u=!0,l=p}finally{try{s||null==E.return||E.return()}finally{if(u)throw l}}return o.email&&!o.email.match(ye)&&(a.email=Object(v.translate)("The email format is not valid")),o.website&&!o.website.match(Pe)&&(a.website=Object(v.translate)("The company website format is not valid")),i&&Object.keys(a).forEach(function(e){i[e]&&delete a[e]}),a}(e,n,r),E=function(e,t,n){var r=Ne(e,t,n).settings,a=r.fieldErrors,i=r.ignoreValidation,c=Object.values(a).every(function(e){return!e}),o=Object.values(i).every(function(e){return!e});return c&&o}(e,n,r),f=Object(Ze.c)(e,n);return f[o.country]||(f=F()(g()({},o.country,Object(Ke.g)(e,o.country,n)),f)),{countryNames:f,fieldErrors:d,isConnectionSuccess:l,isFormValid:E,isSaving:i,showCancelConnectionDialog:s,showUPSInvoiceFields:u,stateNames:Object(Ze.j)(e,o.country,n),values:o}},function(e){return Object(h.b)({setVisibilityCancelConnectionDialog:we,submitCarrierSettings:xe,toggleShowUPSInvoiceFields:De,updateCarrierSettings:ke},e)})(Object(v.localize)(Ye)),Xe=n(673),Je=n(647),et=function(e){function t(e){var n;return c()(this,t),n=l()(this,E()(t).call(this,e)),g()(m()(n),"onChange",function(){n.setState({pristine:!1})}),g()(m()(n),"onSaveSuccess",function(){var e=n.props,t=e.translate,r=e.orderId,a=e.orderHref,i=e.paymentMethodSelected,c=a&&i?{button:t("Return to Order #%(orderId)s",{args:{orderId:r}}),href:a}:{duration:5e3};return n.setState({pristine:!0}),n.props.successNotice(t("Your shipping settings have been saved."),c)}),g()(m()(n),"onSaveFailure",function(){var e=n.props.translate;return n.props.errorNotice(e("Unable to save your shipping settings. Please try again."))}),g()(m()(n),"onPaymentMethodMissing",function(){var e=n.props.translate;return n.props.errorNotice(e("A payment method is required to print shipping labels."),{duration:4e3})}),g()(m()(n),"onSaveChanges",function(){n.props.createWcsShippingSaveActionList(n.onSaveSuccess,n.onSaveFailure)}),n.state={pristine:!0},n}return O()(t,e),s()(t,[{key:"render",value:function(){var e=this.props,t=e.carrier,n=e.carriers,r=e.isSaving,i=e.siteId,c=e.translate;return t?a.a.createElement("div",null,a.a.createElement(I.a,{id:"notices",notices:_e.a.list}),a.a.createElement($e,{carrier:t}),a.a.createElement(Xe.a,{isChanged:!this.state.pristine})):a.a.createElement("div",null,a.a.createElement(I.a,{id:"notices",notices:_e.a.list}),a.a.createElement(Oe,{onChange:this.onChange}),a.a.createElement(Ie,{onChange:this.onChange}),a.a.createElement(Fe,{siteId:i,carriers:n,onChange:this.onChange}),a.a.createElement(S.a,{primary:!0,onClick:this.onSaveChanges,busy:r,disabled:r},c("Save changes")),a.a.createElement(Xe.a,{isChanged:!this.state.pristine}))}}]),t}(r.Component),tt=Object(b.b)(function(e){var t=Object(se.g)(e),n=Object(Ce.e)(e);return{siteId:Object(me.a)(e),isSaving:t.isSaving||n.isSaving,paymentMethodSelected:Boolean(Object(se.n)(e))}},function(e){return Object(h.b)({createWcsShippingSaveActionList:Je.a,errorNotice:Te.a,successNotice:Te.d},e)})(Object(v.localize)(et)),nt=n(652),rt=n(651),at={modalErrors:{},pristine:!0},it={};it[Ae.a]=function(e,t){var n=t.carrier,r=e[n].settings;return F()({},e,g()({},n,{settings:F()({},r,{isConnectionSuccess:!0})}))},it[Ae.g]=function(e,t){var n=t.carrier,r=t.fieldName,a=t.newValue,i=e[n].settings,c=i.ignoreValidation,o=i.values;if(a.target)switch(a.target.type){case"checkbox":a=a.target.checked;break;default:a=a.target.value}var s=F()({},e,g()({},n,{settings:F()({},i,{values:F()({},o,g()({},r,a))})}));return c&&(s[n].settings.ignoreValidation=F()({},c,g()({},r,!1))),s},it[Ae.e]=function(e,t){var n=t.carrier,r=e[n],a=r.isSaving,i=r.settings;return F()({},e,g()({},n,{settings:i,isSaving:!a}))},it[Ae.f]=function(e,t){var n=t.carrier,r=e[n].settings;return F()({},e,g()({},n,{settings:F()({},r,{showUPSInvoiceFields:!r.showUPSInvoiceFields})}))},it[Ae.c]=function(e,t){var n=t.carrier,r=t.show,a=e[n].settings;return F()({},e,g()({},n,{settings:F()({},a,{showCancelConnectionDialog:r})}))},it[Ae.d]=function(e,t){var n=t.carrier,r=t.show,a=e[n];return F()({},e,g()({},n,F()({},a,{showDisconnectDialog:r})))},it[Ae.b]=function(e,t){var n=t.carrier,r=e[n].settings;return F()({},e,g()({},n,{settings:r,disconnected:!0}))};var ct=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:at,t=arguments.length>1?arguments[1]:void 0;return"function"===typeof it[t.type]?it[t.type](e,t):e},ot=function(){var e=["account_number","name","street1","city","state","country","postal_code","phone","email","title","website"];return{UPS:{settings:{requiredFields:e,values:{country:"US",type:"UpsAccount"},fieldErrors:{},ignoreValidation:e.reduce(function(e,t){return e[t]="country"!==t,e},{}),showUPSInvoiceFields:!1},isSaving:!1,showDisconnectDialog:!1}}},st=n(592),ut=n(657),lt=n(633),dt=n(658),Et=n(609),ft=n(116),mt=n(46);t.default=function(e){var t=e.order_id,n=e.order_href,r=e.carrier,i=e.continents,c=e.carriers;return{getReducer:function(){return Object(mt.a)({extensions:Object(mt.a)({woocommerce:Object(mt.a)({woocommerceServices:Object(mt.a)({1:Object(mt.a)({packages:rt.a,labelSettings:nt.a,carrierAccounts:ct})}),sites:Object(mt.a)({1:Object(mt.a)({data:Object(mt.a)({locations:dt.a})})})})}),notices:st.a,ui:function(){return{selectedSiteId:1}}})},getInitialState:function(){return{extensions:{woocommerce:{sites:{1:{data:{locations:i}}},woocommerceServices:{1:{carrierAccounts:ot()}}}}}},getStateForPersisting:function(e){return delete e.notices,e},getStateKey:function(){return"wcs-account-settings"},getMiddlewares:function(){return[Object(ft.b)(Object(Et.a)(lt.a,ut.a))]},View:function(){return a.a.createElement(tt,{orderId:t,orderHref:n,carrier:r,carriers:c})}}}}}]);
|
1 |
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[146,139],{532:function(e,t,n){"use strict";n.d(t,"a",function(){return r});n(1),n(562);function r(e){return e.ui.selectedSiteId}},535:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a}),n.d(t,"d",function(){return i}),n.d(t,"e",function(){return c}),n.d(t,"c",function(){return o}),n.d(t,"f",function(){return s}),n.d(t,"h",function(){return u}),n.d(t,"g",function(){return l}),n.d(t,"j",function(){return d}),n.d(t,"i",function(){return E}),n.d(t,"k",function(){return f}),n.d(t,"l",function(){return m}),n.d(t,"p",function(){return p}),n.d(t,"q",function(){return O}),n.d(t,"r",function(){return _}),n.d(t,"s",function(){return g}),n.d(t,"t",function(){return b}),n.d(t,"u",function(){return h}),n.d(t,"y",function(){return v}),n.d(t,"z",function(){return C}),n.d(t,"A",function(){return S}),n.d(t,"v",function(){return I}),n.d(t,"w",function(){return j}),n.d(t,"x",function(){return R}),n.d(t,"C",function(){return N}),n.d(t,"E",function(){return y}),n.d(t,"D",function(){return P}),n.d(t,"B",function(){return M}),n.d(t,"F",function(){return T}),n.d(t,"G",function(){return A}),n.d(t,"H",function(){return k}),n.d(t,"I",function(){return L}),n.d(t,"J",function(){return D}),n.d(t,"K",function(){return w}),n.d(t,"m",function(){return W}),n.d(t,"n",function(){return U}),n.d(t,"o",function(){return x}),n.d(t,"L",function(){return G}),n.d(t,"M",function(){return V}),n.d(t,"N",function(){return H}),n.d(t,"O",function(){return F}),n.d(t,"P",function(){return B}),n.d(t,"Q",function(){return q}),n.d(t,"R",function(){return z}),n.d(t,"S",function(){return Z}),n.d(t,"T",function(){return K}),n.d(t,"W",function(){return Q}),n.d(t,"X",function(){return Y}),n.d(t,"U",function(){return $}),n.d(t,"V",function(){return X}),n.d(t,"ab",function(){return J}),n.d(t,"bb",function(){return ee}),n.d(t,"Y",function(){return te}),n.d(t,"Z",function(){return ne}),n.d(t,"gb",function(){return re}),n.d(t,"hb",function(){return ae}),n.d(t,"ib",function(){return ie}),n.d(t,"jb",function(){return ce}),n.d(t,"kb",function(){return oe}),n.d(t,"lb",function(){return se}),n.d(t,"mb",function(){return ue}),n.d(t,"nb",function(){return le}),n.d(t,"ob",function(){return de}),n.d(t,"pb",function(){return Ee}),n.d(t,"qb",function(){return fe}),n.d(t,"rb",function(){return me}),n.d(t,"sb",function(){return pe}),n.d(t,"tb",function(){return Oe}),n.d(t,"ub",function(){return _e}),n.d(t,"vb",function(){return ge}),n.d(t,"wb",function(){return be}),n.d(t,"xb",function(){return he}),n.d(t,"yb",function(){return ve}),n.d(t,"zb",function(){return Ce}),n.d(t,"Bb",function(){return Se}),n.d(t,"Ab",function(){return Ie}),n.d(t,"Cb",function(){return je}),n.d(t,"Db",function(){return Re}),n.d(t,"Eb",function(){return Ne}),n.d(t,"Fb",function(){return ye}),n.d(t,"Gb",function(){return Pe}),n.d(t,"Hb",function(){return Me}),n.d(t,"Ib",function(){return Te}),n.d(t,"Jb",function(){return Ae}),n.d(t,"Kb",function(){return ke}),n.d(t,"Lb",function(){return Le}),n.d(t,"Mb",function(){return De}),n.d(t,"Nb",function(){return we}),n.d(t,"Ob",function(){return We}),n.d(t,"Pb",function(){return Ue}),n.d(t,"Qb",function(){return xe}),n.d(t,"Rb",function(){return Ge}),n.d(t,"Sb",function(){return Ve}),n.d(t,"eb",function(){return He}),n.d(t,"fb",function(){return Fe}),n.d(t,"cb",function(){return Be}),n.d(t,"db",function(){return qe});var r="WOOCOMMERCE_ACTION_LIST_ANNOTATE",a="WOOCOMMERCE_ACTION_LIST_CLEAR",i="WOOCOMMERCE_ACTION_LIST_STEP_NEXT",c="WOOCOMMERCE_ACTION_LIST_STEP_SUCCESS",o="WOOCOMMERCE_ACTION_LIST_STEP_FAILURE",s="WOOCOMMERCE_COUNT_REQUEST",u="WOOCOMMERCE_COUNT_REQUEST_SUCCESS",l="WOOCOMMERCE_COUNT_REQUEST_FAILURE",d="WOOCOMMERCE_ERROR_SET",E="WOOCOMMERCE_ERROR_CLEAR",f="WOOCOMMERCE_LOCATIONS_REQUEST",m="WOOCOMMERCE_LOCATIONS_REQUEST_SUCCESS",p="WOOCOMMERCE_ORDER_DELETE",O="WOOCOMMERCE_ORDER_DELETE_FAILURE",_="WOOCOMMERCE_ORDER_DELETE_SUCCESS",g="WOOCOMMERCE_ORDER_INVOICE_SEND",b="WOOCOMMERCE_ORDER_INVOICE_SEND_FAILURE",h="WOOCOMMERCE_ORDER_INVOICE_SEND_SUCCESS",v="WOOCOMMERCE_ORDER_NOTE_CREATE",C="WOOCOMMERCE_ORDER_NOTE_CREATE_FAILURE",S="WOOCOMMERCE_ORDER_NOTE_CREATE_SUCCESS",I="WOOCOMMERCE_ORDER_NOTES_REQUEST",j="WOOCOMMERCE_ORDER_NOTES_REQUEST_FAILURE",R="WOOCOMMERCE_ORDER_NOTES_REQUEST_SUCCESS",N="WOOCOMMERCE_ORDER_REFUND_CREATE",y="WOOCOMMERCE_ORDER_REFUND_CREATE_SUCCESS",P="WOOCOMMERCE_ORDER_REFUND_CREATE_FAILURE",M="WOOCOMMERCE_ORDER_REFUNDS_REQUEST_SUCCESS",T="WOOCOMMERCE_ORDER_REQUEST",A="WOOCOMMERCE_ORDER_REQUEST_FAILURE",k="WOOCOMMERCE_ORDER_REQUEST_SUCCESS",L="WOOCOMMERCE_ORDER_UPDATE",D="WOOCOMMERCE_ORDER_UPDATE_FAILURE",w="WOOCOMMERCE_ORDER_UPDATE_SUCCESS",W="WOOCOMMERCE_ORDERS_REQUEST",U="WOOCOMMERCE_ORDERS_REQUEST_FAILURE",x="WOOCOMMERCE_ORDERS_REQUEST_SUCCESS",G="WOOCOMMERCE_SERVICES_SHIPPING_ACTION_LIST_CREATE",V="WOOCOMMERCE_SETTINGS_PRODUCTS_CHANGE_SETTING",H="WOOCOMMERCE_SETTINGS_PRODUCTS_REQUEST",F="WOOCOMMERCE_SETTINGS_PRODUCTS_REQUEST_SUCCESS",B="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST",q="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST_FAILURE",z="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST_SUCCESS",Z="WOOCOMMERCE_SETTINGS_STRIPE_CONNECT_ACCOUNT_CLEAR_COMPLETED_NOTIFICATION",K="WOOCOMMERCE_SETTINGS_STRIPE_CONNECT_ACCOUNT_CLEAR_ERROR",Q="WOOCOMMERCE_SETTINGS_STRIPE_CONNECT_ACCOUNT_DETAILS_REQUEST",Y="WOOCOMMERCE_SETTINGS_STRIPE_CONNECT_ACCOUNT_DETAILS_UPDATE",$="WOOCOMMERCE_SETTINGS_STRIPE_CONNECT_ACCOUNT_DEAUTHORIZE",X="WOOCOMMERCE_SETTINGS_STRIPE_CONNECT_ACCOUNT_DEAUTHORIZE_COMPLETE",J="WOOCOMMERCE_SETTINGS_STRIPE_CONNECT_ACCOUNT_DEAUTHORIZE_OAUTH_INIT",ee="WOOCOMMERCE_SETTINGS_STRIPE_CONNECT_ACCOUNT_OAUTH_INIT_COMPLETE",te="WOOCOMMERCE_SETTINGS_STRIPE_CONNECT_ACCOUNT_OAUTH_CONNECT",ne="WOOCOMMERCE_SETTINGS_STRIPE_CONNECT_ACCOUNT_OAUTH_CONNECT_COMPLETE",re="WOOCOMMERCE_SHIPPING_ZONE_ADD",ae="WOOCOMMERCE_SHIPPING_ZONE_CANCEL",ie="WOOCOMMERCE_SHIPPING_ZONE_CLOSE",ce="WOOCOMMERCE_SHIPPING_ZONE_DELETED",oe="WOOCOMMERCE_SHIPPING_ZONE_EDIT_NAME",se="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_CANCEL",ue="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_CLOSE",le="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_EDIT",de="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_EDIT_POSTCODE",Ee="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_POSTCODE",fe="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_STATE",me="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_WHOLE_COUNTRY",pe="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_CONTINENT",Oe="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_COUNTRY",_e="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_STATE",ge="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_UPDATED",be="WOOCOMMERCE_SHIPPING_ZONE_METHODS_REQUEST",he="WOOCOMMERCE_SHIPPING_ZONE_METHODS_REQUEST_SUCCESS",ve="WOOCOMMERCE_SHIPPING_ZONE_METHOD_ADD",Ce="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CANCEL",Se="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CLOSE",Ie="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CHANGE_TYPE",je="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CREATE",Re="WOOCOMMERCE_SHIPPING_ZONE_METHOD_DELETE",Ne="WOOCOMMERCE_SHIPPING_ZONE_METHOD_DELETED",ye="WOOCOMMERCE_SHIPPING_ZONE_METHOD_EDIT_TITLE",Pe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_OPEN",Me="WOOCOMMERCE_SHIPPING_ZONE_METHOD_REMOVE",Te="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_CONDITION",Ae="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_COST",ke="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_MIN_COST",Le="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_TAXABLE",De="WOOCOMMERCE_SHIPPING_ZONE_METHOD_TOGGLE_ENABLED",we="WOOCOMMERCE_SHIPPING_ZONE_METHOD_TOGGLE_OPENED_ENABLED",We="WOOCOMMERCE_SHIPPING_ZONE_METHOD_UPDATE",Ue="WOOCOMMERCE_SHIPPING_ZONE_METHOD_UPDATED",xe="WOOCOMMERCE_SHIPPING_ZONE_OPEN",Ge="WOOCOMMERCE_SHIPPING_ZONE_REMOVE",Ve="WOOCOMMERCE_SHIPPING_ZONE_UPDATED",He="WOOCOMMERCE_SHIPPING_ZONES_REQUEST",Fe="WOOCOMMERCE_SHIPPING_ZONES_REQUEST_SUCCESS",Be="WOOCOMMERCE_SHIPPING_CLASSES_REQUEST",qe="WOOCOMMERCE_SHIPPING_CLASSES_REQUEST_SUCCESS"},537:function(e,t,n){"use strict";n.d(t,"i",function(){return m}),n.d(t,"s",function(){return p}),n.d(t,"r",function(){return O}),n.d(t,"q",function(){return _}),n.d(t,"g",function(){return g}),n.d(t,"u",function(){return b}),n.d(t,"t",function(){return h}),n.d(t,"l",function(){return v}),n.d(t,"e",function(){return C}),n.d(t,"k",function(){return S}),n.d(t,"o",function(){return I}),n.d(t,"m",function(){return y}),n.d(t,"f",function(){return T}),n.d(t,"n",function(){return A}),n.d(t,"p",function(){return k}),n.d(t,"d",function(){return L}),n.d(t,"b",function(){return D}),n.d(t,"h",function(){return w}),n.d(t,"c",function(){return W}),n.d(t,"j",function(){return U}),n.d(t,"a",function(){return x});var r=n(1),a=n(35),i=n(544),c=n(532),o=n(552),s=n(543),u=n(541),l=n(565),d=n(575),E=n(563),f=n(566),m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",n,"shippingLabel",t],null)},p=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=m(e,t,n);return r&&r.loaded},O=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=m(e,t,n);return r&&r.isFetching},_=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=m(e,t,n);return r&&r.error},g=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=m(e,t,n);return r&&r.loaded?r.labels:[]},b=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=m(e,t,n);return r&&r.fulfillOrder},h=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=m(e,t,n);return r&&r.emailDetails},v=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=m(e,t,n);return r&&r.refreshedLabelStatus},C=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=m(e,t,n);return r&&r.form},S=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),i=C(e,t,n);if(!i)return null;var o=i.rates,s=o.values,u=o.available,l=[],d=0,E=0,f=function(e){if(!(e in u))return"continue";var t=s[e],n=t.serviceId,i=t.signatureRequired,c=u[e].default.rates,o=null,f=null;i in u[e]&&(o=u[e][i].rates,f=Object(r.find)(o,function(e){return n===e.service_id})||null);var m=Object(r.find)(c,function(e){return n===e.service_id});if(m){var p=m.retail_rate-m.rate,O=m.rate,_={title:m.title,retailRate:m.retail_rate,rateWithDiscount:O,addons:[],carrierId:m.carrier_id,carrierTitle:m.title.split("-")[0].trim()};null!==f&&(_.addons=[{title:Object(a.translate)("Signature Required"),rate:f.rate-m.rate}],O=f.rate),l.push(_),d+=Object(r.round)(p,2),E+=O}};for(var m in s)f(m);return l.length?{prices:l,discount:d,total:E}:null},I=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=C(e,t,n);if(Object(r.isEmpty)(a))return!1;var i=Object(l.a)(a.origin),o=Object(l.a)(a.destination);return!("US"!==i.country||!Object(r.includes)(d.d,i.state))||(!("US"!==o.country||!Object(r.includes)(d.d,o.state))||i.country!==o.country&&(!Object(r.includes)(d.b,i.country)||!Object(r.includes)(d.b,o.country)))},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);return[C(e,t,n)]}),j=function(e,t,n,i){var c=t.values,o=Object(l.a)(t),s=o.phone,u=o.postcode,f=o.state,m=o.country,p={};return["name","address","city","postcode","country"].forEach(function(e){c[e]||(p[e]=Object(a.translate)("This field is required"))}),Object(r.includes)(d.a,m)&&!/^\d{5}(?:-\d{4})?$/.test(u)&&(p.postcode=Object(a.translate)("Invalid ZIP/Postal code format")),!f&&Object(E.j)(e,m,n)&&(p.state=Object(a.translate)("This field is required")),i&&(s?10!==s.split(/\D+/g).join("").replace(/^1/,"").length&&(p.phone=Object(a.translate)("Customs forms require a 10-digit phone number. Please edit your phone number so it has at most 10 digits.")):p.phone=Object(a.translate)("Please enter a phone number for your origin address. It's required because this shipment requires a customs form.")),p},R=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=e.isNormalized,c=e.isUnverifiable,o=e.normalized,s=e.ignoreValidation,u=e.fieldErrors;if((i||c)&&!o&&u)return u;if(i&&!o)return{address:Object(a.translate)("This address is not recognized. Please try another.")};var l=j(t,e,n,r);return s&&Object.keys(l).forEach(function(e){s[e]&&delete l[e]}),l},N=function(e,t,n,i){var c=Object(r.uniq)(Object(r.flatten)(Object(r.map)(e,function(e){return Object(r.map)(e.items,"product_id")}))),o=Object(r.zipObject)(c,Object(r.fill)(Array(c.length),0));Object(r.forEach)(e,function(e){Object(r.forEach)(e.items,function(e){var n=e.quantity,r=e.product_id;return o[r]+=n*t.items[r].value})});var s={};return Object(r.forEach)(Object(r.pick)(t.items,c),function(e,t){e.tariffNumber&&6===e.tariffNumber.length&&(s[e.tariffNumber]||(s[e.tariffNumber]=0),s[e.tariffNumber]+=o[t])}),{packages:Object(r.mapValues)(e,function(e){var c={};"other"!==e.contentsType||e.contentsExplanation||(c.contentsExplanation=Object(a.translate)("Please describe what kind of goods this package contains")),"other"!==e.restrictionType||e.restrictionComments||(c.restrictionComments=Object(a.translate)("Please describe what kind of restrictions this package must have"));var o=new Set;return Object(r.forEach)(e.items,function(e){var n=e.product_id,r=t.items[n].tariffNumber;2500<s[r]&&o.add(r)}),e.itn?/^(?:(?:AES X\d{14})|(?:NOEEI 30\.\d{1,2}(?:\([a-z]\)(?:\(\d\))?)?))$/.test(e.itn)||(c.itn=Object(a.translate)("Invalid format")):"CA"!==n&&(Object(r.isEmpty)(o)?Object(r.includes)(d.c,n)&&(c.itn=Object(a.translate)("International Transaction Number is required for shipments to %(country)s",{args:{country:i}})):c.itn=Object(a.translate)("International Transaction Number is required for shipping items valued over $2,500 per tariff number. Products with tariff number %(code)s add up to more than $2,500.",{args:{code:o.values().next().value}})),c}),items:Object(r.mapValues)(Object(r.pick)(t.items,c),function(e,n){var i={};return e.description||(i.description=Object(a.translate)("This field is required")),t.ignoreWeightValidation[n]||(Object(r.isNil)(e.weight)||""===e.weight?i.weight=Object(a.translate)("This field is required"):parseFloat(e.weight)>0||(i.weight=Object(a.translate)("Weight must be greater than zero"))),t.ignoreValueValidation[n]||(Object(r.isNil)(e.value)||""===e.value?i.value=Object(a.translate)("This field is required"):parseFloat(e.value)>0||(i.value=Object(a.translate)("Declared value must be greater than zero"))),e.tariffNumber&&6!==e.tariffNumber.length&&(i.tariffNumber=Object(a.translate)("The tariff number must be 6 digits long")),i})}},y=function(e){var t=e.values,n=e.available,a=Object(r.map)(n,function(e,n){return t[n]});return!Object(r.isEmpty)(a)&&Object(r.every)(a)},P=function(e){var t=e.values,n=e.available;return Object(r.mapValues)(n,function(e,n){if(!Object(r.isEmpty)(e.default.errors)){var i=e.default.errors.map(function(e){return e.userMessage||e.message}).filter(Boolean);return i.length?i:["We couldn't get a rate for this package, please try again."]}return t[n]&&t[n].serviceId?[]:Object(r.isEmpty)(e.default.rates)?[Object(a.translate)("No rates available, please double check dimensions and weight or try using different packaging.")]:[Object(a.translate)("Please choose a rate")]})},M=function(e){var t={};return e||(t.paperSize=Object(a.translate)("This field is required")),t},T=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);if(!p(e,t,n))return{};var i=m(e,t,n),o=i.form,s=i.paperSize;if(Object(r.isEmpty)(o))return{};var u,l=o.destination.values.country,d=Object(E.g)(e,l,n),f=I(e,t,n);return{origin:R(o.origin,e,n,f),destination:R(o.destination,e,n),packages:(u=o.packages.selected,Object(r.mapValues)(u,function(e){var t={};"not_selected"===e.box_id&&(t.box_id=Object(a.translate)("Please select a package"));var n=function(e){return!Object(r.isFinite)(e)||0>=e};return n(e.weight)&&(t.weight=Object(a.translate)("Invalid weight")),Object(r.some)([e.length,e.width,e.height],n)&&(t.dimensions=Object(a.translate)("Package dimensions must be greater than zero")),t})),customs:N(o.packages.selected,o.customs,l,d),rates:P(o.rates),sidebar:M(s)}},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);return[m(e,t,n)]}),A=Object(i.a)(function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(c.a)(e),a=m(e,t,r).form,i="origin"===n&&I(e,t,r),o=j(e,a[n],r,i);return 0===Object.keys(o).length},function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(c.a)(e);return[m(e,t,r).form[n]]}),k=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=C(e,t,n);if(!a)return!1;var i=Object(r.uniq)(Object(r.flatten)(Object(r.map)(a.packages.selected,function(e){return Object(r.map)(e.items,"product_id")})));return!Object(r.some)(i.map(function(e){return Object(r.isNil)(a.customs.items[e].tariffNumber)||a.customs.ignoreWeightValidation[e]||a.customs.ignoreValueValidation[e]}))},L=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=C(e,t,n);if(!a)return null;var i=T(e,t,n);return a.origin.isNormalized&&Object(r.isEqual)(a.origin.values,a.origin.normalized)&&!Object(o.a)(i.origin)?a.destination.isNormalized&&Object(r.isEqual)(a.destination.values,a.destination.normalized)&&!Object(o.a)(i.destination)?Object(o.a)(i.packages)?"packages":!I(e,t,n)||!Object(o.a)(i.customs)&&k(e,t,n)?Object(o.a)(i.rates)?"rates":null:"customs":"destination":"origin"},D=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=C(e,t,n);return!Object(r.isEmpty)(a)&&!L(e,t,n)&&!a.origin.normalizationInProgress&&!a.destination.normalizationInProgress&&!a.rates.retrievalInProgress&&!Object(r.isEmpty)(a.rates.available)},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);return[C(e,t,n),L(e,t,n)]}),w=Object(i.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(c.a)(e),n=Object(E.d)(e,t);return Object(f.b)(e,t)?Object(r.pick)(n,d.a):Object(r.pick)(n,d.b)},[E.d,f.b]),W=Object(i.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(c.a)(e),n=Object(E.d)(e,t);return Object(f.b)(e,t)?n:Object(r.pick)(n,d.b)},[E.d,f.b]),U=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);if(!Object(E.j)(e,t,n))return null;var a=Object(E.i)(e,t,n),i={};return a.forEach(function(e){var t=e.code,n=e.name;return i[t]=n}),"US"!==t||Object(f.b)(e,n)?i:Object(r.omit)(i,d.d)},[E.i,f.b]),x=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);return p(e,t,n)&&Object(s.d)(e,n)&&Object(u.i)(e,n)&&Object(E.b)(e,n)}},538:function(e,t,n){"use strict";n.d(t,"i",function(){return r}),n.d(t,"k",function(){return a}),n.d(t,"l",function(){return i}),n.d(t,"m",function(){return c}),n.d(t,"j",function(){return o}),n.d(t,"h",function(){return s}),n.d(t,"n",function(){return u}),n.d(t,"o",function(){return l}),n.d(t,"p",function(){return d}),n.d(t,"q",function(){return E}),n.d(t,"r",function(){return f}),n.d(t,"s",function(){return m}),n.d(t,"t",function(){return p}),n.d(t,"u",function(){return O}),n.d(t,"v",function(){return _}),n.d(t,"x",function(){return g}),n.d(t,"w",function(){return b}),n.d(t,"y",function(){return h}),n.d(t,"z",function(){return v}),n.d(t,"A",function(){return C}),n.d(t,"B",function(){return S}),n.d(t,"C",function(){return I}),n.d(t,"D",function(){return j}),n.d(t,"I",function(){return R}),n.d(t,"E",function(){return N}),n.d(t,"J",function(){return y}),n.d(t,"G",function(){return P}),n.d(t,"H",function(){return M}),n.d(t,"K",function(){return T}),n.d(t,"L",function(){return A}),n.d(t,"M",function(){return k}),n.d(t,"N",function(){return L}),n.d(t,"O",function(){return D}),n.d(t,"P",function(){return w}),n.d(t,"Q",function(){return W}),n.d(t,"R",function(){return U}),n.d(t,"S",function(){return x}),n.d(t,"T",function(){return G}),n.d(t,"U",function(){return V}),n.d(t,"F",function(){return H}),n.d(t,"V",function(){return F}),n.d(t,"W",function(){return B}),n.d(t,"X",function(){return q}),n.d(t,"Y",function(){return z}),n.d(t,"Z",function(){return Z}),n.d(t,"ab",function(){return K}),n.d(t,"bb",function(){return Q}),n.d(t,"Vb",function(){return Y}),n.d(t,"cb",function(){return $}),n.d(t,"db",function(){return X}),n.d(t,"eb",function(){return J}),n.d(t,"fb",function(){return ee}),n.d(t,"gb",function(){return te}),n.d(t,"hb",function(){return ne}),n.d(t,"ib",function(){return re}),n.d(t,"jb",function(){return ae}),n.d(t,"kb",function(){return ie}),n.d(t,"lb",function(){return ce}),n.d(t,"mb",function(){return oe}),n.d(t,"nb",function(){return se}),n.d(t,"ob",function(){return ue}),n.d(t,"pb",function(){return le}),n.d(t,"qb",function(){return de}),n.d(t,"rb",function(){return Ee}),n.d(t,"sb",function(){return fe}),n.d(t,"ub",function(){return me}),n.d(t,"tb",function(){return pe}),n.d(t,"vb",function(){return Oe}),n.d(t,"wb",function(){return _e}),n.d(t,"xb",function(){return ge}),n.d(t,"yb",function(){return be}),n.d(t,"zb",function(){return he}),n.d(t,"Ab",function(){return ve}),n.d(t,"Bb",function(){return Ce}),n.d(t,"Cb",function(){return Se}),n.d(t,"Db",function(){return Ie}),n.d(t,"Eb",function(){return je}),n.d(t,"Gb",function(){return Re}),n.d(t,"Hb",function(){return Ne}),n.d(t,"Ib",function(){return ye}),n.d(t,"Jb",function(){return Pe}),n.d(t,"Kb",function(){return Me}),n.d(t,"Lb",function(){return Te}),n.d(t,"Mb",function(){return Ae}),n.d(t,"Nb",function(){return ke}),n.d(t,"Ob",function(){return Le}),n.d(t,"Pb",function(){return De}),n.d(t,"Qb",function(){return we}),n.d(t,"Fb",function(){return We}),n.d(t,"Sb",function(){return Ue}),n.d(t,"Rb",function(){return xe}),n.d(t,"Tb",function(){return Ge}),n.d(t,"Ub",function(){return Ve}),n.d(t,"Wb",function(){return He}),n.d(t,"Xb",function(){return Fe}),n.d(t,"Yb",function(){return Be}),n.d(t,"a",function(){return qe}),n.d(t,"g",function(){return ze}),n.d(t,"e",function(){return Ze}),n.d(t,"f",function(){return Ke}),n.d(t,"c",function(){return Qe}),n.d(t,"d",function(){return Ye}),n.d(t,"b",function(){return $e});var r="WOOCOMMERCE_SERVICES_LABELS_INIT_FORM",a="WOOCOMMERCE_SERVICES_LABELS_RESTORE_PRISTINE",i="WOOCOMMERCE_SERVICES_LABELS_SET_FORM_DATA_VALUE",c="WOOCOMMERCE_SERVICES_LABELS_SET_FORM_META_PROPERTY",o="WOOCOMMERCE_SERVICES_LABELS_OPEN_ADD_CARD_DIALOG",s="WOOCOMMERCE_SERVICES_LABELS_CLOSE_ADD_CARD_DIALOG",u="WOOCOMMERCE_SERVICES_PACKAGES_ADD_PACKAGE",l="WOOCOMMERCE_SERVICES_PACKAGES_DISMISS_MODAL",d="WOOCOMMERCE_SERVICES_PACKAGES_EDIT_PACKAGE",E="WOOCOMMERCE_SERVICES_PACKAGES_INIT_PACKAGES_FORM",f="WOOCOMMERCE_SERVICES_PACKAGES_REMOVE_PACKAGE",m="WOOCOMMERCE_SERVICES_PACKAGES_REMOVE_PREDEFINED",p="WOOCOMMERCE_SERVICES_PACKAGES_SAVE_PACKAGE",O="WOOCOMMERCE_SERVICES_PACKAGES_SAVE_PREDEFINED",_="WOOCOMMERCE_SERVICES_PACKAGES_SET_ADD_MODE",g="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_FETCH_ERROR",b="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_FETCHING",h="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_SAVING",v="WOOCOMMERCE_SERVICES_PACKAGES_SET_MODAL_ERROR",C="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_ALL_PREDEFINED",S="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_OUTER_DIMENSIONS",I="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_PREDEFINED",j="WOOCOMMERCE_SERVICES_PACKAGES_UPDATE_PACKAGES_FIELD",R="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADD_ITEMS",N="WOOCOMMERCE_SERVICES_SERVICE_SETTINGS_UPDATE_FIELD",y="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADD_PACKAGE",P="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADDRESS_NORMALIZATION_COMPLETED",M="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADDRESS_NORMALIZATION_IN_PROGRESS",T="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLEAR_AVAILABLE_RATES",A="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_ADD_ITEM",k="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_DETAILS_DIALOG",L="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_ITEM_MOVE",D="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_REFUND_DIALOG",w="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_REPRINT_DIALOG",W="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CONFIRM_ADDRESS_SUGGESTION",U="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CONFIRM_REPRINT",x="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EDIT_ADDRESS",G="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EDIT_UNVERIFIABLE_ADDRESS",V="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EXIT_PRINTING_FLOW",H="WOOCOMMERCE_SERVICES_SHIPPING_EXIT_TRACKING_FLOW",F="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_INIT",B="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_MOVE_ITEM",q="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_ADD_ITEM",z="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_DETAILS_DIALOG",Z="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_ITEM_MOVE",K="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_PACKAGE",Q="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_PRINTING_FLOW",Y="WOOCOMMERCE_SERVICES_SHIPPING_OPEN_TRACKING_FLOW",$="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_REFUND_DIALOG",X="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_REPRINT_DIALOG",J="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_PURCHASE_REQUEST",ee="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_PURCHASE_RESPONSE",te="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_RATES_RETRIEVAL_COMPLETED",ne="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_RATES_RETRIEVAL_IN_PROGRESS",re="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REFUND_REQUEST",ae="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REFUND_RESPONSE",ie="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REMOVE_IGNORE_VALIDATION",ce="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REMOVE_PACKAGE",oe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REPRINT_DIALOG_ERROR",se="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REPRINT_DIALOG_READY",ue="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SAVE_CUSTOMS",le="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SAVE_PACKAGES",de="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SELECT_NORMALIZED_ADDRESS",Ee="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ABANDON_ON_NON_DELIVERY",fe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ADDED_ITEM",me="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CONTENTS_TYPE",pe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CONTENTS_EXPLANATION",Oe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_DESCRIPTION",_e="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_ORIGIN_COUNTRY",ge="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_TARIFF_NUMBER",be="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_VALUE",he="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_WEIGHT",ve="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_EMAIL_DETAILS",Ce="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_FETCH_ERROR",Se="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_FULFILL_ORDER",Ie="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_IS_FETCHING",je="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ITN",Re="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_PACKAGE_TYPE",Ne="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RATES",ye="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RESTRICTION_COMMENTS",Pe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RESTRICTION_TYPE",Me="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_TARGET_PACKAGE",Te="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SHOW_PRINT_CONFIRMATION",Ae="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_STATUS_RESPONSE",ke="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_STATUS_RETRIEVAL_IN_PROGRESS",Le="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_TOGGLE_STEP",De="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_ADDRESS_VALUE",we="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_PACKAGE_WEIGHT",We="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_PACKAGE_SIGNATURE",Ue="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_RATE",xe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_PAPER_SIZE",Ge="WOOCOMMERCE_SERVICES_SHIPPING_METHOD_SCHEMA_REQUEST",Ve="WOOCOMMERCE_SERVICES_SHIPPING_METHOD_SCHEMA_REQUEST_SUCCESS",He="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_SETTINGS_REQUEST",Fe="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_SETTINGS_REQUEST_SUCCESS",Be="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_UPDATE",qe="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_CONNECTION_SUCCESS",ze="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_UPDATE_SETTINGS",Ze="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_TOGGLE_IS_SAVING",Ke="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_TOGGLE_SHOW_UPS_INVOICE_FIELDS",Qe="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_ENABLE_CANCEL_CONNECTION_DIALOG",Ye="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_ENABLE_DISCONNECT_DIALOG",$e="WOOCOMMERCE_SERVICES_CARRIER_ACCOUNTS_DISCONNECT_CARRIER"},539:function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"a",function(){return a});var r="LOADING",a="ERROR"},541:function(e,t,n){"use strict";n.d(t,"e",function(){return m}),n.d(t,"b",function(){return O}),n.d(t,"d",function(){return _}),n.d(t,"a",function(){return g}),n.d(t,"c",function(){return b}),n.d(t,"f",function(){return h}),n.d(t,"i",function(){return v}),n.d(t,"h",function(){return C}),n.d(t,"g",function(){return S});var r=n(110),a=n.n(r),i=n(36),c=n.n(i),o=n(1),s=n(35),u=n(544),l=n(532),d=n(575),E=n(565),f=n(537),m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e);return Object(o.get)(e,["extensions","woocommerce","woocommerceServices",t,"packages"],null)},p=function(e){return e&&e.predefinedSchema?Object.keys(e.predefinedSchema):[]},O=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=m(e,t);if(!n||!n.predefinedSchema||!n.packages)return null;var r=[];Object(o.forEach)(n.predefinedSchema,function(e,t){var a=(n.packages.predefined||{})[t]||[];Object(o.forEach)(e,function(e){var n=e.definitions;Object(o.forEach)(n,function(e){Object(o.includes)(a,e.id)&&r.push(c()({},e,{serviceId:t}))})})});var a=(n.packages.custom||[]).map(function(e,t){return c()({},e,{index:t})});return Object(o.orderBy)(r.concat(a),"name")},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=m(e,t);if(!n||!n.packages)return[];var r=p(n);return[].concat(a()(n.packages.custom||[]),a()(r.map(function(e){return(n.packages.predefined||{})[e]})))}),_=Object(u.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(l.a)(e),r=m(e,n);if(!r||!r.predefinedSchema||!r.packages)return null;var a=Object(f.e)(e,t,n),i=Object(E.a)(a.origin).country,c=Object(E.a)(a.destination).country,u=d.a.includes(i)&&!d.a.includes(c),p={custom:{title:Object(s.translate)("Custom Packages"),definitions:r.packages.custom}};return Object(o.forEach)(r.predefinedSchema,function(e,t){var n=(r.packages.predefined||{})[t]||[];Object(o.forEach)(e,function(e,t){var r=e.definitions,a={title:e.title,definitions:[]};Object(o.forEach)(r,function(e){u&&!1===e.can_ship_international||Object(o.includes)(n,e.id)&&a.definitions.push(e)}),a.definitions.length&&(p[t]=a)})}),p},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(l.a)(e),r=m(e,n);if(!r||!r.packages)return[];var i=p(r),c=Object(f.e)(e,t,n),o=Object(E.a)(c.origin).country,s=Object(E.a)(c.destination).country;return[].concat(a()(r.packages.custom||[]),a()(i.map(function(e){return(r.packages.predefined||{})[e]})),[o,s])}),g=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=m(e,t);if(!n||!n.predefinedSchema||!n.packages)return null;var r={};return Object(o.forEach)(n.packages.custom,function(e){r[e.name]=e}),Object(o.forEach)(n.predefinedSchema,function(e){Object(o.forEach)(e,function(e){var t=e.definitions;Object(o.forEach)(t,function(e){r[e.id]=e})})}),r},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=m(e,t);if(!n||!n.packages)return[];var r=p(n);return[].concat(a()(n.packages.custom||[]),a()(r.map(function(e){return(n.packages.predefined||{})[e]})))}),b=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=m(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return null;var r={},a=n.predefinedSchema,i=n.currentlyEditingPredefinedPackages;return Object(o.forEach)(a,function(e,t){var n=i[t]||[];Object(o.forEach)(e,function(e,a){var i={groupId:a,serviceId:t,title:e.title,packages:[],total:e.definitions.length,selected:0};Object(o.forEach)(e.definitions,function(e){var r=Object(o.includes)(n,e.id);r&&i.selected++,i.packages.push(c()({},e,{selected:r,serviceId:t}))}),r["".concat(t,"-").concat(a)]=i})}),r},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=m(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return[];var r=p(n);return a()(r.map(function(e){return n.currentlyEditingPredefinedPackages[e]}))}),h=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=0,r=0,a=m(e,t);if(!a||!a.currentlyEditingPredefinedPackages)return{added:n,removed:r};var i=a.packages&&a.packages.predefined?a.packages.predefined:{},c=a.currentlyEditingPredefinedPackages;return Object.keys(c).forEach(function(e){var t=i[e],r=c[e];t?r.forEach(function(e){Object(o.includes)(t,e)||n++}):n+=r.length}),Object.keys(i).forEach(function(e){var t=i[e],n=c[e];n?t.forEach(function(e){Object(o.includes)(n,e)||r++}):r+=t.length}),{added:n,removed:r}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=m(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return[];var r=p(n);return[].concat(a()(r.map(function(e){return n.packages&&n.packages.predefined&&n.packages.predefined[e]})),a()(r.map(function(e){return n.currentlyEditingPredefinedPackages[e]})))}),v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=m(e,t);return n&&n.isLoaded},C=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=m(e,t);return n&&n.isFetching},S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=m(e,t);return n&&n.isFetchError}},542:function(e,t,n){"use strict";n.d(t,"a",function(){return j});var r=n(530),a=n.n(r),i=n(533),c=n.n(i),o=n(107),s=n.n(o),u=n(108),l=n.n(u),d=n(528),E=n.n(d),f=n(527),m=n.n(f),p=n(529),O=n.n(p),_=n(34),g=n.n(_),b=n(10),h=n.n(b),v=n(12),C=n.n(v),S=n(526),I=n.n(S),j=function(e){function t(){return s()(this,t),E()(this,m()(t).apply(this,arguments))}return O()(t,e),l()(t,[{key:"render",value:function(){var e=I()("button",this.props.className,{"is-compact":this.props.compact,"is-primary":this.props.primary,"is-scary":this.props.scary,"is-busy":this.props.busy,"is-borderless":this.props.borderless});if(this.props.href){var t=this.props,n=(t.compact,t.primary,t.scary,t.busy,t.borderless,t.type,c()(t,["compact","primary","scary","busy","borderless","type"])),r=n.target?(n.rel||"").replace(/noopener|noreferrer/g,"")+" noopener noreferrer":n.rel;return h.a.createElement("a",a()({},n,{rel:r,className:e}))}var i=this.props,o=(i.compact,i.primary,i.scary,i.busy,i.borderless,i.target,i.rel,c()(i,["compact","primary","scary","busy","borderless","target","rel"]));return h.a.createElement("button",a()({},o,{className:e}))}}]),t}(b.PureComponent);g()(j,"propTypes",{compact:C.a.bool,primary:C.a.bool,scary:C.a.bool,busy:C.a.bool,type:C.a.string,href:C.a.string,borderless:C.a.bool,target:C.a.string,rel:C.a.string}),g()(j,"defaultProps",{type:"button"})},543:function(e,t,n){"use strict";n.d(t,"f",function(){return c}),n.d(t,"g",function(){return o}),n.d(t,"h",function(){return s}),n.d(t,"i",function(){return u}),n.d(t,"d",function(){return l}),n.d(t,"c",function(){return d}),n.d(t,"b",function(){return E}),n.d(t,"a",function(){return f}),n.d(t,"n",function(){return m}),n.d(t,"o",function(){return p}),n.d(t,"e",function(){return O}),n.d(t,"q",function(){return _}),n.d(t,"p",function(){return g}),n.d(t,"k",function(){return b}),n.d(t,"l",function(){return h}),n.d(t,"m",function(){return v}),n.d(t,"j",function(){return C});var r=n(1),a=n(532),i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"labelSettings"],null)},c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=i(e,t);return n&&n.data},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=i(e,t);return n&&n.meta},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=i(e,t);return n&&n.storeOptions},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=o(e,t);return n&&n.user},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=o(e,t);return n&&n.isLoaded},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=o(e,t);return n&&n.isFetching},E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=o(e,t);return n&&n.isFetchError},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=c(e,t);return n&&n.enabled},m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=c(e,t);return n&&n.selected_payment_method_id},p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=o(e,t);return n&&n.pristine},O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=c(e,t);return n&&n.email_receipts},_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=o(e,t);return n&&n.can_manage_payments},g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=o(e,t);return n&&n.can_edit_settings},b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=c(e,t);return n&&n.paper_size},h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=o(e,t);return n&&n.payment_methods},v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=o(e,t);return n&&n.warnings&&n.warnings.payment_methods},C=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=o(e,t);return{masterUserName:n&&n.master_user_name,masterUserLogin:n&&n.master_user_login,masterUserEmail:n&&n.master_user_email,masterUserWpcomLogin:n&&n.master_user_wpcom_login}}},544:function(e,t,n){"use strict";n.d(t,"a",function(){return u});var r=n(1),a=n(606),i=n.n(a),c=(n(112),function(e){return e}),o=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.join()},s=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return e.map(function(e){return e.apply(void 0,[t].concat(r))})}};function u(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,u=Object(r.memoize)(e,a);return Array.isArray(n)&&(n=s(n)),Object.assign(function(e){for(var r=arguments.length,a=new Array(r>1?r-1:0),c=1;c<r;c++)a[c-1]=arguments[c];var o=n.apply(void 0,[e].concat(a));return Array.isArray(o)||(o=[o]),t&&!i()(o,t)&&u.cache.clear(),t=o,u.apply(void 0,[e].concat(a))},{memoizedSelector:u})}},546:function(e,t,n){"use strict";var r=n(530),a=n.n(r),i=n(533),c=n.n(i),o=n(36),s=n.n(o),u=n(10),l=n.n(u),d=n(12),E=n.n(d),f=n(526),m=n.n(f),p=n(35),O=n(1),_=function(e){var t=e.children,n=e.required,r=e.optional,i=e.translate,o=e.className,u=c()(e,["children","required","optional","translate","className"]);return t=l.a.Children.toArray(t)||[],n&&t.push(function(e){return l.a.createElement("small",{className:"form-label__required"},e("Required"))}(i)),r&&t.push(function(e){return l.a.createElement("small",{className:"form-label__optional"},e("Optional"))}(i)),l.a.createElement("label",a()({},Object(O.omit)(u,"moment","numberFormat"),{className:m()(o,"form-label")}),t.length?t.map(function(e,t){return Object(O.isObject)(e)?s()({},e,{key:t}):e}):null)};_.propTypes={required:E.a.bool},t.a=Object(p.localize)(_)},547:function(e,t,n){"use strict";n.d(t,"d",function(){return r}),n.d(t,"c",function(){return b}),n.d(t,"b",function(){return h}),n.d(t,"a",function(){return v});var r={};n.r(r),n.d(r,"accountSettings",function(){return i}),n.d(r,"packages",function(){return c}),n.d(r,"orderLabels",function(){return o}),n.d(r,"getLabelRates",function(){return s}),n.d(r,"labelStatus",function(){return u}),n.d(r,"labelRefund",function(){return l}),n.d(r,"labelsPrint",function(){return d}),n.d(r,"labelTestPrint",function(){return E}),n.d(r,"addressNormalization",function(){return f}),n.d(r,"serviceSettings",function(){return m}),n.d(r,"shippingCarrier",function(){return p}),n.d(r,"shippingCarriers",function(){return O}),n.d(r,"shippingCarrierDelete",function(){return _});var a=n(561),i="connect/account/settings",c="connect/packages",o=function(e){return"connect/label/".concat(e)},s=function(e){return"connect/label/".concat(e,"/rates")},u=function(e,t){return"connect/label/".concat(e,"/").concat(t)},l=function(e,t){return"connect/label/".concat(e,"/").concat(t,"/refund")},d=function(){return"connect/label/print"},E=function(){return"connect/label/preview"},f=function(){return"connect/normalize-address"},m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"connect/services/".concat(e,"/").concat(t)},p=function(){return"connect/shipping/carrier"},O=function(){return"connect/shipping/carriers"},_=function(e){return"connect/shipping/carrier/".concat(e)},g=function(e){if(e&&e.message)throw e.message;if(e&&e.data&&e.data.message)throw e.data.message;throw e},b=function(e,t,n){return Object(a.a)(e).post(t,n,"wc/v1").catch(g)},h=function(e,t){return Object(a.a)(e).get(t,"wc/v1").catch(g)},v=function(e,t){return Object(a.a)(e).del(t,"wc/v1").catch(g)}},549:function(e,t,n){"use strict";n.d(t,"c",function(){return s}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return d}),n.d(t,"b",function(){return E});var r=n(533),a=n.n(r),i=n(1),c={debounce:i.debounce,isPlainObject:i.isPlainObject,uniqueId:i.uniqueId},o=(n(46),c.uniqueId);function s(e){return{noticeId:e,type:"NOTICE_REMOVE"}}function u(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.id,i=a()(n,["id"]);return{type:"NOTICE_CREATE",notice:Object.assign({showDismiss:!0},i,{noticeId:r||o(),status:e,text:t})}}var l=u.bind(null,"is-success"),d=u.bind(null,"is-error"),E=u.bind(null,"is-info");u.bind(null,"is-warning"),u.bind(null,"is-plain")},552:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),a=function e(t){return!!t&&(Object(r.isArray)(t)?Object(r.some)(t,e):!Object(r.isPlainObject)(t)||Object(r.some)(Object(r.values)(t),e))}},555:function(e,t,n){"use strict";n.r(t),n.d(t,"addPackage",function(){return c}),n.d(t,"removePackage",function(){return o}),n.d(t,"editPackage",function(){return s}),n.d(t,"dismissModal",function(){return u}),n.d(t,"savePackage",function(){return l}),n.d(t,"updatePackagesField",function(){return d}),n.d(t,"toggleOuterDimensions",function(){return E}),n.d(t,"toggleAll",function(){return f}),n.d(t,"togglePackage",function(){return m}),n.d(t,"savePredefinedPackages",function(){return p}),n.d(t,"removePredefinedPackage",function(){return O}),n.d(t,"setModalErrors",function(){return _}),n.d(t,"setIsSaving",function(){return g}),n.d(t,"setIsFetching",function(){return b}),n.d(t,"setIsFetchError",function(){return h}),n.d(t,"setAddMode",function(){return v}),n.d(t,"fetchSettings",function(){return C}),n.d(t,"submit",function(){return S});var r=n(547),a=n(538),i=n(541),c=function(e){return{type:a.n,siteId:e}},o=function(e,t){return{type:a.r,index:t,siteId:e}},s=function(e,t){return{type:a.p,package:t,siteId:e}},u=function(e){return{type:a.o,siteId:e}},l=function(e,t){return{type:a.t,packageData:t,siteId:e}},d=function(e,t){return{type:a.D,values:t,siteId:e}},E=function(e){return{type:a.B,siteId:e}},f=function(e,t,n,r){return{type:a.A,serviceId:t,groupId:n,checked:r,siteId:e}},m=function(e,t,n){return{type:a.C,serviceId:t,packageId:n,siteId:e}},p=function(e){return{type:a.u,siteId:e}},O=function(e,t,n){return{type:a.s,serviceId:t,packageId:n,siteId:e}},_=function(e,t){return{type:a.z,value:t,siteId:e}},g=function(e,t){return{type:a.y,isSaving:t,siteId:e}},b=function(e,t){return{type:a.w,isFetching:t,siteId:e}},h=function(e,t){return{type:a.x,isFetchError:t,siteId:e}},v=function(e,t){return{type:a.v,siteId:e,mode:t}},C=function(e){return function(t,n){var c=Object(i.e)(n(),e);c&&(c.packages||c.isFetching)||(t(b(e,!0)),r.b(e,r.d.packages).then(function(n){var r=n.formData,i=n.formSchema,c=n.storeOptions;t({type:a.q,packages:r,dimensionUnit:c.dimension_unit,weightUnit:c.weight_unit,packageSchema:i.custom.items,predefinedSchema:i.predefined,siteId:e})}).catch(function(n){console.error(n),t(h(e,!0))}).then(function(){return t(b(e,!1))}))}},S=function(e,t,n){return function(a,c){var o=Object(i.e)(c(),e);a(g(e,!0)),r.c(e,r.d.packages,o.packages).then(t).catch(n).then(function(){return a(g(e,!1))})}}},556:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(535);function a(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Date.now();return{type:r.j,siteId:e,originalAction:t,data:n,time:a}}},557:function(e,t,n){"use strict";n.d(t,"a",function(){return R});var r=n(530),a=n.n(r),i=n(107),c=n.n(i),o=n(108),s=n.n(o),u=n(528),l=n.n(u),d=n(527),E=n.n(d),f=n(531),m=n.n(f),p=n(529),O=n.n(p),_=n(34),g=n.n(_),b=n(10),h=n.n(b),v=n(12),C=n.n(v),S=n(526),I=n.n(S),j=n(1),R=function(e){function t(){var e;return c()(this,t),(e=l()(this,E()(t).apply(this,arguments))).selectOnFocus=e.selectOnFocus.bind(m()(e)),e}return O()(t,e),s()(t,[{key:"focus",value:function(){this.refs.textField.focus()}},{key:"selectOnFocus",value:function(e){this.props.selectOnFocus&&e.target.select()}},{key:"render",value:function(){var e=this.props.inputRef,t=Object(j.omit)(this.props,"isError","isValid","selectOnFocus","inputRef"),n=I()("form-text-input",this.props.className,{"is-error":this.props.isError,"is-valid":this.props.isValid});return h.a.createElement("input",a()({type:"text"},t,{ref:e||"textField",className:n,onClick:this.selectOnFocus}))}}]),t}(b.PureComponent);g()(R,"propTypes",{isError:C.a.bool,isValid:C.a.bool,selectOnFocus:C.a.bool,className:C.a.string})},561:function(e,t,n){"use strict";var r=n(75);t.a=r.a},562:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a}),n.d(t,"c",function(){return i});var r=function(){return{}},a=function(){return""},i=function(){return!0}},563:function(e,t,n){"use strict";n.d(t,"b",function(){return s}),n.d(t,"c",function(){return u}),n.d(t,"a",function(){return l}),n.d(t,"e",function(){return E}),n.d(t,"f",function(){return m}),n.d(t,"g",function(){return p}),n.d(t,"i",function(){return O}),n.d(t,"h",function(){return _}),n.d(t,"j",function(){return g}),n.d(t,"d",function(){return b});var r=n(1),a=n(544),i=n(532),c=n(539),o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"data","locations"])},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.isArray)(o(e,t))},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return c.b===o(e,t)},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return c.a===o(e,t)},d=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];var i=r[e],c=s(t,i);return[c,c&&o(t,i)]}},E=Object(a.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);if(!s(e,t))return[];var n=o(e,t).map(function(e){return Object(r.omit)(e,"countries")});return Object(r.sortBy)(n,"name")},d(0)),f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);if(!s(e,t))return[];var n=Object(r.flatMap)(o(e,t),"countries");return Object(r.sortBy)(n,"name")},m=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);if(!s(e,n))return[];var a=Object(r.find)(o(e,n),{code:t});if(!a)return[];var c=a.countries.map(function(e){return Object(r.omit)(e,"states")});return Object(r.sortBy)(c,"name")},d(1)),p=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);if(!s(e,n))return t;var a=Object(r.find)(Object(r.flatMap)(o(e,n),"countries"),{code:t});return a?a.name:t},d(1)),O=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);if(!s(e,n))return[];var a=Object(r.find)(Object(r.flatMap)(o(e,n),"countries"),{code:t});return a?Object(r.sortBy)(a.states,"name"):[]},d(1)),_=Object(a.a)(function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(i.a)(e);if(!s(e,a))return n;var c=Object(r.find)(Object(r.flatMap)(o(e,a),"countries"),{code:t});if(!c)return n;var u=Object(r.find)(c.states,{code:n});return u?u.name:n},d(2)),g=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!Object(r.isEmpty)(O(e,t,n))},b=Object(a.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=f(e,t),r={};return n.forEach(function(e){var t=e.code,n=e.name;return r[t]=n}),r},d(0))},565:function(e,t,n){"use strict";var r=n(1);t.a=function(e){return Object(r.isPlainObject)(e)&&(e.isNormalized&&e.selectNormalized&&e.normalized?e.normalized:e.values)||{}}},566:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a});var r=function(){return!0},a=function(){return!0}},567:function(e,t,n){"use strict";n.d(t,"d",function(){return c}),n.d(t,"a",function(){return s}),n.d(t,"e",function(){return u}),n.d(t,"c",function(){return l}),n.d(t,"b",function(){return d});var r=n(547),a=n(538),i=n(543),c=function(e,t,n){return{type:a.l,siteId:e,key:t,value:n}},o=function(e,t,n){return{type:a.m,siteId:e,key:t,value:n}},s=function(e){return function(t){t(o(e,"isFetching",!0)),r.b(e,r.d.accountSettings).then(function(n){var r=n.storeOptions,i=n.formMeta,c=n.formData,o=n.userMeta;t(function(e,t,n,r,i){return{type:a.i,siteId:e,storeOptions:t,formData:n,formMeta:r,userMeta:i}}(e,r,c,i,o))}).catch(function(n){t(o(e,"isFetchError",!0)),console.error(n)}).then(function(){return t(o(e,"isFetching",!1))})}},u=function(e,t,n){return function(a,c){a(o(e,"isSaving",!0)),a(o(e,"pristine",!0)),r.c(e,r.d.accountSettings,Object(i.f)(c())).then(t).catch(function(t){return a(o(e,"pristine",!1)),n(t)}).then(function(){a(o(e,"isSaving",!1))})}},l=function(e){return{type:a.k,siteId:e}},d=function(e){return{type:a.j,siteId:e}}},568:function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s}),n.d(t,"c",function(){return u});var r=n(1),a=n(532),i=n(539),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"shippingMethodSchemas"],{})},o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return Object(r.isObject)(c(e,n)[t])},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return o(e,t,n)?c(e,n)[t]:null},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return i.b===c(e,n)[t]}},575:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a}),n.d(t,"d",function(){return i}),n.d(t,"c",function(){return c});var r=["US","PR","VI","GU","AS","UM","MH","FM","MP"],a=["US","PR","VI"],i=["AA","AE","AP"],c=["IR","SY","KP","CU","SD"]},576:function(e,t,n){"use strict";n.d(t,"c",function(){return u}),n.d(t,"a",function(){return l}),n.d(t,"b",function(){return d});var r=n(1),a=n(532),i=n(584),c=n(539),o=n(566),s=n(585),u=function(e,t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZoneMethods"])}(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e));return Object(r.isObject)(n)?n[t]:null},l=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),c=Object(i.b)(e,n);if(!Object(r.isArray)(c))return!1;var l=Object(r.find)(c,{id:t});if(!l||!Object(r.isArray)(l.methodIds))return!1;if(!Object(o.a)(e,n))return!0;var d=l.methodIds.map(function(t){var a=u(e,t,n);return a&&Object(r.startsWith)(a.methodType,"wc_services")?a:null}).filter(Boolean);return Object(r.every)(d,function(t){var r=t.id;return Object(s.a)(e,r,n)})},d=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),l=Object(i.b)(e,n);if(!Object(r.isArray)(l))return!1;var d=Object(r.find)(l,{id:t});if(!d)return!1;if(c.b===d.methodIds)return!0;if(!Object(o.a)(e,n)||!Object(r.isArray)(d.methodIds))return!1;var E=d.methodIds.map(function(t){var a=u(e,t,n);return a&&Object(r.startsWith)(a.methodType,"wc_services")?a:null}).filter(Boolean);return Object(r.some)(E,function(t){var r=t.id;return Object(s.b)(e,r,n)})}},580:function(e,t,n){"use strict";var r=n(530),a=n.n(r),i=n(533),c=n.n(i),o=n(107),s=n.n(o),u=n(108),l=n.n(u),d=n(528),E=n.n(d),f=n(527),m=n.n(f),p=n(531),O=n.n(p),_=n(529),g=n.n(_),b=n(34),h=n.n(b),v=n(526),C=n.n(v),S=n(35),I=n(1),j=n(10),R=n.n(j),N=n(542),y=function(e){function t(){var e,n;s()(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=E()(this,(e=m()(t)).call.apply(e,[this].concat(a))),h()(O()(n),"getDefaultButtonAction",function(){return n.props.isSubmitting?n.props.translate("Saving\u2026"):n.props.translate("Save Settings")}),n}return g()(t,e),l()(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.isPrimary,i=c()(e,["children","className","isPrimary"]),o=C()(n,"form-button");return R.a.createElement(N.a,a()({},Object(I.omit)(i,["isSubmitting","moment","numberFormat","translate"]),{primary:r,className:o}),j.Children.count(t)?t:this.getDefaultButtonAction())}}]),t}(R.a.Component);h()(y,"defaultProps",{isSubmitting:!1,isPrimary:!0,type:"submit"}),t.a=Object(S.localize)(y)},584:function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var r=n(1),a=n(532),i=(n(539),n(576)),c=n(610),o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZones"])},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=o(e,t);return Object(r.isArray)(n)&&Object(r.every)(n,function(n){return Object(i.a)(e,n.id,t)})&&Object(r.every)(n,function(n){return Object(c.a)(e,n.id,t)})}},585:function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"b",function(){return s});var r=n(1),a=n(532),i=n(539),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"shippingZoneMethodSettings"],{})},o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return!0===c(e,n)[t]},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return i.b===c(e,n)[t]}},586:function(e,t,n){"use strict";var r=n(10),a=n.n(r),i=n(12),c=n.n(i),o=n(545),s=n(546),u=n(557),l=n(550),d=n(558),E=function(e){var t=e.id,n=e.title,r=e.description,i=e.value,c=e.placeholder,E=e.updateValue,f=e.error,m=e.className;return a.a.createElement(o.a,{className:m},a.a.createElement(s.a,{htmlFor:t},n),a.a.createElement(u.a,{id:t,name:t,placeholder:c,value:i,onChange:function(e){return E(e.target.value)},isError:Boolean(f)}),f&&"string"===typeof f&&a.a.createElement(l.a,{text:f}),!f&&r&&a.a.createElement(d.a,null,r))};E.propTypes={id:c.a.string.isRequired,title:c.a.node,description:c.a.string,value:c.a.string.isRequired,updateValue:c.a.func,error:c.a.oneOfType([c.a.string,c.a.bool]),className:c.a.string},t.a=E},589:function(e,t,n){"use strict";n.d(t,"a",function(){return I});var r=n(533),a=n.n(r),i=n(107),c=n.n(i),o=n(108),s=n.n(o),u=n(528),l=n.n(u),d=n(527),E=n.n(d),f=n(529),m=n.n(f),p=n(34),O=n.n(p),_=n(10),g=n.n(_),b=n(12),h=n.n(b),v=n(526),C=n.n(v),S=n(557),I=function(e){function t(){return c()(this,t),l()(this,E()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){var e=this.props,t=e.noWrap,n=e.prefix,r=e.suffix,i=a()(e,["noWrap","prefix","suffix"]);return g.a.createElement("div",{className:C()("form-text-input-with-affixes",{"no-wrap":t})},n&&g.a.createElement("span",{className:"form-text-input-with-affixes__prefix"},n),g.a.createElement(S.a,i),r&&g.a.createElement("span",{className:"form-text-input-with-affixes__suffix"},r))}}]),t}(g.a.Component);O()(I,"displayName","FormTextInputWithAffixes"),O()(I,"propTypes",{noWrap:h.a.bool,prefix:h.a.node,suffix:h.a.node})},592:function(e,t,n){"use strict";var r,a=n(34),i=n.n(a),c=n(36),o=n.n(c),s=n(1),u=n(46),l=Object(u.b)({},(r={},i()(r,"NOTICE_CREATE",function(e,t){var n=t.notice;return o()({},e,i()({},n.noticeId,n))}),i()(r,"NOTICE_REMOVE",function(e,t){var n=t.noticeId;return e.hasOwnProperty(n)?Object(s.omit)(e,n):e}),i()(r,"ROUTE_SET",function(e){return Object(s.reduce)(e,function(e,t,n){if(!t.isPersistent&&!t.displayOnNextPage)return e;var r=t;return r.displayOnNextPage&&(r=o()({},r,{displayOnNextPage:!1})),e[n]=r,e},{})}),r)),d=Object(u.b)({},i()({},"NOTICE_CREATE",function(e,t){var n=t.notice;return o()({},e,i()({},n.noticeId,Date.now()))}));t.a=Object(u.a)({items:l,lastTimeShown:d})},593:function(e,t,n){"use strict";n.d(t,"d",function(){return a}),n.d(t,"b",function(){return i}),n.d(t,"a",function(){return c}),n.d(t,"e",function(){return o}),n.d(t,"c",function(){return s});var r=n(535);function a(e){return{type:r.d,actionList:e}}function i(){return{type:r.b}}function c(e){return{type:r.a,actionList:e}}function o(e){return{type:r.e,actionList:e}}function s(e,t){return{type:r.c,actionList:e,error:t}}},602:function(e,t,n){"use strict";n.d(t,"a",function(){return c}),n.d(t,"b",function(){return o});n(1);var r=n(659),a=n.n(r),i=document.implementation&&document.implementation.createHTMLDocument?document.implementation.createHTMLDocument("").createElement("textarea"):document.createElement("textarea");function c(e){return"string"!==typeof e||-1===e.indexOf("&")?e:function(e){i.innerHTML=e;var t=i.textContent;return i.innerHTML="",t}(e)}function o(e){return a()(e)}String.fromCharCode(160)},604:function(e,t,n){"use strict";n.d(t,"a",function(){return s}),n.d(t,"b",function(){return l});var r=n(35),a=n(605),i=n(1),c=n(547),o={a4:{name:Object(r.translate)("A4"),exclude:function(e){return Object(i.includes)(["US","CA","MX","DO"],e)}},label:{name:Object(r.translate)('Label (4"x6")')},legal:{name:Object(r.translate)("Legal")},letter:{name:Object(r.translate)("Letter")}},s=function(e){return Object(i.reduce)(o,function(t,n,r){var a=n.name,i=n.exclude;return i&&i(e)||(t[r]=a),t},{})},u=function(e,t,n){if(!o[e])throw new Error("Invalid paper size: ".concat(e));var r={paper_size:e,label_id_csv:Object(i.filter)(Object(i.map)(t,"labelId")).join(","),caption_csv:Object(i.filter)(Object(i.map)(t,function(e){return e.caption?encodeURIComponent(e.caption):null})).join(","),json:!0};return n+"?"+Object(a.stringify)(r)},l=function(e,t){return u(e,t,c.d.labelsPrint())}},609:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(1),a=function(e,t){return Object(r.isArray)(e)?e.concat(t):void 0},i=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length>1?r.mergeWith.apply(void 0,[Object.create(null)].concat(t,[a])):t[0]}},610:function(e,t,n){"use strict";n.d(t,"c",function(){return c}),n.d(t,"a",function(){return o}),n.d(t,"b",function(){return s});var r=n(1),a=n(532),i=n(539),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZoneLocations"])},o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),i=c(e,n);return i&&Object(r.isObject)(i[t])},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return c(e,n)&&i.b===c(e,n)[t]}},611:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var r=n(547),a=n(556),i=n(538),c=n(585),o=function(e,t,n){return function(o,s){if(!Object(c.a)(s(),n,e)&&!Object(c.b)(s(),n,e)){var u={type:i.Wb,instanceId:n,siteId:e};return o(u),r.b(e,r.d.serviceSettings(t,n)).then(function(t){return o(function(e,t,n){return{type:i.Xb,siteId:e,instanceId:t,data:n}}(e,n,t))}).catch(function(t){return o(Object(a.a)(e,u,t))})}}}},612:function(e,t,n){"use strict";t.a=function(e,t){return function e(t,n,r){if(void 0===n||null===n||!t)return n;switch((t=function(e,t){if(e.$ref){var n=e.$ref.match(/^#\/definitions\/(.+)/);n&&t[n[1]]&&(e=t[n[1]])}return e}(t,r)).type){case"number":if(""===n)return;return isNaN(n)?n:parseFloat(n);case"boolean":return-1!==["true","True","TRUE","1",1,!0].indexOf(n)||-1===["false","False","FALSE","0",0,!1].indexOf(n)&&void 0;case"string":return n?n.toString():"";case"object":var a={};return Object.keys(n).forEach(function(i){var c=(t.properties||{})[i];a[i]=e(c,n[i],r)}),a;case"array":return n.map(function(n){return e(t.items,n,r)});default:return n}}({type:"object",properties:e.properties},t,e.definitions)}},613:function(e,t,n){"use strict";var r=n(530),a=n.n(r),i=n(10),c=n.n(i),o=n(12),s=n.n(o),u=n(526),l=n.n(u),d=n(534),E=n.n(d),f=n(1),m=function(e){var t=e.className,n=e.disabled,r=e.checked,i=e.partialChecked,o=Object(f.omit)(e,["className","partialChecked"]);return c.a.createElement("span",{className:l()(t,"form-checkbox",{"is-disabled":n})},c.a.createElement("input",a()({},o,{type:"checkbox"})),r&&c.a.createElement(E.a,{icon:"checkmark",size:14}),!r&&i&&c.a.createElement(E.a,{icon:"minus-small",size:16}))};m.propTypes={checked:s.a.bool.isRequired,partialChecked:s.a.bool,onChange:s.a.func.isRequired,className:s.a.string},t.a=m},615:function(e,t,n){"use strict";var r=n(530),a=n.n(r),i=n(533),c=n.n(i),o=n(10),s=n.n(o),u=n(526),l=n.n(u);t.a=function(e){var t=e.className,n=c()(e,["className"]);return s.a.createElement("input",a()({},n,{type:"checkbox",className:l()(t,"form-checkbox")}))}},619:function(e,t,n){var r={"./af":[392,3],"./af.js":[392,3],"./ar":[399,4],"./ar-dz":[393,5],"./ar-dz.js":[393,5],"./ar-kw":[394,6],"./ar-kw.js":[394,6],"./ar-ly":[395,7],"./ar-ly.js":[395,7],"./ar-ma":[396,8],"./ar-ma.js":[396,8],"./ar-sa":[397,9],"./ar-sa.js":[397,9],"./ar-tn":[398,10],"./ar-tn.js":[398,10],"./ar.js":[399,4],"./az":[400,11],"./az.js":[400,11],"./be":[401,12],"./be.js":[401,12],"./bg":[402,13],"./bg.js":[402,13],"./bm":[403,14],"./bm.js":[403,14],"./bn":[404,15],"./bn.js":[404,15],"./bo":[405,16],"./bo.js":[405,16],"./br":[406,17],"./br.js":[406,17],"./bs":[407,18],"./bs.js":[407,18],"./ca":[408,19],"./ca.js":[408,19],"./cs":[409,20],"./cs.js":[409,20],"./cv":[410,21],"./cv.js":[410,21],"./cy":[411,22],"./cy.js":[411,22],"./da":[412,23],"./da.js":[412,23],"./de":[415,24],"./de-at":[413,25],"./de-at.js":[413,25],"./de-ch":[414,26],"./de-ch.js":[414,26],"./de.js":[415,24],"./dv":[416,27],"./dv.js":[416,27],"./el":[417,28],"./el.js":[417,28],"./en-au":[418,29],"./en-au.js":[418,29],"./en-ca":[419,30],"./en-ca.js":[419,30],"./en-gb":[420,31],"./en-gb.js":[420,31],"./en-ie":[421,32],"./en-ie.js":[421,32],"./en-il":[422,33],"./en-il.js":[422,33],"./en-in":[423,34],"./en-in.js":[423,34],"./en-nz":[424,35],"./en-nz.js":[424,35],"./en-sg":[425,36],"./en-sg.js":[425,36],"./eo":[426,37],"./eo.js":[426,37],"./es":[429,38],"./es-do":[427,39],"./es-do.js":[427,39],"./es-us":[428,40],"./es-us.js":[428,40],"./es.js":[429,38],"./et":[430,41],"./et.js":[430,41],"./eu":[431,42],"./eu.js":[431,42],"./fa":[432,43],"./fa.js":[432,43],"./fi":[433,44],"./fi.js":[433,44],"./fil":[434,45],"./fil.js":[434,45],"./fo":[435,46],"./fo.js":[435,46],"./fr":[438,47],"./fr-ca":[436,48],"./fr-ca.js":[436,48],"./fr-ch":[437,49],"./fr-ch.js":[437,49],"./fr.js":[438,47],"./fy":[439,50],"./fy.js":[439,50],"./ga":[440,51],"./ga.js":[440,51],"./gd":[441,52],"./gd.js":[441,52],"./gl":[442,53],"./gl.js":[442,53],"./gom-deva":[443,54],"./gom-deva.js":[443,54],"./gom-latn":[444,55],"./gom-latn.js":[444,55],"./gu":[445,56],"./gu.js":[445,56],"./he":[446,57],"./he.js":[446,57],"./hi":[447,58],"./hi.js":[447,58],"./hr":[448,59],"./hr.js":[448,59],"./hu":[449,60],"./hu.js":[449,60],"./hy-am":[450,61],"./hy-am.js":[450,61],"./id":[451,62],"./id.js":[451,62],"./is":[452,63],"./is.js":[452,63],"./it":[454,64],"./it-ch":[453,65],"./it-ch.js":[453,65],"./it.js":[454,64],"./ja":[455,66],"./ja.js":[455,66],"./jv":[456,67],"./jv.js":[456,67],"./ka":[457,68],"./ka.js":[457,68],"./kk":[458,69],"./kk.js":[458,69],"./km":[459,70],"./km.js":[459,70],"./kn":[460,71],"./kn.js":[460,71],"./ko":[461,72],"./ko.js":[461,72],"./ku":[462,73],"./ku.js":[462,73],"./ky":[463,74],"./ky.js":[463,74],"./lb":[464,75],"./lb.js":[464,75],"./lo":[465,76],"./lo.js":[465,76],"./lt":[466,77],"./lt.js":[466,77],"./lv":[467,78],"./lv.js":[467,78],"./me":[468,79],"./me.js":[468,79],"./mi":[469,80],"./mi.js":[469,80],"./mk":[470,81],"./mk.js":[470,81],"./ml":[471,82],"./ml.js":[471,82],"./mn":[472,83],"./mn.js":[472,83],"./mr":[473,84],"./mr.js":[473,84],"./ms":[475,85],"./ms-my":[474,86],"./ms-my.js":[474,86],"./ms.js":[475,85],"./mt":[476,87],"./mt.js":[476,87],"./my":[477,88],"./my.js":[477,88],"./nb":[478,89],"./nb.js":[478,89],"./ne":[479,90],"./ne.js":[479,90],"./nl":[481,91],"./nl-be":[480,92],"./nl-be.js":[480,92],"./nl.js":[481,91],"./nn":[482,93],"./nn.js":[482,93],"./oc-lnc":[483,94],"./oc-lnc.js":[483,94],"./pa-in":[484,95],"./pa-in.js":[484,95],"./pl":[485,96],"./pl.js":[485,96],"./pt":[487,97],"./pt-br":[486,98],"./pt-br.js":[486,98],"./pt.js":[487,97],"./ro":[488,99],"./ro.js":[488,99],"./ru":[489,100],"./ru.js":[489,100],"./sd":[490,101],"./sd.js":[490,101],"./se":[491,102],"./se.js":[491,102],"./si":[492,103],"./si.js":[492,103],"./sk":[493,104],"./sk.js":[493,104],"./sl":[494,105],"./sl.js":[494,105],"./sq":[495,106],"./sq.js":[495,106],"./sr":[497,107],"./sr-cyrl":[496,108],"./sr-cyrl.js":[496,108],"./sr.js":[497,107],"./ss":[498,109],"./ss.js":[498,109],"./sv":[499,110],"./sv.js":[499,110],"./sw":[500,111],"./sw.js":[500,111],"./ta":[501,112],"./ta.js":[501,112],"./te":[502,113],"./te.js":[502,113],"./tet":[503,114],"./tet.js":[503,114],"./tg":[504,115],"./tg.js":[504,115],"./th":[505,116],"./th.js":[505,116],"./tk":[506,117],"./tk.js":[506,117],"./tl-ph":[507,118],"./tl-ph.js":[507,118],"./tlh":[508,119],"./tlh.js":[508,119],"./tr":[509,120],"./tr.js":[509,120],"./tzl":[510,121],"./tzl.js":[510,121],"./tzm":[512,122],"./tzm-latn":[511,123],"./tzm-latn.js":[511,123],"./tzm.js":[512,122],"./ug-cn":[513,124],"./ug-cn.js":[513,124],"./uk":[514,125],"./uk.js":[514,125],"./ur":[515,126],"./ur.js":[515,126],"./uz":[517,127],"./uz-latn":[516,128],"./uz-latn.js":[516,128],"./uz.js":[517,127],"./vi":[518,129],"./vi.js":[518,129],"./x-pseudo":[519,130],"./x-pseudo.js":[519,130],"./yo":[520,131],"./yo.js":[520,131],"./zh-cn":[521,132],"./zh-cn.js":[521,132],"./zh-hk":[522,133],"./zh-hk.js":[522,133],"./zh-mo":[523,134],"./zh-mo.js":[523,134],"./zh-tw":[524,135],"./zh-tw.js":[524,135]};function a(e){if(!n.o(r,e))return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=r[e],a=t[0];return n.e(t[1]).then(function(){return n.t(a,7)})}a.keys=function(){return Object.keys(r)},a.id=619,e.exports=a},620:function(e,t,n){"use strict";(function(e){var n={env:e?"production":"development",wpcom_concierge_schedule_id:1,languages:[],google_adwords_conversion_id:"",google_adwords_conversion_id_jetpack:""},r=function(e){if(e in n)return n[e];throw new Error("config key `"+e+"` does not exist")};r.isEnabled=function(){return!0},t.a=r}).call(this,n(111))},633:function(e,t,n){"use strict";var r=n(34),a=n.n(r),i=n(110),c=n.n(i),o=n(1),s=n(35),u=n(535),l=n(593),d=n(543),E=n(541),f=n(567),m=n(555),p=n(532),O=n(538);n(561),n(556),n(576),n(611),n(620);var _=n(547),g=n(36),b=n.n(g);function h(e,t,n,r){Object(o.isFunction)(n)?h(e,t,n(e,t,r),r):Object(o.isObject)(n)&&e(b()({},n,r))}var v,C=n(568),S=n(612),I=function(e,t){var n=Object(E.e)(e,t);return!n||n.pristine?[]:[{description:Object(s.translate)("Saving label settings"),onStep:function(e,n){e(Object(m.submit)(t,function(){return e(Object(l.e)(n))},function(){return e(Object(l.c)(n))}))}}]},j=function(e,t){var n=Object(p.a)(e);return t?c()(I(e,n)):[].concat(c()(function(e,t){var n=Object(d.g)(e,t);return!n||n.pristine||!n.can_edit_settings&&n.can_manage_payments?[]:[{description:Object(s.translate)("Saving label settings"),onStep:function(e,n){e(Object(f.e)(t,function(){return e(Object(l.e)(n))},function(){return e(Object(l.c)(n))}))}}]}(e,n)),c()(I(e,n)))};t.a=(v={},a()(v,u.L,[function(e,t){var n=t.successAction,r=t.failureAction,a=t.onlyPackages,i=function(e){e(n),e(Object(l.b)())},c=j(e.getState(),a);e.dispatch(Object(o.isEmpty)(c)?i:Object(l.d)({nextSteps:c,onSuccess:i,onFailure:function(e){e(r),e(Object(l.b)())}}))}]),a()(v,O.Yb,[function(e,t){var n=e.dispatch,r=e.getState,a=t.siteId,i=t.methodId,c=t.methodType,o=t.method,s=t.successAction,l=t.failureAction,d=Object(C.a)(r(),c,a).formSchema,E=Object(S.a)(d,o);_.c(a,_.d.serviceSettings(c,i),E).then(function(e){n(function(e,t,n){return{type:u.Pb,siteId:e,data:t,originatingAction:n}}(a,e,t)),h(n,r,s,{sentData:E,receivedData:e})}).catch(function(e){return h(n,r,l,{error:e})})}]),v)},634:function(e,t,n){"use strict";n.d(t,"b",function(){return A}),n.d(t,"a",function(){return M});var r=n(114),a=n.n(r),i=n(107),c=n.n(i),o=n(108),s=n.n(o),u=n(528),l=n.n(u),d=n(527),E=n.n(d),f=n(531),m=n.n(f),p=n(529),O=n.n(p),_=n(34),g=n.n(_),b=n(10),h=n.n(b),v=n(109),C=n(163),S=n.n(C),I=n(47),j=n.n(I),R=n(1),N=n(544),y=Object(N.a)(function(e){return Object(R.get)(e,"ui.language.localeSlug",null)},function(e){return e.ui.language}),P=j()("calypso:localized-moment"),M=h.a.createContext(S.a),T=function(e){function t(){var e,n;c()(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=l()(this,(e=E()(t)).call.apply(e,[this].concat(a))),g()(m()(n),"state",{moment:S.a,momentLocale:S.a.locale()}),n}return O()(t,e),s()(t,[{key:"checkAndLoad",value:function(){var e=a()(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((r=this.props.currentLocale)!==t){e.next=3;break}return e.abrupt("return");case 3:if("en"!==r){e.next=7;break}this.loadingLocalePromise=Promise.resolve(),e.next=19;break;case 7:return P("Loading moment locale for %s",r),e.prev=8,this.loadingLocalePromise=n(619)("./".concat(r)),e.next=12,this.loadingLocalePromise;case 12:e.next=18;break;case 14:return e.prev=14,e.t0=e.catch(8),P("Failed to load moment locale for %s",r,e.t0),e.abrupt("return");case 18:P("Loaded moment locale for %s",r);case 19:r===this.props.currentLocale&&(S.a.locale()!==r&&S.a.locale(r),this.setState({momentLocale:r}));case 20:case"end":return e.stop()}},e,this,[[8,14]])}));return function(t){return e.apply(this,arguments)}}()},{key:"componentDidMount",value:function(){this.checkAndLoad(S.a.locale())}},{key:"componentDidUpdate",value:function(e){this.checkAndLoad(e.currentLocale)}},{key:"render",value:function(){return h.a.createElement(M.Provider,{value:this.state},this.props.children)}}]),t}(h.a.Component),A=Object(v.b)(function(e){return{currentLocale:y(e)}})(T)},646:function(e,t,n){"use strict";var r=n(10),a=n.n(r),i=n(12),c=n.n(i),o=n(35),s=n(1),u=n(534),l=n.n(u),d=n(526),E=n.n(d),f=function(e){var t=e.isPlaceholder,n=e.data,r=e.dimensionUnit,i=e.prefixActions,c=(e.hasError,e.children),o=e.translate;if(t)return a.a.createElement("div",{className:"packages__packages-row placeholder"},a.a.createElement("div",{className:"packages__packages-row-icon"},a.a.createElement(l.a,{icon:"product",size:18})),a.a.createElement("div",{className:"packages__packages-row-details"},a.a.createElement("div",{className:"packages__packages-row-details-name"},a.a.createElement("span",null))),a.a.createElement("div",{className:"packages__packages-row-dimensions"},a.a.createElement("span",null)),a.a.createElement("div",{className:"packages__packages-row-actions"},c));var u,d=function(){return a.a.createElement("div",{className:"packages__packages-row-actions"},c)};return a.a.createElement("div",{className:E()("packages__packages-row",{prefixed:i})},i?d():null,a.a.createElement("div",{className:"packages__packages-row-icon"},function(e){var t=e?"mail":"product";return a.a.createElement(l.a,{icon:t,size:18})}(n.is_letter)),a.a.createElement("div",{className:"packages__packages-row-details"},a.a.createElement("div",{className:"packages__packages-row-details-name"},(u=n.name)&&""!==Object(s.trim)(u)?u:o("Untitled"))),a.a.createElement("div",{className:"packages__packages-row-dimensions"},n.inner_dimensions," ",r),i?null:d())};f.propTypes={siteId:c.a.number.isRequired,isPlaceholder:c.a.bool,data:c.a.shape({name:c.a.string,is_letter:c.a.bool,inner_dimensions:c.a.string}).isRequired,prefixActions:c.a.bool,dimensionUnit:c.a.string},t.a=Object(o.localize)(f)},647:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(535);function a(e,t,n){return{type:r.L,successAction:e,failureAction:t,onlyPackages:n||!1}}},651:function(e,t,n){"use strict";var r=n(110),a=n.n(r),i=n(36),c=n.n(i),o=n(1),s=n(538),u={modalErrors:{},pristine:!0},l=function(e){return null===e||""===Object(o.trim)(e)},d={};d[s.n]=function(e){var t=e.packages&&e.packages.predefined?e.packages.predefined:{},n=c()({},e,{showModal:!0,mode:"add-custom",currentlyEditingPredefinedPackages:Object(o.cloneDeep)(t)});return"edit"!==e.mode&&n.packageData||(n.packageData={is_user_defined:!0}),n},d[s.p]=function(e,t){return Object.assign({},e,{showModal:!0,modalReadOnly:!1,mode:"edit",packageData:t.package,showOuterDimensions:!1})},d[s.o]=function(e){return Object.assign({},e,{modalErrors:{},showModal:!1,showOuterDimensions:!1})},d[s.z]=function(e,t){return Object.assign({},e,{modalErrors:t.value})},d[s.D]=function(e,t){var n=Object.assign({},e.packageData,t.values),r=Object(o.omitBy)(n,l);return Object.assign({},e,{packageData:r,pristine:!1})},d[s.t]=function(e,t){var n=t.packageData,r=e.packages.custom||[];(n.box_weight&&(n.box_weight=Number.parseFloat(n.box_weight)),n.max_weight&&(n.max_weight=Number.parseFloat(n.max_weight)),"index"in n)?r[n.index]=Object(o.omit)(n,"index"):r.push(n);return e=d[s.o](e),c()({},e,{mode:"add-custom",packageData:{is_user_defined:!0},packages:c()({},e.packages,{custom:r}),pristine:!1})},d[s.B]=function(e){return c()({},e,{showOuterDimensions:!0})},d[s.r]=function(e,t){var n=a()(e.packages.custom);return n.splice(t.index,1),c()({},e,{packages:c()({},e.packages,{custom:n}),pristine:!1,showModal:!1})},d[s.A]=function(e,t){var n=t.serviceId,r=t.groupId,a=t.checked,i=e.predefinedSchema[n][r].definitions.map(function(e){return e.id}),s=e.currentlyEditingPredefinedPackages[n],u=a?Object(o.uniq)(Object(o.concat)(s,i)):Object(o.difference)(s,i),l=c()({},e.currentlyEditingPredefinedPackages);return l[n]=u,c()({},e,{currentlyEditingPredefinedPackages:l,pristine:!1})},d[s.C]=function(e,t){var n=t.serviceId,r=t.packageId,i=c()({},e.currentlyEditingPredefinedPackages),o=a()(i[n]||[]),s=o.indexOf(r);return-1===s?o.push(r):o.splice(s,1),i[n]=o,c()({},e,{currentlyEditingPredefinedPackages:i,pristine:!1})},d[s.s]=function(e,t){var n=t.serviceId,r=t.packageId,i=c()({},e.packages.predefined),o=a()(i[n]||[]),s=o.indexOf(r);return-1!==s&&o.splice(s,1),i[n]=o,c()({},e,{packages:c()({},e.packages,{predefined:i}),pristine:!1})},d[s.u]=function(e){var t=e.currentlyEditingPredefinedPackages;return e=d[s.o](e),c()({},e,{packages:c()({},e.packages,{predefined:t}),pristine:!1})},d[s.v]=function(e,t){var n=t.mode;return c()({},e,{mode:n})},d[s.y]=function(e,t){return Object.assign({},e,{isSaving:t.isSaving,pristine:!t.isSaving})},d[s.w]=function(e,t){var n=t.isFetching;return c()({},e,{isFetching:n})},d[s.x]=function(e,t){var n=t.isFetchError;return c()({},e,{isFetchError:n})},d[s.q]=function(e,t){var n=t.packages,r=t.dimensionUnit,a=t.weightUnit,i=t.packageSchema,o=t.predefinedSchema;return c()({},e,{packages:n,dimensionUnit:r,weightUnit:a,packageSchema:i,predefinedSchema:o,packageData:e.packageData||{is_user_defined:!0},isLoaded:!0})};t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;return"function"===typeof d[t.type]?d[t.type](e,t):e}},652:function(e,t,n){"use strict";var r=n(34),a=n.n(r),i=n(36),c=n.n(i),o=n(538),s={meta:{error:!1,fieldsStatus:!1,isSaving:!1,isFetching:!1,isLoaded:!1,isFetchError:!1,pristine:!0},data:null,pristineData:null},u={};u[o.i]=function(e,t){var n=t.storeOptions,r=t.formData,a=t.formMeta,i=t.userMeta;return c()({},e,{storeOptions:n,meta:c()({},e.meta,a,{pristine:!0,isLoaded:!0,user:i}),data:c()({},e.data,r)})},u[o.l]=function(e,t){var n=t.key,r=t.value,i=e.meta.pristine?e.data:e.pristineData;return c()({},e,{meta:c()({},e.meta,{pristine:!1}),data:c()({},e.data,a()({},n,r)),pristineData:i})},u[o.m]=function(e,t){var n=t.key,r=t.value;return c()({},e,{meta:c()({},e.meta,a()({},n,r))})},u[o.k]=function(e){return e.meta.pristine?e:c()({},e,{meta:c()({},e.meta,{pristine:!0}),data:e.pristineData,pristineData:null})},u[o.j]=function(e){return c()({},e,{addCardDialog:!0})},u[o.h]=function(e){return c()({},e,{addCardDialog:null})};t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;return u[t.type]?u[t.type](e,t):e}},657:function(e,t,n){"use strict";var r,a=n(110),i=n.n(a),c=n(36),o=n.n(c),s=n(118),u=n.n(s),l=n(34),d=n.n(l),E=n(47),f=n.n(E),m=n(593),p=n(535),O=f()("woocommerce:action-list");t.a=(r={},d()(r,p.d,[function(e,t){var n=e.dispatch,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),a=t.actionList,i=a.prevSteps,c=a.currentStep,s=a.nextSteps||[],l=u()(s),d=l[0],E=l.slice(1);if(c)return void O("[handleStepNext] Warning: Attempting before current step finishes. Ignoring.");if(!d)return void O("[handleStepNext] Warning: Attempting with no nextSteps left. Ignoring.");var f=o()({},a,{prevSteps:i,currentStep:o()({},d,{startTime:r}),nextSteps:E});n(Object(m.a)(f)),d.onStep(n,f)}]),d()(r,p.e,[function(e,t){var n=e.dispatch,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),a=t.actionList,c=a.prevSteps,s=a.currentStep,u=a.nextSteps;if(!s)return void O("[handleStepSuccess] Warning: Attempting with no current step. Ignoring.");var l=o()({},a,{prevSteps:[].concat(i()(c||[]),[o()({},s,{endTime:r})]),currentStep:null,nextSteps:u});n(Object(m.a)(l)),u&&u.length>0?n(Object(m.d)(l)):a.onSuccess&&a.onSuccess(n,l)}]),d()(r,p.c,[function(e,t){var n=e.dispatch,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),a=t.actionList,c=t.error,s=a.prevSteps,u=a.currentStep,l=a.nextSteps;if(!u)return void O("[handleStepFailure] Warning: Attempting with no current step. Ignoring.");var d=o()({},a,{prevSteps:[].concat(i()(s||[]),[o()({},u,{endTime:r,error:c})]),currentStep:null,nextSteps:l});n(Object(m.a)(d)),a.onFailure&&a.onFailure(n,d)}]),r)},658:function(e,t,n){"use strict";var r,a=n(34),i=n.n(a),c=n(46),o=n(535),s=n(539),u=n(602);t.a=Object(c.b)(null,(r={},i()(r,o.k,function(){return s.b}),i()(r,o.l,function(e,t){return t.data.map(function(e){return{code:e.code,name:Object(u.a)(e.name),countries:e.countries.map(function(e){return{code:e.code,name:Object(u.a)(e.name),states:e.states.map(function(e){return{code:e.code,name:Object(u.a)(e.name)}})}})}})}),i()(r,o.j,function(e,t){var n=t.originalAction.type;return o.k===n?s.a:e}),r))},673:function(e,t,n){"use strict";n.d(t,"a",function(){return T});n(530);var r=n(107),a=n.n(r),i=n(108),c=n.n(i),o=n(528),s=n.n(o),u=n(527),l=n.n(u),d=(n(531),n(529)),E=n.n(d),f=n(34),m=n.n(f),p=n(12),O=n.n(p),_=n(10),g=n(47),b=n.n(g),h=(n(674),n(35)),v=n.n(h),C=n(1),S=b()("calypso:protect-form"),I=[],j=0;function R(e){if(I.length){S("unsaved form changes detected");var t=v.a.translate("You have unsaved changes.");return(e||window.event).returnValue=t,t}}function N(){0===j&&window.addEventListener("beforeunload",R),j++}function y(){0===--j&&window.removeEventListener("beforeunload",R)}function P(e){Object(C.includes)(I,e)||I.push(e)}function M(e){I=Object(C.without)(I,e)}var T=function(e){function t(){return a()(this,t),s()(this,l()(t).apply(this,arguments))}return E()(t,e),c()(t,[{key:"componentDidMount",value:function(){N(),this.props.isChanged&&P(this)}},{key:"componentWillUnmount",value:function(){y(),M(this)}},{key:"componentWillReceiveProps",value:function(e){e.isChanged!==this.props.isChanged&&(e.isChanged?P(this):M(this))}},{key:"render",value:function(){return null}}]),t}(_.Component);m()(T,"propTypes",{isChanged:O.a.bool.isRequired})},675:function(e,t,n){"use strict";n.d(t,"a",function(){return I});var r=n(107),a=n.n(r),i=n(108),c=n.n(i),o=n(528),s=n.n(o),u=n(527),l=n.n(u),d=n(531),E=n.n(d),f=n(529),m=n.n(f),p=n(34),O=n.n(p),_=n(10),g=n.n(_),b=n(12),h=n.n(b),v=n(526),C=n.n(v),S=n(1),I=function(e){function t(){var e,n;a()(this,t);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return n=s()(this,(e=l()(t)).call.apply(e,[this].concat(i))),O()(E()(n),"onKeyDown",function(e){n.props.disabled||("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.props.onChange(!n.props.checked)),n.props.onKeyDown(e))}),O()(E()(n),"onClick",function(e){e&&e.stopPropagation&&e.stopPropagation(),n.props.disabled||n.props.onChange(!n.props.checked)}),O()(E()(n),"onLabelClick",function(e){if(!n.props.disabled){var t=e.target.nodeName.toLowerCase();"a"!==t&&"input"!==t&&"select"!==t&&(e.preventDefault(),n.props.onChange(!n.props.checked))}}),n}return m()(t,e),c()(t,[{key:"componentWillMount",value:function(){this.id=this.constructor.idNum++}},{key:"render",value:function(){var e=this.props.id||"toggle-"+this.id,t=C()("form-toggle__wrapper",this.props.wrapperClassName,{"is-disabled":this.props.disabled}),n=C()("form-toggle",this.props.className,{"is-toggling":this.props.toggling});return g.a.createElement("span",{className:t},g.a.createElement("input",{id:e,className:n,type:"checkbox",checked:this.props.checked,readOnly:!0,disabled:this.props.disabled}),g.a.createElement("label",{className:"form-toggle__label",htmlFor:e},g.a.createElement("span",{className:"form-toggle__switch",onClick:this.onClick,onKeyDown:this.onKeyDown,role:"checkbox","aria-checked":this.props.checked,"aria-label":this.props["aria-label"],tabIndex:this.props.disabled?-1:0}),this.props.children&&g.a.createElement("span",{className:"form-toggle__label-content",onClick:this.onLabelClick},this.props.children)))}}]),t}(_.PureComponent);O()(I,"propTypes",{onChange:h.a.func,onKeyDown:h.a.func,checked:h.a.bool,disabled:h.a.bool,id:h.a.string,className:h.a.string,wrapperClassName:h.a.string,toggling:h.a.bool,"aria-label":h.a.string}),O()(I,"defaultProps",{checked:!1,disabled:!1,onKeyDown:S.noop,onChange:S.noop}),O()(I,"idNum",0)},676:function(e,t,n){"use strict";var r=n(107),a=n.n(r),i=n(108),c=n.n(i),o=n(528),s=n.n(o),u=n(527),l=n.n(u),d=n(529),E=n.n(d),f=n(10),m=n(12),p=n.n(m),O=n(109),_=n(30),g=n(567),b=n(543),h=function(e){function t(){return a()(this,t),s()(this,l()(t).apply(this,arguments))}return E()(t,e),c()(t,[{key:"fetch",value:function(e){var t=e.siteId,n=e.loaded,r=e.fetching,a=e.error;n||r||a||this.props.fetchSettings(t)}},{key:"UNSAFE_componentWillMount",value:function(){this.fetch(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.fetch(e)}},{key:"render",value:function(){return null}}]),t}(f.Component);h.propTypes={siteId:p.a.number.isRequired},t.a=Object(O.b)(function(e){return{loaded:Object(b.d)(e),fetching:Object(b.c)(e),error:Object(b.b)(e)}},function(e){return Object(_.b)({fetchSettings:g.a},e)})(h)},677:function(e,t,n){"use strict";var r=n(107),a=n.n(r),i=n(108),c=n.n(i),o=n(528),s=n.n(o),u=n(527),l=n.n(u),d=n(529),E=n.n(d),f=n(10),m=n(12),p=n.n(m),O=n(109),_=n(30),g=n(555),b=n(541),h=function(e){function t(){return a()(this,t),s()(this,l()(t).apply(this,arguments))}return E()(t,e),c()(t,[{key:"fetch",value:function(e){var t=e.siteId,n=e.loaded,r=e.fetching,a=e.error;n||r||a||this.props.fetchSettings(t)}},{key:"UNSAFE_componentWillMount",value:function(){this.fetch(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.fetch(e)}},{key:"render",value:function(){return null}}]),t}(f.Component);h.propTypes={siteId:p.a.number.isRequired},t.a=Object(O.b)(function(e){return{loaded:Object(b.i)(e),fetching:Object(b.h)(e),error:Object(b.g)(e)}},function(e){return Object(_.b)({fetchSettings:g.fetchSettings},e)})(h)},678:function(e,t,n){"use strict";var r=n(10),a=n.n(r),i=n(12),c=n.n(i),o=n(679),s=n.n(o),u=n(680),l=n.n(u),d=n(681),E=n.n(d),f={ups:s.a,usps:l.a,dhlexpress:E.a},m=function(e){var t=e.carrier,n=e.size;if(!t||!f[t.toLowerCase()])return a.a.createElement("span",null);var r="".concat(function(e){switch(e){case"small":return 24;case"big":return 40;case"medium":default:return 30}}(n),"px");return a.a.createElement("div",{style:{width:r},className:"carrier-icon"},a.a.createElement("img",{src:f[t.toLowerCase()],alt:t,className:"carrier-icon__logo"}))};m.propTypes={carrier:c.a.string.isRequired,size:c.a.number},t.a=m},679:function(e,t,n){e.exports=n.p+"images/881843a7135b8abd4794bd2d33dc8b3c.png"},680:function(e,t,n){e.exports=n.p+"images/41c6838923ebde874f7fc71db18dcae5.png"},681:function(e,t,n){e.exports=n.p+"images/224d57e46d3ace2d89e5c790bd828d32.png"},684:function(e,t,n){"use strict";var r=n(36),a=n.n(r),i=n(10),c=n.n(i),o=n(12),s=n.n(o),u=n(109),l=n(35),d=n(1),E=n(534),f=n.n(E),m=n(34),p=n.n(m),O=n(107),_=n.n(O),g=n(108),b=n.n(g),h=n(528),v=n.n(h),C=n(527),S=n.n(C),I=n(529),j=n.n(I),R=n(30),N=n(526),y=n.n(N),P=n(557),M=n(589);function T(e){return Object(d.get)(e,["currentUser","id"])}function A(e){var t=T(e);return t?function(e,t){return e.users.items[t]}(e,t):null}var k=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n){var r=A(n);return Object(d.get)(r,e,t)}};k("localeSlug"),k("localeVariant"),k("user_ip_country_code");k("date"),k("username"),k("email");k("email_verified",!1);var L=n(532),D=n(562);function w(e){var t=Object(L.a)(e);return t||1!==function(e){var t=A(e);return t?t.site_count||0:null}(e)||(t=function(e){var t=A(e);return Object(d.get)(t,"primary_blog",null)}(e)),Object(D.a)(e,t)}var W=n(539),U=function(e,t){return Object(d.get)(e,["extensions","woocommerce","sites",t,"settings","products"])},x=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(L.a)(e);return Object(d.isArray)(U(e,t))},G=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(L.a)(e);return W.b===U(e,t)};function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(L.a)(e),n=U(e,t);return Object(d.find)(n,function(e){return"woocommerce_dimension_unit"===e.id})||{}}var H=n(561),F=n(556),B=n(535),q=function(e){return function(t,n){if(!x(n(),e)&&!G(n(),e)){var r={type:B.N,siteId:e};return t(r),Object(H.a)(e).get("settings/products").then(function(n){t({type:B.O,siteId:e,data:n})}).catch(function(n){t(Object(F.a)(e,r,n))})}}},z=function(e){function t(){return _()(this,t),v()(this,S()(t).apply(this,arguments))}return j()(t,e),b()(t,[{key:"componentDidMount",value:function(){var e=this.props.siteId;e&&this.props.fetchSettingsProducts(e)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.siteId!==this.props.siteId&&this.props.fetchSettingsProducts(e.siteId)}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.noWrap,r=e.dimensions,a=e.onChange,i=e.translate,o=e.dimensionsUnit,s=y()("form-dimensions-input",t,{"no-wrap":n});return c.a.createElement("div",{className:s},c.a.createElement(P.a,{name:"length",placeholder:i("L",{comment:"Length placeholder for dimensions input"}),type:"number",value:r&&r.length||"",onChange:a,className:"form-dimensions-input__length"}),c.a.createElement(P.a,{name:"width",placeholder:i("W",{comment:"Width placeholder for dimensions input"}),type:"number",value:r&&r.width||"",onChange:a,className:"form-dimensions-input__width"}),c.a.createElement(M.a,{name:"height",placeholder:i("H",{comment:"Height placeholder for dimensions input"}),suffix:o,type:"number",noWrap:n,value:r&&r.height||"",onChange:a,className:"form-dimensions-input__height"}))}}]),t}(i.Component);p()(z,"propTypes",{className:s.a.string,dimensions:s.a.shape({width:s.a.string,height:s.a.string,length:s.a.string}),dimensionsUnit:s.a.string,onChange:s.a.func.isRequired,noWrap:s.a.bool}),p()(z,"defaultProps",{value:"",className:"",onChange:d.noop,noWrap:!1});var Z=Object(u.b)(function(e,t){var n=t.dimensionsUnit,r=w(e);if(!n){var a=r&&V(e,r.ID);n=a&&a.value||"in"}return{siteId:r&&r.ID,dimensionsUnit:n}},function(e){return Object(R.b)({fetchSettingsProducts:q},e)})(Object(l.localize)(z)),K=n(545),Q=n(546),Y=n(579),$=n(550),X=/^\.\d+$/,J=/^\d+\.$/,ee=function(e){return e=Object(d.trim)(e),X.test(e)?e="0"+e:J.test(e)&&(e=e.slice(0,e.length-1)),e},te=/^\s*(\S+)\s*x\s*(\S+)\s*x\s*(\S+)\s*$/,ne=/^\s*(\S+)?\s*x\s*(\S+)?\s*x\s*(\S+)?\s*$/,re=function(e){return isNaN(e)?"":0>=e?"":e},ae=function(e){return Object(d.trim)(e)},ie=ee,ce=function(e){var t=te.exec(e);return t?[t[1],t[2],t[3]].map(ee).join(" x "):e},oe=function(e){var t="",n="",r="",a=ne.exec(e);return a&&4===a.length&&(t=re(a[1]),n=re(a[2]),r=re(a[3])),{length:t,width:n,height:r}},se=function(e){var t=e.siteId,n=e.form,r=e.setModalErrors,a=e.updatePackagesField,i=e.translate,o=n.mode,s=n.modalErrors,u=n.dimensionUnit,l=n.weightUnit,E=n.packageData,f=E.name,m=E.inner_dimensions,O=E.box_weight,_=E.is_letter,g=function(e,n){r(t,Object(d.omit)(s,e)),a(t,p()({},e,n))},b=function(e){var t=e.target.name,n=e.target.value;g(t,n)},h=function(e,t){var n=t||i("Invalid value."),r=""===Object(d.trim)(E[e])?i("This field is required."):n;return s[e]?c.a.createElement($.a,{text:r}):null},v=function(e){a(t,{is_letter:"envelope"===e.target.value})};return c.a.createElement("div",{className:"packages__properties-group"},"add-custom"===o?c.a.createElement(K.a,null,c.a.createElement(Q.a,{htmlFor:"package_type"},i("Type of package")),c.a.createElement(Y.a,{id:"package_type",onChange:v,value:_?"envelope":"box"},c.a.createElement("option",{value:"box"},i("Box")),c.a.createElement("option",{value:"envelope"},i("Envelope")))):null,c.a.createElement(K.a,null,c.a.createElement(Q.a,{htmlFor:"name"},i("Package name")),c.a.createElement(P.a,{id:"name",name:"name",placeholder:i("Unique package name"),value:f||"",onChange:b,isError:s.name}),h("name",i("This field must be unique"))),c.a.createElement(K.a,{className:"packages__add-package-weight-group"},c.a.createElement("div",{className:"packages__add-package-weight"},c.a.createElement(Q.a,null,i("Dimensions (L x W x H)")),function(e,t,n,r){var a=oe(t),i=a.length,o=a.width,s=a.height;return c.a.createElement(Z,{dimensionsUnit:n,dimensions:{width:o,height:s,length:i},onChange:function(t){var n=t.target.name,a=t.target.value;r(e,["length"===n?a:i,"width"===n?a:o,"height"===n?a:s].join(" x "))}})}("inner_dimensions",m,u,g),h("inner_dimensions")),c.a.createElement("div",{className:"packages__add-package-weight"},c.a.createElement(Q.a,{htmlFor:"box_weight"},i("Weight of empty package")),c.a.createElement(M.a,{id:"box_weight",name:"box_weight",placeholder:i("0.0"),value:O||"",onChange:b,isError:s.box_weight,type:"number",noWrap:!0,suffix:l}),h("box_weight"))))};se.propTypes={siteId:s.a.number.isRequired,form:s.a.object.isRequired,updatePackagesField:s.a.func.isRequired,packageData:s.a.shape({name:s.a.string.isRequired,inner_dimensions:s.a.string.isRequired,box_weight:s.a.number.isRequired,is_user_defined:s.a.bool.isRequired,is_letter:s.a.bool.isRequired}),setModalErrors:s.a.func.isRequired};var ue=Object(l.localize)(se),le=n(113),de=n.n(le),Ee=Object(d.memoize)(function(e){return de()(e,{greedy:!0})}),fe=function(e){return e&&""!==Object(d.trim)(e)?e:null},me=function(e,t){return e=fe(e),Object(d.some)(t,function(t){return t===e})?null:e},pe=/^\d+(\.\d+)?$/,Oe=function(e){return pe.test(e)?Number.parseFloat(e):null},_e=function(e,t,n){var r,a=Ee(n);return a(function(e,t){var n=Oe(e.box_weight),r=Oe(e.max_weight);n&&r&&r<=n&&(r=null);var a={name:me(e.name,t),inner_dimensions:e.inner_dimensions,outer_dimensions:fe(e.outer_dimensions),box_weight:n,max_weight:r};return Object(d.omitBy)(a,function(e){return null===e})}(e,t)),r=a.errors,Object(d.reduce)(r,function(e,t){if(t.field){var n,r=t.field.replace("data.","");Object.assign(e,(n={},p()(n,r,!0),p()(n,"any",!0),n))}return e},{})},ge=n(551),be=n(548),he=n(580),ve=function(e){var t=e.className,n=e.disabled,r=e.id,a=e.onToggle,i=e.readOnly,o=e.selectedElements,s=e.totalElements,u=o&&o===s,l=o&&o<s,d=y()("bulk-select__box",{"is-checked":u}),E=y()("bulk-select__some-checked-icon",{"is-disabled":n}),m=y()("bulk-select",t);return c.a.createElement("span",{className:m},c.a.createElement("span",{className:"bulk-select__container"},c.a.createElement("input",{id:r,type:"checkbox",className:d,onChange:function(e){i||a(!(l||u),e)},checked:u,disabled:n}),l?c.a.createElement(f.a,{className:E,icon:"minus-small",size:18}):null))};ve.propTypes={totalElements:s.a.number.isRequired,selectedElements:s.a.number.isRequired,onToggle:s.a.func,readOnly:s.a.bool,className:s.a.string,disabled:s.a.bool};var Ce=ve,Se=n(599),Ie=n(615),je=n(646),Re=n(541),Ne=function(e){var t=e.siteId,n=e.form,r=e.toggleAll,a=e.togglePackage,i=e.currentlyEditingPredefinedPackages,o=e.translate,s=n.dimensionUnit,u=function(e){var n="group-".concat(e.serviceId,"-").concat(e.groupId);return c.a.createElement("div",{className:"packages__group-header"},c.a.createElement("label",{htmlFor:n,onClick:function(e){return e.stopPropagation()}},c.a.createElement(Ce,{id:n,totalElements:e.total,selectedElements:e.selected,onToggle:function(n,a){a.stopPropagation(),r(t,e.serviceId,e.groupId,a.target.checked)},className:"packages__group-header-checkbox"}),e.title))};return c.a.createElement("div",null,function(){var e=[];return Object(d.forEach)(i,function(n,r){var i,l,d=(i=n.selected,l=n.total,i===l?o("All packages selected"):o("%(selectedCount)d package selected","%(selectedCount)d packages selected",{count:i,args:{selectedCount:i}}));e.push(c.a.createElement(Se.a,{className:"packages__predefined-packages",key:r,header:u(n),summary:d,expandedSummary:d,clickableHeader:!0,expanded:!1,screenReaderText:o("Expand Services"),icon:"chevron-down"},function(e){return e.packages.map(function(e,n){return c.a.createElement(je.a,{key:n,siteId:t,data:e,dimensionUnit:s,prefixActions:!0},c.a.createElement(Ie.a,{checked:e.selected,onChange:function(){return a(t,e.serviceId,e.id)}}))})}(n)))}),e}())};Ne.propTypes={siteId:s.a.number.isRequired,toggleAll:s.a.func.isRequired,togglePackage:s.a.func.isRequired,form:s.a.shape({dimensionUnit:s.a.string}).isRequired};var ye=Object(u.b)(function(e){return{currentlyEditingPredefinedPackages:Object(Re.c)(e)}})(Object(l.localize)(Ne)),Pe=n(531),Me=n.n(Pe),Te=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=v()(this,(e=S()(t)).call.apply(e,[this].concat(a))),p()(Me()(n),"handleKeyEvent",function(e){switch(e.keyCode){case 13:case 32:e.preventDefault(),document.activeElement.click()}}),n}return j()(t,e),b()(t,[{key:"render",value:function(){var e=y()({"segmented-control__item":!0,"is-selected":this.props.selected}),t=y()("segmented-control__link",p()({},"item-index-".concat(this.props.index),null!=this.props.index));return c.a.createElement("li",{className:e},c.a.createElement("a",{href:this.props.path,className:t,onClick:this.props.onClick,title:this.props.title,"data-e2e-value":this.props.value,role:"radio",tabIndex:0,"aria-checked":this.props.selected,onKeyDown:this.handleKeyEvent},c.a.createElement("span",{className:"segmented-control__text"},this.props.children)))}}]),t}(c.a.Component);p()(Te,"propTypes",{children:s.a.node.isRequired,path:s.a.string,selected:s.a.bool,title:s.a.string,value:s.a.string,onClick:s.a.func,index:s.a.number}),p()(Te,"defaultProps",{selected:!1});var Ae=Te,ke=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=v()(this,(e=S()(t)).call.apply(e,[this].concat(a))),p()(Me()(n),"state",{selected:n.props.initialSelected||n.props.options[0].value}),n}return j()(t,e),b()(t,[{key:"renderOptions",value:function(){var e=this;return this.props.options.map(function(t,n){return c.a.createElement(Ae,{index:n,key:n,onClick:function(){e.setState({selected:t.value}),e.props.onSelect&&e.props.onSelect(t)},path:t.path,selected:e.state.selected===t.value,value:t.value},t.label)})}},{key:"render",value:function(){var e={"is-compact":this.props.compact,"is-primary":this.props.primary};return c.a.createElement("ul",{className:y()("segmented-control",e,this.props.className),style:this.props.style,role:"radiogroup"},this.renderOptions())}}]),t}(c.a.Component);p()(ke,"propTypes",{className:s.a.string,compact:s.a.bool,initialSelected:s.a.string,onSelect:s.a.func,options:s.a.arrayOf(s.a.shape({value:s.a.string.isRequired,label:s.a.string.isRequired,path:s.a.string})).isRequired,style:s.a.object});var Le=n(647),De=n(549),we=n(555),We=function(e){var t,n=e.siteId,r=e.form,a=e.predefinedPackagesSummary,i=e.setModalErrors,o=e.savePackage,s=e.savePredefinedPackages,u=e.dismissModal,l=e.removePackage,E=e.setAddMode,m=e.updatePackagesField,p=e.translate,O=r.showModal,_=r.mode,g=r.packages,b=r.packageSchema,h=r.predefinedSchema,v=r.packageData,C=v.index,S=g.custom,I="edit"===_,j="add-custom"===_,R="add-predefined"===_,N=function(){var t={duration:5e3};e.createWcsShippingSaveActionList(function(){return"function"===typeof e.onSaveSuccess&&"name"in v&&e.onSaveSuccess(v.name),e.successNotice(p("Your shipping packages have been saved."),t)},function(){return e.errorNotice(p("Unable to save your shipping packages. Please try again."),t)},!0)},y=function(){u(n)},P=p(I?"Edit package":"Add a package"),M=j||R,T=j||I,A=R;t=j||R&&0===a.removed?p("Add package","Add packages",{count:j?1:a.added}):p("Done");var k=[c.a.createElement(he.a,{onClick:function(){if(R)return s(n),void(e.persistOnSave&&N());var t="number"===typeof v.index?S[v.index].name:null,r=Object(d.concat)(Object(d.difference)(S.map(function(e){return e.name}),[t]),Object(d.flatten)(Object(d.map)(h,function(e){return Object(d.map)(e,function(e){return e.definitions})})),["individual"]),a=Object.assign({},v,{name:ae(v.name),inner_dimensions:ce(v.inner_dimensions),outer_dimensions:ce(v.outer_dimensions),box_weight:ie(v.box_weight),max_weight:0}),c=_e(a,r,b);if(c.any)return m(n,a),void i(n,c);o(n,a),e.persistOnSave&&N()}},t),c.a.createElement(he.a,{onClick:y,isPrimary:!1},p("Cancel"))];return I&&k.unshift({action:"delete",label:c.a.createElement("span",null,p("{{icon/}} Delete this package",{components:{icon:c.a.createElement(f.a,{icon:"trash"})}})),onClick:function(){return l(n,C)},additionalClassNames:"packages__delete is-scary is-borderless"}),c.a.createElement(ge.a,{isVisible:O,additionalClassNames:"packages__add-edit-dialog woocommerce wcc-root",onClose:y,buttons:k},c.a.createElement(be.a,{className:"packages__add-edit-title"},P),M&&c.a.createElement(ke,{primary:!0,className:"packages__mode-select",initialSelected:_,onSelect:function(e){E(n,e.value)},options:[{value:"add-custom",label:"Custom package"},{value:"add-predefined",label:"Service package"}]}),T&&c.a.createElement(ue,e),A&&c.a.createElement(ye,e))};We.propTypes={siteId:s.a.number.isRequired,dismissModal:s.a.func.isRequired,form:s.a.object.isRequired,updatePackagesField:s.a.func.isRequired,savePackage:s.a.func.isRequired,packageData:s.a.shape({index:s.a.number.isRequired}),setModalErrors:s.a.func.isRequired,removePackage:s.a.func.isRequired,setAddMode:s.a.func.isRequired};t.a=Object(u.b)(function(e){return{predefinedPackagesSummary:Object(Re.f)(e)}},function(e){return Object(R.b)(a()({createWcsShippingSaveActionList:Le.a,errorNotice:De.a,successNotice:De.d},we),e)})(Object(l.localize)(We))},770:function(e,t,n){},771:function(e,t,n){},791:function(e,t,n){"use strict";n.r(t);var r=n(10),a=n.n(r),i=n(107),c=n.n(i),o=n(108),s=n.n(o),u=n(528),l=n.n(u),d=n(527),E=n.n(d),f=n(531),m=n.n(f),p=n(529),O=n.n(p),_=n(34),g=n.n(_),b=n(109),h=n(30),v=n(35),C=n.n(v),S=n(542),I=n(631),j=n(12),R=n.n(j),N=n(526),y=n.n(N),P=n(1),M=n(559),T=n(530),A=n.n(T),k=n(560),L=n(533),D=n.n(L),w={en:{symbol:"K",grouping:",",decimal:"."},es:{symbol:" mil",grouping:".",decimal:","},"pt-br":{symbol:" mil",grouping:".",decimal:","},de:{symbol:" Tsd.",grouping:".",decimal:","},fr:{symbol:" k",grouping:" ",decimal:","},he:{symbol:"K",grouping:",",decimal:"."},ja:{symbol:"\u4e07",unitValue:1e4,grouping:",",decimal:"."},nl:{symbol:"K",grouping:".",decimal:","},tr:{symbol:" B",grouping:".",decimal:","},id:{symbol:" rb",grouping:".",decimal:","},"zh-cn":{symbol:"\u4e07",unitValue:1e4,grouping:",",decimal:"."},"zh-tw":{symbol:"\u842c",unitValue:1e4,grouping:",",decimal:"."},ko:{symbol:"\ucc9c",grouping:",",decimal:"."},ar:{symbol:" \u0623\u0644\u0641",grouping:"\u066c",decimal:"\u066b"},sv:{symbol:" tn",grouping:" ",decimal:","}};n(770);var W=function(e){var t=e.count,n=e.compact,r=e.numberFormat,i=e.primary,c=D()(e,["count","compact","numberFormat","primary"]);return a.a.createElement("span",A()({className:y()("count",{"is-primary":i})},Object(P.omit)(c,["translate","moment"])),n&&function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:C.a.getLocaleSlug();if(isNaN(e)||!w[t])return null;var n=w[t],r=n.decimal,a=n.grouping,i=n.symbol,c=n.unitValue,o=void 0===c?1e3:c,s=e<0?"-":"",u=Math.abs(e);if(u<o)return"".concat(s).concat(u);var l=u<10*o?1:0,d=Object(v.numberFormat)(u/o,{decimals:l,thousandsSep:a,decPoint:r});return"".concat(s).concat(d).concat(i)}(t)||r(t))};W.propTypes={count:R.a.number.isRequired,numberFormat:R.a.func,primary:R.a.bool,compact:R.a.bool},W.defaultProps={primary:!1,compact:!1};var U=Object(v.localize)(W),x=(n(771),function(e){function t(){return c()(this,t),l()(this,E()(t).apply(this,arguments))}return O()(t,e),s()(t,[{key:"render",value:function(){var e="number"===typeof this.props.count,t=!(this.props.label||e||this.props.children),n=y()(this.props.className,"section-header",{"is-empty":t}),r={id:this.props.id};return a.a.createElement(k.a,A()({className:n,href:this.props.href},r),a.a.createElement("div",{className:"section-header__label"},a.a.createElement("span",{className:"section-header__label-text"},this.props.label),e&&a.a.createElement(U,{count:this.props.count})),a.a.createElement("div",{className:"section-header__actions"},this.props.children))}}]),t}(r.PureComponent));g()(x,"defaultProps",{label:"",href:null});var G=function(e){function t(){return c()(this,t),l()(this,E()(t).apply(this,arguments))}return O()(t,e),s()(t,[{key:"render",value:function(){var e=this.props,t=e.label,n=e.description,r=e.children,i=a.a.createElement("div",null,a.a.createElement("div",{className:"extended-header__header"},t),a.a.createElement("div",{className:"extended-header__header-description"},n));return a.a.createElement(x,{className:"extended-header",label:i},r)}}]),t}(r.Component),V=n(675),H=n(36),F=n.n(H),B=n(534),q=n.n(B),z=n(604),Z=n(615),K=n(545),Q=n(546),Y=n(579),$=n(553),X=n(640),J={alipay:"Alipay",amex:"American Express",bancontact:"Bancontact","brazil-tef":"Transfer\xeancia banc\xe1ria",diners:"Diners Club",discover:"Discover",eps:"eps",giropay:"Giropay",ideal:"iDEAL",jcb:"JCB",mastercard:"Mastercard",p24:"Przelewy24",paypal:"PayPal",placeholder:"",unionpay:"UnionPay",visa:"Visa",wechat:C.a.translate("WeChat Pay",{comment:"Name for WeChat Pay - https://pay.weixin.qq.com/"}),sofort:"Sofort"},ee=Object(P.keys)(J),te=function(e){function t(){return c()(this,t),l()(this,E()(t).apply(this,arguments))}return O()(t,e),s()(t,[{key:"render",value:function(){var e=this.props,t=e.altText,n=e.className,r=e.isCompact,i=e.type,c=y()("payment-logo","is-".concat(i),{"is-compact":r},n);return a.a.createElement("div",{className:c,"aria-label":t||J[i]||""})}}]),t}(a.a.Component);g()(te,"propTypes",{className:R.a.string,type:R.a.oneOf(ee),altText:R.a.string,isCompact:R.a.bool});var ne=te,re=function(e,t,n){var r={amex:e("American Express"),discover:e("Discover"),mastercard:e("MasterCard"),visa:e("VISA"),paypal:e("PayPal")};return r[t]?n?e("%(card)s ****%(digits)s",{args:{card:r[t],digits:n}}):r[t]:null},ae=function(e){var t=e.translate,n=e.selected,r=e.isLoading,i=e.type,c=e.digits,o=e.name,s=e.expiry,u=e.onSelect;if(r)return a.a.createElement(k.a,{className:"label-settings__card"},a.a.createElement(Z.a,{className:"label-settings__card-checkbox"}),a.a.createElement(ne,{className:"label-settings__card-logo",type:"placeholder",altText:""}),a.a.createElement("div",{className:"label-settings__card-details"},a.a.createElement("p",{className:"label-settings__card-number"}),a.a.createElement("p",{className:"label-settings__card-name"})),a.a.createElement("div",{className:"label-settings__card-date"},a.a.createElement("p",null)));var l=re(t,i,c),d=l?i:"placeholder",E=l||i;return a.a.createElement(k.a,{className:"label-settings__card",onClick:u},a.a.createElement(Z.a,{className:"label-settings__card-checkbox",checked:n,onChange:u}),a.a.createElement(ne,{className:"label-settings__card-logo",type:d,altText:l}),a.a.createElement("div",{className:"label-settings__card-details"},a.a.createElement("p",{className:"label-settings__card-number"},E),a.a.createElement("p",{className:"label-settings__card-name"},o)),a.a.createElement("div",{className:"label-settings__card-date"},t("Expires %(date)s",{args:{date:s},context:"date is of the form MM/YY"})))};ae.propTypes={selected:R.a.bool.isRequired,isLoading:R.a.bool,type:R.a.string,digits:R.a.string,name:R.a.string,expiry:R.a.string,onSelect:R.a.func};var ie=Object(v.localize)(ae),ce=n(645),oe=n(567),se=n(543),ue=function(){return null},le=function(){return null},de=function(e){function t(){var e,n;c()(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=l()(this,(e=E()(t)).call.apply(e,[this].concat(i))),g()(m()(n),"renderPaymentPermissionNotice",function(){var e=n.props,t=e.canEditPayments,r=e.canEditSettings,i=e.masterUserName,c=e.masterUserLogin,o=e.translate;return!r||t?null:a.a.createElement($.a,{showDismiss:!1},o("Only the site owner can manage shipping label payment methods. Please contact %(ownerName)s (%(ownerLogin)s) to manage payment methods.",{args:{ownerName:i,ownerLogin:c}}))}),g()(m()(n),"refetchSettings",function(){n.props.fetchSettings(n.props.siteId)}),g()(m()(n),"renderPaymentWarningNotice",function(){var e=n.props,t=e.paymentMethodsWarning,r=e.translate;if(t)return a.a.createElement($.a,{status:"is-warning",showDismiss:!1,text:t},a.a.createElement(X.a,{onClick:n.refetchSettings},r("Retry")))}),g()(m()(n),"renderSettingsPermissionNotice",function(){var e=n.props,t=e.canEditSettings,r=e.masterUserName,i=e.masterUserLogin,c=e.translate;return t?null:a.a.createElement($.a,{showDismiss:!1},c("Only the site owner can change these settings. Please contact %(ownerName)s (%(ownerLogin)s) to change the shipping label settings.",{args:{ownerName:r,ownerLogin:i}}))}),g()(m()(n),"renderAddCardExternalInfo",function(){var e=n.props,t=e.masterUserWpcomLogin,r=e.masterUserEmail,i=e.translate;return t?a.a.createElement("p",null,i("Credit cards are retrieved from the following WordPress.com account: %(wpcomLogin)s <%(wpcomEmail)s>",{args:{wpcomLogin:t,wpcomEmail:r}})):null}),g()(m()(n),"onVisibilityChange",function(){document.hidden||n.refetchSettings(),n.addCreditCardWindow&&n.addCreditCardWindow.closed&&document.removeEventListener("visibilitychange",n.onVisibilityChange)}),g()(m()(n),"renderPaymentsSection",function(){var e=n.props,t=e.siteId,r=e.canEditPayments,i=e.paymentMethods,c=e.selectedPaymentMethod,o=e.isReloading,s=e.translate;if(!n.state.expanded){var u;if(c){var l=Object(P.find)(i,{payment_method_id:c}),d=l.card_type,E=l.card_digits;u=s("We'll charge the credit card on your account (%(card)s) to pay for the labels you print",{args:{card:re(s,d,E)}})}else u=s("To purchase shipping labels, add a credit card.");return a.a.createElement("div",null,n.renderPaymentPermissionNotice(),a.a.createElement("p",{className:"label-settings__credit-card-description"},u),r&&a.a.createElement("p",{className:"label-settings__credit-card-description"},a.a.createElement(S.a,{onClick:function(e){e.preventDefault(),n.setState({expanded:!0})},borderless:!0},s("Choose a different card"))))}var f,m;i.length?(f=s("To purchase shipping labels, choose a credit card you have on file or add a new card."),m=s("Add another credit card")):(f=s("To purchase shipping labels, add a credit card."),m=s("Add a credit card"));return a.a.createElement("div",null,n.renderPaymentPermissionNotice(),a.a.createElement("p",{className:"label-settings__credit-card-description"},f),!o&&n.renderPaymentWarningNotice(),a.a.createElement(ue,null),o?a.a.createElement("div",{className:"label-settings__placeholder"},a.a.createElement(ie,{selected:!1,isLoading:!0}),a.a.createElement(ie,{selected:!1,isLoading:!0})):i.map(function(e,t){return a.a.createElement(ie,{key:t,selected:c===e.payment_method_id,type:e.card_type,name:e.name,digits:e.card_digits,expiry:e.expiry,onSelect:function(){return t=e.payment_method_id,n.props.setValue("selected_payment_method_id",t);var t}})}),a.a.createElement(le,{siteId:t}),a.a.createElement(S.a,{className:"label-settings__internal",onClick:function(){n.props.openAddCardDialog(t)},compact:!0},m),a.a.createElement("div",{className:"label-settings__credit-card-description label-settings__external"},n.renderAddCardExternalInfo(),a.a.createElement(S.a,{onClick:function(){n.addCreditCardWindow=window.open(Object(ce.a)()+"/me/purchases/add-credit-card"),document.addEventListener("visibilitychange",n.onVisibilityChange)},compact:!0},m," ",a.a.createElement(q.a,{icon:"external"}))))}),g()(m()(n),"renderEmailReceiptsSection",function(){var e=n.props,t=e.emailReceipts,r=e.translate,i=e.masterUserName,c=e.masterUserLogin,o=e.masterUserEmail,s=e.canEditSettings,u=e.canEditPayments;if(!Object(P.isBoolean)(t))return null;return a.a.createElement(K.a,null,a.a.createElement(Q.a,{className:"label-settings__cards-label"},r("Email Receipts")),a.a.createElement(Q.a,null,a.a.createElement(Z.a,{checked:t,onChange:function(){return n.props.setValue("email_receipts",!t)},disabled:!u&&!s}),a.a.createElement("span",{className:"label-settings__credit-card-description"},r("Email the label purchase receipts to %(ownerName)s (%(ownerLogin)s) at %(ownerEmail)s",{args:{ownerName:i,ownerLogin:c,ownerEmail:o}}))))}),g()(m()(n),"renderContent",function(){var e=n.props,t=e.canEditSettings,r=e.isLoading,i=e.paperSize,c=e.storeOptions,o=e.translate;if(r)return n.renderPlaceholder();var s=Object(z.a)(c.origin_country);return a.a.createElement("div",null,a.a.createElement(K.a,null,n.renderSettingsPermissionNotice(),a.a.createElement(Q.a,{className:"label-settings__cards-label"},o("Paper size")),a.a.createElement(Y.a,{onChange:function(e){return n.props.setValue("paper_size",e.target.value)},value:i,disabled:!t},Object.keys(s).map(function(e){return a.a.createElement("option",{value:e,key:e},s[e])}))),a.a.createElement(K.a,null,a.a.createElement(Q.a,{className:"label-settings__cards-label"},o("Payment")),n.renderPaymentsSection()),n.renderEmailReceiptsSection())}),n}return O()(t,e),s()(t,[{key:"UNSAFE_componentWillMount",value:function(){this.setState({expanded:this.isExpanded(this.props)})}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.selectedPaymentMethod!==this.props.selectedPaymentMethod&&this.setState({expanded:this.isExpanded(e)})}},{key:"isExpanded",value:function(e){var t=e.canEditPayments,n=e.pristine,r=e.selectedPaymentMethod;return t&&(!r||!n)}},{key:"renderPlaceholder",value:function(){return a.a.createElement("div",{className:"label-settings__placeholder"},a.a.createElement(K.a,null,a.a.createElement(Q.a,{className:"label-settings__cards-label"},a.a.createElement("span",null)),a.a.createElement(Y.a,null)),a.a.createElement(K.a,null,a.a.createElement(Q.a,{className:"label-settings__cards-label"},a.a.createElement("span",null)),a.a.createElement("p",{className:"label-settings__credit-card-description"}),a.a.createElement(ie,{selected:!1,isLoading:!0}),a.a.createElement(ie,{selected:!1,isLoading:!0}),a.a.createElement(S.a,{compact:!0})))}},{key:"render",value:function(){return a.a.createElement("div",{className:"label-settings__labels-container"},this.renderContent())}}]),t}(r.Component);de.propTypes={siteId:R.a.number.isRequired,setValue:R.a.func.isRequired};var Ee=Object(b.b)(function(e,t){var n=t.siteId;return F()({isLoading:Object(se.c)(e,n)&&!Object(se.d)(e,n),isReloading:Object(se.c)(e,n)&&Object(se.d)(e,n),pristine:Object(se.o)(e,n),paymentMethods:Object(se.l)(e,n),paymentMethodsWarning:Object(se.m)(e,n),selectedPaymentMethod:Object(se.n)(e,n),paperSize:Object(se.k)(e,n),storeOptions:Object(se.h)(e,n),canEditPayments:Object(se.q)(e,n),canEditSettings:Object(se.q)(e,n)||Object(se.p)(e,n),emailReceipts:Object(se.e)(e,n)},Object(se.j)(e,n))},function(e){return Object(h.b)({openAddCardDialog:oe.b,fetchSettings:oe.a},e)})(Object(v.localize)(de)),fe=n(676),me=n(532),pe=function(e){function t(){var e,n;c()(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=l()(this,(e=E()(t)).call.apply(e,[this].concat(i))),g()(m()(n),"setValue",function(e,t){n.props.onChange(),n.props.setFormDataValue(n.props.siteId,e,t)}),g()(m()(n),"onEnabledToggle",function(){n.props.onChange(),n.props.setFormDataValue(n.props.siteId,"enabled",!n.props.labelsEnabled)}),g()(m()(n),"renderContent",function(){var e=n.props,t=e.isFetchError,r=e.siteId,i=e.translate;return t?a.a.createElement("p",null,i("Unable to get your settings. Please refresh the page to try again.")):a.a.createElement(Ee,{siteId:r,setValue:n.setValue})}),n}return O()(t,e),s()(t,[{key:"componentWillUnmount",value:function(){this.props.restorePristineSettings(this.props.siteId)}},{key:"render",value:function(){var e=this.props,t=e.formMeta,n=e.canManagePayments,r=e.canEditSettings,i=e.labelsEnabled,c=e.siteId,o=e.translate;if(!t)return a.a.createElement(fe.a,{siteId:c});var s=Object(P.isBoolean)(i),u=Object(P.isBoolean)(i)&&!i;return a.a.createElement("div",null,a.a.createElement(fe.a,{siteId:c}),a.a.createElement(G,{label:o("Shipping Labels"),description:o("Print shipping labels yourself and save a trip to the post office")},s&&a.a.createElement(V.a,{checked:i,onChange:this.onEnabledToggle,disabled:Boolean(!n&&!r)})),a.a.createElement(M.a,{className:y()("label-settings__labels-container",{hidden:u})},this.renderContent()))}}]),t}(r.Component);pe.propTypes={onChange:R.a.func.isRequired,submit:R.a.func};var Oe=Object(b.b)(function(e){return{siteId:Object(me.a)(e),formMeta:Object(se.g)(e),labelsEnabled:Object(se.a)(e),isFetchError:Object(se.b)(e),canManagePayments:Object(se.q)(e),canEditSettings:Object(se.p)(e)}},function(e){return Object(h.b)({setFormDataValue:oe.d,restorePristineSettings:oe.c},e)})(Object(v.localize)(pe)),_e=n(590),ge=n(684),be=n(646),he=n(677),ve=n(555),Ce=n(541),Se=function(e){function t(){var e,n;c()(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=l()(this,(e=E()(t)).call.apply(e,[this].concat(i))),g()(m()(n),"renderListHeader",function(e){var t=n.props.translate;return e&&e.length?a.a.createElement("div",{className:"packages__packages-row packages__packages-header"},a.a.createElement("div",{className:"packages__packages-row-icon"}),a.a.createElement("div",{className:"packages__packages-row-details"},t("Name")),a.a.createElement("div",{className:"packages__packages-row-dimensions"},t("Dimensions")),a.a.createElement("div",{className:"packages__packages-row-actions"})):null}),g()(m()(n),"renderListItem",function(e,t){var r=n.props,i=r.siteId,c=r.isFetching,o=r.form,s=r.translate,u=o.dimensionUnit,l=null;if(e.is_user_defined){l=a.a.createElement(S.a,{compact:!0,onClick:function(){n.props.onChange(),n.props.editPackage(i,e)}},s("Edit"))}else{l=a.a.createElement(S.a,{compact:!0,onClick:function(){n.props.onChange(),n.props.removePredefinedPackage(i,e.serviceId,e.id)}},s("Remove"))}return a.a.createElement(be.a,{key:t,siteId:i,isPlaceholder:c,data:e,dimensionUnit:u},l)}),n}return O()(t,e),s()(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.isFetching,r=t.fetchError,i=t.siteId,c=t.allSelectedPackages,o=t.translate;if(r)return null;var s=n?[{},{},{}]:c;return a.a.createElement("div",null,a.a.createElement(he.a,{siteId:i}),a.a.createElement(G,{label:o("Packaging"),description:o("Add boxes, envelopes, and other packages you use most frequently")},a.a.createElement(S.a,{onClick:function(){e.props.onChange(),e.props.addPackage(i)},disabled:n},o("Add package"))),a.a.createElement(M.a,{className:"packages__packages"},this.renderListHeader(s),s.map(this.renderListItem),!n&&a.a.createElement(ge.a,this.props)))}}]),t}(r.Component);Se.propTypes={addPackage:R.a.func.isRequired,removePackage:R.a.func.isRequired,editPackage:R.a.func.isRequired,dismissModal:R.a.func.isRequired,onChange:R.a.func.isRequired,savePackage:R.a.func.isRequired,updatePackagesField:R.a.func.isRequired,toggleOuterDimensions:R.a.func.isRequired,setModalErrors:R.a.func.isRequired,showModal:R.a.bool,form:R.a.shape({packages:R.a.object,dimensionUnit:R.a.string,weightUnit:R.a.string,packageSchema:R.a.object,predefinedSchema:R.a.oneOfType([R.a.object,R.a.array])}).isRequired};var Ie=Object(b.b)(function(e){var t=Object(me.a)(e),n=Object(Ce.e)(e,t)||{};return{siteId:t,isFetching:!n.packages||n.isFetching,fetchError:Object(Ce.g)(e,t),form:n,allSelectedPackages:Object(Ce.b)(e,t)||[]}},function(e){return F()({},Object(h.b)(ve,e))})(Object(v.localize)(Se)),je=n(678),Re=n(551),Ne=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(me.a)(e),n=arguments.length>2?arguments[2]:void 0;return Object(P.get)(e,["extensions","woocommerce","woocommerceServices",t,"carrierAccounts",n],null)},ye=/(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/,Pe=/^(?:(?:(?:https?|ftp):)?\/\/)*(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[\/?#]\S*)?$/i,Me=n(547),Te=n(549),Ae=n(538),ke=function(e,t,n,r){return{type:Ae.g,siteId:e,carrier:t,fieldName:n,newValue:r}},Le=function(e,t){return{type:Ae.e,siteId:e,carrier:t}},De=function(e,t){return{type:Ae.f,siteId:e,carrier:t}},we=function(e,t,n){return{type:Ae.c,siteId:e,carrier:t,show:n}},We=function(e,t,n){return{type:Ae.d,siteId:e,carrier:t,show:n}},Ue=function(e,t,n){return function(r){return r(Le(e,t)),Me.a(e,Me.d.shippingCarrierDelete(n)).then(function(){r(Object(Te.d)(Object(v.translate)("Your carrier account was disconnected succesfully."))),r(Le(e,t)),r(We(e,t,!1)),r({type:Ae.b,siteId:e,carrier:t})}).catch(function(){r(Le(e,t)),r(Object(Te.a)(Object(v.translate)("There was an error trying to disconnect your carrier account")))})}},xe=function(e,t,n){return function(r){return r(Le(e,t)),Me.c(e,Me.d.shippingCarrier(),n).then(function(){r(function(e,t){return{type:Ae.a,siteId:e,carrier:t}}(e,t)),r(Le(e,t)),r(Object(Te.d)(Object(v.translate)("Your carrier account was connected succesfully.")))}).catch(function(){r(Le(e,t)),r(Object(Te.a)(Object(v.translate)("There was an error connecting to your UPS account. Please check that all of the information entered matches your UPS account and try to connect again.")))})}},Ge=function(e){var t=e.data,n=e.disconnected,r=e.isSaving,i=e.translate,c=e.siteId,o=e.showDisconnectDialog;n&&(delete t.id,delete t.account);var s,u,l=function(){e.setVisibilityDisconnectCarrierDialog(c,t.carrier,!0)},d=function(){e.setVisibilityDisconnectCarrierDialog(c,t.carrier,!1)};return a.a.createElement("div",{className:"carrier-accounts__list-item"},(u=t.carrier,a.a.createElement("div",{className:"carrier-accounts__list-item-carrier-icon"},a.a.createElement(je.a,{carrier:u,size:18}))),function(e){var t=e&&""!==Object(P.trim)(e)?e:i("Untitled");return a.a.createElement("div",{className:"carrier-accounts__list-item-name"},a.a.createElement("span",null,t))}(t.carrier),(s=t.account,a.a.createElement("div",{className:"carrier-accounts__list-item-credentials"},a.a.createElement("span",null,s))),function(e){return a.a.createElement("div",{className:"carrier-accounts__list-item-actions"},e?a.a.createElement(S.a,{onClick:l,compact:!0,scary:!0,borderless:!0},i("Disconnect")):a.a.createElement("a",{href:"/wp-admin/admin.php?page=wc-settings&tab=shipping§ion=woocommerce-services-settings&carrier=UPS",className:"button is-compact"},i("Connect")))}(t.account),a.a.createElement(Re.a,{isVisible:o,additionalClassNames:"carrier-accounts__settings-cancel-dialog",onClose:d,buttons:[a.a.createElement(S.a,{compact:!0,primary:!0,disabled:r,onClick:function(){return e.setVisibilityDisconnectCarrierDialog(c,t.carrier,!1)}},i("Cancel")),a.a.createElement(S.a,{compact:!0,primary:!0,scary:!0,disabled:r,busy:r,onClick:function(){return e.disconnectCarrier(c,t.carrier,t.id)}},i("Disconnect"))]},a.a.createElement("div",{className:"carrier-accounts__settings-cancel-dialog-header"},a.a.createElement("h2",{className:"carrier-accounts__settings-cancel-dialog-title"},i("Disconnect your UPS account")),a.a.createElement("button",{className:"carrier-accounts__settings-cancel-dialog-close-button",onClick:d},a.a.createElement(q.a,{icon:"cross"}))),a.a.createElement("p",{className:"carrier-accounts__settings-cancel-dialog-description"},i("This will remove the connection with UPS. All of your UPS account information will be deleted and you won\u2019t see UPS rates when purchasing shipping labels."))))};Ge.propTypes={siteId:R.a.number.isRequired,data:R.a.shape({id:R.a.string,carrier:R.a.string.isRequired,account:R.a.string}).isRequired};var Ve=Object(b.b)(function(e,t){var n=t.siteId,r=t.data.carrier,a=Ne(e,n,r);return{disconnected:a.disconnected,isSaving:a.isSaving,showDisconnectDialog:a.showDisconnectDialog}},function(e){return Object(h.b)({setVisibilityDisconnectCarrierDialog:We,disconnectCarrier:Ue},e)})(Object(v.localize)(Ge)),He=function(e){function t(){var e,n;c()(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=l()(this,(e=E()(t)).call.apply(e,[this].concat(i))),g()(m()(n),"renderListHeader",function(e){var t=n.props.translate;return a.a.createElement("div",{className:"carrier-accounts__header"},a.a.createElement("div",{className:"carrier-accounts__header-icon"}),a.a.createElement("div",{className:"carrier-accounts__header-name"},t("Name")),Object(P.some)(e,"account")&&a.a.createElement("div",{className:"carrier-accounts__header-credentials"},t("Credentials")),a.a.createElement("div",{className:"carrier-accounts__header-actions"}))}),g()(m()(n),"renderListItem",function(e,t){var r=n.props,i=r.siteId,c=r.isFetching;return a.a.createElement(Ve,{key:t,siteId:i,isPlaceholder:c,data:e})}),n}return O()(t,e),s()(t,[{key:"render",value:function(){var e=this.props.translate,t=this.props.carriers||[];return Object(P.isEmpty)(t)?a.a.createElement("div",null):a.a.createElement("div",null,a.a.createElement(G,{label:e("Carrier account"),description:e("Set up your own carrier account by adding your credentials here")}),a.a.createElement(M.a,{className:"carrier-accounts__list"},this.renderListHeader(t),t.map(this.renderListItem)))}}]),t}(r.Component);He.propTypes={siteId:R.a.number.isRequired,carriers:R.a.arrayOf(R.a.shape({id:R.a.string,carrier:R.a.string.isRequired,account:R.a.string}))};var Fe=Object(v.localize)(He),Be=n(600),qe=n(613),ze=n(586),Ze=n(537),Ke=n(563),Qe=n(602),Ye=function(e){var t=e.carrier,n=e.countryNames,r=e.fieldErrors,i=e.isConnectionSuccess,c=e.isFormValid,o=e.isSaving,s=e.showCancelConnectionDialog,u=e.showUPSInvoiceFields,l=e.siteId,d=e.stateNames,E=e.translate,f=e.values;if(i){var m=new URL(window.location.href);m.searchParams.delete("carrier"),window.onbeforeunload=null,window.location.href=m.href}var p=function(e){return f[e]?Object(Qe.a)(f[e]):""},O=function(n){return function(r){return e.updateCarrierSettings(l,t,n,r)}},_=function(){e.setVisibilityCancelConnectionDialog(l,t,!1)};return a.a.createElement("div",{className:"carrier-accounts__settings-container"},void 0,a.a.createElement("div",{className:"carrier-accounts__settings"},a.a.createElement("div",{className:"carrier-accounts__settings-info"},a.a.createElement("h4",{className:"carrier-accounts__settings-subheader-above-description"},E("Connect your UPS account")),a.a.createElement("p",{className:"carrier-accounts__settings-subheader-description"},E("Set up your own UPS carrier account to compare rates and print labels from multiple carriers in WooCommerce Shipping. Learn more about adding {{a}}carrier accounts{{/a}}.",{components:{a:a.a.createElement("a",{href:"https://docs.woocommerce.com/document/using-your-own-ups-account-in-woocommerce-shipping/"})}})),a.a.createElement("p",{className:"carrier-accounts__settings-subheader-description"},E("If you need a UPS account number, go to {{a}}UPS.com{{/a}} to create a new account.",{components:{a:a.a.createElement("a",{href:"https://ups.com/"})}}))),a.a.createElement("div",{className:"carrier-accounts__settings-form"},a.a.createElement(k.a,null,a.a.createElement("h4",{className:"carrier-accounts__settings-subheader"},E("General information")),a.a.createElement("p",{className:"carrier-accounts__settings-subheader-description"},E("This is the account number and address from your UPS profile"))),a.a.createElement(k.a,{className:"carrier-accounts__settings-account-number"},a.a.createElement(ze.a,{id:"account_number",title:E("Account number"),value:p("account_number"),updateValue:O("account_number"),error:r.account_number})),a.a.createElement(k.a,{className:"carrier-accounts__settings-address"},a.a.createElement(ze.a,{id:"name",title:E("Name"),value:p("name"),updateValue:O("name"),error:r.name}),a.a.createElement(ze.a,{id:"street1",title:E("Address"),value:p("street1"),updateValue:O("street1"),error:r.street1}),a.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},a.a.createElement(ze.a,{id:"street2",title:E("Address 2 (optional)"),value:p("street2"),updateValue:O("street2"),error:r.street2}),a.a.createElement(ze.a,{id:"city",title:E("City"),value:p("city"),updateValue:O("city"),error:r.city})),a.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},d?a.a.createElement(Be.a,{id:"state",title:E("State"),value:p("state"),valuesMap:F()({"":e.translate("Select one\u2026")},d),updateValue:O("state"),error:r.state}):a.a.createElement(ze.a,{id:"state",title:E("State"),value:p("state"),updateValue:O("state"),error:r.state}),a.a.createElement(Be.a,{id:"country",title:E("Country"),value:p("country"),valuesMap:n,updateValue:O("country"),error:r.country})),a.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},a.a.createElement(ze.a,{id:"postal_code",title:E("ZIP/Postal code"),value:p("postal_code"),updateValue:O("postal_code"),error:r.postal_code}),a.a.createElement(ze.a,{id:"phone",title:E("Phone"),value:p("phone"),updateValue:O("phone"),error:r.phone})),a.a.createElement(ze.a,{id:"email",title:E("Email"),value:p("email"),updateValue:O("email"),error:r.email})),a.a.createElement(k.a,{className:"carrier-accounts__settings-company-info"},a.a.createElement("div",{className:"carrier-accounts__settings-header"},a.a.createElement("h4",{className:"carrier-accounts__settings-subheader"},E("Company information")),a.a.createElement("p",{className:"carrier-accounts__settings-subheader-description"},E("This is the company info you used to create your UPS account"))),a.a.createElement(ze.a,{id:"company",title:E("Company name"),value:p("company"),updateValue:O("company"),error:r.company}),a.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},a.a.createElement(ze.a,{id:"title",title:E("Job title"),value:p("title"),updateValue:O("title"),error:r.title}),a.a.createElement(ze.a,{id:"website",title:E("Company website"),value:p("website"),updateValue:O("website"),error:r.website}))),a.a.createElement(k.a,{className:"carrier-accounts__settings-ups-info"},a.a.createElement("div",{className:"carrier-accounts__settings-header"},a.a.createElement("h4",{className:"carrier-accounts__settings-subheader"},E("UPS account information")),a.a.createElement(qe.a,{id:"enable_ups_invoice_fields",checked:u,onChange:function(){e.toggleShowUPSInvoiceFields(l,t)}}),a.a.createElement("span",null,E("I have been issued an invoice from UPS within the past 90 days"))),u&&a.a.createElement("div",{className:"carrier-accounts__settings-ups-invoice"},a.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},a.a.createElement(ze.a,{id:"invoice_number",title:E("UPS invoice number"),value:p("invoice_number"),updateValue:O("invoice_number"),error:r.invoice_number}),a.a.createElement(ze.a,{id:"invoice_date",title:E("UPS invoice date"),value:p("invoice_date"),updateValue:O("invoice_date"),error:r.invoice_date,placeholder:"YYYY-MM-DD"})),a.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},a.a.createElement(ze.a,{id:"invoice_amount",title:E("UPS invoice amount"),value:p("invoice_amount"),updateValue:O("invoice_amount"),error:r.invoice_amount}),a.a.createElement(ze.a,{id:"invoice_currency",title:E("UPS invoice currency"),value:p("invoice_currency"),updateValue:O("invoice_currency"),error:r.invoice_currency})),a.a.createElement(ze.a,{id:"invoice_control_id",title:E("UPS invoice control id"),value:p("invoice_control_id"),updateValue:O("invoice_control_id"),error:r.invoice_control_id}))),a.a.createElement(k.a,{className:"carrier-accounts__settings-actions"},a.a.createElement(S.a,{compact:!0,primary:!0,onClick:function(){e.submitCarrierSettings(l,t,f)},disabled:!c||o,busy:o},E("Connect")),a.a.createElement(S.a,{compact:!0,onClick:function(){e.setVisibilityCancelConnectionDialog(l,t,!0)}},E("Cancel")))),a.a.createElement(Re.a,{isVisible:s,additionalClassNames:"carrier-accounts__settings-cancel-dialog",onClose:_,buttons:[a.a.createElement(S.a,{compact:!0,onClick:_},E("Cancel")),a.a.createElement(S.a,{compact:!0,primary:!0,scary:!0,onClick:function(){return history.back()}},E("Ok"))]},a.a.createElement("div",{className:"carrier-accounts__settings-cancel-dialog-header"},a.a.createElement("h2",{className:"carrier-accounts__settings-cancel-dialog-title"},E("Cancel connection")),a.a.createElement("button",{className:"carrier-accounts__settings-cancel-dialog-close-button",onClick:_},a.a.createElement(q.a,{icon:"cross"}))),a.a.createElement("p",{className:"carrier-accounts__settings-cancel-dialog-description"},E("This action will delete any information entered on the form.")))))};Ye.propTypes={carrier:R.a.string.isRequired};var $e=Object(b.b)(function(e,t){var n=t.siteId,r=t.carrier,a=Ne(e,n,r),i=a.isSaving,c=a.settings,o=c.values,s=c.showCancelConnectionDialog,u=c.showUPSInvoiceFields,l=c.isConnectionSuccess,d=function(e,t,n){var r=Ne(e,t,n).settings,a=r.fieldErrors,i=r.ignoreValidation,c=r.requiredFields,o=r.values;if(Object(P.isEmpty)(o))return{};var s=!0,u=!1,l=void 0;try{for(var d,E=c[Symbol.iterator]();!(s=(d=E.next()).done);s=!0){var f=d.value,m=o[f];!m||"string"===typeof m&&""===m.trim()?a[f]=Object(v.translate)("This field is required"):delete a[f]}}catch(p){u=!0,l=p}finally{try{s||null==E.return||E.return()}finally{if(u)throw l}}return o.email&&!o.email.match(ye)&&(a.email=Object(v.translate)("The email format is not valid")),o.website&&!o.website.match(Pe)&&(a.website=Object(v.translate)("The company website format is not valid")),i&&Object.keys(a).forEach(function(e){i[e]&&delete a[e]}),a}(e,n,r),E=function(e,t,n){var r=Ne(e,t,n).settings,a=r.fieldErrors,i=r.ignoreValidation,c=Object.values(a).every(function(e){return!e}),o=Object.values(i).every(function(e){return!e});return c&&o}(e,n,r),f=Object(Ze.c)(e,n);return f[o.country]||(f=F()(g()({},o.country,Object(Ke.g)(e,o.country,n)),f)),{countryNames:f,fieldErrors:d,isConnectionSuccess:l,isFormValid:E,isSaving:i,showCancelConnectionDialog:s,showUPSInvoiceFields:u,stateNames:Object(Ze.j)(e,o.country,n),values:o}},function(e){return Object(h.b)({setVisibilityCancelConnectionDialog:we,submitCarrierSettings:xe,toggleShowUPSInvoiceFields:De,updateCarrierSettings:ke},e)})(Object(v.localize)(Ye)),Xe=n(673),Je=n(647),et=function(e){function t(e){var n;return c()(this,t),n=l()(this,E()(t).call(this,e)),g()(m()(n),"onChange",function(){n.setState({pristine:!1})}),g()(m()(n),"onSaveSuccess",function(){var e=n.props,t=e.translate,r=e.orderId,a=e.orderHref,i=e.paymentMethodSelected,c=a&&i?{button:t("Return to Order #%(orderId)s",{args:{orderId:r}}),href:a}:{duration:5e3};return n.setState({pristine:!0}),n.props.successNotice(t("Your shipping settings have been saved."),c)}),g()(m()(n),"onSaveFailure",function(){var e=n.props.translate;return n.props.errorNotice(e("Unable to save your shipping settings. Please try again."))}),g()(m()(n),"onPaymentMethodMissing",function(){var e=n.props.translate;return n.props.errorNotice(e("A payment method is required to print shipping labels."),{duration:4e3})}),g()(m()(n),"onSaveChanges",function(){n.props.createWcsShippingSaveActionList(n.onSaveSuccess,n.onSaveFailure)}),n.state={pristine:!0},n}return O()(t,e),s()(t,[{key:"render",value:function(){var e=this.props,t=e.carrier,n=e.carriers,r=e.isSaving,i=e.siteId,c=e.translate;return t?a.a.createElement("div",null,a.a.createElement(I.a,{id:"notices",notices:_e.a.list}),a.a.createElement($e,{carrier:t}),a.a.createElement(Xe.a,{isChanged:!this.state.pristine})):a.a.createElement("div",null,a.a.createElement(I.a,{id:"notices",notices:_e.a.list}),a.a.createElement(Oe,{onChange:this.onChange}),a.a.createElement(Ie,{onChange:this.onChange}),a.a.createElement(Fe,{siteId:i,carriers:n,onChange:this.onChange}),a.a.createElement(S.a,{primary:!0,onClick:this.onSaveChanges,busy:r,disabled:r},c("Save changes")),a.a.createElement(Xe.a,{isChanged:!this.state.pristine}))}}]),t}(r.Component),tt=Object(b.b)(function(e){var t=Object(se.g)(e),n=Object(Ce.e)(e);return{siteId:Object(me.a)(e),isSaving:t.isSaving||n.isSaving,paymentMethodSelected:Boolean(Object(se.n)(e))}},function(e){return Object(h.b)({createWcsShippingSaveActionList:Je.a,errorNotice:Te.a,successNotice:Te.d},e)})(Object(v.localize)(et)),nt=n(652),rt=n(651),at={modalErrors:{},pristine:!0},it={};it[Ae.a]=function(e,t){var n=t.carrier,r=e[n].settings;return F()({},e,g()({},n,{settings:F()({},r,{isConnectionSuccess:!0})}))},it[Ae.g]=function(e,t){var n=t.carrier,r=t.fieldName,a=t.newValue,i=e[n].settings,c=i.ignoreValidation,o=i.values;if(a.target)switch(a.target.type){case"checkbox":a=a.target.checked;break;default:a=a.target.value}var s=F()({},e,g()({},n,{settings:F()({},i,{values:F()({},o,g()({},r,a))})}));return c&&(s[n].settings.ignoreValidation=F()({},c,g()({},r,!1))),s},it[Ae.e]=function(e,t){var n=t.carrier,r=e[n],a=r.isSaving,i=r.settings;return F()({},e,g()({},n,{settings:i,isSaving:!a}))},it[Ae.f]=function(e,t){var n=t.carrier,r=e[n].settings;return F()({},e,g()({},n,{settings:F()({},r,{showUPSInvoiceFields:!r.showUPSInvoiceFields})}))},it[Ae.c]=function(e,t){var n=t.carrier,r=t.show,a=e[n].settings;return F()({},e,g()({},n,{settings:F()({},a,{showCancelConnectionDialog:r})}))},it[Ae.d]=function(e,t){var n=t.carrier,r=t.show,a=e[n];return F()({},e,g()({},n,F()({},a,{showDisconnectDialog:r})))},it[Ae.b]=function(e,t){var n=t.carrier,r=e[n].settings;return F()({},e,g()({},n,{settings:r,disconnected:!0}))};var ct=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:at,t=arguments.length>1?arguments[1]:void 0;return"function"===typeof it[t.type]?it[t.type](e,t):e},ot=function(){var e=["account_number","name","street1","city","state","country","postal_code","phone","email","title","website"];return{UPS:{settings:{requiredFields:e,values:{country:"US",type:"UpsAccount"},fieldErrors:{},ignoreValidation:e.reduce(function(e,t){return e[t]="country"!==t,e},{}),showUPSInvoiceFields:!1},isSaving:!1,showDisconnectDialog:!1}}},st=n(592),ut=n(657),lt=n(633),dt=n(658),Et=n(609),ft=n(116),mt=n(46);t.default=function(e){var t=e.order_id,n=e.order_href,r=e.carrier,i=e.continents,c=e.carriers;return{getReducer:function(){return Object(mt.a)({extensions:Object(mt.a)({woocommerce:Object(mt.a)({woocommerceServices:Object(mt.a)({1:Object(mt.a)({packages:rt.a,labelSettings:nt.a,carrierAccounts:ct})}),sites:Object(mt.a)({1:Object(mt.a)({data:Object(mt.a)({locations:dt.a})})})})}),notices:st.a,ui:function(){return{selectedSiteId:1}}})},getInitialState:function(){return{extensions:{woocommerce:{sites:{1:{data:{locations:i}}},woocommerceServices:{1:{carrierAccounts:ot()}}}}}},getStateForPersisting:function(e){return delete e.notices,e},getStateKey:function(){return"wcs-account-settings"},getMiddlewares:function(){return[Object(ft.b)(Object(Et.a)(lt.a,ut.a))]},View:function(){return a.a.createElement(tt,{orderId:t,orderHref:n,carrier:r,carriers:c})}}}}}]);
|
dist/chunks/{bcadb68537fa6f7b8eb8.css → a4e6e6c5332389e456d3.css}
RENAMED
File without changes
|
dist/chunks/{bcadb68537fa6f7b8eb8.min.js → a4e6e6c5332389e456d3.min.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[149],{546:function(e,t,a){"use strict";var n=a(530),r=a.n(n),s=a(533),i=a.n(s),c=a(36),o=a.n(c),l=a(10),u=a.n(l),d=a(12),m=a.n(d),p=a(526),g=a.n(p),b=a(35),f=a(1),h=function(e){var t=e.children,a=e.required,n=e.optional,s=e.translate,c=e.className,l=i()(e,["children","required","optional","translate","className"]);return t=u.a.Children.toArray(t)||[],a&&t.push(function(e){return u.a.createElement("small",{className:"form-label__required"},e("Required"))}(s)),n&&t.push(function(e){return u.a.createElement("small",{className:"form-label__optional"},e("Optional"))}(s)),u.a.createElement("label",r()({},Object(f.omit)(l,"moment","numberFormat"),{className:g()(c,"form-label")}),t.length?t.map(function(e,t){return Object(f.isObject)(e)?o()({},e,{key:t}):e}):null)};h.propTypes={required:m.a.bool},t.a=Object(b.localize)(h)},553:function(e,t,a){"use strict";var n=a(107),r=a.n(n),s=a(108),i=a.n(s),c=a(528),o=a.n(c),l=a(527),u=a.n(l),d=a(531),m=a.n(d),p=a(529),g=a.n(p),b=a(34),f=a.n(b),h=a(12),v=a.n(h),_=a(10),E=a.n(_),k=a(526),y=a.n(k),O=a(1),j=a(35),I=a(534),N=a.n(I),R=a(564),C=function(e){function t(){var e,a;r()(this,t);for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return a=o()(this,(e=u()(t)).call.apply(e,[this].concat(s))),f()(m()(a),"dismissTimeout",null),a}return g()(t,e),i()(t,[{key:"componentDidMount",value:function(){this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"componentWillUnmount",value:function(){this.dismissTimeout&&clearTimeout(this.dismissTimeout)}},{key:"componentDidUpdate",value:function(){clearTimeout(this.dismissTimeout),this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"getIcon",value:function(){var e;switch(this.props.status){case"is-info":e="info";break;case"is-success":e="checkmark";break;case"is-error":case"is-warning":e="notice";break;default:e="info"}return e}},{key:"render",value:function(){var e=this.props,t=e.children,a=e.className,n=e.icon,r=e.isCompact,s=e.isLoading,i=e.onDismissClick,c=e.showDismiss,o=void 0===c?!r:c,l=e.status,u=e.text,d=e.translate,m=y()("notice",l,a,{"is-compact":r,"is-loading":s,"is-dismissable":o});return E.a.createElement("div",{className:m},E.a.createElement("span",{className:"notice__icon-wrapper"},E.a.createElement(N.a,{className:"notice__icon",icon:n||this.getIcon(),size:24})),E.a.createElement("span",{className:"notice__content"},E.a.createElement("span",{className:"notice__text"},u||t)),u?t:null,o&&E.a.createElement("span",{tabIndex:"0",className:"notice__dismiss",onClick:i},E.a.createElement(N.a,{icon:"cross",size:24}),E.a.createElement(R.a,null,d("Dismiss"))))}}]),t}(_.Component);f()(C,"defaultProps",{className:"",duration:0,icon:null,isCompact:!1,isLoading:!1,onDismissClick:O.noop,status:null,text:null}),f()(C,"propTypes",{className:v.a.string,duration:v.a.number,icon:v.a.string,isCompact:v.a.bool,isLoading:v.a.bool,onDismissClick:v.a.func,showDismiss:v.a.bool,status:v.a.oneOf(["is-error","is-info","is-success","is-warning","is-plain"]),text:v.a.oneOfType([v.a.arrayOf(v.a.oneOfType([v.a.string,v.a.node])),v.a.oneOfType([v.a.string,v.a.node])]),translate:v.a.func.isRequired}),t.a=Object(j.localize)(C)},557:function(e,t,a){"use strict";a.d(t,"a",function(){return N});var n=a(530),r=a.n(n),s=a(107),i=a.n(s),c=a(108),o=a.n(c),l=a(528),u=a.n(l),d=a(527),m=a.n(d),p=a(531),g=a.n(p),b=a(529),f=a.n(b),h=a(34),v=a.n(h),_=a(10),E=a.n(_),k=a(12),y=a.n(k),O=a(526),j=a.n(O),I=a(1),N=function(e){function t(){var e;return i()(this,t),(e=u()(this,m()(t).apply(this,arguments))).selectOnFocus=e.selectOnFocus.bind(g()(e)),e}return f()(t,e),o()(t,[{key:"focus",value:function(){this.refs.textField.focus()}},{key:"selectOnFocus",value:function(e){this.props.selectOnFocus&&e.target.select()}},{key:"render",value:function(){var e=this.props.inputRef,t=Object(I.omit)(this.props,"isError","isValid","selectOnFocus","inputRef"),a=j()("form-text-input",this.props.className,{"is-error":this.props.isError,"is-valid":this.props.isValid});return E.a.createElement("input",r()({type:"text"},t,{ref:e||"textField",className:a,onClick:this.selectOnFocus}))}}]),t}(_.PureComponent);v()(N,"propTypes",{isError:y.a.bool,isValid:y.a.bool,selectOnFocus:y.a.bool,className:y.a.string})},580:function(e,t,a){"use strict";var n=a(530),r=a.n(n),s=a(533),i=a.n(s),c=a(107),o=a.n(c),l=a(108),u=a.n(l),d=a(528),m=a.n(d),p=a(527),g=a.n(p),b=a(531),f=a.n(b),h=a(529),v=a.n(h),_=a(34),E=a.n(_),k=a(526),y=a.n(k),O=a(35),j=a(1),I=a(10),N=a.n(I),R=a(542),C=function(e){function t(){var e,a;o()(this,t);for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return a=m()(this,(e=g()(t)).call.apply(e,[this].concat(r))),E()(f()(a),"getDefaultButtonAction",function(){return a.props.isSubmitting?a.props.translate("Saving\u2026"):a.props.translate("Save Settings")}),a}return v()(t,e),u()(t,[{key:"render",value:function(){var e=this.props,t=e.children,a=e.className,n=e.isPrimary,s=i()(e,["children","className","isPrimary"]),c=y()(a,"form-button");return N.a.createElement(R.a,r()({},Object(j.omit)(s,["isSubmitting","moment","numberFormat","translate"]),{primary:n,className:c}),I.Children.count(t)?t:this.getDefaultButtonAction())}}]),t}(N.a.Component);E()(C,"defaultProps",{isSubmitting:!1,isPrimary:!0,type:"submit"}),t.a=Object(O.localize)(C)},586:function(e,t,a){"use strict";var n=a(10),r=a.n(n),s=a(12),i=a.n(s),c=a(545),o=a(546),l=a(557),u=a(550),d=a(558),m=function(e){var t=e.id,a=e.title,n=e.description,s=e.value,i=e.placeholder,m=e.updateValue,p=e.error,g=e.className;return r.a.createElement(c.a,{className:g},r.a.createElement(o.a,{htmlFor:t},a),r.a.createElement(l.a,{id:t,name:t,placeholder:i,value:s,onChange:function(e){return m(e.target.value)},isError:Boolean(p)}),p&&"string"===typeof p&&r.a.createElement(u.a,{text:p}),!p&&n&&r.a.createElement(d.a,null,n))};m.propTypes={id:i.a.string.isRequired,title:i.a.node,description:i.a.string,value:i.a.string.isRequired,updateValue:i.a.func,error:i.a.oneOfType([i.a.string,i.a.bool]),className:i.a.string},t.a=m},589:function(e,t,a){"use strict";a.d(t,"a",function(){return j});var n=a(533),r=a.n(n),s=a(107),i=a.n(s),c=a(108),o=a.n(c),l=a(528),u=a.n(l),d=a(527),m=a.n(d),p=a(529),g=a.n(p),b=a(34),f=a.n(b),h=a(10),v=a.n(h),_=a(12),E=a.n(_),k=a(526),y=a.n(k),O=a(557),j=function(e){function t(){return i()(this,t),u()(this,m()(t).apply(this,arguments))}return g()(t,e),o()(t,[{key:"render",value:function(){var e=this.props,t=e.noWrap,a=e.prefix,n=e.suffix,s=r()(e,["noWrap","prefix","suffix"]);return v.a.createElement("div",{className:y()("form-text-input-with-affixes",{"no-wrap":t})},a&&v.a.createElement("span",{className:"form-text-input-with-affixes__prefix"},a),v.a.createElement(O.a,s),n&&v.a.createElement("span",{className:"form-text-input-with-affixes__suffix"},n))}}]),t}(v.a.Component);f()(j,"displayName","FormTextInputWithAffixes"),f()(j,"propTypes",{noWrap:E.a.bool,prefix:E.a.node,suffix:E.a.node})},601:function(e,t,a){"use strict";var n=a(107),r=a.n(n),s=a(108),i=a.n(s),c=a(528),o=a.n(c),l=a(527),u=a.n(l),d=a(529),m=a.n(d),p=a(34),g=a.n(p),b=a(10),f=a.n(b),h=a(12),v=a.n(h),_=a(526),E=a.n(_),k=a(1),y=a(534),O=a.n(y),j=(a(629),function(e){function t(){return r()(this,t),o()(this,u()(t).apply(this,arguments))}return m()(t,e),i()(t,[{key:"render",value:function(){var e=E()("external-link",this.props.className,{"icon-first":!!this.props.showIconFirst},{"has-icon":!!this.props.icon}),t=Object(k.assign)({},Object(k.omit)(this.props,"icon","iconSize","showIconFirst","iconClassName"),{className:e,rel:"external"});t.target&&(t.rel=t.rel.concat(" noopener noreferrer"));var a=f.a.createElement(O.a,{className:this.props.iconClassName,icon:"external",size:this.props.iconSize});return f.a.createElement("a",t,this.props.icon&&this.props.showIconFirst&&a,this.props.children,this.props.icon&&!this.props.showIconFirst&&a)}}]),t}(b.Component));g()(j,"defaultProps",{iconSize:18,showIconFirst:!1}),g()(j,"propTypes",{className:v.a.string,href:v.a.string,onClick:v.a.func,icon:v.a.bool,iconSize:v.a.number,target:v.a.string,showIconFirst:v.a.bool,iconClassName:v.a.string}),t.a=j},613:function(e,t,a){"use strict";var n=a(530),r=a.n(n),s=a(10),i=a.n(s),c=a(12),o=a.n(c),l=a(526),u=a.n(l),d=a(534),m=a.n(d),p=a(1),g=function(e){var t=e.className,a=e.disabled,n=e.checked,s=e.partialChecked,c=Object(p.omit)(e,["className","partialChecked"]);return i.a.createElement("span",{className:u()(t,"form-checkbox",{"is-disabled":a})},i.a.createElement("input",r()({},c,{type:"checkbox"})),n&&i.a.createElement(m.a,{icon:"checkmark",size:14}),!n&&s&&i.a.createElement(m.a,{icon:"minus-small",size:16}))};g.propTypes={checked:o.a.bool.isRequired,partialChecked:o.a.bool,onChange:o.a.func.isRequired,className:o.a.string},t.a=g},615:function(e,t,a){"use strict";var n=a(530),r=a.n(n),s=a(533),i=a.n(s),c=a(10),o=a.n(c),l=a(526),u=a.n(l);t.a=function(e){var t=e.className,a=i()(e,["className"]);return o.a.createElement("input",r()({},a,{type:"checkbox",className:u()(t,"form-checkbox")}))}},629:function(e,t,a){},641:function(e,t,a){"use strict";var n=a(530),r=a.n(n),s=a(533),i=a.n(s),c=a(10),o=a.n(c),l=a(526),u=a.n(l);t.a=function(e){var t=e.className,a=i()(e,["className"]);return o.a.createElement("input",r()({},a,{type:"radio",className:u()(t,"form-radio")}))}},646:function(e,t,a){"use strict";var n=a(10),r=a.n(n),s=a(12),i=a.n(s),c=a(35),o=a(1),l=a(534),u=a.n(l),d=a(526),m=a.n(d),p=function(e){var t=e.isPlaceholder,a=e.data,n=e.dimensionUnit,s=e.prefixActions,i=(e.hasError,e.children),c=e.translate;if(t)return r.a.createElement("div",{className:"packages__packages-row placeholder"},r.a.createElement("div",{className:"packages__packages-row-icon"},r.a.createElement(u.a,{icon:"product",size:18})),r.a.createElement("div",{className:"packages__packages-row-details"},r.a.createElement("div",{className:"packages__packages-row-details-name"},r.a.createElement("span",null))),r.a.createElement("div",{className:"packages__packages-row-dimensions"},r.a.createElement("span",null)),r.a.createElement("div",{className:"packages__packages-row-actions"},i));var l,d=function(){return r.a.createElement("div",{className:"packages__packages-row-actions"},i)};return r.a.createElement("div",{className:m()("packages__packages-row",{prefixed:s})},s?d():null,r.a.createElement("div",{className:"packages__packages-row-icon"},function(e){var t=e?"mail":"product";return r.a.createElement(u.a,{icon:t,size:18})}(a.is_letter)),r.a.createElement("div",{className:"packages__packages-row-details"},r.a.createElement("div",{className:"packages__packages-row-details-name"},(l=a.name)&&""!==Object(o.trim)(l)?l:c("Untitled"))),r.a.createElement("div",{className:"packages__packages-row-dimensions"},a.inner_dimensions," ",n),s?null:d())};p.propTypes={siteId:i.a.number.isRequired,isPlaceholder:i.a.bool,data:i.a.shape({name:i.a.string,is_letter:i.a.bool,inner_dimensions:i.a.string}).isRequired,prefixActions:i.a.bool,dimensionUnit:i.a.string},t.a=Object(c.localize)(p)},647:function(e,t,a){"use strict";a.d(t,"a",function(){return r});var n=a(535);function r(e,t,a){return{type:n.L,successAction:e,failureAction:t,onlyPackages:a||!1}}},678:function(e,t,a){"use strict";var n=a(10),r=a.n(n),s=a(12),i=a.n(s),c=a(679),o=a.n(c),l=a(680),u=a.n(l),d=a(681),m=a.n(d),p={ups:o.a,usps:u.a,dhlexpress:m.a},g=function(e){var t=e.carrier,a=e.size;if(!t||!p[t.toLowerCase()])return r.a.createElement("span",null);var n="".concat(function(e){switch(e){case"small":return 24;case"big":return 40;case"medium":default:return 30}}(a),"px");return r.a.createElement("div",{style:{width:n},className:"carrier-icon"},r.a.createElement("img",{src:p[t.toLowerCase()],alt:t,className:"carrier-icon__logo"}))};g.propTypes={carrier:i.a.string.isRequired,size:i.a.number},t.a=g},679:function(e,t,a){e.exports=a.p+"images/881843a7135b8abd4794bd2d33dc8b3c.png"},680:function(e,t,a){e.exports=a.p+"images/41c6838923ebde874f7fc71db18dcae5.png"},681:function(e,t,a){e.exports=a.p+"images/41e119813ea7cd89e927349d8d4ad824.png"},684:function(e,t,a){"use strict";var n=a(36),r=a.n(n),s=a(10),i=a.n(s),c=a(12),o=a.n(c),l=a(109),u=a(35),d=a(1),m=a(534),p=a.n(m),g=a(34),b=a.n(g),f=a(107),h=a.n(f),v=a(108),_=a.n(v),E=a(528),k=a.n(E),y=a(527),O=a.n(y),j=a(529),I=a.n(j),N=a(30),R=a(526),C=a.n(R),q=a(557),w=a(589);function x(e){return Object(d.get)(e,["currentUser","id"])}function S(e){var t=x(e);return t?function(e,t){return e.users.items[t]}(e,t):null}var P=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(a){var n=S(a);return Object(d.get)(n,e,t)}};P("localeSlug"),P("localeVariant"),P("user_ip_country_code");P("date"),P("username"),P("email");P("email_verified",!1);var T=a(532),z=a(562);function D(e){var t=Object(T.a)(e);return t||1!==function(e){var t=S(e);return t?t.site_count||0:null}(e)||(t=function(e){var t=S(e);return Object(d.get)(t,"primary_blog",null)}(e)),Object(z.a)(e,t)}var A=a(539),U=function(e,t){return Object(d.get)(e,["extensions","woocommerce","sites",t,"settings","products"])},V=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(T.a)(e);return Object(d.isArray)(U(e,t))},F=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(T.a)(e);return A.b===U(e,t)};function M(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(T.a)(e),a=U(e,t);return Object(d.find)(a,function(e){return"woocommerce_dimension_unit"===e.id})||{}}var W=a(561),L=a(556),B=a(535),H=function(e){return function(t,a){if(!V(a(),e)&&!F(a(),e)){var n={type:B.N,siteId:e};return t(n),Object(W.a)(e).get("settings/products").then(function(a){t({type:B.O,siteId:e,data:a})}).catch(function(a){t(Object(L.a)(e,n,a))})}}},Y=function(e){function t(){return h()(this,t),k()(this,O()(t).apply(this,arguments))}return I()(t,e),_()(t,[{key:"componentDidMount",value:function(){var e=this.props.siteId;e&&this.props.fetchSettingsProducts(e)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.siteId!==this.props.siteId&&this.props.fetchSettingsProducts(e.siteId)}},{key:"render",value:function(){var e=this.props,t=e.className,a=e.noWrap,n=e.dimensions,r=e.onChange,s=e.translate,c=e.dimensionsUnit,o=C()("form-dimensions-input",t,{"no-wrap":a});return i.a.createElement("div",{className:o},i.a.createElement(q.a,{name:"length",placeholder:s("L",{comment:"Length placeholder for dimensions input"}),type:"number",value:n&&n.length||"",onChange:r,className:"form-dimensions-input__length"}),i.a.createElement(q.a,{name:"width",placeholder:s("W",{comment:"Width placeholder for dimensions input"}),type:"number",value:n&&n.width||"",onChange:r,className:"form-dimensions-input__width"}),i.a.createElement(w.a,{name:"height",placeholder:s("H",{comment:"Height placeholder for dimensions input"}),suffix:c,type:"number",noWrap:a,value:n&&n.height||"",onChange:r,className:"form-dimensions-input__height"}))}}]),t}(s.Component);b()(Y,"propTypes",{className:o.a.string,dimensions:o.a.shape({width:o.a.string,height:o.a.string,length:o.a.string}),dimensionsUnit:o.a.string,onChange:o.a.func.isRequired,noWrap:o.a.bool}),b()(Y,"defaultProps",{value:"",className:"",onChange:d.noop,noWrap:!1});var $=Object(l.b)(function(e,t){var a=t.dimensionsUnit,n=D(e);if(!a){var r=n&&M(e,n.ID);a=r&&r.value||"in"}return{siteId:n&&n.ID,dimensionsUnit:a}},function(e){return Object(N.b)({fetchSettingsProducts:H},e)})(Object(u.localize)(Y)),G=a(545),K=a(546),J=a(579),Q=a(550),X=/^\.\d+$/,Z=/^\d+\.$/,ee=function(e){return e=Object(d.trim)(e),X.test(e)?e="0"+e:Z.test(e)&&(e=e.slice(0,e.length-1)),e},te=/^\s*(\S+)\s*x\s*(\S+)\s*x\s*(\S+)\s*$/,ae=/^\s*(\S+)?\s*x\s*(\S+)?\s*x\s*(\S+)?\s*$/,ne=function(e){return isNaN(e)?"":0>=e?"":e},re=function(e){return Object(d.trim)(e)},se=ee,ie=function(e){var t=te.exec(e);return t?[t[1],t[2],t[3]].map(ee).join(" x "):e},ce=function(e){var t="",a="",n="",r=ae.exec(e);return r&&4===r.length&&(t=ne(r[1]),a=ne(r[2]),n=ne(r[3])),{length:t,width:a,height:n}},oe=function(e){var t=e.siteId,a=e.form,n=e.setModalErrors,r=e.updatePackagesField,s=e.translate,c=a.mode,o=a.modalErrors,l=a.dimensionUnit,u=a.weightUnit,m=a.packageData,p=m.name,g=m.inner_dimensions,f=m.box_weight,h=m.is_letter,v=function(e,a){n(t,Object(d.omit)(o,e)),r(t,b()({},e,a))},_=function(e){var t=e.target.name,a=e.target.value;v(t,a)},E=function(e,t){var a=t||s("Invalid value."),n=""===Object(d.trim)(m[e])?s("This field is required."):a;return o[e]?i.a.createElement(Q.a,{text:n}):null},k=function(e){r(t,{is_letter:"envelope"===e.target.value})};return i.a.createElement("div",{className:"packages__properties-group"},"add-custom"===c?i.a.createElement(G.a,null,i.a.createElement(K.a,{htmlFor:"package_type"},s("Type of package")),i.a.createElement(J.a,{id:"package_type",onChange:k,value:h?"envelope":"box"},i.a.createElement("option",{value:"box"},s("Box")),i.a.createElement("option",{value:"envelope"},s("Envelope")))):null,i.a.createElement(G.a,null,i.a.createElement(K.a,{htmlFor:"name"},s("Package name")),i.a.createElement(q.a,{id:"name",name:"name",placeholder:s("Unique package name"),value:p||"",onChange:_,isError:o.name}),E("name",s("This field must be unique"))),i.a.createElement(G.a,{className:"packages__add-package-weight-group"},i.a.createElement("div",{className:"packages__add-package-weight"},i.a.createElement(K.a,null,s("Dimensions (L x W x H)")),function(e,t,a,n){var r=ce(t),s=r.length,c=r.width,o=r.height;return i.a.createElement($,{dimensionsUnit:a,dimensions:{width:c,height:o,length:s},onChange:function(t){var a=t.target.name,r=t.target.value;n(e,["length"===a?r:s,"width"===a?r:c,"height"===a?r:o].join(" x "))}})}("inner_dimensions",g,l,v),E("inner_dimensions")),i.a.createElement("div",{className:"packages__add-package-weight"},i.a.createElement(K.a,{htmlFor:"box_weight"},s("Weight of empty package")),i.a.createElement(w.a,{id:"box_weight",name:"box_weight",placeholder:s("0.0"),value:f||"",onChange:_,isError:o.box_weight,type:"number",noWrap:!0,suffix:u}),E("box_weight"))))};oe.propTypes={siteId:o.a.number.isRequired,form:o.a.object.isRequired,updatePackagesField:o.a.func.isRequired,packageData:o.a.shape({name:o.a.string.isRequired,inner_dimensions:o.a.string.isRequired,box_weight:o.a.number.isRequired,is_user_defined:o.a.bool.isRequired,is_letter:o.a.bool.isRequired}),setModalErrors:o.a.func.isRequired};var le=Object(u.localize)(oe),ue=a(113),de=a.n(ue),me=Object(d.memoize)(function(e){return de()(e,{greedy:!0})}),pe=function(e){return e&&""!==Object(d.trim)(e)?e:null},ge=function(e,t){return e=pe(e),Object(d.some)(t,function(t){return t===e})?null:e},be=/^\d+(\.\d+)?$/,fe=function(e){return be.test(e)?Number.parseFloat(e):null},he=function(e,t,a){var n,r=me(a);return r(function(e,t){var a=fe(e.box_weight),n=fe(e.max_weight);a&&n&&n<=a&&(n=null);var r={name:ge(e.name,t),inner_dimensions:e.inner_dimensions,outer_dimensions:pe(e.outer_dimensions),box_weight:a,max_weight:n};return Object(d.omitBy)(r,function(e){return null===e})}(e,t)),n=r.errors,Object(d.reduce)(n,function(e,t){if(t.field){var a,n=t.field.replace("data.","");Object.assign(e,(a={},b()(a,n,!0),b()(a,"any",!0),a))}return e},{})},ve=a(551),_e=a(548),Ee=a(580),ke=function(e){var t=e.className,a=e.disabled,n=e.id,r=e.onToggle,s=e.readOnly,c=e.selectedElements,o=e.totalElements,l=c&&c===o,u=c&&c<o,d=C()("bulk-select__box",{"is-checked":l}),m=C()("bulk-select__some-checked-icon",{"is-disabled":a}),g=C()("bulk-select",t);return i.a.createElement("span",{className:g},i.a.createElement("span",{className:"bulk-select__container"},i.a.createElement("input",{id:n,type:"checkbox",className:d,onChange:function(e){s||r(!(u||l),e)},checked:l,disabled:a}),u?i.a.createElement(p.a,{className:m,icon:"minus-small",size:18}):null))};ke.propTypes={totalElements:o.a.number.isRequired,selectedElements:o.a.number.isRequired,onToggle:o.a.func,readOnly:o.a.bool,className:o.a.string,disabled:o.a.bool};var ye=ke,Oe=a(599),je=a(615),Ie=a(646),Ne=a(541),Re=function(e){var t=e.siteId,a=e.form,n=e.toggleAll,r=e.togglePackage,s=e.currentlyEditingPredefinedPackages,c=e.translate,o=a.dimensionUnit,l=function(e){var a="group-".concat(e.serviceId,"-").concat(e.groupId);return i.a.createElement("div",{className:"packages__group-header"},i.a.createElement("label",{htmlFor:a,onClick:function(e){return e.stopPropagation()}},i.a.createElement(ye,{id:a,totalElements:e.total,selectedElements:e.selected,onToggle:function(a,r){r.stopPropagation(),n(t,e.serviceId,e.groupId,r.target.checked)},className:"packages__group-header-checkbox"}),e.title))};return i.a.createElement("div",null,function(){var e=[];return Object(d.forEach)(s,function(a,n){var s,u,d=(s=a.selected,u=a.total,s===u?c("All packages selected"):c("%(selectedCount)d package selected","%(selectedCount)d packages selected",{count:s,args:{selectedCount:s}}));e.push(i.a.createElement(Oe.a,{className:"packages__predefined-packages",key:n,header:l(a),summary:d,expandedSummary:d,clickableHeader:!0,expanded:!1,screenReaderText:c("Expand Services"),icon:"chevron-down"},function(e){return e.packages.map(function(e,a){return i.a.createElement(Ie.a,{key:a,siteId:t,data:e,dimensionUnit:o,prefixActions:!0},i.a.createElement(je.a,{checked:e.selected,onChange:function(){return r(t,e.serviceId,e.id)}}))})}(a)))}),e}())};Re.propTypes={siteId:o.a.number.isRequired,toggleAll:o.a.func.isRequired,togglePackage:o.a.func.isRequired,form:o.a.shape({dimensionUnit:o.a.string}).isRequired};var Ce=Object(l.b)(function(e){return{currentlyEditingPredefinedPackages:Object(Ne.c)(e)}})(Object(u.localize)(Re)),qe=a(531),we=a.n(qe),xe=function(e){function t(){var e,a;h()(this,t);for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return a=k()(this,(e=O()(t)).call.apply(e,[this].concat(r))),b()(we()(a),"handleKeyEvent",function(e){switch(e.keyCode){case 13:case 32:e.preventDefault(),document.activeElement.click()}}),a}return I()(t,e),_()(t,[{key:"render",value:function(){var e=C()({"segmented-control__item":!0,"is-selected":this.props.selected}),t=C()("segmented-control__link",b()({},"item-index-".concat(this.props.index),null!=this.props.index));return i.a.createElement("li",{className:e},i.a.createElement("a",{href:this.props.path,className:t,onClick:this.props.onClick,title:this.props.title,"data-e2e-value":this.props.value,role:"radio",tabIndex:0,"aria-checked":this.props.selected,onKeyDown:this.handleKeyEvent},i.a.createElement("span",{className:"segmented-control__text"},this.props.children)))}}]),t}(i.a.Component);b()(xe,"propTypes",{children:o.a.node.isRequired,path:o.a.string,selected:o.a.bool,title:o.a.string,value:o.a.string,onClick:o.a.func,index:o.a.number}),b()(xe,"defaultProps",{selected:!1});var Se=xe,Pe=function(e){function t(){var e,a;h()(this,t);for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return a=k()(this,(e=O()(t)).call.apply(e,[this].concat(r))),b()(we()(a),"state",{selected:a.props.initialSelected||a.props.options[0].value}),a}return I()(t,e),_()(t,[{key:"renderOptions",value:function(){var e=this;return this.props.options.map(function(t,a){return i.a.createElement(Se,{index:a,key:a,onClick:function(){e.setState({selected:t.value}),e.props.onSelect&&e.props.onSelect(t)},path:t.path,selected:e.state.selected===t.value,value:t.value},t.label)})}},{key:"render",value:function(){var e={"is-compact":this.props.compact,"is-primary":this.props.primary};return i.a.createElement("ul",{className:C()("segmented-control",e,this.props.className),style:this.props.style,role:"radiogroup"},this.renderOptions())}}]),t}(i.a.Component);b()(Pe,"propTypes",{className:o.a.string,compact:o.a.bool,initialSelected:o.a.string,onSelect:o.a.func,options:o.a.arrayOf(o.a.shape({value:o.a.string.isRequired,label:o.a.string.isRequired,path:o.a.string})).isRequired,style:o.a.object});var Te=a(647),ze=a(549),De=a(555),Ae=function(e){var t,a=e.siteId,n=e.form,r=e.predefinedPackagesSummary,s=e.setModalErrors,c=e.savePackage,o=e.savePredefinedPackages,l=e.dismissModal,u=e.removePackage,m=e.setAddMode,g=e.updatePackagesField,b=e.translate,f=n.showModal,h=n.mode,v=n.packages,_=n.packageSchema,E=n.predefinedSchema,k=n.packageData,y=k.index,O=v.custom,j="edit"===h,I="add-custom"===h,N="add-predefined"===h,R=function(){var t={duration:5e3};e.createWcsShippingSaveActionList(function(){return"function"===typeof e.onSaveSuccess&&"name"in k&&e.onSaveSuccess(k.name),e.successNotice(b("Your shipping packages have been saved."),t)},function(){return e.errorNotice(b("Unable to save your shipping packages. Please try again."),t)},!0)},C=function(){l(a)},q=b(j?"Edit package":"Add a package"),w=I||N,x=I||j,S=N;t=I||N&&0===r.removed?b("Add package","Add packages",{count:I?1:r.added}):b("Done");var P=[i.a.createElement(Ee.a,{onClick:function(){if(N)return o(a),void(e.persistOnSave&&R());var t="number"===typeof k.index?O[k.index].name:null,n=Object(d.concat)(Object(d.difference)(O.map(function(e){return e.name}),[t]),Object(d.flatten)(Object(d.map)(E,function(e){return Object(d.map)(e,function(e){return e.definitions})})),["individual"]),r=Object.assign({},k,{name:re(k.name),inner_dimensions:ie(k.inner_dimensions),outer_dimensions:ie(k.outer_dimensions),box_weight:se(k.box_weight),max_weight:0}),i=he(r,n,_);if(i.any)return g(a,r),void s(a,i);c(a,r),e.persistOnSave&&R()}},t),i.a.createElement(Ee.a,{onClick:C,isPrimary:!1},b("Cancel"))];return j&&P.unshift({action:"delete",label:i.a.createElement("span",null,b("{{icon/}} Delete this package",{components:{icon:i.a.createElement(p.a,{icon:"trash"})}})),onClick:function(){return u(a,y)},additionalClassNames:"packages__delete is-scary is-borderless"}),i.a.createElement(ve.a,{isVisible:f,additionalClassNames:"packages__add-edit-dialog woocommerce wcc-root",onClose:C,buttons:P},i.a.createElement(_e.a,{className:"packages__add-edit-title"},q),w&&i.a.createElement(Pe,{primary:!0,className:"packages__mode-select",initialSelected:h,onSelect:function(e){m(a,e.value)},options:[{value:"add-custom",label:"Custom package"},{value:"add-predefined",label:"Service package"}]}),x&&i.a.createElement(le,e),S&&i.a.createElement(Ce,e))};Ae.propTypes={siteId:o.a.number.isRequired,dismissModal:o.a.func.isRequired,form:o.a.object.isRequired,updatePackagesField:o.a.func.isRequired,savePackage:o.a.func.isRequired,packageData:o.a.shape({index:o.a.number.isRequired}),setModalErrors:o.a.func.isRequired,removePackage:o.a.func.isRequired,setAddMode:o.a.func.isRequired};t.a=Object(l.b)(function(e){return{predefinedPackagesSummary:Object(Ne.f)(e)}},function(e){return Object(N.b)(r()({createWcsShippingSaveActionList:Te.a,errorNotice:ze.a,successNotice:ze.d},De),e)})(Object(u.localize)(Ae))},782:function(e,t,a){},783:function(e,t,a){},789:function(e,t,a){"use strict";a.r(t);var n=a(10),r=a.n(n),s=a(12),i=a.n(s),c=a(109),o=a(30),l=a(35),u=a.n(l),d=a(534),m=a.n(d),p=a(551),g=a(36),b=a.n(g),f=a(530),h=a.n(f),v=a(1),_=a(34),E=a.n(_),k=a(586),y=a(553),O=a(580),j=a(600),I=a(552),N=a(526),R=a.n(N),C=a(546),q=a(641),w=function(e){var t=e.values,a=e.originalValues,n=e.countryNames,s=e.stateNames,i=e.expandStateName,c=void 0!==i&&i;a=a||{};var o=t.state,l=t.country,u="";o&&(u=(c&&s||{})[o]||o);var d=n[l]||l,m=function(e){var n=t[e];if(!n)return"";var s=a[e],i=s&&s.toLowerCase()!==n.toLowerCase(),c=n;switch(e){case"state":c=u;break;case"country":c=d}return r.a.createElement("span",{key:e,className:i?"highlight":""},c)},p=m("state"),g=Object(v.filter)([m("city"),p?", ":"",p," ",m("postcode")]);return r.a.createElement("div",{className:"address-step__summary"},r.a.createElement("p",null,m("name")),r.a.createElement("p",null,m("address")," ",m("address_2")),r.a.createElement("p",null,g),r.a.createElement("p",null,m("country")))},x=function(e){return r.a.createElement(C.a,{className:R()("address-step__suggestion",{"is-selected":e.checked})},r.a.createElement(q.a,Object(v.omit)(e,"children")),e.children)},S=function(e){var t=e.values,a=e.normalized,n=e.selectNormalized,s=e.selectNormalizedAddress,i=e.editAddress,c=e.confirmAddressSuggestion,o=e.countryNames,l=e.translate,u=function(e){return function(){return s(e)}};return r.a.createElement("div",null,r.a.createElement(y.a,{className:"error-notice",status:"is-info",showDismiss:!1},l("We have slightly modified the address entered. If correct, please use the suggested address to ensure accurate delivery.")),r.a.createElement("div",{className:"address-step__suggestion-container"},r.a.createElement(x,{checked:!n,onChange:u(!1)},r.a.createElement("span",{className:"address-step__suggestion-title"},l("Address entered")),r.a.createElement(w,{values:t,countryNames:o})),r.a.createElement(x,{checked:n,onChange:u(!0)},r.a.createElement("span",{className:"address-step__suggestion-title"},l("Suggested address")),r.a.createElement(w,{values:a,originalValues:t,countryNames:o}))),r.a.createElement("div",{className:"address-step__actions"},r.a.createElement(O.a,{type:"button",onClick:c},l("Use selected address")),r.a.createElement(O.a,{type:"button",onClick:i,borderless:!0},l("Edit address"))))};S.propTypes={values:i.a.object.isRequired,normalized:i.a.object,selectNormalized:i.a.bool.isRequired,selectNormalizedAddress:i.a.func.isRequired,confirmAddressSuggestion:i.a.func.isRequired,editAddress:i.a.func.isRequired,countryNames:i.a.object.isRequired};var P=Object(l.localize)(S),T=a(648),z=a.n(T),D=a(601),A=a(575),U=function(e){var t=e.values,a=e.countryNames,n=e.editUnverifiableAddress,s=e.confirmAddressSuggestion,i=e.translate,c=e.fieldErrors,o=A.a.includes(t.country)?z.a.format({scheme:"https",hostname:"tools.usps.com",pathname:"/zip-code-lookup.htm",query:{mode:"byAddress",companyName:t.company,address1:t.address,address2:t.address_2,city:t.city,state:"US"===t.country?t.state:t.country,zip:t.postcode}}):null,l=Object(v.invokeMap)([t.address+" "+t.address_2,t.city,t.state+" "+t.postcode],"trim").join(", "),u={scheme:"https",hostname:"www.google.com",pathname:"/maps/place/"+encodeURIComponent(l)},d=z.a.format(u);return r.a.createElement("div",null,function(){var e=function(){if(c.general)return c.general;for(var e in c)return c[e];return!1}();return e?r.a.createElement(y.a,{status:"is-error",showDismiss:!1},i("We were unable to automatically verify the address \u2014 %(error)s.",{args:{error:e}})):r.a.createElement(y.a,{status:"is-error",showDismiss:!1},i("We were unable to automatically verify the address."))}(),r.a.createElement("div",{className:"address-step__unverifiable-container"},r.a.createElement("div",{className:"address-step__unverifiable-info"},r.a.createElement("span",{className:"address-step__unverifiable-title"},i("Address entered")),r.a.createElement(w,{values:t,countryNames:a})),r.a.createElement("div",{className:"address-step__unverifiable-info"},r.a.createElement("p",null,i("Automatic verification failed for this address. It may still be a valid address \u2014 use the tools below to manually verify.")),o&&r.a.createElement(D.a,{icon:!0,href:o,target:"_blank"},i("Verify with USPS")),r.a.createElement(D.a,{icon:!0,href:d,target:"_blank"},i("View on Google Maps")))),r.a.createElement("div",{className:"address-step__actions"},r.a.createElement(O.a,{type:"button",onClick:n},i("Edit address")),r.a.createElement(O.a,{type:"button",onClick:s,borderless:!0},i("Use address as entered"))))};U.propTypes={values:i.a.object.isRequired,confirmAddressSuggestion:i.a.func.isRequired,editUnverifiableAddress:i.a.func.isRequired,countryNames:i.a.object.isRequired};var V=Object(l.localize)(U),F=a(602),M=a(540),W=a(537),L=a(563),B=function(e){var t=e.siteId,a=e.orderId,n=e.values,s=e.isNormalized,i=e.normalized,c=e.selectNormalized,o=e.normalizationInProgress,l=e.allowChangeCountry,u=e.group,d=e.countryNames,m=e.stateNames,p=e.errors,g=e.isUsable,f=e.translate,h=Object(v.isObject)(p)?p:{},_=function(){return e.confirmAddressSuggestion(a,t,u)};if(s&&!h.phone){if(i&&!Object(v.isEqual)(i,n)){return r.a.createElement(P,{values:n,normalized:i,selectNormalized:c,selectNormalizedAddress:function(n){return e.selectNormalizedAddress(a,t,u,n)},confirmAddressSuggestion:_,editAddress:function(){return e.editAddress(a,t,u)},countryNames:d})}if(0<Object(v.size)(h)){return r.a.createElement(V,{values:n,confirmAddressSuggestion:_,editUnverifiableAddress:function(){return e.editUnverifiableAddress(a,t,u)},countryNames:d,fieldErrors:h})}}var E=h.general&&1===Object(v.size)(h),N=function(e){return u+"_"+e},R=function(e){return n[e]?Object(F.a)(n[e]):""},C=function(n){return function(r){return e.updateAddressValue(a,t,u,n,r)}};return r.a.createElement("div",null,r.a.createElement(k.a,{id:N("name"),title:f("Name"),value:R("name"),updateValue:C("name"),error:h.name}),r.a.createElement("div",{className:"address-step__company-phone"},r.a.createElement(k.a,{id:N("company"),title:f("Company"),value:R("company"),updateValue:C("company"),className:"address-step__company",error:h.company}),r.a.createElement(k.a,{id:N("phone"),title:f("Phone"),value:R("phone"),updateValue:C("phone"),className:"address-step__phone",error:h.phone})),E&&r.a.createElement(y.a,{status:"is-error",showDismiss:!1},f("%(message)s. Please modify the address and try again.",{args:{message:h.general}})),r.a.createElement(k.a,{id:N("address"),title:f("Address"),value:R("address"),updateValue:C("address"),className:"address-step__address-1",error:h.address||E}),r.a.createElement(k.a,{id:N("address_2"),value:R("address_2"),updateValue:C("address_2"),error:h.address_2||E}),r.a.createElement("div",{className:"address-step__city-state-postal-code"},r.a.createElement(k.a,{id:N("city"),title:f("City"),value:R("city"),updateValue:C("city"),className:"address-step__city",error:h.city||E}),m?r.a.createElement(j.a,{id:N("state"),title:f("State"),value:R("state"),valuesMap:b()({"":e.translate("Select one\u2026")},m),updateValue:C("state"),className:"address-step__state",error:h.state||E}):r.a.createElement(k.a,{id:N("state"),title:f("State"),value:R("state"),updateValue:C("state"),className:"address-step__state",error:h.state||E}),r.a.createElement(k.a,{id:N("postcode"),title:f("ZIP/Postal code"),value:R("postcode"),updateValue:C("postcode"),className:"address-step__postal-code",error:h.postcode||E})),r.a.createElement(j.a,{id:N("country"),title:f("Country"),value:R("country"),disabled:!l,valuesMap:d,updateValue:C("country"),error:h.country||E}),r.a.createElement("div",{className:"address-step__actions"},r.a.createElement(O.a,{type:"button",disabled:Object(I.a)(p)||o,onClick:function(){return e.submitAddressForNormalization(a,t,u)}},f("Verify address")),r.a.createElement(O.a,{type:"button",disabled:!g,onClick:_,borderless:!0},f("Use address as entered"))))};B.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,values:i.a.object.isRequired,isNormalized:i.a.bool.isRequired,normalized:i.a.object,selectNormalized:i.a.bool.isRequired,allowChangeCountry:i.a.bool.isRequired,errors:i.a.oneOfType([i.a.object,i.a.bool]).isRequired,group:i.a.string.isRequired,countryNames:i.a.object.isRequired,stateNames:i.a.object};var H=Object(c.b)(function(e,t){var a=t.group,n=t.orderId,r=t.siteId,s=Object(W.s)(e,n,r),i=Object(W.i)(e,n,r).form[a],c="origin"===a?Object(W.h)(e,r):Object(W.c)(e,r);return c[i.values.country]||(c=b()(E()({},i.values.country,Object(L.g)(e,i.values.country,r)),c)),b()({},i,{errors:s&&Object(W.f)(e,n,r)[a],isUsable:s&&Object(W.n)(e,n,a,r),countryNames:c,stateNames:Object(W.j)(e,i.values.country,r)})},function(e){return Object(o.b)({selectNormalizedAddress:M.C,confirmAddressSuggestion:M.g,editAddress:M.m,editUnverifiableAddress:M.n,updateAddressValue:M.V,submitAddressForNormalization:M.T},e)})(Object(l.localize)(B)),Y=a(107),$=a.n(Y),G=a(108),K=a.n(G),J=a(528),Q=a.n(J),X=a(527),Z=a.n(X),ee=a(529),te=a.n(ee),ae=(a(782),function(e){function t(){return $()(this,t),Q()(this,Z()(t).apply(this,arguments))}return te()(t,e),K()(t,[{key:"render",value:function(){var e=R()("spinner",this.props.className),t={width:this.props.size,height:this.props.size,fontSize:this.props.size};return r.a.createElement("div",{className:e},r.a.createElement("div",{className:"spinner__outer",style:t},r.a.createElement("div",{className:"spinner__inner"})))}}]),t}(n.PureComponent));E()(ae,"propTypes",{className:i.a.string,size:i.a.number}),E()(ae,"defaultProps",{size:20});var ne=a(599),re=function(e){var t=e.isSuccess,a=e.isWarning,n=e.isError,s=e.isProgress,i=e.title,c=e.summary,o=e.children,l=e.expanded,u=e.toggleStep,d=e.translate,p=R()({"is-success":t,"is-warning":a,"is-error":n});c=r.a.createElement("span",{className:p},r.a.createElement("span",null,c),r.a.createElement("div",{className:"label-purchase-modal__step-status"},s?r.a.createElement(ae,{size:18}):r.a.createElement(m.a,{icon:t?"checkmark-circle":a?"notice-outline":n?"notice-outline":"",className:p,size:18})));var g=r.a.createElement("div",null,r.a.createElement("div",{className:"label-purchase-modal__step-title"},i));return r.a.createElement(ne.a,{header:g,summary:c,expandedSummary:c,clickableHeader:!0,compact:!0,screenReaderText:d("Expand"),expanded:l,onClick:u},o)};re.propTypes={isSuccess:i.a.bool,isWarning:i.a.bool,isError:i.a.bool,isProgress:i.a.bool,title:i.a.string.isRequired,summary:i.a.string,expanded:i.a.bool};var se=Object(l.localize)(re),ie=a(565),ce=function(e,t,a,n,r,s){var i=arguments.length>6&&void 0!==arguments[6]&&arguments[6],c=e.isNormalized,o=e.normalizationInProgress,l=e.normalized;if(o)return r("Validating address\u2026");if(Object(I.a)(n)||c&&!l)return n&&n.general||r("Invalid address");if(!c)return r("You've edited the address, please revalidate it for accurate rates");var u=Object(ie.a)(e),d=u.city,m=u.postcode,p=u.state,g=u.country,b=d+", ";p&&(b+=(i?Object(L.h)(t,g,p,a):p)+"\xa0 ");return b+="US"===g?m.split("-")[0]:m,s&&(b+=", "+Object(L.g)(t,g,a)),b},oe=function(e){var t=e.normalizationInProgress,a=e.errors,n=e.isNormalized,r=e.values,s=e.normalized;return t?{isProgress:!0}:Object(I.a)(a)||n&&!s||!n?{isError:!0}:n?Object(v.isEqual)(r,s)?{isSuccess:!0}:{isWarning:!0}:{}},le=function(e){return r.a.createElement(se,h()({title:e.title,summary:e.summary,expanded:e.expanded,toggleStep:function(){return e.toggleStep(e.orderId,e.siteId,e.type)}},e.normalizationStatus),r.a.createElement(H,{group:e.type,siteId:e.siteId,orderId:e.orderId}))};le.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,type:i.a.string.isRequired,title:i.a.string.isRequired,summary:i.a.string.isRequired,expanded:i.a.bool,normalizationStatus:i.a.object.isRequired,toggleStep:i.a.func.isRequired};var ue=Object(l.localize)(Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=t.type,s=t.translate,i=Object(W.s)(e,a,n),c=Object(W.i)(e,a,n),o=c.form[r],l=i&&Object(W.f)(e,a,n)[r],u="destination"===r&&c.form.origin.values.country!==o.values.country;return{errors:l,form:o,expanded:o.expanded,normalizationStatus:oe(b()({},o,{errors:l})),summary:ce(o,e,n,l,s,u)}},function(e){return Object(o.b)({toggleStep:M.U},e)})(le)),de=a(542),me=function(e,t,a){var n=0;return Object(v.mapValues)(e,function(e){if("individual"===e.box_id)return e.items[0].name;n++;var r=t[e.box_id],s=r&&r.is_letter,i=!(!a||!r)&&r.name;return s?i?Object(l.translate)("Envelope %(packageNum)d: %(packageName)s",{args:{packageNum:n,packageName:i}}):Object(l.translate)("Envelope %(packageNum)d",{args:{packageNum:n}}):i?Object(l.translate)("Package %(packageNum)d: %(packageName)s",{args:{packageNum:n,packageName:i}}):Object(l.translate)("Package %(packageNum)d",{args:{packageNum:n}})})},pe=a(541),ge=function(e){var t,a,n=e.orderId,s=e.siteId,i=e.selected,c=e.all,o=e.errors,l=e.packageId,u=e.translate,d=function(t,a,i){var c=0<Object.keys(o[t]||{}).length;return r.a.createElement("div",{className:"packages-step__list-item",key:t},r.a.createElement(de.a,{borderless:!0,className:R()("packages-step__list-package",{"is-selected":l===t}),onClick:function(){return e.openPackage(n,s,t)}},r.a.createElement("span",{className:"packages-step__list-package-name"},a),function(e,t){return e?r.a.createElement(m.a,{icon:"notice-outline",className:"is-error",size:18}):void 0===t?null:r.a.createElement("span",{className:"packages-step__list-package-count"},t)}(c,i)))},p=me(i,c,!1),g=[],b=[];return Object.keys(i).forEach(function(e){var t=i[e];"individual"===t.box_id?b.push(d(e,t.items[0].name)):g.push(d(e,p[e],t.items.length))}),(g.length||b.length)&&g.unshift((t="boxed-header",a=u("Packages to be Shipped"),r.a.createElement("div",{className:"packages-step__list-item packages-step__list-header",key:t},a))),r.a.createElement("div",{className:"packages-step__list"},g,b)};ge.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,selected:i.a.object.isRequired,all:i.a.object.isRequired,packageId:i.a.string.isRequired,errors:i.a.object,openPackage:i.a.func.isRequired};var be=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.s)(e,a,n),s=Object(W.i)(e,a,n);return{errors:r&&Object(W.f)(e,a,n).packages,packageId:s.openedPackageId,selected:s.form.packages.selected,all:Object(pe.a)(e,n)}},function(e){return Object(o.b)({openPackage:M.w},e)})(Object(l.localize)(ge)),fe=a(550),he=a(554),ve=a(589),_e=a(562),Ee=function(e){var t=e.orderId,a=e.siteId,n=e.item,s=e.itemIndex,i=e.translate,c=function(){return e.openItemMove(t,a,s)},o=n.url?r.a.createElement("a",{href:n.url,target:"_blank",rel:"noopener noreferrer"},n.name):n.name;return r.a.createElement("div",{key:s,className:"packages-step__item"},r.a.createElement("div",{className:"packages-step__item-name"},r.a.createElement("span",null,o),"attributes"in n?r.a.createElement("p",null,n.attributes):""),r.a.createElement("div",{className:"packages-step__item-weight"},"weight"in n?r.a.createElement("p",null,n.weight):""),r.a.createElement("div",{className:"packages-step__item-qty"},"quantity"in n?r.a.createElement("p",null,n.quantity):""),r.a.createElement("div",{className:"packages-step__item-move"},r.a.createElement("a",{href:"#",onClick:c},i("Move"))))};Ee.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,item:i.a.object.isRequired,itemIndex:i.a.number.isRequired,openItemMove:i.a.func.isRequired};var ke=Object(c.b)(function(e,t){var a=t.siteId;return{site:Object(_e.a)(e,a)}},function(e){return Object(o.b)({openItemMove:M.v},e)})(Object(l.localize)(Ee)),ye=a(579),Oe=a(690),je=a(684),Ie=a(555),Ne=function(e,t){return[e.length,e.width,e.height].map(function(e){return"".concat(e," ").concat(t)}).join(" x ")},Re=function(e){var t=e.siteId,a=e.orderId,n=e.packageId,s=e.pckg,i=e.dimensionUnit,c=e.packageGroups,o=e.translate,l=e.pckgErrors,u=e.isIndividualPackage,d=function(e){var t=Object(Oe.a)(e),a=e.id||e.name;return r.a.createElement("option",{value:a,key:a},e.name," - ",Ne(t,i))};if(!n)return null;if(u){var p=R()({"is-error":l.dimensions});return r.a.createElement("div",null,r.a.createElement("div",{className:"packages-step__package-items-header"},r.a.createElement(he.a,null,o("Individually Shipped Item"))),r.a.createElement("span",{className:"packages-step__package-item-description"},o("Item Dimensions")," -"," "),r.a.createElement("span",{className:p},Ne(s,i)),l.dimensions&&r.a.createElement(fe.a,{text:l.dimensions}))}var g=Object(v.reduce)(c,function(e,t){return e+t.definitions.length},0);return r.a.createElement("div",null,r.a.createElement("div",{className:"packages-step__package-items-header packages-step__package-details-header"},r.a.createElement(he.a,null,o("Package details")),0!==g?r.a.createElement("a",{href:"#",onClick:function(){return e.addPackage(t)}},o("Add package")):null),0===g?r.a.createElement("div",{className:"packages-step__no-packages"},r.a.createElement(m.a,{icon:"product",size:18}),r.a.createElement("a",{href:"#",onClick:function(){return e.addPackage(t)}},o("Select a package type"))):r.a.createElement("div",{className:"packages-step__with-packages"},r.a.createElement(ye.a,{onChange:function(r){e.setPackageType(a,t,n,r.target.value)},value:s.box_id,isError:l.box_id||l.dimensions},r.a.createElement("option",{value:"not_selected",key:"not_selected"},o("Please select a package"))," ",Object(v.map)(c,function(e,t){return Object(v.isEmpty)(e.definitions)?null:r.a.createElement("optgroup",{label:e.title,key:t},Object(v.map)(e.definitions,d))}))),r.a.createElement(je.a,h()({persistOnSave:!0},e,{onSaveSuccess:function(r){e.setPackageType(a,t,n,r)}})))};Re.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,packageId:i.a.string.isRequired,pckgErrors:i.a.object.isRequired,pckg:i.a.object.isRequired};var Ce=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.s)(e,a,n),s=Object(W.i)(e,a,n),i=r?s.storeOptions:{},c=Object(pe.e)(e,n)||{};return{dimensionUnit:i.dimension_unit,packageGroups:Object(pe.d)(e,a,n),form:c}},function(e){return Object(o.b)({setPackageType:M.P,addPackage:Ie.addPackage},e)})(Object(l.localize)(Re)),qe=a(543),we=function(e){var t=e.siteId,a=e.orderId,n=e.packageId,s=e.selected,i=e.weightUnit,c=e.errors,o=e.translate,l=e.userMeta,u=c[n]||{};if(!n)return null;var d=s[n];"not_selected"===d.box_id&&l.last_box_id&&e.setPackageType(a,t,n,l.last_box_id);var m="individual"===d.box_id,p=function(e,s){return r.a.createElement(ke,{siteId:t,orderId:a,key:s,item:e,itemIndex:s,packageId:n,showRemove:!0,isIndividualPackage:m})},g=function(){return e.openAddItem(a,t)},b=function(){return m?null:r.a.createElement(de.a,{className:"packages-step__add-item-btn",compact:!0,onClick:g},o("Add items"))};return r.a.createElement("div",{className:"packages-step__package"},r.a.createElement("div",null,r.a.createElement("div",{className:"packages-step__package-items-header-name"},r.a.createElement(he.a,null,o("Items to fulfill"))),r.a.createElement("div",{className:"packages-step__package-items-header-weight"},r.a.createElement(he.a,null,o("Weight"))),r.a.createElement("div",{className:"packages-step__package-items-header-qty"},r.a.createElement(he.a,null,o("QTY"))),r.a.createElement("div",{className:"packages-step__package-items-header-move"}),function(){var e=Object(v.some)(s,function(e,t){return n!==t&&e.items.length});if(!d.items.length)return r.a.createElement("div",{className:"packages-step__add-item-row"},r.a.createElement("div",{className:"packages-step__no-items-message"},o("There are no items in this package."),e?b():null));var t=d.items.map(p);return e&&t.push(r.a.createElement("div",{key:t.length,className:"packages-step__add-item-row"},b())),t}()),r.a.createElement(Ce,{siteId:t,orderId:a,isIndividualPackage:m,pckgErrors:u,pckg:d,packageId:n,lastBoxId:l.last_box_id}),r.a.createElement("div",{className:"packages-step__package-weight"},r.a.createElement(C.a,{htmlFor:"weight_".concat(n)},o("Total Weight (with package)")),r.a.createElement(ve.a,{id:"weight_".concat(n),placeholder:o("0"),value:d.weight||"",onChange:function(r){e.updatePackageWeight(a,t,n,r.target.value)},isError:Boolean(u.weight),type:"number",noWrap:!0,suffix:i}),u.weight&&r.a.createElement(fe.a,{text:u.weight})))};we.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,packageId:i.a.string.isRequired,selected:i.a.object.isRequired,updatePackageWeight:i.a.func.isRequired,dimensionUnit:i.a.string.isRequired,weightUnit:i.a.string.isRequired,errors:i.a.object.isRequired,openAddItem:i.a.func.isRequired,userMeta:i.a.object.isRequired};var xe=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.s)(e,a,n),s=Object(W.i)(e,a,n),i=r?s.storeOptions:{},c=r&&Object(W.f)(e,a,n).packages,o=r?Object(qe.i)(e,n):{};return{siteId:n,errors:c,packageId:s.openedPackageId,selected:s.form.packages.selected,dimensionUnit:i.dimension_unit,weightUnit:i.weight_unit,userMeta:o}},function(e){return Object(o.b)(b()({updatePackageWeight:M.W,openAddItem:M.t,setPackageType:M.P},Ie),e)})(Object(l.localize)(we)),Se=a(548),Pe=function(e){e.site;var t=e.siteId,a=e.orderId,n=e.showItemMoveDialog,s=e.movedItemIndex,i=e.targetPackageId,c=e.openedPackageId,o=e.selected,l=e.all,u=e.translate;if(-1===s||!n)return null;var d,m,g=function(n,s){return r.a.createElement(C.a,{key:n,className:"packages-step__dialog-package-option"},r.a.createElement(q.a,{checked:n===i,onChange:function(){return e.setTargetPackage(a,t,n)}}),s)},b=o[c],f=b.items[s],h=(d=f.product_id,"post.php?post=".concat(d,"&action=edit")),v=r.a.createElement("a",{href:h,target:"_blank",rel:"noopener noreferrer"},f.name),_=me(o,l,!0);m=""===c?u("{{itemLink/}} is currently saved for a later shipment.",{components:{itemLink:v}}):"individual"===b.box_id?u("{{itemLink/}} is currently shipped in its original packaging.",{components:{itemLink:v}}):u("{{itemLink/}} is currently in {{pckg/}}.",{components:{itemLink:v,pckg:r.a.createElement("span",{className:"packages-step__dialog-package-name"},_[c])}});var E=function(){return e.closeItemMove(a,t)},k=[{action:"cancel",label:u("Cancel"),onClick:E},{action:"move",label:u("Submit"),isPrimary:!0,disabled:i===c,onClick:function(){return e.moveItem(a,t,c,s,i)}}];return r.a.createElement(p.a,{isVisible:n,isFullScreen:!1,onClickOutside:E,onClose:E,buttons:k,additionalClassNames:"wcc-root woocommerce packages-step__dialog"},r.a.createElement(Se.a,null,u("Move item")),r.a.createElement("div",{className:"packages-step__dialog-body"},r.a.createElement("p",null,m),r.a.createElement("p",null,u("Where would you like to move it?")),function(){var e=[];return Object.keys(o).forEach(function(t){var a=o[t];t!==c&&"individual"!==a.box_id&&e.push(g(t,_[t]))}),e}(),g("new",u("Add to a New Package")),b&&"individual"===b.box_id?null:g("individual",u("Ship in original packaging"))))};Pe.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,showItemMoveDialog:i.a.bool.isRequired,movedItemIndex:i.a.number.isRequired,targetPackageId:i.a.string,openedPackageId:i.a.string.isRequired,selected:i.a.object.isRequired,all:i.a.object.isRequired,moveItem:i.a.func.isRequired};var Te=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.i)(e,a,n);return{site:Object(_e.a)(e,n),showItemMoveDialog:r.showItemMoveDialog||!1,movedItemIndex:isNaN(r.movedItemIndex)?-1:r.movedItemIndex,targetPackageId:r.targetPackageId,openedPackageId:r.openedPackageId,selected:r.form.packages.selected,all:Object(pe.a)(e,n)}},function(e){return Object(o.b)({closeItemMove:M.d,setTargetPackage:M.S,moveItem:M.s},e)})(Object(l.localize)(Pe)),ze=a(615),De=function(e){var t=e.siteId,a=e.orderId,n=e.showAddItemDialog,s=e.addedItems,i=e.openedPackageId,c=e.selected,o=e.all,l=e.translate;if(!n)return null;var u=me(c,o,!0),d=function(e){return r.a.createElement("span",{className:"packages-step__dialog-package-name"},u[e])},m=[];Object.keys(c).forEach(function(n){if(n!==i){var o=0;c[n].items.forEach(function(i){m.push(function(n,i,c){var o=u[n]?l("%(item)s from {{pckg/}}",{args:{item:c.name},components:{pckg:d(n)}}):c;return r.a.createElement(C.a,{key:"".concat(n,"-").concat(i),className:"packages-step__dialog-package-option"},r.a.createElement(ze.a,{checked:Object(v.includes)(s[n],i),onChange:function(r){return e.setAddedItem(a,t,n,i,r.target.checked)}}),r.a.createElement("span",null,o))}(n,o,i)),o++})}});var g=function(){return e.closeAddItem(a,t)},b=[{action:"close",label:l("Close"),onClick:g},{action:"add",label:l("Add"),isPrimary:!0,disabled:!Object(v.some)(s,v.size),onClick:function(){return e.addItems(a,t,i)}}];return r.a.createElement(p.a,{isVisible:n,isFullScreen:!1,onClickOutside:g,onClose:g,buttons:b,additionalClassNames:"wcc-root woocommerce packages-step__dialog"},r.a.createElement(Se.a,null,l("Add item")),r.a.createElement("div",{className:"packages-step__dialog-body"},r.a.createElement("p",null,l("Which items would you like to add to {{pckg/}}?",{components:{pckg:d(i)}})),m))};De.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,showAddItemDialog:i.a.bool.isRequired,addedItems:i.a.object,openedPackageId:i.a.string.isRequired,selected:i.a.object.isRequired,all:i.a.object.isRequired,closeAddItem:i.a.func.isRequired,setAddedItem:i.a.func.isRequired,addItems:i.a.func.isRequired};var Ae=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.i)(e,a,n);return{showAddItemDialog:Boolean(r.showAddItemDialog),addedItems:r.addedItems,openedPackageId:r.openedPackageId,selected:r.form.packages.selected,all:Object(pe.a)(e,n)}},function(e){return Object(o.b)({closeAddItem:M.b,setAddedItem:M.E,addItems:M.a},e)})(Object(l.localize)(De)),Ue=function(e){var t=e.disabled,a=e.onClick,n=e.children;return r.a.createElement("div",{className:"step-confirmation-button"},r.a.createElement(O.a,{type:"button",onClick:a,disabled:Boolean(t),isPrimary:!0},n))};Ue.propTypes={disabled:i.a.bool,onClick:i.a.func.isRequired};var Ve=Ue,Fe={g:0,oz:1,lbs:3,kg:3},Me=function(e){var t=e.siteId,a=e.orderId,n=e.selected,s=e.weightUnit,i=e.errors,c=e.expanded,o=e.translate,u=Object.keys(n),d=u.reduce(function(e,t){return e+n[t].items.length},0),m=u.reduce(function(e,t){return e+n[t].weight},0),p=0<u.length;return r.a.createElement(se,h()({title:o("Packaging")},function(){if(!p)return{isError:!0,summary:o("No packages selected")};var e=Object(v.find)(i,function(e){return!Object(v.isEmpty)(e)});if(e)return{isError:!0,summary:e[Object.keys(e)[0]]};var t=Object(l.numberFormat)(m,{decimals:Fe[s]});return{isSuccess:!0,summary:1===u.length&&1===d?o("1 item in 1 package: %(weight)s %(unit)s total",{args:{weight:t,unit:s}}):1===u.length?o("%(itemsCount)d items in 1 package: %(weight)s %(unit)s total",{args:{itemsCount:d,weight:t,unit:s}}):o("%(itemsCount)d items in %(packageCount)d packages: %(weight)s %(unit)s total",{args:{itemsCount:d,packageCount:u.length,weight:t,unit:s}})}}(),{expanded:c,toggleStep:function(){return e.toggleStep(a,t,"packages")}}),r.a.createElement("div",{className:"packages-step__contents"},r.a.createElement(be,{siteId:e.siteId,orderId:e.orderId}),r.a.createElement(xe,{siteId:e.siteId,orderId:e.orderId})),r.a.createElement(Ve,{disabled:Object(I.a)(i)||!u.length,onClick:function(){return e.confirmPackages(a,t)}},o("Use these packages")),r.a.createElement(Te,{siteId:e.siteId,orderId:e.orderId}),r.a.createElement(Ae,{siteId:e.siteId,orderId:e.orderId}))};Me.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,selected:i.a.object.isRequired,weightUnit:i.a.string.isRequired,errors:i.a.object.isRequired,expanded:i.a.bool};var We=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.s)(e,a,n),s=Object(W.i)(e,a,n),i=r?s.storeOptions:{};return{errors:r&&Object(W.f)(e,a,n).packages,weightUnit:i.weight_unit,expanded:s.form.packages.expanded,selected:s.form.packages.selected}},function(e){return Object(o.b)({toggleStep:M.U,confirmPackages:M.i},e)})(Object(l.localize)(Me)),Le=a(545),Be=function(e){var t=e.id,a=e.title,n=e.value,s=e.placeholder,i=e.updateValue,c=e.error,o=e.className,l=e.weightUnit;return r.a.createElement(Le.a,{className:o},r.a.createElement(C.a,{htmlFor:t},a),r.a.createElement(ve.a,{noWrap:!0,suffix:l,id:t,name:t,type:"number",placeholder:s||"0.0",value:n,onChange:function(e){return i(e.target.value)},isError:Boolean(c)}),c&&"string"===typeof c&&r.a.createElement(fe.a,{text:c}))};Be.propTypes={weightUnit:i.a.string.isRequired,id:i.a.string.isRequired,title:i.a.node,value:i.a.oneOfType([i.a.string,i.a.number]).isRequired,placeholder:i.a.string,updateValue:i.a.func,error:i.a.oneOfType([i.a.string,i.a.bool]),className:i.a.string};var He=Be,Ye=a(533),$e=a.n(Ye);function Ge(e,t,a){if(!e)return null;if(!a)return e;var n=Object(v.get)(Object(v.find)(a,function(t){return t.code===e}),"label",e);return r.a.createElement("span",{className:"form-currency-input__affix"},n,r.a.createElement(m.a,{icon:"chevron-down",size:18,className:"form-currency-input__select-icon"}),r.a.createElement("select",{className:"form-currency-input__select",value:e,onChange:t},a.map(function(e){var t=e.code,a=e.label,n=void 0===a?t:a;return r.a.createElement("option",{key:t,value:t},n)})))}function Ke(e){var t=e.className,a=e.currencySymbolPrefix,n=e.currencySymbolSuffix,s=e.onCurrencyChange,i=e.currencyList,c=e.placeholder,o=void 0===c?"0.00":c,l=$e()(e,["className","currencySymbolPrefix","currencySymbolSuffix","onCurrencyChange","currencyList","placeholder"]),u=R()("form-currency-input",t),d=Ge(a,s,i),m=Ge(n,s,i);return r.a.createElement(ve.a,h()({},l,{type:"number",className:u,prefix:d,suffix:m,placeholder:o}))}var Je=i.a.shape({code:i.a.string.isRequired,label:i.a.string});Ke.propTypes={currencySymbolPrefix:i.a.oneOfType([i.a.string,i.a.object]),currencySymbolSuffix:i.a.oneOfType([i.a.string,i.a.object]),onCurrencyChange:i.a.func,currencyList:i.a.arrayOf(Je)};var Qe=Ke,Xe=function(e){var t=e.id,a=e.title,n=e.value,s=e.placeholder,i=e.updateValue,c=e.error,o=e.className;return r.a.createElement(Le.a,{className:o},r.a.createElement(C.a,{htmlFor:t},a),r.a.createElement(Qe,{id:t,name:t,currencySymbolPrefix:"$",placeholder:s||"0.00",value:n,onChange:function(e){return i(e.target.value)},isError:Boolean(c)}),c&&"string"===typeof c&&r.a.createElement(fe.a,{text:c}))};Xe.propTypes={id:i.a.string.isRequired,title:i.a.node,value:i.a.oneOfType([i.a.string,i.a.number]).isRequired,placeholder:i.a.string,updateValue:i.a.func,error:i.a.oneOfType([i.a.string,i.a.bool]),className:i.a.string};var Ze=Xe,et=a(790),tt=Object(l.localize)(function(e){var t=e.translate;return r.a.createElement("span",null,t("HS Tariff number")," (",r.a.createElement(D.a,{icon:!0,href:"https://docs.woocommerce.com/document/print-shipping-labels-woocommerce-shipping/#section-1",target:"_blank"},t("more info")),")")}),at=Object(l.localize)(function(e){var t=e.translate;return r.a.createElement("span",null,t("Origin country"),r.a.createElement(et.a,{text:t("Country where the product was manufactured or assembled")},r.a.createElement("span",null,r.a.createElement(m.a,{icon:"info-outline",size:18}))))}),nt=function(e){var t=e.translate,a=e.weightUnit;return r.a.createElement("div",{className:"customs-step__item-rows-header"},r.a.createElement("span",{className:"customs-step__item-description-column"},t("Description")),r.a.createElement("span",{className:"customs-step__item-code-column"},r.a.createElement(tt,null)),r.a.createElement("span",{className:"customs-step__item-weight-column"},t("Weight (%s per unit)",{args:[a]})),r.a.createElement("span",{className:"customs-step__item-value-column"},t("Value ($ per unit)")),r.a.createElement("span",{className:"customs-step__item-country-column"},r.a.createElement(at,null)))};nt.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,weightUnit:i.a.string.isRequired};var rt=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId;return{weightUnit:Object(W.i)(e,a,n).storeOptions.weight_unit}})(Object(l.localize)(nt)),st=function(e){var t=e.errors,a=e.packageId,n=e.productId,s=e.translate,i=e.description,c=e.defaultDescription,o=e.weight,l=e.value,u=e.tariffNumber,d=e.originCountry,m=e.countryNames,p=e.weightUnit;return r.a.createElement("div",{className:"customs-step__item-row"},r.a.createElement(k.a,{id:a+"_"+n+"_description",className:"customs-step__item-description-column",title:s("Description"),value:i,placeholder:c,updateValue:e.setCustomsItemDescription,error:t.description}),r.a.createElement(k.a,{id:a+"_"+n+"_tariffNumber",className:"customs-step__item-code-column",title:r.a.createElement(tt,null),placeholder:s("Optional"),value:u,updateValue:e.setCustomsItemTariffNumber,error:t.tariffNumber}),r.a.createElement(He,{weightUnit:p,id:a+"_"+n+"_weight",className:"customs-step__item-weight-column",title:s("Weight (per unit)"),value:o,updateValue:e.setCustomsItemWeight,error:t.weight}),r.a.createElement(Ze,{id:a+"_"+n+"_value",className:"customs-step__item-value-column",title:s("Value (per unit)"),value:l,updateValue:e.setCustomsItemValue,error:t.value}),r.a.createElement(j.a,{id:a+"_"+n+"_originCountry",className:"customs-step__item-country-column",title:r.a.createElement(at,null),value:d,updateValue:e.setCustomsItemOriginCountry,valuesMap:m}))};st.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,packageId:i.a.string.isRequired,productId:i.a.number.isRequired,description:i.a.string.isRequired,defaultDescription:i.a.string.isRequired,tariffNumber:i.a.string.isRequired,weight:i.a.oneOfType([i.a.string,i.a.number]).isRequired,value:i.a.oneOfType([i.a.string,i.a.number]).isRequired,originCountry:i.a.string.isRequired,errors:i.a.object,countryNames:i.a.object.isRequired,setCustomsItemDescription:i.a.func.isRequired,setCustomsItemTariffNumber:i.a.func.isRequired,setCustomsItemWeight:i.a.func.isRequired,setCustomsItemValue:i.a.func.isRequired,setCustomsItemOriginCountry:i.a.func.isRequired};var it=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=t.productId,s=Object(W.s)(e,a,n),i=Object(W.i)(e,a,n),c=i.form.customs.items[r];return{description:c.description,defaultDescription:c.defaultDescription,tariffNumber:c.tariffNumber||"",weight:c.weight,value:c.value,originCountry:c.originCountry,errors:s?Object(W.f)(e,a,n).customs.items[r]:{},countryNames:Object(L.d)(e,n),weightUnit:i.storeOptions.weight_unit}},function(e,t){var a=t.orderId,n=t.siteId,r=t.productId;return{setCustomsItemDescription:function(t){return e(Object(M.H)(a,n,r,t))},setCustomsItemTariffNumber:function(t){return e(Object(M.J)(a,n,r,t))},setCustomsItemWeight:function(t){return e(Object(M.L)(a,n,r,t))},setCustomsItemValue:function(t){return e(Object(M.K)(a,n,r,t))},setCustomsItemOriginCountry:function(t){return e(Object(M.I)(a,n,r,t))}}})(Object(l.localize)(st)),ct=a(613),ot=function(e){var t=e.siteId,a=e.orderId,n=e.errors,s=e.packageId,i=e.translate,c=e.contentsType,o=e.contentsExplanation,l=e.restrictionType,u=e.restrictionComments,d=e.abandonOnNonDelivery,m=e.itn,p=e.items;return r.a.createElement("div",{className:"customs-step__package"},r.a.createElement(C.a,{htmlFor:s+"_abandonOnNonDelivery",className:"customs-step__abandon-on-non-delivery"},r.a.createElement(ct.a,{id:s+"_abandonOnNonDelivery",checked:!d,onChange:function(){return e.setAbandonOnNonDelivery(!d)}}),r.a.createElement("span",null,i("Return to sender if package is unable to be delivered"))),r.a.createElement("div",{className:"customs-step__restrictions-row"},r.a.createElement("div",{className:"customs-step__contents-type"},r.a.createElement(j.a,{id:s+"_contentsType",title:i("Contents type"),value:c||"merchandise",updateValue:e.setContentsType,valuesMap:{merchandise:i("Merchandise"),documents:i("Documents"),gift:i("Gift"),sample:i("Sample"),other:i("Other\u2026")}}),"other"===c&&r.a.createElement(k.a,{id:s+"_contentsExplanation",title:i("Details"),value:o||"",updateValue:e.setContentsExplanation,error:n.contentsExplanation})),r.a.createElement("div",{className:"customs-step__restriction-type"},r.a.createElement(j.a,{id:s+"_restrictionType",title:i("Restriction type"),value:l||"none",updateValue:e.setRestrictionType,valuesMap:{none:i("None"),quarantine:i("Quarantine"),sanitary_phytosanitary_inspection:i("Sanitary / Phytosanitary inspection"),other:i("Other\u2026")}}),"other"===l&&r.a.createElement(k.a,{id:s+"_restrictionComments",title:i("Details"),value:u||"",updateValue:e.setRestrictionExplanation,error:n.restrictionComments}))),r.a.createElement(k.a,{id:s+"_itn",title:r.a.createElement("span",null,i("ITN")," (",r.a.createElement(D.a,{icon:!0,href:"https://pe.usps.com/text/imm/immc5_010.htm",target:"_blank"},i("more info")),")"),value:m||"",updateValue:e.setITN,error:n.itn}),r.a.createElement("div",{className:"customs-step__item-rows"},r.a.createElement(rt,{siteId:t,orderId:a}),Object(v.uniq)(Object(v.map)(p,"product_id")).map(function(e){return r.a.createElement(it,{key:e,productId:e,packageId:s,siteId:t,orderId:a})})))};ot.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,packageId:i.a.string.isRequired,errors:i.a.object,contentsType:i.a.oneOf(["merchandise","documents","gift","sample","other"]),contentsExplanation:i.a.string,restrictionType:i.a.oneOf(["none","quarantine","sanitary_phytosanitary_inspection","other"]),restrictionComments:i.a.string,abandonOnNonDelivery:i.a.bool,itn:i.a.string,items:i.a.arrayOf(i.a.shape({product_id:i.a.number.isRequired})).isRequired,setContentsType:i.a.func.isRequired,setContentsExplanation:i.a.func.isRequired,setRestrictionType:i.a.func.isRequired,setRestrictionExplanation:i.a.func.isRequired,setAbandonOnNonDelivery:i.a.func.isRequired,setITN:i.a.func.isRequired};var lt=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=t.packageId,s=Object(W.s)(e,a,n),i=Object(W.i)(e,a,n).form.packages.selected[r];return{contentsType:i.contentsType,contentsExplanation:i.contentsExplanation,restrictionType:i.restrictionType,restrictionComments:i.restrictionComments,abandonOnNonDelivery:i.abandonOnNonDelivery,itn:i.itn,items:i.items,errors:s?Object(W.f)(e,a,n).customs.packages[r]:{}}},function(e,t){var a=t.orderId,n=t.siteId,r=t.packageId;return{setContentsType:function(t){return e(Object(M.G)(a,n,r,t))},setContentsExplanation:function(t){return e(Object(M.F)(a,n,r,t))},setRestrictionType:function(t){return e(Object(M.R)(a,n,r,t))},setRestrictionExplanation:function(t){return e(Object(M.Q)(a,n,r,t))},setAbandonOnNonDelivery:function(t){return e(Object(M.D)(a,n,r,t))},setITN:function(t){return e(Object(M.O)(a,n,r,t))}}})(Object(l.localize)(ot)),ut=function(e){var t=e.siteId,a=e.orderId,n=e.errors,s=e.expanded,i=e.translate,c=e.isSubmitted,o=e.packageDescriptions,l=Object(I.a)(n)?i("Customs information incomplete"):i("Customs information valid");return r.a.createElement(se,{title:i("Customs"),summary:c?l:"",expanded:s,toggleStep:e.toggleStep,isSuccess:c&&!Object(I.a)(n),isError:c&&Object(I.a)(n)},Object.keys(o).map(function(e,n){return r.a.createElement("div",{className:"customs-step__package-container",key:e},n?r.a.createElement("hr",null):null,r.a.createElement("p",{className:"customs-step__package-name"},o[e]),r.a.createElement(lt,{packageId:e,siteId:t,orderId:a}))}),r.a.createElement(Ve,{disabled:Object(I.a)(n),onClick:e.confirmCustoms},i("Save customs form")))};ut.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,packageDescriptions:i.a.objectOf(i.a.string).isRequired,expanded:i.a.bool,isSubmitted:i.a.bool.isRequired,errors:i.a.object,toggleStep:i.a.func.isRequired,confirmCustoms:i.a.func.isRequired};var dt=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.s)(e,a,n),s=Object(W.i)(e,a,n),i=s.form.packages.selected;return{packageDescriptions:me(i,Object(pe.a)(e,n),!0),expanded:s.form.customs.expanded,isSubmitted:Object(W.p)(e,a,n),errors:r?Object(W.f)(e,a,n).customs:{}}},function(e,t){var a=t.orderId,n=t.siteId;return{toggleStep:function(){return e(Object(M.U)(a,n,"customs"))},confirmCustoms:function(){return e(Object(M.h)(a,n))}}})(Object(l.localize)(ut)),mt=a(583),pt=a.n(mt),gt=a(531),bt=a.n(gt),ft=a(37),ht=a(573),vt=a(689),_t=new WeakMap;function Et(e,t){return Object(n.useMemo)(function(){var a=function(e){var t=_t.get(e)||0;return _t.set(e,t+1),t}(e);return t?"".concat(t,"-").concat(a):a},[e])}var kt=Object(vt.a)(function(e){return function(t){var a=Et(e);return Object(n.createElement)(e,Object(ft.a)({},t,{instanceId:a}))}},"withInstanceId"),yt=a(614);var Ot=function(e){var t=e.as,a=void 0===t?"div":t,r=Object(ht.a)(e,["as"]);return function(e){var t=e.as,a=void 0===t?"div":t,r=Object(ht.a)(e,["as"]);return"function"===typeof r.children?r.children(r):Object(n.createElement)(a,r)}(Object(yt.a)({as:a,className:"components-visually-hidden"},r))};function jt(e){var t=e.id,a=e.label,r=e.hideLabelFromVision,s=e.help,i=e.className,c=e.children;return Object(n.createElement)("div",{className:R()("components-base-control",i)},Object(n.createElement)("div",{className:"components-base-control__field"},a&&t&&(r?Object(n.createElement)(Ot,{as:"label",htmlFor:t},a):Object(n.createElement)("label",{className:"components-base-control__label",htmlFor:t},a)),a&&!t&&(r?Object(n.createElement)(Ot,{as:"label"},a):Object(n.createElement)(jt.VisualLabel,null,a)),c),!!s&&Object(n.createElement)("p",{id:t+"__help",className:"components-base-control__help"},s))}jt.VisualLabel=function(e){var t=e.className,a=e.children;return t=R()("components-base-control__label",t),Object(n.createElement)("span",{className:t},a)};var It=jt,Nt=a(707);var Rt=kt(function(e){var t=e.label,a=e.className,r=e.heading,s=e.checked,i=e.help,c=e.instanceId,o=e.onChange,l=Object(ht.a)(e,["label","className","heading","checked","help","instanceId","onChange"]),u="inspector-checkbox-control-".concat(c);return Object(n.createElement)(It,{label:r,id:u,help:i,className:a},Object(n.createElement)("span",{className:"components-checkbox-control__input-container"},Object(n.createElement)("input",Object(ft.a)({id:u,className:"components-checkbox-control__input",type:"checkbox",value:"1",onChange:function(e){return o(e.target.checked)},checked:s,"aria-describedby":i?u+"__help":void 0},l)),s?Object(n.createElement)(Nt.a,{icon:"yes",className:"components-checkbox-control__checked",role:"presentation"}):null),Object(n.createElement)("label",{className:"components-checkbox-control__label",htmlFor:u},t))});var Ct=kt(function(e){var t=e.label,a=e.className,r=e.selected,s=e.help,i=e.instanceId,c=e.onChange,o=e.options,l=void 0===o?[]:o,u="inspector-radio-control-".concat(i),d=function(e){return c(e.target.value)};return!Object(v.isEmpty)(l)&&Object(n.createElement)(It,{label:t,id:u,help:s,className:R()(a,"components-radio-control")},l.map(function(e,t){return Object(n.createElement)("div",{key:"".concat(u,"-").concat(t),className:"components-radio-control__option"},Object(n.createElement)("input",{id:"".concat(u,"-").concat(t),className:"components-radio-control__input",type:"radio",name:u,value:e.value,onChange:d,checked:e.value===r,"aria-describedby":s?"".concat(u,"__help"):void 0}),Object(n.createElement)("label",{htmlFor:"".concat(u,"-").concat(t)},e.label))}))}),qt=a(678),wt=function(e){function t(){var e;return $()(this,t),e=Q()(this,Z()(t).call(this)),E()(bt()(e),"onSignatureChecked",function(t,a,n){var r=e.props,s=r.rateObject.service_id,i=r.updateValue,c=t?{id:a,value:n.netCost}:null;e.setState({selectedSignature:c}),i(s,t?n.value:0)}),e.state={signatureOption:!1},e}return te()(t,e),K()(t,[{key:"renderServices",value:function(e,t,a){var n=[];if(a.tracking)switch(e){case"usps":n.push(Object(l.translate)("Includes USPS tracking"));break;default:n.push(Object(l.translate)("Includes tracking"))}return a.insurance&&n.push(Object(l.translate)("Insurance (up to %s)",{args:[pt()(a.insurance,"USD")]})),t.filter(function(e){return 0===e.netCost}).length>0&&n.push(Object(l.translate)("Signature required")),a.free_pickup&&n.push(Object(l.translate)("Eligible for free pickup")),n.join(", ")}},{key:"renderSignatureOptions",value:function(e){var t=this;return e.map(function(e,a){return r.a.createElement(Rt,{key:a,name:"signature_option_".concat(a),label:e.label,checked:!!t.state.selectedSignature&&t.state.selectedSignature.id===a,onChange:function(n){return t.onSignatureChecked(n,a,e)}})})}},{key:"render",value:function(){var e=this.props,t=e.rateObject,a=t.title,n=t.service_id,s=t.carrier_id,i=t.rate,c=t.delivery_days,o=t.delivery_date_guaranteed,u=t.delivery_date,d=t.tracking,p=t.insurance,g=t.free_pickup,b=e.isSelected,f=e.updateValue,h=e.signatureRates,_=this.state.selectedSignature,E=Object(v.values)(Object(v.mapValues)(h,function(e,t){var a=0===e.optionNetCost?Object(l.translate)("free"):Object(l.translate)("+%s",{args:[pt()(e.optionNetCost,"USD")]});return{label:Object(l.translate)("%(label)s (%(price)s)",{args:{label:e.label,price:a}}),value:t,netCost:e.optionNetCost}})),k="";o&&u?k=Object(l.moment)(u).format("LL").split(",")[0]:c&&(k=Object(l.translate)("%(delivery_days)s business day","%(delivery_days)s business days",{count:c,args:{delivery_days:c}}));var y=_?i+_.value:i;return r.a.createElement("div",{className:"rates-step__shipping-rate-container"},r.a.createElement(Ct,{className:"rates-step__shipping-rate-radio-control",selected:b?n:null,options:[{label:"",value:n}],onChange:function(){f(n,!1)}}),r.a.createElement("div",{className:"rates-step__shipping-rate-information"},r.a.createElement(qt.a,{carrier:s,size:30}),r.a.createElement("div",{className:"rates-step__shipping-rate-description"},r.a.createElement("div",{className:"rates-step__shipping-rate-description-title"},a),r.a.createElement("div",{className:"rates-step__shipping-rate-description-details"},this.renderServices(s,E,{tracking:d,insurance:p,free_pickup:g}),b&&E.length>1?this.renderSignatureOptions(E):null)),r.a.createElement("div",{className:"rates-step__shipping-rate-details"},r.a.createElement("div",{className:"rates-step__shipping-rate-rate"},"ups"===s?r.a.createElement(et.a,{position:"top left",text:Object(l.translate)("This rate is provided by your connected UPS account")},r.a.createElement("div",{className:"rates-step__shipping-rate-rate-tooltip"},r.a.createElement(m.a,{icon:"help-outline",size:18}))):null,pt()(y,"USD")),r.a.createElement("div",{className:"rates-step__shipping-rate-delivery-date"},k))))}}]),t}(n.Component);wt.propTypes={rateObject:i.a.shape({rate_id:i.a.string.isRequired,title:i.a.string.isRequired,service_id:i.a.string.isRequired,carrier_id:i.a.string.isRequired,rate:i.a.number.isRequired,delivery_days:i.a.number,delivery_date_guaranteed:i.a.bool,delivery_date:i.a.string,tracking:i.a.bool,insurance:i.a.number,free_pickup:i.a.bool}).isRequired,signatureRates:i.a.object.isRequired};var xt=wt,St={signature_required:u.a.translate("Signature required"),adult_signature_required:u.a.translate("Adult signature required")},Pt=function(e,t,a){var n=function(e,t,a){var n=Object(v.find)(a[e].default.rates,function(e){return t===e.service_id});return"undefined"!==typeof n?n.rate:0}(e,t,a);return Object(v.pickBy)(Object(v.mapValues)(a[e],function(e,a){var r=function(e,t,a,n){var r=Object(v.find)(a,function(t){return e===t.service_id});return"undefined"===typeof r?null:t in St?r.rate===n&&"Express"!==e?null:r:null}(t,a,e.rates,n);return null!==r?{rate:r,label:St[a],optionNetCost:r.rate-n}:null}),function(e){return null!==e})},Tt=function(e){var t=e.id,a=e.selectedRates,n=e.availableRates,s=e.selectedPackages,i=e.allPackages,c=e.updateRate,o=e.errors,l=e.shouldShowRateNotice,u=e.translate,d=me(s,i,!0),m=1===Object.keys(s).length;return r.a.createElement("div",null,l&&function(e){return r.a.createElement(y.a,{className:"rates-step__notice",icon:"info-outline",showDismiss:!1,text:e("The service and rate chosen by the customer at checkout is not available. Please choose another.")})}(u),Object.values(Object(v.mapValues)(s,function(e,s){if(!(s in n))return null;var i=a[s]||"",l=n[s].default.rates,p=(o[s]||[]).filter(function(e,t){return o[s].indexOf(e)===t}),g=function(e,t){return c(s,e,t)};return r.a.createElement("div",{key:s,className:"rates-step__package-container"},m?null:r.a.createElement("div",{className:"rates-step__package-container-rates-header"},u("Choose rate: %(pckg)s",{args:{pckg:d[s]}})),Object.values(Object(v.mapValues)(l,function(e){var a=e.service_id;return r.a.createElement(xt,{id:t+"_"+s,key:t+"_"+s+"_"+a,rateObject:e,signatureRates:Pt(s,a,n),updateValue:g,isSelected:a===i.serviceId})})),p.map(function(e,t){return r.a.createElement(fe.a,{type:"server-error",key:t,text:e})}))})))};Tt.propTypes={id:i.a.string.isRequired,selectedRates:i.a.object.isRequired,availableRates:i.a.object.isRequired,selectedPackages:i.a.object.isRequired,allPackages:i.a.object.isRequired,updateRate:i.a.func.isRequired,errors:i.a.object.isRequired};var zt=Object(l.localize)(Tt);function Dt(e){var t=Object(v.get)(e,"shipping_lines",[]);return Object(v.reduce)(t,function(e,t){return e+parseFloat(t.total)},0)}function At(e){return Object(v.get)(e,"shipping_lines[0].method_title",!1)}var Ut=a(607),Vt=function(e){var t=e.siteId,a=e.orderId,n=e.form,s=e.allPackages,i=e.values,c=e.available,o=e.errors,l=e.ratesTotal,u=e.translate,d=function(e,t,a,n,r){if(!n)return r("Unsaved changes made to packages");if(Object(v.some)(Object(v.mapValues)(t,function(e){return Object(v.isEmpty)(e.default.rates)})))return r("No rates found");if(!a)return"";var s=Object.keys(e);if(1===s.length){var i=s[0],c=e[i],o=t[i].default.rates,l=Object(v.find)(o,["service_id",c]);return l?r("%(serviceName)s: %(rate)s",{args:{serviceName:l.title,rate:pt()(l.rate,"USD")}}):""}return r("Total rate: %(total)s",{args:{total:pt()(a,"USD")}})}(i,c,l,n.packages.saved,u),p=function(n,r,s){return e.updateRate(a,t,n,r,s)};return Object(v.forEach)(n.packages.selected,function(e,t){if(""===i[t]&&!Object(v.isEmpty)(c)&&t in c&&1===c[t].default.rates.length){var a=c[t].default.rates[0].service_id;p(t,a,!1)}}),r.a.createElement(se,h()({title:u("Shipping rates"),summary:d,expanded:!Object(v.isEmpty)(c),toggleStep:function(){return e.toggleStep(a,t,"rates")}},function(e){var t=e.retrievalInProgress,a=e.errors,n=e.available,r=e.form;return t?{isProgress:!0}:Object(I.a)(a)?{isError:!0}:Object(v.isEmpty)(n)?{}:r.packages.saved?{isSuccess:!0}:{isWarning:!0}}(e)),!Object(v.isEmpty)(c)&&function(e){var t=e.shippingMethod,a=e.shippingCost,n=e.translate,s=document.createElement("div");s.innerHTML=t;var i,c=s.textContent;if(t)return i=0<a?n("Customer paid a {{shippingMethod/}} of {{shippingCost/}} for shipping",{components:{shippingMethod:r.a.createElement("span",null,c),shippingCost:r.a.createElement("span",{className:"rates-step__shipping-info-cost"},pt()(a,"USD"))}}):n("Your customer selected {{shippingMethod/}}",{components:{shippingMethod:r.a.createElement("span",{className:"rates-step__shipping-info-method"},c)}}),r.a.createElement("div",{className:"rates-step__shipping-info"},r.a.createElement(m.a,{icon:"info-outline"}),r.a.createElement("div",null,i))}(e),r.a.createElement(zt,{id:"rates",orderId:a,siteId:t,showRateNotice:!1,selectedPackages:n.packages.selected,allPackages:s,selectedRates:i,availableRates:c,updateRate:p,errors:o}))};Vt.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,form:i.a.object.isRequired,values:i.a.object.isRequired,available:i.a.object.isRequired,errors:i.a.object.isRequired,toggleStep:i.a.func.isRequired,updateRate:i.a.func.isRequired};var Ft=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.s)(e,a,n),s=Object(W.i)(e,a,n),i=Object(W.k)(e,a,n),c=Object(Ut.a)(e,a,n);return b()({},s.form.rates,{form:s.form,errors:r&&Object(W.f)(e,a,n).rates,ratesTotal:i?i.total:0,allPackages:Object(pe.a)(e,n),shippingCost:Dt(c),shippingMethod:At(c)})},function(e){return Object(o.b)({toggleStep:M.U,updateRate:M.Y},e)})(Object(l.localize)(Vt)),Mt=a(604),Wt=function(e){function t(){var e,a;$()(this,t);for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return a=Q()(this,(e=Z()(t)).call.apply(e,[this].concat(s))),E()(bt()(a),"renderDiscount",function(e){var t=a.props.translate,n=t("WooCommerce Services gives you access to USPS Commercial Pricing, which is discounted over Retail rates.");return r.a.createElement("div",{className:"label-purchase-modal__price-item-help"},r.a.createElement(et.a,{className:"label-purchase-modal__price-item-tooltip is-dialog-visible",position:"top center",text:n},r.a.createElement("div",{className:"label-purchase-modal__discount"},t("You save %s with WooCommerce Services",{args:[pt()(e,"USD")]}),r.a.createElement(m.a,{icon:"help-outline",size:18}))))}),E()(bt()(a),"renderRow",function(e,t,a,n){var s=R()("label-purchase-modal__price-item",{"label-purchase-modal__price-item-total":n});return r.a.createElement("div",{key:a,className:s},r.a.createElement("div",{className:"label-purchase-modal__price-item-name"},e),r.a.createElement("div",{className:"label-purchase-modal__price-item-amount"},pt()(t,"USD")))}),a}return te()(t,e),K()(t,[{key:"render",value:function(){var e=this,t=this.props,a=t.priceBreakdown,s=t.translate;if(!a)return null;var i=a.prices,c=a.discount,o=a.total;return r.a.createElement("div",{className:"label-purchase-modal__shipping-summary-section"},r.a.createElement("hr",null),i.map(function(t,a){var i=s("Package %(index)s \u2013 %(title)s",{args:{index:a+1,title:t.carrierTitle}});return r.a.createElement(n.Fragment,{key:a},e.renderRow(i,t.rateWithDiscount,a),"ups"===t.carrierId?r.a.createElement("div",{className:"label-purchase-modal__price-item-carrier-account-notice"}," ",s("Your UPS account will be charged")):r.a.createElement("div",null),t.addons.map(function(t,n){return r.a.createElement("div",{key:"addons-"+a,className:"label-purchase-modal__price-item-addons"},e.renderRow(t.title,t.rate,"addon-"+n))}))}),this.renderRow(s("Total"),o,"total",!0),0<c&&this.renderDiscount(c))}}]),t}(n.Component);Wt.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired};var Lt=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId;return{priceBreakdown:Object(W.k)(e,a,n)}})(Object(l.localize)(Wt)),Bt=function(e){var t=e.translate,a=e.normalizationStatus,n=e.form,s=e.orderId,i=e.siteId,c=n.origin,o=n.rates,l=Object.keys(o.values).length;return r.a.createElement("div",{className:"label-purchase-modal__shipping-summary-section"},r.a.createElement("div",{className:"label-purchase-modal__shipping-summary-header"},t("Shipping summary")),r.a.createElement("div",{className:"label-purchase-modal__shipping-summary-info"},a.isSuccess?r.a.createElement("div",{className:"label-purchase-modal__shipping-summary-street"},r.a.createElement("div",null,t("Shipping from")),r.a.createElement("div",null,c.values.address,r.a.createElement("a",{href:"#",onClick:function(){return e.toggleStep(s,i,"origin",!0)}},t("Edit")))):null),r.a.createElement("div",{className:"label-purchase-modal__shipping-summarry-labels"},l+" "+t("shipping label ready","shipping labels ready",{count:l})))};Bt.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired};var Ht=function(e){var t=e.normalizationInProgress,a=e.errors,n=e.isNormalized,r=e.values,s=e.normalized;return t?{isProgress:!0}:Object(I.a)(a)||n&&!s||!n?{isError:!0}:n?Object(v.isEqual)(r,s)?{isSuccess:!0}:{isWarning:!0}:{}},Yt=Object(l.localize)(Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.s)(e,a,n),s=Object(W.i)(e,a,n),i=s.form.origin,c=r&&Object(W.f)(e,a,n).origin;return{orderId:a,siteId:n,errors:c,form:s.form,expanded:i.expanded,normalizationStatus:Ht(b()({},i,{errors:c}))}},function(e){return Object(o.b)({toggleStep:M.U},e)})(Bt)),$t=function(e){var t=e.form,a=e.disabled,s=e.busy;return r.a.createElement(n.Fragment,null,r.a.createElement(de.a,{disabled:a,onClick:t.needsPrintConfirmation?e.confirmPrintLabel:e.purchaseLabel,primary:!0,busy:s},function(e){var t=e.form,a=e.translate;return t.needsPrintConfirmation?a("Print"):t.isSubmitting?a("Purchasing\u2026"):a("Buy shipping label","Buy shipping labels",{count:Object.keys(t.packages.selected).length})}(e)))};$t.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,disabled:i.a.bool,busy:i.a.bool};var Gt=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.s)(e,a,n),s=Object(W.i)(e,a,n);return{form:r&&s.form}},function(e,t){var a=t.orderId,n=t.siteId;return{confirmPrintLabel:function(){return e(Object(M.j)(a,n))},purchaseLabel:function(){return e(Object(M.B)(a,n))}}})(Object(l.localize)($t)),Kt=a(567),Jt=function(e){function t(){var e,a;$()(this,t);for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return a=Q()(this,(e=Z()(t)).call.apply(e,[this].concat(r))),E()(bt()(a),"onVisibilityChange",function(){document.hidden||a.refetchSettings(),a.creditCardWindow&&a.creditCardWindow.closed&&document.removeEventListener("visibilitychange",a.onVisibilityChange)}),E()(bt()(a),"refetchSettings",function(){a.props.fetchSettings(a.props.siteId)}),E()(bt()(a),"onChooseCard",function(){a.creditCardWindow=window.open(a.props.url),document.addEventListener("visibilitychange",a.onVisibilityChange)}),a}return te()(t,e),K()(t,[{key:"render",value:function(){var e=this.props,t=e.disabled,a=e.buttonLabel,s=e.buttonDescription;return r.a.createElement(n.Fragment,null,r.a.createElement(de.a,{onClick:this.onChooseCard,disabled:t,primary:!0},a," ",r.a.createElement(m.a,{icon:"external"})),r.a.createElement("div",{className:"purchase-section__explanation"},s(this.onChooseCard)))}}]),t}(n.Component),Qt=Object(c.b)(function(e){return e},function(e){return Object(o.b)({fetchSettings:Kt.a},e)})(Object(l.localize)(Jt)),Xt=a(645),Zt=(a(783),Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.s)(e,a,n),s=Object(W.i)(e,a,n),i=r&&Object(W.b)(e,a,n),c=r&&s.form;return{form:c,hasLabelsPaymentMethod:Boolean(Object(qe.n)(e,n)),paymentMethods:Object(qe.l)(e,n),disablePurchase:!c.needsPrintConfirmation&&(!i||c.isSubmitting)}})(Object(l.localize)(function(e){var t=e.orderId,a=e.siteId,n=e.hasLabelsPaymentMethod,s=e.paymentMethods,i=e.form,c=e.disablePurchase,o=e.translate,l=i.isSubmitting&&!i.needsPrintConfirmation,u=Object(W.m)(i.rates);return r.a.createElement("div",{className:"purchase-section"},n||!u?r.a.createElement(Gt,{siteId:a,orderId:t,disabled:c,busy:l}):s.length?r.a.createElement(Qt,{disabled:c,url:"admin.php?page=wc-settings&tab=shipping§ion=woocommerce-services-settings",buttonLabel:o("Choose credit card"),buttonDescription:function(e){return o("To print this shipping label, {{a}}choose a credit card to add to your account{{/a}}.",{components:{a:r.a.createElement("a",{onClick:e,href:"#",role:"button"})}})}}):r.a.createElement(Qt,{disabled:c,url:Object(Xt.a)()+"/me/purchases/add-credit-card",buttonLabel:o("Add credit card"),buttonDescription:function(e){return o("To print this shipping label, {{a}}add a credit card to your account{{/a}}.",{components:{a:r.a.createElement("a",{onClick:e,href:"#",role:"button"})}})}}))}))),ea=a(688),ta=a(532),aa=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(ta.a)(e);return Object(v.get)(e,["extensions","woocommerce","ui","orders",t,"edits","currentlyEditingId"],null)},na=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(ta.a)(e),a=aa(e,t),n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(ta.a)(e);return Object(v.get)(e,["extensions","woocommerce","ui","orders",t,"edits","changes"],{})}(e,t);if(Object(v.isObject)(a)){var r=function(){var e=Object(ea.b)(0,"USD");return{status:"pending",currency:"USD",discount_total:e,discount_tax:e,shipping_total:e,shipping_tax:e,cart_tax:e,total:e,total_tax:e,prices_include_tax:!1,billing:{},shipping:{},payment_method:"calypso_manual",payment_method_title:Object(l.translate)("Manual Payment"),line_items:[],tax_lines:[],shipping_lines:[],fee_lines:[],coupon_lines:[],refunds:[]}}();return b()({},r,n,{id:a})}var s=Object(Ut.a)(e,a,t);return s?Object(v.merge)({},s,n):n},ra=a(637),sa=function(e){var t=e.orderId,a=e.siteId,n=e.form,s=e.errors,i=e.paperSize,c=e.translate,o=e.fulfillOrder,l=e.emailDetails,u=e.order,d=e.hasLabelsPaymentMethod;return r.a.createElement("div",{className:"label-purchase-modal__sidebar"},r.a.createElement(Yt,{siteId:a,orderId:t}),r.a.createElement(Lt,{siteId:a,orderId:t}),r.a.createElement("hr",null),r.a.createElement("div",{className:"label-purchase-modal__purchase-container"},d?r.a.createElement(j.a,{id:"paper_size",valuesMap:Object(Mt.a)(n.origin.values.country),title:c("Paper size"),value:i,updateValue:function(n){return e.updatePaperSize(t,a,n)},error:s.paperSize}):null,r.a.createElement(Zt,{siteId:a,orderId:t})),r.a.createElement(Rt,{className:"label-purchase-modal__option-mark-order-fulfilled",label:Object(ra.b)(u.status)?c("Notify the customer with shipment details"):c("Mark this order as complete and notify the customer"),checked:o||l,onChange:function(n){e.setFulfillOrderOption(t,a,n&&!Object(ra.b)(u.status)),e.setEmailDetailsOption(t,a,n&&Object(ra.b)(u.status))}}))};sa.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,paperSize:i.a.string.isRequired,errors:i.a.object.isRequired,form:i.a.object.isRequired,updatePaperSize:i.a.func.isRequired,fulfillOrder:i.a.bool.isRequired,emailDetails:i.a.bool.isRequired,order:i.a.object.isRequired,hasLabelsPaymentMethod:i.a.bool.isRequired,setFulfillOrderOption:i.a.func.isRequired};var ia=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.s)(e,a,n),s=Object(W.i)(e,a,n);return{order:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(ta.a)(e);return!!aa(e,t)}(e)?na(e):Object(Ut.a)(e,a),paperSize:s.paperSize,form:s.form,hasLabelsPaymentMethod:Boolean(Object(qe.n)(e,n)),errors:r&&Object(W.f)(e,a,n).sidebar,fulfillOrder:r&&Object(W.u)(e,a,n),emailDetails:r&&Object(W.t)(e,a,n)}},function(e){return Object(o.b)({setEmailDetailsOption:M.M,setFulfillOrderOption:M.N,updatePaperSize:M.X},e)})(Object(l.localize)(sa)),ca=function(e){var t=e.loaded,a=e.translate;if(!t)return null;var n=function(){return e.exitPrintingFlow(e.orderId,e.siteId,!1)};return r.a.createElement(p.a,{additionalClassNames:"woocommerce label-purchase-modal wcc-root",isVisible:e.showPurchaseDialog,onClose:n},r.a.createElement("div",{className:"label-purchase-modal__content"},r.a.createElement("div",{className:"label-purchase-modal__header"},r.a.createElement(Se.a,null,a("Create shipping label","Create shipping labels",{count:Object.keys(e.form.packages.selected).length})),r.a.createElement(de.a,{className:"label-purchase-modal__close-button",onClick:n},r.a.createElement(m.a,{icon:"cross"}))),r.a.createElement("div",{className:"label-purchase-modal__body"},r.a.createElement("div",{className:"label-purchase-modal__main-section"},r.a.createElement(ue,{type:"origin",title:a("Origin address"),siteId:e.siteId,orderId:e.orderId}),r.a.createElement(ue,{type:"destination",title:a("Destination address"),siteId:e.siteId,orderId:e.orderId}),r.a.createElement(We,{siteId:e.siteId,orderId:e.orderId}),e.isCustomsFormRequired&&r.a.createElement(dt,{siteId:e.siteId,orderId:e.orderId}),r.a.createElement(Ft,{siteId:e.siteId,orderId:e.orderId})),r.a.createElement(ia,{siteId:e.siteId,orderId:e.orderId}))))};ca.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired};t.default=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.s)(e,a,n),s=Object(W.i)(e,a,n);return{loaded:r,form:r&&s.form,showPurchaseDialog:s.showPurchaseDialog,isCustomsFormRequired:Object(W.o)(e,a,n)}},function(e){return Object(o.b)({exitPrintingFlow:M.o},e)})(Object(l.localize)(ca))}}]);
|
1 |
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[149],{546:function(e,t,a){"use strict";var n=a(530),r=a.n(n),s=a(533),i=a.n(s),c=a(36),o=a.n(c),l=a(10),u=a.n(l),d=a(12),m=a.n(d),p=a(526),g=a.n(p),b=a(35),f=a(1),h=function(e){var t=e.children,a=e.required,n=e.optional,s=e.translate,c=e.className,l=i()(e,["children","required","optional","translate","className"]);return t=u.a.Children.toArray(t)||[],a&&t.push(function(e){return u.a.createElement("small",{className:"form-label__required"},e("Required"))}(s)),n&&t.push(function(e){return u.a.createElement("small",{className:"form-label__optional"},e("Optional"))}(s)),u.a.createElement("label",r()({},Object(f.omit)(l,"moment","numberFormat"),{className:g()(c,"form-label")}),t.length?t.map(function(e,t){return Object(f.isObject)(e)?o()({},e,{key:t}):e}):null)};h.propTypes={required:m.a.bool},t.a=Object(b.localize)(h)},553:function(e,t,a){"use strict";var n=a(107),r=a.n(n),s=a(108),i=a.n(s),c=a(528),o=a.n(c),l=a(527),u=a.n(l),d=a(531),m=a.n(d),p=a(529),g=a.n(p),b=a(34),f=a.n(b),h=a(12),v=a.n(h),_=a(10),E=a.n(_),k=a(526),y=a.n(k),O=a(1),j=a(35),I=a(534),N=a.n(I),R=a(564),C=function(e){function t(){var e,a;r()(this,t);for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return a=o()(this,(e=u()(t)).call.apply(e,[this].concat(s))),f()(m()(a),"dismissTimeout",null),a}return g()(t,e),i()(t,[{key:"componentDidMount",value:function(){this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"componentWillUnmount",value:function(){this.dismissTimeout&&clearTimeout(this.dismissTimeout)}},{key:"componentDidUpdate",value:function(){clearTimeout(this.dismissTimeout),this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"getIcon",value:function(){var e;switch(this.props.status){case"is-info":e="info";break;case"is-success":e="checkmark";break;case"is-error":case"is-warning":e="notice";break;default:e="info"}return e}},{key:"render",value:function(){var e=this.props,t=e.children,a=e.className,n=e.icon,r=e.isCompact,s=e.isLoading,i=e.onDismissClick,c=e.showDismiss,o=void 0===c?!r:c,l=e.status,u=e.text,d=e.translate,m=y()("notice",l,a,{"is-compact":r,"is-loading":s,"is-dismissable":o});return E.a.createElement("div",{className:m},E.a.createElement("span",{className:"notice__icon-wrapper"},E.a.createElement(N.a,{className:"notice__icon",icon:n||this.getIcon(),size:24})),E.a.createElement("span",{className:"notice__content"},E.a.createElement("span",{className:"notice__text"},u||t)),u?t:null,o&&E.a.createElement("span",{tabIndex:"0",className:"notice__dismiss",onClick:i},E.a.createElement(N.a,{icon:"cross",size:24}),E.a.createElement(R.a,null,d("Dismiss"))))}}]),t}(_.Component);f()(C,"defaultProps",{className:"",duration:0,icon:null,isCompact:!1,isLoading:!1,onDismissClick:O.noop,status:null,text:null}),f()(C,"propTypes",{className:v.a.string,duration:v.a.number,icon:v.a.string,isCompact:v.a.bool,isLoading:v.a.bool,onDismissClick:v.a.func,showDismiss:v.a.bool,status:v.a.oneOf(["is-error","is-info","is-success","is-warning","is-plain"]),text:v.a.oneOfType([v.a.arrayOf(v.a.oneOfType([v.a.string,v.a.node])),v.a.oneOfType([v.a.string,v.a.node])]),translate:v.a.func.isRequired}),t.a=Object(j.localize)(C)},557:function(e,t,a){"use strict";a.d(t,"a",function(){return N});var n=a(530),r=a.n(n),s=a(107),i=a.n(s),c=a(108),o=a.n(c),l=a(528),u=a.n(l),d=a(527),m=a.n(d),p=a(531),g=a.n(p),b=a(529),f=a.n(b),h=a(34),v=a.n(h),_=a(10),E=a.n(_),k=a(12),y=a.n(k),O=a(526),j=a.n(O),I=a(1),N=function(e){function t(){var e;return i()(this,t),(e=u()(this,m()(t).apply(this,arguments))).selectOnFocus=e.selectOnFocus.bind(g()(e)),e}return f()(t,e),o()(t,[{key:"focus",value:function(){this.refs.textField.focus()}},{key:"selectOnFocus",value:function(e){this.props.selectOnFocus&&e.target.select()}},{key:"render",value:function(){var e=this.props.inputRef,t=Object(I.omit)(this.props,"isError","isValid","selectOnFocus","inputRef"),a=j()("form-text-input",this.props.className,{"is-error":this.props.isError,"is-valid":this.props.isValid});return E.a.createElement("input",r()({type:"text"},t,{ref:e||"textField",className:a,onClick:this.selectOnFocus}))}}]),t}(_.PureComponent);v()(N,"propTypes",{isError:y.a.bool,isValid:y.a.bool,selectOnFocus:y.a.bool,className:y.a.string})},580:function(e,t,a){"use strict";var n=a(530),r=a.n(n),s=a(533),i=a.n(s),c=a(107),o=a.n(c),l=a(108),u=a.n(l),d=a(528),m=a.n(d),p=a(527),g=a.n(p),b=a(531),f=a.n(b),h=a(529),v=a.n(h),_=a(34),E=a.n(_),k=a(526),y=a.n(k),O=a(35),j=a(1),I=a(10),N=a.n(I),R=a(542),C=function(e){function t(){var e,a;o()(this,t);for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return a=m()(this,(e=g()(t)).call.apply(e,[this].concat(r))),E()(f()(a),"getDefaultButtonAction",function(){return a.props.isSubmitting?a.props.translate("Saving\u2026"):a.props.translate("Save Settings")}),a}return v()(t,e),u()(t,[{key:"render",value:function(){var e=this.props,t=e.children,a=e.className,n=e.isPrimary,s=i()(e,["children","className","isPrimary"]),c=y()(a,"form-button");return N.a.createElement(R.a,r()({},Object(j.omit)(s,["isSubmitting","moment","numberFormat","translate"]),{primary:n,className:c}),I.Children.count(t)?t:this.getDefaultButtonAction())}}]),t}(N.a.Component);E()(C,"defaultProps",{isSubmitting:!1,isPrimary:!0,type:"submit"}),t.a=Object(O.localize)(C)},586:function(e,t,a){"use strict";var n=a(10),r=a.n(n),s=a(12),i=a.n(s),c=a(545),o=a(546),l=a(557),u=a(550),d=a(558),m=function(e){var t=e.id,a=e.title,n=e.description,s=e.value,i=e.placeholder,m=e.updateValue,p=e.error,g=e.className;return r.a.createElement(c.a,{className:g},r.a.createElement(o.a,{htmlFor:t},a),r.a.createElement(l.a,{id:t,name:t,placeholder:i,value:s,onChange:function(e){return m(e.target.value)},isError:Boolean(p)}),p&&"string"===typeof p&&r.a.createElement(u.a,{text:p}),!p&&n&&r.a.createElement(d.a,null,n))};m.propTypes={id:i.a.string.isRequired,title:i.a.node,description:i.a.string,value:i.a.string.isRequired,updateValue:i.a.func,error:i.a.oneOfType([i.a.string,i.a.bool]),className:i.a.string},t.a=m},589:function(e,t,a){"use strict";a.d(t,"a",function(){return j});var n=a(533),r=a.n(n),s=a(107),i=a.n(s),c=a(108),o=a.n(c),l=a(528),u=a.n(l),d=a(527),m=a.n(d),p=a(529),g=a.n(p),b=a(34),f=a.n(b),h=a(10),v=a.n(h),_=a(12),E=a.n(_),k=a(526),y=a.n(k),O=a(557),j=function(e){function t(){return i()(this,t),u()(this,m()(t).apply(this,arguments))}return g()(t,e),o()(t,[{key:"render",value:function(){var e=this.props,t=e.noWrap,a=e.prefix,n=e.suffix,s=r()(e,["noWrap","prefix","suffix"]);return v.a.createElement("div",{className:y()("form-text-input-with-affixes",{"no-wrap":t})},a&&v.a.createElement("span",{className:"form-text-input-with-affixes__prefix"},a),v.a.createElement(O.a,s),n&&v.a.createElement("span",{className:"form-text-input-with-affixes__suffix"},n))}}]),t}(v.a.Component);f()(j,"displayName","FormTextInputWithAffixes"),f()(j,"propTypes",{noWrap:E.a.bool,prefix:E.a.node,suffix:E.a.node})},601:function(e,t,a){"use strict";var n=a(107),r=a.n(n),s=a(108),i=a.n(s),c=a(528),o=a.n(c),l=a(527),u=a.n(l),d=a(529),m=a.n(d),p=a(34),g=a.n(p),b=a(10),f=a.n(b),h=a(12),v=a.n(h),_=a(526),E=a.n(_),k=a(1),y=a(534),O=a.n(y),j=(a(629),function(e){function t(){return r()(this,t),o()(this,u()(t).apply(this,arguments))}return m()(t,e),i()(t,[{key:"render",value:function(){var e=E()("external-link",this.props.className,{"icon-first":!!this.props.showIconFirst},{"has-icon":!!this.props.icon}),t=Object(k.assign)({},Object(k.omit)(this.props,"icon","iconSize","showIconFirst","iconClassName"),{className:e,rel:"external"});t.target&&(t.rel=t.rel.concat(" noopener noreferrer"));var a=f.a.createElement(O.a,{className:this.props.iconClassName,icon:"external",size:this.props.iconSize});return f.a.createElement("a",t,this.props.icon&&this.props.showIconFirst&&a,this.props.children,this.props.icon&&!this.props.showIconFirst&&a)}}]),t}(b.Component));g()(j,"defaultProps",{iconSize:18,showIconFirst:!1}),g()(j,"propTypes",{className:v.a.string,href:v.a.string,onClick:v.a.func,icon:v.a.bool,iconSize:v.a.number,target:v.a.string,showIconFirst:v.a.bool,iconClassName:v.a.string}),t.a=j},613:function(e,t,a){"use strict";var n=a(530),r=a.n(n),s=a(10),i=a.n(s),c=a(12),o=a.n(c),l=a(526),u=a.n(l),d=a(534),m=a.n(d),p=a(1),g=function(e){var t=e.className,a=e.disabled,n=e.checked,s=e.partialChecked,c=Object(p.omit)(e,["className","partialChecked"]);return i.a.createElement("span",{className:u()(t,"form-checkbox",{"is-disabled":a})},i.a.createElement("input",r()({},c,{type:"checkbox"})),n&&i.a.createElement(m.a,{icon:"checkmark",size:14}),!n&&s&&i.a.createElement(m.a,{icon:"minus-small",size:16}))};g.propTypes={checked:o.a.bool.isRequired,partialChecked:o.a.bool,onChange:o.a.func.isRequired,className:o.a.string},t.a=g},615:function(e,t,a){"use strict";var n=a(530),r=a.n(n),s=a(533),i=a.n(s),c=a(10),o=a.n(c),l=a(526),u=a.n(l);t.a=function(e){var t=e.className,a=i()(e,["className"]);return o.a.createElement("input",r()({},a,{type:"checkbox",className:u()(t,"form-checkbox")}))}},629:function(e,t,a){},641:function(e,t,a){"use strict";var n=a(530),r=a.n(n),s=a(533),i=a.n(s),c=a(10),o=a.n(c),l=a(526),u=a.n(l);t.a=function(e){var t=e.className,a=i()(e,["className"]);return o.a.createElement("input",r()({},a,{type:"radio",className:u()(t,"form-radio")}))}},646:function(e,t,a){"use strict";var n=a(10),r=a.n(n),s=a(12),i=a.n(s),c=a(35),o=a(1),l=a(534),u=a.n(l),d=a(526),m=a.n(d),p=function(e){var t=e.isPlaceholder,a=e.data,n=e.dimensionUnit,s=e.prefixActions,i=(e.hasError,e.children),c=e.translate;if(t)return r.a.createElement("div",{className:"packages__packages-row placeholder"},r.a.createElement("div",{className:"packages__packages-row-icon"},r.a.createElement(u.a,{icon:"product",size:18})),r.a.createElement("div",{className:"packages__packages-row-details"},r.a.createElement("div",{className:"packages__packages-row-details-name"},r.a.createElement("span",null))),r.a.createElement("div",{className:"packages__packages-row-dimensions"},r.a.createElement("span",null)),r.a.createElement("div",{className:"packages__packages-row-actions"},i));var l,d=function(){return r.a.createElement("div",{className:"packages__packages-row-actions"},i)};return r.a.createElement("div",{className:m()("packages__packages-row",{prefixed:s})},s?d():null,r.a.createElement("div",{className:"packages__packages-row-icon"},function(e){var t=e?"mail":"product";return r.a.createElement(u.a,{icon:t,size:18})}(a.is_letter)),r.a.createElement("div",{className:"packages__packages-row-details"},r.a.createElement("div",{className:"packages__packages-row-details-name"},(l=a.name)&&""!==Object(o.trim)(l)?l:c("Untitled"))),r.a.createElement("div",{className:"packages__packages-row-dimensions"},a.inner_dimensions," ",n),s?null:d())};p.propTypes={siteId:i.a.number.isRequired,isPlaceholder:i.a.bool,data:i.a.shape({name:i.a.string,is_letter:i.a.bool,inner_dimensions:i.a.string}).isRequired,prefixActions:i.a.bool,dimensionUnit:i.a.string},t.a=Object(c.localize)(p)},647:function(e,t,a){"use strict";a.d(t,"a",function(){return r});var n=a(535);function r(e,t,a){return{type:n.L,successAction:e,failureAction:t,onlyPackages:a||!1}}},678:function(e,t,a){"use strict";var n=a(10),r=a.n(n),s=a(12),i=a.n(s),c=a(679),o=a.n(c),l=a(680),u=a.n(l),d=a(681),m=a.n(d),p={ups:o.a,usps:u.a,dhlexpress:m.a},g=function(e){var t=e.carrier,a=e.size;if(!t||!p[t.toLowerCase()])return r.a.createElement("span",null);var n="".concat(function(e){switch(e){case"small":return 24;case"big":return 40;case"medium":default:return 30}}(a),"px");return r.a.createElement("div",{style:{width:n},className:"carrier-icon"},r.a.createElement("img",{src:p[t.toLowerCase()],alt:t,className:"carrier-icon__logo"}))};g.propTypes={carrier:i.a.string.isRequired,size:i.a.number},t.a=g},679:function(e,t,a){e.exports=a.p+"images/881843a7135b8abd4794bd2d33dc8b3c.png"},680:function(e,t,a){e.exports=a.p+"images/41c6838923ebde874f7fc71db18dcae5.png"},681:function(e,t,a){e.exports=a.p+"images/224d57e46d3ace2d89e5c790bd828d32.png"},684:function(e,t,a){"use strict";var n=a(36),r=a.n(n),s=a(10),i=a.n(s),c=a(12),o=a.n(c),l=a(109),u=a(35),d=a(1),m=a(534),p=a.n(m),g=a(34),b=a.n(g),f=a(107),h=a.n(f),v=a(108),_=a.n(v),E=a(528),k=a.n(E),y=a(527),O=a.n(y),j=a(529),I=a.n(j),N=a(30),R=a(526),C=a.n(R),q=a(557),w=a(589);function x(e){return Object(d.get)(e,["currentUser","id"])}function S(e){var t=x(e);return t?function(e,t){return e.users.items[t]}(e,t):null}var P=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(a){var n=S(a);return Object(d.get)(n,e,t)}};P("localeSlug"),P("localeVariant"),P("user_ip_country_code");P("date"),P("username"),P("email");P("email_verified",!1);var T=a(532),z=a(562);function D(e){var t=Object(T.a)(e);return t||1!==function(e){var t=S(e);return t?t.site_count||0:null}(e)||(t=function(e){var t=S(e);return Object(d.get)(t,"primary_blog",null)}(e)),Object(z.a)(e,t)}var A=a(539),U=function(e,t){return Object(d.get)(e,["extensions","woocommerce","sites",t,"settings","products"])},V=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(T.a)(e);return Object(d.isArray)(U(e,t))},F=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(T.a)(e);return A.b===U(e,t)};function M(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(T.a)(e),a=U(e,t);return Object(d.find)(a,function(e){return"woocommerce_dimension_unit"===e.id})||{}}var W=a(561),L=a(556),B=a(535),H=function(e){return function(t,a){if(!V(a(),e)&&!F(a(),e)){var n={type:B.N,siteId:e};return t(n),Object(W.a)(e).get("settings/products").then(function(a){t({type:B.O,siteId:e,data:a})}).catch(function(a){t(Object(L.a)(e,n,a))})}}},Y=function(e){function t(){return h()(this,t),k()(this,O()(t).apply(this,arguments))}return I()(t,e),_()(t,[{key:"componentDidMount",value:function(){var e=this.props.siteId;e&&this.props.fetchSettingsProducts(e)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.siteId!==this.props.siteId&&this.props.fetchSettingsProducts(e.siteId)}},{key:"render",value:function(){var e=this.props,t=e.className,a=e.noWrap,n=e.dimensions,r=e.onChange,s=e.translate,c=e.dimensionsUnit,o=C()("form-dimensions-input",t,{"no-wrap":a});return i.a.createElement("div",{className:o},i.a.createElement(q.a,{name:"length",placeholder:s("L",{comment:"Length placeholder for dimensions input"}),type:"number",value:n&&n.length||"",onChange:r,className:"form-dimensions-input__length"}),i.a.createElement(q.a,{name:"width",placeholder:s("W",{comment:"Width placeholder for dimensions input"}),type:"number",value:n&&n.width||"",onChange:r,className:"form-dimensions-input__width"}),i.a.createElement(w.a,{name:"height",placeholder:s("H",{comment:"Height placeholder for dimensions input"}),suffix:c,type:"number",noWrap:a,value:n&&n.height||"",onChange:r,className:"form-dimensions-input__height"}))}}]),t}(s.Component);b()(Y,"propTypes",{className:o.a.string,dimensions:o.a.shape({width:o.a.string,height:o.a.string,length:o.a.string}),dimensionsUnit:o.a.string,onChange:o.a.func.isRequired,noWrap:o.a.bool}),b()(Y,"defaultProps",{value:"",className:"",onChange:d.noop,noWrap:!1});var $=Object(l.b)(function(e,t){var a=t.dimensionsUnit,n=D(e);if(!a){var r=n&&M(e,n.ID);a=r&&r.value||"in"}return{siteId:n&&n.ID,dimensionsUnit:a}},function(e){return Object(N.b)({fetchSettingsProducts:H},e)})(Object(u.localize)(Y)),G=a(545),K=a(546),J=a(579),Q=a(550),X=/^\.\d+$/,Z=/^\d+\.$/,ee=function(e){return e=Object(d.trim)(e),X.test(e)?e="0"+e:Z.test(e)&&(e=e.slice(0,e.length-1)),e},te=/^\s*(\S+)\s*x\s*(\S+)\s*x\s*(\S+)\s*$/,ae=/^\s*(\S+)?\s*x\s*(\S+)?\s*x\s*(\S+)?\s*$/,ne=function(e){return isNaN(e)?"":0>=e?"":e},re=function(e){return Object(d.trim)(e)},se=ee,ie=function(e){var t=te.exec(e);return t?[t[1],t[2],t[3]].map(ee).join(" x "):e},ce=function(e){var t="",a="",n="",r=ae.exec(e);return r&&4===r.length&&(t=ne(r[1]),a=ne(r[2]),n=ne(r[3])),{length:t,width:a,height:n}},oe=function(e){var t=e.siteId,a=e.form,n=e.setModalErrors,r=e.updatePackagesField,s=e.translate,c=a.mode,o=a.modalErrors,l=a.dimensionUnit,u=a.weightUnit,m=a.packageData,p=m.name,g=m.inner_dimensions,f=m.box_weight,h=m.is_letter,v=function(e,a){n(t,Object(d.omit)(o,e)),r(t,b()({},e,a))},_=function(e){var t=e.target.name,a=e.target.value;v(t,a)},E=function(e,t){var a=t||s("Invalid value."),n=""===Object(d.trim)(m[e])?s("This field is required."):a;return o[e]?i.a.createElement(Q.a,{text:n}):null},k=function(e){r(t,{is_letter:"envelope"===e.target.value})};return i.a.createElement("div",{className:"packages__properties-group"},"add-custom"===c?i.a.createElement(G.a,null,i.a.createElement(K.a,{htmlFor:"package_type"},s("Type of package")),i.a.createElement(J.a,{id:"package_type",onChange:k,value:h?"envelope":"box"},i.a.createElement("option",{value:"box"},s("Box")),i.a.createElement("option",{value:"envelope"},s("Envelope")))):null,i.a.createElement(G.a,null,i.a.createElement(K.a,{htmlFor:"name"},s("Package name")),i.a.createElement(q.a,{id:"name",name:"name",placeholder:s("Unique package name"),value:p||"",onChange:_,isError:o.name}),E("name",s("This field must be unique"))),i.a.createElement(G.a,{className:"packages__add-package-weight-group"},i.a.createElement("div",{className:"packages__add-package-weight"},i.a.createElement(K.a,null,s("Dimensions (L x W x H)")),function(e,t,a,n){var r=ce(t),s=r.length,c=r.width,o=r.height;return i.a.createElement($,{dimensionsUnit:a,dimensions:{width:c,height:o,length:s},onChange:function(t){var a=t.target.name,r=t.target.value;n(e,["length"===a?r:s,"width"===a?r:c,"height"===a?r:o].join(" x "))}})}("inner_dimensions",g,l,v),E("inner_dimensions")),i.a.createElement("div",{className:"packages__add-package-weight"},i.a.createElement(K.a,{htmlFor:"box_weight"},s("Weight of empty package")),i.a.createElement(w.a,{id:"box_weight",name:"box_weight",placeholder:s("0.0"),value:f||"",onChange:_,isError:o.box_weight,type:"number",noWrap:!0,suffix:u}),E("box_weight"))))};oe.propTypes={siteId:o.a.number.isRequired,form:o.a.object.isRequired,updatePackagesField:o.a.func.isRequired,packageData:o.a.shape({name:o.a.string.isRequired,inner_dimensions:o.a.string.isRequired,box_weight:o.a.number.isRequired,is_user_defined:o.a.bool.isRequired,is_letter:o.a.bool.isRequired}),setModalErrors:o.a.func.isRequired};var le=Object(u.localize)(oe),ue=a(113),de=a.n(ue),me=Object(d.memoize)(function(e){return de()(e,{greedy:!0})}),pe=function(e){return e&&""!==Object(d.trim)(e)?e:null},ge=function(e,t){return e=pe(e),Object(d.some)(t,function(t){return t===e})?null:e},be=/^\d+(\.\d+)?$/,fe=function(e){return be.test(e)?Number.parseFloat(e):null},he=function(e,t,a){var n,r=me(a);return r(function(e,t){var a=fe(e.box_weight),n=fe(e.max_weight);a&&n&&n<=a&&(n=null);var r={name:ge(e.name,t),inner_dimensions:e.inner_dimensions,outer_dimensions:pe(e.outer_dimensions),box_weight:a,max_weight:n};return Object(d.omitBy)(r,function(e){return null===e})}(e,t)),n=r.errors,Object(d.reduce)(n,function(e,t){if(t.field){var a,n=t.field.replace("data.","");Object.assign(e,(a={},b()(a,n,!0),b()(a,"any",!0),a))}return e},{})},ve=a(551),_e=a(548),Ee=a(580),ke=function(e){var t=e.className,a=e.disabled,n=e.id,r=e.onToggle,s=e.readOnly,c=e.selectedElements,o=e.totalElements,l=c&&c===o,u=c&&c<o,d=C()("bulk-select__box",{"is-checked":l}),m=C()("bulk-select__some-checked-icon",{"is-disabled":a}),g=C()("bulk-select",t);return i.a.createElement("span",{className:g},i.a.createElement("span",{className:"bulk-select__container"},i.a.createElement("input",{id:n,type:"checkbox",className:d,onChange:function(e){s||r(!(u||l),e)},checked:l,disabled:a}),u?i.a.createElement(p.a,{className:m,icon:"minus-small",size:18}):null))};ke.propTypes={totalElements:o.a.number.isRequired,selectedElements:o.a.number.isRequired,onToggle:o.a.func,readOnly:o.a.bool,className:o.a.string,disabled:o.a.bool};var ye=ke,Oe=a(599),je=a(615),Ie=a(646),Ne=a(541),Re=function(e){var t=e.siteId,a=e.form,n=e.toggleAll,r=e.togglePackage,s=e.currentlyEditingPredefinedPackages,c=e.translate,o=a.dimensionUnit,l=function(e){var a="group-".concat(e.serviceId,"-").concat(e.groupId);return i.a.createElement("div",{className:"packages__group-header"},i.a.createElement("label",{htmlFor:a,onClick:function(e){return e.stopPropagation()}},i.a.createElement(ye,{id:a,totalElements:e.total,selectedElements:e.selected,onToggle:function(a,r){r.stopPropagation(),n(t,e.serviceId,e.groupId,r.target.checked)},className:"packages__group-header-checkbox"}),e.title))};return i.a.createElement("div",null,function(){var e=[];return Object(d.forEach)(s,function(a,n){var s,u,d=(s=a.selected,u=a.total,s===u?c("All packages selected"):c("%(selectedCount)d package selected","%(selectedCount)d packages selected",{count:s,args:{selectedCount:s}}));e.push(i.a.createElement(Oe.a,{className:"packages__predefined-packages",key:n,header:l(a),summary:d,expandedSummary:d,clickableHeader:!0,expanded:!1,screenReaderText:c("Expand Services"),icon:"chevron-down"},function(e){return e.packages.map(function(e,a){return i.a.createElement(Ie.a,{key:a,siteId:t,data:e,dimensionUnit:o,prefixActions:!0},i.a.createElement(je.a,{checked:e.selected,onChange:function(){return r(t,e.serviceId,e.id)}}))})}(a)))}),e}())};Re.propTypes={siteId:o.a.number.isRequired,toggleAll:o.a.func.isRequired,togglePackage:o.a.func.isRequired,form:o.a.shape({dimensionUnit:o.a.string}).isRequired};var Ce=Object(l.b)(function(e){return{currentlyEditingPredefinedPackages:Object(Ne.c)(e)}})(Object(u.localize)(Re)),qe=a(531),we=a.n(qe),xe=function(e){function t(){var e,a;h()(this,t);for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return a=k()(this,(e=O()(t)).call.apply(e,[this].concat(r))),b()(we()(a),"handleKeyEvent",function(e){switch(e.keyCode){case 13:case 32:e.preventDefault(),document.activeElement.click()}}),a}return I()(t,e),_()(t,[{key:"render",value:function(){var e=C()({"segmented-control__item":!0,"is-selected":this.props.selected}),t=C()("segmented-control__link",b()({},"item-index-".concat(this.props.index),null!=this.props.index));return i.a.createElement("li",{className:e},i.a.createElement("a",{href:this.props.path,className:t,onClick:this.props.onClick,title:this.props.title,"data-e2e-value":this.props.value,role:"radio",tabIndex:0,"aria-checked":this.props.selected,onKeyDown:this.handleKeyEvent},i.a.createElement("span",{className:"segmented-control__text"},this.props.children)))}}]),t}(i.a.Component);b()(xe,"propTypes",{children:o.a.node.isRequired,path:o.a.string,selected:o.a.bool,title:o.a.string,value:o.a.string,onClick:o.a.func,index:o.a.number}),b()(xe,"defaultProps",{selected:!1});var Se=xe,Pe=function(e){function t(){var e,a;h()(this,t);for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return a=k()(this,(e=O()(t)).call.apply(e,[this].concat(r))),b()(we()(a),"state",{selected:a.props.initialSelected||a.props.options[0].value}),a}return I()(t,e),_()(t,[{key:"renderOptions",value:function(){var e=this;return this.props.options.map(function(t,a){return i.a.createElement(Se,{index:a,key:a,onClick:function(){e.setState({selected:t.value}),e.props.onSelect&&e.props.onSelect(t)},path:t.path,selected:e.state.selected===t.value,value:t.value},t.label)})}},{key:"render",value:function(){var e={"is-compact":this.props.compact,"is-primary":this.props.primary};return i.a.createElement("ul",{className:C()("segmented-control",e,this.props.className),style:this.props.style,role:"radiogroup"},this.renderOptions())}}]),t}(i.a.Component);b()(Pe,"propTypes",{className:o.a.string,compact:o.a.bool,initialSelected:o.a.string,onSelect:o.a.func,options:o.a.arrayOf(o.a.shape({value:o.a.string.isRequired,label:o.a.string.isRequired,path:o.a.string})).isRequired,style:o.a.object});var Te=a(647),ze=a(549),De=a(555),Ae=function(e){var t,a=e.siteId,n=e.form,r=e.predefinedPackagesSummary,s=e.setModalErrors,c=e.savePackage,o=e.savePredefinedPackages,l=e.dismissModal,u=e.removePackage,m=e.setAddMode,g=e.updatePackagesField,b=e.translate,f=n.showModal,h=n.mode,v=n.packages,_=n.packageSchema,E=n.predefinedSchema,k=n.packageData,y=k.index,O=v.custom,j="edit"===h,I="add-custom"===h,N="add-predefined"===h,R=function(){var t={duration:5e3};e.createWcsShippingSaveActionList(function(){return"function"===typeof e.onSaveSuccess&&"name"in k&&e.onSaveSuccess(k.name),e.successNotice(b("Your shipping packages have been saved."),t)},function(){return e.errorNotice(b("Unable to save your shipping packages. Please try again."),t)},!0)},C=function(){l(a)},q=b(j?"Edit package":"Add a package"),w=I||N,x=I||j,S=N;t=I||N&&0===r.removed?b("Add package","Add packages",{count:I?1:r.added}):b("Done");var P=[i.a.createElement(Ee.a,{onClick:function(){if(N)return o(a),void(e.persistOnSave&&R());var t="number"===typeof k.index?O[k.index].name:null,n=Object(d.concat)(Object(d.difference)(O.map(function(e){return e.name}),[t]),Object(d.flatten)(Object(d.map)(E,function(e){return Object(d.map)(e,function(e){return e.definitions})})),["individual"]),r=Object.assign({},k,{name:re(k.name),inner_dimensions:ie(k.inner_dimensions),outer_dimensions:ie(k.outer_dimensions),box_weight:se(k.box_weight),max_weight:0}),i=he(r,n,_);if(i.any)return g(a,r),void s(a,i);c(a,r),e.persistOnSave&&R()}},t),i.a.createElement(Ee.a,{onClick:C,isPrimary:!1},b("Cancel"))];return j&&P.unshift({action:"delete",label:i.a.createElement("span",null,b("{{icon/}} Delete this package",{components:{icon:i.a.createElement(p.a,{icon:"trash"})}})),onClick:function(){return u(a,y)},additionalClassNames:"packages__delete is-scary is-borderless"}),i.a.createElement(ve.a,{isVisible:f,additionalClassNames:"packages__add-edit-dialog woocommerce wcc-root",onClose:C,buttons:P},i.a.createElement(_e.a,{className:"packages__add-edit-title"},q),w&&i.a.createElement(Pe,{primary:!0,className:"packages__mode-select",initialSelected:h,onSelect:function(e){m(a,e.value)},options:[{value:"add-custom",label:"Custom package"},{value:"add-predefined",label:"Service package"}]}),x&&i.a.createElement(le,e),S&&i.a.createElement(Ce,e))};Ae.propTypes={siteId:o.a.number.isRequired,dismissModal:o.a.func.isRequired,form:o.a.object.isRequired,updatePackagesField:o.a.func.isRequired,savePackage:o.a.func.isRequired,packageData:o.a.shape({index:o.a.number.isRequired}),setModalErrors:o.a.func.isRequired,removePackage:o.a.func.isRequired,setAddMode:o.a.func.isRequired};t.a=Object(l.b)(function(e){return{predefinedPackagesSummary:Object(Ne.f)(e)}},function(e){return Object(N.b)(r()({createWcsShippingSaveActionList:Te.a,errorNotice:ze.a,successNotice:ze.d},De),e)})(Object(u.localize)(Ae))},782:function(e,t,a){},783:function(e,t,a){},789:function(e,t,a){"use strict";a.r(t);var n=a(10),r=a.n(n),s=a(12),i=a.n(s),c=a(109),o=a(30),l=a(35),u=a.n(l),d=a(534),m=a.n(d),p=a(551),g=a(36),b=a.n(g),f=a(530),h=a.n(f),v=a(1),_=a(34),E=a.n(_),k=a(586),y=a(553),O=a(580),j=a(600),I=a(552),N=a(526),R=a.n(N),C=a(546),q=a(641),w=function(e){var t=e.values,a=e.originalValues,n=e.countryNames,s=e.stateNames,i=e.expandStateName,c=void 0!==i&&i;a=a||{};var o=t.state,l=t.country,u="";o&&(u=(c&&s||{})[o]||o);var d=n[l]||l,m=function(e){var n=t[e];if(!n)return"";var s=a[e],i=s&&s.toLowerCase()!==n.toLowerCase(),c=n;switch(e){case"state":c=u;break;case"country":c=d}return r.a.createElement("span",{key:e,className:i?"highlight":""},c)},p=m("state"),g=Object(v.filter)([m("city"),p?", ":"",p," ",m("postcode")]);return r.a.createElement("div",{className:"address-step__summary"},r.a.createElement("p",null,m("name")),r.a.createElement("p",null,m("address")," ",m("address_2")),r.a.createElement("p",null,g),r.a.createElement("p",null,m("country")))},x=function(e){return r.a.createElement(C.a,{className:R()("address-step__suggestion",{"is-selected":e.checked})},r.a.createElement(q.a,Object(v.omit)(e,"children")),e.children)},S=function(e){var t=e.values,a=e.normalized,n=e.selectNormalized,s=e.selectNormalizedAddress,i=e.editAddress,c=e.confirmAddressSuggestion,o=e.countryNames,l=e.translate,u=function(e){return function(){return s(e)}};return r.a.createElement("div",null,r.a.createElement(y.a,{className:"error-notice",status:"is-info",showDismiss:!1},l("We have slightly modified the address entered. If correct, please use the suggested address to ensure accurate delivery.")),r.a.createElement("div",{className:"address-step__suggestion-container"},r.a.createElement(x,{checked:!n,onChange:u(!1)},r.a.createElement("span",{className:"address-step__suggestion-title"},l("Address entered")),r.a.createElement(w,{values:t,countryNames:o})),r.a.createElement(x,{checked:n,onChange:u(!0)},r.a.createElement("span",{className:"address-step__suggestion-title"},l("Suggested address")),r.a.createElement(w,{values:a,originalValues:t,countryNames:o}))),r.a.createElement("div",{className:"address-step__actions"},r.a.createElement(O.a,{type:"button",onClick:c},l("Use selected address")),r.a.createElement(O.a,{type:"button",onClick:i,borderless:!0},l("Edit address"))))};S.propTypes={values:i.a.object.isRequired,normalized:i.a.object,selectNormalized:i.a.bool.isRequired,selectNormalizedAddress:i.a.func.isRequired,confirmAddressSuggestion:i.a.func.isRequired,editAddress:i.a.func.isRequired,countryNames:i.a.object.isRequired};var P=Object(l.localize)(S),T=a(648),z=a.n(T),D=a(601),A=a(575),U=function(e){var t=e.values,a=e.countryNames,n=e.editUnverifiableAddress,s=e.confirmAddressSuggestion,i=e.translate,c=e.fieldErrors,o=A.a.includes(t.country)?z.a.format({scheme:"https",hostname:"tools.usps.com",pathname:"/zip-code-lookup.htm",query:{mode:"byAddress",companyName:t.company,address1:t.address,address2:t.address_2,city:t.city,state:"US"===t.country?t.state:t.country,zip:t.postcode}}):null,l=Object(v.invokeMap)([t.address+" "+t.address_2,t.city,t.state+" "+t.postcode],"trim").join(", "),u={scheme:"https",hostname:"www.google.com",pathname:"/maps/place/"+encodeURIComponent(l)},d=z.a.format(u);return r.a.createElement("div",null,function(){var e=function(){if(c.general)return c.general;for(var e in c)return c[e];return!1}();return e?r.a.createElement(y.a,{status:"is-error",showDismiss:!1},i("We were unable to automatically verify the address \u2014 %(error)s.",{args:{error:e}})):r.a.createElement(y.a,{status:"is-error",showDismiss:!1},i("We were unable to automatically verify the address."))}(),r.a.createElement("div",{className:"address-step__unverifiable-container"},r.a.createElement("div",{className:"address-step__unverifiable-info"},r.a.createElement("span",{className:"address-step__unverifiable-title"},i("Address entered")),r.a.createElement(w,{values:t,countryNames:a})),r.a.createElement("div",{className:"address-step__unverifiable-info"},r.a.createElement("p",null,i("Automatic verification failed for this address. It may still be a valid address \u2014 use the tools below to manually verify.")),o&&r.a.createElement(D.a,{icon:!0,href:o,target:"_blank"},i("Verify with USPS")),r.a.createElement(D.a,{icon:!0,href:d,target:"_blank"},i("View on Google Maps")))),r.a.createElement("div",{className:"address-step__actions"},r.a.createElement(O.a,{type:"button",onClick:n},i("Edit address")),r.a.createElement(O.a,{type:"button",onClick:s,borderless:!0},i("Use address as entered"))))};U.propTypes={values:i.a.object.isRequired,confirmAddressSuggestion:i.a.func.isRequired,editUnverifiableAddress:i.a.func.isRequired,countryNames:i.a.object.isRequired};var V=Object(l.localize)(U),F=a(602),M=a(540),W=a(537),L=a(563),B=function(e){var t=e.siteId,a=e.orderId,n=e.values,s=e.isNormalized,i=e.normalized,c=e.selectNormalized,o=e.normalizationInProgress,l=e.allowChangeCountry,u=e.group,d=e.countryNames,m=e.stateNames,p=e.errors,g=e.isUsable,f=e.translate,h=Object(v.isObject)(p)?p:{},_=function(){return e.confirmAddressSuggestion(a,t,u)};if(s&&!h.phone){if(i&&!Object(v.isEqual)(i,n)){return r.a.createElement(P,{values:n,normalized:i,selectNormalized:c,selectNormalizedAddress:function(n){return e.selectNormalizedAddress(a,t,u,n)},confirmAddressSuggestion:_,editAddress:function(){return e.editAddress(a,t,u)},countryNames:d})}if(0<Object(v.size)(h)){return r.a.createElement(V,{values:n,confirmAddressSuggestion:_,editUnverifiableAddress:function(){return e.editUnverifiableAddress(a,t,u)},countryNames:d,fieldErrors:h})}}var E=h.general&&1===Object(v.size)(h),N=function(e){return u+"_"+e},R=function(e){return n[e]?Object(F.a)(n[e]):""},C=function(n){return function(r){return e.updateAddressValue(a,t,u,n,r)}};return r.a.createElement("div",null,r.a.createElement(k.a,{id:N("name"),title:f("Name"),value:R("name"),updateValue:C("name"),error:h.name}),r.a.createElement("div",{className:"address-step__company-phone"},r.a.createElement(k.a,{id:N("company"),title:f("Company"),value:R("company"),updateValue:C("company"),className:"address-step__company",error:h.company}),r.a.createElement(k.a,{id:N("phone"),title:f("Phone"),value:R("phone"),updateValue:C("phone"),className:"address-step__phone",error:h.phone})),E&&r.a.createElement(y.a,{status:"is-error",showDismiss:!1},f("%(message)s. Please modify the address and try again.",{args:{message:h.general}})),r.a.createElement(k.a,{id:N("address"),title:f("Address"),value:R("address"),updateValue:C("address"),className:"address-step__address-1",error:h.address||E}),r.a.createElement(k.a,{id:N("address_2"),value:R("address_2"),updateValue:C("address_2"),error:h.address_2||E}),r.a.createElement("div",{className:"address-step__city-state-postal-code"},r.a.createElement(k.a,{id:N("city"),title:f("City"),value:R("city"),updateValue:C("city"),className:"address-step__city",error:h.city||E}),m?r.a.createElement(j.a,{id:N("state"),title:f("State"),value:R("state"),valuesMap:b()({"":e.translate("Select one\u2026")},m),updateValue:C("state"),className:"address-step__state",error:h.state||E}):r.a.createElement(k.a,{id:N("state"),title:f("State"),value:R("state"),updateValue:C("state"),className:"address-step__state",error:h.state||E}),r.a.createElement(k.a,{id:N("postcode"),title:f("ZIP/Postal code"),value:R("postcode"),updateValue:C("postcode"),className:"address-step__postal-code",error:h.postcode||E})),r.a.createElement(j.a,{id:N("country"),title:f("Country"),value:R("country"),disabled:!l,valuesMap:d,updateValue:C("country"),error:h.country||E}),r.a.createElement("div",{className:"address-step__actions"},r.a.createElement(O.a,{type:"button",disabled:Object(I.a)(p)||o,onClick:function(){return e.submitAddressForNormalization(a,t,u)}},f("Verify address")),r.a.createElement(O.a,{type:"button",disabled:!g,onClick:_,borderless:!0},f("Use address as entered"))))};B.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,values:i.a.object.isRequired,isNormalized:i.a.bool.isRequired,normalized:i.a.object,selectNormalized:i.a.bool.isRequired,allowChangeCountry:i.a.bool.isRequired,errors:i.a.oneOfType([i.a.object,i.a.bool]).isRequired,group:i.a.string.isRequired,countryNames:i.a.object.isRequired,stateNames:i.a.object};var H=Object(c.b)(function(e,t){var a=t.group,n=t.orderId,r=t.siteId,s=Object(W.s)(e,n,r),i=Object(W.i)(e,n,r).form[a],c="origin"===a?Object(W.h)(e,r):Object(W.c)(e,r);return c[i.values.country]||(c=b()(E()({},i.values.country,Object(L.g)(e,i.values.country,r)),c)),b()({},i,{errors:s&&Object(W.f)(e,n,r)[a],isUsable:s&&Object(W.n)(e,n,a,r),countryNames:c,stateNames:Object(W.j)(e,i.values.country,r)})},function(e){return Object(o.b)({selectNormalizedAddress:M.C,confirmAddressSuggestion:M.g,editAddress:M.m,editUnverifiableAddress:M.n,updateAddressValue:M.V,submitAddressForNormalization:M.T},e)})(Object(l.localize)(B)),Y=a(107),$=a.n(Y),G=a(108),K=a.n(G),J=a(528),Q=a.n(J),X=a(527),Z=a.n(X),ee=a(529),te=a.n(ee),ae=(a(782),function(e){function t(){return $()(this,t),Q()(this,Z()(t).apply(this,arguments))}return te()(t,e),K()(t,[{key:"render",value:function(){var e=R()("spinner",this.props.className),t={width:this.props.size,height:this.props.size,fontSize:this.props.size};return r.a.createElement("div",{className:e},r.a.createElement("div",{className:"spinner__outer",style:t},r.a.createElement("div",{className:"spinner__inner"})))}}]),t}(n.PureComponent));E()(ae,"propTypes",{className:i.a.string,size:i.a.number}),E()(ae,"defaultProps",{size:20});var ne=a(599),re=function(e){var t=e.isSuccess,a=e.isWarning,n=e.isError,s=e.isProgress,i=e.title,c=e.summary,o=e.children,l=e.expanded,u=e.toggleStep,d=e.translate,p=R()({"is-success":t,"is-warning":a,"is-error":n});c=r.a.createElement("span",{className:p},r.a.createElement("span",null,c),r.a.createElement("div",{className:"label-purchase-modal__step-status"},s?r.a.createElement(ae,{size:18}):r.a.createElement(m.a,{icon:t?"checkmark-circle":a?"notice-outline":n?"notice-outline":"",className:p,size:18})));var g=r.a.createElement("div",null,r.a.createElement("div",{className:"label-purchase-modal__step-title"},i));return r.a.createElement(ne.a,{header:g,summary:c,expandedSummary:c,clickableHeader:!0,compact:!0,screenReaderText:d("Expand"),expanded:l,onClick:u},o)};re.propTypes={isSuccess:i.a.bool,isWarning:i.a.bool,isError:i.a.bool,isProgress:i.a.bool,title:i.a.string.isRequired,summary:i.a.string,expanded:i.a.bool};var se=Object(l.localize)(re),ie=a(565),ce=function(e,t,a,n,r,s){var i=arguments.length>6&&void 0!==arguments[6]&&arguments[6],c=e.isNormalized,o=e.normalizationInProgress,l=e.normalized;if(o)return r("Validating address\u2026");if(Object(I.a)(n)||c&&!l)return n&&n.general||r("Invalid address");if(!c)return r("You've edited the address, please revalidate it for accurate rates");var u=Object(ie.a)(e),d=u.city,m=u.postcode,p=u.state,g=u.country,b=d+", ";p&&(b+=(i?Object(L.h)(t,g,p,a):p)+"\xa0 ");return b+="US"===g?m.split("-")[0]:m,s&&(b+=", "+Object(L.g)(t,g,a)),b},oe=function(e){var t=e.normalizationInProgress,a=e.errors,n=e.isNormalized,r=e.values,s=e.normalized;return t?{isProgress:!0}:Object(I.a)(a)||n&&!s||!n?{isError:!0}:n?Object(v.isEqual)(r,s)?{isSuccess:!0}:{isWarning:!0}:{}},le=function(e){return r.a.createElement(se,h()({title:e.title,summary:e.summary,expanded:e.expanded,toggleStep:function(){return e.toggleStep(e.orderId,e.siteId,e.type)}},e.normalizationStatus),r.a.createElement(H,{group:e.type,siteId:e.siteId,orderId:e.orderId}))};le.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,type:i.a.string.isRequired,title:i.a.string.isRequired,summary:i.a.string.isRequired,expanded:i.a.bool,normalizationStatus:i.a.object.isRequired,toggleStep:i.a.func.isRequired};var ue=Object(l.localize)(Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=t.type,s=t.translate,i=Object(W.s)(e,a,n),c=Object(W.i)(e,a,n),o=c.form[r],l=i&&Object(W.f)(e,a,n)[r],u="destination"===r&&c.form.origin.values.country!==o.values.country;return{errors:l,form:o,expanded:o.expanded,normalizationStatus:oe(b()({},o,{errors:l})),summary:ce(o,e,n,l,s,u)}},function(e){return Object(o.b)({toggleStep:M.U},e)})(le)),de=a(542),me=function(e,t,a){var n=0;return Object(v.mapValues)(e,function(e){if("individual"===e.box_id)return e.items[0].name;n++;var r=t[e.box_id],s=r&&r.is_letter,i=!(!a||!r)&&r.name;return s?i?Object(l.translate)("Envelope %(packageNum)d: %(packageName)s",{args:{packageNum:n,packageName:i}}):Object(l.translate)("Envelope %(packageNum)d",{args:{packageNum:n}}):i?Object(l.translate)("Package %(packageNum)d: %(packageName)s",{args:{packageNum:n,packageName:i}}):Object(l.translate)("Package %(packageNum)d",{args:{packageNum:n}})})},pe=a(541),ge=function(e){var t,a,n=e.orderId,s=e.siteId,i=e.selected,c=e.all,o=e.errors,l=e.packageId,u=e.translate,d=function(t,a,i){var c=0<Object.keys(o[t]||{}).length;return r.a.createElement("div",{className:"packages-step__list-item",key:t},r.a.createElement(de.a,{borderless:!0,className:R()("packages-step__list-package",{"is-selected":l===t}),onClick:function(){return e.openPackage(n,s,t)}},r.a.createElement("span",{className:"packages-step__list-package-name"},a),function(e,t){return e?r.a.createElement(m.a,{icon:"notice-outline",className:"is-error",size:18}):void 0===t?null:r.a.createElement("span",{className:"packages-step__list-package-count"},t)}(c,i)))},p=me(i,c,!1),g=[],b=[];return Object.keys(i).forEach(function(e){var t=i[e];"individual"===t.box_id?b.push(d(e,t.items[0].name)):g.push(d(e,p[e],t.items.length))}),(g.length||b.length)&&g.unshift((t="boxed-header",a=u("Packages to be Shipped"),r.a.createElement("div",{className:"packages-step__list-item packages-step__list-header",key:t},a))),r.a.createElement("div",{className:"packages-step__list"},g,b)};ge.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,selected:i.a.object.isRequired,all:i.a.object.isRequired,packageId:i.a.string.isRequired,errors:i.a.object,openPackage:i.a.func.isRequired};var be=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.s)(e,a,n),s=Object(W.i)(e,a,n);return{errors:r&&Object(W.f)(e,a,n).packages,packageId:s.openedPackageId,selected:s.form.packages.selected,all:Object(pe.a)(e,n)}},function(e){return Object(o.b)({openPackage:M.w},e)})(Object(l.localize)(ge)),fe=a(550),he=a(554),ve=a(589),_e=a(562),Ee=function(e){var t=e.orderId,a=e.siteId,n=e.item,s=e.itemIndex,i=e.translate,c=function(){return e.openItemMove(t,a,s)},o=n.url?r.a.createElement("a",{href:n.url,target:"_blank",rel:"noopener noreferrer"},n.name):n.name;return r.a.createElement("div",{key:s,className:"packages-step__item"},r.a.createElement("div",{className:"packages-step__item-name"},r.a.createElement("span",null,o),"attributes"in n?r.a.createElement("p",null,n.attributes):""),r.a.createElement("div",{className:"packages-step__item-weight"},"weight"in n?r.a.createElement("p",null,n.weight):""),r.a.createElement("div",{className:"packages-step__item-qty"},"quantity"in n?r.a.createElement("p",null,n.quantity):""),r.a.createElement("div",{className:"packages-step__item-move"},r.a.createElement("a",{href:"#",onClick:c},i("Move"))))};Ee.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,item:i.a.object.isRequired,itemIndex:i.a.number.isRequired,openItemMove:i.a.func.isRequired};var ke=Object(c.b)(function(e,t){var a=t.siteId;return{site:Object(_e.a)(e,a)}},function(e){return Object(o.b)({openItemMove:M.v},e)})(Object(l.localize)(Ee)),ye=a(579),Oe=a(690),je=a(684),Ie=a(555),Ne=function(e,t){return[e.length,e.width,e.height].map(function(e){return"".concat(e," ").concat(t)}).join(" x ")},Re=function(e){var t=e.siteId,a=e.orderId,n=e.packageId,s=e.pckg,i=e.dimensionUnit,c=e.packageGroups,o=e.translate,l=e.pckgErrors,u=e.isIndividualPackage,d=function(e){var t=Object(Oe.a)(e),a=e.id||e.name;return r.a.createElement("option",{value:a,key:a},e.name," - ",Ne(t,i))};if(!n)return null;if(u){var p=R()({"is-error":l.dimensions});return r.a.createElement("div",null,r.a.createElement("div",{className:"packages-step__package-items-header"},r.a.createElement(he.a,null,o("Individually Shipped Item"))),r.a.createElement("span",{className:"packages-step__package-item-description"},o("Item Dimensions")," -"," "),r.a.createElement("span",{className:p},Ne(s,i)),l.dimensions&&r.a.createElement(fe.a,{text:l.dimensions}))}var g=Object(v.reduce)(c,function(e,t){return e+t.definitions.length},0);return r.a.createElement("div",null,r.a.createElement("div",{className:"packages-step__package-items-header packages-step__package-details-header"},r.a.createElement(he.a,null,o("Package details")),0!==g?r.a.createElement("a",{href:"#",onClick:function(){return e.addPackage(t)}},o("Add package")):null),0===g?r.a.createElement("div",{className:"packages-step__no-packages"},r.a.createElement(m.a,{icon:"product",size:18}),r.a.createElement("a",{href:"#",onClick:function(){return e.addPackage(t)}},o("Select a package type"))):r.a.createElement("div",{className:"packages-step__with-packages"},r.a.createElement(ye.a,{onChange:function(r){e.setPackageType(a,t,n,r.target.value)},value:s.box_id,isError:l.box_id||l.dimensions},r.a.createElement("option",{value:"not_selected",key:"not_selected"},o("Please select a package"))," ",Object(v.map)(c,function(e,t){return Object(v.isEmpty)(e.definitions)?null:r.a.createElement("optgroup",{label:e.title,key:t},Object(v.map)(e.definitions,d))}))),r.a.createElement(je.a,h()({persistOnSave:!0},e,{onSaveSuccess:function(r){e.setPackageType(a,t,n,r)}})))};Re.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,packageId:i.a.string.isRequired,pckgErrors:i.a.object.isRequired,pckg:i.a.object.isRequired};var Ce=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.s)(e,a,n),s=Object(W.i)(e,a,n),i=r?s.storeOptions:{},c=Object(pe.e)(e,n)||{};return{dimensionUnit:i.dimension_unit,packageGroups:Object(pe.d)(e,a,n),form:c}},function(e){return Object(o.b)({setPackageType:M.P,addPackage:Ie.addPackage},e)})(Object(l.localize)(Re)),qe=a(543),we=function(e){var t=e.siteId,a=e.orderId,n=e.packageId,s=e.selected,i=e.weightUnit,c=e.errors,o=e.translate,l=e.userMeta,u=c[n]||{};if(!n)return null;var d=s[n];"not_selected"===d.box_id&&l.last_box_id&&e.setPackageType(a,t,n,l.last_box_id);var m="individual"===d.box_id,p=function(e,s){return r.a.createElement(ke,{siteId:t,orderId:a,key:s,item:e,itemIndex:s,packageId:n,showRemove:!0,isIndividualPackage:m})},g=function(){return e.openAddItem(a,t)},b=function(){return m?null:r.a.createElement(de.a,{className:"packages-step__add-item-btn",compact:!0,onClick:g},o("Add items"))};return r.a.createElement("div",{className:"packages-step__package"},r.a.createElement("div",null,r.a.createElement("div",{className:"packages-step__package-items-header-name"},r.a.createElement(he.a,null,o("Items to fulfill"))),r.a.createElement("div",{className:"packages-step__package-items-header-weight"},r.a.createElement(he.a,null,o("Weight"))),r.a.createElement("div",{className:"packages-step__package-items-header-qty"},r.a.createElement(he.a,null,o("QTY"))),r.a.createElement("div",{className:"packages-step__package-items-header-move"}),function(){var e=Object(v.some)(s,function(e,t){return n!==t&&e.items.length});if(!d.items.length)return r.a.createElement("div",{className:"packages-step__add-item-row"},r.a.createElement("div",{className:"packages-step__no-items-message"},o("There are no items in this package."),e?b():null));var t=d.items.map(p);return e&&t.push(r.a.createElement("div",{key:t.length,className:"packages-step__add-item-row"},b())),t}()),r.a.createElement(Ce,{siteId:t,orderId:a,isIndividualPackage:m,pckgErrors:u,pckg:d,packageId:n,lastBoxId:l.last_box_id}),r.a.createElement("div",{className:"packages-step__package-weight"},r.a.createElement(C.a,{htmlFor:"weight_".concat(n)},o("Total Weight (with package)")),r.a.createElement(ve.a,{id:"weight_".concat(n),placeholder:o("0"),value:d.weight||"",onChange:function(r){e.updatePackageWeight(a,t,n,r.target.value)},isError:Boolean(u.weight),type:"number",noWrap:!0,suffix:i}),u.weight&&r.a.createElement(fe.a,{text:u.weight})))};we.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,packageId:i.a.string.isRequired,selected:i.a.object.isRequired,updatePackageWeight:i.a.func.isRequired,dimensionUnit:i.a.string.isRequired,weightUnit:i.a.string.isRequired,errors:i.a.object.isRequired,openAddItem:i.a.func.isRequired,userMeta:i.a.object.isRequired};var xe=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.s)(e,a,n),s=Object(W.i)(e,a,n),i=r?s.storeOptions:{},c=r&&Object(W.f)(e,a,n).packages,o=r?Object(qe.i)(e,n):{};return{siteId:n,errors:c,packageId:s.openedPackageId,selected:s.form.packages.selected,dimensionUnit:i.dimension_unit,weightUnit:i.weight_unit,userMeta:o}},function(e){return Object(o.b)(b()({updatePackageWeight:M.W,openAddItem:M.t,setPackageType:M.P},Ie),e)})(Object(l.localize)(we)),Se=a(548),Pe=function(e){e.site;var t=e.siteId,a=e.orderId,n=e.showItemMoveDialog,s=e.movedItemIndex,i=e.targetPackageId,c=e.openedPackageId,o=e.selected,l=e.all,u=e.translate;if(-1===s||!n)return null;var d,m,g=function(n,s){return r.a.createElement(C.a,{key:n,className:"packages-step__dialog-package-option"},r.a.createElement(q.a,{checked:n===i,onChange:function(){return e.setTargetPackage(a,t,n)}}),s)},b=o[c],f=b.items[s],h=(d=f.product_id,"post.php?post=".concat(d,"&action=edit")),v=r.a.createElement("a",{href:h,target:"_blank",rel:"noopener noreferrer"},f.name),_=me(o,l,!0);m=""===c?u("{{itemLink/}} is currently saved for a later shipment.",{components:{itemLink:v}}):"individual"===b.box_id?u("{{itemLink/}} is currently shipped in its original packaging.",{components:{itemLink:v}}):u("{{itemLink/}} is currently in {{pckg/}}.",{components:{itemLink:v,pckg:r.a.createElement("span",{className:"packages-step__dialog-package-name"},_[c])}});var E=function(){return e.closeItemMove(a,t)},k=[{action:"cancel",label:u("Cancel"),onClick:E},{action:"move",label:u("Submit"),isPrimary:!0,disabled:i===c,onClick:function(){return e.moveItem(a,t,c,s,i)}}];return r.a.createElement(p.a,{isVisible:n,isFullScreen:!1,onClickOutside:E,onClose:E,buttons:k,additionalClassNames:"wcc-root woocommerce packages-step__dialog"},r.a.createElement(Se.a,null,u("Move item")),r.a.createElement("div",{className:"packages-step__dialog-body"},r.a.createElement("p",null,m),r.a.createElement("p",null,u("Where would you like to move it?")),function(){var e=[];return Object.keys(o).forEach(function(t){var a=o[t];t!==c&&"individual"!==a.box_id&&e.push(g(t,_[t]))}),e}(),g("new",u("Add to a New Package")),b&&"individual"===b.box_id?null:g("individual",u("Ship in original packaging"))))};Pe.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,showItemMoveDialog:i.a.bool.isRequired,movedItemIndex:i.a.number.isRequired,targetPackageId:i.a.string,openedPackageId:i.a.string.isRequired,selected:i.a.object.isRequired,all:i.a.object.isRequired,moveItem:i.a.func.isRequired};var Te=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.i)(e,a,n);return{site:Object(_e.a)(e,n),showItemMoveDialog:r.showItemMoveDialog||!1,movedItemIndex:isNaN(r.movedItemIndex)?-1:r.movedItemIndex,targetPackageId:r.targetPackageId,openedPackageId:r.openedPackageId,selected:r.form.packages.selected,all:Object(pe.a)(e,n)}},function(e){return Object(o.b)({closeItemMove:M.d,setTargetPackage:M.S,moveItem:M.s},e)})(Object(l.localize)(Pe)),ze=a(615),De=function(e){var t=e.siteId,a=e.orderId,n=e.showAddItemDialog,s=e.addedItems,i=e.openedPackageId,c=e.selected,o=e.all,l=e.translate;if(!n)return null;var u=me(c,o,!0),d=function(e){return r.a.createElement("span",{className:"packages-step__dialog-package-name"},u[e])},m=[];Object.keys(c).forEach(function(n){if(n!==i){var o=0;c[n].items.forEach(function(i){m.push(function(n,i,c){var o=u[n]?l("%(item)s from {{pckg/}}",{args:{item:c.name},components:{pckg:d(n)}}):c;return r.a.createElement(C.a,{key:"".concat(n,"-").concat(i),className:"packages-step__dialog-package-option"},r.a.createElement(ze.a,{checked:Object(v.includes)(s[n],i),onChange:function(r){return e.setAddedItem(a,t,n,i,r.target.checked)}}),r.a.createElement("span",null,o))}(n,o,i)),o++})}});var g=function(){return e.closeAddItem(a,t)},b=[{action:"close",label:l("Close"),onClick:g},{action:"add",label:l("Add"),isPrimary:!0,disabled:!Object(v.some)(s,v.size),onClick:function(){return e.addItems(a,t,i)}}];return r.a.createElement(p.a,{isVisible:n,isFullScreen:!1,onClickOutside:g,onClose:g,buttons:b,additionalClassNames:"wcc-root woocommerce packages-step__dialog"},r.a.createElement(Se.a,null,l("Add item")),r.a.createElement("div",{className:"packages-step__dialog-body"},r.a.createElement("p",null,l("Which items would you like to add to {{pckg/}}?",{components:{pckg:d(i)}})),m))};De.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,showAddItemDialog:i.a.bool.isRequired,addedItems:i.a.object,openedPackageId:i.a.string.isRequired,selected:i.a.object.isRequired,all:i.a.object.isRequired,closeAddItem:i.a.func.isRequired,setAddedItem:i.a.func.isRequired,addItems:i.a.func.isRequired};var Ae=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.i)(e,a,n);return{showAddItemDialog:Boolean(r.showAddItemDialog),addedItems:r.addedItems,openedPackageId:r.openedPackageId,selected:r.form.packages.selected,all:Object(pe.a)(e,n)}},function(e){return Object(o.b)({closeAddItem:M.b,setAddedItem:M.E,addItems:M.a},e)})(Object(l.localize)(De)),Ue=function(e){var t=e.disabled,a=e.onClick,n=e.children;return r.a.createElement("div",{className:"step-confirmation-button"},r.a.createElement(O.a,{type:"button",onClick:a,disabled:Boolean(t),isPrimary:!0},n))};Ue.propTypes={disabled:i.a.bool,onClick:i.a.func.isRequired};var Ve=Ue,Fe={g:0,oz:1,lbs:3,kg:3},Me=function(e){var t=e.siteId,a=e.orderId,n=e.selected,s=e.weightUnit,i=e.errors,c=e.expanded,o=e.translate,u=Object.keys(n),d=u.reduce(function(e,t){return e+n[t].items.length},0),m=u.reduce(function(e,t){return e+n[t].weight},0),p=0<u.length;return r.a.createElement(se,h()({title:o("Packaging")},function(){if(!p)return{isError:!0,summary:o("No packages selected")};var e=Object(v.find)(i,function(e){return!Object(v.isEmpty)(e)});if(e)return{isError:!0,summary:e[Object.keys(e)[0]]};var t=Object(l.numberFormat)(m,{decimals:Fe[s]});return{isSuccess:!0,summary:1===u.length&&1===d?o("1 item in 1 package: %(weight)s %(unit)s total",{args:{weight:t,unit:s}}):1===u.length?o("%(itemsCount)d items in 1 package: %(weight)s %(unit)s total",{args:{itemsCount:d,weight:t,unit:s}}):o("%(itemsCount)d items in %(packageCount)d packages: %(weight)s %(unit)s total",{args:{itemsCount:d,packageCount:u.length,weight:t,unit:s}})}}(),{expanded:c,toggleStep:function(){return e.toggleStep(a,t,"packages")}}),r.a.createElement("div",{className:"packages-step__contents"},r.a.createElement(be,{siteId:e.siteId,orderId:e.orderId}),r.a.createElement(xe,{siteId:e.siteId,orderId:e.orderId})),r.a.createElement(Ve,{disabled:Object(I.a)(i)||!u.length,onClick:function(){return e.confirmPackages(a,t)}},o("Use these packages")),r.a.createElement(Te,{siteId:e.siteId,orderId:e.orderId}),r.a.createElement(Ae,{siteId:e.siteId,orderId:e.orderId}))};Me.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,selected:i.a.object.isRequired,weightUnit:i.a.string.isRequired,errors:i.a.object.isRequired,expanded:i.a.bool};var We=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.s)(e,a,n),s=Object(W.i)(e,a,n),i=r?s.storeOptions:{};return{errors:r&&Object(W.f)(e,a,n).packages,weightUnit:i.weight_unit,expanded:s.form.packages.expanded,selected:s.form.packages.selected}},function(e){return Object(o.b)({toggleStep:M.U,confirmPackages:M.i},e)})(Object(l.localize)(Me)),Le=a(545),Be=function(e){var t=e.id,a=e.title,n=e.value,s=e.placeholder,i=e.updateValue,c=e.error,o=e.className,l=e.weightUnit;return r.a.createElement(Le.a,{className:o},r.a.createElement(C.a,{htmlFor:t},a),r.a.createElement(ve.a,{noWrap:!0,suffix:l,id:t,name:t,type:"number",placeholder:s||"0.0",value:n,onChange:function(e){return i(e.target.value)},isError:Boolean(c)}),c&&"string"===typeof c&&r.a.createElement(fe.a,{text:c}))};Be.propTypes={weightUnit:i.a.string.isRequired,id:i.a.string.isRequired,title:i.a.node,value:i.a.oneOfType([i.a.string,i.a.number]).isRequired,placeholder:i.a.string,updateValue:i.a.func,error:i.a.oneOfType([i.a.string,i.a.bool]),className:i.a.string};var He=Be,Ye=a(533),$e=a.n(Ye);function Ge(e,t,a){if(!e)return null;if(!a)return e;var n=Object(v.get)(Object(v.find)(a,function(t){return t.code===e}),"label",e);return r.a.createElement("span",{className:"form-currency-input__affix"},n,r.a.createElement(m.a,{icon:"chevron-down",size:18,className:"form-currency-input__select-icon"}),r.a.createElement("select",{className:"form-currency-input__select",value:e,onChange:t},a.map(function(e){var t=e.code,a=e.label,n=void 0===a?t:a;return r.a.createElement("option",{key:t,value:t},n)})))}function Ke(e){var t=e.className,a=e.currencySymbolPrefix,n=e.currencySymbolSuffix,s=e.onCurrencyChange,i=e.currencyList,c=e.placeholder,o=void 0===c?"0.00":c,l=$e()(e,["className","currencySymbolPrefix","currencySymbolSuffix","onCurrencyChange","currencyList","placeholder"]),u=R()("form-currency-input",t),d=Ge(a,s,i),m=Ge(n,s,i);return r.a.createElement(ve.a,h()({},l,{type:"number",className:u,prefix:d,suffix:m,placeholder:o}))}var Je=i.a.shape({code:i.a.string.isRequired,label:i.a.string});Ke.propTypes={currencySymbolPrefix:i.a.oneOfType([i.a.string,i.a.object]),currencySymbolSuffix:i.a.oneOfType([i.a.string,i.a.object]),onCurrencyChange:i.a.func,currencyList:i.a.arrayOf(Je)};var Qe=Ke,Xe=function(e){var t=e.id,a=e.title,n=e.value,s=e.placeholder,i=e.updateValue,c=e.error,o=e.className;return r.a.createElement(Le.a,{className:o},r.a.createElement(C.a,{htmlFor:t},a),r.a.createElement(Qe,{id:t,name:t,currencySymbolPrefix:"$",placeholder:s||"0.00",value:n,onChange:function(e){return i(e.target.value)},isError:Boolean(c)}),c&&"string"===typeof c&&r.a.createElement(fe.a,{text:c}))};Xe.propTypes={id:i.a.string.isRequired,title:i.a.node,value:i.a.oneOfType([i.a.string,i.a.number]).isRequired,placeholder:i.a.string,updateValue:i.a.func,error:i.a.oneOfType([i.a.string,i.a.bool]),className:i.a.string};var Ze=Xe,et=a(790),tt=Object(l.localize)(function(e){var t=e.translate;return r.a.createElement("span",null,t("HS Tariff number")," (",r.a.createElement(D.a,{icon:!0,href:"https://docs.woocommerce.com/document/print-shipping-labels-woocommerce-shipping/#section-1",target:"_blank"},t("more info")),")")}),at=Object(l.localize)(function(e){var t=e.translate;return r.a.createElement("span",null,t("Origin country"),r.a.createElement(et.a,{text:t("Country where the product was manufactured or assembled")},r.a.createElement("span",null,r.a.createElement(m.a,{icon:"info-outline",size:18}))))}),nt=function(e){var t=e.translate,a=e.weightUnit;return r.a.createElement("div",{className:"customs-step__item-rows-header"},r.a.createElement("span",{className:"customs-step__item-description-column"},t("Description")),r.a.createElement("span",{className:"customs-step__item-code-column"},r.a.createElement(tt,null)),r.a.createElement("span",{className:"customs-step__item-weight-column"},t("Weight (%s per unit)",{args:[a]})),r.a.createElement("span",{className:"customs-step__item-value-column"},t("Value ($ per unit)")),r.a.createElement("span",{className:"customs-step__item-country-column"},r.a.createElement(at,null)))};nt.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,weightUnit:i.a.string.isRequired};var rt=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId;return{weightUnit:Object(W.i)(e,a,n).storeOptions.weight_unit}})(Object(l.localize)(nt)),st=function(e){var t=e.errors,a=e.packageId,n=e.productId,s=e.translate,i=e.description,c=e.defaultDescription,o=e.weight,l=e.value,u=e.tariffNumber,d=e.originCountry,m=e.countryNames,p=e.weightUnit;return r.a.createElement("div",{className:"customs-step__item-row"},r.a.createElement(k.a,{id:a+"_"+n+"_description",className:"customs-step__item-description-column",title:s("Description"),value:i,placeholder:c,updateValue:e.setCustomsItemDescription,error:t.description}),r.a.createElement(k.a,{id:a+"_"+n+"_tariffNumber",className:"customs-step__item-code-column",title:r.a.createElement(tt,null),placeholder:s("Optional"),value:u,updateValue:e.setCustomsItemTariffNumber,error:t.tariffNumber}),r.a.createElement(He,{weightUnit:p,id:a+"_"+n+"_weight",className:"customs-step__item-weight-column",title:s("Weight (per unit)"),value:o,updateValue:e.setCustomsItemWeight,error:t.weight}),r.a.createElement(Ze,{id:a+"_"+n+"_value",className:"customs-step__item-value-column",title:s("Value (per unit)"),value:l,updateValue:e.setCustomsItemValue,error:t.value}),r.a.createElement(j.a,{id:a+"_"+n+"_originCountry",className:"customs-step__item-country-column",title:r.a.createElement(at,null),value:d,updateValue:e.setCustomsItemOriginCountry,valuesMap:m}))};st.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,packageId:i.a.string.isRequired,productId:i.a.number.isRequired,description:i.a.string.isRequired,defaultDescription:i.a.string.isRequired,tariffNumber:i.a.string.isRequired,weight:i.a.oneOfType([i.a.string,i.a.number]).isRequired,value:i.a.oneOfType([i.a.string,i.a.number]).isRequired,originCountry:i.a.string.isRequired,errors:i.a.object,countryNames:i.a.object.isRequired,setCustomsItemDescription:i.a.func.isRequired,setCustomsItemTariffNumber:i.a.func.isRequired,setCustomsItemWeight:i.a.func.isRequired,setCustomsItemValue:i.a.func.isRequired,setCustomsItemOriginCountry:i.a.func.isRequired};var it=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=t.productId,s=Object(W.s)(e,a,n),i=Object(W.i)(e,a,n),c=i.form.customs.items[r];return{description:c.description,defaultDescription:c.defaultDescription,tariffNumber:c.tariffNumber||"",weight:c.weight,value:c.value,originCountry:c.originCountry,errors:s?Object(W.f)(e,a,n).customs.items[r]:{},countryNames:Object(L.d)(e,n),weightUnit:i.storeOptions.weight_unit}},function(e,t){var a=t.orderId,n=t.siteId,r=t.productId;return{setCustomsItemDescription:function(t){return e(Object(M.H)(a,n,r,t))},setCustomsItemTariffNumber:function(t){return e(Object(M.J)(a,n,r,t))},setCustomsItemWeight:function(t){return e(Object(M.L)(a,n,r,t))},setCustomsItemValue:function(t){return e(Object(M.K)(a,n,r,t))},setCustomsItemOriginCountry:function(t){return e(Object(M.I)(a,n,r,t))}}})(Object(l.localize)(st)),ct=a(613),ot=function(e){var t=e.siteId,a=e.orderId,n=e.errors,s=e.packageId,i=e.translate,c=e.contentsType,o=e.contentsExplanation,l=e.restrictionType,u=e.restrictionComments,d=e.abandonOnNonDelivery,m=e.itn,p=e.items;return r.a.createElement("div",{className:"customs-step__package"},r.a.createElement(C.a,{htmlFor:s+"_abandonOnNonDelivery",className:"customs-step__abandon-on-non-delivery"},r.a.createElement(ct.a,{id:s+"_abandonOnNonDelivery",checked:!d,onChange:function(){return e.setAbandonOnNonDelivery(!d)}}),r.a.createElement("span",null,i("Return to sender if package is unable to be delivered"))),r.a.createElement("div",{className:"customs-step__restrictions-row"},r.a.createElement("div",{className:"customs-step__contents-type"},r.a.createElement(j.a,{id:s+"_contentsType",title:i("Contents type"),value:c||"merchandise",updateValue:e.setContentsType,valuesMap:{merchandise:i("Merchandise"),documents:i("Documents"),gift:i("Gift"),sample:i("Sample"),other:i("Other\u2026")}}),"other"===c&&r.a.createElement(k.a,{id:s+"_contentsExplanation",title:i("Details"),value:o||"",updateValue:e.setContentsExplanation,error:n.contentsExplanation})),r.a.createElement("div",{className:"customs-step__restriction-type"},r.a.createElement(j.a,{id:s+"_restrictionType",title:i("Restriction type"),value:l||"none",updateValue:e.setRestrictionType,valuesMap:{none:i("None"),quarantine:i("Quarantine"),sanitary_phytosanitary_inspection:i("Sanitary / Phytosanitary inspection"),other:i("Other\u2026")}}),"other"===l&&r.a.createElement(k.a,{id:s+"_restrictionComments",title:i("Details"),value:u||"",updateValue:e.setRestrictionExplanation,error:n.restrictionComments}))),r.a.createElement(k.a,{id:s+"_itn",title:r.a.createElement("span",null,i("ITN")," (",r.a.createElement(D.a,{icon:!0,href:"https://pe.usps.com/text/imm/immc5_010.htm",target:"_blank"},i("more info")),")"),value:m||"",updateValue:e.setITN,error:n.itn}),r.a.createElement("div",{className:"customs-step__item-rows"},r.a.createElement(rt,{siteId:t,orderId:a}),Object(v.uniq)(Object(v.map)(p,"product_id")).map(function(e){return r.a.createElement(it,{key:e,productId:e,packageId:s,siteId:t,orderId:a})})))};ot.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,packageId:i.a.string.isRequired,errors:i.a.object,contentsType:i.a.oneOf(["merchandise","documents","gift","sample","other"]),contentsExplanation:i.a.string,restrictionType:i.a.oneOf(["none","quarantine","sanitary_phytosanitary_inspection","other"]),restrictionComments:i.a.string,abandonOnNonDelivery:i.a.bool,itn:i.a.string,items:i.a.arrayOf(i.a.shape({product_id:i.a.number.isRequired})).isRequired,setContentsType:i.a.func.isRequired,setContentsExplanation:i.a.func.isRequired,setRestrictionType:i.a.func.isRequired,setRestrictionExplanation:i.a.func.isRequired,setAbandonOnNonDelivery:i.a.func.isRequired,setITN:i.a.func.isRequired};var lt=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=t.packageId,s=Object(W.s)(e,a,n),i=Object(W.i)(e,a,n).form.packages.selected[r];return{contentsType:i.contentsType,contentsExplanation:i.contentsExplanation,restrictionType:i.restrictionType,restrictionComments:i.restrictionComments,abandonOnNonDelivery:i.abandonOnNonDelivery,itn:i.itn,items:i.items,errors:s?Object(W.f)(e,a,n).customs.packages[r]:{}}},function(e,t){var a=t.orderId,n=t.siteId,r=t.packageId;return{setContentsType:function(t){return e(Object(M.G)(a,n,r,t))},setContentsExplanation:function(t){return e(Object(M.F)(a,n,r,t))},setRestrictionType:function(t){return e(Object(M.R)(a,n,r,t))},setRestrictionExplanation:function(t){return e(Object(M.Q)(a,n,r,t))},setAbandonOnNonDelivery:function(t){return e(Object(M.D)(a,n,r,t))},setITN:function(t){return e(Object(M.O)(a,n,r,t))}}})(Object(l.localize)(ot)),ut=function(e){var t=e.siteId,a=e.orderId,n=e.errors,s=e.expanded,i=e.translate,c=e.isSubmitted,o=e.packageDescriptions,l=Object(I.a)(n)?i("Customs information incomplete"):i("Customs information valid");return r.a.createElement(se,{title:i("Customs"),summary:c?l:"",expanded:s,toggleStep:e.toggleStep,isSuccess:c&&!Object(I.a)(n),isError:c&&Object(I.a)(n)},Object.keys(o).map(function(e,n){return r.a.createElement("div",{className:"customs-step__package-container",key:e},n?r.a.createElement("hr",null):null,r.a.createElement("p",{className:"customs-step__package-name"},o[e]),r.a.createElement(lt,{packageId:e,siteId:t,orderId:a}))}),r.a.createElement(Ve,{disabled:Object(I.a)(n),onClick:e.confirmCustoms},i("Save customs form")))};ut.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,packageDescriptions:i.a.objectOf(i.a.string).isRequired,expanded:i.a.bool,isSubmitted:i.a.bool.isRequired,errors:i.a.object,toggleStep:i.a.func.isRequired,confirmCustoms:i.a.func.isRequired};var dt=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.s)(e,a,n),s=Object(W.i)(e,a,n),i=s.form.packages.selected;return{packageDescriptions:me(i,Object(pe.a)(e,n),!0),expanded:s.form.customs.expanded,isSubmitted:Object(W.p)(e,a,n),errors:r?Object(W.f)(e,a,n).customs:{}}},function(e,t){var a=t.orderId,n=t.siteId;return{toggleStep:function(){return e(Object(M.U)(a,n,"customs"))},confirmCustoms:function(){return e(Object(M.h)(a,n))}}})(Object(l.localize)(ut)),mt=a(583),pt=a.n(mt),gt=a(531),bt=a.n(gt),ft=a(37),ht=a(573),vt=a(689),_t=new WeakMap;function Et(e,t){return Object(n.useMemo)(function(){var a=function(e){var t=_t.get(e)||0;return _t.set(e,t+1),t}(e);return t?"".concat(t,"-").concat(a):a},[e])}var kt=Object(vt.a)(function(e){return function(t){var a=Et(e);return Object(n.createElement)(e,Object(ft.a)({},t,{instanceId:a}))}},"withInstanceId"),yt=a(614);var Ot=function(e){var t=e.as,a=void 0===t?"div":t,r=Object(ht.a)(e,["as"]);return function(e){var t=e.as,a=void 0===t?"div":t,r=Object(ht.a)(e,["as"]);return"function"===typeof r.children?r.children(r):Object(n.createElement)(a,r)}(Object(yt.a)({as:a,className:"components-visually-hidden"},r))};function jt(e){var t=e.id,a=e.label,r=e.hideLabelFromVision,s=e.help,i=e.className,c=e.children;return Object(n.createElement)("div",{className:R()("components-base-control",i)},Object(n.createElement)("div",{className:"components-base-control__field"},a&&t&&(r?Object(n.createElement)(Ot,{as:"label",htmlFor:t},a):Object(n.createElement)("label",{className:"components-base-control__label",htmlFor:t},a)),a&&!t&&(r?Object(n.createElement)(Ot,{as:"label"},a):Object(n.createElement)(jt.VisualLabel,null,a)),c),!!s&&Object(n.createElement)("p",{id:t+"__help",className:"components-base-control__help"},s))}jt.VisualLabel=function(e){var t=e.className,a=e.children;return t=R()("components-base-control__label",t),Object(n.createElement)("span",{className:t},a)};var It=jt,Nt=a(707);var Rt=kt(function(e){var t=e.label,a=e.className,r=e.heading,s=e.checked,i=e.help,c=e.instanceId,o=e.onChange,l=Object(ht.a)(e,["label","className","heading","checked","help","instanceId","onChange"]),u="inspector-checkbox-control-".concat(c);return Object(n.createElement)(It,{label:r,id:u,help:i,className:a},Object(n.createElement)("span",{className:"components-checkbox-control__input-container"},Object(n.createElement)("input",Object(ft.a)({id:u,className:"components-checkbox-control__input",type:"checkbox",value:"1",onChange:function(e){return o(e.target.checked)},checked:s,"aria-describedby":i?u+"__help":void 0},l)),s?Object(n.createElement)(Nt.a,{icon:"yes",className:"components-checkbox-control__checked",role:"presentation"}):null),Object(n.createElement)("label",{className:"components-checkbox-control__label",htmlFor:u},t))});var Ct=kt(function(e){var t=e.label,a=e.className,r=e.selected,s=e.help,i=e.instanceId,c=e.onChange,o=e.options,l=void 0===o?[]:o,u="inspector-radio-control-".concat(i),d=function(e){return c(e.target.value)};return!Object(v.isEmpty)(l)&&Object(n.createElement)(It,{label:t,id:u,help:s,className:R()(a,"components-radio-control")},l.map(function(e,t){return Object(n.createElement)("div",{key:"".concat(u,"-").concat(t),className:"components-radio-control__option"},Object(n.createElement)("input",{id:"".concat(u,"-").concat(t),className:"components-radio-control__input",type:"radio",name:u,value:e.value,onChange:d,checked:e.value===r,"aria-describedby":s?"".concat(u,"__help"):void 0}),Object(n.createElement)("label",{htmlFor:"".concat(u,"-").concat(t)},e.label))}))}),qt=a(678),wt=function(e){function t(){var e;return $()(this,t),e=Q()(this,Z()(t).call(this)),E()(bt()(e),"onSignatureChecked",function(t,a,n){var r=e.props,s=r.rateObject.service_id,i=r.updateValue,c=t?{id:a,value:n.netCost}:null;e.setState({selectedSignature:c}),i(s,t?n.value:0)}),e.state={signatureOption:!1},e}return te()(t,e),K()(t,[{key:"renderServices",value:function(e,t,a){var n=[];if(a.tracking)switch(e){case"usps":n.push(Object(l.translate)("Includes USPS tracking"));break;default:n.push(Object(l.translate)("Includes tracking"))}if(a.insurance){var r=Number(a.insurance);isNaN(r)?n.push(Object(l.translate)("Insurance (%s)",{args:[a.insurance]})):r>0&&n.push(Object(l.translate)("Insurance (up to %s)",{args:[pt()(r,"USD")]}))}return t.filter(function(e){return 0===e.netCost}).length>0&&n.push(Object(l.translate)("Signature required")),a.free_pickup&&n.push(Object(l.translate)("Eligible for free pickup")),n.join(", ")}},{key:"renderSignatureOptions",value:function(e){var t=this;return e.map(function(e,a){return r.a.createElement(Rt,{key:a,name:"signature_option_".concat(a),label:e.label,checked:!!t.state.selectedSignature&&t.state.selectedSignature.id===a,onChange:function(n){return t.onSignatureChecked(n,a,e)}})})}},{key:"render",value:function(){var e=this.props,t=e.rateObject,a=t.title,n=t.service_id,s=t.carrier_id,i=t.rate,c=t.delivery_days,o=t.delivery_date_guaranteed,u=t.delivery_date,d=t.tracking,p=t.insurance,g=t.free_pickup,b=e.isSelected,f=e.updateValue,h=e.signatureRates,_=this.state.selectedSignature,E=Object(v.values)(Object(v.mapValues)(h,function(e,t){var a=0===e.optionNetCost?Object(l.translate)("free"):Object(l.translate)("+%s",{args:[pt()(e.optionNetCost,"USD")]});return{label:Object(l.translate)("%(label)s (%(price)s)",{args:{label:e.label,price:a}}),value:t,netCost:e.optionNetCost}})),k="";o&&u?k=Object(l.moment)(u).format("LL").split(",")[0]:c&&(k=Object(l.translate)("%(delivery_days)s business day","%(delivery_days)s business days",{count:c,args:{delivery_days:c}}));var y=_?i+_.value:i;return r.a.createElement("div",{className:"rates-step__shipping-rate-container"},r.a.createElement(Ct,{className:"rates-step__shipping-rate-radio-control",selected:b?n:null,options:[{label:"",value:n}],onChange:function(){f(n,s,!1)}}),r.a.createElement("div",{className:"rates-step__shipping-rate-information"},r.a.createElement(qt.a,{carrier:s,size:30}),r.a.createElement("div",{className:"rates-step__shipping-rate-description"},r.a.createElement("div",{className:"rates-step__shipping-rate-description-title"},a),r.a.createElement("div",{className:"rates-step__shipping-rate-description-details"},this.renderServices(s,E,{tracking:d,insurance:p,free_pickup:g}),b&&E.length>1?this.renderSignatureOptions(E):null)),r.a.createElement("div",{className:"rates-step__shipping-rate-details"},r.a.createElement("div",{className:"rates-step__shipping-rate-rate"},"ups"===s?r.a.createElement(et.a,{position:"top left",text:Object(l.translate)("This rate is provided by your connected UPS account")},r.a.createElement("div",{className:"rates-step__shipping-rate-rate-tooltip"},r.a.createElement(m.a,{icon:"help-outline",size:18}))):null,pt()(y,"USD")),r.a.createElement("div",{className:"rates-step__shipping-rate-delivery-date"},k))))}}]),t}(n.Component);wt.propTypes={rateObject:i.a.shape({rate_id:i.a.string.isRequired,title:i.a.string.isRequired,service_id:i.a.string.isRequired,carrier_id:i.a.string.isRequired,rate:i.a.number.isRequired,delivery_days:i.a.number,delivery_date_guaranteed:i.a.bool,delivery_date:i.a.string,tracking:i.a.bool,insurance:i.a.oneOfType([i.a.string,i.a.number]),free_pickup:i.a.bool}).isRequired,signatureRates:i.a.object.isRequired};var xt=wt,St={signature_required:u.a.translate("Signature required"),adult_signature_required:u.a.translate("Adult signature required")},Pt=function(e,t,a){var n=function(e,t,a){var n=Object(v.find)(a[e].default.rates,function(e){return t===e.service_id});return"undefined"!==typeof n?n.rate:0}(e,t,a);return Object(v.pickBy)(Object(v.mapValues)(a[e],function(e,a){var r=function(e,t,a,n){var r=Object(v.find)(a,function(t){return e===t.service_id});return"undefined"===typeof r?null:t in St?r.rate===n&&"Express"!==e?null:r:null}(t,a,e.rates,n);return null!==r?{rate:r,label:St[a],optionNetCost:r.rate-n}:null}),function(e){return null!==e})},Tt=function(e){var t=e.id,a=e.selectedRates,n=e.availableRates,s=e.selectedPackages,i=e.allPackages,c=e.updateRate,o=e.errors,l=e.shouldShowRateNotice,u=e.translate,d=me(s,i,!0),m=1===Object.keys(s).length;return r.a.createElement("div",null,l&&function(e){return r.a.createElement(y.a,{className:"rates-step__notice",icon:"info-outline",showDismiss:!1,text:e("The service and rate chosen by the customer at checkout is not available. Please choose another.")})}(u),Object.values(Object(v.mapValues)(s,function(e,s){if(!(s in n))return null;var i=a[s]||"",l=n[s].default.rates,p=(o[s]||[]).filter(function(e,t){return o[s].indexOf(e)===t}),g=function(e,t,a){return c(s,e,t,a)};return r.a.createElement("div",{key:s,className:"rates-step__package-container"},m?null:r.a.createElement("div",{className:"rates-step__package-container-rates-header"},u("Choose rate: %(pckg)s",{args:{pckg:d[s]}})),Object.values(Object(v.mapValues)(l,function(e){var a=e.service_id;return r.a.createElement(xt,{id:t+"_"+s,key:t+"_"+s+"_"+a,rateObject:e,signatureRates:Pt(s,a,n),updateValue:g,isSelected:a===i.serviceId})})),p.map(function(e,t){return r.a.createElement(fe.a,{type:"server-error",key:t,text:e})}))})))};Tt.propTypes={id:i.a.string.isRequired,selectedRates:i.a.object.isRequired,availableRates:i.a.object.isRequired,selectedPackages:i.a.object.isRequired,allPackages:i.a.object.isRequired,updateRate:i.a.func.isRequired,errors:i.a.object.isRequired};var zt=Object(l.localize)(Tt);function Dt(e){var t=Object(v.get)(e,"shipping_lines",[]);return Object(v.reduce)(t,function(e,t){return e+parseFloat(t.total)},0)}function At(e){return Object(v.get)(e,"shipping_lines[0].method_title",!1)}var Ut=a(607),Vt=function(e){var t=e.siteId,a=e.orderId,n=e.form,s=e.allPackages,i=e.values,c=e.available,o=e.errors,l=e.ratesTotal,u=e.translate,d=function(e,t,a,n,r){if(!n)return r("Unsaved changes made to packages");if(Object(v.some)(Object(v.mapValues)(t,function(e){return Object(v.isEmpty)(e.default.rates)})))return r("No rates found");if(!a)return"";var s=Object.keys(e);if(1===s.length){var i=s[0],c=e[i],o=t[i].default.rates,l=Object(v.find)(o,["service_id",c]);return l?r("%(serviceName)s: %(rate)s",{args:{serviceName:l.title,rate:pt()(l.rate,"USD")}}):""}return r("Total rate: %(total)s",{args:{total:pt()(a,"USD")}})}(i,c,l,n.packages.saved,u),p=function(n,r,s,i){return e.updateRate(a,t,n,r,s,i)};return Object(v.forEach)(n.packages.selected,function(e,t){if(""===i[t]&&!Object(v.isEmpty)(c)&&t in c&&1===c[t].default.rates.length){var a=c[t].default.rates[0].service_id;p(t,a,!1)}}),r.a.createElement(se,h()({title:u("Shipping rates"),summary:d,expanded:!Object(v.isEmpty)(c),toggleStep:function(){return e.toggleStep(a,t,"rates")}},function(e){var t=e.retrievalInProgress,a=e.errors,n=e.available,r=e.form;return t?{isProgress:!0}:Object(I.a)(a)?{isError:!0}:Object(v.isEmpty)(n)?{}:r.packages.saved?{isSuccess:!0}:{isWarning:!0}}(e)),!Object(v.isEmpty)(c)&&function(e){var t=e.shippingMethod,a=e.shippingCost,n=e.translate,s=document.createElement("div");s.innerHTML=t;var i,c=s.textContent;if(t)return i=0<a?n("Customer paid a {{shippingMethod/}} of {{shippingCost/}} for shipping",{components:{shippingMethod:r.a.createElement("span",null,c),shippingCost:r.a.createElement("span",{className:"rates-step__shipping-info-cost"},pt()(a,"USD"))}}):n("Your customer selected {{shippingMethod/}}",{components:{shippingMethod:r.a.createElement("span",{className:"rates-step__shipping-info-method"},c)}}),r.a.createElement("div",{className:"rates-step__shipping-info"},r.a.createElement(m.a,{icon:"info-outline"}),r.a.createElement("div",null,i))}(e),r.a.createElement(zt,{id:"rates",orderId:a,siteId:t,showRateNotice:!1,selectedPackages:n.packages.selected,allPackages:s,selectedRates:i,availableRates:c,updateRate:p,errors:o}))};Vt.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,form:i.a.object.isRequired,values:i.a.object.isRequired,available:i.a.object.isRequired,errors:i.a.object.isRequired,toggleStep:i.a.func.isRequired,updateRate:i.a.func.isRequired};var Ft=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.s)(e,a,n),s=Object(W.i)(e,a,n),i=Object(W.k)(e,a,n),c=Object(Ut.a)(e,a,n);return b()({},s.form.rates,{form:s.form,errors:r&&Object(W.f)(e,a,n).rates,ratesTotal:i?i.total:0,allPackages:Object(pe.a)(e,n),shippingCost:Dt(c),shippingMethod:At(c)})},function(e){return Object(o.b)({toggleStep:M.U,updateRate:M.Y},e)})(Object(l.localize)(Vt)),Mt=a(604),Wt=function(e){function t(){var e,a;$()(this,t);for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return a=Q()(this,(e=Z()(t)).call.apply(e,[this].concat(s))),E()(bt()(a),"renderDiscount",function(e){var t=a.props.translate,n=t("WooCommerce Shipping gives you access to USPS Commercial Pricing, which is discounted over Retail rates.");return r.a.createElement("div",{className:"label-purchase-modal__price-item-help"},r.a.createElement(et.a,{className:"label-purchase-modal__price-item-tooltip is-dialog-visible",position:"top center",text:n},r.a.createElement("div",{className:"label-purchase-modal__discount"},t("You save %s with WooCommerce Shipping",{args:[pt()(e,"USD")]}),r.a.createElement(m.a,{icon:"help-outline",size:18}))))}),E()(bt()(a),"renderRow",function(e,t,a,n){var s=R()("label-purchase-modal__price-item",{"label-purchase-modal__price-item-total":n});return r.a.createElement("div",{key:a,className:s},r.a.createElement("div",{className:"label-purchase-modal__price-item-name"},e),r.a.createElement("div",{className:"label-purchase-modal__price-item-amount"},pt()(t,"USD")))}),a}return te()(t,e),K()(t,[{key:"render",value:function(){var e=this,t=this.props,a=t.priceBreakdown,s=t.translate;if(!a)return null;var i=a.prices,c=a.discount,o=a.total;return r.a.createElement("div",{className:"label-purchase-modal__shipping-summary-section"},r.a.createElement("hr",null),i.map(function(t,a){var i=s("Package %(index)s \u2013 %(title)s",{args:{index:a+1,title:t.carrierTitle}});return r.a.createElement(n.Fragment,{key:a},e.renderRow(i,t.rateWithDiscount,a),"ups"===t.carrierId?r.a.createElement("div",{className:"label-purchase-modal__price-item-carrier-account-notice"}," ",s("Your UPS account will be charged")):r.a.createElement("div",null),t.addons.map(function(t,n){return r.a.createElement("div",{key:"addons-"+a,className:"label-purchase-modal__price-item-addons"},e.renderRow(t.title,t.rate,"addon-"+n))}))}),this.renderRow(s("Total"),o,"total",!0),0<c&&this.renderDiscount(c))}}]),t}(n.Component);Wt.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired};var Lt=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId;return{priceBreakdown:Object(W.k)(e,a,n)}})(Object(l.localize)(Wt)),Bt=function(e){var t=e.translate,a=e.normalizationStatus,n=e.form,s=e.orderId,i=e.siteId,c=n.origin,o=n.rates,l=Object.keys(o.values).length;return r.a.createElement("div",{className:"label-purchase-modal__shipping-summary-section"},r.a.createElement("div",{className:"label-purchase-modal__shipping-summary-header"},t("Shipping summary")),r.a.createElement("div",{className:"label-purchase-modal__shipping-summary-info"},a.isSuccess?r.a.createElement("div",{className:"label-purchase-modal__shipping-summary-street"},r.a.createElement("div",null,t("Shipping from")),r.a.createElement("div",null,c.values.address,r.a.createElement("a",{href:"#",onClick:function(){return e.toggleStep(s,i,"origin",!0)}},t("Edit")))):null),r.a.createElement("div",{className:"label-purchase-modal__shipping-summarry-labels"},l+" "+t("shipping label ready","shipping labels ready",{count:l})))};Bt.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired};var Ht=function(e){var t=e.normalizationInProgress,a=e.errors,n=e.isNormalized,r=e.values,s=e.normalized;return t?{isProgress:!0}:Object(I.a)(a)||n&&!s||!n?{isError:!0}:n?Object(v.isEqual)(r,s)?{isSuccess:!0}:{isWarning:!0}:{}},Yt=Object(l.localize)(Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.s)(e,a,n),s=Object(W.i)(e,a,n),i=s.form.origin,c=r&&Object(W.f)(e,a,n).origin;return{orderId:a,siteId:n,errors:c,form:s.form,expanded:i.expanded,normalizationStatus:Ht(b()({},i,{errors:c}))}},function(e){return Object(o.b)({toggleStep:M.U},e)})(Bt)),$t=function(e){var t=e.form,a=e.disabled,s=e.busy;return r.a.createElement(n.Fragment,null,r.a.createElement(de.a,{disabled:a,onClick:t.needsPrintConfirmation?e.confirmPrintLabel:e.purchaseLabel,primary:!0,busy:s},function(e){var t=e.form,a=e.translate;return t.needsPrintConfirmation?a("Print"):t.isSubmitting?a("Purchasing\u2026"):a("Buy shipping label","Buy shipping labels",{count:Object.keys(t.packages.selected).length})}(e)))};$t.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,disabled:i.a.bool,busy:i.a.bool};var Gt=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.s)(e,a,n),s=Object(W.i)(e,a,n);return{form:r&&s.form}},function(e,t){var a=t.orderId,n=t.siteId;return{confirmPrintLabel:function(){return e(Object(M.j)(a,n))},purchaseLabel:function(){return e(Object(M.B)(a,n))}}})(Object(l.localize)($t)),Kt=a(567),Jt=function(e){function t(){var e,a;$()(this,t);for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return a=Q()(this,(e=Z()(t)).call.apply(e,[this].concat(r))),E()(bt()(a),"onVisibilityChange",function(){document.hidden||a.refetchSettings(),a.creditCardWindow&&a.creditCardWindow.closed&&document.removeEventListener("visibilitychange",a.onVisibilityChange)}),E()(bt()(a),"refetchSettings",function(){a.props.fetchSettings(a.props.siteId)}),E()(bt()(a),"onChooseCard",function(){a.creditCardWindow=window.open(a.props.url),document.addEventListener("visibilitychange",a.onVisibilityChange)}),a}return te()(t,e),K()(t,[{key:"render",value:function(){var e=this.props,t=e.disabled,a=e.buttonLabel,s=e.buttonDescription;return r.a.createElement(n.Fragment,null,r.a.createElement(de.a,{onClick:this.onChooseCard,disabled:t,primary:!0},a," ",r.a.createElement(m.a,{icon:"external"})),r.a.createElement("div",{className:"purchase-section__explanation"},s(this.onChooseCard)))}}]),t}(n.Component),Qt=Object(c.b)(function(e){return e},function(e){return Object(o.b)({fetchSettings:Kt.a},e)})(Object(l.localize)(Jt)),Xt=a(645),Zt=(a(783),Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.s)(e,a,n),s=Object(W.i)(e,a,n),i=r&&Object(W.b)(e,a,n),c=r&&s.form;return{form:c,hasLabelsPaymentMethod:Boolean(Object(qe.n)(e,n)),paymentMethods:Object(qe.l)(e,n),disablePurchase:!c.needsPrintConfirmation&&(!i||c.isSubmitting)}})(Object(l.localize)(function(e){var t=e.orderId,a=e.siteId,n=e.hasLabelsPaymentMethod,s=e.paymentMethods,i=e.form,c=e.disablePurchase,o=e.translate,l=i.isSubmitting&&!i.needsPrintConfirmation,u=Object(W.m)(i.rates),d=u&&Object.values(i.rates.values).some(function(e){return"ups"!==e.carrierId}),m=n&&d||!d;return r.a.createElement("div",{className:"purchase-section"},m||!u?r.a.createElement(Gt,{siteId:a,orderId:t,disabled:c,busy:l}):s.length?r.a.createElement(Qt,{disabled:c,url:"admin.php?page=wc-settings&tab=shipping§ion=woocommerce-services-settings",buttonLabel:o("Choose credit card"),buttonDescription:function(e){return o("To print this shipping label, {{a}}choose a credit card to add to your account{{/a}}.",{components:{a:r.a.createElement("a",{onClick:e,href:"#",role:"button"})}})}}):r.a.createElement(Qt,{disabled:c,url:Object(Xt.a)()+"/me/purchases/add-credit-card",buttonLabel:o("Add credit card"),buttonDescription:function(e){return o("To print this shipping label, {{a}}add a credit card to your account{{/a}}.",{components:{a:r.a.createElement("a",{onClick:e,href:"#",role:"button"})}})}}))}))),ea=a(688),ta=a(532),aa=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(ta.a)(e);return Object(v.get)(e,["extensions","woocommerce","ui","orders",t,"edits","currentlyEditingId"],null)},na=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(ta.a)(e),a=aa(e,t),n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(ta.a)(e);return Object(v.get)(e,["extensions","woocommerce","ui","orders",t,"edits","changes"],{})}(e,t);if(Object(v.isObject)(a)){var r=function(){var e=Object(ea.b)(0,"USD");return{status:"pending",currency:"USD",discount_total:e,discount_tax:e,shipping_total:e,shipping_tax:e,cart_tax:e,total:e,total_tax:e,prices_include_tax:!1,billing:{},shipping:{},payment_method:"calypso_manual",payment_method_title:Object(l.translate)("Manual Payment"),line_items:[],tax_lines:[],shipping_lines:[],fee_lines:[],coupon_lines:[],refunds:[]}}();return b()({},r,n,{id:a})}var s=Object(Ut.a)(e,a,t);return s?Object(v.merge)({},s,n):n},ra=a(637),sa=function(e){var t=e.orderId,a=e.siteId,n=e.form,s=e.errors,i=e.paperSize,c=e.translate,o=e.fulfillOrder,l=e.emailDetails,u=e.order,d=e.hasLabelsPaymentMethod,m=Object(W.m)(n.rates)&&Object.values(n.rates.values).some(function(e){return"ups"!==e.carrierId}),p=d&&m||!m;return r.a.createElement("div",{className:"label-purchase-modal__sidebar"},r.a.createElement(Yt,{siteId:a,orderId:t}),r.a.createElement(Lt,{siteId:a,orderId:t}),r.a.createElement("hr",null),r.a.createElement("div",{className:"label-purchase-modal__purchase-container"},p?r.a.createElement(j.a,{id:"paper_size",valuesMap:Object(Mt.a)(n.origin.values.country),title:c("Paper size"),value:i,updateValue:function(n){return e.updatePaperSize(t,a,n)},error:s.paperSize}):null,r.a.createElement(Zt,{siteId:a,orderId:t})),r.a.createElement(Rt,{className:"label-purchase-modal__option-mark-order-fulfilled",label:Object(ra.b)(u.status)?c("Notify the customer with shipment details"):c("Mark this order as complete and notify the customer"),checked:o||l,onChange:function(n){e.setFulfillOrderOption(t,a,n&&!Object(ra.b)(u.status)),e.setEmailDetailsOption(t,a,n&&Object(ra.b)(u.status))}}))};sa.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired,paperSize:i.a.string.isRequired,errors:i.a.object.isRequired,form:i.a.object.isRequired,updatePaperSize:i.a.func.isRequired,fulfillOrder:i.a.bool.isRequired,emailDetails:i.a.bool.isRequired,order:i.a.object.isRequired,hasLabelsPaymentMethod:i.a.bool.isRequired,setFulfillOrderOption:i.a.func.isRequired};var ia=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.s)(e,a,n),s=Object(W.i)(e,a,n);return{order:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(ta.a)(e);return!!aa(e,t)}(e)?na(e):Object(Ut.a)(e,a),paperSize:s.paperSize,form:s.form,hasLabelsPaymentMethod:Boolean(Object(qe.n)(e,n)),errors:r&&Object(W.f)(e,a,n).sidebar,fulfillOrder:r&&Object(W.u)(e,a,n),emailDetails:r&&Object(W.t)(e,a,n)}},function(e){return Object(o.b)({setEmailDetailsOption:M.M,setFulfillOrderOption:M.N,updatePaperSize:M.X},e)})(Object(l.localize)(sa)),ca=function(e){var t=e.loaded,a=e.translate;if(!t)return null;var n=function(){return e.exitPrintingFlow(e.orderId,e.siteId,!1)};return r.a.createElement(p.a,{additionalClassNames:"woocommerce label-purchase-modal wcc-root",isVisible:e.showPurchaseDialog,onClose:n},r.a.createElement("div",{className:"label-purchase-modal__content"},r.a.createElement("div",{className:"label-purchase-modal__header"},r.a.createElement(Se.a,null,a("Create shipping label","Create shipping labels",{count:Object.keys(e.form.packages.selected).length})),r.a.createElement(de.a,{className:"label-purchase-modal__close-button",onClick:n},r.a.createElement(m.a,{icon:"cross"}))),r.a.createElement("div",{className:"label-purchase-modal__body"},r.a.createElement("div",{className:"label-purchase-modal__main-section"},r.a.createElement(ue,{type:"origin",title:a("Origin address"),siteId:e.siteId,orderId:e.orderId}),r.a.createElement(ue,{type:"destination",title:a("Destination address"),siteId:e.siteId,orderId:e.orderId}),r.a.createElement(We,{siteId:e.siteId,orderId:e.orderId}),e.isCustomsFormRequired&&r.a.createElement(dt,{siteId:e.siteId,orderId:e.orderId}),r.a.createElement(Ft,{siteId:e.siteId,orderId:e.orderId})),r.a.createElement(ia,{siteId:e.siteId,orderId:e.orderId}))))};ca.propTypes={siteId:i.a.number.isRequired,orderId:i.a.number.isRequired};t.default=Object(c.b)(function(e,t){var a=t.orderId,n=t.siteId,r=Object(W.s)(e,a,n),s=Object(W.i)(e,a,n);return{loaded:r,form:r&&s.form,showPurchaseDialog:s.showPurchaseDialog,isCustomsFormRequired:Object(W.o)(e,a,n)}},function(e){return Object(o.b)({exitPrintingFlow:M.o},e)})(Object(l.localize)(ca))}}]);
|
dist/chunks/{4ac1c307f4052717e1a8.css → deb6e682893bf6d661d0.css}
RENAMED
File without changes
|
dist/chunks/{4ac1c307f4052717e1a8.min.js → deb6e682893bf6d661d0.min.js}
RENAMED
File without changes
|
dist/chunks/{d99a250da0e3b29ee6dd.css → e211e5f3ac08c6eb420b.css}
RENAMED
File without changes
|
dist/chunks/{d99a250da0e3b29ee6dd.min.js → e211e5f3ac08c6eb420b.min.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[153],{553:function(t,e,n){"use strict";var r=n(107),a=n.n(r),i=n(108),o=n.n(i),c=n(528),s=n.n(c),u=n(527),l=n.n(u),p=n(531),d=n.n(p),m=n(529),f=n.n(m),h=n(34),g=n.n(h),v=n(12),b=n.n(v),y=n(10),O=n.n(y),_=n(526),N=n.n(_),j=n(1),E=n(35),A=n(534),w=n.n(A),D=n(564),C=function(t){function e(){var t,n;a()(this,e);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=s()(this,(t=l()(e)).call.apply(t,[this].concat(i))),g()(d()(n),"dismissTimeout",null),n}return f()(e,t),o()(e,[{key:"componentDidMount",value:function(){this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"componentWillUnmount",value:function(){this.dismissTimeout&&clearTimeout(this.dismissTimeout)}},{key:"componentDidUpdate",value:function(){clearTimeout(this.dismissTimeout),this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"getIcon",value:function(){var t;switch(this.props.status){case"is-info":t="info";break;case"is-success":t="checkmark";break;case"is-error":case"is-warning":t="notice";break;default:t="info"}return t}},{key:"render",value:function(){var t=this.props,e=t.children,n=t.className,r=t.icon,a=t.isCompact,i=t.isLoading,o=t.onDismissClick,c=t.showDismiss,s=void 0===c?!a:c,u=t.status,l=t.text,p=t.translate,d=N()("notice",u,n,{"is-compact":a,"is-loading":i,"is-dismissable":s});return O.a.createElement("div",{className:d},O.a.createElement("span",{className:"notice__icon-wrapper"},O.a.createElement(w.a,{className:"notice__icon",icon:r||this.getIcon(),size:24})),O.a.createElement("span",{className:"notice__content"},O.a.createElement("span",{className:"notice__text"},l||e)),l?e:null,s&&O.a.createElement("span",{tabIndex:"0",className:"notice__dismiss",onClick:o},O.a.createElement(w.a,{icon:"cross",size:24}),O.a.createElement(D.a,null,p("Dismiss"))))}}]),e}(y.Component);g()(C,"defaultProps",{className:"",duration:0,icon:null,isCompact:!1,isLoading:!1,onDismissClick:j.noop,status:null,text:null}),g()(C,"propTypes",{className:b.a.string,duration:b.a.number,icon:b.a.string,isCompact:b.a.bool,isLoading:b.a.bool,onDismissClick:b.a.func,showDismiss:b.a.bool,status:b.a.oneOf(["is-error","is-info","is-success","is-warning","is-plain"]),text:b.a.oneOfType([b.a.arrayOf(b.a.oneOfType([b.a.string,b.a.node])),b.a.oneOfType([b.a.string,b.a.node])]),translate:b.a.func.isRequired}),e.a=Object(E.localize)(C)},564:function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(10),a=n.n(r);n(577);function i(t){var e=t.children;return a.a.createElement("span",{className:"screen-reader-text"},e)}},577:function(t,e,n){},650:function(t,e){t.exports=function(t){return t&&t.__esModule?t:{default:t}}},773:function(t,e,n){},779:function(t,e,n){"use strict";var r=n(650);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){var n=a.default.parse(t,!0,!0),r="https:"===n.protocol;delete n.protocol,delete n.auth,delete n.port;var u={slashes:!0,protocol:"https:",query:{}};if(p=n.host,/^i[0-2]\.wp\.com$/.test(p))u.pathname=n.pathname,u.hostname=n.hostname;else{if(n.search)return null;var l=a.default.format(n);u.pathname=0===l.indexOf("//")?l.substring(1):l,u.hostname=function(t){var e=(0,i.default)(t),n=(0,o.default)(e),r="i"+Math.floor(3*n());return c('determined server "%s" to use with "%s"',r,t),r+".wp.com"}(u.pathname),r&&(u.query.ssl=1)}var p;if(e)for(var d in e)"host"!==d&&"hostname"!==d?"secure"!==d||e[d]?u.query[s[d]||d]=e[d]:u.protocol="http:":u.hostname=e[d];var m=a.default.format(u);return c("generated Photon URL: %s",m),m};var a=r(n(648)),i=r(n(780)),o=r(n(781)),c=(0,r(n(47)).default)("photon"),s={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"}},780:function(t,e){!function(){"use strict";var e=[],n=3988292384;function r(t){var e,r,a,i,o=-1;for(e=0,a=t.length;e<a;e+=1){for(i=255&(o^t[e]),r=0;r<8;r+=1)1===(1&i)?i=i>>>1^n:i>>>=1;o=o>>>8^i}return-1^o}function a(t,n){var r,i,o;if("undefined"!==typeof a.crc&&n&&t||(a.crc=-1,t)){for(r=a.crc,i=0,o=t.length;i<o;i+=1)r=r>>>8^e[255&(r^t[i])];return a.crc=r,-1^r}}!function(){var t,r,a;for(r=0;r<256;r+=1){for(t=r,a=0;a<8;a+=1)1&t?t=n^t>>>1:t>>>=1;e[r]=t>>>0}}(),t.exports=function(t,e){var n;t="string"===typeof t?(n=t,Array.prototype.map.call(n,function(t){return t.charCodeAt(0)})):t;return((e?r(t):a(t))>>>0).toString(16)},t.exports.direct=r,t.exports.table=a}()},781:function(t,e,n){"use strict";var r=256,a=[],i=window,o=Math.pow(r,6),c=Math.pow(2,52),s=2*c,u=r-1,l=Math.random;function p(t){var e,n=t.length,a=this,i=0,o=a.i=a.j=0,c=a.S=[];for(n||(t=[n++]);i<r;)c[i]=i++;for(i=0;i<r;i++)c[i]=c[o=u&o+t[i%n]+(e=c[i])],c[o]=e;(a.g=function(t){for(var e,n=0,i=a.i,o=a.j,c=a.S;t--;)e=c[i=u&i+1],n=n*r+c[u&(c[i]=c[o=u&o+e])+(c[o]=e)];return a.i=i,a.j=o,n})(r)}function d(t,e){for(var n,r=t+"",a=0;a<r.length;)e[u&a]=u&(n^=19*e[u&a])+r.charCodeAt(a++);return m(e)}function m(t){return String.fromCharCode.apply(0,t)}t.exports=function(e,n){if(n&&!0===n.global)return n.global=!1,Math.random=t.exports(e,n),n.global=!0,Math.random;var u=[],l=(d(function t(e,n){var r,a=[],i=(typeof e)[0];if(n&&"o"==i)for(r in e)try{a.push(t(e[r],n-1))}catch(o){}return a.length?a:"s"==i?e:e+"\0"}(n&&n.entropy||!1?[e,m(a)]:0 in arguments?e:function(t){try{return i.crypto.getRandomValues(t=new Uint8Array(r)),m(t)}catch(e){return[+new Date,i,i.navigator&&i.navigator.plugins,i.screen,m(a)]}}(),3),u),new p(u));return d(m(l.S),a),function(){for(var t=l.g(6),e=o,n=0;t<c;)t=(t+n)*r,e*=r,n=l.g(1);for(;t>=s;)t/=2,e/=2,n>>>=1;return(t+n)/e}},t.exports.resetGlobal=function(){Math.random=l},d(Math.random(),a)},794:function(t,e,n){"use strict";n.r(e);var r=n(10),a=n.n(r),i=(n(773),n(107)),o=n.n(i),c=n(108),s=n.n(c),u=n(528),l=n.n(u),p=n(527),d=n.n(p),m=n(531),f=n.n(m),h=n(529),g=n.n(h),v=n(34),b=n.n(v),y=n(109),O=n(35),_=function(t){window.location.reload(!0),t({type:"STRIPE_CONNECT_ACCOUNT_RELOAD_PAGE"})},N=n(1),j=n(12),E=n.n(j),A=n(542),w=n(530),D=n.n(w),C=n(533),I=n.n(C),z=n(526),U=n.n(z),k=function(t){function e(){var t,n;o()(this,e);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=l()(this,(t=d()(e)).call.apply(t,[this].concat(a))),b()(f()(n),"state",{isError:!1}),b()(f()(n),"handleError",function(){n.setState({isError:!0})}),n}return g()(e,t),s()(e,[{key:"componentWillReceiveProps",value:function(t){t.src!==this.props.src&&this.setState({isError:!1})}},{key:"render",value:function(){var t=this.props,e=t.className,n=I()(t,["className"]),r=U()(e,{image:!0,"is-error":this.state.isError});return a.a.createElement("img",D()({onError:this.handleError,className:r},n))}}]),e}(r.Component);b()(k,"defaultProps",{className:""});var R,S=n(648),T=n(779),x=n.n(T);R="object"===typeof location?new RegExp("^(/(?!/)|data:image/[^;]+;|blob:".concat(location.origin,"/)")):/^(\/(?!\/)|data:image\/[^;]+;)/;var L=/^([-a-zA-Z0-9_]+\.)*(gravatar\.com|wordpress\.com|wp\.com|a8c\.com)$/;var q=/^https?:$/,M=Object(N.get)(window,"devicePixelRatio",1)>1?2:1,P=["w","h","resize","fit","s"],W={photon:/(^[is]\d\.wp\.com|(^|\.)wordpress\.com)$/,gravatar:/(^|\.)gravatar\.com$/},V=function(t){return t*M};function $(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if("string"!==typeof t)return t;var a=Object(S.parse)(t,!0,!0);if(!q.test(a.protocol))return t;if(!a.hostname)return t;a.query=Object(N.omit)(a.query,P);var i=Object(N.findKey)(W,String.prototype.match.bind(a.hostname));return"number"===typeof e&&(e="gravatar"===i?{s:e}:n>0?{fit:[e,n].join()}:{w:e}),!i&&r?$(function(t){if("string"!==typeof t)return null;if(R.test(t))return t;var e=Object(S.parse)(t,!1,!0),n=e.hostname,r=e.path,a=e.query;return L.test(n)?t.replace(/^http:/,"https:"):a&&a.length>0?null:Object(N.endsWith)(r,".svg")?null:x()(t)}(t),e,null,!1):(Object(N.assign)(a.query,Object(N.mapValues)(e,function(t,e){return"resize"===e||"fit"===e?t.split(",").map(V).join(","):Object(N.includes)(P,e)?V(t):t})),delete a.search,Object(S.format)(a))}var G=function(t){function e(){var t,n;o()(this,e);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return n=l()(this,(t=d()(e)).call.apply(t,[this].concat(i))),b()(f()(n),"renderLogo",function(){var t=n.props.stripeConnectAccount.logo,e=null;return Object(N.isEmpty)(t)||(e=a.a.createElement(k,{src:$(t,{w:40,h:40}),className:"stripe__connect-account-logo"})),a.a.createElement("div",{className:"stripe__connect-account-logo-container"},e)}),b()(f()(n),"renderNameAndEmail",function(){var t=n.props.stripeConnectAccount,e=t.displayName,r=t.email,i=t.firstName,o=t.lastName,c=Object(N.isEmpty)(e)?"".concat(i," ").concat(o):e;return a.a.createElement("div",{className:"stripe__connect-account-details"},a.a.createElement("span",{className:"stripe__connect-account-name"},a.a.createElement("span",{className:"stripe__connect-account-name"},c),a.a.createElement("span",{className:"stripe__connect-account-email"},r)))}),b()(f()(n),"onDeauthorize",function(t){t.preventDefault(),n.props.onDeauthorize()}),b()(f()(n),"renderStatus",function(){var t=n.props,e=t.isDeauthorizing,r=t.stripeConnectAccount,i=t.translate,o=null,c=null;return o=r.isActivated?a.a.createElement("span",{className:"stripe__connect-account-status account-activated"},i("Activated")):a.a.createElement("span",{className:"stripe__connect-account-status account-not-activated"},i("Check email to activate account")),c=e?a.a.createElement("span",{className:"stripe__connect-account-disconnect"},i("Disconnecting")):a.a.createElement(A.a,{borderless:!0,className:"stripe__connect-account-disconnect",onClick:n.onDeauthorize},i("Disconnect")),a.a.createElement("div",null,o,c)}),b()(f()(n),"render",function(){var t=n.props.translate;return a.a.createElement("div",{className:"stripe__connect-account"},a.a.createElement("h3",{className:"stripe__connect-account-heading"},t("Stripe account")),a.a.createElement("div",{className:"stripe__connect-account-body"},n.renderLogo(),a.a.createElement("div",{className:"stripe__connect-account-details"},n.renderNameAndEmail(),n.renderStatus())))}),n}return g()(e,t),e}(r.Component);b()(G,"propTypes",{stripeConnectAccount:E.a.shape({displayName:E.a.string,email:E.a.string,firstName:E.a.string,isActivated:E.a.bool,lastName:E.a.string,logo:E.a.string}),isDeauthorizing:E.a.bool.isRequired,onDeauthorize:E.a.func.isRequired});var X=Object(O.localize)(G),J=n(553),K=n(532),Y=function(t,e){return Object(N.get)(t,["extensions","woocommerce","sites",e,"settings","stripeConnectAccount"],{})};function Z(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(K.a)(t);return Object(N.get)(Y(t,e),["error"],"")}function F(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(K.a)(t);return Object(N.get)(Y(t,e),["isDeauthorizing"],!1)}function B(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(K.a)(t);return Object(N.get)(Y(t,e),["oauthUrl"],"")}function H(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(K.a)(t);return Object(N.get)(Y(t,e),["isRequesting"],!1)}var Q=n(535),tt=n(561),et=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return function(r,a){var i=a();t||(t=Object(K.a)(i));var o={type:Q.W,siteId:t};return r(o),Object(tt.a)(t).get("connect/stripe/account","wc/v1").then(function(n){r(function(t,e,n){var r=n.account_id,a=n.display_name,i=n.email,o=n.business_logo,c=n.legal_entity,s=n.payouts_enabled;return{type:Q.X,connectedUserID:r,displayName:a,email:i,firstName:c.first_name,isActivated:s,logo:o,lastName:c.last_name,siteId:t}}(t,0,n)),e&&r(e(t,o,n))}).catch(function(e){r(function(t,e,n){var r=n.message;return{type:Q.X,error:r,siteId:t}}(t,0,e)),n&&r(n(e))})}};var nt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return function(r,a){var i=a();t||(t=Object(K.a)(i));var o={type:Q.U,siteId:t};return r(o),Object(tt.a)(t).post("connect/stripe/account/deauthorize",{},"wc/v1").then(function(n){r(function(t,e,n){return{type:Q.V,siteId:t}}(t)),e&&r(e(t,o,n))}).catch(function(e){r(function(t,e,n){return{type:Q.V,error:n,siteId:t}}(t,0,e)),n&&r(n(e))})}};var rt=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return function(a,i){var o=i();t||(t=Object(K.a)(o));var c={type:Q.ab,returnUrl:e,siteId:t};return a(c),Object(tt.a)(t).post("connect/stripe/oauth/init",{returnUrl:e},"wc/v1").then(function(e){a(function(t,e,n){var r=n.oauthUrl;return{type:Q.bb,oauthUrl:r,siteId:t}}(t,0,e)),n&&a(n(t,c,e))}).catch(function(e){a(function(t,e,n){var r=n.message;return{type:Q.bb,error:r,siteId:t}}(t,0,e)),r&&a(r(t,c,e))})}};var at,it=function(t){function e(){var t,n;o()(this,e);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=l()(this,(t=d()(e)).call.apply(t,[this].concat(a))),b()(f()(n),"onDeauthorize",function(){var t=n.props.siteId;n.props.deauthorizeAccount(t)}),n}return g()(e,t),s()(e,[{key:"componentDidMount",value:function(){var t=this.props.siteId;this.props.fetchAccountDetails(t)}},{key:"componentDidUpdate",value:function(t){var e=this.props,n=e.siteId,r=e.isLoading,a=e.connectedUserID,i=e.oauthURL,o=e.isOAuthInitializing,c=e.stripeError,s=!o&&t.isOAuthInitializing&&c;r||!t.isLoading||a||i||s||this.props.oauthInit(n)}},{key:"render",value:function(){var t=this.props,e=t.isLoading,n=t.stripeConnectAccount,r=t.stripeError,i=t.isDeauthorizing,o=t.isReloading,c=t.oauthURL,s=t.translate;return e?a.a.createElement("div",{className:"stripe-connect-account__placeholder-container"},a.a.createElement("div",{className:"stripe-connect-account__placeholder-body"})):o?a.a.createElement(J.a,{showDismiss:!1,isCompact:!0,isLoading:!0},s("Account disconnected. Reloading page\u2026")):c?s("You\u2019ve got WooCommerce Services installed. If you\u2019d like, we can automatically copy keys from your Stripe account for you. {{a}}Click here{{/a}} to connect your Stripe account using WooCommerce Services.",{components:{a:a.a.createElement("a",{href:c})}}):r||a.a.createElement(X,{stripeConnectAccount:n,isDeauthorizing:i,onDeauthorize:this.onDeauthorize})}}]),e}(r.Component),ot=Object(y.b)(function(t){var e=Object(K.a)(t),n=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(K.a)(t),n=Y(t,e);return Object(N.omit)(n,["error","isDeauthorizing","isOAuthConnecting","isOAuthInitializing","isRequesting","oauthUrl","notifyCompleted"])}(t,e),r=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(K.a)(t);return Object(N.get)(Y(t,e),["isOAuthInitializing"],!1)}(t,e);return{siteId:e,isLoading:H(t,e)||r,isOAuthInitializing:r,stripeConnectAccount:n,stripeError:Z(t,e),connectedUserID:n.connectedUserID,isDeauthorizing:F(t,e),isReloading:t.isReloading,oauthURL:B(t,e)}},function(t){return{fetchAccountDetails:function(e){return t(et(e))},deauthorizeAccount:function(e){t(nt(e)).then(function(){t(_)})},oauthInit:function(e){return t(rt(e))}}})(Object(O.localize)(it)),ct=n(46);var st=Object(ct.b)(null,(at={},b()(at,Q.S,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign({},t,{notifyCompleted:!1})}),b()(at,Q.T,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign({},t,{error:""})}),b()(at,Q.U,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign({},t,{isDeauthorizing:!0})}),b()(at,Q.V,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return Object.assign({},t,{connectedUserID:"",displayName:"",email:"",error:e.error||"",firstName:"",isActivated:!1,isDeauthorizing:!1,isRequesting:!1,lastName:"",logo:""})}),b()(at,Q.W,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign({},t,{connectedUserID:"",displayName:"",email:"",error:"",firstName:"",isActivated:!1,isDeauthorizing:!1,isRequesting:!0,lastName:"",logo:""})}),b()(at,Q.X,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return Object.assign({},t,{connectedUserID:e.connectedUserID||"",displayName:e.displayName||"",email:e.email||"",error:e.error||"",firstName:e.firstName||"",isActivated:e.isActivated||!1,isDeauthorizing:!1,isRequesting:!1,lastName:e.lastName||"",logo:e.logo||""})}),b()(at,Q.ab,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign({},t,{isOAuthInitializing:!0,oauthUrl:""})}),b()(at,Q.bb,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return Object.assign({},t,{isOAuthInitializing:!1,error:e.error||"",oauthUrl:e.oauthUrl||""})}),b()(at,Q.Y,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign({},t,{error:"",isOAuthConnecting:!0,notifyCompleted:!1})}),b()(at,Q.Z,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return Object.assign({},t,{connectedUserID:e.connectedUserID||"",email:"",error:e.error||"",firstName:"",isActivated:!1,isCreating:!1,isOAuthConnecting:!1,isRequesting:!1,lastName:"",logo:"",notifyCompleted:!0})}),at));e.default=function(){return{getReducer:function(){return Object(ct.a)({extensions:Object(ct.a)({woocommerce:Object(ct.a)({sites:Object(ct.a)({1:Object(ct.a)({settings:Object(ct.a)({stripeConnectAccount:st})})})})}),ui:function(){return{selectedSiteId:1}},isReloading:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=(arguments.length>1?arguments[1]:void 0).type;return t||"STRIPE_CONNECT_ACCOUNT_RELOAD_PAGE"===e}})},getInitialState:function(){return{}},getStateForPersisting:function(){return null},getStateKey:function(){return"wcs-stripe-connect-account"},View:function(){return a.a.createElement(ot,null)}}}}}]);
|
1 |
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[153],{553:function(t,e,n){"use strict";var r=n(107),a=n.n(r),i=n(108),o=n.n(i),c=n(528),s=n.n(c),u=n(527),l=n.n(u),p=n(531),d=n.n(p),m=n(529),f=n.n(m),h=n(34),g=n.n(h),v=n(12),b=n.n(v),y=n(10),O=n.n(y),_=n(526),N=n.n(_),j=n(1),E=n(35),A=n(534),w=n.n(A),D=n(564),C=function(t){function e(){var t,n;a()(this,e);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=s()(this,(t=l()(e)).call.apply(t,[this].concat(i))),g()(d()(n),"dismissTimeout",null),n}return f()(e,t),o()(e,[{key:"componentDidMount",value:function(){this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"componentWillUnmount",value:function(){this.dismissTimeout&&clearTimeout(this.dismissTimeout)}},{key:"componentDidUpdate",value:function(){clearTimeout(this.dismissTimeout),this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"getIcon",value:function(){var t;switch(this.props.status){case"is-info":t="info";break;case"is-success":t="checkmark";break;case"is-error":case"is-warning":t="notice";break;default:t="info"}return t}},{key:"render",value:function(){var t=this.props,e=t.children,n=t.className,r=t.icon,a=t.isCompact,i=t.isLoading,o=t.onDismissClick,c=t.showDismiss,s=void 0===c?!a:c,u=t.status,l=t.text,p=t.translate,d=N()("notice",u,n,{"is-compact":a,"is-loading":i,"is-dismissable":s});return O.a.createElement("div",{className:d},O.a.createElement("span",{className:"notice__icon-wrapper"},O.a.createElement(w.a,{className:"notice__icon",icon:r||this.getIcon(),size:24})),O.a.createElement("span",{className:"notice__content"},O.a.createElement("span",{className:"notice__text"},l||e)),l?e:null,s&&O.a.createElement("span",{tabIndex:"0",className:"notice__dismiss",onClick:o},O.a.createElement(w.a,{icon:"cross",size:24}),O.a.createElement(D.a,null,p("Dismiss"))))}}]),e}(y.Component);g()(C,"defaultProps",{className:"",duration:0,icon:null,isCompact:!1,isLoading:!1,onDismissClick:j.noop,status:null,text:null}),g()(C,"propTypes",{className:b.a.string,duration:b.a.number,icon:b.a.string,isCompact:b.a.bool,isLoading:b.a.bool,onDismissClick:b.a.func,showDismiss:b.a.bool,status:b.a.oneOf(["is-error","is-info","is-success","is-warning","is-plain"]),text:b.a.oneOfType([b.a.arrayOf(b.a.oneOfType([b.a.string,b.a.node])),b.a.oneOfType([b.a.string,b.a.node])]),translate:b.a.func.isRequired}),e.a=Object(E.localize)(C)},564:function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(10),a=n.n(r);n(577);function i(t){var e=t.children;return a.a.createElement("span",{className:"screen-reader-text"},e)}},577:function(t,e,n){},650:function(t,e){t.exports=function(t){return t&&t.__esModule?t:{default:t}}},773:function(t,e,n){},779:function(t,e,n){"use strict";var r=n(650);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){var n=a.default.parse(t,!0,!0),r="https:"===n.protocol;delete n.protocol,delete n.auth,delete n.port;var u={slashes:!0,protocol:"https:",query:{}};if(p=n.host,/^i[0-2]\.wp\.com$/.test(p))u.pathname=n.pathname,u.hostname=n.hostname;else{if(n.search)return null;var l=a.default.format(n);u.pathname=0===l.indexOf("//")?l.substring(1):l,u.hostname=function(t){var e=(0,i.default)(t),n=(0,o.default)(e),r="i"+Math.floor(3*n());return c('determined server "%s" to use with "%s"',r,t),r+".wp.com"}(u.pathname),r&&(u.query.ssl=1)}var p;if(e)for(var d in e)"host"!==d&&"hostname"!==d?"secure"!==d||e[d]?u.query[s[d]||d]=e[d]:u.protocol="http:":u.hostname=e[d];var m=a.default.format(u);return c("generated Photon URL: %s",m),m};var a=r(n(648)),i=r(n(780)),o=r(n(781)),c=(0,r(n(47)).default)("photon"),s={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"}},780:function(t,e){!function(){"use strict";var e=[],n=3988292384;function r(t){var e,r,a,i,o=-1;for(e=0,a=t.length;e<a;e+=1){for(i=255&(o^t[e]),r=0;r<8;r+=1)1===(1&i)?i=i>>>1^n:i>>>=1;o=o>>>8^i}return-1^o}function a(t,n){var r,i,o;if("undefined"!==typeof a.crc&&n&&t||(a.crc=-1,t)){for(r=a.crc,i=0,o=t.length;i<o;i+=1)r=r>>>8^e[255&(r^t[i])];return a.crc=r,-1^r}}!function(){var t,r,a;for(r=0;r<256;r+=1){for(t=r,a=0;a<8;a+=1)1&t?t=n^t>>>1:t>>>=1;e[r]=t>>>0}}(),t.exports=function(t,e){var n;t="string"===typeof t?(n=t,Array.prototype.map.call(n,function(t){return t.charCodeAt(0)})):t;return((e?r(t):a(t))>>>0).toString(16)},t.exports.direct=r,t.exports.table=a}()},781:function(t,e,n){"use strict";var r=256,a=[],i=window,o=Math.pow(r,6),c=Math.pow(2,52),s=2*c,u=r-1,l=Math.random;function p(t){var e,n=t.length,a=this,i=0,o=a.i=a.j=0,c=a.S=[];for(n||(t=[n++]);i<r;)c[i]=i++;for(i=0;i<r;i++)c[i]=c[o=u&o+t[i%n]+(e=c[i])],c[o]=e;(a.g=function(t){for(var e,n=0,i=a.i,o=a.j,c=a.S;t--;)e=c[i=u&i+1],n=n*r+c[u&(c[i]=c[o=u&o+e])+(c[o]=e)];return a.i=i,a.j=o,n})(r)}function d(t,e){for(var n,r=t+"",a=0;a<r.length;)e[u&a]=u&(n^=19*e[u&a])+r.charCodeAt(a++);return m(e)}function m(t){return String.fromCharCode.apply(0,t)}t.exports=function(e,n){if(n&&!0===n.global)return n.global=!1,Math.random=t.exports(e,n),n.global=!0,Math.random;var u=[],l=(d(function t(e,n){var r,a=[],i=(typeof e)[0];if(n&&"o"==i)for(r in e)try{a.push(t(e[r],n-1))}catch(o){}return a.length?a:"s"==i?e:e+"\0"}(n&&n.entropy||!1?[e,m(a)]:0 in arguments?e:function(t){try{return i.crypto.getRandomValues(t=new Uint8Array(r)),m(t)}catch(e){return[+new Date,i,i.navigator&&i.navigator.plugins,i.screen,m(a)]}}(),3),u),new p(u));return d(m(l.S),a),function(){for(var t=l.g(6),e=o,n=0;t<c;)t=(t+n)*r,e*=r,n=l.g(1);for(;t>=s;)t/=2,e/=2,n>>>=1;return(t+n)/e}},t.exports.resetGlobal=function(){Math.random=l},d(Math.random(),a)},794:function(t,e,n){"use strict";n.r(e);var r=n(10),a=n.n(r),i=(n(773),n(107)),o=n.n(i),c=n(108),s=n.n(c),u=n(528),l=n.n(u),p=n(527),d=n.n(p),m=n(531),f=n.n(m),h=n(529),g=n.n(h),v=n(34),b=n.n(v),y=n(109),O=n(35),_=function(t){window.location.reload(!0),t({type:"STRIPE_CONNECT_ACCOUNT_RELOAD_PAGE"})},N=n(1),j=n(12),E=n.n(j),A=n(542),w=n(530),D=n.n(w),C=n(533),I=n.n(C),z=n(526),U=n.n(z),k=function(t){function e(){var t,n;o()(this,e);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=l()(this,(t=d()(e)).call.apply(t,[this].concat(a))),b()(f()(n),"state",{isError:!1}),b()(f()(n),"handleError",function(){n.setState({isError:!0})}),n}return g()(e,t),s()(e,[{key:"componentWillReceiveProps",value:function(t){t.src!==this.props.src&&this.setState({isError:!1})}},{key:"render",value:function(){var t=this.props,e=t.className,n=I()(t,["className"]),r=U()(e,{image:!0,"is-error":this.state.isError});return a.a.createElement("img",D()({onError:this.handleError,className:r},n))}}]),e}(r.Component);b()(k,"defaultProps",{className:""});var R,T=n(648),x=n(779),S=n.n(x);R="object"===typeof location?new RegExp("^(/(?!/)|data:image/[^;]+;|blob:".concat(location.origin,"/)")):/^(\/(?!\/)|data:image\/[^;]+;)/;var L=/^([-a-zA-Z0-9_]+\.)*(gravatar\.com|wordpress\.com|wp\.com|a8c\.com)$/;var q=/^https?:$/,M=Object(N.get)(window,"devicePixelRatio",1)>1?2:1,P=["w","h","resize","fit","s"],W={photon:/(^[is]\d\.wp\.com|(^|\.)wordpress\.com)$/,gravatar:/(^|\.)gravatar\.com$/},V=function(t){return t*M};function $(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if("string"!==typeof t)return t;var a=Object(T.parse)(t,!0,!0);if(!q.test(a.protocol))return t;if(!a.hostname)return t;a.query=Object(N.omit)(a.query,P);var i=Object(N.findKey)(W,String.prototype.match.bind(a.hostname));return"number"===typeof e&&(e="gravatar"===i?{s:e}:n>0?{fit:[e,n].join()}:{w:e}),!i&&r?$(function(t){if("string"!==typeof t)return null;if(R.test(t))return t;var e=Object(T.parse)(t,!1,!0),n=e.hostname,r=e.path,a=e.query;return L.test(n)?t.replace(/^http:/,"https:"):a&&a.length>0?null:Object(N.endsWith)(r,".svg")?null:S()(t)}(t),e,null,!1):(Object(N.assign)(a.query,Object(N.mapValues)(e,function(t,e){return"resize"===e||"fit"===e?t.split(",").map(V).join(","):Object(N.includes)(P,e)?V(t):t})),delete a.search,Object(T.format)(a))}var G=function(t){function e(){var t,n;o()(this,e);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return n=l()(this,(t=d()(e)).call.apply(t,[this].concat(i))),b()(f()(n),"renderLogo",function(){var t=n.props.stripeConnectAccount.logo,e=null;return Object(N.isEmpty)(t)||(e=a.a.createElement(k,{src:$(t,{w:40,h:40}),className:"stripe__connect-account-logo"})),a.a.createElement("div",{className:"stripe__connect-account-logo-container"},e)}),b()(f()(n),"renderNameAndEmail",function(){var t=n.props.stripeConnectAccount,e=t.displayName,r=t.email,i=t.firstName,o=t.lastName,c=Object(N.isEmpty)(e)?"".concat(i," ").concat(o):e;return a.a.createElement("div",{className:"stripe__connect-account-details"},a.a.createElement("span",{className:"stripe__connect-account-name"},a.a.createElement("span",{className:"stripe__connect-account-name"},c),a.a.createElement("span",{className:"stripe__connect-account-email"},r)))}),b()(f()(n),"onDeauthorize",function(t){t.preventDefault(),n.props.onDeauthorize()}),b()(f()(n),"renderStatus",function(){var t=n.props,e=t.isDeauthorizing,r=t.stripeConnectAccount,i=t.translate,o=null,c=null;return o=r.isActivated?a.a.createElement("span",{className:"stripe__connect-account-status account-activated"},i("Activated")):a.a.createElement("span",{className:"stripe__connect-account-status account-not-activated"},i("Check email to activate account")),c=e?a.a.createElement("span",{className:"stripe__connect-account-disconnect"},i("Disconnecting")):a.a.createElement(A.a,{borderless:!0,className:"stripe__connect-account-disconnect",onClick:n.onDeauthorize},i("Disconnect")),a.a.createElement("div",null,o,c)}),b()(f()(n),"render",function(){var t=n.props.translate;return a.a.createElement("div",{className:"stripe__connect-account"},a.a.createElement("h3",{className:"stripe__connect-account-heading"},t("Stripe account")),a.a.createElement("div",{className:"stripe__connect-account-body"},n.renderLogo(),a.a.createElement("div",{className:"stripe__connect-account-details"},n.renderNameAndEmail(),n.renderStatus())))}),n}return g()(e,t),e}(r.Component);b()(G,"propTypes",{stripeConnectAccount:E.a.shape({displayName:E.a.string,email:E.a.string,firstName:E.a.string,isActivated:E.a.bool,lastName:E.a.string,logo:E.a.string}),isDeauthorizing:E.a.bool.isRequired,onDeauthorize:E.a.func.isRequired});var X=Object(O.localize)(G),J=n(553),K=n(532),Y=function(t,e){return Object(N.get)(t,["extensions","woocommerce","sites",e,"settings","stripeConnectAccount"],{})};function Z(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(K.a)(t);return Object(N.get)(Y(t,e),["error"],"")}function F(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(K.a)(t);return Object(N.get)(Y(t,e),["isDeauthorizing"],!1)}function B(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(K.a)(t);return Object(N.get)(Y(t,e),["oauthUrl"],"")}function H(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(K.a)(t);return Object(N.get)(Y(t,e),["isRequesting"],!1)}var Q=n(535),tt=n(561),et=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return function(r,a){var i=a();t||(t=Object(K.a)(i));var o={type:Q.W,siteId:t};return r(o),Object(tt.a)(t).get("connect/stripe/account","wc/v1").then(function(n){r(function(t,e,n){var r=n.account_id,a=n.display_name,i=n.email,o=n.business_logo,c=n.legal_entity,s=n.payouts_enabled;return{type:Q.X,connectedUserID:r,displayName:a,email:i,firstName:c.first_name,isActivated:s,logo:o,lastName:c.last_name,siteId:t}}(t,0,n)),e&&r(e(t,o,n))}).catch(function(e){r(function(t,e,n){var r=n.message;return{type:Q.X,error:r,siteId:t}}(t,0,e)),n&&r(n(e))})}};var nt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return function(r,a){var i=a();t||(t=Object(K.a)(i));var o={type:Q.U,siteId:t};return r(o),Object(tt.a)(t).post("connect/stripe/account/deauthorize",{},"wc/v1").then(function(n){r(function(t,e,n){return{type:Q.V,siteId:t}}(t)),e&&r(e(t,o,n))}).catch(function(e){r(function(t,e,n){return{type:Q.V,error:n,siteId:t}}(t,0,e)),n&&r(n(e))})}};var rt=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return function(a,i){var o=i();t||(t=Object(K.a)(o));var c={type:Q.ab,returnUrl:e,siteId:t};return a(c),Object(tt.a)(t).post("connect/stripe/oauth/init",{returnUrl:e},"wc/v1").then(function(e){a(function(t,e,n){var r=n.oauthUrl;return{type:Q.bb,oauthUrl:r,siteId:t}}(t,0,e)),n&&a(n(t,c,e))}).catch(function(e){a(function(t,e,n){var r=n.message;return{type:Q.bb,error:r,siteId:t}}(t,0,e)),r&&a(r(t,c,e))})}};var at,it=function(t){function e(){var t,n;o()(this,e);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=l()(this,(t=d()(e)).call.apply(t,[this].concat(a))),b()(f()(n),"onDeauthorize",function(){var t=n.props.siteId;n.props.deauthorizeAccount(t)}),n}return g()(e,t),s()(e,[{key:"componentDidMount",value:function(){var t=this.props.siteId;this.props.fetchAccountDetails(t)}},{key:"componentDidUpdate",value:function(t){var e=this.props,n=e.siteId,r=e.isLoading,a=e.connectedUserID,i=e.oauthURL,o=e.isOAuthInitializing,c=e.stripeError,s=!o&&t.isOAuthInitializing&&c;r||!t.isLoading||a||i||s||this.props.oauthInit(n)}},{key:"render",value:function(){var t=this.props,e=t.isLoading,n=t.stripeConnectAccount,r=t.stripeError,i=t.isDeauthorizing,o=t.isReloading,c=t.oauthURL,s=t.translate;return e?a.a.createElement("div",{className:"stripe-connect-account__placeholder-container"},a.a.createElement("div",{className:"stripe-connect-account__placeholder-body"})):o?a.a.createElement(J.a,{showDismiss:!1,isCompact:!0,isLoading:!0},s("Account disconnected. Reloading page\u2026")):c?s("You\u2019ve got WooCommerce Tax installed. If you\u2019d like, we can automatically copy keys from your Stripe account for you. {{a}}Click here{{/a}} to connect your Stripe account using WooCommerce Tax.",{components:{a:a.a.createElement("a",{href:c})}}):r||a.a.createElement(X,{stripeConnectAccount:n,isDeauthorizing:i,onDeauthorize:this.onDeauthorize})}}]),e}(r.Component),ot=Object(y.b)(function(t){var e=Object(K.a)(t),n=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(K.a)(t),n=Y(t,e);return Object(N.omit)(n,["error","isDeauthorizing","isOAuthConnecting","isOAuthInitializing","isRequesting","oauthUrl","notifyCompleted"])}(t,e),r=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(K.a)(t);return Object(N.get)(Y(t,e),["isOAuthInitializing"],!1)}(t,e);return{siteId:e,isLoading:H(t,e)||r,isOAuthInitializing:r,stripeConnectAccount:n,stripeError:Z(t,e),connectedUserID:n.connectedUserID,isDeauthorizing:F(t,e),isReloading:t.isReloading,oauthURL:B(t,e)}},function(t){return{fetchAccountDetails:function(e){return t(et(e))},deauthorizeAccount:function(e){t(nt(e)).then(function(){t(_)})},oauthInit:function(e){return t(rt(e))}}})(Object(O.localize)(it)),ct=n(46);var st=Object(ct.b)(null,(at={},b()(at,Q.S,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign({},t,{notifyCompleted:!1})}),b()(at,Q.T,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign({},t,{error:""})}),b()(at,Q.U,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign({},t,{isDeauthorizing:!0})}),b()(at,Q.V,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return Object.assign({},t,{connectedUserID:"",displayName:"",email:"",error:e.error||"",firstName:"",isActivated:!1,isDeauthorizing:!1,isRequesting:!1,lastName:"",logo:""})}),b()(at,Q.W,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign({},t,{connectedUserID:"",displayName:"",email:"",error:"",firstName:"",isActivated:!1,isDeauthorizing:!1,isRequesting:!0,lastName:"",logo:""})}),b()(at,Q.X,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return Object.assign({},t,{connectedUserID:e.connectedUserID||"",displayName:e.displayName||"",email:e.email||"",error:e.error||"",firstName:e.firstName||"",isActivated:e.isActivated||!1,isDeauthorizing:!1,isRequesting:!1,lastName:e.lastName||"",logo:e.logo||""})}),b()(at,Q.ab,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign({},t,{isOAuthInitializing:!0,oauthUrl:""})}),b()(at,Q.bb,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return Object.assign({},t,{isOAuthInitializing:!1,error:e.error||"",oauthUrl:e.oauthUrl||""})}),b()(at,Q.Y,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign({},t,{error:"",isOAuthConnecting:!0,notifyCompleted:!1})}),b()(at,Q.Z,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return Object.assign({},t,{connectedUserID:e.connectedUserID||"",email:"",error:e.error||"",firstName:"",isActivated:!1,isCreating:!1,isOAuthConnecting:!1,isRequesting:!1,lastName:"",logo:"",notifyCompleted:!0})}),at));e.default=function(){return{getReducer:function(){return Object(ct.a)({extensions:Object(ct.a)({woocommerce:Object(ct.a)({sites:Object(ct.a)({1:Object(ct.a)({settings:Object(ct.a)({stripeConnectAccount:st})})})})}),ui:function(){return{selectedSiteId:1}},isReloading:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=(arguments.length>1?arguments[1]:void 0).type;return t||"STRIPE_CONNECT_ACCOUNT_RELOAD_PAGE"===e}})},getInitialState:function(){return{}},getStateForPersisting:function(){return null},getStateKey:function(){return"wcs-stripe-connect-account"},View:function(){return a.a.createElement(ot,null)}}}}}]);
|
dist/images/224d57e46d3ace2d89e5c790bd828d32.png
ADDED
Binary file
|
dist/images/41e119813ea7cd89e927349d8d4ad824.png
DELETED
Binary file
|
dist/{woocommerce-services-1.24.3.css → woocommerce-services-1.25.0.css}
RENAMED
File without changes
|
dist/{woocommerce-services-1.24.3.js → woocommerce-services-1.25.0.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
!function(e){function t(t){for(var n,r,o=t[0],a=t[1],u=0,s=[];u<o.length;u++)r=o[u],Object.prototype.hasOwnProperty.call(i,r)&&i[r]&&s.push(i[r][0]),i[r]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(c&&c(t);s.length;)s.shift()()}var n={},r={141:0},i={141:0};function o(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.e=function(e){var t=[];r[e]?t.push(r[e]):0!==r[e]&&{2:1,137:1,145:1,146:1,147:1,148:1,149:1,150:1,152:1,153:1,154:1}[e]&&t.push(r[e]=new Promise(function(t,n){for(var r="chunks/"+{0:"567f79f890201df88608",1:"aa1c133dc549528a6091",2:"a04337d434f25a5b0b35",3:"437fc9a2bddc58112977",4:"125a150e37bf0a3838ae",5:"3b3bc2cd7919fd031f11",6:"50738da33d1bd3a21c55",7:"8ac0ca44edf7a672086b",8:"521d33b23834ea0dcfe8",9:"e4f6be2d4f24e3282871",10:"5d1352651b0de8a93ae3",11:"37a5cbed058fcd6660d6",12:"e8711ad491e8602a60f0",13:"517cdea07f00749464f2",14:"343940bba60355c0a687",15:"e07d363b3154e90012c8",16:"70830fbe9f9ee930682c",17:"4446dd273d23835c347d",18:"371ce2bdb0a07bd54e38",19:"188fdacea4b0af7baed9",20:"d88e158c1b80f47ad987",21:"b835c9c123fb311b67a2",22:"e537b25af26cd7d4951a",23:"dd7399ad6e4242c37022",24:"9a0433839ef7f9508c27",25:"21324fb2aa4841c04471",26:"47f15889fb1b8409b352",27:"742a17a9ee5d5d3aed78",28:"805a8a14ba23026cd51f",29:"cff0fc8d0f0774cf7b40",30:"99308b32da914605a586",31:"2a6ec298b5d6e944b601",32:"14920103e568561ad30c",33:"7e7e559b571f5c9b6109",34:"b3ff53cb0e9651f5f959",35:"818a0926c1e01f15da16",36:"f6a703dc74799298e5ab",37:"1122ab88c137c897966a",38:"5c8b2dc9fb77a27fbda8",39:"f54f525cc5fb3f7afe8c",40:"13bfb639da950ae6a06c",41:"96c822a9c45316ed14e6",42:"cf065408a0ac6438ce80",43:"4e8b2c06a616dcdb0c7c",44:"37590eaa748511a07fe1",45:"247af6a4b3dd0dae2e54",46:"6296a61ebd5d0b3fcb6c",47:"f011d43cc05880dbd369",48:"3782a6529a6cd9c858f3",49:"84c92efb73abeeed13df",50:"126c11cbf2b1c9c3bee0",51:"8129fe0dcea86086d590",52:"1a20efdd44179ad3ba7f",53:"e42b5f27410a1d24b3fc",54:"28d565a933eb0bb8a893",55:"69e994a62024e72e2e87",56:"ea5a75edea7538acf6fe",57:"e6fa5e4f8ee63d2aa7f8",58:"24c9f083132e20c16885",59:"6c24a49e15c6027b17df",60:"6b5990c827328d2dbc8c",61:"c70ea0a397c0ff0f15a1",62:"d29a186b7961cd87599d",63:"4635feffc72460b4e1e8",64:"908e5187815697cafb23",65:"5ab555460947d0199024",66:"62bbd7c68c143225c465",67:"d82b1d9b8542e18cfdef",68:"285d39bf40a436eafc93",69:"6f93555a0e25fd37c588",70:"79f9ee86d95edc25853b",71:"033eadf1d66420481328",72:"047ab7961a532f3256fd",73:"78df7fbdc10f049f803c",74:"1446ea7c5de38f8beed2",75:"b1b22dbc5802ab15141f",76:"d31b094c312b77b97d4e",77:"9cf88c461308f96e97db",78:"d6c25910a53b218c4085",79:"7720b9b8ac3efcaa6e2b",80:"182c45dc200499d22421",81:"a374140e2dcb48d70c82",82:"9bef3eea7b9428f76394",83:"529edecbb7fe732a02cd",84:"aa161c5685a869070058",85:"ff65712031b800423893",86:"18a4dc23236ad016d5ec",87:"b7bad11e1027ac49e15e",88:"e9c92fec800d64e8f774",89:"5421d8c46fe984ea115b",90:"73fc1d797dc2676a6f6a",91:"af1b497ba572d071c623",92:"d6f4549ffb227e0e42a3",93:"54140e30788fbbce2ef6",94:"aa58764eb76568c7cbc6",95:"2a6051b3e0cee3b3c81b",96:"996ec02ebbe6a3e0a5af",97:"138f70fe5cce7fa1434d",98:"9a04a5d06056e614adaf",99:"4d1746d3b12130856f8f",100:"abd571d39af4f399ef62",101:"a8c48a1eb5c1e96a9f93",102:"3f6d5c101571384084f5",103:"da55a4f26669eba5b643",104:"d6d6065753d65c7605c3",105:"7d8cc2c63e59ac6f079f",106:"afc974c8b2f5798bce1a",107:"a63c5e54c28f11124969",108:"d856bb2c39f447fc163d",109:"550241a33f7d8c1c1f3a",110:"e90ed90d8e4394657a4e",111:"3fb5c11028cc9c2ef5c6",112:"9501c228621dafbedadb",113:"8967c9b415c082ce89c4",114:"11189975a4f17fc8c87e",115:"678a4e2df91833b2d77c",116:"da9347f3cf49ae358fc5",117:"2e0584414cd2ed2b843a",118:"f4c937368dfc0c4dbe1a",119:"17c242274d7f88eab19f",120:"2b572e61676d01a9192a",121:"84f3aace790560ca8865",122:"3d7e50bc5bff76fd0614",123:"656b6d20a370f9c58375",124:"ec7572e5f4b47045e7cf",125:"5912cd9724aff6ff02c5",126:"8d4e61141ee7a849c179",127:"e50d081d18fbaae98486",128:"411e9c4ae2bcc98fdc5c",129:"399c98696fc4ebb4db0d",130:"00744c826f46786f109b",131:"dfa952cc5fae64b6eaf2",132:"c6d69fbef1612388d23c",133:"02c5956cdd7c774f868d",134:"e78f7e2590216524f687",135:"fc6d6fac5bd37ddf1248",136:"7baea95ca46eed3f7db8",137:"3409d8ed5dc61cf56042",138:"7b74a426ce1663cc47e5",139:"46fbde408db6dccfb3e8",140:"91cf8439613f79fcd01a",145:"4ac1c307f4052717e1a8",146:"3ea9563c44a821018d8f",147:"295a2240a399d69fb7e8",148:"8d827ef9f423b897385e",149:"bcadb68537fa6f7b8eb8",150:"9361dfeb2d6b6e27d9a4",151:"0f9170d994b13d5bd678",152:"55d86b44c8592d62c9ba",153:"d99a250da0e3b29ee6dd",154:"e00b4c31a2566d6025f4",155:"4849b73a2a623d66a1e0"}[e]+".css",i=o.p+r,a=document.getElementsByTagName("link"),u=0;u<a.length;u++){var s=(l=a[u]).getAttribute("data-href")||l.getAttribute("href");if("stylesheet"===l.rel&&(s===r||s===i))return t()}var c=document.getElementsByTagName("style");for(u=0;u<c.length;u++){var l;if((s=(l=c[u]).getAttribute("data-href"))===r||s===i)return t()}var f=document.createElement("link");f.rel="stylesheet",f.type="text/css",f.onload=t,f.onerror=function(t){var r=t&&t.target&&t.target.src||i,o=new Error("Loading CSS chunk "+e+" failed.\n("+r+")");o.request=r,n(o)},f.href=i,document.getElementsByTagName("head")[0].appendChild(f)}).then(function(){r[e]=0}));var n=i[e];if(0!==n)if(n)t.push(n[2]);else{var a=new Promise(function(t,r){n=i[e]=[t,r]});t.push(n[2]=a);var u,s=document.createElement("script");s.charset="utf-8",s.timeout=120,o.nc&&s.setAttribute("nonce",o.nc),s.src=function(e){return o.p+"chunks/"+{0:"567f79f890201df88608",1:"aa1c133dc549528a6091",2:"a04337d434f25a5b0b35",3:"437fc9a2bddc58112977",4:"125a150e37bf0a3838ae",5:"3b3bc2cd7919fd031f11",6:"50738da33d1bd3a21c55",7:"8ac0ca44edf7a672086b",8:"521d33b23834ea0dcfe8",9:"e4f6be2d4f24e3282871",10:"5d1352651b0de8a93ae3",11:"37a5cbed058fcd6660d6",12:"e8711ad491e8602a60f0",13:"517cdea07f00749464f2",14:"343940bba60355c0a687",15:"e07d363b3154e90012c8",16:"70830fbe9f9ee930682c",17:"4446dd273d23835c347d",18:"371ce2bdb0a07bd54e38",19:"188fdacea4b0af7baed9",20:"d88e158c1b80f47ad987",21:"b835c9c123fb311b67a2",22:"e537b25af26cd7d4951a",23:"dd7399ad6e4242c37022",24:"9a0433839ef7f9508c27",25:"21324fb2aa4841c04471",26:"47f15889fb1b8409b352",27:"742a17a9ee5d5d3aed78",28:"805a8a14ba23026cd51f",29:"cff0fc8d0f0774cf7b40",30:"99308b32da914605a586",31:"2a6ec298b5d6e944b601",32:"14920103e568561ad30c",33:"7e7e559b571f5c9b6109",34:"b3ff53cb0e9651f5f959",35:"818a0926c1e01f15da16",36:"f6a703dc74799298e5ab",37:"1122ab88c137c897966a",38:"5c8b2dc9fb77a27fbda8",39:"f54f525cc5fb3f7afe8c",40:"13bfb639da950ae6a06c",41:"96c822a9c45316ed14e6",42:"cf065408a0ac6438ce80",43:"4e8b2c06a616dcdb0c7c",44:"37590eaa748511a07fe1",45:"247af6a4b3dd0dae2e54",46:"6296a61ebd5d0b3fcb6c",47:"f011d43cc05880dbd369",48:"3782a6529a6cd9c858f3",49:"84c92efb73abeeed13df",50:"126c11cbf2b1c9c3bee0",51:"8129fe0dcea86086d590",52:"1a20efdd44179ad3ba7f",53:"e42b5f27410a1d24b3fc",54:"28d565a933eb0bb8a893",55:"69e994a62024e72e2e87",56:"ea5a75edea7538acf6fe",57:"e6fa5e4f8ee63d2aa7f8",58:"24c9f083132e20c16885",59:"6c24a49e15c6027b17df",60:"6b5990c827328d2dbc8c",61:"c70ea0a397c0ff0f15a1",62:"d29a186b7961cd87599d",63:"4635feffc72460b4e1e8",64:"908e5187815697cafb23",65:"5ab555460947d0199024",66:"62bbd7c68c143225c465",67:"d82b1d9b8542e18cfdef",68:"285d39bf40a436eafc93",69:"6f93555a0e25fd37c588",70:"79f9ee86d95edc25853b",71:"033eadf1d66420481328",72:"047ab7961a532f3256fd",73:"78df7fbdc10f049f803c",74:"1446ea7c5de38f8beed2",75:"b1b22dbc5802ab15141f",76:"d31b094c312b77b97d4e",77:"9cf88c461308f96e97db",78:"d6c25910a53b218c4085",79:"7720b9b8ac3efcaa6e2b",80:"182c45dc200499d22421",81:"a374140e2dcb48d70c82",82:"9bef3eea7b9428f76394",83:"529edecbb7fe732a02cd",84:"aa161c5685a869070058",85:"ff65712031b800423893",86:"18a4dc23236ad016d5ec",87:"b7bad11e1027ac49e15e",88:"e9c92fec800d64e8f774",89:"5421d8c46fe984ea115b",90:"73fc1d797dc2676a6f6a",91:"af1b497ba572d071c623",92:"d6f4549ffb227e0e42a3",93:"54140e30788fbbce2ef6",94:"aa58764eb76568c7cbc6",95:"2a6051b3e0cee3b3c81b",96:"996ec02ebbe6a3e0a5af",97:"138f70fe5cce7fa1434d",98:"9a04a5d06056e614adaf",99:"4d1746d3b12130856f8f",100:"abd571d39af4f399ef62",101:"a8c48a1eb5c1e96a9f93",102:"3f6d5c101571384084f5",103:"da55a4f26669eba5b643",104:"d6d6065753d65c7605c3",105:"7d8cc2c63e59ac6f079f",106:"afc974c8b2f5798bce1a",107:"a63c5e54c28f11124969",108:"d856bb2c39f447fc163d",109:"550241a33f7d8c1c1f3a",110:"e90ed90d8e4394657a4e",111:"3fb5c11028cc9c2ef5c6",112:"9501c228621dafbedadb",113:"8967c9b415c082ce89c4",114:"11189975a4f17fc8c87e",115:"678a4e2df91833b2d77c",116:"da9347f3cf49ae358fc5",117:"2e0584414cd2ed2b843a",118:"f4c937368dfc0c4dbe1a",119:"17c242274d7f88eab19f",120:"2b572e61676d01a9192a",121:"84f3aace790560ca8865",122:"3d7e50bc5bff76fd0614",123:"656b6d20a370f9c58375",124:"ec7572e5f4b47045e7cf",125:"5912cd9724aff6ff02c5",126:"8d4e61141ee7a849c179",127:"e50d081d18fbaae98486",128:"411e9c4ae2bcc98fdc5c",129:"399c98696fc4ebb4db0d",130:"00744c826f46786f109b",131:"dfa952cc5fae64b6eaf2",132:"c6d69fbef1612388d23c",133:"02c5956cdd7c774f868d",134:"e78f7e2590216524f687",135:"fc6d6fac5bd37ddf1248",136:"7baea95ca46eed3f7db8",137:"3409d8ed5dc61cf56042",138:"7b74a426ce1663cc47e5",139:"46fbde408db6dccfb3e8",140:"91cf8439613f79fcd01a",145:"4ac1c307f4052717e1a8",146:"3ea9563c44a821018d8f",147:"295a2240a399d69fb7e8",148:"8d827ef9f423b897385e",149:"bcadb68537fa6f7b8eb8",150:"9361dfeb2d6b6e27d9a4",151:"0f9170d994b13d5bd678",152:"55d86b44c8592d62c9ba",153:"d99a250da0e3b29ee6dd",154:"e00b4c31a2566d6025f4",155:"4849b73a2a623d66a1e0"}[e]+".min.js"}(e);var c=new Error;u=function(t){s.onerror=s.onload=null,clearTimeout(l);var n=i[e];if(0!==n){if(n){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;c.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",c.name="ChunkLoadError",c.type=r,c.request=o,n[1](c)}i[e]=void 0}};var l=setTimeout(function(){u({type:"timeout",target:s})},12e4);s.onerror=s.onload=u,document.head.appendChild(s)}return Promise.all(t)},o.m=e,o.c=n,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o.oe=function(e){throw console.error(e),e};var a=window.webpackJsonp=window.webpackJsonp||[],u=a.push.bind(a);a.push=t,a=a.slice();for(var s=0;s<a.length;s++)t(a[s]);var c=u;o(o.s=165)}([function(e,t,n){var r=n(2),i=n(31),o=n(15),a=n(13),u=n(21),s=function(e,t,n){var c,l,f,d,p=e&s.F,h=e&s.G,b=e&s.S,m=e&s.P,y=e&s.B,v=h?r:b?r[t]||(r[t]={}):(r[t]||{}).prototype,g=h?i:i[t]||(i[t]={}),A=g.prototype||(g.prototype={});for(c in h&&(n=t),n)f=((l=!p&&v&&void 0!==v[c])?v:n)[c],d=y&&l?u(f,r):m&&"function"==typeof f?u(Function.call,f):f,v&&a(v,c,f,e&s.U),g[c]!=f&&o(g,c,d),m&&A[c]!=f&&(A[c]=f)};r.core=i,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,e.exports=s},function(e,t,n){(function(e){(function(){var n,r=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="__lodash_hash_undefined__",u=500,s="__lodash_placeholder__",c=1,l=2,f=4,d=1,p=2,h=1,b=2,m=4,y=8,v=16,g=32,A=64,_=128,w=256,M=512,O=30,S="...",E=800,T=16,x=1,z=2,k=1/0,P=9007199254740991,C=1.7976931348623157e308,N=NaN,R=4294967295,j=R-1,D=R>>>1,q=[["ary",_],["bind",h],["bindKey",b],["curry",y],["curryRight",v],["flip",M],["partial",g],["partialRight",A],["rearg",w]],W="[object Arguments]",L="[object Array]",I="[object AsyncFunction]",B="[object Boolean]",F="[object Date]",U="[object DOMException]",Y="[object Error]",X="[object Function]",H="[object GeneratorFunction]",V="[object Map]",G="[object Number]",$="[object Null]",J="[object Object]",K="[object Proxy]",Z="[object RegExp]",Q="[object Set]",ee="[object String]",te="[object Symbol]",ne="[object Undefined]",re="[object WeakMap]",ie="[object WeakSet]",oe="[object ArrayBuffer]",ae="[object DataView]",ue="[object Float32Array]",se="[object Float64Array]",ce="[object Int8Array]",le="[object Int16Array]",fe="[object Int32Array]",de="[object Uint8Array]",pe="[object Uint8ClampedArray]",he="[object Uint16Array]",be="[object Uint32Array]",me=/\b__p \+= '';/g,ye=/\b(__p \+=) '' \+/g,ve=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ge=/&(?:amp|lt|gt|quot|#39);/g,Ae=/[&<>"']/g,_e=RegExp(ge.source),we=RegExp(Ae.source),Me=/<%-([\s\S]+?)%>/g,Oe=/<%([\s\S]+?)%>/g,Se=/<%=([\s\S]+?)%>/g,Ee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Te=/^\w*$/,xe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ze=/[\\^$.*+?()[\]{}|]/g,ke=RegExp(ze.source),Pe=/^\s+|\s+$/g,Ce=/^\s+/,Ne=/\s+$/,Re=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,je=/\{\n\/\* \[wrapped with (.+)\] \*/,De=/,? & /,qe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,We=/\\(\\)?/g,Le=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ie=/\w*$/,Be=/^[-+]0x[0-9a-f]+$/i,Fe=/^0b[01]+$/i,Ue=/^\[object .+?Constructor\]$/,Ye=/^0o[0-7]+$/i,Xe=/^(?:0|[1-9]\d*)$/,He=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ve=/($^)/,Ge=/['\n\r\u2028\u2029\\]/g,$e="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Je="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ke="[\\ud800-\\udfff]",Ze="["+Je+"]",Qe="["+$e+"]",et="\\d+",tt="[\\u2700-\\u27bf]",nt="[a-z\\xdf-\\xf6\\xf8-\\xff]",rt="[^\\ud800-\\udfff"+Je+et+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",it="\\ud83c[\\udffb-\\udfff]",ot="[^\\ud800-\\udfff]",at="(?:\\ud83c[\\udde6-\\uddff]){2}",ut="[\\ud800-\\udbff][\\udc00-\\udfff]",st="[A-Z\\xc0-\\xd6\\xd8-\\xde]",ct="(?:"+nt+"|"+rt+")",lt="(?:"+st+"|"+rt+")",ft="(?:"+Qe+"|"+it+")"+"?",dt="[\\ufe0e\\ufe0f]?"+ft+("(?:\\u200d(?:"+[ot,at,ut].join("|")+")[\\ufe0e\\ufe0f]?"+ft+")*"),pt="(?:"+[tt,at,ut].join("|")+")"+dt,ht="(?:"+[ot+Qe+"?",Qe,at,ut,Ke].join("|")+")",bt=RegExp("['\u2019]","g"),mt=RegExp(Qe,"g"),yt=RegExp(it+"(?="+it+")|"+ht+dt,"g"),vt=RegExp([st+"?"+nt+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?="+[Ze,st,"$"].join("|")+")",lt+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?="+[Ze,st+ct,"$"].join("|")+")",st+"?"+ct+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?",st+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",et,pt].join("|"),"g"),gt=RegExp("[\\u200d\\ud800-\\udfff"+$e+"\\ufe0e\\ufe0f]"),At=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,_t=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],wt=-1,Mt={};Mt[ue]=Mt[se]=Mt[ce]=Mt[le]=Mt[fe]=Mt[de]=Mt[pe]=Mt[he]=Mt[be]=!0,Mt[W]=Mt[L]=Mt[oe]=Mt[B]=Mt[ae]=Mt[F]=Mt[Y]=Mt[X]=Mt[V]=Mt[G]=Mt[J]=Mt[Z]=Mt[Q]=Mt[ee]=Mt[re]=!1;var Ot={};Ot[W]=Ot[L]=Ot[oe]=Ot[ae]=Ot[B]=Ot[F]=Ot[ue]=Ot[se]=Ot[ce]=Ot[le]=Ot[fe]=Ot[V]=Ot[G]=Ot[J]=Ot[Z]=Ot[Q]=Ot[ee]=Ot[te]=Ot[de]=Ot[pe]=Ot[he]=Ot[be]=!0,Ot[Y]=Ot[X]=Ot[re]=!1;var St={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Et=parseFloat,Tt=parseInt,xt=window&&window.Object===Object&&window,zt="object"==typeof self&&self&&self.Object===Object&&self,kt=xt||zt||Function("return this")(),Pt=t&&!t.nodeType&&t,Ct=Pt&&"object"==typeof e&&e&&!e.nodeType&&e,Nt=Ct&&Ct.exports===Pt,Rt=Nt&&xt.process,jt=function(){try{var e=Ct&&Ct.require&&Ct.require("util").types;return e||Rt&&Rt.binding&&Rt.binding("util")}catch(t){}}(),Dt=jt&&jt.isArrayBuffer,qt=jt&&jt.isDate,Wt=jt&&jt.isMap,Lt=jt&&jt.isRegExp,It=jt&&jt.isSet,Bt=jt&&jt.isTypedArray;function Ft(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Ut(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function Yt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function Xt(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function Ht(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Vt(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function Gt(e,t){return!!(null==e?0:e.length)&&on(e,t,0)>-1}function $t(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Jt(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Kt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Zt(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function Qt(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function en(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var tn=cn("length");function nn(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function rn(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function on(e,t,n){return t===t?function(e,t,n){var r=n-1,i=e.length;for(;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):rn(e,un,n)}function an(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function un(e){return e!==e}function sn(e,t){var n=null==e?0:e.length;return n?dn(e,t)/n:N}function cn(e){return function(t){return null==t?n:t[e]}}function ln(e){return function(t){return null==e?n:e[t]}}function fn(e,t,n,r,i){return i(e,function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)}),n}function dn(e,t){for(var r,i=-1,o=e.length;++i<o;){var a=t(e[i]);a!==n&&(r=r===n?a:r+a)}return r}function pn(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function hn(e){return function(t){return e(t)}}function bn(e,t){return Jt(t,function(t){return e[t]})}function mn(e,t){return e.has(t)}function yn(e,t){for(var n=-1,r=e.length;++n<r&&on(t,e[n],0)>-1;);return n}function vn(e,t){for(var n=e.length;n--&&on(t,e[n],0)>-1;);return n}var gn=ln({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),An=ln({"&":"&","<":"<",">":">",'"':""","'":"'"});function _n(e){return"\\"+St[e]}function wn(e){return gt.test(e)}function Mn(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function On(e,t){return function(n){return e(t(n))}}function Sn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n];a!==t&&a!==s||(e[n]=s,o[i++]=n)}return o}function En(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function Tn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function xn(e){return wn(e)?function(e){var t=yt.lastIndex=0;for(;yt.test(e);)++t;return t}(e):tn(e)}function zn(e){return wn(e)?function(e){return e.match(yt)||[]}(e):function(e){return e.split("")}(e)}var kn=ln({"&":"&","<":"<",">":">",""":'"',"'":"'"});var Pn=function e(t){var $e=(t=null==t?kt:Pn.defaults(kt.Object(),t,Pn.pick(kt,_t))).Array,Je=t.Date,Ke=t.Error,Ze=t.Function,Qe=t.Math,et=t.Object,tt=t.RegExp,nt=t.String,rt=t.TypeError,it=$e.prototype,ot=Ze.prototype,at=et.prototype,ut=t["__core-js_shared__"],st=ot.toString,ct=at.hasOwnProperty,lt=0,ft=function(){var e=/[^.]+$/.exec(ut&&ut.keys&&ut.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),dt=at.toString,pt=st.call(et),ht=kt._,yt=tt("^"+st.call(ct).replace(ze,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gt=Nt?t.Buffer:n,St=t.Symbol,xt=t.Uint8Array,zt=gt?gt.allocUnsafe:n,Pt=On(et.getPrototypeOf,et),Ct=et.create,Rt=at.propertyIsEnumerable,jt=it.splice,tn=St?St.isConcatSpreadable:n,ln=St?St.iterator:n,Cn=St?St.toStringTag:n,Nn=function(){try{var e=Wo(et,"defineProperty");return e({},"",{}),e}catch(t){}}(),Rn=t.clearTimeout!==kt.clearTimeout&&t.clearTimeout,jn=Je&&Je.now!==kt.Date.now&&Je.now,Dn=t.setTimeout!==kt.setTimeout&&t.setTimeout,qn=Qe.ceil,Wn=Qe.floor,Ln=et.getOwnPropertySymbols,In=gt?gt.isBuffer:n,Bn=t.isFinite,Fn=it.join,Un=On(et.keys,et),Yn=Qe.max,Xn=Qe.min,Hn=Je.now,Vn=t.parseInt,Gn=Qe.random,$n=it.reverse,Jn=Wo(t,"DataView"),Kn=Wo(t,"Map"),Zn=Wo(t,"Promise"),Qn=Wo(t,"Set"),er=Wo(t,"WeakMap"),tr=Wo(et,"create"),nr=er&&new er,rr={},ir=la(Jn),or=la(Kn),ar=la(Zn),ur=la(Qn),sr=la(er),cr=St?St.prototype:n,lr=cr?cr.valueOf:n,fr=cr?cr.toString:n;function dr(e){if(Tu(e)&&!mu(e)&&!(e instanceof mr)){if(e instanceof br)return e;if(ct.call(e,"__wrapped__"))return fa(e)}return new br(e)}var pr=function(){function e(){}return function(t){if(!Eu(t))return{};if(Ct)return Ct(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function hr(){}function br(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function mr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=R,this.__views__=[]}function yr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function vr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function gr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ar(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new gr;++t<n;)this.add(e[t])}function _r(e){var t=this.__data__=new vr(e);this.size=t.size}function wr(e,t){var n=mu(e),r=!n&&bu(e),i=!n&&!r&&Au(e),o=!n&&!r&&!i&&ju(e),a=n||r||i||o,u=a?pn(e.length,nt):[],s=u.length;for(var c in e)!t&&!ct.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Xo(c,s))||u.push(c);return u}function Mr(e){var t=e.length;return t?e[Ai(0,t-1)]:n}function Or(e,t){return ua(to(e),Nr(t,0,e.length))}function Sr(e){return ua(to(e))}function Er(e,t,r){(r===n||du(e[t],r))&&(r!==n||t in e)||Pr(e,t,r)}function Tr(e,t,r){var i=e[t];ct.call(e,t)&&du(i,r)&&(r!==n||t in e)||Pr(e,t,r)}function xr(e,t){for(var n=e.length;n--;)if(du(e[n][0],t))return n;return-1}function zr(e,t,n,r){return Wr(e,function(e,i,o){t(r,e,n(e),o)}),r}function kr(e,t){return e&&no(t,rs(t),e)}function Pr(e,t,n){"__proto__"==t&&Nn?Nn(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Cr(e,t){for(var r=-1,i=t.length,o=$e(i),a=null==e;++r<i;)o[r]=a?n:Zu(e,t[r]);return o}function Nr(e,t,r){return e===e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function Rr(e,t,r,i,o,a){var u,s=t&c,d=t&l,p=t&f;if(r&&(u=o?r(e,i,o,a):r(e)),u!==n)return u;if(!Eu(e))return e;var h=mu(e);if(h){if(u=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ct.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!s)return to(e,u)}else{var b=Bo(e),m=b==X||b==H;if(Au(e))return $i(e,s);if(b==J||b==W||m&&!o){if(u=d||m?{}:Uo(e),!s)return d?function(e,t){return no(e,Io(e),t)}(e,function(e,t){return e&&no(t,is(t),e)}(u,e)):function(e,t){return no(e,Lo(e),t)}(e,kr(u,e))}else{if(!Ot[b])return o?e:{};u=function(e,t,n){var r,i=e.constructor;switch(t){case oe:return Ji(e);case B:case F:return new i(+e);case ae:return function(e,t){var n=t?Ji(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case ue:case se:case ce:case le:case fe:case de:case pe:case he:case be:return Ki(e,n);case V:return new i;case G:case ee:return new i(e);case Z:return function(e){var t=new e.constructor(e.source,Ie.exec(e));return t.lastIndex=e.lastIndex,t}(e);case Q:return new i;case te:return r=e,lr?et(lr.call(r)):{}}}(e,b,s)}}a||(a=new _r);var y=a.get(e);if(y)return y;a.set(e,u),Cu(e)?e.forEach(function(n){u.add(Rr(n,t,r,n,e,a))}):xu(e)&&e.forEach(function(n,i){u.set(i,Rr(n,t,r,i,e,a))});var v=h?n:(p?d?Po:ko:d?is:rs)(e);return Yt(v||e,function(n,i){v&&(n=e[i=n]),Tr(u,i,Rr(n,t,r,i,e,a))}),u}function jr(e,t,r){var i=r.length;if(null==e)return!i;for(e=et(e);i--;){var o=r[i],a=t[o],u=e[o];if(u===n&&!(o in e)||!a(u))return!1}return!0}function Dr(e,t,r){if("function"!=typeof e)throw new rt(o);return ra(function(){e.apply(n,r)},t)}function qr(e,t,n,i){var o=-1,a=Gt,u=!0,s=e.length,c=[],l=t.length;if(!s)return c;n&&(t=Jt(t,hn(n))),i?(a=$t,u=!1):t.length>=r&&(a=mn,u=!1,t=new Ar(t));e:for(;++o<s;){var f=e[o],d=null==n?f:n(f);if(f=i||0!==f?f:0,u&&d===d){for(var p=l;p--;)if(t[p]===d)continue e;c.push(f)}else a(t,d,i)||c.push(f)}return c}dr.templateSettings={escape:Me,evaluate:Oe,interpolate:Se,variable:"",imports:{_:dr}},dr.prototype=hr.prototype,dr.prototype.constructor=dr,br.prototype=pr(hr.prototype),br.prototype.constructor=br,mr.prototype=pr(hr.prototype),mr.prototype.constructor=mr,yr.prototype.clear=function(){this.__data__=tr?tr(null):{},this.size=0},yr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},yr.prototype.get=function(e){var t=this.__data__;if(tr){var r=t[e];return r===a?n:r}return ct.call(t,e)?t[e]:n},yr.prototype.has=function(e){var t=this.__data__;return tr?t[e]!==n:ct.call(t,e)},yr.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=tr&&t===n?a:t,this},vr.prototype.clear=function(){this.__data__=[],this.size=0},vr.prototype.delete=function(e){var t=this.__data__,n=xr(t,e);return!(n<0)&&(n==t.length-1?t.pop():jt.call(t,n,1),--this.size,!0)},vr.prototype.get=function(e){var t=this.__data__,r=xr(t,e);return r<0?n:t[r][1]},vr.prototype.has=function(e){return xr(this.__data__,e)>-1},vr.prototype.set=function(e,t){var n=this.__data__,r=xr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},gr.prototype.clear=function(){this.size=0,this.__data__={hash:new yr,map:new(Kn||vr),string:new yr}},gr.prototype.delete=function(e){var t=Do(this,e).delete(e);return this.size-=t?1:0,t},gr.prototype.get=function(e){return Do(this,e).get(e)},gr.prototype.has=function(e){return Do(this,e).has(e)},gr.prototype.set=function(e,t){var n=Do(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Ar.prototype.add=Ar.prototype.push=function(e){return this.__data__.set(e,a),this},Ar.prototype.has=function(e){return this.__data__.has(e)},_r.prototype.clear=function(){this.__data__=new vr,this.size=0},_r.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},_r.prototype.get=function(e){return this.__data__.get(e)},_r.prototype.has=function(e){return this.__data__.has(e)},_r.prototype.set=function(e,t){var n=this.__data__;if(n instanceof vr){var i=n.__data__;if(!Kn||i.length<r-1)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new gr(i)}return n.set(e,t),this.size=n.size,this};var Wr=oo(Hr),Lr=oo(Vr,!0);function Ir(e,t){var n=!0;return Wr(e,function(e,r,i){return n=!!t(e,r,i)}),n}function Br(e,t,r){for(var i=-1,o=e.length;++i<o;){var a=e[i],u=t(a);if(null!=u&&(s===n?u===u&&!Ru(u):r(u,s)))var s=u,c=a}return c}function Fr(e,t){var n=[];return Wr(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function Ur(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=Yo),i||(i=[]);++o<a;){var u=e[o];t>0&&n(u)?t>1?Ur(u,t-1,n,r,i):Kt(i,u):r||(i[i.length]=u)}return i}var Yr=ao(),Xr=ao(!0);function Hr(e,t){return e&&Yr(e,t,rs)}function Vr(e,t){return e&&Xr(e,t,rs)}function Gr(e,t){return Vt(t,function(t){return Mu(e[t])})}function $r(e,t){for(var r=0,i=(t=Xi(t,e)).length;null!=e&&r<i;)e=e[ca(t[r++])];return r&&r==i?e:n}function Jr(e,t,n){var r=t(e);return mu(e)?r:Kt(r,n(e))}function Kr(e){return null==e?e===n?ne:$:Cn&&Cn in et(e)?function(e){var t=ct.call(e,Cn),r=e[Cn];try{e[Cn]=n;var i=!0}catch(a){}var o=dt.call(e);return i&&(t?e[Cn]=r:delete e[Cn]),o}(e):function(e){return dt.call(e)}(e)}function Zr(e,t){return e>t}function Qr(e,t){return null!=e&&ct.call(e,t)}function ei(e,t){return null!=e&&t in et(e)}function ti(e,t,r){for(var i=r?$t:Gt,o=e[0].length,a=e.length,u=a,s=$e(a),c=1/0,l=[];u--;){var f=e[u];u&&t&&(f=Jt(f,hn(t))),c=Xn(f.length,c),s[u]=!r&&(t||o>=120&&f.length>=120)?new Ar(u&&f):n}f=e[0];var d=-1,p=s[0];e:for(;++d<o&&l.length<c;){var h=f[d],b=t?t(h):h;if(h=r||0!==h?h:0,!(p?mn(p,b):i(l,b,r))){for(u=a;--u;){var m=s[u];if(!(m?mn(m,b):i(e[u],b,r)))continue e}p&&p.push(b),l.push(h)}}return l}function ni(e,t,r){var i=null==(e=ea(e,t=Xi(t,e)))?e:e[ca(wa(t))];return null==i?n:Ft(i,e,r)}function ri(e){return Tu(e)&&Kr(e)==W}function ii(e,t,r,i,o){return e===t||(null==e||null==t||!Tu(e)&&!Tu(t)?e!==e&&t!==t:function(e,t,r,i,o,a){var u=mu(e),s=mu(t),c=u?L:Bo(e),l=s?L:Bo(t),f=(c=c==W?J:c)==J,h=(l=l==W?J:l)==J,b=c==l;if(b&&Au(e)){if(!Au(t))return!1;u=!0,f=!1}if(b&&!f)return a||(a=new _r),u||ju(e)?xo(e,t,r,i,o,a):function(e,t,n,r,i,o,a){switch(n){case ae:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case oe:return!(e.byteLength!=t.byteLength||!o(new xt(e),new xt(t)));case B:case F:case G:return du(+e,+t);case Y:return e.name==t.name&&e.message==t.message;case Z:case ee:return e==t+"";case V:var u=Mn;case Q:var s=r&d;if(u||(u=En),e.size!=t.size&&!s)return!1;var c=a.get(e);if(c)return c==t;r|=p,a.set(e,t);var l=xo(u(e),u(t),r,i,o,a);return a.delete(e),l;case te:if(lr)return lr.call(e)==lr.call(t)}return!1}(e,t,c,r,i,o,a);if(!(r&d)){var m=f&&ct.call(e,"__wrapped__"),y=h&&ct.call(t,"__wrapped__");if(m||y){var v=m?e.value():e,g=y?t.value():t;return a||(a=new _r),o(v,g,r,i,a)}}return!!b&&(a||(a=new _r),function(e,t,r,i,o,a){var u=r&d,s=ko(e),c=s.length,l=ko(t).length;if(c!=l&&!u)return!1;for(var f=c;f--;){var p=s[f];if(!(u?p in t:ct.call(t,p)))return!1}var h=a.get(e),b=a.get(t);if(h&&b)return h==t&&b==e;var m=!0;a.set(e,t),a.set(t,e);for(var y=u;++f<c;){p=s[f];var v=e[p],g=t[p];if(i)var A=u?i(g,v,p,t,e,a):i(v,g,p,e,t,a);if(!(A===n?v===g||o(v,g,r,i,a):A)){m=!1;break}y||(y="constructor"==p)}if(m&&!y){var _=e.constructor,w=t.constructor;_!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof _&&_ instanceof _&&"function"==typeof w&&w instanceof w)&&(m=!1)}return a.delete(e),a.delete(t),m}(e,t,r,i,o,a))}(e,t,r,i,ii,o))}function oi(e,t,r,i){var o=r.length,a=o,u=!i;if(null==e)return!a;for(e=et(e);o--;){var s=r[o];if(u&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<a;){var c=(s=r[o])[0],l=e[c],f=s[1];if(u&&s[2]){if(l===n&&!(c in e))return!1}else{var h=new _r;if(i)var b=i(l,f,c,e,t,h);if(!(b===n?ii(f,l,d|p,i,h):b))return!1}}return!0}function ai(e){return!(!Eu(e)||(t=e,ft&&ft in t))&&(Mu(e)?yt:Ue).test(la(e));var t}function ui(e){return"function"==typeof e?e:null==e?zs:"object"==typeof e?mu(e)?pi(e[0],e[1]):di(e):Ws(e)}function si(e){if(!Jo(e))return Un(e);var t=[];for(var n in et(e))ct.call(e,n)&&"constructor"!=n&&t.push(n);return t}function ci(e){if(!Eu(e))return function(e){var t=[];if(null!=e)for(var n in et(e))t.push(n);return t}(e);var t=Jo(e),n=[];for(var r in e)("constructor"!=r||!t&&ct.call(e,r))&&n.push(r);return n}function li(e,t){return e<t}function fi(e,t){var n=-1,r=vu(e)?$e(e.length):[];return Wr(e,function(e,i,o){r[++n]=t(e,i,o)}),r}function di(e){var t=qo(e);return 1==t.length&&t[0][2]?Zo(t[0][0],t[0][1]):function(n){return n===e||oi(n,e,t)}}function pi(e,t){return Vo(e)&&Ko(t)?Zo(ca(e),t):function(r){var i=Zu(r,e);return i===n&&i===t?Qu(r,e):ii(t,i,d|p)}}function hi(e,t,r,i,o){e!==t&&Yr(t,function(a,u){if(o||(o=new _r),Eu(a))!function(e,t,r,i,o,a,u){var s=ta(e,r),c=ta(t,r),l=u.get(c);if(l)Er(e,r,l);else{var f=a?a(s,c,r+"",e,t,u):n,d=f===n;if(d){var p=mu(c),h=!p&&Au(c),b=!p&&!h&&ju(c);f=c,p||h||b?mu(s)?f=s:gu(s)?f=to(s):h?(d=!1,f=$i(c,!0)):b?(d=!1,f=Ki(c,!0)):f=[]:ku(c)||bu(c)?(f=s,bu(s)?f=Uu(s):Eu(s)&&!Mu(s)||(f=Uo(c))):d=!1}d&&(u.set(c,f),o(f,c,i,a,u),u.delete(c)),Er(e,r,f)}}(e,t,u,r,hi,i,o);else{var s=i?i(ta(e,u),a,u+"",e,t,o):n;s===n&&(s=a),Er(e,u,s)}},is)}function bi(e,t){var r=e.length;if(r)return Xo(t+=t<0?r:0,r)?e[t]:n}function mi(e,t,n){t=t.length?Jt(t,function(e){return mu(e)?function(t){return $r(t,1===e.length?e[0]:e)}:e}):[zs];var r=-1;return t=Jt(t,hn(jo())),function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(fi(e,function(e,n,i){return{criteria:Jt(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,a=i.length,u=n.length;++r<a;){var s=Zi(i[r],o[r]);if(s){if(r>=u)return s;var c=n[r];return s*("desc"==c?-1:1)}}return e.index-t.index}(e,t,n)})}function yi(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],u=$r(e,a);n(u,a)&&Si(o,Xi(a,e),u)}return o}function vi(e,t,n,r){var i=r?an:on,o=-1,a=t.length,u=e;for(e===t&&(t=to(t)),n&&(u=Jt(e,hn(n)));++o<a;)for(var s=0,c=t[o],l=n?n(c):c;(s=i(u,l,s,r))>-1;)u!==e&&jt.call(u,s,1),jt.call(e,s,1);return e}function gi(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;Xo(i)?jt.call(e,i,1):qi(e,i)}}return e}function Ai(e,t){return e+Wn(Gn()*(t-e+1))}function _i(e,t){var n="";if(!e||t<1||t>P)return n;do{t%2&&(n+=e),(t=Wn(t/2))&&(e+=e)}while(t);return n}function wi(e,t){return ia(Qo(e,t,zs),e+"")}function Mi(e){return Mr(ds(e))}function Oi(e,t){var n=ds(e);return ua(n,Nr(t,0,n.length))}function Si(e,t,r,i){if(!Eu(e))return e;for(var o=-1,a=(t=Xi(t,e)).length,u=a-1,s=e;null!=s&&++o<a;){var c=ca(t[o]),l=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=u){var f=s[c];(l=i?i(f,c,s):n)===n&&(l=Eu(f)?f:Xo(t[o+1])?[]:{})}Tr(s,c,l),s=s[c]}return e}var Ei=nr?function(e,t){return nr.set(e,t),e}:zs,Ti=Nn?function(e,t){return Nn(e,"toString",{configurable:!0,enumerable:!1,value:Es(t),writable:!0})}:zs;function xi(e){return ua(ds(e))}function zi(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=$e(i);++r<i;)o[r]=e[r+t];return o}function ki(e,t){var n;return Wr(e,function(e,r,i){return!(n=t(e,r,i))}),!!n}function Pi(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t===t&&i<=D){for(;r<i;){var o=r+i>>>1,a=e[o];null!==a&&!Ru(a)&&(n?a<=t:a<t)?r=o+1:i=o}return i}return Ci(e,t,zs,n)}function Ci(e,t,r,i){var o=0,a=null==e?0:e.length;if(0===a)return 0;for(var u=(t=r(t))!==t,s=null===t,c=Ru(t),l=t===n;o<a;){var f=Wn((o+a)/2),d=r(e[f]),p=d!==n,h=null===d,b=d===d,m=Ru(d);if(u)var y=i||b;else y=l?b&&(i||p):s?b&&p&&(i||!h):c?b&&p&&!h&&(i||!m):!h&&!m&&(i?d<=t:d<t);y?o=f+1:a=f}return Xn(a,j)}function Ni(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n],u=t?t(a):a;if(!n||!du(u,s)){var s=u;o[i++]=0===a?0:a}}return o}function Ri(e){return"number"==typeof e?e:Ru(e)?N:+e}function ji(e){if("string"==typeof e)return e;if(mu(e))return Jt(e,ji)+"";if(Ru(e))return fr?fr.call(e):"";var t=e+"";return"0"==t&&1/e==-k?"-0":t}function Di(e,t,n){var i=-1,o=Gt,a=e.length,u=!0,s=[],c=s;if(n)u=!1,o=$t;else if(a>=r){var l=t?null:wo(e);if(l)return En(l);u=!1,o=mn,c=new Ar}else c=t?[]:s;e:for(;++i<a;){var f=e[i],d=t?t(f):f;if(f=n||0!==f?f:0,u&&d===d){for(var p=c.length;p--;)if(c[p]===d)continue e;t&&c.push(d),s.push(f)}else o(c,d,n)||(c!==s&&c.push(d),s.push(f))}return s}function qi(e,t){return null==(e=ea(e,t=Xi(t,e)))||delete e[ca(wa(t))]}function Wi(e,t,n,r){return Si(e,t,n($r(e,t)),r)}function Li(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?zi(e,r?0:o,r?o+1:i):zi(e,r?o+1:0,r?i:o)}function Ii(e,t){var n=e;return n instanceof mr&&(n=n.value()),Zt(t,function(e,t){return t.func.apply(t.thisArg,Kt([e],t.args))},n)}function Bi(e,t,n){var r=e.length;if(r<2)return r?Di(e[0]):[];for(var i=-1,o=$e(r);++i<r;)for(var a=e[i],u=-1;++u<r;)u!=i&&(o[i]=qr(o[i]||a,e[u],t,n));return Di(Ur(o,1),t,n)}function Fi(e,t,r){for(var i=-1,o=e.length,a=t.length,u={};++i<o;){var s=i<a?t[i]:n;r(u,e[i],s)}return u}function Ui(e){return gu(e)?e:[]}function Yi(e){return"function"==typeof e?e:zs}function Xi(e,t){return mu(e)?e:Vo(e,t)?[e]:sa(Yu(e))}var Hi=wi;function Vi(e,t,r){var i=e.length;return r=r===n?i:r,!t&&r>=i?e:zi(e,t,r)}var Gi=Rn||function(e){return kt.clearTimeout(e)};function $i(e,t){if(t)return e.slice();var n=e.length,r=zt?zt(n):new e.constructor(n);return e.copy(r),r}function Ji(e){var t=new e.constructor(e.byteLength);return new xt(t).set(new xt(e)),t}function Ki(e,t){var n=t?Ji(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Zi(e,t){if(e!==t){var r=e!==n,i=null===e,o=e===e,a=Ru(e),u=t!==n,s=null===t,c=t===t,l=Ru(t);if(!s&&!l&&!a&&e>t||a&&u&&c&&!s&&!l||i&&u&&c||!r&&c||!o)return 1;if(!i&&!a&&!l&&e<t||l&&r&&o&&!i&&!a||s&&r&&o||!u&&o||!c)return-1}return 0}function Qi(e,t,n,r){for(var i=-1,o=e.length,a=n.length,u=-1,s=t.length,c=Yn(o-a,0),l=$e(s+c),f=!r;++u<s;)l[u]=t[u];for(;++i<a;)(f||i<o)&&(l[n[i]]=e[i]);for(;c--;)l[u++]=e[i++];return l}function eo(e,t,n,r){for(var i=-1,o=e.length,a=-1,u=n.length,s=-1,c=t.length,l=Yn(o-u,0),f=$e(l+c),d=!r;++i<l;)f[i]=e[i];for(var p=i;++s<c;)f[p+s]=t[s];for(;++a<u;)(d||i<o)&&(f[p+n[a]]=e[i++]);return f}function to(e,t){var n=-1,r=e.length;for(t||(t=$e(r));++n<r;)t[n]=e[n];return t}function no(e,t,r,i){var o=!r;r||(r={});for(var a=-1,u=t.length;++a<u;){var s=t[a],c=i?i(r[s],e[s],s,r,e):n;c===n&&(c=e[s]),o?Pr(r,s,c):Tr(r,s,c)}return r}function ro(e,t){return function(n,r){var i=mu(n)?Ut:zr,o=t?t():{};return i(n,e,jo(r,2),o)}}function io(e){return wi(function(t,r){var i=-1,o=r.length,a=o>1?r[o-1]:n,u=o>2?r[2]:n;for(a=e.length>3&&"function"==typeof a?(o--,a):n,u&&Ho(r[0],r[1],u)&&(a=o<3?n:a,o=1),t=et(t);++i<o;){var s=r[i];s&&e(t,s,i,a)}return t})}function oo(e,t){return function(n,r){if(null==n)return n;if(!vu(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=et(n);(t?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function ao(e){return function(t,n,r){for(var i=-1,o=et(t),a=r(t),u=a.length;u--;){var s=a[e?u:++i];if(!1===n(o[s],s,o))break}return t}}function uo(e){return function(t){var r=wn(t=Yu(t))?zn(t):n,i=r?r[0]:t.charAt(0),o=r?Vi(r,1).join(""):t.slice(1);return i[e]()+o}}function so(e){return function(t){return Zt(Ms(bs(t).replace(bt,"")),e,"")}}function co(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=pr(e.prototype),r=e.apply(n,t);return Eu(r)?r:n}}function lo(e){return function(t,r,i){var o=et(t);if(!vu(t)){var a=jo(r,3);t=rs(t),r=function(e){return a(o[e],e,o)}}var u=e(t,r,i);return u>-1?o[a?t[u]:u]:n}}function fo(e){return zo(function(t){var r=t.length,i=r,a=br.prototype.thru;for(e&&t.reverse();i--;){var u=t[i];if("function"!=typeof u)throw new rt(o);if(a&&!s&&"wrapper"==No(u))var s=new br([],!0)}for(i=s?i:r;++i<r;){var c=No(u=t[i]),l="wrapper"==c?Co(u):n;s=l&&Go(l[0])&&l[1]==(_|y|g|w)&&!l[4].length&&1==l[9]?s[No(l[0])].apply(s,l[3]):1==u.length&&Go(u)?s[c]():s.thru(u)}return function(){var e=arguments,n=e[0];if(s&&1==e.length&&mu(n))return s.plant(n).value();for(var i=0,o=r?t[i].apply(this,e):n;++i<r;)o=t[i].call(this,o);return o}})}function po(e,t,r,i,o,a,u,s,c,l){var f=t&_,d=t&h,p=t&b,m=t&(y|v),g=t&M,A=p?n:co(e);return function h(){for(var b=arguments.length,y=$e(b),v=b;v--;)y[v]=arguments[v];if(m)var _=Ro(h),w=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(y,_);if(i&&(y=Qi(y,i,o,m)),a&&(y=eo(y,a,u,m)),b-=w,m&&b<l){var M=Sn(y,_);return Ao(e,t,po,h.placeholder,r,y,M,s,c,l-b)}var O=d?r:this,S=p?O[e]:e;return b=y.length,s?y=function(e,t){for(var r=e.length,i=Xn(t.length,r),o=to(e);i--;){var a=t[i];e[i]=Xo(a,r)?o[a]:n}return e}(y,s):g&&b>1&&y.reverse(),f&&c<b&&(y.length=c),this&&this!==kt&&this instanceof h&&(S=A||co(S)),S.apply(O,y)}}function ho(e,t){return function(n,r){return function(e,t,n,r){return Hr(e,function(e,i,o){t(r,n(e),i,o)}),r}(n,e,t(r),{})}}function bo(e,t){return function(r,i){var o;if(r===n&&i===n)return t;if(r!==n&&(o=r),i!==n){if(o===n)return i;"string"==typeof r||"string"==typeof i?(r=ji(r),i=ji(i)):(r=Ri(r),i=Ri(i)),o=e(r,i)}return o}}function mo(e){return zo(function(t){return t=Jt(t,hn(jo())),wi(function(n){var r=this;return e(t,function(e){return Ft(e,r,n)})})})}function yo(e,t){var r=(t=t===n?" ":ji(t)).length;if(r<2)return r?_i(t,e):t;var i=_i(t,qn(e/xn(t)));return wn(t)?Vi(zn(i),0,e).join(""):i.slice(0,e)}function vo(e){return function(t,r,i){return i&&"number"!=typeof i&&Ho(t,r,i)&&(r=i=n),t=Lu(t),r===n?(r=t,t=0):r=Lu(r),function(e,t,n,r){for(var i=-1,o=Yn(qn((t-e)/(n||1)),0),a=$e(o);o--;)a[r?o:++i]=e,e+=n;return a}(t,r,i=i===n?t<r?1:-1:Lu(i),e)}}function go(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=Fu(t),n=Fu(n)),e(t,n)}}function Ao(e,t,r,i,o,a,u,s,c,l){var f=t&y;t|=f?g:A,(t&=~(f?A:g))&m||(t&=~(h|b));var d=[e,t,o,f?a:n,f?u:n,f?n:a,f?n:u,s,c,l],p=r.apply(n,d);return Go(e)&&na(p,d),p.placeholder=i,oa(p,e,t)}function _o(e){var t=Qe[e];return function(e,n){if(e=Fu(e),(n=null==n?0:Xn(Iu(n),292))&&Bn(e)){var r=(Yu(e)+"e").split("e");return+((r=(Yu(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var wo=Qn&&1/En(new Qn([,-0]))[1]==k?function(e){return new Qn(e)}:Rs;function Mo(e){return function(t){var n=Bo(t);return n==V?Mn(t):n==Q?Tn(t):function(e,t){return Jt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Oo(e,t,r,i,a,u,c,l){var f=t&b;if(!f&&"function"!=typeof e)throw new rt(o);var d=i?i.length:0;if(d||(t&=~(g|A),i=a=n),c=c===n?c:Yn(Iu(c),0),l=l===n?l:Iu(l),d-=a?a.length:0,t&A){var p=i,M=a;i=a=n}var O=f?n:Co(e),S=[e,t,r,i,a,p,M,u,c,l];if(O&&function(e,t){var n=e[1],r=t[1],i=n|r,o=i<(h|b|_),a=r==_&&n==y||r==_&&n==w&&e[7].length<=t[8]||r==(_|w)&&t[7].length<=t[8]&&n==y;if(!o&&!a)return e;r&h&&(e[2]=t[2],i|=n&h?0:m);var u=t[3];if(u){var c=e[3];e[3]=c?Qi(c,u,t[4]):u,e[4]=c?Sn(e[3],s):t[4]}(u=t[5])&&(c=e[5],e[5]=c?eo(c,u,t[6]):u,e[6]=c?Sn(e[5],s):t[6]),(u=t[7])&&(e[7]=u),r&_&&(e[8]=null==e[8]?t[8]:Xn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(S,O),e=S[0],t=S[1],r=S[2],i=S[3],a=S[4],!(l=S[9]=S[9]===n?f?0:e.length:Yn(S[9]-d,0))&&t&(y|v)&&(t&=~(y|v)),t&&t!=h)E=t==y||t==v?function(e,t,r){var i=co(e);return function o(){for(var a=arguments.length,u=$e(a),s=a,c=Ro(o);s--;)u[s]=arguments[s];var l=a<3&&u[0]!==c&&u[a-1]!==c?[]:Sn(u,c);return(a-=l.length)<r?Ao(e,t,po,o.placeholder,n,u,l,n,n,r-a):Ft(this&&this!==kt&&this instanceof o?i:e,this,u)}}(e,t,l):t!=g&&t!=(h|g)||a.length?po.apply(n,S):function(e,t,n,r){var i=t&h,o=co(e);return function t(){for(var a=-1,u=arguments.length,s=-1,c=r.length,l=$e(c+u),f=this&&this!==kt&&this instanceof t?o:e;++s<c;)l[s]=r[s];for(;u--;)l[s++]=arguments[++a];return Ft(f,i?n:this,l)}}(e,t,r,i);else var E=function(e,t,n){var r=t&h,i=co(e);return function t(){return(this&&this!==kt&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,r);return oa((O?Ei:na)(E,S),e,t)}function So(e,t,r,i){return e===n||du(e,at[r])&&!ct.call(i,r)?t:e}function Eo(e,t,r,i,o,a){return Eu(e)&&Eu(t)&&(a.set(t,e),hi(e,t,n,Eo,a),a.delete(t)),e}function To(e){return ku(e)?n:e}function xo(e,t,r,i,o,a){var u=r&d,s=e.length,c=t.length;if(s!=c&&!(u&&c>s))return!1;var l=a.get(e),f=a.get(t);if(l&&f)return l==t&&f==e;var h=-1,b=!0,m=r&p?new Ar:n;for(a.set(e,t),a.set(t,e);++h<s;){var y=e[h],v=t[h];if(i)var g=u?i(v,y,h,t,e,a):i(y,v,h,e,t,a);if(g!==n){if(g)continue;b=!1;break}if(m){if(!en(t,function(e,t){if(!mn(m,t)&&(y===e||o(y,e,r,i,a)))return m.push(t)})){b=!1;break}}else if(y!==v&&!o(y,v,r,i,a)){b=!1;break}}return a.delete(e),a.delete(t),b}function zo(e){return ia(Qo(e,n,ya),e+"")}function ko(e){return Jr(e,rs,Lo)}function Po(e){return Jr(e,is,Io)}var Co=nr?function(e){return nr.get(e)}:Rs;function No(e){for(var t=e.name+"",n=rr[t],r=ct.call(rr,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function Ro(e){return(ct.call(dr,"placeholder")?dr:e).placeholder}function jo(){var e=dr.iteratee||ks;return e=e===ks?ui:e,arguments.length?e(arguments[0],arguments[1]):e}function Do(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function qo(e){for(var t=rs(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Ko(i)]}return t}function Wo(e,t){var r=function(e,t){return null==e?n:e[t]}(e,t);return ai(r)?r:n}var Lo=Ln?function(e){return null==e?[]:(e=et(e),Vt(Ln(e),function(t){return Rt.call(e,t)}))}:Bs,Io=Ln?function(e){for(var t=[];e;)Kt(t,Lo(e)),e=Pt(e);return t}:Bs,Bo=Kr;function Fo(e,t,n){for(var r=-1,i=(t=Xi(t,e)).length,o=!1;++r<i;){var a=ca(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Su(i)&&Xo(a,i)&&(mu(e)||bu(e))}function Uo(e){return"function"!=typeof e.constructor||Jo(e)?{}:pr(Pt(e))}function Yo(e){return mu(e)||bu(e)||!!(tn&&e&&e[tn])}function Xo(e,t){var n=typeof e;return!!(t=null==t?P:t)&&("number"==n||"symbol"!=n&&Xe.test(e))&&e>-1&&e%1==0&&e<t}function Ho(e,t,n){if(!Eu(n))return!1;var r=typeof t;return!!("number"==r?vu(n)&&Xo(t,n.length):"string"==r&&t in n)&&du(n[t],e)}function Vo(e,t){if(mu(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Ru(e))||Te.test(e)||!Ee.test(e)||null!=t&&e in et(t)}function Go(e){var t=No(e),n=dr[t];if("function"!=typeof n||!(t in mr.prototype))return!1;if(e===n)return!0;var r=Co(n);return!!r&&e===r[0]}(Jn&&Bo(new Jn(new ArrayBuffer(1)))!=ae||Kn&&Bo(new Kn)!=V||Zn&&"[object Promise]"!=Bo(Zn.resolve())||Qn&&Bo(new Qn)!=Q||er&&Bo(new er)!=re)&&(Bo=function(e){var t=Kr(e),r=t==J?e.constructor:n,i=r?la(r):"";if(i)switch(i){case ir:return ae;case or:return V;case ar:return"[object Promise]";case ur:return Q;case sr:return re}return t});var $o=ut?Mu:Fs;function Jo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||at)}function Ko(e){return e===e&&!Eu(e)}function Zo(e,t){return function(r){return null!=r&&r[e]===t&&(t!==n||e in et(r))}}function Qo(e,t,r){return t=Yn(t===n?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=Yn(n.length-t,0),a=$e(o);++i<o;)a[i]=n[t+i];i=-1;for(var u=$e(t+1);++i<t;)u[i]=n[i];return u[t]=r(a),Ft(e,this,u)}}function ea(e,t){return t.length<2?e:$r(e,zi(t,0,-1))}function ta(e,t){if(("constructor"!==t||"function"!==typeof e[t])&&"__proto__"!=t)return e[t]}var na=aa(Ei),ra=Dn||function(e,t){return kt.setTimeout(e,t)},ia=aa(Ti);function oa(e,t,n){var r=t+"";return ia(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(Re,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Yt(q,function(n){var r="_."+n[0];t&n[1]&&!Gt(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(je);return t?t[1].split(De):[]}(r),n)))}function aa(e){var t=0,r=0;return function(){var i=Hn(),o=T-(i-r);if(r=i,o>0){if(++t>=E)return arguments[0]}else t=0;return e.apply(n,arguments)}}function ua(e,t){var r=-1,i=e.length,o=i-1;for(t=t===n?i:t;++r<t;){var a=Ai(r,o),u=e[a];e[a]=e[r],e[r]=u}return e.length=t,e}var sa=function(e){var t=au(e,function(e){return n.size===u&&n.clear(),e}),n=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(xe,function(e,n,r,i){t.push(r?i.replace(We,"$1"):n||e)}),t});function ca(e){if("string"==typeof e||Ru(e))return e;var t=e+"";return"0"==t&&1/e==-k?"-0":t}function la(e){if(null!=e){try{return st.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function fa(e){if(e instanceof mr)return e.clone();var t=new br(e.__wrapped__,e.__chain__);return t.__actions__=to(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var da=wi(function(e,t){return gu(e)?qr(e,Ur(t,1,gu,!0)):[]}),pa=wi(function(e,t){var r=wa(t);return gu(r)&&(r=n),gu(e)?qr(e,Ur(t,1,gu,!0),jo(r,2)):[]}),ha=wi(function(e,t){var r=wa(t);return gu(r)&&(r=n),gu(e)?qr(e,Ur(t,1,gu,!0),n,r):[]});function ba(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:Iu(n);return i<0&&(i=Yn(r+i,0)),rn(e,jo(t,3),i)}function ma(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var o=i-1;return r!==n&&(o=Iu(r),o=r<0?Yn(i+o,0):Xn(o,i-1)),rn(e,jo(t,3),o,!0)}function ya(e){return null!=e&&e.length?Ur(e,1):[]}function va(e){return e&&e.length?e[0]:n}var ga=wi(function(e){var t=Jt(e,Ui);return t.length&&t[0]===e[0]?ti(t):[]}),Aa=wi(function(e){var t=wa(e),r=Jt(e,Ui);return t===wa(r)?t=n:r.pop(),r.length&&r[0]===e[0]?ti(r,jo(t,2)):[]}),_a=wi(function(e){var t=wa(e),r=Jt(e,Ui);return(t="function"==typeof t?t:n)&&r.pop(),r.length&&r[0]===e[0]?ti(r,n,t):[]});function wa(e){var t=null==e?0:e.length;return t?e[t-1]:n}var Ma=wi(Oa);function Oa(e,t){return e&&e.length&&t&&t.length?vi(e,t):e}var Sa=zo(function(e,t){var n=null==e?0:e.length,r=Cr(e,t);return gi(e,Jt(t,function(e){return Xo(e,n)?+e:e}).sort(Zi)),r});function Ea(e){return null==e?e:$n.call(e)}var Ta=wi(function(e){return Di(Ur(e,1,gu,!0))}),xa=wi(function(e){var t=wa(e);return gu(t)&&(t=n),Di(Ur(e,1,gu,!0),jo(t,2))}),za=wi(function(e){var t=wa(e);return t="function"==typeof t?t:n,Di(Ur(e,1,gu,!0),n,t)});function ka(e){if(!e||!e.length)return[];var t=0;return e=Vt(e,function(e){if(gu(e))return t=Yn(e.length,t),!0}),pn(t,function(t){return Jt(e,cn(t))})}function Pa(e,t){if(!e||!e.length)return[];var r=ka(e);return null==t?r:Jt(r,function(e){return Ft(t,n,e)})}var Ca=wi(function(e,t){return gu(e)?qr(e,t):[]}),Na=wi(function(e){return Bi(Vt(e,gu))}),Ra=wi(function(e){var t=wa(e);return gu(t)&&(t=n),Bi(Vt(e,gu),jo(t,2))}),ja=wi(function(e){var t=wa(e);return t="function"==typeof t?t:n,Bi(Vt(e,gu),n,t)}),Da=wi(ka);var qa=wi(function(e){var t=e.length,r=t>1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,Pa(e,r)});function Wa(e){var t=dr(e);return t.__chain__=!0,t}function La(e,t){return t(e)}var Ia=zo(function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,o=function(t){return Cr(t,e)};return!(t>1||this.__actions__.length)&&i instanceof mr&&Xo(r)?((i=i.slice(r,+r+(t?1:0))).__actions__.push({func:La,args:[o],thisArg:n}),new br(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(n),e})):this.thru(o)});var Ba=ro(function(e,t,n){ct.call(e,n)?++e[n]:Pr(e,n,1)});var Fa=lo(ba),Ua=lo(ma);function Ya(e,t){return(mu(e)?Yt:Wr)(e,jo(t,3))}function Xa(e,t){return(mu(e)?Xt:Lr)(e,jo(t,3))}var Ha=ro(function(e,t,n){ct.call(e,n)?e[n].push(t):Pr(e,n,[t])});var Va=wi(function(e,t,n){var r=-1,i="function"==typeof t,o=vu(e)?$e(e.length):[];return Wr(e,function(e){o[++r]=i?Ft(t,e,n):ni(e,t,n)}),o}),Ga=ro(function(e,t,n){Pr(e,n,t)});function $a(e,t){return(mu(e)?Jt:fi)(e,jo(t,3))}var Ja=ro(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]});var Ka=wi(function(e,t){if(null==e)return[];var n=t.length;return n>1&&Ho(e,t[0],t[1])?t=[]:n>2&&Ho(t[0],t[1],t[2])&&(t=[t[0]]),mi(e,Ur(t,1),[])}),Za=jn||function(){return kt.Date.now()};function Qa(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,Oo(e,_,n,n,n,n,t)}function eu(e,t){var r;if("function"!=typeof t)throw new rt(o);return e=Iu(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=n),r}}var tu=wi(function(e,t,n){var r=h;if(n.length){var i=Sn(n,Ro(tu));r|=g}return Oo(e,r,t,n,i)}),nu=wi(function(e,t,n){var r=h|b;if(n.length){var i=Sn(n,Ro(nu));r|=g}return Oo(t,r,e,n,i)});function ru(e,t,r){var i,a,u,s,c,l,f=0,d=!1,p=!1,h=!0;if("function"!=typeof e)throw new rt(o);function b(t){var r=i,o=a;return i=a=n,f=t,s=e.apply(o,r)}function m(e){var r=e-l;return l===n||r>=t||r<0||p&&e-f>=u}function y(){var e=Za();if(m(e))return v(e);c=ra(y,function(e){var n=t-(e-l);return p?Xn(n,u-(e-f)):n}(e))}function v(e){return c=n,h&&i?b(e):(i=a=n,s)}function g(){var e=Za(),r=m(e);if(i=arguments,a=this,l=e,r){if(c===n)return function(e){return f=e,c=ra(y,t),d?b(e):s}(l);if(p)return Gi(c),c=ra(y,t),b(l)}return c===n&&(c=ra(y,t)),s}return t=Fu(t)||0,Eu(r)&&(d=!!r.leading,u=(p="maxWait"in r)?Yn(Fu(r.maxWait)||0,t):u,h="trailing"in r?!!r.trailing:h),g.cancel=function(){c!==n&&Gi(c),f=0,i=l=a=c=n},g.flush=function(){return c===n?s:v(Za())},g}var iu=wi(function(e,t){return Dr(e,1,t)}),ou=wi(function(e,t,n){return Dr(e,Fu(t)||0,n)});function au(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new rt(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(au.Cache||gr),n}function uu(e){if("function"!=typeof e)throw new rt(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}au.Cache=gr;var su=Hi(function(e,t){var n=(t=1==t.length&&mu(t[0])?Jt(t[0],hn(jo())):Jt(Ur(t,1),hn(jo()))).length;return wi(function(r){for(var i=-1,o=Xn(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return Ft(e,this,r)})}),cu=wi(function(e,t){var r=Sn(t,Ro(cu));return Oo(e,g,n,t,r)}),lu=wi(function(e,t){var r=Sn(t,Ro(lu));return Oo(e,A,n,t,r)}),fu=zo(function(e,t){return Oo(e,w,n,n,n,t)});function du(e,t){return e===t||e!==e&&t!==t}var pu=go(Zr),hu=go(function(e,t){return e>=t}),bu=ri(function(){return arguments}())?ri:function(e){return Tu(e)&&ct.call(e,"callee")&&!Rt.call(e,"callee")},mu=$e.isArray,yu=Dt?hn(Dt):function(e){return Tu(e)&&Kr(e)==oe};function vu(e){return null!=e&&Su(e.length)&&!Mu(e)}function gu(e){return Tu(e)&&vu(e)}var Au=In||Fs,_u=qt?hn(qt):function(e){return Tu(e)&&Kr(e)==F};function wu(e){if(!Tu(e))return!1;var t=Kr(e);return t==Y||t==U||"string"==typeof e.message&&"string"==typeof e.name&&!ku(e)}function Mu(e){if(!Eu(e))return!1;var t=Kr(e);return t==X||t==H||t==I||t==K}function Ou(e){return"number"==typeof e&&e==Iu(e)}function Su(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=P}function Eu(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Tu(e){return null!=e&&"object"==typeof e}var xu=Wt?hn(Wt):function(e){return Tu(e)&&Bo(e)==V};function zu(e){return"number"==typeof e||Tu(e)&&Kr(e)==G}function ku(e){if(!Tu(e)||Kr(e)!=J)return!1;var t=Pt(e);if(null===t)return!0;var n=ct.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&st.call(n)==pt}var Pu=Lt?hn(Lt):function(e){return Tu(e)&&Kr(e)==Z};var Cu=It?hn(It):function(e){return Tu(e)&&Bo(e)==Q};function Nu(e){return"string"==typeof e||!mu(e)&&Tu(e)&&Kr(e)==ee}function Ru(e){return"symbol"==typeof e||Tu(e)&&Kr(e)==te}var ju=Bt?hn(Bt):function(e){return Tu(e)&&Su(e.length)&&!!Mt[Kr(e)]};var Du=go(li),qu=go(function(e,t){return e<=t});function Wu(e){if(!e)return[];if(vu(e))return Nu(e)?zn(e):to(e);if(ln&&e[ln])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[ln]());var t=Bo(e);return(t==V?Mn:t==Q?En:ds)(e)}function Lu(e){return e?(e=Fu(e))===k||e===-k?(e<0?-1:1)*C:e===e?e:0:0===e?e:0}function Iu(e){var t=Lu(e),n=t%1;return t===t?n?t-n:t:0}function Bu(e){return e?Nr(Iu(e),0,R):0}function Fu(e){if("number"==typeof e)return e;if(Ru(e))return N;if(Eu(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Eu(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Pe,"");var n=Fe.test(e);return n||Ye.test(e)?Tt(e.slice(2),n?2:8):Be.test(e)?N:+e}function Uu(e){return no(e,is(e))}function Yu(e){return null==e?"":ji(e)}var Xu=io(function(e,t){if(Jo(t)||vu(t))no(t,rs(t),e);else for(var n in t)ct.call(t,n)&&Tr(e,n,t[n])}),Hu=io(function(e,t){no(t,is(t),e)}),Vu=io(function(e,t,n,r){no(t,is(t),e,r)}),Gu=io(function(e,t,n,r){no(t,rs(t),e,r)}),$u=zo(Cr);var Ju=wi(function(e,t){e=et(e);var r=-1,i=t.length,o=i>2?t[2]:n;for(o&&Ho(t[0],t[1],o)&&(i=1);++r<i;)for(var a=t[r],u=is(a),s=-1,c=u.length;++s<c;){var l=u[s],f=e[l];(f===n||du(f,at[l])&&!ct.call(e,l))&&(e[l]=a[l])}return e}),Ku=wi(function(e){return e.push(n,Eo),Ft(as,n,e)});function Zu(e,t,r){var i=null==e?n:$r(e,t);return i===n?r:i}function Qu(e,t){return null!=e&&Fo(e,t,ei)}var es=ho(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=dt.call(t)),e[t]=n},Es(zs)),ts=ho(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=dt.call(t)),ct.call(e,t)?e[t].push(n):e[t]=[n]},jo),ns=wi(ni);function rs(e){return vu(e)?wr(e):si(e)}function is(e){return vu(e)?wr(e,!0):ci(e)}var os=io(function(e,t,n){hi(e,t,n)}),as=io(function(e,t,n,r){hi(e,t,n,r)}),us=zo(function(e,t){var n={};if(null==e)return n;var r=!1;t=Jt(t,function(t){return t=Xi(t,e),r||(r=t.length>1),t}),no(e,Po(e),n),r&&(n=Rr(n,c|l|f,To));for(var i=t.length;i--;)qi(n,t[i]);return n});var ss=zo(function(e,t){return null==e?{}:function(e,t){return yi(e,t,function(t,n){return Qu(e,n)})}(e,t)});function cs(e,t){if(null==e)return{};var n=Jt(Po(e),function(e){return[e]});return t=jo(t),yi(e,n,function(e,n){return t(e,n[0])})}var ls=Mo(rs),fs=Mo(is);function ds(e){return null==e?[]:bn(e,rs(e))}var ps=so(function(e,t,n){return t=t.toLowerCase(),e+(n?hs(t):t)});function hs(e){return ws(Yu(e).toLowerCase())}function bs(e){return(e=Yu(e))&&e.replace(He,gn).replace(mt,"")}var ms=so(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),ys=so(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),vs=uo("toLowerCase");var gs=so(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()});var As=so(function(e,t,n){return e+(n?" ":"")+ws(t)});var _s=so(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),ws=uo("toUpperCase");function Ms(e,t,r){return e=Yu(e),(t=r?n:t)===n?function(e){return At.test(e)}(e)?function(e){return e.match(vt)||[]}(e):function(e){return e.match(qe)||[]}(e):e.match(t)||[]}var Os=wi(function(e,t){try{return Ft(e,n,t)}catch(r){return wu(r)?r:new Ke(r)}}),Ss=zo(function(e,t){return Yt(t,function(t){t=ca(t),Pr(e,t,tu(e[t],e))}),e});function Es(e){return function(){return e}}var Ts=fo(),xs=fo(!0);function zs(e){return e}function ks(e){return ui("function"==typeof e?e:Rr(e,c))}var Ps=wi(function(e,t){return function(n){return ni(n,e,t)}}),Cs=wi(function(e,t){return function(n){return ni(e,n,t)}});function Ns(e,t,n){var r=rs(t),i=Gr(t,r);null!=n||Eu(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=Gr(t,rs(t)));var o=!(Eu(n)&&"chain"in n)||!!n.chain,a=Mu(e);return Yt(i,function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=to(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Kt([this.value()],arguments))})}),e}function Rs(){}var js=mo(Jt),Ds=mo(Ht),qs=mo(en);function Ws(e){return Vo(e)?cn(ca(e)):function(e){return function(t){return $r(t,e)}}(e)}var Ls=vo(),Is=vo(!0);function Bs(){return[]}function Fs(){return!1}var Us=bo(function(e,t){return e+t},0),Ys=_o("ceil"),Xs=bo(function(e,t){return e/t},1),Hs=_o("floor");var Vs=bo(function(e,t){return e*t},1),Gs=_o("round"),$s=bo(function(e,t){return e-t},0);return dr.after=function(e,t){if("function"!=typeof t)throw new rt(o);return e=Iu(e),function(){if(--e<1)return t.apply(this,arguments)}},dr.ary=Qa,dr.assign=Xu,dr.assignIn=Hu,dr.assignInWith=Vu,dr.assignWith=Gu,dr.at=$u,dr.before=eu,dr.bind=tu,dr.bindAll=Ss,dr.bindKey=nu,dr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return mu(e)?e:[e]},dr.chain=Wa,dr.chunk=function(e,t,r){t=(r?Ho(e,t,r):t===n)?1:Yn(Iu(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,u=$e(qn(i/t));o<i;)u[a++]=zi(e,o,o+=t);return u},dr.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},dr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=$e(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return Kt(mu(n)?to(n):[n],Ur(t,1))},dr.cond=function(e){var t=null==e?0:e.length,n=jo();return e=t?Jt(e,function(e){if("function"!=typeof e[1])throw new rt(o);return[n(e[0]),e[1]]}):[],wi(function(n){for(var r=-1;++r<t;){var i=e[r];if(Ft(i[0],this,n))return Ft(i[1],this,n)}})},dr.conforms=function(e){return function(e){var t=rs(e);return function(n){return jr(n,e,t)}}(Rr(e,c))},dr.constant=Es,dr.countBy=Ba,dr.create=function(e,t){var n=pr(e);return null==t?n:kr(n,t)},dr.curry=function e(t,r,i){var o=Oo(t,y,n,n,n,n,n,r=i?n:r);return o.placeholder=e.placeholder,o},dr.curryRight=function e(t,r,i){var o=Oo(t,v,n,n,n,n,n,r=i?n:r);return o.placeholder=e.placeholder,o},dr.debounce=ru,dr.defaults=Ju,dr.defaultsDeep=Ku,dr.defer=iu,dr.delay=ou,dr.difference=da,dr.differenceBy=pa,dr.differenceWith=ha,dr.drop=function(e,t,r){var i=null==e?0:e.length;return i?zi(e,(t=r||t===n?1:Iu(t))<0?0:t,i):[]},dr.dropRight=function(e,t,r){var i=null==e?0:e.length;return i?zi(e,0,(t=i-(t=r||t===n?1:Iu(t)))<0?0:t):[]},dr.dropRightWhile=function(e,t){return e&&e.length?Li(e,jo(t,3),!0,!0):[]},dr.dropWhile=function(e,t){return e&&e.length?Li(e,jo(t,3),!0):[]},dr.fill=function(e,t,r,i){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&Ho(e,t,r)&&(r=0,i=o),function(e,t,r,i){var o=e.length;for((r=Iu(r))<0&&(r=-r>o?0:o+r),(i=i===n||i>o?o:Iu(i))<0&&(i+=o),i=r>i?0:Bu(i);r<i;)e[r++]=t;return e}(e,t,r,i)):[]},dr.filter=function(e,t){return(mu(e)?Vt:Fr)(e,jo(t,3))},dr.flatMap=function(e,t){return Ur($a(e,t),1)},dr.flatMapDeep=function(e,t){return Ur($a(e,t),k)},dr.flatMapDepth=function(e,t,r){return r=r===n?1:Iu(r),Ur($a(e,t),r)},dr.flatten=ya,dr.flattenDeep=function(e){return null!=e&&e.length?Ur(e,k):[]},dr.flattenDepth=function(e,t){return null!=e&&e.length?Ur(e,t=t===n?1:Iu(t)):[]},dr.flip=function(e){return Oo(e,M)},dr.flow=Ts,dr.flowRight=xs,dr.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},dr.functions=function(e){return null==e?[]:Gr(e,rs(e))},dr.functionsIn=function(e){return null==e?[]:Gr(e,is(e))},dr.groupBy=Ha,dr.initial=function(e){return null!=e&&e.length?zi(e,0,-1):[]},dr.intersection=ga,dr.intersectionBy=Aa,dr.intersectionWith=_a,dr.invert=es,dr.invertBy=ts,dr.invokeMap=Va,dr.iteratee=ks,dr.keyBy=Ga,dr.keys=rs,dr.keysIn=is,dr.map=$a,dr.mapKeys=function(e,t){var n={};return t=jo(t,3),Hr(e,function(e,r,i){Pr(n,t(e,r,i),e)}),n},dr.mapValues=function(e,t){var n={};return t=jo(t,3),Hr(e,function(e,r,i){Pr(n,r,t(e,r,i))}),n},dr.matches=function(e){return di(Rr(e,c))},dr.matchesProperty=function(e,t){return pi(e,Rr(t,c))},dr.memoize=au,dr.merge=os,dr.mergeWith=as,dr.method=Ps,dr.methodOf=Cs,dr.mixin=Ns,dr.negate=uu,dr.nthArg=function(e){return e=Iu(e),wi(function(t){return bi(t,e)})},dr.omit=us,dr.omitBy=function(e,t){return cs(e,uu(jo(t)))},dr.once=function(e){return eu(2,e)},dr.orderBy=function(e,t,r,i){return null==e?[]:(mu(t)||(t=null==t?[]:[t]),mu(r=i?n:r)||(r=null==r?[]:[r]),mi(e,t,r))},dr.over=js,dr.overArgs=su,dr.overEvery=Ds,dr.overSome=qs,dr.partial=cu,dr.partialRight=lu,dr.partition=Ja,dr.pick=ss,dr.pickBy=cs,dr.property=Ws,dr.propertyOf=function(e){return function(t){return null==e?n:$r(e,t)}},dr.pull=Ma,dr.pullAll=Oa,dr.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?vi(e,t,jo(n,2)):e},dr.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?vi(e,t,n,r):e},dr.pullAt=Sa,dr.range=Ls,dr.rangeRight=Is,dr.rearg=fu,dr.reject=function(e,t){return(mu(e)?Vt:Fr)(e,uu(jo(t,3)))},dr.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=jo(t,3);++r<o;){var a=e[r];t(a,r,e)&&(n.push(a),i.push(r))}return gi(e,i),n},dr.rest=function(e,t){if("function"!=typeof e)throw new rt(o);return wi(e,t=t===n?t:Iu(t))},dr.reverse=Ea,dr.sampleSize=function(e,t,r){return t=(r?Ho(e,t,r):t===n)?1:Iu(t),(mu(e)?Or:Oi)(e,t)},dr.set=function(e,t,n){return null==e?e:Si(e,t,n)},dr.setWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:Si(e,t,r,i)},dr.shuffle=function(e){return(mu(e)?Sr:xi)(e)},dr.slice=function(e,t,r){var i=null==e?0:e.length;return i?(r&&"number"!=typeof r&&Ho(e,t,r)?(t=0,r=i):(t=null==t?0:Iu(t),r=r===n?i:Iu(r)),zi(e,t,r)):[]},dr.sortBy=Ka,dr.sortedUniq=function(e){return e&&e.length?Ni(e):[]},dr.sortedUniqBy=function(e,t){return e&&e.length?Ni(e,jo(t,2)):[]},dr.split=function(e,t,r){return r&&"number"!=typeof r&&Ho(e,t,r)&&(t=r=n),(r=r===n?R:r>>>0)?(e=Yu(e))&&("string"==typeof t||null!=t&&!Pu(t))&&!(t=ji(t))&&wn(e)?Vi(zn(e),0,r):e.split(t,r):[]},dr.spread=function(e,t){if("function"!=typeof e)throw new rt(o);return t=null==t?0:Yn(Iu(t),0),wi(function(n){var r=n[t],i=Vi(n,0,t);return r&&Kt(i,r),Ft(e,this,i)})},dr.tail=function(e){var t=null==e?0:e.length;return t?zi(e,1,t):[]},dr.take=function(e,t,r){return e&&e.length?zi(e,0,(t=r||t===n?1:Iu(t))<0?0:t):[]},dr.takeRight=function(e,t,r){var i=null==e?0:e.length;return i?zi(e,(t=i-(t=r||t===n?1:Iu(t)))<0?0:t,i):[]},dr.takeRightWhile=function(e,t){return e&&e.length?Li(e,jo(t,3),!1,!0):[]},dr.takeWhile=function(e,t){return e&&e.length?Li(e,jo(t,3)):[]},dr.tap=function(e,t){return t(e),e},dr.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new rt(o);return Eu(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),ru(e,t,{leading:r,maxWait:t,trailing:i})},dr.thru=La,dr.toArray=Wu,dr.toPairs=ls,dr.toPairsIn=fs,dr.toPath=function(e){return mu(e)?Jt(e,ca):Ru(e)?[e]:to(sa(Yu(e)))},dr.toPlainObject=Uu,dr.transform=function(e,t,n){var r=mu(e),i=r||Au(e)||ju(e);if(t=jo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Eu(e)&&Mu(o)?pr(Pt(e)):{}}return(i?Yt:Hr)(e,function(e,r,i){return t(n,e,r,i)}),n},dr.unary=function(e){return Qa(e,1)},dr.union=Ta,dr.unionBy=xa,dr.unionWith=za,dr.uniq=function(e){return e&&e.length?Di(e):[]},dr.uniqBy=function(e,t){return e&&e.length?Di(e,jo(t,2)):[]},dr.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?Di(e,n,t):[]},dr.unset=function(e,t){return null==e||qi(e,t)},dr.unzip=ka,dr.unzipWith=Pa,dr.update=function(e,t,n){return null==e?e:Wi(e,t,Yi(n))},dr.updateWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:Wi(e,t,Yi(r),i)},dr.values=ds,dr.valuesIn=function(e){return null==e?[]:bn(e,is(e))},dr.without=Ca,dr.words=Ms,dr.wrap=function(e,t){return cu(Yi(t),e)},dr.xor=Na,dr.xorBy=Ra,dr.xorWith=ja,dr.zip=Da,dr.zipObject=function(e,t){return Fi(e||[],t||[],Tr)},dr.zipObjectDeep=function(e,t){return Fi(e||[],t||[],Si)},dr.zipWith=qa,dr.entries=ls,dr.entriesIn=fs,dr.extend=Hu,dr.extendWith=Vu,Ns(dr,dr),dr.add=Us,dr.attempt=Os,dr.camelCase=ps,dr.capitalize=hs,dr.ceil=Ys,dr.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=Fu(r))===r?r:0),t!==n&&(t=(t=Fu(t))===t?t:0),Nr(Fu(e),t,r)},dr.clone=function(e){return Rr(e,f)},dr.cloneDeep=function(e){return Rr(e,c|f)},dr.cloneDeepWith=function(e,t){return Rr(e,c|f,t="function"==typeof t?t:n)},dr.cloneWith=function(e,t){return Rr(e,f,t="function"==typeof t?t:n)},dr.conformsTo=function(e,t){return null==t||jr(e,t,rs(t))},dr.deburr=bs,dr.defaultTo=function(e,t){return null==e||e!==e?t:e},dr.divide=Xs,dr.endsWith=function(e,t,r){e=Yu(e),t=ji(t);var i=e.length,o=r=r===n?i:Nr(Iu(r),0,i);return(r-=t.length)>=0&&e.slice(r,o)==t},dr.eq=du,dr.escape=function(e){return(e=Yu(e))&&we.test(e)?e.replace(Ae,An):e},dr.escapeRegExp=function(e){return(e=Yu(e))&&ke.test(e)?e.replace(ze,"\\$&"):e},dr.every=function(e,t,r){var i=mu(e)?Ht:Ir;return r&&Ho(e,t,r)&&(t=n),i(e,jo(t,3))},dr.find=Fa,dr.findIndex=ba,dr.findKey=function(e,t){return nn(e,jo(t,3),Hr)},dr.findLast=Ua,dr.findLastIndex=ma,dr.findLastKey=function(e,t){return nn(e,jo(t,3),Vr)},dr.floor=Hs,dr.forEach=Ya,dr.forEachRight=Xa,dr.forIn=function(e,t){return null==e?e:Yr(e,jo(t,3),is)},dr.forInRight=function(e,t){return null==e?e:Xr(e,jo(t,3),is)},dr.forOwn=function(e,t){return e&&Hr(e,jo(t,3))},dr.forOwnRight=function(e,t){return e&&Vr(e,jo(t,3))},dr.get=Zu,dr.gt=pu,dr.gte=hu,dr.has=function(e,t){return null!=e&&Fo(e,t,Qr)},dr.hasIn=Qu,dr.head=va,dr.identity=zs,dr.includes=function(e,t,n,r){e=vu(e)?e:ds(e),n=n&&!r?Iu(n):0;var i=e.length;return n<0&&(n=Yn(i+n,0)),Nu(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&on(e,t,n)>-1},dr.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:Iu(n);return i<0&&(i=Yn(r+i,0)),on(e,t,i)},dr.inRange=function(e,t,r){return t=Lu(t),r===n?(r=t,t=0):r=Lu(r),function(e,t,n){return e>=Xn(t,n)&&e<Yn(t,n)}(e=Fu(e),t,r)},dr.invoke=ns,dr.isArguments=bu,dr.isArray=mu,dr.isArrayBuffer=yu,dr.isArrayLike=vu,dr.isArrayLikeObject=gu,dr.isBoolean=function(e){return!0===e||!1===e||Tu(e)&&Kr(e)==B},dr.isBuffer=Au,dr.isDate=_u,dr.isElement=function(e){return Tu(e)&&1===e.nodeType&&!ku(e)},dr.isEmpty=function(e){if(null==e)return!0;if(vu(e)&&(mu(e)||"string"==typeof e||"function"==typeof e.splice||Au(e)||ju(e)||bu(e)))return!e.length;var t=Bo(e);if(t==V||t==Q)return!e.size;if(Jo(e))return!si(e).length;for(var n in e)if(ct.call(e,n))return!1;return!0},dr.isEqual=function(e,t){return ii(e,t)},dr.isEqualWith=function(e,t,r){var i=(r="function"==typeof r?r:n)?r(e,t):n;return i===n?ii(e,t,n,r):!!i},dr.isError=wu,dr.isFinite=function(e){return"number"==typeof e&&Bn(e)},dr.isFunction=Mu,dr.isInteger=Ou,dr.isLength=Su,dr.isMap=xu,dr.isMatch=function(e,t){return e===t||oi(e,t,qo(t))},dr.isMatchWith=function(e,t,r){return r="function"==typeof r?r:n,oi(e,t,qo(t),r)},dr.isNaN=function(e){return zu(e)&&e!=+e},dr.isNative=function(e){if($o(e))throw new Ke(i);return ai(e)},dr.isNil=function(e){return null==e},dr.isNull=function(e){return null===e},dr.isNumber=zu,dr.isObject=Eu,dr.isObjectLike=Tu,dr.isPlainObject=ku,dr.isRegExp=Pu,dr.isSafeInteger=function(e){return Ou(e)&&e>=-P&&e<=P},dr.isSet=Cu,dr.isString=Nu,dr.isSymbol=Ru,dr.isTypedArray=ju,dr.isUndefined=function(e){return e===n},dr.isWeakMap=function(e){return Tu(e)&&Bo(e)==re},dr.isWeakSet=function(e){return Tu(e)&&Kr(e)==ie},dr.join=function(e,t){return null==e?"":Fn.call(e,t)},dr.kebabCase=ms,dr.last=wa,dr.lastIndexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var o=i;return r!==n&&(o=(o=Iu(r))<0?Yn(i+o,0):Xn(o,i-1)),t===t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):rn(e,un,o,!0)},dr.lowerCase=ys,dr.lowerFirst=vs,dr.lt=Du,dr.lte=qu,dr.max=function(e){return e&&e.length?Br(e,zs,Zr):n},dr.maxBy=function(e,t){return e&&e.length?Br(e,jo(t,2),Zr):n},dr.mean=function(e){return sn(e,zs)},dr.meanBy=function(e,t){return sn(e,jo(t,2))},dr.min=function(e){return e&&e.length?Br(e,zs,li):n},dr.minBy=function(e,t){return e&&e.length?Br(e,jo(t,2),li):n},dr.stubArray=Bs,dr.stubFalse=Fs,dr.stubObject=function(){return{}},dr.stubString=function(){return""},dr.stubTrue=function(){return!0},dr.multiply=Vs,dr.nth=function(e,t){return e&&e.length?bi(e,Iu(t)):n},dr.noConflict=function(){return kt._===this&&(kt._=ht),this},dr.noop=Rs,dr.now=Za,dr.pad=function(e,t,n){e=Yu(e);var r=(t=Iu(t))?xn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return yo(Wn(i),n)+e+yo(qn(i),n)},dr.padEnd=function(e,t,n){e=Yu(e);var r=(t=Iu(t))?xn(e):0;return t&&r<t?e+yo(t-r,n):e},dr.padStart=function(e,t,n){e=Yu(e);var r=(t=Iu(t))?xn(e):0;return t&&r<t?yo(t-r,n)+e:e},dr.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),Vn(Yu(e).replace(Ce,""),t||0)},dr.random=function(e,t,r){if(r&&"boolean"!=typeof r&&Ho(e,t,r)&&(t=r=n),r===n&&("boolean"==typeof t?(r=t,t=n):"boolean"==typeof e&&(r=e,e=n)),e===n&&t===n?(e=0,t=1):(e=Lu(e),t===n?(t=e,e=0):t=Lu(t)),e>t){var i=e;e=t,t=i}if(r||e%1||t%1){var o=Gn();return Xn(e+o*(t-e+Et("1e-"+((o+"").length-1))),t)}return Ai(e,t)},dr.reduce=function(e,t,n){var r=mu(e)?Zt:fn,i=arguments.length<3;return r(e,jo(t,4),n,i,Wr)},dr.reduceRight=function(e,t,n){var r=mu(e)?Qt:fn,i=arguments.length<3;return r(e,jo(t,4),n,i,Lr)},dr.repeat=function(e,t,r){return t=(r?Ho(e,t,r):t===n)?1:Iu(t),_i(Yu(e),t)},dr.replace=function(){var e=arguments,t=Yu(e[0]);return e.length<3?t:t.replace(e[1],e[2])},dr.result=function(e,t,r){var i=-1,o=(t=Xi(t,e)).length;for(o||(o=1,e=n);++i<o;){var a=null==e?n:e[ca(t[i])];a===n&&(i=o,a=r),e=Mu(a)?a.call(e):a}return e},dr.round=Gs,dr.runInContext=e,dr.sample=function(e){return(mu(e)?Mr:Mi)(e)},dr.size=function(e){if(null==e)return 0;if(vu(e))return Nu(e)?xn(e):e.length;var t=Bo(e);return t==V||t==Q?e.size:si(e).length},dr.snakeCase=gs,dr.some=function(e,t,r){var i=mu(e)?en:ki;return r&&Ho(e,t,r)&&(t=n),i(e,jo(t,3))},dr.sortedIndex=function(e,t){return Pi(e,t)},dr.sortedIndexBy=function(e,t,n){return Ci(e,t,jo(n,2))},dr.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=Pi(e,t);if(r<n&&du(e[r],t))return r}return-1},dr.sortedLastIndex=function(e,t){return Pi(e,t,!0)},dr.sortedLastIndexBy=function(e,t,n){return Ci(e,t,jo(n,2),!0)},dr.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Pi(e,t,!0)-1;if(du(e[n],t))return n}return-1},dr.startCase=As,dr.startsWith=function(e,t,n){return e=Yu(e),n=null==n?0:Nr(Iu(n),0,e.length),t=ji(t),e.slice(n,n+t.length)==t},dr.subtract=$s,dr.sum=function(e){return e&&e.length?dn(e,zs):0},dr.sumBy=function(e,t){return e&&e.length?dn(e,jo(t,2)):0},dr.template=function(e,t,r){var i=dr.templateSettings;r&&Ho(e,t,r)&&(t=n),e=Yu(e),t=Vu({},t,i,So);var o,a,u=Vu({},t.imports,i.imports,So),s=rs(u),c=bn(u,s),l=0,f=t.interpolate||Ve,d="__p += '",p=tt((t.escape||Ve).source+"|"+f.source+"|"+(f===Se?Le:Ve).source+"|"+(t.evaluate||Ve).source+"|$","g"),h="//# sourceURL="+(ct.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++wt+"]")+"\n";e.replace(p,function(t,n,r,i,u,s){return r||(r=i),d+=e.slice(l,s).replace(Ge,_n),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),u&&(a=!0,d+="';\n"+u+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=s+t.length,t}),d+="';\n";var b=ct.call(t,"variable")&&t.variable;b||(d="with (obj) {\n"+d+"\n}\n"),d=(a?d.replace(me,""):d).replace(ye,"$1").replace(ve,"$1;"),d="function("+(b||"obj")+") {\n"+(b?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=Os(function(){return Ze(s,h+"return "+d).apply(n,c)});if(m.source=d,wu(m))throw m;return m},dr.times=function(e,t){if((e=Iu(e))<1||e>P)return[];var n=R,r=Xn(e,R);t=jo(t),e-=R;for(var i=pn(r,t);++n<e;)t(n);return i},dr.toFinite=Lu,dr.toInteger=Iu,dr.toLength=Bu,dr.toLower=function(e){return Yu(e).toLowerCase()},dr.toNumber=Fu,dr.toSafeInteger=function(e){return e?Nr(Iu(e),-P,P):0===e?e:0},dr.toString=Yu,dr.toUpper=function(e){return Yu(e).toUpperCase()},dr.trim=function(e,t,r){if((e=Yu(e))&&(r||t===n))return e.replace(Pe,"");if(!e||!(t=ji(t)))return e;var i=zn(e),o=zn(t);return Vi(i,yn(i,o),vn(i,o)+1).join("")},dr.trimEnd=function(e,t,r){if((e=Yu(e))&&(r||t===n))return e.replace(Ne,"");if(!e||!(t=ji(t)))return e;var i=zn(e);return Vi(i,0,vn(i,zn(t))+1).join("")},dr.trimStart=function(e,t,r){if((e=Yu(e))&&(r||t===n))return e.replace(Ce,"");if(!e||!(t=ji(t)))return e;var i=zn(e);return Vi(i,yn(i,zn(t))).join("")},dr.truncate=function(e,t){var r=O,i=S;if(Eu(t)){var o="separator"in t?t.separator:o;r="length"in t?Iu(t.length):r,i="omission"in t?ji(t.omission):i}var a=(e=Yu(e)).length;if(wn(e)){var u=zn(e);a=u.length}if(r>=a)return e;var s=r-xn(i);if(s<1)return i;var c=u?Vi(u,0,s).join(""):e.slice(0,s);if(o===n)return c+i;if(u&&(s+=c.length-s),Pu(o)){if(e.slice(s).search(o)){var l,f=c;for(o.global||(o=tt(o.source,Yu(Ie.exec(o))+"g")),o.lastIndex=0;l=o.exec(f);)var d=l.index;c=c.slice(0,d===n?s:d)}}else if(e.indexOf(ji(o),s)!=s){var p=c.lastIndexOf(o);p>-1&&(c=c.slice(0,p))}return c+i},dr.unescape=function(e){return(e=Yu(e))&&_e.test(e)?e.replace(ge,kn):e},dr.uniqueId=function(e){var t=++lt;return Yu(e)+t},dr.upperCase=_s,dr.upperFirst=ws,dr.each=Ya,dr.eachRight=Xa,dr.first=va,Ns(dr,function(){var e={};return Hr(dr,function(t,n){ct.call(dr.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),dr.VERSION="4.17.19",Yt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){dr[e].placeholder=dr}),Yt(["drop","take"],function(e,t){mr.prototype[e]=function(r){r=r===n?1:Yn(Iu(r),0);var i=this.__filtered__&&!t?new mr(this):this.clone();return i.__filtered__?i.__takeCount__=Xn(r,i.__takeCount__):i.__views__.push({size:Xn(r,R),type:e+(i.__dir__<0?"Right":"")}),i},mr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),Yt(["filter","map","takeWhile"],function(e,t){var n=t+1,r=n==x||3==n;mr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:jo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),Yt(["head","last"],function(e,t){var n="take"+(t?"Right":"");mr.prototype[e]=function(){return this[n](1).value()[0]}}),Yt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");mr.prototype[e]=function(){return this.__filtered__?new mr(this):this[n](1)}}),mr.prototype.compact=function(){return this.filter(zs)},mr.prototype.find=function(e){return this.filter(e).head()},mr.prototype.findLast=function(e){return this.reverse().find(e)},mr.prototype.invokeMap=wi(function(e,t){return"function"==typeof e?new mr(this):this.map(function(n){return ni(n,e,t)})}),mr.prototype.reject=function(e){return this.filter(uu(jo(e)))},mr.prototype.slice=function(e,t){e=Iu(e);var r=this;return r.__filtered__&&(e>0||t<0)?new mr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=Iu(t))<0?r.dropRight(-t):r.take(t-e)),r)},mr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},mr.prototype.toArray=function(){return this.take(R)},Hr(mr.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=dr[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(dr.prototype[t]=function(){var t=this.__wrapped__,u=i?[1]:arguments,s=t instanceof mr,c=u[0],l=s||mu(t),f=function(e){var t=o.apply(dr,Kt([e],u));return i&&d?t[0]:t};l&&r&&"function"==typeof c&&1!=c.length&&(s=l=!1);var d=this.__chain__,p=!!this.__actions__.length,h=a&&!d,b=s&&!p;if(!a&&l){t=b?t:new mr(this);var m=e.apply(t,u);return m.__actions__.push({func:La,args:[f],thisArg:n}),new br(m,d)}return h&&b?e.apply(this,u):(m=this.thru(f),h?i?m.value()[0]:m.value():m)})}),Yt(["pop","push","shift","sort","splice","unshift"],function(e){var t=it[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);dr.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(mu(i)?i:[],e)}return this[n](function(n){return t.apply(mu(n)?n:[],e)})}}),Hr(mr.prototype,function(e,t){var n=dr[t];if(n){var r=n.name+"";ct.call(rr,r)||(rr[r]=[]),rr[r].push({name:t,func:n})}}),rr[po(n,b).name]=[{name:"wrapper",func:n}],mr.prototype.clone=function(){var e=new mr(this.__wrapped__);return e.__actions__=to(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=to(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=to(this.__views__),e},mr.prototype.reverse=function(){if(this.__filtered__){var e=new mr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},mr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=mu(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=Xn(t,e+a);break;case"takeRight":e=Yn(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,u=o.end,s=u-a,c=r?u:a-1,l=this.__iteratees__,f=l.length,d=0,p=Xn(s,this.__takeCount__);if(!n||!r&&i==s&&p==s)return Ii(e,this.__actions__);var h=[];e:for(;s--&&d<p;){for(var b=-1,m=e[c+=t];++b<f;){var y=l[b],v=y.iteratee,g=y.type,A=v(m);if(g==z)m=A;else if(!A){if(g==x)continue e;break e}}h[d++]=m}return h},dr.prototype.at=Ia,dr.prototype.chain=function(){return Wa(this)},dr.prototype.commit=function(){return new br(this.value(),this.__chain__)},dr.prototype.next=function(){this.__values__===n&&(this.__values__=Wu(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},dr.prototype.plant=function(e){for(var t,r=this;r instanceof hr;){var i=fa(r);i.__index__=0,i.__values__=n,t?o.__wrapped__=i:t=i;var o=i;r=r.__wrapped__}return o.__wrapped__=e,t},dr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof mr){var t=e;return this.__actions__.length&&(t=new mr(this)),(t=t.reverse()).__actions__.push({func:La,args:[Ea],thisArg:n}),new br(t,this.__chain__)}return this.thru(Ea)},dr.prototype.toJSON=dr.prototype.valueOf=dr.prototype.value=function(){return Ii(this.__wrapped__,this.__actions__)},dr.prototype.first=dr.prototype.head,ln&&(dr.prototype[ln]=function(){return this}),dr}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(kt._=Pn,define(function(){return Pn})):Ct?((Ct.exports=Pn)._=Pn,Pt._=Pn):kt._=Pn}).call(this)}).call(this,n(117)(e))},function(e,t,n){var r=e.exports=window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(e,t){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},function(e,t,n){var r=n(3);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},function(e,t,n){var r=n(60)("wks"),i=n(39),o=n(2).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t,n){e.exports=!n(5)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(4),i=n(120),o=n(20),a=Object.defineProperty;t.f=n(7)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(u){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(27),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){"use strict";e.exports=n(328)},function(e,t,n){var r=n(26);e.exports=function(e){return Object(r(e))}},function(e,t,n){e.exports=n(333)()},function(e,t,n){var r=n(2),i=n(15),o=n(16),a=n(39)("src"),u=n(169),s=(""+u).split("toString");n(31).inspectSource=function(e){return u.call(e)},(e.exports=function(e,t,n,u){var c="function"==typeof n;c&&(o(n,"name")||i(n,"name",t)),e[t]!==n&&(c&&(o(n,a)||i(n,a,e[t]?""+e[t]:s.join(String(t)))),e===r?e[t]=n:u?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||u.call(this)})},function(e,t,n){var r=n(0),i=n(5),o=n(26),a=/"/g,u=function(e,t,n,r){var i=String(o(e)),u="<"+t;return""!==n&&(u+=" "+n+'="'+String(r).replace(a,""")+'"'),u+">"+i+"</"+t+">"};e.exports=function(e,t){var n={};n[e]=t(u),r(r.P+r.F*i(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}),"String",n)}},function(e,t,n){var r=n(8),i=n(38);e.exports=n(7)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(57),i=n(38),o=n(19),a=n(20),u=n(16),s=n(120),c=Object.getOwnPropertyDescriptor;t.f=n(7)?c:function(e,t){if(e=o(e),t=a(t,!0),s)try{return c(e,t)}catch(n){}if(u(e,t))return i(!r.f.call(e,t),e[t])}},function(e,t,n){var r=n(61),i=n(26);e.exports=function(e){return r(i(e))}},function(e,t,n){var r=n(3);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){var r=n(17);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(21),i=n(61),o=n(11),a=n(9),u=n(122);e.exports=function(e,t){var n=1==e,s=2==e,c=3==e,l=4==e,f=6==e,d=5==e||f,p=t||u;return function(t,u,h){for(var b,m,y=o(t),v=i(y),g=r(u,h,3),A=a(v.length),_=0,w=n?p(t,A):s?p(t,0):void 0;A>_;_++)if((d||_ in v)&&(m=g(b=v[_],_,y),e))if(n)w[_]=m;else if(m)switch(e){case 3:return!0;case 5:return b;case 6:return _;case 2:w.push(b)}else if(l)return!1;return f?-1:c||l?l:w}}},function(e,t,n){"use strict";var r=n(5);e.exports=function(e,t){return!!e&&r(function(){t?e.call(null,function(){},1):e.call(null)})}},function(e,t,n){var r=n(0),i=n(31),o=n(5);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*o(function(){n(1)}),"Object",a)}},function(e,t){e.exports=jQuery},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(16),i=n(11),o=n(86)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){"use strict";if(n(7)){var r=n(32),i=n(2),o=n(5),a=n(0),u=n(73),s=n(100),c=n(21),l=n(53),f=n(38),d=n(15),p=n(52),h=n(27),b=n(9),m=n(146),y=n(48),v=n(20),g=n(16),A=n(56),_=n(3),w=n(11),M=n(81),O=n(42),S=n(28),E=n(45).f,T=n(83),x=n(39),z=n(6),k=n(22),P=n(64),C=n(58),N=n(84),R=n(49),j=n(63),D=n(51),q=n(80),W=n(121),L=n(8),I=n(18),B=L.f,F=I.f,U=i.RangeError,Y=i.TypeError,X=i.Uint8Array,H=Array.prototype,V=s.ArrayBuffer,G=s.DataView,$=k(0),J=k(2),K=k(3),Z=k(4),Q=k(5),ee=k(6),te=P(!0),ne=P(!1),re=N.values,ie=N.keys,oe=N.entries,ae=H.lastIndexOf,ue=H.reduce,se=H.reduceRight,ce=H.join,le=H.sort,fe=H.slice,de=H.toString,pe=H.toLocaleString,he=z("iterator"),be=z("toStringTag"),me=x("typed_constructor"),ye=x("def_constructor"),ve=u.CONSTR,ge=u.TYPED,Ae=u.VIEW,_e=k(1,function(e,t){return Ee(C(e,e[ye]),t)}),we=o(function(){return 1===new X(new Uint16Array([1]).buffer)[0]}),Me=!!X&&!!X.prototype.set&&o(function(){new X(1).set({})}),Oe=function(e,t){var n=h(e);if(n<0||n%t)throw U("Wrong offset!");return n},Se=function(e){if(_(e)&&ge in e)return e;throw Y(e+" is not a typed array!")},Ee=function(e,t){if(!(_(e)&&me in e))throw Y("It is not a typed array constructor!");return new e(t)},Te=function(e,t){return xe(C(e,e[ye]),t)},xe=function(e,t){for(var n=0,r=t.length,i=Ee(e,r);r>n;)i[n]=t[n++];return i},ze=function(e,t,n){B(e,t,{get:function(){return this._d[n]}})},ke=function(e){var t,n,r,i,o,a,u=w(e),s=arguments.length,l=s>1?arguments[1]:void 0,f=void 0!==l,d=T(u);if(void 0!=d&&!M(d)){for(a=d.call(u),r=[],t=0;!(o=a.next()).done;t++)r.push(o.value);u=r}for(f&&s>2&&(l=c(l,arguments[2],2)),t=0,n=b(u.length),i=Ee(this,n);n>t;t++)i[t]=f?l(u[t],t):u[t];return i},Pe=function(){for(var e=0,t=arguments.length,n=Ee(this,t);t>e;)n[e]=arguments[e++];return n},Ce=!!X&&o(function(){pe.call(new X(1))}),Ne=function(){return pe.apply(Ce?fe.call(Se(this)):Se(this),arguments)},Re={copyWithin:function(e,t){return W.call(Se(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return Z(Se(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return q.apply(Se(this),arguments)},filter:function(e){return Te(this,J(Se(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return Q(Se(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return ee(Se(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){$(Se(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return ne(Se(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return te(Se(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return ce.apply(Se(this),arguments)},lastIndexOf:function(e){return ae.apply(Se(this),arguments)},map:function(e){return _e(Se(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return ue.apply(Se(this),arguments)},reduceRight:function(e){return se.apply(Se(this),arguments)},reverse:function(){for(var e,t=Se(this).length,n=Math.floor(t/2),r=0;r<n;)e=this[r],this[r++]=this[--t],this[t]=e;return this},some:function(e){return K(Se(this),e,arguments.length>1?arguments[1]:void 0)},sort:function(e){return le.call(Se(this),e)},subarray:function(e,t){var n=Se(this),r=n.length,i=y(e,r);return new(C(n,n[ye]))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,b((void 0===t?r:y(t,r))-i))}},je=function(e,t){return Te(this,fe.call(Se(this),e,t))},De=function(e){Se(this);var t=Oe(arguments[1],1),n=this.length,r=w(e),i=b(r.length),o=0;if(i+t>n)throw U("Wrong length!");for(;o<i;)this[t+o]=r[o++]},qe={entries:function(){return oe.call(Se(this))},keys:function(){return ie.call(Se(this))},values:function(){return re.call(Se(this))}},We=function(e,t){return _(e)&&e[ge]&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},Le=function(e,t){return We(e,t=v(t,!0))?f(2,e[t]):F(e,t)},Ie=function(e,t,n){return!(We(e,t=v(t,!0))&&_(n)&&g(n,"value"))||g(n,"get")||g(n,"set")||n.configurable||g(n,"writable")&&!n.writable||g(n,"enumerable")&&!n.enumerable?B(e,t,n):(e[t]=n.value,e)};ve||(I.f=Le,L.f=Ie),a(a.S+a.F*!ve,"Object",{getOwnPropertyDescriptor:Le,defineProperty:Ie}),o(function(){de.call({})})&&(de=pe=function(){return ce.call(this)});var Be=p({},Re);p(Be,qe),d(Be,he,qe.values),p(Be,{slice:je,set:De,constructor:function(){},toString:de,toLocaleString:Ne}),ze(Be,"buffer","b"),ze(Be,"byteOffset","o"),ze(Be,"byteLength","l"),ze(Be,"length","e"),B(Be,be,{get:function(){return this[ge]}}),e.exports=function(e,t,n,s){var c=e+((s=!!s)?"Clamped":"")+"Array",f="get"+e,p="set"+e,h=i[c],y=h||{},v=h&&S(h),g=!h||!u.ABV,w={},M=h&&h.prototype,T=function(e,n){B(e,n,{get:function(){return function(e,n){var r=e._d;return r.v[f](n*t+r.o,we)}(this,n)},set:function(e){return function(e,n,r){var i=e._d;s&&(r=(r=Math.round(r))<0?0:r>255?255:255&r),i.v[p](n*t+i.o,r,we)}(this,n,e)},enumerable:!0})};g?(h=n(function(e,n,r,i){l(e,h,c,"_d");var o,a,u,s,f=0,p=0;if(_(n)){if(!(n instanceof V||"ArrayBuffer"==(s=A(n))||"SharedArrayBuffer"==s))return ge in n?xe(h,n):ke.call(h,n);o=n,p=Oe(r,t);var y=n.byteLength;if(void 0===i){if(y%t)throw U("Wrong length!");if((a=y-p)<0)throw U("Wrong length!")}else if((a=b(i)*t)+p>y)throw U("Wrong length!");u=a/t}else u=m(n),o=new V(a=u*t);for(d(e,"_d",{b:o,o:p,l:a,e:u,v:new G(o)});f<u;)T(e,f++)}),M=h.prototype=O(Be),d(M,"constructor",h)):o(function(){h(1)})&&o(function(){new h(-1)})&&j(function(e){new h,new h(null),new h(1.5),new h(e)},!0)||(h=n(function(e,n,r,i){var o;return l(e,h,c),_(n)?n instanceof V||"ArrayBuffer"==(o=A(n))||"SharedArrayBuffer"==o?void 0!==i?new y(n,Oe(r,t),i):void 0!==r?new y(n,Oe(r,t)):new y(n):ge in n?xe(h,n):ke.call(h,n):new y(m(n))}),$(v!==Function.prototype?E(y).concat(E(v)):E(y),function(e){e in h||d(h,e,y[e])}),h.prototype=M,r||(M.constructor=h));var x=M[he],z=!!x&&("values"==x.name||void 0==x.name),k=qe.values;d(h,me,!0),d(M,ge,c),d(M,Ae,!0),d(M,ye,h),(s?new h(1)[be]==c:be in M)||B(M,be,{get:function(){return c}}),w[c]=h,a(a.G+a.W+a.F*(h!=y),w),a(a.S,c,{BYTES_PER_ELEMENT:t}),a(a.S+a.F*o(function(){y.of.call(h,1)}),c,{from:ke,of:Pe}),"BYTES_PER_ELEMENT"in M||d(M,"BYTES_PER_ELEMENT",t),a(a.P,c,Re),D(c),a(a.P+a.F*Me,c,{set:De}),a(a.P+a.F*!z,c,qe),r||M.toString==de||(M.toString=de),a(a.P+a.F*o(function(){new h(1).slice()}),c,{slice:je}),a(a.P+a.F*(o(function(){return[1,2].toLocaleString()!=new h([1,2]).toLocaleString()})||!o(function(){M.toLocaleString.call([1,2])})),c,{toLocaleString:Ne}),R[c]=z?x:k,r||z||d(M,he,k)}}else e.exports=function(){}},function(e,t,n){"use strict";n.d(t,"e",function(){return x}),n.d(t,"c",function(){return k}),n.d(t,"b",function(){return C}),n.d(t,"a",function(){return j}),n.d(t,"d",function(){return N});var r=window&&window.Object===Object&&window,i="object"==typeof self&&self&&self.Object===Object&&self,o=(r||i||Function("return this")()).Symbol,a=Object.prototype,u=a.hasOwnProperty,s=a.toString,c=o?o.toStringTag:void 0;var l=function(e){var t=u.call(e,c),n=e[c];try{e[c]=void 0;var r=!0}catch(o){}var i=s.call(e);return r&&(t?e[c]=n:delete e[c]),i},f=Object.prototype.toString;var d=function(e){return f.call(e)},p="[object Null]",h="[object Undefined]",b=o?o.toStringTag:void 0;var m=function(e){return null==e?void 0===e?h:p:b&&b in Object(e)?l(e):d(e)};var y=function(e,t){return function(n){return e(t(n))}}(Object.getPrototypeOf,Object);var v=function(e){return null!=e&&"object"==typeof e},g="[object Object]",A=Function.prototype,_=Object.prototype,w=A.toString,M=_.hasOwnProperty,O=w.call(Object);var S=function(e){if(!v(e)||m(e)!=g)return!1;var t=y(e);if(null===t)return!0;var n=M.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&w.call(n)==O};var E=function(e){var t,n=e.Symbol;return"function"===typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}("undefined"!==typeof self?self:window),T={INIT:"@@redux/INIT"};function x(e,t,n){var r;if("function"===typeof t&&"undefined"===typeof n&&(n=t,t=void 0),"undefined"!==typeof n){if("function"!==typeof n)throw new Error("Expected the enhancer to be a function.");return n(x)(e,t)}if("function"!==typeof e)throw new Error("Expected the reducer to be a function.");var i=e,o=t,a=[],u=a,s=!1;function c(){u===a&&(u=a.slice())}function l(){return o}function f(e){if("function"!==typeof e)throw new Error("Expected listener to be a function.");var t=!0;return c(),u.push(e),function(){if(t){t=!1,c();var n=u.indexOf(e);u.splice(n,1)}}}function d(e){if(!S(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if("undefined"===typeof e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(s)throw new Error("Reducers may not dispatch actions.");try{s=!0,o=i(o,e)}finally{s=!1}for(var t=a=u,n=0;n<t.length;n++){(0,t[n])()}return e}return d({type:T.INIT}),(r={dispatch:d,subscribe:f,getState:l,replaceReducer:function(e){if("function"!==typeof e)throw new Error("Expected the nextReducer to be a function.");i=e,d({type:T.INIT})}})[E]=function(){var e,t=f;return(e={subscribe:function(e){if("object"!==typeof e)throw new TypeError("Expected the observer to be an object.");function n(){e.next&&e.next(l())}return n(),{unsubscribe:t(n)}}})[E]=function(){return this},e},r}function z(e,t){var n=t&&t.type;return"Given action "+(n&&'"'+n.toString()+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function k(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var i=t[r];0,"function"===typeof e[i]&&(n[i]=e[i])}var o=Object.keys(n);var a=void 0;try{!function(e){Object.keys(e).forEach(function(t){var n=e[t];if("undefined"===typeof n(void 0,{type:T.INIT}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if("undefined"===typeof n(void 0,{type:"@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".")}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+T.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')})}(n)}catch(u){a=u}return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(a)throw a;for(var r=!1,i={},u=0;u<o.length;u++){var s=o[u],c=n[s],l=e[s],f=c(l,t);if("undefined"===typeof f){var d=z(s,t);throw new Error(d)}i[s]=f,r=r||f!==l}return r?i:e}}function P(e,t){return function(){return t(e.apply(void 0,arguments))}}function C(e,t){if("function"===typeof e)return P(e,t);if("object"!==typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var n=Object.keys(e),r={},i=0;i<n.length;i++){var o=n[i],a=e[o];"function"===typeof a&&(r[o]=P(a,t))}return r}function N(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}var R=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function j(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(n,r,i){var o,a=e(n,r,i),u=a.dispatch,s={getState:a.getState,dispatch:function(e){return u(e)}};return o=t.map(function(e){return e(s)}),u=N.apply(void 0,o)(a.dispatch),R({},a,{dispatch:u})}}}},function(e,t){var n=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=n)},function(e,t){e.exports=!1},function(e,t,n){var r=n(39)("meta"),i=n(3),o=n(16),a=n(8).f,u=0,s=Object.isExtensible||function(){return!0},c=!n(5)(function(){return s(Object.preventExtensions({}))}),l=function(e){a(e,r,{value:{i:"O"+ ++u,w:{}}})},f=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,r)){if(!s(e))return"F";if(!t)return"E";l(e)}return e[r].i},getWeak:function(e,t){if(!o(e,r)){if(!s(e))return!0;if(!t)return!1;l(e)}return e[r].w},onFreeze:function(e){return c&&f.NEED&&s(e)&&!o(e,r)&&l(e),e}}},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){var r=n(344),i=new r;e.exports={moment:i.moment,numberFormat:i.numberFormat.bind(i),translate:i.translate.bind(i),configure:i.configure.bind(i),setLocale:i.setLocale.bind(i),getLocale:i.getLocale.bind(i),getLocaleSlug:i.getLocaleSlug.bind(i),addTranslations:i.addTranslations.bind(i),reRenderTranslations:i.reRenderTranslations.bind(i),registerComponentUpdateHook:i.registerComponentUpdateHook.bind(i),registerTranslateHook:i.registerTranslateHook.bind(i),state:i.state,stateObserver:i.stateObserver,on:i.stateObserver.on.bind(i.stateObserver),off:i.stateObserver.removeListener.bind(i.stateObserver),emit:i.stateObserver.emit.bind(i.stateObserver),mixin:n(362)(i),localize:n(365)(i),$this:i,I18N:r}},function(e,t,n){var r=n(34);e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(t){r(e,t,n[t])})}return e}},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",function(){return r})},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(6)("unscopables"),i=Array.prototype;void 0==i[r]&&n(15)(i,r,{}),e.exports=function(e){i[r][e]=!0}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(4),i=n(125),o=n(87),a=n(86)("IE_PROTO"),u=function(){},s=function(){var e,t=n(79)("iframe"),r=o.length;for(t.style.display="none",n(127).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),s=e.F;r--;)delete s.prototype[o[r]];return s()};e.exports=Object.create||function(e,t){var n;return null!==e?(u.prototype=r(e),n=new u,u.prototype=null,n[a]=e):n=s(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(126),i=n(87);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t,n){var r=n(3);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,n){var r=n(126),i=n(87).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},function(e,t,n){"use strict";n.d(t,"d",function(){return O}),n.d(t,"c",function(){return S}),n.d(t,"b",function(){return k}),n.d(t,"a",function(){return C});var r=n(118),i=n.n(r),o=n(34),a=n.n(o),u=n(36),s=n.n(u),c=n(59),l=n.n(c),f=n(113),d=n.n(f),p=n(1),h=n(30),b=(n(106),n(107)),m=n.n(b),y=n(108),v=n.n(y),g=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m()(this,e),this.results=t}return v()(e,[{key:"get",value:function(){return this.results}},{key:"root",value:function(){return this.results.root}},{key:"addRootResult",value:function(e,t){return this.addResult("root",e,t)}},{key:"addKeyResult",value:function(e,t){return this.addResult(e,null,t)}},{key:"addResult",value:function(t,n,r){var i=this;r instanceof e?Object(p.forEach)(r.results,function(e,r){"root"===r?i.addResult(t,n,e):i.addResult(r,null,e)}):n?(this.results[t]||(this.results[t]={}),this.results[t][n]=r):this.results[t]=r}}]),e}();n(112);function A(){var e=l()(["keyedReducer"]);return A=function(){return e},e}function _(){var e=l()([" must be a function but I detected a ",""]);return _=function(){return e},e}function w(){var e=l()(["keyedReducer"]);return w=function(){return e},e}function M(){var e=l()([" must be a string but I detected a ",""]);return M=function(){return e},e}var O=function(e,t){if("string"!==typeof e)throw new TypeError("Key name passed into "(w())(M(),typeof keyName));if(!e.length)throw new TypeError("Key name passed into `keyedReducer` must have a non-zero length but I detected an empty string");if("function"!==typeof t)throw new TypeError("Reducer passed into "(A())(_(),typeof t));var n=t(void 0,{type:"@@calypso/INIT"});return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if("SERIALIZE"===i.type)return Object(p.reduce)(r,function(e,r,o){var a=t(r,i);return void 0===a||Object(p.isEqual)(a,n)||(e||(e=new g),e.addRootResult(o,a)),e},void 0);if("DESERIALIZE"===i.type)return Object(p.omitBy)(Object(p.mapValues)(r,function(e){return t(e,i)}),function(e){return void 0===e||Object(p.isEqual)(e,n)});var o=Object(p.get)(i,e,void 0);if(null===o||void 0===o)return r;var u=r[o],c=t(u,i);return c===u?r:void 0===c||Object(p.isEqual)(c,n)?r.hasOwnProperty(o)?Object(p.omit)(r,o):r:s()({},r,a()({},o,c))}};function S(e,t){return"function"!==typeof e?Object(p.merge)({},e,t):function(n,r){return e(function(e){return n(S(e,t))},r)}}function E(e){return e(void 0,{type:"@@calypso/INIT"})}function T(e,t,n){var r=t(void 0,{type:"SERIALIZE"});return!!Object(p.isEqual)(n,r)||function(e,t,n){var r=d()(t,{greedy:!1,verbose:!1}),i=r(e);return i}(n,e)}var x=function(e,t){var n=function(n,r){if("DESERIALIZE"===r.type){if(void 0===n)return E(t);if(!T(e,t,n))return E(t)}return t(n,r)};return n.hasCustomPersistence=!0,n},z=function(e){var t=function(t,n){switch(n.type){case"SERIALIZE":return;case"DESERIALIZE":return E(e);default:return e(t,n)}};return t.hasCustomPersistence=!0,t};function k(e,t,n){var r=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e,r=arguments.length>1?arguments[1]:void 0,i=r.type;return t.hasOwnProperty(i)?t[i](n,r):n};return n?x(n,r):t.SERIALIZE||t.DESERIALIZE?(r.hasCustomPersistence=!0,r):z(r)}function P(e){return e.hasCustomPersistence?e:e.schema?x(e.schema,e):z(e)}function C(e){return N(Object(p.mapValues)(e,P))}function N(e){var t=Object(h.c)(e),n=function(n,r){switch(r.type){case"SERIALIZE":return function(e,t,n){if(void 0!==t)return Object(p.reduce)(e,function(e,r,i){var o=r(t[i],n);return void 0!==o&&(e||(e=new g),r.storageKey?e.addKeyResult(r.storageKey,o):e.addRootResult(i,o)),e},void 0)}(e,n,r);case"APPLY_STORED_STATE":return function(e,t,n){var r=!1,i=Object(p.mapValues)(e,function(e,i){if(e.storageKey===n.storageKey)return r=!0,n.storedState;var o=t[i],a=e(o,n);return r=r||a!==o,a});return r?i:t}(e,n,r);default:return t(n,r)}};return n.hasCustomPersistence=!0,n.addReducer=function(e,t){return function(n,r){var o,u=i()(n),c=u[0],l=u.slice(1),f=t[c];if(f){if(0===l.length)throw new Error("Reducer with key '".concat(c,"' is already registered"));if(!f.addReducer)throw new Error("New reducer can be added only into a reducer created with 'combineReducers'");o=f.addReducer(l,r)}else o=Object(p.reduceRight)(l,function(e,t){return N(a()({},t,e))},P(r));var d=N(s()({},t,a()({},c,o)));return d.storageKey=e.storageKey,d}}(n,e),n.getStorageKeys=function(e){return regeneratorRuntime.mark(function t(){var n,r,i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n=0,r=Object.values(e);case 1:if(!(n<r.length)){t.next=11;break}if(!(i=r[n]).storageKey){t.next=6;break}return t.next=6,{storageKey:i.storageK
|
|