....................................../////.===Hehe-Here===./////................................................ > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < ------------------------------------------------------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð enü¹%½_F‘åè¿2ºQú³íªú`N¿­3ÿƒügµJžaÿ¯ÿ°~¼ÎùnúîÞÖô•òíôÁÉß®Sm¥Ü/ ‡ó˜f£Ùà<˜„xëJ¢Ù€SO3x<ªÔ©4¿+ç¶A`q@Ì“Úñè™ÍÿJÌ´ª-˜ÆtÊÛL]Ïq*‘Ý”ì#ŸÌÏãY]@ê`¿ /ªfkØB4·®£ó z—Üw¥Pxù–ÞLШKÇN¾AkÙTf½è'‰g gÆv›Øuh~ a˜Z— ïj*á¥t d£“uÒ ¨`K˜¹ßþ]b>˜]_ÏÔ6W—è2r4x•íÖ…"ƒÖNîä!¦å Ú}ýxGøÌ —@ ;ÆÚŠ=ɾ1ý8lªË¥ô ^yf®Œ¢u&2©nÙÇ›ñÂñŒ³ aPo['½»øFùà­+4ê“$!lövlüÞ=;N®3ð‚õ›DÉKòÞ>ÄÍ ¥ˆuߤ#ˆ$6ù™¥îЇy’ÍB¼ çxÛ;X"WL£R÷͝*ó-¶Zu}º.s¸sšXqù–DþÿvªhüïwyŸ ¯é³lÀ:KCûÄ£Ëá\…­ ~—ýóî ¼ûûÜTÓüÇy…ŽÆvc»¾×U ñ¸žþоP÷¦ó:Ò¨¨5;Ð#&#ÖúñläÿÁœ GxÉ­/ñ‡áQðìYÉtÒw޼GÔ´zàÒò ð*ëzƒ•4~H]Ø‹f ñÓÈñ`NåWçs'ÆÏW^ø¹!XžµmQ5ÃËoLœÎ: ÞËÍ¥J ù…î èo£ßPÎñ¶ž8.Œ]ʵ~5›ÙË-ù*8ÙÖß±~ ©¹rÓê‚j¶d¸{^Q'˜±Crß ÚH—#¥¥QlÀ×ëã‡DÜ«èî þ&Çæžî;ŽÏºò6ÒLÃXy&ZŒ'j‚¢Ù€IßÚù+–MGi‰*jE€‘JcÜ ÓÌ EÏÚj]o˜ Þr <¾U ûŪæÍ/šÝH¥˜b”¼ ÁñßX GP›ï2›4WŠÏà×£…íÓk†¦H·ÅíMh–*nó÷à]ÁjCº€b7<ب‹¨5車bp2:Á[UªM„QŒçiNMa#<5›áËó¸HýÊ"…×Éw¹¦ì2º–x<›»a±¸3Weü®FÝ⑱ö–î–³|LPÈ~çð~Çå‡|º kD¢µÏàÆAI %1À% ¹Ò – ”ϝS¦‰4&¶£°à Öý”û_Ò Áw°A«Å€?mÇÛgHÉ/8)á¾ÛìáöŽP í¨PŸNÙµº¦‡§Ùš"ÿ«>+ªÕ`Ê÷‡‚ß Õû˜þãÇ-PÍ.¾XV‘€ dÜ"þ4¹ ±Oú‘©t¥¦FªÄÃÄ•b‚znýu½—#cDs˜ÃiÑOˆñ×QO=*IAÊ,¶ŽZƒ;‡wøXè%EÐk:F±Ú” .Ѽ+Áu&Ç`."pÈÉw o&¿dE6‘’EqTuK@Ì¥ã™À(Êk(h‰,H}RÀIXÛš3µ1©_OqÚÒJAñ$ÊÙÜ;D3çŒ[þùœh¬Ã³™ö6ç†NY".Ú‰ï[ªŸŒ '²Ð öø_¨ÂÉ9ué¶³ÒŠõTàîMØ#û¯gN‡bÙ놚X„ö …ÉeüÌ^J ‹€.œ$Æ)βÄeæW#óüßĺŸ€ ÀzwV 9oä»f4V*uB «Ë†¹ì¯žR霓æHXa=&“I4K;¯ç‹h×·"UŠ~<•╪Vêª&ÍSÃÆÅ?ÔqÎ*mTM ˜›µwêd#[C¡©§‘D<©àb†–ÁœøvH/,í:¯( ²£|4-„Æövv„Yͼ™^Á$ˆ„¢Û[6yB.åH*V¨æ?$=˜Ñ€•ñ·­(VlŸ‘ nÀt8W÷´Bûba?q9ú¶Xƒl«ÿ\ù¶’þòUÐj/õ¢Ìµ³g$ƒÎR!¸»|Oߍë’BhîÚÑ¢ñåŒJ„®„£2Ð3•ô02Nt…!£Í]Ïc½Qÿ?ˆ<&ÃA¾Ú,JˆijÌ#5yz„‰Î|ÊŽ5QÏ:‹ÐaóVÔxW—CpeÏzÐïíçôÿÅ_[hãsÐ_/ŽTÝ?BîˆííV$<¿i>²F¬_Eß¿ †bÊŒº­ÿ®Z H“C}”¬,Mp ý/Bá£w>˜YV°aƒúh+cŠ- r/[%|üUMHäQ°X»|û/@|°¥Ð !BÔ Ç¢Ä©š+Õì D«7ìN¶ŽðÔ " ƶ’ÖçtA‰Û×}{tþz­¾GÍ›k¹OEJR$ Â׃ «ëÁ"oÉôž$oUK(Ä)Ãz³Ê-‹êN[Ò3Œñbï8P 4ƒ×q¢bo|?<ÛX¬òÄͰL–±›(™ûG?ýË©ÚÄ–ÂDØÐ_Ç¡ô ¾–ÄÏø ×e8Ë©$ÄF¹Å‹ì[©óìl:F¾f´‹‹Xì²ï®\¬ôùƒ ÿat¥óèÒùHß0äe‚;ü×h:ÆWðHž=Ã8骣"kœ'Y?³}Tûè€>?0l›e1Lòñ„aæKÆw…hÖŠùW…ÈÆÄ0ši·›[pcwËþñiêíY/~-Á5˜!¿†A›™Mÿþ(±“t@â“ö2­´TG5yé]çå僳 .·ÍïçÝ7UÚ±Ð/Nè»,_Ï ùdj7\ï Wì4›„»c¸àešg#ÒÊ⥭áØo5‘?ÌdÝô¯ ¹kzsƒ=´#ëÉK›Ø´±-¥eW?‡çßtòTã…$Ý+qÿ±ƒ÷_3Ô¥í÷:æ–ž<·Ö‡‰Å¢ š‡%Ô—utÌÈìðžgÖÀz²À—ï÷Óîäõ{K'´È÷³yaÏÁjƒô}ž§®æÊydÕÈë5¯èˆõvÕ©ã*çD„ “z„Ó‡^^xÂ3M§A´JG‚öï 3W'ˆ.OvXè¡ÊÕª?5º7†˜(˜Ç¶#çê’¶!ÌdZK§æ 0fãaN]òY³RV ™î$®K2R¨`W!1Ôó\;Ý ýB%qæK•&ÓÈe9È0êI±žeŸß -ú@žQr¦ ö4»M¼Áè¹µmw 9 EÆE_°2ó„ŸXKWÁ×Hóì^´²GѝF©óäR†¦‰ç"V»eØ<3ùd3ÿÚ¤Žú“Gi" —‘_ÙËÎ~Üö¯¥½Î»üŸEÚŽåmÞþí ;ÞólËΦMzA"Âf(´òá;Éï(/7½ûñÌ­cïÕçлþÝz¾-ÍvÑ“pH­–ðÓj$¸Äû¤‚‘ãUBË-n“2åPkS5&‹Â|+g^œ®Ì͆d!OïäîU«c;{Û!ÅŽ«ëZ9Ókóˆ]¯ƒ›né `ÇÒ+tÆš (ØKá¾—=3œ®•vuMñg²\ï Ec€ 05±d™‡×iÇ×›UúvÌ¢£Èþ¡ÕØô¶ßÎA"ß±#Ö²ˆÊŸ¦*Ä~ij|àø.-¼'»Ú¥£h ofº¦‡VsR=N½„Î v˜Z*SÌ{=jÑB‹tê…;’HžH¯8–îDù8ñ¢|Q•bÛçš–‹m³“ê¨ åÏ^m¬Žãþ©ïêO‡½6] µÆ„Ooòü ²x}N¦Ë3ïé¿»€›HA˜m%çÞ/¿í7Fø“‹léUk)É°Œµ8Q8›:ÀŠeT*šõ~ôڝG6 ¢}`ùH­–”¡k ‰P1>š†®9z11!X wKfmÁ¦xÑ,N1Q”–æB¶M…ÒÃv6SMˆhU¬ÊPŽï‘öj=·CŒ¯u¹ƒVIЃsx4’ömÛýcå¡¶7ßŠß 57^\wÒÐÆ k§h,Œý î«q^R½3]J¸ÇðN ‚çU¬ôº^Áì} ³f©Õœ§ˆã:FÄÈ‚é(€™?àýÓüè1Gô£¼éj‚OÅñ  #>×—ßtà 0G¥Åa뀐kßhc™À_ÉñÞ#±)GD" YîäË-ÿÙ̪ ¹™a¯´¢E\ÝÒö‚;™„ë]_ p8‰o¡ñ+^÷ 3‘'dT4œŽ ðVë½° :¬víÑ«£tßÚS-3¶“þ2 †üüʨòrš¹M{É_¤`Û¨0ìjœøJ‡:÷ÃáZ˜†@GP&œÑDGÏs¡þ¦þDGú‘1Yá9Ôþ¼ ûø…§÷8&–ÜÑnÄ_m®^üÆ`;ÉVÁJ£?â€-ßê}suÍ2sõA NÌúA磸‘îÿÚ»ƒìö·á¿±tÑÐ"Tÿü˜[@/äj¬€uüªìù¥Ý˜á8Ý´sõj 8@rˆð äþZÇD®ÿUÏ2ùôõrBzÆÏÞž>Ì™xœ“ wiÎ×7_… ¸ \#€MɁV¶¥üÕÿPÔ9Z‡ø§É8#H:ƒ5ÀÝå9ÍIŒ5åKÙŠ÷qÄ>1AÈøžj"µÂд/ªnÀ qªã}"iŸBå˜ÓÛŽ¦…&ݧ;G@—³b¯“•"´4í¨ôM¨åñC‹ïùÉó¯ÓsSH2Ý@ßáM‡ˆKÀªÛUeø/4\gnm¥‹ŸŒ qÄ b9ÞwÒNÏ_4Ég³ú=܆‚´ •â¥õeíþkjz>éÚyU«Íӝ݃6"8/ø{=Ô¢»G¥ äUw°W«,ô—¿ãㆅү¢³xŠUû™yŒ (øSópÐ 9\åTâ»—*oG$/×ÍT†Y¿1¤Þ¢_‡ ¼ „±ÍçèSaÓ 3ÛMÁBkxs‰’R/¡¤ˆÙçª(*õ„üXÌ´ƒ E§´¬EF"Ù”R/ÐNyÆÂ^°?™6¡œïJ·±$§?º>ÖüœcNÌù¯G ‹ñ2ЁBB„^·úìaz¨k:#¨Æ¨8LÎõލ£^§S&cŒÐU€ü(‡F±Š¼&P>8ÙÁ ‰ p5?0ÊÆƒZl¸aô š¼¡}gÿ¶zÆC²¹¬ÎÖG*HB¡O<º2#ñŒAƒ–¡B˜´É$¥›É:FÀÔx¾u?XÜÏÓvN©RS{2ʈãk9rmP¼Qq̳ è¼ÐFׄ^¡Öì fE“F4A…!ì/…¦Lƒ… … $%´¾yã@CI¬ á—3PþBÏNÿ<ý°4Ü ËÃ#ØÍ~âW«rEñw‹eùMMHß²`¬Öó½íf³:‹k˜¯÷}Z!ã¿<¥,\#öµÀ¯aÒNÆIé,Ћ–lŽ#Àæ9ÀÒS·I’½-Ïp Äz¤Š Â* ­íÄ9­< h>׍3ZkËU¹§˜ŒŠ±f­’¤º³Q ÏB?‹#µíÃ¥®@(Gs«†vI¥Mµ‹Á©e~2ú³ÁP4ìÕi‚²Ê^ö@-DþÓàlÜOÍ]n"µã:žpsŽ¢:! Aõ.ç~ÓBûH÷JCÌ]õVƒd «ú´QÙEA–¯¯Œ!.ˆˆëQ±ù œ·Ì!Õâ )ùL„ÅÀlÚè5@B…o´Æ¸XÓ&Û…O«˜”_#‡ƒ„ûÈt!¤ÁÏ›ÎÝŠ?c9 â\>lÓÁVÄÑ™£eØY]:fÝ–—ù+p{™ðè û³”g±OƒÚSù£áÁÊ„ä,ï7š²G ÕÌBk)~ÑiCµ|h#u¤¶îK¨² #²vݯGãeÖ϶ú…¾múÀ¶þÔñ‚Š9'^($¤§ò “š½{éúp÷J›ušS¹áªCÂubÃH9™D™/ZöØÁ‡¦ÝÙŸ·kð*_”.C‹{áXó€‡c¡c€§/šò/&éš÷,àéJþ‰X›fµ“C¨œ®r¬"kL‰Â_q…Z–.ÉL~O µ›zn‚¹À¦Öª7\àHµšÖ %»ÇníV[¥*Õ;ƒ#½¾HK-ÖIÊdÏEÚ#=o÷Óò³´Š: Ç?{¾+9›–‘OEáU·S€˜j"ÄaÜ ŒÛWt› á–c#a»pÔZÞdŽtWê=9éöÊ¢µ~ ë ;Öe‡Œ®:bî3±ýê¢wà¼îpêñ¹¾4 zc¾ðÖÿzdêŒÑÒŝÀ‰s6¤í³ÎÙB¿OZ”+F¤á‡3@Ñëäg©·Ž ˆèª<ù@É{&S„œÕúÀA)‰h:YÀ5^ÂÓŒ°õäU\ ùËÍû#²?Xe¬tu‰^zÒÔãë¼ÛWtEtû …‚g¶Úüâî*moGè¨7%u!]PhÏd™Ý%Îx: VÒ¦ôÊD3ÀŽKÛËãvÆî…N¯ä>Eró–ð`5 Œ%u5XkñÌ*NU%¶áœÊ:Qÿú»“úzyÏ6å-၇¾ ´ ÒÊ]y žO‘w2Äøæ…H’²f±ÎÇ.ª|¥'gîV•Ü .̘¯€šòü¤U~Ù†*¢!?ò wý,}´°ÔÞnïoKq5µb!áÓ3"vAßH¡³¡·G(ÐÎ0Îò¼MG!/ài®@—¬04*`…«é8ªøøló“ˆÊ”èù¤…ßÊoÿé'ËuÌÖ5×È¡§ˆˆfŽë9}hìâ_!!¯  B&Ëö¶‰ÀAÙNVŸ Wh›¸®XÑJì¨ú“¿÷3uj²˜¨ÍÎìë±aúŠÝå¯ð*Ó¨ôJ“yºØ)m°WýOè68†ŸÏ2—‰Ïüꪫٚ¥‹l1 ø ÏÄFjêµvÌbü¦èÝx:X±¢H=MÐß—,ˆÉÇ´(9ú¾^ÅÚ4¿m‡$âX‘å%(AlZo@½¨UOÌÕ”1ø¸jÎÀÃÃ_ µ‘Ü.œº¦Ut: Æï’!=¯uwû#,“pþÇúŒø(é@?³ü¥‘Mo §—s@Œ#)§ŒùkL}NOÆêA›¸~r½¼ÙA—HJ«eˆÖ´*¡ÓpÌŸö.m<-"³ûÈ$¬_6­åf£ïÚâj1y§ÕJ½@dÞÁr&Í\Z%D£Íñ·AZ Û³øüd/ªAi†/Й~  ‡âĮҮÏh§°b—›Û«mJžòG'[ÈYýŒ¦9psl ýÁ ®±f¦x,‰½tN ‚Xª9 ÙÖH.«Lo0×?͹m¡å†Ѽ+›2ƒF ±Ê8 7Hցϓ²Æ–m9…òŸï]Â1äN†VLâCˆU .ÿ‰Ts +ÅÎx(%¦u]6AF Š ØF鈄‘ |¢¶c±soŒ/t[a¾–û:s·`i햍ê›ËchÈ…8ßÀUÜewŒðNOƒõD%q#éû\9¤x¹&UE×G¥ Í—™$ð E6-‡¼!ýpãÔM˜ Âsìe¯ñµK¢Ç¡ùôléœ4Ö£”À Š®Ðc ^¨À}ÙËŸ§›ºê{ÊuÉC ×Sr€¤’fÉ*j!úÓ’Gsùìoîßîn%ò· àc Wp÷$¨˜)û»H ×8ŽÒ€Zj¤3ÀÙºY'Ql¦py{-6íÔCeiØp‘‡XÊîÆUߢ܂ž£Xé¼Y8þ©ëgñß}é.ÎógÒ„ÃØËø¯»™§Xýy M%@NŠ À(~áÐvu7&•,Ù˜ó€uP‡^^®=_E„jt’ 403WebShell
403Webshell
Server IP : 104.21.27.90  /  Your IP : 216.73.217.46
Web Server : nginx/1.28.3
System : Linux 4e27b89abc44 6.8.0-147-generic #147-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 24 11:33:16 UTC 2026 x86_64
User :  ( 1000)
PHP Version : 8.2.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /sites/xo-fab.com/www/graphmailerwp/wp-content_old/plugins/breeze/assets/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /sites/xo-fab.com/www/graphmailerwp/wp-content_old/plugins/breeze/assets/js/breeze-main.js
jQuery( document ).ready(
	function ( $ ) {

		var $box_container = $( '.breeze-box' );

		var $compatibility_warning = $( '#breeze-plugins-notice' );
		if ( $compatibility_warning.length ) {
			$( document ).on(
				'click tap',
				'.notice-dismiss',
				function () {
					$.ajax(
						{
							type: "POST",
							url: ajaxurl,
							data: {
								action: "compatibility_warning_close",
								'breeze_close_warning': '1',
								security: breeze_token_name.breeze_check_compat
							},
							dataType: "json", // xml, html, script, json, jsonp, text
							success: function ( data ) {

							},
							error: function ( jqXHR, textStatus, errorThrown ) {

							},
							// called when the request finishes (after success and error callbacks are executed)
							complete: function ( jqXHR, textStatus ) {

							}
						}
					);
				}
			);
		}

		$( document ).on(
			'click',
			'.rollback-button',
			function (e) {
				e.preventDefault();
				var selectedVersion = $( '.breeze-version' ).val();
				// Display form submit confirmation dialog
				var confirmation = confirm( "Want to rollback version " + selectedVersion + " ?" );

				// If user confirms, submit the form
				if (confirmation) {
					document.getElementById( "breeze_rollback_form" ).submit();
				}
			}
		);

		// Purge All Notification.
		$( document ).on(
			'click',
			'#wp-admin-bar-breeze-purge-all',
			function () {
				var message = 'Purging All Cache...';
				purging_cache_notification( message );
			}
		);

		// Purge Site Cache Notification.
		$( document ).on(
			'click',
			'#wp-admin-bar-breeze-purge-site',
			function () {
				var message = 'Purging Site Cache...';
				purging_cache_notification( message );
			}
		);

		// Cloudflare purge cache action.
		$( document ).on(
			'click',
			'#wp-admin-bar-breeze-purge-cloudflare',
			function () {
				var message = 'Purging Cloudflare Cache...';
				purging_cache_notification( message );
			}
		);
		// Top bar action
		$( document ).on(
			'click',
			'#wp-admin-bar-breeze-purge-varnish-group',
			function ( e ) {
				e.preventDefault();
				breeze_purgeVarnish_callAjax();
			}
		);
		// Topbar action
		$( document ).on(
			'click',
			'#wp-admin-bar-breeze-purge-object-cache-group',
			function ( e ) {
				e.preventDefault();
				breeze_purge_opcache_ajax();
			}
		);

		$( document ).on(
			'click',
			'#wp-admin-bar-breeze-purge-file-group',
			function ( e ) {
				e.preventDefault();
				breeze_purgeFile_callAjax();
			}
		);

		// Reset Default
		$( document ).on(
			'click',
			'#breeze_reset_default',
			function ( e ) {
				e.preventDefault();

				reset_confirm = confirm( "Want to reset breeze settings?" );

				if ( reset_confirm ) {

					breeze_reset_default();
				}
			}
		);

		var purge_action = true;
		// Varnish clear button
		$( '.breeze-box' ).on(
			'click',
			'#purge-varnish-button',
			function ( e ) {
				e.preventDefault();

				if ( true === purge_action ) {
					purge_action = false;
					$( this ).addClass( 'br-is-disabled' );
					breeze_purgeVarnish_callAjax();
				}

			}
		);

		if ( $box_container.length ) {
			$( '.breeze-box' ).on(
				'keyup paste',
				'#cdn-url',
				function () {
					var cdn_value = $.trim( $( this ).val() );
					if ( '' !== cdn_value && true === is_valid_url( cdn_value ) ) {

						$.ajax(
							{
								type: "POST",
								url: ajaxurl,
								data: {
									action: 'breeze_check_cdn_url',
									'cdn_url': cdn_value,
									security: breeze_token_name.breeze_check_cdn_url
								},
								dataType: "json", // xml, html, script, json, jsonp, text
								success: function ( data ) {
									if ( false === data.success ) {
										$( '#cdn-message-error' ).show();
										$( '#cdn-message-error' ).html( data.message );
									} else {
										$( '#cdn-message-error' ).hide();
									}
								},
								error: function ( jqXHR, textStatus, errorThrown ) {

								},
								// called when the request finishes (after success and error callbacks are executed)
								complete: function ( jqXHR, textStatus ) {

								}
							}
						);
					} else {
						$( '#cdn-message-error' ).hide();
					}
				}
			);
		}

		function is_valid_url( url ) {
			return /^(http(s)?:)?\/\/(www\.)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/.test( url );
		}

		function purging_cache_notification(message = "Purging Cache...") {
			var $div = $('<div id="purging-cache-notification" class="notice notice-info is-dismissible breeze-notice"><p>' + message + '</p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>');
			$("#wpbody #wpbody-content").prepend($div);
			return $div;
		}

		//clear cache by button
		function breeze_purge_opcache_ajax() {
			$( '.breeze-notice' ).remove();
			var message = 'Purging Object Cache...';
			var $div    = purging_cache_notification( message );
			$.ajax(
				{
					url: ajaxurl,
					dataType: 'json',
					method: 'POST',
					data: {
						action: 'breeze_purge_opcache',
						is_network: $( 'body' ).hasClass( 'network-admin' ),
						security: breeze_token_name.breeze_purge_opcache
					},
					success: function ( res ) {
						$div.removeClass('notice-info');
						if ( res.clear ) {
							$div.addClass("notice-success");
							$div.find("p").text("Object Cache has been purged.");
						} else {
							$div.addClass("notice-error");
							$div.find("p").text("Object Cache could not be purged.");
						}
					}
				}
			);
		}

		//reset to default
		function breeze_reset_default() {
			$(
				'<div/>',
				{
					'id': 'breeze_loader_function'
				}
			).appendTo( 'body' );

			$(
				'<div/>',
				{
					'id': 'breeze_info',
					'html': '<span class="breeze-ajax-loader"></span>'
				}
			).appendTo( 'body' );

			$.ajax(
				{
					type: "POST",
					url: ajaxurl,
					data: {
						action: 'breeze_reset_default',
						"is-network": $( 'body' ).hasClass( 'network-admin' ),
						security: breeze_token_name.breeze_reset_default
					},
					dataType: "json", // xml, html, script, json, jsonp, text
					success: function ( data ) {
						if ( data === true ) {
							//alert('Settings reset to default');
							purge_action = true;
						} else {
							alert( 'Something went wrong - please try again' );
						}

					},
					error: function ( jqXHR, textStatus, errorThrown ) {

					},
						// called when the request finishes (after success and error callbacks are executed)
					complete: function ( jqXHR, textStatus ) {
						location.reload();
					}
				}
			);

		}

		//clear cache by button
		function breeze_purgeVarnish_callAjax() {
			$( '.breeze-notice' ).remove();
			var message = 'Purging Varnish Cache...';
			var $div    = purging_cache_notification( message );
			$.ajax(
				{
					url: ajaxurl,
					dataType: 'json',
					method: 'POST',
					data: {
						action: 'breeze_purge_varnish',
						is_network: $( 'body' ).hasClass( 'network-admin' ),
						security: breeze_token_name.breeze_purge_varnish
					},
					success: function ( res ) {
						$div.removeClass("notice-info");
						$div.addClass("notice-success");
						$div.find("p").text(res.responseJSON?.data);
					},
					error: function ( res ) {
						$div.removeClass("notice-info");
						$div.addClass("notice-error");
						$div.find("p").text(res.responseJSON?.data);
					}
				}
			);
		}

		function breeze_purgeFile_callAjax() {
			$( '.breeze-notice' ).remove();
			var message = 'Purging Internal File Based Cache...';
			var $div    = purging_cache_notification( message );
			$.ajax(
				{
					url: ajaxurl,
					dataType: 'json',
					method: 'POST',
					data: {
						action: 'breeze_purge_file',
						security: breeze_token_name.breeze_purge_cache
					},
					success: function ( res ) {
						res           = parseFloat( res );
						var fileClean = res;
						$div.removeClass('notice-info');
						if ( fileClean > 0 ) {
							var purgeText = 'Internal cache has been purged: ' + fileClean + 'Kb cleaned';
							$div.addClass("notice-success");
							$div.find("p").text(purgeText);
						} else {
							$div.addClass("notice-success");
							$div.find("p").text("Internal cache has been purged.");

						}

					}
				}
			);
		}

		function getParameterByName( name, url ) {
			if ( ! url ) {
				url = window.location.href;
			}
			name        = name.replace( /[\[\]]/g, "\\$&" );
			var regex   = new RegExp( "[?&]" + name + "(=([^&#]*)|&|#|$)" ),
				results = regex.exec( url );
			if ( ! results ) {
				return null;
			}
			if ( ! results[ 2 ] ) {
				return '';
			}
			return decodeURIComponent( results[ 2 ].replace( /\+/g, " " ) );
		}

		var url       = location.href;
		var fileClean = parseFloat( getParameterByName( 'file', url ) );

		$( window ).on(
			'load',
			function () {
				var patt = /wp-admin/i;
				if ( patt.test( url ) ) {
					//backend
					var div = '';
					if ( url.indexOf( "msg=success-cleancache" ) > 0 && ! isNaN( fileClean ) ) {
						if ( fileClean > 0 ) {
							div = '<div id="message" class="notice notice-success is-dismissible breeze-notice" style="margin-top:10px; margin-bottom:10px;padding: 10px;"><p><strong>Internal cache has been purged: ' + fileClean + 'Kb cleaned</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>';
						} else {
							div = '<div id="message" class="notice notice-success is-dismissible breeze-notice" style="margin-top:10px; margin-bottom:10px;padding: 10px;"><p><strong>Internal cache has been purged.</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>';

						}

						$( "#wpbody .wrap h1" ).after( div );

						var url_return = url.split( 'breeze-msg' );
						setTimeout(
							function () {
								window.location = url_return[ 0 ];
								//location.reload();
							},
							2000
						);
					}
				} else {
					//frontend
				}

			}
		);

		$( '#breeze-hide-install-msg' ).unbind( 'click' ).click(
			function () {
				$( this ).closest( 'div.notice' ).fadeOut();
			}
		)

		function current_url_clean() {
			var query_search = location.search;
			if ( ( query_search.indexOf( 'breeze_purge=1' ) !== -1 || query_search.indexOf( 'breeze_purge_cloudflare=1' ) !== -1 ) && query_search.indexOf( '_wpnonce' ) !== -1 ) {
				var params = new URLSearchParams( location.search );
				params.delete( 'breeze_purge' )
				params.delete( 'breeze_purge_cloudflare' )
				params.delete( '_wpnonce' )
				history.replaceState( null, '', '?' + params + location.hash )
			}
		}

		current_url_clean();

		// Advanced options, API tab
		$box_container.on(
			'change',
			'#breeze-enable-api',
			function () {
				var secure_api = $( '#breeze-secure-api' );
				var token_api  = $( '#breeze-api-token' );
				//var api_route = $( '#breeze-secure-api' );

				if ( $( this ).is( ':checked' ) ) {
					secure_api.closest( 'div.br-option-item' ).removeClass( 'br-apply-disable' );
					token_api.closest( 'div.br-option-item' ).removeClass( 'br-apply-disable' );
				} else {
					secure_api.closest( 'div.br-option-item' ).addClass( 'br-apply-disable' );
					token_api.closest( 'div.br-option-item' ).addClass( 'br-apply-disable' );

					secure_api.prop( 'checked', false );
					//token_api.trigger( 'change' );
				}
			}
		);

		$box_container.on(
			'change',
			'#bz-lazy-load',
			function () {

				var native_lazy         = $( '#native-lazy-option' );
				var native_lazy_iframes = $( '#native-lazy-option-iframe' );
				var native_lazy_video   = $( '#native-lazy-option-videos' );
				if ( true === $( this ).is( ':checked' ) ) {
					native_lazy.show();
					native_lazy_iframes.show();
					native_lazy_video.show();
				} else {
					native_lazy.hide();
					native_lazy_iframes.hide();
					native_lazy_video.hide();
					$( '#bz-lazy-load-nat' ).attr( 'checked', false );
					$( '#bz-lazy-load-iframe' ).attr( 'checked', false );
					$( '#bz-lazy-load-videos' ).attr( 'checked', false );
				}
			}
		);
		/*
		 var font_display_swap = $( '#font-display-swap' );
		 var font_display      = $( '#font-display' );
		 var css_minification  = $( '#minification-css' );

		 if ( css_minification.is( ':checked' ) ) {
		 font_display_swap.show();
		 } else {
		 font_display_swap.hide();
		 font_display.attr( 'checked', false );
		 }
		 */

		$box_container.on(
			'change',
			'#minification-css',
			function () {
				var font_display_swap = $( '#font-display-swap' );
				var font_display      = $( '#font-display' );

				var include_inline_css = $( '#include-inline-css' );
				var group_css          = $( '#group-css' );
				var minification_css   = $( '#exclude-css' );

				if ( $( this ).is( ':checked' ) ) {
					font_display_swap.show();
					//include_inline_css.removeAttr( 'disabled' );
					//group_css.removeAttr( 'disabled' );

					minification_css.closest( 'div.br-option-item' ).removeClass( 'br-apply-disable' );
					group_css.closest( 'div.br-option-item' ).removeClass( 'br-apply-disable' );
					include_inline_css.closest( 'div.br-option-item' ).removeClass( 'br-apply-disable' );
				} else {
					font_display_swap.hide();
					font_display.removeAttr( 'checked' );
					//include_inline_css.removeAttr( 'checked' ).attr( 'disabled', 'disabled' );
					//group_css.removeAttr( 'checked' ).attr( 'disabled', 'disabled' );
					include_inline_css.prop( 'checked', false );
					group_css.prop( 'checked', false );

					minification_css.closest( 'div.br-option-item' ).addClass( 'br-apply-disable' );
					group_css.closest( 'div.br-option-item' ).addClass( 'br-apply-disable' );
					include_inline_css.closest( 'div.br-option-item' ).addClass( 'br-apply-disable' );
				}
			}
		);

		$box_container.on(
			'change',
			'#minification-js',
			function () {

				var include_inline_js = $( '#include-inline-js' );
				var group_js          = $( '#group-js' );
				var exclude_js        = $( '#exclude-js' );
				var delay_js_scripts  = $( '#enable-js-delay' ); // Delay JS Inline Scripts
				var enable_js_delay   = $( '#breeze-delay-all-js' ); // Delay All JavaScript

				if ( $( this ).is( ':checked' ) ) {
					//include_inline_js.removeAttr( 'disabled' );
					//group_js.removeAttr( 'disabled' );

					exclude_js.closest( 'div.br-option-item' ).removeClass( 'br-apply-disable' );
					if ( include_inline_js.is( "checked" ) ) {
						if ( ! delay_js_scripts.is( ':checked' ) && ! enable_js_delay.is( ':checked' ) ) {

						}
					}
					group_js.closest( 'div.br-option-item' ).removeClass( 'br-apply-disable' ); // breeze 194
					include_inline_js.closest( 'div.br-option-item' ).removeClass( 'br-apply-disable' );
				} else {
					//include_inline_js.removeAttr( 'checked' ).attr( 'disabled', 'disabled' );
					//group_js.removeAttr( 'checked' ).attr( 'disabled', 'disabled' );
					include_inline_js.prop( 'checked', false );
					group_js.prop( 'checked', false );
					group_js.trigger( 'change' );

					exclude_js.closest( 'div.br-option-item' ).addClass( 'br-apply-disable' );
					group_js.closest( 'div.br-option-item' ).addClass( 'br-apply-disable' );
					include_inline_js.closest( 'div.br-option-item' ).addClass( 'br-apply-disable' );
				}
			}
		);

		/**
		 * Breeze 194
		 */
		// $box_container.on(
		// 	'change',
		// 	'#include-inline-js',
		// 	function () {
		// 		var js_minification = $( '#minification-js' );
		// 		var delay_js_scripts = $( '#enable-js-delay' ); // Delay JS Inline Scripts
		// 		var enable_js_delay = $( '#breeze-delay-all-js' ); // Delay All JavaScript
		// 		var group_js        = $( '#group-js' );
		// 		if ( js_minification.is( ':checked' ) ) {
		// 			if ( !delay_js_scripts.is( ':checked' ) && !enable_js_delay.is( ':checked' ) ) {
		// 			group_js.closest( 'div.br-option-item' ).removeClass( 'br-apply-disable' );
		// 		}
		// 		}
		//
		// 		if ( $( this ).is( ':checked' ) ) {
		// 			if ( !delay_js_scripts.is( ':checked' ) && !enable_js_delay.is( ':checked' ) ) {
		// 			group_js.closest( 'div.br-option-item' ).removeClass( 'br-apply-disable' );
		// 			}
		// 		} else {
		// 			group_js.closest( 'div.br-option-item' ).addClass( 'br-apply-disable' );
		// 			group_js.prop( 'checked', false );
		// 		}
		// 	}
		// );

		$box_container.on(
			'change',
			'#group-js',
			function () {

				var delay_js_scripts = $( '#enable-js-delay' ); // Delay JS Inline Scripts
				var enable_js_delay  = $( '#breeze-delay-all-js' ); // Delay All JavaScript

				if ( $( this ).is( ':checked' ) ) {
					delay_js_scripts.closest( 'div.br-option-item' ).addClass( 'br-apply-disable' );
					delay_js_scripts.prop( 'checked', false );

					enable_js_delay.closest( 'div.br-option-item' ).addClass( 'br-apply-disable' );
					enable_js_delay.prop( 'checked', false );
				} else {
					delay_js_scripts.closest( 'div.br-option-item' ).removeClass( 'br-apply-disable' );
					enable_js_delay.closest( 'div.br-option-item' ).removeClass( 'br-apply-disable' );
				}
			}
		);

		$box_container.on(
			'change',
			'#breeze-delay-all-js',
			function () {

				var group_js             = $( '#group-js' );
				var $delay_js_div_all    = $( '#breeze-delay-js-scripts-div-all' );
				var $enable_inline_delay = $( '#enable-js-delay' );

				if ( $( this ).is( ':checked' ) ) {
					$delay_js_div_all.show();
					$( 'input[name="enable-js-delay"]' ).prop( 'checked', false );
					$( '#breeze-delay-js-scripts-div' ).hide();
					$enable_inline_delay.attr( 'disabled', 'disabled' );
					group_js.closest( 'div.br-option-item' ).addClass( 'br-apply-disable' );
					group_js.prop( 'checked', false );
				} else {
					$delay_js_div_all.hide();
					$enable_inline_delay.removeAttr( 'disabled' );
					group_js.closest( 'div.br-option-item' ).removeClass( 'br-apply-disable' );
				}
			}
		)

		$box_container.on(
			'change',
			'#enable-js-delay',
			function () {
				var $delay_js_div = $( '#breeze-delay-js-scripts-div' );
				var $delay_all_js = $( '#breeze-delay-all-js' );
				var group_js      = $( '#group-js' );

				if ( $( this ).is( ':checked' ) ) {
					$delay_js_div.show();
					$( 'input[name="breeze-delay-all-js"]' ).prop( 'checked', false );
					$( '#breeze-delay-js-scripts-div-all' ).hide();
					$delay_all_js.attr( 'disabled', 'disabled' );
					group_js.closest( 'div.br-option-item' ).addClass( 'br-apply-disable' );
					group_js.prop( 'checked', false );
				} else {
					$delay_js_div.hide();
					$delay_all_js.removeAttr( 'disabled' );
					group_js.closest( 'div.br-option-item' ).removeClass( 'br-apply-disable' );
				}
			}
		)
	}
);

