Search Regex - Version 2.0

Version Description

  • 9th May 2020 =
  • Release version 2.0
Download this release

Release Info

Developer johnny5
Plugin Icon 128x128 Search Regex
Version 2.0
Comparing to
See all releases

Code changes from version 1.4.16 to 2.0

Files changed (57) hide show
  1. admin.css +0 -91
  2. api/api-base.php +78 -0
  3. api/api-plugin.php +29 -0
  4. api/api-search.php +656 -0
  5. api/api-settings.php +91 -0
  6. api/api.php +38 -0
  7. images/GitHub-Mark-64px.png +0 -0
  8. images/donate.gif +0 -0
  9. images/small.gif +0 -0
  10. locale/BY.mo +0 -0
  11. locale/BY.po +0 -117
  12. locale/ar.mo +0 -0
  13. locale/ar.po +0 -118
  14. locale/search-regex.po +0 -119
  15. locale/search-regex.pot +674 -92
  16. models/match-column.php +106 -0
  17. models/match-context.php +120 -0
  18. models/match.php +167 -0
  19. models/replace.php +163 -0
  20. models/result.php +90 -28
  21. models/search-flags.php +64 -0
  22. models/search.php +176 -192
  23. models/source-flags.php +51 -0
  24. models/source-manager.php +209 -0
  25. models/source.php +369 -0
  26. readme.txt +39 -73
  27. screenshot-1.png +0 -0
  28. screenshot-2.png +0 -0
  29. search-regex-admin.php +454 -0
  30. search-regex-capabilities.php +121 -0
  31. search-regex-cli.php +4 -0
  32. search-regex-settings.php +97 -0
  33. search-regex-strings.php +162 -0
  34. search-regex-version.php +5 -0
  35. search-regex.css +68 -0
  36. search-regex.js +55 -0
  37. search-regex.php +90 -123
  38. searches/comment_author.php +0 -66
  39. searches/comment_author_email.php +0 -66
  40. searches/comment_author_url.php +0 -66
  41. searches/comment_content.php +0 -62
  42. searches/post_content.php +0 -59
  43. searches/post_excerpt.php +0 -59
  44. searches/post_meta.php +0 -63
  45. searches/post_title.php +0 -63
  46. searches/post_url.php +0 -59
  47. source/core/comment-meta.php +21 -0
  48. source/core/comment.php +99 -0
  49. source/core/meta.php +71 -0
  50. source/core/options.php +90 -0
  51. source/core/post-meta.php +21 -0
  52. source/core/post.php +150 -0
  53. source/core/user-meta.php +25 -0
  54. source/core/user.php +88 -0
  55. source/plugin/redirection.php +89 -0
  56. view/results.php +0 -61
  57. view/search.php +0 -95
admin.css DELETED
@@ -1,91 +0,0 @@
1
- .searchargs
2
- {
3
- width: 100%;
4
- }
5
-
6
- .searchargs th
7
- { text-align: right}
8
-
9
- .searchargs .term
10
- {
11
- width: 90%;
12
- }
13
-
14
- .results li
15
- {
16
- margin-bottom: 10px;
17
- -moz-border-radius: 10px;
18
- padding: 5px;
19
- border: 1px solid white;
20
- }
21
-
22
- .results li:hover
23
- {
24
- border: 1px solid #E8EEF1;
25
- }
26
-
27
- .searchx
28
- {
29
- color: #0F3D09;
30
- margin: 5px 0px 5px 20px;
31
- font-size: 0.9em;
32
- padding: 5px;
33
- background-color: #E7F5E1;
34
- -moz-border-radius: 10px;
35
- }
36
-
37
- .searchx strong, .replacex strong, .searchx a
38
- {
39
- color: red;
40
- background-color: pink;
41
- padding: 2px 0px;
42
- font-weight: bold;
43
- border: none;
44
- }
45
-
46
- .results input, .results textarea
47
- {
48
- font-size: 0.9em;
49
- }
50
-
51
- .alt .searchx
52
- {
53
- background-color: #C0DAB5;
54
- color: #1C465C;
55
- }
56
-
57
-
58
- .replacex
59
- {
60
- color: #4B3510;
61
- margin-top: 10px;
62
- font-size: 0.9em;
63
- margin-left: 20px;
64
- padding: 5px;
65
- background-color: #F5EEE1;
66
- -moz-border-radius: 10px;
67
- }
68
-
69
- .alt .replacex
70
- {
71
- background-color: #E0D3BB;
72
- }
73
-
74
- .sub
75
- {
76
- font-weight: normal;
77
- font-size: 0.8em;
78
- color: #666;
79
- }
80
-
81
- .options, .options a
82
- {
83
- color: #666;
84
- }
85
-
86
- .options
87
- {
88
- float: right;
89
- font-size: 0.9em;
90
- margin-left: 10px;
91
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
api/api-base.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @apiDefine 401Error
4
+ *
5
+ * @apiError (Error 401) rest_forbidden You are not authorized to access this API endpoint
6
+ * @apiErrorExample {json} 401 Error Response:
7
+ * HTTP/1.1 401 Bad Request
8
+ * {
9
+ * "code": "rest_forbidden",
10
+ * "message": "Sorry, you are not allowed to do that."
11
+ * }
12
+ */
13
+
14
+ /**
15
+ * @apiDefine 404Error
16
+ *
17
+ * @apiError (Error 404) rest_no_route Endpoint not found
18
+ * @apiErrorExample {json} 404 Error Response:
19
+ * HTTP/1.1 404 Not Found
20
+ * {
21
+ * "code": "rest_no_route",
22
+ * "message": "No route was found matching the URL and request method"
23
+ * }
24
+ */
25
+
26
+ /**
27
+ * @apiDefine 400Error
28
+ *
29
+ * @apiError rest_forbidden You are not authorized to access this API endpoint
30
+ * @apiErrorExample {json} 400 Error Response:
31
+ * HTTP/1.1 400 Bad Request
32
+ * {
33
+ * "error": "invalid",
34
+ * "message": "Invalid request"
35
+ * }
36
+ */
37
+
38
+ /**
39
+ * @apiDefine 400MissingError
40
+ * @apiError (Error 400) rest_missing_callback_param Some required parameters are not present or not in the correct format
41
+ * @apiErrorExample {json} 400 Error Response:
42
+ * HTTP/1.1 400 Bad Request
43
+ * {
44
+ * "code": "rest_missing_callback_param",
45
+ * "message": "Missing parameter(s): PARAM"
46
+ * }
47
+ */
48
+
49
+ /**
50
+ * Base class for Search Regex API endpoints
51
+ */
52
+ class Search_Regex_Api_Route {
53
+ /**
54
+ * Checks a capability
55
+ *
56
+ * @param WP_REST_Request $request Request.
57
+ * @return Bool
58
+ */
59
+ public function permission_callback( WP_REST_Request $request ) {
60
+ return Search_Regex_Capabilities::has_access( Search_Regex_Capabilities::CAP_SEARCHREGEX_SEARCH );
61
+ }
62
+
63
+ /**
64
+ * Get route details
65
+ *
66
+ * @param String $method Method name.
67
+ * @param String $callback Function name.
68
+ * @param callable|Bool $permissions Permissions callback.
69
+ * @return Array
70
+ */
71
+ public function get_route( $method, $callback, $permissions = false ) {
72
+ return [
73
+ 'methods' => $method,
74
+ 'callback' => [ $this, $callback ],
75
+ 'permission_callback' => $permissions ? $permissions : [ $this, 'permission_callback' ],
76
+ ];
77
+ }
78
+ }
api/api-plugin.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * 'Plugin' functions for Search Regex
5
+ */
6
+ class Search_Regex_Api_Plugin extends Search_Regex_Api_Route {
7
+ /**
8
+ * Plugin API endpoint constructor
9
+ *
10
+ * @param String $namespace Namespace.
11
+ */
12
+ public function __construct( $namespace ) {
13
+ register_rest_route( $namespace, '/plugin/test', array(
14
+ $this->get_route( WP_REST_Server::ALLMETHODS, 'route_test', [ $this, 'permission_callback' ] ),
15
+ ) );
16
+ }
17
+
18
+ /**
19
+ * Test the API
20
+ *
21
+ * @param WP_REST_Request $request Request.
22
+ * @return Array
23
+ */
24
+ public function route_test( WP_REST_Request $request ) {
25
+ return array(
26
+ 'success' => true,
27
+ );
28
+ }
29
+ }
api/api-search.php ADDED
@@ -0,0 +1,656 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use SearchRegex\Search;
4
+ use SearchRegex\Replace;
5
+ use SearchRegex\Search_Flags;
6
+ use SearchRegex\Search_Source;
7
+ use SearchRegex\Source_Manager;
8
+ use SearchRegex\Source_Flags;
9
+
10
+ /**
11
+ * @api {get} /search-regex/v1/search Search
12
+ * @apiVersion 1.0.0
13
+ * @apiName Search
14
+ * @apiDescription This performs the search matching of a search phrase in a search source. The search is designed to not timeout and exhaust server memory, and sometimes
15
+ * requires the client to perform multiple requests to get a full set of results.
16
+ *
17
+ * A search source typically represents a WordPress database table. For example, posts, options, or comments. Some sources also represents part of
18
+ * a database table, such as custom post types.
19
+ *
20
+ * Searching operates in two modes - simple (non-regular expression) or advanced (regular expression). Simple searching provides feedback on how many results
21
+ * match the search phrase, while advanced searching requires you to search through the entire table. It should be noted that while a full result set will be returned
22
+ * for simple searching, unless no more matches are found, advanced searching may return empty results. This indicates you need to keep on searching until the end of the source,
23
+ * or until results are returned. This gives the client the ability to cancel a search if it is taking too long.
24
+ *
25
+ * Searches are returned as an array of results. Every result contains a matched phrase. Each result contains the source name (`source_name`) and row ID (`row_id`) and a number of
26
+ * matched columns. These represent the searchable columns within a source database table.
27
+ *
28
+ * Each column contains a number of search contexts. A context is a group of matching phrases that are within the same section of the content. Search Regex will group matches
29
+ * into contexts so they can be viewed easier. A maximum number of contexts will be returned, and if the search exceeds this then the information will be cropped. The `context_count`
30
+ * value can be used to determine if cropping has occurred.
31
+ *
32
+ * Each context contains a number of matches along with the text for the context. Using the match information and the context it should be possible to show a visual
33
+ * representation of the matched phrases.
34
+ *
35
+ * A match is an individual match of the search phrase within the row, and contains the matched phrase, the exact position within the context and the row, and any captured
36
+ * regular expression data.
37
+ *
38
+ * @apiGroup Search
39
+ *
40
+ * @apiUse SearchQueryParams
41
+ *
42
+ * @apiUse SearchResults
43
+ * @apiUse 401Error
44
+ * @apiUse 404Error
45
+ */
46
+
47
+ /**
48
+ * @api {post} /search-regex/v1/replace Replace
49
+ * @apiVersion 1.0.0
50
+ * @apiName Replace
51
+ * @apiDescription Updates the database with the replaced search phrase.
52
+ *
53
+ * If you pass the optional `rowId`, `columnId`, and `posId` parameters then you can incrementally specify the exact search phrase to
54
+ * replace. If you pass no data then the `replace` endpoint acts like `search`, and you will need to page through the results to
55
+ * replace all matches.
56
+ *
57
+ * @apiGroup Search
58
+ *
59
+ * @apiUse SearchQueryParams
60
+ * @apiParam {Integer} [rowId] Row ID of the item to replace
61
+ * @apiParam {String} [columnId] Column ID of the item to replace
62
+ * @apiParam {Integer} [posId] Positional ID of the item to replace
63
+ * @apiParam {String} replacePhrase The value to replace matches with
64
+ *
65
+ * @apiUse SearchResults
66
+ * @apiUse 401Error
67
+ * @apiUse 404Error
68
+ */
69
+
70
+ /**
71
+ * @api {get} /search-regex/v1/source List of sources
72
+ * @apiVersion 1.0.0
73
+ * @apiName GetSources
74
+ * @apiDescription Return all the available sources
75
+ *
76
+ * @apiGroup Source
77
+ *
78
+ * @apiUse SearchResults
79
+ * @apiUse 401Error
80
+ * @apiUse 404Error
81
+ */
82
+
83
+ /**
84
+ * @api {get} /search-regex/v1/source/:source/:rowId Load source row
85
+ * @apiName LoadRow
86
+ * @apiDescription Load a row of data from one source. This can be used to get the full data for a particular search.
87
+ *
88
+ * @apiGroup Source
89
+ *
90
+ * @apiParam (URL) {String} :source The source
91
+ * @apiParam (URL) {Integer} :rowId The source row ID
92
+ *
93
+ * @apiSuccess {String[]} result Associative array of `column_name` => `value`
94
+ * @apiUse 401Error
95
+ * @apiUse 404Error
96
+ */
97
+
98
+ /**
99
+ * @api {post} /search-regex/v1/source/:source/:rowId Save source row
100
+ * @apiVersion 1.0.0
101
+ * @apiName SaveRow
102
+ * @apiDescription Save data to a column of a row of a source, returning the same row back with modified data
103
+ *
104
+ * @apiGroup Source
105
+ *
106
+ * @apiParam (URL) {String} :source The source
107
+ * @apiParam (URL) {Integer} :rowId The source row ID
108
+ * @apiParam {String} columnId Column ID of the item to save content to
109
+ * @apiParam {String} content The new content
110
+ *
111
+ * @apiUse SearchResult
112
+ * @apiUse 401Error
113
+ * @apiUse 404Error
114
+ */
115
+
116
+ /**
117
+ * @api {post} /search-regex/v1/source/:source/:rowId/delete Delete source row
118
+ * @apiVersion 1.0.0
119
+ * @apiName DeleteRow
120
+ * @apiDescription Removes an entire row of data from the source
121
+ *
122
+ * @apiGroup Source
123
+ *
124
+ * @apiParam (URL) {String} :source The source
125
+ * @apiParam (URL) {Integer} :rowId The source row ID
126
+ *
127
+ * @apiSuccess {Bool} result `true` if deleted, `false` otherwise ??? need a better result
128
+ * @apiUse 401Error
129
+ * @apiUse 404Error
130
+ */
131
+
132
+ /**
133
+ * @apiDefine SearchQueryParams
134
+ *
135
+ * @apiParam (Query Parameter) {String} searchPhrase The search phrase
136
+ * @apiParam (Query Parameter) {String} [replacement] The replacement phrase
137
+ * @apiParam (Query Parameter) {Array} source The sources to search through. Currently only one source is supported
138
+ * @apiParam (Query Parameter) {String} searchFlags[regex] Perform a regular expression search
139
+ * @apiParam (Query Parameter) {String} searchFlags[case] Perform a case insensitive search
140
+ * @apiParam (Query Parameter) {Integer} page The current page offset in the results
141
+ * @apiParam (Query Parameter) {Integer=25,50,100,250,500} [perPage=25] The maximum number of results per page
142
+ * @apiParam (Query Parameter) {String="forward","backward"} [searchDirection="forward"] The direction the search is to proceed. Only needed for regular expression searches
143
+ */
144
+
145
+ /**
146
+ * @apiDefine SearchResults Search results
147
+ * Results for a Search Regex search
148
+ *
149
+ * @apiSuccess {Object[]} results All the search results
150
+ * @apiSuccess {Integer} results.row_id The result row ID
151
+ * @apiSuccess {String} results.source_type The result source type
152
+ * @apiSuccess {String} results.source_name A displayable version of `source_type`
153
+ * @apiSuccess {Object[]} results.columns An array of columns with matches
154
+ * @apiSuccess {String} results.columns.column_id A column ID
155
+ * @apiSuccess {String} results.columns.column_label A displayable name for the `column_id`
156
+ * @apiSuccess {Object[]} results.columns.contexts An array of search contexts containing the search matches. This has a maximum size and cropping may occur (see `context_count`)
157
+ * @apiSuccess {String} results.columns.contexts.context_id A context ID
158
+ * @apiSuccess {String} results.columns.contexts.context The section of text from the column that contains all the matches in this context
159
+ * @apiSuccess {Object[]} results.columns.contexts.matches The matched phrases contained within this context. This has a maximum size and cropping may occur (see `match_count`)
160
+ * @apiSuccess {Integer} results.columns.contexts.matches.pos_id The position of the match within the row
161
+ * @apiSuccess {Integer} results.columns.contexts.matches.context_offset The position of the match within the context
162
+ * @apiSuccess {String} results.columns.contexts.matches.match The matched phrase
163
+ * @apiSuccess {String} results.columns.contexts.matches.replacement The matched phrase with the replacement applied to it
164
+ * @apiSuccess {String[]} results.columns.contexts.matches.captures If a regular expression search then this will contain any captured groups
165
+ * @apiSuccess {Integer} results.columns.contexts.match_count The total number of matched phrases, including any that have been cropped.
166
+ * @apiSuccess {Integer} results.columns.context_count The total possible number of contexts, including any from `contexts` that are cropped
167
+ * @apiSuccess {String} results.columns.match_count The number of matches
168
+ * @apiSuccess {String} results.columns.replacement The search phrase
169
+ * @apiSuccess {Object[]} results.actions An array of actions that can be performed on this result
170
+ * @apiSuccess {String} results.title A title for the result
171
+ * @apiSuccess {Object[]} totals The totals for this search
172
+ * @apiSuccess {Integer} totals.current The current search offset
173
+ * @apiSuccess {Integer} totals.rows The total number of rows for the source, including non-matches
174
+ * @apiSuccess {Integer} totals.matched_rows The number of matched rows if known, or `-1` if a regular expression match and unknown
175
+ * @apiSuccess {Integer} totals.matched_phrases The number of matched phraes if known, or `-1` if a regular expression match and unknown
176
+ * @apiSuccess {Object[]} progress The current search progress, and the previous and next set of results
177
+ * @apiSuccess {Integer} progress.current The current search offset
178
+ * @apiSuccess {Integer} progress.rows The number of rows contained within this result set
179
+ * @apiSuccess {Integer} progress.previous The offset for the previous set of results
180
+ * @apiSuccess {Integer} progress.next The offset for the next set of results
181
+ */
182
+
183
+ /**
184
+ * @apiDefine SearchResult Search results
185
+ * Results for a Search Regex search
186
+ *
187
+ * @apiSuccess {Integer} result.row_id The result row ID
188
+ * @apiSuccess {String} result.source_type The result source type
189
+ * @apiSuccess {String} result.source_name A displayable version of `source_type`
190
+ * @apiSuccess {Object[]} result.columns An array of columns with matches
191
+ * @apiSuccess {String} result.columns.column_id A column ID
192
+ * @apiSuccess {String} result.columns.column_label A displayable name for the `column_id`
193
+ * @apiSuccess {String} result.columns.match_count The total number of matches across all contexts in this column
194
+ * @apiSuccess {String} result.columns.replacement The column with all matches replaced
195
+ * @apiSuccess {Integer} result.columns.context_count The total possible number of contexts, including any from `contexts` that are cropped
196
+ * @apiSuccess {Object[]} result.columns.contexts An array of search contexts containing the search matches. This has a maximum size and cropping may occur (see `context_count`)
197
+ * @apiSuccess {String} result.columns.contexts.context_id A context ID
198
+ * @apiSuccess {String} result.columns.contexts.context The section of text from the column that contains all the matches in this context
199
+ * @apiSuccess {Integer} result.columns.contexts.match_count The total number of matched phrases, including any that have been cropped.
200
+ * @apiSuccess {Object[]} result.columns.contexts.matches The matched phrases contained within this context. This has a maximum size and cropping may occur (see `match_count`)
201
+ * @apiSuccess {Integer} result.columns.contexts.matches.pos_id The position of the match within the row
202
+ * @apiSuccess {Integer} result.columns.contexts.matches.context_offset The position of the match within the context
203
+ * @apiSuccess {String} result.columns.contexts.matches.match The matched phrase
204
+ * @apiSuccess {String} result.columns.contexts.matches.replacement The matched phrase with the replacement applied to it
205
+ * @apiSuccess {String[]} result.columns.contexts.matches.captures If a regular expression search then this will contain any captured groups
206
+ * @apiSuccess {Object[]} result.actions An array of actions that can be performed on this result
207
+ * @apiSuccess {String} result.title A title for the result
208
+ */
209
+
210
+ /**
211
+ * Search API endpoint
212
+ */
213
+ class Search_Regex_Api_Search extends Search_Regex_Api_Route {
214
+ /**
215
+ * Return API search args
216
+ *
217
+ * @internal
218
+ * @return Array<String, Array>
219
+ */
220
+ private function get_search_params() {
221
+ return [
222
+ 'searchPhrase' => [
223
+ 'description' => 'The search phrase',
224
+ 'type' => 'string',
225
+ 'validate_callback' => [ $this, 'validate_search' ],
226
+ 'required' => true,
227
+ ],
228
+ 'replacement' => [
229
+ 'description' => 'The replacement phrase',
230
+ 'type' => 'string',
231
+ 'default' => '',
232
+ ],
233
+ 'source' => [
234
+ 'description' => 'The sources to search through. Currently only one source is supported',
235
+ 'type' => 'array',
236
+ 'items' => [
237
+ 'type' => 'string',
238
+ ],
239
+ 'validate_callback' => [ $this, 'validate_source' ],
240
+ 'required' => true,
241
+ ],
242
+ 'sourceFlags' => [
243
+ 'description' => 'Source flags',
244
+ 'type' => 'array',
245
+ 'items' => [
246
+ 'type' => 'string',
247
+ ],
248
+ 'default' => [],
249
+ 'validate_callback' => [ $this, 'validate_source_flags' ],
250
+ ],
251
+ 'searchFlags' => [
252
+ 'description' => 'Search flags',
253
+ 'type' => 'array',
254
+ 'items' => [
255
+ 'type' => 'string',
256
+ ],
257
+ 'default' => [],
258
+ 'validate_callback' => [ $this, 'validate_search_flags' ],
259
+ ],
260
+ ];
261
+ }
262
+
263
+ /**
264
+ * Return API paging args
265
+ *
266
+ * @internal
267
+ * @return Array<String, Array>
268
+ */
269
+ private function get_paging_params() {
270
+ return [
271
+ 'page' => [
272
+ 'description' => 'The current page offset in the results',
273
+ 'type' => 'integer',
274
+ 'default' => 0,
275
+ 'minimum' => 0,
276
+ ],
277
+ 'perPage' => [
278
+ 'description' => 'The maximum number of results per page',
279
+ 'type' => 'integer',
280
+ 'default' => 25,
281
+ 'maximum' => 500,
282
+ 'minimum' => 25,
283
+ ],
284
+ 'searchDirection' => [
285
+ 'description' => 'The direction the search is to proceed. Only needed for regular expression searches',
286
+ 'type' => 'string',
287
+ 'default' => 'forward',
288
+ 'enum' => [
289
+ 'forward',
290
+ 'backward',
291
+ ],
292
+ ],
293
+ ];
294
+ }
295
+
296
+ /**
297
+ * Search API endpoint constructor
298
+ *
299
+ * @param String $namespace Namespace.
300
+ */
301
+ public function __construct( $namespace ) {
302
+ register_rest_route( $namespace, '/search', [
303
+ 'args' => array_merge(
304
+ $this->get_search_params(),
305
+ $this->get_paging_params()
306
+ ),
307
+ $this->get_route( WP_REST_Server::READABLE, 'search', [ $this, 'permission_callback' ] ),
308
+ ] );
309
+
310
+ register_rest_route( $namespace, '/replace', [
311
+ 'args' => array_merge(
312
+ $this->get_search_params(),
313
+ $this->get_paging_params(),
314
+ [
315
+ 'rowId' => [
316
+ 'description' => 'Optional row ID',
317
+ 'type' => 'integer',
318
+ 'default' => 0,
319
+ ],
320
+ 'columnId' => [
321
+ 'description' => 'Optional column ID',
322
+ 'type' => 'string',
323
+ 'default' => null,
324
+ 'validate_callback' => [ $this, 'validate_replace_column' ],
325
+ ],
326
+ 'posId' => [
327
+ 'description' => 'Optional position ID',
328
+ 'type' => 'integer',
329
+ ],
330
+ 'replacePhrase' => [
331
+ 'description' => 'The value to replace matches with',
332
+ 'type' => 'string',
333
+ 'required' => true,
334
+ ],
335
+ ]
336
+ ),
337
+ $this->get_route( WP_REST_Server::EDITABLE, 'replace', [ $this, 'permission_callback' ] ),
338
+ ] );
339
+
340
+ register_rest_route( $namespace, '/source/(?P<source>[a-z]+)/(?P<rowId>[\d]+)', [
341
+ $this->get_route( WP_REST_Server::READABLE, 'loadRow', [ $this, 'permission_callback' ] ),
342
+ ] );
343
+
344
+ $search_no_source = $this->get_search_params();
345
+ unset( $search_no_source['source'] );
346
+ register_rest_route( $namespace, '/source/(?P<source>[a-z]+)/(?P<rowId>[\d]+)', [
347
+ 'args' => array_merge(
348
+ $search_no_source,
349
+ [
350
+ 'columnId' => [
351
+ 'description' => 'Column within the row to update',
352
+ 'type' => 'string',
353
+ 'required' => true,
354
+ 'validate_callback' => [ $this, 'validate_replace_column' ],
355
+ ],
356
+ 'content' => [
357
+ 'description' => 'The new content',
358
+ 'type' => 'string',
359
+ 'required' => true,
360
+ ],
361
+ ]
362
+ ),
363
+ $this->get_route( WP_REST_Server::EDITABLE, 'saveRow', [ $this, 'permission_callback' ] ),
364
+ ] );
365
+
366
+ register_rest_route( $namespace, '/source/(?P<source>[a-z]+)/(?P<rowId>[\d]+)/delete', [
367
+ $this->get_route( WP_REST_Server::EDITABLE, 'deleteRow', [ $this, 'permission_callback' ] ),
368
+ ] );
369
+ }
370
+
371
+ /**
372
+ * Helper to return a search and replace object
373
+ *
374
+ * @internal
375
+ * @param Array $params Array of params.
376
+ * @param String $replacement Replacement value.
377
+ * @return Array Search and Replace objects
378
+ */
379
+ private function get_search_replace( $params, $replacement ) {
380
+ // Get basics
381
+ $flags = new Search_Flags( $params['searchFlags'] );
382
+ $sources = Source_Manager::get( $params['source'], $flags, new Source_Flags( $params['sourceFlags'] ) );
383
+
384
+ // Create a search and replacer
385
+ $search = new Search( $params['searchPhrase'], $sources, $flags );
386
+ $replacer = new Replace( $replacement, $sources, $flags );
387
+
388
+ return [ $search, $replacer ];
389
+ }
390
+
391
+ /**
392
+ * Search for matches
393
+ *
394
+ * @param WP_REST_Request $request The request.
395
+ * @return WP_Error|array Return an array of results, or a WP_Error
396
+ */
397
+ public function search( WP_REST_Request $request ) {
398
+ $params = $request->get_params();
399
+
400
+ list( $search, $replacer ) = $this->get_search_replace( $params, $params['replacement'] );
401
+
402
+ $results = $search->get_results( $replacer, $params['page'], $params['perPage'] );
403
+ if ( ! is_wp_error( $results ) ) {
404
+ $results['results'] = $search->results_to_json( $results['results'] );
405
+ }
406
+
407
+ return $results;
408
+ }
409
+
410
+ /**
411
+ * Perform a replacement on a row, on all rows
412
+ *
413
+ * @param WP_REST_Request $request The request.
414
+ * @return WP_Error|array Return an array of results, or a WP_Error
415
+ */
416
+ public function replace( WP_REST_Request $request ) {
417
+ $params = $request->get_params();
418
+
419
+ if ( $params['rowId'] > 0 ) {
420
+ // Get the Search/Replace pair, with our replacePhrase as the replacement value
421
+ list( $search, $replacer ) = $this->get_search_replace( $params, $params['replacePhrase'] );
422
+ $results = $search->get_row( $params['rowId'], $replacer );
423
+
424
+ if ( is_wp_error( $results ) ) {
425
+ return $results;
426
+ }
427
+
428
+ // Do the replacement
429
+ $replaced = $replacer->save_and_replace( $results, isset( $params['columnId'] ) ? $params['columnId'] : null, isset( $params['posId'] ) ? intval( $params['posId'], 10 ) : null );
430
+ if ( is_wp_error( $replaced ) ) {
431
+ return $replaced;
432
+ }
433
+
434
+ // Now perform a standard search with the original replacement value so the UI is refreshed
435
+ return $this->search( $request );
436
+ }
437
+
438
+ list( $search, $replacer ) = $this->get_search_replace( $params, $params['replacement'] );
439
+ $results = $search->get_results( $replacer, $params['page'], $params['perPage'] );
440
+
441
+ if ( is_wp_error( $results ) ) {
442
+ return $results;
443
+ }
444
+
445
+ $results = $replacer->save_and_replace( $results['results'] );
446
+ if ( is_wp_error( $results ) ) {
447
+ return $results;
448
+ }
449
+
450
+ $search_results = $this->search( $request );
451
+ if ( $search_results instanceof \WP_Error ) {
452
+ return $search_results;
453
+ }
454
+
455
+ // Do the replacement
456
+ return [
457
+ 'results' => $results,
458
+ 'progress' => $search_results['progress'],
459
+ 'totals' => $search_results['totals'],
460
+ ];
461
+ }
462
+
463
+ /**
464
+ * Save data to a row and column within a source
465
+ *
466
+ * @param WP_REST_Request $request The request.
467
+ * @return WP_Error|array Return an array of results, or a WP_Error
468
+ */
469
+ public function saveRow( WP_REST_Request $request ) {
470
+ $params = $request->get_params();
471
+
472
+ $flags = new Search_Flags( $params['searchFlags'] );
473
+ $sources = Source_Manager::get( [ $params['source'] ], $flags, new Source_Flags( $params['sourceFlags'] ) );
474
+
475
+ $result = $sources[0]->save( $params['rowId'], $params['columnId'], $params['content'] );
476
+
477
+ if ( is_wp_error( $result ) ) {
478
+ return $result;
479
+ }
480
+
481
+ $search = new Search( $params['searchPhrase'], $sources, $flags );
482
+ $replacer = new Replace( $params['replacement'], $sources, $flags );
483
+
484
+ $row = $search->get_row( $params['rowId'], $replacer );
485
+ if ( is_wp_error( $row ) ) {
486
+ return $row;
487
+ }
488
+
489
+ $results = $search->results_to_json( (array) $row );
490
+
491
+ return [
492
+ 'result' => count( $results ) > 0 ? $results[0] : [],
493
+ ];
494
+ }
495
+
496
+ /**
497
+ * Load all relevant data from a source's row
498
+ *
499
+ * @param WP_REST_Request $request The request.
500
+ * @return WP_Error|array Return an array of results, or a WP_Error
501
+ */
502
+ public function loadRow( WP_REST_Request $request ) {
503
+ $params = $request->get_params();
504
+
505
+ $sources = Source_Manager::get( [ $params['source'] ], new Search_Flags(), new Source_Flags() );
506
+ $row = $sources[0]->get_row( $params['rowId'] );
507
+
508
+ if ( is_wp_error( $row ) ) {
509
+ return $row;
510
+ }
511
+
512
+ return [
513
+ 'result' => $row,
514
+ ];
515
+ }
516
+
517
+ /**
518
+ * Delete a row of data
519
+ *
520
+ * @param WP_REST_Request $request The request.
521
+ * @return WP_Error|array Return an array of results, or a WP_Error
522
+ */
523
+ public function deleteRow( WP_REST_Request $request ) {
524
+ $params = $request->get_params();
525
+
526
+ $sources = Source_Manager::get( [ $params['source'] ], new Search_Flags(), new Source_Flags() );
527
+
528
+ return $sources[0]->delete_row( $params['rowId'] );
529
+ }
530
+
531
+ /**
532
+ * Validate that the search parameter is correct
533
+ *
534
+ * @param String $value The value to validate.
535
+ * @param WP_REST_Request $request The request.
536
+ * @param Array $param The array of parameters.
537
+ * @return Bool true or false
538
+ */
539
+ public function validate_search( $value, WP_REST_Request $request, $param ) {
540
+ $value = trim( $value );
541
+
542
+ return strlen( $value ) > 0;
543
+ }
544
+
545
+ /**
546
+ * Validate that the column is correct for the given source
547
+ *
548
+ * @param String|null $value The value to validate.
549
+ * @param WP_REST_Request $request The request.
550
+ * @param Array $param The array of parameters.
551
+ * @return WP_Error|Bool true or false
552
+ */
553
+ public function validate_replace_column( $value, WP_REST_Request $request, $param ) {
554
+ if ( $value === null ) {
555
+ return true;
556
+ }
557
+
558
+ $handlers = Source_Manager::get( Source_Manager::get_all_source_names(), new Search_Flags(), new Source_Flags() );
559
+
560
+ foreach ( $handlers as $handler ) {
561
+ if ( in_array( $value, $handler->get_columns(), true ) ) {
562
+ return true;
563
+ }
564
+ }
565
+
566
+ return new WP_Error( 'rest_invalid_param', 'Invalid column detected', array( 'status' => 400 ) );
567
+ }
568
+
569
+ /**
570
+ * Validate that the search flags are correct
571
+ *
572
+ * @param Array|String $value The value to validate.
573
+ * @param WP_REST_Request $request The request.
574
+ * @param Array $param The array of parameters.
575
+ * @return WP_Error|Bool true or false
576
+ */
577
+ public function validate_search_flags( $value, WP_REST_Request $request, $param ) {
578
+ if ( is_array( $value ) ) {
579
+ $source = new Search_Flags( $value );
580
+
581
+ if ( count( $source->get_flags() ) === count( $value ) ) {
582
+ return true;
583
+ }
584
+ }
585
+
586
+ return new WP_Error( 'rest_invalid_param', 'Invalid search flag detected', array( 'status' => 400 ) );
587
+ }
588
+
589
+ /**
590
+ * Validate that the source flags are correct
591
+ *
592
+ * @param Array|String $value The value to validate.
593
+ * @param WP_REST_Request $request The request.
594
+ * @param Array $param The array of parameters.
595
+ * @return Bool|WP_Error true or false
596
+ */
597
+ public function validate_source_flags( $value, WP_REST_Request $request, $param ) {
598
+ if ( is_array( $value ) ) {
599
+ $params = $request->get_params();
600
+ $sources = Source_Manager::get( is_array( $params['source'] ) ? $params['source'] : [ $params['source'] ], new Search_Flags(), new Source_Flags( $value ) );
601
+
602
+ // Get the sanitized flags from all the sources
603
+ $allowed = [];
604
+ foreach ( $sources as $source ) {
605
+ $allowed = array_merge( $allowed, $source->get_source_flags()->get_flags() );
606
+ }
607
+
608
+ // Make it unique, as some sources can use the same flag
609
+ $allowed = array_unique( $allowed );
610
+
611
+ // Any flags missing?
612
+ if ( count( $allowed ) === count( $value ) ) {
613
+ return true;
614
+ }
615
+ }
616
+
617
+ return new WP_Error( 'rest_invalid_param', 'Invalid source flag detected', array( 'status' => 400 ) );
618
+ }
619
+
620
+ /**
621
+ * Validate that the source is valid
622
+ *
623
+ * @param Array|String $value The value to validate.
624
+ * @param WP_REST_Request $request The request.
625
+ * @param Array $param The array of parameters.
626
+ * @return Bool|WP_Error true or false
627
+ */
628
+ public function validate_source( $value, WP_REST_Request $request, $param ) {
629
+ $allowed = Source_Manager::get_all_source_names();
630
+ $valid = [];
631
+
632
+ add_filter( 'wp_revisions_to_keep', [ $this, 'disable_post_revisions' ] );
633
+
634
+ if ( is_array( $value ) ) {
635
+ $valid = array_filter( $value, function( $item ) use ( $allowed ) {
636
+ return array_search( $item, $allowed, true ) !== false;
637
+ } );
638
+ }
639
+
640
+ if ( count( $valid ) > 0 ) {
641
+ return true;
642
+ }
643
+
644
+ return new WP_Error( 'rest_invalid_param', 'Invalid source detected', array( 'status' => 400 ) );
645
+ }
646
+
647
+ /**
648
+ * Used to disable post revisions when updating a post
649
+ *
650
+ * @internal
651
+ * @return Int
652
+ */
653
+ public function disable_post_revisions() {
654
+ return 0;
655
+ }
656
+ }
api/api-settings.php ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @api {get} /search-regex/v1/setting Get settings
4
+ * @apiVersion 1.0.0
5
+ * @apiName GetSettings
6
+ * @apiDescription Get all settings for Search Regex. This includes user-configurable settings, as well as necessary WordPress settings.
7
+ * @apiGroup Settings
8
+ *
9
+ * @apiUse SettingItem
10
+ * @apiUse 401Error
11
+ * @apiUse 404Error
12
+ */
13
+
14
+ /**
15
+ * @api {post} /search-regex/v1/setting Update settings
16
+ * @apiVersion 1.0.0
17
+ * @apiName UpdateSettings
18
+ * @apiDescription Update Search Regex settings. Note you can do partial updates, and only the values specified will be changed.
19
+ * @apiGroup Settings
20
+ *
21
+ * @apiParam {Object} settings An object containing all the settings to update
22
+ * @apiParamExample {json} settings:
23
+ * {
24
+ * "expire_redirect": 14,
25
+ * "https": false
26
+ * }
27
+ *
28
+ * @apiUse SettingItem
29
+ * @apiUse 401Error
30
+ * @apiUse 404Error
31
+ */
32
+
33
+ /**
34
+ * @apiDefine SettingItem Settings
35
+ * Search Regex settings
36
+ *
37
+ * @apiSuccess {Object[]} settings An object containing all settings
38
+ * @apiSuccess {String} settings.support
39
+ * @apiSuccess {String} settings.rest_api
40
+ *
41
+ * @apiSuccessExample {json} Success-Response:
42
+ * HTTP/1.1 200 OK
43
+ * {
44
+ * "settings": {
45
+ * "support": false,
46
+ * }
47
+ * }
48
+ */
49
+
50
+ /**
51
+ * Settings API endpoint
52
+ */
53
+ class Search_Regex_Api_Settings extends Search_Regex_Api_Route {
54
+ /**
55
+ * Create API endpoints with the given namespace
56
+ *
57
+ * @param String $namespace Namespace.
58
+ */
59
+ public function __construct( $namespace ) {
60
+ register_rest_route( $namespace, '/setting', array(
61
+ $this->get_route( WP_REST_Server::READABLE, 'route_settings', [ $this, 'permission_callback' ] ),
62
+ $this->get_route( WP_REST_Server::EDITABLE, 'route_save_settings', [ $this, 'permission_callback' ] ),
63
+ ) );
64
+ }
65
+
66
+ /**
67
+ * Get settings
68
+ *
69
+ * @param WP_REST_Request $request Request.
70
+ * @return Array Settings
71
+ */
72
+ public function route_settings( WP_REST_Request $request ) {
73
+ return [
74
+ 'settings' => searchregex_get_options(),
75
+ ];
76
+ }
77
+
78
+ /**
79
+ * Set settings
80
+ *
81
+ * @param WP_REST_Request $request Request.
82
+ * @return Array Settings
83
+ */
84
+ public function route_save_settings( WP_REST_Request $request ) {
85
+ $params = $request->get_params();
86
+
87
+ searchregex_set_options( $params );
88
+
89
+ return $this->route_settings( $request );
90
+ }
91
+ }
api/api.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once __DIR__ . '/api-base.php';
4
+ require_once __DIR__ . '/api-search.php';
5
+ require_once __DIR__ . '/api-settings.php';
6
+ require_once __DIR__ . '/api-plugin.php';
7
+
8
+ define( 'SEARCHREGEX_API_NAMESPACE', 'search-regex/v1' );
9
+
10
+ class Search_Regex_Api {
11
+ /** @var Search_Regex_Api|null */
12
+ private static $instance = null;
13
+ /** @var Array */
14
+ private $routes = array();
15
+
16
+ /**
17
+ * Create API
18
+ *
19
+ * @return Search_Regex_Api
20
+ */
21
+ public static function init() {
22
+ if ( is_null( self::$instance ) ) {
23
+ self::$instance = new Search_Regex_Api();
24
+ }
25
+
26
+ return self::$instance;
27
+ }
28
+
29
+ public function __construct() {
30
+ global $wpdb;
31
+
32
+ $wpdb->hide_errors();
33
+
34
+ $this->routes[] = new Search_Regex_Api_Search( SEARCHREGEX_API_NAMESPACE );
35
+ $this->routes[] = new Search_Regex_Api_Plugin( SEARCHREGEX_API_NAMESPACE );
36
+ $this->routes[] = new Search_Regex_Api_Settings( SEARCHREGEX_API_NAMESPACE );
37
+ }
38
+ }
images/GitHub-Mark-64px.png ADDED
Binary file
images/donate.gif ADDED
Binary file
images/small.gif DELETED
Binary file
locale/BY.mo DELETED
Binary file
locale/BY.po DELETED
@@ -1,117 +0,0 @@
1
- # SOME DESCRIPTIVE TITLE.
2
- # Copyright (C) YEAR John Godley
3
- # This file is distributed under the same license as the PACKAGE package.
4
- # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
- #
6
- msgid ""
7
- msgstr ""
8
- "Project-Id-Version: search-regex\n"
9
- "POT-Creation-Date: \n"
10
- "PO-Revision-Date: \n"
11
- "Last-Translator: Илья <mrilyuha@gmail.com>\n"
12
- "Language-Team: \n"
13
- "MIME-Version: 1.0\n"
14
- "Content-Type: text/plain; charset=utf-8\n"
15
- "Content-Transfer-Encoding: 8bit\n"
16
- "X-Poedit-Language: Belarusian\n"
17
- "X-Poedit-Country: BELARUS\n"
18
- "X-Poedit-SourceCharset: utf-8\n"
19
-
20
- #: search-regex.php:335
21
- #, php-format
22
- msgid "%1$s results found."
23
- msgstr "%1$s знойдзена."
24
-
25
- #: search-regex.php:306
26
- msgid "Case-less:"
27
- msgstr "без уліку рэгістра:"
28
-
29
- #: search-regex.php:343
30
- msgid "Comment"
31
- msgstr "Каментарый"
32
-
33
- #: search-regex.php:296
34
- msgid "Comments"
35
- msgstr "Каментарыі"
36
-
37
- #: search-regex.php:308
38
- msgid "Dot-all:"
39
- msgstr "Dot-all:"
40
-
41
- #: search-regex.php:59
42
- msgid "Invalid regular expression"
43
- msgstr "Няправільны рэгулярны выраз"
44
-
45
- #: search-regex.php:297
46
- msgid "Meta-data"
47
- msgstr "Метададзеныя"
48
-
49
- #: search-regex.php:307
50
- msgid "Multi-line:"
51
- msgstr "Шмат радкоў:"
52
-
53
- #: search-regex.php:286
54
- msgid "NOTE: No liability is accepted for any damage caused - make sure to backup your database before clicking 'Replace &amp; Save'."
55
- msgstr "NOTE: No liability is accepted for any damage caused - make sure to backup your database before clicking 'Replace &amp; Save'."
56
-
57
- #: search-regex.php:85
58
- msgid "No search pattern"
59
- msgstr "Няма шаблонаў пошуку"
60
-
61
- #: search-regex.php:341
62
- msgid "Post"
63
- msgstr "пост"
64
-
65
- #: search-regex.php:295
66
- msgid "Posts &amp; pages"
67
- msgstr "Пастоў &amp; старонак"
68
-
69
- #: search-regex.php:305
70
- msgid "Regex:"
71
- msgstr "Regex:"
72
-
73
- #: search-regex.php:321
74
- msgid "Replace"
75
- msgstr "Замяніць"
76
-
77
- #: search-regex.php:322
78
- msgid "Replace &amp; Save &raquo;"
79
- msgstr "Замяніць &amp; Захаваць &raquo;"
80
-
81
- #: search-regex.php:312
82
- msgid "Replace pattern"
83
- msgstr "Шаблон замены"
84
-
85
- #: search-regex.php:332
86
- msgid "Results"
87
- msgstr "рэзультаты"
88
-
89
- #: search-regex.php:320
90
- msgid "Search"
91
- msgstr "пошук"
92
-
93
- #: search-regex.php:284
94
- #: search-regex.php:365
95
- msgid "Search Regex"
96
- msgstr "Search Regex"
97
-
98
- #: search-regex.php:302
99
- msgid "Search pattern"
100
- msgstr "Шаблон пошуку"
101
-
102
- #: search-regex.php:292
103
- msgid "Source"
104
- msgstr "Крыніца"
105
-
106
- #: search-regex.php:356
107
- msgid "There are no results."
108
- msgstr "Няма рэзультатаў."
109
-
110
- #: search-regex.php:285
111
- msgid "WordPress Search &amp; Replace, with full regular expression support. Replacements will only be saved to the database if you check 'save', otherwise you will get a preview of the results."
112
- msgstr "WordPress пошук &amp; замена, з поўнай падтрымкай рэгулярных выразаў. Замены будуць захаваныя ў базе дадзеных толькі пры ўмове, што вы адзначыце 'захаваць'."
113
-
114
- #: search-regex.php:348
115
- msgid "replaced with:"
116
- msgstr "заменена"
117
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
locale/ar.mo DELETED
Binary file
locale/ar.po DELETED
@@ -1,118 +0,0 @@
1
- # SOME DESCRIPTIVE TITLE.
2
- # Copyright (C) YEAR John Godley
3
- # This file is distributed under the same license as the PACKAGE package.
4
- # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
- #
6
- msgid ""
7
- msgstr ""
8
- "Project-Id-Version: PACKAGE VERSION\n"
9
- "Report-Msgid-Bugs-To: \n"
10
- "POT-Creation-Date: 2006-07-13 12:44+0800\n"
11
- "PO-Revision-Date: 2010-01-18 14:32+0300\n"
12
- "Last-Translator: www.r-sn.com <web.rsn@gmail.com>\n"
13
- "Language-Team: مدونة رسين <r-sn.com@hotmail.com>\n"
14
- "MIME-Version: 1.0\n"
15
- "Content-Type: text/plain; charset=utf8\n"
16
- "Content-Transfer-Encoding: 8bit\n"
17
- "X-Poedit-Language: Arabic\n"
18
- "X-Poedit-Country: SAUDI ARABIA\n"
19
- "X-Poedit-SourceCharset: utf8\n"
20
-
21
- #: search-regex.php:335
22
- #, php-format
23
- msgid "%1$s results found."
24
- msgstr "%1$s وجود نتائج"
25
-
26
- #: search-regex.php:306
27
- msgid "Case-less:"
28
- msgstr "حالة على الأقل :"
29
-
30
- #: search-regex.php:343
31
- msgid "Comment"
32
- msgstr "التعليق"
33
-
34
- #: search-regex.php:296
35
- msgid "Comments"
36
- msgstr "التعليقات"
37
-
38
- #: search-regex.php:308
39
- msgid "Dot-all:"
40
- msgstr "جميع النقاط :"
41
-
42
- #: search-regex.php:59
43
- msgid "Invalid regular expression"
44
- msgstr "صلاحية المصطلح"
45
-
46
- #: search-regex.php:297
47
- msgid "Meta-data"
48
- msgstr "البيانات الوصفية"
49
-
50
- #: search-regex.php:307
51
- msgid "Multi-line:"
52
- msgstr "متعدد الأسطر :"
53
-
54
- #: search-regex.php:286
55
- msgid "NOTE: No liability is accepted for any damage caused - make sure to backup your database before clicking 'Replace &amp; Save'."
56
- msgstr "ملاحظة : لا نتحمل المسؤولية عن أي ضرر ناتج -- تأكد من أخذ نسخة احتياطية لقاعدة البيانات .. قبل النقر على 'استبدال &amp; حفظ'"
57
-
58
- #: search-regex.php:85
59
- msgid "No search pattern"
60
- msgstr "لا يوجد نمط البحث"
61
-
62
- #: search-regex.php:341
63
- msgid "Post"
64
- msgstr "التدوينة"
65
-
66
- #: search-regex.php:295
67
- msgid "Posts &amp; pages"
68
- msgstr "تدوينات &amp; صفحات"
69
-
70
- #: search-regex.php:305
71
- msgid "Regex:"
72
- msgstr "Regex:"
73
-
74
- #: search-regex.php:321
75
- msgid "Replace"
76
- msgstr "استبدال"
77
-
78
- #: search-regex.php:322
79
- msgid "Replace &amp; Save &raquo;"
80
- msgstr "استبدال &amp; حفظ &raquo;"
81
-
82
- #: search-regex.php:312
83
- msgid "Replace pattern"
84
- msgstr "كلمة الاستبدال"
85
-
86
- #: search-regex.php:332
87
- msgid "Results"
88
- msgstr "نتائج"
89
-
90
- #: search-regex.php:320
91
- msgid "Search"
92
- msgstr "بحث"
93
-
94
- #: search-regex.php:284
95
- #: search-regex.php:365
96
- msgid "Search Regex"
97
- msgstr "Search Regex"
98
-
99
- #: search-regex.php:302
100
- msgid "Search pattern"
101
- msgstr "كلمة البحث"
102
-
103
- #: search-regex.php:292
104
- msgid "Source"
105
- msgstr "المصدر"
106
-
107
- #: search-regex.php:356
108
- msgid "There are no results."
109
- msgstr "لا توجد نتائج"
110
-
111
- #: search-regex.php:285
112
- msgid "WordPress Search &amp; Replace, with full regular expression support. Replacements will only be saved to the database if you check 'save', otherwise you will get a preview of the results."
113
- msgstr "البحث في الوورد بريس &amp; والاستبدال ، مع دعم كامل المصطلحات العادية. الاستبدال سوف يتم حفظه في قاعدة البيانات إذا كنت من الاختيار اضغط 'حفظ' ، وإلا فإنك ستحصل على معاينة النتائج ."
114
-
115
- #: search-regex.php:348
116
- msgid "replaced with:"
117
- msgstr "استبدال بـ :"
118
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
locale/search-regex.po DELETED
@@ -1,119 +0,0 @@
1
- # SOME DESCRIPTIVE TITLE.
2
- # Copyright (C) YEAR John Godley
3
- # This file is distributed under the same license as the PACKAGE package.
4
- # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
- #
6
- #, fuzzy
7
- msgid ""
8
- msgstr ""
9
- "Project-Id-Version: PACKAGE VERSION\n"
10
- "Report-Msgid-Bugs-To: \n"
11
- "POT-Creation-Date: 2006-07-13 12:44+0800\n"
12
- "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
- "Language-Team: LANGUAGE <LL@li.org>\n"
15
- "MIME-Version: 1.0\n"
16
- "Content-Type: text/plain; charset=CHARSET\n"
17
- "Content-Transfer-Encoding: 8bit\n"
18
-
19
- #: search-regex.php:335
20
- #, php-format
21
- msgid "%1$s results found."
22
- msgstr ""
23
-
24
- #: search-regex.php:306
25
- msgid "Case-less:"
26
- msgstr ""
27
-
28
- #: search-regex.php:343
29
- msgid "Comment"
30
- msgstr ""
31
-
32
- #: search-regex.php:296
33
- msgid "Comments"
34
- msgstr ""
35
-
36
- #: search-regex.php:308
37
- msgid "Dot-all:"
38
- msgstr ""
39
-
40
- #: search-regex.php:59
41
- msgid "Invalid regular expression"
42
- msgstr ""
43
-
44
- #: search-regex.php:297
45
- msgid "Meta-data"
46
- msgstr ""
47
-
48
- #: search-regex.php:307
49
- msgid "Multi-line:"
50
- msgstr ""
51
-
52
- #: search-regex.php:286
53
- msgid ""
54
- "NOTE: No liability is accepted for any damage caused - make sure to backup "
55
- "your database before clicking 'Replace &amp; Save'."
56
- msgstr ""
57
-
58
- #: search-regex.php:85
59
- msgid "No search pattern"
60
- msgstr ""
61
-
62
- #: search-regex.php:341
63
- msgid "Post"
64
- msgstr ""
65
-
66
- #: search-regex.php:295
67
- msgid "Posts &amp; pages"
68
- msgstr ""
69
-
70
- #: search-regex.php:305
71
- msgid "Regex:"
72
- msgstr ""
73
-
74
- #: search-regex.php:321
75
- msgid "Replace"
76
- msgstr ""
77
-
78
- #: search-regex.php:322
79
- msgid "Replace &amp; Save &raquo;"
80
- msgstr ""
81
-
82
- #: search-regex.php:312
83
- msgid "Replace pattern"
84
- msgstr ""
85
-
86
- #: search-regex.php:332
87
- msgid "Results"
88
- msgstr ""
89
-
90
- #: search-regex.php:320
91
- msgid "Search"
92
- msgstr ""
93
-
94
- #: search-regex.php:284 search-regex.php:365
95
- msgid "Search Regex"
96
- msgstr ""
97
-
98
- #: search-regex.php:302
99
- msgid "Search pattern"
100
- msgstr ""
101
-
102
- #: search-regex.php:292
103
- msgid "Source"
104
- msgstr ""
105
-
106
- #: search-regex.php:356
107
- msgid "There are no results."
108
- msgstr ""
109
-
110
- #: search-regex.php:285
111
- msgid ""
112
- "WordPress Search &amp; Replace, with full regular expression support. "
113
- "Replacements will only be saved to the database if you check 'save', "
114
- "otherwise you will get a preview of the results."
115
- msgstr ""
116
-
117
- #: search-regex.php:348
118
- msgid "replaced with:"
119
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
locale/search-regex.pot CHANGED
@@ -1,192 +1,774 @@
1
- # Copyright (C) 2016 Search Regex
2
  # This file is distributed under the same license as the Search Regex package.
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: Search Regex\n"
6
- "Report-Msgid-Bugs-To: https://wordpress.org/plugins/search-regex/\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
9
  "Content-Transfer-Encoding: 8bit\n"
10
- "PO-Revision-Date: 2016-MO-DA HO:MI+ZONE\n"
11
  "X-Poedit-Basepath: ..\n"
12
- "X-Poedit-SourceCharset: UTF-8\n"
13
- "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
14
  "X-Poedit-SearchPath-0: .\n"
15
  "X-Poedit-SearchPathExcluded-0: *.js\n"
16
- "Plural-Forms: nplurals=2; plural=(n != 1);\n\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
- #: models/search.php:31
19
- msgid "Invalid regular expression"
20
  msgstr ""
21
 
22
- #: models/search.php:73
23
- msgid "No search pattern"
24
  msgstr ""
25
 
26
- #: search-regex.php:40, search-regex.php:40, search-regex.php:43, search-regex.php:43, view/search.php:3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  msgid "Search Regex"
28
  msgstr ""
29
 
30
- #: searches/comment_author_email.php:39, searches/comment_author_url.php:39, searches/comment_author.php:39, searches/comment_content.php:35, searches/post_meta.php:36
31
- msgid "view post"
32
  msgstr ""
33
 
34
- #: searches/comment_author_email.php:42, searches/comment_author_url.php:42, searches/comment_author.php:42, searches/comment_content.php:38, searches/post_content.php:35, searches/post_excerpt.php:35, searches/post_meta.php:39, searches/post_title.php:37, searches/post_url.php:35
35
- msgid "edit"
36
  msgstr ""
37
 
38
- #: searches/comment_author_email.php:48, searches/comment_author_url.php:48, searches/comment_author.php:48, searches/comment_content.php:44
39
- msgid "Comment #%d: %s"
40
  msgstr ""
41
 
42
- #: searches/comment_author_email.php:51
43
- msgid "Comment author email"
44
  msgstr ""
45
 
46
- #: searches/comment_author_url.php:51
47
- msgid "Comment author URL"
48
  msgstr ""
49
 
50
- #: searches/comment_author.php:51
51
- msgid "Comment author"
52
  msgstr ""
53
 
54
- #: searches/comment_content.php:47
55
- msgid "Comment content"
56
  msgstr ""
57
 
58
- #: searches/post_content.php:32, searches/post_excerpt.php:32, searches/post_title.php:34, searches/post_url.php:32
59
- msgid "view"
60
  msgstr ""
61
 
62
- #: searches/post_content.php:41, searches/post_excerpt.php:41, searches/post_title.php:45, searches/post_url.php:41
63
- msgid "Post #%d: %s"
64
  msgstr ""
65
 
66
- #: searches/post_content.php:44
67
- msgid "Post content"
68
  msgstr ""
69
 
70
- #: searches/post_excerpt.php:44
71
- msgid "Post excerpt"
72
  msgstr ""
73
 
74
- #: searches/post_meta.php:45
75
- msgid "Meta data for post #%d: %s"
76
  msgstr ""
77
 
78
- #: searches/post_meta.php:48
79
- msgid "Post meta value"
80
  msgstr ""
81
 
82
- #: searches/post_title.php:48
83
- msgid "Post title"
84
  msgstr ""
85
 
86
- #: searches/post_url.php:44
87
- msgid "Post URL"
88
  msgstr ""
89
 
90
- #: view/results.php:3
91
- msgid "Results"
92
  msgstr ""
93
 
94
- #: view/results.php:6
95
- msgid "%1$s result(s) found."
96
  msgstr ""
97
 
98
- #: view/results.php:19
99
- msgid "replaced with:"
100
  msgstr ""
101
 
102
- #: view/results.php:59
103
- msgid "There are no results."
104
  msgstr ""
105
 
106
- #: view/search.php:4
107
- msgid "Replacements will only be saved to the database if you click '<strong>Replace &amp; Save</strong>', otherwise you will get a preview of the results."
108
  msgstr ""
109
 
110
- #: view/search.php:5
111
- msgid "NOTE: <strong>No liability</strong> is accepted for any damage caused. You are strongly advised to backup your database before making any changes."
112
  msgstr ""
113
 
114
- #: view/search.php:11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  msgid "Source"
116
  msgstr ""
117
 
118
- #: view/search.php:22
119
- msgid "Limit to"
120
  msgstr ""
121
 
122
- #: view/search.php:25
123
- msgid "No limit"
124
  msgstr ""
125
 
126
- #: view/search.php:26
127
- msgid "10"
128
  msgstr ""
129
 
130
- #: view/search.php:27
131
- msgid "25"
132
  msgstr ""
133
 
134
- #: view/search.php:28
135
- msgid "50"
136
  msgstr ""
137
 
138
- #: view/search.php:29
139
- msgid "100"
140
  msgstr ""
141
 
142
- #: view/search.php:32
143
- msgid "Order By"
144
  msgstr ""
145
 
146
- #: view/search.php:35
147
- msgid "Ascending"
148
  msgstr ""
149
 
150
- #: view/search.php:36
151
- msgid "Descending"
152
  msgstr ""
153
 
154
- #: view/search.php:41
155
- msgid "Search pattern"
156
  msgstr ""
157
 
158
- #: view/search.php:47
159
- msgid "Replace pattern"
160
  msgstr ""
161
 
162
- #: view/search.php:53
163
- msgid "Regex"
164
  msgstr ""
165
 
166
- #: view/search.php:59
167
- msgid "case-insensitive:"
168
  msgstr ""
169
 
170
- #: view/search.php:63
171
- msgid "multi-line:"
172
  msgstr ""
173
 
174
- #: view/search.php:67
175
- msgid "dot-all:"
176
  msgstr ""
177
 
178
- #: view/search.php:71
179
- msgid "remember to surround your regex with a delimiter!"
180
  msgstr ""
181
 
182
- #: view/search.php:78
183
- msgid "Search"
184
  msgstr ""
185
 
186
- #: view/search.php:81
187
- msgid "Replace"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  msgstr ""
189
 
190
- #: view/search.php:82
191
- msgid "Replace &amp; Save &raquo;"
192
  msgstr ""
1
+ # Copyright (C) 2020 Search Regex
2
  # This file is distributed under the same license as the Search Regex package.
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: Search Regex\n"
 
6
  "MIME-Version: 1.0\n"
7
  "Content-Type: text/plain; charset=UTF-8\n"
8
  "Content-Transfer-Encoding: 8bit\n"
9
+ "Report-Msgid-Bugs-To: https://wordpress.org/plugins/search-regex/\n"
10
  "X-Poedit-Basepath: ..\n"
11
+ "X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
 
12
  "X-Poedit-SearchPath-0: .\n"
13
  "X-Poedit-SearchPathExcluded-0: *.js\n"
14
+ "X-Poedit-SourceCharset: UTF-8\n"
15
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
+
17
+ #: search-regex-admin.php:44
18
+ msgid "Settings"
19
+ msgstr ""
20
+
21
+ #: search-regex-admin.php:167, search-regex-strings.php:131
22
+ msgid "{{link}}Source Flags{{/link}} - additional options for the selected source. For example, include post {{guid}}GUID{{/guid}} in the search."
23
+ msgstr ""
24
+
25
+ #. translators: URL
26
+ #: search-regex-admin.php:175
27
+ msgid "You can find full documentation about using Search Regex on the <a href=\"%s\" target=\"_blank\">searchregex.com</a> support site."
28
+ msgstr ""
29
+
30
+ #: search-regex-admin.php:176, search-regex-strings.php:127
31
+ msgid "The following concepts are used by Search Regex:"
32
+ msgstr ""
33
+
34
+ #: search-regex-admin.php:178, search-regex-strings.php:128
35
+ msgid "{{link}}Search Flags{{/link}} - additional qualifiers for your search, to enable case insensitivity, and to enable regular expression support."
36
+ msgstr ""
37
+
38
+ #: search-regex-admin.php:179, search-regex-strings.php:129
39
+ msgid "{{link}}Regular expression{{/link}} - a way of defining a pattern for text matching. Provides more advanced matches."
40
+ msgstr ""
41
+
42
+ #: search-regex-admin.php:180, search-regex-strings.php:130
43
+ msgid "{{link}}Source{{/link}} - the source of data you wish to search. For example, posts, pages, or comments."
44
+ msgstr ""
45
+
46
+ #: search-regex-admin.php:184
47
+ msgid "Search Regex Support"
48
+ msgstr ""
49
+
50
+ #. translators: 1: Expected WordPress version, 2: Actual WordPress version
51
+ #: search-regex-admin.php:248
52
+ msgid "Search Regex requires WordPress v%1$1s, you are using v%2$2s - please update your WordPress"
53
+ msgstr ""
54
+
55
+ #: search-regex-admin.php:251
56
+ msgid "Unable to load Search Regex"
57
+ msgstr ""
58
+
59
+ #: search-regex-admin.php:260
60
+ msgid "Unable to load Search Regex ☹️"
61
+ msgstr ""
62
+
63
+ #: search-regex-admin.php:261
64
+ msgid "This may be caused by another plugin - look at your browser's error console for more details."
65
+ msgstr ""
66
+
67
+ #: search-regex-admin.php:262, search-regex-strings.php:90
68
+ msgid "If you are using a page caching plugin or service (CloudFlare, OVH, etc) then you can also try clearing that cache."
69
+ msgstr ""
70
+
71
+ #: search-regex-admin.php:263
72
+ msgid "Also check if your browser is able to load <code>search-regex.js</code>:"
73
+ msgstr ""
74
+
75
+ #: search-regex-admin.php:265
76
+ msgid "Please note that Search Regex requires the WordPress REST API to be enabled. If you have disabled this then you won't be able to use Search Regex"
77
+ msgstr ""
78
+
79
+ #: search-regex-admin.php:266
80
+ msgid "Please see the <a href=\"https://searchregex.com/support/problems/\">list of common problems</a>."
81
+ msgstr ""
82
+
83
+ #: search-regex-admin.php:267
84
+ msgid "If you think Search Regex is at fault then create an issue."
85
+ msgstr ""
86
+
87
+ #: search-regex-admin.php:268
88
+ msgid "<code>SearchRegexi10n</code> is not defined. This usually means another plugin is blocking Search Regex from loading. Please disable all plugins and try again."
89
+ msgstr ""
90
+
91
+ #: search-regex-admin.php:271
92
+ msgid "Create Issue"
93
+ msgstr ""
94
+
95
+ #: search-regex-admin.php:284
96
+ msgid "Loading, please wait..."
97
+ msgstr ""
98
+
99
+ #: search-regex-admin.php:288
100
+ msgid "Please enable JavaScript"
101
+ msgstr ""
102
+
103
+ #: search-regex-strings.php:4
104
+ msgid "WordPress did not return a response. This could mean an error occurred or that the request was blocked. Please check your server error_log."
105
+ msgstr ""
106
+
107
+ #: search-regex-strings.php:5
108
+ msgid "Your REST API is being cached. Please clear any caching plugin and any server cache, logout, clear your browser cache, and try again."
109
+ msgstr ""
110
+
111
+ #: search-regex-strings.php:6, search-regex-strings.php:8, search-regex-strings.php:10, search-regex-strings.php:13, search-regex-strings.php:18
112
+ msgid "Read this REST API guide for more information."
113
+ msgstr ""
114
+
115
+ #: search-regex-strings.php:7
116
+ msgid "Your REST API is probably being blocked by a security plugin. Please disable this, or configure it to allow REST API requests."
117
+ msgstr ""
118
+
119
+ #: search-regex-strings.php:9
120
+ msgid "Your REST API is returning a 404 page. This may be caused by a security plugin, or your server may be misconfigured"
121
+ msgstr ""
122
+
123
+ #: search-regex-strings.php:11
124
+ msgid "Your server has rejected the request for being too big. You will need to change it to continue."
125
+ msgstr ""
126
+
127
+ #: search-regex-strings.php:12
128
+ msgid "This could be a security plugin, or your server is out of memory or has an external error. Please check your server error log"
129
+ msgstr ""
130
+
131
+ #: search-regex-strings.php:14
132
+ msgid "Your WordPress REST API has been disabled. You will need to enable it for Search Regex to continue working"
133
+ msgstr ""
134
+
135
+ #: search-regex-strings.php:15
136
+ msgid "WordPress returned an unexpected message. This is probably a PHP error from another plugin."
137
+ msgstr ""
138
+
139
+ #: search-regex-strings.php:16
140
+ msgid "Possible cause"
141
+ msgstr ""
142
+
143
+ #: search-regex-strings.php:17
144
+ msgid "Unable to make request due to browser security. This is typically because your WordPress and Site URL settings are inconsistent, or the request was blocked by your site CORS policy."
145
+ msgstr ""
146
+
147
+ #: search-regex-strings.php:19
148
+ msgid "Editing %s"
149
+ msgstr ""
150
+
151
+ #: search-regex-strings.php:20
152
+ msgid "Save"
153
+ msgstr ""
154
+
155
+ #: search-regex-strings.php:21
156
+ msgid "Close"
157
+ msgstr ""
158
+
159
+ #: search-regex-strings.php:22
160
+ msgid "Please {{strong}}create an issue{{/strong}} or send it in an {{strong}}email{{/strong}}."
161
+ msgstr ""
162
+
163
+ #: search-regex-strings.php:23
164
+ msgid "Create An Issue"
165
+ msgstr ""
166
+
167
+ #: search-regex-strings.php:24, source/core/comment.php:23
168
+ msgid "Email"
169
+ msgstr ""
170
+
171
+ #: search-regex-strings.php:25
172
+ msgid "Include these details in your report along with a description of what you were doing and a screenshot."
173
+ msgstr ""
174
+
175
+ #: search-regex-strings.php:26
176
+ msgid "You are not authorised to access this page."
177
+ msgstr ""
178
+
179
+ #: search-regex-strings.php:27
180
+ msgid "This is usually fixed by doing one of these:"
181
+ msgstr ""
182
+
183
+ #: search-regex-strings.php:28
184
+ msgid "Reload the page - your current session is old."
185
+ msgstr ""
186
+
187
+ #: search-regex-strings.php:29
188
+ msgid "Log out, clear your browser cache, and log in again - your browser has cached an old session."
189
+ msgstr ""
190
+
191
+ #: search-regex-strings.php:30
192
+ msgid "Your admin pages are being cached. Clear this cache and try again."
193
+ msgstr ""
194
+
195
+ #: search-regex-strings.php:31
196
+ msgid "The problem is almost certainly caused by one of the above."
197
+ msgstr ""
198
+
199
+ #: search-regex-strings.php:32, search-regex-strings.php:39
200
+ msgid "That didn't help"
201
+ msgstr ""
202
+
203
+ #: search-regex-strings.php:33, search-regex-strings.php:88
204
+ msgid "Something went wrong 🙁"
205
+ msgstr ""
206
+
207
+ #: search-regex-strings.php:34
208
+ msgid "What do I do next?"
209
+ msgstr ""
210
+
211
+ #: search-regex-strings.php:35
212
+ msgid "Take a look at the {{link}}plugin status{{/link}}. It may be able to identify and \"magic fix\" the problem."
213
+ msgstr ""
214
+
215
+ #: search-regex-strings.php:36
216
+ msgid "{{link}}Caching software{{/link}}, in particular Cloudflare, can cache the wrong thing. Try clearing all your caches."
217
+ msgstr ""
218
+
219
+ #: search-regex-strings.php:37
220
+ msgid "{{link}}Please temporarily disable other plugins!{{/link}} This fixes so many problems."
221
+ msgstr ""
222
+
223
+ #: search-regex-strings.php:38
224
+ msgid "If you are using WordPress 5.2 or newer then look at your {{link}}Site Health{{/link}} and resolve any issues."
225
+ msgstr ""
226
+
227
+ #: search-regex-strings.php:40
228
+ msgid "Search & Replace"
229
+ msgstr ""
230
+
231
+ #: search-regex-strings.php:41, search-regex-strings.php:82
232
+ msgid "Options"
233
+ msgstr ""
234
+
235
+ #: search-regex-strings.php:42, search-regex-strings.php:83
236
+ msgid "Support"
237
+ msgstr ""
238
+
239
+ #: search-regex-strings.php:43
240
+ msgid "Replacement for this match"
241
+ msgstr ""
242
+
243
+ #: search-regex-strings.php:44
244
+ msgid "Replace single phrase."
245
+ msgstr ""
246
+
247
+ #: search-regex-strings.php:45
248
+ msgid "View notice"
249
+ msgstr ""
250
+
251
+ #: search-regex-strings.php:46
252
+ msgid "Single"
253
+ msgstr ""
254
+
255
+ #: search-regex-strings.php:47
256
+ msgid "Multi"
257
+ msgstr ""
258
+
259
+ #: search-regex-strings.php:48
260
+ msgid "Remove"
261
+ msgstr ""
262
+
263
+ #: search-regex-strings.php:49
264
+ msgid "Search phrase will be removed"
265
+ msgstr ""
266
+
267
+ #: search-regex-strings.php:50, search-regex-strings.php:73, search-regex-strings.php:114
268
+ msgid "Replace"
269
+ msgstr ""
270
+
271
+ #: search-regex-strings.php:51, search-regex-strings.php:110
272
+ msgid "Cancel"
273
+ msgstr ""
274
+
275
+ #: search-regex-strings.php:52
276
+ msgid "Replace progress"
277
+ msgstr ""
278
+
279
+ #: search-regex-strings.php:53, search-regex-strings.php:56
280
+ msgid "Finished!"
281
+ msgstr ""
282
+
283
+ #: search-regex-strings.php:54
284
+ msgid "Rows updated: %s"
285
+ msgstr ""
286
+
287
+ #: search-regex-strings.php:55
288
+ msgid "Phrases replaced: %s"
289
+ msgstr ""
290
+
291
+ #: search-regex-strings.php:57
292
+ msgid "Working!"
293
+ msgstr ""
294
+
295
+ #: search-regex-strings.php:58
296
+ msgid "Show Full"
297
+ msgstr ""
298
+
299
+ #: search-regex-strings.php:59
300
+ msgid "Hide"
301
+ msgstr ""
302
+
303
+ #: search-regex-strings.php:60
304
+ msgid "Switch to this API"
305
+ msgstr ""
306
+
307
+ #: search-regex-strings.php:61
308
+ msgid "Current API"
309
+ msgstr ""
310
+
311
+ #: search-regex-strings.php:62
312
+ msgid "Good"
313
+ msgstr ""
314
+
315
+ #: search-regex-strings.php:63
316
+ msgid "Working but some issues"
317
+ msgstr ""
318
+
319
+ #: search-regex-strings.php:64
320
+ msgid "Not working but fixable"
321
+ msgstr ""
322
+
323
+ #: search-regex-strings.php:65
324
+ msgid "Unavailable"
325
+ msgstr ""
326
+
327
+ #: search-regex-strings.php:66
328
+ msgid "There are some problems connecting to your REST API. It is not necessary to fix these problems and the plugin is able to work."
329
+ msgstr ""
330
+
331
+ #: search-regex-strings.php:67
332
+ msgid "Your REST API is not working and the plugin will not be able to continue until this is fixed."
333
+ msgstr ""
334
+
335
+ #: search-regex-strings.php:68
336
+ msgid "You are using a broken REST API route. Changing to a working API should fix the problem."
337
+ msgstr ""
338
 
339
+ #: search-regex-strings.php:69
340
+ msgid "Summary"
341
  msgstr ""
342
 
343
+ #: search-regex-strings.php:70
344
+ msgid "Show Problems"
345
  msgstr ""
346
 
347
+ #: search-regex-strings.php:71
348
+ msgid "Testing - %s$"
349
+ msgstr ""
350
+
351
+ #: search-regex-strings.php:72
352
+ msgid "Check Again"
353
+ msgstr ""
354
+
355
+ #: search-regex-strings.php:74
356
+ msgid "Replacement for all matches in this row"
357
+ msgstr ""
358
+
359
+ #: search-regex-strings.php:75
360
+ msgid "Edit"
361
+ msgstr ""
362
+
363
+ #: search-regex-strings.php:76
364
+ msgid "Editor"
365
+ msgstr ""
366
+
367
+ #: search-regex-strings.php:77
368
+ msgid "Delete"
369
+ msgstr ""
370
+
371
+ #: search-regex-strings.php:78
372
+ msgid "Replace %(count)s match."
373
+ msgid_plural "Replace %(count)s matches."
374
+ msgstr[0] ""
375
+ msgstr[1] ""
376
+
377
+ #: search-regex-strings.php:79
378
+ msgid "Maximum number of matches exceeded and hidden from view. These will be included in any replacements."
379
+ msgstr ""
380
+
381
+ #: search-regex-strings.php:80
382
+ msgid "Show %s more"
383
+ msgid_plural "Show %s more"
384
+ msgstr[0] ""
385
+ msgstr[1] ""
386
+
387
+ #: search-regex-strings.php:81
388
  msgid "Search Regex"
389
  msgstr ""
390
 
391
+ #: search-regex-strings.php:84
392
+ msgid "Cached Search Regex detected"
393
  msgstr ""
394
 
395
+ #: search-regex-strings.php:85
396
+ msgid "Please clear your browser cache and reload this page."
397
  msgstr ""
398
 
399
+ #: search-regex-strings.php:86
400
+ msgid "If you are using a caching system such as Cloudflare then please read this: "
401
  msgstr ""
402
 
403
+ #: search-regex-strings.php:87
404
+ msgid "clearing your cache."
405
  msgstr ""
406
 
407
+ #: search-regex-strings.php:89
408
+ msgid "Search Regex is not working. Try clearing your browser cache and reloading this page."
409
  msgstr ""
410
 
411
+ #: search-regex-strings.php:91
412
+ msgid "If that doesn't help, open your browser's error console and create a {{link}}new issue{{/link}} with the details."
413
  msgstr ""
414
 
415
+ #: search-regex-strings.php:92
416
+ msgid "Please mention {{code}}%s{{/code}}, and explain what you were doing at the time"
417
  msgstr ""
418
 
419
+ #: search-regex-strings.php:93
420
+ msgid "You've supported this plugin - thank you!"
421
  msgstr ""
422
 
423
+ #: search-regex-strings.php:94
424
+ msgid "I'd like to support some more."
425
  msgstr ""
426
 
427
+ #: search-regex-strings.php:95
428
+ msgid "Search Regex is free to use - life is wonderful and lovely! It has required a great deal of time and effort to develop and you can help support this development by {{strong}}making a small donation{{/strong}}."
429
  msgstr ""
430
 
431
+ #: search-regex-strings.php:96
432
+ msgid "You get useful software and I get to carry on making it better."
433
  msgstr ""
434
 
435
+ #: search-regex-strings.php:97
436
+ msgid "Support 💰"
437
  msgstr ""
438
 
439
+ #: search-regex-strings.php:98
440
+ msgid "Plugin Support"
441
  msgstr ""
442
 
443
+ #: search-regex-strings.php:99
444
+ msgid "Default REST API"
445
  msgstr ""
446
 
447
+ #: search-regex-strings.php:100
448
+ msgid "Raw REST API"
449
  msgstr ""
450
 
451
+ #: search-regex-strings.php:101
452
+ msgid "Relative REST API"
453
  msgstr ""
454
 
455
+ #: search-regex-strings.php:102
456
+ msgid "I'm a nice person and I have helped support the author of this plugin"
457
  msgstr ""
458
 
459
+ #: search-regex-strings.php:103
460
+ msgid "REST API"
461
  msgstr ""
462
 
463
+ #: search-regex-strings.php:104
464
+ msgid "How Search Regex uses the REST API - don't change unless necessary"
465
  msgstr ""
466
 
467
+ #: search-regex-strings.php:105
468
+ msgid "Update"
469
  msgstr ""
470
 
471
+ #: search-regex-strings.php:106
472
+ msgid "You are advised to backup your data before making modifications."
473
  msgstr ""
474
 
475
+ #: search-regex-strings.php:107
476
+ msgid "Search and replace information in your database."
477
+ msgstr ""
478
+
479
+ #: search-regex-strings.php:108, search-regex-strings.php:111
480
+ msgid "Search"
481
+ msgstr ""
482
+
483
+ #: search-regex-strings.php:109
484
+ msgid "Replace All"
485
+ msgstr ""
486
+
487
+ #: search-regex-strings.php:112
488
+ msgid "Enter search phrase"
489
+ msgstr ""
490
+
491
+ #: search-regex-strings.php:113
492
+ msgid "Search Flags"
493
+ msgstr ""
494
+
495
+ #: search-regex-strings.php:115
496
+ msgid "Enter global replacement text"
497
+ msgstr ""
498
+
499
+ #: search-regex-strings.php:116, search-regex-strings.php:156
500
  msgid "Source"
501
  msgstr ""
502
 
503
+ #: search-regex-strings.php:117
504
+ msgid "Source Options"
505
  msgstr ""
506
 
507
+ #: search-regex-strings.php:118
508
+ msgid "Results"
509
  msgstr ""
510
 
511
+ #: search-regex-strings.php:119
512
+ msgid "Need more help?"
513
  msgstr ""
514
 
515
+ #: search-regex-strings.php:120
516
+ msgid "Full documentation for Search Regex can be found at {{site}}https://searchregex.com{{/site}}."
517
  msgstr ""
518
 
519
+ #: search-regex-strings.php:121
520
+ msgid "If you want to report a bug please read the {{report}}Reporting Bugs{{/report}} guide."
521
  msgstr ""
522
 
523
+ #: search-regex-strings.php:122
524
+ msgid "Please note that any support is provide on as-time-is-available basis and is not guaranteed. I do not provide paid support."
525
  msgstr ""
526
 
527
+ #: search-regex-strings.php:123
528
+ msgid "If you want to submit information that you don't want in a public repository then send it directly via {{email}}email{{/email}} - include as much information as you can!"
529
  msgstr ""
530
 
531
+ #: search-regex-strings.php:124, source/plugin/redirection.php:76
532
+ msgid "Redirection"
533
  msgstr ""
534
 
535
+ #: search-regex-strings.php:125
536
+ msgid "Like this plugin? You might want to consider {{link}}Redirection{{/link}}, a plugin to manage redirects, that is also written by me."
537
  msgstr ""
538
 
539
+ #: search-regex-strings.php:126
540
+ msgid "Quick Help"
541
  msgstr ""
542
 
543
+ #: search-regex-strings.php:132
544
+ msgid "Settings saved"
545
  msgstr ""
546
 
547
+ #: search-regex-strings.php:133
548
+ msgid "Row deleted"
549
  msgstr ""
550
 
551
+ #: search-regex-strings.php:134
552
+ msgid "Row replaced"
553
  msgstr ""
554
 
555
+ #: search-regex-strings.php:135
556
+ msgid "Row updated"
557
  msgstr ""
558
 
559
+ #: search-regex-strings.php:136
560
+ msgid "Regular Expression"
561
  msgstr ""
562
 
563
+ #: search-regex-strings.php:137
564
+ msgid "Ignore Case"
565
  msgstr ""
566
 
567
+ #: search-regex-strings.php:138
568
+ msgid "25 per page "
569
  msgstr ""
570
 
571
+ #: search-regex-strings.php:139
572
+ msgid "50 per page "
573
+ msgstr ""
574
+
575
+ #: search-regex-strings.php:140
576
+ msgid "100 per page"
577
+ msgstr ""
578
+
579
+ #: search-regex-strings.php:141
580
+ msgid "250 per page"
581
+ msgstr ""
582
+
583
+ #: search-regex-strings.php:142
584
+ msgid "500 per page"
585
+ msgstr ""
586
+
587
+ #: search-regex-strings.php:143
588
+ msgid "%s database row in total"
589
+ msgid_plural "%s database rows in total"
590
+ msgstr[0] ""
591
+ msgstr[1] ""
592
+
593
+ #: search-regex-strings.php:144, search-regex-strings.php:149
594
+ msgid "First page"
595
+ msgstr ""
596
+
597
+ #: search-regex-strings.php:145, search-regex-strings.php:150
598
+ msgid "Prev page"
599
+ msgstr ""
600
+
601
+ #: search-regex-strings.php:146
602
+ msgid "Progress %(current)s$"
603
+ msgstr ""
604
+
605
+ #: search-regex-strings.php:147, search-regex-strings.php:152
606
+ msgid "Next page"
607
+ msgstr ""
608
+
609
+ #: search-regex-strings.php:148
610
+ msgid "Matches: %(phrases)s across %(rows)s database row."
611
+ msgid_plural "Matches: %(phrases)s across %(rows)s database rows."
612
+ msgstr[0] ""
613
+ msgstr[1] ""
614
+
615
+ #: search-regex-strings.php:151
616
+ msgid "Page %(current)s of %(total)s"
617
+ msgstr ""
618
+
619
+ #: search-regex-strings.php:153
620
+ msgid "Last page"
621
+ msgstr ""
622
+
623
+ #: search-regex-strings.php:154
624
+ msgid "No more matching results found."
625
+ msgstr ""
626
+
627
+ #: search-regex-strings.php:155
628
+ msgid "Maximum number of page requests has been exceeded and the search stopped. Try to be more specific with your search term."
629
+ msgstr ""
630
+
631
+ #: search-regex-strings.php:157
632
+ msgid "Row ID"
633
+ msgstr ""
634
+
635
+ #: search-regex-strings.php:158
636
+ msgid "Matches"
637
+ msgstr ""
638
+
639
+ #: search-regex-strings.php:159
640
+ msgid "Matched Phrases"
641
+ msgstr ""
642
+
643
+ #: search-regex-strings.php:160
644
+ msgid "Actions"
645
+ msgstr ""
646
+
647
+ #. translators: 1: server PHP version. 2: required PHP version.
648
+ #: search-regex.php:33
649
+ msgid "Disabled! Detected PHP %1$s, need PHP %2$s+"
650
+ msgstr ""
651
+
652
+ #: models/source-manager.php:21
653
+ msgid "All Post Types"
654
+ msgstr ""
655
+
656
+ #: models/source-manager.php:22
657
+ msgid "Search all posts, pages, and custom post types."
658
+ msgstr ""
659
+
660
+ #: models/source-manager.php:28
661
+ msgid "Post Meta"
662
+ msgstr ""
663
+
664
+ #: models/source-manager.php:29
665
+ msgid "Search post meta names and values."
666
+ msgstr ""
667
+
668
+ #: models/source-manager.php:35
669
+ msgid "Comments"
670
+ msgstr ""
671
+
672
+ #: models/source-manager.php:36
673
+ msgid "Search comment content, URL, and author, with optional support for spam comments."
674
+ msgstr ""
675
+
676
+ #: models/source-manager.php:42
677
+ msgid "Comment Meta"
678
+ msgstr ""
679
+
680
+ #: models/source-manager.php:43
681
+ msgid "Search comment meta names and values."
682
+ msgstr ""
683
+
684
+ #: models/source-manager.php:49
685
+ msgid "Users"
686
+ msgstr ""
687
+
688
+ #: models/source-manager.php:50
689
+ msgid "Search user email, URL, and name."
690
+ msgstr ""
691
+
692
+ #: models/source-manager.php:56
693
+ msgid "User Meta"
694
+ msgstr ""
695
+
696
+ #: models/source-manager.php:57
697
+ msgid "Search user meta name and values."
698
+ msgstr ""
699
+
700
+ #: models/source-manager.php:63
701
+ msgid "WordPress Options"
702
+ msgstr ""
703
+
704
+ #: models/source-manager.php:64
705
+ msgid "Search all WordPress options."
706
+ msgstr ""
707
+
708
+ #: models/source-manager.php:113
709
+ msgid "Standard Types"
710
+ msgstr ""
711
+
712
+ #: models/source-manager.php:120
713
+ msgid "Specific Post Types"
714
+ msgstr ""
715
+
716
+ #: models/source-manager.php:127
717
+ msgid "Plugins"
718
+ msgstr ""
719
+
720
+ #: source/core/comment.php:22, source/core/meta.php:19, source/core/options.php:19
721
+ msgid "Name"
722
+ msgstr ""
723
+
724
+ #: source/core/comment.php:24, source/core/user.php:22, source/plugin/redirection.php:27
725
+ msgid "URL"
726
+ msgstr ""
727
+
728
+ #: source/core/comment.php:25
729
+ msgid "Comment"
730
+ msgstr ""
731
+
732
+ #: source/core/comment.php:54
733
+ msgid "Include spam comments"
734
+ msgstr ""
735
+
736
+ #: source/core/meta.php:20, source/core/options.php:20
737
+ msgid "Value"
738
+ msgstr ""
739
+
740
+ #: source/core/post.php:45
741
+ msgid "Search GUID"
742
+ msgstr ""
743
+
744
+ #: source/core/post.php:80
745
+ msgid "Content"
746
+ msgstr ""
747
+
748
+ #: source/core/post.php:81
749
+ msgid "Excerpt"
750
+ msgstr ""
751
+
752
+ #: source/core/post.php:82, source/plugin/redirection.php:28
753
+ msgid "Title"
754
+ msgstr ""
755
+
756
+ #: source/core/post.php:83
757
+ msgid "Slug"
758
+ msgstr ""
759
+
760
+ #: source/core/post.php:84
761
+ msgid "GUID"
762
+ msgstr ""
763
+
764
+ #: source/core/user.php:21
765
+ msgid "Nicename"
766
+ msgstr ""
767
+
768
+ #: source/core/user.php:23
769
+ msgid "Display name"
770
  msgstr ""
771
 
772
+ #: source/plugin/redirection.php:77
773
+ msgid "Search your redirects"
774
  msgstr ""
models/match-column.php ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SearchRegex;
4
+
5
+ class Match_Column {
6
+ const CONTEXT_LIMIT = 20;
7
+
8
+ /** @var string Column ID */
9
+ private $column_id;
10
+ /** @var string */
11
+ private $column_label;
12
+ /** @var Match_Context[] */
13
+ private $contexts;
14
+ /** @var int */
15
+ private $context_count;
16
+ /** @var int */
17
+ private $match_count;
18
+ /** @var string */
19
+ private $replacement;
20
+
21
+ /**
22
+ * Create a Match Column, which contains an array of Match_Context items for a particular database column.
23
+ *
24
+ * @param string $column_id Column ID.
25
+ * @param string $column_label Descriptive column label, shown to the user.
26
+ * @param string $replacement The replaced value.
27
+ * @param Match_Context[] $contexts Array of Match_Context items for this column.
28
+ */
29
+ public function __construct( $column_id, $column_label, $replacement, array $contexts ) {
30
+ $this->match_count = 0;
31
+
32
+ foreach ( $contexts as $context ) {
33
+ $this->match_count += $context->get_match_count();
34
+ }
35
+
36
+ $this->column_id = $column_id;
37
+ $this->column_label = $column_label;
38
+ $this->context_count = count( $contexts );
39
+ $this->contexts = array_slice( $contexts, 0, self::CONTEXT_LIMIT );
40
+ $this->replacement = $replacement;
41
+ }
42
+
43
+ /**
44
+ * Convert the Match_Context to JSON
45
+ *
46
+ * @return Array JSON data
47
+ */
48
+ public function to_json() {
49
+ $contexts = [];
50
+
51
+ foreach ( $this->contexts as $context ) {
52
+ $contexts[] = $context->to_json();
53
+ }
54
+
55
+ return [
56
+ 'column_id' => $this->column_id,
57
+ 'column_label' => $this->column_label,
58
+ 'contexts' => $contexts,
59
+ 'context_count' => $this->context_count,
60
+ 'match_count' => $this->match_count,
61
+ 'replacement' => $this->replacement, // TODO is this needed?
62
+ ];
63
+ }
64
+
65
+ /**
66
+ * Get column ID
67
+ *
68
+ * @return String Column ID
69
+ */
70
+ public function get_column_id() {
71
+ return $this->column_id;
72
+ }
73
+
74
+ /**
75
+ * Get match count
76
+ *
77
+ * @return Int Match count
78
+ */
79
+ public function get_match_count() {
80
+ return $this->match_count;
81
+ }
82
+
83
+ /**
84
+ * Get the replacement
85
+ *
86
+ * @param Int|null $pos_id Position within the raw data.
87
+ * @param Array $raw Raw column data.
88
+ * @return Bool|String Replaced data, or false
89
+ */
90
+ public function get_replacement( $pos_id, array $raw ) {
91
+ if ( $pos_id !== null ) {
92
+ foreach ( $this->contexts as $context ) {
93
+ $match = $context->get_match_at_position( $pos_id );
94
+
95
+ if ( is_object( $match ) && isset( $raw[ $this->column_id ] ) ) {
96
+ // Need to replace the match with the result in the raw data
97
+ return $match->replace_at_position( $raw[ $this->column_id ] );
98
+ }
99
+ }
100
+
101
+ return false;
102
+ }
103
+
104
+ return $this->replacement;
105
+ }
106
+ }
models/match-context.php ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SearchRegex;
4
+
5
+ /**
6
+ * A group of matches within the same area of a column
7
+ */
8
+ class Match_Context {
9
+ const MATCH_LIMIT = 100;
10
+ const CONTEXT_RANGE = 100;
11
+ const CHARS_BEFORE = 50;
12
+ const CHARS_AFTER = 60;
13
+
14
+ /** @var Int */
15
+ private $context_id;
16
+ /** @var String|null */
17
+ private $context = null;
18
+ /** @var Match[] */
19
+ private $matches = [];
20
+ /** @var Int */
21
+ private $match_count = 0;
22
+
23
+ /**
24
+ * Create a Match_Context with a given context ID
25
+ *
26
+ * @param int $context_id Context ID.
27
+ */
28
+ public function __construct( $context_id ) {
29
+ $this->context_id = $context_id;
30
+ }
31
+
32
+ /**
33
+ * Return the number of matches within this context
34
+ *
35
+ * @return Int Match count
36
+ */
37
+ public function get_match_count() {
38
+ return $this->match_count;
39
+ }
40
+
41
+ /**
42
+ * Convert the Match_Context to to_json
43
+ *
44
+ * @return Array JSON
45
+ */
46
+ public function to_json() {
47
+ $matches = [];
48
+
49
+ foreach ( $this->matches as $match ) {
50
+ $matches[] = $match->to_json();
51
+ }
52
+
53
+ return [
54
+ 'context_id' => $this->context_id,
55
+ 'context' => $this->context,
56
+ 'matches' => $matches,
57
+ 'match_count' => $this->match_count,
58
+ ];
59
+ }
60
+
61
+ /**
62
+ * Determine if the Match object is within this context.
63
+ *
64
+ * @param Match $match The match to check.
65
+ * @return Bool true if within the context, false otherwise
66
+ */
67
+ public function is_within_context( Match $match ) {
68
+ if ( $this->context === null ) {
69
+ return true;
70
+ }
71
+
72
+ $last_match = $this->matches[ count( $this->matches ) - 1 ];
73
+
74
+ return $match->get_position() - $last_match->get_position() < self::CONTEXT_RANGE;
75
+ }
76
+
77
+ /**
78
+ * Add a Match to this context
79
+ *
80
+ * @param Match $match The match to do.
81
+ * @param String $value The column value.
82
+ * @return void
83
+ */
84
+ public function add_match( Match $match, $value ) {
85
+ $this->match_count++;
86
+
87
+ if ( count( $this->matches ) === self::MATCH_LIMIT ) {
88
+ return;
89
+ }
90
+
91
+ // Add match to list
92
+ $this->matches[] = $match;
93
+
94
+ // Expand the context to include everything from the first to last match
95
+ $start_pos = max( 0, $this->matches[0]->get_position() - self::CHARS_BEFORE );
96
+
97
+ $end_pos = $match->get_position() + strlen( $match->get_matched_text() ) + self::CHARS_AFTER;
98
+
99
+ $this->context = mb_substr( $value, $start_pos, $end_pos - $start_pos, 'UTF-8' );
100
+
101
+ // Finally update the match
102
+ $match->set_context( $match->get_position() - $start_pos );
103
+ }
104
+
105
+ /**
106
+ * Find the Match that exists at the given position
107
+ *
108
+ * @param int $pos_id Position.
109
+ * @return Match|Bool Match at position
110
+ */
111
+ public function get_match_at_position( $pos_id ) {
112
+ foreach ( $this->matches as $match ) {
113
+ if ( $match->get_position() === $pos_id ) {
114
+ return $match;
115
+ }
116
+ }
117
+
118
+ return false;
119
+ }
120
+ }
models/match.php ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SearchRegex;
4
+
5
+ use SearchRegex\Match_Context;
6
+
7
+ /**
8
+ * Represents a single match
9
+ */
10
+ class Match {
11
+ /** @var Int */
12
+ private $pos_id;
13
+ /** @var String */
14
+ private $match;
15
+ /** @var Int */
16
+ private $context_offset = 0;
17
+ /** @var String */
18
+ private $replacement;
19
+ /** @var String[] */
20
+ private $captures;
21
+
22
+ /**
23
+ * Create a Match given the matched phrase, the match offset, and what the match is replaced with
24
+ *
25
+ * @param String $match The matched phrased. Typical the search phrase unless a regular expression search.
26
+ * @param int $match_offset The offset within the column.
27
+ * @param String $replacement The replaced value, if one is supplied.
28
+ */
29
+ public function __construct( $match, $match_offset, $replacement ) {
30
+ $this->pos_id = intval( $match_offset, 10 );
31
+ $this->match = $match;
32
+ $this->replacement = $replacement;
33
+ $this->captures = [];
34
+ }
35
+
36
+ /**
37
+ * Add a regular expression capture value
38
+ *
39
+ * @param String $capture Captured value.
40
+ * @return void
41
+ */
42
+ public function add_capture( $capture ) {
43
+ $this->captures[] = $capture;
44
+ }
45
+
46
+ /**
47
+ * Get match position
48
+ *
49
+ * @return Int Position
50
+ */
51
+ public function get_position() {
52
+ return $this->pos_id;
53
+ }
54
+
55
+ /**
56
+ * Get matched text
57
+ *
58
+ * @return String Matched text
59
+ */
60
+ public function get_matched_text() {
61
+ return $this->match;
62
+ }
63
+
64
+ /**
65
+ * Set the context offset - the offset within the context that this match belongs to
66
+ *
67
+ * @param Int $context_offset The context offset.
68
+ * @return void
69
+ */
70
+ public function set_context( $context_offset ) {
71
+ $this->context_offset = $context_offset;
72
+ }
73
+
74
+ /**
75
+ * Convert this match to JSON
76
+ *
77
+ * @return Array JSON
78
+ */
79
+ public function to_json() {
80
+ return [
81
+ 'pos_id' => $this->pos_id,
82
+ 'context_offset' => $this->context_offset,
83
+ 'match' => $this->match,
84
+ 'replacement' => $this->replacement,
85
+ 'captures' => $this->captures,
86
+ ];
87
+ }
88
+
89
+ /**
90
+ * Encode a search as a regular expression
91
+ *
92
+ * @param String $search Search phrase.
93
+ * @param Search_Flags $flags Is this regular expression.
94
+ * @return String Encoded search phrase
95
+ */
96
+ public static function get_pattern( $search, Search_Flags $flags ) {
97
+ $pattern = \preg_quote( $search, '@' );
98
+
99
+ if ( $flags->is_regex() ) {
100
+ $pattern = str_replace( '@', '\\@', $search );
101
+ }
102
+
103
+ $pattern = '@' . $pattern . '@';
104
+
105
+ if ( $flags->is_case_insensitive() ) {
106
+ $pattern .= 'i';
107
+ }
108
+
109
+ // UTF-8 support
110
+ return $pattern . 'u';
111
+ }
112
+
113
+ /**
114
+ * Get all matches for a search phrase on a column
115
+ *
116
+ * @param String $search The search phrase.
117
+ * @param Search_Flags $flags Any search flags.
118
+ * @param Array $replacements A matching set of replacements.
119
+ * @param String $column_value The content to match.
120
+ * @return Array Array of Match contexts
121
+ */
122
+ public static function get_all( $search, Search_Flags $flags, array $replacements, $column_value ) {
123
+ $pattern = self::get_pattern( $search, $flags );
124
+ $contexts = [];
125
+
126
+ if ( \preg_match_all( $pattern, $column_value, $searches, PREG_OFFSET_CAPTURE ) > 0 ) {
127
+ $current_context = new Match_Context( 0 );
128
+ $contexts[] = $current_context;
129
+
130
+ // Go through each search match and create a Match
131
+ foreach ( $searches[0] as $match_pos => $match ) {
132
+ // Adjust for UTF8 strings
133
+ $pos = mb_strlen( substr( $column_value, 0, $match[1] ), 'utf-8' );
134
+
135
+ // Create a match
136
+ $match = new Match( $match[0], $pos, isset( $replacements[ $match_pos ] ) ? $replacements[ $match_pos ] : '' );
137
+
138
+ // Add any captures
139
+ foreach ( array_slice( $searches, 1 ) as $capture ) {
140
+ $match->add_capture( $capture[ $match_pos ][0] );
141
+ }
142
+
143
+ // Is the match within range of the current context
144
+ if ( ! $current_context->is_within_context( $match ) ) {
145
+ // No - create a new context
146
+ $current_context = new Match_Context( count( $contexts ) );
147
+ $contexts[] = $current_context;
148
+ }
149
+
150
+ // Add the match to the context
151
+ $current_context->add_match( $match, $column_value );
152
+ }
153
+ }
154
+
155
+ return $contexts;
156
+ }
157
+
158
+ /**
159
+ * Return the replacement at the matches position of the given text.
160
+ *
161
+ * @param String $text Text value.
162
+ * @return String The $text value, with the replacement inserted at the Match position
163
+ */
164
+ public function replace_at_position( $text ) {
165
+ return mb_substr( $text, 0, $this->pos_id, 'UTF-8' ) . $this->replacement . mb_substr( $text, $this->pos_id + mb_strlen( $this->match, 'UTF-8' ), null, 'UTF-8' );
166
+ }
167
+ }
models/replace.php ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SearchRegex;
4
+
5
+ use SearchRegex\Result_Collection;
6
+ use SearchRegex\Match;
7
+
8
+ /**
9
+ * Performs plain and regular expressions of single and global replacements
10
+ */
11
+ class Replace {
12
+ /** @var String */
13
+ private $replace;
14
+ /** @var Search_Source[] */
15
+ private $sources = [];
16
+ /** @var Search_Flags */
17
+ private $flags;
18
+
19
+ const BEFORE = '<SEARCHREGEX>';
20
+ const AFTER = '</SEARCHREGEX>';
21
+
22
+ /**
23
+ * Create a Replace object given a replacement value, the Search_Sources, and Search_Flags
24
+ *
25
+ * @param String $replace_value Value to replace with.
26
+ * @param Array $sources Array of Search_Sources. Only one is currently supported.
27
+ * @param Search_Flags $flags The Search_Flags.
28
+ */
29
+ public function __construct( $replace_value, array $sources, Search_Flags $flags ) {
30
+ $this->replace = $replace_value;
31
+ $this->flags = $flags;
32
+ $this->sources = $sources;
33
+ }
34
+
35
+ /**
36
+ * Return all the replace positions - the positions within the content where the search is matched.
37
+ *
38
+ * @param String $search Search value.
39
+ * @param String $value Content to search.
40
+ * @return Array Array of match positions
41
+ */
42
+ public function get_replace_positions( $search, $value ) {
43
+ // Global replace
44
+ $result = $this->replace_all( $search, self::BEFORE . $this->replace . self::AFTER, $value );
45
+
46
+ // Split into array
47
+ $pattern = '@' . self::BEFORE . '(.*?)' . self::AFTER . '@';
48
+ if ( $this->flags->is_case_insensitive() ) {
49
+ $pattern .= 'i';
50
+ }
51
+
52
+ if ( \preg_match_all( $pattern, $result, $searches ) > 0 ) {
53
+ return $searches[1];
54
+ }
55
+
56
+ return [];
57
+ }
58
+
59
+ /**
60
+ * Globally replace all matches with the content
61
+ *
62
+ * @param String $search Search value.
63
+ * @param String $value Content to replace within.
64
+ * @return String The `$value` with all the matches replaced
65
+ */
66
+ public function get_global_replace( $search, $value ) {
67
+ return $this->replace_all( $search, $this->replace, $value );
68
+ }
69
+
70
+ /**
71
+ * Perform a replace on a set of results, optionally with the column and column position specified.
72
+ * Changes are saved to the database.
73
+ *
74
+ * @param Array $results Array of Result objects.
75
+ * @param String $column_id The optional column. If specified only this column is replaced.
76
+ * @param Int $pos_id The optional position within the column. If specified only this match is replaced.
77
+ * @return Array|\WP_Error A summary consisting of `rows`, the total number of rows changed, and `phrases` containing how many replacements were made
78
+ */
79
+ public function save_and_replace( array $results, $column_id = null, $pos_id = null ) {
80
+ $rows_replaced = 0;
81
+ $phrases_replaced = 0;
82
+
83
+ foreach ( $results as $result ) {
84
+ $replaced = $this->save_and_replace_result( $result, $column_id, $pos_id );
85
+
86
+ if ( \is_wp_error( $replaced ) && is_object( $replaced ) ) {
87
+ return $replaced;
88
+ }
89
+
90
+ if ( is_int( $replaced ) && $replaced > 0 ) {
91
+ $rows_replaced++;
92
+ $phrases_replaced += $replaced;
93
+ error_log($replaced);
94
+ }
95
+ }
96
+
97
+ return [
98
+ 'rows' => $rows_replaced,
99
+ 'phrases' => $phrases_replaced,
100
+ ];
101
+ }
102
+
103
+ /**
104
+ * Perform a replacement for a single result
105
+ *
106
+ * @internal
107
+ * @param Result $result The result to replace in.
108
+ * @param String|null $column_id Column ID.
109
+ * @param Int|null $pos_id Position within column.
110
+ * @return Int|\WP_Error Number of phrases replaced, or WP_Error on error
111
+ */
112
+ private function save_and_replace_result( Result $result, $column_id, $pos_id ) {
113
+ $phrases_replaced = 0;
114
+
115
+ foreach ( $result->get_columns() as $column ) {
116
+ if ( ! $this->can_replace_column( $column_id, $column->get_column_id() ) ) {
117
+ continue;
118
+ }
119
+
120
+ $replacement = $column->get_replacement( $pos_id, $result->get_raw() );
121
+ if ( $replacement === false ) {
122
+ continue;
123
+ }
124
+
125
+ $saved = $this->sources[0]->save( $result->get_row_id(), $column->get_column_id(), $replacement );
126
+ if ( is_wp_error( $saved ) && is_object( $saved ) ) {
127
+ return $saved;
128
+ }
129
+
130
+ $phrases_replaced += $column->get_match_count();
131
+ }
132
+
133
+ return $phrases_replaced;
134
+ }
135
+
136
+ /**
137
+ * Check if we can replace this particular column
138
+ *
139
+ * @internal
140
+ * @param String|null $result_column Column.
141
+ * @param String $replace_column Column.
142
+ * @return boolean
143
+ */
144
+ private function can_replace_column( $result_column, $replace_column ) {
145
+ return $result_column === null || $result_column === $replace_column;
146
+ }
147
+
148
+ /**
149
+ * Perform a global replacement
150
+ *
151
+ * @internal
152
+ * @param String $search Search string.
153
+ * @param String $replace Replacement value.
154
+ * @param String $value Content to replace.
155
+ * @return String
156
+ */
157
+ private function replace_all( $search, $replace, $value ) {
158
+ $pattern = Match::get_pattern( $search, $this->flags );
159
+
160
+ // Global replace
161
+ return preg_replace( $pattern, $replace, $value );
162
+ }
163
+ }
models/result.php CHANGED
@@ -1,34 +1,96 @@
1
  <?php
2
 
3
- class Result
4
- {
5
- var $search;
6
- var $replace;
7
- var $content;
8
- var $id;
9
- var $title;
10
-
11
- var $offset;
12
- var $length;
13
- var $replace_string;
14
-
15
- function for_js ($js)
16
- {
17
- $js = str_replace ('\\', '\\\\', $js);
18
- $js = str_replace ('/', '\/', $js);
19
- $js = str_replace ('<', '\<', $js);
20
- $js = str_replace ("'", "\\'", $js);
21
- $js = str_replace ('"', '&quot;', $js);
22
- $js = str_replace ("\n", "\\n", $js);
23
- $js = str_replace ("\r", "\\r", $js);
24
- return $js;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  }
26
 
27
- function single_line ()
28
- {
29
- if (strpos ($this->search_plain, "\r") !== false || strpos ($this->search_plain, "\n") !== false)
30
- return false;
31
- return true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  }
33
- }
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
 
3
+ namespace SearchRegex;
4
+
5
+ /**
6
+ * Contains all information for a search result - a database row that contains matches
7
+ */
8
+ class Result {
9
+ /** @var Int */
10
+ private $row_id;
11
+ /** @var String */
12
+ private $source_type;
13
+ /** @var String */
14
+ private $source_name;
15
+ /** @var String */
16
+ private $result_title;
17
+ /** @var Match_Column[] */
18
+ private $columns;
19
+ /** @var String[] */
20
+ private $raw;
21
+ /** @var String[] */
22
+ private $actions = [];
23
+
24
+ /**
25
+ * Create the result given a row ID, the Search_Source, a set of columns, and the raw database data.
26
+ *
27
+ * @param Int $row_id Database row ID.
28
+ * @param Search_Source $source The search source.
29
+ * @param Array $columns Array of Match_Column objects.
30
+ * @param Array $raw Raw row data.
31
+ */
32
+ public function __construct( $row_id, Search_Source $source, array $columns, $raw ) {
33
+ global $wpdb;
34
+
35
+ $this->row_id = $row_id;
36
+ $this->columns = $columns;
37
+ $this->raw = $raw;
38
+ $this->source_type = $source->get_type( $raw );
39
+ $this->source_name = $source->get_name( $raw );
40
+ $this->result_title = isset( $raw[ $source->get_title_column() ] ) ? $raw[ $source->get_title_column() ] : false;
41
+ /** @psalm-suppress TooManyArguments */
42
+ $this->actions = \apply_filters( 'searchregex_result_actions', $source->get_actions( $this ), $this->source_type, $this );
43
  }
44
 
45
+ /**
46
+ * Convert the Result to JSON
47
+ *
48
+ * @return Array JSON
49
+ */
50
+ public function to_json() {
51
+ $columns = [];
52
+
53
+ foreach ( $this->columns as $column ) {
54
+ $columns[] = $column->to_json();
55
+ }
56
+
57
+ return [
58
+ 'row_id' => $this->row_id,
59
+ 'source_type' => $this->source_type,
60
+ 'source_name' => $this->source_name,
61
+ 'columns' => $columns,
62
+ 'actions' => $this->actions,
63
+ 'title' => $this->result_title,
64
+ 'match_count' => \array_reduce( $columns, function( $carry, $column ) {
65
+ return $carry + $column['match_count'];
66
+ }, 0 ),
67
+ ];
68
  }
 
69
 
70
+ /**
71
+ * Get the Match_Column array
72
+ *
73
+ * @return Array Match_Column array
74
+ */
75
+ public function get_columns() {
76
+ return $this->columns;
77
+ }
78
+
79
+ /**
80
+ * Get the raw data
81
+ *
82
+ * @return String[] Raw data
83
+ */
84
+ public function get_raw() {
85
+ return $this->raw;
86
+ }
87
+
88
+ /**
89
+ * Get the row ID
90
+ *
91
+ * @return Int Row ID
92
+ */
93
+ public function get_row_id() {
94
+ return $this->row_id;
95
+ }
96
+ }
models/search-flags.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SearchRegex;
4
+
5
+ /**
6
+ * Represents flags for a particular search
7
+ */
8
+ class Search_Flags {
9
+ /** @var String[] */
10
+ private $flags = [];
11
+
12
+ /**
13
+ * Create a Source_Flags object with an array of flag strings
14
+ *
15
+ * @param Array $flags Array of flag values.
16
+ */
17
+ public function __construct( array $flags = [] ) {
18
+ $allowed = [
19
+ 'regex',
20
+ 'case',
21
+ ];
22
+
23
+ $this->flags = array_filter( $flags, function( $flag ) use ( $allowed ) {
24
+ return array_search( $flag, $allowed, true ) !== false;
25
+ } );
26
+ }
27
+
28
+ /**
29
+ * Is the flag set?
30
+ *
31
+ * @param String $flag Flag to check.
32
+ * @return boolean true if set, false otherwise
33
+ */
34
+ public function has_flag( $flag ) {
35
+ return in_array( $flag, $this->flags, true );
36
+ }
37
+
38
+ /**
39
+ * Is the a regular expression search?
40
+ *
41
+ * @return boolean true if yes, false otherwise
42
+ */
43
+ public function is_regex() {
44
+ return $this->has_flag( 'regex' );
45
+ }
46
+
47
+ /**
48
+ * Is the a case insensitive search?
49
+ *
50
+ * @return boolean true if yes, false otherwise
51
+ */
52
+ public function is_case_insensitive() {
53
+ return $this->has_flag( 'case' );
54
+ }
55
+
56
+ /**
57
+ * Get all the flags
58
+ *
59
+ * @return Array Array of flags
60
+ */
61
+ public function get_flags() {
62
+ return $this->flags;
63
+ }
64
+ }
models/search.php CHANGED
@@ -1,231 +1,215 @@
1
  <?php
2
 
3
- class Search
4
- {
5
- var $search = null;
6
- var $replace = null;
7
- var $search_params = null;
8
- var $save = false;
9
- var $source = null;
10
- var $error = null;
11
-
12
- var $regex_options = null;
13
- var $regex_error = null;
14
- var $regex = false;
15
-
16
- function set_regex_options( $dotall, $case, $multi)
17
- {
18
- $this->regex = true;
19
- if( !empty( $case))
20
- $this->regex_options .= 'i';
21
-
22
- if( !empty( $dotall))
23
- $this->regex_options .= 's';
24
-
25
- if( !empty( $multi))
26
- $this->regex_options .= 'm';
 
 
 
 
 
 
 
 
 
 
 
27
  }
28
 
29
- function regex_error( $errno, $errstr, $errfile, $errline)
30
- {
31
- $this->regex_error = __( "Invalid regular expression", 'search-regex').": ".preg_replace( '/(.*?):/', '', $errstr);
32
- }
33
-
34
- function name() { return '';}
35
- function run_search( $search) { return false; }
36
-
37
- function search_and_replace( $search, $replace, $limit, $offset, $orderby, $save = false)
38
- {
39
- $this->replace = $replace;
40
- $results = $this->search_for_pattern( $search, $limit, $offset, $orderby);
41
-
42
- if( $results !== false && $save)
43
- $this->replace( $results);
44
- return $results;
45
- }
46
-
47
- function search_for_pattern( $search, $limit, $offset, $orderby ) {
48
- if ( !in_array( $orderby, array( 'asc', 'desc' ) ) )
49
- $orderby = 'asc';
50
-
51
- $limit = intval( $limit );
52
- $offset = intval( $offset );
53
-
54
- if ( strlen( $search ) > 0 ) {
55
- if ( !ini_get( 'safe_mode' ) )
56
- set_time_limit( 0 );
57
-
58
- // First test that the search and replace strings are valid regex
59
- if ( $this->regex ) {
60
- set_error_handler( array( &$this, 'regex_error' ) );
61
- $valid = @preg_match( $search, '', $matches );
62
- restore_error_handler();
63
-
64
- if ( $valid === false )
65
- return $this->regex_error;
66
-
67
- return $this->find( $search, $limit, $offset, $orderby );
68
  }
69
- else
70
- return $this->find( '@'.preg_quote( $search, '@' ).'@', $limit, $offset, $orderby );
71
  }
72
 
73
- return __( "No search pattern", 'search-regex' );
74
- }
 
 
75
 
76
- static function get_searches()
77
- {
78
- global $search_regex_searches;
79
- if( !is_array( $search_regex_searches))
80
- {
81
- $available = get_declared_classes();
82
- $files = glob( dirname( __FILE__).'/../searches/*.php');
83
- if( !empty( $files))
84
- {
85
- foreach( $files AS $file)
86
- include_once( $file);
87
- }
88
 
89
- $classes = array();
90
- $available = array_diff( get_declared_classes(), $available);
91
- if( count( $available) > 0)
92
- {
93
- foreach( $available AS $class)
94
- $classes[] = new $class;
95
  }
96
-
97
- $search_regex_searches = $classes;
98
  }
99
 
100
- return $search_regex_searches;
101
  }
102
 
103
- static function valid_search( $class ) {
104
- $classes = Search::get_searches();
105
- foreach ( $classes AS $item ) {
106
- if ( strcasecmp( get_class( $item ), $class ) === 0 )
107
- return true;
 
 
 
 
 
 
108
  }
109
 
110
- return false;
111
  }
112
 
113
- function matches( $pattern, $content, $id)
114
- {
115
- if( preg_match_all( $pattern.$this->regex_options, $content, $matches, PREG_OFFSET_CAPTURE) > 0)
116
- {
117
- $results = array();
118
-
119
- // We found something
120
- foreach( $matches[0] AS $found)
121
- {
122
- $result = new Result();
123
- $result->id = $id;
124
-
125
- $result->offset = $found[1];
126
- $result->length = strlen( $found[0]);
127
-
128
- // Extract the context - surrounding 40 characters either side
129
- // Index 0 is the match, index 1 is the position
130
- $start = $found[1] - 40;
131
- if( $start < 0)
132
- $start = 0;
133
-
134
- $end = $found[1] + 40;
135
- if( $end > strlen( $content))
136
- $end = strlen( $content);
137
-
138
- $end -= $start;
139
-
140
- $left = substr( $content, $start, $found[1] - $start);
141
- $right = substr( $content, $found[1] + strlen( $found[0]), $end);
142
-
143
- $result->left = $start;
144
- $result->left_length = strlen( $found[0]) +( $found[1] - $start) + $end;
145
 
146
- if( $start != 0)
147
- $result->search = '&hellip; ';
148
 
149
- $result->search .= esc_html( $left );
150
- $result->search .= '<strong>'.esc_html( $found[0] ).'</strong>';
151
- $result->search .= esc_html( $right );
 
152
 
153
- $result->search_plain = esc_html( $left );
154
- $result->search_plain .= esc_html( $found[0] );
155
- $result->search_plain .= esc_html( $right );
156
 
157
- if( $start + $end < strlen( $content))
158
- $result->search .= ' &hellip;';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
 
160
- if( !is_null( $this->replace))
161
- {
162
- // Produce preview
163
- $rep = preg_replace( $pattern.$this->regex_options, $this->replace, $found[0]);
164
- $result->replace_string = $rep;
165
 
166
- if( $start != 0)
167
- $result->replace = '&hellip; ';
 
 
168
 
169
- $result->replace .= esc_html( $left );
170
- $result->replace .= '<strong>'.esc_html( $rep ).'</strong></a>';
171
- $result->replace .= esc_html( $right );
172
 
173
- $result->left_length_replace = strlen( $left) + strlen( $rep) + strlen( $right) + 1;
 
 
174
 
175
- $result->replace_plain = esc_html( $left );
176
- $result->replace_plain .= esc_html( $rep );
177
- $result->replace_plain .= esc_html( $right );
178
 
179
- if( $start + $end < strlen( $content))
180
- $result->replace .= ' &hellip;';
 
 
 
 
 
 
 
 
 
181
 
182
- // And the real thing
183
- $result->content = preg_replace( $pattern.$this->regex_options, $this->replace, $content);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
  }
185
-
186
- $results[] = $result;
187
  }
188
 
189
- return $results;
190
- }
191
- return false;
192
- }
193
-
194
-
195
- function replace( $results)
196
- {
197
- global $wpdb;
198
-
199
- // Update database, if appropriate
200
- if( count( $results) > 0)
201
- {
202
- // We only do the first replace of any set, as that will cover everything
203
- $lastid = '';
204
- foreach( $results AS $result)
205
- {
206
- if( $result->id != $lastid)
207
- {
208
- $this->replace_content( $result->id, $result->content);
209
- $lastid = $result->id;
210
- }
211
  }
212
  }
213
- }
214
-
215
- function replace_inline( $id, $offset, $length, $replace)
216
- {
217
- $content = $this->get_content( $id);
218
 
219
- // Delete the original string
220
- $before = substr( $content, 0, $offset);
221
- $after = substr( $content, $offset + $length);
222
 
223
- // Stick the new string between
224
- $content = $before.$replace.$after;
 
 
 
 
 
 
 
 
 
 
225
 
226
- // Insert back into database
227
- $this->replace_content( $id, $content);
228
  }
229
  }
230
-
231
- global $search_regex_searches;
1
  <?php
2
 
3
+ namespace SearchRegex;
4
+
5
+ use SearchRegex\Result_Collection;
6
+ use SearchRegex\Match;
7
+
8
+ require_once __DIR__ . '/source.php';
9
+ require_once __DIR__ . '/source-manager.php';
10
+ require_once __DIR__ . '/match.php';
11
+ require_once __DIR__ . '/match-context.php';
12
+ require_once __DIR__ . '/match-column.php';
13
+ require_once __DIR__ . '/search-flags.php';
14
+ require_once __DIR__ . '/source-flags.php';
15
+
16
+ /**
17
+ * Perform a search
18
+ */
19
+ class Search {
20
+ /** @var String */
21
+ private $search;
22
+ /** @var Search_Source[] */
23
+ private $sources = [];
24
+ /** @var Search_Flags */
25
+ private $flags;
26
+
27
+ /**
28
+ * Create a Search object, with a search value, an array of sources, and some search flags
29
+ *
30
+ * @param String $search_value The value to search for.
31
+ * @param Array $sources Array of Search_Source objects. Only one is supported.
32
+ * @param Search_Flags $flags Search flags.
33
+ */
34
+ public function __construct( $search_value, array $sources, Search_Flags $flags ) {
35
+ $this->search = $search_value;
36
+ $this->flags = $flags;
37
+ $this->sources = $sources;
38
  }
39
 
40
+ /**
41
+ * Get total number of matches and rows across each source
42
+ *
43
+ * @internal
44
+ * @param Int $offset Page offset.
45
+ * @return \WP_Error|Array<String,Int> Array of totals
46
+ */
47
+ private function get_totals( $offset ) {
48
+ $totals = [ 'rows' => 0 ];
49
+
50
+ foreach ( $this->sources as $source ) {
51
+ $rows = $source->get_total_rows();
52
+ if ( is_wp_error( $rows ) && is_object( $rows ) ) {
53
+ return $rows;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  }
55
+
56
+ $totals['rows'] += intval( $rows, 10 );
57
  }
58
 
59
+ // First request also returns the total matched
60
+ if ( $offset === 0 ) {
61
+ $totals['matched_rows'] = 0;
62
+ $totals['matched_phrases'] = 0;
63
 
64
+ foreach ( $this->sources as $source ) {
65
+ if ( ! $this->flags->is_regex() ) {
66
+ $matches = $source->get_total_matches( $this->search );
67
+ if ( $matches instanceof \WP_Error ) {
68
+ return $matches;
69
+ }
 
 
 
 
 
 
70
 
71
+ $totals['matched_rows'] += $matches['rows'];
72
+ $totals['matched_phrases'] += $matches['matches'];
73
+ }
 
 
 
74
  }
 
 
75
  }
76
 
77
+ return $totals;
78
  }
79
 
80
+ /**
81
+ * Get the match data for a search
82
+ *
83
+ * @internal
84
+ * @param Int $offset Page offset.
85
+ * @param Int $limit Page limit.
86
+ * @return \WP_Error|Array Data array
87
+ */
88
+ private function get_data( $offset, $limit ) {
89
+ if ( $this->flags->is_regex() ) {
90
+ return $this->sources[0]->get_all_rows( $this->search, $offset, $limit );
91
  }
92
 
93
+ return $this->sources[0]->get_matched_rows( $this->search, $offset, $limit );
94
  }
95
 
96
+ /**
97
+ * Get a single database row
98
+ *
99
+ * @param int $row_id Row ID to return.
100
+ * @param Replace $replacer The Replace object used when replacing data.
101
+ * @return \WP_Error|Array Return a single database row, or WP_Error on error
102
+ */
103
+ public function get_row( $row_id, Replace $replacer ) {
104
+ global $wpdb;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
 
106
+ $row = $this->sources[0]->get_row( $row_id );
 
107
 
108
+ // Error
109
+ if ( is_wp_error( $row ) ) {
110
+ return new \WP_Error( 'searchregex_database', $wpdb->last_error );
111
+ }
112
 
113
+ return $this->rows_to_results( [ $row ], $replacer );
114
+ }
 
115
 
116
+ /**
117
+ * Perform the search, returning a result array that contains the totals, the progress, and an array of Result objects
118
+ *
119
+ * @param Replace $replacer The replacer which performs any replacements.
120
+ * @param int $offset Current page offset.
121
+ * @param int $limit Per page limit.
122
+ * @return Array|\WP_Error Array containing `totals`, `progress`, and `results`
123
+ */
124
+ public function get_results( Replace $replacer, $offset, $limit = 5 ) {
125
+ // TODO return totals of each source
126
+ $totals = $this->get_totals( $offset );
127
+ $rows = $this->get_data( $offset, $limit );
128
+
129
+ if ( $totals instanceof \WP_Error ) {
130
+ return $totals;
131
+ }
132
 
133
+ if ( $rows instanceof \WP_Error ) {
134
+ return $rows;
135
+ }
 
 
136
 
137
+ $results = $this->rows_to_results( (array) $rows, $replacer );
138
+ if ( $results instanceof \WP_Error ) {
139
+ return $results;
140
+ }
141
 
142
+ $previous = max( 0, $offset - $limit );
143
+ $next = min( $offset + $limit, $totals['rows'] ); // TODO this isn't going to end in simple search
 
144
 
145
+ if ( $next === $offset ) {
146
+ $next = false;
147
+ }
148
 
149
+ if ( $previous === $offset ) {
150
+ $previous = false;
151
+ }
152
 
153
+ return [
154
+ 'results' => $results,
155
+ 'totals' => $totals,
156
+ 'progress' => [
157
+ 'current' => $offset,
158
+ 'rows' => count( $results ),
159
+ 'previous' => $previous,
160
+ 'next' => $next,
161
+ ],
162
+ ];
163
+ }
164
 
165
+ /**
166
+ * Convert database rows into Result objects
167
+ *
168
+ * @internal
169
+ * @param Array $rows Array of row data.
170
+ * @param Replace $replacer Replace object.
171
+ * @return Result[]|\WP_Error Array of results
172
+ */
173
+ private function rows_to_results( $rows, Replace $replacer ) {
174
+ $results = [];
175
+ $source = $this->sources[0];
176
+
177
+ foreach ( $rows as $row ) {
178
+ $columns = array_keys( $row );
179
+ $match_columns = [];
180
+ $row_id = 0;
181
+
182
+ foreach ( array_slice( $columns, 1 ) as $column ) {
183
+ $row_id = intval( array_values( $row )[0], 10 );
184
+ $replacement = $replacer->get_replace_positions( $this->search, $row[ $column ] );
185
+ $contexts = Match::get_all( $this->search, $this->flags, $replacement, $row[ $column ] );
186
+
187
+ if ( count( $contexts ) > 0 ) {
188
+ $match_columns[] = new Match_Column( $column, $source->get_column_label( $column ), $replacer->get_global_replace( $this->search, $row[ $column ] ), $contexts );
189
  }
 
 
190
  }
191
 
192
+ if ( count( $match_columns ) > 0 && $row_id > 0 ) {
193
+ $results[] = new Result( $row_id, $source, $match_columns, $row );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
  }
195
  }
 
 
 
 
 
196
 
197
+ return $results;
198
+ }
 
199
 
200
+ /**
201
+ * Convert a set of search results into JSON
202
+ *
203
+ * @param Array $results Array of Results.
204
+ * @return Array JSON array
205
+ */
206
+ public function results_to_json( array $results ) {
207
+ $json = [];
208
+
209
+ foreach ( $results as $result ) {
210
+ $json[] = $result->to_json();
211
+ }
212
 
213
+ return $json;
 
214
  }
215
  }
 
 
models/source-flags.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SearchRegex;
4
+
5
+ /**
6
+ * Represents flags for a particular source
7
+ */
8
+ class Source_Flags {
9
+ /** @var Array */
10
+ private $flags = [];
11
+
12
+ /**
13
+ * Create a Source_Flags object with an array of flag strings
14
+ *
15
+ * @param Array $flags Array of flag values.
16
+ */
17
+ public function __construct( array $flags = [] ) {
18
+ $this->flags = $flags;
19
+ }
20
+
21
+ /**
22
+ * Set which flags are allowed, and remove any existing flags that don't match
23
+ *
24
+ * @param Array $allowed Array of allowed flags.
25
+ * @return void
26
+ */
27
+ public function set_allowed_flags( array $allowed ) {
28
+ $this->flags = array_filter( $this->flags, function( $flag ) use ( $allowed ) {
29
+ return array_search( $flag, $allowed, true ) !== false;
30
+ } );
31
+ }
32
+
33
+ /**
34
+ * Is the flag set?
35
+ *
36
+ * @param String $flag Flag to check.
37
+ * @return boolean true if set, false otherwise
38
+ */
39
+ public function has_flag( $flag ) {
40
+ return in_array( $flag, $this->flags, true );
41
+ }
42
+
43
+ /**
44
+ * Get all the flags
45
+ *
46
+ * @return Array Array of flags
47
+ */
48
+ public function get_flags() {
49
+ return $this->flags;
50
+ }
51
+ }
models/source-manager.php ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SearchRegex;
4
+
5
+ use SearchRegex\Search_Source;
6
+
7
+ /**
8
+ * Create Source objects
9
+ */
10
+ class Source_Manager {
11
+ /**
12
+ * Return an array of all the database sources. Note this is filtered with `searchregex_sources`
13
+ *
14
+ * @return Array The array of database sources as name => class
15
+ */
16
+ public static function get_all_sources() {
17
+ $core_sources = [
18
+ [
19
+ 'name' => 'posts',
20
+ 'class' => 'SearchRegex\Source_Post',
21
+ 'label' => __( 'All Post Types', 'search-regex' ),
22
+ 'description' => __( 'Search all posts, pages, and custom post types.', 'search-regex' ),
23
+ 'type' => 'core',
24
+ ],
25
+ [
26
+ 'name' => 'post-meta',
27
+ 'class' => 'SearchRegex\Source_Post_Meta',
28
+ 'label' => __( 'Post Meta', 'search-regex' ),
29
+ 'description' => __( 'Search post meta names and values.', 'search-regex' ),
30
+ 'type' => 'core',
31
+ ],
32
+ [
33
+ 'name' => 'comment',
34
+ 'class' => 'SearchRegex\Source_Comment',
35
+ 'label' => __( 'Comments', 'search-regex' ),
36
+ 'description' => __( 'Search comment content, URL, and author, with optional support for spam comments.', 'search-regex' ),
37
+ 'type' => 'core',
38
+ ],
39
+ [
40
+ 'name' => 'comment-meta',
41
+ 'class' => 'SearchRegex\Source_Comment_Meta',
42
+ 'label' => __( 'Comment Meta', 'search-regex' ),
43
+ 'description' => __( 'Search comment meta names and values.', 'search-regex' ),
44
+ 'type' => 'core',
45
+ ],
46
+ [
47
+ 'name' => 'user',
48
+ 'class' => 'SearchRegex\Source_User',
49
+ 'label' => __( 'Users', 'search-regex' ),
50
+ 'description' => __( 'Search user email, URL, and name.', 'search-regex' ),
51
+ 'type' => 'core',
52
+ ],
53
+ [
54
+ 'name' => 'user-meta',
55
+ 'class' => 'SearchRegex\Source_User_Meta',
56
+ 'label' => __( 'User Meta', 'search-regex' ),
57
+ 'description' => __( 'Search user meta name and values.', 'search-regex' ),
58
+ 'type' => 'core',
59
+ ],
60
+ [
61
+ 'name' => 'options',
62
+ 'class' => 'SearchRegex\Source_Options',
63
+ 'label' => __( 'WordPress Options', 'search-regex' ),
64
+ 'description' => __( 'Search all WordPress options.', 'search-regex' ),
65
+ 'type' => 'core',
66
+ ],
67
+ ];
68
+
69
+ // Add on post types
70
+ /** @var Array */
71
+ $post_types = get_post_types( [], 'objects' );
72
+ $post_sources = [];
73
+
74
+ foreach ( $post_types as $type ) {
75
+ if ( strlen( $type->label ) > 0 ) {
76
+ $post_sources[] = [
77
+ 'name' => $type->name,
78
+ 'class' => 'SearchRegex\Source_Post',
79
+ 'label' => $type->label,
80
+ 'type' => 'posttype',
81
+ ];
82
+ }
83
+ }
84
+
85
+ // Load custom stuff here
86
+ $plugin_sources = glob( dirname( SEARCHREGEX_FILE ) . '/source/plugin/*.php' );
87
+ foreach ( $plugin_sources as $plugin ) {
88
+ /**
89
+ * @psalm-suppress UnresolvableInclude
90
+ */
91
+ require_once $plugin;
92
+ }
93
+
94
+ $plugin_sources = apply_filters( 'searchregex_sources_plugin', [] );
95
+ $plugin_sources = array_map( function( $source ) {
96
+ $source['type'] = 'plugin';
97
+ return $source;
98
+ }, $plugin_sources );
99
+
100
+ $post_sources = apply_filters( 'searchregex_sources_posttype', $post_sources );
101
+ $core_sources = apply_filters( 'searchregex_sources_core', $core_sources );
102
+
103
+ return array_merge( array_values( $core_sources ), array_values( $post_sources ), array_values( $plugin_sources ) );
104
+ }
105
+
106
+ /**
107
+ * Get all the sources grouped into 'core', 'posttype', and 'plugin' groups.
108
+ *
109
+ * @return Array Associative array of sources, grouped by type
110
+ */
111
+ public static function get_all_grouped() {
112
+ $sources = self::get_all_sources();
113
+
114
+ $groups = [
115
+ [
116
+ 'name' => 'core',
117
+ 'label' => __( 'Standard Types', 'search-regex' ),
118
+ 'sources' => array_values( array_filter( $sources, function( $source ) {
119
+ return $source['type'] === 'core';
120
+ } ) ),
121
+ ],
122
+ [
123
+ 'name' => 'posttype',
124
+ 'label' => __( 'Specific Post Types', 'search-regex' ),
125
+ 'sources' => array_values( array_filter( $sources, function( $source ) {
126
+ return $source['type'] === 'posttype';
127
+ } ) ),
128
+ ],
129
+ [
130
+ 'name' => 'plugin',
131
+ 'label' => __( 'Plugins', 'search-regex' ),
132
+ 'sources' => array_values( array_filter( $sources, function( $source ) {
133
+ return $source['type'] === 'plugin';
134
+ } ) ),
135
+ ],
136
+ ];
137
+
138
+ return array_filter( apply_filters( 'searchregex_source_groups', $groups ), function( $group ) {
139
+ return count( $group['sources'] ) > 0;
140
+ } );
141
+ }
142
+
143
+ /**
144
+ * Return a particular Source object for the given name
145
+ *
146
+ * @param String $source Source name.
147
+ * @param Search_Flags $search_flags Search_Flags.
148
+ * @param Source_Flags $source_flags Source_Flags.
149
+ * @return object|null New Source_Flags object
150
+ */
151
+ private static function get_handler_for_source( $source, Search_Flags $search_flags, Source_Flags $source_flags ) {
152
+ $sources = self::get_all_sources();
153
+
154
+ foreach ( $sources as $handler ) {
155
+ if ( $handler['name'] === $source ) {
156
+ $new_source = new $handler['class']( $handler, $search_flags, $source_flags );
157
+ $source_flags->set_allowed_flags( array_keys( $new_source->get_supported_flags() ) );
158
+
159
+ return $new_source;
160
+ }
161
+ }
162
+
163
+ return null;
164
+ }
165
+
166
+ /**
167
+ * Return a list of all source names only. This can be used for checking a name is allowed.
168
+ *
169
+ * @return Array Array of source names
170
+ */
171
+ public static function get_all_source_names() {
172
+ $sources = self::get_all_sources();
173
+
174
+ return array_map( function( $source ) {
175
+ return $source['name'];
176
+ }, $sources );
177
+ }
178
+
179
+ /**
180
+ * Get all the specified sources as source objects
181
+ *
182
+ * @param Array $sources Array of source names.
183
+ * @param Search_Flags $search_flags The search flags object.
184
+ * @param Source_Flags $source_flags The source flags object.
185
+ * @return Array The array of source objects
186
+ */
187
+ public static function get( $sources, Search_Flags $search_flags, Source_Flags $source_flags ) {
188
+ $handlers = [];
189
+
190
+ foreach ( $sources as $source ) {
191
+ $handler = self::get_handler_for_source( $source, $search_flags, $source_flags );
192
+
193
+ if ( $handler ) {
194
+ $handlers[] = $handler;
195
+ }
196
+ }
197
+
198
+ return $handlers;
199
+ }
200
+ }
201
+
202
+ require_once dirname( __DIR__ ) . '/source/core/meta.php';
203
+ require_once dirname( __DIR__ ) . '/source/core/post.php';
204
+ require_once dirname( __DIR__ ) . '/source/core/post-meta.php';
205
+ require_once dirname( __DIR__ ) . '/source/core/user.php';
206
+ require_once dirname( __DIR__ ) . '/source/core/user-meta.php';
207
+ require_once dirname( __DIR__ ) . '/source/core/comment.php';
208
+ require_once dirname( __DIR__ ) . '/source/core/comment-meta.php';
209
+ require_once dirname( __DIR__ ) . '/source/core/options.php';
models/source.php ADDED
@@ -0,0 +1,369 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SearchRegex;
4
+
5
+ use SearchRegex\Search_Regex;
6
+
7
+ /**
8
+ * Represents a source of data that can be searched. Typically maps directly to a database table
9
+ */
10
+ abstract class Search_Source {
11
+ /** @var Search_Flags */
12
+ protected $search_flags;
13
+ /** @var Source_Flags */
14
+ protected $source_flags;
15
+ /** @var String */
16
+ protected $source_type;
17
+ /** @var String */
18
+ protected $source_name;
19
+
20
+ /**
21
+ * Create a Search_Source object
22
+ *
23
+ * @param Array $handler Source handler information - an array of `name`, `class`, `label`, and `type`.
24
+ * @param Search_Flags $search_flags A Search_Flags object.
25
+ * @param Source_Flags $source_flags A Source_Flags object.
26
+ */
27
+ public function __construct( array $handler, Search_Flags $search_flags, Source_Flags $source_flags ) {
28
+ $this->search_flags = $search_flags;
29
+ $this->source_flags = $source_flags;
30
+
31
+ $this->source_type = isset( $handler['name'] ) ? $handler['name'] : 'unknown';
32
+ $this->source_name = isset( $handler['label'] ) ? $handler['label'] : $this->source_type;
33
+ }
34
+
35
+ /**
36
+ * Return the source type
37
+ *
38
+ * @param Array $row Database row, used in some sources to determine the type.
39
+ * @return String Source type
40
+ */
41
+ public function get_type( array $row ) {
42
+ return $this->source_type;
43
+ }
44
+
45
+ /**
46
+ * Return the source name
47
+ *
48
+ * @param Array $row Database row, used in some sources to determine the type.
49
+ * @return String A user viewable source name
50
+ */
51
+ public function get_name( array $row ) {
52
+ return $this->source_name;
53
+ }
54
+
55
+ /**
56
+ * Return the associated Source_Flags
57
+ *
58
+ * @return Source_Flags Source_Flags object
59
+ */
60
+ public function get_source_flags() {
61
+ return $this->source_flags;
62
+ }
63
+
64
+ /**
65
+ * Return an array of columns for this source
66
+ *
67
+ * @return Array The array of column names
68
+ */
69
+ abstract public function get_columns();
70
+
71
+ /**
72
+ * Return an array of additional columns to return in a search. These aren't searched, and can be used by the source.
73
+ *
74
+ * @return Array The array of column names
75
+ */
76
+ public function get_info_columns() {
77
+ return [];
78
+ }
79
+
80
+ /**
81
+ * Return an the table's ID column name
82
+ *
83
+ * @return String The table's ID column name
84
+ */
85
+ abstract public function get_table_id();
86
+
87
+ /**
88
+ * Return the column name used as a visible title for the source. For example, a post would have `post_title`
89
+ *
90
+ * @return String Column used for the title
91
+ */
92
+ abstract public function get_title_column();
93
+
94
+ /**
95
+ * Return the table name
96
+ *
97
+ * @return String The table name for the source
98
+ */
99
+ abstract public function get_table_name();
100
+
101
+ /**
102
+ * Return an array of additional search conditions applied to each query. These will be ANDed together.
103
+ * These conditions should be sanitized here, and won't be sanitized elsewhere.
104
+ *
105
+ * @param String $search Search phrase.
106
+ * @return Array Array of SQL condition
107
+ */
108
+ public function get_search_conditions( $search ) {
109
+ return [];
110
+ }
111
+
112
+ /**
113
+ * Return a visible label for the column. This is shown to the user and should be more descriptive than the column name itself
114
+ *
115
+ * @param String $column Column name.
116
+ * @return String Column label
117
+ */
118
+ public function get_column_label( $column ) {
119
+ return $column;
120
+ }
121
+
122
+ /**
123
+ * Return an array of flags used by this source via Source_Flags. Used primarily to validate the flag.
124
+ *
125
+ * @return Array The array of flags
126
+ */
127
+ public function get_supported_flags() {
128
+ return [];
129
+ }
130
+
131
+ /**
132
+ * Get an array of actions for a given row
133
+ *
134
+ * @param Result $result The Result object containing the row from the source.
135
+ * @return Array An array of action type => action URL
136
+ */
137
+ public function get_actions( Result $result ) {
138
+ return [];
139
+ }
140
+
141
+ /**
142
+ * Get the total number of matches for this search
143
+ *
144
+ * @param String $search Search string.
145
+ * @return Array<String,Int>|\WP_Error The number of matches as an array of 'matches' and 'rows', or WP_Error on error
146
+ */
147
+ public function get_total_matches( $search ) {
148
+ global $wpdb;
149
+
150
+ $search_query = $this->get_search_query( $search );
151
+
152
+ // Sum all the matches
153
+ $sum = [];
154
+ foreach ( $this->get_columns() as $column ) {
155
+ $cropped = mb_substr( $search, 0, mb_strlen( $search, 'UTF-8' ) - 1, 'UTF-8' );
156
+
157
+ // phpcs:ignore
158
+ $sum[] = $wpdb->prepare( "SUM( CHAR_LENGTH( $column ) - CHAR_LENGTH( REPLACE( UPPER($column), UPPER(%s), UPPER(%s) ) ) )", $search, $cropped );
159
+ }
160
+
161
+ // This is a known and validated query
162
+ // phpcs:ignore
163
+ $result = $wpdb->get_row( "SELECT COUNT(*) AS match_rows, " . implode( ' + ', $sum ) . " AS match_total FROM {$this->get_table_name()} WHERE " . $search_query );
164
+ if ( $result === null ) {
165
+ return new \WP_Error( 'searchregex_database', $wpdb->last_error, 401 );
166
+ }
167
+
168
+ return [
169
+ 'matches' => intval( $result->match_total, 10 ),
170
+ 'rows' => intval( $result->match_rows, 10 ),
171
+ ];
172
+ }
173
+
174
+ /**
175
+ * Get total number of rows for this source
176
+ *
177
+ * @return Int|\WP_Error The number of rows, or WP_Error on error
178
+ */
179
+ public function get_total_rows() {
180
+ global $wpdb;
181
+
182
+ // This is a known and validated query
183
+ // phpcs:ignore
184
+ $result = $wpdb->get_var( "SELECT COUNT(*) FROM {$this->get_table_name()}" );
185
+ if ( $result === null ) {
186
+ return new \WP_Error( 'searchregex_database', $wpdb->last_error, 401 );
187
+ }
188
+
189
+ return intval( $result, 10 );
190
+ }
191
+
192
+ /**
193
+ * Get a single row from the source
194
+ *
195
+ * @param int $row_id The row ID.
196
+ * @return Object|\WP_Error The database row, or WP_Error on error
197
+ */
198
+ public function get_row( $row_id ) {
199
+ global $wpdb;
200
+
201
+ $columns = $this->get_query_columns();
202
+
203
+ // $columns, get_table_id, and get_table_name are sanitized for any user input
204
+ // phpcs:ignore
205
+ $row = $wpdb->get_row( $wpdb->prepare( "SELECT {$columns} FROM {$this->get_table_name()} WHERE {$this->get_table_id()}=%d", $row_id ), ARRAY_A );
206
+ if ( $row === null ) {
207
+ return new \WP_Error( 'searchregex_database', $wpdb->last_error, 401 );
208
+ }
209
+
210
+ return $row;
211
+ }
212
+
213
+ /**
214
+ * Get all database rows for the source from the start offset to the limit
215
+ *
216
+ * @param String $search The search phrase.
217
+ * @param int $offset The row offset.
218
+ * @param int $limit The number of rows to return.
219
+ * @return Array|\WP_Error The database rows, or WP_Error on error
220
+ */
221
+ public function get_all_rows( $search, $offset, $limit ) {
222
+ global $wpdb;
223
+
224
+ $columns = $this->get_query_columns();
225
+
226
+ // Add any source specific conditions
227
+ $source_conditions = $this->get_search_conditions( $search );
228
+ $search_phrase = '';
229
+ if ( count( $source_conditions ) > 0 ) {
230
+ $search_phrase = ' WHERE ' . implode( ' AND ', $source_conditions );
231
+ }
232
+
233
+ // This is a known and validated query
234
+ // phpcs:ignore
235
+ $results = $wpdb->get_results( $wpdb->prepare( "SELECT {$columns} FROM {$this->get_table_name()}{$search_phrase} ORDER BY {$this->get_table_id()} ASC LIMIT %d,%d", $offset, $limit ), ARRAY_A );
236
+ if ( $results === false || $wpdb->last_error ) {
237
+ return new \WP_Error( 'searchregex_database', $wpdb->last_error, 401 );
238
+ }
239
+
240
+ return $results;
241
+ }
242
+
243
+ /**
244
+ * Get a set of matching rows
245
+ *
246
+ * @param String $search The search string.
247
+ * @param int $offset The row offset.
248
+ * @param int $limit The number of rows to return.
249
+ * @return Array|\WP_Error The database rows, or WP_Error on error
250
+ */
251
+ public function get_matched_rows( $search, $offset, $limit ) {
252
+ global $wpdb;
253
+
254
+ $search_query = $this->get_search_query( $search );
255
+ $columns = $this->get_query_columns();
256
+
257
+ // This is a known and validated query
258
+ // phpcs:ignore
259
+ $results = $wpdb->get_results( $wpdb->prepare( "SELECT {$columns} FROM {$this->get_table_name()} WHERE {$search_query} ORDER BY {$this->get_table_id()} ASC LIMIT %d,%d", $offset, $limit ), ARRAY_A );
260
+ if ( $results === false || $wpdb->last_error ) {
261
+ return new \WP_Error( 'searchregex_database', $wpdb->last_error, 401 );
262
+ }
263
+
264
+ return $results;
265
+ }
266
+
267
+ /**
268
+ * Save a replacement to the database
269
+ *
270
+ * @param int $row_id The row ID to save.
271
+ * @param String $column_id The column to save.
272
+ * @param String $content The value to save to the column in the row.
273
+ * @return Bool|\WP_Error True on success, or WP_Error on error
274
+ */
275
+ public function save( $row_id, $column_id, $content ) {
276
+ global $wpdb;
277
+
278
+ // Final check that is specific to this handler. The API check is general over all handlers
279
+ $columns = $this->get_columns();
280
+ if ( ! in_array( $column_id, $columns, true ) ) {
281
+ return new \WP_Error( 'searchregex_database', 'Unknown column for database' );
282
+ }
283
+
284
+ $result = $wpdb->update( $this->get_table_name(), [ $column_id => $content ], [ $this->get_table_id() => $row_id ] );
285
+
286
+ if ( $result === null ) {
287
+ return new \WP_Error( 'searchregex_database', $wpdb->last_error, 401 );
288
+ }
289
+
290
+ return true;
291
+ }
292
+
293
+ /**
294
+ * Delete a row from the source
295
+ *
296
+ * @param int $row_id The row ID.
297
+ * @return Bool|\WP_Error true on success, or WP_Error on error
298
+ */
299
+ public function delete_row( $row_id ) {
300
+ global $wpdb;
301
+
302
+ if ( $wpdb->delete( $this->get_table_name(), [ $this->get_table_id() => $row_id ] ) === false ) {
303
+ return new \WP_Error( 'searchregex_database', $wpdb->last_error, 401 );
304
+ }
305
+
306
+ return true;
307
+ }
308
+
309
+ /**
310
+ * Returns database columns in SQL format
311
+ *
312
+ * @internal
313
+ * @return String SQL string
314
+ */
315
+ protected function get_query_columns() {
316
+ $columns = array_merge(
317
+ [ $this->get_table_id() ],
318
+ $this->get_columns(),
319
+ $this->get_info_columns()
320
+ );
321
+
322
+ return implode( ', ', $columns );
323
+ }
324
+
325
+ /**
326
+ * Returns a LIKE query for a given column and search phrase
327
+ *
328
+ * @internal
329
+ * @param String $column Column name.
330
+ * @param String $search Search phrase.
331
+ * @return String SQL string
332
+ */
333
+ protected function get_search_query_as_like( $column, $search ) {
334
+ global $wpdb;
335
+
336
+ if ( $this->search_flags->is_case_insensitive() ) {
337
+ return 'UPPER(' . $column . ') ' . $wpdb->prepare( 'LIKE %s', '%' . $wpdb->esc_like( strtoupper( $search ) ) . '%' );
338
+ }
339
+
340
+ return $column . ' ' . $wpdb->prepare( 'LIKE %s', '%' . $wpdb->esc_like( $search ) . '%' );
341
+ }
342
+
343
+ /**
344
+ * Returns the search for each of the columns in SQL format
345
+ *
346
+ * @internal
347
+ * @param String $search Search phrase.
348
+ * @return String SQL string
349
+ */
350
+ protected function get_search_query( $search ) {
351
+ $source_matches = [];
352
+
353
+ // Look for the text in all the columns
354
+ foreach ( $this->get_columns() as $column ) {
355
+ $source_matches[] = $this->get_search_query_as_like( $column, $search );
356
+ }
357
+
358
+ // Add any source specific conditions
359
+ $source_conditions = $this->get_search_conditions( $search );
360
+
361
+ $search_phrase = '(' . implode( ' OR ', $source_matches ) . ')';
362
+ $conditions = '';
363
+ if ( count( $source_conditions ) > 0 ) {
364
+ $conditions = ' AND ' . implode( ' AND ', $source_conditions );
365
+ }
366
+
367
+ return $search_phrase . $conditions;
368
+ }
369
+ }
readme.txt CHANGED
@@ -1,26 +1,45 @@
1
  === Search Regex ===
2
  Contributors: johnny5
3
- Donate link: http://urbangiraffe.com/about/support/
4
- Tags: search, regex, regular expression, admin, post, page
5
- Requires at least: 4.1
6
- Tested up to: 4.5
7
  Stable tag: trunk
 
 
8
 
9
- Search Regex adds a powerful set of search and replace functions to WordPress that go beyond the standard searching capabilities, with full regex support.
10
 
11
  == Description ==
12
 
13
- Search Regex adds a powerful set of search and replace functions to WordPress. These go beyond the standard searching capabilities, and allow you to search and replace almost any data stored on your site. In addition to simple searches you have the full power of PHP's regular expressions at your disposal.
14
 
15
- The driving force behind this plugin is to aid in website migration and upgrading. If you've ever done either of these then you know the pain of having to go back through all your data, changing URL paths and fixing things. With this plugin you can reduce this work to a search and replace pattern and the job is finished in seconds.
 
 
 
16
 
17
- Why would you want this? The primary reason for the plugin was to aid in relocating directories. It's a real pain to manually go through every post and change image directory names. With this plugin all that was required was a simple search and replace pattern, and the job was finished in a few seconds.
18
 
19
- Search Regex is available in the following languages:
 
 
 
 
 
 
 
 
20
 
21
- * English
22
- * Arabic, thanks to R.SN
23
- * Belarussian, thanks to Marcis Gasuns
 
 
 
 
 
 
24
 
25
  == Installation ==
26
 
@@ -30,77 +49,24 @@ The plugin is simple to install:
30
  1. Unzip
31
  1. Upload `search-regex` directory to your `/wp-content/plugins` directory
32
  1. Go to the plugin management page and enable the plugin
33
- 1. Configure the plugin from `Management/Search Regex`
34
 
35
- You can find full details of installing a plugin on the [plugin installation page](http://urbangiraffe.com/articles/how-to-install-a-wordpress-plugin/).
36
 
37
  == Screenshots ==
38
 
39
  1. Search options
40
  2. Inline search and replace
 
41
 
42
  == Documentation ==
43
 
44
- Full documentation can be found on the [Search Regex Page](http://urbangiraffe.com/plugins/search-regex/) page.
45
 
46
  == Changelog ==
47
 
48
- = 1.4.16 =
49
- * Fix error thrown by regex options, props to leoxavier
50
- * Fix pagination problem
51
-
52
- = 1.4.15 =
53
- * Minor refresh
54
-
55
- = 1.4.14 =
56
- * WP 3.5 compat
57
-
58
- = 1.4.13 =
59
- * Code cleanup
60
-
61
- = 1.4.11 =
62
- * Add Arabic translation
63
-
64
- = 1.4.10 =
65
- * Fix deep slashes
66
-
67
- = 1.4.9 =
68
- * WP 2.8 compatibility
69
-
70
- = 1.4.8 =
71
- * Update base library
72
- * Fix issue with regex not being selected
73
-
74
- = 1.4.7 =
75
- * WP 2.6
76
- = 1.4.6 =
77
- * Added tag & sniplet searching.
78
- * Make work in Safari
79
-
80
- = 1.4.5 =
81
- * Add search regex capabilities ('search_regex_read' and 'search_regex_write').
82
- * Fix meta values
83
-
84
- = 1.4.4 =
85
- * Fix escaping issue
86
- * Allowing search limit and direction
87
-
88
- = 1.4.3 =
89
- * Allow searching in pings & trackbacks
90
-
91
- = 1.4.2 =
92
- * Fix escaping bug
93
-
94
- = 1.4 =
95
- * Extensible plugins
96
- * Reorganisation of code
97
-
98
- = 1.3 =
99
- * Use correct table prefix
100
-
101
- = 1.2 =
102
- * Fix stupid typo
103
 
104
- = 1.1 =
105
- * Minor cosmetic changes
106
- * Set a timeout limit
1
  === Search Regex ===
2
  Contributors: johnny5
3
+ Donate link: http://searchregex.com/donation/
4
+ Tags: search, replace, regex, regular expression, database, post, page
5
+ Requires at least: 5.3
6
+ Tested up to: 5.4
7
  Stable tag: trunk
8
+ Requires PHP: 5.6
9
+ License: GPLv3
10
 
11
+ Search Regex adds a powerful set of search and replace functions to WordPress posts, pages, custom post types, and other data sources.
12
 
13
  == Description ==
14
 
15
+ Search Regex adds a powerful set of search and replace functions to WordPress posts, pages, custom post types, and other data sources. These go beyond the standard searching capabilities, and allow you to search and replace almost any data stored on your site. In addition to simple searches you have the full power of PHP's regular expressions at your disposal.
16
 
17
+ You can use this to do things like:
18
+ - Help migrate a site from one domain to another
19
+ - Update URLs in links and images
20
+ - Perform site-wide changes
21
 
22
+ == What can I search? ==
23
 
24
+ You can search:
25
+ - Posts
26
+ - Pages
27
+ - Any custom post type
28
+ - Comments (including spam)
29
+ - Users
30
+ - Meta data
31
+ - WordPress options
32
+ - Supported plugins (such as Redirection)
33
 
34
+ == Support ==
35
+
36
+ Please submit bugs, patches, and feature requests to:
37
+
38
+ [https://github.com/johngodley/search-regex](https://github.com/johngodley/search-regex)
39
+
40
+ Please submit translations to:
41
+
42
+ [https://translate.wordpress.org/projects/wp-plugins/search-regex](https://translate.wordpress.org/projects/wp-plugins/search-regex)
43
 
44
  == Installation ==
45
 
49
  1. Unzip
50
  1. Upload `search-regex` directory to your `/wp-content/plugins` directory
51
  1. Go to the plugin management page and enable the plugin
52
+ 1. Configure the options from the `Tools/Search Regex` page
53
 
54
+ You can find full details of installing a plugin on the [plugin installation page](https://searchregex.com/support/installation/).
55
 
56
  == Screenshots ==
57
 
58
  1. Search options
59
  2. Inline search and replace
60
+ 3. Inline editor
61
 
62
  == Documentation ==
63
 
64
+ Full documentation can be found on the [Search Regex](http://searchregex.com/) site.
65
 
66
  == Changelog ==
67
 
68
+ = 2.0 - 9th May 2020 =
69
+ - Release version 2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
 
71
+ = 1.4.16 - 21st November 2014 =
72
+ - Old version
 
screenshot-1.png DELETED
Binary file
screenshot-2.png DELETED
Binary file
search-regex-admin.php ADDED
@@ -0,0 +1,454 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once __DIR__ . '/models/search.php';
4
+ require_once __DIR__ . '/models/replace.php';
5
+ require_once __DIR__ . '/models/result.php';
6
+
7
+ use SearchRegex\Source_Manager;
8
+ use SearchRegex\Search_Flags;
9
+ use SearchRegex\Source_Flags;
10
+
11
+ class Search_Regex_Admin {
12
+ /** @var null|Search_Regex_Admin */
13
+ private static $instance = null;
14
+
15
+ /**
16
+ * Initialize the object
17
+ *
18
+ * @return Search_Regex_Admin
19
+ */
20
+ public static function init() {
21
+ if ( is_null( self::$instance ) ) {
22
+ self::$instance = new Search_Regex_Admin();
23
+ }
24
+
25
+ return self::$instance;
26
+ }
27
+
28
+ /**
29
+ * Create the admin class
30
+ */
31
+ public function __construct() {
32
+ add_action( 'admin_menu', [ $this, 'admin_menu' ] );
33
+ add_action( 'plugin_action_links_' . basename( dirname( SEARCHREGEX_FILE ) ) . '/' . basename( SEARCHREGEX_FILE ), [ $this, 'plugin_settings' ], 10, 4 );
34
+ /** @psalm-suppress InvalidArgument */
35
+ add_filter( 'set-screen-option', [ $this, 'set_per_page' ], 10, 3 );
36
+ }
37
+
38
+ /**
39
+ * Add plugin settings to plugin page
40
+ *
41
+ * @param Array $links Links.
42
+ * @return Array
43
+ */
44
+ public function plugin_settings( $links ) {
45
+ array_unshift( $links, '<a href="' . esc_url( $this->get_plugin_url() ) . '&amp;sub=options">' . __( 'Settings', 'search-regex' ) . '</a>' );
46
+ return $links;
47
+ }
48
+
49
+ /**
50
+ * Get plugin URL
51
+ *
52
+ * @return String
53
+ */
54
+ private function get_plugin_url() {
55
+ return admin_url( 'tools.php?page=' . basename( SEARCHREGEX_FILE ) );
56
+ }
57
+
58
+ /**
59
+ * Get first page the current user is allowed to see
60
+ *
61
+ * @return String
62
+ */
63
+ private function get_first_available_page_url() {
64
+ $pages = Search_Regex_Capabilities::get_available_pages();
65
+
66
+ if ( count( $pages ) > 0 ) {
67
+ return $this->get_plugin_url() . ( $pages[0] === 'search' ? '' : '&sub=' . rawurlencode( $pages[0] ) );
68
+ }
69
+
70
+ return admin_url();
71
+ }
72
+
73
+ /**
74
+ * Insert stuff into the admin head
75
+ *
76
+ * @return void
77
+ */
78
+ public function searchregex_head() {
79
+ global $wp_version;
80
+
81
+ // Does user have access to this page?
82
+ if ( $this->get_current_page() === false ) {
83
+ // Redirect to root plugin page
84
+ wp_safe_redirect( $this->get_first_available_page_url() );
85
+ die();
86
+ }
87
+
88
+ if ( isset( $_REQUEST['action'] ) && isset( $_REQUEST['_wpnonce'] ) && wp_verify_nonce( $_REQUEST['_wpnonce'], 'wp_rest' ) ) {
89
+ if ( $_REQUEST['action'] === 'rest_api' ) {
90
+ $this->set_rest_api( intval( $_REQUEST['rest_api'], 10 ) );
91
+ }
92
+ }
93
+
94
+ $build = SEARCHREGEX_VERSION . '-' . SEARCHREGEX_BUILD;
95
+ $preload = $this->get_preload_data();
96
+ $options = searchregex_get_options();
97
+ $versions = array(
98
+ 'Plugin: ' . SEARCHREGEX_VERSION,
99
+ 'WordPress: ' . $wp_version . ' (' . ( is_multisite() ? 'multi' : 'single' ) . ')',
100
+ 'PHP: ' . phpversion(),
101
+ 'Browser: ' . $this->get_user_agent(),
102
+ 'JavaScript: ' . plugin_dir_url( SEARCHREGEX_FILE ) . 'search-regex.js',
103
+ 'REST API: ' . searchregex_get_rest_api(),
104
+ );
105
+
106
+ if ( defined( 'SEARCHREGEX_DEV_MODE' ) && SEARCHREGEX_DEV_MODE ) {
107
+ wp_enqueue_script( 'search-regex', 'http://localhost:3312/search-regex.js', array(), $build, true );
108
+ } else {
109
+ wp_enqueue_script( 'search-regex', plugin_dir_url( SEARCHREGEX_FILE ) . 'search-regex.js', array(), $build, true );
110
+ }
111
+
112
+ wp_enqueue_style( 'search-regex', plugin_dir_url( SEARCHREGEX_FILE ) . 'search-regex.css', array(), $build );
113
+
114
+ wp_localize_script( 'search-regex', 'SearchRegexi10n', array(
115
+ 'api' => [
116
+ 'WP_API_root' => esc_url_raw( searchregex_get_rest_api() ),
117
+ 'WP_API_nonce' => wp_create_nonce( 'wp_rest' ),
118
+ 'current' => $options['rest_api'],
119
+ 'routes' => [
120
+ SEARCHREGEX_API_JSON => searchregex_get_rest_api( SEARCHREGEX_API_JSON ),
121
+ SEARCHREGEX_API_JSON_INDEX => searchregex_get_rest_api( SEARCHREGEX_API_JSON_INDEX ),
122
+ SEARCHREGEX_API_JSON_RELATIVE => searchregex_get_rest_api( SEARCHREGEX_API_JSON_RELATIVE ),
123
+ ],
124
+ ],
125
+ 'pluginBaseUrl' => plugins_url( '', SEARCHREGEX_FILE ),
126
+ 'pluginRoot' => $this->get_plugin_url(),
127
+ 'locale' => $this->get_i18n_data(),
128
+ 'localeSlug' => get_locale(),
129
+ 'settings' => $options,
130
+ 'preload' => $preload,
131
+ 'versions' => implode( "\n", $versions ),
132
+ 'version' => SEARCHREGEX_VERSION,
133
+ 'caps' => [
134
+ 'pages' => Search_Regex_Capabilities::get_available_pages(),
135
+ 'capabilities' => Search_Regex_Capabilities::get_all_capabilities(),
136
+ ],
137
+ ) );
138
+
139
+ $this->add_help_tab();
140
+ }
141
+
142
+ /**
143
+ * Get browser agent
144
+ *
145
+ * @return String
146
+ */
147
+ public function get_user_agent() {
148
+ $agent = '';
149
+
150
+ if ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) {
151
+ $agent = $_SERVER['HTTP_USER_AGENT'];
152
+ }
153
+
154
+ return $agent;
155
+ }
156
+
157
+ /**
158
+ * Set REST API
159
+ *
160
+ * @param Int $api API.
161
+ * @return void
162
+ */
163
+ private function set_rest_api( $api ) {
164
+ if ( $api >= 0 && $api <= SEARCHREGEX_API_JSON_RELATIVE ) {
165
+ searchregex_set_options( array( 'rest_api' => intval( $api, 10 ) ) );
166
+ }
167
+ }
168
+
169
+ /**
170
+ * Get preloaded data
171
+ *
172
+ * @return Array
173
+ */
174
+ private function get_preload_data() {
175
+ $sources = Source_Manager::get_all_grouped();
176
+ $all = Source_Manager::get_all_source_names();
177
+ $handler = Source_Manager::get( $all, new Search_Flags(), new Source_Flags() );
178
+ $flags = [];
179
+
180
+ foreach ( $handler as $pos => $source ) {
181
+ $flags[ $all[ $pos ] ] = $source->get_supported_flags();
182
+ }
183
+
184
+ return [
185
+ 'sources' => $sources,
186
+ 'source_flags' => $flags,
187
+ ];
188
+ }
189
+
190
+ /**
191
+ * Replace links
192
+ *
193
+ * @internal
194
+ * @param String $text Text to replace.
195
+ * @param String $url URL to insert into the link.
196
+ * @param String $link Link name.
197
+ * @return String
198
+ */
199
+ private function linkify( $text, $url, $link = 'link' ) {
200
+ return preg_replace( '@{{' . $link . '}}(.*?){{/' . $link . '}}@', '<a target="_blank" rel="noopener noreferrer" href="' . esc_url( $url ) . '">$1</a>', $text );
201
+ }
202
+
203
+ /**
204
+ * Add help tab
205
+ *
206
+ * @internal
207
+ * @return void
208
+ */
209
+ private function add_help_tab() {
210
+ $flags = $this->linkify(
211
+ $this->linkify(
212
+ __( '{{link}}Source Flags{{/link}} - additional options for the selected source. For example, include post {{guid}}GUID{{/guid}} in the search.', 'search-regex' ),
213
+ 'https://searchregex.com/support/search-source/'
214
+ ),
215
+ 'https://deliciousbrains.com/wordpress-post-guids-sometimes-update/',
216
+ 'guid'
217
+ );
218
+
219
+ /* translators: URL */
220
+ $content = [ '<p>' . sprintf( __( 'You can find full documentation about using Search Regex on the <a href="%s" target="_blank">searchregex.com</a> support site.', 'search-regex' ), 'https://searchregex.com/support/' ) . '</p>' ];
221
+ $content[] = '<p>' . __( 'The following concepts are used by Search Regex:', 'search-regex' ) . '</p>';
222
+ $content[] = '<ul>';
223
+ $content[] = '<li>' . $this->linkify( __( '{{link}}Search Flags{{/link}} - additional qualifiers for your search, to enable case insensitivity, and to enable regular expression support.', 'search-regex' ), 'https://searchregex.com/support/searching/' ) . '</li>';
224
+ $content[] = '<li>' . $this->linkify( __( '{{link}}Regular expression{{/link}} - a way of defining a pattern for text matching. Provides more advanced matches.', 'search-regex' ), 'https://searchregex.com/support/regular-expression/' ) . '</li>';
225
+ $content[] = '<li>' . $this->linkify( __( '{{link}}Source{{/link}} - the source of data you wish to search. For example, posts, pages, or comments.', 'search-regex' ), 'https://searchregex.com/support/search-source/' ) . '</li>';
226
+ $content[] = '<li>' . $flags . '</li>';
227
+ $content[] = '</ul>';
228
+
229
+ $title = __( 'Search Regex Support', 'search-regex' );
230
+
231
+ $current_screen = get_current_screen();
232
+ if ( $current_screen ) {
233
+ $current_screen->add_help_tab( array(
234
+ 'id' => 'search-regex',
235
+ 'title' => 'Search Regex',
236
+ 'content' => "<h2>$title</h2>" . implode( "\n", $content ),
237
+ ) );
238
+ }
239
+ }
240
+
241
+ /**
242
+ * Get i18n data
243
+ *
244
+ * @internal
245
+ * @return Array
246
+ */
247
+ private function get_i18n_data() {
248
+ $locale = get_locale();
249
+
250
+ // WP 4.7
251
+ if ( function_exists( 'get_user_locale' ) ) {
252
+ $locale = get_user_locale();
253
+ }
254
+
255
+ $i18n_json = dirname( SEARCHREGEX_FILE ) . '/locale/json/search-regex-' . $locale . '.json';
256
+
257
+ if ( is_file( $i18n_json ) && is_readable( $i18n_json ) ) {
258
+ // phpcs:ignore
259
+ $locale_data = @file_get_contents( $i18n_json );
260
+
261
+ if ( $locale_data ) {
262
+ return json_decode( $locale_data );
263
+ }
264
+ }
265
+
266
+ // Return empty if we have nothing to return so it doesn't fail when parsed in JS
267
+ return array();
268
+ }
269
+
270
+ /**
271
+ * Admin menu
272
+ *
273
+ * @return void
274
+ */
275
+ public function admin_menu() {
276
+ $hook = add_management_page( 'Search Regex', 'Search Regex', Search_Regex_Capabilities::get_plugin_access(), basename( SEARCHREGEX_FILE ), [ $this, 'admin_screen' ] );
277
+ if ( $hook ) {
278
+ add_action( 'load-' . $hook, [ $this, 'searchregex_head' ] );
279
+ }
280
+ }
281
+
282
+ /**
283
+ * Check if we meet minimum WP requirements
284
+ *
285
+ * @return Bool
286
+ */
287
+ private function check_minimum_wp() {
288
+ $wp_version = get_bloginfo( 'version' );
289
+
290
+ if ( version_compare( $wp_version, SEARCHREGEX_MIN_WP, '<' ) ) {
291
+ return false;
292
+ }
293
+
294
+ return true;
295
+ }
296
+
297
+ /**
298
+ * Admin screen
299
+ *
300
+ * @return void
301
+ */
302
+ public function admin_screen() {
303
+ if ( count( Search_Regex_Capabilities::get_all_capabilities() ) === 0 ) {
304
+ die( 'You do not have sufficient permissions to access this page.' );
305
+ }
306
+
307
+ if ( $this->check_minimum_wp() === false ) {
308
+ $this->show_minimum_wordpress();
309
+ return;
310
+ }
311
+
312
+ $this->show_main();
313
+ }
314
+
315
+ /**
316
+ * Show minimum supported WP
317
+ *
318
+ * @internal
319
+ * @return void
320
+ */
321
+ private function show_minimum_wordpress() {
322
+ global $wp_version;
323
+
324
+ /* translators: 1: Expected WordPress version, 2: Actual WordPress version */
325
+ $wp_requirement = sprintf( __( 'Search Regex requires WordPress v%1$1s, you are using v%2$2s - please update your WordPress', 'search-regex' ), SEARCHREGEX_MIN_WP, $wp_version );
326
+ ?>
327
+ <div class="react-error">
328
+ <h1><?php esc_html_e( 'Unable to load Search Regex', 'search-regex' ); ?></h1>
329
+ <p><?php echo esc_html( $wp_requirement ); ?></p>
330
+ </div>
331
+ <?php
332
+ }
333
+
334
+ /**
335
+ * Show fail to load page
336
+ *
337
+ * @internal
338
+ * @return void
339
+ */
340
+ private function show_load_fail() {
341
+ ?>
342
+ <div class="react-error" style="display: none">
343
+ <h1><?php esc_html_e( 'Unable to load Search Regex ☹️', 'search-regex' ); ?> v<?php echo esc_html( SEARCHREGEX_VERSION ); ?></h1>
344
+ <p><?php esc_html_e( "This may be caused by another plugin - look at your browser's error console for more details.", 'search-regex' ); ?></p>
345
+ <p><?php esc_html_e( 'If you are using a page caching plugin or service (CloudFlare, OVH, etc) then you can also try clearing that cache.', 'search-regex' ); ?></p>
346
+ <p><?php _e( 'Also check if your browser is able to load <code>search-regex.js</code>:', 'search-regex' ); ?></p>
347
+ <p><code><?php echo esc_html( plugin_dir_url( SEARCHREGEX_FILE ) . 'search-regex.js?ver=' . rawurlencode( SEARCHREGEX_VERSION ) . '-' . rawurlencode( SEARCHREGEX_BUILD ) ); ?></code></p>
348
+ <p><?php esc_html_e( 'Please note that Search Regex requires the WordPress REST API to be enabled. If you have disabled this then you won\'t be able to use Search Regex', 'search-regex' ); ?></p>
349
+ <p><?php _e( 'Please see the <a href="https://searchregex.com/support/problems/">list of common problems</a>.', 'search-regex' ); ?></p>
350
+ <p><?php esc_html_e( 'If you think Search Regex is at fault then create an issue.', 'search-regex' ); ?></p>
351
+ <p class="versions"><?php _e( '<code>SearchRegexi10n</code> is not defined. This usually means another plugin is blocking Search Regex from loading. Please disable all plugins and try again.', 'search-regex' ); ?></p>
352
+ <p>
353
+ <a class="button-primary" target="_blank" href="https://github.com/johngodley/search-regex/issues/new?title=Problem%20starting%20Search%20Regex%20<?php echo esc_attr( SEARCHREGEX_VERSION ); ?>">
354
+ <?php esc_html_e( 'Create Issue', 'search-regex' ); ?>
355
+ </a>
356
+ </p>
357
+ </div>
358
+ <?php
359
+ }
360
+
361
+ /**
362
+ * Show main UI
363
+ *
364
+ * @internal
365
+ * @return void
366
+ */
367
+ private function show_main() {
368
+ ?>
369
+ <div id="react-modal"></div>
370
+ <div id="react-portal"></div>
371
+ <div id="react-ui">
372
+ <div class="react-loading">
373
+ <h1><?php esc_html_e( 'Loading, please wait...', 'search-regex' ); ?></h1>
374
+
375
+ <span class="react-loading-spinner"></span>
376
+ </div>
377
+ <noscript><?php esc_html_e( 'Please enable JavaScript', 'search-regex' ); ?></noscript>
378
+
379
+ <?php $this->show_load_fail(); ?>
380
+ </div>
381
+
382
+ <script>
383
+ var prevError = window.onerror;
384
+ var errors = [];
385
+ var timeout = 0;
386
+ var timer = setInterval( function() {
387
+ if ( isSearchRegexLoaded() ) {
388
+ resetAll();
389
+ } else if ( errors.length > 0 || timeout++ === 5 ) {
390
+ showError();
391
+ }
392
+ }, 5000 );
393
+
394
+ function isSearchRegexLoaded() {
395
+ return typeof searchregex !== 'undefined';
396
+ }
397
+
398
+ function showError() {
399
+ var errorText = "";
400
+
401
+ if ( errors.length > 0 ) {
402
+ errorText = "```\n" + errors.join( ',' ) + "\n```\n\n";
403
+ }
404
+
405
+ resetAll();
406
+ document.querySelector( '.react-loading' ).style.display = 'none';
407
+ document.querySelector( '.react-error' ).style.display = 'block';
408
+
409
+ if ( typeof SearchRegexi10n !== 'undefined' ) {
410
+ document.querySelector( '.versions' ).innerHTML = SearchRegexi10n.versions.replace( /\n/g, '<br />' );
411
+ document.querySelector( '.react-error .button-primary' ).href += '&body=' + encodeURIComponent( errorText ) + encodeURIComponent( SearchRegexi10n.versions );
412
+ }
413
+ }
414
+
415
+ function resetAll() {
416
+ clearInterval( timer );
417
+ window.onerror = prevError;
418
+ }
419
+
420
+ window.onerror = function( error, url, line ) {
421
+ console.error( error );
422
+ errors.push( error + ' ' + url + ' ' + line );
423
+ };
424
+ </script>
425
+ <?php
426
+ }
427
+
428
+ /**
429
+ * Get the current plugin page.
430
+ * Uses $_GET['sub'] to determine the current page unless a page is supplied.
431
+ *
432
+ * @param String|Bool $page Current page.
433
+ *
434
+ * @return string|boolean Current page, or false.
435
+ */
436
+ private function get_current_page( $page = false ) {
437
+ // $_GET['sub'] is validated below
438
+ // phpcs:ignore
439
+ if ( ! $page ) {
440
+ // phpcs:ignore
441
+ $page = isset( $_GET['sub'] ) ? $_GET['sub'] : 'search';
442
+ }
443
+
444
+ // Are we allowed to access this page?
445
+ if ( in_array( $page, Search_Regex_Capabilities::get_available_pages(), true ) ) {
446
+ // phpcs:ignore
447
+ return $page;
448
+ }
449
+
450
+ return false;
451
+ }
452
+ }
453
+
454
+ add_action( 'init', array( 'Search_Regex_Admin', 'init' ) );
search-regex-capabilities.php ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Search Regex capabilities
5
+ *
6
+ * Hook `searchregex_role` and return a capability for access to the plugin menu. For example `edit_pages` will allow an editor
7
+ * Hook `searchregex_capability` and return a different capability for each check that needs specific permissions.
8
+ *
9
+ * For example, if you want to give editors access to create redirects, but nothing else:
10
+ *
11
+ * ```php
12
+ * add_filter( 'searchregex_capability_check', function( $capability, $permission_name ) {
13
+ * if ( $permission_name === 'searchregex_cap_redirect_manage' || $permission_name === 'searchregex_cap_redirect_add' ) {
14
+ * return $capability;
15
+ * }
16
+ *
17
+ * return 'manage_options';
18
+ * } );
19
+ * ```
20
+ *
21
+ * Always default to restrictive and then grant permissions. Don't default to permissive and remove permissions. This way if a new
22
+ * capability is added your users won't automatically be granted access.
23
+ *
24
+ * Capabilities can be filtered with:
25
+ * - `searchregex_capability_check( $capability, $permission_name )` - override `$capability` dependant on `$permission_name`
26
+ * - `searchregex_capability_pages( $pages )` - filters the list of available pages
27
+ * - `searchregex_role( $cap )` - return the role/capability used for overall access to the plugin
28
+ *
29
+ * Note some capabilities may give access to data from others. For example, when viewing a page of redirects via `searchregex_cap_redirect_manage`
30
+ * the client will need to access group data.
31
+ */
32
+ class Search_Regex_Capabilities {
33
+ const FILTER_ALL = 'searchregex_capability_all';
34
+ const FILTER_PAGES = 'searchregex_capability_pages';
35
+ const FILTER_CAPABILITY = 'searchregex_capability_check';
36
+
37
+ // The default WordPress capability used for all checks
38
+ const CAP_DEFAULT = 'manage_options';
39
+
40
+ // The main capability used to provide access to the plugin
41
+ const CAP_PLUGIN = 'searchregex_role';
42
+
43
+ // These capabilities are combined with `searchregex_cap_` to form `searchregex_cap_redirect_add` etc
44
+ const CAP_SEARCHREGEX_SEARCH = 'searchregex_cap_manage';
45
+ const CAP_SEARCHREGEX_OPTIONS = 'searchregex_cap_options';
46
+ const CAP_SEARCHREGEX_SUPPORT = 'searchregex_cap_support';
47
+
48
+ /**
49
+ * Determine if the current user has access to a named capability.
50
+ *
51
+ * @param string $cap_name The capability to check for. See Search_Regex_Capabilities for constants.
52
+ * @return boolean
53
+ */
54
+ public static function has_access( $cap_name ) {
55
+ // Get the capability using the default plugin access as the base. Old sites overriding `searchregex_role` will get access to everything
56
+ /** @psalm-suppress TooManyArguments */
57
+ $cap_to_check = apply_filters( self::FILTER_CAPABILITY, self::get_plugin_access(), $cap_name );
58
+
59
+ // Check the capability
60
+ return current_user_can( $cap_to_check );
61
+ }
62
+
63
+ /**
64
+ * Return the role/capability used for displaying the plugin menu. This is also the base capability for all other checks.
65
+ *
66
+ * @return string Role/capability
67
+ */
68
+ public static function get_plugin_access() {
69
+ return apply_filters( self::CAP_PLUGIN, self::CAP_DEFAULT );
70
+ }
71
+
72
+ /**
73
+ * Return all the pages the user has access to.
74
+ *
75
+ * @return array Array of pages
76
+ */
77
+ public static function get_available_pages() {
78
+ $pages = [
79
+ self::CAP_SEARCHREGEX_SEARCH => 'search',
80
+ self::CAP_SEARCHREGEX_OPTIONS => 'options',
81
+ self::CAP_SEARCHREGEX_SUPPORT => 'support',
82
+ ];
83
+
84
+ $available = [];
85
+ foreach ( $pages as $key => $page ) {
86
+ if ( self::has_access( $key ) ) {
87
+ $available[] = $page;
88
+ }
89
+ }
90
+
91
+ return array_values( apply_filters( self::FILTER_PAGES, $available ) );
92
+ }
93
+
94
+ /**
95
+ * Return all the capabilities the current user has
96
+ *
97
+ * @return array Array of capabilities
98
+ */
99
+ public static function get_all_capabilities() {
100
+ $caps = self::get_every_capability();
101
+
102
+ $caps = array_filter( $caps, function( $cap ) {
103
+ return self::has_access( $cap );
104
+ } );
105
+
106
+ return array_values( apply_filters( self::FILTER_ALL, $caps ) );
107
+ }
108
+
109
+ /**
110
+ * Unfiltered list of all the supported capabilities, without influence from the current user
111
+ *
112
+ * @return array Array of capabilities
113
+ */
114
+ public static function get_every_capability() {
115
+ return [
116
+ self::CAP_SEARCHREGEX_SEARCH,
117
+ self::CAP_SEARCHREGEX_OPTIONS,
118
+ self::CAP_SEARCHREGEX_SUPPORT,
119
+ ];
120
+ }
121
+ }
search-regex-cli.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+
3
+ if ( defined( 'WP_CLI' ) && WP_CLI ) {
4
+ }
search-regex-settings.php ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /** @var String */
4
+ define( 'SEARCHREGEX_OPTION', 'searchregex_options' );
5
+ /** @var String */
6
+ define( 'SEARCHREGEX_API_JSON', 0 );
7
+ /** @var String */
8
+ define( 'SEARCHREGEX_API_JSON_INDEX', 1 );
9
+ /** @var String */
10
+ define( 'SEARCHREGEX_API_JSON_RELATIVE', 3 );
11
+
12
+ /**
13
+ * Get default Search Regex options
14
+ *
15
+ * @return Array
16
+ */
17
+ function searchregex_get_default_options() {
18
+ $defaults = [
19
+ 'support' => false,
20
+ 'rest_api' => SEARCHREGEX_API_JSON,
21
+ ];
22
+
23
+ return \apply_filters( 'searchregex_default_options', $defaults );
24
+ }
25
+
26
+ /**
27
+ * Set Search Regex options. Can be passed as many options as necessary and the rest will be unchanged
28
+ *
29
+ * @param Array $settings Array of name => value.
30
+ * @return Array Array of name => value
31
+ */
32
+ function searchregex_set_options( array $settings = array() ) {
33
+ $options = searchregex_get_options();
34
+
35
+ if ( isset( $settings['rest_api'] ) && in_array( intval( $settings['rest_api'], 10 ), array( 0, 1, 2, 3, 4 ), true ) ) {
36
+ $options['rest_api'] = intval( $settings['rest_api'], 10 );
37
+ }
38
+
39
+ if ( isset( $settings['support'] ) ) {
40
+ $options['support'] = $settings['support'] ? true : false;
41
+ }
42
+
43
+ \update_option( SEARCHREGEX_OPTION, \apply_filters( 'searchregex_save_options', $options ) );
44
+ return $options;
45
+ }
46
+
47
+ /**
48
+ * Return Search Regex options
49
+ *
50
+ * @return Array Array of data
51
+ */
52
+ function searchregex_get_options() {
53
+ $options = \get_option( SEARCHREGEX_OPTION );
54
+ $defaults = searchregex_get_default_options();
55
+
56
+ foreach ( $defaults as $key => $value ) {
57
+ if ( ! isset( $options[ $key ] ) ) {
58
+ $options[ $key ] = $value;
59
+ }
60
+ }
61
+
62
+ // Remove old options not in searchregex_get_default_options()
63
+ foreach ( array_keys( $options ) as $key ) {
64
+ if ( ! isset( $defaults[ $key ] ) ) {
65
+ unset( $options[ $key ] );
66
+ }
67
+ }
68
+
69
+ return $options;
70
+ }
71
+
72
+ /**
73
+ * Get the configured REST API
74
+ *
75
+ * @param boolean $type Type of API.
76
+ * @return String API URL
77
+ */
78
+ function searchregex_get_rest_api( $type = false ) {
79
+ if ( $type === false ) {
80
+ $options = searchregex_get_options();
81
+ $type = $options['rest_api'];
82
+ }
83
+
84
+ $url = \get_rest_url(); // SEARCHREGEX_API_JSON
85
+
86
+ if ( $type === SEARCHREGEX_API_JSON_INDEX ) {
87
+ $url = \home_url( '/index.php?rest_route=/' );
88
+ } elseif ( $type === SEARCHREGEX_API_JSON_RELATIVE ) {
89
+ $relative = \wp_parse_url( $url, PHP_URL_PATH );
90
+
91
+ if ( $relative ) {
92
+ $url = $relative;
93
+ }
94
+ }
95
+
96
+ return $url;
97
+ }
search-regex-strings.php ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */
3
+ $search_regex_strings = array(
4
+ __( "WordPress did not return a response. This could mean an error occurred or that the request was blocked. Please check your server error_log.", "search-regex" ), // client/component/decode-error/index.js:49
5
+ __( "Your REST API is being cached. Please clear any caching plugin and any server cache, logout, clear your browser cache, and try again.", "search-regex" ), // client/component/decode-error/index.js:56
6
+ __( "Read this REST API guide for more information.", "search-regex" ), // client/component/decode-error/index.js:57
7
+ __( "Your REST API is probably being blocked by a security plugin. Please disable this, or configure it to allow REST API requests.", "search-regex" ), // client/component/decode-error/index.js:66
8
+ __( "Read this REST API guide for more information.", "search-regex" ), // client/component/decode-error/index.js:67
9
+ __( "Your REST API is returning a 404 page. This may be caused by a security plugin, or your server may be misconfigured", "search-regex" ), // client/component/decode-error/index.js:76
10
+ __( "Read this REST API guide for more information.", "search-regex" ), // client/component/decode-error/index.js:77
11
+ __( "Your server has rejected the request for being too big. You will need to change it to continue.", "search-regex" ), // client/component/decode-error/index.js:83
12
+ __( "This could be a security plugin, or your server is out of memory or has an external error. Please check your server error log", "search-regex" ), // client/component/decode-error/index.js:90
13
+ __( "Read this REST API guide for more information.", "search-regex" ), // client/component/decode-error/index.js:91
14
+ __( "Your WordPress REST API has been disabled. You will need to enable it for Search Regex to continue working", "search-regex" ), // client/component/decode-error/index.js:97
15
+ __( "WordPress returned an unexpected message. This is probably a PHP error from another plugin.", "search-regex" ), // client/component/decode-error/index.js:106
16
+ __( "Possible cause", "search-regex" ), // client/component/decode-error/index.js:107
17
+ __( "Unable to make request due to browser security. This is typically because your WordPress and Site URL settings are inconsistent, or the request was blocked by your site CORS policy.", "search-regex" ), // client/component/decode-error/index.js:117
18
+ __( "Read this REST API guide for more information.", "search-regex" ), // client/component/decode-error/index.js:118
19
+ __( "Editing %s", "search-regex" ), // client/component/editor/index.js:55
20
+ __( "Save", "search-regex" ), // client/component/editor/index.js:80
21
+ __( "Close", "search-regex" ), // client/component/editor/index.js:81
22
+ __( "Please {{strong}}create an issue{{/strong}} or send it in an {{strong}}email{{/strong}}.", "search-regex" ), // client/component/error/index.js:100
23
+ __( "Create An Issue", "search-regex" ), // client/component/error/index.js:107
24
+ __( "Email", "search-regex" ), // client/component/error/index.js:107
25
+ __( "Include these details in your report along with a description of what you were doing and a screenshot.", "search-regex" ), // client/component/error/index.js:108
26
+ __( "You are not authorised to access this page.", "search-regex" ), // client/component/error/index.js:118
27
+ __( "This is usually fixed by doing one of these:", "search-regex" ), // client/component/error/index.js:120
28
+ __( "Reload the page - your current session is old.", "search-regex" ), // client/component/error/index.js:122
29
+ __( "Log out, clear your browser cache, and log in again - your browser has cached an old session.", "search-regex" ), // client/component/error/index.js:123
30
+ __( "Your admin pages are being cached. Clear this cache and try again.", "search-regex" ), // client/component/error/index.js:124
31
+ __( "The problem is almost certainly caused by one of the above.", "search-regex" ), // client/component/error/index.js:127
32
+ __( "That didn't help", "search-regex" ), // client/component/error/index.js:129
33
+ __( "Something went wrong 🙁", "search-regex" ), // client/component/error/index.js:147
34
+ __( "What do I do next?", "search-regex" ), // client/component/error/index.js:155
35
+ __( "Take a look at the {{link}}plugin status{{/link}}. It may be able to identify and \"magic fix\" the problem.", "search-regex" ), // client/component/error/index.js:159
36
+ __( "{{link}}Caching software{{/link}}, in particular Cloudflare, can cache the wrong thing. Try clearing all your caches.", "search-regex" ), // client/component/error/index.js:166
37
+ __( "{{link}}Please temporarily disable other plugins!{{/link}} This fixes so many problems.", "search-regex" ), // client/component/error/index.js:173
38
+ __( "If you are using WordPress 5.2 or newer then look at your {{link}}Site Health{{/link}} and resolve any issues.", "search-regex" ), // client/component/error/index.js:180
39
+ __( "That didn't help", "search-regex" ), // client/component/error/index.js:188
40
+ __( "Search & Replace", "search-regex" ), // client/component/menu/index.js:18
41
+ __( "Options", "search-regex" ), // client/component/menu/index.js:22
42
+ __( "Support", "search-regex" ), // client/component/menu/index.js:26
43
+ __( "Replacement for this match", "search-regex" ), // client/component/highlight-matches/replacement.js:52
44
+ __( "Replace single phrase.", "search-regex" ), // client/component/highlight-matches/replacement.js:53
45
+ __( "View notice", "search-regex" ), // client/component/notice/index.js:76
46
+ __( "Single", "search-regex" ), // client/component/replace/index.js:19
47
+ __( "Multi", "search-regex" ), // client/component/replace/index.js:23
48
+ __( "Remove", "search-regex" ), // client/component/replace/index.js:27
49
+ __( "Search phrase will be removed", "search-regex" ), // client/component/replace/index.js:65
50
+ __( "Replace", "search-regex" ), // client/component/replace/index.js:117
51
+ __( "Cancel", "search-regex" ), // client/component/replace/index.js:120
52
+ __( "Replace progress", "search-regex" ), // client/component/replace-progress/index.js:32
53
+ __( "Finished!", "search-regex" ), // client/component/replace-progress/index.js:42
54
+ __( "Rows updated: %s", "search-regex" ), // client/component/replace-progress/index.js:43
55
+ __( "Phrases replaced: %s", "search-regex" ), // client/component/replace-progress/index.js:44
56
+ __( "Finished!", "search-regex" ), // client/component/replace-progress/index.js:45
57
+ __( "Working!", "search-regex" ), // client/component/rest-api-status/api-result-pass.js:15
58
+ __( "Show Full", "search-regex" ), // client/component/rest-api-status/api-result-raw.js:41
59
+ __( "Hide", "search-regex" ), // client/component/rest-api-status/api-result-raw.js:42
60
+ __( "Switch to this API", "search-regex" ), // client/component/rest-api-status/api-result.js:27
61
+ __( "Current API", "search-regex" ), // client/component/rest-api-status/api-result.js:28
62
+ __( "Good", "search-regex" ), // client/component/rest-api-status/index.js:100
63
+ __( "Working but some issues", "search-regex" ), // client/component/rest-api-status/index.js:102
64
+ __( "Not working but fixable", "search-regex" ), // client/component/rest-api-status/index.js:104
65
+ __( "Unavailable", "search-regex" ), // client/component/rest-api-status/index.js:107
66
+ __( "There are some problems connecting to your REST API. It is not necessary to fix these problems and the plugin is able to work.", "search-regex" ), // client/component/rest-api-status/index.js:122
67
+ __( "Your REST API is not working and the plugin will not be able to continue until this is fixed.", "search-regex" ), // client/component/rest-api-status/index.js:125
68
+ __( "You are using a broken REST API route. Changing to a working API should fix the problem.", "search-regex" ), // client/component/rest-api-status/index.js:127
69
+ __( "Summary", "search-regex" ), // client/component/rest-api-status/index.js:132
70
+ __( "Show Problems", "search-regex" ), // client/component/rest-api-status/index.js:134
71
+ __( "Testing - %s\$", "search-regex" ), // client/component/rest-api-status/index.js:160
72
+ __( "Check Again", "search-regex" ), // client/component/rest-api-status/index.js:167
73
+ __( "Replace", "search-regex" ), // client/component/result/actions.js:49
74
+ __( "Replacement for all matches in this row", "search-regex" ), // client/component/result/actions.js:63
75
+ __( "Edit", "search-regex" ), // client/component/result/actions.js:71
76
+ __( "Editor", "search-regex" ), // client/component/result/actions.js:81
77
+ __( "Delete", "search-regex" ), // client/component/result/actions.js:82
78
+ _n( "Replace %(count)s match.", "Replace %(count)s matches.", 1, "search-regex" ), // client/component/result/index.js:86
79
+ __( "Maximum number of matches exceeded and hidden from view. These will be included in any replacements.", "search-regex" ), // client/component/result/restricted-matches.js:11
80
+ _n( "Show %s more", "Show %s more", 1, "search-regex" ), // client/component/result/result-columns.js:42
81
+ __( "Search Regex", "search-regex" ), // client/page/home/index.js:26
82
+ __( "Options", "search-regex" ), // client/page/home/index.js:27
83
+ __( "Support", "search-regex" ), // client/page/home/index.js:28
84
+ __( "Cached Search Regex detected", "search-regex" ), // client/page/home/index.js:109
85
+ __( "Please clear your browser cache and reload this page.", "search-regex" ), // client/page/home/index.js:110
86
+ __( "If you are using a caching system such as Cloudflare then please read this: ", "search-regex" ), // client/page/home/index.js:112
87
+ __( "clearing your cache.", "search-regex" ), // client/page/home/index.js:113
88
+ __( "Something went wrong 🙁", "search-regex" ), // client/page/home/index.js:122
89
+ __( "Search Regex is not working. Try clearing your browser cache and reloading this page.", "search-regex" ), // client/page/home/index.js:125
90
+ __( "If you are using a page caching plugin or service (CloudFlare, OVH, etc) then you can also try clearing that cache.", "search-regex" ), // client/page/home/index.js:126
91
+ __( "If that doesn't help, open your browser's error console and create a {{link}}new issue{{/link}} with the details.", "search-regex" ), // client/page/home/index.js:130
92
+ __( "Please mention {{code}}%s{{/code}}, and explain what you were doing at the time", "search-regex" ), // client/page/home/index.js:137
93
+ __( "You've supported this plugin - thank you!", "search-regex" ), // client/page/options/donation.js:82
94
+ __( "I'd like to support some more.", "search-regex" ), // client/page/options/donation.js:83
95
+ __( "Search Regex is free to use - life is wonderful and lovely! It has required a great deal of time and effort to develop and you can help support this development by {{strong}}making a small donation{{/strong}}.", "search-regex" ), // client/page/options/donation.js:99
96
+ __( "You get useful software and I get to carry on making it better.", "search-regex" ), // client/page/options/donation.js:104
97
+ __( "Support 💰", "search-regex" ), // client/page/options/donation.js:127
98
+ __( "Plugin Support", "search-regex" ), // client/page/options/donation.js:139
99
+ __( "Default REST API", "search-regex" ), // client/page/options/options-form.js:18
100
+ __( "Raw REST API", "search-regex" ), // client/page/options/options-form.js:19
101
+ __( "Relative REST API", "search-regex" ), // client/page/options/options-form.js:20
102
+ __( "I'm a nice person and I have helped support the author of this plugin", "search-regex" ), // client/page/options/options-form.js:51
103
+ __( "REST API", "search-regex" ), // client/page/options/options-form.js:55
104
+ __( "How Search Regex uses the REST API - don't change unless necessary", "search-regex" ), // client/page/options/options-form.js:57
105
+ __( "Update", "search-regex" ), // client/page/options/options-form.js:61
106
+ __( "You are advised to backup your data before making modifications.", "search-regex" ), // client/page/search-replace/index.js:25
107
+ __( "Search and replace information in your database.", "search-regex" ), // client/page/search-replace/index.js:28
108
+ __( "Search", "search-regex" ), // client/page/search-replace/search-actions.js:32
109
+ __( "Replace All", "search-regex" ), // client/page/search-replace/search-actions.js:40
110
+ __( "Cancel", "search-regex" ), // client/page/search-replace/search-actions.js:51
111
+ __( "Search", "search-regex" ), // client/page/search-replace/search-form.js:54
112
+ __( "Enter search phrase", "search-regex" ), // client/page/search-replace/search-form.js:61
113
+ __( "Search Flags", "search-regex" ), // client/page/search-replace/search-form.js:70
114
+ __( "Replace", "search-regex" ), // client/page/search-replace/search-form.js:78
115
+ __( "Enter global replacement text", "search-regex" ), // client/page/search-replace/search-form.js:83
116
+ __( "Source", "search-regex" ), // client/page/search-replace/search-form.js:89
117
+ __( "Source Options", "search-regex" ), // client/page/search-replace/search-form.js:104
118
+ __( "Results", "search-regex" ), // client/page/search-replace/search-form.js:116
119
+ __( "Need more help?", "search-regex" ), // client/page/support/help.js:14
120
+ __( "Full documentation for Search Regex can be found at {{site}}https://searchregex.com{{/site}}.", "search-regex" ), // client/page/support/help.js:16
121
+ __( "If you want to report a bug please read the {{report}}Reporting Bugs{{/report}} guide.", "search-regex" ), // client/page/support/help.js:22
122
+ __( "Please note that any support is provide on as-time-is-available basis and is not guaranteed. I do not provide paid support.", "search-regex" ), // client/page/support/help.js:37
123
+ __( "If you want to submit information that you don't want in a public repository then send it directly via {{email}}email{{/email}} - include as much information as you can!", "search-regex" ), // client/page/support/help.js:38
124
+ __( "Redirection", "search-regex" ), // client/page/support/help.js:44
125
+ __( "Like this plugin? You might want to consider {{link}}Redirection{{/link}}, a plugin to manage redirects, that is also written by me.", "search-regex" ), // client/page/support/help.js:45
126
+ __( "Quick Help", "search-regex" ), // client/page/support/search-help.js:17
127
+ __( "The following concepts are used by Search Regex:", "search-regex" ), // client/page/support/search-help.js:19
128
+ __( "{{link}}Search Flags{{/link}} - additional qualifiers for your search, to enable case insensitivity, and to enable regular expression support.", "search-regex" ), // client/page/support/search-help.js:22
129
+ __( "{{link}}Regular expression{{/link}} - a way of defining a pattern for text matching. Provides more advanced matches.", "search-regex" ), // client/page/support/search-help.js:27
130
+ __( "{{link}}Source{{/link}} - the source of data you wish to search. For example, posts, pages, or comments.", "search-regex" ), // client/page/support/search-help.js:32
131
+ __( "{{link}}Source Flags{{/link}} - additional options for the selected source. For example, include post {{guid}}GUID{{/guid}} in the search.", "search-regex" ), // client/page/support/search-help.js:37
132
+ __( "Settings saved", "search-regex" ), // client/state/message/reducer.js:30
133
+ __( "Row deleted", "search-regex" ), // client/state/message/reducer.js:31
134
+ __( "Row replaced", "search-regex" ), // client/state/message/reducer.js:32
135
+ __( "Row updated", "search-regex" ), // client/state/message/reducer.js:33
136
+ __( "Regular Expression", "search-regex" ), // client/state/search/selector.js:10
137
+ __( "Ignore Case", "search-regex" ), // client/state/search/selector.js:14
138
+ __( "25 per page ", "search-regex" ), // client/state/search/selector.js:21
139
+ __( "50 per page ", "search-regex" ), // client/state/search/selector.js:25
140
+ __( "100 per page", "search-regex" ), // client/state/search/selector.js:29
141
+ __( "250 per page", "search-regex" ), // client/state/search/selector.js:33
142
+ __( "500 per page", "search-regex" ), // client/state/search/selector.js:37
143
+ _n( "%s database row in total", "%s database rows in total", 1, "search-regex" ), // client/page/search-replace/pagination/advanced-pagination.js:28
144
+ __( "First page", "search-regex" ), // client/page/search-replace/pagination/advanced-pagination.js:34
145
+ __( "Prev page", "search-regex" ), // client/page/search-replace/pagination/advanced-pagination.js:35
146
+ __( "Progress %(current)s\$", "search-regex" ), // client/page/search-replace/pagination/advanced-pagination.js:38
147
+ __( "Next page", "search-regex" ), // client/page/search-replace/pagination/advanced-pagination.js:45
148
+ _n( "Matches: %(phrases)s across %(rows)s database row.", "Matches: %(phrases)s across %(rows)s database rows.", 1, "search-regex" ), // client/page/search-replace/pagination/simple-pagination.js:27
149
+ __( "First page", "search-regex" ), // client/page/search-replace/pagination/simple-pagination.js:37
150
+ __( "Prev page", "search-regex" ), // client/page/search-replace/pagination/simple-pagination.js:38
151
+ __( "Page %(current)s of %(total)s", "search-regex" ), // client/page/search-replace/pagination/simple-pagination.js:41
152
+ __( "Next page", "search-regex" ), // client/page/search-replace/pagination/simple-pagination.js:49
153
+ __( "Last page", "search-regex" ), // client/page/search-replace/pagination/simple-pagination.js:50
154
+ __( "No more matching results found.", "search-regex" ), // client/page/search-replace/search-results/empty-results.js:11
155
+ __( "Maximum number of page requests has been exceeded and the search stopped. Try to be more specific with your search term.", "search-regex" ), // client/page/search-replace/search-results/index.js:36
156
+ __( "Source", "search-regex" ), // client/page/search-replace/search-results/index.js:56
157
+ __( "Row ID", "search-regex" ), // client/page/search-replace/search-results/index.js:57
158
+ __( "Matches", "search-regex" ), // client/page/search-replace/search-results/index.js:58
159
+ __( "Matched Phrases", "search-regex" ), // client/page/search-replace/search-results/index.js:59
160
+ __( "Actions", "search-regex" ), // client/page/search-replace/search-results/index.js:60
161
+ );
162
+ /* THIS IS THE END OF THE GENERATED FILE */
search-regex-version.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ define( 'SEARCHREGEX_VERSION', '2.0' );
4
+ define( 'SEARCHREGEX_BUILD', '32f788d37fc2989dee637ada18b75ef4' );
5
+ define( 'SEARCHREGEX_MIN_WP', '4.6' );
search-regex.css ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .react-error h1, .react-loading h1 {
2
+ text-align: center;
3
+ color: #999;
4
+ margin-top: 150px;
5
+ }
6
+
7
+ .react-loading {
8
+ position: absolute;
9
+ width: 100%;
10
+ height: 100%;
11
+ }
12
+
13
+ .react-loading-spinner {
14
+ position: absolute;
15
+ width: 120px;
16
+ height: 120px;
17
+ left: 50%;
18
+ margin-left: -65px;
19
+
20
+ background-color: #333;
21
+ border-radius: 100%;
22
+ -webkit-animation: sk-scaleout-loading 1.0s infinite ease-in-out;
23
+ animation: sk-scaleout-loading 1.0s infinite ease-in-out;
24
+ }
25
+
26
+ .react-error p {
27
+ text-align: center;
28
+ line-height: 1;
29
+ }
30
+
31
+ .react-error pre {
32
+ border: 1px solid #aaa;
33
+ background-color: white;
34
+ padding: 10px;
35
+ margin: 0 auto;
36
+ width: 600px;
37
+ }
38
+
39
+ p.versions {
40
+ text-align: left;
41
+ width: 600px;
42
+ margin: 0 auto;
43
+ line-height: 1.6;
44
+ color: #666;
45
+ font-size: 12px;
46
+ background-color: white;
47
+ padding: 10px;
48
+ border: 1px solid #ddd;
49
+ }
50
+
51
+ @-webkit-keyframes sk-scaleout-loading {
52
+ 0% { -webkit-transform: scale(0) }
53
+ 100% {
54
+ -webkit-transform: scale(1.0);
55
+ opacity: 0;
56
+ }
57
+ }
58
+
59
+ @keyframes sk-scaleout-loading {
60
+ 0% {
61
+ -webkit-transform: scale(0);
62
+ transform: scale(0);
63
+ } 100% {
64
+ -webkit-transform: scale(1.0);
65
+ transform: scale(1.0);
66
+ opacity: 0;
67
+ }
68
+ }
search-regex.js ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! Search Regex v2.0 */!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}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 o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));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=20)}([function(e,t,n){"use strict";e.exports=n(21)},function(e,t,n){var r=n(25),o=new r;e.exports={numberFormat:o.numberFormat.bind(o),translate:o.translate.bind(o),configure:o.configure.bind(o),setLocale:o.setLocale.bind(o),getLocale:o.getLocale.bind(o),getLocaleSlug:o.getLocaleSlug.bind(o),addTranslations:o.addTranslations.bind(o),reRenderTranslations:o.reRenderTranslations.bind(o),registerComponentUpdateHook:o.registerComponentUpdateHook.bind(o),registerTranslateHook:o.registerTranslateHook.bind(o),state:o.state,stateObserver:o.stateObserver,on:o.stateObserver.on.bind(o.stateObserver),off:o.stateObserver.removeListener.bind(o.stateObserver),emit:o.stateObserver.emit.bind(o.stateObserver),$this:o,I18N:r}},function(e,t,n){e.exports=n(35)()},function(e,t,n){"use strict";var r,o=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},a=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),i=[];function l(e){for(var t=-1,n=0;n<i.length;n++)if(i[n].identifier===e){t=n;break}return t}function u(e,t){for(var n={},r=[],o=0;o<e.length;o++){var a=e[o],u=t.base?a[0]+t.base:a[0],c=n[u]||0,s="".concat(u," ").concat(c);n[u]=c+1;var f=l(s),p={css:a[1],media:a[2],sourceMap:a[3]};-1!==f?(i[f].references++,i[f].updater(p)):i.push({identifier:s,updater:g(p,t),references:1}),r.push(s)}return r}function c(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var o=n.nc;o&&(r.nonce=o)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var i=a(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(t)}return t}var s,f=(s=[],function(e,t){return s[e]=t,s.filter(Boolean).join("\n")});function p(e,t,n,r){var o=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=f(t,o);else{var a=document.createTextNode(o),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(a,i[t]):e.appendChild(a)}}function d(e,t,n){var r=n.css,o=n.media,a=n.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),a&&btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var h=null,m=0;function g(e,t){var n,r,o;if(t.singleton){var a=m++;n=h||(h=c(t)),r=p.bind(null,n,a,!1),o=p.bind(null,n,a,!0)}else n=c(t),r=d.bind(null,n,t),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=o());var n=u(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var o=l(n[r]);i[o].references--}for(var a=u(e,t),c=0;c<n.length;c++){var s=l(n[c]);0===i[s].references&&(i[s].updater(),i.splice(s,1))}n=a}}}},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=(i=r,l=btoa(unescape(encodeURIComponent(JSON.stringify(i)))),u="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(l),"/*# ".concat(u," */")),a=r.sources.map((function(e){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(e," */")}));return[n].concat(a).concat([o]).join("\n")}var i,l,u;return[n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var a=0;a<this.length;a++){var i=this[a][0];null!=i&&(o[i]=!0)}for(var l=0;l<e.length;l++){var u=[].concat(e[l]);r&&o[u[0]]||(n&&(u[2]?u[2]="".concat(n," and ").concat(u[2]):u[2]=n),t.push(u))}},t}},function(e,t,n){var r;
2
+ /*!
3
+ Copyright (c) 2017 Jed Watson.
4
+ Licensed under the MIT License (MIT), see
5
+ http://jedwatson.github.io/classnames
6
+ */!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var a=typeof r;if("string"===a||"number"===a)e.push(r);else if(Array.isArray(r)&&r.length){var i=o.apply(null,r);i&&e.push(i)}else if("object"===a)for(var l in r)n.call(r,l)&&r[l]&&e.push(l)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}}(),e.exports=n(22)},function(e,t,n){"use strict";n.r(t),n.d(t,"__DO_NOT_USE__ActionTypes",(function(){return a})),n.d(t,"applyMiddleware",(function(){return g})),n.d(t,"bindActionCreators",(function(){return f})),n.d(t,"combineReducers",(function(){return c})),n.d(t,"compose",(function(){return m})),n.d(t,"createStore",(function(){return l}));var r=n(12),o=function(){return Math.random().toString(36).substring(7).split("").join(".")},a={INIT:"@@redux/INIT"+o(),REPLACE:"@@redux/REPLACE"+o(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+o()}};function i(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function l(e,t,n){var o;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("Expected the enhancer to be a function.");return n(l)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var u=e,c=t,s=[],f=s,p=!1;function d(){f===s&&(f=s.slice())}function h(){if(p)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return c}function m(e){if("function"!=typeof e)throw new Error("Expected the listener to be a function.");if(p)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribelistener for more details.");var t=!0;return d(),f.push(e),function(){if(t){if(p)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribelistener for more details.");t=!1,d();var n=f.indexOf(e);f.splice(n,1),s=null}}}function g(e){if(!i(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(p)throw new Error("Reducers may not dispatch actions.");try{p=!0,c=u(c,e)}finally{p=!1}for(var t=s=f,n=0;n<t.length;n++){(0,t[n])()}return e}function y(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");u=e,g({type:a.REPLACE})}function b(){var e,t=m;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new TypeError("Expected the observer to be an object.");function n(){e.next&&e.next(h())}return n(),{unsubscribe:t(n)}}})[r.a]=function(){return this},e}return g({type:a.INIT}),(o={dispatch:g,subscribe:m,getState:h,replaceReducer:y})[r.a]=b,o}function u(e,t){var n=t&&t.type;return"Given "+(n&&'action "'+String(n)+'"'||"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 c(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];0,"function"==typeof e[o]&&(n[o]=e[o])}var i,l=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:a.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(void 0===n(void 0,{type:a.PROBE_UNKNOWN_ACTION()}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+a.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(e){i=e}return function(e,t){if(void 0===e&&(e={}),i)throw i;for(var r=!1,o={},a=0;a<l.length;a++){var c=l[a],s=n[c],f=e[c],p=s(f,t);if(void 0===p){var d=u(c,t);throw new Error(d)}o[c]=p,r=r||p!==f}return(r=r||l.length!==Object.keys(e).length)?o:e}}function s(e,t){return function(){return t(e.apply(this,arguments))}}function f(e,t){if("function"==typeof e)return s(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"?');var n={};for(var r in e){var o=e[r];"function"==typeof o&&(n[r]=s(o,t))}return n}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(n,!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function m(){for(var e=arguments.length,t=new 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))}}))}function g(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},a=t.map((function(e){return e(o)}));return h({},n,{dispatch:r=m.apply(void 0,a)(n.dispatch)})}}}},function(e,t,n){"use strict";var r=n(40),o=n(41),a=n(16);e.exports={formats:a,parse:o,stringify:r}},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,o=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),i=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n};e.exports={arrayToObject:i,assign:function(e,t){return Object.keys(t).reduce((function(e,n){return e[n]=t[n],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var a=t[r],i=a.obj[a.prop],l=Object.keys(i),u=0;u<l.length;++u){var c=l[u],s=i[c];"object"==typeof s&&null!==s&&-1===n.indexOf(s)&&(t.push({obj:i,prop:c}),n.push(s))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(o(n)){for(var r=[],a=0;a<n.length;++a)void 0!==n[a]&&r.push(n[a]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n){if(0===e.length)return e;var r=e;if("symbol"==typeof e?r=Symbol.prototype.toString.call(e):"string"!=typeof e&&(r=String(e)),"iso-8859-1"===n)return escape(r).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var o="",i=0;i<r.length;++i){var l=r.charCodeAt(i);45===l||46===l||95===l||126===l||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122?o+=r.charAt(i):l<128?o+=a[l]:l<2048?o+=a[192|l>>6]+a[128|63&l]:l<55296||l>=57344?o+=a[224|l>>12]+a[128|l>>6&63]+a[128|63&l]:(i+=1,l=65536+((1023&l)<<10|1023&r.charCodeAt(i)),o+=a[240|l>>18]+a[128|l>>12&63]+a[128|l>>6&63]+a[128|63&l])}return o},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(t,n,a){if(!n)return t;if("object"!=typeof n){if(o(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(a&&(a.plainObjects||a.allowPrototypes)||!r.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var l=t;return o(t)&&!o(n)&&(l=i(t,a)),o(t)&&o(n)?(n.forEach((function(n,o){if(r.call(t,o)){var i=t[o];i&&"object"==typeof i&&n&&"object"==typeof n?t[o]=e(i,n,a):t.push(n)}else t[o]=n})),t):Object.keys(n).reduce((function(t,o){var i=n[o];return r.call(t,o)?t[o]=e(t[o],i,a):t[o]=i,t}),l)}}},function(e,t,n){"use strict";e.exports=n(37)},function(e,t,n){"use strict";var r=n(10),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function u(e){return r.isMemo(e)?i:l[e.$$typeof]||o}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=i;var c=Object.defineProperty,s=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var o=d(n);o&&o!==h&&e(t,o,r)}var i=s(n);f&&(i=i.concat(f(n)));for(var l=u(t),m=u(n),g=0;g<i.length;++g){var y=i[g];if(!(a[y]||r&&r[y]||m&&m[y]||l&&l[y])){var b=p(n,y);try{c(t,y,b)}catch(e){}}}}return t}},function(e,t,n){"use strict";(function(e,r){var o,a=n(18);o="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var i=Object(a.a)(o);t.a=i}).call(this,n(38),n(39)(e))},function(e,t,n){"use strict";
7
+ /*
8
+ object-assign
9
+ (c) Sindre Sorhus
10
+ @license MIT
11
+ */var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,l,u=i(e),c=1;c<arguments.length;c++){for(var s in n=Object(arguments[c]))o.call(n,s)&&(u[s]=n[s]);if(r){l=r(n);for(var f=0;f<l.length;f++)a.call(n,l[f])&&(u[l[f]]=n[l[f]])}}return u}},function(e,t,n){"use strict";var r,o="object"==typeof Reflect?Reflect:null,a=o&&"function"==typeof o.apply?o.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function l(){l.init.call(this)}e.exports=l,l.EventEmitter=l,l.prototype._events=void 0,l.prototype._eventsCount=0,l.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function s(e){return void 0===e._maxListeners?l.defaultMaxListeners:e._maxListeners}function f(e,t,n,r){var o,a,i,l;if(c(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),i=a[t]),void 0===i)i=a[t]=n,++e._eventsCount;else if("function"==typeof i?i=a[t]=r?[n,i]:[i,n]:r?i.unshift(n):i.push(n),(o=s(e))>0&&i.length>o&&!i.warned){i.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=i.length,l=u,console&&console.warn&&console.warn(l)}return e}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=p.bind(r);return o.listener=n,r.wrapFn=o,o}function h(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):g(o,o.length)}function m(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function g(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(l,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),l.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},l.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},l.prototype.getMaxListeners=function(){return s(this)},l.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var i;if(t.length>0&&(i=t[0]),i instanceof Error)throw i;var l=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw l.context=i,l}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)a(u,this,t);else{var c=u.length,s=g(u,c);for(n=0;n<c;++n)a(s[n],this,t)}return!0},l.prototype.addListener=function(e,t){return f(this,e,t,!1)},l.prototype.on=l.prototype.addListener,l.prototype.prependListener=function(e,t){return f(this,e,t,!0)},l.prototype.once=function(e,t){return c(t),this.on(e,d(this,e,t)),this},l.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,d(this,e,t)),this},l.prototype.removeListener=function(e,t){var n,r,o,a,i;if(c(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){i=n[a].listener,o=a;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,i||t)}return this},l.prototype.off=l.prototype.removeListener,l.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(o=a[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},l.prototype.listeners=function(e){return h(this,e,!0)},l.prototype.rawListeners=function(e){return h(this,e,!1)},l.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},l.prototype.listenerCount=m,l.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";var r=String.prototype.replace,o=/%20/g,a=n(9),i={RFC1738:"RFC1738",RFC3986:"RFC3986"};e.exports=a.assign({default:i.RFC3986,formatters:{RFC1738:function(e){return r.call(e,o,"+")},RFC3986:function(e){return String(e)}}},i)},function(e,t,n){function r(e){var t,n=function(){};function o(e,t,n){e&&e.then?e.then((function(e){o(e,t,n)})).catch((function(e){o(e,n,n)})):t(e)}function a(e){t=function(t,n){try{e(t,n)}catch(e){n(e)}},n(),n=void 0}function i(e){a((function(t,n){n(e)}))}function l(e){a((function(t){t(e)}))}function u(e,r){var o=n;n=function(){o(),t(e,r)}}function c(e){!t&&o(e,l,i)}function s(e){!t&&o(e,i,i)}var f={then:function(e){var n=t||u;return r((function(t,r){n((function(n){t(e(n))}),r)}))},catch:function(e){var n=t||u;return r((function(t,r){n(t,(function(t){r(e(t))}))}))},resolve:c,reject:s};try{e&&e(c,s)}catch(e){s(e)}return f}r.resolve=function(e){return r((function(t){t(e)}))},r.reject=function(e){return r((function(t,n){n(e)}))},r.race=function(e){return e=e||[],r((function(t,n){var r=e.length;if(!r)return t();for(var o=0;o<r;++o){var a=e[o];a&&a.then&&a.then(t).catch(n)}}))},r.all=function(e){return e=e||[],r((function(t,n){var r=e.length,o=r;if(!r)return t();function a(){--o<=0&&t(e)}function i(t,r){t&&t.then?t.then((function(t){e[r]=t,a()})).catch(n):a()}for(var l=0;l<r;++l)i(e[l],l)}))},e.exports&&(e.exports=r)},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(7).compose;t.__esModule=!0,t.composeWithDevTools=function(){if(0!==arguments.length)return"object"==typeof arguments[0]?r:r.apply(null,arguments)},t.devToolsEnhancer=function(){return function(e){return e}}},function(e,t,n){e.exports=n(86)},function(e,t,n){"use strict";
12
+ /** @license React v16.13.1
13
+ * react.production.min.js
14
+ *
15
+ * Copyright (c) Facebook, Inc. and its affiliates.
16
+ *
17
+ * This source code is licensed under the MIT license found in the
18
+ * LICENSE file in the root directory of this source tree.
19
+ */var r=n(13),o="function"==typeof Symbol&&Symbol.for,a=o?Symbol.for("react.element"):60103,i=o?Symbol.for("react.portal"):60106,l=o?Symbol.for("react.fragment"):60107,u=o?Symbol.for("react.strict_mode"):60108,c=o?Symbol.for("react.profiler"):60114,s=o?Symbol.for("react.provider"):60109,f=o?Symbol.for("react.context"):60110,p=o?Symbol.for("react.forward_ref"):60112,d=o?Symbol.for("react.suspense"):60113,h=o?Symbol.for("react.memo"):60115,m=o?Symbol.for("react.lazy"):60116,g="function"==typeof Symbol&&Symbol.iterator;function y(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v={};function w(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||b}function E(){}function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||b}w.prototype.isReactComponent={},w.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(y(85));this.updater.enqueueSetState(this,e,t,"setState")},w.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},E.prototype=w.prototype;var _=x.prototype=new E;_.constructor=x,r(_,w.prototype),_.isPureReactComponent=!0;var S={current:null},O=Object.prototype.hasOwnProperty,k={key:!0,ref:!0,__self:!0,__source:!0};function P(e,t,n){var r,o={},i=null,l=null;if(null!=t)for(r in void 0!==t.ref&&(l=t.ref),void 0!==t.key&&(i=""+t.key),t)O.call(t,r)&&!k.hasOwnProperty(r)&&(o[r]=t[r]);var u=arguments.length-2;if(1===u)o.children=n;else if(1<u){for(var c=Array(u),s=0;s<u;s++)c[s]=arguments[s+2];o.children=c}if(e&&e.defaultProps)for(r in u=e.defaultProps)void 0===o[r]&&(o[r]=u[r]);return{$$typeof:a,type:e,key:i,ref:l,props:o,_owner:S.current}}function T(e){return"object"==typeof e&&null!==e&&e.$$typeof===a}var j=/\/+/g,C=[];function R(e,t,n,r){if(C.length){var o=C.pop();return o.result=e,o.keyPrefix=t,o.func=n,o.context=r,o.count=0,o}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function N(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>C.length&&C.push(e)}function A(e,t,n){return null==e?0:function e(t,n,r,o){var l=typeof t;"undefined"!==l&&"boolean"!==l||(t=null);var u=!1;if(null===t)u=!0;else switch(l){case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case a:case i:u=!0}}if(u)return r(o,t,""===n?"."+I(t,0):n),1;if(u=0,n=""===n?".":n+":",Array.isArray(t))for(var c=0;c<t.length;c++){var s=n+I(l=t[c],c);u+=e(l,s,r,o)}else if(null===t||"object"!=typeof t?s=null:s="function"==typeof(s=g&&t[g]||t["@@iterator"])?s:null,"function"==typeof s)for(t=s.call(t),c=0;!(l=t.next()).done;)u+=e(l=l.value,s=n+I(l,c++),r,o);else if("object"===l)throw r=""+t,Error(y(31,"[object Object]"===r?"object with keys {"+Object.keys(t).join(", ")+"}":r,""));return u}(e,"",t,n)}function I(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return t[e]}))}(e.key):t.toString(36)}function D(e,t){e.func.call(e.context,t,e.count++)}function L(e,t,n){var r=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?F(e,r,n,(function(e){return e})):null!=e&&(T(e)&&(e=function(e,t){return{$$typeof:a,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,o+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(j,"$&/")+"/")+n)),r.push(e))}function F(e,t,n,r,o){var a="";null!=n&&(a=(""+n).replace(j,"$&/")+"/"),A(e,L,t=R(t,a,r,o)),N(t)}var M={current:null};function z(){var e=M.current;if(null===e)throw Error(y(321));return e}var U={ReactCurrentDispatcher:M,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:S,IsSomeRendererActing:{current:!1},assign:r};t.Children={map:function(e,t,n){if(null==e)return e;var r=[];return F(e,r,null,t,n),r},forEach:function(e,t,n){if(null==e)return e;A(e,D,t=R(null,null,t,n)),N(t)},count:function(e){return A(e,(function(){return null}),null)},toArray:function(e){var t=[];return F(e,t,null,(function(e){return e})),t},only:function(e){if(!T(e))throw Error(y(143));return e}},t.Component=w,t.Fragment=l,t.Profiler=c,t.PureComponent=x,t.StrictMode=u,t.Suspense=d,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=U,t.cloneElement=function(e,t,n){if(null==e)throw Error(y(267,e));var o=r({},e.props),i=e.key,l=e.ref,u=e._owner;if(null!=t){if(void 0!==t.ref&&(l=t.ref,u=S.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(s in t)O.call(t,s)&&!k.hasOwnProperty(s)&&(o[s]=void 0===t[s]&&void 0!==c?c[s]:t[s])}var s=arguments.length-2;if(1===s)o.children=n;else if(1<s){c=Array(s);for(var f=0;f<s;f++)c[f]=arguments[f+2];o.children=c}return{$$typeof:a,type:e.type,key:i,ref:l,props:o,_owner:u}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:f,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:s,_context:e},e.Consumer=e},t.createElement=P,t.createFactory=function(e){var t=P.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:p,render:e}},t.isValidElement=T,t.lazy=function(e){return{$$typeof:m,_ctor:e,_status:-1,_result:null}},t.memo=function(e,t){return{$$typeof:h,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return z().useCallback(e,t)},t.useContext=function(e,t){return z().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return z().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return z().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return z().useLayoutEffect(e,t)},t.useMemo=function(e,t){return z().useMemo(e,t)},t.useReducer=function(e,t,n){return z().useReducer(e,t,n)},t.useRef=function(e){return z().useRef(e)},t.useState=function(e){return z().useState(e)},t.version="16.13.1"},function(e,t,n){"use strict";
20
+ /** @license React v16.13.1
21
+ * react-dom.production.min.js
22
+ *
23
+ * Copyright (c) Facebook, Inc. and its affiliates.
24
+ *
25
+ * This source code is licensed under the MIT license found in the
26
+ * LICENSE file in the root directory of this source tree.
27
+ */var r=n(0),o=n(13),a=n(23);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!r)throw Error(i(227));function l(e,t,n,r,o,a,i,l,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(e){this.onError(e)}}var u=!1,c=null,s=!1,f=null,p={onError:function(e){u=!0,c=e}};function d(e,t,n,r,o,a,i,s,f){u=!1,c=null,l.apply(p,arguments)}var h=null,m=null,g=null;function y(e,t,n){var r=e.type||"unknown-event";e.currentTarget=g(n),function(e,t,n,r,o,a,l,p,h){if(d.apply(this,arguments),u){if(!u)throw Error(i(198));var m=c;u=!1,c=null,s||(s=!0,f=m)}}(r,t,void 0,e),e.currentTarget=null}var b=null,v={};function w(){if(b)for(var e in v){var t=v[e],n=b.indexOf(e);if(!(-1<n))throw Error(i(96,e));if(!x[n]){if(!t.extractEvents)throw Error(i(97,e));for(var r in x[n]=t,n=t.eventTypes){var o=void 0,a=n[r],l=t,u=r;if(_.hasOwnProperty(u))throw Error(i(99,u));_[u]=a;var c=a.phasedRegistrationNames;if(c){for(o in c)c.hasOwnProperty(o)&&E(c[o],l,u);o=!0}else a.registrationName?(E(a.registrationName,l,u),o=!0):o=!1;if(!o)throw Error(i(98,r,e))}}}}function E(e,t,n){if(S[e])throw Error(i(100,e));S[e]=t,O[e]=t.eventTypes[n].dependencies}var x=[],_={},S={},O={};function k(e){var t,n=!1;for(t in e)if(e.hasOwnProperty(t)){var r=e[t];if(!v.hasOwnProperty(t)||v[t]!==r){if(v[t])throw Error(i(102,t));v[t]=r,n=!0}}n&&w()}var P=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),T=null,j=null,C=null;function R(e){if(e=m(e)){if("function"!=typeof T)throw Error(i(280));var t=e.stateNode;t&&(t=h(t),T(e.stateNode,e.type,t))}}function N(e){j?C?C.push(e):C=[e]:j=e}function A(){if(j){var e=j,t=C;if(C=j=null,R(e),t)for(e=0;e<t.length;e++)R(t[e])}}function I(e,t){return e(t)}function D(e,t,n,r,o){return e(t,n,r,o)}function L(){}var F=I,M=!1,z=!1;function U(){null===j&&null===C||(L(),A())}function H(e,t,n){if(z)return e(t,n);z=!0;try{return F(e,t,n)}finally{z=!1,U()}}var W=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,B=Object.prototype.hasOwnProperty,$={},V={};function q(e,t,n,r,o,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a}var Q={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){Q[e]=new q(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];Q[t]=new q(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){Q[e]=new q(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){Q[e]=new q(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){Q[e]=new q(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){Q[e]=new q(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){Q[e]=new q(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){Q[e]=new q(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){Q[e]=new q(e,5,!1,e.toLowerCase(),null,!1)}));var G=/[\-:]([a-z])/g;function K(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(G,K);Q[t]=new q(t,1,!1,e,null,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(G,K);Q[t]=new q(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(G,K);Q[t]=new q(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(e){Q[e]=new q(e,1,!1,e.toLowerCase(),null,!1)})),Q.xlinkHref=new q("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(e){Q[e]=new q(e,1,!1,e.toLowerCase(),null,!0)}));var Y=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function X(e,t,n,r){var o=Q.hasOwnProperty(t)?Q[t]:null;(null!==o?0===o.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!B.call(V,e)||!B.call($,e)&&(W.test(e)?V[e]=!0:($[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}Y.hasOwnProperty("ReactCurrentDispatcher")||(Y.ReactCurrentDispatcher={current:null}),Y.hasOwnProperty("ReactCurrentBatchConfig")||(Y.ReactCurrentBatchConfig={suspense:null});var J=/^(.*)[\\\/]/,Z="function"==typeof Symbol&&Symbol.for,ee=Z?Symbol.for("react.element"):60103,te=Z?Symbol.for("react.portal"):60106,ne=Z?Symbol.for("react.fragment"):60107,re=Z?Symbol.for("react.strict_mode"):60108,oe=Z?Symbol.for("react.profiler"):60114,ae=Z?Symbol.for("react.provider"):60109,ie=Z?Symbol.for("react.context"):60110,le=Z?Symbol.for("react.concurrent_mode"):60111,ue=Z?Symbol.for("react.forward_ref"):60112,ce=Z?Symbol.for("react.suspense"):60113,se=Z?Symbol.for("react.suspense_list"):60120,fe=Z?Symbol.for("react.memo"):60115,pe=Z?Symbol.for("react.lazy"):60116,de=Z?Symbol.for("react.block"):60121,he="function"==typeof Symbol&&Symbol.iterator;function me(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=he&&e[he]||e["@@iterator"])?e:null}function ge(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case ne:return"Fragment";case te:return"Portal";case oe:return"Profiler";case re:return"StrictMode";case ce:return"Suspense";case se:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case ie:return"Context.Consumer";case ae:return"Context.Provider";case ue:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case fe:return ge(e.type);case de:return ge(e.render);case pe:if(e=1===e._status?e._result:null)return ge(e)}return null}function ye(e){var t="";do{e:switch(e.tag){case 3:case 4:case 6:case 7:case 10:case 9:var n="";break e;default:var r=e._debugOwner,o=e._debugSource,a=ge(e.type);n=null,r&&(n=ge(r.type)),r=a,a="",o?a=" (at "+o.fileName.replace(J,"")+":"+o.lineNumber+")":n&&(a=" (created by "+n+")"),n="\n in "+(r||"Unknown")+a}t+=n,e=e.return}while(e);return t}function be(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function ve(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function we(e){e._valueTracker||(e._valueTracker=function(e){var t=ve(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var o=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function Ee(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ve(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function xe(e,t){var n=t.checked;return o({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function _e(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=be(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Se(e,t){null!=(t=t.checked)&&X(e,"checked",t,!1)}function Oe(e,t){Se(e,t);var n=be(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?Pe(e,t.type,n):t.hasOwnProperty("defaultValue")&&Pe(e,t.type,be(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function ke(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function Pe(e,t,n){"number"===t&&e.ownerDocument.activeElement===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function Te(e,t){return e=o({children:void 0},t),(t=function(e){var t="";return r.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function je(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+be(n),t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function Ce(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(i(91));return o({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Re(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(i(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(i(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:be(n)}}function Ne(e,t){var n=be(t.value),r=be(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function Ae(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var Ie="http://www.w3.org/1999/xhtml",De="http://www.w3.org/2000/svg";function Le(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Fe(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?Le(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var Me,ze=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction((function(){return e(t,n)}))}:e}((function(e,t){if(e.namespaceURI!==De||"innerHTML"in e)e.innerHTML=t;else{for((Me=Me||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Me.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}));function Ue(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}function He(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var We={animationend:He("Animation","AnimationEnd"),animationiteration:He("Animation","AnimationIteration"),animationstart:He("Animation","AnimationStart"),transitionend:He("Transition","TransitionEnd")},Be={},$e={};function Ve(e){if(Be[e])return Be[e];if(!We[e])return e;var t,n=We[e];for(t in n)if(n.hasOwnProperty(t)&&t in $e)return Be[e]=n[t];return e}P&&($e=document.createElement("div").style,"AnimationEvent"in window||(delete We.animationend.animation,delete We.animationiteration.animation,delete We.animationstart.animation),"TransitionEvent"in window||delete We.transitionend.transition);var qe=Ve("animationend"),Qe=Ve("animationiteration"),Ge=Ve("animationstart"),Ke=Ve("transitionend"),Ye="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Xe=new("function"==typeof WeakMap?WeakMap:Map);function Je(e){var t=Xe.get(e);return void 0===t&&(t=new Map,Xe.set(e,t)),t}function Ze(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).effectTag)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function et(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function tt(e){if(Ze(e)!==e)throw Error(i(188))}function nt(e){if(!(e=function(e){var t=e.alternate;if(!t){if(null===(t=Ze(e)))throw Error(i(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(null===o)break;var a=o.alternate;if(null===a){if(null!==(r=o.return)){n=r;continue}break}if(o.child===a.child){for(a=o.child;a;){if(a===n)return tt(o),e;if(a===r)return tt(o),t;a=a.sibling}throw Error(i(188))}if(n.return!==r.return)n=o,r=a;else{for(var l=!1,u=o.child;u;){if(u===n){l=!0,n=o,r=a;break}if(u===r){l=!0,r=o,n=a;break}u=u.sibling}if(!l){for(u=a.child;u;){if(u===n){l=!0,n=a,r=o;break}if(u===r){l=!0,r=a,n=o;break}u=u.sibling}if(!l)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(3!==n.tag)throw Error(i(188));return n.stateNode.current===n?e:t}(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function rt(e,t){if(null==t)throw Error(i(30));return null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function ot(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}var at=null;function it(e){if(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t))for(var r=0;r<t.length&&!e.isPropagationStopped();r++)y(e,t[r],n[r]);else t&&y(e,t,n);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function lt(e){if(null!==e&&(at=rt(at,e)),e=at,at=null,e){if(ot(e,it),at)throw Error(i(95));if(s)throw e=f,s=!1,f=null,e}}function ut(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}function ct(e){if(!P)return!1;var t=(e="on"+e)in document;return t||((t=document.createElement("div")).setAttribute(e,"return;"),t="function"==typeof t[e]),t}var st=[];function ft(e){e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>st.length&&st.push(e)}function pt(e,t,n,r){if(st.length){var o=st.pop();return o.topLevelType=e,o.eventSystemFlags=r,o.nativeEvent=t,o.targetInst=n,o}return{topLevelType:e,eventSystemFlags:r,nativeEvent:t,targetInst:n,ancestors:[]}}function dt(e){var t=e.targetInst,n=t;do{if(!n){e.ancestors.push(n);break}var r=n;if(3===r.tag)r=r.stateNode.containerInfo;else{for(;r.return;)r=r.return;r=3!==r.tag?null:r.stateNode.containerInfo}if(!r)break;5!==(t=n.tag)&&6!==t||e.ancestors.push(n),n=Pn(r)}while(n);for(n=0;n<e.ancestors.length;n++){t=e.ancestors[n];var o=ut(e.nativeEvent);r=e.topLevelType;var a=e.nativeEvent,i=e.eventSystemFlags;0===n&&(i|=64);for(var l=null,u=0;u<x.length;u++){var c=x[u];c&&(c=c.extractEvents(r,t,a,o,i))&&(l=rt(l,c))}lt(l)}}function ht(e,t,n){if(!n.has(e)){switch(e){case"scroll":Gt(t,"scroll",!0);break;case"focus":case"blur":Gt(t,"focus",!0),Gt(t,"blur",!0),n.set("blur",null),n.set("focus",null);break;case"cancel":case"close":ct(e)&&Gt(t,e,!0);break;case"invalid":case"submit":case"reset":break;default:-1===Ye.indexOf(e)&&Qt(e,t)}n.set(e,null)}}var mt,gt,yt,bt=!1,vt=[],wt=null,Et=null,xt=null,_t=new Map,St=new Map,Ot=[],kt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit".split(" "),Pt="focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" ");function Tt(e,t,n,r,o){return{blockedOn:e,topLevelType:t,eventSystemFlags:32|n,nativeEvent:o,container:r}}function jt(e,t){switch(e){case"focus":case"blur":wt=null;break;case"dragenter":case"dragleave":Et=null;break;case"mouseover":case"mouseout":xt=null;break;case"pointerover":case"pointerout":_t.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":St.delete(t.pointerId)}}function Ct(e,t,n,r,o,a){return null===e||e.nativeEvent!==a?(e=Tt(t,n,r,o,a),null!==t&&(null!==(t=Tn(t))&&gt(t)),e):(e.eventSystemFlags|=r,e)}function Rt(e){var t=Pn(e.target);if(null!==t){var n=Ze(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=et(n)))return e.blockedOn=t,void a.unstable_runWithPriority(e.priority,(function(){yt(n)}))}else if(3===t&&n.stateNode.hydrate)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Nt(e){if(null!==e.blockedOn)return!1;var t=Jt(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);if(null!==t){var n=Tn(t);return null!==n&&gt(n),e.blockedOn=t,!1}return!0}function At(e,t,n){Nt(e)&&n.delete(t)}function It(){for(bt=!1;0<vt.length;){var e=vt[0];if(null!==e.blockedOn){null!==(e=Tn(e.blockedOn))&&mt(e);break}var t=Jt(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);null!==t?e.blockedOn=t:vt.shift()}null!==wt&&Nt(wt)&&(wt=null),null!==Et&&Nt(Et)&&(Et=null),null!==xt&&Nt(xt)&&(xt=null),_t.forEach(At),St.forEach(At)}function Dt(e,t){e.blockedOn===t&&(e.blockedOn=null,bt||(bt=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,It)))}function Lt(e){function t(t){return Dt(t,e)}if(0<vt.length){Dt(vt[0],e);for(var n=1;n<vt.length;n++){var r=vt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==wt&&Dt(wt,e),null!==Et&&Dt(Et,e),null!==xt&&Dt(xt,e),_t.forEach(t),St.forEach(t),n=0;n<Ot.length;n++)(r=Ot[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Ot.length&&null===(n=Ot[0]).blockedOn;)Rt(n),null===n.blockedOn&&Ot.shift()}var Ft={},Mt=new Map,zt=new Map,Ut=["abort","abort",qe,"animationEnd",Qe,"animationIteration",Ge,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Ke,"transitionEnd","waiting","waiting"];function Ht(e,t){for(var n=0;n<e.length;n+=2){var r=e[n],o=e[n+1],a="on"+(o[0].toUpperCase()+o.slice(1));a={phasedRegistrationNames:{bubbled:a,captured:a+"Capture"},dependencies:[r],eventPriority:t},zt.set(r,t),Mt.set(r,a),Ft[o]=a}}Ht("blur blur cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focus focus input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),Ht("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),Ht(Ut,2);for(var Wt="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),Bt=0;Bt<Wt.length;Bt++)zt.set(Wt[Bt],0);var $t=a.unstable_UserBlockingPriority,Vt=a.unstable_runWithPriority,qt=!0;function Qt(e,t){Gt(t,e,!1)}function Gt(e,t,n){var r=zt.get(t);switch(void 0===r?2:r){case 0:r=Kt.bind(null,t,1,e);break;case 1:r=Yt.bind(null,t,1,e);break;default:r=Xt.bind(null,t,1,e)}n?e.addEventListener(t,r,!0):e.addEventListener(t,r,!1)}function Kt(e,t,n,r){M||L();var o=Xt,a=M;M=!0;try{D(o,e,t,n,r)}finally{(M=a)||U()}}function Yt(e,t,n,r){Vt($t,Xt.bind(null,e,t,n,r))}function Xt(e,t,n,r){if(qt)if(0<vt.length&&-1<kt.indexOf(e))e=Tt(null,e,t,n,r),vt.push(e);else{var o=Jt(e,t,n,r);if(null===o)jt(e,r);else if(-1<kt.indexOf(e))e=Tt(o,e,t,n,r),vt.push(e);else if(!function(e,t,n,r,o){switch(t){case"focus":return wt=Ct(wt,e,t,n,r,o),!0;case"dragenter":return Et=Ct(Et,e,t,n,r,o),!0;case"mouseover":return xt=Ct(xt,e,t,n,r,o),!0;case"pointerover":var a=o.pointerId;return _t.set(a,Ct(_t.get(a)||null,e,t,n,r,o)),!0;case"gotpointercapture":return a=o.pointerId,St.set(a,Ct(St.get(a)||null,e,t,n,r,o)),!0}return!1}(o,e,t,n,r)){jt(e,r),e=pt(e,r,null,t);try{H(dt,e)}finally{ft(e)}}}}function Jt(e,t,n,r){if(null!==(n=Pn(n=ut(r)))){var o=Ze(n);if(null===o)n=null;else{var a=o.tag;if(13===a){if(null!==(n=et(o)))return n;n=null}else if(3===a){if(o.stateNode.hydrate)return 3===o.tag?o.stateNode.containerInfo:null;n=null}else o!==n&&(n=null)}}e=pt(e,r,n,t);try{H(dt,e)}finally{ft(e)}return null}var Zt={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},en=["Webkit","ms","Moz","O"];function tn(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||Zt.hasOwnProperty(e)&&Zt[e]?(""+t).trim():t+"px"}function nn(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=tn(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(Zt).forEach((function(e){en.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Zt[t]=Zt[e]}))}));var rn=o({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function on(e,t){if(t){if(rn[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(i(137,e,""));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(i(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(i(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(i(62,""))}}function an(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ln=Ie;function un(e,t){var n=Je(e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument);t=O[t];for(var r=0;r<t.length;r++)ht(t[r],e,n)}function cn(){}function sn(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function fn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pn(e,t){var n,r=fn(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=fn(r)}}function dn(){for(var e=window,t=sn();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=sn((e=t.contentWindow).document)}return t}function hn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var mn=null,gn=null;function yn(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function bn(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var vn="function"==typeof setTimeout?setTimeout:void 0,wn="function"==typeof clearTimeout?clearTimeout:void 0;function En(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function xn(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var _n=Math.random().toString(36).slice(2),Sn="__reactInternalInstance$"+_n,On="__reactEventHandlers$"+_n,kn="__reactContainere$"+_n;function Pn(e){var t=e[Sn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[kn]||n[Sn]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=xn(e);null!==e;){if(n=e[Sn])return n;e=xn(e)}return t}n=(e=n).parentNode}return null}function Tn(e){return!(e=e[Sn]||e[kn])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function jn(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(i(33))}function Cn(e){return e[On]||null}function Rn(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function Nn(e,t){var n=e.stateNode;if(!n)return null;var r=h(n);if(!r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(i(231,t,typeof n));return n}function An(e,t,n){(t=Nn(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=rt(n._dispatchListeners,t),n._dispatchInstances=rt(n._dispatchInstances,e))}function In(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,n=[];t;)n.push(t),t=Rn(t);for(t=n.length;0<t--;)An(n[t],"captured",e);for(t=0;t<n.length;t++)An(n[t],"bubbled",e)}}function Dn(e,t,n){e&&n&&n.dispatchConfig.registrationName&&(t=Nn(e,n.dispatchConfig.registrationName))&&(n._dispatchListeners=rt(n._dispatchListeners,t),n._dispatchInstances=rt(n._dispatchInstances,e))}function Ln(e){e&&e.dispatchConfig.registrationName&&Dn(e._targetInst,null,e)}function Fn(e){ot(e,In)}var Mn=null,zn=null,Un=null;function Hn(){if(Un)return Un;var e,t,n=zn,r=n.length,o="value"in Mn?Mn.value:Mn.textContent,a=o.length;for(e=0;e<r&&n[e]===o[e];e++);var i=r-e;for(t=1;t<=i&&n[r-t]===o[a-t];t++);return Un=o.slice(e,1<t?1-t:void 0)}function Wn(){return!0}function Bn(){return!1}function $n(e,t,n,r){for(var o in this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n,e=this.constructor.Interface)e.hasOwnProperty(o)&&((t=e[o])?this[o]=t(n):"target"===o?this.target=r:this[o]=n[o]);return this.isDefaultPrevented=(null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue)?Wn:Bn,this.isPropagationStopped=Bn,this}function Vn(e,t,n,r){if(this.eventPool.length){var o=this.eventPool.pop();return this.call(o,e,t,n,r),o}return new this(e,t,n,r)}function qn(e){if(!(e instanceof this))throw Error(i(279));e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function Qn(e){e.eventPool=[],e.getPooled=Vn,e.release=qn}o($n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Wn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Wn)},persist:function(){this.isPersistent=Wn},isPersistent:Bn,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=Bn,this._dispatchInstances=this._dispatchListeners=null}}),$n.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},$n.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var a=new t;return o(a,n.prototype),n.prototype=a,n.prototype.constructor=n,n.Interface=o({},r.Interface,e),n.extend=r.extend,Qn(n),n},Qn($n);var Gn=$n.extend({data:null}),Kn=$n.extend({data:null}),Yn=[9,13,27,32],Xn=P&&"CompositionEvent"in window,Jn=null;P&&"documentMode"in document&&(Jn=document.documentMode);var Zn=P&&"TextEvent"in window&&!Jn,er=P&&(!Xn||Jn&&8<Jn&&11>=Jn),tr=String.fromCharCode(32),nr={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},rr=!1;function or(e,t){switch(e){case"keyup":return-1!==Yn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function ar(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var ir=!1;var lr={eventTypes:nr,extractEvents:function(e,t,n,r){var o;if(Xn)e:{switch(e){case"compositionstart":var a=nr.compositionStart;break e;case"compositionend":a=nr.compositionEnd;break e;case"compositionupdate":a=nr.compositionUpdate;break e}a=void 0}else ir?or(e,n)&&(a=nr.compositionEnd):"keydown"===e&&229===n.keyCode&&(a=nr.compositionStart);return a?(er&&"ko"!==n.locale&&(ir||a!==nr.compositionStart?a===nr.compositionEnd&&ir&&(o=Hn()):(zn="value"in(Mn=r)?Mn.value:Mn.textContent,ir=!0)),a=Gn.getPooled(a,t,n,r),o?a.data=o:null!==(o=ar(n))&&(a.data=o),Fn(a),o=a):o=null,(e=Zn?function(e,t){switch(e){case"compositionend":return ar(t);case"keypress":return 32!==t.which?null:(rr=!0,tr);case"textInput":return(e=t.data)===tr&&rr?null:e;default:return null}}(e,n):function(e,t){if(ir)return"compositionend"===e||!Xn&&or(e,t)?(e=Hn(),Un=zn=Mn=null,ir=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return er&&"ko"!==t.locale?null:t.data;default:return null}}(e,n))?((t=Kn.getPooled(nr.beforeInput,t,n,r)).data=e,Fn(t)):t=null,null===o?t:null===t?o:[o,t]}},ur={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!ur[e.type]:"textarea"===t}var sr={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function fr(e,t,n){return(e=$n.getPooled(sr.change,e,t,n)).type="change",N(n),Fn(e),e}var pr=null,dr=null;function hr(e){lt(e)}function mr(e){if(Ee(jn(e)))return e}function gr(e,t){if("change"===e)return t}var yr=!1;function br(){pr&&(pr.detachEvent("onpropertychange",vr),dr=pr=null)}function vr(e){if("value"===e.propertyName&&mr(dr))if(e=fr(dr,e,ut(e)),M)lt(e);else{M=!0;try{I(hr,e)}finally{M=!1,U()}}}function wr(e,t,n){"focus"===e?(br(),dr=n,(pr=t).attachEvent("onpropertychange",vr)):"blur"===e&&br()}function Er(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return mr(dr)}function xr(e,t){if("click"===e)return mr(t)}function _r(e,t){if("input"===e||"change"===e)return mr(t)}P&&(yr=ct("input")&&(!document.documentMode||9<document.documentMode));var Sr={eventTypes:sr,_isInputEventSupported:yr,extractEvents:function(e,t,n,r){var o=t?jn(t):window,a=o.nodeName&&o.nodeName.toLowerCase();if("select"===a||"input"===a&&"file"===o.type)var i=gr;else if(cr(o))if(yr)i=_r;else{i=Er;var l=wr}else(a=o.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===o.type||"radio"===o.type)&&(i=xr);if(i&&(i=i(e,t)))return fr(i,n,r);l&&l(e,o,t),"blur"===e&&(e=o._wrapperState)&&e.controlled&&"number"===o.type&&Pe(o,"number",o.value)}},Or=$n.extend({view:null,detail:null}),kr={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Pr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=kr[e])&&!!t[e]}function Tr(){return Pr}var jr=0,Cr=0,Rr=!1,Nr=!1,Ar=Or.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:Tr,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},movementX:function(e){if("movementX"in e)return e.movementX;var t=jr;return jr=e.screenX,Rr?"mousemove"===e.type?e.screenX-t:0:(Rr=!0,0)},movementY:function(e){if("movementY"in e)return e.movementY;var t=Cr;return Cr=e.screenY,Nr?"mousemove"===e.type?e.screenY-t:0:(Nr=!0,0)}}),Ir=Ar.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),Dr={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},Lr={eventTypes:Dr,extractEvents:function(e,t,n,r,o){var a="mouseover"===e||"pointerover"===e,i="mouseout"===e||"pointerout"===e;if(a&&0==(32&o)&&(n.relatedTarget||n.fromElement)||!i&&!a)return null;(a=r.window===r?r:(a=r.ownerDocument)?a.defaultView||a.parentWindow:window,i)?(i=t,null!==(t=(t=n.relatedTarget||n.toElement)?Pn(t):null)&&(t!==Ze(t)||5!==t.tag&&6!==t.tag)&&(t=null)):i=null;if(i===t)return null;if("mouseout"===e||"mouseover"===e)var l=Ar,u=Dr.mouseLeave,c=Dr.mouseEnter,s="mouse";else"pointerout"!==e&&"pointerover"!==e||(l=Ir,u=Dr.pointerLeave,c=Dr.pointerEnter,s="pointer");if(e=null==i?a:jn(i),a=null==t?a:jn(t),(u=l.getPooled(u,i,n,r)).type=s+"leave",u.target=e,u.relatedTarget=a,(n=l.getPooled(c,t,n,r)).type=s+"enter",n.target=a,n.relatedTarget=e,s=t,(r=i)&&s)e:{for(c=s,i=0,e=l=r;e;e=Rn(e))i++;for(e=0,t=c;t;t=Rn(t))e++;for(;0<i-e;)l=Rn(l),i--;for(;0<e-i;)c=Rn(c),e--;for(;i--;){if(l===c||l===c.alternate)break e;l=Rn(l),c=Rn(c)}l=null}else l=null;for(c=l,l=[];r&&r!==c&&(null===(i=r.alternate)||i!==c);)l.push(r),r=Rn(r);for(r=[];s&&s!==c&&(null===(i=s.alternate)||i!==c);)r.push(s),s=Rn(s);for(s=0;s<l.length;s++)Dn(l[s],"bubbled",u);for(s=r.length;0<s--;)Dn(r[s],"captured",n);return 0==(64&o)?[u]:[u,n]}};var Fr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},Mr=Object.prototype.hasOwnProperty;function zr(e,t){if(Fr(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!Mr.call(t,n[r])||!Fr(e[n[r]],t[n[r]]))return!1;return!0}var Ur=P&&"documentMode"in document&&11>=document.documentMode,Hr={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Wr=null,Br=null,$r=null,Vr=!1;function qr(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return Vr||null==Wr||Wr!==sn(n)?null:("selectionStart"in(n=Wr)&&hn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},$r&&zr($r,n)?null:($r=n,(e=$n.getPooled(Hr.select,Br,e,t)).type="select",e.target=Wr,Fn(e),e))}var Qr={eventTypes:Hr,extractEvents:function(e,t,n,r,o,a){if(!(a=!(o=a||(r.window===r?r.document:9===r.nodeType?r:r.ownerDocument)))){e:{o=Je(o),a=O.onSelect;for(var i=0;i<a.length;i++)if(!o.has(a[i])){o=!1;break e}o=!0}a=!o}if(a)return null;switch(o=t?jn(t):window,e){case"focus":(cr(o)||"true"===o.contentEditable)&&(Wr=o,Br=t,$r=null);break;case"blur":$r=Br=Wr=null;break;case"mousedown":Vr=!0;break;case"contextmenu":case"mouseup":case"dragend":return Vr=!1,qr(n,r);case"selectionchange":if(Ur)break;case"keydown":case"keyup":return qr(n,r)}return null}},Gr=$n.extend({animationName:null,elapsedTime:null,pseudoElement:null}),Kr=$n.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Yr=Or.extend({relatedTarget:null});function Xr(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}var Jr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Zr={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},eo=Or.extend({key:function(e){if(e.key){var t=Jr[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Xr(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Zr[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Tr,charCode:function(e){return"keypress"===e.type?Xr(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Xr(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),to=Ar.extend({dataTransfer:null}),no=Or.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Tr}),ro=$n.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),oo=Ar.extend({deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),ao={eventTypes:Ft,extractEvents:function(e,t,n,r){var o=Mt.get(e);if(!o)return null;switch(e){case"keypress":if(0===Xr(n))return null;case"keydown":case"keyup":e=eo;break;case"blur":case"focus":e=Yr;break;case"click":if(2===n.button)return null;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":e=Ar;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":e=to;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":e=no;break;case qe:case Qe:case Ge:e=Gr;break;case Ke:e=ro;break;case"scroll":e=Or;break;case"wheel":e=oo;break;case"copy":case"cut":case"paste":e=Kr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":e=Ir;break;default:e=$n}return Fn(t=e.getPooled(o,t,n,r)),t}};if(b)throw Error(i(101));b=Array.prototype.slice.call("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),w(),h=Cn,m=Tn,g=jn,k({SimpleEventPlugin:ao,EnterLeaveEventPlugin:Lr,ChangeEventPlugin:Sr,SelectEventPlugin:Qr,BeforeInputEventPlugin:lr});var io=[],lo=-1;function uo(e){0>lo||(e.current=io[lo],io[lo]=null,lo--)}function co(e,t){lo++,io[lo]=e.current,e.current=t}var so={},fo={current:so},po={current:!1},ho=so;function mo(e,t){var n=e.type.contextTypes;if(!n)return so;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,a={};for(o in n)a[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function go(e){return null!=(e=e.childContextTypes)}function yo(){uo(po),uo(fo)}function bo(e,t,n){if(fo.current!==so)throw Error(i(168));co(fo,t),co(po,n)}function vo(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var a in r=r.getChildContext())if(!(a in e))throw Error(i(108,ge(t)||"Unknown",a));return o({},n,{},r)}function wo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||so,ho=fo.current,co(fo,e),co(po,po.current),!0}function Eo(e,t,n){var r=e.stateNode;if(!r)throw Error(i(169));n?(e=vo(e,t,ho),r.__reactInternalMemoizedMergedChildContext=e,uo(po),uo(fo),co(fo,e)):uo(po),co(po,n)}var xo=a.unstable_runWithPriority,_o=a.unstable_scheduleCallback,So=a.unstable_cancelCallback,Oo=a.unstable_requestPaint,ko=a.unstable_now,Po=a.unstable_getCurrentPriorityLevel,To=a.unstable_ImmediatePriority,jo=a.unstable_UserBlockingPriority,Co=a.unstable_NormalPriority,Ro=a.unstable_LowPriority,No=a.unstable_IdlePriority,Ao={},Io=a.unstable_shouldYield,Do=void 0!==Oo?Oo:function(){},Lo=null,Fo=null,Mo=!1,zo=ko(),Uo=1e4>zo?ko:function(){return ko()-zo};function Ho(){switch(Po()){case To:return 99;case jo:return 98;case Co:return 97;case Ro:return 96;case No:return 95;default:throw Error(i(332))}}function Wo(e){switch(e){case 99:return To;case 98:return jo;case 97:return Co;case 96:return Ro;case 95:return No;default:throw Error(i(332))}}function Bo(e,t){return e=Wo(e),xo(e,t)}function $o(e,t,n){return e=Wo(e),_o(e,t,n)}function Vo(e){return null===Lo?(Lo=[e],Fo=_o(To,Qo)):Lo.push(e),Ao}function qo(){if(null!==Fo){var e=Fo;Fo=null,So(e)}Qo()}function Qo(){if(!Mo&&null!==Lo){Mo=!0;var e=0;try{var t=Lo;Bo(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),Lo=null}catch(t){throw null!==Lo&&(Lo=Lo.slice(e+1)),_o(To,qo),t}finally{Mo=!1}}}function Go(e,t,n){return 1073741821-(1+((1073741821-e+t/10)/(n/=10)|0))*n}function Ko(e,t){if(e&&e.defaultProps)for(var n in t=o({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}var Yo={current:null},Xo=null,Jo=null,Zo=null;function ea(){Zo=Jo=Xo=null}function ta(e){var t=Yo.current;uo(Yo),e.type._context._currentValue=t}function na(e,t){for(;null!==e;){var n=e.alternate;if(e.childExpirationTime<t)e.childExpirationTime=t,null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t);else{if(!(null!==n&&n.childExpirationTime<t))break;n.childExpirationTime=t}e=e.return}}function ra(e,t){Xo=e,Zo=Jo=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(e.expirationTime>=t&&(Ci=!0),e.firstContext=null)}function oa(e,t){if(Zo!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(Zo=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Jo){if(null===Xo)throw Error(i(308));Jo=t,Xo.dependencies={expirationTime:0,firstContext:t,responders:null}}else Jo=Jo.next=t;return e._currentValue}var aa=!1;function ia(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function la(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function ua(e,t){return(e={expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null}).next=e}function ca(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function sa(e,t){var n=e.alternate;null!==n&&la(n,e),null===(n=(e=e.updateQueue).baseQueue)?(e.baseQueue=t.next=t,t.next=t):(t.next=n.next,n.next=t)}function fa(e,t,n,r){var a=e.updateQueue;aa=!1;var i=a.baseQueue,l=a.shared.pending;if(null!==l){if(null!==i){var u=i.next;i.next=l.next,l.next=u}i=l,a.shared.pending=null,null!==(u=e.alternate)&&(null!==(u=u.updateQueue)&&(u.baseQueue=l))}if(null!==i){u=i.next;var c=a.baseState,s=0,f=null,p=null,d=null;if(null!==u)for(var h=u;;){if((l=h.expirationTime)<r){var m={expirationTime:h.expirationTime,suspenseConfig:h.suspenseConfig,tag:h.tag,payload:h.payload,callback:h.callback,next:null};null===d?(p=d=m,f=c):d=d.next=m,l>s&&(s=l)}else{null!==d&&(d=d.next={expirationTime:1073741823,suspenseConfig:h.suspenseConfig,tag:h.tag,payload:h.payload,callback:h.callback,next:null}),au(l,h.suspenseConfig);e:{var g=e,y=h;switch(l=t,m=n,y.tag){case 1:if("function"==typeof(g=y.payload)){c=g.call(m,c,l);break e}c=g;break e;case 3:g.effectTag=-4097&g.effectTag|64;case 0:if(null==(l="function"==typeof(g=y.payload)?g.call(m,c,l):g))break e;c=o({},c,l);break e;case 2:aa=!0}}null!==h.callback&&(e.effectTag|=32,null===(l=a.effects)?a.effects=[h]:l.push(h))}if(null===(h=h.next)||h===u){if(null===(l=a.shared.pending))break;h=i.next=l.next,l.next=u,a.baseQueue=i=l,a.shared.pending=null}}null===d?f=c:d.next=p,a.baseState=f,a.baseQueue=d,iu(s),e.expirationTime=s,e.memoizedState=c}}function pa(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(null!==o){if(r.callback=null,r=o,o=n,"function"!=typeof r)throw Error(i(191,r));r.call(o)}}}var da=Y.ReactCurrentBatchConfig,ha=(new r.Component).refs;function ma(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:o({},t,n),e.memoizedState=n,0===e.expirationTime&&(e.updateQueue.baseState=n)}var ga={isMounted:function(e){return!!(e=e._reactInternalFiber)&&Ze(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternalFiber;var r=ql(),o=da.suspense;(o=ua(r=Ql(r,e,o),o)).payload=t,null!=n&&(o.callback=n),ca(e,o),Gl(e,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternalFiber;var r=ql(),o=da.suspense;(o=ua(r=Ql(r,e,o),o)).tag=1,o.payload=t,null!=n&&(o.callback=n),ca(e,o),Gl(e,r)},enqueueForceUpdate:function(e,t){e=e._reactInternalFiber;var n=ql(),r=da.suspense;(r=ua(n=Ql(n,e,r),r)).tag=2,null!=t&&(r.callback=t),ca(e,r),Gl(e,n)}};function ya(e,t,n,r,o,a,i){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,i):!t.prototype||!t.prototype.isPureReactComponent||(!zr(n,r)||!zr(o,a))}function ba(e,t,n){var r=!1,o=so,a=t.contextType;return"object"==typeof a&&null!==a?a=oa(a):(o=go(t)?ho:fo.current,a=(r=null!=(r=t.contextTypes))?mo(e,o):so),t=new t(n,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=ga,e.stateNode=t,t._reactInternalFiber=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=a),t}function va(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ga.enqueueReplaceState(t,t.state,null)}function wa(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=ha,ia(e);var a=t.contextType;"object"==typeof a&&null!==a?o.context=oa(a):(a=go(t)?ho:fo.current,o.context=mo(e,a)),fa(e,n,o,r),o.state=e.memoizedState,"function"==typeof(a=t.getDerivedStateFromProps)&&(ma(e,t,a,n),o.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(t=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&ga.enqueueReplaceState(o,o.state,null),fa(e,n,o,r),o.state=e.memoizedState),"function"==typeof o.componentDidMount&&(e.effectTag|=4)}var Ea=Array.isArray;function xa(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(i(309));var r=n.stateNode}if(!r)throw Error(i(147,e));var o=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===o?t.ref:((t=function(e){var t=r.refs;t===ha&&(t=r.refs={}),null===e?delete t[o]:t[o]=e})._stringRef=o,t)}if("string"!=typeof e)throw Error(i(284));if(!n._owner)throw Error(i(290,e))}return e}function _a(e,t){if("textarea"!==e.type)throw Error(i(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,""))}function Sa(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.effectTag=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function o(e,t){return(e=ku(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.effectTag=2,n):r:(t.effectTag=2,n):n}function l(t){return e&&null===t.alternate&&(t.effectTag=2),t}function u(e,t,n,r){return null===t||6!==t.tag?((t=ju(n,e.mode,r)).return=e,t):((t=o(t,n)).return=e,t)}function c(e,t,n,r){return null!==t&&t.elementType===n.type?((r=o(t,n.props)).ref=xa(e,t,n),r.return=e,r):((r=Pu(n.type,n.key,n.props,null,e.mode,r)).ref=xa(e,t,n),r.return=e,r)}function s(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Cu(n,e.mode,r)).return=e,t):((t=o(t,n.children||[])).return=e,t)}function f(e,t,n,r,a){return null===t||7!==t.tag?((t=Tu(n,e.mode,r,a)).return=e,t):((t=o(t,n)).return=e,t)}function p(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=ju(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case ee:return(n=Pu(t.type,t.key,t.props,null,e.mode,n)).ref=xa(e,null,t),n.return=e,n;case te:return(t=Cu(t,e.mode,n)).return=e,t}if(Ea(t)||me(t))return(t=Tu(t,e.mode,n,null)).return=e,t;_a(e,t)}return null}function d(e,t,n,r){var o=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==o?null:u(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case ee:return n.key===o?n.type===ne?f(e,t,n.props.children,r,o):c(e,t,n,r):null;case te:return n.key===o?s(e,t,n,r):null}if(Ea(n)||me(n))return null!==o?null:f(e,t,n,r,null);_a(e,n)}return null}function h(e,t,n,r,o){if("string"==typeof r||"number"==typeof r)return u(t,e=e.get(n)||null,""+r,o);if("object"==typeof r&&null!==r){switch(r.$$typeof){case ee:return e=e.get(null===r.key?n:r.key)||null,r.type===ne?f(t,e,r.props.children,o,r.key):c(t,e,r,o);case te:return s(t,e=e.get(null===r.key?n:r.key)||null,r,o)}if(Ea(r)||me(r))return f(t,e=e.get(n)||null,r,o,null);_a(t,r)}return null}function m(o,i,l,u){for(var c=null,s=null,f=i,m=i=0,g=null;null!==f&&m<l.length;m++){f.index>m?(g=f,f=null):g=f.sibling;var y=d(o,f,l[m],u);if(null===y){null===f&&(f=g);break}e&&f&&null===y.alternate&&t(o,f),i=a(y,i,m),null===s?c=y:s.sibling=y,s=y,f=g}if(m===l.length)return n(o,f),c;if(null===f){for(;m<l.length;m++)null!==(f=p(o,l[m],u))&&(i=a(f,i,m),null===s?c=f:s.sibling=f,s=f);return c}for(f=r(o,f);m<l.length;m++)null!==(g=h(f,o,m,l[m],u))&&(e&&null!==g.alternate&&f.delete(null===g.key?m:g.key),i=a(g,i,m),null===s?c=g:s.sibling=g,s=g);return e&&f.forEach((function(e){return t(o,e)})),c}function g(o,l,u,c){var s=me(u);if("function"!=typeof s)throw Error(i(150));if(null==(u=s.call(u)))throw Error(i(151));for(var f=s=null,m=l,g=l=0,y=null,b=u.next();null!==m&&!b.done;g++,b=u.next()){m.index>g?(y=m,m=null):y=m.sibling;var v=d(o,m,b.value,c);if(null===v){null===m&&(m=y);break}e&&m&&null===v.alternate&&t(o,m),l=a(v,l,g),null===f?s=v:f.sibling=v,f=v,m=y}if(b.done)return n(o,m),s;if(null===m){for(;!b.done;g++,b=u.next())null!==(b=p(o,b.value,c))&&(l=a(b,l,g),null===f?s=b:f.sibling=b,f=b);return s}for(m=r(o,m);!b.done;g++,b=u.next())null!==(b=h(m,o,g,b.value,c))&&(e&&null!==b.alternate&&m.delete(null===b.key?g:b.key),l=a(b,l,g),null===f?s=b:f.sibling=b,f=b);return e&&m.forEach((function(e){return t(o,e)})),s}return function(e,r,a,u){var c="object"==typeof a&&null!==a&&a.type===ne&&null===a.key;c&&(a=a.props.children);var s="object"==typeof a&&null!==a;if(s)switch(a.$$typeof){case ee:e:{for(s=a.key,c=r;null!==c;){if(c.key===s){switch(c.tag){case 7:if(a.type===ne){n(e,c.sibling),(r=o(c,a.props.children)).return=e,e=r;break e}break;default:if(c.elementType===a.type){n(e,c.sibling),(r=o(c,a.props)).ref=xa(e,c,a),r.return=e,e=r;break e}}n(e,c);break}t(e,c),c=c.sibling}a.type===ne?((r=Tu(a.props.children,e.mode,u,a.key)).return=e,e=r):((u=Pu(a.type,a.key,a.props,null,e.mode,u)).ref=xa(e,r,a),u.return=e,e=u)}return l(e);case te:e:{for(c=a.key;null!==r;){if(r.key===c){if(4===r.tag&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),(r=o(r,a.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Cu(a,e.mode,u)).return=e,e=r}return l(e)}if("string"==typeof a||"number"==typeof a)return a=""+a,null!==r&&6===r.tag?(n(e,r.sibling),(r=o(r,a)).return=e,e=r):(n(e,r),(r=ju(a,e.mode,u)).return=e,e=r),l(e);if(Ea(a))return m(e,r,a,u);if(me(a))return g(e,r,a,u);if(s&&_a(e,a),void 0===a&&!c)switch(e.tag){case 1:case 0:throw e=e.type,Error(i(152,e.displayName||e.name||"Component"))}return n(e,r)}}var Oa=Sa(!0),ka=Sa(!1),Pa={},Ta={current:Pa},ja={current:Pa},Ca={current:Pa};function Ra(e){if(e===Pa)throw Error(i(174));return e}function Na(e,t){switch(co(Ca,t),co(ja,e),co(Ta,Pa),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Fe(null,"");break;default:t=Fe(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}uo(Ta),co(Ta,t)}function Aa(){uo(Ta),uo(ja),uo(Ca)}function Ia(e){Ra(Ca.current);var t=Ra(Ta.current),n=Fe(t,e.type);t!==n&&(co(ja,e),co(Ta,n))}function Da(e){ja.current===e&&(uo(Ta),uo(ja))}var La={current:0};function Fa(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.effectTag))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Ma(e,t){return{responder:e,props:t}}var za=Y.ReactCurrentDispatcher,Ua=Y.ReactCurrentBatchConfig,Ha=0,Wa=null,Ba=null,$a=null,Va=!1;function qa(){throw Error(i(321))}function Qa(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Fr(e[n],t[n]))return!1;return!0}function Ga(e,t,n,r,o,a){if(Ha=a,Wa=t,t.memoizedState=null,t.updateQueue=null,t.expirationTime=0,za.current=null===e||null===e.memoizedState?yi:bi,e=n(r,o),t.expirationTime===Ha){a=0;do{if(t.expirationTime=0,!(25>a))throw Error(i(301));a+=1,$a=Ba=null,t.updateQueue=null,za.current=vi,e=n(r,o)}while(t.expirationTime===Ha)}if(za.current=gi,t=null!==Ba&&null!==Ba.next,Ha=0,$a=Ba=Wa=null,Va=!1,t)throw Error(i(300));return e}function Ka(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===$a?Wa.memoizedState=$a=e:$a=$a.next=e,$a}function Ya(){if(null===Ba){var e=Wa.alternate;e=null!==e?e.memoizedState:null}else e=Ba.next;var t=null===$a?Wa.memoizedState:$a.next;if(null!==t)$a=t,Ba=e;else{if(null===e)throw Error(i(310));e={memoizedState:(Ba=e).memoizedState,baseState:Ba.baseState,baseQueue:Ba.baseQueue,queue:Ba.queue,next:null},null===$a?Wa.memoizedState=$a=e:$a=$a.next=e}return $a}function Xa(e,t){return"function"==typeof t?t(e):t}function Ja(e){var t=Ya(),n=t.queue;if(null===n)throw Error(i(311));n.lastRenderedReducer=e;var r=Ba,o=r.baseQueue,a=n.pending;if(null!==a){if(null!==o){var l=o.next;o.next=a.next,a.next=l}r.baseQueue=o=a,n.pending=null}if(null!==o){o=o.next,r=r.baseState;var u=l=a=null,c=o;do{var s=c.expirationTime;if(s<Ha){var f={expirationTime:c.expirationTime,suspenseConfig:c.suspenseConfig,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===u?(l=u=f,a=r):u=u.next=f,s>Wa.expirationTime&&(Wa.expirationTime=s,iu(s))}else null!==u&&(u=u.next={expirationTime:1073741823,suspenseConfig:c.suspenseConfig,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),au(s,c.suspenseConfig),r=c.eagerReducer===e?c.eagerState:e(r,c.action);c=c.next}while(null!==c&&c!==o);null===u?a=r:u.next=l,Fr(r,t.memoizedState)||(Ci=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=u,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function Za(e){var t=Ya(),n=t.queue;if(null===n)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,a=t.memoizedState;if(null!==o){n.pending=null;var l=o=o.next;do{a=e(a,l.action),l=l.next}while(l!==o);Fr(a,t.memoizedState)||(Ci=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function ei(e){var t=Ka();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:Xa,lastRenderedState:e}).dispatch=mi.bind(null,Wa,e),[t.memoizedState,e]}function ti(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=Wa.updateQueue)?(t={lastEffect:null},Wa.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ni(){return Ya().memoizedState}function ri(e,t,n,r){var o=Ka();Wa.effectTag|=e,o.memoizedState=ti(1|t,n,void 0,void 0===r?null:r)}function oi(e,t,n,r){var o=Ya();r=void 0===r?null:r;var a=void 0;if(null!==Ba){var i=Ba.memoizedState;if(a=i.destroy,null!==r&&Qa(r,i.deps))return void ti(t,n,a,r)}Wa.effectTag|=e,o.memoizedState=ti(1|t,n,a,r)}function ai(e,t){return ri(516,4,e,t)}function ii(e,t){return oi(516,4,e,t)}function li(e,t){return oi(4,2,e,t)}function ui(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function ci(e,t,n){return n=null!=n?n.concat([e]):null,oi(4,2,ui.bind(null,t,e),n)}function si(){}function fi(e,t){return Ka().memoizedState=[e,void 0===t?null:t],e}function pi(e,t){var n=Ya();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Qa(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function di(e,t){var n=Ya();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Qa(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function hi(e,t,n){var r=Ho();Bo(98>r?98:r,(function(){e(!0)})),Bo(97<r?97:r,(function(){var r=Ua.suspense;Ua.suspense=void 0===t?null:t;try{e(!1),n()}finally{Ua.suspense=r}}))}function mi(e,t,n){var r=ql(),o=da.suspense;o={expirationTime:r=Ql(r,e,o),suspenseConfig:o,action:n,eagerReducer:null,eagerState:null,next:null};var a=t.pending;if(null===a?o.next=o:(o.next=a.next,a.next=o),t.pending=o,a=e.alternate,e===Wa||null!==a&&a===Wa)Va=!0,o.expirationTime=Ha,Wa.expirationTime=Ha;else{if(0===e.expirationTime&&(null===a||0===a.expirationTime)&&null!==(a=t.lastRenderedReducer))try{var i=t.lastRenderedState,l=a(i,n);if(o.eagerReducer=a,o.eagerState=l,Fr(l,i))return}catch(e){}Gl(e,r)}}var gi={readContext:oa,useCallback:qa,useContext:qa,useEffect:qa,useImperativeHandle:qa,useLayoutEffect:qa,useMemo:qa,useReducer:qa,useRef:qa,useState:qa,useDebugValue:qa,useResponder:qa,useDeferredValue:qa,useTransition:qa},yi={readContext:oa,useCallback:fi,useContext:oa,useEffect:ai,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,ri(4,2,ui.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ri(4,2,e,t)},useMemo:function(e,t){var n=Ka();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ka();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=mi.bind(null,Wa,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Ka().memoizedState=e},useState:ei,useDebugValue:si,useResponder:Ma,useDeferredValue:function(e,t){var n=ei(e),r=n[0],o=n[1];return ai((function(){var n=Ua.suspense;Ua.suspense=void 0===t?null:t;try{o(e)}finally{Ua.suspense=n}}),[e,t]),r},useTransition:function(e){var t=ei(!1),n=t[0];return t=t[1],[fi(hi.bind(null,t,e),[t,e]),n]}},bi={readContext:oa,useCallback:pi,useContext:oa,useEffect:ii,useImperativeHandle:ci,useLayoutEffect:li,useMemo:di,useReducer:Ja,useRef:ni,useState:function(){return Ja(Xa)},useDebugValue:si,useResponder:Ma,useDeferredValue:function(e,t){var n=Ja(Xa),r=n[0],o=n[1];return ii((function(){var n=Ua.suspense;Ua.suspense=void 0===t?null:t;try{o(e)}finally{Ua.suspense=n}}),[e,t]),r},useTransition:function(e){var t=Ja(Xa),n=t[0];return t=t[1],[pi(hi.bind(null,t,e),[t,e]),n]}},vi={readContext:oa,useCallback:pi,useContext:oa,useEffect:ii,useImperativeHandle:ci,useLayoutEffect:li,useMemo:di,useReducer:Za,useRef:ni,useState:function(){return Za(Xa)},useDebugValue:si,useResponder:Ma,useDeferredValue:function(e,t){var n=Za(Xa),r=n[0],o=n[1];return ii((function(){var n=Ua.suspense;Ua.suspense=void 0===t?null:t;try{o(e)}finally{Ua.suspense=n}}),[e,t]),r},useTransition:function(e){var t=Za(Xa),n=t[0];return t=t[1],[pi(hi.bind(null,t,e),[t,e]),n]}},wi=null,Ei=null,xi=!1;function _i(e,t){var n=Su(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function Si(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);case 13:default:return!1}}function Oi(e){if(xi){var t=Ei;if(t){var n=t;if(!Si(e,t)){if(!(t=En(n.nextSibling))||!Si(e,t))return e.effectTag=-1025&e.effectTag|2,xi=!1,void(wi=e);_i(wi,n)}wi=e,Ei=En(t.firstChild)}else e.effectTag=-1025&e.effectTag|2,xi=!1,wi=e}}function ki(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;wi=e}function Pi(e){if(e!==wi)return!1;if(!xi)return ki(e),xi=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!bn(t,e.memoizedProps))for(t=Ei;t;)_i(e,t),t=En(t.nextSibling);if(ki(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(i(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){Ei=En(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}Ei=null}}else Ei=wi?En(e.stateNode.nextSibling):null;return!0}function Ti(){Ei=wi=null,xi=!1}var ji=Y.ReactCurrentOwner,Ci=!1;function Ri(e,t,n,r){t.child=null===e?ka(t,null,n,r):Oa(t,e.child,n,r)}function Ni(e,t,n,r,o){n=n.render;var a=t.ref;return ra(t,o),r=Ga(e,t,n,r,a,o),null===e||Ci?(t.effectTag|=1,Ri(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=o&&(e.expirationTime=0),Gi(e,t,o))}function Ai(e,t,n,r,o,a){if(null===e){var i=n.type;return"function"!=typeof i||Ou(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Pu(n.type,null,r,null,t.mode,a)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,Ii(e,t,i,r,o,a))}return i=e.child,o<a&&(o=i.memoizedProps,(n=null!==(n=n.compare)?n:zr)(o,r)&&e.ref===t.ref)?Gi(e,t,a):(t.effectTag|=1,(e=ku(i,r)).ref=t.ref,e.return=t,t.child=e)}function Ii(e,t,n,r,o,a){return null!==e&&zr(e.memoizedProps,r)&&e.ref===t.ref&&(Ci=!1,o<a)?(t.expirationTime=e.expirationTime,Gi(e,t,a)):Li(e,t,n,r,a)}function Di(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.effectTag|=128)}function Li(e,t,n,r,o){var a=go(n)?ho:fo.current;return a=mo(t,a),ra(t,o),n=Ga(e,t,n,r,a,o),null===e||Ci?(t.effectTag|=1,Ri(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=o&&(e.expirationTime=0),Gi(e,t,o))}function Fi(e,t,n,r,o){if(go(n)){var a=!0;wo(t)}else a=!1;if(ra(t,o),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),ba(t,n,r),wa(t,n,r,o),r=!0;else if(null===e){var i=t.stateNode,l=t.memoizedProps;i.props=l;var u=i.context,c=n.contextType;"object"==typeof c&&null!==c?c=oa(c):c=mo(t,c=go(n)?ho:fo.current);var s=n.getDerivedStateFromProps,f="function"==typeof s||"function"==typeof i.getSnapshotBeforeUpdate;f||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(l!==r||u!==c)&&va(t,i,r,c),aa=!1;var p=t.memoizedState;i.state=p,fa(t,r,i,o),u=t.memoizedState,l!==r||p!==u||po.current||aa?("function"==typeof s&&(ma(t,n,s,r),u=t.memoizedState),(l=aa||ya(t,n,l,r,p,u,c))?(f||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||("function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount()),"function"==typeof i.componentDidMount&&(t.effectTag|=4)):("function"==typeof i.componentDidMount&&(t.effectTag|=4),t.memoizedProps=r,t.memoizedState=u),i.props=r,i.state=u,i.context=c,r=l):("function"==typeof i.componentDidMount&&(t.effectTag|=4),r=!1)}else i=t.stateNode,la(e,t),l=t.memoizedProps,i.props=t.type===t.elementType?l:Ko(t.type,l),u=i.context,"object"==typeof(c=n.contextType)&&null!==c?c=oa(c):c=mo(t,c=go(n)?ho:fo.current),(f="function"==typeof(s=n.getDerivedStateFromProps)||"function"==typeof i.getSnapshotBeforeUpdate)||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(l!==r||u!==c)&&va(t,i,r,c),aa=!1,u=t.memoizedState,i.state=u,fa(t,r,i,o),p=t.memoizedState,l!==r||u!==p||po.current||aa?("function"==typeof s&&(ma(t,n,s,r),p=t.memoizedState),(s=aa||ya(t,n,l,r,u,p,c))?(f||"function"!=typeof i.UNSAFE_componentWillUpdate&&"function"!=typeof i.componentWillUpdate||("function"==typeof i.componentWillUpdate&&i.componentWillUpdate(r,p,c),"function"==typeof i.UNSAFE_componentWillUpdate&&i.UNSAFE_componentWillUpdate(r,p,c)),"function"==typeof i.componentDidUpdate&&(t.effectTag|=4),"function"==typeof i.getSnapshotBeforeUpdate&&(t.effectTag|=256)):("function"!=typeof i.componentDidUpdate||l===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=4),"function"!=typeof i.getSnapshotBeforeUpdate||l===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=256),t.memoizedProps=r,t.memoizedState=p),i.props=r,i.state=p,i.context=c,r=s):("function"!=typeof i.componentDidUpdate||l===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=4),"function"!=typeof i.getSnapshotBeforeUpdate||l===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=256),r=!1);return Mi(e,t,n,r,a,o)}function Mi(e,t,n,r,o,a){Di(e,t);var i=0!=(64&t.effectTag);if(!r&&!i)return o&&Eo(t,n,!1),Gi(e,t,a);r=t.stateNode,ji.current=t;var l=i&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.effectTag|=1,null!==e&&i?(t.child=Oa(t,e.child,null,a),t.child=Oa(t,null,l,a)):Ri(e,t,l,a),t.memoizedState=r.state,o&&Eo(t,n,!0),t.child}function zi(e){var t=e.stateNode;t.pendingContext?bo(0,t.pendingContext,t.pendingContext!==t.context):t.context&&bo(0,t.context,!1),Na(e,t.containerInfo)}var Ui,Hi,Wi,Bi={dehydrated:null,retryTime:0};function $i(e,t,n){var r,o=t.mode,a=t.pendingProps,i=La.current,l=!1;if((r=0!=(64&t.effectTag))||(r=0!=(2&i)&&(null===e||null!==e.memoizedState)),r?(l=!0,t.effectTag&=-65):null!==e&&null===e.memoizedState||void 0===a.fallback||!0===a.unstable_avoidThisFallback||(i|=1),co(La,1&i),null===e){if(void 0!==a.fallback&&Oi(t),l){if(l=a.fallback,(a=Tu(null,o,0,null)).return=t,0==(2&t.mode))for(e=null!==t.memoizedState?t.child.child:t.child,a.child=e;null!==e;)e.return=a,e=e.sibling;return(n=Tu(l,o,n,null)).return=t,a.sibling=n,t.memoizedState=Bi,t.child=a,n}return o=a.children,t.memoizedState=null,t.child=ka(t,null,o,n)}if(null!==e.memoizedState){if(o=(e=e.child).sibling,l){if(a=a.fallback,(n=ku(e,e.pendingProps)).return=t,0==(2&t.mode)&&(l=null!==t.memoizedState?t.child.child:t.child)!==e.child)for(n.child=l;null!==l;)l.return=n,l=l.sibling;return(o=ku(o,a)).return=t,n.sibling=o,n.childExpirationTime=0,t.memoizedState=Bi,t.child=n,o}return n=Oa(t,e.child,a.children,n),t.memoizedState=null,t.child=n}if(e=e.child,l){if(l=a.fallback,(a=Tu(null,o,0,null)).return=t,a.child=e,null!==e&&(e.return=a),0==(2&t.mode))for(e=null!==t.memoizedState?t.child.child:t.child,a.child=e;null!==e;)e.return=a,e=e.sibling;return(n=Tu(l,o,n,null)).return=t,a.sibling=n,n.effectTag|=2,a.childExpirationTime=0,t.memoizedState=Bi,t.child=a,n}return t.memoizedState=null,t.child=Oa(t,e,a.children,n)}function Vi(e,t){e.expirationTime<t&&(e.expirationTime=t);var n=e.alternate;null!==n&&n.expirationTime<t&&(n.expirationTime=t),na(e.return,t)}function qi(e,t,n,r,o,a){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailExpiration:0,tailMode:o,lastEffect:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailExpiration=0,i.tailMode=o,i.lastEffect=a)}function Qi(e,t,n){var r=t.pendingProps,o=r.revealOrder,a=r.tail;if(Ri(e,t,r.children,n),0!=(2&(r=La.current)))r=1&r|2,t.effectTag|=64;else{if(null!==e&&0!=(64&e.effectTag))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Vi(e,n);else if(19===e.tag)Vi(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(co(La,r),0==(2&t.mode))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===Fa(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),qi(t,!1,o,n,a,t.lastEffect);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===Fa(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}qi(t,!0,n,null,a,t.lastEffect);break;case"together":qi(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function Gi(e,t,n){null!==e&&(t.dependencies=e.dependencies);var r=t.expirationTime;if(0!==r&&iu(r),t.childExpirationTime<n)return null;if(null!==e&&t.child!==e.child)throw Error(i(153));if(null!==t.child){for(n=ku(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=ku(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Ki(e,t){switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Yi(e,t,n){var r=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return go(t.type)&&yo(),null;case 3:return Aa(),uo(po),uo(fo),(n=t.stateNode).pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||!Pi(t)||(t.effectTag|=4),null;case 5:Da(t),n=Ra(Ca.current);var a=t.type;if(null!==e&&null!=t.stateNode)Hi(e,t,a,r,n),e.ref!==t.ref&&(t.effectTag|=128);else{if(!r){if(null===t.stateNode)throw Error(i(166));return null}if(e=Ra(Ta.current),Pi(t)){r=t.stateNode,a=t.type;var l=t.memoizedProps;switch(r[Sn]=t,r[On]=l,a){case"iframe":case"object":case"embed":Qt("load",r);break;case"video":case"audio":for(e=0;e<Ye.length;e++)Qt(Ye[e],r);break;case"source":Qt("error",r);break;case"img":case"image":case"link":Qt("error",r),Qt("load",r);break;case"form":Qt("reset",r),Qt("submit",r);break;case"details":Qt("toggle",r);break;case"input":_e(r,l),Qt("invalid",r),un(n,"onChange");break;case"select":r._wrapperState={wasMultiple:!!l.multiple},Qt("invalid",r),un(n,"onChange");break;case"textarea":Re(r,l),Qt("invalid",r),un(n,"onChange")}for(var u in on(a,l),e=null,l)if(l.hasOwnProperty(u)){var c=l[u];"children"===u?"string"==typeof c?r.textContent!==c&&(e=["children",c]):"number"==typeof c&&r.textContent!==""+c&&(e=["children",""+c]):S.hasOwnProperty(u)&&null!=c&&un(n,u)}switch(a){case"input":we(r),ke(r,l,!0);break;case"textarea":we(r),Ae(r);break;case"select":case"option":break;default:"function"==typeof l.onClick&&(r.onclick=cn)}n=e,t.updateQueue=n,null!==n&&(t.effectTag|=4)}else{switch(u=9===n.nodeType?n:n.ownerDocument,e===ln&&(e=Le(a)),e===ln?"script"===a?((e=u.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=u.createElement(a,{is:r.is}):(e=u.createElement(a),"select"===a&&(u=e,r.multiple?u.multiple=!0:r.size&&(u.size=r.size))):e=u.createElementNS(e,a),e[Sn]=t,e[On]=r,Ui(e,t),t.stateNode=e,u=an(a,r),a){case"iframe":case"object":case"embed":Qt("load",e),c=r;break;case"video":case"audio":for(c=0;c<Ye.length;c++)Qt(Ye[c],e);c=r;break;case"source":Qt("error",e),c=r;break;case"img":case"image":case"link":Qt("error",e),Qt("load",e),c=r;break;case"form":Qt("reset",e),Qt("submit",e),c=r;break;case"details":Qt("toggle",e),c=r;break;case"input":_e(e,r),c=xe(e,r),Qt("invalid",e),un(n,"onChange");break;case"option":c=Te(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},c=o({},r,{value:void 0}),Qt("invalid",e),un(n,"onChange");break;case"textarea":Re(e,r),c=Ce(e,r),Qt("invalid",e),un(n,"onChange");break;default:c=r}on(a,c);var s=c;for(l in s)if(s.hasOwnProperty(l)){var f=s[l];"style"===l?nn(e,f):"dangerouslySetInnerHTML"===l?null!=(f=f?f.__html:void 0)&&ze(e,f):"children"===l?"string"==typeof f?("textarea"!==a||""!==f)&&Ue(e,f):"number"==typeof f&&Ue(e,""+f):"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&"autoFocus"!==l&&(S.hasOwnProperty(l)?null!=f&&un(n,l):null!=f&&X(e,l,f,u))}switch(a){case"input":we(e),ke(e,r,!1);break;case"textarea":we(e),Ae(e);break;case"option":null!=r.value&&e.setAttribute("value",""+be(r.value));break;case"select":e.multiple=!!r.multiple,null!=(n=r.value)?je(e,!!r.multiple,n,!1):null!=r.defaultValue&&je(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof c.onClick&&(e.onclick=cn)}yn(a,r)&&(t.effectTag|=4)}null!==t.ref&&(t.effectTag|=128)}return null;case 6:if(e&&null!=t.stateNode)Wi(0,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(i(166));n=Ra(Ca.current),Ra(Ta.current),Pi(t)?(n=t.stateNode,r=t.memoizedProps,n[Sn]=t,n.nodeValue!==r&&(t.effectTag|=4)):((n=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[Sn]=t,t.stateNode=n)}return null;case 13:return uo(La),r=t.memoizedState,0!=(64&t.effectTag)?(t.expirationTime=n,t):(n=null!==r,r=!1,null===e?void 0!==t.memoizedProps.fallback&&Pi(t):(r=null!==(a=e.memoizedState),n||null===a||null!==(a=e.child.sibling)&&(null!==(l=t.firstEffect)?(t.firstEffect=a,a.nextEffect=l):(t.firstEffect=t.lastEffect=a,a.nextEffect=null),a.effectTag=8)),n&&!r&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&La.current)?Pl===wl&&(Pl=El):(Pl!==wl&&Pl!==El||(Pl=xl),0!==Nl&&null!==Sl&&(Au(Sl,kl),Iu(Sl,Nl)))),(n||r)&&(t.effectTag|=4),null);case 4:return Aa(),null;case 10:return ta(t),null;case 17:return go(t.type)&&yo(),null;case 19:if(uo(La),null===(r=t.memoizedState))return null;if(a=0!=(64&t.effectTag),null===(l=r.rendering)){if(a)Ki(r,!1);else if(Pl!==wl||null!==e&&0!=(64&e.effectTag))for(l=t.child;null!==l;){if(null!==(e=Fa(l))){for(t.effectTag|=64,Ki(r,!1),null!==(a=e.updateQueue)&&(t.updateQueue=a,t.effectTag|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=t.child;null!==r;)l=n,(a=r).effectTag&=2,a.nextEffect=null,a.firstEffect=null,a.lastEffect=null,null===(e=a.alternate)?(a.childExpirationTime=0,a.expirationTime=l,a.child=null,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null):(a.childExpirationTime=e.childExpirationTime,a.expirationTime=e.expirationTime,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,l=e.dependencies,a.dependencies=null===l?null:{expirationTime:l.expirationTime,firstContext:l.firstContext,responders:l.responders}),r=r.sibling;return co(La,1&La.current|2),t.child}l=l.sibling}}else{if(!a)if(null!==(e=Fa(l))){if(t.effectTag|=64,a=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.effectTag|=4),Ki(r,!0),null===r.tail&&"hidden"===r.tailMode&&!l.alternate)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*Uo()-r.renderingStartTime>r.tailExpiration&&1<n&&(t.effectTag|=64,a=!0,Ki(r,!1),t.expirationTime=t.childExpirationTime=n-1);r.isBackwards?(l.sibling=t.child,t.child=l):(null!==(n=r.last)?n.sibling=l:t.child=l,r.last=l)}return null!==r.tail?(0===r.tailExpiration&&(r.tailExpiration=Uo()+500),n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=Uo(),n.sibling=null,t=La.current,co(La,a?1&t|2:1&t),n):null}throw Error(i(156,t.tag))}function Xi(e){switch(e.tag){case 1:go(e.type)&&yo();var t=e.effectTag;return 4096&t?(e.effectTag=-4097&t|64,e):null;case 3:if(Aa(),uo(po),uo(fo),0!=(64&(t=e.effectTag)))throw Error(i(285));return e.effectTag=-4097&t|64,e;case 5:return Da(e),null;case 13:return uo(La),4096&(t=e.effectTag)?(e.effectTag=-4097&t|64,e):null;case 19:return uo(La),null;case 4:return Aa(),null;case 10:return ta(e),null;default:return null}}function Ji(e,t){return{value:e,source:t,stack:ye(t)}}Ui=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Hi=function(e,t,n,r,a){var i=e.memoizedProps;if(i!==r){var l,u,c=t.stateNode;switch(Ra(Ta.current),e=null,n){case"input":i=xe(c,i),r=xe(c,r),e=[];break;case"option":i=Te(c,i),r=Te(c,r),e=[];break;case"select":i=o({},i,{value:void 0}),r=o({},r,{value:void 0}),e=[];break;case"textarea":i=Ce(c,i),r=Ce(c,r),e=[];break;default:"function"!=typeof i.onClick&&"function"==typeof r.onClick&&(c.onclick=cn)}for(l in on(n,r),n=null,i)if(!r.hasOwnProperty(l)&&i.hasOwnProperty(l)&&null!=i[l])if("style"===l)for(u in c=i[l])c.hasOwnProperty(u)&&(n||(n={}),n[u]="");else"dangerouslySetInnerHTML"!==l&&"children"!==l&&"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&"autoFocus"!==l&&(S.hasOwnProperty(l)?e||(e=[]):(e=e||[]).push(l,null));for(l in r){var s=r[l];if(c=null!=i?i[l]:void 0,r.hasOwnProperty(l)&&s!==c&&(null!=s||null!=c))if("style"===l)if(c){for(u in c)!c.hasOwnProperty(u)||s&&s.hasOwnProperty(u)||(n||(n={}),n[u]="");for(u in s)s.hasOwnProperty(u)&&c[u]!==s[u]&&(n||(n={}),n[u]=s[u])}else n||(e||(e=[]),e.push(l,n)),n=s;else"dangerouslySetInnerHTML"===l?(s=s?s.__html:void 0,c=c?c.__html:void 0,null!=s&&c!==s&&(e=e||[]).push(l,s)):"children"===l?c===s||"string"!=typeof s&&"number"!=typeof s||(e=e||[]).push(l,""+s):"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&(S.hasOwnProperty(l)?(null!=s&&un(a,l),e||c===s||(e=[])):(e=e||[]).push(l,s))}n&&(e=e||[]).push("style",n),a=e,(t.updateQueue=a)&&(t.effectTag|=4)}},Wi=function(e,t,n,r){n!==r&&(t.effectTag|=4)};var Zi="function"==typeof WeakSet?WeakSet:Set;function el(e,t){var n=t.source,r=t.stack;null===r&&null!==n&&(r=ye(n)),null!==n&&ge(n.type),t=t.value,null!==e&&1===e.tag&&ge(e.type);try{console.error(t)}catch(e){setTimeout((function(){throw e}))}}function tl(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(t){bu(e,t)}else t.current=null}function nl(e,t){switch(t.tag){case 0:case 11:case 15:case 22:return;case 1:if(256&t.effectTag&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:Ko(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:case 5:case 6:case 4:case 17:return}throw Error(i(163))}function rl(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.destroy;n.destroy=void 0,void 0!==r&&r()}n=n.next}while(n!==t)}}function ol(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function al(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:return void ol(3,n);case 1:if(e=n.stateNode,4&n.effectTag)if(null===t)e.componentDidMount();else{var r=n.elementType===n.type?t.memoizedProps:Ko(n.type,t.memoizedProps);e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate)}return void(null!==(t=n.updateQueue)&&pa(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}pa(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.effectTag&&yn(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&Lt(n)))));case 19:case 17:case 20:case 21:return}throw Error(i(163))}function il(e,t,n){switch("function"==typeof xu&&xu(t),t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var r=e.next;Bo(97<n?97:n,(function(){var e=r;do{var n=e.destroy;if(void 0!==n){var o=t;try{n()}catch(e){bu(o,e)}}e=e.next}while(e!==r)}))}break;case 1:tl(t),"function"==typeof(n=t.stateNode).componentWillUnmount&&function(e,t){try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(t){bu(e,t)}}(t,n);break;case 5:tl(t);break;case 4:sl(e,t,n)}}function ll(e){var t=e.alternate;e.return=null,e.child=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.alternate=null,e.firstEffect=null,e.lastEffect=null,e.pendingProps=null,e.memoizedProps=null,e.stateNode=null,null!==t&&ll(t)}function ul(e){return 5===e.tag||3===e.tag||4===e.tag}function cl(e){e:{for(var t=e.return;null!==t;){if(ul(t)){var n=t;break e}t=t.return}throw Error(i(160))}switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:t=t.containerInfo,r=!0;break;default:throw Error(i(161))}16&n.effectTag&&(Ue(t,""),n.effectTag&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||ul(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.effectTag)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break e}}r?function e(t,n,r){var o=t.tag,a=5===o||6===o;if(a)t=a?t.stateNode:t.stateNode.instance,n?8===r.nodeType?r.parentNode.insertBefore(t,n):r.insertBefore(t,n):(8===r.nodeType?(n=r.parentNode).insertBefore(t,r):(n=r).appendChild(t),null!==(r=r._reactRootContainer)&&void 0!==r||null!==n.onclick||(n.onclick=cn));else if(4!==o&&null!==(t=t.child))for(e(t,n,r),t=t.sibling;null!==t;)e(t,n,r),t=t.sibling}(e,n,t):function e(t,n,r){var o=t.tag,a=5===o||6===o;if(a)t=a?t.stateNode:t.stateNode.instance,n?r.insertBefore(t,n):r.appendChild(t);else if(4!==o&&null!==(t=t.child))for(e(t,n,r),t=t.sibling;null!==t;)e(t,n,r),t=t.sibling}(e,n,t)}function sl(e,t,n){for(var r,o,a=t,l=!1;;){if(!l){l=a.return;e:for(;;){if(null===l)throw Error(i(160));switch(r=l.stateNode,l.tag){case 5:o=!1;break e;case 3:case 4:r=r.containerInfo,o=!0;break e}l=l.return}l=!0}if(5===a.tag||6===a.tag){e:for(var u=e,c=a,s=n,f=c;;)if(il(u,f,s),null!==f.child&&4!==f.tag)f.child.return=f,f=f.child;else{if(f===c)break e;for(;null===f.sibling;){if(null===f.return||f.return===c)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}o?(u=r,c=a.stateNode,8===u.nodeType?u.parentNode.removeChild(c):u.removeChild(c)):r.removeChild(a.stateNode)}else if(4===a.tag){if(null!==a.child){r=a.stateNode.containerInfo,o=!0,a.child.return=a,a=a.child;continue}}else if(il(e,a,n),null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break;for(;null===a.sibling;){if(null===a.return||a.return===t)return;4===(a=a.return).tag&&(l=!1)}a.sibling.return=a.return,a=a.sibling}}function fl(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:return void rl(3,t);case 1:return;case 5:var n=t.stateNode;if(null!=n){var r=t.memoizedProps,o=null!==e?e.memoizedProps:r;e=t.type;var a=t.updateQueue;if(t.updateQueue=null,null!==a){for(n[On]=r,"input"===e&&"radio"===r.type&&null!=r.name&&Se(n,r),an(e,o),t=an(e,r),o=0;o<a.length;o+=2){var l=a[o],u=a[o+1];"style"===l?nn(n,u):"dangerouslySetInnerHTML"===l?ze(n,u):"children"===l?Ue(n,u):X(n,l,u,t)}switch(e){case"input":Oe(n,r);break;case"textarea":Ne(n,r);break;case"select":t=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(e=r.value)?je(n,!!r.multiple,e,!1):t!==!!r.multiple&&(null!=r.defaultValue?je(n,!!r.multiple,r.defaultValue,!0):je(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(i(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((t=t.stateNode).hydrate&&(t.hydrate=!1,Lt(t.containerInfo)));case 12:return;case 13:if(n=t,null===t.memoizedState?r=!1:(r=!0,n=t.child,Il=Uo()),null!==n)e:for(e=n;;){if(5===e.tag)a=e.stateNode,r?"function"==typeof(a=a.style).setProperty?a.setProperty("display","none","important"):a.display="none":(a=e.stateNode,o=null!=(o=e.memoizedProps.style)&&o.hasOwnProperty("display")?o.display:null,a.style.display=tn("display",o));else if(6===e.tag)e.stateNode.nodeValue=r?"":e.memoizedProps;else{if(13===e.tag&&null!==e.memoizedState&&null===e.memoizedState.dehydrated){(a=e.child.sibling).return=e,e=a;continue}if(null!==e.child){e.child.return=e,e=e.child;continue}}if(e===n)break;for(;null===e.sibling;){if(null===e.return||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}return void pl(t);case 19:return void pl(t);case 17:return}throw Error(i(163))}function pl(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Zi),t.forEach((function(t){var r=wu.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}var dl="function"==typeof WeakMap?WeakMap:Map;function hl(e,t,n){(n=ua(n,null)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ll||(Ll=!0,Fl=r),el(e,t)},n}function ml(e,t,n){(n=ua(n,null)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return el(e,t),r(o)}}var a=e.stateNode;return null!==a&&"function"==typeof a.componentDidCatch&&(n.callback=function(){"function"!=typeof r&&(null===Ml?Ml=new Set([this]):Ml.add(this),el(e,t));var n=t.stack;this.componentDidCatch(t.value,{componentStack:null!==n?n:""})}),n}var gl,yl=Math.ceil,bl=Y.ReactCurrentDispatcher,vl=Y.ReactCurrentOwner,wl=0,El=3,xl=4,_l=0,Sl=null,Ol=null,kl=0,Pl=wl,Tl=null,jl=1073741823,Cl=1073741823,Rl=null,Nl=0,Al=!1,Il=0,Dl=null,Ll=!1,Fl=null,Ml=null,zl=!1,Ul=null,Hl=90,Wl=null,Bl=0,$l=null,Vl=0;function ql(){return 0!=(48&_l)?1073741821-(Uo()/10|0):0!==Vl?Vl:Vl=1073741821-(Uo()/10|0)}function Ql(e,t,n){if(0==(2&(t=t.mode)))return 1073741823;var r=Ho();if(0==(4&t))return 99===r?1073741823:1073741822;if(0!=(16&_l))return kl;if(null!==n)e=Go(e,0|n.timeoutMs||5e3,250);else switch(r){case 99:e=1073741823;break;case 98:e=Go(e,150,100);break;case 97:case 96:e=Go(e,5e3,250);break;case 95:e=2;break;default:throw Error(i(326))}return null!==Sl&&e===kl&&--e,e}function Gl(e,t){if(50<Bl)throw Bl=0,$l=null,Error(i(185));if(null!==(e=Kl(e,t))){var n=Ho();1073741823===t?0!=(8&_l)&&0==(48&_l)?Zl(e):(Xl(e),0===_l&&qo()):Xl(e),0==(4&_l)||98!==n&&99!==n||(null===Wl?Wl=new Map([[e,t]]):(void 0===(n=Wl.get(e))||n>t)&&Wl.set(e,t))}}function Kl(e,t){e.expirationTime<t&&(e.expirationTime=t);var n=e.alternate;null!==n&&n.expirationTime<t&&(n.expirationTime=t);var r=e.return,o=null;if(null===r&&3===e.tag)o=e.stateNode;else for(;null!==r;){if(n=r.alternate,r.childExpirationTime<t&&(r.childExpirationTime=t),null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t),null===r.return&&3===r.tag){o=r.stateNode;break}r=r.return}return null!==o&&(Sl===o&&(iu(t),Pl===xl&&Au(o,kl)),Iu(o,t)),o}function Yl(e){var t=e.lastExpiredTime;if(0!==t)return t;if(!Nu(e,t=e.firstPendingTime))return t;var n=e.lastPingedTime;return 2>=(e=n>(e=e.nextKnownPendingLevel)?n:e)&&t!==e?0:e}function Xl(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=Vo(Zl.bind(null,e));else{var t=Yl(e),n=e.callbackNode;if(0===t)null!==n&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var r=ql();if(1073741823===t?r=99:1===t||2===t?r=95:r=0>=(r=10*(1073741821-t)-10*(1073741821-r))?99:250>=r?98:5250>=r?97:95,null!==n){var o=e.callbackPriority;if(e.callbackExpirationTime===t&&o>=r)return;n!==Ao&&So(n)}e.callbackExpirationTime=t,e.callbackPriority=r,t=1073741823===t?Vo(Zl.bind(null,e)):$o(r,Jl.bind(null,e),{timeout:10*(1073741821-t)-Uo()}),e.callbackNode=t}}}function Jl(e,t){if(Vl=0,t)return Du(e,t=ql()),Xl(e),null;var n=Yl(e);if(0!==n){if(t=e.callbackNode,0!=(48&_l))throw Error(i(327));if(mu(),e===Sl&&n===kl||nu(e,n),null!==Ol){var r=_l;_l|=16;for(var o=ou();;)try{uu();break}catch(t){ru(e,t)}if(ea(),_l=r,bl.current=o,1===Pl)throw t=Tl,nu(e,n),Au(e,n),Xl(e),t;if(null===Ol)switch(o=e.finishedWork=e.current.alternate,e.finishedExpirationTime=n,r=Pl,Sl=null,r){case wl:case 1:throw Error(i(345));case 2:Du(e,2<n?2:n);break;case El:if(Au(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=fu(o)),1073741823===jl&&10<(o=Il+500-Uo())){if(Al){var a=e.lastPingedTime;if(0===a||a>=n){e.lastPingedTime=n,nu(e,n);break}}if(0!==(a=Yl(e))&&a!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}e.timeoutHandle=vn(pu.bind(null,e),o);break}pu(e);break;case xl:if(Au(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=fu(o)),Al&&(0===(o=e.lastPingedTime)||o>=n)){e.lastPingedTime=n,nu(e,n);break}if(0!==(o=Yl(e))&&o!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}if(1073741823!==Cl?r=10*(1073741821-Cl)-Uo():1073741823===jl?r=0:(r=10*(1073741821-jl)-5e3,0>(r=(o=Uo())-r)&&(r=0),(n=10*(1073741821-n)-o)<(r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*yl(r/1960))-r)&&(r=n)),10<r){e.timeoutHandle=vn(pu.bind(null,e),r);break}pu(e);break;case 5:if(1073741823!==jl&&null!==Rl){a=jl;var l=Rl;if(0>=(r=0|l.busyMinDurationMs)?r=0:(o=0|l.busyDelayMs,r=(a=Uo()-(10*(1073741821-a)-(0|l.timeoutMs||5e3)))<=o?0:o+r-a),10<r){Au(e,n),e.timeoutHandle=vn(pu.bind(null,e),r);break}}pu(e);break;default:throw Error(i(329))}if(Xl(e),e.callbackNode===t)return Jl.bind(null,e)}}return null}function Zl(e){var t=e.lastExpiredTime;if(t=0!==t?t:1073741823,0!=(48&_l))throw Error(i(327));if(mu(),e===Sl&&t===kl||nu(e,t),null!==Ol){var n=_l;_l|=16;for(var r=ou();;)try{lu();break}catch(t){ru(e,t)}if(ea(),_l=n,bl.current=r,1===Pl)throw n=Tl,nu(e,t),Au(e,t),Xl(e),n;if(null!==Ol)throw Error(i(261));e.finishedWork=e.current.alternate,e.finishedExpirationTime=t,Sl=null,pu(e),Xl(e)}return null}function eu(e,t){var n=_l;_l|=1;try{return e(t)}finally{0===(_l=n)&&qo()}}function tu(e,t){var n=_l;_l&=-2,_l|=8;try{return e(t)}finally{0===(_l=n)&&qo()}}function nu(e,t){e.finishedWork=null,e.finishedExpirationTime=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,wn(n)),null!==Ol)for(n=Ol.return;null!==n;){var r=n;switch(r.tag){case 1:null!=(r=r.type.childContextTypes)&&yo();break;case 3:Aa(),uo(po),uo(fo);break;case 5:Da(r);break;case 4:Aa();break;case 13:case 19:uo(La);break;case 10:ta(r)}n=n.return}Sl=e,Ol=ku(e.current,null),kl=t,Pl=wl,Tl=null,Cl=jl=1073741823,Rl=null,Nl=0,Al=!1}function ru(e,t){for(;;){try{if(ea(),za.current=gi,Va)for(var n=Wa.memoizedState;null!==n;){var r=n.queue;null!==r&&(r.pending=null),n=n.next}if(Ha=0,$a=Ba=Wa=null,Va=!1,null===Ol||null===Ol.return)return Pl=1,Tl=t,Ol=null;e:{var o=e,a=Ol.return,i=Ol,l=t;if(t=kl,i.effectTag|=2048,i.firstEffect=i.lastEffect=null,null!==l&&"object"==typeof l&&"function"==typeof l.then){var u=l;if(0==(2&i.mode)){var c=i.alternate;c?(i.updateQueue=c.updateQueue,i.memoizedState=c.memoizedState,i.expirationTime=c.expirationTime):(i.updateQueue=null,i.memoizedState=null)}var s=0!=(1&La.current),f=a;do{var p;if(p=13===f.tag){var d=f.memoizedState;if(null!==d)p=null!==d.dehydrated;else{var h=f.memoizedProps;p=void 0!==h.fallback&&(!0!==h.unstable_avoidThisFallback||!s)}}if(p){var m=f.updateQueue;if(null===m){var g=new Set;g.add(u),f.updateQueue=g}else m.add(u);if(0==(2&f.mode)){if(f.effectTag|=64,i.effectTag&=-2981,1===i.tag)if(null===i.alternate)i.tag=17;else{var y=ua(1073741823,null);y.tag=2,ca(i,y)}i.expirationTime=1073741823;break e}l=void 0,i=t;var b=o.pingCache;if(null===b?(b=o.pingCache=new dl,l=new Set,b.set(u,l)):void 0===(l=b.get(u))&&(l=new Set,b.set(u,l)),!l.has(i)){l.add(i);var v=vu.bind(null,o,u,i);u.then(v,v)}f.effectTag|=4096,f.expirationTime=t;break e}f=f.return}while(null!==f);l=Error((ge(i.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+ye(i))}5!==Pl&&(Pl=2),l=Ji(l,i),f=a;do{switch(f.tag){case 3:u=l,f.effectTag|=4096,f.expirationTime=t,sa(f,hl(f,u,t));break e;case 1:u=l;var w=f.type,E=f.stateNode;if(0==(64&f.effectTag)&&("function"==typeof w.getDerivedStateFromError||null!==E&&"function"==typeof E.componentDidCatch&&(null===Ml||!Ml.has(E)))){f.effectTag|=4096,f.expirationTime=t,sa(f,ml(f,u,t));break e}}f=f.return}while(null!==f)}Ol=su(Ol)}catch(e){t=e;continue}break}}function ou(){var e=bl.current;return bl.current=gi,null===e?gi:e}function au(e,t){e<jl&&2<e&&(jl=e),null!==t&&e<Cl&&2<e&&(Cl=e,Rl=t)}function iu(e){e>Nl&&(Nl=e)}function lu(){for(;null!==Ol;)Ol=cu(Ol)}function uu(){for(;null!==Ol&&!Io();)Ol=cu(Ol)}function cu(e){var t=gl(e.alternate,e,kl);return e.memoizedProps=e.pendingProps,null===t&&(t=su(e)),vl.current=null,t}function su(e){Ol=e;do{var t=Ol.alternate;if(e=Ol.return,0==(2048&Ol.effectTag)){if(t=Yi(t,Ol,kl),1===kl||1!==Ol.childExpirationTime){for(var n=0,r=Ol.child;null!==r;){var o=r.expirationTime,a=r.childExpirationTime;o>n&&(n=o),a>n&&(n=a),r=r.sibling}Ol.childExpirationTime=n}if(null!==t)return t;null!==e&&0==(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=Ol.firstEffect),null!==Ol.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=Ol.firstEffect),e.lastEffect=Ol.lastEffect),1<Ol.effectTag&&(null!==e.lastEffect?e.lastEffect.nextEffect=Ol:e.firstEffect=Ol,e.lastEffect=Ol))}else{if(null!==(t=Xi(Ol)))return t.effectTag&=2047,t;null!==e&&(e.firstEffect=e.lastEffect=null,e.effectTag|=2048)}if(null!==(t=Ol.sibling))return t;Ol=e}while(null!==Ol);return Pl===wl&&(Pl=5),null}function fu(e){var t=e.expirationTime;return t>(e=e.childExpirationTime)?t:e}function pu(e){var t=Ho();return Bo(99,du.bind(null,e,t)),null}function du(e,t){do{mu()}while(null!==Ul);if(0!=(48&_l))throw Error(i(327));var n=e.finishedWork,r=e.finishedExpirationTime;if(null===n)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,n===e.current)throw Error(i(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var o=fu(n);if(e.firstPendingTime=o,r<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:r<=e.firstSuspendedTime&&(e.firstSuspendedTime=r-1),r<=e.lastPingedTime&&(e.lastPingedTime=0),r<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===Sl&&(Ol=Sl=null,kl=0),1<n.effectTag?null!==n.lastEffect?(n.lastEffect.nextEffect=n,o=n.firstEffect):o=n:o=n.firstEffect,null!==o){var a=_l;_l|=32,vl.current=null,mn=qt;var l=dn();if(hn(l)){if("selectionStart"in l)var u={start:l.selectionStart,end:l.selectionEnd};else e:{var c=(u=(u=l.ownerDocument)&&u.defaultView||window).getSelection&&u.getSelection();if(c&&0!==c.rangeCount){u=c.anchorNode;var s=c.anchorOffset,f=c.focusNode;c=c.focusOffset;try{u.nodeType,f.nodeType}catch(e){u=null;break e}var p=0,d=-1,h=-1,m=0,g=0,y=l,b=null;t:for(;;){for(var v;y!==u||0!==s&&3!==y.nodeType||(d=p+s),y!==f||0!==c&&3!==y.nodeType||(h=p+c),3===y.nodeType&&(p+=y.nodeValue.length),null!==(v=y.firstChild);)b=y,y=v;for(;;){if(y===l)break t;if(b===u&&++m===s&&(d=p),b===f&&++g===c&&(h=p),null!==(v=y.nextSibling))break;b=(y=b).parentNode}y=v}u=-1===d||-1===h?null:{start:d,end:h}}else u=null}u=u||{start:0,end:0}}else u=null;gn={activeElementDetached:null,focusedElem:l,selectionRange:u},qt=!1,Dl=o;do{try{hu()}catch(e){if(null===Dl)throw Error(i(330));bu(Dl,e),Dl=Dl.nextEffect}}while(null!==Dl);Dl=o;do{try{for(l=e,u=t;null!==Dl;){var w=Dl.effectTag;if(16&w&&Ue(Dl.stateNode,""),128&w){var E=Dl.alternate;if(null!==E){var x=E.ref;null!==x&&("function"==typeof x?x(null):x.current=null)}}switch(1038&w){case 2:cl(Dl),Dl.effectTag&=-3;break;case 6:cl(Dl),Dl.effectTag&=-3,fl(Dl.alternate,Dl);break;case 1024:Dl.effectTag&=-1025;break;case 1028:Dl.effectTag&=-1025,fl(Dl.alternate,Dl);break;case 4:fl(Dl.alternate,Dl);break;case 8:sl(l,s=Dl,u),ll(s)}Dl=Dl.nextEffect}}catch(e){if(null===Dl)throw Error(i(330));bu(Dl,e),Dl=Dl.nextEffect}}while(null!==Dl);if(x=gn,E=dn(),w=x.focusedElem,u=x.selectionRange,E!==w&&w&&w.ownerDocument&&function e(t,n){return!(!t||!n)&&(t===n||(!t||3!==t.nodeType)&&(n&&3===n.nodeType?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}(w.ownerDocument.documentElement,w)){null!==u&&hn(w)&&(E=u.start,void 0===(x=u.end)&&(x=E),"selectionStart"in w?(w.selectionStart=E,w.selectionEnd=Math.min(x,w.value.length)):(x=(E=w.ownerDocument||document)&&E.defaultView||window).getSelection&&(x=x.getSelection(),s=w.textContent.length,l=Math.min(u.start,s),u=void 0===u.end?l:Math.min(u.end,s),!x.extend&&l>u&&(s=u,u=l,l=s),s=pn(w,l),f=pn(w,u),s&&f&&(1!==x.rangeCount||x.anchorNode!==s.node||x.anchorOffset!==s.offset||x.focusNode!==f.node||x.focusOffset!==f.offset)&&((E=E.createRange()).setStart(s.node,s.offset),x.removeAllRanges(),l>u?(x.addRange(E),x.extend(f.node,f.offset)):(E.setEnd(f.node,f.offset),x.addRange(E))))),E=[];for(x=w;x=x.parentNode;)1===x.nodeType&&E.push({element:x,left:x.scrollLeft,top:x.scrollTop});for("function"==typeof w.focus&&w.focus(),w=0;w<E.length;w++)(x=E[w]).element.scrollLeft=x.left,x.element.scrollTop=x.top}qt=!!mn,gn=mn=null,e.current=n,Dl=o;do{try{for(w=e;null!==Dl;){var _=Dl.effectTag;if(36&_&&al(w,Dl.alternate,Dl),128&_){E=void 0;var S=Dl.ref;if(null!==S){var O=Dl.stateNode;switch(Dl.tag){case 5:E=O;break;default:E=O}"function"==typeof S?S(E):S.current=E}}Dl=Dl.nextEffect}}catch(e){if(null===Dl)throw Error(i(330));bu(Dl,e),Dl=Dl.nextEffect}}while(null!==Dl);Dl=null,Do(),_l=a}else e.current=n;if(zl)zl=!1,Ul=e,Hl=t;else for(Dl=o;null!==Dl;)t=Dl.nextEffect,Dl.nextEffect=null,Dl=t;if(0===(t=e.firstPendingTime)&&(Ml=null),1073741823===t?e===$l?Bl++:(Bl=0,$l=e):Bl=0,"function"==typeof Eu&&Eu(n.stateNode,r),Xl(e),Ll)throw Ll=!1,e=Fl,Fl=null,e;return 0!=(8&_l)||qo(),null}function hu(){for(;null!==Dl;){var e=Dl.effectTag;0!=(256&e)&&nl(Dl.alternate,Dl),0==(512&e)||zl||(zl=!0,$o(97,(function(){return mu(),null}))),Dl=Dl.nextEffect}}function mu(){if(90!==Hl){var e=97<Hl?97:Hl;return Hl=90,Bo(e,gu)}}function gu(){if(null===Ul)return!1;var e=Ul;if(Ul=null,0!=(48&_l))throw Error(i(331));var t=_l;for(_l|=32,e=e.current.firstEffect;null!==e;){try{var n=e;if(0!=(512&n.effectTag))switch(n.tag){case 0:case 11:case 15:case 22:rl(5,n),ol(5,n)}}catch(t){if(null===e)throw Error(i(330));bu(e,t)}n=e.nextEffect,e.nextEffect=null,e=n}return _l=t,qo(),!0}function yu(e,t,n){ca(e,t=hl(e,t=Ji(n,t),1073741823)),null!==(e=Kl(e,1073741823))&&Xl(e)}function bu(e,t){if(3===e.tag)yu(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){yu(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Ml||!Ml.has(r))){ca(n,e=ml(n,e=Ji(t,e),1073741823)),null!==(n=Kl(n,1073741823))&&Xl(n);break}}n=n.return}}function vu(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),Sl===e&&kl===n?Pl===xl||Pl===El&&1073741823===jl&&Uo()-Il<500?nu(e,kl):Al=!0:Nu(e,n)&&(0!==(t=e.lastPingedTime)&&t<n||(e.lastPingedTime=n,Xl(e)))}function wu(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(t=Ql(t=ql(),e,null)),null!==(e=Kl(e,t))&&Xl(e)}gl=function(e,t,n){var r=t.expirationTime;if(null!==e){var o=t.pendingProps;if(e.memoizedProps!==o||po.current)Ci=!0;else{if(r<n){switch(Ci=!1,t.tag){case 3:zi(t),Ti();break;case 5:if(Ia(t),4&t.mode&&1!==n&&o.hidden)return t.expirationTime=t.childExpirationTime=1,null;break;case 1:go(t.type)&&wo(t);break;case 4:Na(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value,o=t.type._context,co(Yo,o._currentValue),o._currentValue=r;break;case 13:if(null!==t.memoizedState)return 0!==(r=t.child.childExpirationTime)&&r>=n?$i(e,t,n):(co(La,1&La.current),null!==(t=Gi(e,t,n))?t.sibling:null);co(La,1&La.current);break;case 19:if(r=t.childExpirationTime>=n,0!=(64&e.effectTag)){if(r)return Qi(e,t,n);t.effectTag|=64}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null),co(La,La.current),!r)return null}return Gi(e,t,n)}Ci=!1}}else Ci=!1;switch(t.expirationTime=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,o=mo(t,fo.current),ra(t,n),o=Ga(null,t,r,e,o,n),t.effectTag|=1,"object"==typeof o&&null!==o&&"function"==typeof o.render&&void 0===o.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,go(r)){var a=!0;wo(t)}else a=!1;t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,ia(t);var l=r.getDerivedStateFromProps;"function"==typeof l&&ma(t,r,l,e),o.updater=ga,t.stateNode=o,o._reactInternalFiber=t,wa(t,r,e,n),t=Mi(null,t,r,!0,a,n)}else t.tag=0,Ri(null,t,o,n),t=t.child;return t;case 16:e:{if(o=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,function(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}}(o),1!==o._status)throw o._result;switch(o=o._result,t.type=o,a=t.tag=function(e){if("function"==typeof e)return Ou(e)?1:0;if(null!=e){if((e=e.$$typeof)===ue)return 11;if(e===fe)return 14}return 2}(o),e=Ko(o,e),a){case 0:t=Li(null,t,o,e,n);break e;case 1:t=Fi(null,t,o,e,n);break e;case 11:t=Ni(null,t,o,e,n);break e;case 14:t=Ai(null,t,o,Ko(o.type,e),r,n);break e}throw Error(i(306,o,""))}return t;case 0:return r=t.type,o=t.pendingProps,Li(e,t,r,o=t.elementType===r?o:Ko(r,o),n);case 1:return r=t.type,o=t.pendingProps,Fi(e,t,r,o=t.elementType===r?o:Ko(r,o),n);case 3:if(zi(t),r=t.updateQueue,null===e||null===r)throw Error(i(282));if(r=t.pendingProps,o=null!==(o=t.memoizedState)?o.element:null,la(e,t),fa(t,r,null,n),(r=t.memoizedState.element)===o)Ti(),t=Gi(e,t,n);else{if((o=t.stateNode.hydrate)&&(Ei=En(t.stateNode.containerInfo.firstChild),wi=t,o=xi=!0),o)for(n=ka(t,null,r,n),t.child=n;n;)n.effectTag=-3&n.effectTag|1024,n=n.sibling;else Ri(e,t,r,n),Ti();t=t.child}return t;case 5:return Ia(t),null===e&&Oi(t),r=t.type,o=t.pendingProps,a=null!==e?e.memoizedProps:null,l=o.children,bn(r,o)?l=null:null!==a&&bn(r,a)&&(t.effectTag|=16),Di(e,t),4&t.mode&&1!==n&&o.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(Ri(e,t,l,n),t=t.child),t;case 6:return null===e&&Oi(t),null;case 13:return $i(e,t,n);case 4:return Na(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Oa(t,null,r,n):Ri(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,Ni(e,t,r,o=t.elementType===r?o:Ko(r,o),n);case 7:return Ri(e,t,t.pendingProps,n),t.child;case 8:case 12:return Ri(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,o=t.pendingProps,l=t.memoizedProps,a=o.value;var u=t.type._context;if(co(Yo,u._currentValue),u._currentValue=a,null!==l)if(u=l.value,0===(a=Fr(u,a)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(u,a):1073741823))){if(l.children===o.children&&!po.current){t=Gi(e,t,n);break e}}else for(null!==(u=t.child)&&(u.return=t);null!==u;){var c=u.dependencies;if(null!==c){l=u.child;for(var s=c.firstContext;null!==s;){if(s.context===r&&0!=(s.observedBits&a)){1===u.tag&&((s=ua(n,null)).tag=2,ca(u,s)),u.expirationTime<n&&(u.expirationTime=n),null!==(s=u.alternate)&&s.expirationTime<n&&(s.expirationTime=n),na(u.return,n),c.expirationTime<n&&(c.expirationTime=n);break}s=s.next}}else l=10===u.tag&&u.type===t.type?null:u.child;if(null!==l)l.return=u;else for(l=u;null!==l;){if(l===t){l=null;break}if(null!==(u=l.sibling)){u.return=l.return,l=u;break}l=l.return}u=l}Ri(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=(a=t.pendingProps).children,ra(t,n),r=r(o=oa(o,a.unstable_observedBits)),t.effectTag|=1,Ri(e,t,r,n),t.child;case 14:return a=Ko(o=t.type,t.pendingProps),Ai(e,t,o,a=Ko(o.type,a),r,n);case 15:return Ii(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ko(r,o),null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),t.tag=1,go(r)?(e=!0,wo(t)):e=!1,ra(t,n),ba(t,r,o),wa(t,r,o,n),Mi(null,t,r,!0,e,n);case 19:return Qi(e,t,n)}throw Error(i(156,t.tag))};var Eu=null,xu=null;function _u(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function Su(e,t,n,r){return new _u(e,t,n,r)}function Ou(e){return!(!(e=e.prototype)||!e.isReactComponent)}function ku(e,t){var n=e.alternate;return null===n?((n=Su(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.effectTag=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childExpirationTime=e.childExpirationTime,n.expirationTime=e.expirationTime,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{expirationTime:t.expirationTime,firstContext:t.firstContext,responders:t.responders},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Pu(e,t,n,r,o,a){var l=2;if(r=e,"function"==typeof e)Ou(e)&&(l=1);else if("string"==typeof e)l=5;else e:switch(e){case ne:return Tu(n.children,o,a,t);case le:l=8,o|=7;break;case re:l=8,o|=1;break;case oe:return(e=Su(12,n,t,8|o)).elementType=oe,e.type=oe,e.expirationTime=a,e;case ce:return(e=Su(13,n,t,o)).type=ce,e.elementType=ce,e.expirationTime=a,e;case se:return(e=Su(19,n,t,o)).elementType=se,e.expirationTime=a,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case ae:l=10;break e;case ie:l=9;break e;case ue:l=11;break e;case fe:l=14;break e;case pe:l=16,r=null;break e;case de:l=22;break e}throw Error(i(130,null==e?e:typeof e,""))}return(t=Su(l,n,t,o)).elementType=e,t.type=r,t.expirationTime=a,t}function Tu(e,t,n,r){return(e=Su(7,e,r,t)).expirationTime=n,e}function ju(e,t,n){return(e=Su(6,e,null,t)).expirationTime=n,e}function Cu(e,t,n){return(t=Su(4,null!==e.children?e.children:[],e.key,t)).expirationTime=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ru(e,t,n){this.tag=t,this.current=null,this.containerInfo=e,this.pingCache=this.pendingChildren=null,this.finishedExpirationTime=0,this.finishedWork=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=90,this.lastExpiredTime=this.lastPingedTime=this.nextKnownPendingLevel=this.lastSuspendedTime=this.firstSuspendedTime=this.firstPendingTime=0}function Nu(e,t){var n=e.firstSuspendedTime;return e=e.lastSuspendedTime,0!==n&&n>=t&&e<=t}function Au(e,t){var n=e.firstSuspendedTime,r=e.lastSuspendedTime;n<t&&(e.firstSuspendedTime=t),(r>t||0===n)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function Iu(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var n=e.firstSuspendedTime;0!==n&&(t>=n?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function Du(e,t){var n=e.lastExpiredTime;(0===n||n>t)&&(e.lastExpiredTime=t)}function Lu(e,t,n,r){var o=t.current,a=ql(),l=da.suspense;a=Ql(a,o,l);e:if(n){t:{if(Ze(n=n._reactInternalFiber)!==n||1!==n.tag)throw Error(i(170));var u=n;do{switch(u.tag){case 3:u=u.stateNode.context;break t;case 1:if(go(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break t}}u=u.return}while(null!==u);throw Error(i(171))}if(1===n.tag){var c=n.type;if(go(c)){n=vo(n,c,u);break e}}n=u}else n=so;return null===t.context?t.context=n:t.pendingContext=n,(t=ua(a,l)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),ca(o,t),Gl(o,a),a}function Fu(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function Mu(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime<t&&(e.retryTime=t)}function zu(e,t){Mu(e,t),(e=e.alternate)&&Mu(e,t)}function Uu(e,t,n){var r=new Ru(e,t,n=null!=n&&!0===n.hydrate),o=Su(3,null,null,2===t?7:1===t?3:0);r.current=o,o.stateNode=r,ia(o),e[kn]=r.current,n&&0!==t&&function(e,t){var n=Je(t);kt.forEach((function(e){ht(e,t,n)})),Pt.forEach((function(e){ht(e,t,n)}))}(0,9===e.nodeType?e:e.ownerDocument),this._internalRoot=r}function Hu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Wu(e,t,n,r,o){var a=n._reactRootContainer;if(a){var i=a._internalRoot;if("function"==typeof o){var l=o;o=function(){var e=Fu(i);l.call(e)}}Lu(t,i,e,o)}else{if(a=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new Uu(e,0,t?{hydrate:!0}:void 0)}(n,r),i=a._internalRoot,"function"==typeof o){var u=o;o=function(){var e=Fu(i);u.call(e)}}tu((function(){Lu(t,i,e,o)}))}return Fu(i)}function Bu(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:te,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function $u(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Hu(t))throw Error(i(200));return Bu(e,t,null,n)}Uu.prototype.render=function(e){Lu(e,this._internalRoot,null,null)},Uu.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;Lu(null,e,null,(function(){t[kn]=null}))},mt=function(e){if(13===e.tag){var t=Go(ql(),150,100);Gl(e,t),zu(e,t)}},gt=function(e){13===e.tag&&(Gl(e,3),zu(e,3))},yt=function(e){if(13===e.tag){var t=ql();Gl(e,t=Ql(t,e,null)),zu(e,t)}},T=function(e,t,n){switch(t){case"input":if(Oe(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=Cn(r);if(!o)throw Error(i(90));Ee(r),Oe(r,o)}}}break;case"textarea":Ne(e,n);break;case"select":null!=(t=n.value)&&je(e,!!n.multiple,t,!1)}},I=eu,D=function(e,t,n,r,o){var a=_l;_l|=4;try{return Bo(98,e.bind(null,t,n,r,o))}finally{0===(_l=a)&&qo()}},L=function(){0==(49&_l)&&(function(){if(null!==Wl){var e=Wl;Wl=null,e.forEach((function(e,t){Du(t,e),Xl(t)})),qo()}}(),mu())},F=function(e,t){var n=_l;_l|=2;try{return e(t)}finally{0===(_l=n)&&qo()}};var Vu,qu,Qu={Events:[Tn,jn,Cn,k,_,Fn,function(e){ot(e,Ln)},N,A,Xt,lt,mu,{current:!1}]};qu=(Vu={findFiberByHostInstance:Pn,bundleType:0,version:"16.13.1",rendererPackageName:"react-dom"}).findFiberByHostInstance,function(e){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var n=t.inject(e);Eu=function(e){try{t.onCommitFiberRoot(n,e,void 0,64==(64&e.current.effectTag))}catch(e){}},xu=function(e){try{t.onCommitFiberUnmount(n,e)}catch(e){}}}catch(e){}}(o({},Vu,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Y.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=nt(e))?null:e.stateNode},findFiberByHostInstance:function(e){return qu?qu(e):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null})),t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Qu,t.createPortal=$u,t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternalFiber;if(void 0===t){if("function"==typeof e.render)throw Error(i(188));throw Error(i(268,Object.keys(e)))}return e=null===(e=nt(t))?null:e.stateNode},t.flushSync=function(e,t){if(0!=(48&_l))throw Error(i(187));var n=_l;_l|=1;try{return Bo(99,e.bind(null,t))}finally{_l=n,qo()}},t.hydrate=function(e,t,n){if(!Hu(t))throw Error(i(200));return Wu(null,e,t,!0,n)},t.render=function(e,t,n){if(!Hu(t))throw Error(i(200));return Wu(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!Hu(e))throw Error(i(40));return!!e._reactRootContainer&&(tu((function(){Wu(null,null,e,!1,(function(){e._reactRootContainer=null,e[kn]=null}))})),!0)},t.unstable_batchedUpdates=eu,t.unstable_createPortal=function(e,t){return $u(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Hu(n))throw Error(i(200));if(null==e||void 0===e._reactInternalFiber)throw Error(i(38));return Wu(e,t,n,!1,r)},t.version="16.13.1"},function(e,t,n){"use strict";e.exports=n(24)},function(e,t,n){"use strict";
28
+ /** @license React v0.19.1
29
+ * scheduler.production.min.js
30
+ *
31
+ * Copyright (c) Facebook, Inc. and its affiliates.
32
+ *
33
+ * This source code is licensed under the MIT license found in the
34
+ * LICENSE file in the root directory of this source tree.
35
+ */var r,o,a,i,l;if("undefined"==typeof window||"function"!=typeof MessageChannel){var u=null,c=null,s=function(){if(null!==u)try{var e=t.unstable_now();u(!0,e),u=null}catch(e){throw setTimeout(s,0),e}},f=Date.now();t.unstable_now=function(){return Date.now()-f},r=function(e){null!==u?setTimeout(r,0,e):(u=e,setTimeout(s,0))},o=function(e,t){c=setTimeout(e,t)},a=function(){clearTimeout(c)},i=function(){return!1},l=t.unstable_forceFrameRate=function(){}}else{var p=window.performance,d=window.Date,h=window.setTimeout,m=window.clearTimeout;if("undefined"!=typeof console){var g=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof g&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof p&&"function"==typeof p.now)t.unstable_now=function(){return p.now()};else{var y=d.now();t.unstable_now=function(){return d.now()-y}}var b=!1,v=null,w=-1,E=5,x=0;i=function(){return t.unstable_now()>=x},l=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):E=0<e?Math.floor(1e3/e):5};var _=new MessageChannel,S=_.port2;_.port1.onmessage=function(){if(null!==v){var e=t.unstable_now();x=e+E;try{v(!0,e)?S.postMessage(null):(b=!1,v=null)}catch(e){throw S.postMessage(null),e}}else b=!1},r=function(e){v=e,b||(b=!0,S.postMessage(null))},o=function(e,n){w=h((function(){e(t.unstable_now())}),n)},a=function(){m(w),w=-1}}function O(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,o=e[r];if(!(void 0!==o&&0<T(o,t)))break e;e[r]=t,e[n]=o,n=r}}function k(e){return void 0===(e=e[0])?null:e}function P(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length;r<o;){var a=2*(r+1)-1,i=e[a],l=a+1,u=e[l];if(void 0!==i&&0>T(i,n))void 0!==u&&0>T(u,i)?(e[r]=u,e[l]=n,r=l):(e[r]=i,e[a]=n,r=a);else{if(!(void 0!==u&&0>T(u,n)))break e;e[r]=u,e[l]=n,r=l}}}return t}return null}function T(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var j=[],C=[],R=1,N=null,A=3,I=!1,D=!1,L=!1;function F(e){for(var t=k(C);null!==t;){if(null===t.callback)P(C);else{if(!(t.startTime<=e))break;P(C),t.sortIndex=t.expirationTime,O(j,t)}t=k(C)}}function M(e){if(L=!1,F(e),!D)if(null!==k(j))D=!0,r(z);else{var t=k(C);null!==t&&o(M,t.startTime-e)}}function z(e,n){D=!1,L&&(L=!1,a()),I=!0;var r=A;try{for(F(n),N=k(j);null!==N&&(!(N.expirationTime>n)||e&&!i());){var l=N.callback;if(null!==l){N.callback=null,A=N.priorityLevel;var u=l(N.expirationTime<=n);n=t.unstable_now(),"function"==typeof u?N.callback=u:N===k(j)&&P(j),F(n)}else P(j);N=k(j)}if(null!==N)var c=!0;else{var s=k(C);null!==s&&o(M,s.startTime-n),c=!1}return c}finally{N=null,A=r,I=!1}}function U(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var H=l;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){D||I||(D=!0,r(z))},t.unstable_getCurrentPriorityLevel=function(){return A},t.unstable_getFirstCallbackNode=function(){return k(j)},t.unstable_next=function(e){switch(A){case 1:case 2:case 3:var t=3;break;default:t=A}var n=A;A=t;try{return e()}finally{A=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=H,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=A;A=e;try{return t()}finally{A=n}},t.unstable_scheduleCallback=function(e,n,i){var l=t.unstable_now();if("object"==typeof i&&null!==i){var u=i.delay;u="number"==typeof u&&0<u?l+u:l,i="number"==typeof i.timeout?i.timeout:U(e)}else i=U(e),u=l;return e={id:R++,callback:n,priorityLevel:e,startTime:u,expirationTime:i=u+i,sortIndex:-1},u>l?(e.sortIndex=u,O(C,e),null===k(j)&&e===k(C)&&(L?a():L=!0,o(M,u-l))):(e.sortIndex=i,O(j,e),D||I||(D=!0,r(z))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();F(e);var n=k(j);return n!==N&&null!==N&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime<N.expirationTime||i()},t.unstable_wrapCallback=function(e){var t=A;return function(){var n=A;A=t;try{return e.apply(this,arguments)}finally{A=n}}}},function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Jed=n(26),EventEmitter=n(14).EventEmitter,interpolateComponents=n(27).default,LRU=n(32);var o=n(34);function a(){c.throwErrors&&"undefined"!=typeof window&&window.console&&window.console.warn&&window.console.warn.apply(window.console,arguments)}function i(e){return Array.prototype.slice.call(e)}function l(e){var t,n=e[0],o={};for(("string"!=typeof n||e.length>3||e.length>2&&"object"===r(e[1])&&"object"===r(e[2]))&&a("Deprecated Invocation: `translate()` accepts ( string, [string], [object] ). These arguments passed:",i(e),". See https://github.com/Automattic/i18n-calypso#translate-method"),2===e.length&&"string"==typeof n&&"string"==typeof e[1]&&a("Invalid Invocation: `translate()` requires an options object for plural translations, but passed:",i(e)),t=0;t<e.length;t++)"object"===r(e[t])&&(o=e[t]);if("string"==typeof n?o.original=n:"object"===r(o.original)&&(o.plural=o.original.plural,o.count=o.original.count,o.original=o.original.single),"string"==typeof e[1]&&(o.plural=e[1]),void 0===o.original)throw new Error("Translate called without a `string` value as first argument.");return o}function u(e,t){var n,r="gettext";return t.context&&(r="p"+r),"string"==typeof t.original&&"string"==typeof t.plural&&(r="n"+r),n=function(e,t){return{gettext:[t.original],ngettext:[t.original,t.plural,t.count],npgettext:[t.context,t.original,t.plural,t.count],pgettext:[t.context,t.original]}[e]||[]}(r,t),e[r].apply(e,n)}function c(){if(!(this instanceof c))return new c;this.defaultLocaleSlug="en",this.state={numberFormatSettings:{},jed:void 0,locale:void 0,localeSlug:void 0,translations:LRU({max:100})},this.componentUpdateHooks=[],this.translateHooks=[],this.stateObserver=new EventEmitter,this.stateObserver.setMaxListeners(0),this.configure()}c.throwErrors=!1,c.prototype.numberFormat=function(e){var t=arguments[1]||{},n="number"==typeof t?t:t.decimals||0,r=t.decPoint||this.state.numberFormatSettings.decimal_point||".",a=t.thousandsSep||this.state.numberFormatSettings.thousands_sep||",";return o(e,n,r,a)},c.prototype.configure=function(e){Object.assign(this,e||{}),this.setLocale()},c.prototype.setLocale=function(e){var t;e&&e[""].localeSlug||(e={"":{localeSlug:this.defaultLocaleSlug}}),(t=e[""].localeSlug)!==this.defaultLocaleSlug&&t===this.state.localeSlug||(this.state.localeSlug=t,this.state.locale=e,this.state.jed=new Jed({locale_data:{messages:e}}),this.state.numberFormatSettings.decimal_point=u(this.state.jed,l(["number_format_decimals"])),this.state.numberFormatSettings.thousands_sep=u(this.state.jed,l(["number_format_thousands_sep"])),"number_format_decimals"===this.state.numberFormatSettings.decimal_point&&(this.state.numberFormatSettings.decimal_point="."),"number_format_thousands_sep"===this.state.numberFormatSettings.thousands_sep&&(this.state.numberFormatSettings.thousands_sep=","),this.state.translations.clear(),this.stateObserver.emit("change"))},c.prototype.getLocale=function(){return this.state.locale},c.prototype.getLocaleSlug=function(){return this.state.localeSlug},c.prototype.addTranslations=function(e){for(var t in e)""!==t&&(this.state.jed.options.locale_data.messages[t]=e[t]);this.state.translations.clear(),this.stateObserver.emit("change")},c.prototype.translate=function(){var e,t,n,r,o,a;if((a=!(e=l(arguments)).components)&&(o=JSON.stringify(e),t=this.state.translations.get(o)))return t;if(t=u(this.state.jed,e),e.args){(n=Array.isArray(e.args)?e.args.slice(0):[e.args]).unshift(t);try{t=Jed.sprintf.apply(Jed,n)}catch(e){if(!window||!window.console)return;r=this.throwErrors?"error":"warn","string"!=typeof e?window.console[r](e):window.console[r]("i18n sprintf error:",n)}}return e.components&&(t=interpolateComponents({mixedString:t,components:e.components,throwErrors:this.throwErrors})),this.translateHooks.forEach((function(n){t=n(t,e)})),a&&this.state.translations.set(o,t),t},c.prototype.reRenderTranslations=function(){this.state.translations.clear(),this.stateObserver.emit("change")},c.prototype.registerComponentUpdateHook=function(e){this.componentUpdateHooks.push(e)},c.prototype.registerTranslateHook=function(e){this.translateHooks.push(e)},e.exports=c},function(e,t,n){
36
+ /**
37
+ * @preserve jed.js https://github.com/SlexAxton/Jed
38
+ */
39
+ !function(n,r){var o=Array.prototype,a=Object.prototype,i=o.slice,l=a.hasOwnProperty,u=o.forEach,c={},s={forEach:function(e,t,n){var r,o,a;if(null!==e)if(u&&e.forEach===u)e.forEach(t,n);else if(e.length===+e.length){for(r=0,o=e.length;r<o;r++)if(r in e&&t.call(n,e[r],r,e)===c)return}else for(a in e)if(l.call(e,a)&&t.call(n,e[a],a,e)===c)return},extend:function(e){return this.forEach(i.call(arguments,1),(function(t){for(var n in t)e[n]=t[n]})),e}},f=function(e){if(this.defaults={locale_data:{messages:{"":{domain:"messages",lang:"en",plural_forms:"nplurals=2; plural=(n != 1);"}}},domain:"messages",debug:!1},this.options=s.extend({},this.defaults,e),this.textdomain(this.options.domain),e.domain&&!this.options.locale_data[this.options.domain])throw new Error("Text domain set to non-existent domain: `"+e.domain+"`")};function p(e){return f.PF.compile(e||"nplurals=2; plural=(n != 1);")}function d(e,t){this._key=e,this._i18n=t}f.context_delimiter=String.fromCharCode(4),s.extend(d.prototype,{onDomain:function(e){return this._domain=e,this},withContext:function(e){return this._context=e,this},ifPlural:function(e,t){return this._val=e,this._pkey=t,this},fetch:function(e){return"[object Array]"!={}.toString.call(e)&&(e=[].slice.call(arguments,0)),(e&&e.length?f.sprintf:function(e){return e})(this._i18n.dcnpgettext(this._domain,this._context,this._key,this._pkey,this._val),e)}}),s.extend(f.prototype,{translate:function(e){return new d(e,this)},textdomain:function(e){if(!e)return this._textdomain;this._textdomain=e},gettext:function(e){return this.dcnpgettext.call(this,void 0,void 0,e)},dgettext:function(e,t){return this.dcnpgettext.call(this,e,void 0,t)},dcgettext:function(e,t){return this.dcnpgettext.call(this,e,void 0,t)},ngettext:function(e,t,n){return this.dcnpgettext.call(this,void 0,void 0,e,t,n)},dngettext:function(e,t,n,r){return this.dcnpgettext.call(this,e,void 0,t,n,r)},dcngettext:function(e,t,n,r){return this.dcnpgettext.call(this,e,void 0,t,n,r)},pgettext:function(e,t){return this.dcnpgettext.call(this,void 0,e,t)},dpgettext:function(e,t,n){return this.dcnpgettext.call(this,e,t,n)},dcpgettext:function(e,t,n){return this.dcnpgettext.call(this,e,t,n)},npgettext:function(e,t,n,r){return this.dcnpgettext.call(this,void 0,e,t,n,r)},dnpgettext:function(e,t,n,r,o){return this.dcnpgettext.call(this,e,t,n,r,o)},dcnpgettext:function(e,t,n,r,o){var a;if(r=r||n,e=e||this._textdomain,!this.options)return(a=new f).dcnpgettext.call(a,void 0,void 0,n,r,o);if(!this.options.locale_data)throw new Error("No locale data provided.");if(!this.options.locale_data[e])throw new Error("Domain `"+e+"` was not found.");if(!this.options.locale_data[e][""])throw new Error("No locale meta information provided.");if(!n)throw new Error("No translation key found.");var i,l,u,c=t?t+f.context_delimiter+n:n,s=this.options.locale_data,d=s[e],h=(s.messages||this.defaults.locale_data.messages)[""],m=d[""].plural_forms||d[""]["Plural-Forms"]||d[""]["plural-forms"]||h.plural_forms||h["Plural-Forms"]||h["plural-forms"];if(void 0===o)u=0;else{if("number"!=typeof o&&(o=parseInt(o,10),isNaN(o)))throw new Error("The number that was passed in is not a number.");u=p(m)(o)}if(!d)throw new Error("No domain named `"+e+"` could be found.");return!(i=d[c])||u>i.length?(this.options.missing_key_callback&&this.options.missing_key_callback(c,e),l=[n,r],!0===this.options.debug&&console.log(l[p(m)(o)]),l[p()(o)]):(l=i[u])||(l=[n,r])[p()(o)]}});var h,m,g=function(){function e(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function t(e,t){for(var n=[];t>0;n[--t]=e);return n.join("")}var n=function(){return n.cache.hasOwnProperty(arguments[0])||(n.cache[arguments[0]]=n.parse(arguments[0])),n.format.call(null,n.cache[arguments[0]],arguments)};return n.format=function(n,r){var o,a,i,l,u,c,s,f=1,p=n.length,d="",h=[];for(a=0;a<p;a++)if("string"===(d=e(n[a])))h.push(n[a]);else if("array"===d){if((l=n[a])[2])for(o=r[f],i=0;i<l[2].length;i++){if(!o.hasOwnProperty(l[2][i]))throw g('[sprintf] property "%s" does not exist',l[2][i]);o=o[l[2][i]]}else o=l[1]?r[l[1]]:r[f++];if(/[^s]/.test(l[8])&&"number"!=e(o))throw g("[sprintf] expecting number but found %s",e(o));switch(null==o&&(o=""),l[8]){case"b":o=o.toString(2);break;case"c":o=String.fromCharCode(o);break;case"d":o=parseInt(o,10);break;case"e":o=l[7]?o.toExponential(l[7]):o.toExponential();break;case"f":o=l[7]?parseFloat(o).toFixed(l[7]):parseFloat(o);break;case"o":o=o.toString(8);break;case"s":o=(o=String(o))&&l[7]?o.substring(0,l[7]):o;break;case"u":o=Math.abs(o);break;case"x":o=o.toString(16);break;case"X":o=o.toString(16).toUpperCase()}o=/[def]/.test(l[8])&&l[3]&&o>=0?"+"+o:o,c=l[4]?"0"==l[4]?"0":l[4].charAt(1):" ",s=l[6]-String(o).length,u=l[6]?t(c,s):"",h.push(l[5]?o+u:u+o)}return h.join("")},n.cache={},n.parse=function(e){for(var t=e,n=[],r=[],o=0;t;){if(null!==(n=/^[^\x25]+/.exec(t)))r.push(n[0]);else if(null!==(n=/^\x25{2}/.exec(t)))r.push("%");else{if(null===(n=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(t)))throw"[sprintf] huh?";if(n[2]){o|=1;var a=[],i=n[2],l=[];if(null===(l=/^([a-z_][a-z_\d]*)/i.exec(i)))throw"[sprintf] huh?";for(a.push(l[1]);""!==(i=i.substring(l[0].length));)if(null!==(l=/^\.([a-z_][a-z_\d]*)/i.exec(i)))a.push(l[1]);else{if(null===(l=/^\[(\d+)\]/.exec(i)))throw"[sprintf] huh?";a.push(l[1])}n[2]=a}else o|=2;if(3===o)throw"[sprintf] mixing positional and named placeholders is not (yet) supported";r.push(n)}t=t.substring(n[0].length)}return r},n}(),y=function(e,t){return t.unshift(e),g.apply(null,t)};f.parse_plural=function(e,t){return e=e.replace(/n/g,t),f.parse_expression(e)},f.sprintf=function(e,t){return"[object Array]"=={}.toString.call(t)?y(e,[].slice.call(t)):g.apply(this,[].slice.call(arguments))},f.prototype.sprintf=function(){return f.sprintf.apply(this,arguments)},(f.PF={}).parse=function(e){var t=f.PF.extractPluralExpr(e);return f.PF.parser.parse.call(f.PF.parser,t)},f.PF.compile=function(e){var t=f.PF.parse(e);return function(e){return!0===(n=f.PF.interpreter(t)(e))?1:n||0;var n}},f.PF.interpreter=function(e){return function(t){switch(e.type){case"GROUP":return f.PF.interpreter(e.expr)(t);case"TERNARY":return f.PF.interpreter(e.expr)(t)?f.PF.interpreter(e.truthy)(t):f.PF.interpreter(e.falsey)(t);case"OR":return f.PF.interpreter(e.left)(t)||f.PF.interpreter(e.right)(t);case"AND":return f.PF.interpreter(e.left)(t)&&f.PF.interpreter(e.right)(t);case"LT":return f.PF.interpreter(e.left)(t)<f.PF.interpreter(e.right)(t);case"GT":return f.PF.interpreter(e.left)(t)>f.PF.interpreter(e.right)(t);case"LTE":return f.PF.interpreter(e.left)(t)<=f.PF.interpreter(e.right)(t);case"GTE":return f.PF.interpreter(e.left)(t)>=f.PF.interpreter(e.right)(t);case"EQ":return f.PF.interpreter(e.left)(t)==f.PF.interpreter(e.right)(t);case"NEQ":return f.PF.interpreter(e.left)(t)!=f.PF.interpreter(e.right)(t);case"MOD":return f.PF.interpreter(e.left)(t)%f.PF.interpreter(e.right)(t);case"VAR":return t;case"NUM":return e.val;default:throw new Error("Invalid Token found.")}}},f.PF.extractPluralExpr=function(e){e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,""),/;\s*$/.test(e)||(e=e.concat(";"));var t,n=/nplurals\=(\d+);/,r=e.match(n);if(!(r.length>1))throw new Error("nplurals not found in plural_forms string: "+e);if(r[1],!((t=(e=e.replace(n,"")).match(/plural\=(.*);/))&&t.length>1))throw new Error("`plural` expression not found: "+e);return t[1]},f.PF.parser=(h={trace:function(){},yy:{},symbols_:{error:2,expressions:3,e:4,EOF:5,"?":6,":":7,"||":8,"&&":9,"<":10,"<=":11,">":12,">=":13,"!=":14,"==":15,"%":16,"(":17,")":18,n:19,NUMBER:20,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",6:"?",7:":",8:"||",9:"&&",10:"<",11:"<=",12:">",13:">=",14:"!=",15:"==",16:"%",17:"(",18:")",19:"n",20:"NUMBER"},productions_:[0,[3,2],[4,5],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,1],[4,1]],performAction:function(e,t,n,r,o,a,i){var l=a.length-1;switch(o){case 1:return{type:"GROUP",expr:a[l-1]};case 2:this.$={type:"TERNARY",expr:a[l-4],truthy:a[l-2],falsey:a[l]};break;case 3:this.$={type:"OR",left:a[l-2],right:a[l]};break;case 4:this.$={type:"AND",left:a[l-2],right:a[l]};break;case 5:this.$={type:"LT",left:a[l-2],right:a[l]};break;case 6:this.$={type:"LTE",left:a[l-2],right:a[l]};break;case 7:this.$={type:"GT",left:a[l-2],right:a[l]};break;case 8:this.$={type:"GTE",left:a[l-2],right:a[l]};break;case 9:this.$={type:"NEQ",left:a[l-2],right:a[l]};break;case 10:this.$={type:"EQ",left:a[l-2],right:a[l]};break;case 11:this.$={type:"MOD",left:a[l-2],right:a[l]};break;case 12:this.$={type:"GROUP",expr:a[l-1]};break;case 13:this.$={type:"VAR"};break;case 14:this.$={type:"NUM",val:Number(e)}}},table:[{3:1,4:2,17:[1,3],19:[1,4],20:[1,5]},{1:[3]},{5:[1,6],6:[1,7],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16]},{4:17,17:[1,3],19:[1,4],20:[1,5]},{5:[2,13],6:[2,13],7:[2,13],8:[2,13],9:[2,13],10:[2,13],11:[2,13],12:[2,13],13:[2,13],14:[2,13],15:[2,13],16:[2,13],18:[2,13]},{5:[2,14],6:[2,14],7:[2,14],8:[2,14],9:[2,14],10:[2,14],11:[2,14],12:[2,14],13:[2,14],14:[2,14],15:[2,14],16:[2,14],18:[2,14]},{1:[2,1]},{4:18,17:[1,3],19:[1,4],20:[1,5]},{4:19,17:[1,3],19:[1,4],20:[1,5]},{4:20,17:[1,3],19:[1,4],20:[1,5]},{4:21,17:[1,3],19:[1,4],20:[1,5]},{4:22,17:[1,3],19:[1,4],20:[1,5]},{4:23,17:[1,3],19:[1,4],20:[1,5]},{4:24,17:[1,3],19:[1,4],20:[1,5]},{4:25,17:[1,3],19:[1,4],20:[1,5]},{4:26,17:[1,3],19:[1,4],20:[1,5]},{4:27,17:[1,3],19:[1,4],20:[1,5]},{6:[1,7],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[1,28]},{6:[1,7],7:[1,29],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16]},{5:[2,3],6:[2,3],7:[2,3],8:[2,3],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,3]},{5:[2,4],6:[2,4],7:[2,4],8:[2,4],9:[2,4],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,4]},{5:[2,5],6:[2,5],7:[2,5],8:[2,5],9:[2,5],10:[2,5],11:[2,5],12:[2,5],13:[2,5],14:[2,5],15:[2,5],16:[1,16],18:[2,5]},{5:[2,6],6:[2,6],7:[2,6],8:[2,6],9:[2,6],10:[2,6],11:[2,6],12:[2,6],13:[2,6],14:[2,6],15:[2,6],16:[1,16],18:[2,6]},{5:[2,7],6:[2,7],7:[2,7],8:[2,7],9:[2,7],10:[2,7],11:[2,7],12:[2,7],13:[2,7],14:[2,7],15:[2,7],16:[1,16],18:[2,7]},{5:[2,8],6:[2,8],7:[2,8],8:[2,8],9:[2,8],10:[2,8],11:[2,8],12:[2,8],13:[2,8],14:[2,8],15:[2,8],16:[1,16],18:[2,8]},{5:[2,9],6:[2,9],7:[2,9],8:[2,9],9:[2,9],10:[2,9],11:[2,9],12:[2,9],13:[2,9],14:[2,9],15:[2,9],16:[1,16],18:[2,9]},{5:[2,10],6:[2,10],7:[2,10],8:[2,10],9:[2,10],10:[2,10],11:[2,10],12:[2,10],13:[2,10],14:[2,10],15:[2,10],16:[1,16],18:[2,10]},{5:[2,11],6:[2,11],7:[2,11],8:[2,11],9:[2,11],10:[2,11],11:[2,11],12:[2,11],13:[2,11],14:[2,11],15:[2,11],16:[2,11],18:[2,11]},{5:[2,12],6:[2,12],7:[2,12],8:[2,12],9:[2,12],10:[2,12],11:[2,12],12:[2,12],13:[2,12],14:[2,12],15:[2,12],16:[2,12],18:[2,12]},{4:30,17:[1,3],19:[1,4],20:[1,5]},{5:[2,2],6:[1,7],7:[2,2],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,2]}],defaultActions:{6:[2,1]},parseError:function(e,t){throw new Error(e)},parse:function(e){var t=this,n=[0],r=[null],o=[],a=this.table,i="",l=0,u=0,c=0;this.lexer.setInput(e),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var s=this.lexer.yylloc;function f(){var e;return"number"!=typeof(e=t.lexer.lex()||1)&&(e=t.symbols_[e]||e),e}o.push(s),"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var p,d,h,m,g,y,b,v,w,E,x={};;){if(h=n[n.length-1],this.defaultActions[h]?m=this.defaultActions[h]:(null==p&&(p=f()),m=a[h]&&a[h][p]),void 0===m||!m.length||!m[0]){if(!c){for(y in w=[],a[h])this.terminals_[y]&&y>2&&w.push("'"+this.terminals_[y]+"'");var _="";_=this.lexer.showPosition?"Parse error on line "+(l+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+w.join(", ")+", got '"+this.terminals_[p]+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==p?"end of input":"'"+(this.terminals_[p]||p)+"'"),this.parseError(_,{text:this.lexer.match,token:this.terminals_[p]||p,line:this.lexer.yylineno,loc:s,expected:w})}if(3==c){if(1==p)throw new Error(_||"Parsing halted.");u=this.lexer.yyleng,i=this.lexer.yytext,l=this.lexer.yylineno,s=this.lexer.yylloc,p=f()}for(;!(2..toString()in a[h]);){if(0==h)throw new Error(_||"Parsing halted.");E=1,n.length=n.length-2*E,r.length=r.length-E,o.length=o.length-E,h=n[n.length-1]}d=p,p=2,m=a[h=n[n.length-1]]&&a[h][2],c=3}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+h+", token: "+p);switch(m[0]){case 1:n.push(p),r.push(this.lexer.yytext),o.push(this.lexer.yylloc),n.push(m[1]),p=null,d?(p=d,d=null):(u=this.lexer.yyleng,i=this.lexer.yytext,l=this.lexer.yylineno,s=this.lexer.yylloc,c>0&&c--);break;case 2:if(b=this.productions_[m[1]][1],x.$=r[r.length-b],x._$={first_line:o[o.length-(b||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(b||1)].first_column,last_column:o[o.length-1].last_column},void 0!==(g=this.performAction.call(x,i,u,l,this.yy,m[1],r,o)))return g;b&&(n=n.slice(0,-1*b*2),r=r.slice(0,-1*b),o=o.slice(0,-1*b)),n.push(this.productions_[m[1]][0]),r.push(x.$),o.push(x._$),v=a[n[n.length-2]][n[n.length-1]],n.push(v);break;case 3:return!0}}return!0}},m=function(){var e={EOF:1,parseError:function(e,t){if(!this.yy.parseError)throw new Error(e);this.yy.parseError(e,t)},setInput:function(e){return this._input=e,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this},input:function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.match+=e,this.matched+=e,e.match(/\n/)&&this.yylineno++,this._input=this._input.slice(1),e},unput:function(e){return this._input=e+this._input,this},more:function(){return this._more=!0,this},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)return this.EOF;var e,t;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r<n.length;r++)if(e=this._input.match(this.rules[n[r]]))return(t=e[0].match(/\n.*/g))&&(this.yylineno+=t.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:t?t[t.length-1].length-1:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this._more=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],this.performAction.call(this,this.yy,this,n[r],this.conditionStack[this.conditionStack.length-1])||void 0;if(""===this._input)return this.EOF;this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return void 0!==e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(e){this.begin(e)},performAction:function(e,t,n,r){switch(n){case 0:break;case 1:return 20;case 2:return 19;case 3:return 8;case 4:return 9;case 5:return 6;case 6:return 7;case 7:return 11;case 8:return 13;case 9:return 10;case 10:return 12;case 11:return 14;case 12:return 15;case 13:return 16;case 14:return 17;case 15:return 18;case 16:return 5;case 17:return"INVALID"}},rules:[/^\s+/,/^[0-9]+(\.[0-9]+)?\b/,/^n\b/,/^\|\|/,/^&&/,/^\?/,/^:/,/^<=/,/^>=/,/^</,/^>/,/^!=/,/^==/,/^%/,/^\(/,/^\)/,/^$/,/^./],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],inclusive:!0}}};return e}(),h.lexer=m,h),e.exports&&(t=e.exports=f),t.Jed=f}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=l(n(0)),a=l(n(28)),i=l(n(31));function l(e){return e&&e.__esModule?e:{default:e}}var u=void 0;function c(e,t){var n,i,l,s,f,p,d,h,m=[],g={};for(p=0;p<e.length;p++)if("string"!==(f=e[p]).type){if(!t.hasOwnProperty(f.value)||void 0===t[f.value])throw new Error("Invalid interpolation, missing component node: `"+f.value+"`");if("object"!==r(t[f.value]))throw new Error("Invalid interpolation, component node must be a ReactElement or null: `"+f.value+"`","\n> "+u);if("componentClose"===f.type)throw new Error("Missing opening component token: `"+f.value+"`");if("componentOpen"===f.type){n=t[f.value],l=p;break}m.push(t[f.value])}else m.push(f.value);return n&&(s=function(e,t){var n,r,o=t[e],a=0;for(r=e+1;r<t.length;r++)if((n=t[r]).value===o.value){if("componentOpen"===n.type){a++;continue}if("componentClose"===n.type){if(0===a)return r;a--}}throw new Error("Missing closing component token `"+o.value+"`")}(l,e),d=c(e.slice(l+1,s),t),i=o.default.cloneElement(n,{},d),m.push(i),s<e.length-1&&(h=c(e.slice(s+1),t),m=m.concat(h))),1===m.length?m[0]:(m.forEach((function(e,t){e&&(g["interpolation-child-"+t]=e)})),(0,a.default)(g))}t.default=function(e){var t=e.mixedString,n=e.components,o=e.throwErrors;if(u=t,!n)return t;if("object"!==(void 0===n?"undefined":r(n))){if(o)throw new Error("Interpolation Error: unable to process `"+t+"` because components is not an object");return t}var a=(0,i.default)(t);try{return c(a,n)}catch(e){if(o)throw new Error("Interpolation Error: unable to process `"+t+"` because of error `"+e.message+"`");return t}}},function(e,t,n){"use strict";var r=n(0),o="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,a=n(15),i=n(29),l=n(30),u="function"==typeof Symbol&&Symbol.iterator;function c(e,t){return e&&"object"==typeof e&&null!=e.key?(n=e.key,r={"=":"=0",":":"=2"},"$"+(""+n).replace(/[=:]/g,(function(e){return r[e]}))):t.toString(36);var n,r}function s(e,t,n,r){var a,l=typeof e;if("undefined"!==l&&"boolean"!==l||(e=null),null===e||"string"===l||"number"===l||"object"===l&&e.$$typeof===o)return n(r,e,""===t?"."+c(e,0):t),1;var f=0,p=""===t?".":t+":";if(Array.isArray(e))for(var d=0;d<e.length;d++)f+=s(a=e[d],p+c(a,d),n,r);else{var h=function(e){var t=e&&(u&&e[u]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(h){0;for(var m,g=h.call(e),y=0;!(m=g.next()).done;)f+=s(a=m.value,p+c(a,y++),n,r)}else if("object"===l){0;var b=""+e;i(!1,"Objects are not valid as a React child (found: %s).%s","[object Object]"===b?"object with keys {"+Object.keys(e).join(", ")+"}":b,"")}}return f}var f=/\/+/g;function p(e){return(""+e).replace(f,"$&/")}var d,h,m=g,g=function(e){if(this.instancePool.length){var t=this.instancePool.pop();return this.call(t,e),t}return new this(e)},y=function(e){i(e instanceof this,"Trying to release an instance into a pool of a different type."),e.destructor(),this.instancePool.length<this.poolSize&&this.instancePool.push(e)};function b(e,t,n,r){this.result=e,this.keyPrefix=t,this.func=n,this.context=r,this.count=0}function v(e,t,n){var o,i,l=e.result,u=e.keyPrefix,c=e.func,s=e.context,f=c.call(s,t,e.count++);Array.isArray(f)?w(f,l,n,a.thatReturnsArgument):null!=f&&(r.isValidElement(f)&&(o=f,i=u+(!f.key||t&&t.key===f.key?"":p(f.key)+"/")+n,f=r.cloneElement(o,{key:i},void 0!==o.props?o.props.children:void 0)),l.push(f))}function w(e,t,n,r,o){var a="";null!=n&&(a=p(n)+"/");var i=b.getPooled(t,a,r,o);!function(e,t,n){null==e||s(e,"",t,n)}(e,v,i),b.release(i)}b.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},d=function(e,t,n,r){if(this.instancePool.length){var o=this.instancePool.pop();return this.call(o,e,t,n,r),o}return new this(e,t,n,r)},(h=b).instancePool=[],h.getPooled=d||m,h.poolSize||(h.poolSize=10),h.release=y;e.exports=function(e){if("object"!=typeof e||!e||Array.isArray(e))return l(!1,"React.addons.createFragment only accepts a single object. Got: %s",e),e;if(r.isValidElement(e))return l(!1,"React.addons.createFragment does not accept a ReactElement without a wrapper object."),e;i(1!==e.nodeType,"React.addons.createFragment(...): Encountered an invalid child; DOM elements are not valid children of React components.");var t=[];for(var n in e)w(e[n],t,n,a.thatReturnsArgument);return t}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o,a,i,l){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,a,i,l],s=0;(u=new Error(t.replace(/%s/g,(function(){return c[s++]})))).name="Invariant Violation"}throw u.framesToPop=1,u}}},function(e,t,n){"use strict";var r=n(15);e.exports=r},function(e,t,n){"use strict";function r(e){return e.match(/^\{\{\//)?{type:"componentClose",value:e.replace(/\W/g,"")}:e.match(/\/\}\}$/)?{type:"componentSelfClosing",value:e.replace(/\W/g,"")}:e.match(/^\{\{/)?{type:"componentOpen",value:e.replace(/\W/g,"")}:{type:"string",value:e}}e.exports=function(e){return e.split(/(\{\{\/?\s*\w+\s*\/?\}\})/g).map(r)}},function(e,t,n){var r=n(14),o=n(33);function a(e){if(!(this instanceof a))return new a(e);"number"==typeof e&&(e={max:e}),e||(e={}),r.EventEmitter.call(this),this.cache={},this.head=this.tail=null,this.length=0,this.max=e.max||1e3,this.maxAge=e.maxAge||0}e.exports=a,o(a,r.EventEmitter),Object.defineProperty(a.prototype,"keys",{get:function(){return Object.keys(this.cache)}}),a.prototype.clear=function(){this.cache={},this.head=this.tail=null,this.length=0},a.prototype.remove=function(e){if("string"!=typeof e&&(e=""+e),this.cache.hasOwnProperty(e)){var t=this.cache[e];return delete this.cache[e],this._unlink(e,t.prev,t.next),t.value}},a.prototype._unlink=function(e,t,n){this.length--,0===this.length?this.head=this.tail=null:this.head===e?(this.head=t,this.cache[this.head].next=null):this.tail===e?(this.tail=n,this.cache[this.tail].prev=null):(this.cache[t].next=n,this.cache[n].prev=t)},a.prototype.peek=function(e){if(this.cache.hasOwnProperty(e)){var t=this.cache[e];if(this._checkAge(e,t))return t.value}},a.prototype.set=function(e,t){var n;if("string"!=typeof e&&(e=""+e),this.cache.hasOwnProperty(e)){if((n=this.cache[e]).value=t,this.maxAge&&(n.modified=Date.now()),e===this.head)return t;this._unlink(e,n.prev,n.next)}else n={value:t,modified:0,next:null,prev:null},this.maxAge&&(n.modified=Date.now()),this.cache[e]=n,this.length===this.max&&this.evict();return this.length++,n.next=null,n.prev=this.head,this.head&&(this.cache[this.head].next=e),this.head=e,this.tail||(this.tail=e),t},a.prototype._checkAge=function(e,t){return!(this.maxAge&&Date.now()-t.modified>this.maxAge)||(this.remove(e),this.emit("evict",{key:e,value:t.value}),!1)},a.prototype.get=function(e){if("string"!=typeof e&&(e=""+e),this.cache.hasOwnProperty(e)){var t=this.cache[e];if(this._checkAge(e,t))return this.head!==e&&(e===this.tail?(this.tail=t.next,this.cache[this.tail].prev=null):this.cache[t.prev].next=t.next,this.cache[t.next].prev=t.prev,this.cache[this.head].next=e,t.prev=this.head,t.next=null,this.head=e),t.value}},a.prototype.evict=function(){if(this.tail){var e=this.tail,t=this.remove(this.tail);this.emit("evict",{key:e,value:t})}}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},function(e,t){e.exports=
40
+ /**
41
+ * Exposes number format capability through i18n mixin
42
+ *
43
+ * @copyright Copyright (c) 2013 Kevin van Zonneveld (http://kvz.io) and Contributors (http://phpjs.org/authors).
44
+ * @license See CREDITS.md
45
+ * @see https://github.com/kvz/phpjs/blob/ffe1356af23a6f2512c84c954dd4e828e92579fa/functions/strings/number_format.js
46
+ */
47
+ function(e,t,n,r){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var o=isFinite(+e)?+e:0,a=isFinite(+t)?Math.abs(t):0,i=void 0===r?",":r,l=void 0===n?".":n,u="";return(u=(a?function(e,t){var n=Math.pow(10,t);return""+(Math.round(e*n)/n).toFixed(t)}(o,a):""+Math.round(o)).split("."))[0].length>3&&(u[0]=u[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,i)),(u[1]||"").length<a&&(u[1]=u[1]||"",u[1]+=new Array(a-u[1].length+1).join("0")),u.join(l)}},function(e,t,n){"use strict";var r=n(36);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";
48
+ /** @license React v16.13.1
49
+ * react-is.production.min.js
50
+ *
51
+ * Copyright (c) Facebook, Inc. and its affiliates.
52
+ *
53
+ * This source code is licensed under the MIT license found in the
54
+ * LICENSE file in the root directory of this source tree.
55
+ */var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,a=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,l=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,s=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,h=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.suspense_list"):60120,g=r?Symbol.for("react.memo"):60115,y=r?Symbol.for("react.lazy"):60116,b=r?Symbol.for("react.block"):60121,v=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,E=r?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case f:case p:case i:case u:case l:case h:return e;default:switch(e=e&&e.$$typeof){case s:case d:case y:case g:case c:return e;default:return t}}case a:return t}}}function _(e){return x(e)===p}t.AsyncMode=f,t.ConcurrentMode=p,t.ContextConsumer=s,t.ContextProvider=c,t.Element=o,t.ForwardRef=d,t.Fragment=i,t.Lazy=y,t.Memo=g,t.Portal=a,t.Profiler=u,t.StrictMode=l,t.Suspense=h,t.isAsyncMode=function(e){return _(e)||x(e)===f},t.isConcurrentMode=_,t.isContextConsumer=function(e){return x(e)===s},t.isContextProvider=function(e){return x(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return x(e)===d},t.isFragment=function(e){return x(e)===i},t.isLazy=function(e){return x(e)===y},t.isMemo=function(e){return x(e)===g},t.isPortal=function(e){return x(e)===a},t.isProfiler=function(e){return x(e)===u},t.isStrictMode=function(e){return x(e)===l},t.isSuspense=function(e){return x(e)===h},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===p||e===u||e===l||e===h||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===g||e.$$typeof===c||e.$$typeof===s||e.$$typeof===d||e.$$typeof===v||e.$$typeof===w||e.$$typeof===E||e.$$typeof===b)},t.typeOf=x},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){"use strict";var r=n(9),o=n(16),a=Object.prototype.hasOwnProperty,i={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},l=Array.isArray,u=Array.prototype.push,c=function(e,t){u.apply(e,l(t)?t:[t])},s=Date.prototype.toISOString,f=o.default,p={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:r.encode,encodeValuesOnly:!1,format:f,formatter:o.formatters[f],indices:!1,serializeDate:function(e){return s.call(e)},skipNulls:!1,strictNullHandling:!1},d=function e(t,n,o,a,i,u,s,f,d,h,m,g,y){var b,v=t;if("function"==typeof s?v=s(n,v):v instanceof Date?v=h(v):"comma"===o&&l(v)&&(v=v.join(",")),null===v){if(a)return u&&!g?u(n,p.encoder,y,"key"):n;v=""}if("string"==typeof(b=v)||"number"==typeof b||"boolean"==typeof b||"symbol"==typeof b||"bigint"==typeof b||r.isBuffer(v))return u?[m(g?n:u(n,p.encoder,y,"key"))+"="+m(u(v,p.encoder,y,"value"))]:[m(n)+"="+m(String(v))];var w,E=[];if(void 0===v)return E;if(l(s))w=s;else{var x=Object.keys(v);w=f?x.sort(f):x}for(var _=0;_<w.length;++_){var S=w[_];i&&null===v[S]||(l(v)?c(E,e(v[S],"function"==typeof o?o(n,S):n,o,a,i,u,s,f,d,h,m,g,y)):c(E,e(v[S],n+(d?"."+S:"["+S+"]"),o,a,i,u,s,f,d,h,m,g,y)))}return E};e.exports=function(e,t){var n,r=e,u=function(e){if(!e)return p;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||p.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=o.default;if(void 0!==e.format){if(!a.call(o.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r=o.formatters[n],i=p.filter;return("function"==typeof e.filter||l(e.filter))&&(i=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:p.addQueryPrefix,allowDots:void 0===e.allowDots?p.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:p.charsetSentinel,delimiter:void 0===e.delimiter?p.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:p.encode,encoder:"function"==typeof e.encoder?e.encoder:p.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:p.encodeValuesOnly,filter:i,formatter:r,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:p.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:p.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:p.strictNullHandling}}(t);"function"==typeof u.filter?r=(0,u.filter)("",r):l(u.filter)&&(n=u.filter);var s,f=[];if("object"!=typeof r||null===r)return"";s=t&&t.arrayFormat in i?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var h=i[s];n||(n=Object.keys(r)),u.sort&&n.sort(u.sort);for(var m=0;m<n.length;++m){var g=n[m];u.skipNulls&&null===r[g]||c(f,d(r[g],g,h,u.strictNullHandling,u.skipNulls,u.encode?u.encoder:null,u.filter,u.sort,u.allowDots,u.serializeDate,u.formatter,u.encodeValuesOnly,u.charset))}var y=f.join(u.delimiter),b=!0===u.addQueryPrefix?"?":"";return u.charsetSentinel&&("iso-8859-1"===u.charset?b+="utf8=%26%2310003%3B&":b+="utf8=%E2%9C%93&"),y.length>0?b+y:""}},function(e,t,n){"use strict";var r=n(9),o=Object.prototype.hasOwnProperty,a=Array.isArray,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},l=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},u=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},c=function(e,t){if(a(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},s=function(e,t,n,r){if(e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,l=n.depth>0&&/(\[[^[\]]*])/.exec(a),c=l?a.slice(0,l.index):a,s=[];if(c){if(!n.plainObjects&&o.call(Object.prototype,c)&&!n.allowPrototypes)return;s.push(c)}for(var f=0;n.depth>0&&null!==(l=i.exec(a))&&f<n.depth;){if(f+=1,!n.plainObjects&&o.call(Object.prototype,l[1].slice(1,-1))&&!n.allowPrototypes)return;s.push(l[1])}return l&&s.push("["+a.slice(l.index)+"]"),function(e,t,n,r){for(var o=r?t:u(t,n),a=e.length-1;a>=0;--a){var i,l=e[a];if("[]"===l&&n.parseArrays)i=[].concat(o);else{i=n.plainObjects?Object.create(null):{};var c="["===l.charAt(0)&&"]"===l.charAt(l.length-1)?l.slice(1,-1):l,s=parseInt(c,10);n.parseArrays||""!==c?!isNaN(s)&&l!==c&&String(s)===c&&s>=0&&n.parseArrays&&s<=n.arrayLimit?(i=[])[s]=o:i[c]=o:i={0:o}}o=i}return o}(s,t,n,r)}};e.exports=function(e,t){var n=function(e){if(!e)return i;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?i.charset:e.charset;return{allowDots:void 0===e.allowDots?i.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:i.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:i.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:i.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:i.comma,decoder:"function"==typeof e.decoder?e.decoder:i.decoder,delimiter:"string"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:i.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:i.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:i.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:i.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:i.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:i.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var f="string"==typeof e?function(e,t){var n,s={},f=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,p=t.parameterLimit===1/0?void 0:t.parameterLimit,d=f.split(t.delimiter,p),h=-1,m=t.charset;if(t.charsetSentinel)for(n=0;n<d.length;++n)0===d[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===d[n]?m="utf-8":"utf8=%26%2310003%3B"===d[n]&&(m="iso-8859-1"),h=n,n=d.length);for(n=0;n<d.length;++n)if(n!==h){var g,y,b=d[n],v=b.indexOf("]="),w=-1===v?b.indexOf("="):v+1;-1===w?(g=t.decoder(b,i.decoder,m,"key"),y=t.strictNullHandling?null:""):(g=t.decoder(b.slice(0,w),i.decoder,m,"key"),y=c(u(b.slice(w+1),t),(function(e){return t.decoder(e,i.decoder,m,"value")}))),y&&t.interpretNumericEntities&&"iso-8859-1"===m&&(y=l(y)),b.indexOf("[]=")>-1&&(y=a(y)?[y]:y),o.call(s,g)?s[g]=r.combine(s[g],y):s[g]=y}return s}(e,n):e,p=n.plainObjects?Object.create(null):{},d=Object.keys(f),h=0;h<d.length;++h){var m=d[h],g=s(m,f[m],n,"string"==typeof e);p=r.merge(p,g,n)}return r.compact(p)}},function(e,t,n){var r=n(3),o=n(43);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},function(e,t,n){(t=n(4)(!1)).push([e.i,".redirection .form-table th a{color:#444}.redirection .form-table td ul{padding-left:20px;list-style-type:disc;margin:0;margin-top:15px}.redirection .form-table td li{margin-bottom:0;line-height:1.6}\n",""]),e.exports=t},function(e,t,n){var r=n(3),o=n(45);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},function(e,t,n){(t=n(4)(!1)).push([e.i,'@-webkit-keyframes loading-fade{0%{opacity:0.5}50%{opacity:1}100%{opacity:0.5}}@keyframes loading-fade{0%{opacity:0.5}50%{opacity:1}100%{opacity:0.5}}.placeholder-container{width:100%;height:100px;position:relative}.placeholder-loading{content:"";position:absolute;top:16px;right:8px;bottom:16px;left:8px;padding-left:8px;padding-top:8px;background-color:#bbb;-webkit-animation:loading-fade 1.6s ease-in-out infinite;animation:loading-fade 1.6s ease-in-out infinite}.placeholder-inline{width:100%;height:50px;position:relative}.placeholder-inline .placeholder-loading{top:0;right:0;left:0;bottom:0}.loading-small{width:25px;height:25px}input.current-page{width:60px}.loader-wrapper{position:relative}.loader-textarea{height:100px}.wp-list-table .is-placeholder td{position:relative;height:50px}.wp-list-table .item-loading{opacity:0.3}\n',""]),e.exports=t},function(e,t,n){var r=n(3),o=n(47);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},function(e,t,n){(t=n(4)(!1)).push([e.i,'.donation .donation-amount{float:left;margin-top:10px}.donation .donation-amount span{font-size:28px;margin-top:4px;vertical-align:bottom}.donation .donation-amount img{width:24px !important;margin-bottom:-5px !important}.donation .donation-amount:after{content:"";display:block;clear:both}.donation input[type="number"]{width:60px;margin-left:10px}.donation td,.donation th{padding-bottom:0;margin-bottom:0}.donation input[type="submit"]{margin-left:10px}.newsletter h3{margin-top:30px}\n',""]),e.exports=t},function(e,t,n){var r=n(3),o=n(49);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},function(e,t,n){(t=n(4)(!1)).push([e.i,".github{margin-top:8px}.github a{text-decoration:none}.github img{padding-right:10px;margin-bottom:-10px}.searchregex-help ul{list-style:disc;margin-left:20px}\n",""]),e.exports=t},function(e,t,n){var r=n(3),o=n(51);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},function(e,t,n){(t=n(4)(!1)).push([e.i,'.redirect-popover__toggle{display:inline-block;flex:none !important;cursor:pointer}.redirect-popover__content{box-shadow:0 3px 30px rgba(51,51,51,0.1);border:1px solid #ddd;background:white;min-width:150px;max-height:400px;position:absolute;z-index:10001;height:auto;overflow-y:auto}.redirect-popover__arrows{position:absolute;width:100%}.redirect-popover__arrows::after,.redirect-popover__arrows::before{content:"";box-shadow:0 3px 30px rgba(51,51,51,0.1);position:absolute;height:0;width:0;line-height:0;margin-left:10px}.redirect-popover__arrows::before{border:8px solid #ddd;border-bottom-style:solid;border-left-color:transparent;border-right-color:transparent;border-top:none;top:-8px}.redirect-popover__arrows::after{border:8px solid white;border-bottom-style:solid;border-left-color:transparent;border-right-color:transparent;border-top:none;top:-6px;z-index:10003}.redirect-popover__arrows.redirect-popover__arrows__right::after,.redirect-popover__arrows.redirect-popover__arrows__right::before{right:0;margin-right:10px}.redirect-popover__arrows.redirect-popover__arrows__centre::after,.redirect-popover__arrows.redirect-popover__arrows__centre::before{left:calc(50% - 16px)}\n',""]),e.exports=t},function(e,t,n){var r=n(3),o=n(53);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},function(e,t,n){(t=n(4)(!1)).push([e.i,'.redirect-badge{display:inline-block;padding:0 5px 0 6px;font-size:12px;background-color:#ddd;border-radius:3px;font-feature-settings:"c2sc";font-variant:small-caps;white-space:nowrap;color:black}.redirect-badge>div{display:flex;align-items:center}.redirect-badge.redirect-badge__click{cursor:pointer;border:1px solid transparent}.redirect-badge.redirect-badge__click:hover{border:1px solid black}.redirect-badge span{background-color:transparent;border:none;width:15px;text-align:center;padding:0;margin-left:4px;font-size:20px;vertical-align:middle;margin-top:-5px;margin-right:-3px}.redirect-badge span:hover{color:white;background-color:#333}.redirect-badge:not(:last-child){margin-right:5px}\n',""]),e.exports=t},function(e,t,n){var r=n(3),o=n(55);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},function(e,t,n){(t=n(4)(!1)).push([e.i,'.redirect-multioption .redirect-popover__content{padding:10px 10px;white-space:nowrap;box-sizing:border-box}.redirect-multioption .redirect-popover__content h4{margin-top:5px}.redirect-multioption .redirect-popover__content h5{margin-top:3px;margin-bottom:6px;text-transform:uppercase;color:#999}.redirect-multioption .redirect-popover__content p{margin:2px 0 0.8em !important}.redirect-multioption .redirect-popover__content p:first-child{margin-top:0}.redirect-multioption .redirect-popover__content p:last-child{margin-bottom:0 !important}.redirect-multioption .redirect-popover__content label{display:inline-block;width:100%}.button.redirect-multioption__button,.redirect-multioption__button{box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;box-shadow:none;height:30px;max-width:500px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background-color:#fff;border-color:#7e8993;color:#32373c}.button.redirect-multioption__button svg,.redirect-multioption__button svg{margin-left:5px;margin-right:-4px;display:inline-block;fill:#888;border-left:1px solid #ddd;padding-left:5px}.button.redirect-multioption__button h5,.redirect-multioption__button h5{padding:0;margin:0;margin-right:10px;font-size:13px;font-weight:normal}.button.redirect-multioption__button .redirect-badge,.redirect-multioption__button .redirect-badge{line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.actions .button.redirect-multioption__button{height:28px}.actions .redirect-multioption__button .redirect-badge{margin-top:-1px}.redirect-multioption__button.redirect-multioption__button_enabled{background-color:#fff}.redirect-multioption__button.redirect-multioption__button_enabled svg{transform:rotate(180deg);border-right:1px solid #ddd;border-left:1px solid transparent;padding-right:4px;padding-left:0}.redirect-multioption__group{margin-bottom:20px}.redirect-multioption__group:last-child{margin-bottom:10px}.branch-4-9 .redirect-dropdownbutton .button,.branch-4-9 .button.redirect-multioption__button,.branch-5-0 .redirect-dropdownbutton .button,.branch-5-0 .button.redirect-multioption__button,.branch-5-1 .redirect-dropdownbutton .button,.branch-5-1 .button.redirect-multioption__button,.branch-5-2 .redirect-dropdownbutton .button,.branch-5-2 .button.redirect-multioption__button{border-color:#ddd}.branch-4-9 input[type="search"],.branch-5-0 input[type="search"],.branch-5-1 input[type="search"],.branch-5-2 input[type="search"]{height:30px}.branch-4-9 .redirect-multioption__button .redirect-badge,.branch-4-9 .redirect-multioption,.branch-4-9 .actions .redirect-multioption__button .redirect-badge,.branch-5-0 .redirect-multioption__button .redirect-badge,.branch-5-0 .redirect-multioption,.branch-5-0 .actions .redirect-multioption__button .redirect-badge,.branch-5-1 .redirect-multioption__button .redirect-badge,.branch-5-1 .redirect-multioption,.branch-5-1 .actions .redirect-multioption__button .redirect-badge,.branch-5-2 .redirect-multioption__button .redirect-badge,.branch-5-2 .redirect-multioption,.branch-5-2 .actions .redirect-multioption__button .redirect-badge{margin-top:1px !important}.actions .redirect-popover__content{margin-top:-1px}.redirect-multioption{padding:0 10px}.redirect-multioption p{white-space:nowrap}\n',""]),e.exports=t},function(e,t,n){var r=n(3),o=n(57);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},function(e,t,n){(t=n(4)(!1)).push([e.i,'.searchregex-replace__input{display:flex;width:100%;align-items:flex-start}.searchregex-replace__input input[type="text"]{width:100%}.searchregex-replace__input select{margin-left:10px}.searchregex-replace__input textarea{width:100%;margin-left:1px;margin-right:1px;padding:4px 8px}.redirect-popover__content .searchregex-replace__action{display:flex;justify-content:space-between;align-items:center;margin-top:10px;margin-left:10px}.redirect-popover__content .searchregex-replace__action p{color:#999;margin:0}.searchregex-replace__modal{padding:13px 10px;width:450px}.searchregex-replace__modal input[type="text"]{width:75%}.searchregex-replace__modal select{width:25%}.searchregex-replace__modal p.searchregex-replace__actions{text-align:right;margin-bottom:0}.searchregex-replace__modal p.searchregex-replace__actions input{margin-left:10px}.searchregex-replace__modal textarea{width:75%}\n',""]),e.exports=t},function(e,t,n){var r=n(3),o=n(59);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},function(e,t,n){(t=n(4)(!1)).push([e.i,".spinner-container{display:inline-block;position:relative}.css-spinner{position:absolute;left:10px;top:-25px;display:block;width:40px;height:40px;background-color:#333;border-radius:100%;-webkit-animation:sk-scaleout 1.0s infinite ease-in-out;animation:sk-scaleout 1.0s infinite ease-in-out}@-webkit-keyframes sk-scaleout{0%{-webkit-transform:scale(0)}100%{-webkit-transform:scale(1);opacity:0}}@keyframes sk-scaleout{0%{transform:scale(0)}100%{transform:scale(1);opacity:0}}.spinner-small .css-spinner{width:20px;height:20px;top:-15px;left:5px}\n",""]),e.exports=t},function(e,t,n){var r=n(3),o=n(61);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},function(e,t,n){(t=n(4)(!1)).push([e.i,".searchregex-result__replaced,.searchregex-result__highlight{background-color:yellow;font-weight:bold;padding:1px;cursor:pointer}.searchregex-result__replaced{background-color:orange;display:inline}.searchregex-result__deleted{background-color:red;color:white}.searchregex-match{display:flex;align-items:flex-start;justify-content:flex-start;line-height:2}.searchregex-match .searchregex-match__column{margin-right:10px;background-color:#ddd;padding:0 5px;border-radius:3px;margin-bottom:5px}\n",""]),e.exports=t},function(e,t,n){var r=n(3),o=n(63);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},function(e,t,n){(t=n(4)(!1)).push([e.i,"body.redirection-modal_shown{overflow:hidden}.redirection-modal_wrapper{width:100%}.redirection-modal_backdrop{width:100%;height:100%;position:fixed;top:0;left:0;z-index:10000;background-color:rgba(255,255,255,0.4)}.redirection-modal_main{position:fixed;top:0;left:0;height:100%;width:100%;z-index:10000;align-items:center;flex-grow:1;display:flex;flex-direction:row;justify-content:center}.redirection-modal_main .redirect-click-outside{min-height:100px;max-width:90%;max-height:90%;min-width:60%}.redirection-modal_main .redirection-modal_content{position:relative;background:#fff;opacity:1;border:1px solid #e2e4e7;box-shadow:0 3px 30px rgba(25,30,35,0.2);transition:height 0.05s ease;min-height:100px;max-width:90%;max-height:90%;min-width:60%;margin:0 auto}.redirection-modal_main .redirection-modal_content h1{margin:0 !important;color:#333 !important}.redirection-modal_main .redirection-modal_close button{position:absolute;top:0;right:0;padding-top:10px;padding-right:10px;border:none;background-color:#fff;border-radius:2px;cursor:pointer;z-index:10001}.redirection-modal_wrapper.redirection-modal_wrapper-padless .redirection-modal_content{padding:20px}.redirection-modal_wrapper-padding .redirection-modal_content{padding:10px}.redirection-modal_error h2{text-align:center}.redirection-modal_loading{display:flex;height:100px}.redirection-modal_loading>*{justify-content:center;align-self:center;margin-left:calc(50% - 30px);margin-top:40px}@media screen and (max-width: 782px){.redirection-modal_main .redirection-modal_content{width:80%;margin-right:10%}}\n",""]),e.exports=t},function(e,t,n){var r=n(3),o=n(65);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},function(e,t,n){(t=n(4)(!1)).push([e.i,".searchregex-editor{padding:5px}.searchregex-editor textarea{width:100%;min-height:150px;margin-bottom:10px}.searchregex-editor h2{margin-top:0}.searchregex-editor .searchregex-editor__actions{display:flex;justify-content:space-between}.searchregex-editor button.button-primary{margin-right:10px}.searchregex-editor .css-spinner{margin-left:-50px;height:24px;width:24px;margin-top:12px}\n",""]),e.exports=t},function(e,t,n){var r=n(3),o=n(67);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},function(e,t,n){(t=n(4)(!1)).push([e.i,".searchregex-result__more{font-style:italic}.searchregex-result__updating{-webkit-animation:loading-fade 1.6s ease-in-out infinite;animation:loading-fade 1.6s ease-in-out infinite}.searchregex-result__updating .css-spinner{width:24px;height:24px;margin-top:10px}.searchregex-result h2{margin:0;padding:0;margin-bottom:10px;font-weight:normal;font-size:1.2em}\n",""]),e.exports=t},function(e,t,n){var r=n(3),o=n(69);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},function(e,t,n){(t=n(4)(!1)).push([e.i,".tablenav-pages{display:flex;justify-content:space-between;align-items:center;padding:10px}.pagination-links{display:flex;align-items:center}.pagination-links .button{margin:0 2px}.pagination-links .paging-input{margin:0 4px}.pagination-links .tablenav-paging-text{margin:0 5px}\n",""]),e.exports=t},function(e,t,n){var r=n(3),o=n(71);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},function(e,t,n){(t=n(4)(!1)).push([e.i,".searchregex-result__table{width:100px}.searchregex-result__row{width:50px}.searchregex-result__matches{width:70px}.searchregex-result__column{width:100px}.searchregex-result__action{width:200px}\n",""]),e.exports=t},function(e,t,n){var r=n(3),o=n(73);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},function(e,t,n){(t=n(4)(!1)).push([e.i,".searchregex-replaceall{margin-top:50px}.searchregex-replaceall__progress{position:relative}.searchregex-replaceall__status{position:absolute;top:0;left:0;width:100%;text-align:center;font-size:18px;font-weight:bold;margin-top:20px}\n",""]),e.exports=t},function(e,t,n){var r=n(3),o=n(75);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},function(e,t,n){(t=n(4)(!1)).push([e.i,'.searchregex-loading{opacity:0.8;-webkit-animation:loading-fade 1.6s ease-in-out infinite;animation:loading-fade 1.6s ease-in-out infinite}.searchregex-search table{table-layout:fixed;width:100%}.searchregex-search th{text-align:left;width:80px;vertical-align:top;padding-top:5px}.searchregex-search td{width:100%}.searchregex-search .inline-error{margin-top:20px}.searchregex-search__search td{display:flex;justify-content:flex-start;align-items:flex-start}.searchregex-search__search input[type="text"]{width:100%}.searchregex-search__search .redirect-popover__toggle,.searchregex-search__search select{margin-left:10px}.searchregex-search__replace,.searchregex-search__search,.searchregex-search__source{width:100%;margin-bottom:10px}.searchregex-search__replace>label,.searchregex-search__search>label,.searchregex-search__source>label{font-weight:bold;width:60px}.searchregex-search__replace .redirect-popover__toggle button,.searchregex-search__search .redirect-popover__toggle button,.searchregex-search__source .redirect-popover__toggle button{min-width:150px;margin-right:2px}.searchregex-search__replace select,.searchregex-search__search select,.searchregex-search__source select{min-width:150px;margin-right:0}.searchregex-search__source select{margin-right:10px}.searchregex-search__source td{display:flex;align-items:center}.searchregex-search__source__description{margin-left:5px}.searchregex-search__action{margin-top:10px}.searchregex-search__action input.button{margin-right:10px}.searchregex-search__action .css-spinner{width:28px;height:28px;margin-top:10px}\n',""]),e.exports=t},function(e,t,n){var r=n(3),o=n(77);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},function(e,t,n){(t=n(4)(!1)).push([e.i,".api-result-retry{float:right;clear:both}.api-result-log{background-color:#ddd;padding:5px 10px;color:#111;margin:10px 0;position:relative}.api-result-log .api-result-method_fail{color:white;background-color:#ff3860;padding:3px 5px;margin-right:5px}.api-result-log .api-result-method_pass{color:white;background-color:#4ab866;padding:3px 5px;width:150px;margin-right:5px}.api-result-log .dashicons{vertical-align:middle;width:26px;height:26px;font-size:26px;padding:0}.api-result-log .dashicons-no{color:#ff3860}.api-result-log .dashicons-yes{color:#4ab866}.api-result-log pre{background-color:#ccc;padding:10px 15px}.api-result-log pre{font-family:'Courier New', Courier, monospace}.api-result-log code{background-color:transparent}.api-result-log h4{margin:0;margin-top:5px;font-size:14px}.api-result-log_details{display:flex}.api-result-log_details>div{width:95%}.api-result-log_details a{color:#111}.api-result-log_details a:hover{font-weight:bold}.api-result-log_details pre{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}.api-result-hide{position:absolute;bottom:25px;right:5%}.api-result-select{position:absolute;right:10px;top:15px}.api-result-select span{background-color:#777;color:white;padding:5px 10px;margin-left:10px}.api-result-header{display:flex;align-items:center}.api-result-header .api-result-progress{margin:0 15px}.api-result-header .css-spinner{width:18px;height:18px;top:-14px}.api-result-header .api-result-status{text-align:center;top:0;left:0;padding:5px 10px;background-color:#ddd;font-weight:bold}.api-result-header .api-result-status_good{background-color:#4ab866;color:white}.api-result-header .api-result-status_problem{background-color:#f0b849}.api-result-header .api-result-status_failed{background-color:#ff3860;color:white}\n",""]),e.exports=t},function(e,t,n){var r=n(3),o=n(79);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},function(e,t,n){(t=n(4)(!1)).push([e.i,".red-error{background:#fff;border-left:4px solid #fff;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);margin:5px 15px 2px;padding:1px 12px;border-left-color:#dc3232;margin:5px 0 15px;margin-top:2em}.red-error .closer{float:right;padding-top:5px;font-size:18px;cursor:pointer;color:#333}.red-error textarea{font-family:courier,Monaco,monospace;font-size:12px;background-color:#eee;width:100%}.red-error span code{background-color:transparent}.red-error h3{font-size:1.2em}\n",""]),e.exports=t},function(e,t,n){var r=n(3),o=n(81);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},function(e,t,n){(t=n(4)(!1)).push([e.i,".redirection-notice{position:fixed;bottom:25px;right:0;font-weight:bold;box-shadow:3px 3px 3px rgba(0,0,0,0.2);border-top:1px solid #eee;cursor:pointer;transition:width 1s ease-in-out}.redirection-notice p{padding-right:20px}.redirection-notice .closer{position:absolute;right:5px;top:10px;font-size:16px;opacity:0.8}.redirection-notice.notice-shrunk{width:20px}.redirection-notice.notice-shrunk p{font-size:16px}.redirection-notice.notice-shrunk .closer{display:none}\n",""]),e.exports=t},function(e,t,n){var r=n(3),o=n(83);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},function(e,t,n){(t=n(4)(!1)).push([e.i,'.subsubsub-container::before,.subsubsub-container::after{content:"";display:table}.subsubsub-container::after{clear:both}\n',""]),e.exports=t},function(e,t,n){var r=n(3),o=n(85);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},function(e,t,n){(t=n(4)(!1)).push([e.i,'.wp-core-ui .button-delete{box-shadow:none;text-shadow:none;background-color:#ff3860;border-color:transparent;color:#fff}.wp-core-ui .button-delete:hover{background-color:#ff3860;border-color:transparent;box-shadow:none;text-shadow:none}.inline-notice{background:#fff;border-left:4px solid #fff;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);margin:5px 15px 2px;padding:5px 12px;margin:5px 0 15px;border-left-color:#ffb900}.inline-notice.inline-general{border-left-color:#46b450}.inline-error{border-color:red}.addTop{margin-top:20px}@media screen and (max-width: 782px){.newsletter form input[type="email"]{display:block;width:100%;margin:5px 0}.import select{width:100%;margin:5px 0}.plugin-importer button{width:100%}p.search-box input[name="s"]{margin-top:20px}}.module-export{border:1px solid #ddd;padding:5px;font-family:courier,Monaco,monospace;margin-top:15px;width:100%;background-color:white !important}.redirect-edit .table-actions{margin-left:1px;margin-top:2px;display:flex;align-items:center;justify-content:flex-start}.redirect-edit .table-actions .redirection-edit_advanced{text-decoration:none;font-size:16px}.redirect-edit .table-actions .redirection-edit_advanced svg{padding-top:2px}.error{padding-bottom:10px !important}.notice{display:block !important}.database-switch{float:right}.database-switch a{color:#444;text-decoration:none}.database-switch a:hover{text-decoration:underline}\n',""]),e.exports=t},function(e,t,n){"use strict";n.r(t);var r=n(17),o=n.n(r),a="URLSearchParams"in self,i="Symbol"in self&&"iterator"in Symbol,l="FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(e){return!1}}(),u="FormData"in self,c="ArrayBuffer"in self;if(c)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function p(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function d(e){return"string"!=typeof e&&(e=String(e)),e}function h(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i&&(t[Symbol.iterator]=function(){return t}),t}function m(e){this.map={},e instanceof m?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function g(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function y(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function b(e){var t=new FileReader,n=y(t);return t.readAsArrayBuffer(e),n}function v(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function w(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:l&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:u&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:a&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():c&&l&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=v(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c&&(ArrayBuffer.prototype.isPrototypeOf(e)||f(e))?this._bodyArrayBuffer=v(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l&&(this.blob=function(){var e=g(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?g(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(b)}),this.text=function(){var e,t,n,r=g(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=y(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},u&&(this.formData=function(){return this.text().then(_)}),this.json=function(){return this.text().then(JSON.parse)},this}m.prototype.append=function(e,t){e=p(e),t=d(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},m.prototype.delete=function(e){delete this.map[p(e)]},m.prototype.get=function(e){return e=p(e),this.has(e)?this.map[e]:null},m.prototype.has=function(e){return this.map.hasOwnProperty(p(e))},m.prototype.set=function(e,t){this.map[p(e)]=d(t)},m.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},m.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),h(e)},m.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),h(e)},m.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),h(e)},i&&(m.prototype[Symbol.iterator]=m.prototype.entries);var E=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function x(e,t){var n,r,o=(t=t||{}).body;if(e instanceof x){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new m(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new m(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),E.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function _(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}})),t}function S(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new m(t.headers),this.url=t.url||"",this._initBody(e)}x.prototype.clone=function(){return new x(this,{body:this._bodyInit})},w.call(x.prototype),w.call(S.prototype),S.prototype.clone=function(){return new S(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new m(this.headers),url:this.url})},S.error=function(){var e=new S(null,{status:0,statusText:""});return e.type="error",e};var O=[301,302,303,307,308];S.redirect=function(e,t){if(-1===O.indexOf(t))throw new RangeError("Invalid status code");return new S(null,{status:t,headers:{location:e}})};var k=self.DOMException;try{new k}catch(e){(k=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),k.prototype.constructor=k}function P(e,t){return new Promise((function(n,r){var o=new x(e,t);if(o.signal&&o.signal.aborted)return r(new k("Aborted","AbortError"));var a=new XMLHttpRequest;function i(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new m,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var o="response"in a?a.response:a.responseText;n(new S(o,r))},a.onerror=function(){r(new TypeError("Network request failed"))},a.ontimeout=function(){r(new TypeError("Network request failed"))},a.onabort=function(){r(new k("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&l&&(a.responseType="blob"),o.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),o.signal&&(o.signal.addEventListener("abort",i),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",i)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}P.polyfill=!0,self.fetch||(self.fetch=P,self.Headers=m,self.Request=x,self.Response=S),!window.Promise&&(window.Promise=o.a),Array.from||(Array.from=function(e){return[].slice.call(e)}),"function"!=typeof Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),n=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var r=arguments[1],o=0;o<n;){var a=t[o];if(e.call(r,a,o,t))return a;o++}}});var T=n(0),j=n.n(T),C=n(6),R=n.n(C),N=n(1),A=n.n(N),I=n(2),D=n.n(I),L=j.a.createContext(null);var F=function(e){e()},M={notify:function(){}};function z(){var e=F,t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}var U=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=M,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=z())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=M)},e}();var H=function(e){var t=e.store,n=e.context,r=e.children,o=Object(T.useMemo)((function(){var e=new U(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),a=Object(T.useMemo)((function(){return t.getState()}),[t]);Object(T.useEffect)((function(){var e=o.subscription;return e.trySubscribe(),a!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[o,a]);var i=n||L;return j.a.createElement(i.Provider,{value:o},r)};function W(){return(W=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)}function B(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}var $=n(11),V=n.n($),q=n(10),Q="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?T.useLayoutEffect:T.useEffect,G=[],K=[null,null];function Y(e,t){var n=e[1];return[t.payload,n+1]}function X(e,t,n){Q((function(){return e.apply(void 0,t)}),n)}function J(e,t,n,r,o,a,i){e.current=r,t.current=o,n.current=!1,a.current&&(a.current=null,i())}function Z(e,t,n,r,o,a,i,l,u,c){if(e){var s=!1,f=null,p=function(){if(!s){var e,n,p=t.getState();try{e=r(p,o.current)}catch(e){n=e,f=e}n||(f=null),e===a.current?i.current||u():(a.current=e,l.current=e,i.current=!0,c({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=p,n.trySubscribe(),p();return function(){if(s=!0,n.tryUnsubscribe(),n.onStateChange=null,f)throw f}}}var ee=function(){return[null,0]};function te(e,t){void 0===t&&(t={});var n=t,r=n.getDisplayName,o=void 0===r?function(e){return"ConnectAdvanced("+e+")"}:r,a=n.methodName,i=void 0===a?"connectAdvanced":a,l=n.renderCountProp,u=void 0===l?void 0:l,c=n.shouldHandleStateChanges,s=void 0===c||c,f=n.storeKey,p=void 0===f?"store":f,d=(n.withRef,n.forwardRef),h=void 0!==d&&d,m=n.context,g=void 0===m?L:m,y=B(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),b=g;return function(t){var n=t.displayName||t.name||"Component",r=o(n),a=W({},y,{getDisplayName:o,methodName:i,renderCountProp:u,shouldHandleStateChanges:s,storeKey:p,displayName:r,wrappedComponentName:n,WrappedComponent:t}),l=y.pure;var c=l?T.useMemo:function(e){return e()};function f(n){var r=Object(T.useMemo)((function(){var e=n.forwardedRef,t=B(n,["forwardedRef"]);return[n.context,e,t]}),[n]),o=r[0],i=r[1],l=r[2],u=Object(T.useMemo)((function(){return o&&o.Consumer&&Object(q.isContextConsumer)(j.a.createElement(o.Consumer,null))?o:b}),[o,b]),f=Object(T.useContext)(u),p=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(f)&&Boolean(f.store);var d=p?n.store:f.store,h=Object(T.useMemo)((function(){return function(t){return e(t.dispatch,a)}(d)}),[d]),m=Object(T.useMemo)((function(){if(!s)return K;var e=new U(d,p?null:f.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[d,p,f]),g=m[0],y=m[1],v=Object(T.useMemo)((function(){return p?f:W({},f,{subscription:g})}),[p,f,g]),w=Object(T.useReducer)(Y,G,ee),E=w[0][0],x=w[1];if(E&&E.error)throw E.error;var _=Object(T.useRef)(),S=Object(T.useRef)(l),O=Object(T.useRef)(),k=Object(T.useRef)(!1),P=c((function(){return O.current&&l===S.current?O.current:h(d.getState(),l)}),[d,E,l]);X(J,[S,_,k,l,P,O,y]),X(Z,[s,d,g,h,S,_,k,O,y,x],[d,g,h]);var C=Object(T.useMemo)((function(){return j.a.createElement(t,W({},P,{ref:i}))}),[i,t,P]);return Object(T.useMemo)((function(){return s?j.a.createElement(u.Provider,{value:v},C):C}),[u,C,v])}var d=l?j.a.memo(f):f;if(d.WrappedComponent=t,d.displayName=r,h){var m=j.a.forwardRef((function(e,t){return j.a.createElement(d,W({},e,{forwardedRef:t}))}));return m.displayName=r,m.WrappedComponent=t,V()(m,t)}return V()(d,t)}}function ne(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function re(e,t){if(ne(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!ne(e[n[o]],t[n[o]]))return!1;return!0}var oe=n(7);function ae(e){return function(t,n){var r=e(t,n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function ie(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function le(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=ie(e);var o=r(t,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=ie(o),o=r(t,n)),o},r}}var ue=[function(e){return"function"==typeof e?le(e):void 0},function(e){return e?void 0:ae((function(e){return{dispatch:e}}))},function(e){return e&&"object"==typeof e?ae((function(t){return Object(oe.bindActionCreators)(e,t)})):void 0}];var ce=[function(e){return"function"==typeof e?le(e):void 0},function(e){return e?void 0:ae((function(){return{}}))}];function se(e,t,n){return W({},n,{},e,{},t)}var fe=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r,o=n.pure,a=n.areMergedPropsEqual,i=!1;return function(t,n,l){var u=e(t,n,l);return i?o&&a(u,r)||(r=u):(i=!0,r=u),r}}}(e):void 0},function(e){return e?void 0:function(){return se}}];function pe(e,t,n,r){return function(o,a){return n(e(o,a),t(r,a),a)}}function de(e,t,n,r,o){var a,i,l,u,c,s=o.areStatesEqual,f=o.areOwnPropsEqual,p=o.areStatePropsEqual,d=!1;function h(o,d){var h,m,g=!f(d,i),y=!s(o,a);return a=o,i=d,g&&y?(l=e(a,i),t.dependsOnOwnProps&&(u=t(r,i)),c=n(l,u,i)):g?(e.dependsOnOwnProps&&(l=e(a,i)),t.dependsOnOwnProps&&(u=t(r,i)),c=n(l,u,i)):y?(h=e(a,i),m=!p(h,l),l=h,m&&(c=n(l,u,i)),c):c}return function(o,s){return d?h(o,s):(l=e(a=o,i=s),u=t(r,i),c=n(l,u,i),d=!0,c)}}function he(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,o=t.initMergeProps,a=B(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),i=n(e,a),l=r(e,a),u=o(e,a);return(a.pure?de:pe)(i,l,u,e,a)}function me(e,t,n){for(var r=t.length-1;r>=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function ge(e,t){return e===t}function ye(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?te:n,o=t.mapStateToPropsFactories,a=void 0===o?ce:o,i=t.mapDispatchToPropsFactories,l=void 0===i?ue:i,u=t.mergePropsFactories,c=void 0===u?fe:u,s=t.selectorFactory,f=void 0===s?he:s;return function(e,t,n,o){void 0===o&&(o={});var i=o,u=i.pure,s=void 0===u||u,p=i.areStatesEqual,d=void 0===p?ge:p,h=i.areOwnPropsEqual,m=void 0===h?re:h,g=i.areStatePropsEqual,y=void 0===g?re:g,b=i.areMergedPropsEqual,v=void 0===b?re:b,w=B(i,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),E=me(e,a,"mapStateToProps"),x=me(t,l,"mapDispatchToProps"),_=me(n,c,"mergeProps");return r(f,W({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:E,initMapDispatchToProps:x,initMergeProps:_,pure:s,areStatesEqual:d,areOwnPropsEqual:m,areStatePropsEqual:y,areMergedPropsEqual:v},w))}}var be=ye();var ve;ve=C.unstable_batchedUpdates,F=ve;var we=n(19);function Ee(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,r,e):t(o)}}}}var xe=Ee();xe.withExtraArgument=Ee;var _e=xe,Se="STATUS_IN_PROGRESS",Oe="STATUS_COMPLETE";function ke(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ke(Object(n),!0).forEach((function(t){Te(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ke(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Te(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function je(e,t,n,r){var o=e[t]?Pe({},e[t]):[];return o[n]=r,Te({},t,o)}var Ce="SEARCH_FAIL";function Re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ne(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Re(Object(n),!0).forEach((function(t){Ae(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ae(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ie=function(e,t,n){return"forward"===n&&!1===e.progress.next||"backward"===n&&!1===e.progress.previous||t.length===e.perPage};function De(e,t){return e.search.searchFlags.regex?function(e,t){var n,r,o,a,i="forward"===e.searchDirection?e.results.concat(t.results):t.results.concat(e.results);return Ne(Ne({},e),{},{status:Ie(t,i,e.searchDirection)?Oe:e.status,results:i,requestCount:e.requestCount+1,progress:(n=e.progress,r=t.progress,o=e.searchDirection,a=0===e.requestCount,Ne(Ne({},n),{},{current:r.current,next:"forward"===o||a?r.next:n.next,previous:"backward"===o||a?r.previous:n.previous,rows:(n.rows?n.rows:0)+r.rows})),totals:Ne(Ne({},e.totals),t.totals),canCancel:!1,showLoading:!1})}(e,t):function(e,t){return Ne(Ne({},e),{},{status:Oe,results:t.results,progress:t.progress,totals:t.totals?Ne(Ne({},e.totals),t.totals):e.totals,canCancel:!1,showLoading:!1})}(e,t)}var Le=function(){return Ne(Ne({},Fe()),{},{results:[],totals:[],progress:{}})},Fe=function(){return{requestCount:0,searchedPhrase:"",replaceCount:0,phraseCount:0,status:null,replacing:[],replaceAll:!1,row:null,canCancel:!1,showLoading:!1}};function Me(e,t){var n=t.results.rows+e.replaceCount,r=t.totals.matched_rows?t.totals.matched_rows:t.totals.rows?t.totals.rows:e.totals.rows;return!1===t.progress.next||n>=r||e.totals.matched_rows>0&&n>=e.totals.matched_rows}var ze=function(e){return e.status===Oe||null===e.status};function Ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function He(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ue(Object(n),!0).forEach((function(t){We(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ue(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function We(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Be=function(e,t){return e.slice(0).concat([t])},$e=function(e,t){return e.slice(0).concat([t])},Ve=function(e){return Math.max(0,e.inProgress-1)},qe={SETTING_SAVED:Object(N.translate)("Settings saved"),SEARCH_DELETE_COMPLETE:Object(N.translate)("Row deleted"),SEARCH_REPLACE_COMPLETE:Object(N.translate)("Row replaced"),SEARCH_SAVE_ROW_COMPLETE:Object(N.translate)("Row updated")};var Qe=Object(oe.combineReducers)({settings:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SETTING_API_TRY":return Pe(Pe({},e),{},{apiTest:Pe(Pe({},e.apiTest),je(e.apiTest,t.id,t.method,{status:"loading"}))});case"SETTING_API_SUCCESS":return Pe(Pe({},e),{},{apiTest:Pe(Pe({},e.apiTest),je(e.apiTest,t.id,t.method,{status:"ok"}))});case"SETTING_API_FAILED":return Pe(Pe({},e),{},{apiTest:Pe(Pe({},e.apiTest),je(e.apiTest,t.id,t.method,{status:"fail",error:t.error}))});case"SETTING_LOAD_START":return Pe(Pe({},e),{},{loadStatus:Se});case"SETTING_LOAD_SUCCESS":return Pe(Pe({},e),{},{loadStatus:Oe,values:t.values});case"SETTING_LOAD_FAILED":return Pe(Pe({},e),{},{loadStatus:"STATUS_FAILED",error:t.error});case"SETTING_SAVING":return Pe(Pe({},e),{},{saveStatus:Se,warning:!1});case"SETTING_SAVED":return Pe(Pe({},e),{},{saveStatus:Oe,values:t.values,warning:!!t.warning&&t.warning});case"SETTING_SAVE_FAILED":return Pe(Pe({},e),{},{saveStatus:"STATUS_FAILED",error:t.error});case"SETTING_LOAD_STATUS":return Pe(Pe({},e),{},{pluginStatus:t.pluginStatus})}return e},search:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SEARCH_VALUES":return Ne(Ne({},e),{},{search:Ne(Ne({},e.search),t.searchValue),results:void 0!==t.searchValue.replacement?e.results:[],status:void 0!==t.searchValue.replacement?e.status:null});case"SEARCH_CANCEL":return t.clearAll?Ne(Ne({},e),Le()):Ne(Ne({},e),Fe());case"SEARCH_START_FRESH":return Ne(Ne({},e),{},{requestCount:0,status:Se,totals:0===t.page?[]:e.totals,progress:0===t.page?[]:e.progress,results:[],searchDirection:t.searchDirection,searchedPhrase:t.replacement,showLoading:!0});case"SEARCH_START_MORE":return Ne(Ne({},e),{},{canCancel:!0,showLoading:!0});case"SEARCH_COMPLETE":return ze(e)?e:De(e,t);case"SEARCH_REPLACE_COMPLETE":return ze(e)?e:Ne(Ne({},De(Ne(Ne({},e),{},{results:[]}),t)),{},{replacing:e.replacing.filter((function(e){return e!==t.rowId}))});case"SEARCH_REPLACE_ALL":return Ne(Ne(Ne({},e),Le()),{},{replaceAll:!0,status:Se,canCancel:!0});case"SEARCH_REPLACE_ALL_COMPLETE":return ze(e)?e:Ne(Ne({},e),{},{replaceCount:t.results.rows+e.replaceCount,phraseCount:t.results.phrases+e.phraseCount,requestCount:!1===t.progress.next?0:e.requestCount+1,progress:t.progress,totals:Ne(Ne({},e.totals),t.totals),status:Me(e,t)?Oe:Se});case"SEARCH_SAVE_ROW_COMPLETE":return Ne(Ne({},e),{},{status:Oe,replacing:e.replacing.filter((function(e){return e!==t.rowId})),results:e.results.map((function(e){return e.row_id===t.result.row_id?t.result:e})),rawData:null});case"SEARCH_LOAD_ROW_COMPLETE":return Ne(Ne({},e),{},{replacing:e.replacing.filter((function(e){return e!==t.rowId})),status:Oe,rawData:t.row});case"SEARCH_REPLACE_ROW":return Ne(Ne({},e),{},{replacing:e.replacing.concat(t.rowId),status:Se,rawData:null});case Ce:return Ne(Ne(Ne({},e),Fe()),{},{status:"STATUS_FAILED"});case"SEARCH_DELETE_COMPLETE":return Ne(Ne({},e),{},{results:e.results.filter((function(e){return e.row_id!==t.rowId})),replacing:e.replacing.filter((function(e){return e!==t.rowId})),status:Oe})}return e},message:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ce:case"SETTING_LOAD_FAILED":case"SETTING_SAVE_FAILED":var n=Be(e.errors,t.error);return console.error(t.error.message),He(He({},e),{},{errors:n,inProgress:Ve(e)});case"SEARCH_REPLACE_ROW":case"SETTING_SAVING":return He(He({},e),{},{inProgress:e.inProgress+1});case"SEARCH_REPLACE_COMPLETE":case"SEARCH_DELETE_COMPLETE":case"SEARCH_SAVE_ROW_COMPLETE":case"SETTING_SAVED":return He(He({},e),{},{notices:$e(e.notices,qe[t.type]),inProgress:Ve(e)});case"MESSAGE_CLEAR_NOTICES":return He(He({},e),{},{notices:[]});case"MESSAGE_CLEAR_ERRORS":return He(He({},e),{},{errors:[]})}return e}}),Ge=n(8),Ke=n.n(Ge),Ye=["search","options","support"];function Xe(e,t){var n=function(e,t,n){var r=Je(n);for(var o in e)e[o]&&t[o]!==e[o]?r[o.toLowerCase()]=e[o]:t[o]===e[o]&&delete r[o.toLowerCase()];return"?"+Ge.stringify(r)}(e,t);document.location.search!==n&&history.pushState({},null,n)}function Je(e){return Ge.parse(e?e.slice(1):document.location.search.slice(1))}function Ze(e){var t=Je(e);return-1!==Ye.indexOf(t.sub)?t.sub:"search"}var et=Object(we.composeWithDevTools)({name:"Search Regex"}),tt=[_e,function(){return function(e){return function(t){switch(t.type){case"SEARCH_START_FRESH":!function(e){Xe({searchPhrase:e.searchPhrase,searchFlags:e.searchFlags,source:e.source,sourceFlags:e.sourceFlags,perPage:e.perPage},{searchPhrase:"",searchFlags:[],source:[],sourceFlags:[],perPage:25,sub:"search"})}(t)}return e(t)}}}];function nt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object(oe.createStore)(Qe,e,et(oe.applyMiddleware.apply(void 0,tt)));return t}function rt(){var e=SearchRegexi10n&&SearchRegexi10n.preload&&SearchRegexi10n.preload.pluginStatus?SearchRegexi10n.preload.pluginStatus:[];return{loadStatus:Se,saveStatus:!1,error:!1,pluginStatus:e,apiTest:{},database:SearchRegexi10n.database?SearchRegexi10n.database:{},values:SearchRegexi10n.settings?SearchRegexi10n.settings:{},api:SearchRegexi10n.api?SearchRegexi10n.api:[],warning:!1}}var ot=function(){return[{value:"regex",label:Object(N.translate)("Regular Expression")},{value:"case",label:Object(N.translate)("Ignore Case")}]},at=function(){return[{value:25,label:Object(N.translate)("25 per page ")},{value:50,label:Object(N.translate)("50 per page ")},{value:100,label:Object(N.translate)("100 per page")},{value:250,label:Object(N.translate)("250 per page")},{value:500,label:Object(N.translate)("500 per page")}]};function it(e,t,n){return t.find((function(t){return t.value===e||t.name===e}))?e:n}function lt(e,t){return e.filter((function(e){return it(e,t,!1)}))}function ut(e,t,n){return t[e[0]]?n.filter((function(n){return void 0!==t[e[0]][n]})):[]}function ct(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;return t}function st(e){var t,n,r=e.searchPhrase,o=e.searchFlags,a=e.sourceFlags,i=e.replacement,l=e.perPage,u=(t=SearchRegexi10n.preload.sources,n=e.source.length>0?e.source[0]:[],t.map((function(e){return it(n,e.sources)})).filter((function(e){return e})));return{searchPhrase:r,searchFlags:ct(lt(o,ot())),source:u,sourceFlags:ct(ut(u,SearchRegexi10n.preload.source_flags,a)),replacement:i,perPage:it(parseInt(l,10),at(),25)}}function ft(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ft(Object(n),!0).forEach((function(t){dt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ft(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function dt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ht=function(e){return Object.keys(e).filter((function(t){return e[t]||0===e[t]||!1===e[t]})).reduce((function(t,n){return t[n]=e[n],t}),{})},mt=function(){return SearchRegexi10n.api&&SearchRegexi10n.api.WP_API_root?SearchRegexi10n.api.WP_API_root:"/wp-json/"},gt=function(){return SearchRegexi10n.api.WP_API_nonce},yt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=mt()+"search-regex/v1/"+e+"/";if(t._wpnonce=gt(),t&&Object.keys(t).length>0&&(t=ht(t),Object.keys(t).length>0)){var r=n+(-1===mt().indexOf("?")?"?":"&")+Ke.a.stringify(t);return r}return n},bt=function(){return new Headers({Accept:"application/json, */*;q=0.1"})},vt=function(){return new Headers({"Content-Type":"application/json; charset=utf-8"})},wt=function(e){return{url:e,credentials:"same-origin"}},Et=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return pt(pt({headers:bt()},wt(yt(e,t))),{},{method:"get"})},xt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=pt(pt({headers:vt()},wt(yt(e,n))),{},{method:"post",params:t});return r.body="{}",Object.keys(t).length>0&&(r.body=JSON.stringify(t)),r},_t={get:function(){return Et("setting")},update:function(e){return xt("setting",e)}},St={get:function(e){return Et("search",e)},replace:function(e){return xt("replace",e)}},Ot={deleteRow:function(e,t){return xt("source/".concat(e,"/").concat(t,"/delete"))},loadRow:function(e,t){return Et("source/".concat(e,"/").concat(t))},saveRow:function(e,t,n){return xt("source/".concat(e,"/").concat(t),n)}},kt={checkApi:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t?xt("plugin/test",{test:"ping"}):Et("plugin/test");return n.url=n.url.replace(mt(),e).replace(/[\?&]_wpnonce=[a-f0-9]*/,""),n.url+=(-1===n.url.indexOf("?")?"?":"&")+"_wpnonce="+gt(),n}},Pt=function(e){return 0===e?"Admin AJAX returned 0":e.message?e.message:"Unknown error "+e},Tt=function(e){return e.error_code?e.error_code:e.data&&e.data.error_code?e.data.error_code:0===e?"admin-ajax":e.code?e.code:"unknown"},jt=function(e){return e.action=function(e){return e.url.replace(mt(),"").replace(/[\?&]_wpnonce=[a-f0-9]*/,"")+" "+e.method.toUpperCase()}(e),fetch(e.url,e).then((function(t){if(!t||!t.status)throw{message:"No data or status object returned in request",code:0};var n;return t.status&&void 0!==t.statusText&&(e.status=t.status,e.statusText=t.statusText),t.headers.get("x-wp-nonce")&&(n=t.headers.get("x-wp-nonce"),SearchRegexi10n.api.WP_API_nonce=n),t.text()})).then((function(t){e.raw=t;try{var n=JSON.parse(t.replace(/\ufeff/,""));if(e.status&&200!==e.status)throw{message:Pt(n),code:Tt(n),request:e,data:n.data?n.data:null};if(0===n)throw{message:"Failed to get data",code:"json-zero"};return n}catch(t){throw t.request=e,t.code=t.code||t.name,t}}))},Ct=(n(42),function(e){var t=e.title,n=e.url,r=void 0!==n&&n;return j.a.createElement("tr",null,j.a.createElement("th",null,!r&&t,r&&j.a.createElement("a",{href:r,target:"_blank"},t)),j.a.createElement("td",null,e.children))}),Rt=function(e){return j.a.createElement("table",{className:"form-table"},j.a.createElement("tbody",null,e.children))};function Nt(e){return(Nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var At=function e(t){var n=t.value,r=t.label;return"object"===Nt(n)?j.a.createElement("optgroup",{label:r},n.map((function(t,n){return j.a.createElement(e,{label:t.label,value:t.value,key:n})}))):j.a.createElement("option",{value:n},r)},It=function(e){var t=e.items,n=e.value,r=e.name,o=e.onChange,a=e.isEnabled,i=void 0===a||a;return j.a.createElement("select",{name:r,value:n,onChange:o,disabled:!i},t.map((function(e,t){return j.a.createElement(At,{value:e.value,label:e.label,key:t})})))};function Dt(e){return(Dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Lt(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)}}function Ft(e,t){return(Ft=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Mt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ht(e);if(t){var o=Ht(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return zt(this,n)}}function zt(e,t){return!t||"object"!==Dt(t)&&"function"!=typeof t?Ut(e):t}function Ut(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ht(e){return(Ht=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Wt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Bt=function(){return[{value:0,label:Object(N.translate)("Default REST API")},{value:1,label:Object(N.translate)("Raw REST API")},{value:3,label:Object(N.translate)("Relative REST API")}]},$t=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ft(e,t)}(a,e);var t,n,r,o=Mt(a);function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),Wt(Ut(t=o.call(this,e)),"onChange",(function(e){var n=e.target,r="checkbox"===n.type?n.checked:n.value;t.setState(Wt({},n.name,r))})),Wt(Ut(t),"onSubmit",(function(e){e.preventDefault(),t.props.onSaveSettings(t.state)})),t.state=e.values,t}return t=a,(n=[{key:"render",value:function(){var e=this.props.saveStatus;return j.a.createElement("form",{onSubmit:this.onSubmit},j.a.createElement(Rt,null,j.a.createElement(Ct,{title:""},j.a.createElement("label",null,j.a.createElement("input",{type:"checkbox",checked:this.state.support,name:"support",onChange:this.onChange}),j.a.createElement("span",{className:"sub"},Object(N.translate)("I'm a nice person and I have helped support the author of this plugin")))),j.a.createElement(Ct,{title:Object(N.translate)("REST API")},j.a.createElement(It,{items:Bt(),name:"rest_api",value:parseInt(this.state.rest_api,10),onChange:this.onChange}),"  ",j.a.createElement("span",{className:"sub"},Object(N.translate)("How Search Regex uses the REST API - don't change unless necessary")))),j.a.createElement("input",{className:"button-primary",type:"submit",name:"update",value:Object(N.translate)("Update"),disabled:e===Se}))}}])&&Lt(t.prototype,n),r&&Lt(t,r),a}(j.a.Component);var Vt=be((function(e){var t=e.settings;return{values:t.values,saveStatus:t.saveStatus}}),(function(e){return{onSaveSettings:function(t){e(function(e){return function(t){return jt(_t.update(e)).then((function(e){t({type:"SETTING_SAVED",values:e.settings,warning:e.warning})})).catch((function(e){t({type:"SETTING_SAVE_FAILED",error:e})})),t({type:"SETTING_SAVING",settings:e})}}(t))}}}))($t),qt=(n(44),function(){return j.a.createElement("div",{className:"placeholder-container"},j.a.createElement("div",{className:"placeholder-loading"}))});n(46);function Qt(e){return(Qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Gt(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)}}function Kt(e,t){return(Kt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Yt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Zt(e);if(t){var o=Zt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Xt(this,n)}}function Xt(e,t){return!t||"object"!==Qt(t)&&"function"!=typeof t?Jt(e):t}function Jt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zt(e){return(Zt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var en=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Kt(e,t)}(a,e);var t,n,r,o=Yt(a);function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=o.call(this,e)).onDonate=t.handleDonation.bind(Jt(t)),t.onChange=t.handleChange.bind(Jt(t)),t.onBlur=t.handleBlur.bind(Jt(t)),t.onInput=t.handleInput.bind(Jt(t)),t.state={support:e.support,amount:20},t}return t=a,(n=[{key:"handleBlur",value:function(){this.setState({amount:Math.max(16,this.state.amount)})}},{key:"handleDonation",value:function(){this.setState({support:!1})}},{key:"getReturnUrl",value:function(){return document.location.href+"#thanks"}},{key:"handleChange",value:function(e){this.state.amount!==e.value&&this.setState({amount:parseInt(e.value,10)})}},{key:"handleInput",value:function(e){var t=e.target.value?parseInt(e.target.value,10):16;this.setState({amount:t})}},{key:"getAmountoji",value:function(e){for(var t=[[100,"😍"],[80,"😎"],[60,"😊"],[40,"😃"],[20,"😀"],[10,"🙂"]],n=0;n<t.length;n++)if(e>=t[n][0])return t[n][1];return t[t.length-1][1]}},{key:"renderSupported",value:function(){return j.a.createElement("div",null,Object(N.translate)("You've supported this plugin - thank you!"),"  ",j.a.createElement("a",{href:"#",onClick:this.onDonate},Object(N.translate)("I'd like to support some more.")))}},{key:"renderUnsupported",value:function(){for(var e,t,n,r=(n="",(t=16)in(e={})?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e),o=20;o<=100;o+=20)r[o]="";return j.a.createElement("div",null,j.a.createElement("label",null,j.a.createElement("p",null,Object(N.translate)("Search Regex is free to use - life is wonderful and lovely! It has required a great deal of time and effort to develop and you can help support this development by {{strong}}making a small donation{{/strong}}.",{components:{strong:j.a.createElement("strong",null)}})," ",Object(N.translate)("You get useful software and I get to carry on making it better."))),j.a.createElement("input",{type:"hidden",name:"cmd",value:"_xclick"}),j.a.createElement("input",{type:"hidden",name:"business",value:"admin@urbangiraffe.com"}),j.a.createElement("input",{type:"hidden",name:"item_name",value:"Search Regex (WordPress Plugin)"}),j.a.createElement("input",{type:"hidden",name:"buyer_credit_promo_code",value:""}),j.a.createElement("input",{type:"hidden",name:"buyer_credit_product_category",value:""}),j.a.createElement("input",{type:"hidden",name:"buyer_credit_shipping_method",value:""}),j.a.createElement("input",{type:"hidden",name:"buyer_credit_user_address_change",value:""}),j.a.createElement("input",{type:"hidden",name:"no_shipping",value:"1"}),j.a.createElement("input",{type:"hidden",name:"return",value:this.getReturnUrl()}),j.a.createElement("input",{type:"hidden",name:"no_note",value:"1"}),j.a.createElement("input",{type:"hidden",name:"currency_code",value:"USD"}),j.a.createElement("input",{type:"hidden",name:"tax",value:"0"}),j.a.createElement("input",{type:"hidden",name:"lc",value:"US"}),j.a.createElement("input",{type:"hidden",name:"bn",value:"PP-DonationsBF"}),j.a.createElement("div",{className:"donation-amount"},"$",j.a.createElement("input",{type:"number",name:"amount",min:16,value:this.state.amount,onChange:this.onInput,onBlur:this.onBlur}),j.a.createElement("span",null,this.getAmountoji(this.state.amount)),j.a.createElement("input",{type:"submit",className:"button-primary",value:Object(N.translate)("Support 💰")})))}},{key:"render",value:function(){var e=this.state.support;return j.a.createElement("form",{action:"https://www.paypal.com/cgi-bin/webscr",method:"post",className:"donation"},j.a.createElement(Rt,null,j.a.createElement(Ct,{title:Object(N.translate)("Plugin Support")+":"},e?this.renderSupported():this.renderUnsupported())))}}])&&Gt(t.prototype,n),r&&Gt(t,r),a}(j.a.Component);function tn(e){return(tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rn(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)}}function on(e,t){return(on=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function an(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=un(e);if(t){var o=un(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ln(this,n)}}function ln(e,t){return!t||"object"!==tn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function un(e){return(un=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var cn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&on(e,t)}(a,e);var t,n,r,o=an(a);function a(){return nn(this,a),o.apply(this,arguments)}return t=a,(n=[{key:"componentDidMount",value:function(){this.props.onLoadSettings()}},{key:"render",value:function(){var e=this.props,t=e.loadStatus,n=e.values;return t!==Se&&n?j.a.createElement("div",null,t===Oe&&j.a.createElement(en,{support:n.support}),t===Oe&&j.a.createElement(Vt,null)):j.a.createElement(qt,null)}}])&&rn(t.prototype,n),r&&rn(t,r),a}(j.a.Component);var sn=be((function(e){var t=e.settings;return{loadStatus:t.loadStatus,values:t.values}}),(function(e){return{onLoadSettings:function(){e((function(e,t){return t().settings.loadStatus===Oe?null:(jt(_t.get()).then((function(t){e({type:"SETTING_LOAD_SUCCESS",values:t.settings})})).catch((function(t){e({type:"SETTING_LOAD_FAILED",error:t})})),e({type:"SETTING_LOAD_START"}))}))}}}))(cn),fn=function(e){var t=e.url,n=e.children;return j.a.createElement("a",{href:t,target:"_blank",rel:"noopener noreferrer"},n)},pn=function(){return j.a.createElement("div",null,j.a.createElement("h2",null,Object(N.translate)("Need more help?")),j.a.createElement("p",null,Object(N.translate)("Full documentation for Search Regex can be found at {{site}}https://searchregex.com{{/site}}.",{components:{site:j.a.createElement(fn,{url:"https://searchregex.com/support/"})}})),j.a.createElement("p",null,j.a.createElement("strong",null,Object(N.translate)("If you want to report a bug please read the {{report}}Reporting Bugs{{/report}} guide.",{components:{report:j.a.createElement(fn,{url:"https://searchregex.com/support/reporting-bugs/"})}}))),j.a.createElement("div",{className:"inline-notice inline-general"},j.a.createElement("p",{className:"github"},j.a.createElement(fn,{url:"https://github.com/johngodley/search-regex/issues"},j.a.createElement("img",{src:SearchRegexi10n.pluginBaseUrl+"/images/GitHub-Mark-64px.png",width:"32",height:"32"})),j.a.createElement(fn,{url:"https://github.com/johngodley/search-regex/issues"},"https://github.com/johngodley/search-regex/"))),j.a.createElement("p",null,Object(N.translate)("Please note that any support is provide on as-time-is-available basis and is not guaranteed. I do not provide paid support.")),j.a.createElement("p",null,Object(N.translate)("If you want to submit information that you don't want in a public repository then send it directly via {{email}}email{{/email}} - include as much information as you can!",{components:{email:j.a.createElement("a",{href:"mailto:john@searchregex.com?subject=Search%20Regex%20Issue&body="+encodeURIComponent("Search Regex: "+SearchRegexi10n.versions)})}})),j.a.createElement("h2",null,Object(N.translate)("Redirection")),j.a.createElement("p",null,Object(N.translate)("Like this plugin? You might want to consider {{link}}Redirection{{/link}}, a plugin to manage redirects, that is also written by me.",{components:{link:j.a.createElement(fn,{url:"https://redirection.me"})}})))};var dn=function(){return j.a.createElement("div",{className:"searchregex-help"},j.a.createElement("h3",null,Object(N.translate)("Quick Help")),j.a.createElement("p",null,Object(N.translate)("The following concepts are used by Search Regex:")),j.a.createElement("ul",null,j.a.createElement("li",null,Object(N.translate)("{{link}}Search Flags{{/link}} - additional qualifiers for your search, to enable case insensitivity, and to enable regular expression support.",{components:{link:j.a.createElement(fn,{url:"https://searchregex.com/support/searching/"})}})),j.a.createElement("li",null,Object(N.translate)("{{link}}Regular expression{{/link}} - a way of defining a pattern for text matching. Provides more advanced matches.",{components:{link:j.a.createElement(fn,{url:"https://searchregex.com/support/regular-expression/"})}})),j.a.createElement("li",null,Object(N.translate)("{{link}}Source{{/link}} - the source of data you wish to search. For example, posts, pages, or comments.",{components:{link:j.a.createElement(fn,{url:"https://searchregex.com/support/search-source/"})}})),j.a.createElement("li",null,Object(N.translate)("{{link}}Source Flags{{/link}} - additional options for the selected source. For example, include post {{guid}}GUID{{/guid}} in the search.",{components:{link:j.a.createElement(fn,{url:"https://searchregex.com/support/search-source/"}),guid:j.a.createElement(fn,{url:"https://deliciousbrains.com/wordpress-post-guids-sometimes-update/"})}}))))},hn=(n(48),function(){return j.a.createElement(j.a.Fragment,null,j.a.createElement(dn,null),j.a.createElement(pn,null))}),mn=n(5),gn=n.n(mn);n(50);function yn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yn(Object(n),!0).forEach((function(t){vn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function vn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wn(e,t){if(null===e)return{};var n=e.left,r=e.top,o=e.width,a={left:n,top:r+e.height};return t&&(a.width=o),a}function En(e){var t=e.style,n=e.align,r=gn()("redirect-popover__arrows",{"redirect-popover__arrows__left":"left"===n,"redirect-popover__arrows__right":"right"===n,"redirect-popover__arrows__centre":"centre"===n});return j.a.createElement("div",{className:r,style:t})}var xn=function(e){var t=e.position,n=e.children,r=e.togglePosition,o=e.align,a=e.hasArrow,i=Object(T.useRef)(null),l=Object(T.useMemo)((function(){return function(e,t,n,r,o){if(!r.current)return bn(bn({},e),{},{visibility:"hidden"});var a=e.width?e.width:r.current.getBoundingClientRect().width,i=t.parentWidth-a-20,l=function(e,t,n,r){return"right"===r?e+n-t:"centre"===r?e-(t+n)/2:e}(t.left,e.width?e.width:a,t.width,n);return bn(bn({},e),{},{left:Math.min(i,l),top:o?e.top+5:e.top})}(t,r,o,i,a)}),[t,r]),u=Object(T.useMemo)((function(){return function(e,t){return t?bn(bn({},e),{},{width:t.getBoundingClientRect().width}):e}(l,i.current)}),[l]);return j.a.createElement(j.a.Fragment,null,a&&j.a.createElement(En,{style:u,align:o}),j.a.createElement("div",{className:"redirect-popover__content",style:l,ref:i},n))};function _n(e){var t=Object(T.useRef)(null),n=e.children,r=e.onOutside,o=e.className,a=function(e){(function(e,t){return!!t.current&&!t.current.contains(e.target)}(e,t)||"Escape"===e.key)&&r(e)};return Object(T.useEffect)((function(){return addEventListener("click",a),addEventListener("keydown",a),function(){removeEventListener("click",a),removeEventListener("keydown",a)}}),[]),j.a.createElement("div",{className:o,ref:t},n)}function Sn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return On(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return On(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function On(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var kn=function(e){var t=e.renderContent,n=e.className,r=e.renderToggle,o=e.align,a=void 0===o?"left":o,i=e.onHide,l=e.matchToggle,u=void 0!==l&&l,c=e.hasArrow,s=void 0!==c&&c,f=e.offset,p=Sn(Object(T.useState)(!1),2),d=p[0],h=p[1],m=Sn(Object(T.useState)(null),2),g=m[0],y=m[1],b=Object(T.useRef)(null);return Object(T.useEffect)((function(){d&&y(function(e,t){if(null===e)return{};var n=document.getElementById("react-portal").getBoundingClientRect(),r=e.getBoundingClientRect(),o=r.height,a=r.width,i=r.left,l=r.top;return{left:i-n.left+(t||0),top:l-n.top,width:a,height:o,parentWidth:n.width,parentHeight:n.height}}(b.current,f))}),[d,u]),Object(T.useEffect)((function(){if(d){var e=window.addEventListener("resize",(function(){h(!1)}));return function(){window.removeEventListener("resize",e)}}}),[d]),j.a.createElement(j.a.Fragment,null,j.a.createElement("div",{className:gn()("redirect-popover__toggle",n),ref:b},r(d,(function(e){return h(!d)}))),d&&Object(C.createPortal)(j.a.createElement(_n,{className:"redirect-popover",onOutside:function(){h(!1),i&&i()}},j.a.createElement(xn,{position:wn(g,u),togglePosition:g,align:a,hasArrow:s},t((function(){return h(!1)})))),document.getElementById("react-portal")))};n(52);function Pn(){return(Pn=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)}var Tn=function(e){var t=e.children,n=e.className,r=e.onClick,o=e.title,a=e.onCancel,i={title:o,onClick:r};return j.a.createElement("div",Pn({className:gn()("redirect-badge",n,r?"redirect-badge__click":null)},i),j.a.createElement("div",null,t,a&&j.a.createElement("span",{onClick:a},"⨯")))};function jn(e){return(jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Cn(e){return function(e){if(Array.isArray(e))return Rn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Rn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rn(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Nn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function An(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nn(Object(n),!0).forEach((function(t){Hn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function In(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dn(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)}}function Ln(e,t){return(Ln=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Fn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Un(e);if(t){var o=Un(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Mn(this,n)}}function Mn(e,t){return!t||"object"!==jn(t)&&"function"!=typeof t?zn(e):t}function zn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Un(e){return(Un=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Hn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Wn=function(e){var t=e.label,n=e.value,r=e.onSelect,o=e.isSelected;return j.a.createElement("p",null,j.a.createElement("label",null,j.a.createElement("input",{type:"checkbox",name:n,onChange:function(e){return r(n,e.target.checked)},checked:o}),t))},Bn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ln(e,t)}(a,e);var t,n,r,o=Fn(a);function a(){var e;In(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Hn(zn(e=o.call.apply(o,[this].concat(n))),"onSelect",(function(t,n){var r=e.props,o=r.selected,a=r.value,i=r.multiple,l=An({},o);if(n){var u=t===a||t;l[a]=i?[].concat(Cn(l[a]),[t]):u}else i?l[a]=l[a].filter((function(e){return e!==t})):delete l[a];e.props.onApply(l,t)})),e}return t=a,(n=[{key:"isSelected",value:function(e){var t=this.props,n=t.multiple,r=t.selected,o=t.value;return n&&Array.isArray(r[o])?-1!==r[o].indexOf(e):!(o!==e||!r[o])||r[o]===e}},{key:"render",value:function(){var e=this,t=this.props,n=t.label,r=t.options,o=t.value;return r?j.a.createElement("div",{className:"redirect-multioption__group"},j.a.createElement("h5",null,n),r.map((function(t){return j.a.createElement(Wn,{label:t.label,value:t.value,onSelect:e.onSelect,isSelected:e.isSelected(t.value),key:t.value})}))):j.a.createElement(Wn,{label:n,value:o,onSelect:this.onSelect,isSelected:this.isSelected(o)})}}])&&Dn(t.prototype,n),r&&Dn(t,r),a}(j.a.Component);n(54);function $n(e){return($n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Vn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vn(Object(n),!0).forEach((function(t){er(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Qn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gn(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)}}function Kn(e,t){return(Kn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Yn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Zn(e);if(t){var o=Zn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Xn(this,n)}}function Xn(e,t){return!t||"object"!==$n(t)&&"function"!=typeof t?Jn(e):t}function Jn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zn(e){return(Zn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function er(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var tr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Kn(e,t)}(a,e);var t,n,r,o=Yn(a);function a(){var e;Qn(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return er(Jn(e=o.call.apply(o,[this].concat(n))),"removeFilter",(function(t,n){n.preventDefault(),n.stopPropagation();var r=qn({},e.props.selected);delete r[t],e.props.onApply(r,t)})),e}return t=a,(n=[{key:"getBadges",value:function(){var e=this,t=this.props,n=t.selected,r=t.options,o=t.badges,a=Object.keys(n).filter((function(e){return void 0!==n[e]}));return a.length>0&&o?a.slice(0,3).map((function(t){var o=r.find((function(e){return e.value===t}));return o&&n[t]?j.a.createElement(Tn,{key:t,onCancel:function(n){return e.removeFilter(t,n)}},o.label):null})).concat([a.length>3?j.a.createElement("span",{key:"end"},"..."):null]):null}},{key:"shouldShowTitle",value:function(){var e=this.props,t=e.selected;return!1===e.hideTitle||0===Object.keys(t).filter((function(e){return t[e]})).length}},{key:"render",value:function(){var e=this,t=this.props,n=t.options,r=t.selected,o=t.onApply,a=t.title,i=t.isEnabled,l=t.multiple,u=t.className,c=this.getBadges();return j.a.createElement(kn,{renderToggle:function(t,n){return j.a.createElement("button",{className:gn()("button","action","redirect-multioption__button",i?null:"redirect-multioption__disabled",t?"redirect-multioption__button_enabled":null),onClick:n,disabled:!i,type:"button"},e.shouldShowTitle()&&j.a.createElement("h5",null,a),c,j.a.createElement("svg",{height:"20",width:"20",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false"},j.a.createElement("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"})))},matchToggle:c&&Object.keys(r),align:"right",renderContent:function(){return j.a.createElement("div",{className:gn()("redirect-multioption",u)},n.map((function(e){return j.a.createElement(Bn,{label:e.label,value:e.value,options:e.options,multiple:e.multiple||l||!1,selected:r,key:e.label,onApply:o})})))}})}}])&&Gn(t.prototype,n),r&&Gn(t,r),a}(j.a.Component);er(tr,"defaultProps",{badges:!1,hideTitle:!1,isEnabled:!0});var nr=tr;n(56);function rr(){return(rr=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)}function or(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ar(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ar(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ar(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ir(e){var t=e.children,n=e.onSave,r=e.className,o=gn()("searchregex-replace",r);if(n){return j.a.createElement("form",{className:o,onSubmit:function(e){e.preventDefault(),n()}},t)}return j.a.createElement("div",{className:o},t)}var lr=function(e){var t=e.canReplace,n=e.setReplace,r=e.className,o=e.autoFocus,a=e.onSave,i=e.onCancel,l=e.placeholder,u=e.description,c=Object(T.useRef)(null),s=or(Object(T.useState)(""),2),f=s[0],p=s[1],d=or(Object(T.useState)(""),2),h=d[0],m=d[1],g={id:"replace",value:null===f?"":f,name:"replace",onChange:function(e){return p(e.target.value)},disabled:!t||"remove"===h,placeholder:"remove"===h?Object(N.translate)("Search phrase will be removed"):l,ref:c};return Object(T.useEffect)((function(){p("remove"===h?null:""),n("remove"===h?null:"")}),[h]),Object(T.useEffect)((function(){n(f)}),[f]),Object(T.useEffect)((function(){setTimeout((function(){o&&c&&c.current.focus()}),50)}),[c]),j.a.createElement(ir,{onSave:a&&function(){return a(f)},className:r},j.a.createElement("div",{className:"searchregex-replace__input"},"multi"===h?j.a.createElement("textarea",rr({rows:"4"},g)):j.a.createElement("input",rr({type:"text"},g)),j.a.createElement(It,{items:[{value:"",label:Object(N.translate)("Single")},{value:"multi",label:Object(N.translate)("Multi")},{value:"remove",label:Object(N.translate)("Remove")}],name:"replace_flags",value:h,onChange:function(e){return m(e.target.value)},isEnabled:t})),j.a.createElement("div",{className:"searchregex-replace__action"},u&&j.a.createElement("p",null,u),a&&j.a.createElement("p",{className:"searchregex-replace__actions"},j.a.createElement("input",{type:"submit",className:"button button-primary",value:Object(N.translate)("Replace"),disabled:""===f}),j.a.createElement("input",{type:"button",className:"button button-secondary",value:Object(N.translate)("Cancel"),onClick:i}))))};function ur(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ur(Object(n),!0).forEach((function(t){sr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ur(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function sr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fr(e){return cr(cr({},e),{},{searchFlags:Object.keys(e.searchFlags),sourceFlags:Object.keys(e.sourceFlags)})}var pr=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"forward";return function(r){var o=cr(cr({},fr(e)),{},{page:t,searchDirection:n});return jt(St.get(o)).then((function(e){r(cr(cr({type:"SEARCH_COMPLETE"},e),{},{perPage:o.perPage}))})).catch((function(e){r({type:Ce,error:e})})),r(cr({type:"SEARCH_START_FRESH"},o))}},dr=function(e,t){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(o,a){var i=a().search.search,l=cr(cr({},i),{},{rowId:t,replacePhrase:e,searchFlags:Object.keys(i.searchFlags),sourceFlags:Object.keys(i.sourceFlags)});return n&&(l.columnId=n),r&&(l.posId=r),jt(St.replace(l)).then((function(e){o(cr(cr({type:"SEARCH_REPLACE_COMPLETE"},e),{},{perPage:i.perPage,rowId:t}))})).catch((function(e){o({type:Ce,error:e})})),o({type:"SEARCH_REPLACE_ROW",rowId:t})}};var hr=function(e){return e.map((function(e){var t=e.name;return{label:e.label,value:t}}))};var mr=be((function(e){var t=e.search;return{search:t.search,sources:t.sources,sourceFlagOptions:t.sourceFlags,replaceAll:t.replaceAll}}),(function(e){return{onSetSearch:function(t){e(function(e){return{type:"SEARCH_VALUES",searchValue:e}}(t))}}}))((function(e){var t,n=e.search,r=e.onSetSearch,o=e.sources,a=e.sourceFlagOptions,i=e.replaceAll,l=n.searchPhrase,u=n.searchFlags,c=n.sourceFlags,s=n.source,f=n.perPage,p=o.map((function(e){var t=e.sources;return{label:e.label,value:hr(t)}})),d=a[s[0]]?(t=a[s[0]],Object.keys(t).map((function(e){return{value:e,label:t[e]}}))):null,h=status===Se||i,m=function(e,t){if(0===t.length)return null;for(var n=0;n<e.length;n++)for(var r=0;r<e[n].sources.length;r++)if(e[n].sources[r].name===t[0])return e[n].sources[r];return null}(o,s);return j.a.createElement("table",null,j.a.createElement("tbody",null,j.a.createElement("tr",{className:"searchregex-search__search"},j.a.createElement("th",null,Object(N.translate)("Search")),j.a.createElement("td",null,j.a.createElement("input",{type:"text",value:l,name:"searchPhrase",placeholder:Object(N.translate)("Enter search phrase"),onChange:function(e){var t,n,o;r((t={},n=e.target.name,o=e.target.value,n in t?Object.defineProperty(t,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[n]=o,t))},disabled:h}),j.a.createElement(nr,{options:ot(),selected:u,onApply:function(e){return r({searchFlags:e})},title:Object(N.translate)("Search Flags"),isEnabled:!h,badges:!0}))),j.a.createElement("tr",{className:"searchregex-search__replace"},j.a.createElement("th",null,Object(N.translate)("Replace")),j.a.createElement("td",null,j.a.createElement(lr,{canReplace:!h,setReplace:function(e){return r({replacement:e})},placeholder:Object(N.translate)("Enter global replacement text")}))),j.a.createElement("tr",{className:"searchregex-search__source"},j.a.createElement("th",null,Object(N.translate)("Source")),j.a.createElement("td",null,j.a.createElement(It,{items:p,value:s[0],onChange:function(e){return r({source:[e.target.value],sourceFlags:{}})},name:"source",isEnabled:!h}),d&&d.length>0&&j.a.createElement(nr,{options:d,selected:c,onApply:function(e){return r({sourceFlags:e})},title:Object(N.translate)("Source Options"),isEnabled:!h,badges:!0,hideTitle:!0}),m&&j.a.createElement("span",{className:"searchregex-search__source__description"},m.description))),j.a.createElement("tr",null,j.a.createElement("th",null,Object(N.translate)("Results")),j.a.createElement("td",null,j.a.createElement(It,{name:"perPage",items:at(),value:f,onChange:function(e){return r({perPage:parseInt(e.target.value,10)})},isEnabled:!h})))))}));var gr=be((function(e){return{isLoading:e.status===Se}}),(function(e){return{onDelete:function(t,n){e(function(e,t){return function(n){return jt(Ot.deleteRow(e,t)).then((function(e){n({type:"SEARCH_DELETE_COMPLETE",rowId:t})})).catch((function(e){n({type:Ce,error:e})})),n({type:"SEARCH_REPLACE_ROW",rowId:t})}}(t,n))},onSave:function(t,n){e(dr(t,n))}}}))((function(e){for(var t=e.setReplacement,n=e.actions,r=e.isLoading,o=e.onSave,a=e.result,i=e.onDelete,l=e.onEditor,u=e.description,c=function(e,n){n(),t(""),o(e,a.row_id)},s=[j.a.createElement(kn,{key:"replace",renderToggle:function(e,t){return j.a.createElement("a",{href:"#",onClick:function(e){return function(e,t){e.preventDefault(),r||t()}(e,t)}},Object(N.translate)("Replace"))},onHide:function(){return t("")},hasArrow:!0,disabled:r,align:"right",renderContent:function(e){return j.a.createElement(lr,{className:"searchregex-replace__modal",canReplace:!0,setReplace:function(e){return t(e)},autoFocus:!0,onSave:function(t){return c(t,e)},onCancel:function(){return function(e){e(),t("")}(e)},placeholder:Object(N.translate)("Replacement for all matches in this row"),description:u})}})],f={edit:Object(N.translate)("Edit")},p=Object.keys(n),d=0;d<p.length;d++)f[p[d]]&&s.push(j.a.createElement(fn,{url:n[p[d]],key:p[d]},f[p[d]]));return s.push(j.a.createElement("a",{key:"edit",href:"#",onClick:function(e){e.preventDefault(),l()}},Object(N.translate)("Editor"))),s.push(j.a.createElement("a",{key:"delete",href:"#",onClick:function(e){e.preventDefault(),i(a.source_type,a.row_id)}},Object(N.translate)("Delete"))),s.reduce((function(e,t){return[e," | ",t]}))})),yr=(n(58),function(e){var t=e.size,n=void 0===t?"":t,r="spinner-container"+(n?" spinner-"+n:"");return j.a.createElement("div",{className:r},j.a.createElement("span",{className:"css-spinner"}))});var br=function(){return j.a.createElement("div",{className:"searchregex-result__more"},Object(N.translate)("Maximum number of matches exceeded and hidden from view. These will be included in any replacements."))};var vr=function(e){var t=e.typeOfReplacement,n=e.isReplacing,r=e.onUpdate,o=e.onSave,a=e.children,i=e.match,l=function(e,t){r(""),o(e),t()},u=function(e){r(""),e&&e()};return j.a.createElement(kn,{className:gn()({"searchregex-result__replaced":"replace"===t,"searchregex-result__highlight":"match"===t,"searchregex-result__deleted":"delete"===t}),renderToggle:function(e,t){return j.a.createElement("span",{onClick:function(){return!n&&t()},title:i},a)},onHide:u,hasArrow:!0,align:"centre",offset:25,renderContent:function(e){return j.a.createElement(lr,{className:"searchregex-replace__modal",canReplace:!0,setReplace:function(e){return r(e)},autoFocus:!0,onSave:function(t){return l(t,e)},onCancel:function(){return u(e)},placeholder:Object(N.translate)("Replacement for this match"),description:Object(N.translate)("Replace single phrase.")})}})},wr=function(e,t){return" ".replace(t.length)};function Er(e,t){return e&&t.length>0?e.replace(/(\\?)\$(\d{1,2})/g,(function(e,n,r){return r=parseInt(r,10),n.length>0?e.replace("\\",""):void 0!==t[r-1]?t[r-1]:e})):e}function xr(e,t){return null===e?"delete":e!==t?"replace":"match"}var _r=function(e){var t=e.match,n=e.originalMatch;return null===t?j.a.createElement("strike",null,n):t.replace(/\n/g,"↵").replace(/^(\s+)/,wr).replace(/(\s+)$/,wr)};n(60);function Sr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw a}}return n}(e,t)||kr(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Or(e){return function(e){if(Array.isArray(e))return Pr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||kr(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kr(e,t){if(e){if("string"==typeof e)return Pr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pr(e,t):void 0}}function Pr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Tr=function(e){return e.map((function(){return""}))};function jr(e,t,n){for(var r=e.source,o=e.matches,a=e.contextReplacement,i=e.columnId,l=e.rowId,u=e.onReplace,c=e.isReplacing,s=[],f=0,p=function(e){var p,d,h,m=o[e],g=m.context_offset,y=m.match,b=m.pos_id,v=m.replacement,w=m.captures,E=(p=[t[e],a,v],d=y,void 0===(h=p.find((function(e){return n=d,null===(t=e)||t!==n&&""!==t;var t,n})))?d:h);s.push(r.substring(f,g)),s.push(j.a.createElement(vr,{typeOfReplacement:xr(E,y),onSave:function(e){return u(e,l,i,b)},onUpdate:function(r){return n(function(e,t,n){var r=Or(e);return r[t]=n,r}(t,e,r))},isReplacing:c,title:y,key:e},j.a.createElement(_r,{match:Er(E,w),originalMatch:y}))),f=g+y.length},d=0;d<o.length;d++)p(d);return s.push(r.substr(f)),s}var Cr=be(null,(function(e){return{onReplace:function(t,n,r,o){e(dr(t,n,r,o))}}}))((function(e){var t=e.matches,n=e.count,r=e.contextReplacement,o=Sr(Object(T.useState)(Tr(t)),2),a=o[0],i=o[1],l=jr(e,a,i);return Object(T.useEffect)((function(){i(Tr(t))}),[r]),j.a.createElement("div",{className:"searchregex-match__context"},l,t.length!==n&&j.a.createElement(br,null))}));var Rr=function(e){var t=e.item,n=e.rowId,r=e.contextReplacement,o=e.isReplacing,a=e.column,i=t.context,l=t.match_count,u=t.matches,c=a.column_id,s=a.column_label;return j.a.createElement("div",{className:"searchregex-match"},j.a.createElement("div",{className:"searchregex-match__column",title:c},s),j.a.createElement(Cr,{source:i,matches:u,count:l,contextReplacement:r,columnId:c,rowId:n,isReplacing:o}))};function Nr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ar(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ar(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ar(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ir=function(e){var t=e.replacement,n=e.rowId,r=e.isReplacing,o=e.column,a=o.contexts,i=o.context_count,l=o.match_count,u=Nr(Object(T.useState)(!1),2),c=u[0],s=u[1],f=a.slice(0,c?a.length:2),p=l-f.reduce((function(e,t){return e+t.match_count}),0);return j.a.createElement(j.a.Fragment,null,f.map((function(e){return j.a.createElement(Rr,{item:e,key:n+"-"+e.context_id,column:o,rowId:n,contextReplacement:t,isReplacing:r})})),!c&&a.length>2&&j.a.createElement("p",null,j.a.createElement("button",{className:"button button-secondary",onClick:function(){return s(!0)}},Object(N.translate)("Show %s more","Show %s more",{count:p,args:Object(N.numberFormat)(p)}))),c&&a.length!==i&&j.a.createElement(br,null))};var Dr=!!document.documentElement.currentStyle,Lr={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},Fr=["letter-spacing","line-height","font-family","font-weight","font-size","font-style","tab-size","text-rendering","text-transform","width","text-indent","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width","box-sizing"],Mr={},zr=document.createElement("textarea"),Ur=function(e){Object.keys(Lr).forEach((function(t){e.style.setProperty(t,Lr[t],"important")}))};function Hr(e,t,n,r,o){void 0===n&&(n=!1),void 0===r&&(r=null),void 0===o&&(o=null),null===zr.parentNode&&document.body.appendChild(zr);var a=function(e,t,n){void 0===n&&(n=!1);if(n&&Mr[t])return Mr[t];var r=window.getComputedStyle(e);if(null===r)return null;var o=Fr.reduce((function(e,t){return e[t]=r.getPropertyValue(t),e}),{}),a=o["box-sizing"];if(""===a)return null;Dr&&"border-box"===a&&(o.width=parseFloat(o.width)+parseFloat(r["border-right-width"])+parseFloat(r["border-left-width"])+parseFloat(r["padding-right"])+parseFloat(r["padding-left"])+"px");var i=parseFloat(o["padding-bottom"])+parseFloat(o["padding-top"]),l=parseFloat(o["border-bottom-width"])+parseFloat(o["border-top-width"]),u={sizingStyle:o,paddingSize:i,borderSize:l,boxSizing:a};n&&(Mr[t]=u);return u}(e,t,n);if(null===a)return null;var i=a.paddingSize,l=a.borderSize,u=a.boxSizing,c=a.sizingStyle;Object.keys(c).forEach((function(e){zr.style[e]=c[e]})),Ur(zr),zr.value=e.value||e.placeholder||"x";var s=-1/0,f=1/0,p=zr.scrollHeight;"border-box"===u?p+=l:"content-box"===u&&(p-=i),zr.value="x";var d=zr.scrollHeight-i,h=Math.floor(p/d);return null!==r&&(s=d*r,"border-box"===u&&(s=s+i+l),p=Math.max(s,p)),null!==o&&(f=d*o,"border-box"===u&&(f=f+i+l),p=Math.min(f,p)),{height:p,minHeight:s,maxHeight:f,rowCount:Math.floor(p/d),valueRowCount:h}}zr.setAttribute("tab-index","-1"),zr.setAttribute("aria-hidden","true"),Ur(zr);var Wr=function(){},Br=0,$r=function(e){var t,n;function r(t){var n;return(n=e.call(this,t)||this)._onRef=function(e){n._ref=e;var t=n.props.inputRef;"function"!=typeof t?t.current=e:t(e)},n._onChange=function(e){n._controlled||n._resizeComponent(),n.props.onChange(e,function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n))},n._resizeComponent=function(e){void 0===e&&(e=Wr);var t=Hr(n._ref,n._uid,n.props.useCacheForDOMMeasurements,n.props.minRows,n.props.maxRows);if(null!==t){var r=t.height,o=t.minHeight,a=t.maxHeight,i=t.rowCount,l=t.valueRowCount;n.rowCount=i,n.valueRowCount=l,n.state.height===r&&n.state.minHeight===o&&n.state.maxHeight===a?e():n.setState({height:r,minHeight:o,maxHeight:a},e)}else e()},n.state={height:t.style&&t.style.height||0,minHeight:-1/0,maxHeight:1/0},n._uid=Br++,n._controlled=void 0!==t.value,n._resizeLock=!1,n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o=r.prototype;return o.render=function(){var e=this.props,t=(e.inputRef,e.maxRows,e.minRows,e.onHeightChange,e.useCacheForDOMMeasurements,B(e,["inputRef","maxRows","minRows","onHeightChange","useCacheForDOMMeasurements"]));return t.style=W({},t.style,{height:this.state.height}),Math.max(t.style.maxHeight||1/0,this.state.maxHeight)<this.state.height&&(t.style.overflow="hidden"),Object(T.createElement)("textarea",W({},t,{onChange:this._onChange,ref:this._onRef}))},o.componentDidMount=function(){var e=this;this._resizeComponent(),this._resizeListener=function(){e._resizeLock||(e._resizeLock=!0,e._resizeComponent((function(){e._resizeLock=!1})))},window.addEventListener("resize",this._resizeListener)},o.componentDidUpdate=function(e,t){e!==this.props&&this._resizeComponent(),this.state.height!==t.height&&this.props.onHeightChange(this.state.height,this)},o.componentWillUnmount=function(){window.removeEventListener("resize",this._resizeListener),function(e){delete Mr[e]}(this._uid)},r}(T.Component);$r.defaultProps={inputRef:Wr,onChange:Wr,onHeightChange:Wr,useCacheForDOMMeasurements:!1};var Vr=$r;function qr(e){return(qr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Qr(){return(Qr=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)}function Gr(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)}}function Kr(e,t){return(Kr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Yr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Zr(e);if(t){var o=Zr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Xr(this,n)}}function Xr(e,t){return!t||"object"!==qr(t)&&"function"!=typeof t?Jr(e):t}function Jr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zr(e){return(Zr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function to(e){return(to="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function no(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ro(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)}}function oo(e,t){return(oo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ao(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=uo(e);if(t){var o=uo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return io(this,n)}}function io(e,t){return!t||"object"!==to(t)&&"function"!=typeof t?lo(e):t}function lo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function uo(e){return(uo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function co(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var so,fo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&oo(e,t)}(a,e);var t,n,r,o=ao(a);function a(){var e;no(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return co(lo(e=o.call.apply(o,[this].concat(n))),"handleClickOutside",(function(){e.props.onClose()})),e}return t=a,(n=[{key:"render",value:function(){var e=this.props.onClose;return j.a.createElement("div",{className:"redirection-modal_content"},j.a.createElement("div",{className:"redirection-modal_close"},j.a.createElement("button",{onClick:e},"✖")),this.props.children)}}])&&ro(t.prototype,n),r&&ro(t,r),a}(j.a.Component),po=(so=fo,function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Kr(e,t)}(a,e);var t,n,r,o=Yr(a);function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),eo(Jr(t=o.call(this,e)),"onClick",(function(e){t.node.current&&null===e.target.closest(".redirect-click-outside")&&t.node.current.handleClickOutside(e)})),eo(Jr(t),"onKeydown",(function(e){"Escape"===e.key&&t.node.current.handleClickOutside(e)})),t.node=j.a.createRef(),t}return t=a,(n=[{key:"componentDidMount",value:function(){addEventListener("mousedown",this.onClick),addEventListener("keydown",this.onKeydown)}},{key:"componentWillUnmount",value:function(){removeEventListener("mousedown",this.onClick),removeEventListener("keydown",this.onKeydown)}},{key:"render",value:function(){return j.a.createElement("div",{className:"redirect-click-outside"},j.a.createElement(so,Qr({},this.props,{ref:this.node})))}}])&&Gr(t.prototype,n),r&&Gr(t,r),a}(j.a.Component));n(62);function ho(e){Object(T.useEffect)((function(){return document.body.classList.add("redirection-modal_shown"),function(){document.body.classList.remove("redirection-modal_shown")}}));var t=gn()({"redirection-modal_wrapper":!0,"redirection-modal_wrapper-padding":e.padding});return j.a.createElement("div",{className:t},j.a.createElement("div",{className:"redirection-modal_backdrop"}),j.a.createElement("div",{className:"redirection-modal_main"},j.a.createElement(po,e)))}ho.defaultProps={padding:!0,onClose:function(){}};var mo=function(e){return R.a.createPortal(j.a.createElement(ho,e),document.getElementById("react-modal"))};n(64);function go(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return yo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yo(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var bo=be((function(e){var t=e.search;return{rawData:t.rawData,status:t.status}}),(function(e){return{onLoad:function(t,n){e(function(e,t){return function(n){return jt(Ot.loadRow(e,t)).then((function(e){n({type:"SEARCH_LOAD_ROW_COMPLETE",rowId:t,row:e.result})})).catch((function(e){n({type:Ce,error:e})})),n({type:"SEARCH_REPLACE_ROW",rowId:t})}}(t,n))},onSave:function(t,n,r,o){e(function(e,t,n,r){return function(o,a){var i=a().search.search,l=i.searchPhrase,u=i.searchFlags,c=i.replacement,s=i.sourceFlags,f={searchPhrase:l,replacement:c,searchFlags:Object.keys(u),sourceFlags:Object.keys(s)};return jt(Ot.saveRow(e,t,cr(cr({},f),{},{columnId:n,content:r}))).then((function(e){o(cr(cr({type:"SEARCH_SAVE_ROW_COMPLETE"},e),{},{rowId:t}))})).catch((function(e){o({type:Ce,error:e})})),o({type:"SEARCH_REPLACE_ROW",rowId:t})}}(t,n,r,o))}}}))((function(e){var t=e.result,n=e.onClose,r=e.onLoad,o=e.rawData,a=e.onSave,i=e.status,l=t.row_id,u=t.source_type,c=t.columns,s=go(Object(T.useState)(c[0].column_id),2),f=s[0],p=s[1],d=go(Object(T.useState)(""),2),h=d[0],m=d[1],g=c.find((function(e){return e.column_id===f}))?c.find((function(e){return e.column_id===f})).column_label:"";return Object(T.useEffect)((function(){r(u,l)}),[]),Object(T.useEffect)((function(){o&&m(o[f]?o[f]:"")}),[o]),o?j.a.createElement(mo,{onClose:n},j.a.createElement("div",{className:"searchregex-editor"},j.a.createElement("h2",null,Object(N.translate)("Editing %s",{args:g})),j.a.createElement(Vr,{value:h,rows:"15",maxRows:30,onChange:function(e){return m(e.target.value)},disabled:i===Se}),j.a.createElement("div",{className:"searchregex-editor__actions"},1===c.length&&j.a.createElement("div",null," "),c.length>1&&j.a.createElement(It,{name:"column_id",value:f,items:c.map((function(e){return{value:e.column_id,label:e.column_label}})),onChange:function(e){return t=e.target.value,p(t),void m(o[t]?o[t]:"");var t},isEnabled:i!==Se}),j.a.createElement("div",null,i===Se&&j.a.createElement(yr,null),j.a.createElement("button",{disabled:i===Se,className:"button button-primary",onClick:function(){n(),a(u,l,f,h)}},Object(N.translate)("Save")),j.a.createElement("button",{className:"button button-secondary",onClick:function(){return n()}},Object(N.translate)("Close")))))):null}));n(66);function vo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return wo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wo(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Eo(e,t){return null===t||t.length>0?t:e}function xo(e){var t=e.view,n=e.title;return t?j.a.createElement(fn,{url:t},n):n}var _o=be((function(e){var t=e.search;return{replacing:t.replacing,globalReplacement:t.search.replacement}}),null)((function(e){var t=e.result,n=e.globalReplacement,r=e.replacing,o=t.columns,a=t.actions,i=t.row_id,l=t.source_name,u=t.source_type,c=t.title,s=t.match_count,f=-1!==r.indexOf(i),p=vo(Object(T.useState)(""),2),d=p[0],h=p[1],m=vo(Object(T.useState)(!1),2),g=m[0],y=m[1];return Object(T.useEffect)((function(){h("")}),[n]),j.a.createElement("tr",{className:gn()("searchregex-result",{"searchregex-result__updating":f})},j.a.createElement("td",{className:"searchregex-result__table"},j.a.createElement("span",{title:u},l)),j.a.createElement("td",{className:"searchregex-result__row"},i),j.a.createElement("td",{className:"searchregex-result__row"},s),j.a.createElement("td",{className:"searchregex-result__match"},j.a.createElement("h2",null,j.a.createElement(xo,{view:a.view,title:c})),o.map((function(e){return j.a.createElement(Ir,{column:e,replacement:Eo(n,d),rowId:i,isReplacing:f,key:e.column_id})}))),j.a.createElement("td",{className:"searchregex-result__action"},f?j.a.createElement(yr,null):j.a.createElement(gr,{actions:a,setReplacement:h,result:t,onEditor:function(){return y(!0)},description:Object(N.translate)("Replace %(count)s match.","Replace %(count)s matches.",{count:s,args:{count:Object(N.numberFormat)(s)}})}),g&&j.a.createElement(bo,{onClose:function(){return y(!1)},result:t})))}));var So=function(e){for(var t=e.columns,n=[],r=0;r<t;r++)n.push(j.a.createElement("td",{key:r,colSpan:0==r?2:1},j.a.createElement(qt,null)));return j.a.createElement("tr",null,n)};var Oo=function(e){var t=e.columns;return j.a.createElement("tr",null,j.a.createElement("td",{colSpan:t},Object(N.translate)("No more matching results found.")))},ko=function(e){var t=e.title,n=e.button,r=e.className,o=e.enabled,a=e.onClick;return o?j.a.createElement("a",{className:r+" button",href:"#",onClick:function(e){e.preventDefault(),a()}},j.a.createElement("span",{className:"screen-reader-text"},t),j.a.createElement("span",{"aria-hidden":"true"},n)):j.a.createElement("span",{className:"tablenav-pages-navspan button disabled","aria-hidden":"true"},n)};var Po=be((function(e){return{search:e.search.search}}),(function(e){return{onChangePage:function(t,n){e(pr(t,n))}}}))((function(e){var t=e.progress,n=e.onChangePage,r=e.isLoading,o=e.matchedPhrases,a=e.matchedRows,i=e.perPage,l=e.search,u=e.noTotal,c=void 0!==u&&u,s=t.current,f=t.previous,p=t.next,d=Math.round(a/i),h=Math.round(s/i),m=p&&h<d;return j.a.createElement("div",{className:"tablenav-pages"},c&&j.a.createElement("div",null," "),!c&&j.a.createElement("div",{className:"displaying-num"},Object(N.translate)("Matches: %(phrases)s across %(rows)s database row.","Matches: %(phrases)s across %(rows)s database rows.",{count:a,args:{phrases:Object(N.numberFormat)(o),rows:Object(N.numberFormat)(a)}})),j.a.createElement("div",{className:"pagination-links"},j.a.createElement(ko,{title:Object(N.translate)("First page"),button:"«",className:"first-page",enabled:!1!==f&&!r,onClick:function(){return n(l,0)}}),j.a.createElement(ko,{title:Object(N.translate)("Prev page"),button:"‹",className:"prev-page",enabled:!1!==f&&!r,onClick:function(){return n(l,f)}}),j.a.createElement("span",{className:"tablenav-paging-text"},Object(N.translate)("Page %(current)s of %(total)s",{args:{current:Object(N.numberFormat)(h+1),total:Object(N.numberFormat)(Math.max(1,d+1))}})),j.a.createElement(ko,{title:Object(N.translate)("Next page"),button:"›",className:"next-page",enabled:m&&!r,onClick:function(){return n(l,p)}}),j.a.createElement(ko,{title:Object(N.translate)("Last page"),button:"»",className:"last-page",enabled:m&&!r,onClick:function(){return n(l,(d-1)*i)}})))})),To=function(e,t){return!1===t?100:t/e*100},jo=function(e,t){return 0===t?t:t/e*100};var Co=be((function(e){return{search:e.search.search}}),(function(e){return{onChangePage:function(t,n,r){e(pr(t,n,r))}}}))((function(e){var t=e.total,n=e.progress,r=e.onChangePage,o=e.isLoading,a=e.searchDirection,i=e.search,l=e.noTotal,u=void 0!==l&&l,c=n.previous,s=n.next;return j.a.createElement("div",{className:"tablenav-pages"},u&&j.a.createElement("div",null," "),!u&&j.a.createElement("div",{className:"displaying-num"},Object(N.translate)("%s database row in total","%s database rows in total",{count:t,args:Object(N.numberFormat)(t)})),j.a.createElement("div",{className:"pagination-links"},j.a.createElement(ko,{title:Object(N.translate)("First page"),button:"«",className:"first-page",enabled:!1!==c&&!o,onClick:function(){return r(i,0,"forward")}}),j.a.createElement(ko,{title:Object(N.translate)("Prev page"),button:"‹",className:"prev-page",enabled:!1!==c&&!o,onClick:function(){return r(i,c,"backward")}}),j.a.createElement("span",{className:"tablenav-paging-text"},Object(N.translate)("Progress %(current)s%%",{args:{current:Object(N.numberFormat)("forward"===a?To(t,s):jo(t,0==s?c:s))}})),j.a.createElement(ko,{title:Object(N.translate)("Next page"),button:"›",className:"next-page",enabled:!1!==s&&!o,onClick:function(){return r(i,s,"forward")}})))}));n(68);function Ro(){return(Ro=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)}var No=function(e){var t=e.totals,n=e.searchDirection,r=t.matched_rows,o=t.matched_phrases,a=t.rows;return null===r?j.a.createElement("div",{className:"tablenav-pages"},j.a.createElement("div",{className:"displaying-num"}," ")):r>0?j.a.createElement(Po,Ro({},e,{matchedRows:r,matchedPhrases:o,total:a})):j.a.createElement(Co,Ro({},e,{total:a,searchDirection:n}))};n(70);var Ao=be((function(e){var t=e.search,n=t.results,r=t.status,o=t.progress,a=t.totals,i=t.requestCount;return{results:n,status:r,progress:o,searchDirection:t.searchDirection,totals:a,requestCount:i,search:t.search,showLoading:t.showLoading}}),(function(e){return{onSearchMore:function(t,n){e(function(e,t){return function(n,r){var o=cr(cr({},fr(e)),{},{page:t,searchDirection:r().search.searchDirection});return jt(St.get(o)).then((function(e){n(cr(cr({type:"SEARCH_COMPLETE"},e),{},{perPage:o.perPage}))})).catch((function(e){n({type:Ce,error:e})})),n(cr({type:"SEARCH_START_MORE"},o))}}(t,n))},onSetError:function(t){e(function(e){return{type:Ce,error:e}}(t))}}}))((function(e){var t=e.results,n=e.totals,r=e.progress,o=e.status,a=e.requestCount,i=e.search,l=e.searchDirection,u=e.showLoading,c=i.searchFlags,s=i.perPage,f=e.onSearchMore,p=e.onChangePage,d=e.onSetError,h=o===Se;return Object(T.useEffect)((function(){a>100?d(Object(N.translate)("Maximum number of page requests has been exceeded and the search stopped. Try to be more specific with your search term.")):Object.keys(c).length>0&&function(e,t,n,r){return e===Se&&t>0&&n.length!==r}(o,a,t,s)&&function(e,t){return"forward"===e&&!1!==t.next||"backward"===e&&!1!==t.previous}(l,r)&&f(i,"forward"===l?r.next:r.previous)}),[a]),j.a.createElement(j.a.Fragment,null,j.a.createElement(No,{totals:n,onChangePage:p,perPage:s,isLoading:h,progress:r,searchDirection:l}),j.a.createElement("table",{className:gn()("wp-list-table","widefat","fixed","striped","items","searchregex-results")},j.a.createElement("thead",null,j.a.createElement("tr",null,j.a.createElement("th",{className:"searchregex-result__table"},Object(N.translate)("Source")),j.a.createElement("th",{className:"searchregex-result__row"},Object(N.translate)("Row ID")),j.a.createElement("th",{className:"searchregex-result__matches"},Object(N.translate)("Matches")),j.a.createElement("th",{className:"searchregex-result__match"},Object(N.translate)("Matched Phrases")),j.a.createElement("th",{className:"searchregex-result__action"},Object(N.translate)("Actions")))),j.a.createElement("tbody",null,t.map((function(e,t){return j.a.createElement(_o,{key:t,result:e})})),u&&j.a.createElement(So,{columns:4}),!h&&0===t.length&&j.a.createElement(Oo,{columns:5}))),j.a.createElement(No,{totals:n,onChangePage:p,perPage:s,isLoading:h,progress:r,searchDirection:l,noTotal:!0}))})),Io=function(e,t){return e===Se||0===t.length},Do=function(e,t,n){return e===Se||0===t.length||t===n||null!==n&&0===n.length};var Lo=be((function(e){var t=e.search;return{search:t.search,status:t.status,replaceAll:t.replaceAll,canCancel:t.canCancel}}),(function(e){return{onCancel:function(){e({type:"SEARCH_CANCEL",clearAll:!1})},onSearch:function(t,n,r){e(pr(t,n,r))},onReplace:function(t,n,r){e(function(e,t,n){return function(r,o){return jt(St.replace(cr(cr({},e),{},{replacePhrase:e.replacement,page:t,perPage:n,searchFlags:Object.keys(e.searchFlags)}))).then((function(e){r(cr({type:"SEARCH_REPLACE_ALL_COMPLETE"},e))})).catch((function(e){r({type:Ce,error:e})})),r({type:"SEARCH_REPLACE_ALL"})}}(t,n,r))}}}))((function(e){var t=e.search,n=e.status,r=e.onSearch,o=e.onReplace,a=e.onCancel,i=e.replaceAll,l=e.canCancel,u=t.searchPhrase,c=t.replacement;return j.a.createElement("div",{className:"searchregex-search__action"},j.a.createElement("input",{className:"button button-primary",type:"submit",value:Object(N.translate)("Search"),onClick:function(){return r(t,0,"forward")},disabled:Io(n,u)||i}),j.a.createElement("input",{className:"button button-delete",type:"submit",value:Object(N.translate)("Replace All"),onClick:function(){return o(t,0,50)},disabled:Do(n,u,c)||i}),n===Se&&l&&j.a.createElement(j.a.Fragment,null,j.a.createElement("button",{className:"button button-delete",onClick:a},Object(N.translate)("Cancel")),j.a.createElement(yr,null)))}));function Fo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mo(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)}}function zo(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Uo(e,t,n){return(Uo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ho(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function Ho(e){return(Ho=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Wo(e,t){return(Wo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Bo=function(e){return function(e){function t(){return Fo(this,t),zo(this,Ho(t).apply(this,arguments))}var n,r,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Wo(e,t)}(t,e),n=t,(r=[{key:"componentDidUpdate",value:function(){var e=this,t=Date.now(),n=!1;Object.keys(this.paths).forEach((function(r){var o=e.paths[r];if(o){n=!0;var a=o.style;a.transitionDuration=".3s, .3s, .3s, .06s",e.prevTimeStamp&&t-e.prevTimeStamp<100&&(a.transitionDuration="0s, 0s")}})),n&&(this.prevTimeStamp=Date.now())}},{key:"render",value:function(){return Uo(Ho(t.prototype),"render",this).call(this)}}])&&Mo(n.prototype,r),o&&Mo(n,o),t}(e)},$o={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},Vo=D.a.oneOfType([D.a.number,D.a.string]),qo={className:D.a.string,percent:D.a.oneOfType([Vo,D.a.arrayOf(Vo)]),prefixCls:D.a.string,strokeColor:D.a.oneOfType([D.a.string,D.a.arrayOf(D.a.oneOfType([D.a.string,D.a.object])),D.a.object]),strokeLinecap:D.a.oneOf(["butt","round","square"]),strokeWidth:Vo,style:D.a.object,trailColor:D.a.string,trailWidth:Vo};function Qo(){return(Qo=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)}function Go(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Ko(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yo(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)}}function Xo(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?Zo(e):t}function Jo(e){return(Jo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Zo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ea(e,t){return(ea=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ta(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var na=function(e){function t(){var e,n;Ko(this,t);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return ta(Zo(n=Xo(this,(e=Jo(t)).call.apply(e,[this].concat(o)))),"paths",{}),n}var n,r,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ea(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props,n=t.className,r=t.percent,o=t.prefixCls,a=t.strokeColor,i=t.strokeLinecap,l=t.strokeWidth,u=t.style,c=t.trailColor,s=t.trailWidth,f=t.transition,p=Go(t,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete p.gapPosition;var d=Array.isArray(r)?r:[r],h=Array.isArray(a)?a:[a],m=l/2,g=100-l/2,y="M ".concat("round"===i?m:0,",").concat(m,"\n L ").concat("round"===i?g:100,",").concat(m),b="0 0 100 ".concat(l),v=0;return j.a.createElement("svg",Qo({className:"".concat(o,"-line ").concat(n),viewBox:b,preserveAspectRatio:"none",style:u},p),j.a.createElement("path",{className:"".concat(o,"-line-trail"),d:y,strokeLinecap:i,stroke:c,strokeWidth:s||l,fillOpacity:"0"}),d.map((function(t,n){var r={strokeDasharray:"".concat(t,"px, 100px"),strokeDashoffset:"-".concat(v,"px"),transition:f||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},a=h[n]||h[h.length-1];return v+=t,j.a.createElement("path",{key:n,className:"".concat(o,"-line-path"),d:y,strokeLinecap:i,stroke:a,strokeWidth:l,fillOpacity:"0",ref:function(t){e.paths[n]=t},style:r})})))}}])&&Yo(n.prototype,r),o&&Yo(n,o),t}(T.Component);na.propTypes=qo,na.defaultProps=$o;var ra=Bo(na);function oa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function aa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oa(n,!0).forEach((function(t){pa(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oa(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ia(){return(ia=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)}function la(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function ua(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)}}function ca(e){return(ca=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function sa(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fa(e,t){return(fa=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function pa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var da=0;function ha(e){return+e.replace("%","")}function ma(e){return Array.isArray(e)?e:[e]}function ga(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0,i=50-r/2,l=0,u=-i,c=0,s=-2*i;switch(a){case"left":l=-i,u=0,c=2*i,s=0;break;case"right":l=i,u=0,c=-2*i,s=0;break;case"bottom":u=i,s=2*i}var f="M 50,50 m ".concat(l,",").concat(u,"\n a ").concat(i,",").concat(i," 0 1 1 ").concat(c,",").concat(-s,"\n a ").concat(i,",").concat(i," 0 1 1 ").concat(-c,",").concat(s),p=2*Math.PI*i,d={stroke:n,strokeDasharray:"".concat(t/100*(p-o),"px ").concat(p,"px"),strokeDashoffset:"-".concat(o/2+e/100*(p-o),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:f,pathStyle:d}}var ya=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),e=function(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?sa(e):t}(this,ca(t).call(this)),pa(sa(e),"paths",{}),pa(sa(e),"gradientId",0),e.gradientId=da,da+=1,e}var n,r,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&fa(e,t)}(t,e),n=t,(r=[{key:"getStokeList",value:function(){var e=this,t=this.props,n=t.prefixCls,r=t.percent,o=t.strokeColor,a=t.strokeWidth,i=t.strokeLinecap,l=t.gapDegree,u=t.gapPosition,c=ma(r),s=ma(o),f=0;return c.map((function(t,r){var o=s[r]||s[s.length-1],c="[object Object]"===Object.prototype.toString.call(o)?"url(#".concat(n,"-gradient-").concat(e.gradientId,")"):"",p=ga(f,t,o,a,l,u),d=p.pathString,h=p.pathStyle;return f+=t,j.a.createElement("path",{key:r,className:"".concat(n,"-circle-path"),d:d,stroke:c,strokeLinecap:i,strokeWidth:0===t?0:a,fillOpacity:"0",style:h,ref:function(t){e.paths[r]=t}})}))}},{key:"render",value:function(){var e=this.props,t=e.prefixCls,n=e.strokeWidth,r=e.trailWidth,o=e.gapDegree,a=e.gapPosition,i=e.trailColor,l=e.strokeLinecap,u=e.style,c=e.className,s=e.strokeColor,f=la(e,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor"]),p=ga(0,100,i,n,o,a),d=p.pathString,h=p.pathStyle;delete f.percent;var m=ma(s).find((function(e){return"[object Object]"===Object.prototype.toString.call(e)}));return j.a.createElement("svg",ia({className:"".concat(t,"-circle ").concat(c),viewBox:"0 0 100 100",style:u},f),m&&j.a.createElement("defs",null,j.a.createElement("linearGradient",{id:"".concat(t,"-gradient-").concat(this.gradientId),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(m).sort((function(e,t){return ha(e)-ha(t)})).map((function(e,t){return j.a.createElement("stop",{key:t,offset:e,stopColor:m[e]})})))),j.a.createElement("path",{className:"".concat(t,"-circle-trail"),d:d,stroke:i,strokeLinecap:l,strokeWidth:r||n,fillOpacity:"0",style:h}),this.getStokeList().reverse())}}])&&ua(n.prototype,r),o&&ua(n,o),t}(T.Component);ya.propTypes=aa({},qo,{gapPosition:D.a.oneOf(["top","bottom","left","right"])}),ya.defaultProps=aa({},$o,{gapPosition:"top"});Bo(ya),n(72);var ba=be((function(e){var t=e.search,n=t.progress,r=t.totals,o=t.requestCount,a=t.replaceCount,i=t.phraseCount;return{status:t.status,progress:n,totals:r,requestCount:o,replaceCount:a,phraseCount:i,isRegex:void 0!==t.search.searchFlags.regex}}),(function(e){return{onCancel:function(){e({type:"SEARCH_CANCEL",clearAll:!0})},onNext:function(t){e(function(e){return function(t,n){var r=cr(cr({},fr(n().search.search)),{},{page:e});return jt(St.replace(r)).then((function(e){t(cr({type:"SEARCH_REPLACE_ALL_COMPLETE"},e))})).catch((function(e){t({type:Ce,error:e})})),t({type:"SEARCH_REPLACE_ALL_MORE"})}}(t))}}}))((function(e){var t=e.progress,n=e.totals,r=e.requestCount,o=e.replaceCount,a=e.onNext,i=e.status,l=e.onCancel,u=e.phraseCount,c=e.isRegex?n.rows:n.matched_rows,s=void 0===t.rows?0:t.current+t.rows,f=c>0?Math.round(s/c*100):0;return Object(T.useEffect)((function(){r>0&&!1!==t.next&&o<c&&i===Se&&a(t.next)}),[r]),j.a.createElement("div",{className:"searchregex-replaceall"},j.a.createElement("h3",null,Object(N.translate)("Replace progress")),j.a.createElement("div",{className:"searchregex-replaceall__progress"},j.a.createElement(ra,{percent:f,strokeWidth:"4",trailWidth:"4",strokeLinecap:"square"}),j.a.createElement("div",{className:"searchregex-replaceall__status"},"".concat(f,"%"))),i===Oe&&j.a.createElement(j.a.Fragment,null,j.a.createElement("p",null,Object(N.translate)("Finished!")),j.a.createElement("p",null,Object(N.translate)("Rows updated: %s",{args:Object(N.numberFormat)(o)})),j.a.createElement("p",null,Object(N.translate)("Phrases replaced: %s",{args:Object(N.numberFormat)(u)})),j.a.createElement("button",{className:"button button-primary",onClick:l},Object(N.translate)("Finished!"))))}));n(74);var va=be((function(e){var t=e.search;return{status:t.status,replaceAll:t.replaceAll}}),null)((function(e){var t=e.status,n=e.replaceAll;return j.a.createElement(j.a.Fragment,null,j.a.createElement("div",{className:"inline-notice inline-warning"},j.a.createElement("p",null,Object(N.translate)("You are advised to backup your data before making modifications."))),j.a.createElement("p",null,Object(N.translate)("Search and replace information in your database.")),j.a.createElement("form",{className:"searchregex-search",onSubmit:function(e){return e.preventDefault()}},j.a.createElement(mr,null),j.a.createElement(Lo,null)),t&&(n?j.a.createElement(ba,null):j.a.createElement(Ao,null)))}));function wa(e){return 0===e.code?e.message:e.data&&e.data.wpdb?j.a.createElement("span",null,"".concat(e.message," (").concat(e.code,")"),": ",j.a.createElement("code",null,e.data.wpdb)):e.code?j.a.createElement(j.a.Fragment,null,e.message," (",j.a.createElement("code",null,e.code),")"):e.message}var Ea=function(e){var t,n,r,o,a=e.error;if(0===a.code)return j.a.createElement("p",null,Object(N.translate)("WordPress did not return a response. This could mean an error occurred or that the request was blocked. Please check your server error_log."));if("rest_cookie_invalid_nonce"===a.code)return j.a.createElement(j.a.Fragment,null,j.a.createElement("p",null,wa(a)),j.a.createElement("p",null,Object(N.translate)("Your REST API is being cached. Please clear any caching plugin and any server cache, logout, clear your browser cache, and try again.")),j.a.createElement("p",null,j.a.createElement(fn,{url:"https://searchregex.com/support/problems/cloudflare/"},Object(N.translate)("Read this REST API guide for more information."))));if(a.request&&function(e,t){return(-1!==[400,401,403,405].indexOf(e)||"rest_no_route"===t)&&0===parseInt(t,10)}(a.request.status,a.code))return j.a.createElement(j.a.Fragment,null,j.a.createElement("p",null,wa(a)),j.a.createElement("p",null,Object(N.translate)("Your REST API is probably being blocked by a security plugin. Please disable this, or configure it to allow REST API requests.")),j.a.createElement("p",null,j.a.createElement(fn,{url:"https://searchregex.com/support/problems/rest-api/"},Object(N.translate)("Read this REST API guide for more information."))));if(a.request&&404===a.request.status)return j.a.createElement(j.a.Fragment,null,j.a.createElement("p",null,wa(a)),j.a.createElement("p",null,Object(N.translate)("Your REST API is returning a 404 page. This may be caused by a security plugin, or your server may be misconfigured")),j.a.createElement("p",null,j.a.createElement(fn,{url:"https://searchregex.com/support/problems/rest-api/"},Object(N.translate)("Read this REST API guide for more information."))));if(a.request&&413===a.request.status)return j.a.createElement("p",null,Object(N.translate)("Your server has rejected the request for being too big. You will need to change it to continue."));if(a.request&&function(e){return-1!==[500,502,503].indexOf(e)}(a.request.status))return j.a.createElement(j.a.Fragment,null,j.a.createElement("p",null,wa(a)),j.a.createElement("p",null,Object(N.translate)("This could be a security plugin, or your server is out of memory or has an external error. Please check your server error log")),j.a.createElement("p",null,j.a.createElement(fn,{url:"https://searchregex.com/support/problems/rest-api/#http"},Object(N.translate)("Read this REST API guide for more information."))));if("disabled"===a.code||"rest_disabled"===a.code)return j.a.createElement("p",null,Object(N.translate)("Your WordPress REST API has been disabled. You will need to enable it for Search Regex to continue working"));if(-1!==a.message.indexOf("Unexpected token")||-1!==a.message.indexOf("JSON parse error")){var i=(t=a.request,n=t.raw,r=n.split("<br />").filter((function(e){return e})),(o=n.lastIndexOf("}"))!==n.length?n.substr(o+1).trim():r.slice(0,r.length-1).join(" ").trim());return j.a.createElement(j.a.Fragment,null,j.a.createElement("p",null,wa(a)),j.a.createElement("p",null,Object(N.translate)("WordPress returned an unexpected message. This is probably a PHP error from another plugin.")),i.length>1&&j.a.createElement("p",null,j.a.createElement("strong",null,Object(N.translate)("Possible cause"),":")," ",j.a.createElement("code",null,i.substr(0,1e3))))}var l=a.message.toLowerCase();return"failed to fetch"===l||"not allowed to request resource"===l||-1!==l.indexOf("networkerror")?j.a.createElement(j.a.Fragment,null,j.a.createElement("p",null,wa(a)),j.a.createElement("p",null,Object(N.translate)("Unable to make request due to browser security. This is typically because your WordPress and Site URL settings are inconsistent, or the request was blocked by your site CORS policy.")),j.a.createElement("p",null,j.a.createElement(fn,{url:"https://searchregex.com/support/problems/rest-api/#url"},Object(N.translate)("Read this REST API guide for more information.")))):j.a.createElement("p",null,wa(a))};function xa(e){return(xa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _a(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)}}function Sa(e,t){return(Sa=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Oa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ta(e);if(t){var o=Ta(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ka(this,n)}}function ka(e,t){return!t||"object"!==xa(t)&&"function"!=typeof t?Pa(e):t}function Pa(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ta(e){return(Ta=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ja(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ca=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Sa(e,t)}(a,e);var t,n,r,o=Oa(a);function a(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),ja(Pa(t=o.call(this,e)),"onShow",(function(e){e.preventDefault(),t.setState({hide:!1})})),ja(Pa(t),"onHide",(function(e){e.preventDefault(),t.setState({hide:!0})}));var n=t.props.error.request;return t.state={hide:t.doesNeedHiding(n)},t}return t=a,(n=[{key:"doesNeedHiding",value:function(e){return e&&e.raw&&e.raw.length>500}},{key:"render",value:function(){var e=this.props.error.request,t=this.state.hide,n=this.doesNeedHiding(e);return e&&e.raw?j.a.createElement(j.a.Fragment,null,n&&t&&j.a.createElement("a",{className:"api-result-hide",onClick:this.onShow,href:"#"},Object(N.translate)("Show Full")),n&&!t&&j.a.createElement("a",{className:"api-result-hide",onClick:this.onHide,href:"#"},Object(N.translate)("Hide")),j.a.createElement("pre",null,t?e.raw.substr(0,500)+" ...":e.raw)):null}}])&&_a(t.prototype,n),r&&_a(t,r),a}(j.a.Component),Ra=function(e,t){var n=function(e){return e.code?e.code:e.name?e.name:null}(e);return j.a.createElement("div",{className:"api-result-log_details",key:t},j.a.createElement("p",null,j.a.createElement("span",{className:"dashicons dashicons-no"})),j.a.createElement("div",null,j.a.createElement("p",null,t.map((function(t,n){return j.a.createElement("span",{key:n,className:"api-result-method_fail"},t," ",e.data&&e.data.status)})),n&&j.a.createElement("strong",null,n,": "),e.message),j.a.createElement(Ea,{error:e}),j.a.createElement(Ca,{error:e})))},Na=function(e){return j.a.createElement("p",{key:e},j.a.createElement("span",{className:"dashicons dashicons-yes"}),e.map((function(e,t){return j.a.createElement("span",{key:t,className:"api-result-method_pass"},e)})),Object(N.translate)("Working!"))},Aa=function(e){return e.code?e.code:0},Ia=function(e){var t=e.result,n=[],r=t.GET,o=t.POST;return r.status===o.status&&Aa(r)===Aa(o)?("fail"===r.status?n.push(Ra(r.error,["GET","POST"])):n.push(Na(["GET","POST"])),n):("fail"===r.status?n.push(Ra(r.error,["GET"])):n.push(Na(["GET"])),"fail"===o.status?n.push(Ra(o.error,["POST"])):n.push(Na(["POST"])),n)},Da=function(e){var t=e.item,n=e.result,r=e.routes,o=e.isCurrent,a=e.allowChange;return function(e){return 0===Object.keys(e).length||"loading"===e.GET.status||"loading"===e.POST.status}(n)?null:j.a.createElement("div",{className:"api-result-log"},j.a.createElement("form",{className:"api-result-select",action:SearchRegexi10n.pluginRoot+"&sub=support",method:"POST"},a&&!o&&j.a.createElement("input",{type:"submit",className:"button button-secondary",value:Object(N.translate)("Switch to this API")}),a&&o&&j.a.createElement("span",null,Object(N.translate)("Current API")),j.a.createElement("input",{type:"hidden",name:"rest_api",value:t.value}),j.a.createElement("input",{type:"hidden",name:"_wpnonce",value:gt()}),j.a.createElement("input",{type:"hidden",name:"action",value:"rest_api"})),j.a.createElement("h4",null,t.text),j.a.createElement("p",null,"URL: ",j.a.createElement("code",null,j.a.createElement(fn,{url:r[t.value]},r[t.value]))),j.a.createElement(Ia,{result:n}))};n(76);function La(e){return(La="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Fa(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)}}function Ma(e,t){return(Ma=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function za(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Wa(e);if(t){var o=Wa(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ua(this,n)}}function Ua(e,t){return!t||"object"!==La(t)&&"function"!=typeof t?Ha(e):t}function Ha(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wa(e){return(Wa=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ba(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var $a="warning-not-selected",Va=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ma(e,t)}(a,e);var t,n,r,o=za(a);function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),Ba(Ha(t=o.call(this,e)),"onRetry",(function(e){e.preventDefault,t.setState({showing:!1}),t.onTry()})),Ba(Ha(t),"onShow",(function(){t.setState({showing:!0})})),t.state={showing:!1},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.onTry()}},{key:"onTry",value:function(){var e=this.props.routes,t=Object.keys(e).map((function(t){return{id:t,url:e[t]}}));this.props.onCheckApi(t.filter((function(e){return e})))}},{key:"getPercent",value:function(e,t){if(0===Object.keys(e).length)return 0;for(var n=2*t.length,r=0,o=0;o<Object.keys(e).length;o++){var a=Object.keys(e)[o];e[a]&&e[a].GET&&"loading"!==e[a].GET.status&&r++,e[a]&&e[a].POST&&"loading"!==e[a].POST.status&&r++}return Math.round(r/n*100)}},{key:"getApiStatus",value:function(e,t,n){var r,o=Object.keys(e).filter((function(t){return(n=e[t]).GET&&n.POST&&("fail"===n.GET.status||"fail"===n.POST.status);var n})).length;return 0===o?"ok":o<t.length?(r=e[n]).GET&&r.POST&&"ok"===r.GET.status&&"ok"===r.POST.status?"warning-current":$a:"fail"}},{key:"getApiStatusText",value:function(e){return"ok"===e?Object(N.translate)("Good"):"warning-current"===e?Object(N.translate)("Working but some issues"):e===$a?Object(N.translate)("Not working but fixable"):Object(N.translate)("Unavailable")}},{key:"canShowProblem",value:function(e){return this.state.showing||"fail"===e||e===$a}},{key:"renderError",value:function(e){var t=this.canShowProblem(e),n=Object(N.translate)("There are some problems connecting to your REST API. It is not necessary to fix these problems and the plugin is able to work.");return"fail"===e?n=Object(N.translate)("Your REST API is not working and the plugin will not be able to continue until this is fixed."):e===$a&&(n=Object(N.translate)("You are using a broken REST API route. Changing to a working API should fix the problem.")),j.a.createElement("div",{className:"api-result-log"},j.a.createElement("p",null,j.a.createElement("strong",null,Object(N.translate)("Summary")),": ",n),!t&&j.a.createElement("p",null,j.a.createElement("button",{className:"button-secondary",onClick:this.onShow},Object(N.translate)("Show Problems"))))}},{key:"render",value:function(){var e=Bt(),t=this.props,n=t.apiTest,r=t.routes,o=t.current,a=t.allowChange,i=this.state.showing,l=this.getPercent(n,e),u=this.getApiStatus(n,e,o),c=l>=100&&this.canShowProblem(u)||i,s=gn()({"api-result-status":!0,"api-result-status_good":"ok"===u&&l>=100,"api-result-status_problem":"warning-current"===u&&l>=100,"api-result-status_failed":("fail"===u||u===$a)&&l>=100});return j.a.createElement("div",{className:"api-result-wrapper"},j.a.createElement("div",{className:"api-result-header"},j.a.createElement("strong",null,"REST API:"),j.a.createElement("div",{className:"api-result-progress"},j.a.createElement("span",{className:s},l<100&&Object(N.translate)("Testing - %s%%",{args:[l]}),l>=100&&this.getApiStatusText(u)),l<100&&j.a.createElement(yr,null)),l>=100&&"ok"!==u&&j.a.createElement("button",{className:"button button-secondary api-result-retry",onClick:this.onRetry},Object(N.translate)("Check Again"))),l>=100&&"ok"!==u&&this.renderError(u),c&&e.map((function(e,t){return j.a.createElement(Da,{item:e,result:(i=n,l=e.value,i&&i[l]?i[l]:{}),routes:r,key:t,isCurrent:o===e.value,allowChange:a});var i,l})))}}])&&Fa(t.prototype,n),r&&Fa(t,r),a}(j.a.Component);Ba(Va,"defaultProps",{allowChange:!0});var qa=be((function(e){var t=e.settings,n=t.api,r=n.routes,o=n.current;return{apiTest:t.apiTest,routes:r,current:o}}),(function(e){return{onCheckApi:function(t){e(function(e){return function(t){for(var n=function(n){var r=e[n],o=r.id,a=r.url;t({type:"SETTING_API_TRY",id:o,method:"GET"}),t({type:"SETTING_API_TRY",id:o,method:"POST"}),setTimeout((function(){jt(kt.checkApi(a)).then((function(){t({type:"SETTING_API_SUCCESS",id:o,method:"GET"})})).catch((function(e){t({type:"SETTING_API_FAILED",id:o,method:"GET",error:e})})),jt(kt.checkApi(a,!0)).then((function(){t({type:"SETTING_API_SUCCESS",id:o,method:"POST"})})).catch((function(e){t({type:"SETTING_API_FAILED",id:o,method:"POST",error:e})}))}),1e3)},r=0;r<e.length;r++)n(r)}}(t))}}}))(Va);n(78);function Qa(e){return(Qa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ga(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ka(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)}}function Ya(e,t){return(Ya=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Xa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ei(e);if(t){var o=ei(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ja(this,n)}}function Ja(e,t){return!t||"object"!==Qa(t)&&"function"!=typeof t?Za(e):t}function Za(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ei(e){return(ei=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ti(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ni=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ya(e,t)}(a,e);var t,n,r,o=Xa(a);function a(){var e;Ga(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return ti(Za(e=o.call.apply(o,[this].concat(n))),"onClick",(function(){e.props.onClear()})),e}return t=a,(n=[{key:"componentDidUpdate",value:function(e){0===e.errors.length&&this.props.errors.length>0&&window.scrollTo(0,0)}},{key:"getDebug",value:function(e){for(var t=[SearchRegexi10n.versions],n=0;n<e.length;n++){var r=e[n].request,o=void 0!==r&&r;t.push(""),t.push("Error: "+this.getErrorDetails(e[n])),o&&o.status&&o.statusText&&(t.push("Action: "+o.action),o.params&&t.push("Params: "+JSON.stringify(o.params)),t.push("Code: "+o.status+" "+o.statusText)),o&&t.push("Raw: "+(o.raw?o.raw:"-no data-"))}return t}},{key:"getErrorDetails",value:function(e){return 0===e.code?e.message:e.data&&e.data.wpdb?"".concat(e.message," (").concat(e.code,"): ").concat(e.data.wpdb):e.code?"".concat(e.message," (").concat(e.code,")"):e.message}},{key:"removeSameError",value:function(e){return e.filter((function(t,n){for(var r=n+1;n<e.length-1;n++){if(t.code&&e[r].code&&t.code===e[r].code)return!1;if(t.message&&e[r].message&&t.message===e[r].message)return!1}return!0}))}},{key:"renderDebug",value:function(e){var t="mailto:john@search-regex?subject=Search%20Regex%20Error&body="+encodeURIComponent(e.join("\n")),n="https://github.com/johngodley/search-regex/issues/new?title=Search%20Regex%20Error&body="+encodeURIComponent("```\n"+e.join("\n")+"\n```\n\n");return j.a.createElement(j.a.Fragment,null,j.a.createElement("p",null,Object(N.translate)("Please {{strong}}create an issue{{/strong}} or send it in an {{strong}}email{{/strong}}.",{components:{strong:j.a.createElement("strong",null)}})),j.a.createElement("p",null,j.a.createElement("a",{href:n,className:"button-primary"},Object(N.translate)("Create An Issue"))," ",j.a.createElement("a",{href:t,className:"button-secondary"},Object(N.translate)("Email"))),j.a.createElement("p",null,Object(N.translate)("Include these details in your report along with a description of what you were doing and a screenshot.")),j.a.createElement("p",null,j.a.createElement(Vr,{readOnly:!0,cols:"120",value:e.join("\n"),spellCheck:!1})))}},{key:"renderNonce",value:function(e){return j.a.createElement("div",{className:"red-error"},j.a.createElement("h2",null,Object(N.translate)("You are not authorised to access this page.")),j.a.createElement("p",null,Object(N.translate)("This is usually fixed by doing one of these:")),j.a.createElement("ol",null,j.a.createElement("li",null,Object(N.translate)("Reload the page - your current session is old.")),j.a.createElement("li",null,Object(N.translate)("Log out, clear your browser cache, and log in again - your browser has cached an old session.")),j.a.createElement("li",null,Object(N.translate)("Your admin pages are being cached. Clear this cache and try again."))),j.a.createElement("p",null,Object(N.translate)("The problem is almost certainly caused by one of the above.")),j.a.createElement("h3",null,Object(N.translate)("That didn't help")),this.renderDebug(e))}},{key:"renderError",value:function(e){var t=this.removeSameError(e),n=this.getDebug(t);return e.length>0&&"rest_cookie_invalid_nonce"===e[0].code?this.renderNonce(n):j.a.createElement("div",{className:"red-error"},j.a.createElement("div",{className:"closer",onClick:this.onClick},"✖"),j.a.createElement("h2",null,Object(N.translate)("Something went wrong 🙁")),j.a.createElement("div",{className:"red-error_title"},t.map((function(e,t){return j.a.createElement(Ea,{error:e,key:t})}))),j.a.createElement(qa,null),j.a.createElement("h3",null,Object(N.translate)("What do I do next?")),j.a.createElement("ol",null,j.a.createElement("li",null,Object(N.translate)('Take a look at the {{link}}plugin status{{/link}}. It may be able to identify and "magic fix" the problem.',{components:{link:j.a.createElement("a",{href:"?page=search-regex.php&sub=support"})}})),j.a.createElement("li",null,Object(N.translate)("{{link}}Caching software{{/link}}, in particular Cloudflare, can cache the wrong thing. Try clearing all your caches.",{components:{link:j.a.createElement(fn,{url:"https://searchregex.com/support/problems/cloudflare/"})}})),j.a.createElement("li",null,Object(N.translate)("{{link}}Please temporarily disable other plugins!{{/link}} This fixes so many problems.",{components:{link:j.a.createElement(fn,{url:"https://searchregex.com/support/problems/plugins/"})}})),j.a.createElement("li",null,Object(N.translate)("If you are using WordPress 5.2 or newer then look at your {{link}}Site Health{{/link}} and resolve any issues.",{components:{link:j.a.createElement(fn,{url:"/wp-admin/site-health.php"})}}))),j.a.createElement("h3",null,Object(N.translate)("That didn't help")),this.renderDebug(n))}},{key:"render",value:function(){var e=this.props.errors;return 0===e.length?null:this.renderError(e)}}])&&Ka(t.prototype,n),r&&Ka(t,r),a}(j.a.Component);var ri=be((function(e){return{errors:e.message.errors}}),(function(e){return{onClear:function(){e({type:"MESSAGE_CLEAR_ERRORS"})}}}))(ni);n(80);function oi(e){return(oi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ai(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)}}function ii(e,t){return(ii=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function li(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=si(e);if(t){var o=si(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ui(this,n)}}function ui(e,t){return!t||"object"!==oi(t)&&"function"!=typeof t?ci(e):t}function ci(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function si(e){return(si=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function fi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var pi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ii(e,t)}(a,e);var t,n,r,o=li(a);function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),fi(ci(t=o.call(this,e)),"onClick",(function(){t.state.shrunk?t.setState({shrunk:!1}):t.props.onClear()})),fi(ci(t),"onShrink",(function(){t.setState({shrunk:!0})})),t.state={shrunk:!1,width:"auto"},t}return t=a,(n=[{key:"getSnapshotBeforeUpdate",value:function(e){return this.props.notices!==e.notices&&(this.stopTimer(),this.setState({shrunk:!1}),this.startTimer()),null}},{key:"componentWillUnmount",value:function(){this.stopTimer()}},{key:"stopTimer",value:function(){clearTimeout(this.timer)}},{key:"startTimer",value:function(){this.timer=setTimeout(this.onShrink,5e3)}},{key:"getNotice",value:function(e){return e.length>1?e[e.length-1]+" ("+e.length+")":e[0]}},{key:"renderNotice",value:function(e){var t="notice notice-info redirection-notice"+(this.state.shrunk?" redirection-notice_shrunk":"");return j.a.createElement("div",{className:t,onClick:this.onClick},j.a.createElement("div",{className:"closer"},"✔"),j.a.createElement("p",null,this.state.shrunk?j.a.createElement("span",{title:Object(N.translate)("View notice")},"🔔"):this.getNotice(e)))}},{key:"render",value:function(){var e=this.props.notices;return 0===e.length?null:this.renderNotice(e)}}])&&ai(t.prototype,n),r&&ai(t,r),a}(j.a.Component);var di=be((function(e){return{notices:e.message.notices}}),(function(e){return{onClear:function(){e({type:"MESSAGE_CLEAR_NOTICES"})}}}))(pi),hi=function(e){var t=e.item,n=e.isCurrent,r=e.onClick,o=SearchRegexi10n.pluginRoot+(""===t.value?"":"&sub="+t.value);return j.a.createElement("li",null,j.a.createElement("a",{className:n?"current":"",href:o,onClick:function(e){e.preventDefault(),r(t.value,o)}},t.name))};function mi(e){return-1!==SearchRegexi10n.caps.pages.indexOf(e)}n(82);var gi=function(e,t){return e===t.value||"search"===e&&""===t.value},yi=function(e){var t=e.onChangePage,n=e.current,r=[{name:Object(N.translate)("Search & Replace"),value:""},{name:Object(N.translate)("Options"),value:"options"},{name:Object(N.translate)("Support"),value:"support"}].filter((function(e){return mi(e.value)||""===e.value&&mi("search")}));return r.length<2?null:j.a.createElement("div",{className:"subsubsub-container"},j.a.createElement("ul",{className:"subsubsub"},r.map((function(e,r){return j.a.createElement(hi,{key:r,item:e,isCurrent:gi(n,e),onClick:t})})).reduce((function(e,t){return[e," | ",t]}))))};n(84);function bi(e){return(bi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vi(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)}}function wi(e,t){return(wi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ei(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Si(e);if(t){var o=Si(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return xi(this,n)}}function xi(e,t){return!t||"object"!==bi(t)&&"function"!=typeof t?_i(e):t}function _i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Si(e){return(Si=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Oi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ki=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&wi(e,t)}(a,e);var t,n,r,o=Ei(a);function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),Oi(_i(t=o.call(this,e)),"onPageChanged",(function(){var e=Ze();t.changePage(e),t.setState({page:e,clicked:t.state.clicked+1})})),Oi(_i(t),"onChangePage",(function(e,n){""===e&&(e="search"),t.props.onClear(),history.pushState({},null,n),t.changePage(e),t.setState({page:e,clicked:t.state.clicked+1})})),t.state={page:Ze(),clicked:0,stack:!1,error:"2.0"!==SearchRegexi10n.version,info:!1},window.addEventListener("popstate",t.onPageChanged),t}return t=a,(n=[{key:"componentDidCatch",value:function(e,t){this.setState({error:!0,stack:e,info:t})}},{key:"componentWillUnmount",value:function(){window.removeEventListener("popstate",this.onPageChanged)}},{key:"changePage",value:function(e){}},{key:"getContent",value:function(e){switch(this.state.clicked,e){case"support":return j.a.createElement(hn,null);case"options":return j.a.createElement(sn,null)}return j.a.createElement(va,null)}},{key:"renderError",value:function(){var e=[SearchRegexi10n.versions,"Buster: 2.0 === "+SearchRegexi10n.version,"",this.state.stack];return this.state.info&&this.state.info.componentStack&&e.push(this.state.info.componentStack),"2.0"!==SearchRegexi10n.version?j.a.createElement("div",{className:"red-error"},j.a.createElement("h2",null,Object(N.translate)("Cached Search Regex detected")),j.a.createElement("p",null,Object(N.translate)("Please clear your browser cache and reload this page.")),j.a.createElement("p",null,Object(N.translate)("If you are using a caching system such as Cloudflare then please read this: "),j.a.createElement(fn,{url:"https://searchregex.com/support/problems/cloudflare/"},Object(N.translate)("clearing your cache."))),j.a.createElement("p",null,j.a.createElement("textarea",{readOnly:!0,rows:e.length+3,cols:"120",value:e.join("\n"),spellCheck:!1}))):j.a.createElement("div",{className:"red-error"},j.a.createElement("h2",null,Object(N.translate)("Something went wrong 🙁")),j.a.createElement("p",null,Object(N.translate)("Search Regex is not working. Try clearing your browser cache and reloading this page."),"  ",Object(N.translate)("If you are using a page caching plugin or service (CloudFlare, OVH, etc) then you can also try clearing that cache.")),j.a.createElement("p",null,Object(N.translate)("If that doesn't help, open your browser's error console and create a {{link}}new issue{{/link}} with the details.",{components:{link:j.a.createElement(fn,{url:"https://github.com/johngodley/searchregex/issues"})}})),j.a.createElement("p",null,Object(N.translate)("Please mention {{code}}%s{{/code}}, and explain what you were doing at the time",{components:{code:j.a.createElement("code",null)},args:this.state.page})),j.a.createElement("p",null,j.a.createElement("textarea",{readOnly:!0,rows:e.length+8,cols:"120",value:e.join("\n"),spellCheck:!1})))}},{key:"render",value:function(){var e=this.state,t=e.error,n=e.page,r={search:Object(N.translate)("Search Regex"),options:Object(N.translate)("Options"),support:Object(N.translate)("Support")}[n];return t?this.renderError():j.a.createElement("div",{className:"wrap searchregex"},j.a.createElement("h1",{className:"wp-heading-inline"},r),j.a.createElement(yi,{onChangePage:this.onChangePage,current:n}),j.a.createElement(ri,null),this.getContent(n),j.a.createElement(di,null))}}])&&vi(t.prototype,n),r&&vi(t,r),a}(j.a.Component);var Pi,Ti=be((function(e){return{errors:e.message.errors}}),(function(e){return{onClear:function(){e({type:"MESSAGE_CLEAR_ERRORS"})}}}))(ki),ji=function(){return j.a.createElement(H,{store:nt({settings:rt(),search:{results:[],replacements:[],replacing:[],replaceAll:!1,replaceCount:0,phraseCount:0,search:(e=Je(),st({searchPhrase:e.searchphrase?e.searchphrase:"",searchFlags:e.searchflags?e.searchflags:["case"],source:e.source?e.source:["posts"],sourceFlags:e.sourceflags?e.sourceflags:[],replacement:"",perPage:e.perpage?e.perpage:25})),searchDirection:null,searchedPhrase:"",requestCount:0,totals:{},progress:{},status:null,showLoading:!1,sources:SearchRegexi10n.preload&&SearchRegexi10n.preload.sources?SearchRegexi10n.preload.sources:[],sourceFlags:SearchRegexi10n.preload&&SearchRegexi10n.preload.source_flags?SearchRegexi10n.preload.source_flags:[],rawData:null,canCancel:!1},message:{errors:[],notices:[],inProgress:0,saving:[]}})},j.a.createElement(j.a.StrictMode,null,j.a.createElement(Ti,null)));var e};document.querySelector("#react-ui")&&(Pi="react-ui",A.a.setLocale({"":{localeSlug:SearchRegexi10n.localeSlug}}),A.a.addTranslations(SearchRegexi10n.locale),R.a.render(j.a.createElement(ji,null),document.getElementById(Pi))),window.searchregex=SearchRegexi10n.version}]);
search-regex.php CHANGED
@@ -1,144 +1,111 @@
1
  <?php
 
2
  /*
3
  Plugin Name: Search Regex
4
- Plugin URI: http://urbangiraffe.com/plugins/search-regex
5
- Description: Adds search &amp; replace functionality across posts, pages, comments, and meta-data, with full regular expression support
 
6
  Author: John Godley
7
- Version: 1.4.16
8
- Author URI: http://urbangiraffe.com/
 
 
 
 
 
 
 
 
 
 
 
9
  */
10
 
11
- class SearchRegex {
12
- private static $instance = null;
13
-
14
- static function init() {
15
- if ( is_admin() ) {
16
- if ( is_null( self::$instance ) ) {
17
- self::$instance = new SearchRegex();
18
-
19
- load_plugin_textdomain( 'search-regex', false, dirname( plugin_basename( __FILE__ ) ).'/locale/' );
20
- }
21
-
22
- return self::$instance;
23
- }
 
 
 
 
24
  }
25
 
26
- function __construct() {
27
- add_filter( 'admin_menu', array( &$this, 'admin_menu' ) );
28
- add_action( 'load-tools_page_search-regex', array( &$this, 'search_head' ) );
29
- }
30
-
31
- function search_head() {
32
- include dirname( __FILE__ ).'/models/search.php';
33
- include dirname( __FILE__ ).'/models/result.php';
34
 
35
- wp_enqueue_style( 'search-regex', plugin_dir_url( __FILE__ ).'admin.css' );
 
 
 
 
 
 
 
 
 
 
 
36
  }
37
 
38
- function admin_menu() {
39
- if ( current_user_can( 'administrator' ) ) {
40
- add_management_page( __( 'Search Regex', 'search-regex' ), __( 'Search Regex', 'search-regex' ), 'administrator', basename( __FILE__ ), array( &$this, 'admin_screen' ) );
41
- }
42
- elseif ( current_user_can( 'search_regex_read' ) ) {
43
- add_management_page( __( 'Search Regex', 'search-regex' ), __( 'Search Regex', 'search-regex' ), 'search_regex_read', basename( __FILE__ ), array( &$this, 'admin_screen' ) );
44
- }
 
 
 
 
45
  }
46
 
47
- function admin_screen() {
48
- $searches = Search::get_searches();
49
-
50
- if ( isset( $_POST['search_pattern'] ) && ! wp_verify_nonce( $_POST['search-regex-nonce'], 'search' ) ) {
51
- return;
52
- }
53
-
54
- $search_pattern = $replace_pattern = '';
55
- if ( isset( $_POST['search_pattern'] ) ) {
56
- $search_pattern = stripslashes( $_POST['search_pattern'] );
57
- }
58
-
59
- if ( isset( $_POST['replace_pattern'] ) ) {
60
- $replace_pattern = stripslashes( $_POST['replace_pattern'] );
61
- }
62
-
63
- $search_pattern = str_replace( "\'", "'", $search_pattern );
64
- $replace_pattern = str_replace( "\'", "'", $replace_pattern );
65
- $orderby = 'asc';
66
-
67
- if ( isset( $_POST['orderby'] ) && $_POST['orderby'] === 'desc' ) {
68
- $orderby = 'desc';
69
- }
70
-
71
- $limit = isset( $_POST['limit'] ) ? intval( $_POST['limit'] ) : 10;
72
- $offset = 0;
73
- $source = isset( $_POST['source'] ) ? stripslashes( $_POST['source'] ) : '';
74
-
75
- if ( Search::valid_search( $source ) && ( isset( $_POST['search'] ) || isset( $_POST['replace'] ) || isset( $_POST['replace_and_save'] ) ) ) {
76
- $klass = stripslashes( $source );
77
- $searcher = new $klass;
78
-
79
- if ( isset( $_POST['regex'] ) ) {
80
- $searcher->set_regex_options( isset( $_POST['regex_dot'] ) ? $_POST['regex_dot'] : false, isset( $_POST['regex_case'] ) ? $_POST['regex_case'] : false, isset( $_POST['regex_multi'] ) ? $_POST['regex_multi'] : false );
81
- }
82
-
83
- // Make sure no one sneaks in with a replace
84
- if ( ! current_user_can( 'administrator' ) && ! current_user_can( 'search_regex_write' ) ) {
85
- unset( $_POST['replace'] );
86
- unset( $_POST['replace_and_save'] );
87
- $_POST['search'] = 'search';
88
- }
89
-
90
- $results = array();
91
-
92
- if ( isset( $_POST['search'] ) ) {
93
- $results = $searcher->search_for_pattern( $search_pattern, $limit, $offset, $orderby );
94
- }
95
- elseif ( isset( $_POST['replace'] ) ) {
96
- $results = $searcher->search_and_replace( $search_pattern, $replace_pattern, $limit, $offset, $orderby );
97
- }
98
- elseif ( isset( $_POST['replace_and_save'] ) ) {
99
- $results = $searcher->search_and_replace( $search_pattern, $replace_pattern, $limit, $offset, $orderby, true );
100
- }
101
-
102
- if ( ! is_array( $results ) ) {
103
- $this->render_error( $results );
104
- }
105
- elseif ( isset( $_POST['replace_and_save'] ) ) {
106
- ?>
107
- <div class="updated" id="message" onclick="this.parentNode.removeChild (this)">
108
- <p><?php printf( _n( '%d occurrence replaced', '%d occurrences replaced', count( $results ) ), count( $results ) ) ?></p>
109
- </div>
110
- <?php
111
- }
112
 
113
- $this->render( 'search', array( 'search' => $search_pattern, 'replace' => $replace_pattern, 'searches' => $searches, 'source' => $source ) );
 
 
 
 
 
 
 
114
 
115
- if ( is_array( $results ) && ! isset( $_POST['replace_and_save'] ) ) {
116
- $this->render( 'results', array( 'search' => $searcher, 'results' => $results ) );
117
- }
118
- }
119
- else {
120
- $this->render( 'search', array( 'search' => $search_pattern, 'replace' => $replace_pattern, 'searches' => $searches, 'source' => $source ) );
121
- }
122
- }
123
 
124
- private function render( $template, $template_vars = array() ) {
125
- foreach ( $template_vars as $key => $val ) {
126
- $$key = $val;
127
- }
128
 
129
- if ( file_exists( dirname( __FILE__ )."/view/$template.php" ) )
130
- include dirname( __FILE__ )."/view/$template.php";
131
- }
 
 
 
 
 
 
132
 
133
- function render_error( $message ) {
134
- ?>
135
- <div class="fade error" id="message">
136
- <p><?php echo $message ?></p>
137
- </div>
138
- <?php
139
- }
140
  }
141
 
142
- if ( is_admin() ) {
143
- add_action( 'init', array( 'SearchRegex', 'init' ) );
144
  }
 
 
 
1
  <?php
2
+
3
  /*
4
  Plugin Name: Search Regex
5
+ Plugin URI: https://searchregex.com/
6
+ Description: Adds search and replace functionality across posts, pages, comments, and meta-data, with full regular expression support
7
+ Version: 2.0
8
  Author: John Godley
9
+ Text Domain: search-regex
10
+ Domain Path: /locale
11
+ ============================================================================================================
12
+ This software is provided "as is" and any express or implied warranties, including, but not limited to, the
13
+ implied warranties of merchantibility and fitness for a particular purpose are disclaimed. In no event shall
14
+ the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or
15
+ consequential damages(including, but not limited to, procurement of substitute goods or services; loss of
16
+ use, data, or profits; or business interruption) however caused and on any theory of liability, whether in
17
+ contract, strict liability, or tort(including negligence or otherwise) arising in any way out of the use of
18
+ this software, even if advised of the possibility of such damage.
19
+
20
+ For full license details see license.txt
21
+ ============================================================================================================
22
  */
23
 
24
+ define( 'SEARCHREGEX_FILE', __FILE__ );
25
+ define( 'SEARCHREGEX_DEV_MODE', false );
26
+
27
+ // This file must support PHP < 5.6 so as not to crash
28
+ if ( version_compare( phpversion(), '5.6' ) < 0 ) {
29
+ add_action( 'plugin_action_links_' . basename( dirname( SEARCHREGEX_FILE ) ) . '/' . basename( SEARCHREGEX_FILE ), 'searchregex_deprecated_php', 10, 4 );
30
+
31
+ /**
32
+ * Show a deprecated PHP warning in the plugin page
33
+ *
34
+ * @param Array $links Plugin links.
35
+ * @return Array
36
+ */
37
+ function searchregex_deprecated_php( $links ) {
38
+ /* translators: 1: server PHP version. 2: required PHP version. */
39
+ array_unshift( $links, '<a href="https://searchregex.com/support/problems/php-version/" style="color: red; text-decoration: underline">' . sprintf( __( 'Disabled! Detected PHP %1$s, need PHP %2$s+', 'search-regex' ), phpversion(), '5.6' ) . '</a>' );
40
+ return $links;
41
  }
42
 
43
+ return;
44
+ }
 
 
 
 
 
 
45
 
46
+ require_once __DIR__ . '/search-regex-version.php';
47
+ require_once __DIR__ . '/search-regex-settings.php';
48
+ require_once __DIR__ . '/search-regex-capabilities.php';
49
+
50
+ /**
51
+ * Is the request for WP CLI?
52
+ *
53
+ * @return Bool
54
+ */
55
+ function searchregex_is_wpcli() {
56
+ if ( defined( 'WP_CLI' ) && WP_CLI ) {
57
+ return true;
58
  }
59
 
60
+ return false;
61
+ }
62
+
63
+ /**
64
+ * Is the request for Search Regex admin?
65
+ *
66
+ * @return Bool
67
+ */
68
+ function searchregex_is_admin() {
69
+ if ( is_admin() ) {
70
+ return true;
71
  }
72
 
73
+ return false;
74
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
 
76
+ /**
77
+ * Start the Search Regex REST API
78
+ *
79
+ * @return void
80
+ */
81
+ function searchregex_start_rest() {
82
+ require_once __DIR__ . '/search-regex-admin.php';
83
+ require_once __DIR__ . '/api/api.php';
84
 
85
+ Search_Regex_Api::init();
86
+ Search_Regex_Admin::init();
 
 
 
 
 
 
87
 
88
+ remove_action( 'rest_api_init', 'searchregex_start_rest' );
89
+ }
 
 
90
 
91
+ /**
92
+ * Set the Search Regex text domain
93
+ *
94
+ * @return void
95
+ */
96
+ function searchregex_locale() {
97
+ /** @psalm-suppress PossiblyFalseArgument */
98
+ load_plugin_textdomain( 'search-regex', false, dirname( plugin_basename( SEARCHREGEX_FILE ) ) . '/locale/' );
99
+ }
100
 
101
+ if ( searchregex_is_admin() || searchregex_is_wpcli() ) {
102
+ require_once __DIR__ . '/search-regex-admin.php';
103
+ require_once __DIR__ . '/api/api.php';
 
 
 
 
104
  }
105
 
106
+ if ( searchregex_is_wpcli() ) {
107
+ require_once __DIR__ . '/search-regex-cli.php';
108
  }
109
+
110
+ add_action( 'rest_api_init', 'searchregex_start_rest' );
111
+ add_action( 'init', 'searchregex_locale' );
searches/comment_author.php DELETED
@@ -1,66 +0,0 @@
1
- <?php
2
-
3
- class SearchCommentAuthor extends Search {
4
- function find( $pattern, $limit, $offset, $orderby ) {
5
- global $wpdb;
6
-
7
- if ($orderby == 'id')
8
- $order = 'comment_ID ASC';
9
- else
10
- $order = 'comment_date DESC';
11
-
12
- $results = array();
13
- $sql = "SELECT {$wpdb->comments}.comment_ID AS comment_ID, {$wpdb->comments}.comment_post_ID AS comment_post_ID, {$wpdb->comments}.comment_author AS comment_author, {$wpdb->posts}.post_title AS post_title FROM {$wpdb->comments},{$wpdb->posts} WHERE {$wpdb->comments}.comment_approved='1' AND {$wpdb->posts}.ID={$wpdb->comments}.comment_post_ID ORDER BY {$wpdb->comments}.comment_ID $orderby";
14
- if ( $limit > 0 ) {
15
- $sql .= $wpdb->prepare( "LIMIT %d,%d", $offset, $limit );
16
- }
17
-
18
- $comments = $wpdb->get_results( $sql );
19
- if ( count( $comments ) > 0 ) {
20
- foreach ( $comments as $comment ) {
21
- if (($matches = $this->matches ($pattern, $comment->comment_author, $comment->comment_ID)))
22
- {
23
- foreach ($matches AS $match)
24
- {
25
- $match->sub_id = $comment->comment_post_ID;
26
- $match->title = $comment->post_title;
27
- }
28
-
29
- $results = array_merge ($results, $matches);
30
- }
31
- }
32
- }
33
-
34
- return $results;
35
- }
36
-
37
- function get_options ($result)
38
- {
39
- $options[] = '<a href="'.get_permalink ($result->sub_id).'">'.__ ('view post', 'search-regex').'</a>';
40
-
41
- if (current_user_can ('edit_post', $result->id))
42
- $options[] = '<a href="'.get_bloginfo ('wpurl').'/wp-admin/comment.php?action=editcomment&amp;c='.$result->id.'">'.__ ('edit','search-regex').'</a>';
43
- return $options;
44
- }
45
-
46
- function show ($result)
47
- {
48
- printf (__ ('Comment #%d: %s', 'search-regex'), $result->id, $result->title);
49
- }
50
-
51
- function name () { return __ ('Comment author', 'search-regex'); }
52
-
53
- function get_content ($id)
54
- {
55
- global $wpdb;
56
-
57
- $row = $wpdb->get_row ($wpdb->prepare( "SELECT comment_author FROM {$wpdb->comments} WHERE comment_ID=%d", $id ) );
58
- return $row->comment_content;
59
- }
60
-
61
- function replace_content ($id, $content)
62
- {
63
- global $wpdb;
64
- $wpdb->query ($wpdb->prepare( "UPDATE {$wpdb->comments} SET comment_author=%s WHERE comment_ID=%d", $content, $id ) );
65
- }
66
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
searches/comment_author_email.php DELETED
@@ -1,66 +0,0 @@
1
- <?php
2
-
3
- class SearchCommentAuthorEmail extends Search {
4
- function find( $pattern, $limit, $offset, $orderby ) {
5
- global $wpdb;
6
-
7
- if ($orderby == 'id')
8
- $order = 'comment_ID ASC';
9
- else
10
- $order = 'comment_date DESC';
11
-
12
- $results = array ();
13
- $sql = "SELECT {$wpdb->comments}.comment_ID AS comment_ID, {$wpdb->comments}.comment_post_ID AS comment_post_ID, {$wpdb->comments}.comment_author_email AS comment_author_email, {$wpdb->posts}.post_title AS post_title FROM {$wpdb->comments},{$wpdb->posts} WHERE {$wpdb->comments}.comment_approved='1' AND {$wpdb->posts}.ID={$wpdb->comments}.comment_post_ID ORDER BY {$wpdb->comments}.comment_ID $orderby";
14
- if ( $limit > 0 ) {
15
- $sql .= $wpdb->prepare( "LIMIT %d,%d", $offset, $limit );
16
- }
17
-
18
- $comments = $wpdb->get_results( $sql );
19
- if ( count( $comments ) > 0 ) {
20
- foreach ( $comments as $comment ) {
21
- if (($matches = $this->matches ($pattern, $comment->comment_author_email, $comment->comment_ID)))
22
- {
23
- foreach ($matches AS $match)
24
- {
25
- $match->sub_id = $comment->comment_post_ID;
26
- $match->title = $comment->post_title;
27
- }
28
-
29
- $results = array_merge ($results, $matches);
30
- }
31
- }
32
- }
33
-
34
- return $results;
35
- }
36
-
37
- function get_options ($result)
38
- {
39
- $options[] = '<a href="'.get_permalink ($result->sub_id).'">'.__ ('view post', 'search-regex').'</a>';
40
-
41
- if (current_user_can ('edit_post', $result->id))
42
- $options[] = '<a href="'.get_bloginfo ('wpurl').'/wp-admin/comment.php?action=editcomment&amp;c='.$result->id.'">'.__ ('edit','search-regex').'</a>';
43
- return $options;
44
- }
45
-
46
- function show ($result)
47
- {
48
- printf (__ ('Comment #%d: %s', 'search-regex'), $result->id, $result->title);
49
- }
50
-
51
- function name () { return __ ('Comment author email', 'search-regex'); }
52
-
53
- function get_content ($id)
54
- {
55
- global $wpdb;
56
-
57
- $row = $wpdb->get_row ($wpdb->prepare( "SELECT comment_author_email FROM {$wpdb->comments} WHERE comment_ID=%d", $id ) );
58
- return $row->comment_author_email;
59
- }
60
-
61
- function replace_content ($id, $content)
62
- {
63
- global $wpdb;
64
- $wpdb->query ($wpdb->prepare( "UPDATE {$wpdb->comments} SET comment_author_email=%s WHERE comment_ID=%d", $content, $id ) );
65
- }
66
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
searches/comment_author_url.php DELETED
@@ -1,66 +0,0 @@
1
- <?php
2
-
3
- class SearchCommentAuthorURL extends Search {
4
- function find( $pattern, $limit, $offset, $orderby ) {
5
- global $wpdb;
6
-
7
- if ($orderby == 'id')
8
- $order = 'comment_ID ASC';
9
- else
10
- $order = 'comment_date DESC';
11
-
12
- $results = array();
13
- $sql = "SELECT {$wpdb->comments}.comment_ID AS comment_ID, {$wpdb->comments}.comment_post_ID AS comment_post_ID, {$wpdb->comments}.comment_author_url AS comment_author_url, {$wpdb->posts}.post_title AS post_title FROM {$wpdb->comments},{$wpdb->posts} WHERE {$wpdb->comments}.comment_approved='1' AND {$wpdb->posts}.ID={$wpdb->comments}.comment_post_ID ORDER BY {$wpdb->comments}.comment_ID $orderby";
14
- if ( $limit > 0 ) {
15
- $sql .= $wpdb->prepare( "LIMIT %d,%d", $offset, $limit );
16
- }
17
-
18
- $comments = $wpdb->get_results( $sql );
19
- if ( count( $comments ) > 0 ) {
20
- foreach ( $comments as $comment ) {
21
- if (($matches = $this->matches ($pattern, $comment->comment_author_url, $comment->comment_ID)))
22
- {
23
- foreach ($matches AS $match)
24
- {
25
- $match->sub_id = $comment->comment_post_ID;
26
- $match->title = $comment->post_title;
27
- }
28
-
29
- $results = array_merge ($results, $matches);
30
- }
31
- }
32
- }
33
-
34
- return $results;
35
- }
36
-
37
- function get_options ($result)
38
- {
39
- $options[] = '<a href="'.get_permalink ($result->sub_id).'">'.__ ('view post', 'search-regex').'</a>';
40
-
41
- if (current_user_can ('edit_post', $result->id))
42
- $options[] = '<a href="'.get_bloginfo ('wpurl').'/wp-admin/comment.php?action=editcomment&amp;c='.$result->id.'">'.__ ('edit','search-regex').'</a>';
43
- return $options;
44
- }
45
-
46
- function show ($result)
47
- {
48
- printf (__ ('Comment #%d: %s', 'search-regex'), $result->id, $result->title);
49
- }
50
-
51
- function name () { return __ ('Comment author URL', 'search-regex'); }
52
-
53
- function get_content ($id)
54
- {
55
- global $wpdb;
56
-
57
- $row = $wpdb->get_row ($wpdb->prepare( "SELECT comment_author_url FROM {$wpdb->comments} WHERE comment_ID=%d", $id ) );
58
- return $row->comment_author_url;
59
- }
60
-
61
- function replace_content ($id, $content)
62
- {
63
- global $wpdb;
64
- $wpdb->query ($wpdb->prepare( "UPDATE {$wpdb->comments} SET comment_author_url=%s WHERE comment_ID=%d", $content, $id ) );
65
- }
66
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
searches/comment_content.php DELETED
@@ -1,62 +0,0 @@
1
- <?php
2
-
3
- class SearchCommentContent extends Search {
4
- function find( $pattern, $limit, $offset, $orderby ) {
5
- global $wpdb;
6
-
7
- $results = array();
8
- $sql = "SELECT {$wpdb->comments}.comment_ID AS comment_ID, {$wpdb->comments}.comment_post_ID AS comment_post_ID, {$wpdb->comments}.comment_content AS comment_content, {$wpdb->posts}.post_title AS post_title FROM {$wpdb->comments},{$wpdb->posts} WHERE {$wpdb->comments}.comment_approved='1' AND {$wpdb->posts}.ID={$wpdb->comments}.comment_post_ID ORDER BY {$wpdb->comments}.comment_ID $orderby";
9
-
10
- if ( $limit > 0 ) {
11
- $sql .= $wpdb->prepare( "LIMIT %d,%d", $offset, $limit );
12
- }
13
-
14
- $comments = $wpdb->get_results( $sql );
15
- if ( count( $comments ) > 0 ) {
16
- foreach ( $comments as $comment ) {
17
- if (($matches = $this->matches ($pattern, $comment->comment_content, $comment->comment_ID)))
18
- {
19
- foreach ($matches AS $match)
20
- {
21
- $match->sub_id = $comment->comment_post_ID;
22
- $match->title = $comment->post_title;
23
- }
24
-
25
- $results = array_merge ($results, $matches);
26
- }
27
- }
28
- }
29
-
30
- return $results;
31
- }
32
-
33
- function get_options ($result)
34
- {
35
- $options[] = '<a href="'.get_permalink ($result->sub_id).'">'.__ ('view post', 'search-regex').'</a>';
36
-
37
- if (current_user_can ('edit_post', $result->id))
38
- $options[] = '<a href="'.get_bloginfo ('wpurl').'/wp-admin/comment.php?action=editcomment&amp;c='.$result->id.'">'.__ ('edit','search-regex').'</a>';
39
- return $options;
40
- }
41
-
42
- function show ($result)
43
- {
44
- printf (__ ('Comment #%d: %s', 'search-regex'), $result->id, $result->title);
45
- }
46
-
47
- function name () { return __ ('Comment content', 'search-regex'); }
48
-
49
- function get_content ($id)
50
- {
51
- global $wpdb;
52
-
53
- $row = $wpdb->get_row ($wpdb->prepare( "SELECT comment_content FROM {$wpdb->comments} WHERE comment_ID=", $id ) );
54
- return $row->comment_content;
55
- }
56
-
57
- function replace_content ($id, $content)
58
- {
59
- global $wpdb;
60
- $wpdb->query ( $wpdb->prepare( "UPDATE {$wpdb->comments} SET comment_content=%s WHERE comment_ID=%d", $content, $id ) );
61
- }
62
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
searches/post_content.php DELETED
@@ -1,59 +0,0 @@
1
- <?php
2
-
3
- class SearchPostContent extends Search {
4
- function find( $pattern, $limit, $offset, $orderby ) {
5
- global $wpdb;
6
-
7
- $sql = "SELECT ID, post_content, post_title FROM {$wpdb->posts} WHERE post_status != 'inherit' AND post_type IN ('post','page') ORDER BY ID ".$orderby;
8
-
9
- if ( $limit > 0 )
10
- $sql .= $wpdb->prepare( " LIMIT %d,%d", $offset, $limit );
11
-
12
- $results = array();
13
- $posts = $wpdb->get_results( $sql );
14
-
15
- if ( count( $posts ) > 0 ) {
16
- foreach ( $posts as $post ) {
17
- if ( ( $matches = $this->matches( $pattern, $post->post_content, $post->ID ) ) ) {
18
- foreach ( $matches AS $match ) {
19
- $match->title = $post->post_title;
20
- }
21
-
22
- $results = array_merge( $results, $matches );
23
- }
24
- }
25
- }
26
-
27
- return $results;
28
- }
29
-
30
- function get_options ($result)
31
- {
32
- $options[] = '<a href="'.get_permalink ($result->id).'">'.__ ('view', 'search-regex').'</a>';
33
-
34
- if (current_user_can ('edit_post', $result->id))
35
- $options[] = '<a href="'.get_bloginfo ('wpurl').'/wp-admin/post.php?action=edit&amp;post='.$result->id.'">'.__ ('edit','search-regex').'</a>';
36
- return $options;
37
- }
38
-
39
- function show ($result)
40
- {
41
- printf (__ ('Post #%d: %s', 'search-regex'), $result->id, $result->title);
42
- }
43
-
44
- function name () { return __ ('Post content', 'search-regex'); }
45
-
46
- function get_content ($id)
47
- {
48
- global $wpdb;
49
-
50
- $post = $wpdb->get_row ( $wpdb->prepare( "SELECT post_content FROM {$wpdb->prefix}posts WHERE id=%d", $id ) );
51
- return $post->post_content;
52
- }
53
-
54
- function replace_content ($id, $content)
55
- {
56
- global $wpdb;
57
- $wpdb->query ($wpdb->prepare( "UPDATE {$wpdb->posts} SET post_content=%s WHERE ID=%d", $content, $id ) );
58
- }
59
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
searches/post_excerpt.php DELETED
@@ -1,59 +0,0 @@
1
- <?php
2
-
3
- class SearchPostExcerpt extends Search {
4
- function find( $pattern, $limit, $offset, $orderby ) {
5
- global $wpdb;
6
-
7
- $results = array();
8
- $sql = "SELECT ID, post_title, post_excerpt FROM {$wpdb->posts} WHERE post_status != 'inherit' ORDER BY ID $orderby";
9
-
10
- if ( $limit > 0 ) {
11
- $sql .= $wpdb->prepare( "LIMIT %d,%d", $offset, $limit );
12
- }
13
-
14
- $posts = $wpdb->get_results( $sql );
15
- if ( count( $posts ) > 0 ) {
16
- foreach ( $posts as $post ) {
17
- if (($matches = $this->matches ($pattern, $post->post_excerpt, $post->ID)))
18
- {
19
- foreach ($matches AS $match)
20
- $match->title = $post->post_title;
21
-
22
- $results = array_merge ($results, $matches);
23
- }
24
- }
25
- }
26
-
27
- return $results;
28
- }
29
-
30
- function get_options ($result)
31
- {
32
- $options[] = '<a href="'.get_permalink ($result->id).'">'.__ ('view', 'search-regex').'</a>';
33
-
34
- if (current_user_can ('edit_post', $result->id))
35
- $options[] = '<a href="'.get_bloginfo ('wpurl').'/wp-admin/post.php?action=edit&amp;post='.$result->id.'">'.__ ('edit','search-regex').'</a>';
36
- return $options;
37
- }
38
-
39
- function show ($result)
40
- {
41
- printf (__ ('Post #%d: %s', 'search-regex'), $result->id, $result->title);
42
- }
43
-
44
- function name () { return __ ('Post excerpt', 'search-regex'); }
45
-
46
- function get_content ($id)
47
- {
48
- global $wpdb;
49
-
50
- $post = $wpdb->get_row ($wpdb->prepare( "SELECT post_excerpt FROM {$wpdb->prefix}posts WHERE id=%d", $id ) );
51
- return $post->post_excerpt;
52
- }
53
-
54
- function replace_content ($id, $content)
55
- {
56
- global $wpdb;
57
- $wpdb->query ($wpdb->prepare( "UPDATE {$wpdb->posts} SET post_excerpt=%s WHERE ID=%d", $content, $id ) );
58
- }
59
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
searches/post_meta.php DELETED
@@ -1,63 +0,0 @@
1
- <?php
2
-
3
- class SearchPostMetaValue extends Search {
4
- function find( $pattern, $limit, $offset, $orderby ) {
5
- global $wpdb;
6
-
7
- $results = array();
8
- $sql = "SELECT {$wpdb->postmeta}.meta_id AS meta_id, {$wpdb->postmeta}.meta_value AS meta_value, {$wpdb->postmeta}.post_id AS post_id, {$wpdb->posts}.post_title AS title FROM {$wpdb->postmeta} LEFT JOIN {$wpdb->posts} ON {$wpdb->postmeta}.post_id = {$wpdb->posts}.ID ORDER BY meta_value $orderby";
9
-
10
- if ( $limit > 0 ) {
11
- $sql .= $wpdb->prepare( "LIMIT %d,%d", $offset, $limit );
12
- }
13
-
14
- $metas = $wpdb->get_results( $sql );
15
-
16
- if ( count( $metas ) > 0 ) {
17
- foreach ( $metas as $meta ) {
18
- // Perform a regex
19
- if (($result = $this->matches ($pattern, $meta->meta_value, $meta->meta_id)) !== false)
20
- {
21
- foreach ($result AS $item)
22
- {
23
- $item->sub_id = $meta->post_id;
24
- $item->title = $meta->title;
25
- }
26
- $results = array_merge ($results, $result);
27
- }
28
- }
29
- }
30
-
31
- return $results;
32
- }
33
-
34
- function get_options ($result)
35
- {
36
- $options[] = '<a href="'.get_permalink ($result->sub_id).'">'.__ ('view post', 'search-regex').'</a>';
37
-
38
- if (current_user_can ('edit_post', $result->sub_id))
39
- $options[] = '<a href="'.get_bloginfo ('wpurl').'/wp-admin/post.php?action=edit&amp;post='.$result->sub_id.'">'.__ ('edit','search-regex').'</a>';
40
- return $options;
41
- }
42
-
43
- function show ($result)
44
- {
45
- printf (__ ('Meta data for post #%d: %s', 'search-regex'), $result->sub_id, $result->title);
46
- }
47
-
48
- function name () { return __ ('Post meta value', 'search-regex'); }
49
-
50
- function get_content ($id)
51
- {
52
- global $wpdb;
53
-
54
- $post = $wpdb->get_row ($wpdb->prepare( "SELECT meta_value FROM {$wpdb->postmeta} WHERE meta_id=%d", $id ) );
55
- return $post->meta_value;
56
- }
57
-
58
- function replace_content ($id, $content)
59
- {
60
- global $wpdb;
61
- $wpdb->query ($wpdb->prepare( "UPDATE {$wpdb->postmeta} SET meta_value=%s WHERE meta_id=%d", $content, $id ) );
62
- }
63
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
searches/post_title.php DELETED
@@ -1,63 +0,0 @@
1
- <?php
2
-
3
- class SearchPostTitle extends Search {
4
- function find ($pattern, $limit, $offset, $orderby) {
5
- global $wpdb;
6
-
7
- $results = array();
8
-
9
- $sql = "SELECT ID, post_title FROM {$wpdb->posts} WHERE post_status != 'inherit' ORDER BY ID $orderby";
10
- if ( $limit > 0 ) {
11
- $sql .= $wpdb->prepare( " LIMIT %d,%d", $offset, $limit );
12
- }
13
-
14
- $posts = $wpdb->get_results( $sql );
15
-
16
- if (count ($posts) > 0)
17
- {
18
- foreach ($posts AS $post)
19
- {
20
- if (($matches = $this->matches ($pattern, $post->post_title, $post->ID)))
21
- {
22
- foreach ($matches AS $match)
23
- $match->title = $post->post_title;
24
-
25
- $results = array_merge ($results, $matches);
26
- }
27
- }
28
- }
29
-
30
- return $results;
31
- }
32
-
33
- function get_options( $result ) {
34
- $options[] = '<a href="'.get_permalink( $result->id ).'">'.__( 'view', 'search-regex' ).'</a>';
35
-
36
- if ( current_user_can( 'edit_post', $result->id ) ) {
37
- $options[] = '<a href="'.get_bloginfo( 'wpurl' ).'/wp-admin/post.php?action=edit&amp;post='.$result->id.'">'.__( 'edit','search-regex' ).'</a>';
38
- }
39
-
40
- return $options;
41
- }
42
-
43
- function show ($result)
44
- {
45
- printf (__ ('Post #%d: %s', 'search-regex'), $result->id, $result->title);
46
- }
47
-
48
- function name () { return __ ('Post title', 'search-regex'); }
49
-
50
- function get_content ($id)
51
- {
52
- global $wpdb;
53
-
54
- $post = $wpdb->get_row ($wpdb->prepare( "SELECT post_title FROM {$wpdb->prefix}posts WHERE id=%d", $id ) );
55
- return $post->post_title;
56
- }
57
-
58
- function replace_content ($id, $content)
59
- {
60
- global $wpdb;
61
- $wpdb->query ($wpdb->prepare( "UPDATE {$wpdb->posts} SET post_title=%s WHERE ID=%d", $content, $id ) );
62
- }
63
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
searches/post_url.php DELETED
@@ -1,59 +0,0 @@
1
- <?php
2
-
3
- class SearchPostURL extends Search {
4
- function find ($pattern, $limit, $offset, $orderby) {
5
- global $wpdb;
6
-
7
- $results = array();
8
- $sql = "SELECT ID, post_name, post_title FROM {$wpdb->posts} WHERE post_status != 'inherit' ORDER BY ID $orderby";
9
-
10
- if ( $limit > 0 ) {
11
- $sql .= $wpdb->prepare( "LIMIT %d,%d", $offset, $limit );
12
- }
13
-
14
- $posts = $wpdb->get_results( $sql );
15
- if ( count( $posts ) > 0 ) {
16
- foreach ( $posts as $post ) {
17
- if (($matches = $this->matches ($pattern, $post->post_name, $post->ID)))
18
- {
19
- foreach ($matches AS $match)
20
- $match->title = $post->post_title;
21
-
22
- $results = array_merge ($results, $matches);
23
- }
24
- }
25
- }
26
-
27
- return $results;
28
- }
29
-
30
- function get_options ($result)
31
- {
32
- $options[] = '<a href="'.get_permalink ($result->id).'">'.__ ('view', 'search-regex').'</a>';
33
-
34
- if (current_user_can ('edit_post', $result->id))
35
- $options[] = '<a href="'.get_bloginfo ('wpurl').'/wp-admin/post.php?action=edit&amp;post='.$result->id.'">'.__ ('edit','search-regex').'</a>';
36
- return $options;
37
- }
38
-
39
- function show ($result)
40
- {
41
- printf (__ ('Post #%d: %s', 'search-regex'), $result->id, $result->title);
42
- }
43
-
44
- function name () { return __ ('Post URL', 'search-regex'); }
45
-
46
- function get_content ($id)
47
- {
48
- global $wpdb;
49
-
50
- $post = $wpdb->get_row ($wpdb->prepare( "SELECT post_name FROM {$wpdb->prefix}posts WHERE id=%d", $id ) );
51
- return $post->post_name;
52
- }
53
-
54
- function replace_content ($id, $content)
55
- {
56
- global $wpdb;
57
- $wpdb->query ($wpdb->prepare( "UPDATE {$wpdb->posts} SET post_name=%s WHERE ID=%d", $content, $id ) );
58
- }
59
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
source/core/comment-meta.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SearchRegex;
4
+
5
+ use SearchRegex\Search_Source;
6
+
7
+ class Source_Comment_Meta extends Source_Meta {
8
+ public function get_table_name() {
9
+ global $wpdb;
10
+
11
+ return $wpdb->commentmeta;
12
+ }
13
+
14
+ public function get_meta_object_id() {
15
+ return 'comment_id';
16
+ }
17
+
18
+ public function get_meta_table() {
19
+ return 'comment';
20
+ }
21
+ }
source/core/comment.php ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SearchRegex;
4
+
5
+ use SearchRegex\Search_Source;
6
+ use SearchRegex\Result;
7
+
8
+ class Source_Comment extends Search_Source {
9
+ public function get_columns() {
10
+ $columns = [
11
+ 'comment_author',
12
+ 'comment_author_email',
13
+ 'comment_author_url',
14
+ 'comment_content',
15
+ ];
16
+
17
+ return $columns;
18
+ }
19
+
20
+ public function get_column_label( $column ) {
21
+ $labels = [
22
+ 'comment_author' => __( 'Name', 'search-regex' ),
23
+ 'comment_author_email' => __( 'Email', 'search-regex' ),
24
+ 'comment_author_url' => __( 'URL', 'search-regex' ),
25
+ 'comment_content' => __( 'Comment', 'search-regex' ),
26
+ ];
27
+
28
+ if ( isset( $labels[ $column ] ) ) {
29
+ return $labels[ $column ];
30
+ }
31
+
32
+ return $column;
33
+ }
34
+
35
+ public function get_search_conditions( $search ) {
36
+ global $wpdb;
37
+
38
+ // If searching a particular post type then just look there
39
+ if ( ! $this->source_flags->has_flag( 'comment_spam' ) ) {
40
+ return [ 'comment_approved=1' ];
41
+ }
42
+
43
+ return [];
44
+ }
45
+
46
+ public function get_actions( Result $result ) {
47
+ $link = get_edit_comment_link( $result->get_row_id() );
48
+
49
+ if ( $link ) {
50
+ return [
51
+ 'edit' => str_replace( '&amp;', '&', $link ),
52
+ ];
53
+ }
54
+
55
+ return [];
56
+ }
57
+
58
+ public function get_supported_flags() {
59
+ return [
60
+ 'comment_spam' => __( 'Include spam comments', 'search-regex' ),
61
+ ];
62
+ }
63
+
64
+ public function get_table_id() {
65
+ return 'comment_ID';
66
+ }
67
+
68
+ public function get_table_name() {
69
+ global $wpdb;
70
+
71
+ return $wpdb->comments;
72
+ }
73
+
74
+ public function get_title_column() {
75
+ return 'comment_author';
76
+ }
77
+
78
+ public function save( $row_id, $column_id, $content ) {
79
+ // This does all the sanitization
80
+ $result = wp_update_comment( [
81
+ $this->get_table_id() => $row_id,
82
+ $column_id => $content,
83
+ ] );
84
+
85
+ if ( $result ) {
86
+ return true;
87
+ }
88
+
89
+ return new \WP_Error( 'searchregex', 'Failed to save comment' );
90
+ }
91
+
92
+ public function delete_row( $row_id ) {
93
+ if ( wp_delete_comment( $row_id, true ) ) {
94
+ return true;
95
+ }
96
+
97
+ return new \WP_Error( 'searchregex_delete', 'Failed to delete comment', 401 );
98
+ }
99
+ }
source/core/meta.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SearchRegex;
4
+
5
+ use SearchRegex\Search_Source;
6
+
7
+ abstract class Source_Meta extends Search_Source {
8
+ public function get_columns() {
9
+ $columns = [
10
+ 'meta_key',
11
+ 'meta_value',
12
+ ];
13
+
14
+ return $columns;
15
+ }
16
+
17
+ public function get_column_label( $column ) {
18
+ $labels = [
19
+ 'meta_key' => __( 'Name', 'search-regex' ),
20
+ 'meta_value' => __( 'Value', 'search-regex' ),
21
+ ];
22
+
23
+ if ( isset( $labels[ $column ] ) ) {
24
+ return $labels[ $column ];
25
+ }
26
+
27
+ return $column;
28
+ }
29
+
30
+ public function get_table_id() {
31
+ return 'meta_id';
32
+ }
33
+
34
+ public function get_title_column() {
35
+ return 'meta_key';
36
+ }
37
+
38
+ /**
39
+ * Return the meta object ID name
40
+ *
41
+ * @return String
42
+ */
43
+ abstract public function get_meta_object_id();
44
+
45
+ /**
46
+ * Return the meta table name
47
+ *
48
+ * @return String
49
+ */
50
+ abstract public function get_meta_table();
51
+
52
+ public function save( $row_id, $column_id, $content ) {
53
+ global $wpdb;
54
+
55
+ if ( $column_id === 'meta_key' ) {
56
+ $content = sanitize_key( $content );
57
+
58
+ return parent::save( $row_id, $column_id, strlen( $content ) === 0 ? $column_id : $content );
59
+ }
60
+
61
+ // Known values
62
+ // phpcs:ignore
63
+ $existing = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$this->get_table_name()} WHERE meta_id=%d", $row_id ), ARRAY_A );
64
+
65
+ if ( $existing && update_metadata( $this->get_meta_table(), $existing[ $this->get_meta_object_id() ], $existing['meta_key'], $content, $existing['meta_value'] ) ) {
66
+ return true;
67
+ }
68
+
69
+ return new \WP_Error( 'searchregex', 'Failed to update meta data' );
70
+ }
71
+ }
source/core/options.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SearchRegex;
4
+
5
+ use SearchRegex\Search_Source;
6
+
7
+ class Source_Options extends Search_Source {
8
+ public function get_columns() {
9
+ $columns = [
10
+ 'option_name',
11
+ 'option_value',
12
+ ];
13
+
14
+ return $columns;
15
+ }
16
+
17
+ public function get_column_label( $column ) {
18
+ $labels = [
19
+ 'option_name' => __( 'Name', 'search-regex' ),
20
+ 'option_value' => __( 'Value', 'search-regex' ),
21
+ ];
22
+
23
+ if ( isset( $labels[ $column ] ) ) {
24
+ return $labels[ $column ];
25
+ }
26
+
27
+ return $column;
28
+ }
29
+
30
+ public function get_table_id() {
31
+ return 'option_id';
32
+ }
33
+
34
+ public function get_table_name() {
35
+ global $wpdb;
36
+
37
+ return $wpdb->options;
38
+ }
39
+
40
+ public function get_title_column() {
41
+ return 'option_name';
42
+ }
43
+
44
+ public function save( $row_id, $column_id, $content ) {
45
+ global $wpdb;
46
+
47
+ // Get current option name. The table name is a known sanitized value
48
+ // phpcs:ignore
49
+ $row = $wpdb->get_row( $wpdb->prepare( "SELECT option_name,option_value,autoload FROM {$this->get_table_name()} WHERE option_id=%d", $row_id ) );
50
+ if ( ! $row ) {
51
+ return new \WP_Error( 'searchregex', 'Unable to update option' );
52
+ }
53
+
54
+ if ( $column_id === 'option_name' ) {
55
+ // Changing the option name. Delete the current option and then recreate with the new option. This ensures it is correctly sanitized
56
+ delete_option( $row->option_name );
57
+
58
+ // Insert as a new option
59
+ if ( add_option( $content, $row->option_value, '', $row->autoload ) ) {
60
+ return true;
61
+ }
62
+
63
+ return new \WP_Error( 'searchregex', 'Unable to update option' );
64
+ }
65
+
66
+ // This handles all sanitization
67
+ if ( update_option( $row->option_name, $content ) ) {
68
+ return true;
69
+ }
70
+
71
+ return new \WP_Error( 'searchregex', 'Unable to update option' );
72
+ }
73
+
74
+ public function delete_row( $row_id ) {
75
+ global $wpdb;
76
+
77
+ // Get current option name. The table name is a known sanitized value
78
+ // phpcs:ignore
79
+ $row = $wpdb->get_row( $wpdb->prepare( "SELECT option_name,option_value,autoload FROM {$this->get_table_name()} WHERE option_id=%d", $row_id ) );
80
+ if ( ! $row ) {
81
+ return new \WP_Error( 'searchregex', 'Failed to delete option' );
82
+ }
83
+
84
+ if ( delete_option( $row->option_name ) ) {
85
+ return true;
86
+ }
87
+
88
+ return new \WP_Error( 'searchregex_delete', 'Failed to delete option', 401 );
89
+ }
90
+ }
source/core/post-meta.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SearchRegex;
4
+
5
+ use SearchRegex\Search_Source;
6
+
7
+ class Source_Post_Meta extends Source_Meta {
8
+ public function get_table_name() {
9
+ global $wpdb;
10
+
11
+ return $wpdb->postmeta;
12
+ }
13
+
14
+ public function get_meta_object_id() {
15
+ return 'post_id';
16
+ }
17
+
18
+ public function get_meta_table() {
19
+ return 'post';
20
+ }
21
+ }
source/core/post.php ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SearchRegex;
4
+
5
+ use SearchRegex\Search_Source;
6
+ use SearchRegex\Result;
7
+
8
+ class Source_Post extends Search_Source {
9
+ /**
10
+ * Get the custom post type from the source
11
+ *
12
+ * @param String $post_type Source post type.
13
+ * @return null|Array
14
+ */
15
+ private function get_post_type( $post_type ) {
16
+ $post_types = array_values( array_filter( Source_Manager::get_all_grouped(), function( $source ) {
17
+ return $source['name'] === 'posttype';
18
+ } ) );
19
+
20
+ if ( count( $post_types ) === 1 ) {
21
+ foreach ( $post_types[0]['sources'] as $source ) {
22
+ if ( $source['name'] === $post_type ) {
23
+ return $source;
24
+ }
25
+ }
26
+ }
27
+
28
+ return null;
29
+ }
30
+
31
+ public function get_type( array $row ) {
32
+ $post_type = isset( $row['post_type'] ) ? $this->get_post_type( $row['post_type'] ) : false;
33
+ if ( $post_type ) {
34
+ return $post_type['name'];
35
+ }
36
+
37
+ return $this->source_type;
38
+ }
39
+
40
+ public function get_name( array $row ) {
41
+ $post_type = isset( $row['post_type'] ) ? $this->get_post_type( $row['post_type'] ) : false;
42
+ if ( $post_type ) {
43
+ return $post_type['label'];
44
+ }
45
+
46
+ return $this->source_name;
47
+ }
48
+
49
+ public function get_supported_flags() {
50
+ return [
51
+ 'post_guid' => __( 'Search GUID', 'search-regex' ),
52
+ ];
53
+ }
54
+
55
+ public function get_actions( Result $result ) {
56
+ $edit = get_edit_post_link( $result->get_row_id(), '' );
57
+ $view = get_permalink( $result->get_row_id() );
58
+
59
+ if ( $edit ) {
60
+ return [
61
+ 'edit' => $edit,
62
+ 'view' => $view,
63
+ ];
64
+ }
65
+
66
+ return [];
67
+ }
68
+
69
+ public function get_search_conditions( $search ) {
70
+ global $wpdb;
71
+
72
+ // If searching a particular post type then just look there
73
+ if ( $this->source_type !== 'posts' ) {
74
+ return [ $wpdb->prepare( 'post_type=%s', $this->source_type ) ];
75
+ }
76
+
77
+ return [];
78
+ }
79
+
80
+ public function get_info_columns() {
81
+ return [ 'post_type' ];
82
+ }
83
+
84
+ public function get_column_label( $column ) {
85
+ $labels = [
86
+ 'post_content' => __( 'Content', 'search-regex' ),
87
+ 'post_excerpt' => __( 'Excerpt', 'search-regex' ),
88
+ 'post_title' => __( 'Title', 'search-regex' ),
89
+ 'post_name' => __( 'Slug', 'search-regex' ),
90
+ 'guid' => __( 'GUID', 'search-regex' ),
91
+ ];
92
+
93
+ if ( isset( $labels[ $column ] ) ) {
94
+ return $labels[ $column ];
95
+ }
96
+
97
+ return $column;
98
+ }
99
+
100
+ public function get_columns() {
101
+ $columns = [
102
+ 'post_content',
103
+ 'post_excerpt',
104
+ 'post_title',
105
+ 'post_name',
106
+ ];
107
+
108
+ if ( $this->source_flags->has_flag( 'post_guid' ) ) {
109
+ $columns[] = 'guid';
110
+ }
111
+
112
+ return $columns;
113
+ }
114
+
115
+ public function get_title_column() {
116
+ return 'post_title';
117
+ }
118
+
119
+ public function get_table_id() {
120
+ return 'ID';
121
+ }
122
+
123
+ public function get_table_name() {
124
+ global $wpdb;
125
+
126
+ return $wpdb->posts;
127
+ }
128
+
129
+ public function save( $row_id, $column_id, $content ) {
130
+ // This does all the sanitization
131
+ $result = wp_update_post( [
132
+ 'ID' => $row_id,
133
+ $column_id => $content,
134
+ ] );
135
+
136
+ if ( $result ) {
137
+ return true;
138
+ }
139
+
140
+ return new \WP_Error( 'searchregex', 'Failed to update post' );
141
+ }
142
+
143
+ public function delete_row( $row_id ) {
144
+ if ( wp_delete_post( $row_id ) ) {
145
+ return true;
146
+ }
147
+
148
+ return new \WP_Error( 'searchregex_delete', 'Failed to delete post', 401 );
149
+ }
150
+ }
source/core/user-meta.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SearchRegex;
4
+
5
+ use SearchRegex\Search_Source;
6
+
7
+ class Source_User_Meta extends Source_Meta {
8
+ public function get_table_name() {
9
+ global $wpdb;
10
+
11
+ return $wpdb->prefix . 'usermeta';
12
+ }
13
+
14
+ public function get_table_id() {
15
+ return 'umeta_id';
16
+ }
17
+
18
+ public function get_meta_object_id() {
19
+ return 'user_id';
20
+ }
21
+
22
+ public function get_meta_table() {
23
+ return 'user';
24
+ }
25
+ }
source/core/user.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SearchRegex;
4
+
5
+ use SearchRegex\Search_Source;
6
+ use SearchRegex\Result;
7
+
8
+ /**
9
+ * User source
10
+ */
11
+ class Source_User extends Search_Source {
12
+ /**
13
+ * Return an array of columns for this source
14
+ *
15
+ * @return Array The array of column names
16
+ */
17
+ public function get_columns() {
18
+ $columns = [
19
+ 'user_nicename',
20
+ 'user_url',
21
+ 'display_name',
22
+ ];
23
+
24
+ return $columns;
25
+ }
26
+
27
+ /**
28
+ * Return a visible label for the column. This is shown to the user and should be more descriptive than the column name itself
29
+ *
30
+ * @param String $column Column name.
31
+ * @return String Column label
32
+ */
33
+ public function get_column_label( $column ) {
34
+ $labels = [
35
+ 'user_nicename' => __( 'Nicename', 'search-regex' ),
36
+ 'user_url' => __( 'URL', 'search-regex' ),
37
+ 'display_name' => __( 'Display name', 'search-regex' ),
38
+ ];
39
+
40
+ if ( isset( $labels[ $column ] ) ) {
41
+ return $labels[ $column ];
42
+ }
43
+
44
+ return $column;
45
+ }
46
+
47
+ public function get_table_id() {
48
+ return 'ID';
49
+ }
50
+
51
+ public function get_table_name() {
52
+ global $wpdb;
53
+
54
+ return $wpdb->users;
55
+ }
56
+
57
+ public function get_actions( Result $result ) {
58
+ return [
59
+ 'edit' => get_edit_profile_url( $result->get_row_id(), 'admin' ),
60
+ ];
61
+ }
62
+
63
+ public function get_title_column() {
64
+ return 'user_nicename';
65
+ }
66
+
67
+ public function save( $row_id, $column_id, $content ) {
68
+ // This does all the sanitization
69
+ $result = wp_update_user( [
70
+ 'ID' => $row_id,
71
+ $column_id => $content,
72
+ ] );
73
+
74
+ if ( $result ) {
75
+ return true;
76
+ }
77
+
78
+ return new \WP_Error( 'searchregex', 'Failed to update user' );
79
+ }
80
+
81
+ public function delete_row( $row_id ) {
82
+ if ( wp_delete_user( $row_id ) ) {
83
+ return true;
84
+ }
85
+
86
+ return new \WP_Error( 'searchregex_delete', 'Failed to delete user', 401 );
87
+ }
88
+ }
source/plugin/redirection.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use SearchRegex\Search_Source;
4
+ use SearchRegex\Result;
5
+
6
+ class Redirection_Search_Regex extends Search_Source {
7
+ public function get_actions( Result $result ) {
8
+ $edit = admin_url( 'tools.php?page=redirection.php' );
9
+
10
+ return [
11
+ 'edit' => $edit,
12
+ ];
13
+ }
14
+
15
+ public function get_columns() {
16
+ $columns = [
17
+ 'url',
18
+ 'action_data',
19
+ 'title',
20
+ ];
21
+
22
+ return $columns;
23
+ }
24
+
25
+ public function get_column_label( $column ) {
26
+ $labels = [
27
+ 'url' => __( 'URL', 'search-regex' ),
28
+ 'title' => __( 'Title', 'search-regex' ),
29
+ ];
30
+
31
+ if ( isset( $labels[ $column ] ) ) {
32
+ return $labels[ $column ];
33
+ }
34
+
35
+ return $column;
36
+ }
37
+
38
+ public function get_table_id() {
39
+ return 'id';
40
+ }
41
+
42
+ public function get_table_name() {
43
+ global $wpdb;
44
+
45
+ return $wpdb->prefix . 'redirection_items';
46
+ }
47
+
48
+ public function get_title_column() {
49
+ return 'url';
50
+ }
51
+
52
+ public function save( $row_id, $column_id, $content ) {
53
+ $item = \Red_Item::get_by_id( $row_id );
54
+
55
+ if ( ! is_wp_error( $item ) ) {
56
+ /** @psalm-suppress PossiblyUndefinedMethod */
57
+ $json = $item->to_json();
58
+
59
+ if ( isset( $json[ $column_id ] ) ) {
60
+ $json[ $column_id ] = $content;
61
+ /** @psalm-suppress PossiblyUndefinedMethod */
62
+ $saved = $item->update( $json );
63
+
64
+ if ( is_wp_error( $saved ) ) {
65
+ return $saved;
66
+ }
67
+
68
+ return true;
69
+ }
70
+ }
71
+
72
+ return new WP_Error( 'searchregex', 'Failed to update redirection' );
73
+ }
74
+ }
75
+
76
+ add_filter( 'searchregex_sources_plugin', function( $plugins ) {
77
+ // Only show if Redirection is loaded
78
+ if ( defined( 'REDIRECTION_VERSION' ) ) {
79
+ $plugins[] = [
80
+ 'name' => 'redirection',
81
+ 'label' => __( 'Redirection', 'search-regex' ),
82
+ 'description' => __( 'Search your redirects', 'search-regex' ),
83
+ 'class' => 'Redirection_Search_Regex',
84
+ 'type' => 'plugin',
85
+ ];
86
+ }
87
+
88
+ return $plugins;
89
+ } );
view/results.php DELETED
@@ -1,61 +0,0 @@
1
- <?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?>
2
- <div class="wrap">
3
- <h2><?php _e ('Results', 'search-regex') ?></h2>
4
-
5
- <?php if (count ($results) > 0) : ?>
6
- <p><?php printf (__('%1$s result(s) found.', 'search-regex'), count ($results)); ?></p>
7
-
8
- <ol class="results">
9
- <?php foreach ($results AS $pos => $result) : ?>
10
- <li id="search_<?php echo $result->id.'_'.$result->offset ?>"<?php if ($pos % 2 == 1) echo ' class="alt"' ?>>
11
-
12
- <div id="options_<?php echo $result->id.'_'.$result->offset ?>" class="options"><?php echo implode (' | ', $search->get_options ($result)); ?></div>
13
-
14
- <?php $search->show ($result); ?>
15
-
16
- <div class="searchx" id="value_<?php echo $result->id.'_'.$result->offset ?>"><?php echo $result->search ?></div>
17
-
18
- <?php if ($result->replace) : ?>
19
- <?php _e ('replaced with:', 'search-regex') ?>
20
- <div class="replacex" id="replace_<?php echo $result->id.'_'.$result->offset ?>"><?php echo $result->replace ?></div>
21
- <?php endif; ?>
22
- </li>
23
- <?php endforeach; ?>
24
- </ol>
25
-
26
- <img src="<?php echo plugins_url( '/images/small.gif', $this->base_url() ); ?>" style="display: none" alt="pre"/>
27
-
28
- <script type="text/javascript" charset="utf-8">
29
- var re_text = new Array (), re_input = new Array (), re_replace = new Array (), re_text_replace = new Array ();
30
-
31
- <?php foreach ($results AS $result) : ?>
32
- <?php
33
- $id = $result->id.'_'.$result->offset;
34
- $edit = '<br/><input type="submit" name="save" value="Save" onclick="save_edit(\\\''.get_class ($search).'\\\','.$result->id.','.$result->offset.','.$result->left.','.$result->left_length.');return false"/>';
35
- $rep = '<br/><input type="submit" name="save" value="Save" onclick="save_edit_rep(\\\''.get_class ($search).'\\\','.$result->id.','.$result->offset.','.$result->left.','.$result->left_length.');return false"/>';
36
- ?>
37
-
38
- re_text['<?php echo $id ?>'] = '<?php echo $result->for_js ($result->search); ?>';
39
-
40
- <?php if ($result->single_line ()) : ?>
41
- re_input['<?php echo $id ?>'] = '<input id="txt_<?php echo $id ?>" style="width: 95%" type="text" name="replace" value="<?php echo $result->for_js ($result->search_plain); ?>"/><?php echo $edit ?>';
42
- <?php else : ?>
43
- re_input['<?php echo $id ?>'] = '<textarea id="txt_<?php echo $id ?>" style="width: 95%" rows="2" name="replace"><?php echo $result->for_js ($result->search_plain); ?><\/textarea><?php echo $edit ?>';
44
- <?php endif; ?>
45
-
46
- <?php if ($result->replace) : ?>
47
- re_text_replace['<?php echo $id ?>'] = '<?php echo $result->for_js ($result->replace); ?>';
48
- <?php if ($result->single_line ()) : ?>
49
- re_replace['<?php echo $id ?>'] = '<input id="rep_<?php echo $id ?>" style="width: 95%" type="text" name="replace" value="<?php echo $result->for_js ($result->replace_plain); ?>"/><?php echo $rep ?>';
50
- <?php else : ?>
51
- re_replace['<?php echo $id ?>'] = '<textarea id="rep_<?php echo $id ?>" style="width: 95%" rows="2" name="replace"><?php echo $result->for_js ($result->replace_plain); ?><\/textarea><?php echo $rep ?>';
52
- <?php endif; ?>
53
- <?php endif; ?>
54
-
55
- <?php endforeach; ?>
56
- </script>
57
-
58
- <?php else : ?>
59
- <p><?php _e ('There are no results.', 'search-regex') ?></p>
60
- <?php endif; ?>
61
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
view/search.php DELETED
@@ -1,95 +0,0 @@
1
- <?php if (!defined( 'ABSPATH' )) die( 'No direct access allowed' ); ?>
2
- <div class="wrap">
3
- <h2><?php _e( 'Search Regex', 'search-regex' ) ?></h2>
4
- <p><?php _e( "Replacements will only be saved to the database if you click '<strong>Replace &amp; Save</strong>', otherwise you will get a preview of the results.", 'search-regex' ) ?></p>
5
- <p><?php _e( "NOTE: <strong>No liability</strong> is accepted for any damage caused. You are strongly advised to backup your database before making any changes.", 'search-regex' ) ?></p>
6
-
7
- <form method="post" action="">
8
- <table class="searchargs">
9
- <tr>
10
- <th width="150">
11
- <?php _e( "Source", 'search-regex' ) ?>
12
- </th>
13
- <td>
14
- <select name="source">
15
- <?php foreach ( $searches AS $searcher ) : ?>
16
- <option value="<?php echo get_class( $searcher ) ?>" <?php if ( strcasecmp( $source, get_class( $searcher ) ) == 0 || ( $source == '' && strcasecmp( get_class( $searcher ), 'SearchPostContent' ) == 0 ) ) echo ' selected="selected"' ?>>
17
- <?php echo esc_attr( $searcher->name() ) ?>
18
- </option>
19
- <?php endforeach; ?>
20
- </select>
21
-
22
- <strong><?php _e( 'Limit to', 'search-regex' ); ?>:</strong>
23
- <?php $limit = isset( $_POST['limit'] ) ? intval( $_POST['limit'] ) : 0 ?>
24
- <select name="limit">
25
- <option <?php selected( $limit, 0 ); ?> value="0"><?php _e( 'No limit', 'search-regex' ); ?></option>
26
- <option <?php selected( $limit, 10 ); ?> value="10"><?php _e( '10', 'search-regex' ); ?></option>
27
- <option <?php selected( $limit, 25 ); ?> value="25"><?php _e( '25', 'search-regex' ); ?></option>
28
- <option <?php selected( $limit, 50 ); ?> value="50"><?php _e( '50', 'search-regex' ); ?></option>
29
- <option <?php selected( $limit, 100 ); ?> value="100"><?php _e( '100', 'search-regex' ); ?></option>
30
- </select>
31
-
32
- <strong><?php _e( 'Order By', 'search-regex' ); ?>:</strong>
33
- <?php $orderby = isset( $_POST['orderby'] ) ? $_POST['orderby'] : ''; ?>
34
- <select name="orderby">
35
- <option <?php selected( $orderby, 'asc' ); ?>value="asc"><?php _e( 'Ascending', 'search-regex' ); ?></option>
36
- <option <?php selected( $orderby, 'desc' ); ?>value="desc"><?php _e( 'Descending', 'search-regex' ); ?></option>
37
- </select>
38
- </td>
39
- </tr>
40
- <tr>
41
- <th width="150" valign="top"><?php _e( "Search pattern", 'search-regex' ) ?></th>
42
- <td>
43
- <input class="term" type="text" name="search_pattern" value="<?php esc_attr_e( $search ) ?>"/><br/>
44
- </td>
45
- </tr>
46
- <tr>
47
- <th width="150" valign="top"><?php _e( 'Replace pattern', 'search-regex' ) ?></th>
48
- <td>
49
- <input class="term" type="text" name="replace_pattern" value="<?php esc_attr_e( $replace ) ?>"/><br/>
50
- </td>
51
- </tr>
52
- <tr>
53
- <th><label for="regex"><?php _e( 'Regex', 'search-regex' ); ?></label>:</th>
54
- <td>
55
- <input id="regex" type="checkbox" value="regex" name="regex"<?php if (isset ($_POST['regex'])) echo 'checked="checked"' ?>/>
56
-
57
- <span id="regex-options" class="sub">
58
- <label>
59
- <?php _e( 'case-insensitive:', 'search-regex' ) ?>
60
- <input type="checkbox" name="regex_case" <?php checked( !empty( $_POST['regex_case'] ) ); ?>/>
61
- </label>
62
- <label>
63
- <?php _e( 'multi-line:', 'search-regex' ) ?>
64
- <input type="checkbox" name="regex_multi" <?php checked( !empty( $_POST['regex_multi'] ) ); ?>/>
65
- </label>
66
- <label>
67
- <?php _e( 'dot-all:', 'search-regex' ) ?>
68
- <input type="checkbox" name="regex_dot" <?php checked( !empty( $_POST['regex_dot'] ) ); ?>/>
69
- </label>
70
-
71
- &mdash; <?php _e( 'remember to surround your regex with a delimiter!', 'search-regex' ); ?>
72
- </span>
73
- </td>
74
- </tr>
75
- <tr>
76
- <th width="150"></th>
77
- <td><p class="submit">
78
- <input type="submit" class="button-primary" name="search" value="<?php esc_attr_e( 'Search', 'search-regex' )?> &raquo;" />
79
-
80
- <?php if (current_user_can( 'administrator' ) || current_user_can( 'search_regex_write' )) : ?>
81
- <input type="submit" class="button" name="replace" value="<?php esc_attr_e( 'Replace', 'search-regex' )?> &raquo;" />
82
- <input type="submit" class="button" name="replace_and_save" value="<?php esc_attr_e( 'Replace &amp; Save &raquo;', 'search-regex' ) ?>"/>
83
- <?php endif; ?>
84
- </p>
85
- </td>
86
- </tr>
87
-
88
- <?php wp_nonce_field( 'search', 'search-regex-nonce' ); ?>
89
- </table>
90
- </form>
91
- </div>
92
-
93
- <script type="text/javascript" charset="utf-8">
94
- var wp_loading = '<?php echo plugins_url( '/images/small.gif', dirname( __FILE__ ) ); ?>';
95
- </script>