PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 3.3.1
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v3.3.1
3.3.1 V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 All 138 releases
bit-form / includes / Admin / Form / FrontEndScriptGenerator.php

FrontEndScriptGenerator.php in Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder 3.3.1, at includes/Admin/Form/FrontEndScriptGenerator.php

596 lines 21.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace BitCode\BitForm\Admin\Form;
4
5 if (!defined('ABSPATH')) {
6 exit;
7 }
8
9 use BitCode\BitForm\Core\Util\FileHandler;
10 use BitCode\BitForm\Core\Util\Log;
11 use WP_Error;
12
13 class FrontEndScriptGenerator
14 {
15 private $_scriptAddedFlags;
16 private $_fields;
17 private $_formContents;
18 private $_jsFilesNeeded;
19 private $_loadedScriptsList;
20 private $_validationJsFilesNeeded;
21
22 public function __construct()
23 {
24 $this->_scriptAddedFlags = [];
25 $this->_fields = [];
26 $this->_jsFilesNeeded = [];
27 $this->_loadedScriptsList = [];
28 $this->_validationJsFilesNeeded = ScriptFilePriorityManager::validationAndOtherScriptFile();
29 }
30
31 private static function generateBfGlobalObjJS($contentIds = [])
32 {
33 $contentidArray = wp_json_encode($contentIds);
34 return ' if(!window.bf_globals){ window.bf_globals = {};}
35 (function(){
36 var bfSetupGlobals = function(){
37 ' . $contentidArray . '.forEach(function(contentId){
38 const form = document.getElementById(contentId);
39 if(!form){
40 delete window.bf_globals[contentId];
41 return;
42 }
43 if(!window.bf_globals[contentId]){
44 window.bf_globals[contentId] = {inits: {}, contentId: contentId};
45 }else{
46 if(!window.bf_globals[contentId].inits) window.bf_globals[contentId].inits = {};
47 window.bf_globals[contentId].contentId = contentId;
48 }
49 });
50 };
51 if(document.readyState === "loading"){
52 document.addEventListener("DOMContentLoaded", bfSetupGlobals, { once: true });
53 } else {
54 bfSetupGlobals();
55 }
56 })();';
57 }
58
59 private static function isValidationNeeded($fldData)
60 {
61 $validationsToCheck = ['valid->req', 'valid->regexr', 'mn', 'mx', 'opt', 'err->invalid->show', 'err->notVerified->show'];
62 foreach ($validationsToCheck as $property) {
63 $needValidation = Helpers::property_exists_nested($fldData, $property);
64 if ($needValidation) {
65 return true;
66 }
67 }
68 return false;
69 }
70
71 public function generateJsFile($formContents, $fields, $contentIds, $postId, $formIDs = null, $preview = 'classic')
72 {
73 add_option('bitforms_frontend_js_generating', true);
74 $this->_formContents = $formContents;
75 $this->_fields = $fields;
76
77 $this->appendJs(self::generateBfGlobalObjJS($contentIds), $postId, $preview, 'w');
78 $this->_jsFilesNeeded = ScriptFilePriorityManager::jsFile();
79
80 // helper js files for whole form
81 foreach ($this->_jsFilesNeeded['helperScript'] as $jsFile) {
82 $this->addScriptInLoadedScriptsList($jsFile);
83 }
84
85 // for add validation js files
86 $this->jsValidationNeededFile();
87
88 // js files for all fields
89 $this->jsFieldsNeededFile();
90
91 // for frontend helper js files
92 $this->jsFrontendScript();
93
94 // for hidden Field when cache plugin on
95 $this->jsHiddenFieldScript();
96
97 // for recaptcha v3 (form-level setting)
98 $this->jsRecaptchaV3Scripts();
99
100 // for form abandonment scripts
101 $this->jsFormAbandonmentScripts();
102
103 // multi step form scripts
104 $this->multiStepFormScripts();
105
106 // conversational form scripts
107 $this->conversationalFormScripts();
108
109 //⚠👆 every script file generate method call before this method
110 $this->appendJs($this->getScript(), $postId, $preview);
111 $this->appendJs($this->generateFieldConfigsJs($contentIds), $postId, $preview);
112 // init all js events and functions at last
113 $this->appendJs(self::getFileFromAssetsJs('bitform-init.min.js'), $postId, $preview);
114 // picks up forms injected after load (AJAX, popups, lazy content)
115 $this->appendJs(self::getFileFromAssetsJs('bitform-observer.min.js'), $postId, $preview);
116 if (defined('ELEMENTOR_PRO_VERSION')) {
117 $this->appendJs(self::getFileFromAssetsJs('bitform-elementor.min.js'), $postId, $preview);
118 }
119
120 // for js file minification
121 $this->appendJs(self::getCustomJsCodes($contentIds), $postId, $preview);
122 delete_option('bitforms_frontend_js_generating');
123 return true;
124 }
125
126 private function multiStepFormScripts()
127 {
128 foreach ($this->_formContents as $formContent) {
129 $layout = $formContent->layout;
130 if (is_array($layout) && count($layout) > 1) {
131 $files = ScriptFilePriorityManager::multiStepFiles();
132 foreach ($files as $file) {
133 $this->addScriptInLoadedScriptsList($file);
134 }
135 }
136 }
137 }
138
139 private function conversationalFormScripts()
140 {
141 foreach ($this->_formContents as $formContent) {
142 if (!empty($formContent->formInfo->conversationalSettings) && $formContent->formInfo->conversationalSettings->enable) {
143 $files = ScriptFilePriorityManager::conversationalFormFiles();
144 foreach ($files as $file) {
145 $this->addScriptInLoadedScriptsList($file);
146 }
147 }
148 }
149 }
150
151 private function jsFormAbandonmentScripts()
152 {
153 /**
154 * Add-ons can inject required script files here.
155 *
156 * @param array $files Array of file arrays: ['priority' => int, 'filename' => string]
157 * @param array $formContents
158 * @param array $fields
159 */
160 $files = apply_filters('bitform_form_abandonment_script_files', [], $this->_formContents, $this->_fields);
161 if (empty($files) || !is_array($files)) {
162 return;
163 }
164 foreach ($files as $jsFile) {
165 if (!empty($jsFile['filename']) && !empty($jsFile['priority'])) {
166 $this->addScriptInLoadedScriptsList($jsFile);
167 }
168 }
169 }
170
171 private function appendJs($script, $postId, $previewMode, $mode = 'a')
172 {
173 $fileName = '';
174 $path = '';
175
176 if ('conversational' === $previewMode) {
177 $fileName = "bitform-conversational-{$postId}.js";
178 $path = 'form-scripts';
179 } elseif ('preview' === $previewMode) {
180 $fileName = "preview-{$postId}.js";
181 $path = 'form-scripts';
182 } else {
183 $fileName = "bitform-js-$postId.js";
184 $path = "form-scripts/{$postId}";
185 }
186 Helpers::saveFile($path, $fileName, Helpers::minifyJs($script), $mode);
187 }
188
189 private function getScript()
190 {
191 usort($this->_loadedScriptsList, function ($a, $b) {
192 return $a['priority'] - $b['priority'];
193 });
194
195 $script = '';
196 foreach ($this->_loadedScriptsList as $scriptFileArr) {
197 $fileNam = $scriptFileArr['filename'];
198 $fileContent = self::getFileFromAssetsJs($fileNam);
199 if ($fileContent) {
200 $script .= $fileContent;
201 }
202 }
203 return $script;
204 }
205
206 private function jsValidationNeededFile()
207 {
208 foreach ($this->_fields as $flds) {
209 foreach ($flds as $fld) {
210 $fldData = $fld['field'];
211 // Corrupt/partial form JSON can produce a null field or one without typ.
212 if (!is_object($fldData)) {
213 continue;
214 }
215 // for validation js files
216 if (self::isValidationNeeded($fldData)) {
217 $validation = $this->_validationJsFilesNeeded['validation'];
218 $this->addScriptInLoadedScriptsList($validation);
219 }
220 // for required
221 if (Helpers::property_exists_nested($fldData, 'valid->req')) {
222 $fileArr = $this->_validationJsFilesNeeded['requiredFldValidation'];
223 $this->addScriptInLoadedScriptsList($fileArr);
224 }
225 // for regex
226 if (Helpers::property_exists_nested($fldData, 'valid->regexr')) {
227 $patternFile = $this->_validationJsFilesNeeded['generateBackslashPattern'];
228 $rgx = $this->_validationJsFilesNeeded['regexPatternValidation'];
229 $this->addScriptInLoadedScriptsList($patternFile);
230 $this->addScriptInLoadedScriptsList($rgx);
231 }
232
233 $validationScriptFileMapping = ScriptFilePriorityManager::validationScriptFileMapping($fldData->typ);
234 if ($validationScriptFileMapping) {
235 foreach ($validationScriptFileMapping as $key => $value) {
236 $paths = $value['paths'] ?? [];
237 $hasMatchingPath = false;
238 foreach ($paths as $path) {
239 if (Helpers::property_exists_nested($fldData, $path)) {
240 $hasMatchingPath = true;
241 break; // one match is enough
242 }
243 }
244
245 if (!$hasMatchingPath) {
246 continue;
247 }
248
249 // Add the main script once
250 if (!empty($this->_validationJsFilesNeeded[$key])) {
251 $this->addScriptInLoadedScriptsList($this->_validationJsFilesNeeded[$key]);
252 }
253
254 // Add dependencies once each
255 foreach (($value['dependencies'] ?? []) as $dep) {
256 if (!empty($this->_validationJsFilesNeeded[$dep])) {
257 $this->addScriptInLoadedScriptsList($this->_validationJsFilesNeeded[$dep]);
258 }
259 }
260 }
261 }
262 }
263 }
264 }
265
266 private function jsFieldsNeededFile()
267 {
268 $filePondPluginList = apply_filters('bitform_filepond_plugins_list', []);
269 foreach ($this->_fields as $typ => $flds) {
270 if (!array_key_exists($typ, $this->_jsFilesNeeded)) {
271 continue;
272 }
273 $fldScriptArr = $this->_jsFilesNeeded[$typ];
274
275 foreach ($flds as $fld) {
276 if ('advanced-file-up' === $typ) {
277 $configs = $fld['field']->config;
278 foreach ($configs as $configKey => $config) {
279 if ($configs->$configKey) {
280 if (array_key_exists($configKey, $filePondPluginList)) {
281 $this->addScriptInLoadedScriptsList($filePondPluginList[$configKey]);
282 }
283 }
284 }
285 }
286 foreach ($fldScriptArr as $scriptFile) {
287 if (isset($scriptFile['paths']) && is_array($scriptFile['paths'])) {
288 $pathMatched = false;
289 foreach ($scriptFile['paths'] as $path) {
290 if (Helpers::property_exists_nested($fld['field'], $path)) {
291 $pathMatched = true;
292 break;
293 }
294 }
295 if (!$pathMatched) {
296 continue;
297 }
298 } elseif (isset($scriptFile['path']) && !Helpers::property_exists_nested($fld['field'], $scriptFile['path'])) {
299 continue;
300 }
301 $this->addScriptInLoadedScriptsList($scriptFile);
302 }
303 }
304 }
305 }
306
307 private static function getCustomJsCodes($contentIds = [])
308 {
309 $script = 'let bfContentId = "", bfSlNo = "1", bfVars= "";';
310 foreach ($contentIds as $contentId) {
311 $contentIdArr = explode('_', $contentId);
312 $jsCode = self::getCustomCodes($contentIdArr[1])['JavaScript'];
313 $bfSlNo = array_key_exists(3, $contentIdArr) ? $contentIdArr[3] : '1';
314 if (!empty($jsCode)) {
315 $script .= " if(bfSelect('#{$contentId}')){ bfContentId = '{$contentId}'; bfSlNo = '{$bfSlNo}'; bfVars = window.bf_globals.{$contentId}.smartTags; {$jsCode}}";
316 }
317 }
318
319 return $script;
320 }
321
322 private static function getFileFromAssetsJs($fileName)
323 {
324 $sourceJsFile = BITFORMS_PLUGIN_DIR_PATH . 'assets' . DIRECTORY_SEPARATOR . $fileName;
325 if (file_exists($sourceJsFile)) {
326 return file_get_contents($sourceJsFile);
327 }
328 Log::debug_log('file not found: ' . $fileName);
329 return false;
330 }
331
332 public static function saveCssFile($formId, $atomicCssText)
333 {
334 $path = 'form-styles';
335 $fileName = "bitform-$formId.css";
336 if (!isset($formId) || '' === $formId) {
337 return new WP_Error('missing_form_id', __('Error Occurred, Please Reload', 'bit-form'));
338 }
339 return Helpers::saveFile($path, $fileName, $atomicCssText, 'w');
340 }
341
342 public static function customCodeFile($formId, $customCodes)
343 {
344 // for js file
345 $path = 'form-scripts';
346 $fileName = "bitform-custom-$formId.js";
347 $filteredJs = Helpers::removeJsSingleLineComments($customCodes->JavaScript);
348 self::customCodeFileSaveOrDelete($filteredJs, $path, $fileName);
349
350 // for css file
351 $path = 'form-styles';
352 $fileName = "bitform-custom-$formId.css";
353 self::customCodeFileSaveOrDelete($customCodes->CSS, $path, $fileName);
354
355 return true;
356 }
357
358 public static function customCodeFileSaveOrDelete($script, $path, $fileName)
359 {
360 if ($script) {
361 Helpers::saveFile($path, $fileName, $script, 'w');
362 } else {
363 $uploadPath = "$path/$fileName";
364 $uploadFilePath = Helpers::generatePathDirOrFile($uploadPath);
365 FileHandler::deleteIsFileExists($uploadFilePath);
366 }
367 return true;
368 }
369
370 public static function getCustomCodes($formId)
371 {
372 $customCodes = ['JavaScript' => '', 'CSS' => ''];
373 $customJsPath = Helpers::generatePathDirOrFile("form-scripts/bitform-custom-$formId.js");
374 $customCodes['JavaScript'] = Helpers::fileRead($customJsPath);
375
376 $customCSSPath = Helpers::generatePathDirOrFile("form-styles/bitform-custom-$formId.css");
377 $customCodes['CSS'] = Helpers::fileRead($customCSSPath);
378
379 return $customCodes;
380 }
381
382 private $fldContainersByType = [
383 'address' => '.__$fk__-parent-fld-wrp',
384 'select' => '.__$fk__-dpd-fld-wrp',
385 'country' => '.__$fk__-country-fld-wrp',
386 'currency' => '.__$fk__-currency-fld-wrp',
387 'phone-number' => '.__$fk__-phone-fld-wrp',
388 'file-up' => '.__$fk__-file-up-wrpr',
389 'advanced-file-up' => '#filepond-__$fk__-container',
390 'paypal' => '.__$fk__-paypal-wrp',
391 'razorpay' => '.__$fk__-razorpay-wrp',
392 'recaptcha' => '.__$fk__-recaptcha-wrp',
393 'stripe' => '.__$fk__-stripe-fld',
394 'mollie' => '.__$fk__-mollie-wrp',
395 'repeater' => '.__$fk__-rpt-fld-wrp',
396 'signature' => '.__$fk__-inp-fld-wrp',
397 'rating' => '.__$fk__-inp-fld-wrp',
398 'email-otp' => '.__$fk__-inp-fld-wrp',
399 'hcaptcha' => '.__$fk__-h-captcha-wrp',
400 'advanced-datetime' => '.__$fk__-advanced-datetime',
401 ];
402
403 private function generateFieldConfigsJs()
404 {
405 $customFlds = ['address', 'select', 'country', 'currency', 'phone-number', 'file-up', 'advanced-file-up', 'paypal', 'razorpay', 'stripe', 'mollie', 'recaptcha', 'repeater', 'signature', 'rating', 'turnstile', 'hcaptcha', 'advanced-datetime', 'email-otp'];
406 $allFieldTypes = array_keys($this->_fields);
407 $customFldsInForms = array_intersect($allFieldTypes, $customFlds);
408 $formContents = $this->_formContents;
409 $recaptchaV3Enabled = false;
410 foreach ($formContents as $content) {
411 if (isset($content->additional->enabled->recaptchav3) && $content->additional->enabled->recaptchav3) {
412 $recaptchaV3Enabled = true;
413 break;
414 }
415 }
416 if (empty($customFldsInForms) && !$recaptchaV3Enabled) {
417 return '';
418 }
419
420 $containers = [];
421 foreach ($customFldsInForms as $customFldTyp) {
422 if (isset($this->fldContainersByType[$customFldTyp])) {
423 $containers[$customFldTyp] = $this->fldContainersByType[$customFldTyp];
424 }
425 }
426
427 $customFldConfigPaths = [];
428
429 $allConfs = ScriptFilePriorityManager::getAllFldConfs();
430 foreach ($customFldsInForms as $customFldTyp) {
431 if (isset($allConfs[$customFldTyp])) {
432 $customFldConfigPaths[$customFldTyp] = $allConfs[$customFldTyp];
433 } else {
434 $customFldConfigPaths[$customFldTyp] = (object) [];
435 }
436 }
437
438 $customFldConfigPaths = wp_json_encode($customFldConfigPaths);
439 $containers = wp_json_encode($containers);
440
441 $script = ' const customFldConfigPaths = ' . $customFldConfigPaths . ';
442 const fldContainers = ' . $containers . ';
443
444 function initAllCustomFlds (formContentId = null) {
445 const allContendIds = formContentId ? [formContentId] : Object.keys(bf_globals);
446 allContendIds.forEach((contentId) => {
447 const contentData = bf_globals[contentId];
448 if(!contentData?.inits) contentData.inits = {};
449 const flds = bf_globals[contentId]?.fields || {};
450 const fldKeys = Object.keys(flds).reverse();
451 fldKeys.forEach((fldKey) => {
452 const fldData = flds[fldKey];
453 const fldType = fldData.typ;
454 if(fldType === \'paypal\') {
455 initPaypalFld(contentId, fldKey, fldData, fldType);
456 } else if(fldType === \'razorpay\') {
457 initRazorpayFld(contentId, fldKey, fldType);
458 } else if(fldType === \'recaptcha\') {
459 initRecaptchaFld(contentId, fldKey, fldType);
460 } else if(fldType === \'turnstile\') {
461 initTurnstileFld(contentId, fldKey);
462 } else if(fldType === \'hcaptcha\') {
463 initHCaptchaFld(contentId, fldKey, fldType);
464 } else if(fldType === \'stripe\' || fldType === \'mollie\') {
465 initStripeFld(contentId, fldKey, fldType);
466 } else if (customFldConfigPaths[fldType]) {
467 contentData.inits[fldKey] = getFldInstance(contentId, fldKey, fldType);
468 }
469 });
470 if(contentData.gRecaptchaVersion === \'v3\' && contentData.gRecaptchaSiteKey){
471 initRecaptchaV3Fld(contentId, contentData);
472 }
473 });
474 };
475 function getFldInstance(contentId, fldKey, fldTyp, nestedSelector = \'\') {
476 const fldClass = this[\'bit_\'+fldTyp.replace(/-/g, \'_\')+\'_field\'];
477 const selector = \'#form-\'+contentId+\' \'+nestedSelector+fldContainers[fldTyp].replace("__$fk__", fldKey);
478 if(!fldClass || !bfSelect(selector)) return;
479 return new fldClass(selector, getFldConf(contentId, fldKey, fldTyp));
480 };
481 function getFldConf(contentId, fieldKey, fldTyp) {
482 const fldData = bf_globals[contentId].fields[fieldKey];
483 const fldConfPaths = Object.entries(customFldConfigPaths[fldTyp]);
484 let fldConf = {};
485 const { formId } = bf_globals[contentId];
486 if (!("config" in customFldConfigPaths[fldTyp]) && "config" in fldData) fldConf = fldData.config;
487 const varData = { contentId, fieldKey, formId };
488 fldConfPaths.forEach(([ confPath, fldPath ]) => {
489 let value = "";
490 if (fldPath.var) value = varData[fldPath.var];
491 if (!value && fldPath.path) {
492 if(Array.isArray(fldPath.path)) {
493 fldPath.path.forEach((path) => {
494 if(!value) value = getDataFromNestedPath(fldData, path);
495 });
496 } else {
497 value = getDataFromNestedPath(fldData, fldPath.path);
498 }
499 }
500 if (!value && "val" in fldPath) {
501 value = fldPath.val;
502 if(typeof value === \'string\') {
503 Object.entries(varData).forEach(([key, val]) => {
504 value = value.replace("__$"+key+"__", val);
505 });
506 }
507 }
508 fldConf = setDataToNestedPath(fldConf, confPath, value);
509 });
510 return fldConf;
511 };
512 function getDataFromNestedPath(data, key) {
513 const keys = key.split("->");
514 const lastKey = keys.pop();
515 let current = {...data};
516 for (const k of keys) {
517 if (!(k in current)) return null;
518 current = current[k];
519 }
520 return current[lastKey] || null;
521 }
522 function setDataToNestedPath(data, key, value) {
523 const keys = key.split("->");
524 const lastKey = keys.pop();
525 let current = {...data};
526 keys.forEach((k) => {
527 if (!current[k]) current[k] = {};
528 current = current[k];
529 });
530 current[lastKey] = value;
531 return current;
532 }';
533
534 return $script;
535 }
536
537 private function addScriptInLoadedScriptsList($fileArr)
538 {
539 $fileName = $fileArr['filename'];
540 if (!in_array($fileName, $this->_scriptAddedFlags)) {
541 $this->_loadedScriptsList[] = $fileArr;
542 $this->_scriptAddedFlags[] = $fileName;
543 }
544 return true;
545 }
546
547 private function jsFrontendScript()
548 {
549 foreach ($this->_formContents as $formContent) {
550 if (Helpers::property_exists_nested($formContent, 'workFlowExist->oninput', true)) {
551 $fileArr = ScriptFilePriorityManager::validationAndOtherScriptFile()['conditionalLogic'];
552 $this->addScriptInLoadedScriptsList($fileArr);
553 $fileArr = ScriptFilePriorityManager::validationAndOtherScriptFile()['resetPlaceholders'];
554 $this->addScriptInLoadedScriptsList($fileArr);
555 $fileArr = ScriptFilePriorityManager::validationAndOtherScriptFile()['bfResetDefaultValue'];
556 $this->addScriptInLoadedScriptsList($fileArr);
557 $fileArr = ScriptFilePriorityManager::validationAndOtherScriptFile()['validateFocusLost'];
558 $this->addScriptInLoadedScriptsList($fileArr);
559 $fileArr = ScriptFilePriorityManager::frontendScriptFile()['observeElm'];
560 $this->addScriptInLoadedScriptsList($fileArr);
561 }
562 if (Helpers::property_exists_nested($formContent, 'additional->enabled->validateFocusLost', true)) {
563 $fileArr = ScriptFilePriorityManager::validationAndOtherScriptFile()['validateFocusLost'];
564 $this->addScriptInLoadedScriptsList($fileArr);
565 }
566 }
567 }
568
569 private function jsHiddenFieldScript()
570 {
571 $appConfig = get_option('bitform_app_config');
572 $cacheTokenEnabled = true;
573 if (is_object($appConfig) && property_exists($appConfig, 'cache_plugin')) {
574 $cacheTokenEnabled = (bool) $appConfig->cache_plugin;
575 } elseif (is_array($appConfig) && array_key_exists('cache_plugin', $appConfig)) {
576 $cacheTokenEnabled = (bool) $appConfig['cache_plugin'];
577 }
578 if ($cacheTokenEnabled) {
579 $fileArr = ScriptFilePriorityManager::frontendScriptFile()['hidden-token-field'];
580 $this->addScriptInLoadedScriptsList($fileArr);
581 return;
582 }
583 }
584
585 private function jsRecaptchaV3Scripts()
586 {
587 foreach ($this->_formContents as $content) {
588 if (isset($content->additional->enabled->recaptchav3) && $content->additional->enabled->recaptchav3) {
589 $this->addScriptInLoadedScriptsList(['priority' => 302, 'filename' => 'scriptLoader.min.js']);
590 $this->addScriptInLoadedScriptsList(['priority' => 303, 'filename' => 'initRecaptchaV3Fld.min.js']);
591 return;
592 }
593 }
594 }
595 }
596