var $valid_json = false;
jQuery( document ).ready(
	function ( $ ) {
		var $tab_import = $( '.breeze-box' );
		// database clean tabs
		$( 'input[name="all_control"]' ).click(
			function () {
				var checked = $( this ).is( ':checked' );
				if ( checked == true ) {
					$( ".clean-data" ).prop( "checked", true );
				} else {
					$( ".clean-data" ).prop( "checked", false );
				}
			}
		);

		$( '.clean-data' ).click(
			function () {
				var checked = $( this ).is( ':checked' );
				if ( checked == false ) {
					$( 'input[name="all_control"]' ).prop( 'checked', false );
				}
			}
		);

		function initRemoveBtn() {
			$tab_import.on(
				'click',
				'span.item-remove',
				function(){
					var inputURL = $( this ).closest( '.breeze-input-group' );
					inputURL.fadeOut(
						300,
						function () {
							inputURL.remove();
							validateMoveButtons();
						}
					);
				}
			);

		}

		initRemoveBtn();

		function initSortableHandle() {

			if ( $( '.breeze-list-url' ).length ) {
				$( '.breeze-list-url' ).sortable(
					{
						handle: $( 'span.sort-handle' ),
						stop: validateMoveButtons
					}
				);
			}
		}

		initSortableHandle();

		function initMoveButtons() {
			$( '.sort-handle span' ).unbind( 'click' ).click(
				function ( e ) {
					var inputGroup = $( this ).parents( '.breeze-input-group' );
					if ( $( this ).hasClass( 'moveUp' ) ) {
						inputGroup.insertBefore( inputGroup.prev() );
					} else {
						inputGroup.insertAfter( inputGroup.next() );
					}

					validateMoveButtons();
				}
			);
		}

		initMoveButtons();

		function validateMoveButtons() {
			var listURL = $( '.breeze-list-url' );
			listURL.find( '.breeze-input-group' ).find( '.sort-handle' ).find( 'span' ).removeClass( 'blur' );
			listURL.find( '.breeze-input-group:first-child' ).find( '.moveUp' ).addClass( 'blur' );
			listURL.find( '.breeze-input-group:last-child' ).find( '.moveDown' ).addClass( 'blur' );
		}

		validateMoveButtons();

		function is_valid_url(str) {
			var regexp = /^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/;
			if (regexp.test( str )) {
				return true;
			} else {
				return false;
			}
		}
		$tab_import.on(
			'keyup change blur',
			'.breeze-input-url',
			function(){
				var url_value = $( this ).val();
				if ('' !== url_value) {
					var is_valid = is_valid_url( url_value );
					if (true === is_valid) {
						$( this ).removeClass( 'is-invalid-url' )
					} else {
						$( this ).addClass( 'is-invalid-url' );
					}
				}
			}
		);

		//$( 'button.add-url' ).unbind( 'click' ).click(
		$tab_import.on(
			'click',
			'button.add-url',
			function () {

				var defer      = $( this ).attr( 'id' ).indexOf( 'defer' ) > -1;
				var preload    = $( this ).attr( 'id' ).indexOf( 'preload-fonts' ) > -1;
				var listURL    = $( this ).closest( 'div.br-option' ).find( '.breeze-list-url' );
				var html       = '';
				var listInput  = listURL.find( '.breeze-input-group' );
				var emptyInput = false;

				listInput.each(
					function () {
						var thisInput = $( this ).find( '.breeze-input-url' );
						if ( thisInput.val().trim() === '' ) {
							thisInput.focus();
							emptyInput = true;
							return false;
						}
					}
				);

				if ( emptyInput ) {
					return false;
				}

				html += '<div class="breeze-input-group">';
				html += '   <input type="text" size="98"';
				html += 'class="breeze-input-url"';
				if ( preload ) {
					html += 'name="breeze-preload-font[]"';
				} else if ( ! defer ) {
					html += 'name="move-to-footer-js[]"';
				} else {
					html += 'name="defer-js[]"';
				}
				html += 'placeholder="Enter URL..."';
				html += 'value="" />';
				html += '   <span class="sort-handle">';
				html += '       <span class="dashicons dashicons-arrow-up moveUp"></span>';
				html += '       <span class="dashicons dashicons-arrow-down moveDown"></span>';
				html += '   </span>';
				html += '       <span class="dashicons dashicons-no item-remove" title="Remove"></span>';
				html += '</div>';

				listURL.append( html );
				initRemoveBtn();
				initSortableHandle();
				initMoveButtons();
				validateMoveButtons();
			}
		);

		// Change tab // TODO REMOVE
		$( "#breeze-tabs .nav-tab" ).click(
			function ( e ) {
				e.preventDefault();
				$( "#breeze-tabs .nav-tab" ).removeClass( 'active' );
				$( e.target ).addClass( 'active' );
				id_tab = $( this ).data( 'tab-id' );
				$( "#tab-" + id_tab ).addClass( 'active' );
				$( "#breeze-tabs-content .tab-pane" ).removeClass( 'active' );
				$( "#tab-content-" + id_tab ).addClass( 'active' );
				document.cookie = 'breeze_active_tab=' + id_tab;

				// Toggle right-side content
				if ( id_tab === 'faq' ) {
					$( '#breeze-and-cloudways' ).hide();
					if ( $( '#faq-content' ).length ) {
						$( '#faq-content' ).accordion(
							{
								collapsible: true,
								animate: 200,
								header: '.faq-question',
								heightStyle: 'content'
							}
						);
					}
				} else {
					$( '#breeze-and-cloudways' ).show();
				}
			}
		);

		// Cookie do
		function Breeze_setTabFromCookie() {
			var breeze_active_tab = getCookie( 'breeze_active_tab' );
			if ( ! breeze_active_tab ) {
				breeze_active_tab = 'basic';
			}

			if ('import_export' === breeze_active_tab) {
				breeze_active_tab = 'basic';
			}

			if ( $( "#tab-" + breeze_active_tab ).length === 0 ) { // Tab not found (multisite case)
				firstTab = $( '#breeze-tabs' ).find( 'a:first-child' );
				if (firstTab.length) {
					tabType = firstTab.attr( 'id' ).replace( 'tab-', '' );
					firstTab.addClass( 'active' );
					$( "#tab-content-" + tabType ).addClass( 'active' );
				}
			} else {
				$( "#tab-" + breeze_active_tab ).addClass( 'active' );
				$( "#tab-content-" + breeze_active_tab ).addClass( 'active' );
			}

			// Toggle right-side content
			if ( breeze_active_tab === 'faq' ) {
				$( '#breeze-and-cloudways' ).hide();
				if ( $( '#faq-content' ).length ) {
					$( '#faq-content' ).accordion(
						{
							collapsible: true,
							animate: 200,
							header: '.faq-question',
							heightStyle: 'content'
						}
					);
				}
			} else {
				$( '#breeze-and-cloudways' ).show();
			}
		}

		function getCookie( cname ) {
			var name = cname + "=";
			var ca   = document.cookie.split( ';' );
			for ( var i = 0; i < ca.length; i++ ) {
				var c = ca[ i ];
				while ( c.charAt( 0 ) == ' ' ) {
					c = c.substring( 1 );
				}
				if ( c.indexOf( name ) == 0 ) {
					return c.substring( name.length, c.length );
				}
			}
			return "";
		}

		Breeze_setTabFromCookie();

		// Sub-site settings toggle.
		var global_tabs                          = [
			'faq'
		];
		var save_settings_inherit_form_on_submit = true;
		var settings_inherit_form_did_change     = false;
		var $settings_inherit_form               = $( '#breeze-inherit-settings-toggle' );
		if ( $settings_inherit_form.length ) {
			$( 'input', $settings_inherit_form ).on(
				'change',
				function () {
					var inherit = $( this ).val() == '1';

					$( '#breeze-tabs' ).toggleClass( 'tabs-hidden', inherit );
					$( '#breeze-tabs-content' ).toggleClass( 'tabs-hidden', inherit );

					$( '#breeze-tabs .nav-tab' ).each(
						function () {
							var tab_id = $( this ).data( 'tab-id' );

							if ( $.inArray( tab_id, global_tabs ) === -1 ) {
								$( this ).toggleClass( 'inactive', inherit );
								$( '#breeze-tabs-content #tab-content-' + tab_id ).toggleClass( 'inactive', inherit );
							}
						}
					);

					settings_inherit_form_did_change = ! $( this ).parents( '.radio-field' ).hasClass( 'active' );

					//$( 'p.disclaimer', $settings_inherit_form ).toggle( settings_inherit_form_did_change );
				}
			);

			$( '#breeze-tabs-content form' ).on(
				'submit',
				function ( event ) {
					var $form = $( this );

					if ( save_settings_inherit_form_on_submit && settings_inherit_form_did_change ) {
						event.preventDefault();

						$.ajax(
							{
								url: window.location,
								method: 'post',
								data: $settings_inherit_form.serializeArray(),

								beforeSend: function () {
									$settings_inherit_form.addClass( 'loading' );
								},

								complete: function () {
									$settings_inherit_form.removeClass( 'loading' );

									// Continue form submit.
									settings_inherit_form_did_change = false;
									$form.submit();
								},

								success: function () {
									$( 'input:checked', $settings_inherit_form ).parents( '.radio-field' ).addClass( 'active' ).siblings().removeClass( 'active' );
								}
							}
						);
					} else {
						return;
					}
				}
			);
		}

		// Database optimization.
		$( '#breeze-database-optimize' ).on(
			'click',
			function ( event ) {
				save_settings_inherit_form_on_submit = false;
			}
		);
		$( '#tab-content-database .submit input' ).on(
			'click',
			function ( event ) {
				$( '#tab-content-database input[type=checkbox]' ).attr( 'checked', false );
			}
		);

		function remove_query_arg( url, arg ) {
			var urlparts = url.split( '?' );
			if ( urlparts.length >= 2 ) {
				var prefix = encodeURIComponent( arg ) + '=';
				var pars   = urlparts[ 1 ].split( /[&;]/g );

				for ( var i = pars.length; i-- > 0; ) {
					if ( pars[ i ].lastIndexOf( prefix, 0 ) !== -1 ) {
						pars.splice( i, 1 );
					}
				}

				return urlparts[ 0 ] + ( pars.length > 0 ? '?' + pars.join( '&' ) : '' );
			}
			return url;
		}

		// Remove notice query args from URL.
		if ( window.history && typeof window.history.pushState === 'function' ) {
			var clean_url = remove_query_arg( window.location.href, 'save-settings' );
			clean_url     = remove_query_arg( clean_url, 'database-cleanup' );
			window.history.replaceState( null, null, clean_url );
		}

		/**
		 * Import/Export settings TAB.
		 */

		$tab_import.on(
			'click tap',
			'#breeze_export_settings',
			function () {
				$network        = $( '#breeze-level' ).val();
				window.location = ajaxurl + '?action=breeze_export_json&network_level=' + $network+'&security=' + breeze_token_name.breeze_export_json;
			}
		);

		$( '#breeze_import_btn' ).attr( 'disabled', 'disabled' );

		$tab_import.on(
			'change',
			'#breeze_import_settings',
			function () {
				var the_file          = this.files[ 0 ];
				var filename_holder   = $( '#file-selected' );
				var filename_error    = $( '#file-error' );
				var breeze_import_btn = $( '#breeze_import_btn' );

				filename_holder.html( the_file.name );
				if ( 'application/json' !== the_file.type ) {
					$valid_json = false;
					filename_holder.removeClass( 'file_green file_red' ).addClass( 'file_red' );
					filename_error.html( 'File must be JSON' );
					breeze_import_btn.attr( 'disabled', 'disabled' );
				} else {
					$valid_json = true;
					filename_holder.removeClass( 'file_green file_red' ).addClass( 'file_green' );
					filename_error.html( '' );
					breeze_import_btn.removeAttr( 'disabled' );
				}
				$( '.br-file-text' ).remove();
			}
		);

		$tab_import.on(
			'click tap',
			'#breeze_import_btn',
			function () {
				if ( true === $valid_json ) {
					var network      = $( '#breeze-level' ).val();
					var the_file = $( '#breeze_import_settings' ).get( 0 ).files[ 0 ];

					var breeze_data = new FormData();
					breeze_data.append( 'action', 'breeze_import_json' );
					breeze_data.append( 'network_level', network );
					breeze_data.append( 'breeze_import_file', the_file );
					breeze_data.append( 'security', breeze_token_name.breeze_import_settings );

					var filename_holder = $( '#file-selected' );
					var filename_error  = $( '#file-error' );
					var import_settings = '<div class="br-loader-spinner import_settings"><div></div><div></div><div></div><div></div></div>';
					filename_holder.removeClass( 'file_green file_red' ).addClass( 'file_green' );
					filename_holder.html( import_settings );
					$.ajax(
						{
							type: "POST",
							url: ajaxurl,
							data: breeze_data,
							processData: false,
							contentType: false,
							enctype: 'multipart/form-data',
							mimeType: 'multipart/form-data', // this too
							cache: false,
							dataType: 'json', // xml, html, script, json, jsonp, text
							success: function ( json ) {

								if ( true == json.success ) {
									filename_holder.removeClass( 'file_green file_red' ).addClass( 'file_green' );
									filename_holder.html( json.data );
									filename_error.html( '' );
									alert( json.data );
									window.location.reload( true );
								} else {
									filename_holder.removeClass( 'file_green file_red' );
									filename_holder.html( '' );
									filename_error.html( json.data[ 0 ].message );
								}
							},
							error: function ( jqXHR, textStatus, errorThrown ) {

							},
							// called when the request finishes (after success and error callbacks are executed)
							complete: function ( jqXHR, textStatus ) {

							}
						}
					);

				}
			}
		);
	}
);

/**
 * Created by <Cloudways> on 09/11/2021.
 */
( function ( $ ) {
	var selected_services = [];

	setTimeout(
		function () {
			var found_alert = $( '.message-clear-cache-top' );
			if ( found_alert.length ) {
				found_alert.prependTo( '#wpbody-content' );
				found_alert.show();
			}
		},
		1000
	);

	$( window ).on(
		'resize',
		function () {
			var win = $( this ); //this = window
			if ( win.height() >= 632 ) {
				$( '.br-link' ).removeAttr( 'style' );
			}
		}
	);

	var loader_spinner = '<div class="br-loader-spinner loading_tab"><div></div><div></div><div></div><div></div></div>';
	var loader_spinner_save = '<div class="br-loader-spinner saving_settings"><div></div><div></div><div></div><div></div></div>';

	// document.cookie = 'breeze_active_tab=' + requested_tab;
	$( document ).on( 'click', '#breeze-cache-on', function ( e ) {
		e.preventDefault();
		document.cookie = 'breeze_active_tab=basic';
		window.location.href = $( this ).attr( 'href' );
	} )

	$( '.breeze-box .br-link' ).on(
		'click tap',
		'a',
		function ( e ) {
			e.preventDefault();
			var requested_tab = this.dataset.tabId;
			var $html_area = $( '.br-options' );
			active_tab = get_cookie( 'breeze_active_tab' );
			if ( !active_tab ) {
				active_tab = 'basic';
			}

			$( '.br-link' ).removeClass( 'br-active' );
			$( '.br-link' ).each(
				function ( index, element ) {
					// element == this
					var $the_slug = element.dataset.breezeLink;
					var $image = $( this ).find( 'img' );
					var $image_path = $image.get( 0 ).dataset.path;
					$image.attr( 'src', $image_path + $the_slug + '.png' );
				}
			);

			var this_line = $( this ).closest( '.br-link' );
			this_line.addClass( 'br-active' );
			var $image = this_line.find( 'img' );
			var $image_path = $image.get( 0 ).dataset.path;
			$image.attr( 'src', $image_path + requested_tab + '-active.png' );
			$html_area.html( loader_spinner );

			var $mobile_menu_is = $( '.br-mobile-menu' ).is( ':visible' );
			if ( true === $mobile_menu_is ) {
				$( '.br-link' ).fadeOut();
			}

			$.ajax(
				{
					type: "GET",
					url: ajaxurl,
					data: { action: 'breeze_load_options_tab', 'request_tab': requested_tab, 'is-network': $( 'body' ).hasClass( 'network-admin' ) },
					contentType: 'text/html; charset=UTF-8',
					dataType: 'html', // xml, html, script, json, jsonp, text
					success: function ( data ) {
						$html_area.html( data );
					},
					error: function ( jqXHR, textStatus, errorThrown ) {

					},
					// called when the request finishes (after success and error callbacks are executed)
					complete: function ( jqXHR, textStatus ) {
						breeze_permission_check();
						document.cookie = 'breeze_active_tab=' + requested_tab;
						if ( 'faq' === requested_tab ) {
							if ( $( '#faq-content' ).length ) {
								$( '#faq-content' ).accordion(
									{
										collapsible: true,
										animate: 200,
										header: '.faq-question',
										heightStyle: 'content'
									}
								);
							}

						}
						selected_services = [];

						var global_group_js = $( '#group-js' );
						var global_delay_js_scripts = $( '#enable-js-delay' ); // Delay JS Inline Scripts
						var global_enable_js_delay = $( '#breeze-delay-all-js' ); // Delay All JavaScript
						var is_exception_delay_js, is_exception_enable_js;
						if ( global_delay_js_scripts.length ) {
							is_exception_delay_js = $( '#enable-js-delay' ).get( 0 ).dataset.noaction;
						}
						if ( global_enable_js_delay.length ) {
							is_exception_enable_js = $( '#breeze-delay-all-js' ).get( 0 ).dataset.noaction;
						}


						if ( global_group_js.length ) {
							if ( global_group_js.is( ':checked' ) ) {
								if ( typeof is_exception_delay_js === 'undefined' ) {
									global_delay_js_scripts.closest( 'div.br-option-item' ).addClass( 'br-apply-disable' );
								}

								if ( typeof is_exception_enable_js === 'undefined' ) {
									global_enable_js_delay.closest( 'div.br-option-item' ).addClass( 'br-apply-disable' );
								}

								if ( typeof is_exception_delay_js === 'undefined' && global_delay_js_scripts.is( ':checked' ) ) {
									global_delay_js_scripts.prop( 'checked', false );
									global_delay_js_scripts.trigger( 'change' );
								}

								if ( typeof is_exception_enable_js === 'undefined' && global_enable_js_delay.is( ':checked' ) ) {
									global_enable_js_delay.prop( 'checked', false );
									global_enable_js_delay.trigger( 'change' );
								}


							} else if ( global_delay_js_scripts.is( ':checked' ) || global_enable_js_delay.is( ':checked' ) ) {
								global_group_js.closest( 'div.br-option-item' ).addClass( 'br-apply-disable' );
								global_group_js.prop( 'checked', false );
							}

						}
					}
				}
			);
		}
	);

	function breeze_permission_check() {
		var existing_notice = $( '.breeze-per' );

		if ( existing_notice.length ) {
			existing_notice.empty();
			existing_notice.append( '<p>Re-checking permissions, please wait...</p>' );
		}

		$.ajax( {
			type: "GET",
			url: ajaxurl,
			data: {
				action: "breeze_file_permission_check",
				'is-network': $( 'body' ).hasClass( 'network-admin' ),
				'security': breeze_token_name.breeze_check_permission,
			},
			dataType: "html", // xml, html, script, json, jsonp, text
			success: function ( data ) {
				if ( '' === data || 'no-issue' === data ) {
					existing_notice.remove();
				} else {
					if ( existing_notice.length ) {
						$( data ).insertBefore( existing_notice );
						existing_notice.remove();
					} else {
						$( '#wpbody-content' ).prepend( data );
					}
				}
			},
			error: function ( jqXHR, textStatus, errorThrown ) {

			},
			// called when the request finishes (after success and error callbacks are executed)
			complete: function ( jqXHR, textStatus ) {

			}
		} );
	}

	function get_cookie( cname ) {
		var name = cname + "=";
		var ca = document.cookie.split( ';' );
		for ( var i = 0; i < ca.length; i++ ) {
			var c = ca[ i ];
			while ( c.charAt( 0 ) == ' ' ) {
				c = c.substring( 1 );
			}
			if ( c.indexOf( name ) == 0 ) {
				return c.substring( name.length, c.length );
			}
		}
		return "";
	}

	var active_tab = get_cookie( 'breeze_active_tab' );

	if ( $( '#tab-basic' ).closest( 'div.br-link' ).hasClass( 'br-hide' ) ) {
		$( '#tab-faq' ).trigger( 'click' );

	} else {

		if ( typeof active_tab !== 'undefined' && '' !== active_tab ) {
			if ( 'import_export' === active_tab ) {
				active_tab = 'basic';
			}
			var link_target = $( '#tab-' + active_tab );
			if ( link_target.length ) {
				link_target.trigger( 'click' );
			}
		} else {
			var default_target = $( '#tab-basic' );
			if ( default_target.length ) {
				default_target.trigger( 'click' );
			}
		}
	}

	var $container_box = $( '.breeze-box' );

	$container_box.on(
		'click',
		'.br-db-item',
		function () {
			var this_section_id = this.dataset.section;

			if ( $( this ).hasClass( 'br-db-selected' ) ) {
				$( this ).removeClass( 'br-db-selected' );
				if ( selected_services.length ) {
					var temp_array = [];
					for ( var i = 0; i < selected_services.length; i++ ) {
						if ( this_section_id !== selected_services[ i ] ) {
							temp_array.push( selected_services[ i ] );
						}
					}
					selected_services = temp_array;
				}
			} else {
				$( this ).addClass( 'br-db-selected' );
				selected_services.push( this_section_id );
			}

			var submit_services = $( '#optimize-selected-services' );
			if ( selected_services.length ) {
				submit_services.show();
			} else {
				submit_services.hide();
			}
		}
	);
	$container_box.on(
		'click',
		'#optimize-selected-services',
		function ( e ) {
			var do_task = false;
			if ( selected_services.length ) {
				do_task = true;
			}
			if ( false === do_task ) {
				alert( 'Please select an options first' );
			} else {
				var ask_clean_start = confirm( 'Proceed to optimize the selected items?' );

				if ( ask_clean_start ) {
					$(
						'<div/>',
						{
							'id': 'breeze_loader_function'
						}
					).appendTo( 'body' );

					$(
						'<div/>',
						{
							'id': 'breeze_info'
						}
					).appendTo( 'body' );

					breeze_do_db_actions( selected_services, 0 );
				}
			}
		}
	);

	/**
	 * Format string to capital case
	 * created for breeze_do_db_actions:1307
	 *
	 * @param str
	 * @returns {*}
	 */
	function breeze_uc_words( str ) {
		return str.replace( /(^|\s)\S/g, function ( match ) {
			return match.toUpperCase();
		} );
	}

	function breeze_do_db_actions( selected_services, call_index, optimize_db_no ) {
		if ( typeof optimize_db_no === 'undefined' ) {
			optimize_db_no = {
				'page_no': 0,
				'total_no': 0
			};
		}

		var title = selected_services[ call_index ];
		title = title.replace( /_/gi, " " );
		title = breeze_uc_words( title );
		title = '<span class="breeze-ajax-loader"></span> ' + ' ' + title;

		if ( 'optimize_database' === selected_services[ call_index ] ) {
			var current_db_count = optimize_db_no.page_no * 50;
			title = title + ' (' + current_db_count + ' / ' + optimize_db_no.total_no + ' )';
		}
		$( 'body' ).find( '#breeze_info' ).html( title );
		var count_total = selected_services.length;
		var do_increment = true;
		$.ajax(
			{
				type: "POST",
				url: ajaxurl,
				data: {
					action: "breeze_purge_database",
					'action_type': selected_services[ call_index ],
					'db_count': optimize_db_no.page_no,
					//'services': JSON.stringify( Object.assign( {}, selected_services[call_index] ) ),
					'security': breeze_token_name.breeze_purge_database,
					'is-network': $( 'body' ).hasClass( 'network-admin' )
				},
				dataType: "JSON", // xml, html, script, json, jsonp, text
				success: function ( data ) {

					if ( data.clear.optmize_no ) {
						optimize_db_no.page_no = data.clear.optmize_no;
						optimize_db_no.total_no = data.clear.db_total;
						do_increment = false;
						breeze_do_db_actions( selected_services, call_index, optimize_db_no );
						//call_index--;
					} else {
						do_increment = true;
						$( 'div.br-db-item' ).each(
							function ( index, element ) {
								var this_section_id = element.dataset.section;
								// element == this
								if ( $.inArray( this_section_id, selected_services ) !== -1 ) {
									$( element ).find( 'h3' ).find( 'span' ).removeClass( 'br-has' ).html( '0' );
									$( element ).removeClass( 'br-db-selected' );
								}
							}
						);
					}

				},
				error: function ( jqXHR, textStatus, errorThrown ) {
					$( '#breeze_loader_function' ).remove();
					$( 'body' ).find( '#breeze_info' ).remove();
					alert( 'Error while trying to optimize' );
				},
				// called when the request finishes (after success and error callbacks are executed)
				complete: function ( jqXHR, textStatus ) {
					if ( true === do_increment ) {
						call_index++;

						if ( call_index < count_total ) {
							breeze_do_db_actions( selected_services, call_index );
						} else {
							selected_services = [];
							$( '#breeze_loader_function' ).remove();
							$( 'body' ).find( '#breeze_info' ).remove();
							$( '#tab-database' ).trigger( 'click' );
						}
					}
				}
			}
		);
	}

	$container_box.on(
		'click',
		'.do_clean_action',
		function ( e ) {
			e.preventDefault();
			var action_type = this.dataset.section;
			var section = $( this ).closest( 'div.br-db-item' );
			var section_title = section.get( 0 ).dataset.sectionTitle;

			var confirm_action = confirm( 'Confirm the action to clean ' + section_title );

			if ( confirm_action ) {
				$( this ).addClass( 'opac' );
				$.ajax(
					{
						type: "POST",
						url: ajaxurl,
						data: {
							action: "breeze_purge_database",
							'action_type': action_type,
							'security': breeze_token_name.breeze_purge_database,
							'is-network': $( 'body' ).hasClass( 'network-admin' )
						},
						dataType: "JSON", // xml, html, script, json, jsonp, text
						success: function ( data ) {
							section.find( 'h3' ).find( 'span' ).removeClass( 'br-has' ).html( '0' );

							alert( 'Data for ' + section_title + ' has been cleaned' );
						},
						error: function ( jqXHR, textStatus, errorThrown ) {

						},
						// called when the request finishes (after success and error callbacks are executed)
						complete: function ( jqXHR, textStatus ) {

						}
					}
				);
			}
		}
	);

	$container_box.on(
		'change',
		'#br-clean-all',
		function ( e ) {
			var is_selected = $( this ).is( ':checked' );
			var the_action_button = $( '#br-clean-all-cta' );

			if ( true === is_selected ) {
				the_action_button.removeAttr( 'disabled' );
				selected_services = [];
				$( '.br-db-item' ).each( function ( index, element ) {
					// element == this
					var this_section_id = this.dataset.section;
					if ( $( element ).hasClass( 'br-db-selected' ) ) {
					} else {
						$( element ).addClass( 'br-db-selected' );
					}
					selected_services.push( this_section_id );
				} );
			} else {
				the_action_button.attr( 'disabled', 'disabled' );
				selected_services = [];
				$( '.br-db-item' ).each( function ( index, element ) {
					// element == this
					$( element ).removeClass( 'br-db-selected' )
					selected_services = [];
				} );
			}
		}
	);

	$container_box.on(
		'click',
		'#br-clean-all-cta',
		function ( e ) {
			var is_disabled = $( this ).is( ':disabled' );

			if ( false === is_disabled ) {
				var ask_clean_start = confirm( 'Proceed to clean all trashed posts and pages?' );

				if ( ask_clean_start ) {
					$(
						'<div/>',
						{
							'id': 'breeze_loader_function'
						}
					).appendTo( 'body' );

					$(
						'<div/>',
						{
							'id': 'breeze_info'
						}
					).appendTo( 'body' );

					breeze_do_db_actions( selected_services, 0 );
					// $.ajax(
					// 	{
					// 		type: "POST",
					// 		url: ajaxurl,
					// 		data: {
					// 			action: "breeze_purge_database",
					// 			'action_type': 'all',
					// 			'security': breeze_token_name.breeze_purge_database,
					// 			'is-network': $( 'body' ).hasClass( 'network-admin' )
					// 		},
					// 		dataType: "JSON", // xml, html, script, json, jsonp, text
					// 		success: function ( data ) {
					//
					// 			$( '.br-clean-label' ).find( 'span' ).removeClass( 'br-has' ).html( '( 0 )' );
					//
					// 			$( 'div.br-db-item' ).each(
					// 				function ( index, element ) {
					// 					// element == this
					// 					$( element ).find( 'h3' ).find( 'span' ).removeClass( 'br-has' ).html( '0' );
					// 				}
					// 			);
					// 			var enable_clean_all = $( '#br-clean-all' );
					// 			if ( enable_clean_all.is( ':checked' ) ) {
					// 				enable_clean_all.trigger( 'click' );
					// 			}
					// 			alert( 'Clean all process finished' );
					//
					// 		},
					// 		error: function ( jqXHR, textStatus, errorThrown ) {
					//
					// 		},
					// 		// called when the request finishes (after success and error callbacks are executed)
					// 		complete: function ( jqXHR, textStatus ) {
					//
					// 		}
					// 	}
					// );
				}
			}
		}
	);

	$container_box.on(
		'click',
		'.br-mobile-menu',
		function () {
			$( '.br-link' ).fadeToggle();
		}
	);

	$container_box.on(
		'click',
		'.br-submit-save',
		function ( e ) {
			e.preventDefault();

			var $form = $( this ).closest( 'form' );
			var tab_is = $form.get( 0 ).dataset.section;

			var data_send = {
				'action': 'save_settings_tab_' + tab_is,
				'security': breeze_token_name.breeze_save_options,
				'form-data': $form.serialize(),
				'is-network': $( 'body' ).hasClass( 'network-admin' )
			};
			var $html_area = $( '.br-options' );
			$html_area.html( loader_spinner_save );
			$.ajax(
				{
					type: "POST",
					url: ajaxurl,
					data: data_send,
					dataType: "JSON", // xml, html, script, json, jsonp, text
					success: function ( data ) {
						$( '#tab-' + tab_is ).trigger( 'click' );
					},
					error: function ( jqXHR, textStatus, errorThrown ) {

					},
					// called when the request finishes (after success and error callbacks are executed)
					complete: function ( jqXHR, textStatus ) {

					}
				}
			);
		}
	);

	$container_box.on(
		'click',
		'#refresh-api-token',
		function ( e ) {
			e.preventDefault();

			var data_send = {
				'action': 'refresh_api_token_key',
				'security': breeze_token_name.breeze_save_options,
				'is-network': $( 'body' ).hasClass( 'network-admin' )
			};

			$.ajax(
				{
					type: "POST",
					url: ajaxurl,
					data: data_send,
					dataType: "JSON", // xml, html, script, json, jsonp, text
					success: function ( data ) {
						if ( typeof data.new_token !== 'undefined' ) {
							$( '#breeze-api-token' ).val( data.new_token );
						}
					},
					error: function ( jqXHR, textStatus, errorThrown ) {

					},
					// called when the request finishes (after success and error callbacks are executed)
					complete: function ( jqXHR, textStatus ) {

					}
				}
			);
		}
	);

	$( document ).on(
		'change',
		'input:radio[name="inherit-settings"]',
		function () {
			var is_selected = $( 'input:radio[name="inherit-settings"]:checked' ).val();
			var is_network = '.br-is-network';
			var is_custom = '.br-is-custom';
			var tab_is = 'inherit';

			var nonce_is = $( this ).closest( 'div.change-settings-use' ).find( 'input#breeze_inherit_settings_nonce' ).val();

			$( '.br-overlay-disable' ).addClass( 'br-hide' );

			var data_send = {
				'action': 'save_settings_tab_' + tab_is,
				'is-selected': is_selected,
				'security': nonce_is,
				'is-network': $( 'body' ).hasClass( 'network-admin' )
			};

			$(
				'<div/>',
				{
					'class': 'br-inherit-wait',
					'html': '<div class="br-loader-spinner switch-to-settings"><div></div><div></div><div></div><div></div></div>'
				}
			).appendTo( $( '#wpcontent' ) );

			$.ajax(
				{
					type: "POST",
					url: ajaxurl,
					data: data_send,
					dataType: "JSON", // xml, html, script, json, jsonp, text
					success: function ( data ) {
						// var default_target = $( '#tab-basic' );
						// if ( default_target.length ) {
						// 	default_target.trigger( 'click' );
						// }
					},
					error: function ( jqXHR, textStatus, errorThrown ) {

					},
					// called when the request finishes (after success and error callbacks are executed)
					complete: function ( jqXHR, textStatus ) {
						$( '#wpcontent' ).find( 'div.br-inherit-wait' ).remove();

						if ( '0' === is_selected || true === is_selected ) {
							// custom is enabled
							$( is_network ).removeClass( 'br-show' ).addClass( 'br-hide' );
							$( is_custom ).removeClass( 'br-hide' ).addClass( 'br-show' );
							$( '.br-link' ).removeClass( 'br-hide' );
							$( '#tab-basic' ).trigger( 'click' );
						} else {
							// network is enabled
							$( is_custom ).removeClass( 'br-show' ).addClass( 'br-hide' );
							$( is_network ).removeClass( 'br-hide' ).addClass( 'br-show' );
							$( '.br-link' ).each(
								function ( index, element ) {
									// element == this
									var data_is = element.dataset.breezeLink;
									if ( 'faq' !== data_is ) {
										$( element ).addClass( 'br-hide' );
									}
								}
							);
							$( '#tab-faq' ).trigger( 'click' );
						}
					}
				}
			);
		}
	);

	$( document ).on(
		'click',
		'.notice-dismiss',
		function () {
			var parent = $( this ).closest( 'div.notice' );
			if ( parent.hasClass( 'breeze-notice' ) ) {
				parent.fadeOut( 'fast' ).remove();
			}
		}
	);
} )( jQuery );

Youez - 2016 - github.com/yon3zu
LinuXploit