diff --git a/vendor/autoload.php b/vendor/autoload.php
new file mode 100644
index 0000000..9703d3c
--- /dev/null
+++ b/vendor/autoload.php
@@ -0,0 +1,7 @@
+<?php
+
+// autoload.php @generated by Composer
+
+require_once __DIR__ . '/composer/autoload_real.php';
+
+return ComposerAutoloaderInit13163adc30f7dea8ccb9868cafbfd377::getLoader();
diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php
new file mode 100644
index 0000000..fce8549
--- /dev/null
+++ b/vendor/composer/ClassLoader.php
@@ -0,0 +1,445 @@
+<?php
+
+/*
+ * This file is part of Composer.
+ *
+ * (c) Nils Adermann <naderman@naderman.de>
+ *     Jordi Boggiano <j.boggiano@seld.be>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer\Autoload;
+
+/**
+ * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
+ *
+ *     $loader = new \Composer\Autoload\ClassLoader();
+ *
+ *     // register classes with namespaces
+ *     $loader->add('Symfony\Component', __DIR__.'/component');
+ *     $loader->add('Symfony',           __DIR__.'/framework');
+ *
+ *     // activate the autoloader
+ *     $loader->register();
+ *
+ *     // to enable searching the include path (eg. for PEAR packages)
+ *     $loader->setUseIncludePath(true);
+ *
+ * In this example, if you try to use a class in the Symfony\Component
+ * namespace or one of its children (Symfony\Component\Console for instance),
+ * the autoloader will first look for the class under the component/
+ * directory, and it will then fallback to the framework/ directory if not
+ * found before giving up.
+ *
+ * This class is loosely based on the Symfony UniversalClassLoader.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ * @author Jordi Boggiano <j.boggiano@seld.be>
+ * @see    http://www.php-fig.org/psr/psr-0/
+ * @see    http://www.php-fig.org/psr/psr-4/
+ */
+class ClassLoader
+{
+    // PSR-4
+    private $prefixLengthsPsr4 = array();
+    private $prefixDirsPsr4 = array();
+    private $fallbackDirsPsr4 = array();
+
+    // PSR-0
+    private $prefixesPsr0 = array();
+    private $fallbackDirsPsr0 = array();
+
+    private $useIncludePath = false;
+    private $classMap = array();
+    private $classMapAuthoritative = false;
+    private $missingClasses = array();
+    private $apcuPrefix;
+
+    public function getPrefixes()
+    {
+        if (!empty($this->prefixesPsr0)) {
+            return call_user_func_array('array_merge', $this->prefixesPsr0);
+        }
+
+        return array();
+    }
+
+    public function getPrefixesPsr4()
+    {
+        return $this->prefixDirsPsr4;
+    }
+
+    public function getFallbackDirs()
+    {
+        return $this->fallbackDirsPsr0;
+    }
+
+    public function getFallbackDirsPsr4()
+    {
+        return $this->fallbackDirsPsr4;
+    }
+
+    public function getClassMap()
+    {
+        return $this->classMap;
+    }
+
+    /**
+     * @param array $classMap Class to filename map
+     */
+    public function addClassMap(array $classMap)
+    {
+        if ($this->classMap) {
+            $this->classMap = array_merge($this->classMap, $classMap);
+        } else {
+            $this->classMap = $classMap;
+        }
+    }
+
+    /**
+     * Registers a set of PSR-0 directories for a given prefix, either
+     * appending or prepending to the ones previously set for this prefix.
+     *
+     * @param string       $prefix  The prefix
+     * @param array|string $paths   The PSR-0 root directories
+     * @param bool         $prepend Whether to prepend the directories
+     */
+    public function add($prefix, $paths, $prepend = false)
+    {
+        if (!$prefix) {
+            if ($prepend) {
+                $this->fallbackDirsPsr0 = array_merge(
+                    (array) $paths,
+                    $this->fallbackDirsPsr0
+                );
+            } else {
+                $this->fallbackDirsPsr0 = array_merge(
+                    $this->fallbackDirsPsr0,
+                    (array) $paths
+                );
+            }
+
+            return;
+        }
+
+        $first = $prefix[0];
+        if (!isset($this->prefixesPsr0[$first][$prefix])) {
+            $this->prefixesPsr0[$first][$prefix] = (array) $paths;
+
+            return;
+        }
+        if ($prepend) {
+            $this->prefixesPsr0[$first][$prefix] = array_merge(
+                (array) $paths,
+                $this->prefixesPsr0[$first][$prefix]
+            );
+        } else {
+            $this->prefixesPsr0[$first][$prefix] = array_merge(
+                $this->prefixesPsr0[$first][$prefix],
+                (array) $paths
+            );
+        }
+    }
+
+    /**
+     * Registers a set of PSR-4 directories for a given namespace, either
+     * appending or prepending to the ones previously set for this namespace.
+     *
+     * @param string       $prefix  The prefix/namespace, with trailing '\\'
+     * @param array|string $paths   The PSR-4 base directories
+     * @param bool         $prepend Whether to prepend the directories
+     *
+     * @throws \InvalidArgumentException
+     */
+    public function addPsr4($prefix, $paths, $prepend = false)
+    {
+        if (!$prefix) {
+            // Register directories for the root namespace.
+            if ($prepend) {
+                $this->fallbackDirsPsr4 = array_merge(
+                    (array) $paths,
+                    $this->fallbackDirsPsr4
+                );
+            } else {
+                $this->fallbackDirsPsr4 = array_merge(
+                    $this->fallbackDirsPsr4,
+                    (array) $paths
+                );
+            }
+        } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
+            // Register directories for a new namespace.
+            $length = strlen($prefix);
+            if ('\\' !== $prefix[$length - 1]) {
+                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+            }
+            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+            $this->prefixDirsPsr4[$prefix] = (array) $paths;
+        } elseif ($prepend) {
+            // Prepend directories for an already registered namespace.
+            $this->prefixDirsPsr4[$prefix] = array_merge(
+                (array) $paths,
+                $this->prefixDirsPsr4[$prefix]
+            );
+        } else {
+            // Append directories for an already registered namespace.
+            $this->prefixDirsPsr4[$prefix] = array_merge(
+                $this->prefixDirsPsr4[$prefix],
+                (array) $paths
+            );
+        }
+    }
+
+    /**
+     * Registers a set of PSR-0 directories for a given prefix,
+     * replacing any others previously set for this prefix.
+     *
+     * @param string       $prefix The prefix
+     * @param array|string $paths  The PSR-0 base directories
+     */
+    public function set($prefix, $paths)
+    {
+        if (!$prefix) {
+            $this->fallbackDirsPsr0 = (array) $paths;
+        } else {
+            $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
+        }
+    }
+
+    /**
+     * Registers a set of PSR-4 directories for a given namespace,
+     * replacing any others previously set for this namespace.
+     *
+     * @param string       $prefix The prefix/namespace, with trailing '\\'
+     * @param array|string $paths  The PSR-4 base directories
+     *
+     * @throws \InvalidArgumentException
+     */
+    public function setPsr4($prefix, $paths)
+    {
+        if (!$prefix) {
+            $this->fallbackDirsPsr4 = (array) $paths;
+        } else {
+            $length = strlen($prefix);
+            if ('\\' !== $prefix[$length - 1]) {
+                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+            }
+            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+            $this->prefixDirsPsr4[$prefix] = (array) $paths;
+        }
+    }
+
+    /**
+     * Turns on searching the include path for class files.
+     *
+     * @param bool $useIncludePath
+     */
+    public function setUseIncludePath($useIncludePath)
+    {
+        $this->useIncludePath = $useIncludePath;
+    }
+
+    /**
+     * Can be used to check if the autoloader uses the include path to check
+     * for classes.
+     *
+     * @return bool
+     */
+    public function getUseIncludePath()
+    {
+        return $this->useIncludePath;
+    }
+
+    /**
+     * Turns off searching the prefix and fallback directories for classes
+     * that have not been registered with the class map.
+     *
+     * @param bool $classMapAuthoritative
+     */
+    public function setClassMapAuthoritative($classMapAuthoritative)
+    {
+        $this->classMapAuthoritative = $classMapAuthoritative;
+    }
+
+    /**
+     * Should class lookup fail if not found in the current class map?
+     *
+     * @return bool
+     */
+    public function isClassMapAuthoritative()
+    {
+        return $this->classMapAuthoritative;
+    }
+
+    /**
+     * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
+     *
+     * @param string|null $apcuPrefix
+     */
+    public function setApcuPrefix($apcuPrefix)
+    {
+        $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
+    }
+
+    /**
+     * The APCu prefix in use, or null if APCu caching is not enabled.
+     *
+     * @return string|null
+     */
+    public function getApcuPrefix()
+    {
+        return $this->apcuPrefix;
+    }
+
+    /**
+     * Registers this instance as an autoloader.
+     *
+     * @param bool $prepend Whether to prepend the autoloader or not
+     */
+    public function register($prepend = false)
+    {
+        spl_autoload_register(array($this, 'loadClass'), true, $prepend);
+    }
+
+    /**
+     * Unregisters this instance as an autoloader.
+     */
+    public function unregister()
+    {
+        spl_autoload_unregister(array($this, 'loadClass'));
+    }
+
+    /**
+     * Loads the given class or interface.
+     *
+     * @param  string    $class The name of the class
+     * @return bool|null True if loaded, null otherwise
+     */
+    public function loadClass($class)
+    {
+        if ($file = $this->findFile($class)) {
+            includeFile($file);
+
+            return true;
+        }
+    }
+
+    /**
+     * Finds the path to the file where the class is defined.
+     *
+     * @param string $class The name of the class
+     *
+     * @return string|false The path if found, false otherwise
+     */
+    public function findFile($class)
+    {
+        // class map lookup
+        if (isset($this->classMap[$class])) {
+            return $this->classMap[$class];
+        }
+        if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
+            return false;
+        }
+        if (null !== $this->apcuPrefix) {
+            $file = apcu_fetch($this->apcuPrefix.$class, $hit);
+            if ($hit) {
+                return $file;
+            }
+        }
+
+        $file = $this->findFileWithExtension($class, '.php');
+
+        // Search for Hack files if we are running on HHVM
+        if (false === $file && defined('HHVM_VERSION')) {
+            $file = $this->findFileWithExtension($class, '.hh');
+        }
+
+        if (null !== $this->apcuPrefix) {
+            apcu_add($this->apcuPrefix.$class, $file);
+        }
+
+        if (false === $file) {
+            // Remember that this class does not exist.
+            $this->missingClasses[$class] = true;
+        }
+
+        return $file;
+    }
+
+    private function findFileWithExtension($class, $ext)
+    {
+        // PSR-4 lookup
+        $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
+
+        $first = $class[0];
+        if (isset($this->prefixLengthsPsr4[$first])) {
+            $subPath = $class;
+            while (false !== $lastPos = strrpos($subPath, '\\')) {
+                $subPath = substr($subPath, 0, $lastPos);
+                $search = $subPath . '\\';
+                if (isset($this->prefixDirsPsr4[$search])) {
+                    $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
+                    foreach ($this->prefixDirsPsr4[$search] as $dir) {
+                        if (file_exists($file = $dir . $pathEnd)) {
+                            return $file;
+                        }
+                    }
+                }
+            }
+        }
+
+        // PSR-4 fallback dirs
+        foreach ($this->fallbackDirsPsr4 as $dir) {
+            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
+                return $file;
+            }
+        }
+
+        // PSR-0 lookup
+        if (false !== $pos = strrpos($class, '\\')) {
+            // namespaced class name
+            $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
+                . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
+        } else {
+            // PEAR-like class name
+            $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
+        }
+
+        if (isset($this->prefixesPsr0[$first])) {
+            foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
+                if (0 === strpos($class, $prefix)) {
+                    foreach ($dirs as $dir) {
+                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+                            return $file;
+                        }
+                    }
+                }
+            }
+        }
+
+        // PSR-0 fallback dirs
+        foreach ($this->fallbackDirsPsr0 as $dir) {
+            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+                return $file;
+            }
+        }
+
+        // PSR-0 include paths.
+        if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
+            return $file;
+        }
+
+        return false;
+    }
+}
+
+/**
+ * Scope isolated include.
+ *
+ * Prevents access to $this/self from included files.
+ */
+function includeFile($file)
+{
+    include $file;
+}
diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE
new file mode 100644
index 0000000..f27399a
--- /dev/null
+++ b/vendor/composer/LICENSE
@@ -0,0 +1,21 @@
+
+Copyright (c) Nils Adermann, Jordi Boggiano
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php
new file mode 100644
index 0000000..7a91153
--- /dev/null
+++ b/vendor/composer/autoload_classmap.php
@@ -0,0 +1,9 @@
+<?php
+
+// autoload_classmap.php @generated by Composer
+
+$vendorDir = dirname(dirname(__FILE__));
+$baseDir = dirname($vendorDir);
+
+return array(
+);
diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php
new file mode 100644
index 0000000..b7fc012
--- /dev/null
+++ b/vendor/composer/autoload_namespaces.php
@@ -0,0 +1,9 @@
+<?php
+
+// autoload_namespaces.php @generated by Composer
+
+$vendorDir = dirname(dirname(__FILE__));
+$baseDir = dirname($vendorDir);
+
+return array(
+);
diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php
new file mode 100644
index 0000000..fdc285b
--- /dev/null
+++ b/vendor/composer/autoload_psr4.php
@@ -0,0 +1,11 @@
+<?php
+
+// autoload_psr4.php @generated by Composer
+
+$vendorDir = dirname(dirname(__FILE__));
+$baseDir = dirname($vendorDir);
+
+return array(
+    'Google\\Protobuf\\' => array($vendorDir . '/google/protobuf/src/Google/Protobuf'),
+    'GPBMetadata\\Google\\Protobuf\\' => array($vendorDir . '/google/protobuf/src/GPBMetadata/Google/Protobuf'),
+);
diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php
new file mode 100644
index 0000000..29aac13
--- /dev/null
+++ b/vendor/composer/autoload_real.php
@@ -0,0 +1,52 @@
+<?php
+
+// autoload_real.php @generated by Composer
+
+class ComposerAutoloaderInit13163adc30f7dea8ccb9868cafbfd377
+{
+    private static $loader;
+
+    public static function loadClassLoader($class)
+    {
+        if ('Composer\Autoload\ClassLoader' === $class) {
+            require __DIR__ . '/ClassLoader.php';
+        }
+    }
+
+    public static function getLoader()
+    {
+        if (null !== self::$loader) {
+            return self::$loader;
+        }
+
+        spl_autoload_register(array('ComposerAutoloaderInit13163adc30f7dea8ccb9868cafbfd377', 'loadClassLoader'), true, true);
+        self::$loader = $loader = new \Composer\Autoload\ClassLoader();
+        spl_autoload_unregister(array('ComposerAutoloaderInit13163adc30f7dea8ccb9868cafbfd377', 'loadClassLoader'));
+
+        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
+        if ($useStaticLoader) {
+            require_once __DIR__ . '/autoload_static.php';
+
+            call_user_func(\Composer\Autoload\ComposerStaticInit13163adc30f7dea8ccb9868cafbfd377::getInitializer($loader));
+        } else {
+            $map = require __DIR__ . '/autoload_namespaces.php';
+            foreach ($map as $namespace => $path) {
+                $loader->set($namespace, $path);
+            }
+
+            $map = require __DIR__ . '/autoload_psr4.php';
+            foreach ($map as $namespace => $path) {
+                $loader->setPsr4($namespace, $path);
+            }
+
+            $classMap = require __DIR__ . '/autoload_classmap.php';
+            if ($classMap) {
+                $loader->addClassMap($classMap);
+            }
+        }
+
+        $loader->register(true);
+
+        return $loader;
+    }
+}
diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php
new file mode 100644
index 0000000..3d50f6c
--- /dev/null
+++ b/vendor/composer/autoload_static.php
@@ -0,0 +1,36 @@
+<?php
+
+// autoload_static.php @generated by Composer
+
+namespace Composer\Autoload;
+
+class ComposerStaticInit13163adc30f7dea8ccb9868cafbfd377
+{
+    public static $prefixLengthsPsr4 = array (
+        'G' => 
+        array (
+            'Google\\Protobuf\\' => 16,
+            'GPBMetadata\\Google\\Protobuf\\' => 28,
+        ),
+    );
+
+    public static $prefixDirsPsr4 = array (
+        'Google\\Protobuf\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/google/protobuf/src/Google/Protobuf',
+        ),
+        'GPBMetadata\\Google\\Protobuf\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/google/protobuf/src/GPBMetadata/Google/Protobuf',
+        ),
+    );
+
+    public static function getInitializer(ClassLoader $loader)
+    {
+        return \Closure::bind(function () use ($loader) {
+            $loader->prefixLengthsPsr4 = ComposerStaticInit13163adc30f7dea8ccb9868cafbfd377::$prefixLengthsPsr4;
+            $loader->prefixDirsPsr4 = ComposerStaticInit13163adc30f7dea8ccb9868cafbfd377::$prefixDirsPsr4;
+
+        }, null, ClassLoader::class);
+    }
+}
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
new file mode 100644
index 0000000..0ea222a
--- /dev/null
+++ b/vendor/composer/installed.json
@@ -0,0 +1,45 @@
+[
+    {
+        "name": "google/protobuf",
+        "version": "v3.11.2",
+        "version_normalized": "3.11.2.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/protocolbuffers/protobuf-php.git",
+            "reference": "0864882396746542ead01fc002e1644b9490dbe8"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/0864882396746542ead01fc002e1644b9490dbe8",
+            "reference": "0864882396746542ead01fc002e1644b9490dbe8",
+            "shasum": ""
+        },
+        "require": {
+            "php": ">=5.5.0"
+        },
+        "require-dev": {
+            "phpunit/phpunit": ">=4.8.0"
+        },
+        "suggest": {
+            "ext-bcmath": "Need to support JSON deserialization"
+        },
+        "time": "2019-12-14T00:45:36+00:00",
+        "type": "library",
+        "installation-source": "dist",
+        "autoload": {
+            "psr-4": {
+                "Google\\Protobuf\\": "src/Google/Protobuf",
+                "GPBMetadata\\Google\\Protobuf\\": "src/GPBMetadata/Google/Protobuf"
+            }
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "BSD-3-Clause"
+        ],
+        "description": "proto library for PHP",
+        "homepage": "https://developers.google.com/protocol-buffers/",
+        "keywords": [
+            "proto"
+        ]
+    }
+]
diff --git a/vendor/google/protobuf/LICENSE b/vendor/google/protobuf/LICENSE
new file mode 100644
index 0000000..ba32af4
--- /dev/null
+++ b/vendor/google/protobuf/LICENSE
@@ -0,0 +1,29 @@
+BSD 3-Clause License
+
+Copyright (c) 2019, Protocol Buffers
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+  list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+
+* Neither the name of the copyright holder nor the names of its
+  contributors may be used to endorse or promote products derived from
+  this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/google/protobuf/README.md b/vendor/google/protobuf/README.md
new file mode 100644
index 0000000..3663050
--- /dev/null
+++ b/vendor/google/protobuf/README.md
@@ -0,0 +1,2 @@
+# protobuf-php
+This repository contains only PHP files to support Composer installation. This repository is a mirror of [protobuf](https://github.com/protocolbuffers/protobuf). Any support requests, bug reports, or development contributions should be directed to that project. To install protobuf for PHP, please see https://github.com/protocolbuffers/protobuf/tree/master/php
diff --git a/vendor/google/protobuf/composer.json b/vendor/google/protobuf/composer.json
new file mode 100644
index 0000000..69a3297
--- /dev/null
+++ b/vendor/google/protobuf/composer.json
@@ -0,0 +1,23 @@
+{
+  "name": "google/protobuf",
+  "type": "library",
+  "description": "proto library for PHP",
+  "keywords": ["proto"],
+  "homepage": "https://developers.google.com/protocol-buffers/",
+  "license": "BSD-3-Clause",
+  "require": {
+    "php": ">=5.5.0"
+  },
+  "require-dev": {
+    "phpunit/phpunit": ">=4.8.0"
+  },
+  "suggest": {
+    "ext-bcmath": "Need to support JSON deserialization"
+  },
+  "autoload": {
+    "psr-4": {
+      "Google\\Protobuf\\": "src/Google/Protobuf",
+      "GPBMetadata\\Google\\Protobuf\\": "src/GPBMetadata/Google/Protobuf"
+    }
+  }
+}
diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Any.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Any.php
new file mode 100644
index 0000000..22cc250
--- /dev/null
+++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Any.php
@@ -0,0 +1,30 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/any.proto
+
+namespace GPBMetadata\Google\Protobuf;
+
+class Any
+{
+    public static $is_initialized = false;
+
+    public static function initOnce() {
+        $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
+
+        if (static::$is_initialized == true) {
+          return;
+        }
+        $pool->internalAddGeneratedFile(hex2bin(
+            "0acd010a19676f6f676c652f70726f746f6275662f616e792e70726f746f" .
+            "120f676f6f676c652e70726f746f62756622260a03416e7912100a087479" .
+            "70655f75726c180120012809120d0a0576616c756518022001280c426f0a" .
+            "13636f6d2e676f6f676c652e70726f746f6275664208416e7950726f746f" .
+            "50015a256769746875622e636f6d2f676f6c616e672f70726f746f627566" .
+            "2f7074797065732f616e79a20203475042aa021e476f6f676c652e50726f" .
+            "746f6275662e57656c6c4b6e6f776e5479706573620670726f746f33"
+        ));
+
+        static::$is_initialized = true;
+    }
+}
+
diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Api.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Api.php
new file mode 100644
index 0000000..b18e0d3
--- /dev/null
+++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Api.php
@@ -0,0 +1,49 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/api.proto
+
+namespace GPBMetadata\Google\Protobuf;
+
+class Api
+{
+    public static $is_initialized = false;
+
+    public static function initOnce() {
+        $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
+
+        if (static::$is_initialized == true) {
+          return;
+        }
+        \GPBMetadata\Google\Protobuf\SourceContext::initOnce();
+        \GPBMetadata\Google\Protobuf\Type::initOnce();
+        $pool->internalAddGeneratedFile(hex2bin(
+            "0ac8050a19676f6f676c652f70726f746f6275662f6170692e70726f746f" .
+            "120f676f6f676c652e70726f746f6275661a1a676f6f676c652f70726f74" .
+            "6f6275662f747970652e70726f746f2281020a03417069120c0a046e616d" .
+            "6518012001280912280a076d6574686f647318022003280b32172e676f6f" .
+            "676c652e70726f746f6275662e4d6574686f6412280a076f7074696f6e73" .
+            "18032003280b32172e676f6f676c652e70726f746f6275662e4f7074696f" .
+            "6e120f0a0776657273696f6e18042001280912360a0e736f757263655f63" .
+            "6f6e7465787418052001280b321e2e676f6f676c652e70726f746f627566" .
+            "2e536f75726365436f6e7465787412260a066d6978696e7318062003280b" .
+            "32162e676f6f676c652e70726f746f6275662e4d6978696e12270a067379" .
+            "6e74617818072001280e32172e676f6f676c652e70726f746f6275662e53" .
+            "796e74617822d5010a064d6574686f64120c0a046e616d65180120012809" .
+            "12180a10726571756573745f747970655f75726c18022001280912190a11" .
+            "726571756573745f73747265616d696e6718032001280812190a11726573" .
+            "706f6e73655f747970655f75726c180420012809121a0a12726573706f6e" .
+            "73655f73747265616d696e6718052001280812280a076f7074696f6e7318" .
+            "062003280b32172e676f6f676c652e70726f746f6275662e4f7074696f6e" .
+            "12270a0673796e74617818072001280e32172e676f6f676c652e70726f74" .
+            "6f6275662e53796e74617822230a054d6978696e120c0a046e616d651801" .
+            "20012809120c0a04726f6f7418022001280942750a13636f6d2e676f6f67" .
+            "6c652e70726f746f627566420841706950726f746f50015a2b676f6f676c" .
+            "652e676f6c616e672e6f72672f67656e70726f746f2f70726f746f627566" .
+            "2f6170693b617069a20203475042aa021e476f6f676c652e50726f746f62" .
+            "75662e57656c6c4b6e6f776e5479706573620670726f746f33"
+        ));
+
+        static::$is_initialized = true;
+    }
+}
+
diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Duration.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Duration.php
new file mode 100644
index 0000000..b1c85ad
--- /dev/null
+++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Duration.php
@@ -0,0 +1,31 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/duration.proto
+
+namespace GPBMetadata\Google\Protobuf;
+
+class Duration
+{
+    public static $is_initialized = false;
+
+    public static function initOnce() {
+        $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
+
+        if (static::$is_initialized == true) {
+          return;
+        }
+        $pool->internalAddGeneratedFile(hex2bin(
+            "0ae3010a1e676f6f676c652f70726f746f6275662f6475726174696f6e2e" .
+            "70726f746f120f676f6f676c652e70726f746f627566222a0a0844757261" .
+            "74696f6e120f0a077365636f6e6473180120012803120d0a056e616e6f73" .
+            "180220012805427c0a13636f6d2e676f6f676c652e70726f746f62756642" .
+            "0d4475726174696f6e50726f746f50015a2a6769746875622e636f6d2f67" .
+            "6f6c616e672f70726f746f6275662f7074797065732f6475726174696f6e" .
+            "f80101a20203475042aa021e476f6f676c652e50726f746f6275662e5765" .
+            "6c6c4b6e6f776e5479706573620670726f746f33"
+        ));
+
+        static::$is_initialized = true;
+    }
+}
+
diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/FieldMask.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/FieldMask.php
new file mode 100644
index 0000000..5812be1
--- /dev/null
+++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/FieldMask.php
@@ -0,0 +1,31 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/field_mask.proto
+
+namespace GPBMetadata\Google\Protobuf;
+
+class FieldMask
+{
+    public static $is_initialized = false;
+
+    public static function initOnce() {
+        $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
+
+        if (static::$is_initialized == true) {
+          return;
+        }
+        $pool->internalAddGeneratedFile(hex2bin(
+            "0ae3010a20676f6f676c652f70726f746f6275662f6669656c645f6d6173" .
+            "6b2e70726f746f120f676f6f676c652e70726f746f627566221a0a094669" .
+            "656c644d61736b120d0a0570617468731801200328094289010a13636f6d" .
+            "2e676f6f676c652e70726f746f627566420e4669656c644d61736b50726f" .
+            "746f50015a39676f6f676c652e676f6c616e672e6f72672f67656e70726f" .
+            "746f2f70726f746f6275662f6669656c645f6d61736b3b6669656c645f6d" .
+            "61736ba20203475042aa021e476f6f676c652e50726f746f6275662e5765" .
+            "6c6c4b6e6f776e5479706573620670726f746f33"
+        ));
+
+        static::$is_initialized = true;
+    }
+}
+
diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/GPBEmpty.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/GPBEmpty.php
new file mode 100644
index 0000000..88f42a1
--- /dev/null
+++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/GPBEmpty.php
@@ -0,0 +1,30 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/empty.proto
+
+namespace GPBMetadata\Google\Protobuf;
+
+class GPBEmpty
+{
+    public static $is_initialized = false;
+
+    public static function initOnce() {
+        $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
+
+        if (static::$is_initialized == true) {
+          return;
+        }
+        $pool->internalAddGeneratedFile(hex2bin(
+            "0ab7010a1b676f6f676c652f70726f746f6275662f656d7074792e70726f" .
+            "746f120f676f6f676c652e70726f746f62756622070a05456d7074794276" .
+            "0a13636f6d2e676f6f676c652e70726f746f627566420a456d7074795072" .
+            "6f746f50015a276769746875622e636f6d2f676f6c616e672f70726f746f" .
+            "6275662f7074797065732f656d707479f80101a20203475042aa021e476f" .
+            "6f676c652e50726f746f6275662e57656c6c4b6e6f776e54797065736206" .
+            "70726f746f33"
+        ));
+
+        static::$is_initialized = true;
+    }
+}
+
diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php
new file mode 100644
index 0000000..e6362f2
--- /dev/null
+++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php
@@ -0,0 +1,277 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace GPBMetadata\Google\Protobuf\Internal;
+
+class Descriptor
+{
+    public static $is_initialized = false;
+
+    public static function initOnce() {
+        $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
+
+        if (static::$is_initialized == true) {
+          return;
+        }
+        $pool->addMessage('google.protobuf.internal.FileDescriptorSet', \Google\Protobuf\Internal\FileDescriptorSet::class)
+            ->repeated('file', \Google\Protobuf\Internal\GPBType::MESSAGE, 1, 'google.protobuf.internal.FileDescriptorProto')
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.FileDescriptorProto', \Google\Protobuf\Internal\FileDescriptorProto::class)
+            ->optional('name', \Google\Protobuf\Internal\GPBType::STRING, 1)
+            ->optional('package', \Google\Protobuf\Internal\GPBType::STRING, 2)
+            ->repeated('dependency', \Google\Protobuf\Internal\GPBType::STRING, 3)
+            ->repeated('public_dependency', \Google\Protobuf\Internal\GPBType::INT32, 10)
+            ->repeated('weak_dependency', \Google\Protobuf\Internal\GPBType::INT32, 11)
+            ->repeated('message_type', \Google\Protobuf\Internal\GPBType::MESSAGE, 4, 'google.protobuf.internal.DescriptorProto')
+            ->repeated('enum_type', \Google\Protobuf\Internal\GPBType::MESSAGE, 5, 'google.protobuf.internal.EnumDescriptorProto')
+            ->repeated('service', \Google\Protobuf\Internal\GPBType::MESSAGE, 6, 'google.protobuf.internal.ServiceDescriptorProto')
+            ->repeated('extension', \Google\Protobuf\Internal\GPBType::MESSAGE, 7, 'google.protobuf.internal.FieldDescriptorProto')
+            ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 8, 'google.protobuf.internal.FileOptions')
+            ->optional('source_code_info', \Google\Protobuf\Internal\GPBType::MESSAGE, 9, 'google.protobuf.internal.SourceCodeInfo')
+            ->optional('syntax', \Google\Protobuf\Internal\GPBType::STRING, 12)
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.DescriptorProto', \Google\Protobuf\Internal\DescriptorProto::class)
+            ->optional('name', \Google\Protobuf\Internal\GPBType::STRING, 1)
+            ->repeated('field', \Google\Protobuf\Internal\GPBType::MESSAGE, 2, 'google.protobuf.internal.FieldDescriptorProto')
+            ->repeated('extension', \Google\Protobuf\Internal\GPBType::MESSAGE, 6, 'google.protobuf.internal.FieldDescriptorProto')
+            ->repeated('nested_type', \Google\Protobuf\Internal\GPBType::MESSAGE, 3, 'google.protobuf.internal.DescriptorProto')
+            ->repeated('enum_type', \Google\Protobuf\Internal\GPBType::MESSAGE, 4, 'google.protobuf.internal.EnumDescriptorProto')
+            ->repeated('extension_range', \Google\Protobuf\Internal\GPBType::MESSAGE, 5, 'google.protobuf.internal.DescriptorProto.ExtensionRange')
+            ->repeated('oneof_decl', \Google\Protobuf\Internal\GPBType::MESSAGE, 8, 'google.protobuf.internal.OneofDescriptorProto')
+            ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 7, 'google.protobuf.internal.MessageOptions')
+            ->repeated('reserved_range', \Google\Protobuf\Internal\GPBType::MESSAGE, 9, 'google.protobuf.internal.DescriptorProto.ReservedRange')
+            ->repeated('reserved_name', \Google\Protobuf\Internal\GPBType::STRING, 10)
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.DescriptorProto.ExtensionRange', \Google\Protobuf\Internal\DescriptorProto\ExtensionRange::class)
+            ->optional('start', \Google\Protobuf\Internal\GPBType::INT32, 1)
+            ->optional('end', \Google\Protobuf\Internal\GPBType::INT32, 2)
+            ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 3, 'google.protobuf.internal.ExtensionRangeOptions')
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.DescriptorProto.ReservedRange', \Google\Protobuf\Internal\DescriptorProto\ReservedRange::class)
+            ->optional('start', \Google\Protobuf\Internal\GPBType::INT32, 1)
+            ->optional('end', \Google\Protobuf\Internal\GPBType::INT32, 2)
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.ExtensionRangeOptions', \Google\Protobuf\Internal\ExtensionRangeOptions::class)
+            ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption')
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.FieldDescriptorProto', \Google\Protobuf\Internal\FieldDescriptorProto::class)
+            ->optional('name', \Google\Protobuf\Internal\GPBType::STRING, 1)
+            ->optional('number', \Google\Protobuf\Internal\GPBType::INT32, 3)
+            ->optional('label', \Google\Protobuf\Internal\GPBType::ENUM, 4, 'google.protobuf.internal.FieldDescriptorProto.Label')
+            ->optional('type', \Google\Protobuf\Internal\GPBType::ENUM, 5, 'google.protobuf.internal.FieldDescriptorProto.Type')
+            ->optional('type_name', \Google\Protobuf\Internal\GPBType::STRING, 6)
+            ->optional('extendee', \Google\Protobuf\Internal\GPBType::STRING, 2)
+            ->optional('default_value', \Google\Protobuf\Internal\GPBType::STRING, 7)
+            ->optional('oneof_index', \Google\Protobuf\Internal\GPBType::INT32, 9)
+            ->optional('json_name', \Google\Protobuf\Internal\GPBType::STRING, 10)
+            ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 8, 'google.protobuf.internal.FieldOptions')
+            ->finalizeToPool();
+
+        $pool->addEnum('google.protobuf.internal.FieldDescriptorProto.Type', \Google\Protobuf\Internal\Type::class)
+            ->value("TYPE_DOUBLE", 1)
+            ->value("TYPE_FLOAT", 2)
+            ->value("TYPE_INT64", 3)
+            ->value("TYPE_UINT64", 4)
+            ->value("TYPE_INT32", 5)
+            ->value("TYPE_FIXED64", 6)
+            ->value("TYPE_FIXED32", 7)
+            ->value("TYPE_BOOL", 8)
+            ->value("TYPE_STRING", 9)
+            ->value("TYPE_GROUP", 10)
+            ->value("TYPE_MESSAGE", 11)
+            ->value("TYPE_BYTES", 12)
+            ->value("TYPE_UINT32", 13)
+            ->value("TYPE_ENUM", 14)
+            ->value("TYPE_SFIXED32", 15)
+            ->value("TYPE_SFIXED64", 16)
+            ->value("TYPE_SINT32", 17)
+            ->value("TYPE_SINT64", 18)
+            ->finalizeToPool();
+
+        $pool->addEnum('google.protobuf.internal.FieldDescriptorProto.Label', \Google\Protobuf\Internal\Label::class)
+            ->value("LABEL_OPTIONAL", 1)
+            ->value("LABEL_REQUIRED", 2)
+            ->value("LABEL_REPEATED", 3)
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.OneofDescriptorProto', \Google\Protobuf\Internal\OneofDescriptorProto::class)
+            ->optional('name', \Google\Protobuf\Internal\GPBType::STRING, 1)
+            ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 2, 'google.protobuf.internal.OneofOptions')
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.EnumDescriptorProto', \Google\Protobuf\Internal\EnumDescriptorProto::class)
+            ->optional('name', \Google\Protobuf\Internal\GPBType::STRING, 1)
+            ->repeated('value', \Google\Protobuf\Internal\GPBType::MESSAGE, 2, 'google.protobuf.internal.EnumValueDescriptorProto')
+            ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 3, 'google.protobuf.internal.EnumOptions')
+            ->repeated('reserved_range', \Google\Protobuf\Internal\GPBType::MESSAGE, 4, 'google.protobuf.internal.EnumDescriptorProto.EnumReservedRange')
+            ->repeated('reserved_name', \Google\Protobuf\Internal\GPBType::STRING, 5)
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.EnumDescriptorProto.EnumReservedRange', \Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange::class)
+            ->optional('start', \Google\Protobuf\Internal\GPBType::INT32, 1)
+            ->optional('end', \Google\Protobuf\Internal\GPBType::INT32, 2)
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.EnumValueDescriptorProto', \Google\Protobuf\Internal\EnumValueDescriptorProto::class)
+            ->optional('name', \Google\Protobuf\Internal\GPBType::STRING, 1)
+            ->optional('number', \Google\Protobuf\Internal\GPBType::INT32, 2)
+            ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 3, 'google.protobuf.internal.EnumValueOptions')
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.ServiceDescriptorProto', \Google\Protobuf\Internal\ServiceDescriptorProto::class)
+            ->optional('name', \Google\Protobuf\Internal\GPBType::STRING, 1)
+            ->repeated('method', \Google\Protobuf\Internal\GPBType::MESSAGE, 2, 'google.protobuf.internal.MethodDescriptorProto')
+            ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 3, 'google.protobuf.internal.ServiceOptions')
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.MethodDescriptorProto', \Google\Protobuf\Internal\MethodDescriptorProto::class)
+            ->optional('name', \Google\Protobuf\Internal\GPBType::STRING, 1)
+            ->optional('input_type', \Google\Protobuf\Internal\GPBType::STRING, 2)
+            ->optional('output_type', \Google\Protobuf\Internal\GPBType::STRING, 3)
+            ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 4, 'google.protobuf.internal.MethodOptions')
+            ->optional('client_streaming', \Google\Protobuf\Internal\GPBType::BOOL, 5)
+            ->optional('server_streaming', \Google\Protobuf\Internal\GPBType::BOOL, 6)
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.FileOptions', \Google\Protobuf\Internal\FileOptions::class)
+            ->optional('java_package', \Google\Protobuf\Internal\GPBType::STRING, 1)
+            ->optional('java_outer_classname', \Google\Protobuf\Internal\GPBType::STRING, 8)
+            ->optional('java_multiple_files', \Google\Protobuf\Internal\GPBType::BOOL, 10)
+            ->optional('java_generate_equals_and_hash', \Google\Protobuf\Internal\GPBType::BOOL, 20)
+            ->optional('java_string_check_utf8', \Google\Protobuf\Internal\GPBType::BOOL, 27)
+            ->optional('optimize_for', \Google\Protobuf\Internal\GPBType::ENUM, 9, 'google.protobuf.internal.FileOptions.OptimizeMode')
+            ->optional('go_package', \Google\Protobuf\Internal\GPBType::STRING, 11)
+            ->optional('cc_generic_services', \Google\Protobuf\Internal\GPBType::BOOL, 16)
+            ->optional('java_generic_services', \Google\Protobuf\Internal\GPBType::BOOL, 17)
+            ->optional('py_generic_services', \Google\Protobuf\Internal\GPBType::BOOL, 18)
+            ->optional('php_generic_services', \Google\Protobuf\Internal\GPBType::BOOL, 42)
+            ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 23)
+            ->optional('cc_enable_arenas', \Google\Protobuf\Internal\GPBType::BOOL, 31)
+            ->optional('objc_class_prefix', \Google\Protobuf\Internal\GPBType::STRING, 36)
+            ->optional('csharp_namespace', \Google\Protobuf\Internal\GPBType::STRING, 37)
+            ->optional('swift_prefix', \Google\Protobuf\Internal\GPBType::STRING, 39)
+            ->optional('php_class_prefix', \Google\Protobuf\Internal\GPBType::STRING, 40)
+            ->optional('php_namespace', \Google\Protobuf\Internal\GPBType::STRING, 41)
+            ->optional('php_metadata_namespace', \Google\Protobuf\Internal\GPBType::STRING, 44)
+            ->optional('ruby_package', \Google\Protobuf\Internal\GPBType::STRING, 45)
+            ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption')
+            ->finalizeToPool();
+
+        $pool->addEnum('google.protobuf.internal.FileOptions.OptimizeMode', \Google\Protobuf\Internal\OptimizeMode::class)
+            ->value("SPEED", 1)
+            ->value("CODE_SIZE", 2)
+            ->value("LITE_RUNTIME", 3)
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.MessageOptions', \Google\Protobuf\Internal\MessageOptions::class)
+            ->optional('message_set_wire_format', \Google\Protobuf\Internal\GPBType::BOOL, 1)
+            ->optional('no_standard_descriptor_accessor', \Google\Protobuf\Internal\GPBType::BOOL, 2)
+            ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 3)
+            ->optional('map_entry', \Google\Protobuf\Internal\GPBType::BOOL, 7)
+            ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption')
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.FieldOptions', \Google\Protobuf\Internal\FieldOptions::class)
+            ->optional('ctype', \Google\Protobuf\Internal\GPBType::ENUM, 1, 'google.protobuf.internal.FieldOptions.CType')
+            ->optional('packed', \Google\Protobuf\Internal\GPBType::BOOL, 2)
+            ->optional('jstype', \Google\Protobuf\Internal\GPBType::ENUM, 6, 'google.protobuf.internal.FieldOptions.JSType')
+            ->optional('lazy', \Google\Protobuf\Internal\GPBType::BOOL, 5)
+            ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 3)
+            ->optional('weak', \Google\Protobuf\Internal\GPBType::BOOL, 10)
+            ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption')
+            ->finalizeToPool();
+
+        $pool->addEnum('google.protobuf.internal.FieldOptions.CType', \Google\Protobuf\Internal\CType::class)
+            ->value("STRING", 0)
+            ->value("CORD", 1)
+            ->value("STRING_PIECE", 2)
+            ->finalizeToPool();
+
+        $pool->addEnum('google.protobuf.internal.FieldOptions.JSType', \Google\Protobuf\Internal\JSType::class)
+            ->value("JS_NORMAL", 0)
+            ->value("JS_STRING", 1)
+            ->value("JS_NUMBER", 2)
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.OneofOptions', \Google\Protobuf\Internal\OneofOptions::class)
+            ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption')
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.EnumOptions', \Google\Protobuf\Internal\EnumOptions::class)
+            ->optional('allow_alias', \Google\Protobuf\Internal\GPBType::BOOL, 2)
+            ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 3)
+            ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption')
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.EnumValueOptions', \Google\Protobuf\Internal\EnumValueOptions::class)
+            ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 1)
+            ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption')
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.ServiceOptions', \Google\Protobuf\Internal\ServiceOptions::class)
+            ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 33)
+            ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption')
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.MethodOptions', \Google\Protobuf\Internal\MethodOptions::class)
+            ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 33)
+            ->optional('idempotency_level', \Google\Protobuf\Internal\GPBType::ENUM, 34, 'google.protobuf.internal.MethodOptions.IdempotencyLevel')
+            ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption')
+            ->finalizeToPool();
+
+        $pool->addEnum('google.protobuf.internal.MethodOptions.IdempotencyLevel', \Google\Protobuf\Internal\IdempotencyLevel::class)
+            ->value("IDEMPOTENCY_UNKNOWN", 0)
+            ->value("NO_SIDE_EFFECTS", 1)
+            ->value("IDEMPOTENT", 2)
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.UninterpretedOption', \Google\Protobuf\Internal\UninterpretedOption::class)
+            ->repeated('name', \Google\Protobuf\Internal\GPBType::MESSAGE, 2, 'google.protobuf.internal.UninterpretedOption.NamePart')
+            ->optional('identifier_value', \Google\Protobuf\Internal\GPBType::STRING, 3)
+            ->optional('positive_int_value', \Google\Protobuf\Internal\GPBType::UINT64, 4)
+            ->optional('negative_int_value', \Google\Protobuf\Internal\GPBType::INT64, 5)
+            ->optional('double_value', \Google\Protobuf\Internal\GPBType::DOUBLE, 6)
+            ->optional('string_value', \Google\Protobuf\Internal\GPBType::BYTES, 7)
+            ->optional('aggregate_value', \Google\Protobuf\Internal\GPBType::STRING, 8)
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.UninterpretedOption.NamePart', \Google\Protobuf\Internal\UninterpretedOption\NamePart::class)
+            ->required('name_part', \Google\Protobuf\Internal\GPBType::STRING, 1)
+            ->required('is_extension', \Google\Protobuf\Internal\GPBType::BOOL, 2)
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.SourceCodeInfo', \Google\Protobuf\Internal\SourceCodeInfo::class)
+            ->repeated('location', \Google\Protobuf\Internal\GPBType::MESSAGE, 1, 'google.protobuf.internal.SourceCodeInfo.Location')
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.SourceCodeInfo.Location', \Google\Protobuf\Internal\SourceCodeInfo\Location::class)
+            ->repeated('path', \Google\Protobuf\Internal\GPBType::INT32, 1)
+            ->repeated('span', \Google\Protobuf\Internal\GPBType::INT32, 2)
+            ->optional('leading_comments', \Google\Protobuf\Internal\GPBType::STRING, 3)
+            ->optional('trailing_comments', \Google\Protobuf\Internal\GPBType::STRING, 4)
+            ->repeated('leading_detached_comments', \Google\Protobuf\Internal\GPBType::STRING, 6)
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.GeneratedCodeInfo', \Google\Protobuf\Internal\GeneratedCodeInfo::class)
+            ->repeated('annotation', \Google\Protobuf\Internal\GPBType::MESSAGE, 1, 'google.protobuf.internal.GeneratedCodeInfo.Annotation')
+            ->finalizeToPool();
+
+        $pool->addMessage('google.protobuf.internal.GeneratedCodeInfo.Annotation', \Google\Protobuf\Internal\GeneratedCodeInfo\Annotation::class)
+            ->repeated('path', \Google\Protobuf\Internal\GPBType::INT32, 1)
+            ->optional('source_file', \Google\Protobuf\Internal\GPBType::STRING, 2)
+            ->optional('begin', \Google\Protobuf\Internal\GPBType::INT32, 3)
+            ->optional('end', \Google\Protobuf\Internal\GPBType::INT32, 4)
+            ->finalizeToPool();
+
+        $pool->finish();
+        static::$is_initialized = true;
+    }
+}
+
diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/SourceContext.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/SourceContext.php
new file mode 100644
index 0000000..495c6de
--- /dev/null
+++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/SourceContext.php
@@ -0,0 +1,32 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/source_context.proto
+
+namespace GPBMetadata\Google\Protobuf;
+
+class SourceContext
+{
+    public static $is_initialized = false;
+
+    public static function initOnce() {
+        $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
+
+        if (static::$is_initialized == true) {
+          return;
+        }
+        $pool->internalAddGeneratedFile(hex2bin(
+            "0afb010a24676f6f676c652f70726f746f6275662f736f757263655f636f" .
+            "6e746578742e70726f746f120f676f6f676c652e70726f746f6275662222" .
+            "0a0d536f75726365436f6e7465787412110a0966696c655f6e616d651801" .
+            "200128094295010a13636f6d2e676f6f676c652e70726f746f6275664212" .
+            "536f75726365436f6e7465787450726f746f50015a41676f6f676c652e67" .
+            "6f6c616e672e6f72672f67656e70726f746f2f70726f746f6275662f736f" .
+            "757263655f636f6e746578743b736f757263655f636f6e74657874a20203" .
+            "475042aa021e476f6f676c652e50726f746f6275662e57656c6c4b6e6f77" .
+            "6e5479706573620670726f746f33"
+        ));
+
+        static::$is_initialized = true;
+    }
+}
+
diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Struct.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Struct.php
new file mode 100644
index 0000000..96b42af
--- /dev/null
+++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Struct.php
@@ -0,0 +1,45 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/struct.proto
+
+namespace GPBMetadata\Google\Protobuf;
+
+class Struct
+{
+    public static $is_initialized = false;
+
+    public static function initOnce() {
+        $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
+
+        if (static::$is_initialized == true) {
+          return;
+        }
+        $pool->internalAddGeneratedFile(hex2bin(
+            "0a81050a1c676f6f676c652f70726f746f6275662f7374727563742e7072" .
+            "6f746f120f676f6f676c652e70726f746f6275662284010a065374727563" .
+            "7412330a066669656c647318012003280b32232e676f6f676c652e70726f" .
+            "746f6275662e5374727563742e4669656c6473456e7472791a450a0b4669" .
+            "656c6473456e747279120b0a036b657918012001280912250a0576616c75" .
+            "6518022001280b32162e676f6f676c652e70726f746f6275662e56616c75" .
+            "653a02380122ea010a0556616c756512300a0a6e756c6c5f76616c756518" .
+            "012001280e321a2e676f6f676c652e70726f746f6275662e4e756c6c5661" .
+            "6c7565480012160a0c6e756d6265725f76616c7565180220012801480012" .
+            "160a0c737472696e675f76616c7565180320012809480012140a0a626f6f" .
+            "6c5f76616c75651804200128084800122f0a0c7374727563745f76616c75" .
+            "6518052001280b32172e676f6f676c652e70726f746f6275662e53747275" .
+            "6374480012300a0a6c6973745f76616c756518062001280b321a2e676f6f" .
+            "676c652e70726f746f6275662e4c69737456616c7565480042060a046b69" .
+            "6e6422330a094c69737456616c756512260a0676616c7565731801200328" .
+            "0b32162e676f6f676c652e70726f746f6275662e56616c75652a1b0a094e" .
+            "756c6c56616c7565120e0a0a4e554c4c5f56414c554510004281010a1363" .
+            "6f6d2e676f6f676c652e70726f746f627566420b53747275637450726f74" .
+            "6f50015a316769746875622e636f6d2f676f6c616e672f70726f746f6275" .
+            "662f7074797065732f7374727563743b7374727563747062f80101a20203" .
+            "475042aa021e476f6f676c652e50726f746f6275662e57656c6c4b6e6f77" .
+            "6e5479706573620670726f746f33"
+        ));
+
+        static::$is_initialized = true;
+    }
+}
+
diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Timestamp.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Timestamp.php
new file mode 100644
index 0000000..373665c
--- /dev/null
+++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Timestamp.php
@@ -0,0 +1,31 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/timestamp.proto
+
+namespace GPBMetadata\Google\Protobuf;
+
+class Timestamp
+{
+    public static $is_initialized = false;
+
+    public static function initOnce() {
+        $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
+
+        if (static::$is_initialized == true) {
+          return;
+        }
+        $pool->internalAddGeneratedFile(hex2bin(
+            "0ae7010a1f676f6f676c652f70726f746f6275662f74696d657374616d70" .
+            "2e70726f746f120f676f6f676c652e70726f746f627566222b0a0954696d" .
+            "657374616d70120f0a077365636f6e6473180120012803120d0a056e616e" .
+            "6f73180220012805427e0a13636f6d2e676f6f676c652e70726f746f6275" .
+            "66420e54696d657374616d7050726f746f50015a2b6769746875622e636f" .
+            "6d2f676f6c616e672f70726f746f6275662f7074797065732f74696d6573" .
+            "74616d70f80101a20203475042aa021e476f6f676c652e50726f746f6275" .
+            "662e57656c6c4b6e6f776e5479706573620670726f746f33"
+        ));
+
+        static::$is_initialized = true;
+    }
+}
+
diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Type.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Type.php
new file mode 100644
index 0000000..8fbe8cb
--- /dev/null
+++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Type.php
@@ -0,0 +1,78 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/type.proto
+
+namespace GPBMetadata\Google\Protobuf;
+
+class Type
+{
+    public static $is_initialized = false;
+
+    public static function initOnce() {
+        $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
+
+        if (static::$is_initialized == true) {
+          return;
+        }
+        \GPBMetadata\Google\Protobuf\Any::initOnce();
+        \GPBMetadata\Google\Protobuf\SourceContext::initOnce();
+        $pool->internalAddGeneratedFile(hex2bin(
+            "0a9f0c0a1a676f6f676c652f70726f746f6275662f747970652e70726f74" .
+            "6f120f676f6f676c652e70726f746f6275661a24676f6f676c652f70726f" .
+            "746f6275662f736f757263655f636f6e746578742e70726f746f22d7010a" .
+            "0454797065120c0a046e616d6518012001280912260a066669656c647318" .
+            "022003280b32162e676f6f676c652e70726f746f6275662e4669656c6412" .
+            "0e0a066f6e656f667318032003280912280a076f7074696f6e7318042003" .
+            "280b32172e676f6f676c652e70726f746f6275662e4f7074696f6e12360a" .
+            "0e736f757263655f636f6e7465787418052001280b321e2e676f6f676c65" .
+            "2e70726f746f6275662e536f75726365436f6e7465787412270a0673796e" .
+            "74617818062001280e32172e676f6f676c652e70726f746f6275662e5379" .
+            "6e74617822d5050a054669656c6412290a046b696e6418012001280e321b" .
+            "2e676f6f676c652e70726f746f6275662e4669656c642e4b696e6412370a" .
+            "0b63617264696e616c69747918022001280e32222e676f6f676c652e7072" .
+            "6f746f6275662e4669656c642e43617264696e616c697479120e0a066e75" .
+            "6d626572180320012805120c0a046e616d6518042001280912100a087479" .
+            "70655f75726c18062001280912130a0b6f6e656f665f696e646578180720" .
+            "012805120e0a067061636b656418082001280812280a076f7074696f6e73" .
+            "18092003280b32172e676f6f676c652e70726f746f6275662e4f7074696f" .
+            "6e12110a096a736f6e5f6e616d65180a2001280912150a0d64656661756c" .
+            "745f76616c7565180b2001280922c8020a044b696e6412100a0c54595045" .
+            "5f554e4b4e4f574e1000120f0a0b545950455f444f55424c451001120e0a" .
+            "0a545950455f464c4f41541002120e0a0a545950455f494e543634100312" .
+            "0f0a0b545950455f55494e5436341004120e0a0a545950455f494e543332" .
+            "100512100a0c545950455f46495845443634100612100a0c545950455f46" .
+            "4958454433321007120d0a09545950455f424f4f4c1008120f0a0b545950" .
+            "455f535452494e471009120e0a0a545950455f47524f5550100a12100a0c" .
+            "545950455f4d455353414745100b120e0a0a545950455f4259544553100c" .
+            "120f0a0b545950455f55494e543332100d120d0a09545950455f454e554d" .
+            "100e12110a0d545950455f5346495845443332100f12110a0d545950455f" .
+            "53464958454436341010120f0a0b545950455f53494e5433321011120f0a" .
+            "0b545950455f53494e543634101222740a0b43617264696e616c69747912" .
+            "170a1343415244494e414c4954595f554e4b4e4f574e100012180a144341" .
+            "5244494e414c4954595f4f5054494f4e414c100112180a1443415244494e" .
+            "414c4954595f5245515549524544100212180a1443415244494e414c4954" .
+            "595f5245504541544544100322ce010a04456e756d120c0a046e616d6518" .
+            "0120012809122d0a09656e756d76616c756518022003280b321a2e676f6f" .
+            "676c652e70726f746f6275662e456e756d56616c756512280a076f707469" .
+            "6f6e7318032003280b32172e676f6f676c652e70726f746f6275662e4f70" .
+            "74696f6e12360a0e736f757263655f636f6e7465787418042001280b321e" .
+            "2e676f6f676c652e70726f746f6275662e536f75726365436f6e74657874" .
+            "12270a0673796e74617818052001280e32172e676f6f676c652e70726f74" .
+            "6f6275662e53796e74617822530a09456e756d56616c7565120c0a046e61" .
+            "6d65180120012809120e0a066e756d62657218022001280512280a076f70" .
+            "74696f6e7318032003280b32172e676f6f676c652e70726f746f6275662e" .
+            "4f7074696f6e223b0a064f7074696f6e120c0a046e616d65180120012809" .
+            "12230a0576616c756518022001280b32142e676f6f676c652e70726f746f" .
+            "6275662e416e792a2e0a0653796e74617812110a0d53594e5441585f5052" .
+            "4f544f32100012110a0d53594e5441585f50524f544f331001427d0a1363" .
+            "6f6d2e676f6f676c652e70726f746f62756642095479706550726f746f50" .
+            "015a2f676f6f676c652e676f6c616e672e6f72672f67656e70726f746f2f" .
+            "70726f746f6275662f70747970653b7074797065f80101a20203475042aa" .
+            "021e476f6f676c652e50726f746f6275662e57656c6c4b6e6f776e547970" .
+            "6573620670726f746f33"
+        ));
+
+        static::$is_initialized = true;
+    }
+}
+
diff --git a/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Wrappers.php b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Wrappers.php
new file mode 100644
index 0000000..dd72ff4
--- /dev/null
+++ b/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Wrappers.php
@@ -0,0 +1,38 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/wrappers.proto
+
+namespace GPBMetadata\Google\Protobuf;
+
+class Wrappers
+{
+    public static $is_initialized = false;
+
+    public static function initOnce() {
+        $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
+
+        if (static::$is_initialized == true) {
+          return;
+        }
+        $pool->internalAddGeneratedFile(hex2bin(
+            "0abf030a1e676f6f676c652f70726f746f6275662f77726170706572732e" .
+            "70726f746f120f676f6f676c652e70726f746f627566221c0a0b446f7562" .
+            "6c6556616c7565120d0a0576616c7565180120012801221b0a0a466c6f61" .
+            "7456616c7565120d0a0576616c7565180120012802221b0a0a496e743634" .
+            "56616c7565120d0a0576616c7565180120012803221c0a0b55496e743634" .
+            "56616c7565120d0a0576616c7565180120012804221b0a0a496e74333256" .
+            "616c7565120d0a0576616c7565180120012805221c0a0b55496e74333256" .
+            "616c7565120d0a0576616c756518012001280d221a0a09426f6f6c56616c" .
+            "7565120d0a0576616c7565180120012808221c0a0b537472696e6756616c" .
+            "7565120d0a0576616c7565180120012809221b0a0a427974657356616c75" .
+            "65120d0a0576616c756518012001280c427c0a13636f6d2e676f6f676c65" .
+            "2e70726f746f627566420d577261707065727350726f746f50015a2a6769" .
+            "746875622e636f6d2f676f6c616e672f70726f746f6275662f7074797065" .
+            "732f7772617070657273f80101a20203475042aa021e476f6f676c652e50" .
+            "726f746f6275662e57656c6c4b6e6f776e5479706573620670726f746f33"
+        ));
+
+        static::$is_initialized = true;
+    }
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Any.php b/vendor/google/protobuf/src/Google/Protobuf/Any.php
new file mode 100644
index 0000000..cdbaa25
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Any.php
@@ -0,0 +1,325 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/any.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\Message;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * `Any` contains an arbitrary serialized protocol buffer message along with a
+ * URL that describes the type of the serialized message.
+ * Protobuf library provides support to pack/unpack Any values in the form
+ * of utility functions or additional generated methods of the Any type.
+ * Example 1: Pack and unpack a message in C++.
+ *     Foo foo = ...;
+ *     Any any;
+ *     any.PackFrom(foo);
+ *     ...
+ *     if (any.UnpackTo(&foo)) {
+ *       ...
+ *     }
+ * Example 2: Pack and unpack a message in Java.
+ *     Foo foo = ...;
+ *     Any any = Any.pack(foo);
+ *     ...
+ *     if (any.is(Foo.class)) {
+ *       foo = any.unpack(Foo.class);
+ *     }
+ *  Example 3: Pack and unpack a message in Python.
+ *     foo = Foo(...)
+ *     any = Any()
+ *     any.Pack(foo)
+ *     ...
+ *     if any.Is(Foo.DESCRIPTOR):
+ *       any.Unpack(foo)
+ *       ...
+ *  Example 4: Pack and unpack a message in Go
+ *      foo := &pb.Foo{...}
+ *      any, err := ptypes.MarshalAny(foo)
+ *      ...
+ *      foo := &pb.Foo{}
+ *      if err := ptypes.UnmarshalAny(any, foo); err != nil {
+ *        ...
+ *      }
+ * The pack methods provided by protobuf library will by default use
+ * 'type.googleapis.com/full.type.name' as the type URL and the unpack
+ * methods only use the fully qualified type name after the last '/'
+ * in the type URL, for example "foo.bar.com/x/y.z" will yield type
+ * name "y.z".
+ * JSON
+ * ====
+ * The JSON representation of an `Any` value uses the regular
+ * representation of the deserialized, embedded message, with an
+ * additional field `&#64;type` which contains the type URL. Example:
+ *     package google.profile;
+ *     message Person {
+ *       string first_name = 1;
+ *       string last_name = 2;
+ *     }
+ *     {
+ *       "&#64;type": "type.googleapis.com/google.profile.Person",
+ *       "firstName": <string>,
+ *       "lastName": <string>
+ *     }
+ * If the embedded message type is well-known and has a custom JSON
+ * representation, that representation will be embedded adding a field
+ * `value` which holds the custom JSON in addition to the `&#64;type`
+ * field. Example (for message [google.protobuf.Duration][]):
+ *     {
+ *       "&#64;type": "type.googleapis.com/google.protobuf.Duration",
+ *       "value": "1.212s"
+ *     }
+ *
+ * Generated from protobuf message <code>google.protobuf.Any</code>
+ */
+class Any extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * A URL/resource name that uniquely identifies the type of the serialized
+     * protocol buffer message. The last segment of the URL's path must represent
+     * the fully qualified name of the type (as in
+     * `path/google.protobuf.Duration`). The name should be in a canonical form
+     * (e.g., leading "." is not accepted).
+     * In practice, teams usually precompile into the binary all types that they
+     * expect it to use in the context of Any. However, for URLs which use the
+     * scheme `http`, `https`, or no scheme, one can optionally set up a type
+     * server that maps type URLs to message definitions as follows:
+     * * If no scheme is provided, `https` is assumed.
+     * * An HTTP GET on the URL must yield a [google.protobuf.Type][]
+     *   value in binary format, or produce an error.
+     * * Applications are allowed to cache lookup results based on the
+     *   URL, or have them precompiled into a binary to avoid any
+     *   lookup. Therefore, binary compatibility needs to be preserved
+     *   on changes to types. (Use versioned type names to manage
+     *   breaking changes.)
+     * Note: this functionality is not currently available in the official
+     * protobuf release, and it is not used for type URLs beginning with
+     * type.googleapis.com.
+     * Schemes other than `http`, `https` (or the empty scheme) might be
+     * used with implementation specific semantics.
+     *
+     * Generated from protobuf field <code>string type_url = 1;</code>
+     */
+    private $type_url = '';
+    /**
+     * Must be a valid serialized protocol buffer of the above specified type.
+     *
+     * Generated from protobuf field <code>bytes value = 2;</code>
+     */
+    private $value = '';
+
+    const TYPE_URL_PREFIX = 'type.googleapis.com/';
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type string $type_url
+     *           A URL/resource name that uniquely identifies the type of the serialized
+     *           protocol buffer message. The last segment of the URL's path must represent
+     *           the fully qualified name of the type (as in
+     *           `path/google.protobuf.Duration`). The name should be in a canonical form
+     *           (e.g., leading "." is not accepted).
+     *           In practice, teams usually precompile into the binary all types that they
+     *           expect it to use in the context of Any. However, for URLs which use the
+     *           scheme `http`, `https`, or no scheme, one can optionally set up a type
+     *           server that maps type URLs to message definitions as follows:
+     *           * If no scheme is provided, `https` is assumed.
+     *           * An HTTP GET on the URL must yield a [google.protobuf.Type][]
+     *             value in binary format, or produce an error.
+     *           * Applications are allowed to cache lookup results based on the
+     *             URL, or have them precompiled into a binary to avoid any
+     *             lookup. Therefore, binary compatibility needs to be preserved
+     *             on changes to types. (Use versioned type names to manage
+     *             breaking changes.)
+     *           Note: this functionality is not currently available in the official
+     *           protobuf release, and it is not used for type URLs beginning with
+     *           type.googleapis.com.
+     *           Schemes other than `http`, `https` (or the empty scheme) might be
+     *           used with implementation specific semantics.
+     *     @type string $value
+     *           Must be a valid serialized protocol buffer of the above specified type.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Any::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * A URL/resource name that uniquely identifies the type of the serialized
+     * protocol buffer message. The last segment of the URL's path must represent
+     * the fully qualified name of the type (as in
+     * `path/google.protobuf.Duration`). The name should be in a canonical form
+     * (e.g., leading "." is not accepted).
+     * In practice, teams usually precompile into the binary all types that they
+     * expect it to use in the context of Any. However, for URLs which use the
+     * scheme `http`, `https`, or no scheme, one can optionally set up a type
+     * server that maps type URLs to message definitions as follows:
+     * * If no scheme is provided, `https` is assumed.
+     * * An HTTP GET on the URL must yield a [google.protobuf.Type][]
+     *   value in binary format, or produce an error.
+     * * Applications are allowed to cache lookup results based on the
+     *   URL, or have them precompiled into a binary to avoid any
+     *   lookup. Therefore, binary compatibility needs to be preserved
+     *   on changes to types. (Use versioned type names to manage
+     *   breaking changes.)
+     * Note: this functionality is not currently available in the official
+     * protobuf release, and it is not used for type URLs beginning with
+     * type.googleapis.com.
+     * Schemes other than `http`, `https` (or the empty scheme) might be
+     * used with implementation specific semantics.
+     *
+     * Generated from protobuf field <code>string type_url = 1;</code>
+     * @return string
+     */
+    public function getTypeUrl()
+    {
+        return $this->type_url;
+    }
+
+    /**
+     * A URL/resource name that uniquely identifies the type of the serialized
+     * protocol buffer message. The last segment of the URL's path must represent
+     * the fully qualified name of the type (as in
+     * `path/google.protobuf.Duration`). The name should be in a canonical form
+     * (e.g., leading "." is not accepted).
+     * In practice, teams usually precompile into the binary all types that they
+     * expect it to use in the context of Any. However, for URLs which use the
+     * scheme `http`, `https`, or no scheme, one can optionally set up a type
+     * server that maps type URLs to message definitions as follows:
+     * * If no scheme is provided, `https` is assumed.
+     * * An HTTP GET on the URL must yield a [google.protobuf.Type][]
+     *   value in binary format, or produce an error.
+     * * Applications are allowed to cache lookup results based on the
+     *   URL, or have them precompiled into a binary to avoid any
+     *   lookup. Therefore, binary compatibility needs to be preserved
+     *   on changes to types. (Use versioned type names to manage
+     *   breaking changes.)
+     * Note: this functionality is not currently available in the official
+     * protobuf release, and it is not used for type URLs beginning with
+     * type.googleapis.com.
+     * Schemes other than `http`, `https` (or the empty scheme) might be
+     * used with implementation specific semantics.
+     *
+     * Generated from protobuf field <code>string type_url = 1;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setTypeUrl($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->type_url = $var;
+
+        return $this;
+    }
+
+    /**
+     * Must be a valid serialized protocol buffer of the above specified type.
+     *
+     * Generated from protobuf field <code>bytes value = 2;</code>
+     * @return string
+     */
+    public function getValue()
+    {
+        return $this->value;
+    }
+
+    /**
+     * Must be a valid serialized protocol buffer of the above specified type.
+     *
+     * Generated from protobuf field <code>bytes value = 2;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setValue($var)
+    {
+        GPBUtil::checkString($var, False);
+        $this->value = $var;
+
+        return $this;
+    }
+
+    /**
+     * This method will try to resolve the type_url in Any message to get the
+     * targeted message type. If failed, an error will be thrown. Otherwise,
+     * the method will create a message of the targeted type and fill it with
+     * the decoded value in Any.
+     * @return unpacked message
+     * @throws \Exception Type url needs to be type.googleapis.com/fully-qulified.
+     * @throws \Exception Class hasn't been added to descriptor pool.
+     * @throws \Exception cannot decode data in value field.
+     */
+    public function unpack()
+    {
+        // Get fully qualifed name from type url.
+        $url_prifix_len = strlen(GPBUtil::TYPE_URL_PREFIX);
+        if (substr($this->type_url, 0, $url_prifix_len) !=
+                GPBUtil::TYPE_URL_PREFIX) {
+            throw new \Exception(
+                "Type url needs to be type.googleapis.com/fully-qulified");
+        }
+        $fully_qualifed_name =
+            substr($this->type_url, $url_prifix_len);
+
+        // Create message according to fully qualified name.
+        $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
+        $desc = $pool->getDescriptorByProtoName( ".".$fully_qualifed_name);
+        if (is_null($desc)) {
+            throw new \Exception("Class ".$fully_qualifed_name
+                                     ." hasn't been added to descriptor pool");
+        }
+        $klass = $desc->getClass();
+        $msg = new $klass();
+
+        // Merge data into message.
+        $msg->mergeFromString($this->value);
+        return $msg;
+    }
+
+    /**
+     * The type_url will be created according to the given message’s type and
+     * the value is encoded data from the given message..
+     * @param message: A proto message.
+     */
+    public function pack($msg)
+    {
+        if (!$msg instanceof Message) {
+            trigger_error("Given parameter is not a message instance.",
+                          E_USER_ERROR);
+            return;
+        }
+
+        // Set value using serialzed message.
+        $this->value = $msg->serializeToString();
+
+        // Set type url.
+        $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
+        $desc = $pool->getDescriptorByClassName(get_class($msg));
+        $fully_qualifed_name = $desc->getFullName();
+        $this->type_url = GPBUtil::TYPE_URL_PREFIX.substr(
+            $fully_qualifed_name, 1, strlen($fully_qualifed_name));
+    }
+
+    /**
+     * This method returns whether the type_url in any_message is corresponded
+     * to the given class.
+     * @param klass: The fully qualified PHP class name of a proto message type.
+     */
+    public function is($klass)
+    {
+        $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
+        $desc = $pool->getDescriptorByClassName($klass);
+        $fully_qualifed_name = $desc->getFullName();
+        $type_url = GPBUtil::TYPE_URL_PREFIX.substr(
+            $fully_qualifed_name, 1, strlen($fully_qualifed_name));
+        return $this->type_url === $type_url;
+    }
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Api.php b/vendor/google/protobuf/src/Google/Protobuf/Api.php
new file mode 100644
index 0000000..db37ffb
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Api.php
@@ -0,0 +1,350 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/api.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Api is a light-weight descriptor for an API Interface.
+ * Interfaces are also described as "protocol buffer services" in some contexts,
+ * such as by the "service" keyword in a .proto file, but they are different
+ * from API Services, which represent a concrete implementation of an interface
+ * as opposed to simply a description of methods and bindings. They are also
+ * sometimes simply referred to as "APIs" in other contexts, such as the name of
+ * this message itself. See https://cloud.google.com/apis/design/glossary for
+ * detailed terminology.
+ *
+ * Generated from protobuf message <code>google.protobuf.Api</code>
+ */
+class Api extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * The fully qualified name of this interface, including package name
+     * followed by the interface's simple name.
+     *
+     * Generated from protobuf field <code>string name = 1;</code>
+     */
+    private $name = '';
+    /**
+     * The methods of this interface, in unspecified order.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Method methods = 2;</code>
+     */
+    private $methods;
+    /**
+     * Any metadata attached to the interface.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Option options = 3;</code>
+     */
+    private $options;
+    /**
+     * A version string for this interface. If specified, must have the form
+     * `major-version.minor-version`, as in `1.10`. If the minor version is
+     * omitted, it defaults to zero. If the entire version field is empty, the
+     * major version is derived from the package name, as outlined below. If the
+     * field is not empty, the version in the package name will be verified to be
+     * consistent with what is provided here.
+     * The versioning schema uses [semantic
+     * versioning](http://semver.org) where the major version number
+     * indicates a breaking change and the minor version an additive,
+     * non-breaking change. Both version numbers are signals to users
+     * what to expect from different versions, and should be carefully
+     * chosen based on the product plan.
+     * The major version is also reflected in the package name of the
+     * interface, which must end in `v<major-version>`, as in
+     * `google.feature.v1`. For major versions 0 and 1, the suffix can
+     * be omitted. Zero major versions must only be used for
+     * experimental, non-GA interfaces.
+     *
+     * Generated from protobuf field <code>string version = 4;</code>
+     */
+    private $version = '';
+    /**
+     * Source context for the protocol buffer service represented by this
+     * message.
+     *
+     * Generated from protobuf field <code>.google.protobuf.SourceContext source_context = 5;</code>
+     */
+    private $source_context = null;
+    /**
+     * Included interfaces. See [Mixin][].
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Mixin mixins = 6;</code>
+     */
+    private $mixins;
+    /**
+     * The source syntax of the service.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Syntax syntax = 7;</code>
+     */
+    private $syntax = 0;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type string $name
+     *           The fully qualified name of this interface, including package name
+     *           followed by the interface's simple name.
+     *     @type \Google\Protobuf\Method[]|\Google\Protobuf\Internal\RepeatedField $methods
+     *           The methods of this interface, in unspecified order.
+     *     @type \Google\Protobuf\Option[]|\Google\Protobuf\Internal\RepeatedField $options
+     *           Any metadata attached to the interface.
+     *     @type string $version
+     *           A version string for this interface. If specified, must have the form
+     *           `major-version.minor-version`, as in `1.10`. If the minor version is
+     *           omitted, it defaults to zero. If the entire version field is empty, the
+     *           major version is derived from the package name, as outlined below. If the
+     *           field is not empty, the version in the package name will be verified to be
+     *           consistent with what is provided here.
+     *           The versioning schema uses [semantic
+     *           versioning](http://semver.org) where the major version number
+     *           indicates a breaking change and the minor version an additive,
+     *           non-breaking change. Both version numbers are signals to users
+     *           what to expect from different versions, and should be carefully
+     *           chosen based on the product plan.
+     *           The major version is also reflected in the package name of the
+     *           interface, which must end in `v<major-version>`, as in
+     *           `google.feature.v1`. For major versions 0 and 1, the suffix can
+     *           be omitted. Zero major versions must only be used for
+     *           experimental, non-GA interfaces.
+     *     @type \Google\Protobuf\SourceContext $source_context
+     *           Source context for the protocol buffer service represented by this
+     *           message.
+     *     @type \Google\Protobuf\Mixin[]|\Google\Protobuf\Internal\RepeatedField $mixins
+     *           Included interfaces. See [Mixin][].
+     *     @type int $syntax
+     *           The source syntax of the service.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Api::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * The fully qualified name of this interface, including package name
+     * followed by the interface's simple name.
+     *
+     * Generated from protobuf field <code>string name = 1;</code>
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * The fully qualified name of this interface, including package name
+     * followed by the interface's simple name.
+     *
+     * Generated from protobuf field <code>string name = 1;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setName($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->name = $var;
+
+        return $this;
+    }
+
+    /**
+     * The methods of this interface, in unspecified order.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Method methods = 2;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getMethods()
+    {
+        return $this->methods;
+    }
+
+    /**
+     * The methods of this interface, in unspecified order.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Method methods = 2;</code>
+     * @param \Google\Protobuf\Method[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setMethods($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Method::class);
+        $this->methods = $arr;
+
+        return $this;
+    }
+
+    /**
+     * Any metadata attached to the interface.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Option options = 3;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getOptions()
+    {
+        return $this->options;
+    }
+
+    /**
+     * Any metadata attached to the interface.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Option options = 3;</code>
+     * @param \Google\Protobuf\Option[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setOptions($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class);
+        $this->options = $arr;
+
+        return $this;
+    }
+
+    /**
+     * A version string for this interface. If specified, must have the form
+     * `major-version.minor-version`, as in `1.10`. If the minor version is
+     * omitted, it defaults to zero. If the entire version field is empty, the
+     * major version is derived from the package name, as outlined below. If the
+     * field is not empty, the version in the package name will be verified to be
+     * consistent with what is provided here.
+     * The versioning schema uses [semantic
+     * versioning](http://semver.org) where the major version number
+     * indicates a breaking change and the minor version an additive,
+     * non-breaking change. Both version numbers are signals to users
+     * what to expect from different versions, and should be carefully
+     * chosen based on the product plan.
+     * The major version is also reflected in the package name of the
+     * interface, which must end in `v<major-version>`, as in
+     * `google.feature.v1`. For major versions 0 and 1, the suffix can
+     * be omitted. Zero major versions must only be used for
+     * experimental, non-GA interfaces.
+     *
+     * Generated from protobuf field <code>string version = 4;</code>
+     * @return string
+     */
+    public function getVersion()
+    {
+        return $this->version;
+    }
+
+    /**
+     * A version string for this interface. If specified, must have the form
+     * `major-version.minor-version`, as in `1.10`. If the minor version is
+     * omitted, it defaults to zero. If the entire version field is empty, the
+     * major version is derived from the package name, as outlined below. If the
+     * field is not empty, the version in the package name will be verified to be
+     * consistent with what is provided here.
+     * The versioning schema uses [semantic
+     * versioning](http://semver.org) where the major version number
+     * indicates a breaking change and the minor version an additive,
+     * non-breaking change. Both version numbers are signals to users
+     * what to expect from different versions, and should be carefully
+     * chosen based on the product plan.
+     * The major version is also reflected in the package name of the
+     * interface, which must end in `v<major-version>`, as in
+     * `google.feature.v1`. For major versions 0 and 1, the suffix can
+     * be omitted. Zero major versions must only be used for
+     * experimental, non-GA interfaces.
+     *
+     * Generated from protobuf field <code>string version = 4;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setVersion($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->version = $var;
+
+        return $this;
+    }
+
+    /**
+     * Source context for the protocol buffer service represented by this
+     * message.
+     *
+     * Generated from protobuf field <code>.google.protobuf.SourceContext source_context = 5;</code>
+     * @return \Google\Protobuf\SourceContext
+     */
+    public function getSourceContext()
+    {
+        return $this->source_context;
+    }
+
+    /**
+     * Source context for the protocol buffer service represented by this
+     * message.
+     *
+     * Generated from protobuf field <code>.google.protobuf.SourceContext source_context = 5;</code>
+     * @param \Google\Protobuf\SourceContext $var
+     * @return $this
+     */
+    public function setSourceContext($var)
+    {
+        GPBUtil::checkMessage($var, \Google\Protobuf\SourceContext::class);
+        $this->source_context = $var;
+
+        return $this;
+    }
+
+    /**
+     * Included interfaces. See [Mixin][].
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Mixin mixins = 6;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getMixins()
+    {
+        return $this->mixins;
+    }
+
+    /**
+     * Included interfaces. See [Mixin][].
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Mixin mixins = 6;</code>
+     * @param \Google\Protobuf\Mixin[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setMixins($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Mixin::class);
+        $this->mixins = $arr;
+
+        return $this;
+    }
+
+    /**
+     * The source syntax of the service.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Syntax syntax = 7;</code>
+     * @return int
+     */
+    public function getSyntax()
+    {
+        return $this->syntax;
+    }
+
+    /**
+     * The source syntax of the service.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Syntax syntax = 7;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setSyntax($var)
+    {
+        GPBUtil::checkEnum($var, \Google\Protobuf\Syntax::class);
+        $this->syntax = $var;
+
+        return $this;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/BoolValue.php b/vendor/google/protobuf/src/Google/Protobuf/BoolValue.php
new file mode 100644
index 0000000..13872eb
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/BoolValue.php
@@ -0,0 +1,68 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/wrappers.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Wrapper message for `bool`.
+ * The JSON representation for `BoolValue` is JSON `true` and `false`.
+ *
+ * Generated from protobuf message <code>google.protobuf.BoolValue</code>
+ */
+class BoolValue extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * The bool value.
+     *
+     * Generated from protobuf field <code>bool value = 1;</code>
+     */
+    private $value = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type bool $value
+     *           The bool value.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Wrappers::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * The bool value.
+     *
+     * Generated from protobuf field <code>bool value = 1;</code>
+     * @return bool
+     */
+    public function getValue()
+    {
+        return $this->value;
+    }
+
+    /**
+     * The bool value.
+     *
+     * Generated from protobuf field <code>bool value = 1;</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setValue($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->value = $var;
+
+        return $this;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/BytesValue.php b/vendor/google/protobuf/src/Google/Protobuf/BytesValue.php
new file mode 100644
index 0000000..f1b3817
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/BytesValue.php
@@ -0,0 +1,68 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/wrappers.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Wrapper message for `bytes`.
+ * The JSON representation for `BytesValue` is JSON string.
+ *
+ * Generated from protobuf message <code>google.protobuf.BytesValue</code>
+ */
+class BytesValue extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * The bytes value.
+     *
+     * Generated from protobuf field <code>bytes value = 1;</code>
+     */
+    private $value = '';
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type string $value
+     *           The bytes value.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Wrappers::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * The bytes value.
+     *
+     * Generated from protobuf field <code>bytes value = 1;</code>
+     * @return string
+     */
+    public function getValue()
+    {
+        return $this->value;
+    }
+
+    /**
+     * The bytes value.
+     *
+     * Generated from protobuf field <code>bytes value = 1;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setValue($var)
+    {
+        GPBUtil::checkString($var, False);
+        $this->value = $var;
+
+        return $this;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Descriptor.php b/vendor/google/protobuf/src/Google/Protobuf/Descriptor.php
new file mode 100644
index 0000000..986b81e
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Descriptor.php
@@ -0,0 +1,100 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2017 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GetPublicDescriptorTrait;
+
+class Descriptor
+{
+    use GetPublicDescriptorTrait;
+
+    private $internal_desc;
+
+    /**
+     * @internal
+     */
+    public function __construct($internal_desc)
+    {
+        $this->internal_desc = $internal_desc;
+    }
+
+    /**
+     * @return string Full protobuf message name
+     */
+    public function getFullName()
+    {
+        return trim($this->internal_desc->getFullName(), ".");
+    }
+
+    /**
+     * @return string PHP class name
+     */
+    public function getClass()
+    {
+        return $this->internal_desc->getClass();
+    }
+
+    /**
+     * @param int $index Must be >= 0 and < getFieldCount()
+     * @return FieldDescriptor
+     */
+    public function getField($index)
+    {
+        return $this->getPublicDescriptor($this->internal_desc->getFieldByIndex($index));
+    }
+
+    /**
+     * @return int Number of fields in message
+     */
+    public function getFieldCount()
+    {
+        return count($this->internal_desc->getField());
+    }
+
+    /**
+     * @param int $index Must be >= 0 and < getOneofDeclCount()
+     * @return OneofDescriptor
+     */
+    public function getOneofDecl($index)
+    {
+        return $this->getPublicDescriptor($this->internal_desc->getOneofDecl()[$index]);
+    }
+
+    /**
+     * @return int Number of oneofs in message
+     */
+    public function getOneofDeclCount()
+    {
+        return count($this->internal_desc->getOneofDecl());
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/DescriptorPool.php b/vendor/google/protobuf/src/Google/Protobuf/DescriptorPool.php
new file mode 100644
index 0000000..119f0e2
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/DescriptorPool.php
@@ -0,0 +1,76 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2017 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf;
+
+class DescriptorPool
+{
+    private static $pool;
+
+    private $internal_pool;
+
+    /**
+     * @return DescriptorPool
+     */
+    public static function getGeneratedPool()
+    {
+        if (!isset(self::$pool)) {
+            self::$pool = new DescriptorPool(\Google\Protobuf\Internal\DescriptorPool::getGeneratedPool());
+        }
+        return self::$pool;
+    }
+
+    private function __construct($internal_pool)
+    {
+        $this->internal_pool = $internal_pool;
+    }
+
+    /**
+     * @param string $className A fully qualified protobuf class name
+     * @return Descriptor
+     */
+    public function getDescriptorByClassName($className)
+    {
+        $desc = $this->internal_pool->getDescriptorByClassName($className);
+        return is_null($desc) ? null : $desc->getPublicDescriptor();
+    }
+
+    /**
+     * @param string $className A fully qualified protobuf class name
+     * @return EnumDescriptor
+     */
+    public function getEnumDescriptorByClassName($className)
+    {
+        $desc = $this->internal_pool->getEnumDescriptorByClassName($className);
+        return is_null($desc) ? null : $desc->getPublicDescriptor();
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/DoubleValue.php b/vendor/google/protobuf/src/Google/Protobuf/DoubleValue.php
new file mode 100644
index 0000000..236d918
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/DoubleValue.php
@@ -0,0 +1,68 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/wrappers.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Wrapper message for `double`.
+ * The JSON representation for `DoubleValue` is JSON number.
+ *
+ * Generated from protobuf message <code>google.protobuf.DoubleValue</code>
+ */
+class DoubleValue extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * The double value.
+     *
+     * Generated from protobuf field <code>double value = 1;</code>
+     */
+    private $value = 0.0;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type float $value
+     *           The double value.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Wrappers::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * The double value.
+     *
+     * Generated from protobuf field <code>double value = 1;</code>
+     * @return float
+     */
+    public function getValue()
+    {
+        return $this->value;
+    }
+
+    /**
+     * The double value.
+     *
+     * Generated from protobuf field <code>double value = 1;</code>
+     * @param float $var
+     * @return $this
+     */
+    public function setValue($var)
+    {
+        GPBUtil::checkDouble($var);
+        $this->value = $var;
+
+        return $this;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Duration.php b/vendor/google/protobuf/src/Google/Protobuf/Duration.php
new file mode 100644
index 0000000..414a186
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Duration.php
@@ -0,0 +1,173 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/duration.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * A Duration represents a signed, fixed-length span of time represented
+ * as a count of seconds and fractions of seconds at nanosecond
+ * resolution. It is independent of any calendar and concepts like "day"
+ * or "month". It is related to Timestamp in that the difference between
+ * two Timestamp values is a Duration and it can be added or subtracted
+ * from a Timestamp. Range is approximately +-10,000 years.
+ * # Examples
+ * Example 1: Compute Duration from two Timestamps in pseudo code.
+ *     Timestamp start = ...;
+ *     Timestamp end = ...;
+ *     Duration duration = ...;
+ *     duration.seconds = end.seconds - start.seconds;
+ *     duration.nanos = end.nanos - start.nanos;
+ *     if (duration.seconds < 0 && duration.nanos > 0) {
+ *       duration.seconds += 1;
+ *       duration.nanos -= 1000000000;
+ *     } else if (durations.seconds > 0 && duration.nanos < 0) {
+ *       duration.seconds -= 1;
+ *       duration.nanos += 1000000000;
+ *     }
+ * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
+ *     Timestamp start = ...;
+ *     Duration duration = ...;
+ *     Timestamp end = ...;
+ *     end.seconds = start.seconds + duration.seconds;
+ *     end.nanos = start.nanos + duration.nanos;
+ *     if (end.nanos < 0) {
+ *       end.seconds -= 1;
+ *       end.nanos += 1000000000;
+ *     } else if (end.nanos >= 1000000000) {
+ *       end.seconds += 1;
+ *       end.nanos -= 1000000000;
+ *     }
+ * Example 3: Compute Duration from datetime.timedelta in Python.
+ *     td = datetime.timedelta(days=3, minutes=10)
+ *     duration = Duration()
+ *     duration.FromTimedelta(td)
+ * # JSON Mapping
+ * In JSON format, the Duration type is encoded as a string rather than an
+ * object, where the string ends in the suffix "s" (indicating seconds) and
+ * is preceded by the number of seconds, with nanoseconds expressed as
+ * fractional seconds. For example, 3 seconds with 0 nanoseconds should be
+ * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
+ * be expressed in JSON format as "3.000000001s", and 3 seconds and 1
+ * microsecond should be expressed in JSON format as "3.000001s".
+ *
+ * Generated from protobuf message <code>google.protobuf.Duration</code>
+ */
+class Duration extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Signed seconds of the span of time. Must be from -315,576,000,000
+     * to +315,576,000,000 inclusive. Note: these bounds are computed from:
+     * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
+     *
+     * Generated from protobuf field <code>int64 seconds = 1;</code>
+     */
+    private $seconds = 0;
+    /**
+     * Signed fractions of a second at nanosecond resolution of the span
+     * of time. Durations less than one second are represented with a 0
+     * `seconds` field and a positive or negative `nanos` field. For durations
+     * of one second or more, a non-zero value for the `nanos` field must be
+     * of the same sign as the `seconds` field. Must be from -999,999,999
+     * to +999,999,999 inclusive.
+     *
+     * Generated from protobuf field <code>int32 nanos = 2;</code>
+     */
+    private $nanos = 0;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type int|string $seconds
+     *           Signed seconds of the span of time. Must be from -315,576,000,000
+     *           to +315,576,000,000 inclusive. Note: these bounds are computed from:
+     *           60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
+     *     @type int $nanos
+     *           Signed fractions of a second at nanosecond resolution of the span
+     *           of time. Durations less than one second are represented with a 0
+     *           `seconds` field and a positive or negative `nanos` field. For durations
+     *           of one second or more, a non-zero value for the `nanos` field must be
+     *           of the same sign as the `seconds` field. Must be from -999,999,999
+     *           to +999,999,999 inclusive.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Duration::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Signed seconds of the span of time. Must be from -315,576,000,000
+     * to +315,576,000,000 inclusive. Note: these bounds are computed from:
+     * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
+     *
+     * Generated from protobuf field <code>int64 seconds = 1;</code>
+     * @return int|string
+     */
+    public function getSeconds()
+    {
+        return $this->seconds;
+    }
+
+    /**
+     * Signed seconds of the span of time. Must be from -315,576,000,000
+     * to +315,576,000,000 inclusive. Note: these bounds are computed from:
+     * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
+     *
+     * Generated from protobuf field <code>int64 seconds = 1;</code>
+     * @param int|string $var
+     * @return $this
+     */
+    public function setSeconds($var)
+    {
+        GPBUtil::checkInt64($var);
+        $this->seconds = $var;
+
+        return $this;
+    }
+
+    /**
+     * Signed fractions of a second at nanosecond resolution of the span
+     * of time. Durations less than one second are represented with a 0
+     * `seconds` field and a positive or negative `nanos` field. For durations
+     * of one second or more, a non-zero value for the `nanos` field must be
+     * of the same sign as the `seconds` field. Must be from -999,999,999
+     * to +999,999,999 inclusive.
+     *
+     * Generated from protobuf field <code>int32 nanos = 2;</code>
+     * @return int
+     */
+    public function getNanos()
+    {
+        return $this->nanos;
+    }
+
+    /**
+     * Signed fractions of a second at nanosecond resolution of the span
+     * of time. Durations less than one second are represented with a 0
+     * `seconds` field and a positive or negative `nanos` field. For durations
+     * of one second or more, a non-zero value for the `nanos` field must be
+     * of the same sign as the `seconds` field. Must be from -999,999,999
+     * to +999,999,999 inclusive.
+     *
+     * Generated from protobuf field <code>int32 nanos = 2;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setNanos($var)
+    {
+        GPBUtil::checkInt32($var);
+        $this->nanos = $var;
+
+        return $this;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Enum.php b/vendor/google/protobuf/src/Google/Protobuf/Enum.php
new file mode 100644
index 0000000..243c40d
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Enum.php
@@ -0,0 +1,203 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/type.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Enum type definition.
+ *
+ * Generated from protobuf message <code>google.protobuf.Enum</code>
+ */
+class Enum extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Enum type name.
+     *
+     * Generated from protobuf field <code>string name = 1;</code>
+     */
+    private $name = '';
+    /**
+     * Enum value definitions.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.EnumValue enumvalue = 2;</code>
+     */
+    private $enumvalue;
+    /**
+     * Protocol buffer options.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Option options = 3;</code>
+     */
+    private $options;
+    /**
+     * The source context.
+     *
+     * Generated from protobuf field <code>.google.protobuf.SourceContext source_context = 4;</code>
+     */
+    private $source_context = null;
+    /**
+     * The source syntax.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Syntax syntax = 5;</code>
+     */
+    private $syntax = 0;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type string $name
+     *           Enum type name.
+     *     @type \Google\Protobuf\EnumValue[]|\Google\Protobuf\Internal\RepeatedField $enumvalue
+     *           Enum value definitions.
+     *     @type \Google\Protobuf\Option[]|\Google\Protobuf\Internal\RepeatedField $options
+     *           Protocol buffer options.
+     *     @type \Google\Protobuf\SourceContext $source_context
+     *           The source context.
+     *     @type int $syntax
+     *           The source syntax.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Type::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Enum type name.
+     *
+     * Generated from protobuf field <code>string name = 1;</code>
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * Enum type name.
+     *
+     * Generated from protobuf field <code>string name = 1;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setName($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->name = $var;
+
+        return $this;
+    }
+
+    /**
+     * Enum value definitions.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.EnumValue enumvalue = 2;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getEnumvalue()
+    {
+        return $this->enumvalue;
+    }
+
+    /**
+     * Enum value definitions.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.EnumValue enumvalue = 2;</code>
+     * @param \Google\Protobuf\EnumValue[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setEnumvalue($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\EnumValue::class);
+        $this->enumvalue = $arr;
+
+        return $this;
+    }
+
+    /**
+     * Protocol buffer options.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Option options = 3;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getOptions()
+    {
+        return $this->options;
+    }
+
+    /**
+     * Protocol buffer options.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Option options = 3;</code>
+     * @param \Google\Protobuf\Option[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setOptions($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class);
+        $this->options = $arr;
+
+        return $this;
+    }
+
+    /**
+     * The source context.
+     *
+     * Generated from protobuf field <code>.google.protobuf.SourceContext source_context = 4;</code>
+     * @return \Google\Protobuf\SourceContext
+     */
+    public function getSourceContext()
+    {
+        return $this->source_context;
+    }
+
+    /**
+     * The source context.
+     *
+     * Generated from protobuf field <code>.google.protobuf.SourceContext source_context = 4;</code>
+     * @param \Google\Protobuf\SourceContext $var
+     * @return $this
+     */
+    public function setSourceContext($var)
+    {
+        GPBUtil::checkMessage($var, \Google\Protobuf\SourceContext::class);
+        $this->source_context = $var;
+
+        return $this;
+    }
+
+    /**
+     * The source syntax.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Syntax syntax = 5;</code>
+     * @return int
+     */
+    public function getSyntax()
+    {
+        return $this->syntax;
+    }
+
+    /**
+     * The source syntax.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Syntax syntax = 5;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setSyntax($var)
+    {
+        GPBUtil::checkEnum($var, \Google\Protobuf\Syntax::class);
+        $this->syntax = $var;
+
+        return $this;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/EnumDescriptor.php b/vendor/google/protobuf/src/Google/Protobuf/EnumDescriptor.php
new file mode 100644
index 0000000..a8b56c0
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/EnumDescriptor.php
@@ -0,0 +1,79 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2017 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf;
+
+class EnumDescriptor
+{
+    private $internal_desc;
+
+    /**
+     * @internal
+     */
+    public function __construct($internal_desc)
+    {
+        $this->internal_desc = $internal_desc;
+    }
+
+    /**
+     * @return string Full protobuf message name
+     */
+    public function getFullName()
+    {
+        return $this->internal_desc->getFullName();
+    }
+
+    /**
+     * @return string PHP class name
+     */
+    public function getClass()
+    {
+        return $this->internal_desc->getClass();
+    }
+
+    /**
+     * @param int $index Must be >= 0 and < getValueCount()
+     * @return EnumValueDescriptor
+     */
+    public function getValue($index)
+    {
+        return $this->internal_desc->getValueDescriptorByIndex($index);
+    }
+
+    /**
+     * @return int Number of values in enum
+     */
+    public function getValueCount()
+    {
+        return $this->internal_desc->getValueCount();
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/EnumValue.php b/vendor/google/protobuf/src/Google/Protobuf/EnumValue.php
new file mode 100644
index 0000000..1dc3c7a
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/EnumValue.php
@@ -0,0 +1,135 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/type.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Enum value definition.
+ *
+ * Generated from protobuf message <code>google.protobuf.EnumValue</code>
+ */
+class EnumValue extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Enum value name.
+     *
+     * Generated from protobuf field <code>string name = 1;</code>
+     */
+    private $name = '';
+    /**
+     * Enum value number.
+     *
+     * Generated from protobuf field <code>int32 number = 2;</code>
+     */
+    private $number = 0;
+    /**
+     * Protocol buffer options.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Option options = 3;</code>
+     */
+    private $options;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type string $name
+     *           Enum value name.
+     *     @type int $number
+     *           Enum value number.
+     *     @type \Google\Protobuf\Option[]|\Google\Protobuf\Internal\RepeatedField $options
+     *           Protocol buffer options.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Type::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Enum value name.
+     *
+     * Generated from protobuf field <code>string name = 1;</code>
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * Enum value name.
+     *
+     * Generated from protobuf field <code>string name = 1;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setName($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->name = $var;
+
+        return $this;
+    }
+
+    /**
+     * Enum value number.
+     *
+     * Generated from protobuf field <code>int32 number = 2;</code>
+     * @return int
+     */
+    public function getNumber()
+    {
+        return $this->number;
+    }
+
+    /**
+     * Enum value number.
+     *
+     * Generated from protobuf field <code>int32 number = 2;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setNumber($var)
+    {
+        GPBUtil::checkInt32($var);
+        $this->number = $var;
+
+        return $this;
+    }
+
+    /**
+     * Protocol buffer options.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Option options = 3;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getOptions()
+    {
+        return $this->options;
+    }
+
+    /**
+     * Protocol buffer options.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Option options = 3;</code>
+     * @param \Google\Protobuf\Option[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setOptions($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class);
+        $this->options = $arr;
+
+        return $this;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/EnumValueDescriptor.php b/vendor/google/protobuf/src/Google/Protobuf/EnumValueDescriptor.php
new file mode 100644
index 0000000..e76e199
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/EnumValueDescriptor.php
@@ -0,0 +1,64 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf;
+
+class EnumValueDescriptor
+{
+    private $name;
+    private $number;
+
+    /**
+     * @internal
+     */
+    public function __construct($name, $number)
+    {
+        $this->name = $name;
+        $this->number = $number;
+    }
+
+    /**
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * @return int
+     */
+    public function getNumber()
+    {
+        return $this->number;
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Field.php b/vendor/google/protobuf/src/Google/Protobuf/Field.php
new file mode 100644
index 0000000..8da43e3
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Field.php
@@ -0,0 +1,381 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/type.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * A single field of a message type.
+ *
+ * Generated from protobuf message <code>google.protobuf.Field</code>
+ */
+class Field extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * The field type.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Field.Kind kind = 1;</code>
+     */
+    private $kind = 0;
+    /**
+     * The field cardinality.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Field.Cardinality cardinality = 2;</code>
+     */
+    private $cardinality = 0;
+    /**
+     * The field number.
+     *
+     * Generated from protobuf field <code>int32 number = 3;</code>
+     */
+    private $number = 0;
+    /**
+     * The field name.
+     *
+     * Generated from protobuf field <code>string name = 4;</code>
+     */
+    private $name = '';
+    /**
+     * The field type URL, without the scheme, for message or enumeration
+     * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
+     *
+     * Generated from protobuf field <code>string type_url = 6;</code>
+     */
+    private $type_url = '';
+    /**
+     * The index of the field type in `Type.oneofs`, for message or enumeration
+     * types. The first type has index 1; zero means the type is not in the list.
+     *
+     * Generated from protobuf field <code>int32 oneof_index = 7;</code>
+     */
+    private $oneof_index = 0;
+    /**
+     * Whether to use alternative packed wire representation.
+     *
+     * Generated from protobuf field <code>bool packed = 8;</code>
+     */
+    private $packed = false;
+    /**
+     * The protocol buffer options.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Option options = 9;</code>
+     */
+    private $options;
+    /**
+     * The field JSON name.
+     *
+     * Generated from protobuf field <code>string json_name = 10;</code>
+     */
+    private $json_name = '';
+    /**
+     * The string value of the default value of this field. Proto2 syntax only.
+     *
+     * Generated from protobuf field <code>string default_value = 11;</code>
+     */
+    private $default_value = '';
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type int $kind
+     *           The field type.
+     *     @type int $cardinality
+     *           The field cardinality.
+     *     @type int $number
+     *           The field number.
+     *     @type string $name
+     *           The field name.
+     *     @type string $type_url
+     *           The field type URL, without the scheme, for message or enumeration
+     *           types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
+     *     @type int $oneof_index
+     *           The index of the field type in `Type.oneofs`, for message or enumeration
+     *           types. The first type has index 1; zero means the type is not in the list.
+     *     @type bool $packed
+     *           Whether to use alternative packed wire representation.
+     *     @type \Google\Protobuf\Option[]|\Google\Protobuf\Internal\RepeatedField $options
+     *           The protocol buffer options.
+     *     @type string $json_name
+     *           The field JSON name.
+     *     @type string $default_value
+     *           The string value of the default value of this field. Proto2 syntax only.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Type::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * The field type.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Field.Kind kind = 1;</code>
+     * @return int
+     */
+    public function getKind()
+    {
+        return $this->kind;
+    }
+
+    /**
+     * The field type.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Field.Kind kind = 1;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setKind($var)
+    {
+        GPBUtil::checkEnum($var, \Google\Protobuf\Field_Kind::class);
+        $this->kind = $var;
+
+        return $this;
+    }
+
+    /**
+     * The field cardinality.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Field.Cardinality cardinality = 2;</code>
+     * @return int
+     */
+    public function getCardinality()
+    {
+        return $this->cardinality;
+    }
+
+    /**
+     * The field cardinality.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Field.Cardinality cardinality = 2;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setCardinality($var)
+    {
+        GPBUtil::checkEnum($var, \Google\Protobuf\Field_Cardinality::class);
+        $this->cardinality = $var;
+
+        return $this;
+    }
+
+    /**
+     * The field number.
+     *
+     * Generated from protobuf field <code>int32 number = 3;</code>
+     * @return int
+     */
+    public function getNumber()
+    {
+        return $this->number;
+    }
+
+    /**
+     * The field number.
+     *
+     * Generated from protobuf field <code>int32 number = 3;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setNumber($var)
+    {
+        GPBUtil::checkInt32($var);
+        $this->number = $var;
+
+        return $this;
+    }
+
+    /**
+     * The field name.
+     *
+     * Generated from protobuf field <code>string name = 4;</code>
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * The field name.
+     *
+     * Generated from protobuf field <code>string name = 4;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setName($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->name = $var;
+
+        return $this;
+    }
+
+    /**
+     * The field type URL, without the scheme, for message or enumeration
+     * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
+     *
+     * Generated from protobuf field <code>string type_url = 6;</code>
+     * @return string
+     */
+    public function getTypeUrl()
+    {
+        return $this->type_url;
+    }
+
+    /**
+     * The field type URL, without the scheme, for message or enumeration
+     * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
+     *
+     * Generated from protobuf field <code>string type_url = 6;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setTypeUrl($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->type_url = $var;
+
+        return $this;
+    }
+
+    /**
+     * The index of the field type in `Type.oneofs`, for message or enumeration
+     * types. The first type has index 1; zero means the type is not in the list.
+     *
+     * Generated from protobuf field <code>int32 oneof_index = 7;</code>
+     * @return int
+     */
+    public function getOneofIndex()
+    {
+        return $this->oneof_index;
+    }
+
+    /**
+     * The index of the field type in `Type.oneofs`, for message or enumeration
+     * types. The first type has index 1; zero means the type is not in the list.
+     *
+     * Generated from protobuf field <code>int32 oneof_index = 7;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setOneofIndex($var)
+    {
+        GPBUtil::checkInt32($var);
+        $this->oneof_index = $var;
+
+        return $this;
+    }
+
+    /**
+     * Whether to use alternative packed wire representation.
+     *
+     * Generated from protobuf field <code>bool packed = 8;</code>
+     * @return bool
+     */
+    public function getPacked()
+    {
+        return $this->packed;
+    }
+
+    /**
+     * Whether to use alternative packed wire representation.
+     *
+     * Generated from protobuf field <code>bool packed = 8;</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setPacked($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->packed = $var;
+
+        return $this;
+    }
+
+    /**
+     * The protocol buffer options.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Option options = 9;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getOptions()
+    {
+        return $this->options;
+    }
+
+    /**
+     * The protocol buffer options.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Option options = 9;</code>
+     * @param \Google\Protobuf\Option[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setOptions($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class);
+        $this->options = $arr;
+
+        return $this;
+    }
+
+    /**
+     * The field JSON name.
+     *
+     * Generated from protobuf field <code>string json_name = 10;</code>
+     * @return string
+     */
+    public function getJsonName()
+    {
+        return $this->json_name;
+    }
+
+    /**
+     * The field JSON name.
+     *
+     * Generated from protobuf field <code>string json_name = 10;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setJsonName($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->json_name = $var;
+
+        return $this;
+    }
+
+    /**
+     * The string value of the default value of this field. Proto2 syntax only.
+     *
+     * Generated from protobuf field <code>string default_value = 11;</code>
+     * @return string
+     */
+    public function getDefaultValue()
+    {
+        return $this->default_value;
+    }
+
+    /**
+     * The string value of the default value of this field. Proto2 syntax only.
+     *
+     * Generated from protobuf field <code>string default_value = 11;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setDefaultValue($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->default_value = $var;
+
+        return $this;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Field/Cardinality.php b/vendor/google/protobuf/src/Google/Protobuf/Field/Cardinality.php
new file mode 100644
index 0000000..479dc0b
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Field/Cardinality.php
@@ -0,0 +1,70 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/type.proto
+
+namespace Google\Protobuf\Field;
+
+use UnexpectedValueException;
+
+/**
+ * Whether a field is optional, required, or repeated.
+ *
+ * Protobuf type <code>google.protobuf.Field.Cardinality</code>
+ */
+class Cardinality
+{
+    /**
+     * For fields with unknown cardinality.
+     *
+     * Generated from protobuf enum <code>CARDINALITY_UNKNOWN = 0;</code>
+     */
+    const CARDINALITY_UNKNOWN = 0;
+    /**
+     * For optional fields.
+     *
+     * Generated from protobuf enum <code>CARDINALITY_OPTIONAL = 1;</code>
+     */
+    const CARDINALITY_OPTIONAL = 1;
+    /**
+     * For required fields. Proto2 syntax only.
+     *
+     * Generated from protobuf enum <code>CARDINALITY_REQUIRED = 2;</code>
+     */
+    const CARDINALITY_REQUIRED = 2;
+    /**
+     * For repeated fields.
+     *
+     * Generated from protobuf enum <code>CARDINALITY_REPEATED = 3;</code>
+     */
+    const CARDINALITY_REPEATED = 3;
+
+    private static $valueToName = [
+        self::CARDINALITY_UNKNOWN => 'CARDINALITY_UNKNOWN',
+        self::CARDINALITY_OPTIONAL => 'CARDINALITY_OPTIONAL',
+        self::CARDINALITY_REQUIRED => 'CARDINALITY_REQUIRED',
+        self::CARDINALITY_REPEATED => 'CARDINALITY_REPEATED',
+    ];
+
+    public static function name($value)
+    {
+        if (!isset(self::$valueToName[$value])) {
+            throw new UnexpectedValueException(sprintf(
+                    'Enum %s has no name defined for value %s', __CLASS__, $value));
+        }
+        return self::$valueToName[$value];
+    }
+
+    public static function value($name)
+    {
+        $const = __CLASS__ . '::' . strtoupper($name);
+        if (!defined($const)) {
+            throw new UnexpectedValueException(sprintf(
+                    'Enum %s has no value defined for name %s', __CLASS__, $name));
+        }
+        return constant($const);
+    }
+}
+
+// Adding a class alias for backwards compatibility with the previous class name.
+class_alias(Cardinality::class, \Google\Protobuf\Field_Cardinality::class);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Field/Kind.php b/vendor/google/protobuf/src/Google/Protobuf/Field/Kind.php
new file mode 100644
index 0000000..f30bd2f
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Field/Kind.php
@@ -0,0 +1,175 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/type.proto
+
+namespace Google\Protobuf\Field;
+
+use UnexpectedValueException;
+
+/**
+ * Basic field types.
+ *
+ * Protobuf type <code>google.protobuf.Field.Kind</code>
+ */
+class Kind
+{
+    /**
+     * Field type unknown.
+     *
+     * Generated from protobuf enum <code>TYPE_UNKNOWN = 0;</code>
+     */
+    const TYPE_UNKNOWN = 0;
+    /**
+     * Field type double.
+     *
+     * Generated from protobuf enum <code>TYPE_DOUBLE = 1;</code>
+     */
+    const TYPE_DOUBLE = 1;
+    /**
+     * Field type float.
+     *
+     * Generated from protobuf enum <code>TYPE_FLOAT = 2;</code>
+     */
+    const TYPE_FLOAT = 2;
+    /**
+     * Field type int64.
+     *
+     * Generated from protobuf enum <code>TYPE_INT64 = 3;</code>
+     */
+    const TYPE_INT64 = 3;
+    /**
+     * Field type uint64.
+     *
+     * Generated from protobuf enum <code>TYPE_UINT64 = 4;</code>
+     */
+    const TYPE_UINT64 = 4;
+    /**
+     * Field type int32.
+     *
+     * Generated from protobuf enum <code>TYPE_INT32 = 5;</code>
+     */
+    const TYPE_INT32 = 5;
+    /**
+     * Field type fixed64.
+     *
+     * Generated from protobuf enum <code>TYPE_FIXED64 = 6;</code>
+     */
+    const TYPE_FIXED64 = 6;
+    /**
+     * Field type fixed32.
+     *
+     * Generated from protobuf enum <code>TYPE_FIXED32 = 7;</code>
+     */
+    const TYPE_FIXED32 = 7;
+    /**
+     * Field type bool.
+     *
+     * Generated from protobuf enum <code>TYPE_BOOL = 8;</code>
+     */
+    const TYPE_BOOL = 8;
+    /**
+     * Field type string.
+     *
+     * Generated from protobuf enum <code>TYPE_STRING = 9;</code>
+     */
+    const TYPE_STRING = 9;
+    /**
+     * Field type group. Proto2 syntax only, and deprecated.
+     *
+     * Generated from protobuf enum <code>TYPE_GROUP = 10;</code>
+     */
+    const TYPE_GROUP = 10;
+    /**
+     * Field type message.
+     *
+     * Generated from protobuf enum <code>TYPE_MESSAGE = 11;</code>
+     */
+    const TYPE_MESSAGE = 11;
+    /**
+     * Field type bytes.
+     *
+     * Generated from protobuf enum <code>TYPE_BYTES = 12;</code>
+     */
+    const TYPE_BYTES = 12;
+    /**
+     * Field type uint32.
+     *
+     * Generated from protobuf enum <code>TYPE_UINT32 = 13;</code>
+     */
+    const TYPE_UINT32 = 13;
+    /**
+     * Field type enum.
+     *
+     * Generated from protobuf enum <code>TYPE_ENUM = 14;</code>
+     */
+    const TYPE_ENUM = 14;
+    /**
+     * Field type sfixed32.
+     *
+     * Generated from protobuf enum <code>TYPE_SFIXED32 = 15;</code>
+     */
+    const TYPE_SFIXED32 = 15;
+    /**
+     * Field type sfixed64.
+     *
+     * Generated from protobuf enum <code>TYPE_SFIXED64 = 16;</code>
+     */
+    const TYPE_SFIXED64 = 16;
+    /**
+     * Field type sint32.
+     *
+     * Generated from protobuf enum <code>TYPE_SINT32 = 17;</code>
+     */
+    const TYPE_SINT32 = 17;
+    /**
+     * Field type sint64.
+     *
+     * Generated from protobuf enum <code>TYPE_SINT64 = 18;</code>
+     */
+    const TYPE_SINT64 = 18;
+
+    private static $valueToName = [
+        self::TYPE_UNKNOWN => 'TYPE_UNKNOWN',
+        self::TYPE_DOUBLE => 'TYPE_DOUBLE',
+        self::TYPE_FLOAT => 'TYPE_FLOAT',
+        self::TYPE_INT64 => 'TYPE_INT64',
+        self::TYPE_UINT64 => 'TYPE_UINT64',
+        self::TYPE_INT32 => 'TYPE_INT32',
+        self::TYPE_FIXED64 => 'TYPE_FIXED64',
+        self::TYPE_FIXED32 => 'TYPE_FIXED32',
+        self::TYPE_BOOL => 'TYPE_BOOL',
+        self::TYPE_STRING => 'TYPE_STRING',
+        self::TYPE_GROUP => 'TYPE_GROUP',
+        self::TYPE_MESSAGE => 'TYPE_MESSAGE',
+        self::TYPE_BYTES => 'TYPE_BYTES',
+        self::TYPE_UINT32 => 'TYPE_UINT32',
+        self::TYPE_ENUM => 'TYPE_ENUM',
+        self::TYPE_SFIXED32 => 'TYPE_SFIXED32',
+        self::TYPE_SFIXED64 => 'TYPE_SFIXED64',
+        self::TYPE_SINT32 => 'TYPE_SINT32',
+        self::TYPE_SINT64 => 'TYPE_SINT64',
+    ];
+
+    public static function name($value)
+    {
+        if (!isset(self::$valueToName[$value])) {
+            throw new UnexpectedValueException(sprintf(
+                    'Enum %s has no name defined for value %s', __CLASS__, $value));
+        }
+        return self::$valueToName[$value];
+    }
+
+    public static function value($name)
+    {
+        $const = __CLASS__ . '::' . strtoupper($name);
+        if (!defined($const)) {
+            throw new UnexpectedValueException(sprintf(
+                    'Enum %s has no value defined for name %s', __CLASS__, $name));
+        }
+        return constant($const);
+    }
+}
+
+// Adding a class alias for backwards compatibility with the previous class name.
+class_alias(Kind::class, \Google\Protobuf\Field_Kind::class);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/FieldDescriptor.php b/vendor/google/protobuf/src/Google/Protobuf/FieldDescriptor.php
new file mode 100644
index 0000000..ac9271f
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/FieldDescriptor.php
@@ -0,0 +1,117 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2017 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GetPublicDescriptorTrait;
+use Google\Protobuf\Internal\GPBType;
+
+class FieldDescriptor
+{
+    use GetPublicDescriptorTrait;
+
+    private $internal_desc;
+
+    /**
+     * @internal
+     */
+    public function __construct($internal_desc)
+    {
+        $this->internal_desc = $internal_desc;
+    }
+
+    /**
+     * @return string Field name
+     */
+    public function getName()
+    {
+        return $this->internal_desc->getName();
+    }
+
+    /**
+     * @return int Protobuf field number
+     */
+    public function getNumber()
+    {
+        return $this->internal_desc->getNumber();
+    }
+
+    /**
+     * @return int
+     */
+    public function getLabel()
+    {
+        return $this->internal_desc->getLabel();
+    }
+
+    /**
+     * @return int
+     */
+    public function getType()
+    {
+        return $this->internal_desc->getType();
+    }
+
+    /**
+     * @return Descriptor Returns a descriptor for the field type if the field type is a message, otherwise throws \Exception
+     * @throws \Exception
+     */
+    public function getMessageType()
+    {
+        if ($this->getType() == GPBType::MESSAGE) {
+            return $this->getPublicDescriptor($this->internal_desc->getMessageType());
+        } else {
+            throw new \Exception("Cannot get message type for non-message field '" . $this->getName() . "'");
+        }
+    }
+
+    /**
+     * @return EnumDescriptor Returns an enum descriptor if the field type is an enum, otherwise throws \Exception
+     * @throws \Exception
+     */
+    public function getEnumType()
+    {
+        if ($this->getType() == GPBType::ENUM) {
+            return $this->getPublicDescriptor($this->internal_desc->getEnumType());
+        } else {
+            throw new \Exception("Cannot get enum type for non-enum field '" . $this->getName() . "'");
+        }
+    }
+
+    /**
+     * @return boolean
+     */
+    public function isMap()
+    {
+        return $this->internal_desc->isMap();
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/FieldMask.php b/vendor/google/protobuf/src/Google/Protobuf/FieldMask.php
new file mode 100644
index 0000000..8fb38cb
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/FieldMask.php
@@ -0,0 +1,223 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/field_mask.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * `FieldMask` represents a set of symbolic field paths, for example:
+ *     paths: "f.a"
+ *     paths: "f.b.d"
+ * Here `f` represents a field in some root message, `a` and `b`
+ * fields in the message found in `f`, and `d` a field found in the
+ * message in `f.b`.
+ * Field masks are used to specify a subset of fields that should be
+ * returned by a get operation or modified by an update operation.
+ * Field masks also have a custom JSON encoding (see below).
+ * # Field Masks in Projections
+ * When used in the context of a projection, a response message or
+ * sub-message is filtered by the API to only contain those fields as
+ * specified in the mask. For example, if the mask in the previous
+ * example is applied to a response message as follows:
+ *     f {
+ *       a : 22
+ *       b {
+ *         d : 1
+ *         x : 2
+ *       }
+ *       y : 13
+ *     }
+ *     z: 8
+ * The result will not contain specific values for fields x,y and z
+ * (their value will be set to the default, and omitted in proto text
+ * output):
+ *     f {
+ *       a : 22
+ *       b {
+ *         d : 1
+ *       }
+ *     }
+ * A repeated field is not allowed except at the last position of a
+ * paths string.
+ * If a FieldMask object is not present in a get operation, the
+ * operation applies to all fields (as if a FieldMask of all fields
+ * had been specified).
+ * Note that a field mask does not necessarily apply to the
+ * top-level response message. In case of a REST get operation, the
+ * field mask applies directly to the response, but in case of a REST
+ * list operation, the mask instead applies to each individual message
+ * in the returned resource list. In case of a REST custom method,
+ * other definitions may be used. Where the mask applies will be
+ * clearly documented together with its declaration in the API.  In
+ * any case, the effect on the returned resource/resources is required
+ * behavior for APIs.
+ * # Field Masks in Update Operations
+ * A field mask in update operations specifies which fields of the
+ * targeted resource are going to be updated. The API is required
+ * to only change the values of the fields as specified in the mask
+ * and leave the others untouched. If a resource is passed in to
+ * describe the updated values, the API ignores the values of all
+ * fields not covered by the mask.
+ * If a repeated field is specified for an update operation, the existing
+ * repeated values in the target resource will be overwritten by the new values.
+ * Note that a repeated field is only allowed in the last position of a `paths`
+ * string.
+ * If a sub-message is specified in the last position of the field mask for an
+ * update operation, then the existing sub-message in the target resource is
+ * overwritten. Given the target message:
+ *     f {
+ *       b {
+ *         d : 1
+ *         x : 2
+ *       }
+ *       c : 1
+ *     }
+ * And an update message:
+ *     f {
+ *       b {
+ *         d : 10
+ *       }
+ *     }
+ * then if the field mask is:
+ *  paths: "f.b"
+ * then the result will be:
+ *     f {
+ *       b {
+ *         d : 10
+ *       }
+ *       c : 1
+ *     }
+ * However, if the update mask was:
+ *  paths: "f.b.d"
+ * then the result would be:
+ *     f {
+ *       b {
+ *         d : 10
+ *         x : 2
+ *       }
+ *       c : 1
+ *     }
+ * In order to reset a field's value to the default, the field must
+ * be in the mask and set to the default value in the provided resource.
+ * Hence, in order to reset all fields of a resource, provide a default
+ * instance of the resource and set all fields in the mask, or do
+ * not provide a mask as described below.
+ * If a field mask is not present on update, the operation applies to
+ * all fields (as if a field mask of all fields has been specified).
+ * Note that in the presence of schema evolution, this may mean that
+ * fields the client does not know and has therefore not filled into
+ * the request will be reset to their default. If this is unwanted
+ * behavior, a specific service may require a client to always specify
+ * a field mask, producing an error if not.
+ * As with get operations, the location of the resource which
+ * describes the updated values in the request message depends on the
+ * operation kind. In any case, the effect of the field mask is
+ * required to be honored by the API.
+ * ## Considerations for HTTP REST
+ * The HTTP kind of an update operation which uses a field mask must
+ * be set to PATCH instead of PUT in order to satisfy HTTP semantics
+ * (PUT must only be used for full updates).
+ * # JSON Encoding of Field Masks
+ * In JSON, a field mask is encoded as a single string where paths are
+ * separated by a comma. Fields name in each path are converted
+ * to/from lower-camel naming conventions.
+ * As an example, consider the following message declarations:
+ *     message Profile {
+ *       User user = 1;
+ *       Photo photo = 2;
+ *     }
+ *     message User {
+ *       string display_name = 1;
+ *       string address = 2;
+ *     }
+ * In proto a field mask for `Profile` may look as such:
+ *     mask {
+ *       paths: "user.display_name"
+ *       paths: "photo"
+ *     }
+ * In JSON, the same mask is represented as below:
+ *     {
+ *       mask: "user.displayName,photo"
+ *     }
+ * # Field Masks and Oneof Fields
+ * Field masks treat fields in oneofs just as regular fields. Consider the
+ * following message:
+ *     message SampleMessage {
+ *       oneof test_oneof {
+ *         string name = 4;
+ *         SubMessage sub_message = 9;
+ *       }
+ *     }
+ * The field mask can be:
+ *     mask {
+ *       paths: "name"
+ *     }
+ * Or:
+ *     mask {
+ *       paths: "sub_message"
+ *     }
+ * Note that oneof type names ("test_oneof" in this case) cannot be used in
+ * paths.
+ * ## Field Mask Verification
+ * The implementation of any API method which has a FieldMask type field in the
+ * request should verify the included field paths, and return an
+ * `INVALID_ARGUMENT` error if any path is duplicated or unmappable.
+ *
+ * Generated from protobuf message <code>google.protobuf.FieldMask</code>
+ */
+class FieldMask extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * The set of field mask paths.
+     *
+     * Generated from protobuf field <code>repeated string paths = 1;</code>
+     */
+    private $paths;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type string[]|\Google\Protobuf\Internal\RepeatedField $paths
+     *           The set of field mask paths.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\FieldMask::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * The set of field mask paths.
+     *
+     * Generated from protobuf field <code>repeated string paths = 1;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getPaths()
+    {
+        return $this->paths;
+    }
+
+    /**
+     * The set of field mask paths.
+     *
+     * Generated from protobuf field <code>repeated string paths = 1;</code>
+     * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setPaths($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
+        $this->paths = $arr;
+
+        return $this;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Field_Cardinality.php b/vendor/google/protobuf/src/Google/Protobuf/Field_Cardinality.php
new file mode 100644
index 0000000..dff8f89
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Field_Cardinality.php
@@ -0,0 +1,16 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/type.proto
+
+namespace Google\Protobuf;
+
+if (false) {
+    /**
+     * This class is deprecated. Use Google\Protobuf\Field\Cardinality instead.
+     * @deprecated
+     */
+    class Field_Cardinality {}
+}
+class_exists(Field\Cardinality::class);
+@trigger_error('Google\Protobuf\Field_Cardinality is deprecated and will be removed in the next major release. Use Google\Protobuf\Field\Cardinality instead', E_USER_DEPRECATED);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Field_Kind.php b/vendor/google/protobuf/src/Google/Protobuf/Field_Kind.php
new file mode 100644
index 0000000..aa20237
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Field_Kind.php
@@ -0,0 +1,16 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/type.proto
+
+namespace Google\Protobuf;
+
+if (false) {
+    /**
+     * This class is deprecated. Use Google\Protobuf\Field\Kind instead.
+     * @deprecated
+     */
+    class Field_Kind {}
+}
+class_exists(Field\Kind::class);
+@trigger_error('Google\Protobuf\Field_Kind is deprecated and will be removed in the next major release. Use Google\Protobuf\Field\Kind instead', E_USER_DEPRECATED);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/FloatValue.php b/vendor/google/protobuf/src/Google/Protobuf/FloatValue.php
new file mode 100644
index 0000000..47ba52e
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/FloatValue.php
@@ -0,0 +1,68 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/wrappers.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Wrapper message for `float`.
+ * The JSON representation for `FloatValue` is JSON number.
+ *
+ * Generated from protobuf message <code>google.protobuf.FloatValue</code>
+ */
+class FloatValue extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * The float value.
+     *
+     * Generated from protobuf field <code>float value = 1;</code>
+     */
+    private $value = 0.0;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type float $value
+     *           The float value.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Wrappers::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * The float value.
+     *
+     * Generated from protobuf field <code>float value = 1;</code>
+     * @return float
+     */
+    public function getValue()
+    {
+        return $this->value;
+    }
+
+    /**
+     * The float value.
+     *
+     * Generated from protobuf field <code>float value = 1;</code>
+     * @param float $var
+     * @return $this
+     */
+    public function setValue($var)
+    {
+        GPBUtil::checkFloat($var);
+        $this->value = $var;
+
+        return $this;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/GPBEmpty.php b/vendor/google/protobuf/src/Google/Protobuf/GPBEmpty.php
new file mode 100644
index 0000000..2de9c3b
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/GPBEmpty.php
@@ -0,0 +1,39 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/empty.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * A generic empty message that you can re-use to avoid defining duplicated
+ * empty messages in your APIs. A typical example is to use it as the request
+ * or the response type of an API method. For instance:
+ *     service Foo {
+ *       rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
+ *     }
+ * The JSON representation for `Empty` is empty JSON object `{}`.
+ *
+ * Generated from protobuf message <code>google.protobuf.Empty</code>
+ */
+class GPBEmpty extends \Google\Protobuf\Internal\Message
+{
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\GPBEmpty::initOnce();
+        parent::__construct($data);
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Int32Value.php b/vendor/google/protobuf/src/Google/Protobuf/Int32Value.php
new file mode 100644
index 0000000..d7fd528
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Int32Value.php
@@ -0,0 +1,68 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/wrappers.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Wrapper message for `int32`.
+ * The JSON representation for `Int32Value` is JSON number.
+ *
+ * Generated from protobuf message <code>google.protobuf.Int32Value</code>
+ */
+class Int32Value extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * The int32 value.
+     *
+     * Generated from protobuf field <code>int32 value = 1;</code>
+     */
+    private $value = 0;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type int $value
+     *           The int32 value.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Wrappers::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * The int32 value.
+     *
+     * Generated from protobuf field <code>int32 value = 1;</code>
+     * @return int
+     */
+    public function getValue()
+    {
+        return $this->value;
+    }
+
+    /**
+     * The int32 value.
+     *
+     * Generated from protobuf field <code>int32 value = 1;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setValue($var)
+    {
+        GPBUtil::checkInt32($var);
+        $this->value = $var;
+
+        return $this;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Int64Value.php b/vendor/google/protobuf/src/Google/Protobuf/Int64Value.php
new file mode 100644
index 0000000..ca66305
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Int64Value.php
@@ -0,0 +1,68 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/wrappers.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Wrapper message for `int64`.
+ * The JSON representation for `Int64Value` is JSON string.
+ *
+ * Generated from protobuf message <code>google.protobuf.Int64Value</code>
+ */
+class Int64Value extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * The int64 value.
+     *
+     * Generated from protobuf field <code>int64 value = 1;</code>
+     */
+    private $value = 0;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type int|string $value
+     *           The int64 value.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Wrappers::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * The int64 value.
+     *
+     * Generated from protobuf field <code>int64 value = 1;</code>
+     * @return int|string
+     */
+    public function getValue()
+    {
+        return $this->value;
+    }
+
+    /**
+     * The int64 value.
+     *
+     * Generated from protobuf field <code>int64 value = 1;</code>
+     * @param int|string $var
+     * @return $this
+     */
+    public function setValue($var)
+    {
+        GPBUtil::checkInt64($var);
+        $this->value = $var;
+
+        return $this;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/CodedInputStream.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/CodedInputStream.php
new file mode 100644
index 0000000..33b1f5a
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/CodedInputStream.php
@@ -0,0 +1,382 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\Uint64;
+
+class CodedInputStream
+{
+
+    private $buffer;
+    private $buffer_size_after_limit;
+    private $buffer_end;
+    private $current;
+    private $current_limit;
+    private $legitimate_message_end;
+    private $recursion_budget;
+    private $recursion_limit;
+    private $total_bytes_limit;
+    private $total_bytes_read;
+
+    const MAX_VARINT_BYTES = 10;
+    const DEFAULT_RECURSION_LIMIT = 100;
+    const DEFAULT_TOTAL_BYTES_LIMIT = 33554432; // 32 << 20, 32MB
+
+    public function __construct($buffer)
+    {
+        $start = 0;
+        $end = strlen($buffer);
+        $this->buffer = $buffer;
+        $this->buffer_size_after_limit = 0;
+        $this->buffer_end = $end;
+        $this->current = $start;
+        $this->current_limit = $end;
+        $this->legitimate_message_end = false;
+        $this->recursion_budget = self::DEFAULT_RECURSION_LIMIT;
+        $this->recursion_limit = self::DEFAULT_RECURSION_LIMIT;
+        $this->total_bytes_limit = self::DEFAULT_TOTAL_BYTES_LIMIT;
+        $this->total_bytes_read = $end - $start;
+    }
+
+    private function advance($amount)
+    {
+        $this->current += $amount;
+    }
+
+    public function bufferSize()
+    {
+        return $this->buffer_end - $this->current;
+    }
+
+    public function current()
+    {
+        return $this->total_bytes_read -
+            ($this->buffer_end - $this->current +
+            $this->buffer_size_after_limit);
+    }
+
+    public function substr($start, $end)
+    {
+        return substr($this->buffer, $start, $end - $start);
+    }
+
+    private function recomputeBufferLimits()
+    {
+        $this->buffer_end += $this->buffer_size_after_limit;
+        $closest_limit = min($this->current_limit, $this->total_bytes_limit);
+        if ($closest_limit < $this->total_bytes_read) {
+            // The limit position is in the current buffer.  We must adjust the
+            // buffer size accordingly.
+            $this->buffer_size_after_limit = $this->total_bytes_read -
+                $closest_limit;
+            $this->buffer_end -= $this->buffer_size_after_limit;
+        } else {
+            $this->buffer_size_after_limit = 0;
+        }
+    }
+
+    private function consumedEntireMessage()
+    {
+        return $this->legitimate_message_end;
+    }
+
+    /**
+     * Read uint32 into $var. Advance buffer with consumed bytes. If the
+     * contained varint is larger than 32 bits, discard the high order bits.
+     * @param $var.
+     */
+    public function readVarint32(&$var)
+    {
+        if (!$this->readVarint64($var)) {
+            return false;
+        }
+
+        if (PHP_INT_SIZE == 4) {
+            $var = bcmod($var, 4294967296);
+        } else {
+            $var &= 0xFFFFFFFF;
+        }
+
+        // Convert large uint32 to int32.
+        if ($var > 0x7FFFFFFF) {
+            if (PHP_INT_SIZE === 8) {
+                $var = $var | (0xFFFFFFFF << 32);
+            } else {
+                $var = bcsub($var, 4294967296);
+            }
+        }
+
+        $var = intval($var);
+        return true;
+    }
+
+    /**
+     * Read Uint64 into $var. Advance buffer with consumed bytes.
+     * @param $var.
+     */
+    public function readVarint64(&$var)
+    {
+        $count = 0;
+
+        if (PHP_INT_SIZE == 4) {
+            $high = 0;
+            $low = 0;
+            $b = 0;
+
+            do {
+                if ($this->current === $this->buffer_end) {
+                    return false;
+                }
+                if ($count === self::MAX_VARINT_BYTES) {
+                    return false;
+                }
+                $b = ord($this->buffer[$this->current]);
+                $bits = 7 * $count;
+                if ($bits >= 32) {
+                    $high |= (($b & 0x7F) << ($bits - 32));
+                } else if ($bits > 25){
+                    // $bits is 28 in this case.
+                    $low |= (($b & 0x7F) << 28);
+                    $high = ($b & 0x7F) >> 4;
+                } else {
+                    $low |= (($b & 0x7F) << $bits);
+                }
+
+                $this->advance(1);
+                $count += 1;
+            } while ($b & 0x80);
+
+            $var = GPBUtil::combineInt32ToInt64($high, $low);
+            if (bccomp($var, 0) < 0) {
+                $var = bcadd($var, "18446744073709551616");
+            }
+        } else {
+            $result = 0;
+            $shift = 0;
+
+            do {
+                if ($this->current === $this->buffer_end) {
+                    return false;
+                }
+                if ($count === self::MAX_VARINT_BYTES) {
+                    return false;
+                }
+
+                $byte = ord($this->buffer[$this->current]);
+                $result |= ($byte & 0x7f) << $shift;
+                $shift += 7;
+                $this->advance(1);
+                $count += 1;
+            } while ($byte > 0x7f);
+
+            $var = $result;
+        }
+
+        return true;
+    }
+
+    /**
+     * Read int into $var. If the result is larger than the largest integer, $var
+     * will be -1. Advance buffer with consumed bytes.
+     * @param $var.
+     */
+    public function readVarintSizeAsInt(&$var)
+    {
+        if (!$this->readVarint64($var)) {
+            return false;
+        }
+        $var = (int)$var;
+        return true;
+    }
+
+    /**
+     * Read 32-bit unsiged integer to $var. If the buffer has less than 4 bytes,
+     * return false. Advance buffer with consumed bytes.
+     * @param $var.
+     */
+    public function readLittleEndian32(&$var)
+    {
+        $data = null;
+        if (!$this->readRaw(4, $data)) {
+            return false;
+        }
+        $var = unpack('V', $data);
+        $var = $var[1];
+        return true;
+    }
+
+    /**
+     * Read 64-bit unsiged integer to $var. If the buffer has less than 8 bytes,
+     * return false. Advance buffer with consumed bytes.
+     * @param $var.
+     */
+    public function readLittleEndian64(&$var)
+    {
+        $data = null;
+        if (!$this->readRaw(4, $data)) {
+            return false;
+        }
+        $low = unpack('V', $data)[1];
+        if (!$this->readRaw(4, $data)) {
+            return false;
+        }
+        $high = unpack('V', $data)[1];
+        if (PHP_INT_SIZE == 4) {
+            $var = GPBUtil::combineInt32ToInt64($high, $low);
+        } else {
+            $var = ($high << 32) | $low;
+        }
+        return true;
+    }
+
+    /**
+     * Read tag into $var. Advance buffer with consumed bytes.
+     * @param $var.
+     */
+    public function readTag()
+    {
+        if ($this->current === $this->buffer_end) {
+            // Make sure that it failed due to EOF, not because we hit
+            // total_bytes_limit, which, unlike normal limits, is not a valid
+            // place to end a message.
+            $current_position = $this->total_bytes_read -
+                $this->buffer_size_after_limit;
+            if ($current_position >= $this->total_bytes_limit) {
+                // Hit total_bytes_limit_.  But if we also hit the normal limit,
+                // we're still OK.
+                $this->legitimate_message_end =
+                    ($this->current_limit === $this->total_bytes_limit);
+            } else {
+                $this->legitimate_message_end = true;
+            }
+            return 0;
+        }
+
+        $result = 0;
+        // The larget tag is 2^29 - 1, which can be represented by int32.
+        $success = $this->readVarint32($result);
+        if ($success) {
+            return $result;
+        } else {
+            return 0;
+        }
+    }
+
+    public function readRaw($size, &$buffer)
+    {
+        $current_buffer_size = 0;
+        if ($this->bufferSize() < $size) {
+            return false;
+        }
+
+        if ($size === 0) {
+          $buffer = "";
+        } else {
+          $buffer = substr($this->buffer, $this->current, $size);
+          $this->advance($size);
+        }
+
+        return true;
+    }
+
+    /* Places a limit on the number of bytes that the stream may read, starting
+     * from the current position.  Once the stream hits this limit, it will act
+     * like the end of the input has been reached until popLimit() is called.
+     *
+     * As the names imply, the stream conceptually has a stack of limits.  The
+     * shortest limit on the stack is always enforced, even if it is not the top
+     * limit.
+     *
+     * The value returned by pushLimit() is opaque to the caller, and must be
+     * passed unchanged to the corresponding call to popLimit().
+     *
+     * @param integer $byte_limit
+     * @throws \Exception Fail to push limit.
+     */
+    public function pushLimit($byte_limit)
+    {
+        // Current position relative to the beginning of the stream.
+        $current_position = $this->current();
+        $old_limit = $this->current_limit;
+
+        // security: byte_limit is possibly evil, so check for negative values
+        // and overflow.
+        if ($byte_limit >= 0 &&
+            $byte_limit <= PHP_INT_MAX - $current_position &&
+            $byte_limit <= $this->current_limit - $current_position) {
+            $this->current_limit = $current_position + $byte_limit;
+            $this->recomputeBufferLimits();
+        } else {
+            throw new GPBDecodeException("Fail to push limit.");
+        }
+
+        return $old_limit;
+    }
+
+    /* The limit passed in is actually the *old* limit, which we returned from
+     * PushLimit().
+     *
+     * @param integer $byte_limit
+     */
+    public function popLimit($byte_limit)
+    {
+        $this->current_limit = $byte_limit;
+        $this->recomputeBufferLimits();
+        // We may no longer be at a legitimate message end.  ReadTag() needs to
+        // be called again to find out.
+        $this->legitimate_message_end = false;
+    }
+
+    public function incrementRecursionDepthAndPushLimit(
+        $byte_limit, &$old_limit, &$recursion_budget)
+    {
+        $old_limit = $this->pushLimit($byte_limit);
+        $recursion_limit = --$this->recursion_limit;
+    }
+
+    public function decrementRecursionDepthAndPopLimit($byte_limit)
+    {
+        $result = $this->consumedEntireMessage();
+        $this->popLimit($byte_limit);
+        ++$this->recursion_budget;
+        return $result;
+    }
+
+    public function bytesUntilLimit()
+    {
+        if ($this->current_limit === PHP_INT_MAX) {
+            return -1;
+        }
+        return $this->current_limit - $this->current;
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/CodedOutputStream.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/CodedOutputStream.php
new file mode 100644
index 0000000..f75e9c6
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/CodedOutputStream.php
@@ -0,0 +1,159 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf\Internal;
+
+class CodedOutputStream
+{
+
+    private $buffer;
+    private $buffer_size;
+    private $current;
+
+    const MAX_VARINT64_BYTES = 10;
+
+    public function __construct($size)
+    {
+        $this->current = 0;
+        $this->buffer_size = $size;
+        $this->buffer = str_repeat(chr(0), $this->buffer_size);
+    }
+
+    public function getData()
+    {
+        return $this->buffer;
+    }
+
+    public function writeVarint32($value, $trim)
+    {
+        $bytes = str_repeat(chr(0), self::MAX_VARINT64_BYTES);
+        $size = self::writeVarintToArray($value, $bytes, $trim);
+        return $this->writeRaw($bytes, $size);
+    }
+
+    public function writeVarint64($value)
+    {
+        $bytes = str_repeat(chr(0), self::MAX_VARINT64_BYTES);
+        $size = self::writeVarintToArray($value, $bytes);
+        return $this->writeRaw($bytes, $size);
+    }
+
+    public function writeLittleEndian32($value)
+    {
+        $bytes = str_repeat(chr(0), 4);
+        $size = self::writeLittleEndian32ToArray($value, $bytes);
+        return $this->writeRaw($bytes, $size);
+    }
+
+    public function writeLittleEndian64($value)
+    {
+        $bytes = str_repeat(chr(0), 8);
+        $size = self::writeLittleEndian64ToArray($value, $bytes);
+        return $this->writeRaw($bytes, $size);
+    }
+
+    public function writeTag($tag)
+    {
+        return $this->writeVarint32($tag, true);
+    }
+
+    public function writeRaw($data, $size)
+    {
+        if ($this->buffer_size < $size) {
+            trigger_error("Output stream doesn't have enough buffer.");
+            return false;
+        }
+
+        for ($i = 0; $i < $size; $i++) {
+            $this->buffer[$this->current] = $data[$i];
+            $this->current++;
+            $this->buffer_size--;
+        }
+        return true;
+    }
+
+    public static function writeVarintToArray($value, &$buffer, $trim = false)
+    {
+        $current = 0;
+
+        $high = 0;
+        $low = 0;
+        if (PHP_INT_SIZE == 4) {
+            GPBUtil::divideInt64ToInt32($value, $high, $low, $trim);
+        } else {
+            $low = $value;
+        }
+
+        while (($low >= 0x80 || $low < 0) || $high != 0) {
+            $buffer[$current] = chr($low | 0x80);
+            $value = ($value >> 7) & ~(0x7F << ((PHP_INT_SIZE << 3) - 7));
+            $carry = ($high & 0x7F) << ((PHP_INT_SIZE << 3) - 7);
+            $high = ($high >> 7) & ~(0x7F << ((PHP_INT_SIZE << 3) - 7));
+            $low = (($low >> 7) & ~(0x7F << ((PHP_INT_SIZE << 3) - 7)) | $carry);
+            $current++;
+        }
+        $buffer[$current] = chr($low);
+        return $current + 1;
+    }
+
+    private static function writeLittleEndian32ToArray($value, &$buffer)
+    {
+        $buffer[0] = chr($value & 0x000000FF);
+        $buffer[1] = chr(($value >> 8) & 0x000000FF);
+        $buffer[2] = chr(($value >> 16) & 0x000000FF);
+        $buffer[3] = chr(($value >> 24) & 0x000000FF);
+        return 4;
+    }
+
+    private static function writeLittleEndian64ToArray($value, &$buffer)
+    {
+        $high = 0;
+        $low = 0;
+        if (PHP_INT_SIZE == 4) {
+            GPBUtil::divideInt64ToInt32($value, $high, $low);
+        } else {
+            $low = $value & 0xFFFFFFFF;
+            $high = ($value >> 32) & 0xFFFFFFFF;
+        }
+
+        $buffer[0] = chr($low & 0x000000FF);
+        $buffer[1] = chr(($low >> 8) & 0x000000FF);
+        $buffer[2] = chr(($low >> 16) & 0x000000FF);
+        $buffer[3] = chr(($low >> 24) & 0x000000FF);
+        $buffer[4] = chr($high & 0x000000FF);
+        $buffer[5] = chr(($high >> 8) & 0x000000FF);
+        $buffer[6] = chr(($high >> 16) & 0x000000FF);
+        $buffer[7] = chr(($high >> 24) & 0x000000FF);
+        return 8;
+    }
+
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/Descriptor.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/Descriptor.php
new file mode 100644
index 0000000..21ac5de
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/Descriptor.php
@@ -0,0 +1,222 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf\Internal;
+
+class Descriptor
+{
+    use HasPublicDescriptorTrait;
+
+    private $full_name;
+    private $field = [];
+    private $json_to_field = [];
+    private $name_to_field = [];
+    private $index_to_field = [];
+    private $nested_type = [];
+    private $enum_type = [];
+    private $klass;
+    private $legacy_klass;
+    private $options;
+    private $oneof_decl = [];
+
+    public function __construct()
+    {
+        $this->public_desc = new \Google\Protobuf\Descriptor($this);
+    }
+
+    public function addOneofDecl($oneof)
+    {
+        $this->oneof_decl[] = $oneof;
+    }
+
+    public function getOneofDecl()
+    {
+        return $this->oneof_decl;
+    }
+
+    public function setFullName($full_name)
+    {
+        $this->full_name = $full_name;
+    }
+
+    public function getFullName()
+    {
+        return $this->full_name;
+    }
+
+    public function addField($field)
+    {
+        $this->field[$field->getNumber()] = $field;
+        $this->json_to_field[$field->getJsonName()] = $field;
+        $this->name_to_field[$field->getName()] = $field;
+        $this->index_to_field[] = $field;
+    }
+
+    public function getField()
+    {
+        return $this->field;
+    }
+
+    public function addNestedType($desc)
+    {
+        $this->nested_type[] = $desc;
+    }
+
+    public function getNestedType()
+    {
+        return $this->nested_type;
+    }
+
+    public function addEnumType($desc)
+    {
+        $this->enum_type[] = $desc;
+    }
+
+    public function getEnumType()
+    {
+        return $this->enum_type;
+    }
+
+    public function getFieldByNumber($number)
+    {
+        if (!isset($this->field[$number])) {
+          return NULL;
+        } else {
+          return $this->field[$number];
+        }
+    }
+
+    public function getFieldByJsonName($json_name)
+    {
+        if (!isset($this->json_to_field[$json_name])) {
+          return NULL;
+        } else {
+          return $this->json_to_field[$json_name];
+        }
+    }
+
+    public function getFieldByName($name)
+    {
+        if (!isset($this->name_to_field[$name])) {
+          return NULL;
+        } else {
+          return $this->name_to_field[$name];
+        }
+    }
+
+    public function getFieldByIndex($index)
+    {
+        if (count($this->index_to_field) <= $index) {
+            return NULL;
+        } else {
+            return $this->index_to_field[$index];
+        }
+    }
+
+    public function setClass($klass)
+    {
+        $this->klass = $klass;
+    }
+
+    public function getClass()
+    {
+        return $this->klass;
+    }
+
+    public function setLegacyClass($klass)
+    {
+        $this->legacy_klass = $klass;
+    }
+
+    public function getLegacyClass()
+    {
+        return $this->legacy_klass;
+    }
+
+    public function setOptions($options)
+    {
+        $this->options = $options;
+    }
+
+    public function getOptions()
+    {
+        return $this->options;
+    }
+
+    public static function buildFromProto($proto, $file_proto, $containing)
+    {
+        $desc = new Descriptor();
+
+        $message_name_without_package  = "";
+        $classname = "";
+        $legacy_classname = "";
+        $fullname = "";
+        GPBUtil::getFullClassName(
+            $proto,
+            $containing,
+            $file_proto,
+            $message_name_without_package,
+            $legacy_classname,
+            $classname,
+            $fullname);
+        $desc->setFullName($fullname);
+        $desc->setClass($classname);
+        $desc->setLegacyClass($legacy_classname);
+        $desc->setOptions($proto->getOptions());
+
+        foreach ($proto->getField() as $field_proto) {
+            $desc->addField(FieldDescriptor::buildFromProto($field_proto));
+        }
+
+        // Handle nested types.
+        foreach ($proto->getNestedType() as $nested_proto) {
+            $desc->addNestedType(Descriptor::buildFromProto(
+              $nested_proto, $file_proto, $message_name_without_package));
+        }
+
+        // Handle nested enum.
+        foreach ($proto->getEnumType() as $enum_proto) {
+            $desc->addEnumType(EnumDescriptor::buildFromProto(
+              $enum_proto, $file_proto, $message_name_without_package));
+        }
+
+        // Handle oneof fields.
+        $index = 0;
+        foreach ($proto->getOneofDecl() as $oneof_proto) {
+            $desc->addOneofDecl(
+                OneofDescriptor::buildFromProto($oneof_proto, $desc, $index));
+            $index++;
+        }
+
+        return $desc;
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorPool.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorPool.php
new file mode 100644
index 0000000..419bbf4
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorPool.php
@@ -0,0 +1,179 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\Descriptor;
+use Google\Protobuf\Internal\FileDescriptor;
+use Google\Protobuf\Internal\FileDescriptorSet;
+use Google\Protobuf\Internal\MessageBuilderContext;
+use Google\Protobuf\Internal\EnumBuilderContext;
+
+class DescriptorPool
+{
+    private static $pool;
+    // Map from message names to sub-maps, which are maps from field numbers to
+    // field descriptors.
+    private $class_to_desc = [];
+    private $class_to_enum_desc = [];
+    private $proto_to_class = [];
+
+    public static function getGeneratedPool()
+    {
+        if (!isset(self::$pool)) {
+            self::$pool = new DescriptorPool();
+        }
+        return self::$pool;
+    }
+
+    public function internalAddGeneratedFile($data, $use_nested = false)
+    {
+        $files = new FileDescriptorSet();
+        $files->mergeFromString($data);
+        $file = FileDescriptor::buildFromProto($files->getFile()[0]);
+
+        foreach ($file->getMessageType() as $desc) {
+            $this->addDescriptor($desc);
+        }
+        unset($desc);
+
+        foreach ($file->getEnumType() as $desc) {
+            $this->addEnumDescriptor($desc);
+        }
+        unset($desc);
+
+        foreach ($file->getMessageType() as $desc) {
+            $this->crossLink($desc);
+        }
+        unset($desc);
+    }
+
+    public function addMessage($name, $klass)
+    {
+        return new MessageBuilderContext($name, $klass, $this);
+    }
+
+    public function addEnum($name, $klass)
+    {
+        return new EnumBuilderContext($name, $klass, $this);
+    }
+
+    public function addDescriptor($descriptor)
+    {
+        $this->proto_to_class[$descriptor->getFullName()] =
+            $descriptor->getClass();
+        $this->class_to_desc[$descriptor->getClass()] = $descriptor;
+        $this->class_to_desc[$descriptor->getLegacyClass()] = $descriptor;
+        foreach ($descriptor->getNestedType() as $nested_type) {
+            $this->addDescriptor($nested_type);
+        }
+        foreach ($descriptor->getEnumType() as $enum_type) {
+            $this->addEnumDescriptor($enum_type);
+        }
+    }
+
+    public function addEnumDescriptor($descriptor)
+    {
+        $this->proto_to_class[$descriptor->getFullName()] =
+            $descriptor->getClass();
+        $this->class_to_enum_desc[$descriptor->getClass()] = $descriptor;
+        $this->class_to_enum_desc[$descriptor->getLegacyClass()] = $descriptor;
+    }
+
+    public function getDescriptorByClassName($klass)
+    {
+        if (isset($this->class_to_desc[$klass])) {
+            return $this->class_to_desc[$klass];
+        } else {
+            return null;
+        }
+    }
+
+    public function getEnumDescriptorByClassName($klass)
+    {
+        if (isset($this->class_to_enum_desc[$klass])) {
+            return $this->class_to_enum_desc[$klass];
+        } else {
+            return null;
+        }
+    }
+
+    public function getDescriptorByProtoName($proto)
+    {
+        if (isset($this->proto_to_class[$proto])) {
+            $klass = $this->proto_to_class[$proto];
+            return $this->class_to_desc[$klass];
+        } else {
+          return null;
+        }
+    }
+
+    public function getEnumDescriptorByProtoName($proto)
+    {
+        $klass = $this->proto_to_class[$proto];
+        return $this->class_to_enum_desc[$klass];
+    }
+
+    private function crossLink(Descriptor $desc)
+    {
+        foreach ($desc->getField() as $field) {
+            switch ($field->getType()) {
+                case GPBType::MESSAGE:
+                    $proto = $field->getMessageType();
+                    $field->setMessageType(
+                        $this->getDescriptorByProtoName($proto));
+                    break;
+                case GPBType::ENUM:
+                    $proto = $field->getEnumType();
+                    $field->setEnumType(
+                        $this->getEnumDescriptorByProtoName($proto));
+                    break;
+                default:
+                    break;
+            }
+        }
+        unset($field);
+
+        foreach ($desc->getNestedType() as $nested_type) {
+            $this->crossLink($nested_type);
+        }
+        unset($nested_type);
+    }
+
+    public function finish()
+    {
+        foreach ($this->class_to_desc as $klass => $desc) {
+            $this->crossLink($desc);
+        }
+        unset($desc);
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto.php
new file mode 100644
index 0000000..7cc689d
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto.php
@@ -0,0 +1,386 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Describes a message type.
+ *
+ * Generated from protobuf message <code>google.protobuf.DescriptorProto</code>
+ */
+class DescriptorProto extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Generated from protobuf field <code>optional string name = 1;</code>
+     */
+    protected $name = '';
+    private $has_name = false;
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.FieldDescriptorProto field = 2;</code>
+     */
+    private $field;
+    private $has_field = false;
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.FieldDescriptorProto extension = 6;</code>
+     */
+    private $extension;
+    private $has_extension = false;
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto nested_type = 3;</code>
+     */
+    private $nested_type;
+    private $has_nested_type = false;
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.EnumDescriptorProto enum_type = 4;</code>
+     */
+    private $enum_type;
+    private $has_enum_type = false;
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5;</code>
+     */
+    private $extension_range;
+    private $has_extension_range = false;
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8;</code>
+     */
+    private $oneof_decl;
+    private $has_oneof_decl = false;
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.MessageOptions options = 7;</code>
+     */
+    protected $options = null;
+    private $has_options = false;
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9;</code>
+     */
+    private $reserved_range;
+    private $has_reserved_range = false;
+    /**
+     * Reserved field names, which may not be used by fields in the same message.
+     * A given name may only be reserved once.
+     *
+     * Generated from protobuf field <code>repeated string reserved_name = 10;</code>
+     */
+    private $reserved_name;
+    private $has_reserved_name = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type string $name
+     *     @type \Google\Protobuf\Internal\FieldDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $field
+     *     @type \Google\Protobuf\Internal\FieldDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $extension
+     *     @type \Google\Protobuf\Internal\DescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $nested_type
+     *     @type \Google\Protobuf\Internal\EnumDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $enum_type
+     *     @type \Google\Protobuf\Internal\DescriptorProto\ExtensionRange[]|\Google\Protobuf\Internal\RepeatedField $extension_range
+     *     @type \Google\Protobuf\Internal\OneofDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $oneof_decl
+     *     @type \Google\Protobuf\Internal\MessageOptions $options
+     *     @type \Google\Protobuf\Internal\DescriptorProto\ReservedRange[]|\Google\Protobuf\Internal\RepeatedField $reserved_range
+     *     @type string[]|\Google\Protobuf\Internal\RepeatedField $reserved_name
+     *           Reserved field names, which may not be used by fields in the same message.
+     *           A given name may only be reserved once.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Generated from protobuf field <code>optional string name = 1;</code>
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional string name = 1;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setName($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->name = $var;
+        $this->has_name = true;
+
+        return $this;
+    }
+
+    public function hasName()
+    {
+        return $this->has_name;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.FieldDescriptorProto field = 2;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getField()
+    {
+        return $this->field;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.FieldDescriptorProto field = 2;</code>
+     * @param \Google\Protobuf\Internal\FieldDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setField($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FieldDescriptorProto::class);
+        $this->field = $arr;
+        $this->has_field = true;
+
+        return $this;
+    }
+
+    public function hasField()
+    {
+        return $this->has_field;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.FieldDescriptorProto extension = 6;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getExtension()
+    {
+        return $this->extension;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.FieldDescriptorProto extension = 6;</code>
+     * @param \Google\Protobuf\Internal\FieldDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setExtension($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FieldDescriptorProto::class);
+        $this->extension = $arr;
+        $this->has_extension = true;
+
+        return $this;
+    }
+
+    public function hasExtension()
+    {
+        return $this->has_extension;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto nested_type = 3;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getNestedType()
+    {
+        return $this->nested_type;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto nested_type = 3;</code>
+     * @param \Google\Protobuf\Internal\DescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setNestedType($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto::class);
+        $this->nested_type = $arr;
+        $this->has_nested_type = true;
+
+        return $this;
+    }
+
+    public function hasNestedType()
+    {
+        return $this->has_nested_type;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.EnumDescriptorProto enum_type = 4;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getEnumType()
+    {
+        return $this->enum_type;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.EnumDescriptorProto enum_type = 4;</code>
+     * @param \Google\Protobuf\Internal\EnumDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setEnumType($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumDescriptorProto::class);
+        $this->enum_type = $arr;
+        $this->has_enum_type = true;
+
+        return $this;
+    }
+
+    public function hasEnumType()
+    {
+        return $this->has_enum_type;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getExtensionRange()
+    {
+        return $this->extension_range;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5;</code>
+     * @param \Google\Protobuf\Internal\DescriptorProto\ExtensionRange[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setExtensionRange($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto\ExtensionRange::class);
+        $this->extension_range = $arr;
+        $this->has_extension_range = true;
+
+        return $this;
+    }
+
+    public function hasExtensionRange()
+    {
+        return $this->has_extension_range;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getOneofDecl()
+    {
+        return $this->oneof_decl;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8;</code>
+     * @param \Google\Protobuf\Internal\OneofDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setOneofDecl($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\OneofDescriptorProto::class);
+        $this->oneof_decl = $arr;
+        $this->has_oneof_decl = true;
+
+        return $this;
+    }
+
+    public function hasOneofDecl()
+    {
+        return $this->has_oneof_decl;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.MessageOptions options = 7;</code>
+     * @return \Google\Protobuf\Internal\MessageOptions
+     */
+    public function getOptions()
+    {
+        return $this->options;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.MessageOptions options = 7;</code>
+     * @param \Google\Protobuf\Internal\MessageOptions $var
+     * @return $this
+     */
+    public function setOptions($var)
+    {
+        GPBUtil::checkMessage($var, \Google\Protobuf\Internal\MessageOptions::class);
+        $this->options = $var;
+        $this->has_options = true;
+
+        return $this;
+    }
+
+    public function hasOptions()
+    {
+        return $this->has_options;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getReservedRange()
+    {
+        return $this->reserved_range;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9;</code>
+     * @param \Google\Protobuf\Internal\DescriptorProto\ReservedRange[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setReservedRange($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto\ReservedRange::class);
+        $this->reserved_range = $arr;
+        $this->has_reserved_range = true;
+
+        return $this;
+    }
+
+    public function hasReservedRange()
+    {
+        return $this->has_reserved_range;
+    }
+
+    /**
+     * Reserved field names, which may not be used by fields in the same message.
+     * A given name may only be reserved once.
+     *
+     * Generated from protobuf field <code>repeated string reserved_name = 10;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getReservedName()
+    {
+        return $this->reserved_name;
+    }
+
+    /**
+     * Reserved field names, which may not be used by fields in the same message.
+     * A given name may only be reserved once.
+     *
+     * Generated from protobuf field <code>repeated string reserved_name = 10;</code>
+     * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setReservedName($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
+        $this->reserved_name = $arr;
+        $this->has_reserved_name = true;
+
+        return $this;
+    }
+
+    public function hasReservedName()
+    {
+        return $this->has_reserved_name;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ExtensionRange.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ExtensionRange.php
new file mode 100644
index 0000000..82b5695
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ExtensionRange.php
@@ -0,0 +1,152 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal\DescriptorProto;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Generated from protobuf message <code>google.protobuf.DescriptorProto.ExtensionRange</code>
+ */
+class ExtensionRange extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Inclusive.
+     *
+     * Generated from protobuf field <code>optional int32 start = 1;</code>
+     */
+    protected $start = 0;
+    private $has_start = false;
+    /**
+     * Exclusive.
+     *
+     * Generated from protobuf field <code>optional int32 end = 2;</code>
+     */
+    protected $end = 0;
+    private $has_end = false;
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.ExtensionRangeOptions options = 3;</code>
+     */
+    protected $options = null;
+    private $has_options = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type int $start
+     *           Inclusive.
+     *     @type int $end
+     *           Exclusive.
+     *     @type \Google\Protobuf\Internal\ExtensionRangeOptions $options
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Inclusive.
+     *
+     * Generated from protobuf field <code>optional int32 start = 1;</code>
+     * @return int
+     */
+    public function getStart()
+    {
+        return $this->start;
+    }
+
+    /**
+     * Inclusive.
+     *
+     * Generated from protobuf field <code>optional int32 start = 1;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setStart($var)
+    {
+        GPBUtil::checkInt32($var);
+        $this->start = $var;
+        $this->has_start = true;
+
+        return $this;
+    }
+
+    public function hasStart()
+    {
+        return $this->has_start;
+    }
+
+    /**
+     * Exclusive.
+     *
+     * Generated from protobuf field <code>optional int32 end = 2;</code>
+     * @return int
+     */
+    public function getEnd()
+    {
+        return $this->end;
+    }
+
+    /**
+     * Exclusive.
+     *
+     * Generated from protobuf field <code>optional int32 end = 2;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setEnd($var)
+    {
+        GPBUtil::checkInt32($var);
+        $this->end = $var;
+        $this->has_end = true;
+
+        return $this;
+    }
+
+    public function hasEnd()
+    {
+        return $this->has_end;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.ExtensionRangeOptions options = 3;</code>
+     * @return \Google\Protobuf\Internal\ExtensionRangeOptions
+     */
+    public function getOptions()
+    {
+        return $this->options;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.ExtensionRangeOptions options = 3;</code>
+     * @param \Google\Protobuf\Internal\ExtensionRangeOptions $var
+     * @return $this
+     */
+    public function setOptions($var)
+    {
+        GPBUtil::checkMessage($var, \Google\Protobuf\Internal\ExtensionRangeOptions::class);
+        $this->options = $var;
+        $this->has_options = true;
+
+        return $this;
+    }
+
+    public function hasOptions()
+    {
+        return $this->has_options;
+    }
+
+}
+
+// Adding a class alias for backwards compatibility with the previous class name.
+class_alias(ExtensionRange::class, \Google\Protobuf\Internal\DescriptorProto_ExtensionRange::class);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ReservedRange.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ReservedRange.php
new file mode 100644
index 0000000..8022151
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ReservedRange.php
@@ -0,0 +1,122 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal\DescriptorProto;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Range of reserved tag numbers. Reserved tag numbers may not be used by
+ * fields or extension ranges in the same message. Reserved ranges may
+ * not overlap.
+ *
+ * Generated from protobuf message <code>google.protobuf.DescriptorProto.ReservedRange</code>
+ */
+class ReservedRange extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Inclusive.
+     *
+     * Generated from protobuf field <code>optional int32 start = 1;</code>
+     */
+    protected $start = 0;
+    private $has_start = false;
+    /**
+     * Exclusive.
+     *
+     * Generated from protobuf field <code>optional int32 end = 2;</code>
+     */
+    protected $end = 0;
+    private $has_end = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type int $start
+     *           Inclusive.
+     *     @type int $end
+     *           Exclusive.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Inclusive.
+     *
+     * Generated from protobuf field <code>optional int32 start = 1;</code>
+     * @return int
+     */
+    public function getStart()
+    {
+        return $this->start;
+    }
+
+    /**
+     * Inclusive.
+     *
+     * Generated from protobuf field <code>optional int32 start = 1;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setStart($var)
+    {
+        GPBUtil::checkInt32($var);
+        $this->start = $var;
+        $this->has_start = true;
+
+        return $this;
+    }
+
+    public function hasStart()
+    {
+        return $this->has_start;
+    }
+
+    /**
+     * Exclusive.
+     *
+     * Generated from protobuf field <code>optional int32 end = 2;</code>
+     * @return int
+     */
+    public function getEnd()
+    {
+        return $this->end;
+    }
+
+    /**
+     * Exclusive.
+     *
+     * Generated from protobuf field <code>optional int32 end = 2;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setEnd($var)
+    {
+        GPBUtil::checkInt32($var);
+        $this->end = $var;
+        $this->has_end = true;
+
+        return $this;
+    }
+
+    public function hasEnd()
+    {
+        return $this->has_end;
+    }
+
+}
+
+// Adding a class alias for backwards compatibility with the previous class name.
+class_alias(ReservedRange::class, \Google\Protobuf\Internal\DescriptorProto_ReservedRange::class);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php
new file mode 100644
index 0000000..c928fbe
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php
@@ -0,0 +1,16 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+if (false) {
+    /**
+     * This class is deprecated. Use Google\Protobuf\Internal\DescriptorProto\ExtensionRange instead.
+     * @deprecated
+     */
+    class DescriptorProto_ExtensionRange {}
+}
+class_exists(DescriptorProto\ExtensionRange::class);
+@trigger_error('Google\Protobuf\Internal\DescriptorProto_ExtensionRange is deprecated and will be removed in the next major release. Use Google\Protobuf\Internal\DescriptorProto\ExtensionRange instead', E_USER_DEPRECATED);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto_ReservedRange.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto_ReservedRange.php
new file mode 100644
index 0000000..e49e945
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto_ReservedRange.php
@@ -0,0 +1,16 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+if (false) {
+    /**
+     * This class is deprecated. Use Google\Protobuf\Internal\DescriptorProto\ReservedRange instead.
+     * @deprecated
+     */
+    class DescriptorProto_ReservedRange {}
+}
+class_exists(DescriptorProto\ReservedRange::class);
+@trigger_error('Google\Protobuf\Internal\DescriptorProto_ReservedRange is deprecated and will be removed in the next major release. Use Google\Protobuf\Internal\DescriptorProto\ReservedRange instead', E_USER_DEPRECATED);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumBuilderContext.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumBuilderContext.php
new file mode 100644
index 0000000..0839728
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumBuilderContext.php
@@ -0,0 +1,63 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\EnumDescriptor;
+use Google\Protobuf\EnumValueDescriptor;
+
+class EnumBuilderContext
+{
+
+    private $descriptor;
+    private $pool;
+
+    public function __construct($full_name, $klass, $pool)
+    {
+        $this->descriptor = new EnumDescriptor();
+        $this->descriptor->setFullName($full_name);
+        $this->descriptor->setClass($klass);
+        $this->pool = $pool;
+    }
+
+    public function value($name, $number)
+    {
+        $value = new EnumValueDescriptor($name, $number);
+        $this->descriptor->addValue($number, $value);
+        return $this;
+    }
+
+    public function finalizeToPool()
+    {
+        $this->pool->addEnumDescriptor($this->descriptor);
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptor.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptor.php
new file mode 100644
index 0000000..7af4f84
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptor.php
@@ -0,0 +1,115 @@
+<?php
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\EnumValueDescriptor;
+
+class EnumDescriptor
+{
+    use HasPublicDescriptorTrait;
+
+    private $klass;
+    private $legacy_klass;
+    private $full_name;
+    private $value;
+    private $name_to_value;
+    private $value_descriptor = [];
+
+    public function __construct()
+    {
+        $this->public_desc = new \Google\Protobuf\EnumDescriptor($this);
+    }
+
+    public function setFullName($full_name)
+    {
+        $this->full_name = $full_name;
+    }
+
+    public function getFullName()
+    {
+        return $this->full_name;
+    }
+
+    public function addValue($number, $value)
+    {
+        $this->value[$number] = $value;
+        $this->name_to_value[$value->getName()] = $value;
+        $this->value_descriptor[] = new EnumValueDescriptor($value->getName(), $number);
+    }
+
+    public function getValueByNumber($number)
+    {
+        if (isset($this->value[$number])) {
+            return $this->value[$number];
+        }
+        return null;
+    }
+
+    public function getValueByName($name)
+    {
+        if (isset($this->name_to_value[$name])) {
+            return $this->name_to_value[$name];
+        }
+        return null;
+    }
+
+    public function getValueDescriptorByIndex($index)
+    {
+        if (isset($this->value_descriptor[$index])) {
+            return $this->value_descriptor[$index];
+        }
+        return null;
+    }
+
+    public function getValueCount()
+    {
+        return count($this->value);
+    }
+
+    public function setClass($klass)
+    {
+        $this->klass = $klass;
+    }
+
+    public function getClass()
+    {
+        return $this->klass;
+    }
+
+    public function setLegacyClass($klass)
+    {
+        $this->legacy_klass = $klass;
+    }
+
+    public function getLegacyClass()
+    {
+        return $this->legacy_klass;
+    }
+
+    public static function buildFromProto($proto, $file_proto, $containing)
+    {
+        $desc = new EnumDescriptor();
+
+        $enum_name_without_package  = "";
+        $classname = "";
+        $legacy_classname = "";
+        $fullname = "";
+        GPBUtil::getFullClassName(
+            $proto,
+            $containing,
+            $file_proto,
+            $enum_name_without_package,
+            $classname,
+            $legacy_classname,
+            $fullname);
+        $desc->setFullName($fullname);
+        $desc->setClass($classname);
+        $desc->setLegacyClass($legacy_classname);
+        $values = $proto->getValue();
+        foreach ($values as $value) {
+            $desc->addValue($value->getNumber(), $value);
+        }
+
+        return $desc;
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto.php
new file mode 100644
index 0000000..f5c7fe1
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto.php
@@ -0,0 +1,231 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Describes an enum type.
+ *
+ * Generated from protobuf message <code>google.protobuf.EnumDescriptorProto</code>
+ */
+class EnumDescriptorProto extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Generated from protobuf field <code>optional string name = 1;</code>
+     */
+    protected $name = '';
+    private $has_name = false;
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.EnumValueDescriptorProto value = 2;</code>
+     */
+    private $value;
+    private $has_value = false;
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.EnumOptions options = 3;</code>
+     */
+    protected $options = null;
+    private $has_options = false;
+    /**
+     * Range of reserved numeric values. Reserved numeric values may not be used
+     * by enum values in the same enum declaration. Reserved ranges may not
+     * overlap.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4;</code>
+     */
+    private $reserved_range;
+    private $has_reserved_range = false;
+    /**
+     * Reserved enum value names, which may not be reused. A given name may only
+     * be reserved once.
+     *
+     * Generated from protobuf field <code>repeated string reserved_name = 5;</code>
+     */
+    private $reserved_name;
+    private $has_reserved_name = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type string $name
+     *     @type \Google\Protobuf\Internal\EnumValueDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $value
+     *     @type \Google\Protobuf\Internal\EnumOptions $options
+     *     @type \Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange[]|\Google\Protobuf\Internal\RepeatedField $reserved_range
+     *           Range of reserved numeric values. Reserved numeric values may not be used
+     *           by enum values in the same enum declaration. Reserved ranges may not
+     *           overlap.
+     *     @type string[]|\Google\Protobuf\Internal\RepeatedField $reserved_name
+     *           Reserved enum value names, which may not be reused. A given name may only
+     *           be reserved once.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Generated from protobuf field <code>optional string name = 1;</code>
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional string name = 1;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setName($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->name = $var;
+        $this->has_name = true;
+
+        return $this;
+    }
+
+    public function hasName()
+    {
+        return $this->has_name;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.EnumValueDescriptorProto value = 2;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getValue()
+    {
+        return $this->value;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.EnumValueDescriptorProto value = 2;</code>
+     * @param \Google\Protobuf\Internal\EnumValueDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setValue($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumValueDescriptorProto::class);
+        $this->value = $arr;
+        $this->has_value = true;
+
+        return $this;
+    }
+
+    public function hasValue()
+    {
+        return $this->has_value;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.EnumOptions options = 3;</code>
+     * @return \Google\Protobuf\Internal\EnumOptions
+     */
+    public function getOptions()
+    {
+        return $this->options;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.EnumOptions options = 3;</code>
+     * @param \Google\Protobuf\Internal\EnumOptions $var
+     * @return $this
+     */
+    public function setOptions($var)
+    {
+        GPBUtil::checkMessage($var, \Google\Protobuf\Internal\EnumOptions::class);
+        $this->options = $var;
+        $this->has_options = true;
+
+        return $this;
+    }
+
+    public function hasOptions()
+    {
+        return $this->has_options;
+    }
+
+    /**
+     * Range of reserved numeric values. Reserved numeric values may not be used
+     * by enum values in the same enum declaration. Reserved ranges may not
+     * overlap.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getReservedRange()
+    {
+        return $this->reserved_range;
+    }
+
+    /**
+     * Range of reserved numeric values. Reserved numeric values may not be used
+     * by enum values in the same enum declaration. Reserved ranges may not
+     * overlap.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4;</code>
+     * @param \Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setReservedRange($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange::class);
+        $this->reserved_range = $arr;
+        $this->has_reserved_range = true;
+
+        return $this;
+    }
+
+    public function hasReservedRange()
+    {
+        return $this->has_reserved_range;
+    }
+
+    /**
+     * Reserved enum value names, which may not be reused. A given name may only
+     * be reserved once.
+     *
+     * Generated from protobuf field <code>repeated string reserved_name = 5;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getReservedName()
+    {
+        return $this->reserved_name;
+    }
+
+    /**
+     * Reserved enum value names, which may not be reused. A given name may only
+     * be reserved once.
+     *
+     * Generated from protobuf field <code>repeated string reserved_name = 5;</code>
+     * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setReservedName($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
+        $this->reserved_name = $arr;
+        $this->has_reserved_name = true;
+
+        return $this;
+    }
+
+    public function hasReservedName()
+    {
+        return $this->has_reserved_name;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto/EnumReservedRange.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto/EnumReservedRange.php
new file mode 100644
index 0000000..949dd89
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto/EnumReservedRange.php
@@ -0,0 +1,124 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal\EnumDescriptorProto;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Range of reserved numeric values. Reserved values may not be used by
+ * entries in the same enum. Reserved ranges may not overlap.
+ * Note that this is distinct from DescriptorProto.ReservedRange in that it
+ * is inclusive such that it can appropriately represent the entire int32
+ * domain.
+ *
+ * Generated from protobuf message <code>google.protobuf.EnumDescriptorProto.EnumReservedRange</code>
+ */
+class EnumReservedRange extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Inclusive.
+     *
+     * Generated from protobuf field <code>optional int32 start = 1;</code>
+     */
+    protected $start = 0;
+    private $has_start = false;
+    /**
+     * Inclusive.
+     *
+     * Generated from protobuf field <code>optional int32 end = 2;</code>
+     */
+    protected $end = 0;
+    private $has_end = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type int $start
+     *           Inclusive.
+     *     @type int $end
+     *           Inclusive.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Inclusive.
+     *
+     * Generated from protobuf field <code>optional int32 start = 1;</code>
+     * @return int
+     */
+    public function getStart()
+    {
+        return $this->start;
+    }
+
+    /**
+     * Inclusive.
+     *
+     * Generated from protobuf field <code>optional int32 start = 1;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setStart($var)
+    {
+        GPBUtil::checkInt32($var);
+        $this->start = $var;
+        $this->has_start = true;
+
+        return $this;
+    }
+
+    public function hasStart()
+    {
+        return $this->has_start;
+    }
+
+    /**
+     * Inclusive.
+     *
+     * Generated from protobuf field <code>optional int32 end = 2;</code>
+     * @return int
+     */
+    public function getEnd()
+    {
+        return $this->end;
+    }
+
+    /**
+     * Inclusive.
+     *
+     * Generated from protobuf field <code>optional int32 end = 2;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setEnd($var)
+    {
+        GPBUtil::checkInt32($var);
+        $this->end = $var;
+        $this->has_end = true;
+
+        return $this;
+    }
+
+    public function hasEnd()
+    {
+        return $this->has_end;
+    }
+
+}
+
+// Adding a class alias for backwards compatibility with the previous class name.
+class_alias(EnumReservedRange::class, \Google\Protobuf\Internal\EnumDescriptorProto_EnumReservedRange::class);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto_EnumReservedRange.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto_EnumReservedRange.php
new file mode 100644
index 0000000..b1b59ed
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto_EnumReservedRange.php
@@ -0,0 +1,16 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+if (false) {
+    /**
+     * This class is deprecated. Use Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange instead.
+     * @deprecated
+     */
+    class EnumDescriptorProto_EnumReservedRange {}
+}
+class_exists(EnumDescriptorProto\EnumReservedRange::class);
+@trigger_error('Google\Protobuf\Internal\EnumDescriptorProto_EnumReservedRange is deprecated and will be removed in the next major release. Use Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange instead', E_USER_DEPRECATED);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumOptions.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumOptions.php
new file mode 100644
index 0000000..e650042
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumOptions.php
@@ -0,0 +1,172 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Generated from protobuf message <code>google.protobuf.EnumOptions</code>
+ */
+class EnumOptions extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Set this option to true to allow mapping different tag names to the same
+     * value.
+     *
+     * Generated from protobuf field <code>optional bool allow_alias = 2;</code>
+     */
+    protected $allow_alias = false;
+    private $has_allow_alias = false;
+    /**
+     * Is this enum deprecated?
+     * Depending on the target platform, this can emit Deprecated annotations
+     * for the enum, or it will be completely ignored; in the very least, this
+     * is a formalization for deprecating enums.
+     *
+     * Generated from protobuf field <code>optional bool deprecated = 3 [default = false];</code>
+     */
+    protected $deprecated = false;
+    private $has_deprecated = false;
+    /**
+     * The parser stores options it doesn't recognize here. See above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     */
+    private $uninterpreted_option;
+    private $has_uninterpreted_option = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type bool $allow_alias
+     *           Set this option to true to allow mapping different tag names to the same
+     *           value.
+     *     @type bool $deprecated
+     *           Is this enum deprecated?
+     *           Depending on the target platform, this can emit Deprecated annotations
+     *           for the enum, or it will be completely ignored; in the very least, this
+     *           is a formalization for deprecating enums.
+     *     @type \Google\Protobuf\Internal\UninterpretedOption[]|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option
+     *           The parser stores options it doesn't recognize here. See above.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Set this option to true to allow mapping different tag names to the same
+     * value.
+     *
+     * Generated from protobuf field <code>optional bool allow_alias = 2;</code>
+     * @return bool
+     */
+    public function getAllowAlias()
+    {
+        return $this->allow_alias;
+    }
+
+    /**
+     * Set this option to true to allow mapping different tag names to the same
+     * value.
+     *
+     * Generated from protobuf field <code>optional bool allow_alias = 2;</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setAllowAlias($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->allow_alias = $var;
+        $this->has_allow_alias = true;
+
+        return $this;
+    }
+
+    public function hasAllowAlias()
+    {
+        return $this->has_allow_alias;
+    }
+
+    /**
+     * Is this enum deprecated?
+     * Depending on the target platform, this can emit Deprecated annotations
+     * for the enum, or it will be completely ignored; in the very least, this
+     * is a formalization for deprecating enums.
+     *
+     * Generated from protobuf field <code>optional bool deprecated = 3 [default = false];</code>
+     * @return bool
+     */
+    public function getDeprecated()
+    {
+        return $this->deprecated;
+    }
+
+    /**
+     * Is this enum deprecated?
+     * Depending on the target platform, this can emit Deprecated annotations
+     * for the enum, or it will be completely ignored; in the very least, this
+     * is a formalization for deprecating enums.
+     *
+     * Generated from protobuf field <code>optional bool deprecated = 3 [default = false];</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setDeprecated($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->deprecated = $var;
+        $this->has_deprecated = true;
+
+        return $this;
+    }
+
+    public function hasDeprecated()
+    {
+        return $this->has_deprecated;
+    }
+
+    /**
+     * The parser stores options it doesn't recognize here. See above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getUninterpretedOption()
+    {
+        return $this->uninterpreted_option;
+    }
+
+    /**
+     * The parser stores options it doesn't recognize here. See above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     * @param \Google\Protobuf\Internal\UninterpretedOption[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setUninterpretedOption($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class);
+        $this->uninterpreted_option = $arr;
+        $this->has_uninterpreted_option = true;
+
+        return $this;
+    }
+
+    public function hasUninterpretedOption()
+    {
+        return $this->has_uninterpreted_option;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php
new file mode 100644
index 0000000..3dd9558
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php
@@ -0,0 +1,137 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Describes a value within an enum.
+ *
+ * Generated from protobuf message <code>google.protobuf.EnumValueDescriptorProto</code>
+ */
+class EnumValueDescriptorProto extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Generated from protobuf field <code>optional string name = 1;</code>
+     */
+    protected $name = '';
+    private $has_name = false;
+    /**
+     * Generated from protobuf field <code>optional int32 number = 2;</code>
+     */
+    protected $number = 0;
+    private $has_number = false;
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.EnumValueOptions options = 3;</code>
+     */
+    protected $options = null;
+    private $has_options = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type string $name
+     *     @type int $number
+     *     @type \Google\Protobuf\Internal\EnumValueOptions $options
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Generated from protobuf field <code>optional string name = 1;</code>
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional string name = 1;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setName($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->name = $var;
+        $this->has_name = true;
+
+        return $this;
+    }
+
+    public function hasName()
+    {
+        return $this->has_name;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional int32 number = 2;</code>
+     * @return int
+     */
+    public function getNumber()
+    {
+        return $this->number;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional int32 number = 2;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setNumber($var)
+    {
+        GPBUtil::checkInt32($var);
+        $this->number = $var;
+        $this->has_number = true;
+
+        return $this;
+    }
+
+    public function hasNumber()
+    {
+        return $this->has_number;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.EnumValueOptions options = 3;</code>
+     * @return \Google\Protobuf\Internal\EnumValueOptions
+     */
+    public function getOptions()
+    {
+        return $this->options;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.EnumValueOptions options = 3;</code>
+     * @param \Google\Protobuf\Internal\EnumValueOptions $var
+     * @return $this
+     */
+    public function setOptions($var)
+    {
+        GPBUtil::checkMessage($var, \Google\Protobuf\Internal\EnumValueOptions::class);
+        $this->options = $var;
+        $this->has_options = true;
+
+        return $this;
+    }
+
+    public function hasOptions()
+    {
+        return $this->has_options;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumValueOptions.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumValueOptions.php
new file mode 100644
index 0000000..9f9fb3b
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumValueOptions.php
@@ -0,0 +1,127 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Generated from protobuf message <code>google.protobuf.EnumValueOptions</code>
+ */
+class EnumValueOptions extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Is this enum value deprecated?
+     * Depending on the target platform, this can emit Deprecated annotations
+     * for the enum value, or it will be completely ignored; in the very least,
+     * this is a formalization for deprecating enum values.
+     *
+     * Generated from protobuf field <code>optional bool deprecated = 1 [default = false];</code>
+     */
+    protected $deprecated = false;
+    private $has_deprecated = false;
+    /**
+     * The parser stores options it doesn't recognize here. See above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     */
+    private $uninterpreted_option;
+    private $has_uninterpreted_option = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type bool $deprecated
+     *           Is this enum value deprecated?
+     *           Depending on the target platform, this can emit Deprecated annotations
+     *           for the enum value, or it will be completely ignored; in the very least,
+     *           this is a formalization for deprecating enum values.
+     *     @type \Google\Protobuf\Internal\UninterpretedOption[]|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option
+     *           The parser stores options it doesn't recognize here. See above.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Is this enum value deprecated?
+     * Depending on the target platform, this can emit Deprecated annotations
+     * for the enum value, or it will be completely ignored; in the very least,
+     * this is a formalization for deprecating enum values.
+     *
+     * Generated from protobuf field <code>optional bool deprecated = 1 [default = false];</code>
+     * @return bool
+     */
+    public function getDeprecated()
+    {
+        return $this->deprecated;
+    }
+
+    /**
+     * Is this enum value deprecated?
+     * Depending on the target platform, this can emit Deprecated annotations
+     * for the enum value, or it will be completely ignored; in the very least,
+     * this is a formalization for deprecating enum values.
+     *
+     * Generated from protobuf field <code>optional bool deprecated = 1 [default = false];</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setDeprecated($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->deprecated = $var;
+        $this->has_deprecated = true;
+
+        return $this;
+    }
+
+    public function hasDeprecated()
+    {
+        return $this->has_deprecated;
+    }
+
+    /**
+     * The parser stores options it doesn't recognize here. See above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getUninterpretedOption()
+    {
+        return $this->uninterpreted_option;
+    }
+
+    /**
+     * The parser stores options it doesn't recognize here. See above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     * @param \Google\Protobuf\Internal\UninterpretedOption[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setUninterpretedOption($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class);
+        $this->uninterpreted_option = $arr;
+        $this->has_uninterpreted_option = true;
+
+        return $this;
+    }
+
+    public function hasUninterpretedOption()
+    {
+        return $this->has_uninterpreted_option;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions.php
new file mode 100644
index 0000000..00fbebe
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions.php
@@ -0,0 +1,74 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Generated from protobuf message <code>google.protobuf.ExtensionRangeOptions</code>
+ */
+class ExtensionRangeOptions extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * The parser stores options it doesn't recognize here. See above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     */
+    private $uninterpreted_option;
+    private $has_uninterpreted_option = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type \Google\Protobuf\Internal\UninterpretedOption[]|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option
+     *           The parser stores options it doesn't recognize here. See above.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * The parser stores options it doesn't recognize here. See above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getUninterpretedOption()
+    {
+        return $this->uninterpreted_option;
+    }
+
+    /**
+     * The parser stores options it doesn't recognize here. See above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     * @param \Google\Protobuf\Internal\UninterpretedOption[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setUninterpretedOption($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class);
+        $this->uninterpreted_option = $arr;
+        $this->has_uninterpreted_option = true;
+
+        return $this;
+    }
+
+    public function hasUninterpretedOption()
+    {
+        return $this->has_uninterpreted_option;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptor.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptor.php
new file mode 100644
index 0000000..98b516f
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptor.php
@@ -0,0 +1,284 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf\Internal;
+
+class FieldDescriptor
+{
+    use HasPublicDescriptorTrait;
+
+    private $name;
+    private $json_name;
+    private $setter;
+    private $getter;
+    private $number;
+    private $label;
+    private $type;
+    private $message_type;
+    private $enum_type;
+    private $packed;
+    private $is_map;
+    private $oneof_index = -1;
+
+    public function __construct()
+    {
+        $this->public_desc = new \Google\Protobuf\FieldDescriptor($this);
+    }
+
+    public function setOneofIndex($index)
+    {
+        $this->oneof_index = $index;
+    }
+
+    public function getOneofIndex()
+    {
+        return $this->oneof_index;
+    }
+
+    public function setName($name)
+    {
+        $this->name = $name;
+    }
+
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    public function setJsonName($json_name)
+    {
+        $this->json_name = $json_name;
+    }
+
+    public function getJsonName()
+    {
+        return $this->json_name;
+    }
+
+    public function setSetter($setter)
+    {
+        $this->setter = $setter;
+    }
+
+    public function getSetter()
+    {
+        return $this->setter;
+    }
+
+    public function setGetter($getter)
+    {
+        $this->getter = $getter;
+    }
+
+    public function getGetter()
+    {
+        return $this->getter;
+    }
+
+    public function setNumber($number)
+    {
+        $this->number = $number;
+    }
+
+    public function getNumber()
+    {
+        return $this->number;
+    }
+
+    public function setLabel($label)
+    {
+        $this->label = $label;
+    }
+
+    public function getLabel()
+    {
+        return $this->label;
+    }
+
+    public function isRepeated()
+    {
+        return $this->label === GPBLabel::REPEATED;
+    }
+
+    public function setType($type)
+    {
+        $this->type = $type;
+    }
+
+    public function getType()
+    {
+        return $this->type;
+    }
+
+    public function setMessageType($message_type)
+    {
+        $this->message_type = $message_type;
+    }
+
+    public function getMessageType()
+    {
+        return $this->message_type;
+    }
+
+    public function setEnumType($enum_type)
+    {
+        $this->enum_type = $enum_type;
+    }
+
+    public function getEnumType()
+    {
+        return $this->enum_type;
+    }
+
+    public function setPacked($packed)
+    {
+        $this->packed = $packed;
+    }
+
+    public function getPacked()
+    {
+        return $this->packed;
+    }
+
+    public function isPackable()
+    {
+        return $this->isRepeated() && self::isTypePackable($this->type);
+    }
+
+    public function isMap()
+    {
+        return $this->getType() == GPBType::MESSAGE &&
+               !is_null($this->getMessageType()->getOptions()) &&
+               $this->getMessageType()->getOptions()->getMapEntry();
+    }
+
+    public function isTimestamp()
+    {
+        return $this->getType() == GPBType::MESSAGE &&
+            $this->getMessageType()->getClass() === "Google\Protobuf\Timestamp";
+    }
+
+    public function isWrapperType()
+    {
+        if ($this->getType() == GPBType::MESSAGE) {
+            $class = $this->getMessageType()->getClass();
+            return in_array($class, [
+                "Google\Protobuf\DoubleValue",
+                "Google\Protobuf\FloatValue",
+                "Google\Protobuf\Int64Value",
+                "Google\Protobuf\UInt64Value",
+                "Google\Protobuf\Int32Value",
+                "Google\Protobuf\UInt32Value",
+                "Google\Protobuf\BoolValue",
+                "Google\Protobuf\StringValue",
+                "Google\Protobuf\BytesValue",
+            ]);
+        }
+        return false;
+    }
+
+    private static function isTypePackable($field_type)
+    {
+        return ($field_type !== GPBType::STRING  &&
+            $field_type !== GPBType::GROUP   &&
+            $field_type !== GPBType::MESSAGE &&
+            $field_type !== GPBType::BYTES);
+    }
+
+    public static function getFieldDescriptor($proto)
+    {
+        $type_name = null;
+        $type = $proto->getType();
+        switch ($type) {
+            case GPBType::MESSAGE:
+            case GPBType::GROUP:
+            case GPBType::ENUM:
+                $type_name = $proto->getTypeName();
+                break;
+            default:
+                break;
+        }
+
+        $oneof_index = $proto->hasOneofIndex() ? $proto->getOneofIndex() : -1;
+        $packed = false;
+        $options = $proto->getOptions();
+        if ($options !== null) {
+            $packed = $options->getPacked();
+        }
+
+        $field = new FieldDescriptor();
+        $field->setName($proto->getName());
+
+        $json_name = $proto->hasJsonName() ? $proto->getJsonName() :
+            lcfirst(implode('', array_map('ucwords', explode('_', $proto->getName()))));
+        if ($proto->hasJsonName()) {
+            $json_name = $proto->getJsonName();
+        } else {
+            $proto_name = $proto->getName();
+            $json_name = implode('', array_map('ucwords', explode('_', $proto_name)));
+            if ($proto_name[0] !== "_" && !ctype_upper($proto_name[0])) {
+                $json_name = lcfirst($json_name);
+            }
+        }
+        $field->setJsonName($json_name);
+
+        $camel_name = implode('', array_map('ucwords', explode('_', $proto->getName())));
+        $field->setGetter('get' . $camel_name);
+        $field->setSetter('set' . $camel_name);
+        $field->setType($proto->getType());
+        $field->setNumber($proto->getNumber());
+        $field->setLabel($proto->getLabel());
+        $field->setPacked($packed);
+        $field->setOneofIndex($oneof_index);
+
+        // At this time, the message/enum type may have not been added to pool.
+        // So we use the type name as place holder and will replace it with the
+        // actual descriptor in cross building.
+        switch ($type) {
+            case GPBType::MESSAGE:
+                $field->setMessageType($type_name);
+                break;
+            case GPBType::ENUM:
+                $field->setEnumType($type_name);
+                break;
+            default:
+                break;
+        }
+
+        return $field;
+    }
+
+    public static function buildFromProto($proto)
+    {
+        return FieldDescriptor::getFieldDescriptor($proto);
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto.php
new file mode 100644
index 0000000..b231c9e
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto.php
@@ -0,0 +1,473 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Describes a field within a message.
+ *
+ * Generated from protobuf message <code>google.protobuf.FieldDescriptorProto</code>
+ */
+class FieldDescriptorProto extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Generated from protobuf field <code>optional string name = 1;</code>
+     */
+    protected $name = '';
+    private $has_name = false;
+    /**
+     * Generated from protobuf field <code>optional int32 number = 3;</code>
+     */
+    protected $number = 0;
+    private $has_number = false;
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.FieldDescriptorProto.Label label = 4;</code>
+     */
+    protected $label = 0;
+    private $has_label = false;
+    /**
+     * If type_name is set, this need not be set.  If both this and type_name
+     * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
+     *
+     * Generated from protobuf field <code>optional .google.protobuf.FieldDescriptorProto.Type type = 5;</code>
+     */
+    protected $type = 0;
+    private $has_type = false;
+    /**
+     * For message and enum types, this is the name of the type.  If the name
+     * starts with a '.', it is fully-qualified.  Otherwise, C++-like scoping
+     * rules are used to find the type (i.e. first the nested types within this
+     * message are searched, then within the parent, on up to the root
+     * namespace).
+     *
+     * Generated from protobuf field <code>optional string type_name = 6;</code>
+     */
+    protected $type_name = '';
+    private $has_type_name = false;
+    /**
+     * For extensions, this is the name of the type being extended.  It is
+     * resolved in the same manner as type_name.
+     *
+     * Generated from protobuf field <code>optional string extendee = 2;</code>
+     */
+    protected $extendee = '';
+    private $has_extendee = false;
+    /**
+     * For numeric types, contains the original text representation of the value.
+     * For booleans, "true" or "false".
+     * For strings, contains the default text contents (not escaped in any way).
+     * For bytes, contains the C escaped value.  All bytes >= 128 are escaped.
+     * TODO(kenton):  Base-64 encode?
+     *
+     * Generated from protobuf field <code>optional string default_value = 7;</code>
+     */
+    protected $default_value = '';
+    private $has_default_value = false;
+    /**
+     * If set, gives the index of a oneof in the containing type's oneof_decl
+     * list.  This field is a member of that oneof.
+     *
+     * Generated from protobuf field <code>optional int32 oneof_index = 9;</code>
+     */
+    protected $oneof_index = 0;
+    private $has_oneof_index = false;
+    /**
+     * JSON name of this field. The value is set by protocol compiler. If the
+     * user has set a "json_name" option on this field, that option's value
+     * will be used. Otherwise, it's deduced from the field's name by converting
+     * it to camelCase.
+     *
+     * Generated from protobuf field <code>optional string json_name = 10;</code>
+     */
+    protected $json_name = '';
+    private $has_json_name = false;
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.FieldOptions options = 8;</code>
+     */
+    protected $options = null;
+    private $has_options = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type string $name
+     *     @type int $number
+     *     @type int $label
+     *     @type int $type
+     *           If type_name is set, this need not be set.  If both this and type_name
+     *           are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
+     *     @type string $type_name
+     *           For message and enum types, this is the name of the type.  If the name
+     *           starts with a '.', it is fully-qualified.  Otherwise, C++-like scoping
+     *           rules are used to find the type (i.e. first the nested types within this
+     *           message are searched, then within the parent, on up to the root
+     *           namespace).
+     *     @type string $extendee
+     *           For extensions, this is the name of the type being extended.  It is
+     *           resolved in the same manner as type_name.
+     *     @type string $default_value
+     *           For numeric types, contains the original text representation of the value.
+     *           For booleans, "true" or "false".
+     *           For strings, contains the default text contents (not escaped in any way).
+     *           For bytes, contains the C escaped value.  All bytes >= 128 are escaped.
+     *           TODO(kenton):  Base-64 encode?
+     *     @type int $oneof_index
+     *           If set, gives the index of a oneof in the containing type's oneof_decl
+     *           list.  This field is a member of that oneof.
+     *     @type string $json_name
+     *           JSON name of this field. The value is set by protocol compiler. If the
+     *           user has set a "json_name" option on this field, that option's value
+     *           will be used. Otherwise, it's deduced from the field's name by converting
+     *           it to camelCase.
+     *     @type \Google\Protobuf\Internal\FieldOptions $options
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Generated from protobuf field <code>optional string name = 1;</code>
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional string name = 1;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setName($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->name = $var;
+        $this->has_name = true;
+
+        return $this;
+    }
+
+    public function hasName()
+    {
+        return $this->has_name;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional int32 number = 3;</code>
+     * @return int
+     */
+    public function getNumber()
+    {
+        return $this->number;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional int32 number = 3;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setNumber($var)
+    {
+        GPBUtil::checkInt32($var);
+        $this->number = $var;
+        $this->has_number = true;
+
+        return $this;
+    }
+
+    public function hasNumber()
+    {
+        return $this->has_number;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.FieldDescriptorProto.Label label = 4;</code>
+     * @return int
+     */
+    public function getLabel()
+    {
+        return $this->label;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.FieldDescriptorProto.Label label = 4;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setLabel($var)
+    {
+        GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldDescriptorProto_Label::class);
+        $this->label = $var;
+        $this->has_label = true;
+
+        return $this;
+    }
+
+    public function hasLabel()
+    {
+        return $this->has_label;
+    }
+
+    /**
+     * If type_name is set, this need not be set.  If both this and type_name
+     * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
+     *
+     * Generated from protobuf field <code>optional .google.protobuf.FieldDescriptorProto.Type type = 5;</code>
+     * @return int
+     */
+    public function getType()
+    {
+        return $this->type;
+    }
+
+    /**
+     * If type_name is set, this need not be set.  If both this and type_name
+     * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
+     *
+     * Generated from protobuf field <code>optional .google.protobuf.FieldDescriptorProto.Type type = 5;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setType($var)
+    {
+        GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldDescriptorProto_Type::class);
+        $this->type = $var;
+        $this->has_type = true;
+
+        return $this;
+    }
+
+    public function hasType()
+    {
+        return $this->has_type;
+    }
+
+    /**
+     * For message and enum types, this is the name of the type.  If the name
+     * starts with a '.', it is fully-qualified.  Otherwise, C++-like scoping
+     * rules are used to find the type (i.e. first the nested types within this
+     * message are searched, then within the parent, on up to the root
+     * namespace).
+     *
+     * Generated from protobuf field <code>optional string type_name = 6;</code>
+     * @return string
+     */
+    public function getTypeName()
+    {
+        return $this->type_name;
+    }
+
+    /**
+     * For message and enum types, this is the name of the type.  If the name
+     * starts with a '.', it is fully-qualified.  Otherwise, C++-like scoping
+     * rules are used to find the type (i.e. first the nested types within this
+     * message are searched, then within the parent, on up to the root
+     * namespace).
+     *
+     * Generated from protobuf field <code>optional string type_name = 6;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setTypeName($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->type_name = $var;
+        $this->has_type_name = true;
+
+        return $this;
+    }
+
+    public function hasTypeName()
+    {
+        return $this->has_type_name;
+    }
+
+    /**
+     * For extensions, this is the name of the type being extended.  It is
+     * resolved in the same manner as type_name.
+     *
+     * Generated from protobuf field <code>optional string extendee = 2;</code>
+     * @return string
+     */
+    public function getExtendee()
+    {
+        return $this->extendee;
+    }
+
+    /**
+     * For extensions, this is the name of the type being extended.  It is
+     * resolved in the same manner as type_name.
+     *
+     * Generated from protobuf field <code>optional string extendee = 2;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setExtendee($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->extendee = $var;
+        $this->has_extendee = true;
+
+        return $this;
+    }
+
+    public function hasExtendee()
+    {
+        return $this->has_extendee;
+    }
+
+    /**
+     * For numeric types, contains the original text representation of the value.
+     * For booleans, "true" or "false".
+     * For strings, contains the default text contents (not escaped in any way).
+     * For bytes, contains the C escaped value.  All bytes >= 128 are escaped.
+     * TODO(kenton):  Base-64 encode?
+     *
+     * Generated from protobuf field <code>optional string default_value = 7;</code>
+     * @return string
+     */
+    public function getDefaultValue()
+    {
+        return $this->default_value;
+    }
+
+    /**
+     * For numeric types, contains the original text representation of the value.
+     * For booleans, "true" or "false".
+     * For strings, contains the default text contents (not escaped in any way).
+     * For bytes, contains the C escaped value.  All bytes >= 128 are escaped.
+     * TODO(kenton):  Base-64 encode?
+     *
+     * Generated from protobuf field <code>optional string default_value = 7;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setDefaultValue($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->default_value = $var;
+        $this->has_default_value = true;
+
+        return $this;
+    }
+
+    public function hasDefaultValue()
+    {
+        return $this->has_default_value;
+    }
+
+    /**
+     * If set, gives the index of a oneof in the containing type's oneof_decl
+     * list.  This field is a member of that oneof.
+     *
+     * Generated from protobuf field <code>optional int32 oneof_index = 9;</code>
+     * @return int
+     */
+    public function getOneofIndex()
+    {
+        return $this->oneof_index;
+    }
+
+    /**
+     * If set, gives the index of a oneof in the containing type's oneof_decl
+     * list.  This field is a member of that oneof.
+     *
+     * Generated from protobuf field <code>optional int32 oneof_index = 9;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setOneofIndex($var)
+    {
+        GPBUtil::checkInt32($var);
+        $this->oneof_index = $var;
+        $this->has_oneof_index = true;
+
+        return $this;
+    }
+
+    public function hasOneofIndex()
+    {
+        return $this->has_oneof_index;
+    }
+
+    /**
+     * JSON name of this field. The value is set by protocol compiler. If the
+     * user has set a "json_name" option on this field, that option's value
+     * will be used. Otherwise, it's deduced from the field's name by converting
+     * it to camelCase.
+     *
+     * Generated from protobuf field <code>optional string json_name = 10;</code>
+     * @return string
+     */
+    public function getJsonName()
+    {
+        return $this->json_name;
+    }
+
+    /**
+     * JSON name of this field. The value is set by protocol compiler. If the
+     * user has set a "json_name" option on this field, that option's value
+     * will be used. Otherwise, it's deduced from the field's name by converting
+     * it to camelCase.
+     *
+     * Generated from protobuf field <code>optional string json_name = 10;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setJsonName($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->json_name = $var;
+        $this->has_json_name = true;
+
+        return $this;
+    }
+
+    public function hasJsonName()
+    {
+        return $this->has_json_name;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.FieldOptions options = 8;</code>
+     * @return \Google\Protobuf\Internal\FieldOptions
+     */
+    public function getOptions()
+    {
+        return $this->options;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.FieldOptions options = 8;</code>
+     * @param \Google\Protobuf\Internal\FieldOptions $var
+     * @return $this
+     */
+    public function setOptions($var)
+    {
+        GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FieldOptions::class);
+        $this->options = $var;
+        $this->has_options = true;
+
+        return $this;
+    }
+
+    public function hasOptions()
+    {
+        return $this->has_options;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto/Label.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto/Label.php
new file mode 100644
index 0000000..a54b228
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto/Label.php
@@ -0,0 +1,58 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal\FieldDescriptorProto;
+
+use UnexpectedValueException;
+
+/**
+ * Protobuf type <code>google.protobuf.FieldDescriptorProto.Label</code>
+ */
+class Label
+{
+    /**
+     * 0 is reserved for errors
+     *
+     * Generated from protobuf enum <code>LABEL_OPTIONAL = 1;</code>
+     */
+    const LABEL_OPTIONAL = 1;
+    /**
+     * Generated from protobuf enum <code>LABEL_REQUIRED = 2;</code>
+     */
+    const LABEL_REQUIRED = 2;
+    /**
+     * Generated from protobuf enum <code>LABEL_REPEATED = 3;</code>
+     */
+    const LABEL_REPEATED = 3;
+
+    private static $valueToName = [
+        self::LABEL_OPTIONAL => 'LABEL_OPTIONAL',
+        self::LABEL_REQUIRED => 'LABEL_REQUIRED',
+        self::LABEL_REPEATED => 'LABEL_REPEATED',
+    ];
+
+    public static function name($value)
+    {
+        if (!isset(self::$valueToName[$value])) {
+            throw new UnexpectedValueException(sprintf(
+                    'Enum %s has no name defined for value %s', __CLASS__, $value));
+        }
+        return self::$valueToName[$value];
+    }
+
+
+    public static function value($name)
+    {
+        $const = __CLASS__ . '::' . strtoupper($name);
+        if (!defined($const)) {
+            throw new UnexpectedValueException(sprintf(
+                    'Enum %s has no value defined for name %s', __CLASS__, $name));
+        }
+        return constant($const);
+    }
+}
+
+// Adding a class alias for backwards compatibility with the previous class name.
+class_alias(Label::class, \Google\Protobuf\Internal\FieldDescriptorProto_Label::class);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto/Type.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto/Type.php
new file mode 100644
index 0000000..6072e99
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto/Type.php
@@ -0,0 +1,153 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal\FieldDescriptorProto;
+
+use UnexpectedValueException;
+
+/**
+ * Protobuf type <code>google.protobuf.FieldDescriptorProto.Type</code>
+ */
+class Type
+{
+    /**
+     * 0 is reserved for errors.
+     * Order is weird for historical reasons.
+     *
+     * Generated from protobuf enum <code>TYPE_DOUBLE = 1;</code>
+     */
+    const TYPE_DOUBLE = 1;
+    /**
+     * Generated from protobuf enum <code>TYPE_FLOAT = 2;</code>
+     */
+    const TYPE_FLOAT = 2;
+    /**
+     * Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT64 if
+     * negative values are likely.
+     *
+     * Generated from protobuf enum <code>TYPE_INT64 = 3;</code>
+     */
+    const TYPE_INT64 = 3;
+    /**
+     * Generated from protobuf enum <code>TYPE_UINT64 = 4;</code>
+     */
+    const TYPE_UINT64 = 4;
+    /**
+     * Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT32 if
+     * negative values are likely.
+     *
+     * Generated from protobuf enum <code>TYPE_INT32 = 5;</code>
+     */
+    const TYPE_INT32 = 5;
+    /**
+     * Generated from protobuf enum <code>TYPE_FIXED64 = 6;</code>
+     */
+    const TYPE_FIXED64 = 6;
+    /**
+     * Generated from protobuf enum <code>TYPE_FIXED32 = 7;</code>
+     */
+    const TYPE_FIXED32 = 7;
+    /**
+     * Generated from protobuf enum <code>TYPE_BOOL = 8;</code>
+     */
+    const TYPE_BOOL = 8;
+    /**
+     * Generated from protobuf enum <code>TYPE_STRING = 9;</code>
+     */
+    const TYPE_STRING = 9;
+    /**
+     * Tag-delimited aggregate.
+     * Group type is deprecated and not supported in proto3. However, Proto3
+     * implementations should still be able to parse the group wire format and
+     * treat group fields as unknown fields.
+     *
+     * Generated from protobuf enum <code>TYPE_GROUP = 10;</code>
+     */
+    const TYPE_GROUP = 10;
+    /**
+     * Length-delimited aggregate.
+     *
+     * Generated from protobuf enum <code>TYPE_MESSAGE = 11;</code>
+     */
+    const TYPE_MESSAGE = 11;
+    /**
+     * New in version 2.
+     *
+     * Generated from protobuf enum <code>TYPE_BYTES = 12;</code>
+     */
+    const TYPE_BYTES = 12;
+    /**
+     * Generated from protobuf enum <code>TYPE_UINT32 = 13;</code>
+     */
+    const TYPE_UINT32 = 13;
+    /**
+     * Generated from protobuf enum <code>TYPE_ENUM = 14;</code>
+     */
+    const TYPE_ENUM = 14;
+    /**
+     * Generated from protobuf enum <code>TYPE_SFIXED32 = 15;</code>
+     */
+    const TYPE_SFIXED32 = 15;
+    /**
+     * Generated from protobuf enum <code>TYPE_SFIXED64 = 16;</code>
+     */
+    const TYPE_SFIXED64 = 16;
+    /**
+     * Uses ZigZag encoding.
+     *
+     * Generated from protobuf enum <code>TYPE_SINT32 = 17;</code>
+     */
+    const TYPE_SINT32 = 17;
+    /**
+     * Uses ZigZag encoding.
+     *
+     * Generated from protobuf enum <code>TYPE_SINT64 = 18;</code>
+     */
+    const TYPE_SINT64 = 18;
+
+    private static $valueToName = [
+        self::TYPE_DOUBLE => 'TYPE_DOUBLE',
+        self::TYPE_FLOAT => 'TYPE_FLOAT',
+        self::TYPE_INT64 => 'TYPE_INT64',
+        self::TYPE_UINT64 => 'TYPE_UINT64',
+        self::TYPE_INT32 => 'TYPE_INT32',
+        self::TYPE_FIXED64 => 'TYPE_FIXED64',
+        self::TYPE_FIXED32 => 'TYPE_FIXED32',
+        self::TYPE_BOOL => 'TYPE_BOOL',
+        self::TYPE_STRING => 'TYPE_STRING',
+        self::TYPE_GROUP => 'TYPE_GROUP',
+        self::TYPE_MESSAGE => 'TYPE_MESSAGE',
+        self::TYPE_BYTES => 'TYPE_BYTES',
+        self::TYPE_UINT32 => 'TYPE_UINT32',
+        self::TYPE_ENUM => 'TYPE_ENUM',
+        self::TYPE_SFIXED32 => 'TYPE_SFIXED32',
+        self::TYPE_SFIXED64 => 'TYPE_SFIXED64',
+        self::TYPE_SINT32 => 'TYPE_SINT32',
+        self::TYPE_SINT64 => 'TYPE_SINT64',
+    ];
+
+    public static function name($value)
+    {
+        if (!isset(self::$valueToName[$value])) {
+            throw new UnexpectedValueException(sprintf(
+                    'Enum %s has no name defined for value %s', __CLASS__, $value));
+        }
+        return self::$valueToName[$value];
+    }
+
+
+    public static function value($name)
+    {
+        $const = __CLASS__ . '::' . strtoupper($name);
+        if (!defined($const)) {
+            throw new UnexpectedValueException(sprintf(
+                    'Enum %s has no value defined for name %s', __CLASS__, $name));
+        }
+        return constant($const);
+    }
+}
+
+// Adding a class alias for backwards compatibility with the previous class name.
+class_alias(Type::class, \Google\Protobuf\Internal\FieldDescriptorProto_Type::class);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto_Label.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto_Label.php
new file mode 100644
index 0000000..218a846
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto_Label.php
@@ -0,0 +1,16 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+if (false) {
+    /**
+     * This class is deprecated. Use Google\Protobuf\Internal\FieldDescriptorProto\Label instead.
+     * @deprecated
+     */
+    class FieldDescriptorProto_Label {}
+}
+class_exists(FieldDescriptorProto\Label::class);
+@trigger_error('Google\Protobuf\Internal\FieldDescriptorProto_Label is deprecated and will be removed in the next major release. Use Google\Protobuf\Internal\FieldDescriptorProto\Label instead', E_USER_DEPRECATED);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto_Type.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto_Type.php
new file mode 100644
index 0000000..fd8d449
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto_Type.php
@@ -0,0 +1,16 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+if (false) {
+    /**
+     * This class is deprecated. Use Google\Protobuf\Internal\FieldDescriptorProto\Type instead.
+     * @deprecated
+     */
+    class FieldDescriptorProto_Type {}
+}
+class_exists(FieldDescriptorProto\Type::class);
+@trigger_error('Google\Protobuf\Internal\FieldDescriptorProto_Type is deprecated and will be removed in the next major release. Use Google\Protobuf\Internal\FieldDescriptorProto\Type instead', E_USER_DEPRECATED);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions.php
new file mode 100644
index 0000000..2ccc418
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions.php
@@ -0,0 +1,488 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Generated from protobuf message <code>google.protobuf.FieldOptions</code>
+ */
+class FieldOptions extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * The ctype option instructs the C++ code generator to use a different
+     * representation of the field than it normally would.  See the specific
+     * options below.  This option is not yet implemented in the open source
+     * release -- sorry, we'll try to include it in a future version!
+     *
+     * Generated from protobuf field <code>optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];</code>
+     */
+    protected $ctype = 0;
+    private $has_ctype = false;
+    /**
+     * The packed option can be enabled for repeated primitive fields to enable
+     * a more efficient representation on the wire. Rather than repeatedly
+     * writing the tag and type for each element, the entire array is encoded as
+     * a single length-delimited blob. In proto3, only explicit setting it to
+     * false will avoid using packed encoding.
+     *
+     * Generated from protobuf field <code>optional bool packed = 2;</code>
+     */
+    protected $packed = false;
+    private $has_packed = false;
+    /**
+     * The jstype option determines the JavaScript type used for values of the
+     * field.  The option is permitted only for 64 bit integral and fixed types
+     * (int64, uint64, sint64, fixed64, sfixed64).  A field with jstype JS_STRING
+     * is represented as JavaScript string, which avoids loss of precision that
+     * can happen when a large value is converted to a floating point JavaScript.
+     * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
+     * use the JavaScript "number" type.  The behavior of the default option
+     * JS_NORMAL is implementation dependent.
+     * This option is an enum to permit additional types to be added, e.g.
+     * goog.math.Integer.
+     *
+     * Generated from protobuf field <code>optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL];</code>
+     */
+    protected $jstype = 0;
+    private $has_jstype = false;
+    /**
+     * Should this field be parsed lazily?  Lazy applies only to message-type
+     * fields.  It means that when the outer message is initially parsed, the
+     * inner message's contents will not be parsed but instead stored in encoded
+     * form.  The inner message will actually be parsed when it is first accessed.
+     * This is only a hint.  Implementations are free to choose whether to use
+     * eager or lazy parsing regardless of the value of this option.  However,
+     * setting this option true suggests that the protocol author believes that
+     * using lazy parsing on this field is worth the additional bookkeeping
+     * overhead typically needed to implement it.
+     * This option does not affect the public interface of any generated code;
+     * all method signatures remain the same.  Furthermore, thread-safety of the
+     * interface is not affected by this option; const methods remain safe to
+     * call from multiple threads concurrently, while non-const methods continue
+     * to require exclusive access.
+     * Note that implementations may choose not to check required fields within
+     * a lazy sub-message.  That is, calling IsInitialized() on the outer message
+     * may return true even if the inner message has missing required fields.
+     * This is necessary because otherwise the inner message would have to be
+     * parsed in order to perform the check, defeating the purpose of lazy
+     * parsing.  An implementation which chooses not to check required fields
+     * must be consistent about it.  That is, for any particular sub-message, the
+     * implementation must either *always* check its required fields, or *never*
+     * check its required fields, regardless of whether or not the message has
+     * been parsed.
+     *
+     * Generated from protobuf field <code>optional bool lazy = 5 [default = false];</code>
+     */
+    protected $lazy = false;
+    private $has_lazy = false;
+    /**
+     * Is this field deprecated?
+     * Depending on the target platform, this can emit Deprecated annotations
+     * for accessors, or it will be completely ignored; in the very least, this
+     * is a formalization for deprecating fields.
+     *
+     * Generated from protobuf field <code>optional bool deprecated = 3 [default = false];</code>
+     */
+    protected $deprecated = false;
+    private $has_deprecated = false;
+    /**
+     * For Google-internal migration only. Do not use.
+     *
+     * Generated from protobuf field <code>optional bool weak = 10 [default = false];</code>
+     */
+    protected $weak = false;
+    private $has_weak = false;
+    /**
+     * The parser stores options it doesn't recognize here. See above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     */
+    private $uninterpreted_option;
+    private $has_uninterpreted_option = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type int $ctype
+     *           The ctype option instructs the C++ code generator to use a different
+     *           representation of the field than it normally would.  See the specific
+     *           options below.  This option is not yet implemented in the open source
+     *           release -- sorry, we'll try to include it in a future version!
+     *     @type bool $packed
+     *           The packed option can be enabled for repeated primitive fields to enable
+     *           a more efficient representation on the wire. Rather than repeatedly
+     *           writing the tag and type for each element, the entire array is encoded as
+     *           a single length-delimited blob. In proto3, only explicit setting it to
+     *           false will avoid using packed encoding.
+     *     @type int $jstype
+     *           The jstype option determines the JavaScript type used for values of the
+     *           field.  The option is permitted only for 64 bit integral and fixed types
+     *           (int64, uint64, sint64, fixed64, sfixed64).  A field with jstype JS_STRING
+     *           is represented as JavaScript string, which avoids loss of precision that
+     *           can happen when a large value is converted to a floating point JavaScript.
+     *           Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
+     *           use the JavaScript "number" type.  The behavior of the default option
+     *           JS_NORMAL is implementation dependent.
+     *           This option is an enum to permit additional types to be added, e.g.
+     *           goog.math.Integer.
+     *     @type bool $lazy
+     *           Should this field be parsed lazily?  Lazy applies only to message-type
+     *           fields.  It means that when the outer message is initially parsed, the
+     *           inner message's contents will not be parsed but instead stored in encoded
+     *           form.  The inner message will actually be parsed when it is first accessed.
+     *           This is only a hint.  Implementations are free to choose whether to use
+     *           eager or lazy parsing regardless of the value of this option.  However,
+     *           setting this option true suggests that the protocol author believes that
+     *           using lazy parsing on this field is worth the additional bookkeeping
+     *           overhead typically needed to implement it.
+     *           This option does not affect the public interface of any generated code;
+     *           all method signatures remain the same.  Furthermore, thread-safety of the
+     *           interface is not affected by this option; const methods remain safe to
+     *           call from multiple threads concurrently, while non-const methods continue
+     *           to require exclusive access.
+     *           Note that implementations may choose not to check required fields within
+     *           a lazy sub-message.  That is, calling IsInitialized() on the outer message
+     *           may return true even if the inner message has missing required fields.
+     *           This is necessary because otherwise the inner message would have to be
+     *           parsed in order to perform the check, defeating the purpose of lazy
+     *           parsing.  An implementation which chooses not to check required fields
+     *           must be consistent about it.  That is, for any particular sub-message, the
+     *           implementation must either *always* check its required fields, or *never*
+     *           check its required fields, regardless of whether or not the message has
+     *           been parsed.
+     *     @type bool $deprecated
+     *           Is this field deprecated?
+     *           Depending on the target platform, this can emit Deprecated annotations
+     *           for accessors, or it will be completely ignored; in the very least, this
+     *           is a formalization for deprecating fields.
+     *     @type bool $weak
+     *           For Google-internal migration only. Do not use.
+     *     @type \Google\Protobuf\Internal\UninterpretedOption[]|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option
+     *           The parser stores options it doesn't recognize here. See above.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * The ctype option instructs the C++ code generator to use a different
+     * representation of the field than it normally would.  See the specific
+     * options below.  This option is not yet implemented in the open source
+     * release -- sorry, we'll try to include it in a future version!
+     *
+     * Generated from protobuf field <code>optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];</code>
+     * @return int
+     */
+    public function getCtype()
+    {
+        return $this->ctype;
+    }
+
+    /**
+     * The ctype option instructs the C++ code generator to use a different
+     * representation of the field than it normally would.  See the specific
+     * options below.  This option is not yet implemented in the open source
+     * release -- sorry, we'll try to include it in a future version!
+     *
+     * Generated from protobuf field <code>optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setCtype($var)
+    {
+        GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldOptions_CType::class);
+        $this->ctype = $var;
+        $this->has_ctype = true;
+
+        return $this;
+    }
+
+    public function hasCtype()
+    {
+        return $this->has_ctype;
+    }
+
+    /**
+     * The packed option can be enabled for repeated primitive fields to enable
+     * a more efficient representation on the wire. Rather than repeatedly
+     * writing the tag and type for each element, the entire array is encoded as
+     * a single length-delimited blob. In proto3, only explicit setting it to
+     * false will avoid using packed encoding.
+     *
+     * Generated from protobuf field <code>optional bool packed = 2;</code>
+     * @return bool
+     */
+    public function getPacked()
+    {
+        return $this->packed;
+    }
+
+    /**
+     * The packed option can be enabled for repeated primitive fields to enable
+     * a more efficient representation on the wire. Rather than repeatedly
+     * writing the tag and type for each element, the entire array is encoded as
+     * a single length-delimited blob. In proto3, only explicit setting it to
+     * false will avoid using packed encoding.
+     *
+     * Generated from protobuf field <code>optional bool packed = 2;</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setPacked($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->packed = $var;
+        $this->has_packed = true;
+
+        return $this;
+    }
+
+    public function hasPacked()
+    {
+        return $this->has_packed;
+    }
+
+    /**
+     * The jstype option determines the JavaScript type used for values of the
+     * field.  The option is permitted only for 64 bit integral and fixed types
+     * (int64, uint64, sint64, fixed64, sfixed64).  A field with jstype JS_STRING
+     * is represented as JavaScript string, which avoids loss of precision that
+     * can happen when a large value is converted to a floating point JavaScript.
+     * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
+     * use the JavaScript "number" type.  The behavior of the default option
+     * JS_NORMAL is implementation dependent.
+     * This option is an enum to permit additional types to be added, e.g.
+     * goog.math.Integer.
+     *
+     * Generated from protobuf field <code>optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL];</code>
+     * @return int
+     */
+    public function getJstype()
+    {
+        return $this->jstype;
+    }
+
+    /**
+     * The jstype option determines the JavaScript type used for values of the
+     * field.  The option is permitted only for 64 bit integral and fixed types
+     * (int64, uint64, sint64, fixed64, sfixed64).  A field with jstype JS_STRING
+     * is represented as JavaScript string, which avoids loss of precision that
+     * can happen when a large value is converted to a floating point JavaScript.
+     * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
+     * use the JavaScript "number" type.  The behavior of the default option
+     * JS_NORMAL is implementation dependent.
+     * This option is an enum to permit additional types to be added, e.g.
+     * goog.math.Integer.
+     *
+     * Generated from protobuf field <code>optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL];</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setJstype($var)
+    {
+        GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldOptions_JSType::class);
+        $this->jstype = $var;
+        $this->has_jstype = true;
+
+        return $this;
+    }
+
+    public function hasJstype()
+    {
+        return $this->has_jstype;
+    }
+
+    /**
+     * Should this field be parsed lazily?  Lazy applies only to message-type
+     * fields.  It means that when the outer message is initially parsed, the
+     * inner message's contents will not be parsed but instead stored in encoded
+     * form.  The inner message will actually be parsed when it is first accessed.
+     * This is only a hint.  Implementations are free to choose whether to use
+     * eager or lazy parsing regardless of the value of this option.  However,
+     * setting this option true suggests that the protocol author believes that
+     * using lazy parsing on this field is worth the additional bookkeeping
+     * overhead typically needed to implement it.
+     * This option does not affect the public interface of any generated code;
+     * all method signatures remain the same.  Furthermore, thread-safety of the
+     * interface is not affected by this option; const methods remain safe to
+     * call from multiple threads concurrently, while non-const methods continue
+     * to require exclusive access.
+     * Note that implementations may choose not to check required fields within
+     * a lazy sub-message.  That is, calling IsInitialized() on the outer message
+     * may return true even if the inner message has missing required fields.
+     * This is necessary because otherwise the inner message would have to be
+     * parsed in order to perform the check, defeating the purpose of lazy
+     * parsing.  An implementation which chooses not to check required fields
+     * must be consistent about it.  That is, for any particular sub-message, the
+     * implementation must either *always* check its required fields, or *never*
+     * check its required fields, regardless of whether or not the message has
+     * been parsed.
+     *
+     * Generated from protobuf field <code>optional bool lazy = 5 [default = false];</code>
+     * @return bool
+     */
+    public function getLazy()
+    {
+        return $this->lazy;
+    }
+
+    /**
+     * Should this field be parsed lazily?  Lazy applies only to message-type
+     * fields.  It means that when the outer message is initially parsed, the
+     * inner message's contents will not be parsed but instead stored in encoded
+     * form.  The inner message will actually be parsed when it is first accessed.
+     * This is only a hint.  Implementations are free to choose whether to use
+     * eager or lazy parsing regardless of the value of this option.  However,
+     * setting this option true suggests that the protocol author believes that
+     * using lazy parsing on this field is worth the additional bookkeeping
+     * overhead typically needed to implement it.
+     * This option does not affect the public interface of any generated code;
+     * all method signatures remain the same.  Furthermore, thread-safety of the
+     * interface is not affected by this option; const methods remain safe to
+     * call from multiple threads concurrently, while non-const methods continue
+     * to require exclusive access.
+     * Note that implementations may choose not to check required fields within
+     * a lazy sub-message.  That is, calling IsInitialized() on the outer message
+     * may return true even if the inner message has missing required fields.
+     * This is necessary because otherwise the inner message would have to be
+     * parsed in order to perform the check, defeating the purpose of lazy
+     * parsing.  An implementation which chooses not to check required fields
+     * must be consistent about it.  That is, for any particular sub-message, the
+     * implementation must either *always* check its required fields, or *never*
+     * check its required fields, regardless of whether or not the message has
+     * been parsed.
+     *
+     * Generated from protobuf field <code>optional bool lazy = 5 [default = false];</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setLazy($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->lazy = $var;
+        $this->has_lazy = true;
+
+        return $this;
+    }
+
+    public function hasLazy()
+    {
+        return $this->has_lazy;
+    }
+
+    /**
+     * Is this field deprecated?
+     * Depending on the target platform, this can emit Deprecated annotations
+     * for accessors, or it will be completely ignored; in the very least, this
+     * is a formalization for deprecating fields.
+     *
+     * Generated from protobuf field <code>optional bool deprecated = 3 [default = false];</code>
+     * @return bool
+     */
+    public function getDeprecated()
+    {
+        return $this->deprecated;
+    }
+
+    /**
+     * Is this field deprecated?
+     * Depending on the target platform, this can emit Deprecated annotations
+     * for accessors, or it will be completely ignored; in the very least, this
+     * is a formalization for deprecating fields.
+     *
+     * Generated from protobuf field <code>optional bool deprecated = 3 [default = false];</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setDeprecated($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->deprecated = $var;
+        $this->has_deprecated = true;
+
+        return $this;
+    }
+
+    public function hasDeprecated()
+    {
+        return $this->has_deprecated;
+    }
+
+    /**
+     * For Google-internal migration only. Do not use.
+     *
+     * Generated from protobuf field <code>optional bool weak = 10 [default = false];</code>
+     * @return bool
+     */
+    public function getWeak()
+    {
+        return $this->weak;
+    }
+
+    /**
+     * For Google-internal migration only. Do not use.
+     *
+     * Generated from protobuf field <code>optional bool weak = 10 [default = false];</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setWeak($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->weak = $var;
+        $this->has_weak = true;
+
+        return $this;
+    }
+
+    public function hasWeak()
+    {
+        return $this->has_weak;
+    }
+
+    /**
+     * The parser stores options it doesn't recognize here. See above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getUninterpretedOption()
+    {
+        return $this->uninterpreted_option;
+    }
+
+    /**
+     * The parser stores options it doesn't recognize here. See above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     * @param \Google\Protobuf\Internal\UninterpretedOption[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setUninterpretedOption($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class);
+        $this->uninterpreted_option = $arr;
+        $this->has_uninterpreted_option = true;
+
+        return $this;
+    }
+
+    public function hasUninterpretedOption()
+    {
+        return $this->has_uninterpreted_option;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/CType.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/CType.php
new file mode 100644
index 0000000..ba9eb4a
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/CType.php
@@ -0,0 +1,58 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal\FieldOptions;
+
+use UnexpectedValueException;
+
+/**
+ * Protobuf type <code>google.protobuf.FieldOptions.CType</code>
+ */
+class CType
+{
+    /**
+     * Default mode.
+     *
+     * Generated from protobuf enum <code>STRING = 0;</code>
+     */
+    const STRING = 0;
+    /**
+     * Generated from protobuf enum <code>CORD = 1;</code>
+     */
+    const CORD = 1;
+    /**
+     * Generated from protobuf enum <code>STRING_PIECE = 2;</code>
+     */
+    const STRING_PIECE = 2;
+
+    private static $valueToName = [
+        self::STRING => 'STRING',
+        self::CORD => 'CORD',
+        self::STRING_PIECE => 'STRING_PIECE',
+    ];
+
+    public static function name($value)
+    {
+        if (!isset(self::$valueToName[$value])) {
+            throw new UnexpectedValueException(sprintf(
+                    'Enum %s has no name defined for value %s', __CLASS__, $value));
+        }
+        return self::$valueToName[$value];
+    }
+
+
+    public static function value($name)
+    {
+        $const = __CLASS__ . '::' . strtoupper($name);
+        if (!defined($const)) {
+            throw new UnexpectedValueException(sprintf(
+                    'Enum %s has no value defined for name %s', __CLASS__, $name));
+        }
+        return constant($const);
+    }
+}
+
+// Adding a class alias for backwards compatibility with the previous class name.
+class_alias(CType::class, \Google\Protobuf\Internal\FieldOptions_CType::class);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/JSType.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/JSType.php
new file mode 100644
index 0000000..175a433
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/JSType.php
@@ -0,0 +1,62 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal\FieldOptions;
+
+use UnexpectedValueException;
+
+/**
+ * Protobuf type <code>google.protobuf.FieldOptions.JSType</code>
+ */
+class JSType
+{
+    /**
+     * Use the default type.
+     *
+     * Generated from protobuf enum <code>JS_NORMAL = 0;</code>
+     */
+    const JS_NORMAL = 0;
+    /**
+     * Use JavaScript strings.
+     *
+     * Generated from protobuf enum <code>JS_STRING = 1;</code>
+     */
+    const JS_STRING = 1;
+    /**
+     * Use JavaScript numbers.
+     *
+     * Generated from protobuf enum <code>JS_NUMBER = 2;</code>
+     */
+    const JS_NUMBER = 2;
+
+    private static $valueToName = [
+        self::JS_NORMAL => 'JS_NORMAL',
+        self::JS_STRING => 'JS_STRING',
+        self::JS_NUMBER => 'JS_NUMBER',
+    ];
+
+    public static function name($value)
+    {
+        if (!isset(self::$valueToName[$value])) {
+            throw new UnexpectedValueException(sprintf(
+                    'Enum %s has no name defined for value %s', __CLASS__, $value));
+        }
+        return self::$valueToName[$value];
+    }
+
+
+    public static function value($name)
+    {
+        $const = __CLASS__ . '::' . strtoupper($name);
+        if (!defined($const)) {
+            throw new UnexpectedValueException(sprintf(
+                    'Enum %s has no value defined for name %s', __CLASS__, $name));
+        }
+        return constant($const);
+    }
+}
+
+// Adding a class alias for backwards compatibility with the previous class name.
+class_alias(JSType::class, \Google\Protobuf\Internal\FieldOptions_JSType::class);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions_CType.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions_CType.php
new file mode 100644
index 0000000..4d18783
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions_CType.php
@@ -0,0 +1,16 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+if (false) {
+    /**
+     * This class is deprecated. Use Google\Protobuf\Internal\FieldOptions\CType instead.
+     * @deprecated
+     */
+    class FieldOptions_CType {}
+}
+class_exists(FieldOptions\CType::class);
+@trigger_error('Google\Protobuf\Internal\FieldOptions_CType is deprecated and will be removed in the next major release. Use Google\Protobuf\Internal\FieldOptions\CType instead', E_USER_DEPRECATED);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions_JSType.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions_JSType.php
new file mode 100644
index 0000000..9db0782
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions_JSType.php
@@ -0,0 +1,16 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+if (false) {
+    /**
+     * This class is deprecated. Use Google\Protobuf\Internal\FieldOptions\JSType instead.
+     * @deprecated
+     */
+    class FieldOptions_JSType {}
+}
+class_exists(FieldOptions\JSType::class);
+@trigger_error('Google\Protobuf\Internal\FieldOptions_JSType is deprecated and will be removed in the next major release. Use Google\Protobuf\Internal\FieldOptions\JSType instead', E_USER_DEPRECATED);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptor.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptor.php
new file mode 100644
index 0000000..038da38
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptor.php
@@ -0,0 +1,89 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf\Internal;
+
+class FileDescriptor
+{
+
+    private $package;
+    private $message_type = [];
+    private $enum_type = [];
+
+    public function setPackage($package)
+    {
+        $this->package = $package;
+    }
+
+    public function getPackage()
+    {
+        return $this->package;
+    }
+
+    public function getMessageType()
+    {
+        return $this->message_type;
+    }
+
+    public function addMessageType($desc)
+    {
+        $this->message_type[] = $desc;
+    }
+
+    public function getEnumType()
+    {
+        return $this->enum_type;
+    }
+
+    public function addEnumType($desc)
+    {
+        $this->enum_type[]= $desc;
+    }
+
+    public static function buildFromProto($proto)
+    {
+        $file = new FileDescriptor();
+        $file->setPackage($proto->getPackage());
+        foreach ($proto->getMessageType() as $message_proto) {
+            $file->addMessageType(Descriptor::buildFromProto(
+                $message_proto, $proto, ""));
+        }
+        foreach ($proto->getEnumType() as $enum_proto) {
+            $file->addEnumType(
+                EnumDescriptor::buildFromProto(
+                    $enum_proto,
+                    $proto,
+                    ""));
+        }
+        return $file;
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptorProto.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptorProto.php
new file mode 100644
index 0000000..c9e3648
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptorProto.php
@@ -0,0 +1,519 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Describes a complete .proto file.
+ *
+ * Generated from protobuf message <code>google.protobuf.FileDescriptorProto</code>
+ */
+class FileDescriptorProto extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * file name, relative to root of source tree
+     *
+     * Generated from protobuf field <code>optional string name = 1;</code>
+     */
+    protected $name = '';
+    private $has_name = false;
+    /**
+     * e.g. "foo", "foo.bar", etc.
+     *
+     * Generated from protobuf field <code>optional string package = 2;</code>
+     */
+    protected $package = '';
+    private $has_package = false;
+    /**
+     * Names of files imported by this file.
+     *
+     * Generated from protobuf field <code>repeated string dependency = 3;</code>
+     */
+    private $dependency;
+    private $has_dependency = false;
+    /**
+     * Indexes of the public imported files in the dependency list above.
+     *
+     * Generated from protobuf field <code>repeated int32 public_dependency = 10;</code>
+     */
+    private $public_dependency;
+    private $has_public_dependency = false;
+    /**
+     * Indexes of the weak imported files in the dependency list.
+     * For Google-internal migration only. Do not use.
+     *
+     * Generated from protobuf field <code>repeated int32 weak_dependency = 11;</code>
+     */
+    private $weak_dependency;
+    private $has_weak_dependency = false;
+    /**
+     * All top-level definitions in this file.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto message_type = 4;</code>
+     */
+    private $message_type;
+    private $has_message_type = false;
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.EnumDescriptorProto enum_type = 5;</code>
+     */
+    private $enum_type;
+    private $has_enum_type = false;
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.ServiceDescriptorProto service = 6;</code>
+     */
+    private $service;
+    private $has_service = false;
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.FieldDescriptorProto extension = 7;</code>
+     */
+    private $extension;
+    private $has_extension = false;
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.FileOptions options = 8;</code>
+     */
+    protected $options = null;
+    private $has_options = false;
+    /**
+     * This field contains optional information about the original source code.
+     * You may safely remove this entire field without harming runtime
+     * functionality of the descriptors -- the information is needed only by
+     * development tools.
+     *
+     * Generated from protobuf field <code>optional .google.protobuf.SourceCodeInfo source_code_info = 9;</code>
+     */
+    protected $source_code_info = null;
+    private $has_source_code_info = false;
+    /**
+     * The syntax of the proto file.
+     * The supported values are "proto2" and "proto3".
+     *
+     * Generated from protobuf field <code>optional string syntax = 12;</code>
+     */
+    protected $syntax = '';
+    private $has_syntax = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type string $name
+     *           file name, relative to root of source tree
+     *     @type string $package
+     *           e.g. "foo", "foo.bar", etc.
+     *     @type string[]|\Google\Protobuf\Internal\RepeatedField $dependency
+     *           Names of files imported by this file.
+     *     @type int[]|\Google\Protobuf\Internal\RepeatedField $public_dependency
+     *           Indexes of the public imported files in the dependency list above.
+     *     @type int[]|\Google\Protobuf\Internal\RepeatedField $weak_dependency
+     *           Indexes of the weak imported files in the dependency list.
+     *           For Google-internal migration only. Do not use.
+     *     @type \Google\Protobuf\Internal\DescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $message_type
+     *           All top-level definitions in this file.
+     *     @type \Google\Protobuf\Internal\EnumDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $enum_type
+     *     @type \Google\Protobuf\Internal\ServiceDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $service
+     *     @type \Google\Protobuf\Internal\FieldDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $extension
+     *     @type \Google\Protobuf\Internal\FileOptions $options
+     *     @type \Google\Protobuf\Internal\SourceCodeInfo $source_code_info
+     *           This field contains optional information about the original source code.
+     *           You may safely remove this entire field without harming runtime
+     *           functionality of the descriptors -- the information is needed only by
+     *           development tools.
+     *     @type string $syntax
+     *           The syntax of the proto file.
+     *           The supported values are "proto2" and "proto3".
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * file name, relative to root of source tree
+     *
+     * Generated from protobuf field <code>optional string name = 1;</code>
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * file name, relative to root of source tree
+     *
+     * Generated from protobuf field <code>optional string name = 1;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setName($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->name = $var;
+        $this->has_name = true;
+
+        return $this;
+    }
+
+    public function hasName()
+    {
+        return $this->has_name;
+    }
+
+    /**
+     * e.g. "foo", "foo.bar", etc.
+     *
+     * Generated from protobuf field <code>optional string package = 2;</code>
+     * @return string
+     */
+    public function getPackage()
+    {
+        return $this->package;
+    }
+
+    /**
+     * e.g. "foo", "foo.bar", etc.
+     *
+     * Generated from protobuf field <code>optional string package = 2;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setPackage($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->package = $var;
+        $this->has_package = true;
+
+        return $this;
+    }
+
+    public function hasPackage()
+    {
+        return $this->has_package;
+    }
+
+    /**
+     * Names of files imported by this file.
+     *
+     * Generated from protobuf field <code>repeated string dependency = 3;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getDependency()
+    {
+        return $this->dependency;
+    }
+
+    /**
+     * Names of files imported by this file.
+     *
+     * Generated from protobuf field <code>repeated string dependency = 3;</code>
+     * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setDependency($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
+        $this->dependency = $arr;
+        $this->has_dependency = true;
+
+        return $this;
+    }
+
+    public function hasDependency()
+    {
+        return $this->has_dependency;
+    }
+
+    /**
+     * Indexes of the public imported files in the dependency list above.
+     *
+     * Generated from protobuf field <code>repeated int32 public_dependency = 10;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getPublicDependency()
+    {
+        return $this->public_dependency;
+    }
+
+    /**
+     * Indexes of the public imported files in the dependency list above.
+     *
+     * Generated from protobuf field <code>repeated int32 public_dependency = 10;</code>
+     * @param int[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setPublicDependency($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
+        $this->public_dependency = $arr;
+        $this->has_public_dependency = true;
+
+        return $this;
+    }
+
+    public function hasPublicDependency()
+    {
+        return $this->has_public_dependency;
+    }
+
+    /**
+     * Indexes of the weak imported files in the dependency list.
+     * For Google-internal migration only. Do not use.
+     *
+     * Generated from protobuf field <code>repeated int32 weak_dependency = 11;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getWeakDependency()
+    {
+        return $this->weak_dependency;
+    }
+
+    /**
+     * Indexes of the weak imported files in the dependency list.
+     * For Google-internal migration only. Do not use.
+     *
+     * Generated from protobuf field <code>repeated int32 weak_dependency = 11;</code>
+     * @param int[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setWeakDependency($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
+        $this->weak_dependency = $arr;
+        $this->has_weak_dependency = true;
+
+        return $this;
+    }
+
+    public function hasWeakDependency()
+    {
+        return $this->has_weak_dependency;
+    }
+
+    /**
+     * All top-level definitions in this file.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto message_type = 4;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getMessageType()
+    {
+        return $this->message_type;
+    }
+
+    /**
+     * All top-level definitions in this file.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto message_type = 4;</code>
+     * @param \Google\Protobuf\Internal\DescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setMessageType($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto::class);
+        $this->message_type = $arr;
+        $this->has_message_type = true;
+
+        return $this;
+    }
+
+    public function hasMessageType()
+    {
+        return $this->has_message_type;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.EnumDescriptorProto enum_type = 5;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getEnumType()
+    {
+        return $this->enum_type;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.EnumDescriptorProto enum_type = 5;</code>
+     * @param \Google\Protobuf\Internal\EnumDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setEnumType($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumDescriptorProto::class);
+        $this->enum_type = $arr;
+        $this->has_enum_type = true;
+
+        return $this;
+    }
+
+    public function hasEnumType()
+    {
+        return $this->has_enum_type;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.ServiceDescriptorProto service = 6;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getService()
+    {
+        return $this->service;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.ServiceDescriptorProto service = 6;</code>
+     * @param \Google\Protobuf\Internal\ServiceDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setService($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\ServiceDescriptorProto::class);
+        $this->service = $arr;
+        $this->has_service = true;
+
+        return $this;
+    }
+
+    public function hasService()
+    {
+        return $this->has_service;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.FieldDescriptorProto extension = 7;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getExtension()
+    {
+        return $this->extension;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.FieldDescriptorProto extension = 7;</code>
+     * @param \Google\Protobuf\Internal\FieldDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setExtension($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FieldDescriptorProto::class);
+        $this->extension = $arr;
+        $this->has_extension = true;
+
+        return $this;
+    }
+
+    public function hasExtension()
+    {
+        return $this->has_extension;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.FileOptions options = 8;</code>
+     * @return \Google\Protobuf\Internal\FileOptions
+     */
+    public function getOptions()
+    {
+        return $this->options;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.FileOptions options = 8;</code>
+     * @param \Google\Protobuf\Internal\FileOptions $var
+     * @return $this
+     */
+    public function setOptions($var)
+    {
+        GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FileOptions::class);
+        $this->options = $var;
+        $this->has_options = true;
+
+        return $this;
+    }
+
+    public function hasOptions()
+    {
+        return $this->has_options;
+    }
+
+    /**
+     * This field contains optional information about the original source code.
+     * You may safely remove this entire field without harming runtime
+     * functionality of the descriptors -- the information is needed only by
+     * development tools.
+     *
+     * Generated from protobuf field <code>optional .google.protobuf.SourceCodeInfo source_code_info = 9;</code>
+     * @return \Google\Protobuf\Internal\SourceCodeInfo
+     */
+    public function getSourceCodeInfo()
+    {
+        return $this->source_code_info;
+    }
+
+    /**
+     * This field contains optional information about the original source code.
+     * You may safely remove this entire field without harming runtime
+     * functionality of the descriptors -- the information is needed only by
+     * development tools.
+     *
+     * Generated from protobuf field <code>optional .google.protobuf.SourceCodeInfo source_code_info = 9;</code>
+     * @param \Google\Protobuf\Internal\SourceCodeInfo $var
+     * @return $this
+     */
+    public function setSourceCodeInfo($var)
+    {
+        GPBUtil::checkMessage($var, \Google\Protobuf\Internal\SourceCodeInfo::class);
+        $this->source_code_info = $var;
+        $this->has_source_code_info = true;
+
+        return $this;
+    }
+
+    public function hasSourceCodeInfo()
+    {
+        return $this->has_source_code_info;
+    }
+
+    /**
+     * The syntax of the proto file.
+     * The supported values are "proto2" and "proto3".
+     *
+     * Generated from protobuf field <code>optional string syntax = 12;</code>
+     * @return string
+     */
+    public function getSyntax()
+    {
+        return $this->syntax;
+    }
+
+    /**
+     * The syntax of the proto file.
+     * The supported values are "proto2" and "proto3".
+     *
+     * Generated from protobuf field <code>optional string syntax = 12;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setSyntax($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->syntax = $var;
+        $this->has_syntax = true;
+
+        return $this;
+    }
+
+    public function hasSyntax()
+    {
+        return $this->has_syntax;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptorSet.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptorSet.php
new file mode 100644
index 0000000..9907b17
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptorSet.php
@@ -0,0 +1,70 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * The protocol compiler can output a FileDescriptorSet containing the .proto
+ * files it parses.
+ *
+ * Generated from protobuf message <code>google.protobuf.FileDescriptorSet</code>
+ */
+class FileDescriptorSet extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.FileDescriptorProto file = 1;</code>
+     */
+    private $file;
+    private $has_file = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type \Google\Protobuf\Internal\FileDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $file
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.FileDescriptorProto file = 1;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getFile()
+    {
+        return $this->file;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.FileDescriptorProto file = 1;</code>
+     * @param \Google\Protobuf\Internal\FileDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setFile($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FileDescriptorProto::class);
+        $this->file = $arr;
+        $this->has_file = true;
+
+        return $this;
+    }
+
+    public function hasFile()
+    {
+        return $this->has_file;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions.php
new file mode 100644
index 0000000..605d92b
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions.php
@@ -0,0 +1,1046 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Generated from protobuf message <code>google.protobuf.FileOptions</code>
+ */
+class FileOptions extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Sets the Java package where classes generated from this .proto will be
+     * placed.  By default, the proto package is used, but this is often
+     * inappropriate because proto packages do not normally start with backwards
+     * domain names.
+     *
+     * Generated from protobuf field <code>optional string java_package = 1;</code>
+     */
+    protected $java_package = '';
+    private $has_java_package = false;
+    /**
+     * If set, all the classes from the .proto file are wrapped in a single
+     * outer class with the given name.  This applies to both Proto1
+     * (equivalent to the old "--one_java_file" option) and Proto2 (where
+     * a .proto always translates to a single class, but you may want to
+     * explicitly choose the class name).
+     *
+     * Generated from protobuf field <code>optional string java_outer_classname = 8;</code>
+     */
+    protected $java_outer_classname = '';
+    private $has_java_outer_classname = false;
+    /**
+     * If set true, then the Java code generator will generate a separate .java
+     * file for each top-level message, enum, and service defined in the .proto
+     * file.  Thus, these types will *not* be nested inside the outer class
+     * named by java_outer_classname.  However, the outer class will still be
+     * generated to contain the file's getDescriptor() method as well as any
+     * top-level extensions defined in the file.
+     *
+     * Generated from protobuf field <code>optional bool java_multiple_files = 10 [default = false];</code>
+     */
+    protected $java_multiple_files = false;
+    private $has_java_multiple_files = false;
+    /**
+     * This option does nothing.
+     *
+     * Generated from protobuf field <code>optional bool java_generate_equals_and_hash = 20 [deprecated = true];</code>
+     */
+    protected $java_generate_equals_and_hash = false;
+    private $has_java_generate_equals_and_hash = false;
+    /**
+     * If set true, then the Java2 code generator will generate code that
+     * throws an exception whenever an attempt is made to assign a non-UTF-8
+     * byte sequence to a string field.
+     * Message reflection will do the same.
+     * However, an extension field still accepts non-UTF-8 byte sequences.
+     * This option has no effect on when used with the lite runtime.
+     *
+     * Generated from protobuf field <code>optional bool java_string_check_utf8 = 27 [default = false];</code>
+     */
+    protected $java_string_check_utf8 = false;
+    private $has_java_string_check_utf8 = false;
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED];</code>
+     */
+    protected $optimize_for = 0;
+    private $has_optimize_for = false;
+    /**
+     * Sets the Go package where structs generated from this .proto will be
+     * placed. If omitted, the Go package will be derived from the following:
+     *   - The basename of the package import path, if provided.
+     *   - Otherwise, the package statement in the .proto file, if present.
+     *   - Otherwise, the basename of the .proto file, without extension.
+     *
+     * Generated from protobuf field <code>optional string go_package = 11;</code>
+     */
+    protected $go_package = '';
+    private $has_go_package = false;
+    /**
+     * Should generic services be generated in each language?  "Generic" services
+     * are not specific to any particular RPC system.  They are generated by the
+     * main code generators in each language (without additional plugins).
+     * Generic services were the only kind of service generation supported by
+     * early versions of google.protobuf.
+     * Generic services are now considered deprecated in favor of using plugins
+     * that generate code specific to your particular RPC system.  Therefore,
+     * these default to false.  Old code which depends on generic services should
+     * explicitly set them to true.
+     *
+     * Generated from protobuf field <code>optional bool cc_generic_services = 16 [default = false];</code>
+     */
+    protected $cc_generic_services = false;
+    private $has_cc_generic_services = false;
+    /**
+     * Generated from protobuf field <code>optional bool java_generic_services = 17 [default = false];</code>
+     */
+    protected $java_generic_services = false;
+    private $has_java_generic_services = false;
+    /**
+     * Generated from protobuf field <code>optional bool py_generic_services = 18 [default = false];</code>
+     */
+    protected $py_generic_services = false;
+    private $has_py_generic_services = false;
+    /**
+     * Generated from protobuf field <code>optional bool php_generic_services = 42 [default = false];</code>
+     */
+    protected $php_generic_services = false;
+    private $has_php_generic_services = false;
+    /**
+     * Is this file deprecated?
+     * Depending on the target platform, this can emit Deprecated annotations
+     * for everything in the file, or it will be completely ignored; in the very
+     * least, this is a formalization for deprecating files.
+     *
+     * Generated from protobuf field <code>optional bool deprecated = 23 [default = false];</code>
+     */
+    protected $deprecated = false;
+    private $has_deprecated = false;
+    /**
+     * Enables the use of arenas for the proto messages in this file. This applies
+     * only to generated classes for C++.
+     *
+     * Generated from protobuf field <code>optional bool cc_enable_arenas = 31 [default = false];</code>
+     */
+    protected $cc_enable_arenas = false;
+    private $has_cc_enable_arenas = false;
+    /**
+     * Sets the objective c class prefix which is prepended to all objective c
+     * generated classes from this .proto. There is no default.
+     *
+     * Generated from protobuf field <code>optional string objc_class_prefix = 36;</code>
+     */
+    protected $objc_class_prefix = '';
+    private $has_objc_class_prefix = false;
+    /**
+     * Namespace for generated classes; defaults to the package.
+     *
+     * Generated from protobuf field <code>optional string csharp_namespace = 37;</code>
+     */
+    protected $csharp_namespace = '';
+    private $has_csharp_namespace = false;
+    /**
+     * By default Swift generators will take the proto package and CamelCase it
+     * replacing '.' with underscore and use that to prefix the types/symbols
+     * defined. When this options is provided, they will use this value instead
+     * to prefix the types/symbols defined.
+     *
+     * Generated from protobuf field <code>optional string swift_prefix = 39;</code>
+     */
+    protected $swift_prefix = '';
+    private $has_swift_prefix = false;
+    /**
+     * Sets the php class prefix which is prepended to all php generated classes
+     * from this .proto. Default is empty.
+     *
+     * Generated from protobuf field <code>optional string php_class_prefix = 40;</code>
+     */
+    protected $php_class_prefix = '';
+    private $has_php_class_prefix = false;
+    /**
+     * Use this option to change the namespace of php generated classes. Default
+     * is empty. When this option is empty, the package name will be used for
+     * determining the namespace.
+     *
+     * Generated from protobuf field <code>optional string php_namespace = 41;</code>
+     */
+    protected $php_namespace = '';
+    private $has_php_namespace = false;
+    /**
+     * Use this option to change the namespace of php generated metadata classes.
+     * Default is empty. When this option is empty, the proto file name will be
+     * used for determining the namespace.
+     *
+     * Generated from protobuf field <code>optional string php_metadata_namespace = 44;</code>
+     */
+    protected $php_metadata_namespace = '';
+    private $has_php_metadata_namespace = false;
+    /**
+     * Use this option to change the package of ruby generated classes. Default
+     * is empty. When this option is not set, the package name will be used for
+     * determining the ruby package.
+     *
+     * Generated from protobuf field <code>optional string ruby_package = 45;</code>
+     */
+    protected $ruby_package = '';
+    private $has_ruby_package = false;
+    /**
+     * The parser stores options it doesn't recognize here.
+     * See the documentation for the "Options" section above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     */
+    private $uninterpreted_option;
+    private $has_uninterpreted_option = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type string $java_package
+     *           Sets the Java package where classes generated from this .proto will be
+     *           placed.  By default, the proto package is used, but this is often
+     *           inappropriate because proto packages do not normally start with backwards
+     *           domain names.
+     *     @type string $java_outer_classname
+     *           If set, all the classes from the .proto file are wrapped in a single
+     *           outer class with the given name.  This applies to both Proto1
+     *           (equivalent to the old "--one_java_file" option) and Proto2 (where
+     *           a .proto always translates to a single class, but you may want to
+     *           explicitly choose the class name).
+     *     @type bool $java_multiple_files
+     *           If set true, then the Java code generator will generate a separate .java
+     *           file for each top-level message, enum, and service defined in the .proto
+     *           file.  Thus, these types will *not* be nested inside the outer class
+     *           named by java_outer_classname.  However, the outer class will still be
+     *           generated to contain the file's getDescriptor() method as well as any
+     *           top-level extensions defined in the file.
+     *     @type bool $java_generate_equals_and_hash
+     *           This option does nothing.
+     *     @type bool $java_string_check_utf8
+     *           If set true, then the Java2 code generator will generate code that
+     *           throws an exception whenever an attempt is made to assign a non-UTF-8
+     *           byte sequence to a string field.
+     *           Message reflection will do the same.
+     *           However, an extension field still accepts non-UTF-8 byte sequences.
+     *           This option has no effect on when used with the lite runtime.
+     *     @type int $optimize_for
+     *     @type string $go_package
+     *           Sets the Go package where structs generated from this .proto will be
+     *           placed. If omitted, the Go package will be derived from the following:
+     *             - The basename of the package import path, if provided.
+     *             - Otherwise, the package statement in the .proto file, if present.
+     *             - Otherwise, the basename of the .proto file, without extension.
+     *     @type bool $cc_generic_services
+     *           Should generic services be generated in each language?  "Generic" services
+     *           are not specific to any particular RPC system.  They are generated by the
+     *           main code generators in each language (without additional plugins).
+     *           Generic services were the only kind of service generation supported by
+     *           early versions of google.protobuf.
+     *           Generic services are now considered deprecated in favor of using plugins
+     *           that generate code specific to your particular RPC system.  Therefore,
+     *           these default to false.  Old code which depends on generic services should
+     *           explicitly set them to true.
+     *     @type bool $java_generic_services
+     *     @type bool $py_generic_services
+     *     @type bool $php_generic_services
+     *     @type bool $deprecated
+     *           Is this file deprecated?
+     *           Depending on the target platform, this can emit Deprecated annotations
+     *           for everything in the file, or it will be completely ignored; in the very
+     *           least, this is a formalization for deprecating files.
+     *     @type bool $cc_enable_arenas
+     *           Enables the use of arenas for the proto messages in this file. This applies
+     *           only to generated classes for C++.
+     *     @type string $objc_class_prefix
+     *           Sets the objective c class prefix which is prepended to all objective c
+     *           generated classes from this .proto. There is no default.
+     *     @type string $csharp_namespace
+     *           Namespace for generated classes; defaults to the package.
+     *     @type string $swift_prefix
+     *           By default Swift generators will take the proto package and CamelCase it
+     *           replacing '.' with underscore and use that to prefix the types/symbols
+     *           defined. When this options is provided, they will use this value instead
+     *           to prefix the types/symbols defined.
+     *     @type string $php_class_prefix
+     *           Sets the php class prefix which is prepended to all php generated classes
+     *           from this .proto. Default is empty.
+     *     @type string $php_namespace
+     *           Use this option to change the namespace of php generated classes. Default
+     *           is empty. When this option is empty, the package name will be used for
+     *           determining the namespace.
+     *     @type string $php_metadata_namespace
+     *           Use this option to change the namespace of php generated metadata classes.
+     *           Default is empty. When this option is empty, the proto file name will be
+     *           used for determining the namespace.
+     *     @type string $ruby_package
+     *           Use this option to change the package of ruby generated classes. Default
+     *           is empty. When this option is not set, the package name will be used for
+     *           determining the ruby package.
+     *     @type \Google\Protobuf\Internal\UninterpretedOption[]|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option
+     *           The parser stores options it doesn't recognize here.
+     *           See the documentation for the "Options" section above.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Sets the Java package where classes generated from this .proto will be
+     * placed.  By default, the proto package is used, but this is often
+     * inappropriate because proto packages do not normally start with backwards
+     * domain names.
+     *
+     * Generated from protobuf field <code>optional string java_package = 1;</code>
+     * @return string
+     */
+    public function getJavaPackage()
+    {
+        return $this->java_package;
+    }
+
+    /**
+     * Sets the Java package where classes generated from this .proto will be
+     * placed.  By default, the proto package is used, but this is often
+     * inappropriate because proto packages do not normally start with backwards
+     * domain names.
+     *
+     * Generated from protobuf field <code>optional string java_package = 1;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setJavaPackage($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->java_package = $var;
+        $this->has_java_package = true;
+
+        return $this;
+    }
+
+    public function hasJavaPackage()
+    {
+        return $this->has_java_package;
+    }
+
+    /**
+     * If set, all the classes from the .proto file are wrapped in a single
+     * outer class with the given name.  This applies to both Proto1
+     * (equivalent to the old "--one_java_file" option) and Proto2 (where
+     * a .proto always translates to a single class, but you may want to
+     * explicitly choose the class name).
+     *
+     * Generated from protobuf field <code>optional string java_outer_classname = 8;</code>
+     * @return string
+     */
+    public function getJavaOuterClassname()
+    {
+        return $this->java_outer_classname;
+    }
+
+    /**
+     * If set, all the classes from the .proto file are wrapped in a single
+     * outer class with the given name.  This applies to both Proto1
+     * (equivalent to the old "--one_java_file" option) and Proto2 (where
+     * a .proto always translates to a single class, but you may want to
+     * explicitly choose the class name).
+     *
+     * Generated from protobuf field <code>optional string java_outer_classname = 8;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setJavaOuterClassname($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->java_outer_classname = $var;
+        $this->has_java_outer_classname = true;
+
+        return $this;
+    }
+
+    public function hasJavaOuterClassname()
+    {
+        return $this->has_java_outer_classname;
+    }
+
+    /**
+     * If set true, then the Java code generator will generate a separate .java
+     * file for each top-level message, enum, and service defined in the .proto
+     * file.  Thus, these types will *not* be nested inside the outer class
+     * named by java_outer_classname.  However, the outer class will still be
+     * generated to contain the file's getDescriptor() method as well as any
+     * top-level extensions defined in the file.
+     *
+     * Generated from protobuf field <code>optional bool java_multiple_files = 10 [default = false];</code>
+     * @return bool
+     */
+    public function getJavaMultipleFiles()
+    {
+        return $this->java_multiple_files;
+    }
+
+    /**
+     * If set true, then the Java code generator will generate a separate .java
+     * file for each top-level message, enum, and service defined in the .proto
+     * file.  Thus, these types will *not* be nested inside the outer class
+     * named by java_outer_classname.  However, the outer class will still be
+     * generated to contain the file's getDescriptor() method as well as any
+     * top-level extensions defined in the file.
+     *
+     * Generated from protobuf field <code>optional bool java_multiple_files = 10 [default = false];</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setJavaMultipleFiles($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->java_multiple_files = $var;
+        $this->has_java_multiple_files = true;
+
+        return $this;
+    }
+
+    public function hasJavaMultipleFiles()
+    {
+        return $this->has_java_multiple_files;
+    }
+
+    /**
+     * This option does nothing.
+     *
+     * Generated from protobuf field <code>optional bool java_generate_equals_and_hash = 20 [deprecated = true];</code>
+     * @return bool
+     */
+    public function getJavaGenerateEqualsAndHash()
+    {
+        return $this->java_generate_equals_and_hash;
+    }
+
+    /**
+     * This option does nothing.
+     *
+     * Generated from protobuf field <code>optional bool java_generate_equals_and_hash = 20 [deprecated = true];</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setJavaGenerateEqualsAndHash($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->java_generate_equals_and_hash = $var;
+        $this->has_java_generate_equals_and_hash = true;
+
+        return $this;
+    }
+
+    public function hasJavaGenerateEqualsAndHash()
+    {
+        return $this->has_java_generate_equals_and_hash;
+    }
+
+    /**
+     * If set true, then the Java2 code generator will generate code that
+     * throws an exception whenever an attempt is made to assign a non-UTF-8
+     * byte sequence to a string field.
+     * Message reflection will do the same.
+     * However, an extension field still accepts non-UTF-8 byte sequences.
+     * This option has no effect on when used with the lite runtime.
+     *
+     * Generated from protobuf field <code>optional bool java_string_check_utf8 = 27 [default = false];</code>
+     * @return bool
+     */
+    public function getJavaStringCheckUtf8()
+    {
+        return $this->java_string_check_utf8;
+    }
+
+    /**
+     * If set true, then the Java2 code generator will generate code that
+     * throws an exception whenever an attempt is made to assign a non-UTF-8
+     * byte sequence to a string field.
+     * Message reflection will do the same.
+     * However, an extension field still accepts non-UTF-8 byte sequences.
+     * This option has no effect on when used with the lite runtime.
+     *
+     * Generated from protobuf field <code>optional bool java_string_check_utf8 = 27 [default = false];</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setJavaStringCheckUtf8($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->java_string_check_utf8 = $var;
+        $this->has_java_string_check_utf8 = true;
+
+        return $this;
+    }
+
+    public function hasJavaStringCheckUtf8()
+    {
+        return $this->has_java_string_check_utf8;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED];</code>
+     * @return int
+     */
+    public function getOptimizeFor()
+    {
+        return $this->optimize_for;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED];</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setOptimizeFor($var)
+    {
+        GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FileOptions_OptimizeMode::class);
+        $this->optimize_for = $var;
+        $this->has_optimize_for = true;
+
+        return $this;
+    }
+
+    public function hasOptimizeFor()
+    {
+        return $this->has_optimize_for;
+    }
+
+    /**
+     * Sets the Go package where structs generated from this .proto will be
+     * placed. If omitted, the Go package will be derived from the following:
+     *   - The basename of the package import path, if provided.
+     *   - Otherwise, the package statement in the .proto file, if present.
+     *   - Otherwise, the basename of the .proto file, without extension.
+     *
+     * Generated from protobuf field <code>optional string go_package = 11;</code>
+     * @return string
+     */
+    public function getGoPackage()
+    {
+        return $this->go_package;
+    }
+
+    /**
+     * Sets the Go package where structs generated from this .proto will be
+     * placed. If omitted, the Go package will be derived from the following:
+     *   - The basename of the package import path, if provided.
+     *   - Otherwise, the package statement in the .proto file, if present.
+     *   - Otherwise, the basename of the .proto file, without extension.
+     *
+     * Generated from protobuf field <code>optional string go_package = 11;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setGoPackage($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->go_package = $var;
+        $this->has_go_package = true;
+
+        return $this;
+    }
+
+    public function hasGoPackage()
+    {
+        return $this->has_go_package;
+    }
+
+    /**
+     * Should generic services be generated in each language?  "Generic" services
+     * are not specific to any particular RPC system.  They are generated by the
+     * main code generators in each language (without additional plugins).
+     * Generic services were the only kind of service generation supported by
+     * early versions of google.protobuf.
+     * Generic services are now considered deprecated in favor of using plugins
+     * that generate code specific to your particular RPC system.  Therefore,
+     * these default to false.  Old code which depends on generic services should
+     * explicitly set them to true.
+     *
+     * Generated from protobuf field <code>optional bool cc_generic_services = 16 [default = false];</code>
+     * @return bool
+     */
+    public function getCcGenericServices()
+    {
+        return $this->cc_generic_services;
+    }
+
+    /**
+     * Should generic services be generated in each language?  "Generic" services
+     * are not specific to any particular RPC system.  They are generated by the
+     * main code generators in each language (without additional plugins).
+     * Generic services were the only kind of service generation supported by
+     * early versions of google.protobuf.
+     * Generic services are now considered deprecated in favor of using plugins
+     * that generate code specific to your particular RPC system.  Therefore,
+     * these default to false.  Old code which depends on generic services should
+     * explicitly set them to true.
+     *
+     * Generated from protobuf field <code>optional bool cc_generic_services = 16 [default = false];</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setCcGenericServices($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->cc_generic_services = $var;
+        $this->has_cc_generic_services = true;
+
+        return $this;
+    }
+
+    public function hasCcGenericServices()
+    {
+        return $this->has_cc_generic_services;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional bool java_generic_services = 17 [default = false];</code>
+     * @return bool
+     */
+    public function getJavaGenericServices()
+    {
+        return $this->java_generic_services;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional bool java_generic_services = 17 [default = false];</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setJavaGenericServices($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->java_generic_services = $var;
+        $this->has_java_generic_services = true;
+
+        return $this;
+    }
+
+    public function hasJavaGenericServices()
+    {
+        return $this->has_java_generic_services;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional bool py_generic_services = 18 [default = false];</code>
+     * @return bool
+     */
+    public function getPyGenericServices()
+    {
+        return $this->py_generic_services;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional bool py_generic_services = 18 [default = false];</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setPyGenericServices($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->py_generic_services = $var;
+        $this->has_py_generic_services = true;
+
+        return $this;
+    }
+
+    public function hasPyGenericServices()
+    {
+        return $this->has_py_generic_services;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional bool php_generic_services = 42 [default = false];</code>
+     * @return bool
+     */
+    public function getPhpGenericServices()
+    {
+        return $this->php_generic_services;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional bool php_generic_services = 42 [default = false];</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setPhpGenericServices($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->php_generic_services = $var;
+        $this->has_php_generic_services = true;
+
+        return $this;
+    }
+
+    public function hasPhpGenericServices()
+    {
+        return $this->has_php_generic_services;
+    }
+
+    /**
+     * Is this file deprecated?
+     * Depending on the target platform, this can emit Deprecated annotations
+     * for everything in the file, or it will be completely ignored; in the very
+     * least, this is a formalization for deprecating files.
+     *
+     * Generated from protobuf field <code>optional bool deprecated = 23 [default = false];</code>
+     * @return bool
+     */
+    public function getDeprecated()
+    {
+        return $this->deprecated;
+    }
+
+    /**
+     * Is this file deprecated?
+     * Depending on the target platform, this can emit Deprecated annotations
+     * for everything in the file, or it will be completely ignored; in the very
+     * least, this is a formalization for deprecating files.
+     *
+     * Generated from protobuf field <code>optional bool deprecated = 23 [default = false];</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setDeprecated($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->deprecated = $var;
+        $this->has_deprecated = true;
+
+        return $this;
+    }
+
+    public function hasDeprecated()
+    {
+        return $this->has_deprecated;
+    }
+
+    /**
+     * Enables the use of arenas for the proto messages in this file. This applies
+     * only to generated classes for C++.
+     *
+     * Generated from protobuf field <code>optional bool cc_enable_arenas = 31 [default = false];</code>
+     * @return bool
+     */
+    public function getCcEnableArenas()
+    {
+        return $this->cc_enable_arenas;
+    }
+
+    /**
+     * Enables the use of arenas for the proto messages in this file. This applies
+     * only to generated classes for C++.
+     *
+     * Generated from protobuf field <code>optional bool cc_enable_arenas = 31 [default = false];</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setCcEnableArenas($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->cc_enable_arenas = $var;
+        $this->has_cc_enable_arenas = true;
+
+        return $this;
+    }
+
+    public function hasCcEnableArenas()
+    {
+        return $this->has_cc_enable_arenas;
+    }
+
+    /**
+     * Sets the objective c class prefix which is prepended to all objective c
+     * generated classes from this .proto. There is no default.
+     *
+     * Generated from protobuf field <code>optional string objc_class_prefix = 36;</code>
+     * @return string
+     */
+    public function getObjcClassPrefix()
+    {
+        return $this->objc_class_prefix;
+    }
+
+    /**
+     * Sets the objective c class prefix which is prepended to all objective c
+     * generated classes from this .proto. There is no default.
+     *
+     * Generated from protobuf field <code>optional string objc_class_prefix = 36;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setObjcClassPrefix($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->objc_class_prefix = $var;
+        $this->has_objc_class_prefix = true;
+
+        return $this;
+    }
+
+    public function hasObjcClassPrefix()
+    {
+        return $this->has_objc_class_prefix;
+    }
+
+    /**
+     * Namespace for generated classes; defaults to the package.
+     *
+     * Generated from protobuf field <code>optional string csharp_namespace = 37;</code>
+     * @return string
+     */
+    public function getCsharpNamespace()
+    {
+        return $this->csharp_namespace;
+    }
+
+    /**
+     * Namespace for generated classes; defaults to the package.
+     *
+     * Generated from protobuf field <code>optional string csharp_namespace = 37;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setCsharpNamespace($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->csharp_namespace = $var;
+        $this->has_csharp_namespace = true;
+
+        return $this;
+    }
+
+    public function hasCsharpNamespace()
+    {
+        return $this->has_csharp_namespace;
+    }
+
+    /**
+     * By default Swift generators will take the proto package and CamelCase it
+     * replacing '.' with underscore and use that to prefix the types/symbols
+     * defined. When this options is provided, they will use this value instead
+     * to prefix the types/symbols defined.
+     *
+     * Generated from protobuf field <code>optional string swift_prefix = 39;</code>
+     * @return string
+     */
+    public function getSwiftPrefix()
+    {
+        return $this->swift_prefix;
+    }
+
+    /**
+     * By default Swift generators will take the proto package and CamelCase it
+     * replacing '.' with underscore and use that to prefix the types/symbols
+     * defined. When this options is provided, they will use this value instead
+     * to prefix the types/symbols defined.
+     *
+     * Generated from protobuf field <code>optional string swift_prefix = 39;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setSwiftPrefix($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->swift_prefix = $var;
+        $this->has_swift_prefix = true;
+
+        return $this;
+    }
+
+    public function hasSwiftPrefix()
+    {
+        return $this->has_swift_prefix;
+    }
+
+    /**
+     * Sets the php class prefix which is prepended to all php generated classes
+     * from this .proto. Default is empty.
+     *
+     * Generated from protobuf field <code>optional string php_class_prefix = 40;</code>
+     * @return string
+     */
+    public function getPhpClassPrefix()
+    {
+        return $this->php_class_prefix;
+    }
+
+    /**
+     * Sets the php class prefix which is prepended to all php generated classes
+     * from this .proto. Default is empty.
+     *
+     * Generated from protobuf field <code>optional string php_class_prefix = 40;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setPhpClassPrefix($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->php_class_prefix = $var;
+        $this->has_php_class_prefix = true;
+
+        return $this;
+    }
+
+    public function hasPhpClassPrefix()
+    {
+        return $this->has_php_class_prefix;
+    }
+
+    /**
+     * Use this option to change the namespace of php generated classes. Default
+     * is empty. When this option is empty, the package name will be used for
+     * determining the namespace.
+     *
+     * Generated from protobuf field <code>optional string php_namespace = 41;</code>
+     * @return string
+     */
+    public function getPhpNamespace()
+    {
+        return $this->php_namespace;
+    }
+
+    /**
+     * Use this option to change the namespace of php generated classes. Default
+     * is empty. When this option is empty, the package name will be used for
+     * determining the namespace.
+     *
+     * Generated from protobuf field <code>optional string php_namespace = 41;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setPhpNamespace($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->php_namespace = $var;
+        $this->has_php_namespace = true;
+
+        return $this;
+    }
+
+    public function hasPhpNamespace()
+    {
+        return $this->has_php_namespace;
+    }
+
+    /**
+     * Use this option to change the namespace of php generated metadata classes.
+     * Default is empty. When this option is empty, the proto file name will be
+     * used for determining the namespace.
+     *
+     * Generated from protobuf field <code>optional string php_metadata_namespace = 44;</code>
+     * @return string
+     */
+    public function getPhpMetadataNamespace()
+    {
+        return $this->php_metadata_namespace;
+    }
+
+    /**
+     * Use this option to change the namespace of php generated metadata classes.
+     * Default is empty. When this option is empty, the proto file name will be
+     * used for determining the namespace.
+     *
+     * Generated from protobuf field <code>optional string php_metadata_namespace = 44;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setPhpMetadataNamespace($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->php_metadata_namespace = $var;
+        $this->has_php_metadata_namespace = true;
+
+        return $this;
+    }
+
+    public function hasPhpMetadataNamespace()
+    {
+        return $this->has_php_metadata_namespace;
+    }
+
+    /**
+     * Use this option to change the package of ruby generated classes. Default
+     * is empty. When this option is not set, the package name will be used for
+     * determining the ruby package.
+     *
+     * Generated from protobuf field <code>optional string ruby_package = 45;</code>
+     * @return string
+     */
+    public function getRubyPackage()
+    {
+        return $this->ruby_package;
+    }
+
+    /**
+     * Use this option to change the package of ruby generated classes. Default
+     * is empty. When this option is not set, the package name will be used for
+     * determining the ruby package.
+     *
+     * Generated from protobuf field <code>optional string ruby_package = 45;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setRubyPackage($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->ruby_package = $var;
+        $this->has_ruby_package = true;
+
+        return $this;
+    }
+
+    public function hasRubyPackage()
+    {
+        return $this->has_ruby_package;
+    }
+
+    /**
+     * The parser stores options it doesn't recognize here.
+     * See the documentation for the "Options" section above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getUninterpretedOption()
+    {
+        return $this->uninterpreted_option;
+    }
+
+    /**
+     * The parser stores options it doesn't recognize here.
+     * See the documentation for the "Options" section above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     * @param \Google\Protobuf\Internal\UninterpretedOption[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setUninterpretedOption($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class);
+        $this->uninterpreted_option = $arr;
+        $this->has_uninterpreted_option = true;
+
+        return $this;
+    }
+
+    public function hasUninterpretedOption()
+    {
+        return $this->has_uninterpreted_option;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions/OptimizeMode.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions/OptimizeMode.php
new file mode 100644
index 0000000..0df27b5
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions/OptimizeMode.php
@@ -0,0 +1,64 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal\FileOptions;
+
+use UnexpectedValueException;
+
+/**
+ * Generated classes can be optimized for speed or code size.
+ *
+ * Protobuf type <code>google.protobuf.FileOptions.OptimizeMode</code>
+ */
+class OptimizeMode
+{
+    /**
+     * Generate complete code for parsing, serialization,
+     *
+     * Generated from protobuf enum <code>SPEED = 1;</code>
+     */
+    const SPEED = 1;
+    /**
+     * etc.
+     *
+     * Generated from protobuf enum <code>CODE_SIZE = 2;</code>
+     */
+    const CODE_SIZE = 2;
+    /**
+     * Generate code using MessageLite and the lite runtime.
+     *
+     * Generated from protobuf enum <code>LITE_RUNTIME = 3;</code>
+     */
+    const LITE_RUNTIME = 3;
+
+    private static $valueToName = [
+        self::SPEED => 'SPEED',
+        self::CODE_SIZE => 'CODE_SIZE',
+        self::LITE_RUNTIME => 'LITE_RUNTIME',
+    ];
+
+    public static function name($value)
+    {
+        if (!isset(self::$valueToName[$value])) {
+            throw new UnexpectedValueException(sprintf(
+                    'Enum %s has no name defined for value %s', __CLASS__, $value));
+        }
+        return self::$valueToName[$value];
+    }
+
+
+    public static function value($name)
+    {
+        $const = __CLASS__ . '::' . strtoupper($name);
+        if (!defined($const)) {
+            throw new UnexpectedValueException(sprintf(
+                    'Enum %s has no value defined for name %s', __CLASS__, $name));
+        }
+        return constant($const);
+    }
+}
+
+// Adding a class alias for backwards compatibility with the previous class name.
+class_alias(OptimizeMode::class, \Google\Protobuf\Internal\FileOptions_OptimizeMode::class);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions_OptimizeMode.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions_OptimizeMode.php
new file mode 100644
index 0000000..8926e63
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions_OptimizeMode.php
@@ -0,0 +1,16 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+if (false) {
+    /**
+     * This class is deprecated. Use Google\Protobuf\Internal\FileOptions\OptimizeMode instead.
+     * @deprecated
+     */
+    class FileOptions_OptimizeMode {}
+}
+class_exists(FileOptions\OptimizeMode::class);
+@trigger_error('Google\Protobuf\Internal\FileOptions_OptimizeMode is deprecated and will be removed in the next major release. Use Google\Protobuf\Internal\FileOptions\OptimizeMode instead', E_USER_DEPRECATED);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBDecodeException.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBDecodeException.php
new file mode 100644
index 0000000..402d542
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBDecodeException.php
@@ -0,0 +1,47 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf\Internal;
+
+class GPBDecodeException extends \Exception
+{
+    public function __construct(
+        $message,
+        $code = 0,
+        \Exception $previous = null)
+    {
+        parent::__construct(
+            "Error occurred during parsing: " . $message,
+            $code,
+            $previous);
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBJsonWire.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBJsonWire.php
new file mode 100644
index 0000000..43f4745
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBJsonWire.php
@@ -0,0 +1,304 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf\Internal;
+
+class GPBJsonWire
+{
+
+    public static function serializeFieldToStream(
+        $value,
+        $field,
+        &$output, $has_field_name = true)
+    {
+        if ($has_field_name) {
+            $output->writeRaw("\"", 1);
+            $field_name = GPBJsonWire::formatFieldName($field);
+            $output->writeRaw($field_name, strlen($field_name));
+            $output->writeRaw("\":", 2);
+        }
+        return static::serializeFieldValueToStream(
+            $value,
+            $field,
+            $output,
+            !$has_field_name);
+    }
+
+    public static function serializeFieldValueToStream(
+        $values,
+        $field,
+        &$output,
+        $is_well_known = false)
+    {
+        if ($field->isMap()) {
+            $output->writeRaw("{", 1);
+            $first = true;
+            $map_entry = $field->getMessageType();
+            $key_field = $map_entry->getFieldByNumber(1);
+            $value_field = $map_entry->getFieldByNumber(2);
+
+            switch ($key_field->getType()) {
+            case GPBType::STRING:
+            case GPBType::SFIXED64:
+            case GPBType::INT64:
+            case GPBType::SINT64:
+            case GPBType::FIXED64:
+            case GPBType::UINT64:
+                $additional_quote = false;
+                break;
+            default:
+                $additional_quote = true;
+            }
+
+            foreach ($values as $key => $value) {
+                if ($first) {
+                    $first = false;
+                } else {
+                    $output->writeRaw(",", 1);
+                }
+                if ($additional_quote) {
+                    $output->writeRaw("\"", 1);
+                }
+                if (!static::serializeSingularFieldValueToStream(
+                    $key,
+                    $key_field,
+                    $output,
+                    $is_well_known)) {
+                    return false;
+                }
+                if ($additional_quote) {
+                    $output->writeRaw("\"", 1);
+                }
+                $output->writeRaw(":", 1);
+                if (!static::serializeSingularFieldValueToStream(
+                    $value,
+                    $value_field,
+                    $output,
+                    $is_well_known)) {
+                    return false;
+                }
+            }
+            $output->writeRaw("}", 1);
+            return true;
+        } elseif ($field->isRepeated()) {
+            $output->writeRaw("[", 1);
+            $first = true;
+            foreach ($values as $value) {
+                if ($first) {
+                    $first = false;
+                } else {
+                    $output->writeRaw(",", 1);
+                }
+                if (!static::serializeSingularFieldValueToStream(
+                    $value,
+                    $field,
+                    $output,
+                    $is_well_known)) {
+                    return false;
+                }
+            }
+            $output->writeRaw("]", 1);
+            return true;
+        } else {
+            return static::serializeSingularFieldValueToStream(
+                $values,
+                $field,
+                $output,
+                $is_well_known);
+        }
+    }
+
+    private static function serializeSingularFieldValueToStream(
+        $value,
+        $field,
+        &$output, $is_well_known = false)
+    {
+        switch ($field->getType()) {
+            case GPBType::SFIXED32:
+            case GPBType::SINT32:
+            case GPBType::INT32:
+                $str_value = strval($value);
+                $output->writeRaw($str_value, strlen($str_value));
+                break;
+            case GPBType::FIXED32:
+            case GPBType::UINT32:
+                if ($value < 0) {
+                    $value = bcadd($value, "4294967296");
+                }
+                $str_value = strval($value);
+                $output->writeRaw($str_value, strlen($str_value));
+                break;
+            case GPBType::FIXED64:
+            case GPBType::UINT64:
+                if ($value < 0) {
+                    $value = bcadd($value, "18446744073709551616");
+                }
+                // Intentional fall through.
+            case GPBType::SFIXED64:
+            case GPBType::INT64:
+            case GPBType::SINT64:
+                $output->writeRaw("\"", 1);
+                $str_value = strval($value);
+                $output->writeRaw($str_value, strlen($str_value));
+                $output->writeRaw("\"", 1);
+                break;
+            case GPBType::FLOAT:
+                if (is_nan($value)) {
+                    $str_value = "\"NaN\"";
+                } elseif ($value === INF) {
+                    $str_value = "\"Infinity\"";
+                } elseif ($value === -INF) {
+                    $str_value = "\"-Infinity\"";
+                } else {
+                    $str_value = sprintf("%.8g", $value);
+                }
+                $output->writeRaw($str_value, strlen($str_value));
+                break;
+            case GPBType::DOUBLE:
+                if (is_nan($value)) {
+                    $str_value = "\"NaN\"";
+                } elseif ($value === INF) {
+                    $str_value = "\"Infinity\"";
+                } elseif ($value === -INF) {
+                    $str_value = "\"-Infinity\"";
+                } else {
+                    $str_value = sprintf("%.17g", $value);
+                }
+                $output->writeRaw($str_value, strlen($str_value));
+                break;
+            case GPBType::ENUM:
+                $enum_desc = $field->getEnumType();
+                if ($enum_desc->getClass() === "Google\Protobuf\NullValue") {
+                    $output->writeRaw("null", 4);
+                    break;
+                }
+                $enum_value_desc = $enum_desc->getValueByNumber($value);
+                if (!is_null($enum_value_desc)) {
+                    $str_value = $enum_value_desc->getName();
+                    $output->writeRaw("\"", 1);
+                    $output->writeRaw($str_value, strlen($str_value));
+                    $output->writeRaw("\"", 1);
+                } else {
+                    $str_value = strval($value);
+                    $output->writeRaw($str_value, strlen($str_value));
+                }
+                break;
+            case GPBType::BOOL:
+                if ($value) {
+                    $output->writeRaw("true", 4);
+                } else {
+                    $output->writeRaw("false", 5);
+                }
+                break;
+            case GPBType::BYTES:
+                $bytes_value = base64_encode($value);
+                $output->writeRaw("\"", 1);
+                $output->writeRaw($bytes_value, strlen($bytes_value));
+                $output->writeRaw("\"", 1);
+                break;
+            case GPBType::STRING:
+                $value = json_encode($value, JSON_UNESCAPED_UNICODE);
+                $output->writeRaw($value, strlen($value));
+                break;
+            //    case GPBType::GROUP:
+            //      echo "GROUP\xA";
+            //      trigger_error("Not implemented.", E_ERROR);
+            //      break;
+            case GPBType::MESSAGE:
+                $value->serializeToJsonStream($output);
+                break;
+            default:
+                user_error("Unsupported type.");
+                return false;
+        }
+        return true;
+    }
+
+    private static function formatFieldName($field)
+    {
+        return $field->getJsonName();
+    }
+
+    // Used for escaping control chars in strings.
+    private static $k_control_char_limit = 0x20;
+
+    private static function jsonNiceEscape($c)
+    {
+      switch ($c) {
+          case '"':  return "\\\"";
+          case '\\': return "\\\\";
+          case '/': return "\\/";
+          case '\b': return "\\b";
+          case '\f': return "\\f";
+          case '\n': return "\\n";
+          case '\r': return "\\r";
+          case '\t': return "\\t";
+          default:   return NULL;
+      }
+    }
+
+    private static function isJsonEscaped($c)
+    {
+        // See RFC 4627.
+        return $c < chr($k_control_char_limit) || $c === "\"" || $c === "\\";
+    }
+
+    public static function escapedJson($value)
+    {
+        $escaped_value = "";
+        $unescaped_run = "";
+        for ($i = 0; $i < strlen($value); $i++) {
+            $c = $value[$i];
+            // Handle escaping.
+            if (static::isJsonEscaped($c)) {
+                // Use a "nice" escape, like \n, if one exists for this
+                // character.
+                $escape = static::jsonNiceEscape($c);
+                if (is_null($escape)) {
+                    $escape = "\\u00" . bin2hex($c);
+                }
+                if ($unescaped_run !== "") {
+                    $escaped_value .= $unescaped_run;
+                    $unescaped_run = "";
+                }
+                $escaped_value .= $escape;
+            } else {
+              if ($unescaped_run === "") {
+                $unescaped_run .= $c;
+              }
+            }
+        }
+        $escaped_value .= $unescaped_run;
+        return $escaped_value;
+    }
+
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBLabel.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBLabel.php
new file mode 100644
index 0000000..0fb2384
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBLabel.php
@@ -0,0 +1,40 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf\Internal;
+
+class GPBLabel
+{
+    const OPTIONAL = 1;
+    const REQUIRED = 2;
+    const REPEATED = 3;
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBType.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBType.php
new file mode 100644
index 0000000..fa849ce
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBType.php
@@ -0,0 +1,55 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf\Internal;
+
+class GPBType
+{
+    const DOUBLE   =  1;
+    const FLOAT    =  2;
+    const INT64    =  3;
+    const UINT64   =  4;
+    const INT32    =  5;
+    const FIXED64  =  6;
+    const FIXED32  =  7;
+    const BOOL     =  8;
+    const STRING   =  9;
+    const GROUP    = 10;
+    const MESSAGE  = 11;
+    const BYTES    = 12;
+    const UINT32   = 13;
+    const ENUM     = 14;
+    const SFIXED32 = 15;
+    const SFIXED64 = 16;
+    const SINT32   = 17;
+    const SINT64   = 18;
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBUtil.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBUtil.php
new file mode 100644
index 0000000..7ec3ca2
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBUtil.php
@@ -0,0 +1,615 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Duration;
+use Google\Protobuf\FieldMask;
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\MapField;
+
+function camel2underscore($input) {
+    preg_match_all(
+        '!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!',
+        $input,
+        $matches);
+    $ret = $matches[0];
+    foreach ($ret as &$match) {
+        $match = $match == strtoupper($match) ? strtolower($match) : lcfirst($match);
+    }
+    return implode('_', $ret);
+}
+
+class GPBUtil
+{
+    const NANOS_PER_MILLISECOND = 1000000;
+    const NANOS_PER_MICROSECOND = 1000;
+    const TYPE_URL_PREFIX = 'type.googleapis.com/';
+
+    public static function divideInt64ToInt32($value, &$high, &$low, $trim = false)
+    {
+        $isNeg = (bccomp($value, 0) < 0);
+        if ($isNeg) {
+            $value = bcsub(0, $value);
+        }
+
+        $high = bcdiv($value, 4294967296);
+        $low = bcmod($value, 4294967296);
+        if (bccomp($high, 2147483647) > 0) {
+            $high = (int) bcsub($high, 4294967296);
+        } else {
+            $high = (int) $high;
+        }
+        if (bccomp($low, 2147483647) > 0) {
+            $low = (int) bcsub($low, 4294967296);
+        } else {
+            $low = (int) $low;
+        }
+
+        if ($isNeg) {
+            $high = ~$high;
+            $low = ~$low;
+            $low++;
+            if (!$low) {
+                $high = (int)($high + 1);
+            }
+        }
+
+        if ($trim) {
+            $high = 0;
+        }
+    }
+
+    public static function checkString(&$var, $check_utf8)
+    {
+        if (is_array($var) || is_object($var)) {
+            throw new \InvalidArgumentException("Expect string.");
+        }
+        if (!is_string($var)) {
+            $var = strval($var);
+        }
+        if ($check_utf8 && !preg_match('//u', $var)) {
+            throw new \Exception("Expect utf-8 encoding.");
+        }
+    }
+
+    public static function checkEnum(&$var)
+    {
+      static::checkInt32($var);
+    }
+
+    public static function checkInt32(&$var)
+    {
+        if (is_numeric($var)) {
+            $var = intval($var);
+        } else {
+            throw new \Exception("Expect integer.");
+        }
+    }
+
+    public static function checkUint32(&$var)
+    {
+        if (is_numeric($var)) {
+            if (PHP_INT_SIZE === 8) {
+                $var = intval($var);
+                $var |= ((-(($var >> 31) & 0x1)) & ~0xFFFFFFFF);
+            } else {
+                if (bccomp($var, 0x7FFFFFFF) > 0) {
+                    $var = bcsub($var, "4294967296");
+                }
+                $var = (int) $var;
+            }
+        } else {
+            throw new \Exception("Expect integer.");
+        }
+    }
+
+    public static function checkInt64(&$var)
+    {
+        if (is_numeric($var)) {
+            if (PHP_INT_SIZE == 8) {
+                $var = intval($var);
+            } else {
+                if (is_float($var) ||
+                    is_integer($var) ||
+                    (is_string($var) &&
+                         bccomp($var, "9223372036854774784") < 0)) {
+                    $var = number_format($var, 0, ".", "");
+                }
+            }
+        } else {
+            throw new \Exception("Expect integer.");
+        }
+    }
+
+    public static function checkUint64(&$var)
+    {
+        if (is_numeric($var)) {
+            if (PHP_INT_SIZE == 8) {
+                $var = intval($var);
+            } else {
+                $var = number_format($var, 0, ".", "");
+            }
+        } else {
+            throw new \Exception("Expect integer.");
+        }
+    }
+
+    public static function checkFloat(&$var)
+    {
+        if (is_float($var) || is_numeric($var)) {
+            $var = floatval($var);
+        } else {
+            throw new \Exception("Expect float.");
+        }
+    }
+
+    public static function checkDouble(&$var)
+    {
+        if (is_float($var) || is_numeric($var)) {
+            $var = floatval($var);
+        } else {
+            throw new \Exception("Expect float.");
+        }
+    }
+
+    public static function checkBool(&$var)
+    {
+        if (is_array($var) || is_object($var)) {
+            throw new \Exception("Expect boolean.");
+        }
+        $var = boolval($var);
+    }
+
+    public static function checkMessage(&$var, $klass, $newClass = null)
+    {
+        if (!$var instanceof $klass && !is_null($var)) {
+            throw new \Exception("Expect $klass.");
+        }
+    }
+
+    public static function checkRepeatedField(&$var, $type, $klass = null)
+    {
+        if (!$var instanceof RepeatedField && !is_array($var)) {
+            throw new \Exception("Expect array.");
+        }
+        if (is_array($var)) {
+            $tmp = new RepeatedField($type, $klass);
+            foreach ($var as $value) {
+                $tmp[] = $value;
+            }
+            return $tmp;
+        } else {
+            if ($var->getType() != $type) {
+                throw new \Exception(
+                    "Expect repeated field of different type.");
+            }
+            if ($var->getType() === GPBType::MESSAGE &&
+                $var->getClass() !== $klass &&
+                $var->getLegacyClass() !== $klass) {
+                throw new \Exception(
+                    "Expect repeated field of " . $klass . ".");
+            }
+            return $var;
+        }
+    }
+
+    public static function checkMapField(&$var, $key_type, $value_type, $klass = null)
+    {
+        if (!$var instanceof MapField && !is_array($var)) {
+            throw new \Exception("Expect dict.");
+        }
+        if (is_array($var)) {
+            $tmp = new MapField($key_type, $value_type, $klass);
+            foreach ($var as $key => $value) {
+                $tmp[$key] = $value;
+            }
+            return $tmp;
+        } else {
+            if ($var->getKeyType() != $key_type) {
+                throw new \Exception("Expect map field of key type.");
+            }
+            if ($var->getValueType() != $value_type) {
+                throw new \Exception("Expect map field of value type.");
+            }
+            if ($var->getValueType() === GPBType::MESSAGE &&
+                $var->getValueClass() !== $klass &&
+                $var->getLegacyValueClass() !== $klass) {
+                throw new \Exception(
+                    "Expect map field of " . $klass . ".");
+            }
+            return $var;
+        }
+    }
+
+    public static function Int64($value)
+    {
+        return new Int64($value);
+    }
+
+    public static function Uint64($value)
+    {
+        return new Uint64($value);
+    }
+
+    public static function getClassNamePrefix(
+        $classname,
+        $file_proto)
+    {
+        $option = $file_proto->getOptions();
+        $prefix = is_null($option) ? "" : $option->getPhpClassPrefix();
+        if ($prefix !== "") {
+            return $prefix;
+        }
+
+        $reserved_words = array(
+            "abstract"=>0, "and"=>0, "array"=>0, "as"=>0, "break"=>0,
+            "callable"=>0, "case"=>0, "catch"=>0, "class"=>0, "clone"=>0,
+            "const"=>0, "continue"=>0, "declare"=>0, "default"=>0, "die"=>0,
+            "do"=>0, "echo"=>0, "else"=>0, "elseif"=>0, "empty"=>0,
+            "enddeclare"=>0, "endfor"=>0, "endforeach"=>0, "endif"=>0,
+            "endswitch"=>0, "endwhile"=>0, "eval"=>0, "exit"=>0, "extends"=>0,
+            "final"=>0, "for"=>0, "foreach"=>0, "function"=>0, "global"=>0,
+            "goto"=>0, "if"=>0, "implements"=>0, "include"=>0,
+            "include_once"=>0, "instanceof"=>0, "insteadof"=>0, "interface"=>0,
+            "isset"=>0, "list"=>0, "namespace"=>0, "new"=>0, "or"=>0,
+            "print"=>0, "private"=>0, "protected"=>0, "public"=>0, "require"=>0,
+            "require_once"=>0, "return"=>0, "static"=>0, "switch"=>0,
+            "throw"=>0, "trait"=>0, "try"=>0, "unset"=>0, "use"=>0, "var"=>0,
+            "while"=>0, "xor"=>0, "int"=>0, "float"=>0, "bool"=>0, "string"=>0,
+            "true"=>0, "false"=>0, "null"=>0, "void"=>0, "iterable"=>0
+        );
+
+        if (array_key_exists(strtolower($classname), $reserved_words)) {
+            if ($file_proto->getPackage() === "google.protobuf") {
+                return "GPB";
+            } else {
+                return "PB";
+            }
+        }
+
+        return "";
+    }
+
+    public static function getLegacyClassNameWithoutPackage(
+        $name,
+        $file_proto)
+    {
+        $classname = implode('_', explode('.', $name));
+        return static::getClassNamePrefix($classname, $file_proto) . $classname;
+    }
+
+    public static function getClassNameWithoutPackage(
+        $name,
+        $file_proto)
+    {
+        $parts = explode('.', $name);
+        foreach ($parts as $i => $part) {
+            $parts[$i] = static::getClassNamePrefix($parts[$i], $file_proto) . $parts[$i];
+        }
+        return implode('\\', $parts);
+    }
+
+    public static function getFullClassName(
+        $proto,
+        $containing,
+        $file_proto,
+        &$message_name_without_package,
+        &$classname,
+        &$legacy_classname,
+        &$fullname)
+    {
+        // Full name needs to start with '.'.
+        $message_name_without_package = $proto->getName();
+        if ($containing !== "") {
+            $message_name_without_package =
+                $containing . "." . $message_name_without_package;
+        }
+
+        $package = $file_proto->getPackage();
+        if ($package === "") {
+            $fullname = "." . $message_name_without_package;
+        } else {
+            $fullname = "." . $package . "." . $message_name_without_package;
+        }
+
+        $class_name_without_package =
+            static::getClassNameWithoutPackage($message_name_without_package, $file_proto);
+        $legacy_class_name_without_package =
+            static::getLegacyClassNameWithoutPackage(
+                $message_name_without_package, $file_proto);
+
+        $option = $file_proto->getOptions();
+        if (!is_null($option) && $option->hasPhpNamespace()) {
+            $namespace = $option->getPhpNamespace();
+            if ($namespace !== "") {
+                $classname = $namespace . "\\" . $class_name_without_package;
+                $legacy_classname =
+                    $namespace . "\\" . $legacy_class_name_without_package;
+                return;
+            } else {
+                $classname = $class_name_without_package;
+                $legacy_classname = $legacy_class_name_without_package;
+                return;
+            }
+        }
+
+        if ($package === "") {
+            $classname = $class_name_without_package;
+            $legacy_classname = $legacy_class_name_without_package;
+        } else {
+            $parts = array_map('ucwords', explode('.', $package));
+            foreach ($parts as $i => $part) {
+                $parts[$i] = self::getClassNamePrefix($part, $file_proto).$part;
+            }
+            $classname =
+                implode('\\', $parts) .
+                "\\".self::getClassNamePrefix($class_name_without_package,$file_proto).
+                $class_name_without_package;
+            $legacy_classname =
+                implode('\\', array_map('ucwords', explode('.', $package))).
+                "\\".$legacy_class_name_without_package;
+        }
+    }
+
+    public static function combineInt32ToInt64($high, $low)
+    {
+        $isNeg = $high < 0;
+        if ($isNeg) {
+            $high = ~$high;
+            $low = ~$low;
+            $low++;
+            if (!$low) {
+                $high = (int) ($high + 1);
+            }
+        }
+        $result = bcadd(bcmul($high, 4294967296), $low);
+        if ($low < 0) {
+            $result = bcadd($result, 4294967296);
+        }
+        if ($isNeg) {
+          $result = bcsub(0, $result);
+        }
+        return $result;
+    }
+
+    public static function parseTimestamp($timestamp)
+    {
+        // prevent parsing timestamps containing with the non-existant year "0000"
+        // DateTime::createFromFormat parses without failing but as a nonsensical date
+        if (substr($timestamp, 0, 4) === "0000") {
+            throw new \Exception("Year cannot be zero.");
+        }
+        // prevent parsing timestamps ending with a lowercase z
+        if (substr($timestamp, -1, 1) === "z") {
+            throw new \Exception("Timezone cannot be a lowercase z.");
+        }
+
+        $nanoseconds = 0;
+        $periodIndex = strpos($timestamp, ".");
+        if ($periodIndex !== false) {
+            $nanosecondsLength = 0;
+            // find the next non-numeric character in the timestamp to calculate
+            // the length of the nanoseconds text
+            for ($i = $periodIndex + 1, $length = strlen($timestamp); $i < $length; $i++) {
+                if (!is_numeric($timestamp[$i])) {
+                    $nanosecondsLength = $i - ($periodIndex + 1);
+                    break;
+                }
+            }
+            if ($nanosecondsLength % 3 !== 0) {
+                throw new \Exception("Nanoseconds must be disible by 3.");
+            }
+            if ($nanosecondsLength > 9) {
+                throw new \Exception("Nanoseconds must be in the range of 0 to 999,999,999 nanoseconds.");
+            }
+            if ($nanosecondsLength > 0) {
+                $nanoseconds = substr($timestamp, $periodIndex + 1, $nanosecondsLength);
+                $nanoseconds = intval($nanoseconds);
+
+                // remove the nanoseconds and preceding period from the timestamp
+                $date = substr($timestamp, 0, $periodIndex);
+                $timezone = substr($timestamp, $periodIndex + $nanosecondsLength + 1);
+                $timestamp = $date.$timezone;
+            }
+        }
+
+        $date = \DateTime::createFromFormat(\DateTime::RFC3339, $timestamp, new \DateTimeZone("UTC"));
+        if ($date === false) {
+            throw new \Exception("Invalid RFC 3339 timestamp.");
+        }
+
+        $value = new \Google\Protobuf\Timestamp();
+        $seconds = $date->format("U");
+        $value->setSeconds($seconds);
+        $value->setNanos($nanoseconds);
+        return $value;
+    }
+
+    public static function formatTimestamp($value)
+    {
+        if (bccomp($value->getSeconds(), "253402300800") != -1) {
+          throw new GPBDecodeException("Duration number too large.");
+        }
+        if (bccomp($value->getSeconds(), "-62135596801") != 1) {
+          throw new GPBDecodeException("Duration number too small.");
+        }
+        $nanoseconds = static::getNanosecondsForTimestamp($value->getNanos());
+        if (!empty($nanoseconds)) {
+            $nanoseconds = ".".$nanoseconds;
+        }
+        $date = new \DateTime('@'.$value->getSeconds(), new \DateTimeZone("UTC"));
+        return $date->format("Y-m-d\TH:i:s".$nanoseconds."\Z");
+    }
+
+    public static function parseDuration($value)
+    {
+        if (strlen($value) < 2 || substr($value, -1) !== "s") {
+          throw new GPBDecodeException("Missing s after duration string");
+        }
+        $number = substr($value, 0, -1);
+        if (bccomp($number, "315576000001") != -1) {
+          throw new GPBDecodeException("Duration number too large.");
+        }
+        if (bccomp($number, "-315576000001") != 1) {
+          throw new GPBDecodeException("Duration number too small.");
+        }
+        $pos = strrpos($number, ".");
+        if ($pos !== false) {
+            $seconds = substr($number, 0, $pos);
+            if (bccomp($seconds, 0) < 0) {
+                $nanos = bcmul("0" . substr($number, $pos), -1000000000);
+            } else {
+                $nanos = bcmul("0" . substr($number, $pos), 1000000000);
+            }
+        } else {
+            $seconds = $number;
+            $nanos = 0;
+        }
+        $duration = new Duration();
+        $duration->setSeconds($seconds);
+        $duration->setNanos($nanos);
+        return $duration;
+    }
+
+    public static function formatDuration($value)
+    {
+        if (bccomp($value->getSeconds(), '315576000001') != -1) {
+            throw new GPBDecodeException('Duration number too large.');
+        }
+        if (bccomp($value->getSeconds(), '-315576000001') != 1) {
+            throw new GPBDecodeException('Duration number too small.');
+        }
+
+        $nanos = $value->getNanos();
+        if ($nanos === 0) {
+            return (string) $value->getSeconds();
+        }
+
+        if ($nanos % 1000000 === 0) {
+            $digits = 3;
+        } elseif ($nanos % 1000 === 0) {
+            $digits = 6;
+        } else {
+            $digits = 9;
+        }
+
+        $nanos = bcdiv($nanos, '1000000000', $digits);
+        return bcadd($value->getSeconds(), $nanos, $digits);
+    }
+
+    public static function parseFieldMask($paths_string)
+    {
+        $field_mask = new FieldMask();
+        if (strlen($paths_string) === 0) {
+            return $field_mask;
+        }
+        $path_strings = explode(",", $paths_string);
+        $paths = $field_mask->getPaths();
+        foreach($path_strings as &$path_string) {
+            $field_strings = explode(".", $path_string);
+            foreach($field_strings as &$field_string) {
+                $field_string = camel2underscore($field_string);
+            }
+            $path_string = implode(".", $field_strings);
+            $paths[] = $path_string;
+        }
+        return $field_mask;
+    }
+
+    public static function formatFieldMask($field_mask)
+    {
+        $converted_paths = [];
+        foreach($field_mask->getPaths() as $path) {
+            $fields = explode('.', $path);
+            $converted_path = [];
+            foreach ($fields as $field) {
+                $segments = explode('_', $field);
+                $start = true;
+                $converted_segments = "";
+                foreach($segments as $segment) {
+                  if (!$start) {
+                    $converted = ucfirst($segment);
+                  } else {
+                    $converted = $segment;
+                    $start = false;
+                  }
+                  $converted_segments .= $converted;
+                }
+                $converted_path []= $converted_segments;
+            }
+            $converted_path = implode(".", $converted_path);
+            $converted_paths []= $converted_path;
+        }
+        return implode(",", $converted_paths);
+    }
+
+    public static function getNanosecondsForTimestamp($nanoseconds)
+    {
+        if ($nanoseconds == 0) {
+            return '';
+        }
+        if ($nanoseconds % static::NANOS_PER_MILLISECOND == 0) {
+            return sprintf('%03d', $nanoseconds / static::NANOS_PER_MILLISECOND);
+        }
+        if ($nanoseconds % static::NANOS_PER_MICROSECOND == 0) {
+            return sprintf('%06d', $nanoseconds / static::NANOS_PER_MICROSECOND);
+        }
+        return sprintf('%09d', $nanoseconds);
+    }
+
+    public static function hasSpecialJsonMapping($msg)
+    {
+        return is_a($msg, 'Google\Protobuf\Any')         ||
+               is_a($msg, "Google\Protobuf\ListValue")   ||
+               is_a($msg, "Google\Protobuf\Struct")      ||
+               is_a($msg, "Google\Protobuf\Value")       ||
+               is_a($msg, "Google\Protobuf\Duration")    ||
+               is_a($msg, "Google\Protobuf\Timestamp")   ||
+               is_a($msg, "Google\Protobuf\FieldMask")   ||
+               static::hasJsonValue($msg);
+    }
+
+    public static function hasJsonValue($msg)
+    {
+        return is_a($msg, "Google\Protobuf\DoubleValue") ||
+               is_a($msg, "Google\Protobuf\FloatValue")  ||
+               is_a($msg, "Google\Protobuf\Int64Value")  ||
+               is_a($msg, "Google\Protobuf\UInt64Value") ||
+               is_a($msg, "Google\Protobuf\Int32Value")  ||
+               is_a($msg, "Google\Protobuf\UInt32Value") ||
+               is_a($msg, "Google\Protobuf\BoolValue")   ||
+               is_a($msg, "Google\Protobuf\StringValue") ||
+               is_a($msg, "Google\Protobuf\BytesValue");
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBWire.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBWire.php
new file mode 100644
index 0000000..7f1eab3
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBWire.php
@@ -0,0 +1,622 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf\Internal;
+
+class GPBWire
+{
+
+    const TAG_TYPE_BITS = 3;
+
+    const WIRETYPE_VARINT  = 0;
+    const WIRETYPE_FIXED64 = 1;
+    const WIRETYPE_LENGTH_DELIMITED = 2;
+    const WIRETYPE_START_GROUP = 3;
+    const WIRETYPE_END_GROUP = 4;
+    const WIRETYPE_FIXED32 = 5;
+
+    const UNKNOWN = 0;
+    const NORMAL_FORMAT = 1;
+    const PACKED_FORMAT = 2;
+
+    public static function getTagFieldNumber($tag)
+    {
+        return ($tag >> self::TAG_TYPE_BITS) &
+            (1 << ((PHP_INT_SIZE * 8) - self::TAG_TYPE_BITS)) - 1;
+    }
+
+    public static function getTagWireType($tag)
+    {
+        return $tag & 0x7;
+    }
+
+    public static function getWireType($type)
+    {
+        switch ($type) {
+            case GPBType::FLOAT:
+            case GPBType::FIXED32:
+            case GPBType::SFIXED32:
+                return self::WIRETYPE_FIXED32;
+            case GPBType::DOUBLE:
+            case GPBType::FIXED64:
+            case GPBType::SFIXED64:
+                return self::WIRETYPE_FIXED64;
+            case GPBType::UINT32:
+            case GPBType::UINT64:
+            case GPBType::INT32:
+            case GPBType::INT64:
+            case GPBType::SINT32:
+            case GPBType::SINT64:
+            case GPBType::ENUM:
+            case GPBType::BOOL:
+                return self::WIRETYPE_VARINT;
+            case GPBType::STRING:
+            case GPBType::BYTES:
+            case GPBType::MESSAGE:
+                return self::WIRETYPE_LENGTH_DELIMITED;
+            case GPBType::GROUP:
+                user_error("Unsupported type.");
+                return 0;
+            default:
+                user_error("Unsupported type.");
+                return 0;
+        }
+    }
+
+  // ZigZag Transform:  Encodes signed integers so that they can be effectively
+  // used with varint encoding.
+  //
+  // varint operates on unsigned integers, encoding smaller numbers into fewer
+  // bytes.  If you try to use it on a signed integer, it will treat this
+  // number as a very large unsigned integer, which means that even small
+  // signed numbers like -1 will take the maximum number of bytes (10) to
+  // encode.  zigZagEncode() maps signed integers to unsigned in such a way
+  // that those with a small absolute value will have smaller encoded values,
+  // making them appropriate for encoding using varint.
+  //
+  // int32 ->     uint32
+  // -------------------------
+  //           0 ->          0
+  //          -1 ->          1
+  //           1 ->          2
+  //          -2 ->          3
+  //         ... ->        ...
+  //  2147483647 -> 4294967294
+  // -2147483648 -> 4294967295
+  //
+  //        >> encode >>
+  //        << decode <<
+  public static function zigZagEncode32($int32)
+  {
+      if (PHP_INT_SIZE == 8) {
+          $trim_int32 = $int32 & 0xFFFFFFFF;
+          return (($trim_int32 << 1) ^ ($int32 << 32 >> 63)) & 0xFFFFFFFF;
+      } else {
+          return ($int32 << 1) ^ ($int32 >> 31);
+      }
+  }
+
+    public static function zigZagDecode32($uint32)
+    {
+        // Fill high 32 bits.
+        if (PHP_INT_SIZE === 8) {
+            $uint32 |= ($uint32 & 0xFFFFFFFF);
+        }
+
+        $int32 = (($uint32 >> 1) & 0x7FFFFFFF) ^ (-($uint32 & 1));
+
+        return $int32;
+    }
+
+    public static function zigZagEncode64($int64)
+    {
+        if (PHP_INT_SIZE == 4) {
+            if (bccomp($int64, 0) >= 0) {
+                return bcmul($int64, 2);
+            } else {
+                return bcsub(bcmul(bcsub(0, $int64), 2), 1);
+            }
+        } else {
+            return ($int64 << 1) ^ ($int64 >> 63);
+        }
+    }
+
+    public static function zigZagDecode64($uint64)
+    {
+        if (PHP_INT_SIZE == 4) {
+            if (bcmod($uint64, 2) == 0) {
+                return bcdiv($uint64, 2, 0);
+            } else {
+                return bcsub(0, bcdiv(bcadd($uint64, 1), 2, 0));
+            }
+        } else {
+            return (($uint64 >> 1) & 0x7FFFFFFFFFFFFFFF) ^ (-($uint64 & 1));
+        }
+    }
+
+    public static function readInt32(&$input, &$value)
+    {
+        return $input->readVarint32($value);
+    }
+
+    public static function readInt64(&$input, &$value)
+    {
+        $success = $input->readVarint64($value);
+        if (PHP_INT_SIZE == 4 && bccomp($value, "9223372036854775807") > 0) {
+            $value = bcsub($value, "18446744073709551616");
+        }
+        return $success;
+    }
+
+    public static function readUint32(&$input, &$value)
+    {
+        return self::readInt32($input, $value);
+    }
+
+    public static function readUint64(&$input, &$value)
+    {
+        return self::readInt64($input, $value);
+    }
+
+    public static function readSint32(&$input, &$value)
+    {
+        if (!$input->readVarint32($value)) {
+            return false;
+        }
+        $value = GPBWire::zigZagDecode32($value);
+        return true;
+    }
+
+    public static function readSint64(&$input, &$value)
+    {
+        if (!$input->readVarint64($value)) {
+            return false;
+        }
+        $value = GPBWire::zigZagDecode64($value);
+        return true;
+    }
+
+    public static function readFixed32(&$input, &$value)
+    {
+        return $input->readLittleEndian32($value);
+    }
+
+    public static function readFixed64(&$input, &$value)
+    {
+        return $input->readLittleEndian64($value);
+    }
+
+    public static function readSfixed32(&$input, &$value)
+    {
+        if (!self::readFixed32($input, $value)) {
+            return false;
+        }
+        if (PHP_INT_SIZE === 8) {
+            $value |= (-($value >> 31) << 32);
+        }
+        return true;
+    }
+
+    public static function readSfixed64(&$input, &$value)
+    {
+        $success = $input->readLittleEndian64($value);
+        if (PHP_INT_SIZE == 4 && bccomp($value, "9223372036854775807") > 0) {
+            $value = bcsub($value, "18446744073709551616");
+        }
+        return $success;
+    }
+
+    public static function readFloat(&$input, &$value)
+    {
+        $data = null;
+        if (!$input->readRaw(4, $data)) {
+            return false;
+        }
+        $value = unpack('f', $data)[1];
+        return true;
+    }
+
+    public static function readDouble(&$input, &$value)
+    {
+        $data = null;
+        if (!$input->readRaw(8, $data)) {
+            return false;
+        }
+        $value = unpack('d', $data)[1];
+        return true;
+    }
+
+    public static function readBool(&$input, &$value)
+    {
+        if (!$input->readVarint64($value)) {
+            return false;
+        }
+        if ($value == 0) {
+            $value = false;
+        } else {
+            $value = true;
+        }
+        return true;
+    }
+
+    public static function readString(&$input, &$value)
+    {
+        $length = 0;
+        return $input->readVarintSizeAsInt($length) && $input->readRaw($length, $value);
+    }
+
+    public static function readMessage(&$input, &$message)
+    {
+        $length = 0;
+        if (!$input->readVarintSizeAsInt($length)) {
+            return false;
+        }
+        $old_limit = 0;
+        $recursion_limit = 0;
+        $input->incrementRecursionDepthAndPushLimit(
+            $length,
+            $old_limit,
+            $recursion_limit);
+        if ($recursion_limit < 0 || !$message->parseFromStream($input)) {
+            return false;
+        }
+        return $input->decrementRecursionDepthAndPopLimit($old_limit);
+    }
+
+    public static function writeTag(&$output, $tag)
+    {
+        return $output->writeTag($tag);
+    }
+
+    public static function writeInt32(&$output, $value)
+    {
+        return $output->writeVarint32($value, false);
+    }
+
+    public static function writeInt64(&$output, $value)
+    {
+        return $output->writeVarint64($value);
+    }
+
+    public static function writeUint32(&$output, $value)
+    {
+        return $output->writeVarint32($value, true);
+    }
+
+    public static function writeUint64(&$output, $value)
+    {
+        return $output->writeVarint64($value);
+    }
+
+    public static function writeSint32(&$output, $value)
+    {
+        $value = GPBWire::zigZagEncode32($value);
+        return $output->writeVarint32($value, true);
+    }
+
+    public static function writeSint64(&$output, $value)
+    {
+        $value = GPBWire::zigZagEncode64($value);
+        return $output->writeVarint64($value);
+    }
+
+    public static function writeFixed32(&$output, $value)
+    {
+        return $output->writeLittleEndian32($value);
+    }
+
+    public static function writeFixed64(&$output, $value)
+    {
+        return $output->writeLittleEndian64($value);
+    }
+
+    public static function writeSfixed32(&$output, $value)
+    {
+        return $output->writeLittleEndian32($value);
+    }
+
+    public static function writeSfixed64(&$output, $value)
+    {
+        return $output->writeLittleEndian64($value);
+    }
+
+    public static function writeBool(&$output, $value)
+    {
+        if ($value) {
+            return $output->writeVarint32(1, true);
+        } else {
+            return $output->writeVarint32(0, true);
+        }
+    }
+
+    public static function writeFloat(&$output, $value)
+    {
+        $data = pack("f", $value);
+        return $output->writeRaw($data, 4);
+    }
+
+    public static function writeDouble(&$output, $value)
+    {
+        $data = pack("d", $value);
+        return $output->writeRaw($data, 8);
+    }
+
+    public static function writeString(&$output, $value)
+    {
+        return self::writeBytes($output, $value);
+    }
+
+    public static function writeBytes(&$output, $value)
+    {
+        $size = strlen($value);
+        if (!$output->writeVarint32($size, true)) {
+            return false;
+        }
+        return $output->writeRaw($value, $size);
+    }
+
+    public static function writeMessage(&$output, $value)
+    {
+        $size = $value->byteSize();
+        if (!$output->writeVarint32($size, true)) {
+            return false;
+        }
+        return $value->serializeToStream($output);
+    }
+
+    public static function makeTag($number, $type)
+    {
+        return ($number << 3) | self::getWireType($type);
+    }
+
+    public static function tagSize($field)
+    {
+        $tag = self::makeTag($field->getNumber(), $field->getType());
+        return self::varint32Size($tag);
+    }
+
+    public static function varint32Size($value, $sign_extended = false)
+    {
+        if ($value < 0) {
+            if ($sign_extended) {
+                return 10;
+            } else {
+                return 5;
+            }
+        }
+        if ($value < (1 <<  7)) {
+            return 1;
+        }
+        if ($value < (1 << 14)) {
+            return 2;
+        }
+        if ($value < (1 << 21)) {
+            return 3;
+        }
+        if ($value < (1 << 28)) {
+            return 4;
+        }
+        return 5;
+    }
+
+    public static function sint32Size($value)
+    {
+        $value = self::zigZagEncode32($value);
+        return self::varint32Size($value);
+    }
+
+    public static function sint64Size($value)
+    {
+        $value = self::zigZagEncode64($value);
+        return self::varint64Size($value);
+    }
+
+    public static function varint64Size($value)
+    {
+        if (PHP_INT_SIZE == 4) {
+            if (bccomp($value, 0) < 0 ||
+                bccomp($value, "9223372036854775807") > 0) {
+                return 10;
+            }
+            if (bccomp($value, 1 << 7) < 0) {
+                return 1;
+            }
+            if (bccomp($value, 1 << 14) < 0) {
+                return 2;
+            }
+            if (bccomp($value, 1 << 21) < 0) {
+                return 3;
+            }
+            if (bccomp($value, 1 << 28) < 0) {
+                return 4;
+            }
+            if (bccomp($value, '34359738368') < 0) {
+                return 5;
+            }
+            if (bccomp($value, '4398046511104') < 0) {
+                return 6;
+            }
+            if (bccomp($value, '562949953421312') < 0) {
+                return 7;
+            }
+            if (bccomp($value, '72057594037927936') < 0) {
+                return 8;
+            }
+            return 9;
+        } else {
+            if ($value < 0) {
+                return 10;
+            }
+            if ($value < (1 <<  7)) {
+                return 1;
+            }
+            if ($value < (1 << 14)) {
+                return 2;
+            }
+            if ($value < (1 << 21)) {
+                return 3;
+            }
+            if ($value < (1 << 28)) {
+                return 4;
+            }
+            if ($value < (1 << 35)) {
+                return 5;
+            }
+            if ($value < (1 << 42)) {
+                return 6;
+            }
+            if ($value < (1 << 49)) {
+                return 7;
+            }
+            if ($value < (1 << 56)) {
+                return 8;
+            }
+            return 9;
+        }
+    }
+
+    public static function serializeFieldToStream(
+        $value,
+        $field,
+        $need_tag,
+        &$output)
+    {
+        if ($need_tag) {
+            if (!GPBWire::writeTag(
+                $output,
+                self::makeTag(
+                    $field->getNumber(),
+                    $field->getType()))) {
+                return false;
+            }
+        }
+        switch ($field->getType()) {
+            case GPBType::DOUBLE:
+                if (!GPBWire::writeDouble($output, $value)) {
+                    return false;
+                }
+                break;
+            case GPBType::FLOAT:
+                if (!GPBWire::writeFloat($output, $value)) {
+                    return false;
+                }
+                break;
+            case GPBType::INT64:
+                if (!GPBWire::writeInt64($output, $value)) {
+                    return false;
+                }
+                break;
+            case GPBType::UINT64:
+                if (!GPBWire::writeUint64($output, $value)) {
+                    return false;
+                }
+                break;
+            case GPBType::INT32:
+                if (!GPBWire::writeInt32($output, $value)) {
+                    return false;
+                }
+                break;
+            case GPBType::FIXED32:
+                if (!GPBWire::writeFixed32($output, $value)) {
+                    return false;
+                }
+                break;
+            case GPBType::FIXED64:
+                if (!GPBWire::writeFixed64($output, $value)) {
+                    return false;
+                }
+                break;
+            case GPBType::BOOL:
+                if (!GPBWire::writeBool($output, $value)) {
+                    return false;
+                }
+                break;
+            case GPBType::STRING:
+                if (!GPBWire::writeString($output, $value)) {
+                    return false;
+                }
+                break;
+            //    case GPBType::GROUP:
+            //      echo "GROUP\xA";
+            //      trigger_error("Not implemented.", E_ERROR);
+            //      break;
+            case GPBType::MESSAGE:
+                if (!GPBWire::writeMessage($output, $value)) {
+                    return false;
+                }
+                break;
+            case GPBType::BYTES:
+                if (!GPBWire::writeBytes($output, $value)) {
+                    return false;
+                }
+                break;
+            case GPBType::UINT32:
+                if (PHP_INT_SIZE === 8 && $value < 0) {
+                    $value += 4294967296;
+                }
+                if (!GPBWire::writeUint32($output, $value)) {
+                    return false;
+                }
+                break;
+            case GPBType::ENUM:
+                if (!GPBWire::writeInt32($output, $value)) {
+                    return false;
+                }
+                break;
+            case GPBType::SFIXED32:
+                if (!GPBWire::writeSfixed32($output, $value)) {
+                    return false;
+                }
+                break;
+            case GPBType::SFIXED64:
+                if (!GPBWire::writeSfixed64($output, $value)) {
+                    return false;
+                }
+                break;
+            case GPBType::SINT32:
+                if (!GPBWire::writeSint32($output, $value)) {
+                    return false;
+                }
+                break;
+            case GPBType::SINT64:
+                if (!GPBWire::writeSint64($output, $value)) {
+                    return false;
+                }
+                break;
+            default:
+                user_error("Unsupported type.");
+                return false;
+        }
+
+        return true;
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBWireType.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBWireType.php
new file mode 100644
index 0000000..c1ad370
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBWireType.php
@@ -0,0 +1,43 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf\Internal;
+
+class GPBWireType
+{
+    const VARINT           = 0;
+    const FIXED64          = 1;
+    const LENGTH_DELIMITED = 2;
+    const START_GROUP      = 3;
+    const END_GROUP        = 4;
+    const FIXED32          = 5;
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo.php
new file mode 100644
index 0000000..f5a65be
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo.php
@@ -0,0 +1,82 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Describes the relationship between generated code and its original source
+ * file. A GeneratedCodeInfo message is associated with only one generated
+ * source file, but may contain references to different source .proto files.
+ *
+ * Generated from protobuf message <code>google.protobuf.GeneratedCodeInfo</code>
+ */
+class GeneratedCodeInfo extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * An Annotation connects some span of text in generated code to an element
+     * of its generating .proto file.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;</code>
+     */
+    private $annotation;
+    private $has_annotation = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type \Google\Protobuf\Internal\GeneratedCodeInfo\Annotation[]|\Google\Protobuf\Internal\RepeatedField $annotation
+     *           An Annotation connects some span of text in generated code to an element
+     *           of its generating .proto file.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * An Annotation connects some span of text in generated code to an element
+     * of its generating .proto file.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getAnnotation()
+    {
+        return $this->annotation;
+    }
+
+    /**
+     * An Annotation connects some span of text in generated code to an element
+     * of its generating .proto file.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;</code>
+     * @param \Google\Protobuf\Internal\GeneratedCodeInfo\Annotation[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setAnnotation($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\GeneratedCodeInfo\Annotation::class);
+        $this->annotation = $arr;
+        $this->has_annotation = true;
+
+        return $this;
+    }
+
+    public function hasAnnotation()
+    {
+        return $this->has_annotation;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php
new file mode 100644
index 0000000..369fea4
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php
@@ -0,0 +1,216 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal\GeneratedCodeInfo;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Generated from protobuf message <code>google.protobuf.GeneratedCodeInfo.Annotation</code>
+ */
+class Annotation extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Identifies the element in the original source .proto file. This field
+     * is formatted the same as SourceCodeInfo.Location.path.
+     *
+     * Generated from protobuf field <code>repeated int32 path = 1 [packed = true];</code>
+     */
+    private $path;
+    private $has_path = false;
+    /**
+     * Identifies the filesystem path to the original source .proto.
+     *
+     * Generated from protobuf field <code>optional string source_file = 2;</code>
+     */
+    protected $source_file = '';
+    private $has_source_file = false;
+    /**
+     * Identifies the starting offset in bytes in the generated code
+     * that relates to the identified object.
+     *
+     * Generated from protobuf field <code>optional int32 begin = 3;</code>
+     */
+    protected $begin = 0;
+    private $has_begin = false;
+    /**
+     * Identifies the ending offset in bytes in the generated code that
+     * relates to the identified offset. The end offset should be one past
+     * the last relevant byte (so the length of the text = end - begin).
+     *
+     * Generated from protobuf field <code>optional int32 end = 4;</code>
+     */
+    protected $end = 0;
+    private $has_end = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type int[]|\Google\Protobuf\Internal\RepeatedField $path
+     *           Identifies the element in the original source .proto file. This field
+     *           is formatted the same as SourceCodeInfo.Location.path.
+     *     @type string $source_file
+     *           Identifies the filesystem path to the original source .proto.
+     *     @type int $begin
+     *           Identifies the starting offset in bytes in the generated code
+     *           that relates to the identified object.
+     *     @type int $end
+     *           Identifies the ending offset in bytes in the generated code that
+     *           relates to the identified offset. The end offset should be one past
+     *           the last relevant byte (so the length of the text = end - begin).
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Identifies the element in the original source .proto file. This field
+     * is formatted the same as SourceCodeInfo.Location.path.
+     *
+     * Generated from protobuf field <code>repeated int32 path = 1 [packed = true];</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getPath()
+    {
+        return $this->path;
+    }
+
+    /**
+     * Identifies the element in the original source .proto file. This field
+     * is formatted the same as SourceCodeInfo.Location.path.
+     *
+     * Generated from protobuf field <code>repeated int32 path = 1 [packed = true];</code>
+     * @param int[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setPath($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
+        $this->path = $arr;
+        $this->has_path = true;
+
+        return $this;
+    }
+
+    public function hasPath()
+    {
+        return $this->has_path;
+    }
+
+    /**
+     * Identifies the filesystem path to the original source .proto.
+     *
+     * Generated from protobuf field <code>optional string source_file = 2;</code>
+     * @return string
+     */
+    public function getSourceFile()
+    {
+        return $this->source_file;
+    }
+
+    /**
+     * Identifies the filesystem path to the original source .proto.
+     *
+     * Generated from protobuf field <code>optional string source_file = 2;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setSourceFile($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->source_file = $var;
+        $this->has_source_file = true;
+
+        return $this;
+    }
+
+    public function hasSourceFile()
+    {
+        return $this->has_source_file;
+    }
+
+    /**
+     * Identifies the starting offset in bytes in the generated code
+     * that relates to the identified object.
+     *
+     * Generated from protobuf field <code>optional int32 begin = 3;</code>
+     * @return int
+     */
+    public function getBegin()
+    {
+        return $this->begin;
+    }
+
+    /**
+     * Identifies the starting offset in bytes in the generated code
+     * that relates to the identified object.
+     *
+     * Generated from protobuf field <code>optional int32 begin = 3;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setBegin($var)
+    {
+        GPBUtil::checkInt32($var);
+        $this->begin = $var;
+        $this->has_begin = true;
+
+        return $this;
+    }
+
+    public function hasBegin()
+    {
+        return $this->has_begin;
+    }
+
+    /**
+     * Identifies the ending offset in bytes in the generated code that
+     * relates to the identified offset. The end offset should be one past
+     * the last relevant byte (so the length of the text = end - begin).
+     *
+     * Generated from protobuf field <code>optional int32 end = 4;</code>
+     * @return int
+     */
+    public function getEnd()
+    {
+        return $this->end;
+    }
+
+    /**
+     * Identifies the ending offset in bytes in the generated code that
+     * relates to the identified offset. The end offset should be one past
+     * the last relevant byte (so the length of the text = end - begin).
+     *
+     * Generated from protobuf field <code>optional int32 end = 4;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setEnd($var)
+    {
+        GPBUtil::checkInt32($var);
+        $this->end = $var;
+        $this->has_end = true;
+
+        return $this;
+    }
+
+    public function hasEnd()
+    {
+        return $this->has_end;
+    }
+
+}
+
+// Adding a class alias for backwards compatibility with the previous class name.
+class_alias(Annotation::class, \Google\Protobuf\Internal\GeneratedCodeInfo_Annotation::class);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php
new file mode 100644
index 0000000..e36f1e5
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php
@@ -0,0 +1,16 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+if (false) {
+    /**
+     * This class is deprecated. Use Google\Protobuf\Internal\GeneratedCodeInfo\Annotation instead.
+     * @deprecated
+     */
+    class GeneratedCodeInfo_Annotation {}
+}
+class_exists(GeneratedCodeInfo\Annotation::class);
+@trigger_error('Google\Protobuf\Internal\GeneratedCodeInfo_Annotation is deprecated and will be removed in the next major release. Use Google\Protobuf\Internal\GeneratedCodeInfo\Annotation instead', E_USER_DEPRECATED);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/GetPublicDescriptorTrait.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/GetPublicDescriptorTrait.php
new file mode 100644
index 0000000..d22bc30
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/GetPublicDescriptorTrait.php
@@ -0,0 +1,41 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2017 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf\Internal;
+
+trait GetPublicDescriptorTrait
+{
+    private function getPublicDescriptor($desc)
+    {
+        return is_null($desc) ? null : $desc->getPublicDescriptor();
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/HasPublicDescriptorTrait.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/HasPublicDescriptorTrait.php
new file mode 100644
index 0000000..ed5d166
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/HasPublicDescriptorTrait.php
@@ -0,0 +1,43 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf\Internal;
+
+trait HasPublicDescriptorTrait
+{
+    private $public_desc;
+
+    public function getPublicDescriptor()
+    {
+        return $this->public_desc;
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MapEntry.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MapEntry.php
new file mode 100644
index 0000000..e89481f
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MapEntry.php
@@ -0,0 +1,71 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\Message;
+
+class MapEntry extends Message
+{
+    public $key;
+    public $value;
+
+    public function __construct($desc) {
+        parent::__construct($desc);
+        // For MapEntry, getValue should always return a valid value. Thus, we
+        // need to create a default instance value if the value type is
+        // message, in case no value is provided in data.
+        $value_field = $desc->getFieldByNumber(2);
+        if ($value_field->getType() == GPBType::MESSAGE) {
+            $klass = $value_field->getMessageType()->getClass();
+            $value = new $klass;
+            $this->setValue($value);
+        }
+    }
+
+    public function setKey($key) {
+      $this->key = $key;
+    }
+
+    public function getKey() {
+      return $this->key;
+    }
+
+    public function setValue($value) {
+      $this->value = $value;
+    }
+
+    public function getValue() {
+      return $this->value;
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MapField.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MapField.php
new file mode 100644
index 0000000..2c66aa0
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MapField.php
@@ -0,0 +1,290 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/**
+ * MapField and MapFieldIter are used by generated protocol message classes to
+ * manipulate map fields.
+ */
+
+namespace Google\Protobuf\Internal;
+
+/**
+ * MapField is used by generated protocol message classes to manipulate map
+ * fields. It can be used like native PHP array.
+ */
+class MapField implements \ArrayAccess, \IteratorAggregate, \Countable
+{
+    /**
+     * @ignore
+     */
+    private $container;
+    /**
+     * @ignore
+     */
+    private $key_type;
+    /**
+     * @ignore
+     */
+    private $value_type;
+    /**
+     * @ignore
+     */
+    private $klass;
+    /**
+     * @ignore
+     */
+    private $legacy_klass;
+
+    /**
+     * Constructs an instance of MapField.
+     *
+     * @param long $key_type Type of the stored key element.
+     * @param long $value_type Type of the stored value element.
+     * @param string $klass Message/Enum class name of value instance
+     * (message/enum fields only).
+     * @ignore
+     */
+    public function __construct($key_type, $value_type, $klass = null)
+    {
+        $this->container = [];
+        $this->key_type = $key_type;
+        $this->value_type = $value_type;
+        $this->klass = $klass;
+
+        if ($this->value_type == GPBType::MESSAGE) {
+            $pool = DescriptorPool::getGeneratedPool();
+            $desc = $pool->getDescriptorByClassName($klass);
+            if ($desc == NULL) {
+                new $klass;  // No msg class instance has been created before.
+                $desc = $pool->getDescriptorByClassName($klass);
+            }
+            $this->klass = $desc->getClass();
+            $this->legacy_klass = $desc->getLegacyClass();
+        }
+    }
+
+    /**
+     * @ignore
+     */
+    public function getKeyType()
+    {
+        return $this->key_type;
+    }
+
+    /**
+     * @ignore
+     */
+    public function getValueType()
+    {
+        return $this->value_type;
+    }
+
+    /**
+     * @ignore
+     */
+    public function getValueClass()
+    {
+        return $this->klass;
+    }
+
+    /**
+     * @ignore
+     */
+    public function getLegacyValueClass()
+    {
+        return $this->legacy_klass;
+    }
+
+    /**
+     * Return the element at the given key.
+     *
+     * This will also be called for: $ele = $arr[$key]
+     *
+     * @param object $key The key of the element to be fetched.
+     * @return object The stored element at given key.
+     * @throws \ErrorException Invalid type for index.
+     * @throws \ErrorException Non-existing index.
+     */
+    public function offsetGet($key)
+    {
+        return $this->container[$key];
+    }
+
+    /**
+     * Assign the element at the given key.
+     *
+     * This will also be called for: $arr[$key] = $value
+     *
+     * @param object $key The key of the element to be fetched.
+     * @param object $value The element to be assigned.
+     * @return void
+     * @throws \ErrorException Invalid type for key.
+     * @throws \ErrorException Invalid type for value.
+     * @throws \ErrorException Non-existing key.
+     */
+    public function offsetSet($key, $value)
+    {
+        $this->checkKey($this->key_type, $key);
+
+        switch ($this->value_type) {
+            case GPBType::SFIXED32:
+            case GPBType::SINT32:
+            case GPBType::INT32:
+            case GPBType::ENUM:
+                GPBUtil::checkInt32($value);
+                break;
+            case GPBType::FIXED32:
+            case GPBType::UINT32:
+                GPBUtil::checkUint32($value);
+                break;
+            case GPBType::SFIXED64:
+            case GPBType::SINT64:
+            case GPBType::INT64:
+                GPBUtil::checkInt64($value);
+                break;
+            case GPBType::FIXED64:
+            case GPBType::UINT64:
+                GPBUtil::checkUint64($value);
+                break;
+            case GPBType::FLOAT:
+                GPBUtil::checkFloat($value);
+                break;
+            case GPBType::DOUBLE:
+                GPBUtil::checkDouble($value);
+                break;
+            case GPBType::BOOL:
+                GPBUtil::checkBool($value);
+                break;
+            case GPBType::STRING:
+                GPBUtil::checkString($value, true);
+                break;
+            case GPBType::MESSAGE:
+                if (is_null($value)) {
+                  trigger_error("Map element cannot be null.", E_USER_ERROR);
+                }
+                GPBUtil::checkMessage($value, $this->klass);
+                break;
+            default:
+                break;
+        }
+
+        $this->container[$key] = $value;
+    }
+
+    /**
+     * Remove the element at the given key.
+     *
+     * This will also be called for: unset($arr)
+     *
+     * @param object $key The key of the element to be removed.
+     * @return void
+     * @throws \ErrorException Invalid type for key.
+     */
+    public function offsetUnset($key)
+    {
+        $this->checkKey($this->key_type, $key);
+        unset($this->container[$key]);
+    }
+
+    /**
+     * Check the existence of the element at the given key.
+     *
+     * This will also be called for: isset($arr)
+     *
+     * @param object $key The key of the element to be removed.
+     * @return bool True if the element at the given key exists.
+     * @throws \ErrorException Invalid type for key.
+     */
+    public function offsetExists($key)
+    {
+        $this->checkKey($this->key_type, $key);
+        return isset($this->container[$key]);
+    }
+
+    /**
+     * @ignore
+     */
+    public function getIterator()
+    {
+        return new MapFieldIter($this->container, $this->key_type);
+    }
+
+    /**
+     * Return the number of stored elements.
+     *
+     * This will also be called for: count($arr)
+     *
+     * @return integer The number of stored elements.
+     */
+    public function count()
+    {
+        return count($this->container);
+    }
+
+    /**
+     * @ignore
+     */
+    private function checkKey($key_type, &$key)
+    {
+        switch ($key_type) {
+            case GPBType::SFIXED32:
+            case GPBType::SINT32:
+            case GPBType::INT32:
+                GPBUtil::checkInt32($key);
+                break;
+            case GPBType::FIXED32:
+            case GPBType::UINT32:
+                GPBUtil::checkUint32($key);
+                break;
+            case GPBType::SFIXED64:
+            case GPBType::SINT64:
+            case GPBType::INT64:
+                GPBUtil::checkInt64($key);
+                break;
+            case GPBType::FIXED64:
+            case GPBType::UINT64:
+                GPBUtil::checkUint64($key);
+                break;
+            case GPBType::BOOL:
+                GPBUtil::checkBool($key);
+                break;
+            case GPBType::STRING:
+                GPBUtil::checkString($key, true);
+                break;
+            default:
+                trigger_error(
+                    "Given type cannot be map key.",
+                    E_USER_ERROR);
+                break;
+        }
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MapFieldIter.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MapFieldIter.php
new file mode 100644
index 0000000..4e18005
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MapFieldIter.php
@@ -0,0 +1,134 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/**
+ * MapField and MapFieldIter are used by generated protocol message classes to
+ * manipulate map fields.
+ */
+
+namespace Google\Protobuf\Internal;
+
+/**
+ * MapFieldIter is used to iterate MapField. It is also need for the foreach
+ * syntax.
+ */
+class MapFieldIter implements \Iterator
+{
+
+    /**
+     * @ignore
+     */
+    private $container;
+
+    /**
+     * Create iterator instance for MapField.
+     *
+     * @param MapField The MapField instance for which this iterator is
+     * created.
+     * @param GPBType Map key type.
+     * @ignore
+     */
+    public function __construct($container, $key_type)
+    {
+        $this->container = $container;
+        $this->key_type = $key_type;
+    }
+
+    /**
+     * Reset the status of the iterator
+     *
+     * @return void
+     */
+    public function rewind()
+    {
+        return reset($this->container);
+    }
+
+    /**
+     * Return the element at the current position.
+     *
+     * @return object The element at the current position.
+     */
+    public function current()
+    {
+        return current($this->container);
+    }
+
+    /**
+     * Return the current key.
+     *
+     * @return object The current key.
+     */
+    public function key()
+    {
+        $key = key($this->container);
+        switch ($this->key_type) {
+            case GPBType::INT64:
+            case GPBType::UINT64:
+            case GPBType::FIXED64:
+            case GPBType::SFIXED64:
+            case GPBType::SINT64:
+                if (PHP_INT_SIZE === 8) {
+                    return $key;
+                }
+                // Intentionally fall through
+            case GPBType::STRING:
+                // PHP associative array stores int string as int for key.
+                return strval($key);
+            case GPBType::BOOL:
+                // PHP associative array stores bool as integer for key.
+                return boolval($key);
+            default:
+                return $key;
+        }
+    }
+
+    /**
+     * Move to the next position.
+     *
+     * @return void
+     */
+    public function next()
+    {
+        return next($this->container);
+    }
+
+    /**
+     * Check whether there are more elements to iterate.
+     *
+     * @return bool True if there are more elements to iterate.
+     */
+    public function valid()
+    {
+        return key($this->container) !== null;
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php
new file mode 100644
index 0000000..1ffb245
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php
@@ -0,0 +1,1983 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/**
+ * Defines Message, the parent class extended by all protocol message classes.
+ */
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\CodedInputStream;
+use Google\Protobuf\Internal\CodedOutputStream;
+use Google\Protobuf\Internal\DescriptorPool;
+use Google\Protobuf\Internal\GPBLabel;
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\MapEntry;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\ListValue;
+use Google\Protobuf\Value;
+use Google\Protobuf\Struct;
+use Google\Protobuf\NullValue;
+
+/**
+ * Parent class of all proto messages. Users should not instantiate this class
+ * or extend this class or its child classes by their own.  See the comment of
+ * specific functions for more details.
+ */
+class Message
+{
+
+    /**
+     * @ignore
+     */
+    private $desc;
+    private $unknown = "";
+
+    /**
+     * @ignore
+     */
+    public function __construct($data = NULL)
+    {
+        // MapEntry message is shared by all types of map fields, whose
+        // descriptors are different from each other. Thus, we cannot find a
+        // specific descriptor from the descriptor pool.
+        if ($this instanceof MapEntry) {
+            $this->initWithDescriptor($data);
+        } else {
+            $this->initWithGeneratedPool();
+            if (is_array($data)) {
+                $this->mergeFromArray($data);
+            } else if (!empty($data)) {
+                throw new \InvalidArgumentException(
+                    'Message constructor must be an array or null.'
+                );
+            }
+        }
+    }
+
+    /**
+     * @ignore
+     */
+    private function initWithGeneratedPool()
+    {
+        $pool = DescriptorPool::getGeneratedPool();
+        $this->desc = $pool->getDescriptorByClassName(get_class($this));
+        if (is_null($this->desc)) {
+            user_error(get_class($this) . " is not found in descriptor pool.");
+        }
+        foreach ($this->desc->getField() as $field) {
+            $setter = $field->getSetter();
+            if ($field->isMap()) {
+                $message_type = $field->getMessageType();
+                $key_field = $message_type->getFieldByNumber(1);
+                $value_field = $message_type->getFieldByNumber(2);
+                switch ($value_field->getType()) {
+                    case GPBType::MESSAGE:
+                    case GPBType::GROUP:
+                        $map_field = new MapField(
+                            $key_field->getType(),
+                            $value_field->getType(),
+                            $value_field->getMessageType()->getClass());
+                        $this->$setter($map_field);
+                        break;
+                    case GPBType::ENUM:
+                        $map_field = new MapField(
+                            $key_field->getType(),
+                            $value_field->getType(),
+                            $value_field->getEnumType()->getClass());
+                        $this->$setter($map_field);
+                        break;
+                    default:
+                        $map_field = new MapField(
+                            $key_field->getType(),
+                            $value_field->getType());
+                        $this->$setter($map_field);
+                        break;
+                }
+            } else if ($field->getLabel() === GPBLabel::REPEATED) {
+                switch ($field->getType()) {
+                    case GPBType::MESSAGE:
+                    case GPBType::GROUP:
+                        $repeated_field = new RepeatedField(
+                            $field->getType(),
+                            $field->getMessageType()->getClass());
+                        $this->$setter($repeated_field);
+                        break;
+                    case GPBType::ENUM:
+                        $repeated_field = new RepeatedField(
+                            $field->getType(),
+                            $field->getEnumType()->getClass());
+                        $this->$setter($repeated_field);
+                        break;
+                    default:
+                        $repeated_field = new RepeatedField($field->getType());
+                        $this->$setter($repeated_field);
+                        break;
+                }
+            } else if ($field->getOneofIndex() !== -1) {
+                $oneof = $this->desc->getOneofDecl()[$field->getOneofIndex()];
+                $oneof_name = $oneof->getName();
+                $this->$oneof_name = new OneofField($oneof);
+            } else if ($field->getLabel() === GPBLabel::OPTIONAL &&
+                       PHP_INT_SIZE == 4) {
+                switch ($field->getType()) {
+                    case GPBType::INT64:
+                    case GPBType::UINT64:
+                    case GPBType::FIXED64:
+                    case GPBType::SFIXED64:
+                    case GPBType::SINT64:
+                        $this->$setter("0");
+                }
+            }
+        }
+    }
+
+    /**
+     * @ignore
+     */
+    private function initWithDescriptor(Descriptor $desc)
+    {
+        $this->desc = $desc;
+        foreach ($desc->getField() as $field) {
+            $setter = $field->getSetter();
+            $defaultValue = $this->defaultValue($field);
+            $this->$setter($defaultValue);
+        }
+    }
+
+    protected function readWrapperValue($member)
+    {
+        $field = $this->desc->getFieldByName($member);
+        $oneof_index = $field->getOneofIndex();
+        if ($oneof_index === -1) {
+            $wrapper = $this->$member;
+        } else {
+            $wrapper = $this->readOneof($field->getNumber());
+        }
+
+        if (is_null($wrapper)) {
+            return NULL;
+        } else {
+            return $wrapper->getValue();
+        }
+    }
+
+    protected function writeWrapperValue($member, $value)
+    {
+        $field = $this->desc->getFieldByName($member);
+        $wrapped_value = $value;
+        if (!is_null($value)) {
+            $desc = $field->getMessageType();
+            $klass = $desc->getClass();
+            $wrapped_value = new $klass;
+            $wrapped_value->setValue($value);
+        }
+
+        $oneof_index = $field->getOneofIndex();
+        if ($oneof_index === -1) {
+            $this->$member = $wrapped_value;
+        } else {
+            $this->writeOneof($field->getNumber(), $wrapped_value);
+        }
+    }
+
+    protected function readOneof($number)
+    {
+        $field = $this->desc->getFieldByNumber($number);
+        $oneof = $this->desc->getOneofDecl()[$field->getOneofIndex()];
+        $oneof_name = $oneof->getName();
+        $oneof_field = $this->$oneof_name;
+        if ($number === $oneof_field->getNumber()) {
+            return $oneof_field->getValue();
+        } else {
+            return $this->defaultValue($field);
+        }
+    }
+
+    protected function writeOneof($number, $value)
+    {
+        $field = $this->desc->getFieldByNumber($number);
+        $oneof = $this->desc->getOneofDecl()[$field->getOneofIndex()];
+        $oneof_name = $oneof->getName();
+        $oneof_field = $this->$oneof_name;
+        $oneof_field->setValue($value);
+        $oneof_field->setFieldName($field->getName());
+        $oneof_field->setNumber($number);
+    }
+
+    protected function whichOneof($oneof_name)
+    {
+        $oneof_field = $this->$oneof_name;
+        $number = $oneof_field->getNumber();
+        if ($number == 0) {
+          return "";
+        }
+        $field = $this->desc->getFieldByNumber($number);
+        return $field->getName();
+    }
+
+    /**
+     * @ignore
+     */
+    private function defaultValue($field)
+    {
+        $value = null;
+
+        switch ($field->getType()) {
+            case GPBType::DOUBLE:
+            case GPBType::FLOAT:
+                return 0.0;
+            case GPBType::UINT32:
+            case GPBType::INT32:
+            case GPBType::FIXED32:
+            case GPBType::SFIXED32:
+            case GPBType::SINT32:
+            case GPBType::ENUM:
+                return 0;
+            case GPBType::INT64:
+            case GPBType::UINT64:
+            case GPBType::FIXED64:
+            case GPBType::SFIXED64:
+            case GPBType::SINT64:
+                if (PHP_INT_SIZE === 4) {
+                    return '0';
+                } else {
+                    return 0;
+                }
+            case GPBType::BOOL:
+                return false;
+            case GPBType::STRING:
+            case GPBType::BYTES:
+                return "";
+            case GPBType::GROUP:
+            case GPBType::MESSAGE:
+                return null;
+            default:
+                user_error("Unsupported type.");
+                return false;
+        }
+    }
+
+    /**
+     * @ignore
+     */
+    private function skipField($input, $tag)
+    {
+        $number = GPBWire::getTagFieldNumber($tag);
+        if ($number === 0) {
+            throw new GPBDecodeException("Illegal field number zero.");
+        }
+
+        $start = $input->current();
+        switch (GPBWire::getTagWireType($tag)) {
+            case GPBWireType::VARINT:
+                $uint64 = 0;
+                if (!$input->readVarint64($uint64)) {
+                    throw new GPBDecodeException(
+                        "Unexpected EOF inside varint.");
+                }
+                break;
+            case GPBWireType::FIXED64:
+                $uint64 = 0;
+                if (!$input->readLittleEndian64($uint64)) {
+                    throw new GPBDecodeException(
+                        "Unexpected EOF inside fixed64.");
+                }
+                break;
+            case GPBWireType::FIXED32:
+                $uint32 = 0;
+                if (!$input->readLittleEndian32($uint32)) {
+                    throw new GPBDecodeException(
+                        "Unexpected EOF inside fixed32.");
+                }
+                break;
+            case GPBWireType::LENGTH_DELIMITED:
+                $length = 0;
+                if (!$input->readVarint32($length)) {
+                    throw new GPBDecodeException(
+                        "Unexpected EOF inside length.");
+                }
+                $data = NULL;
+                if (!$input->readRaw($length, $data)) {
+                    throw new GPBDecodeException(
+                        "Unexpected EOF inside length delimited data.");
+                }
+                break;
+            case GPBWireType::START_GROUP:
+            case GPBWireType::END_GROUP:
+                throw new GPBDecodeException("Unexpected wire type.");
+            default:
+                throw new GPBDecodeException("Unexpected wire type.");
+        }
+        $end = $input->current();
+
+        $bytes = str_repeat(chr(0), CodedOutputStream::MAX_VARINT64_BYTES);
+        $size = CodedOutputStream::writeVarintToArray($tag, $bytes, true);
+        $this->unknown .= substr($bytes, 0, $size) . $input->substr($start, $end);
+    }
+
+    /**
+     * @ignore
+     */
+    private static function parseFieldFromStreamNoTag($input, $field, &$value)
+    {
+        switch ($field->getType()) {
+            case GPBType::DOUBLE:
+                if (!GPBWire::readDouble($input, $value)) {
+                    throw new GPBDecodeException(
+                        "Unexpected EOF inside double field.");
+                }
+                break;
+            case GPBType::FLOAT:
+                if (!GPBWire::readFloat($input, $value)) {
+                    throw new GPBDecodeException(
+                        "Unexpected EOF inside float field.");
+                }
+                break;
+            case GPBType::INT64:
+                if (!GPBWire::readInt64($input, $value)) {
+                    throw new GPBDecodeException(
+                        "Unexpected EOF inside int64 field.");
+                }
+                break;
+            case GPBType::UINT64:
+                if (!GPBWire::readUint64($input, $value)) {
+                    throw new GPBDecodeException(
+                        "Unexpected EOF inside uint64 field.");
+                }
+                break;
+            case GPBType::INT32:
+                if (!GPBWire::readInt32($input, $value)) {
+                    throw new GPBDecodeException(
+                        "Unexpected EOF inside int32 field.");
+                }
+                break;
+            case GPBType::FIXED64:
+                if (!GPBWire::readFixed64($input, $value)) {
+                    throw new GPBDecodeException(
+                        "Unexpected EOF inside fixed64 field.");
+                }
+                break;
+            case GPBType::FIXED32:
+                if (!GPBWire::readFixed32($input, $value)) {
+                    throw new GPBDecodeException(
+                        "Unexpected EOF inside fixed32 field.");
+                }
+                break;
+            case GPBType::BOOL:
+                if (!GPBWire::readBool($input, $value)) {
+                    throw new GPBDecodeException(
+                        "Unexpected EOF inside bool field.");
+                }
+                break;
+            case GPBType::STRING:
+                // TODO(teboring): Add utf-8 check.
+                if (!GPBWire::readString($input, $value)) {
+                    throw new GPBDecodeException(
+                        "Unexpected EOF inside string field.");
+                }
+                break;
+            case GPBType::GROUP:
+                trigger_error("Not implemented.", E_ERROR);
+                break;
+            case GPBType::MESSAGE:
+                if ($field->isMap()) {
+                    $value = new MapEntry($field->getMessageType());
+                } else {
+                    $klass = $field->getMessageType()->getClass();
+                    $value = new $klass;
+                }
+                if (!GPBWire::readMessage($input, $value)) {
+                    throw new GPBDecodeException(
+                        "Unexpected EOF inside message.");
+                }
+                break;
+            case GPBType::BYTES:
+                if (!GPBWire::readString($input, $value)) {
+                    throw new GPBDecodeException(
+                        "Unexpected EOF inside bytes field.");
+                }
+                break;
+            case GPBType::UINT32:
+                if (!GPBWire::readUint32($input, $value)) {
+                    throw new GPBDecodeException(
+                        "Unexpected EOF inside uint32 field.");
+                }
+                break;
+            case GPBType::ENUM:
+                // TODO(teboring): Check unknown enum value.
+                if (!GPBWire::readInt32($input, $value)) {
+                    throw new GPBDecodeException(
+                        "Unexpected EOF inside enum field.");
+                }
+                break;
+            case GPBType::SFIXED32:
+                if (!GPBWire::readSfixed32($input, $value)) {
+                    throw new GPBDecodeException(
+                        "Unexpected EOF inside sfixed32 field.");
+                }
+                break;
+            case GPBType::SFIXED64:
+                if (!GPBWire::readSfixed64($input, $value)) {
+                    throw new GPBDecodeException(
+                        "Unexpected EOF inside sfixed64 field.");
+                }
+                break;
+            case GPBType::SINT32:
+                if (!GPBWire::readSint32($input, $value)) {
+                    throw new GPBDecodeException(
+                        "Unexpected EOF inside sint32 field.");
+                }
+                break;
+            case GPBType::SINT64:
+                if (!GPBWire::readSint64($input, $value)) {
+                    throw new GPBDecodeException(
+                        "Unexpected EOF inside sint64 field.");
+                }
+                break;
+            default:
+                user_error("Unsupported type.");
+                return false;
+        }
+        return true;
+    }
+
+    /**
+     * @ignore
+     */
+    private function parseFieldFromStream($tag, $input, $field)
+    {
+        $value = null;
+
+        if (is_null($field)) {
+            $value_format = GPBWire::UNKNOWN;
+        } elseif (GPBWire::getTagWireType($tag) ===
+            GPBWire::getWireType($field->getType())) {
+            $value_format = GPBWire::NORMAL_FORMAT;
+        } elseif ($field->isPackable() &&
+            GPBWire::getTagWireType($tag) ===
+            GPBWire::WIRETYPE_LENGTH_DELIMITED) {
+            $value_format = GPBWire::PACKED_FORMAT;
+        } else {
+            // the wire type doesn't match. Put it in our unknown field set.
+            $value_format = GPBWire::UNKNOWN;
+        }
+
+        if ($value_format === GPBWire::UNKNOWN) {
+            $this->skipField($input, $tag);
+            return;
+        } elseif ($value_format === GPBWire::NORMAL_FORMAT) {
+            self::parseFieldFromStreamNoTag($input, $field, $value);
+        } elseif ($value_format === GPBWire::PACKED_FORMAT) {
+            $length = 0;
+            if (!GPBWire::readInt32($input, $length)) {
+                throw new GPBDecodeException(
+                    "Unexpected EOF inside packed length.");
+            }
+            $limit = $input->pushLimit($length);
+            $getter = $field->getGetter();
+            while ($input->bytesUntilLimit() > 0) {
+                self::parseFieldFromStreamNoTag($input, $field, $value);
+                $this->appendHelper($field, $value);
+            }
+            $input->popLimit($limit);
+            return;
+        } else {
+            return;
+        }
+
+        if ($field->isMap()) {
+            $this->kvUpdateHelper($field, $value->getKey(), $value->getValue());
+        } else if ($field->isRepeated()) {
+            $this->appendHelper($field, $value);
+        } else {
+            $setter = $field->getSetter();
+            $this->$setter($value);
+        }
+    }
+
+    /**
+     * Clear all containing fields.
+     * @return null.
+     */
+    public function clear()
+    {
+        $this->unknown = "";
+        foreach ($this->desc->getField() as $field) {
+            $setter = $field->getSetter();
+            if ($field->isMap()) {
+                $message_type = $field->getMessageType();
+                $key_field = $message_type->getFieldByNumber(1);
+                $value_field = $message_type->getFieldByNumber(2);
+                switch ($value_field->getType()) {
+                    case GPBType::MESSAGE:
+                    case GPBType::GROUP:
+                        $map_field = new MapField(
+                            $key_field->getType(),
+                            $value_field->getType(),
+                            $value_field->getMessageType()->getClass());
+                        $this->$setter($map_field);
+                        break;
+                    case GPBType::ENUM:
+                        $map_field = new MapField(
+                            $key_field->getType(),
+                            $value_field->getType(),
+                            $value_field->getEnumType()->getClass());
+                        $this->$setter($map_field);
+                        break;
+                    default:
+                        $map_field = new MapField(
+                            $key_field->getType(),
+                            $value_field->getType());
+                        $this->$setter($map_field);
+                        break;
+                }
+            } else if ($field->getLabel() === GPBLabel::REPEATED) {
+                switch ($field->getType()) {
+                    case GPBType::MESSAGE:
+                    case GPBType::GROUP:
+                        $repeated_field = new RepeatedField(
+                            $field->getType(),
+                            $field->getMessageType()->getClass());
+                        $this->$setter($repeated_field);
+                        break;
+                    case GPBType::ENUM:
+                        $repeated_field = new RepeatedField(
+                            $field->getType(),
+                            $field->getEnumType()->getClass());
+                        $this->$setter($repeated_field);
+                        break;
+                    default:
+                        $repeated_field = new RepeatedField($field->getType());
+                        $this->$setter($repeated_field);
+                        break;
+                }
+            } else if ($field->getOneofIndex() !== -1) {
+                $oneof = $this->desc->getOneofDecl()[$field->getOneofIndex()];
+                $oneof_name = $oneof->getName();
+                $this->$oneof_name = new OneofField($oneof);
+            } else if ($field->getLabel() === GPBLabel::OPTIONAL) {
+                switch ($field->getType()) {
+                    case GPBType::DOUBLE   :
+                    case GPBType::FLOAT    :
+                        $this->$setter(0.0);
+                        break;
+                    case GPBType::INT32    :
+                    case GPBType::FIXED32  :
+                    case GPBType::UINT32   :
+                    case GPBType::SFIXED32 :
+                    case GPBType::SINT32   :
+                    case GPBType::ENUM     :
+                        $this->$setter(0);
+                        break;
+                    case GPBType::BOOL     :
+                        $this->$setter(false);
+                        break;
+                    case GPBType::STRING   :
+                    case GPBType::BYTES    :
+                        $this->$setter("");
+                        break;
+                    case GPBType::GROUP    :
+                    case GPBType::MESSAGE  :
+                        $null = null;
+                        $this->$setter($null);
+                        break;
+                }
+                if (PHP_INT_SIZE == 4) {
+                    switch ($field->getType()) {
+                        case GPBType::INT64:
+                        case GPBType::UINT64:
+                        case GPBType::FIXED64:
+                        case GPBType::SFIXED64:
+                        case GPBType::SINT64:
+                            $this->$setter("0");
+                    }
+                } else {
+                    switch ($field->getType()) {
+                        case GPBType::INT64:
+                        case GPBType::UINT64:
+                        case GPBType::FIXED64:
+                        case GPBType::SFIXED64:
+                        case GPBType::SINT64:
+                            $this->$setter(0);
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * Clear all unknown fields previously parsed.
+     * @return null.
+     */
+    public function discardUnknownFields()
+    {
+        $this->unknown = "";
+        foreach ($this->desc->getField() as $field) {
+            if ($field->getType() != GPBType::MESSAGE) {
+                continue;
+            }
+            if ($field->isMap()) {
+                $value_field = $field->getMessageType()->getFieldByNumber(2);
+                if ($value_field->getType() != GPBType::MESSAGE) {
+                    continue;
+                }
+                $getter = $field->getGetter();
+                $map = $this->$getter();
+                foreach ($map as $key => $value) {
+                    $value->discardUnknownFields();
+                }
+            } else if ($field->getLabel() === GPBLabel::REPEATED) {
+                $getter = $field->getGetter();
+                $arr = $this->$getter();
+                foreach ($arr as $sub) {
+                    $sub->discardUnknownFields();
+                }
+            } else if ($field->getLabel() === GPBLabel::OPTIONAL) {
+                $getter = $field->getGetter();
+                $sub = $this->$getter();
+                if (!is_null($sub)) {
+                    $sub->discardUnknownFields();
+                }
+            }
+        }
+    }
+
+    /**
+     * Merges the contents of the specified message into current message.
+     *
+     * This method merges the contents of the specified message into the
+     * current message. Singular fields that are set in the specified message
+     * overwrite the corresponding fields in the current message.  Repeated
+     * fields are appended. Map fields key-value pairs are overritten.
+     * Singular/Oneof sub-messages are recursively merged. All overritten
+     * sub-messages are deep-copied.
+     *
+     * @param object $msg Protobuf message to be merged from.
+     * @return null.
+     */
+    public function mergeFrom($msg)
+    {
+        if (get_class($this) !== get_class($msg)) {
+            user_error("Cannot merge messages with different class.");
+            return;
+        }
+
+        foreach ($this->desc->getField() as $field) {
+            $setter = $field->getSetter();
+            $getter = $field->getGetter();
+            if ($field->isMap()) {
+                if (count($msg->$getter()) != 0) {
+                    $value_field = $field->getMessageType()->getFieldByNumber(2);
+                    foreach ($msg->$getter() as $key => $value) {
+                        if ($value_field->getType() == GPBType::MESSAGE) {
+                            $klass = $value_field->getMessageType()->getClass();
+                            $copy = new $klass;
+                            $copy->mergeFrom($value);
+
+                            $this->kvUpdateHelper($field, $key, $copy);
+                        } else {
+                            $this->kvUpdateHelper($field, $key, $value);
+                        }
+                    }
+                }
+            } else if ($field->getLabel() === GPBLabel::REPEATED) {
+                if (count($msg->$getter()) != 0) {
+                    foreach ($msg->$getter() as $tmp) {
+                        if ($field->getType() == GPBType::MESSAGE) {
+                            $klass = $field->getMessageType()->getClass();
+                            $copy = new $klass;
+                            $copy->mergeFrom($tmp);
+                            $this->appendHelper($field, $copy);
+                        } else {
+                            $this->appendHelper($field, $tmp);
+                        }
+                    }
+                }
+            } else if ($field->getLabel() === GPBLabel::OPTIONAL) {
+                if($msg->$getter() !== $this->defaultValue($field)) {
+                    $tmp = $msg->$getter();
+                    if ($field->getType() == GPBType::MESSAGE) {
+                        if (is_null($this->$getter())) {
+                            $klass = $field->getMessageType()->getClass();
+                            $new_msg = new $klass;
+                            $this->$setter($new_msg);
+                        }
+                        $this->$getter()->mergeFrom($tmp);
+                    } else {
+                        $this->$setter($tmp);
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * Parses a protocol buffer contained in a string.
+     *
+     * This function takes a string in the (non-human-readable) binary wire
+     * format, matching the encoding output by serializeToString().
+     * See mergeFrom() for merging behavior, if the field is already set in the
+     * specified message.
+     *
+     * @param string $data Binary protobuf data.
+     * @return null.
+     * @throws \Exception Invalid data.
+     */
+    public function mergeFromString($data)
+    {
+        $input = new CodedInputStream($data);
+        $this->parseFromStream($input);
+    }
+
+    /**
+     * Parses a json string to protobuf message.
+     *
+     * This function takes a string in the json wire format, matching the
+     * encoding output by serializeToJsonString().
+     * See mergeFrom() for merging behavior, if the field is already set in the
+     * specified message.
+     *
+     * @param string $data Json protobuf data.
+     * @return null.
+     * @throws \Exception Invalid data.
+     */
+    public function mergeFromJsonString($data)
+    {
+        $input = new RawInputStream($data);
+        $this->parseFromJsonStream($input);
+    }
+
+    /**
+     * @ignore
+     */
+    public function parseFromStream($input)
+    {
+        while (true) {
+            $tag = $input->readTag();
+            // End of input.  This is a valid place to end, so return true.
+            if ($tag === 0) {
+                return true;
+            }
+
+            $number = GPBWire::getTagFieldNumber($tag);
+            $field = $this->desc->getFieldByNumber($number);
+
+            $this->parseFieldFromStream($tag, $input, $field);
+        }
+    }
+
+    private function convertJsonValueToProtoValue(
+        $value,
+        $field,
+        $is_map_key = false)
+    {
+        switch ($field->getType()) {
+            case GPBType::MESSAGE:
+                $klass = $field->getMessageType()->getClass();
+                $submsg = new $klass;
+
+                if (is_a($submsg, "Google\Protobuf\Duration")) {
+                    if (is_null($value)) {
+                        return $this->defaultValue($field);
+                    } else if (!is_string($value)) {
+                        throw new GPBDecodeException("Expect string.");
+                    }
+                    return GPBUtil::parseDuration($value);
+                } else if ($field->isTimestamp()) {
+                    if (is_null($value)) {
+                        return $this->defaultValue($field);
+                    } else if (!is_string($value)) {
+                        throw new GPBDecodeException("Expect string.");
+                    }
+                    try {
+                        $timestamp = GPBUtil::parseTimestamp($value);
+                    } catch (\Exception $e) {
+                        throw new GPBDecodeException(
+                            "Invalid RFC 3339 timestamp: ".$e->getMessage());
+                    }
+
+                    $submsg->setSeconds($timestamp->getSeconds());
+                    $submsg->setNanos($timestamp->getNanos());
+                } else if (is_a($submsg, "Google\Protobuf\FieldMask")) {
+                    if (is_null($value)) {
+                        return $this->defaultValue($field);
+                    }
+                    try {
+                        return GPBUtil::parseFieldMask($value);
+                    } catch (\Exception $e) {
+                        throw new GPBDecodeException(
+                            "Invalid FieldMask: ".$e->getMessage());
+                    }
+                } else {
+                    if (is_null($value) &&
+                        !is_a($submsg, "Google\Protobuf\Value")) {
+                        return $this->defaultValue($field);
+                    }
+                    if (GPBUtil::hasSpecialJsonMapping($submsg)) {
+                    } elseif (!is_object($value) && !is_array($value)) {
+                        throw new GPBDecodeException("Expect message.");
+                    }
+                    $submsg->mergeFromJsonArray($value);
+                }
+                return $submsg;
+            case GPBType::ENUM:
+                if (is_null($value)) {
+                    return $this->defaultValue($field);
+                }
+                if (is_integer($value)) {
+                    return $value;
+                }
+                $enum_value = $field->getEnumType()->getValueByName($value);
+                if (!is_null($enum_value)) {
+                    return $enum_value->getNumber();
+                }
+                throw new GPBDecodeException(
+                        "Enum field only accepts integer or enum value name");
+            case GPBType::STRING:
+                if (is_null($value)) {
+                    return $this->defaultValue($field);
+                }
+                if (is_numeric($value)) {
+                    return strval($value);
+                }
+                if (!is_string($value)) {
+                    throw new GPBDecodeException(
+                        "String field only accepts string value");
+                }
+                return $value;
+            case GPBType::BYTES:
+                if (is_null($value)) {
+                    return $this->defaultValue($field);
+                }
+                if (!is_string($value)) {
+                    throw new GPBDecodeException(
+                        "Byte field only accepts string value");
+                }
+                $proto_value = base64_decode($value, true);
+                if ($proto_value === false) {
+                    throw new GPBDecodeException("Invalid base64 characters");
+                }
+                return $proto_value;
+            case GPBType::BOOL:
+                if (is_null($value)) {
+                    return $this->defaultValue($field);
+                }
+                if ($is_map_key) {
+                    if ($value === "true") {
+                        return true;
+                    }
+                    if ($value === "false") {
+                        return false;
+                    }
+                    throw new GPBDecodeException(
+                        "Bool field only accepts bool value");
+                }
+                if (!is_bool($value)) {
+                    throw new GPBDecodeException(
+                        "Bool field only accepts bool value");
+                }
+                return $value;
+            case GPBType::FLOAT:
+            case GPBType::DOUBLE:
+                if (is_null($value)) {
+                    return $this->defaultValue($field);
+                }
+                if ($value === "Infinity") {
+                    return INF;
+                }
+                if ($value === "-Infinity") {
+                    return -INF;
+                }
+                if ($value === "NaN") {
+                    return NAN;
+                }
+                return $value;
+            case GPBType::INT32:
+            case GPBType::SINT32:
+            case GPBType::SFIXED32:
+                if (is_null($value)) {
+                    return $this->defaultValue($field);
+                }
+                if (!is_numeric($value)) {
+                   throw new GPBDecodeException(
+                       "Invalid data type for int32 field");
+                }
+                if (bccomp($value, "2147483647") > 0) {
+                   throw new GPBDecodeException(
+                       "Int32 too large");
+                }
+                if (bccomp($value, "-2147483648") < 0) {
+                   throw new GPBDecodeException(
+                       "Int32 too small");
+                }
+                return $value;
+            case GPBType::UINT32:
+            case GPBType::FIXED32:
+                if (is_null($value)) {
+                    return $this->defaultValue($field);
+                }
+                if (!is_numeric($value)) {
+                   throw new GPBDecodeException(
+                       "Invalid data type for uint32 field");
+                }
+                if (bccomp($value, 4294967295) > 0) {
+                    throw new GPBDecodeException(
+                        "Uint32 too large");
+                }
+                return $value;
+            case GPBType::INT64:
+            case GPBType::SINT64:
+            case GPBType::SFIXED64:
+                if (is_null($value)) {
+                    return $this->defaultValue($field);
+                }
+                if (!is_numeric($value)) {
+                   throw new GPBDecodeException(
+                       "Invalid data type for int64 field");
+                }
+                if (bccomp($value, "9223372036854775807") > 0) {
+                    throw new GPBDecodeException(
+                        "Int64 too large");
+                }
+                if (bccomp($value, "-9223372036854775808") < 0) {
+                    throw new GPBDecodeException(
+                        "Int64 too small");
+                }
+                return $value;
+            case GPBType::UINT64:
+            case GPBType::FIXED64:
+                if (is_null($value)) {
+                    return $this->defaultValue($field);
+                }
+                if (!is_numeric($value)) {
+                   throw new GPBDecodeException(
+                       "Invalid data type for int64 field");
+                }
+                if (bccomp($value, "18446744073709551615") > 0) {
+                    throw new GPBDecodeException(
+                        "Uint64 too large");
+                }
+                if (bccomp($value, "9223372036854775807") > 0) {
+                    $value = bcsub($value, "18446744073709551616");
+                }
+                return $value;
+            default:
+                return $value;
+        }
+    }
+
+    /**
+     * Populates the message from a user-supplied PHP array. Array keys
+     * correspond to Message properties and nested message properties.
+     *
+     * Example:
+     * ```
+     * $message->mergeFromArray([
+     *     'name' => 'This is a message name',
+     *     'interval' => [
+     *          'startTime' => time() - 60,
+     *          'endTime' => time(),
+     *     ]
+     * ]);
+     * ```
+     *
+     * This method will trigger an error if it is passed data that cannot
+     * be converted to the correct type. For example, a StringValue field
+     * must receive data that is either a string or a StringValue object.
+     *
+     * @param array $array An array containing message properties and values.
+     * @return null.
+     */
+    protected function mergeFromArray(array $array)
+    {
+        // Just call the setters for the field names
+        foreach ($array as $key => $value) {
+            $field = $this->desc->getFieldByName($key);
+            if (is_null($field)) {
+                throw new \UnexpectedValueException(
+                    'Invalid message property: ' . $key);
+            }
+            $setter = $field->getSetter();
+            if ($field->isMap()) {
+                $valueField = $field->getMessageType()->getFieldByName('value');
+                if (!is_null($valueField) && $valueField->isWrapperType()) {
+                    self::normalizeArrayElementsToMessageType($value, $valueField->getMessageType()->getClass());
+                }
+            } elseif ($field->isWrapperType()) {
+                $class = $field->getMessageType()->getClass();
+                if ($field->isRepeated()) {
+                    self::normalizeArrayElementsToMessageType($value, $class);
+                } else {
+                    self::normalizeToMessageType($value, $class);
+                }
+            }
+            $this->$setter($value);
+        }
+    }
+
+    /**
+     * Tries to normalize the elements in $value into a provided protobuf
+     * wrapper type $class. If $value is any type other than array, we do
+     * not do any conversion, and instead rely on the existing protobuf
+     * type checking. If $value is an array, we process each element and
+     * try to convert it to an instance of $class.
+     *
+     * @param mixed $value The array of values to normalize.
+     * @param string $class The expected wrapper class name
+     */
+    private static function normalizeArrayElementsToMessageType(&$value, $class)
+    {
+        if (!is_array($value)) {
+            // In the case that $value is not an array, we do not want to
+            // attempt any conversion. Note that this includes the cases
+            // when $value is a RepeatedField of MapField. In those cases,
+            // we do not need to convert the elements, as they should
+            // already be the correct types.
+            return;
+        } else {
+            // Normalize each element in the array.
+            foreach ($value as $key => &$elementValue) {
+              self::normalizeToMessageType($elementValue, $class);
+            }
+        }
+    }
+
+    /**
+     * Tries to normalize $value into a provided protobuf wrapper type $class.
+     * If $value is any type other than an object, we attempt to construct an
+     * instance of $class and assign $value to it using the setValue method
+     * shared by all wrapper types.
+     *
+     * This method will raise an error if it receives a type that cannot be
+     * assigned to the wrapper type via setValue.
+     *
+     * @param mixed $value The value to normalize.
+     * @param string $class The expected wrapper class name
+     */
+    private static function normalizeToMessageType(&$value, $class)
+    {
+        if (is_null($value) || is_object($value)) {
+            // This handles the case that $value is an instance of $class. We
+            // choose not to do any more strict checking here, relying on the
+            // existing type checking done by GPBUtil.
+            return;
+        } else {
+            // Try to instantiate $class and set the value
+            try {
+                $msg = new $class;
+                $msg->setValue($value);
+                $value = $msg;
+                return;
+            } catch (\Exception $exception) {
+                trigger_error(
+                    "Error normalizing value to type '$class': " . $exception->getMessage(),
+                    E_USER_ERROR
+                );
+            }
+        }
+    }
+
+    protected function mergeFromJsonArray($array)
+    {
+        if (is_a($this, "Google\Protobuf\Any")) {
+            $this->clear();
+            $this->setTypeUrl($array["@type"]);
+            $msg = $this->unpack();
+            if (GPBUtil::hasSpecialJsonMapping($msg)) {
+                $msg->mergeFromJsonArray($array["value"]);
+            } else {
+                unset($array["@type"]);
+                $msg->mergeFromJsonArray($array);
+            }
+            $this->setValue($msg->serializeToString());
+            return;
+        }
+        if (is_a($this, "Google\Protobuf\DoubleValue") ||
+            is_a($this, "Google\Protobuf\FloatValue")  ||
+            is_a($this, "Google\Protobuf\Int64Value")  ||
+            is_a($this, "Google\Protobuf\UInt64Value") ||
+            is_a($this, "Google\Protobuf\Int32Value")  ||
+            is_a($this, "Google\Protobuf\UInt32Value") ||
+            is_a($this, "Google\Protobuf\BoolValue")   ||
+            is_a($this, "Google\Protobuf\StringValue")) {
+            $this->setValue($array);
+            return;
+        }
+        if (is_a($this, "Google\Protobuf\BytesValue")) {
+            $this->setValue(base64_decode($array));
+            return;
+        }
+        if (is_a($this, "Google\Protobuf\Duration")) {
+            $this->mergeFrom(GPBUtil::parseDuration($array));
+            return;
+        }
+        if (is_a($this, "Google\Protobuf\FieldMask")) {
+            $this->mergeFrom(GPBUtil::parseFieldMask($array));
+            return;
+        }
+        if (is_a($this, "Google\Protobuf\Timestamp")) {
+            $this->mergeFrom(GPBUtil::parseTimestamp($array));
+            return;
+        }
+        if (is_a($this, "Google\Protobuf\Struct")) {
+            $fields = $this->getFields();
+            foreach($array as $key => $value) {
+                $v = new Value();
+                $v->mergeFromJsonArray($value);
+                $fields[$key] = $v;
+            }
+        }
+        if (is_a($this, "Google\Protobuf\Value")) {
+            if (is_bool($array)) {
+                $this->setBoolValue($array);
+            } elseif (is_string($array)) {
+                $this->setStringValue($array);
+            } elseif (is_null($array)) {
+                $this->setNullValue(0);
+            } elseif (is_double($array) || is_integer($array)) {
+                $this->setNumberValue($array);
+            } elseif (is_array($array)) {
+                if (array_values($array) !== $array) {
+                    // Associative array
+                    $struct_value = $this->getStructValue();
+                    if (is_null($struct_value)) {
+                        $struct_value = new Struct();
+                        $this->setStructValue($struct_value);
+                    }
+                    foreach ($array as $key => $v) {
+                        $value = new Value();
+                        $value->mergeFromJsonArray($v);
+                        $values = $struct_value->getFields();
+                        $values[$key]= $value;
+                    }
+                } else {
+                    // Array
+                    $list_value = $this->getListValue();
+                    if (is_null($list_value)) {
+                        $list_value = new ListValue();
+                        $this->setListValue($list_value);
+                    }
+                    foreach ($array as $v) {
+                        $value = new Value();
+                        $value->mergeFromJsonArray($v);
+                        $values = $list_value->getValues();
+                        $values[]= $value;
+                    }
+                }
+            } else {
+                throw new GPBDecodeException("Invalid type for Value.");
+            }
+            return;
+        }
+        $this->mergeFromArrayJsonImpl($array);
+    }
+
+    private function mergeFromArrayJsonImpl($array)
+    {
+        foreach ($array as $key => $value) {
+            $field = $this->desc->getFieldByJsonName($key);
+            if (is_null($field)) {
+                $field = $this->desc->getFieldByName($key);
+                if (is_null($field)) {
+                    continue;
+                }
+            }
+            if ($field->isMap()) {
+                if (is_null($value)) {
+                    continue;
+                }
+                $key_field = $field->getMessageType()->getFieldByNumber(1);
+                $value_field = $field->getMessageType()->getFieldByNumber(2);
+                foreach ($value as $tmp_key => $tmp_value) {
+                    if (is_null($tmp_value)) {
+                        throw new \Exception(
+                            "Map value field element cannot be null.");
+                    }
+                    $proto_key = $this->convertJsonValueToProtoValue(
+                        $tmp_key,
+                        $key_field,
+                        true);
+                    $proto_value = $this->convertJsonValueToProtoValue(
+                        $tmp_value,
+                        $value_field);
+                    self::kvUpdateHelper($field, $proto_key, $proto_value);
+                }
+            } else if ($field->isRepeated()) {
+                if (is_null($value)) {
+                    continue;
+                }
+                foreach ($value as $tmp) {
+                    if (is_null($tmp)) {
+                        throw new \Exception(
+                            "Repeated field elements cannot be null.");
+                    }
+                    $proto_value = $this->convertJsonValueToProtoValue(
+                        $tmp,
+                        $field);
+                    self::appendHelper($field, $proto_value);
+                }
+            } else {
+                $setter = $field->getSetter();
+                $proto_value = $this->convertJsonValueToProtoValue(
+                    $value,
+                    $field);
+                if ($field->getType() === GPBType::MESSAGE) {
+                    if (is_null($proto_value)) {
+                        continue;
+                    }
+                    $getter = $field->getGetter();
+                    $submsg = $this->$getter();
+                    if (!is_null($submsg)) {
+                        $submsg->mergeFrom($proto_value);
+                        continue;
+                    }
+                }
+                $this->$setter($proto_value);
+            }
+        }
+    }
+
+    /**
+     * @ignore
+     */
+    public function parseFromJsonStream($input)
+    {
+        $array = json_decode($input->getData(), true, 512, JSON_BIGINT_AS_STRING);
+        if ($this instanceof \Google\Protobuf\ListValue) {
+            $array = ["values"=>$array];
+        }
+        if (is_null($array)) {
+            if ($this instanceof \Google\Protobuf\Value) {
+              $this->setNullValue(\Google\Protobuf\NullValue::NULL_VALUE);
+              return;
+            } else {
+              throw new GPBDecodeException(
+                  "Cannot decode json string: " . $input->getData());
+            }
+        }
+        try {
+            $this->mergeFromJsonArray($array);
+        } catch (\Exception $e) {
+            throw new GPBDecodeException($e->getMessage());
+        }
+    }
+
+    /**
+     * @ignore
+     */
+    private function serializeSingularFieldToStream($field, &$output)
+    {
+        if (!$this->existField($field)) {
+            return true;
+        }
+        $getter = $field->getGetter();
+        $value = $this->$getter();
+        if (!GPBWire::serializeFieldToStream($value, $field, true, $output)) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * @ignore
+     */
+    private function serializeRepeatedFieldToStream($field, &$output)
+    {
+        $getter = $field->getGetter();
+        $values = $this->$getter();
+        $count = count($values);
+        if ($count === 0) {
+            return true;
+        }
+
+        $packed = $field->getPacked();
+        if ($packed) {
+            if (!GPBWire::writeTag(
+                $output,
+                GPBWire::makeTag($field->getNumber(), GPBType::STRING))) {
+                return false;
+            }
+            $size = 0;
+            foreach ($values as $value) {
+                $size += $this->fieldDataOnlyByteSize($field, $value);
+            }
+            if (!$output->writeVarint32($size, true)) {
+                return false;
+            }
+        }
+
+        foreach ($values as $value) {
+            if (!GPBWire::serializeFieldToStream(
+                $value,
+                $field,
+                !$packed,
+                $output)) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * @ignore
+     */
+    private function serializeMapFieldToStream($field, $output)
+    {
+        $getter = $field->getGetter();
+        $values = $this->$getter();
+        $count = count($values);
+        if ($count === 0) {
+            return true;
+        }
+
+        foreach ($values as $key => $value) {
+            $map_entry = new MapEntry($field->getMessageType());
+            $map_entry->setKey($key);
+            $map_entry->setValue($value);
+            if (!GPBWire::serializeFieldToStream(
+                $map_entry,
+                $field,
+                true,
+                $output)) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * @ignore
+     */
+    private function serializeFieldToStream(&$output, $field)
+    {
+        if ($field->isMap()) {
+            return $this->serializeMapFieldToStream($field, $output);
+        } elseif ($field->isRepeated()) {
+            return $this->serializeRepeatedFieldToStream($field, $output);
+        } else {
+            return $this->serializeSingularFieldToStream($field, $output);
+        }
+    }
+
+    /**
+     * @ignore
+     */
+    private function serializeFieldToJsonStream(&$output, $field)
+    {
+        $getter = $field->getGetter();
+        $values = $this->$getter();
+        return GPBJsonWire::serializeFieldToStream(
+            $values, $field, $output, !GPBUtil::hasSpecialJsonMapping($this));
+    }
+
+    /**
+     * @ignore
+     */
+    public function serializeToStream(&$output)
+    {
+        $fields = $this->desc->getField();
+        foreach ($fields as $field) {
+            if (!$this->serializeFieldToStream($output, $field)) {
+                return false;
+            }
+        }
+        $output->writeRaw($this->unknown, strlen($this->unknown));
+        return true;
+    }
+
+    /**
+     * @ignore
+     */
+    public function serializeToJsonStream(&$output)
+    {
+        if (is_a($this, 'Google\Protobuf\Any')) {
+            $output->writeRaw("{", 1);
+            $type_field = $this->desc->getFieldByNumber(1);
+            $value_msg = $this->unpack();
+
+            // Serialize type url.
+            $output->writeRaw("\"@type\":", 8);
+            $output->writeRaw("\"", 1);
+            $output->writeRaw($this->getTypeUrl(), strlen($this->getTypeUrl()));
+            $output->writeRaw("\"", 1);
+
+            // Serialize value
+            if (GPBUtil::hasSpecialJsonMapping($value_msg)) {
+                $output->writeRaw(",\"value\":", 9);
+                $value_msg->serializeToJsonStream($output);
+            } else {
+                $value_fields = $value_msg->desc->getField();
+                foreach ($value_fields as $field) {
+                    if ($value_msg->existField($field)) {
+                        $output->writeRaw(",", 1);
+                        if (!$value_msg->serializeFieldToJsonStream($output, $field)) {
+                            return false;
+                        }
+                    }
+                }
+            }
+
+            $output->writeRaw("}", 1);
+        } elseif (is_a($this, 'Google\Protobuf\FieldMask')) {
+            $field_mask = GPBUtil::formatFieldMask($this);
+            $output->writeRaw("\"", 1);
+            $output->writeRaw($field_mask, strlen($field_mask));
+            $output->writeRaw("\"", 1);
+        } elseif (is_a($this, 'Google\Protobuf\Duration')) {
+            $duration = GPBUtil::formatDuration($this) . "s";
+            $output->writeRaw("\"", 1);
+            $output->writeRaw($duration, strlen($duration));
+            $output->writeRaw("\"", 1);
+        } elseif (get_class($this) === 'Google\Protobuf\Timestamp') {
+            $timestamp = GPBUtil::formatTimestamp($this);
+            $timestamp = json_encode($timestamp);
+            $output->writeRaw($timestamp, strlen($timestamp));
+        } elseif (get_class($this) === 'Google\Protobuf\ListValue') {
+            $field = $this->desc->getField()[1];
+            if (!$this->existField($field)) {
+                $output->writeRaw("[]", 2);
+            } else {
+                if (!$this->serializeFieldToJsonStream($output, $field)) {
+                    return false;
+                }
+            }
+        } elseif (get_class($this) === 'Google\Protobuf\Struct') {
+            $field = $this->desc->getField()[1];
+            if (!$this->existField($field)) {
+                $output->writeRaw("{}", 2);
+            } else {
+                if (!$this->serializeFieldToJsonStream($output, $field)) {
+                    return false;
+                }
+            }
+        } else {
+            if (!GPBUtil::hasSpecialJsonMapping($this)) {
+                $output->writeRaw("{", 1);
+            }
+            $fields = $this->desc->getField();
+            $first = true;
+            foreach ($fields as $field) {
+                if ($this->existField($field) ||
+                    GPBUtil::hasJsonValue($this)) {
+                    if ($first) {
+                        $first = false;
+                    } else {
+                        $output->writeRaw(",", 1);
+                    }
+                    if (!$this->serializeFieldToJsonStream($output, $field)) {
+                        return false;
+                    }
+                }
+            }
+            if (!GPBUtil::hasSpecialJsonMapping($this)) {
+                $output->writeRaw("}", 1);
+            }
+        }
+        return true;
+    }
+
+    /**
+     * Serialize the message to string.
+     * @return string Serialized binary protobuf data.
+     */
+    public function serializeToString()
+    {
+        $output = new CodedOutputStream($this->byteSize());
+        $this->serializeToStream($output);
+        return $output->getData();
+    }
+
+    /**
+     * Serialize the message to json string.
+     * @return string Serialized json protobuf data.
+     */
+    public function serializeToJsonString()
+    {
+        $output = new CodedOutputStream($this->jsonByteSize());
+        $this->serializeToJsonStream($output);
+        return $output->getData();
+    }
+
+    /**
+     * @ignore
+     */
+    private function existField($field)
+    {
+        $oneof_index = $field->getOneofIndex();
+        if ($oneof_index !== -1) {
+            $oneof = $this->desc->getOneofDecl()[$oneof_index];
+            $oneof_name = $oneof->getName();
+            return $this->$oneof_name->getNumber() === $field->getNumber();
+        }
+
+        $getter = $field->getGetter();
+        $values = $this->$getter();
+        if ($field->isMap()) {
+            return count($values) !== 0;
+        } elseif ($field->isRepeated()) {
+            return count($values) !== 0;
+        } else {
+            return $values !== $this->defaultValue($field);
+        }
+    }
+
+    /**
+     * @ignore
+     */
+    private function repeatedFieldDataOnlyByteSize($field)
+    {
+        $size = 0;
+
+        $getter = $field->getGetter();
+        $values = $this->$getter();
+        $count = count($values);
+        if ($count !== 0) {
+            $size += $count * GPBWire::tagSize($field);
+            foreach ($values as $value) {
+                $size += $this->singularFieldDataOnlyByteSize($field);
+            }
+        }
+    }
+
+    /**
+     * @ignore
+     */
+    private function fieldDataOnlyByteSize($field, $value)
+    {
+        $size = 0;
+
+        switch ($field->getType()) {
+            case GPBType::BOOL:
+                $size += 1;
+                break;
+            case GPBType::FLOAT:
+            case GPBType::FIXED32:
+            case GPBType::SFIXED32:
+                $size += 4;
+                break;
+            case GPBType::DOUBLE:
+            case GPBType::FIXED64:
+            case GPBType::SFIXED64:
+                $size += 8;
+                break;
+            case GPBType::INT32:
+            case GPBType::ENUM:
+                $size += GPBWire::varint32Size($value, true);
+                break;
+            case GPBType::UINT32:
+                $size += GPBWire::varint32Size($value);
+                break;
+            case GPBType::UINT64:
+            case GPBType::INT64:
+                $size += GPBWire::varint64Size($value);
+                break;
+            case GPBType::SINT32:
+                $size += GPBWire::sint32Size($value);
+                break;
+            case GPBType::SINT64:
+                $size += GPBWire::sint64Size($value);
+                break;
+            case GPBType::STRING:
+            case GPBType::BYTES:
+                $size += strlen($value);
+                $size += GPBWire::varint32Size($size);
+                break;
+            case GPBType::MESSAGE:
+                $size += $value->byteSize();
+                $size += GPBWire::varint32Size($size);
+                break;
+            case GPBType::GROUP:
+                // TODO(teboring): Add support.
+                user_error("Unsupported type.");
+                break;
+            default:
+                user_error("Unsupported type.");
+                return 0;
+        }
+
+        return $size;
+    }
+
+    /**
+     * @ignore
+     */
+    private function fieldDataOnlyJsonByteSize($field, $value)
+    {
+        $size = 0;
+
+        switch ($field->getType()) {
+            case GPBType::SFIXED32:
+            case GPBType::SINT32:
+            case GPBType::INT32:
+                $size += strlen(strval($value));
+                break;
+            case GPBType::FIXED32:
+            case GPBType::UINT32:
+                if ($value < 0) {
+                    $value = bcadd($value, "4294967296");
+                }
+                $size += strlen(strval($value));
+                break;
+            case GPBType::FIXED64:
+            case GPBType::UINT64:
+                if ($value < 0) {
+                    $value = bcadd($value, "18446744073709551616");
+                }
+                // Intentional fall through.
+            case GPBType::SFIXED64:
+            case GPBType::INT64:
+            case GPBType::SINT64:
+                $size += 2;  // size for ""
+                $size += strlen(strval($value));
+                break;
+            case GPBType::FLOAT:
+                if (is_nan($value)) {
+                    $size += strlen("NaN") + 2;
+                } elseif ($value === INF) {
+                    $size += strlen("Infinity") + 2;
+                } elseif ($value === -INF) {
+                    $size += strlen("-Infinity") + 2;
+                } else {
+                    $size += strlen(sprintf("%.8g", $value));
+                }
+                break;
+            case GPBType::DOUBLE:
+                if (is_nan($value)) {
+                    $size += strlen("NaN") + 2;
+                } elseif ($value === INF) {
+                    $size += strlen("Infinity") + 2;
+                } elseif ($value === -INF) {
+                    $size += strlen("-Infinity") + 2;
+                } else {
+                    $size += strlen(sprintf("%.17g", $value));
+                }
+                break;
+            case GPBType::ENUM:
+                $enum_desc = $field->getEnumType();
+                if ($enum_desc->getClass() === "Google\Protobuf\NullValue") {
+                    $size += 4;
+                    break;
+                }
+                $enum_value_desc = $enum_desc->getValueByNumber($value);
+                if (!is_null($enum_value_desc)) {
+                    $size += 2;  // size for ""
+                    $size += strlen($enum_value_desc->getName());
+                } else {
+                    $str_value = strval($value);
+                    $size += strlen($str_value);
+                }
+                break;
+            case GPBType::BOOL:
+                if ($value) {
+                    $size += 4;
+                } else {
+                    $size += 5;
+                }
+                break;
+            case GPBType::STRING:
+                $value = json_encode($value, JSON_UNESCAPED_UNICODE);
+                $size += strlen($value);
+                break;
+            case GPBType::BYTES:
+                # if (is_a($this, "Google\Protobuf\BytesValue")) {
+                #     $size += strlen(json_encode($value));
+                # } else {
+                #     $size += strlen(base64_encode($value));
+                #     $size += 2;  // size for \"\"
+                # }
+                $size += strlen(base64_encode($value));
+                $size += 2;  // size for \"\"
+                break;
+            case GPBType::MESSAGE:
+                $size += $value->jsonByteSize();
+                break;
+#             case GPBType::GROUP:
+#                 // TODO(teboring): Add support.
+#                 user_error("Unsupported type.");
+#                 break;
+            default:
+                user_error("Unsupported type " . $field->getType());
+                return 0;
+        }
+
+        return $size;
+    }
+
+    /**
+     * @ignore
+     */
+    private function fieldByteSize($field)
+    {
+        $size = 0;
+        if ($field->isMap()) {
+            $getter = $field->getGetter();
+            $values = $this->$getter();
+            $count = count($values);
+            if ($count !== 0) {
+                $size += $count * GPBWire::tagSize($field);
+                $message_type = $field->getMessageType();
+                $key_field = $message_type->getFieldByNumber(1);
+                $value_field = $message_type->getFieldByNumber(2);
+                foreach ($values as $key => $value) {
+                    $data_size = 0;
+                    if ($key != $this->defaultValue($key_field)) {
+                        $data_size += $this->fieldDataOnlyByteSize(
+                            $key_field,
+                            $key);
+                        $data_size += GPBWire::tagSize($key_field);
+                    }
+                    if ($value != $this->defaultValue($value_field)) {
+                        $data_size += $this->fieldDataOnlyByteSize(
+                            $value_field,
+                            $value);
+                        $data_size += GPBWire::tagSize($value_field);
+                    }
+                    $size += GPBWire::varint32Size($data_size) + $data_size;
+                }
+            }
+        } elseif ($field->isRepeated()) {
+            $getter = $field->getGetter();
+            $values = $this->$getter();
+            $count = count($values);
+            if ($count !== 0) {
+                if ($field->getPacked()) {
+                    $data_size = 0;
+                    foreach ($values as $value) {
+                        $data_size += $this->fieldDataOnlyByteSize($field, $value);
+                    }
+                    $size += GPBWire::tagSize($field);
+                    $size += GPBWire::varint32Size($data_size);
+                    $size += $data_size;
+                } else {
+                    $size += $count * GPBWire::tagSize($field);
+                    foreach ($values as $value) {
+                        $size += $this->fieldDataOnlyByteSize($field, $value);
+                    }
+                }
+            }
+        } elseif ($this->existField($field)) {
+            $size += GPBWire::tagSize($field);
+            $getter = $field->getGetter();
+            $value = $this->$getter();
+            $size += $this->fieldDataOnlyByteSize($field, $value);
+        }
+        return $size;
+    }
+
+    /**
+     * @ignore
+     */
+    private function fieldJsonByteSize($field)
+    {
+        $size = 0;
+
+        if ($field->isMap()) {
+            $getter = $field->getGetter();
+            $values = $this->$getter();
+            $count = count($values);
+            if ($count !== 0) {
+                if (!GPBUtil::hasSpecialJsonMapping($this)) {
+                    $size += 3;                              // size for "\"\":".
+                    $size += strlen($field->getJsonName());  // size for field name
+                }
+                $size += 2;  // size for "{}".
+                $size += $count - 1;                     // size for commas
+                $getter = $field->getGetter();
+                $map_entry = $field->getMessageType();
+                $key_field = $map_entry->getFieldByNumber(1);
+                $value_field = $map_entry->getFieldByNumber(2);
+                switch ($key_field->getType()) {
+                case GPBType::STRING:
+                case GPBType::SFIXED64:
+                case GPBType::INT64:
+                case GPBType::SINT64:
+                case GPBType::FIXED64:
+                case GPBType::UINT64:
+                    $additional_quote = false;
+                    break;
+                default:
+                    $additional_quote = true;
+                }
+                foreach ($values as $key => $value) {
+                    if ($additional_quote) {
+                        $size += 2;  // size for ""
+                    }
+                    $size += $this->fieldDataOnlyJsonByteSize($key_field, $key);
+                    $size += $this->fieldDataOnlyJsonByteSize($value_field, $value);
+                    $size += 1;  // size for :
+                }
+            }
+        } elseif ($field->isRepeated()) {
+            $getter = $field->getGetter();
+            $values = $this->$getter();
+            $count = count($values);
+            if ($count !== 0) {
+                if (!GPBUtil::hasSpecialJsonMapping($this)) {
+                    $size += 3;                              // size for "\"\":".
+                    $size += strlen($field->getJsonName());  // size for field name
+                }
+                $size += 2;  // size for "[]".
+                $size += $count - 1;                     // size for commas
+                $getter = $field->getGetter();
+                foreach ($values as $value) {
+                    $size += $this->fieldDataOnlyJsonByteSize($field, $value);
+                }
+            }
+        } elseif ($this->existField($field) || GPBUtil::hasJsonValue($this)) {
+            if (!GPBUtil::hasSpecialJsonMapping($this)) {
+                $size += 3;                              // size for "\"\":".
+                $size += strlen($field->getJsonName());  // size for field name
+            }
+            $getter = $field->getGetter();
+            $value = $this->$getter();
+            $size += $this->fieldDataOnlyJsonByteSize($field, $value);
+        }
+        return $size;
+    }
+
+    /**
+     * @ignore
+     */
+    public function byteSize()
+    {
+        $size = 0;
+
+        $fields = $this->desc->getField();
+        foreach ($fields as $field) {
+            $size += $this->fieldByteSize($field);
+        }
+        $size += strlen($this->unknown);
+        return $size;
+    }
+
+    private function appendHelper($field, $append_value)
+    {
+        $getter = $field->getGetter();
+        $setter = $field->getSetter();
+
+        $field_arr_value = $this->$getter();
+        $field_arr_value[] = $append_value;
+
+        if (!is_object($field_arr_value)) {
+            $this->$setter($field_arr_value);
+        }
+    }
+
+    private function kvUpdateHelper($field, $update_key, $update_value)
+    {
+        $getter = $field->getGetter();
+        $setter = $field->getSetter();
+
+        $field_arr_value = $this->$getter();
+        $field_arr_value[$update_key] = $update_value;
+
+        if (!is_object($field_arr_value)) {
+            $this->$setter($field_arr_value);
+        }
+    }
+
+    /**
+     * @ignore
+     */
+    public function jsonByteSize()
+    {
+        $size = 0;
+        if (is_a($this, 'Google\Protobuf\Any')) {
+            // Size for "{}".
+            $size += 2;
+
+            // Size for "\"@type\":".
+            $size += 8;
+
+            // Size for url. +2 for "" /.
+            $size += strlen($this->getTypeUrl()) + 2;
+
+            $value_msg = $this->unpack();
+            if (GPBUtil::hasSpecialJsonMapping($value_msg)) {
+                // Size for "\",value\":".
+                $size += 9;
+                $size += $value_msg->jsonByteSize();
+            } else {
+                // Size for value. +1 for comma, -2 for "{}".
+                $size += $value_msg->jsonByteSize() -1;
+            }
+        } elseif (get_class($this) === 'Google\Protobuf\FieldMask') {
+            $field_mask = GPBUtil::formatFieldMask($this);
+            $size += strlen($field_mask) + 2;  // 2 for ""
+        } elseif (get_class($this) === 'Google\Protobuf\Duration') {
+            $duration = GPBUtil::formatDuration($this) . "s";
+            $size += strlen($duration) + 2;  // 2 for ""
+        } elseif (get_class($this) === 'Google\Protobuf\Timestamp') {
+            $timestamp = GPBUtil::formatTimestamp($this);
+            $timestamp = json_encode($timestamp);
+            $size += strlen($timestamp);
+        } elseif (get_class($this) === 'Google\Protobuf\ListValue') {
+            $field = $this->desc->getField()[1];
+            if ($this->existField($field)) {
+                $field_size = $this->fieldJsonByteSize($field);
+                $size += $field_size;
+            } else {
+                // Size for "[]".
+                $size += 2;
+            }
+        } elseif (get_class($this) === 'Google\Protobuf\Struct') {
+            $field = $this->desc->getField()[1];
+            if ($this->existField($field)) {
+                $field_size = $this->fieldJsonByteSize($field);
+                $size += $field_size;
+            } else {
+                // Size for "{}".
+                $size += 2;
+            }
+        } else {
+            if (!GPBUtil::hasSpecialJsonMapping($this)) {
+                // Size for "{}".
+                $size += 2;
+            }
+
+            $fields = $this->desc->getField();
+            $count = 0;
+            foreach ($fields as $field) {
+                $field_size = $this->fieldJsonByteSize($field);
+                $size += $field_size;
+                if ($field_size != 0) {
+                  $count++;
+                }
+            }
+            // size for comma
+            $size += $count > 0 ? ($count - 1) : 0;
+        }
+        return $size;
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MessageBuilderContext.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MessageBuilderContext.php
new file mode 100644
index 0000000..2724d26
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MessageBuilderContext.php
@@ -0,0 +1,120 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\GPBLabel;
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\Descriptor;
+use Google\Protobuf\Internal\FieldDescriptor;
+
+class MessageBuilderContext
+{
+
+    private $descriptor;
+    private $pool;
+
+    public function __construct($full_name, $klass, $pool)
+    {
+        $this->descriptor = new Descriptor();
+        $this->descriptor->setFullName($full_name);
+        $this->descriptor->setClass($klass);
+        $this->pool = $pool;
+    }
+
+    private function getFieldDescriptor($name, $label, $type,
+                                      $number, $type_name = null)
+    {
+        $field = new FieldDescriptor();
+        $field->setName($name);
+        $camel_name = implode('', array_map('ucwords', explode('_', $name)));
+        $field->setGetter('get' . $camel_name);
+        $field->setSetter('set' . $camel_name);
+        $field->setType($type);
+        $field->setNumber($number);
+        $field->setLabel($label);
+
+        // At this time, the message/enum type may have not been added to pool.
+        // So we use the type name as place holder and will replace it with the
+        // actual descriptor in cross building.
+        switch ($type) {
+        case GPBType::MESSAGE:
+          $field->setMessageType($type_name);
+          break;
+        case GPBType::ENUM:
+          $field->setEnumType($type_name);
+          break;
+        default:
+          break;
+        }
+
+        return $field;
+    }
+
+    public function optional($name, $type, $number, $type_name = null)
+    {
+        $this->descriptor->addField($this->getFieldDescriptor(
+            $name,
+            GPBLabel::OPTIONAL,
+            $type,
+            $number,
+            $type_name));
+        return $this;
+    }
+
+    public function repeated($name, $type, $number, $type_name = null)
+    {
+        $this->descriptor->addField($this->getFieldDescriptor(
+            $name,
+            GPBLabel::REPEATED,
+            $type,
+            $number,
+            $type_name));
+        return $this;
+    }
+
+    public function required($name, $type, $number, $type_name = null)
+    {
+        $this->descriptor->addField($this->getFieldDescriptor(
+            $name,
+            GPBLabel::REQUIRED,
+            $type,
+            $number,
+            $type_name));
+        return $this;
+    }
+
+    public function finalizeToPool()
+    {
+        $this->pool->addDescriptor($this->descriptor);
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MessageOptions.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MessageOptions.php
new file mode 100644
index 0000000..95bb706
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MessageOptions.php
@@ -0,0 +1,382 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Generated from protobuf message <code>google.protobuf.MessageOptions</code>
+ */
+class MessageOptions extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Set true to use the old proto1 MessageSet wire format for extensions.
+     * This is provided for backwards-compatibility with the MessageSet wire
+     * format.  You should not use this for any other reason:  It's less
+     * efficient, has fewer features, and is more complicated.
+     * The message must be defined exactly as follows:
+     *   message Foo {
+     *     option message_set_wire_format = true;
+     *     extensions 4 to max;
+     *   }
+     * Note that the message cannot have any defined fields; MessageSets only
+     * have extensions.
+     * All extensions of your type must be singular messages; e.g. they cannot
+     * be int32s, enums, or repeated messages.
+     * Because this is an option, the above two restrictions are not enforced by
+     * the protocol compiler.
+     *
+     * Generated from protobuf field <code>optional bool message_set_wire_format = 1 [default = false];</code>
+     */
+    protected $message_set_wire_format = false;
+    private $has_message_set_wire_format = false;
+    /**
+     * Disables the generation of the standard "descriptor()" accessor, which can
+     * conflict with a field of the same name.  This is meant to make migration
+     * from proto1 easier; new code should avoid fields named "descriptor".
+     *
+     * Generated from protobuf field <code>optional bool no_standard_descriptor_accessor = 2 [default = false];</code>
+     */
+    protected $no_standard_descriptor_accessor = false;
+    private $has_no_standard_descriptor_accessor = false;
+    /**
+     * Is this message deprecated?
+     * Depending on the target platform, this can emit Deprecated annotations
+     * for the message, or it will be completely ignored; in the very least,
+     * this is a formalization for deprecating messages.
+     *
+     * Generated from protobuf field <code>optional bool deprecated = 3 [default = false];</code>
+     */
+    protected $deprecated = false;
+    private $has_deprecated = false;
+    /**
+     * Whether the message is an automatically generated map entry type for the
+     * maps field.
+     * For maps fields:
+     *     map<KeyType, ValueType> map_field = 1;
+     * The parsed descriptor looks like:
+     *     message MapFieldEntry {
+     *         option map_entry = true;
+     *         optional KeyType key = 1;
+     *         optional ValueType value = 2;
+     *     }
+     *     repeated MapFieldEntry map_field = 1;
+     * Implementations may choose not to generate the map_entry=true message, but
+     * use a native map in the target language to hold the keys and values.
+     * The reflection APIs in such implementations still need to work as
+     * if the field is a repeated message field.
+     * NOTE: Do not set the option in .proto files. Always use the maps syntax
+     * instead. The option should only be implicitly set by the proto compiler
+     * parser.
+     *
+     * Generated from protobuf field <code>optional bool map_entry = 7;</code>
+     */
+    protected $map_entry = false;
+    private $has_map_entry = false;
+    /**
+     * The parser stores options it doesn't recognize here. See above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     */
+    private $uninterpreted_option;
+    private $has_uninterpreted_option = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type bool $message_set_wire_format
+     *           Set true to use the old proto1 MessageSet wire format for extensions.
+     *           This is provided for backwards-compatibility with the MessageSet wire
+     *           format.  You should not use this for any other reason:  It's less
+     *           efficient, has fewer features, and is more complicated.
+     *           The message must be defined exactly as follows:
+     *             message Foo {
+     *               option message_set_wire_format = true;
+     *               extensions 4 to max;
+     *             }
+     *           Note that the message cannot have any defined fields; MessageSets only
+     *           have extensions.
+     *           All extensions of your type must be singular messages; e.g. they cannot
+     *           be int32s, enums, or repeated messages.
+     *           Because this is an option, the above two restrictions are not enforced by
+     *           the protocol compiler.
+     *     @type bool $no_standard_descriptor_accessor
+     *           Disables the generation of the standard "descriptor()" accessor, which can
+     *           conflict with a field of the same name.  This is meant to make migration
+     *           from proto1 easier; new code should avoid fields named "descriptor".
+     *     @type bool $deprecated
+     *           Is this message deprecated?
+     *           Depending on the target platform, this can emit Deprecated annotations
+     *           for the message, or it will be completely ignored; in the very least,
+     *           this is a formalization for deprecating messages.
+     *     @type bool $map_entry
+     *           Whether the message is an automatically generated map entry type for the
+     *           maps field.
+     *           For maps fields:
+     *               map<KeyType, ValueType> map_field = 1;
+     *           The parsed descriptor looks like:
+     *               message MapFieldEntry {
+     *                   option map_entry = true;
+     *                   optional KeyType key = 1;
+     *                   optional ValueType value = 2;
+     *               }
+     *               repeated MapFieldEntry map_field = 1;
+     *           Implementations may choose not to generate the map_entry=true message, but
+     *           use a native map in the target language to hold the keys and values.
+     *           The reflection APIs in such implementations still need to work as
+     *           if the field is a repeated message field.
+     *           NOTE: Do not set the option in .proto files. Always use the maps syntax
+     *           instead. The option should only be implicitly set by the proto compiler
+     *           parser.
+     *     @type \Google\Protobuf\Internal\UninterpretedOption[]|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option
+     *           The parser stores options it doesn't recognize here. See above.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Set true to use the old proto1 MessageSet wire format for extensions.
+     * This is provided for backwards-compatibility with the MessageSet wire
+     * format.  You should not use this for any other reason:  It's less
+     * efficient, has fewer features, and is more complicated.
+     * The message must be defined exactly as follows:
+     *   message Foo {
+     *     option message_set_wire_format = true;
+     *     extensions 4 to max;
+     *   }
+     * Note that the message cannot have any defined fields; MessageSets only
+     * have extensions.
+     * All extensions of your type must be singular messages; e.g. they cannot
+     * be int32s, enums, or repeated messages.
+     * Because this is an option, the above two restrictions are not enforced by
+     * the protocol compiler.
+     *
+     * Generated from protobuf field <code>optional bool message_set_wire_format = 1 [default = false];</code>
+     * @return bool
+     */
+    public function getMessageSetWireFormat()
+    {
+        return $this->message_set_wire_format;
+    }
+
+    /**
+     * Set true to use the old proto1 MessageSet wire format for extensions.
+     * This is provided for backwards-compatibility with the MessageSet wire
+     * format.  You should not use this for any other reason:  It's less
+     * efficient, has fewer features, and is more complicated.
+     * The message must be defined exactly as follows:
+     *   message Foo {
+     *     option message_set_wire_format = true;
+     *     extensions 4 to max;
+     *   }
+     * Note that the message cannot have any defined fields; MessageSets only
+     * have extensions.
+     * All extensions of your type must be singular messages; e.g. they cannot
+     * be int32s, enums, or repeated messages.
+     * Because this is an option, the above two restrictions are not enforced by
+     * the protocol compiler.
+     *
+     * Generated from protobuf field <code>optional bool message_set_wire_format = 1 [default = false];</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setMessageSetWireFormat($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->message_set_wire_format = $var;
+        $this->has_message_set_wire_format = true;
+
+        return $this;
+    }
+
+    public function hasMessageSetWireFormat()
+    {
+        return $this->has_message_set_wire_format;
+    }
+
+    /**
+     * Disables the generation of the standard "descriptor()" accessor, which can
+     * conflict with a field of the same name.  This is meant to make migration
+     * from proto1 easier; new code should avoid fields named "descriptor".
+     *
+     * Generated from protobuf field <code>optional bool no_standard_descriptor_accessor = 2 [default = false];</code>
+     * @return bool
+     */
+    public function getNoStandardDescriptorAccessor()
+    {
+        return $this->no_standard_descriptor_accessor;
+    }
+
+    /**
+     * Disables the generation of the standard "descriptor()" accessor, which can
+     * conflict with a field of the same name.  This is meant to make migration
+     * from proto1 easier; new code should avoid fields named "descriptor".
+     *
+     * Generated from protobuf field <code>optional bool no_standard_descriptor_accessor = 2 [default = false];</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setNoStandardDescriptorAccessor($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->no_standard_descriptor_accessor = $var;
+        $this->has_no_standard_descriptor_accessor = true;
+
+        return $this;
+    }
+
+    public function hasNoStandardDescriptorAccessor()
+    {
+        return $this->has_no_standard_descriptor_accessor;
+    }
+
+    /**
+     * Is this message deprecated?
+     * Depending on the target platform, this can emit Deprecated annotations
+     * for the message, or it will be completely ignored; in the very least,
+     * this is a formalization for deprecating messages.
+     *
+     * Generated from protobuf field <code>optional bool deprecated = 3 [default = false];</code>
+     * @return bool
+     */
+    public function getDeprecated()
+    {
+        return $this->deprecated;
+    }
+
+    /**
+     * Is this message deprecated?
+     * Depending on the target platform, this can emit Deprecated annotations
+     * for the message, or it will be completely ignored; in the very least,
+     * this is a formalization for deprecating messages.
+     *
+     * Generated from protobuf field <code>optional bool deprecated = 3 [default = false];</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setDeprecated($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->deprecated = $var;
+        $this->has_deprecated = true;
+
+        return $this;
+    }
+
+    public function hasDeprecated()
+    {
+        return $this->has_deprecated;
+    }
+
+    /**
+     * Whether the message is an automatically generated map entry type for the
+     * maps field.
+     * For maps fields:
+     *     map<KeyType, ValueType> map_field = 1;
+     * The parsed descriptor looks like:
+     *     message MapFieldEntry {
+     *         option map_entry = true;
+     *         optional KeyType key = 1;
+     *         optional ValueType value = 2;
+     *     }
+     *     repeated MapFieldEntry map_field = 1;
+     * Implementations may choose not to generate the map_entry=true message, but
+     * use a native map in the target language to hold the keys and values.
+     * The reflection APIs in such implementations still need to work as
+     * if the field is a repeated message field.
+     * NOTE: Do not set the option in .proto files. Always use the maps syntax
+     * instead. The option should only be implicitly set by the proto compiler
+     * parser.
+     *
+     * Generated from protobuf field <code>optional bool map_entry = 7;</code>
+     * @return bool
+     */
+    public function getMapEntry()
+    {
+        return $this->map_entry;
+    }
+
+    /**
+     * Whether the message is an automatically generated map entry type for the
+     * maps field.
+     * For maps fields:
+     *     map<KeyType, ValueType> map_field = 1;
+     * The parsed descriptor looks like:
+     *     message MapFieldEntry {
+     *         option map_entry = true;
+     *         optional KeyType key = 1;
+     *         optional ValueType value = 2;
+     *     }
+     *     repeated MapFieldEntry map_field = 1;
+     * Implementations may choose not to generate the map_entry=true message, but
+     * use a native map in the target language to hold the keys and values.
+     * The reflection APIs in such implementations still need to work as
+     * if the field is a repeated message field.
+     * NOTE: Do not set the option in .proto files. Always use the maps syntax
+     * instead. The option should only be implicitly set by the proto compiler
+     * parser.
+     *
+     * Generated from protobuf field <code>optional bool map_entry = 7;</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setMapEntry($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->map_entry = $var;
+        $this->has_map_entry = true;
+
+        return $this;
+    }
+
+    public function hasMapEntry()
+    {
+        return $this->has_map_entry;
+    }
+
+    /**
+     * The parser stores options it doesn't recognize here. See above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getUninterpretedOption()
+    {
+        return $this->uninterpreted_option;
+    }
+
+    /**
+     * The parser stores options it doesn't recognize here. See above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     * @param \Google\Protobuf\Internal\UninterpretedOption[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setUninterpretedOption($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class);
+        $this->uninterpreted_option = $arr;
+        $this->has_uninterpreted_option = true;
+
+        return $this;
+    }
+
+    public function hasUninterpretedOption()
+    {
+        return $this->has_uninterpreted_option;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodDescriptorProto.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodDescriptorProto.php
new file mode 100644
index 0000000..f40f20f
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodDescriptorProto.php
@@ -0,0 +1,264 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Describes a method of a service.
+ *
+ * Generated from protobuf message <code>google.protobuf.MethodDescriptorProto</code>
+ */
+class MethodDescriptorProto extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Generated from protobuf field <code>optional string name = 1;</code>
+     */
+    protected $name = '';
+    private $has_name = false;
+    /**
+     * Input and output type names.  These are resolved in the same way as
+     * FieldDescriptorProto.type_name, but must refer to a message type.
+     *
+     * Generated from protobuf field <code>optional string input_type = 2;</code>
+     */
+    protected $input_type = '';
+    private $has_input_type = false;
+    /**
+     * Generated from protobuf field <code>optional string output_type = 3;</code>
+     */
+    protected $output_type = '';
+    private $has_output_type = false;
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.MethodOptions options = 4;</code>
+     */
+    protected $options = null;
+    private $has_options = false;
+    /**
+     * Identifies if client streams multiple client messages
+     *
+     * Generated from protobuf field <code>optional bool client_streaming = 5 [default = false];</code>
+     */
+    protected $client_streaming = false;
+    private $has_client_streaming = false;
+    /**
+     * Identifies if server streams multiple server messages
+     *
+     * Generated from protobuf field <code>optional bool server_streaming = 6 [default = false];</code>
+     */
+    protected $server_streaming = false;
+    private $has_server_streaming = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type string $name
+     *     @type string $input_type
+     *           Input and output type names.  These are resolved in the same way as
+     *           FieldDescriptorProto.type_name, but must refer to a message type.
+     *     @type string $output_type
+     *     @type \Google\Protobuf\Internal\MethodOptions $options
+     *     @type bool $client_streaming
+     *           Identifies if client streams multiple client messages
+     *     @type bool $server_streaming
+     *           Identifies if server streams multiple server messages
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Generated from protobuf field <code>optional string name = 1;</code>
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional string name = 1;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setName($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->name = $var;
+        $this->has_name = true;
+
+        return $this;
+    }
+
+    public function hasName()
+    {
+        return $this->has_name;
+    }
+
+    /**
+     * Input and output type names.  These are resolved in the same way as
+     * FieldDescriptorProto.type_name, but must refer to a message type.
+     *
+     * Generated from protobuf field <code>optional string input_type = 2;</code>
+     * @return string
+     */
+    public function getInputType()
+    {
+        return $this->input_type;
+    }
+
+    /**
+     * Input and output type names.  These are resolved in the same way as
+     * FieldDescriptorProto.type_name, but must refer to a message type.
+     *
+     * Generated from protobuf field <code>optional string input_type = 2;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setInputType($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->input_type = $var;
+        $this->has_input_type = true;
+
+        return $this;
+    }
+
+    public function hasInputType()
+    {
+        return $this->has_input_type;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional string output_type = 3;</code>
+     * @return string
+     */
+    public function getOutputType()
+    {
+        return $this->output_type;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional string output_type = 3;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setOutputType($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->output_type = $var;
+        $this->has_output_type = true;
+
+        return $this;
+    }
+
+    public function hasOutputType()
+    {
+        return $this->has_output_type;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.MethodOptions options = 4;</code>
+     * @return \Google\Protobuf\Internal\MethodOptions
+     */
+    public function getOptions()
+    {
+        return $this->options;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.MethodOptions options = 4;</code>
+     * @param \Google\Protobuf\Internal\MethodOptions $var
+     * @return $this
+     */
+    public function setOptions($var)
+    {
+        GPBUtil::checkMessage($var, \Google\Protobuf\Internal\MethodOptions::class);
+        $this->options = $var;
+        $this->has_options = true;
+
+        return $this;
+    }
+
+    public function hasOptions()
+    {
+        return $this->has_options;
+    }
+
+    /**
+     * Identifies if client streams multiple client messages
+     *
+     * Generated from protobuf field <code>optional bool client_streaming = 5 [default = false];</code>
+     * @return bool
+     */
+    public function getClientStreaming()
+    {
+        return $this->client_streaming;
+    }
+
+    /**
+     * Identifies if client streams multiple client messages
+     *
+     * Generated from protobuf field <code>optional bool client_streaming = 5 [default = false];</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setClientStreaming($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->client_streaming = $var;
+        $this->has_client_streaming = true;
+
+        return $this;
+    }
+
+    public function hasClientStreaming()
+    {
+        return $this->has_client_streaming;
+    }
+
+    /**
+     * Identifies if server streams multiple server messages
+     *
+     * Generated from protobuf field <code>optional bool server_streaming = 6 [default = false];</code>
+     * @return bool
+     */
+    public function getServerStreaming()
+    {
+        return $this->server_streaming;
+    }
+
+    /**
+     * Identifies if server streams multiple server messages
+     *
+     * Generated from protobuf field <code>optional bool server_streaming = 6 [default = false];</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setServerStreaming($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->server_streaming = $var;
+        $this->has_server_streaming = true;
+
+        return $this;
+    }
+
+    public function hasServerStreaming()
+    {
+        return $this->has_server_streaming;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions.php
new file mode 100644
index 0000000..6a4c92d
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions.php
@@ -0,0 +1,161 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Generated from protobuf message <code>google.protobuf.MethodOptions</code>
+ */
+class MethodOptions extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Is this method deprecated?
+     * Depending on the target platform, this can emit Deprecated annotations
+     * for the method, or it will be completely ignored; in the very least,
+     * this is a formalization for deprecating methods.
+     *
+     * Generated from protobuf field <code>optional bool deprecated = 33 [default = false];</code>
+     */
+    protected $deprecated = false;
+    private $has_deprecated = false;
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];</code>
+     */
+    protected $idempotency_level = 0;
+    private $has_idempotency_level = false;
+    /**
+     * The parser stores options it doesn't recognize here. See above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     */
+    private $uninterpreted_option;
+    private $has_uninterpreted_option = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type bool $deprecated
+     *           Is this method deprecated?
+     *           Depending on the target platform, this can emit Deprecated annotations
+     *           for the method, or it will be completely ignored; in the very least,
+     *           this is a formalization for deprecating methods.
+     *     @type int $idempotency_level
+     *     @type \Google\Protobuf\Internal\UninterpretedOption[]|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option
+     *           The parser stores options it doesn't recognize here. See above.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Is this method deprecated?
+     * Depending on the target platform, this can emit Deprecated annotations
+     * for the method, or it will be completely ignored; in the very least,
+     * this is a formalization for deprecating methods.
+     *
+     * Generated from protobuf field <code>optional bool deprecated = 33 [default = false];</code>
+     * @return bool
+     */
+    public function getDeprecated()
+    {
+        return $this->deprecated;
+    }
+
+    /**
+     * Is this method deprecated?
+     * Depending on the target platform, this can emit Deprecated annotations
+     * for the method, or it will be completely ignored; in the very least,
+     * this is a formalization for deprecating methods.
+     *
+     * Generated from protobuf field <code>optional bool deprecated = 33 [default = false];</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setDeprecated($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->deprecated = $var;
+        $this->has_deprecated = true;
+
+        return $this;
+    }
+
+    public function hasDeprecated()
+    {
+        return $this->has_deprecated;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];</code>
+     * @return int
+     */
+    public function getIdempotencyLevel()
+    {
+        return $this->idempotency_level;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setIdempotencyLevel($var)
+    {
+        GPBUtil::checkEnum($var, \Google\Protobuf\Internal\MethodOptions_IdempotencyLevel::class);
+        $this->idempotency_level = $var;
+        $this->has_idempotency_level = true;
+
+        return $this;
+    }
+
+    public function hasIdempotencyLevel()
+    {
+        return $this->has_idempotency_level;
+    }
+
+    /**
+     * The parser stores options it doesn't recognize here. See above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getUninterpretedOption()
+    {
+        return $this->uninterpreted_option;
+    }
+
+    /**
+     * The parser stores options it doesn't recognize here. See above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     * @param \Google\Protobuf\Internal\UninterpretedOption[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setUninterpretedOption($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class);
+        $this->uninterpreted_option = $arr;
+        $this->has_uninterpreted_option = true;
+
+        return $this;
+    }
+
+    public function hasUninterpretedOption()
+    {
+        return $this->has_uninterpreted_option;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions/IdempotencyLevel.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions/IdempotencyLevel.php
new file mode 100644
index 0000000..ce3c062
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions/IdempotencyLevel.php
@@ -0,0 +1,64 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal\MethodOptions;
+
+use UnexpectedValueException;
+
+/**
+ * Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
+ * or neither? HTTP based RPC implementation may choose GET verb for safe
+ * methods, and PUT verb for idempotent methods instead of the default POST.
+ *
+ * Protobuf type <code>google.protobuf.MethodOptions.IdempotencyLevel</code>
+ */
+class IdempotencyLevel
+{
+    /**
+     * Generated from protobuf enum <code>IDEMPOTENCY_UNKNOWN = 0;</code>
+     */
+    const IDEMPOTENCY_UNKNOWN = 0;
+    /**
+     * implies idempotent
+     *
+     * Generated from protobuf enum <code>NO_SIDE_EFFECTS = 1;</code>
+     */
+    const NO_SIDE_EFFECTS = 1;
+    /**
+     * idempotent, but may have side effects
+     *
+     * Generated from protobuf enum <code>IDEMPOTENT = 2;</code>
+     */
+    const IDEMPOTENT = 2;
+
+    private static $valueToName = [
+        self::IDEMPOTENCY_UNKNOWN => 'IDEMPOTENCY_UNKNOWN',
+        self::NO_SIDE_EFFECTS => 'NO_SIDE_EFFECTS',
+        self::IDEMPOTENT => 'IDEMPOTENT',
+    ];
+
+    public static function name($value)
+    {
+        if (!isset(self::$valueToName[$value])) {
+            throw new UnexpectedValueException(sprintf(
+                    'Enum %s has no name defined for value %s', __CLASS__, $value));
+        }
+        return self::$valueToName[$value];
+    }
+
+
+    public static function value($name)
+    {
+        $const = __CLASS__ . '::' . strtoupper($name);
+        if (!defined($const)) {
+            throw new UnexpectedValueException(sprintf(
+                    'Enum %s has no value defined for name %s', __CLASS__, $name));
+        }
+        return constant($const);
+    }
+}
+
+// Adding a class alias for backwards compatibility with the previous class name.
+class_alias(IdempotencyLevel::class, \Google\Protobuf\Internal\MethodOptions_IdempotencyLevel::class);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions_IdempotencyLevel.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions_IdempotencyLevel.php
new file mode 100644
index 0000000..a291311
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions_IdempotencyLevel.php
@@ -0,0 +1,16 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+if (false) {
+    /**
+     * This class is deprecated. Use Google\Protobuf\Internal\MethodOptions\IdempotencyLevel instead.
+     * @deprecated
+     */
+    class MethodOptions_IdempotencyLevel {}
+}
+class_exists(MethodOptions\IdempotencyLevel::class);
+@trigger_error('Google\Protobuf\Internal\MethodOptions_IdempotencyLevel is deprecated and will be removed in the next major release. Use Google\Protobuf\Internal\MethodOptions\IdempotencyLevel instead', E_USER_DEPRECATED);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofDescriptor.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofDescriptor.php
new file mode 100644
index 0000000..67b107f
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofDescriptor.php
@@ -0,0 +1,78 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf\Internal;
+
+class OneofDescriptor
+{
+    use HasPublicDescriptorTrait;
+
+    private $name;
+    private $fields;
+
+    public function __construct()
+    {
+        $this->public_desc = new \Google\Protobuf\OneofDescriptor($this);
+    }
+
+    public function setName($name)
+    {
+        $this->name = $name;
+    }
+
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    public function addField(FieldDescriptor $field)
+    {
+        $this->fields[] = $field;
+    }
+
+    public function getFields()
+    {
+        return $this->fields;
+    }
+
+    public static function buildFromProto($oneof_proto, $desc, $index)
+    {
+        $oneof = new OneofDescriptor();
+        $oneof->setName($oneof_proto->getName());
+        foreach ($desc->getField() as $field) {
+            if ($field->getOneofIndex() == $index) {
+                $oneof->addField($field);
+            }
+        }
+        return $oneof;
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofDescriptorProto.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofDescriptorProto.php
new file mode 100644
index 0000000..413b8e5
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofDescriptorProto.php
@@ -0,0 +1,103 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Describes a oneof.
+ *
+ * Generated from protobuf message <code>google.protobuf.OneofDescriptorProto</code>
+ */
+class OneofDescriptorProto extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Generated from protobuf field <code>optional string name = 1;</code>
+     */
+    protected $name = '';
+    private $has_name = false;
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.OneofOptions options = 2;</code>
+     */
+    protected $options = null;
+    private $has_options = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type string $name
+     *     @type \Google\Protobuf\Internal\OneofOptions $options
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Generated from protobuf field <code>optional string name = 1;</code>
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional string name = 1;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setName($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->name = $var;
+        $this->has_name = true;
+
+        return $this;
+    }
+
+    public function hasName()
+    {
+        return $this->has_name;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.OneofOptions options = 2;</code>
+     * @return \Google\Protobuf\Internal\OneofOptions
+     */
+    public function getOptions()
+    {
+        return $this->options;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.OneofOptions options = 2;</code>
+     * @param \Google\Protobuf\Internal\OneofOptions $var
+     * @return $this
+     */
+    public function setOptions($var)
+    {
+        GPBUtil::checkMessage($var, \Google\Protobuf\Internal\OneofOptions::class);
+        $this->options = $var;
+        $this->has_options = true;
+
+        return $this;
+    }
+
+    public function hasOptions()
+    {
+        return $this->has_options;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofField.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofField.php
new file mode 100644
index 0000000..2c689e8
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofField.php
@@ -0,0 +1,77 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf\Internal;
+
+class OneofField
+{
+
+    private $desc;
+    private $field_name;
+    private $number = 0;
+    private $value;
+
+    public function __construct($desc)
+    {
+        $this->desc = $desc;
+    }
+
+    public function setValue($value)
+    {
+        $this->value = $value;
+    }
+
+    public function getValue()
+    {
+        return $this->value;
+    }
+
+    public function setFieldName($field_name)
+    {
+        $this->field_name = $field_name;
+    }
+
+    public function getFieldName()
+    {
+        return $this->field_name;
+    }
+
+    public function setNumber($number)
+    {
+        $this->number = $number;
+    }
+
+    public function getNumber()
+    {
+        return $this->number;
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofOptions.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofOptions.php
new file mode 100644
index 0000000..46b516f
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofOptions.php
@@ -0,0 +1,74 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Generated from protobuf message <code>google.protobuf.OneofOptions</code>
+ */
+class OneofOptions extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * The parser stores options it doesn't recognize here. See above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     */
+    private $uninterpreted_option;
+    private $has_uninterpreted_option = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type \Google\Protobuf\Internal\UninterpretedOption[]|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option
+     *           The parser stores options it doesn't recognize here. See above.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * The parser stores options it doesn't recognize here. See above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getUninterpretedOption()
+    {
+        return $this->uninterpreted_option;
+    }
+
+    /**
+     * The parser stores options it doesn't recognize here. See above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     * @param \Google\Protobuf\Internal\UninterpretedOption[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setUninterpretedOption($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class);
+        $this->uninterpreted_option = $arr;
+        $this->has_uninterpreted_option = true;
+
+        return $this;
+    }
+
+    public function hasUninterpretedOption()
+    {
+        return $this->has_uninterpreted_option;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/RawInputStream.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/RawInputStream.php
new file mode 100644
index 0000000..4e7ed5c
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/RawInputStream.php
@@ -0,0 +1,50 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf\Internal;
+
+class RawInputStream
+{
+
+    private $buffer;
+
+    public function __construct($buffer)
+    {
+        $this->buffer = $buffer;
+    }
+
+    public function getData()
+    {
+        return $this->buffer;
+    }
+
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/RepeatedField.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/RepeatedField.php
new file mode 100644
index 0000000..ec7a3a6
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/RepeatedField.php
@@ -0,0 +1,258 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/**
+ * RepeatedField and RepeatedFieldIter are used by generated protocol message
+ * classes to manipulate repeated fields.
+ */
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * RepeatedField is used by generated protocol message classes to manipulate
+ * repeated fields. It can be used like native PHP array.
+ */
+class RepeatedField implements \ArrayAccess, \IteratorAggregate, \Countable
+{
+
+    /**
+     * @ignore
+     */
+    private $container;
+    /**
+     * @ignore
+     */
+    private $type;
+    /**
+     * @ignore
+     */
+    private $klass;
+    /**
+     * @ignore
+     */
+    private $legacy_klass;
+
+    /**
+     * Constructs an instance of RepeatedField.
+     *
+     * @param long $type Type of the stored element.
+     * @param string $klass Message/Enum class name (message/enum fields only).
+     * @ignore
+     */
+    public function __construct($type, $klass = null)
+    {
+        $this->container = [];
+        $this->type = $type;
+        if ($this->type == GPBType::MESSAGE) {
+            $pool = DescriptorPool::getGeneratedPool();
+            $desc = $pool->getDescriptorByClassName($klass);
+            if ($desc == NULL) {
+                new $klass;  // No msg class instance has been created before.
+                $desc = $pool->getDescriptorByClassName($klass);
+            }
+            $this->klass = $desc->getClass();
+            $this->legacy_klass = $desc->getLegacyClass();
+        }
+    }
+
+    /**
+     * @ignore
+     */
+    public function getType()
+    {
+        return $this->type;
+    }
+
+    /**
+     * @ignore
+     */
+    public function getClass()
+    {
+        return $this->klass;
+    }
+
+    /**
+     * @ignore
+     */
+    public function getLegacyClass()
+    {
+        return $this->legacy_klass;
+    }
+
+    /**
+     * Return the element at the given index.
+     *
+     * This will also be called for: $ele = $arr[0]
+     *
+     * @param long $offset The index of the element to be fetched.
+     * @return object The stored element at given index.
+     * @throws \ErrorException Invalid type for index.
+     * @throws \ErrorException Non-existing index.
+     */
+    public function offsetGet($offset)
+    {
+        return $this->container[$offset];
+    }
+
+    /**
+     * Assign the element at the given index.
+     *
+     * This will also be called for: $arr []= $ele and $arr[0] = ele
+     *
+     * @param long $offset The index of the element to be assigned.
+     * @param object $value The element to be assigned.
+     * @return void
+     * @throws \ErrorException Invalid type for index.
+     * @throws \ErrorException Non-existing index.
+     * @throws \ErrorException Incorrect type of the element.
+     */
+    public function offsetSet($offset, $value)
+    {
+        switch ($this->type) {
+            case GPBType::SFIXED32:
+            case GPBType::SINT32:
+            case GPBType::INT32:
+            case GPBType::ENUM:
+                GPBUtil::checkInt32($value);
+                break;
+            case GPBType::FIXED32:
+            case GPBType::UINT32:
+                GPBUtil::checkUint32($value);
+                break;
+            case GPBType::SFIXED64:
+            case GPBType::SINT64:
+            case GPBType::INT64:
+                GPBUtil::checkInt64($value);
+                break;
+            case GPBType::FIXED64:
+            case GPBType::UINT64:
+                GPBUtil::checkUint64($value);
+                break;
+            case GPBType::FLOAT:
+                GPBUtil::checkFloat($value);
+                break;
+            case GPBType::DOUBLE:
+                GPBUtil::checkDouble($value);
+                break;
+            case GPBType::BOOL:
+                GPBUtil::checkBool($value);
+                break;
+            case GPBType::BYTES:
+                GPBUtil::checkString($value, false);
+                break;
+            case GPBType::STRING:
+                GPBUtil::checkString($value, true);
+                break;
+            case GPBType::MESSAGE:
+                if (is_null($value)) {
+                  trigger_error("RepeatedField element cannot be null.",
+                                E_USER_ERROR);
+                }
+                GPBUtil::checkMessage($value, $this->klass);
+                break;
+            default:
+                break;
+        }
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $count = count($this->container);
+            if (!is_numeric($offset) || $offset < 0 || $offset >= $count) {
+                trigger_error(
+                    "Cannot modify element at the given index",
+                    E_USER_ERROR);
+                return;
+            }
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Remove the element at the given index.
+     *
+     * This will also be called for: unset($arr)
+     *
+     * @param long $offset The index of the element to be removed.
+     * @return void
+     * @throws \ErrorException Invalid type for index.
+     * @throws \ErrorException The element to be removed is not at the end of the
+     * RepeatedField.
+     */
+    public function offsetUnset($offset)
+    {
+        $count = count($this->container);
+        if (!is_numeric($offset) || $count === 0 || $offset !== $count - 1) {
+            trigger_error(
+                "Cannot remove element at the given index",
+                E_USER_ERROR);
+            return;
+        }
+        array_pop($this->container);
+    }
+
+    /**
+     * Check the existence of the element at the given index.
+     *
+     * This will also be called for: isset($arr)
+     *
+     * @param long $offset The index of the element to be removed.
+     * @return bool True if the element at the given offset exists.
+     * @throws \ErrorException Invalid type for index.
+     */
+    public function offsetExists($offset)
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * @ignore
+     */
+    public function getIterator()
+    {
+        return new RepeatedFieldIter($this->container);
+    }
+
+    /**
+     * Return the number of stored elements.
+     *
+     * This will also be called for: count($arr)
+     *
+     * @return integer The number of stored elements.
+     */
+    public function count()
+    {
+        return count($this->container);
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/RepeatedFieldIter.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/RepeatedFieldIter.php
new file mode 100644
index 0000000..2b6f823
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/RepeatedFieldIter.php
@@ -0,0 +1,118 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/**
+ * RepeatedField and RepeatedFieldIter are used by generated protocol message
+ * classes to manipulate repeated fields.
+ */
+
+namespace Google\Protobuf\Internal;
+
+/**
+ * RepeatedFieldIter is used to iterate RepeatedField. It is also need for the
+ * foreach syntax.
+ */
+class RepeatedFieldIter implements \Iterator
+{
+
+    /**
+     * @ignore
+     */
+    private $position;
+    /**
+     * @ignore
+     */
+    private $container;
+
+    /**
+     * Create iterator instance for RepeatedField.
+     *
+     * @param RepeatedField The RepeatedField instance for which this iterator
+     * is created.
+     * @ignore
+     */
+    public function __construct($container)
+    {
+        $this->position = 0;
+        $this->container = $container;
+    }
+
+    /**
+     * Reset the status of the iterator
+     *
+     * @return void
+     */
+    public function rewind()
+    {
+        $this->position = 0;
+    }
+
+    /**
+     * Return the element at the current position.
+     *
+     * @return object The element at the current position.
+     */
+    public function current()
+    {
+        return $this->container[$this->position];
+    }
+
+    /**
+     * Return the current position.
+     *
+     * @return integer The current position.
+     */
+    public function key()
+    {
+        return $this->position;
+    }
+
+    /**
+     * Move to the next position.
+     *
+     * @return void
+     */
+    public function next()
+    {
+        ++$this->position;
+    }
+
+    /**
+     * Check whether there are more elements to iterate.
+     *
+     * @return bool True if there are more elements to iterate.
+     */
+    public function valid()
+    {
+        return isset($this->container[$this->position]);
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceDescriptorProto.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceDescriptorProto.php
new file mode 100644
index 0000000..aaeefbc
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceDescriptorProto.php
@@ -0,0 +1,137 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Describes a service.
+ *
+ * Generated from protobuf message <code>google.protobuf.ServiceDescriptorProto</code>
+ */
+class ServiceDescriptorProto extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Generated from protobuf field <code>optional string name = 1;</code>
+     */
+    protected $name = '';
+    private $has_name = false;
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.MethodDescriptorProto method = 2;</code>
+     */
+    private $method;
+    private $has_method = false;
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.ServiceOptions options = 3;</code>
+     */
+    protected $options = null;
+    private $has_options = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type string $name
+     *     @type \Google\Protobuf\Internal\MethodDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $method
+     *     @type \Google\Protobuf\Internal\ServiceOptions $options
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Generated from protobuf field <code>optional string name = 1;</code>
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional string name = 1;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setName($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->name = $var;
+        $this->has_name = true;
+
+        return $this;
+    }
+
+    public function hasName()
+    {
+        return $this->has_name;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.MethodDescriptorProto method = 2;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getMethod()
+    {
+        return $this->method;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.MethodDescriptorProto method = 2;</code>
+     * @param \Google\Protobuf\Internal\MethodDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setMethod($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\MethodDescriptorProto::class);
+        $this->method = $arr;
+        $this->has_method = true;
+
+        return $this;
+    }
+
+    public function hasMethod()
+    {
+        return $this->has_method;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.ServiceOptions options = 3;</code>
+     * @return \Google\Protobuf\Internal\ServiceOptions
+     */
+    public function getOptions()
+    {
+        return $this->options;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional .google.protobuf.ServiceOptions options = 3;</code>
+     * @param \Google\Protobuf\Internal\ServiceOptions $var
+     * @return $this
+     */
+    public function setOptions($var)
+    {
+        GPBUtil::checkMessage($var, \Google\Protobuf\Internal\ServiceOptions::class);
+        $this->options = $var;
+        $this->has_options = true;
+
+        return $this;
+    }
+
+    public function hasOptions()
+    {
+        return $this->has_options;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceOptions.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceOptions.php
new file mode 100644
index 0000000..0581efb
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceOptions.php
@@ -0,0 +1,127 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Generated from protobuf message <code>google.protobuf.ServiceOptions</code>
+ */
+class ServiceOptions extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Is this service deprecated?
+     * Depending on the target platform, this can emit Deprecated annotations
+     * for the service, or it will be completely ignored; in the very least,
+     * this is a formalization for deprecating services.
+     *
+     * Generated from protobuf field <code>optional bool deprecated = 33 [default = false];</code>
+     */
+    protected $deprecated = false;
+    private $has_deprecated = false;
+    /**
+     * The parser stores options it doesn't recognize here. See above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     */
+    private $uninterpreted_option;
+    private $has_uninterpreted_option = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type bool $deprecated
+     *           Is this service deprecated?
+     *           Depending on the target platform, this can emit Deprecated annotations
+     *           for the service, or it will be completely ignored; in the very least,
+     *           this is a formalization for deprecating services.
+     *     @type \Google\Protobuf\Internal\UninterpretedOption[]|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option
+     *           The parser stores options it doesn't recognize here. See above.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Is this service deprecated?
+     * Depending on the target platform, this can emit Deprecated annotations
+     * for the service, or it will be completely ignored; in the very least,
+     * this is a formalization for deprecating services.
+     *
+     * Generated from protobuf field <code>optional bool deprecated = 33 [default = false];</code>
+     * @return bool
+     */
+    public function getDeprecated()
+    {
+        return $this->deprecated;
+    }
+
+    /**
+     * Is this service deprecated?
+     * Depending on the target platform, this can emit Deprecated annotations
+     * for the service, or it will be completely ignored; in the very least,
+     * this is a formalization for deprecating services.
+     *
+     * Generated from protobuf field <code>optional bool deprecated = 33 [default = false];</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setDeprecated($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->deprecated = $var;
+        $this->has_deprecated = true;
+
+        return $this;
+    }
+
+    public function hasDeprecated()
+    {
+        return $this->has_deprecated;
+    }
+
+    /**
+     * The parser stores options it doesn't recognize here. See above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getUninterpretedOption()
+    {
+        return $this->uninterpreted_option;
+    }
+
+    /**
+     * The parser stores options it doesn't recognize here. See above.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
+     * @param \Google\Protobuf\Internal\UninterpretedOption[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setUninterpretedOption($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class);
+        $this->uninterpreted_option = $arr;
+        $this->has_uninterpreted_option = true;
+
+        return $this;
+    }
+
+    public function hasUninterpretedOption()
+    {
+        return $this->has_uninterpreted_option;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo.php
new file mode 100644
index 0000000..dfeb69f
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo.php
@@ -0,0 +1,237 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Encapsulates information about the original source file from which a
+ * FileDescriptorProto was generated.
+ *
+ * Generated from protobuf message <code>google.protobuf.SourceCodeInfo</code>
+ */
+class SourceCodeInfo extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * A Location identifies a piece of source code in a .proto file which
+     * corresponds to a particular definition.  This information is intended
+     * to be useful to IDEs, code indexers, documentation generators, and similar
+     * tools.
+     * For example, say we have a file like:
+     *   message Foo {
+     *     optional string foo = 1;
+     *   }
+     * Let's look at just the field definition:
+     *   optional string foo = 1;
+     *   ^       ^^     ^^  ^  ^^^
+     *   a       bc     de  f  ghi
+     * We have the following locations:
+     *   span   path               represents
+     *   [a,i)  [ 4, 0, 2, 0 ]     The whole field definition.
+     *   [a,b)  [ 4, 0, 2, 0, 4 ]  The label (optional).
+     *   [c,d)  [ 4, 0, 2, 0, 5 ]  The type (string).
+     *   [e,f)  [ 4, 0, 2, 0, 1 ]  The name (foo).
+     *   [g,h)  [ 4, 0, 2, 0, 3 ]  The number (1).
+     * Notes:
+     * - A location may refer to a repeated field itself (i.e. not to any
+     *   particular index within it).  This is used whenever a set of elements are
+     *   logically enclosed in a single code segment.  For example, an entire
+     *   extend block (possibly containing multiple extension definitions) will
+     *   have an outer location whose path refers to the "extensions" repeated
+     *   field without an index.
+     * - Multiple locations may have the same path.  This happens when a single
+     *   logical declaration is spread out across multiple places.  The most
+     *   obvious example is the "extend" block again -- there may be multiple
+     *   extend blocks in the same scope, each of which will have the same path.
+     * - A location's span is not always a subset of its parent's span.  For
+     *   example, the "extendee" of an extension declaration appears at the
+     *   beginning of the "extend" block and is shared by all extensions within
+     *   the block.
+     * - Just because a location's span is a subset of some other location's span
+     *   does not mean that it is a descendant.  For example, a "group" defines
+     *   both a type and a field in a single declaration.  Thus, the locations
+     *   corresponding to the type and field and their components will overlap.
+     * - Code which tries to interpret locations should probably be designed to
+     *   ignore those that it doesn't understand, as more types of locations could
+     *   be recorded in the future.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.SourceCodeInfo.Location location = 1;</code>
+     */
+    private $location;
+    private $has_location = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type \Google\Protobuf\Internal\SourceCodeInfo\Location[]|\Google\Protobuf\Internal\RepeatedField $location
+     *           A Location identifies a piece of source code in a .proto file which
+     *           corresponds to a particular definition.  This information is intended
+     *           to be useful to IDEs, code indexers, documentation generators, and similar
+     *           tools.
+     *           For example, say we have a file like:
+     *             message Foo {
+     *               optional string foo = 1;
+     *             }
+     *           Let's look at just the field definition:
+     *             optional string foo = 1;
+     *             ^       ^^     ^^  ^  ^^^
+     *             a       bc     de  f  ghi
+     *           We have the following locations:
+     *             span   path               represents
+     *             [a,i)  [ 4, 0, 2, 0 ]     The whole field definition.
+     *             [a,b)  [ 4, 0, 2, 0, 4 ]  The label (optional).
+     *             [c,d)  [ 4, 0, 2, 0, 5 ]  The type (string).
+     *             [e,f)  [ 4, 0, 2, 0, 1 ]  The name (foo).
+     *             [g,h)  [ 4, 0, 2, 0, 3 ]  The number (1).
+     *           Notes:
+     *           - A location may refer to a repeated field itself (i.e. not to any
+     *             particular index within it).  This is used whenever a set of elements are
+     *             logically enclosed in a single code segment.  For example, an entire
+     *             extend block (possibly containing multiple extension definitions) will
+     *             have an outer location whose path refers to the "extensions" repeated
+     *             field without an index.
+     *           - Multiple locations may have the same path.  This happens when a single
+     *             logical declaration is spread out across multiple places.  The most
+     *             obvious example is the "extend" block again -- there may be multiple
+     *             extend blocks in the same scope, each of which will have the same path.
+     *           - A location's span is not always a subset of its parent's span.  For
+     *             example, the "extendee" of an extension declaration appears at the
+     *             beginning of the "extend" block and is shared by all extensions within
+     *             the block.
+     *           - Just because a location's span is a subset of some other location's span
+     *             does not mean that it is a descendant.  For example, a "group" defines
+     *             both a type and a field in a single declaration.  Thus, the locations
+     *             corresponding to the type and field and their components will overlap.
+     *           - Code which tries to interpret locations should probably be designed to
+     *             ignore those that it doesn't understand, as more types of locations could
+     *             be recorded in the future.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * A Location identifies a piece of source code in a .proto file which
+     * corresponds to a particular definition.  This information is intended
+     * to be useful to IDEs, code indexers, documentation generators, and similar
+     * tools.
+     * For example, say we have a file like:
+     *   message Foo {
+     *     optional string foo = 1;
+     *   }
+     * Let's look at just the field definition:
+     *   optional string foo = 1;
+     *   ^       ^^     ^^  ^  ^^^
+     *   a       bc     de  f  ghi
+     * We have the following locations:
+     *   span   path               represents
+     *   [a,i)  [ 4, 0, 2, 0 ]     The whole field definition.
+     *   [a,b)  [ 4, 0, 2, 0, 4 ]  The label (optional).
+     *   [c,d)  [ 4, 0, 2, 0, 5 ]  The type (string).
+     *   [e,f)  [ 4, 0, 2, 0, 1 ]  The name (foo).
+     *   [g,h)  [ 4, 0, 2, 0, 3 ]  The number (1).
+     * Notes:
+     * - A location may refer to a repeated field itself (i.e. not to any
+     *   particular index within it).  This is used whenever a set of elements are
+     *   logically enclosed in a single code segment.  For example, an entire
+     *   extend block (possibly containing multiple extension definitions) will
+     *   have an outer location whose path refers to the "extensions" repeated
+     *   field without an index.
+     * - Multiple locations may have the same path.  This happens when a single
+     *   logical declaration is spread out across multiple places.  The most
+     *   obvious example is the "extend" block again -- there may be multiple
+     *   extend blocks in the same scope, each of which will have the same path.
+     * - A location's span is not always a subset of its parent's span.  For
+     *   example, the "extendee" of an extension declaration appears at the
+     *   beginning of the "extend" block and is shared by all extensions within
+     *   the block.
+     * - Just because a location's span is a subset of some other location's span
+     *   does not mean that it is a descendant.  For example, a "group" defines
+     *   both a type and a field in a single declaration.  Thus, the locations
+     *   corresponding to the type and field and their components will overlap.
+     * - Code which tries to interpret locations should probably be designed to
+     *   ignore those that it doesn't understand, as more types of locations could
+     *   be recorded in the future.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.SourceCodeInfo.Location location = 1;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getLocation()
+    {
+        return $this->location;
+    }
+
+    /**
+     * A Location identifies a piece of source code in a .proto file which
+     * corresponds to a particular definition.  This information is intended
+     * to be useful to IDEs, code indexers, documentation generators, and similar
+     * tools.
+     * For example, say we have a file like:
+     *   message Foo {
+     *     optional string foo = 1;
+     *   }
+     * Let's look at just the field definition:
+     *   optional string foo = 1;
+     *   ^       ^^     ^^  ^  ^^^
+     *   a       bc     de  f  ghi
+     * We have the following locations:
+     *   span   path               represents
+     *   [a,i)  [ 4, 0, 2, 0 ]     The whole field definition.
+     *   [a,b)  [ 4, 0, 2, 0, 4 ]  The label (optional).
+     *   [c,d)  [ 4, 0, 2, 0, 5 ]  The type (string).
+     *   [e,f)  [ 4, 0, 2, 0, 1 ]  The name (foo).
+     *   [g,h)  [ 4, 0, 2, 0, 3 ]  The number (1).
+     * Notes:
+     * - A location may refer to a repeated field itself (i.e. not to any
+     *   particular index within it).  This is used whenever a set of elements are
+     *   logically enclosed in a single code segment.  For example, an entire
+     *   extend block (possibly containing multiple extension definitions) will
+     *   have an outer location whose path refers to the "extensions" repeated
+     *   field without an index.
+     * - Multiple locations may have the same path.  This happens when a single
+     *   logical declaration is spread out across multiple places.  The most
+     *   obvious example is the "extend" block again -- there may be multiple
+     *   extend blocks in the same scope, each of which will have the same path.
+     * - A location's span is not always a subset of its parent's span.  For
+     *   example, the "extendee" of an extension declaration appears at the
+     *   beginning of the "extend" block and is shared by all extensions within
+     *   the block.
+     * - Just because a location's span is a subset of some other location's span
+     *   does not mean that it is a descendant.  For example, a "group" defines
+     *   both a type and a field in a single declaration.  Thus, the locations
+     *   corresponding to the type and field and their components will overlap.
+     * - Code which tries to interpret locations should probably be designed to
+     *   ignore those that it doesn't understand, as more types of locations could
+     *   be recorded in the future.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.SourceCodeInfo.Location location = 1;</code>
+     * @param \Google\Protobuf\Internal\SourceCodeInfo\Location[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setLocation($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\SourceCodeInfo\Location::class);
+        $this->location = $arr;
+        $this->has_location = true;
+
+        return $this;
+    }
+
+    public function hasLocation()
+    {
+        return $this->has_location;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php
new file mode 100644
index 0000000..0aeea61
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php
@@ -0,0 +1,463 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal\SourceCodeInfo;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Generated from protobuf message <code>google.protobuf.SourceCodeInfo.Location</code>
+ */
+class Location extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Identifies which part of the FileDescriptorProto was defined at this
+     * location.
+     * Each element is a field number or an index.  They form a path from
+     * the root FileDescriptorProto to the place where the definition.  For
+     * example, this path:
+     *   [ 4, 3, 2, 7, 1 ]
+     * refers to:
+     *   file.message_type(3)  // 4, 3
+     *       .field(7)         // 2, 7
+     *       .name()           // 1
+     * This is because FileDescriptorProto.message_type has field number 4:
+     *   repeated DescriptorProto message_type = 4;
+     * and DescriptorProto.field has field number 2:
+     *   repeated FieldDescriptorProto field = 2;
+     * and FieldDescriptorProto.name has field number 1:
+     *   optional string name = 1;
+     * Thus, the above path gives the location of a field name.  If we removed
+     * the last element:
+     *   [ 4, 3, 2, 7 ]
+     * this path refers to the whole field declaration (from the beginning
+     * of the label to the terminating semicolon).
+     *
+     * Generated from protobuf field <code>repeated int32 path = 1 [packed = true];</code>
+     */
+    private $path;
+    private $has_path = false;
+    /**
+     * Always has exactly three or four elements: start line, start column,
+     * end line (optional, otherwise assumed same as start line), end column.
+     * These are packed into a single field for efficiency.  Note that line
+     * and column numbers are zero-based -- typically you will want to add
+     * 1 to each before displaying to a user.
+     *
+     * Generated from protobuf field <code>repeated int32 span = 2 [packed = true];</code>
+     */
+    private $span;
+    private $has_span = false;
+    /**
+     * If this SourceCodeInfo represents a complete declaration, these are any
+     * comments appearing before and after the declaration which appear to be
+     * attached to the declaration.
+     * A series of line comments appearing on consecutive lines, with no other
+     * tokens appearing on those lines, will be treated as a single comment.
+     * leading_detached_comments will keep paragraphs of comments that appear
+     * before (but not connected to) the current element. Each paragraph,
+     * separated by empty lines, will be one comment element in the repeated
+     * field.
+     * Only the comment content is provided; comment markers (e.g. //) are
+     * stripped out.  For block comments, leading whitespace and an asterisk
+     * will be stripped from the beginning of each line other than the first.
+     * Newlines are included in the output.
+     * Examples:
+     *   optional int32 foo = 1;  // Comment attached to foo.
+     *   // Comment attached to bar.
+     *   optional int32 bar = 2;
+     *   optional string baz = 3;
+     *   // Comment attached to baz.
+     *   // Another line attached to baz.
+     *   // Comment attached to qux.
+     *   //
+     *   // Another line attached to qux.
+     *   optional double qux = 4;
+     *   // Detached comment for corge. This is not leading or trailing comments
+     *   // to qux or corge because there are blank lines separating it from
+     *   // both.
+     *   // Detached comment for corge paragraph 2.
+     *   optional string corge = 5;
+     *   /&#42; Block comment attached
+     *    * to corge.  Leading asterisks
+     *    * will be removed. *&#47;
+     *   /&#42; Block comment attached to
+     *    * grault. *&#47;
+     *   optional int32 grault = 6;
+     *   // ignored detached comments.
+     *
+     * Generated from protobuf field <code>optional string leading_comments = 3;</code>
+     */
+    protected $leading_comments = '';
+    private $has_leading_comments = false;
+    /**
+     * Generated from protobuf field <code>optional string trailing_comments = 4;</code>
+     */
+    protected $trailing_comments = '';
+    private $has_trailing_comments = false;
+    /**
+     * Generated from protobuf field <code>repeated string leading_detached_comments = 6;</code>
+     */
+    private $leading_detached_comments;
+    private $has_leading_detached_comments = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type int[]|\Google\Protobuf\Internal\RepeatedField $path
+     *           Identifies which part of the FileDescriptorProto was defined at this
+     *           location.
+     *           Each element is a field number or an index.  They form a path from
+     *           the root FileDescriptorProto to the place where the definition.  For
+     *           example, this path:
+     *             [ 4, 3, 2, 7, 1 ]
+     *           refers to:
+     *             file.message_type(3)  // 4, 3
+     *                 .field(7)         // 2, 7
+     *                 .name()           // 1
+     *           This is because FileDescriptorProto.message_type has field number 4:
+     *             repeated DescriptorProto message_type = 4;
+     *           and DescriptorProto.field has field number 2:
+     *             repeated FieldDescriptorProto field = 2;
+     *           and FieldDescriptorProto.name has field number 1:
+     *             optional string name = 1;
+     *           Thus, the above path gives the location of a field name.  If we removed
+     *           the last element:
+     *             [ 4, 3, 2, 7 ]
+     *           this path refers to the whole field declaration (from the beginning
+     *           of the label to the terminating semicolon).
+     *     @type int[]|\Google\Protobuf\Internal\RepeatedField $span
+     *           Always has exactly three or four elements: start line, start column,
+     *           end line (optional, otherwise assumed same as start line), end column.
+     *           These are packed into a single field for efficiency.  Note that line
+     *           and column numbers are zero-based -- typically you will want to add
+     *           1 to each before displaying to a user.
+     *     @type string $leading_comments
+     *           If this SourceCodeInfo represents a complete declaration, these are any
+     *           comments appearing before and after the declaration which appear to be
+     *           attached to the declaration.
+     *           A series of line comments appearing on consecutive lines, with no other
+     *           tokens appearing on those lines, will be treated as a single comment.
+     *           leading_detached_comments will keep paragraphs of comments that appear
+     *           before (but not connected to) the current element. Each paragraph,
+     *           separated by empty lines, will be one comment element in the repeated
+     *           field.
+     *           Only the comment content is provided; comment markers (e.g. //) are
+     *           stripped out.  For block comments, leading whitespace and an asterisk
+     *           will be stripped from the beginning of each line other than the first.
+     *           Newlines are included in the output.
+     *           Examples:
+     *             optional int32 foo = 1;  // Comment attached to foo.
+     *             // Comment attached to bar.
+     *             optional int32 bar = 2;
+     *             optional string baz = 3;
+     *             // Comment attached to baz.
+     *             // Another line attached to baz.
+     *             // Comment attached to qux.
+     *             //
+     *             // Another line attached to qux.
+     *             optional double qux = 4;
+     *             // Detached comment for corge. This is not leading or trailing comments
+     *             // to qux or corge because there are blank lines separating it from
+     *             // both.
+     *             // Detached comment for corge paragraph 2.
+     *             optional string corge = 5;
+     *             /&#42; Block comment attached
+     *              * to corge.  Leading asterisks
+     *              * will be removed. *&#47;
+     *             /&#42; Block comment attached to
+     *              * grault. *&#47;
+     *             optional int32 grault = 6;
+     *             // ignored detached comments.
+     *     @type string $trailing_comments
+     *     @type string[]|\Google\Protobuf\Internal\RepeatedField $leading_detached_comments
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Identifies which part of the FileDescriptorProto was defined at this
+     * location.
+     * Each element is a field number or an index.  They form a path from
+     * the root FileDescriptorProto to the place where the definition.  For
+     * example, this path:
+     *   [ 4, 3, 2, 7, 1 ]
+     * refers to:
+     *   file.message_type(3)  // 4, 3
+     *       .field(7)         // 2, 7
+     *       .name()           // 1
+     * This is because FileDescriptorProto.message_type has field number 4:
+     *   repeated DescriptorProto message_type = 4;
+     * and DescriptorProto.field has field number 2:
+     *   repeated FieldDescriptorProto field = 2;
+     * and FieldDescriptorProto.name has field number 1:
+     *   optional string name = 1;
+     * Thus, the above path gives the location of a field name.  If we removed
+     * the last element:
+     *   [ 4, 3, 2, 7 ]
+     * this path refers to the whole field declaration (from the beginning
+     * of the label to the terminating semicolon).
+     *
+     * Generated from protobuf field <code>repeated int32 path = 1 [packed = true];</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getPath()
+    {
+        return $this->path;
+    }
+
+    /**
+     * Identifies which part of the FileDescriptorProto was defined at this
+     * location.
+     * Each element is a field number or an index.  They form a path from
+     * the root FileDescriptorProto to the place where the definition.  For
+     * example, this path:
+     *   [ 4, 3, 2, 7, 1 ]
+     * refers to:
+     *   file.message_type(3)  // 4, 3
+     *       .field(7)         // 2, 7
+     *       .name()           // 1
+     * This is because FileDescriptorProto.message_type has field number 4:
+     *   repeated DescriptorProto message_type = 4;
+     * and DescriptorProto.field has field number 2:
+     *   repeated FieldDescriptorProto field = 2;
+     * and FieldDescriptorProto.name has field number 1:
+     *   optional string name = 1;
+     * Thus, the above path gives the location of a field name.  If we removed
+     * the last element:
+     *   [ 4, 3, 2, 7 ]
+     * this path refers to the whole field declaration (from the beginning
+     * of the label to the terminating semicolon).
+     *
+     * Generated from protobuf field <code>repeated int32 path = 1 [packed = true];</code>
+     * @param int[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setPath($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
+        $this->path = $arr;
+        $this->has_path = true;
+
+        return $this;
+    }
+
+    public function hasPath()
+    {
+        return $this->has_path;
+    }
+
+    /**
+     * Always has exactly three or four elements: start line, start column,
+     * end line (optional, otherwise assumed same as start line), end column.
+     * These are packed into a single field for efficiency.  Note that line
+     * and column numbers are zero-based -- typically you will want to add
+     * 1 to each before displaying to a user.
+     *
+     * Generated from protobuf field <code>repeated int32 span = 2 [packed = true];</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getSpan()
+    {
+        return $this->span;
+    }
+
+    /**
+     * Always has exactly three or four elements: start line, start column,
+     * end line (optional, otherwise assumed same as start line), end column.
+     * These are packed into a single field for efficiency.  Note that line
+     * and column numbers are zero-based -- typically you will want to add
+     * 1 to each before displaying to a user.
+     *
+     * Generated from protobuf field <code>repeated int32 span = 2 [packed = true];</code>
+     * @param int[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setSpan($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
+        $this->span = $arr;
+        $this->has_span = true;
+
+        return $this;
+    }
+
+    public function hasSpan()
+    {
+        return $this->has_span;
+    }
+
+    /**
+     * If this SourceCodeInfo represents a complete declaration, these are any
+     * comments appearing before and after the declaration which appear to be
+     * attached to the declaration.
+     * A series of line comments appearing on consecutive lines, with no other
+     * tokens appearing on those lines, will be treated as a single comment.
+     * leading_detached_comments will keep paragraphs of comments that appear
+     * before (but not connected to) the current element. Each paragraph,
+     * separated by empty lines, will be one comment element in the repeated
+     * field.
+     * Only the comment content is provided; comment markers (e.g. //) are
+     * stripped out.  For block comments, leading whitespace and an asterisk
+     * will be stripped from the beginning of each line other than the first.
+     * Newlines are included in the output.
+     * Examples:
+     *   optional int32 foo = 1;  // Comment attached to foo.
+     *   // Comment attached to bar.
+     *   optional int32 bar = 2;
+     *   optional string baz = 3;
+     *   // Comment attached to baz.
+     *   // Another line attached to baz.
+     *   // Comment attached to qux.
+     *   //
+     *   // Another line attached to qux.
+     *   optional double qux = 4;
+     *   // Detached comment for corge. This is not leading or trailing comments
+     *   // to qux or corge because there are blank lines separating it from
+     *   // both.
+     *   // Detached comment for corge paragraph 2.
+     *   optional string corge = 5;
+     *   /&#42; Block comment attached
+     *    * to corge.  Leading asterisks
+     *    * will be removed. *&#47;
+     *   /&#42; Block comment attached to
+     *    * grault. *&#47;
+     *   optional int32 grault = 6;
+     *   // ignored detached comments.
+     *
+     * Generated from protobuf field <code>optional string leading_comments = 3;</code>
+     * @return string
+     */
+    public function getLeadingComments()
+    {
+        return $this->leading_comments;
+    }
+
+    /**
+     * If this SourceCodeInfo represents a complete declaration, these are any
+     * comments appearing before and after the declaration which appear to be
+     * attached to the declaration.
+     * A series of line comments appearing on consecutive lines, with no other
+     * tokens appearing on those lines, will be treated as a single comment.
+     * leading_detached_comments will keep paragraphs of comments that appear
+     * before (but not connected to) the current element. Each paragraph,
+     * separated by empty lines, will be one comment element in the repeated
+     * field.
+     * Only the comment content is provided; comment markers (e.g. //) are
+     * stripped out.  For block comments, leading whitespace and an asterisk
+     * will be stripped from the beginning of each line other than the first.
+     * Newlines are included in the output.
+     * Examples:
+     *   optional int32 foo = 1;  // Comment attached to foo.
+     *   // Comment attached to bar.
+     *   optional int32 bar = 2;
+     *   optional string baz = 3;
+     *   // Comment attached to baz.
+     *   // Another line attached to baz.
+     *   // Comment attached to qux.
+     *   //
+     *   // Another line attached to qux.
+     *   optional double qux = 4;
+     *   // Detached comment for corge. This is not leading or trailing comments
+     *   // to qux or corge because there are blank lines separating it from
+     *   // both.
+     *   // Detached comment for corge paragraph 2.
+     *   optional string corge = 5;
+     *   /&#42; Block comment attached
+     *    * to corge.  Leading asterisks
+     *    * will be removed. *&#47;
+     *   /&#42; Block comment attached to
+     *    * grault. *&#47;
+     *   optional int32 grault = 6;
+     *   // ignored detached comments.
+     *
+     * Generated from protobuf field <code>optional string leading_comments = 3;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setLeadingComments($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->leading_comments = $var;
+        $this->has_leading_comments = true;
+
+        return $this;
+    }
+
+    public function hasLeadingComments()
+    {
+        return $this->has_leading_comments;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional string trailing_comments = 4;</code>
+     * @return string
+     */
+    public function getTrailingComments()
+    {
+        return $this->trailing_comments;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional string trailing_comments = 4;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setTrailingComments($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->trailing_comments = $var;
+        $this->has_trailing_comments = true;
+
+        return $this;
+    }
+
+    public function hasTrailingComments()
+    {
+        return $this->has_trailing_comments;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated string leading_detached_comments = 6;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getLeadingDetachedComments()
+    {
+        return $this->leading_detached_comments;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated string leading_detached_comments = 6;</code>
+     * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setLeadingDetachedComments($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
+        $this->leading_detached_comments = $arr;
+        $this->has_leading_detached_comments = true;
+
+        return $this;
+    }
+
+    public function hasLeadingDetachedComments()
+    {
+        return $this->has_leading_detached_comments;
+    }
+
+}
+
+// Adding a class alias for backwards compatibility with the previous class name.
+class_alias(Location::class, \Google\Protobuf\Internal\SourceCodeInfo_Location::class);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo_Location.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo_Location.php
new file mode 100644
index 0000000..1346492
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo_Location.php
@@ -0,0 +1,16 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+if (false) {
+    /**
+     * This class is deprecated. Use Google\Protobuf\Internal\SourceCodeInfo\Location instead.
+     * @deprecated
+     */
+    class SourceCodeInfo_Location {}
+}
+class_exists(SourceCodeInfo\Location::class);
+@trigger_error('Google\Protobuf\Internal\SourceCodeInfo_Location is deprecated and will be removed in the next major release. Use Google\Protobuf\Internal\SourceCodeInfo\Location instead', E_USER_DEPRECATED);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption.php
new file mode 100644
index 0000000..6c871cc
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption.php
@@ -0,0 +1,289 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * A message representing a option the parser does not recognize. This only
+ * appears in options protos created by the compiler::Parser class.
+ * DescriptorPool resolves these when building Descriptor objects. Therefore,
+ * options protos in descriptor objects (e.g. returned by Descriptor::options(),
+ * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
+ * in them.
+ *
+ * Generated from protobuf message <code>google.protobuf.UninterpretedOption</code>
+ */
+class UninterpretedOption extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption.NamePart name = 2;</code>
+     */
+    private $name;
+    private $has_name = false;
+    /**
+     * The value of the uninterpreted option, in whatever type the tokenizer
+     * identified it as during parsing. Exactly one of these should be set.
+     *
+     * Generated from protobuf field <code>optional string identifier_value = 3;</code>
+     */
+    protected $identifier_value = '';
+    private $has_identifier_value = false;
+    /**
+     * Generated from protobuf field <code>optional uint64 positive_int_value = 4;</code>
+     */
+    protected $positive_int_value = 0;
+    private $has_positive_int_value = false;
+    /**
+     * Generated from protobuf field <code>optional int64 negative_int_value = 5;</code>
+     */
+    protected $negative_int_value = 0;
+    private $has_negative_int_value = false;
+    /**
+     * Generated from protobuf field <code>optional double double_value = 6;</code>
+     */
+    protected $double_value = 0.0;
+    private $has_double_value = false;
+    /**
+     * Generated from protobuf field <code>optional bytes string_value = 7;</code>
+     */
+    protected $string_value = '';
+    private $has_string_value = false;
+    /**
+     * Generated from protobuf field <code>optional string aggregate_value = 8;</code>
+     */
+    protected $aggregate_value = '';
+    private $has_aggregate_value = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type \Google\Protobuf\Internal\UninterpretedOption\NamePart[]|\Google\Protobuf\Internal\RepeatedField $name
+     *     @type string $identifier_value
+     *           The value of the uninterpreted option, in whatever type the tokenizer
+     *           identified it as during parsing. Exactly one of these should be set.
+     *     @type int|string $positive_int_value
+     *     @type int|string $negative_int_value
+     *     @type float $double_value
+     *     @type string $string_value
+     *     @type string $aggregate_value
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption.NamePart name = 2;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption.NamePart name = 2;</code>
+     * @param \Google\Protobuf\Internal\UninterpretedOption\NamePart[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setName($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption\NamePart::class);
+        $this->name = $arr;
+        $this->has_name = true;
+
+        return $this;
+    }
+
+    public function hasName()
+    {
+        return $this->has_name;
+    }
+
+    /**
+     * The value of the uninterpreted option, in whatever type the tokenizer
+     * identified it as during parsing. Exactly one of these should be set.
+     *
+     * Generated from protobuf field <code>optional string identifier_value = 3;</code>
+     * @return string
+     */
+    public function getIdentifierValue()
+    {
+        return $this->identifier_value;
+    }
+
+    /**
+     * The value of the uninterpreted option, in whatever type the tokenizer
+     * identified it as during parsing. Exactly one of these should be set.
+     *
+     * Generated from protobuf field <code>optional string identifier_value = 3;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setIdentifierValue($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->identifier_value = $var;
+        $this->has_identifier_value = true;
+
+        return $this;
+    }
+
+    public function hasIdentifierValue()
+    {
+        return $this->has_identifier_value;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional uint64 positive_int_value = 4;</code>
+     * @return int|string
+     */
+    public function getPositiveIntValue()
+    {
+        return $this->positive_int_value;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional uint64 positive_int_value = 4;</code>
+     * @param int|string $var
+     * @return $this
+     */
+    public function setPositiveIntValue($var)
+    {
+        GPBUtil::checkUint64($var);
+        $this->positive_int_value = $var;
+        $this->has_positive_int_value = true;
+
+        return $this;
+    }
+
+    public function hasPositiveIntValue()
+    {
+        return $this->has_positive_int_value;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional int64 negative_int_value = 5;</code>
+     * @return int|string
+     */
+    public function getNegativeIntValue()
+    {
+        return $this->negative_int_value;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional int64 negative_int_value = 5;</code>
+     * @param int|string $var
+     * @return $this
+     */
+    public function setNegativeIntValue($var)
+    {
+        GPBUtil::checkInt64($var);
+        $this->negative_int_value = $var;
+        $this->has_negative_int_value = true;
+
+        return $this;
+    }
+
+    public function hasNegativeIntValue()
+    {
+        return $this->has_negative_int_value;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional double double_value = 6;</code>
+     * @return float
+     */
+    public function getDoubleValue()
+    {
+        return $this->double_value;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional double double_value = 6;</code>
+     * @param float $var
+     * @return $this
+     */
+    public function setDoubleValue($var)
+    {
+        GPBUtil::checkDouble($var);
+        $this->double_value = $var;
+        $this->has_double_value = true;
+
+        return $this;
+    }
+
+    public function hasDoubleValue()
+    {
+        return $this->has_double_value;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional bytes string_value = 7;</code>
+     * @return string
+     */
+    public function getStringValue()
+    {
+        return $this->string_value;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional bytes string_value = 7;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setStringValue($var)
+    {
+        GPBUtil::checkString($var, False);
+        $this->string_value = $var;
+        $this->has_string_value = true;
+
+        return $this;
+    }
+
+    public function hasStringValue()
+    {
+        return $this->has_string_value;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional string aggregate_value = 8;</code>
+     * @return string
+     */
+    public function getAggregateValue()
+    {
+        return $this->aggregate_value;
+    }
+
+    /**
+     * Generated from protobuf field <code>optional string aggregate_value = 8;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setAggregateValue($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->aggregate_value = $var;
+        $this->has_aggregate_value = true;
+
+        return $this;
+    }
+
+    public function hasAggregateValue()
+    {
+        return $this->has_aggregate_value;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php
new file mode 100644
index 0000000..1956ba7
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php
@@ -0,0 +1,110 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal\UninterpretedOption;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\GPBWire;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\InputStream;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * The name of the uninterpreted option.  Each string represents a segment in
+ * a dot-separated name.  is_extension is true iff a segment represents an
+ * extension (denoted with parentheses in options specs in .proto files).
+ * E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents
+ * "foo.(bar.baz).qux".
+ *
+ * Generated from protobuf message <code>google.protobuf.UninterpretedOption.NamePart</code>
+ */
+class NamePart extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Generated from protobuf field <code>required string name_part = 1;</code>
+     */
+    protected $name_part = '';
+    private $has_name_part = false;
+    /**
+     * Generated from protobuf field <code>required bool is_extension = 2;</code>
+     */
+    protected $is_extension = false;
+    private $has_is_extension = false;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type string $name_part
+     *     @type bool $is_extension
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Generated from protobuf field <code>required string name_part = 1;</code>
+     * @return string
+     */
+    public function getNamePart()
+    {
+        return $this->name_part;
+    }
+
+    /**
+     * Generated from protobuf field <code>required string name_part = 1;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setNamePart($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->name_part = $var;
+        $this->has_name_part = true;
+
+        return $this;
+    }
+
+    public function hasNamePart()
+    {
+        return $this->has_name_part;
+    }
+
+    /**
+     * Generated from protobuf field <code>required bool is_extension = 2;</code>
+     * @return bool
+     */
+    public function getIsExtension()
+    {
+        return $this->is_extension;
+    }
+
+    /**
+     * Generated from protobuf field <code>required bool is_extension = 2;</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setIsExtension($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->is_extension = $var;
+        $this->has_is_extension = true;
+
+        return $this;
+    }
+
+    public function hasIsExtension()
+    {
+        return $this->has_is_extension;
+    }
+
+}
+
+// Adding a class alias for backwards compatibility with the previous class name.
+class_alias(NamePart::class, \Google\Protobuf\Internal\UninterpretedOption_NamePart::class);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption_NamePart.php b/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption_NamePart.php
new file mode 100644
index 0000000..9750eb0
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption_NamePart.php
@@ -0,0 +1,16 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/descriptor.proto
+
+namespace Google\Protobuf\Internal;
+
+if (false) {
+    /**
+     * This class is deprecated. Use Google\Protobuf\Internal\UninterpretedOption\NamePart instead.
+     * @deprecated
+     */
+    class UninterpretedOption_NamePart {}
+}
+class_exists(UninterpretedOption\NamePart::class);
+@trigger_error('Google\Protobuf\Internal\UninterpretedOption_NamePart is deprecated and will be removed in the next major release. Use Google\Protobuf\Internal\UninterpretedOption\NamePart instead', E_USER_DEPRECATED);
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/ListValue.php b/vendor/google/protobuf/src/Google/Protobuf/ListValue.php
new file mode 100644
index 0000000..70f5423
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/ListValue.php
@@ -0,0 +1,68 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/struct.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * `ListValue` is a wrapper around a repeated field of values.
+ * The JSON representation for `ListValue` is JSON array.
+ *
+ * Generated from protobuf message <code>google.protobuf.ListValue</code>
+ */
+class ListValue extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Repeated field of dynamically typed values.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Value values = 1;</code>
+     */
+    private $values;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type \Google\Protobuf\Value[]|\Google\Protobuf\Internal\RepeatedField $values
+     *           Repeated field of dynamically typed values.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Struct::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Repeated field of dynamically typed values.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Value values = 1;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getValues()
+    {
+        return $this->values;
+    }
+
+    /**
+     * Repeated field of dynamically typed values.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Value values = 1;</code>
+     * @param \Google\Protobuf\Value[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setValues($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class);
+        $this->values = $arr;
+
+        return $this;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Method.php b/vendor/google/protobuf/src/Google/Protobuf/Method.php
new file mode 100644
index 0000000..8e80350
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Method.php
@@ -0,0 +1,271 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/api.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Method represents a method of an API interface.
+ *
+ * Generated from protobuf message <code>google.protobuf.Method</code>
+ */
+class Method extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * The simple name of this method.
+     *
+     * Generated from protobuf field <code>string name = 1;</code>
+     */
+    private $name = '';
+    /**
+     * A URL of the input message type.
+     *
+     * Generated from protobuf field <code>string request_type_url = 2;</code>
+     */
+    private $request_type_url = '';
+    /**
+     * If true, the request is streamed.
+     *
+     * Generated from protobuf field <code>bool request_streaming = 3;</code>
+     */
+    private $request_streaming = false;
+    /**
+     * The URL of the output message type.
+     *
+     * Generated from protobuf field <code>string response_type_url = 4;</code>
+     */
+    private $response_type_url = '';
+    /**
+     * If true, the response is streamed.
+     *
+     * Generated from protobuf field <code>bool response_streaming = 5;</code>
+     */
+    private $response_streaming = false;
+    /**
+     * Any metadata attached to the method.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Option options = 6;</code>
+     */
+    private $options;
+    /**
+     * The source syntax of this method.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Syntax syntax = 7;</code>
+     */
+    private $syntax = 0;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type string $name
+     *           The simple name of this method.
+     *     @type string $request_type_url
+     *           A URL of the input message type.
+     *     @type bool $request_streaming
+     *           If true, the request is streamed.
+     *     @type string $response_type_url
+     *           The URL of the output message type.
+     *     @type bool $response_streaming
+     *           If true, the response is streamed.
+     *     @type \Google\Protobuf\Option[]|\Google\Protobuf\Internal\RepeatedField $options
+     *           Any metadata attached to the method.
+     *     @type int $syntax
+     *           The source syntax of this method.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Api::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * The simple name of this method.
+     *
+     * Generated from protobuf field <code>string name = 1;</code>
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * The simple name of this method.
+     *
+     * Generated from protobuf field <code>string name = 1;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setName($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->name = $var;
+
+        return $this;
+    }
+
+    /**
+     * A URL of the input message type.
+     *
+     * Generated from protobuf field <code>string request_type_url = 2;</code>
+     * @return string
+     */
+    public function getRequestTypeUrl()
+    {
+        return $this->request_type_url;
+    }
+
+    /**
+     * A URL of the input message type.
+     *
+     * Generated from protobuf field <code>string request_type_url = 2;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setRequestTypeUrl($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->request_type_url = $var;
+
+        return $this;
+    }
+
+    /**
+     * If true, the request is streamed.
+     *
+     * Generated from protobuf field <code>bool request_streaming = 3;</code>
+     * @return bool
+     */
+    public function getRequestStreaming()
+    {
+        return $this->request_streaming;
+    }
+
+    /**
+     * If true, the request is streamed.
+     *
+     * Generated from protobuf field <code>bool request_streaming = 3;</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setRequestStreaming($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->request_streaming = $var;
+
+        return $this;
+    }
+
+    /**
+     * The URL of the output message type.
+     *
+     * Generated from protobuf field <code>string response_type_url = 4;</code>
+     * @return string
+     */
+    public function getResponseTypeUrl()
+    {
+        return $this->response_type_url;
+    }
+
+    /**
+     * The URL of the output message type.
+     *
+     * Generated from protobuf field <code>string response_type_url = 4;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setResponseTypeUrl($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->response_type_url = $var;
+
+        return $this;
+    }
+
+    /**
+     * If true, the response is streamed.
+     *
+     * Generated from protobuf field <code>bool response_streaming = 5;</code>
+     * @return bool
+     */
+    public function getResponseStreaming()
+    {
+        return $this->response_streaming;
+    }
+
+    /**
+     * If true, the response is streamed.
+     *
+     * Generated from protobuf field <code>bool response_streaming = 5;</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setResponseStreaming($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->response_streaming = $var;
+
+        return $this;
+    }
+
+    /**
+     * Any metadata attached to the method.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Option options = 6;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getOptions()
+    {
+        return $this->options;
+    }
+
+    /**
+     * Any metadata attached to the method.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Option options = 6;</code>
+     * @param \Google\Protobuf\Option[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setOptions($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class);
+        $this->options = $arr;
+
+        return $this;
+    }
+
+    /**
+     * The source syntax of this method.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Syntax syntax = 7;</code>
+     * @return int
+     */
+    public function getSyntax()
+    {
+        return $this->syntax;
+    }
+
+    /**
+     * The source syntax of this method.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Syntax syntax = 7;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setSyntax($var)
+    {
+        GPBUtil::checkEnum($var, \Google\Protobuf\Syntax::class);
+        $this->syntax = $var;
+
+        return $this;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Mixin.php b/vendor/google/protobuf/src/Google/Protobuf/Mixin.php
new file mode 100644
index 0000000..a2ea59c
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Mixin.php
@@ -0,0 +1,166 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/api.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Declares an API Interface to be included in this interface. The including
+ * interface must redeclare all the methods from the included interface, but
+ * documentation and options are inherited as follows:
+ * - If after comment and whitespace stripping, the documentation
+ *   string of the redeclared method is empty, it will be inherited
+ *   from the original method.
+ * - Each annotation belonging to the service config (http,
+ *   visibility) which is not set in the redeclared method will be
+ *   inherited.
+ * - If an http annotation is inherited, the path pattern will be
+ *   modified as follows. Any version prefix will be replaced by the
+ *   version of the including interface plus the [root][] path if
+ *   specified.
+ * Example of a simple mixin:
+ *     package google.acl.v1;
+ *     service AccessControl {
+ *       // Get the underlying ACL object.
+ *       rpc GetAcl(GetAclRequest) returns (Acl) {
+ *         option (google.api.http).get = "/v1/{resource=**}:getAcl";
+ *       }
+ *     }
+ *     package google.storage.v2;
+ *     service Storage {
+ *       rpc GetAcl(GetAclRequest) returns (Acl);
+ *       // Get a data record.
+ *       rpc GetData(GetDataRequest) returns (Data) {
+ *         option (google.api.http).get = "/v2/{resource=**}";
+ *       }
+ *     }
+ * Example of a mixin configuration:
+ *     apis:
+ *     - name: google.storage.v2.Storage
+ *       mixins:
+ *       - name: google.acl.v1.AccessControl
+ * The mixin construct implies that all methods in `AccessControl` are
+ * also declared with same name and request/response types in
+ * `Storage`. A documentation generator or annotation processor will
+ * see the effective `Storage.GetAcl` method after inherting
+ * documentation and annotations as follows:
+ *     service Storage {
+ *       // Get the underlying ACL object.
+ *       rpc GetAcl(GetAclRequest) returns (Acl) {
+ *         option (google.api.http).get = "/v2/{resource=**}:getAcl";
+ *       }
+ *       ...
+ *     }
+ * Note how the version in the path pattern changed from `v1` to `v2`.
+ * If the `root` field in the mixin is specified, it should be a
+ * relative path under which inherited HTTP paths are placed. Example:
+ *     apis:
+ *     - name: google.storage.v2.Storage
+ *       mixins:
+ *       - name: google.acl.v1.AccessControl
+ *         root: acls
+ * This implies the following inherited HTTP annotation:
+ *     service Storage {
+ *       // Get the underlying ACL object.
+ *       rpc GetAcl(GetAclRequest) returns (Acl) {
+ *         option (google.api.http).get = "/v2/acls/{resource=**}:getAcl";
+ *       }
+ *       ...
+ *     }
+ *
+ * Generated from protobuf message <code>google.protobuf.Mixin</code>
+ */
+class Mixin extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * The fully qualified name of the interface which is included.
+     *
+     * Generated from protobuf field <code>string name = 1;</code>
+     */
+    private $name = '';
+    /**
+     * If non-empty specifies a path under which inherited HTTP paths
+     * are rooted.
+     *
+     * Generated from protobuf field <code>string root = 2;</code>
+     */
+    private $root = '';
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type string $name
+     *           The fully qualified name of the interface which is included.
+     *     @type string $root
+     *           If non-empty specifies a path under which inherited HTTP paths
+     *           are rooted.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Api::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * The fully qualified name of the interface which is included.
+     *
+     * Generated from protobuf field <code>string name = 1;</code>
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * The fully qualified name of the interface which is included.
+     *
+     * Generated from protobuf field <code>string name = 1;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setName($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->name = $var;
+
+        return $this;
+    }
+
+    /**
+     * If non-empty specifies a path under which inherited HTTP paths
+     * are rooted.
+     *
+     * Generated from protobuf field <code>string root = 2;</code>
+     * @return string
+     */
+    public function getRoot()
+    {
+        return $this->root;
+    }
+
+    /**
+     * If non-empty specifies a path under which inherited HTTP paths
+     * are rooted.
+     *
+     * Generated from protobuf field <code>string root = 2;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setRoot($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->root = $var;
+
+        return $this;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/NullValue.php b/vendor/google/protobuf/src/Google/Protobuf/NullValue.php
new file mode 100644
index 0000000..a72cbb2
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/NullValue.php
@@ -0,0 +1,48 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/struct.proto
+
+namespace Google\Protobuf;
+
+use UnexpectedValueException;
+
+/**
+ * `NullValue` is a singleton enumeration to represent the null value for the
+ * `Value` type union.
+ *  The JSON representation for `NullValue` is JSON `null`.
+ *
+ * Protobuf type <code>google.protobuf.NullValue</code>
+ */
+class NullValue
+{
+    /**
+     * Null value.
+     *
+     * Generated from protobuf enum <code>NULL_VALUE = 0;</code>
+     */
+    const NULL_VALUE = 0;
+
+    private static $valueToName = [
+        self::NULL_VALUE => 'NULL_VALUE',
+    ];
+
+    public static function name($value)
+    {
+        if (!isset(self::$valueToName[$value])) {
+            throw new UnexpectedValueException(sprintf(
+                    'Enum %s has no name defined for value %s', __CLASS__, $value));
+        }
+        return self::$valueToName[$value];
+    }
+
+    public static function value($name)
+    {
+        $const = __CLASS__ . '::' . strtoupper($name);
+        if (!defined($const)) {
+            throw new UnexpectedValueException(sprintf(
+                    'Enum %s has no value defined for name %s', __CLASS__, $name));
+        }
+        return constant($const);
+    }
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/OneofDescriptor.php b/vendor/google/protobuf/src/Google/Protobuf/OneofDescriptor.php
new file mode 100644
index 0000000..d973663
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/OneofDescriptor.php
@@ -0,0 +1,75 @@
+<?php
+
+// Protocol Buffers - Google's data interchange format
+// Copyright 2017 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GetPublicDescriptorTrait;
+
+class OneofDescriptor
+{
+    use GetPublicDescriptorTrait;
+
+    private $internal_desc;
+
+    /**
+     * @internal
+     */
+    public function __construct($internal_desc)
+    {
+        $this->internal_desc = $internal_desc;
+    }
+
+    /**
+     * @return string The name of the oneof
+     */
+    public function getName()
+    {
+        return $this->internal_desc->getName();
+    }
+
+    /**
+     * @param int $index Must be >= 0 and < getFieldCount()
+     * @return FieldDescriptor
+     */
+    public function getField($index)
+    {
+        return $this->getPublicDescriptor($this->internal_desc->getFields()[$index]);
+    }
+
+    /**
+     * @return int Number of fields in the oneof
+     */
+    public function getFieldCount()
+    {
+        return count($this->internal_desc->getFields());
+    }
+}
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Option.php b/vendor/google/protobuf/src/Google/Protobuf/Option.php
new file mode 100644
index 0000000..22ecfc5
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Option.php
@@ -0,0 +1,126 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/type.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * A protocol buffer option, which can be attached to a message, field,
+ * enumeration, etc.
+ *
+ * Generated from protobuf message <code>google.protobuf.Option</code>
+ */
+class Option extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * The option's name. For protobuf built-in options (options defined in
+     * descriptor.proto), this is the short name. For example, `"map_entry"`.
+     * For custom options, it should be the fully-qualified name. For example,
+     * `"google.api.http"`.
+     *
+     * Generated from protobuf field <code>string name = 1;</code>
+     */
+    private $name = '';
+    /**
+     * The option's value packed in an Any message. If the value is a primitive,
+     * the corresponding wrapper type defined in google/protobuf/wrappers.proto
+     * should be used. If the value is an enum, it should be stored as an int32
+     * value using the google.protobuf.Int32Value type.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Any value = 2;</code>
+     */
+    private $value = null;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type string $name
+     *           The option's name. For protobuf built-in options (options defined in
+     *           descriptor.proto), this is the short name. For example, `"map_entry"`.
+     *           For custom options, it should be the fully-qualified name. For example,
+     *           `"google.api.http"`.
+     *     @type \Google\Protobuf\Any $value
+     *           The option's value packed in an Any message. If the value is a primitive,
+     *           the corresponding wrapper type defined in google/protobuf/wrappers.proto
+     *           should be used. If the value is an enum, it should be stored as an int32
+     *           value using the google.protobuf.Int32Value type.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Type::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * The option's name. For protobuf built-in options (options defined in
+     * descriptor.proto), this is the short name. For example, `"map_entry"`.
+     * For custom options, it should be the fully-qualified name. For example,
+     * `"google.api.http"`.
+     *
+     * Generated from protobuf field <code>string name = 1;</code>
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * The option's name. For protobuf built-in options (options defined in
+     * descriptor.proto), this is the short name. For example, `"map_entry"`.
+     * For custom options, it should be the fully-qualified name. For example,
+     * `"google.api.http"`.
+     *
+     * Generated from protobuf field <code>string name = 1;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setName($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->name = $var;
+
+        return $this;
+    }
+
+    /**
+     * The option's value packed in an Any message. If the value is a primitive,
+     * the corresponding wrapper type defined in google/protobuf/wrappers.proto
+     * should be used. If the value is an enum, it should be stored as an int32
+     * value using the google.protobuf.Int32Value type.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Any value = 2;</code>
+     * @return \Google\Protobuf\Any
+     */
+    public function getValue()
+    {
+        return $this->value;
+    }
+
+    /**
+     * The option's value packed in an Any message. If the value is a primitive,
+     * the corresponding wrapper type defined in google/protobuf/wrappers.proto
+     * should be used. If the value is an enum, it should be stored as an int32
+     * value using the google.protobuf.Int32Value type.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Any value = 2;</code>
+     * @param \Google\Protobuf\Any $var
+     * @return $this
+     */
+    public function setValue($var)
+    {
+        GPBUtil::checkMessage($var, \Google\Protobuf\Any::class);
+        $this->value = $var;
+
+        return $this;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/SourceContext.php b/vendor/google/protobuf/src/Google/Protobuf/SourceContext.php
new file mode 100644
index 0000000..cbc50c6
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/SourceContext.php
@@ -0,0 +1,72 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/source_context.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * `SourceContext` represents information about the source of a
+ * protobuf element, like the file in which it is defined.
+ *
+ * Generated from protobuf message <code>google.protobuf.SourceContext</code>
+ */
+class SourceContext extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * The path-qualified name of the .proto file that contained the associated
+     * protobuf element.  For example: `"google/protobuf/source_context.proto"`.
+     *
+     * Generated from protobuf field <code>string file_name = 1;</code>
+     */
+    private $file_name = '';
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type string $file_name
+     *           The path-qualified name of the .proto file that contained the associated
+     *           protobuf element.  For example: `"google/protobuf/source_context.proto"`.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\SourceContext::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * The path-qualified name of the .proto file that contained the associated
+     * protobuf element.  For example: `"google/protobuf/source_context.proto"`.
+     *
+     * Generated from protobuf field <code>string file_name = 1;</code>
+     * @return string
+     */
+    public function getFileName()
+    {
+        return $this->file_name;
+    }
+
+    /**
+     * The path-qualified name of the .proto file that contained the associated
+     * protobuf element.  For example: `"google/protobuf/source_context.proto"`.
+     *
+     * Generated from protobuf field <code>string file_name = 1;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setFileName($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->file_name = $var;
+
+        return $this;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/StringValue.php b/vendor/google/protobuf/src/Google/Protobuf/StringValue.php
new file mode 100644
index 0000000..8fb354f
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/StringValue.php
@@ -0,0 +1,68 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/wrappers.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Wrapper message for `string`.
+ * The JSON representation for `StringValue` is JSON string.
+ *
+ * Generated from protobuf message <code>google.protobuf.StringValue</code>
+ */
+class StringValue extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * The string value.
+     *
+     * Generated from protobuf field <code>string value = 1;</code>
+     */
+    private $value = '';
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type string $value
+     *           The string value.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Wrappers::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * The string value.
+     *
+     * Generated from protobuf field <code>string value = 1;</code>
+     * @return string
+     */
+    public function getValue()
+    {
+        return $this->value;
+    }
+
+    /**
+     * The string value.
+     *
+     * Generated from protobuf field <code>string value = 1;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setValue($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->value = $var;
+
+        return $this;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Struct.php b/vendor/google/protobuf/src/Google/Protobuf/Struct.php
new file mode 100644
index 0000000..0456541
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Struct.php
@@ -0,0 +1,73 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/struct.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * `Struct` represents a structured data value, consisting of fields
+ * which map to dynamically typed values. In some languages, `Struct`
+ * might be supported by a native representation. For example, in
+ * scripting languages like JS a struct is represented as an
+ * object. The details of that representation are described together
+ * with the proto support for the language.
+ * The JSON representation for `Struct` is JSON object.
+ *
+ * Generated from protobuf message <code>google.protobuf.Struct</code>
+ */
+class Struct extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Unordered map of dynamically typed values.
+     *
+     * Generated from protobuf field <code>map<string, .google.protobuf.Value> fields = 1;</code>
+     */
+    private $fields;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type array|\Google\Protobuf\Internal\MapField $fields
+     *           Unordered map of dynamically typed values.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Struct::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Unordered map of dynamically typed values.
+     *
+     * Generated from protobuf field <code>map<string, .google.protobuf.Value> fields = 1;</code>
+     * @return \Google\Protobuf\Internal\MapField
+     */
+    public function getFields()
+    {
+        return $this->fields;
+    }
+
+    /**
+     * Unordered map of dynamically typed values.
+     *
+     * Generated from protobuf field <code>map<string, .google.protobuf.Value> fields = 1;</code>
+     * @param array|\Google\Protobuf\Internal\MapField $var
+     * @return $this
+     */
+    public function setFields($var)
+    {
+        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class);
+        $this->fields = $arr;
+
+        return $this;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Syntax.php b/vendor/google/protobuf/src/Google/Protobuf/Syntax.php
new file mode 100644
index 0000000..9812669
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Syntax.php
@@ -0,0 +1,53 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/type.proto
+
+namespace Google\Protobuf;
+
+use UnexpectedValueException;
+
+/**
+ * The syntax in which a protocol buffer element is defined.
+ *
+ * Protobuf type <code>google.protobuf.Syntax</code>
+ */
+class Syntax
+{
+    /**
+     * Syntax `proto2`.
+     *
+     * Generated from protobuf enum <code>SYNTAX_PROTO2 = 0;</code>
+     */
+    const SYNTAX_PROTO2 = 0;
+    /**
+     * Syntax `proto3`.
+     *
+     * Generated from protobuf enum <code>SYNTAX_PROTO3 = 1;</code>
+     */
+    const SYNTAX_PROTO3 = 1;
+
+    private static $valueToName = [
+        self::SYNTAX_PROTO2 => 'SYNTAX_PROTO2',
+        self::SYNTAX_PROTO3 => 'SYNTAX_PROTO3',
+    ];
+
+    public static function name($value)
+    {
+        if (!isset(self::$valueToName[$value])) {
+            throw new UnexpectedValueException(sprintf(
+                    'Enum %s has no name defined for value %s', __CLASS__, $value));
+        }
+        return self::$valueToName[$value];
+    }
+
+    public static function value($name)
+    {
+        $const = __CLASS__ . '::' . strtoupper($name);
+        if (!defined($const)) {
+            throw new UnexpectedValueException(sprintf(
+                    'Enum %s has no value defined for name %s', __CLASS__, $name));
+        }
+        return constant($const);
+    }
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Timestamp.php b/vendor/google/protobuf/src/Google/Protobuf/Timestamp.php
new file mode 100644
index 0000000..6d26f6c
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Timestamp.php
@@ -0,0 +1,200 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/timestamp.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * A Timestamp represents a point in time independent of any time zone
+ * or calendar, represented as seconds and fractions of seconds at
+ * nanosecond resolution in UTC Epoch time. It is encoded using the
+ * Proleptic Gregorian Calendar which extends the Gregorian calendar
+ * backwards to year one. It is encoded assuming all minutes are 60
+ * seconds long, i.e. leap seconds are "smeared" so that no leap second
+ * table is needed for interpretation. Range is from
+ * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.
+ * By restricting to that range, we ensure that we can convert to
+ * and from  RFC 3339 date strings.
+ * See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt).
+ * # Examples
+ * Example 1: Compute Timestamp from POSIX `time()`.
+ *     Timestamp timestamp;
+ *     timestamp.set_seconds(time(NULL));
+ *     timestamp.set_nanos(0);
+ * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
+ *     struct timeval tv;
+ *     gettimeofday(&tv, NULL);
+ *     Timestamp timestamp;
+ *     timestamp.set_seconds(tv.tv_sec);
+ *     timestamp.set_nanos(tv.tv_usec * 1000);
+ * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
+ *     FILETIME ft;
+ *     GetSystemTimeAsFileTime(&ft);
+ *     UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
+ *     // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
+ *     // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
+ *     Timestamp timestamp;
+ *     timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
+ *     timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
+ * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
+ *     long millis = System.currentTimeMillis();
+ *     Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
+ *         .setNanos((int) ((millis % 1000) * 1000000)).build();
+ * Example 5: Compute Timestamp from current time in Python.
+ *     timestamp = Timestamp()
+ *     timestamp.GetCurrentTime()
+ * # JSON Mapping
+ * In JSON format, the Timestamp type is encoded as a string in the
+ * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
+ * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
+ * where {year} is always expressed using four digits while {month}, {day},
+ * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
+ * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
+ * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
+ * is required. A proto3 JSON serializer should always use UTC (as indicated by
+ * "Z") when printing the Timestamp type and a proto3 JSON parser should be
+ * able to accept both UTC and other timezones (as indicated by an offset).
+ * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
+ * 01:30 UTC on January 15, 2017.
+ * In JavaScript, one can convert a Date object to this format using the
+ * standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString]
+ * method. In Python, a standard `datetime.datetime` object can be converted
+ * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
+ * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
+ * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
+ * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--
+ * ) to obtain a formatter capable of generating timestamps in this format.
+ *
+ * Generated from protobuf message <code>google.protobuf.Timestamp</code>
+ */
+class Timestamp extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * Represents seconds of UTC time since Unix epoch
+     * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
+     * 9999-12-31T23:59:59Z inclusive.
+     *
+     * Generated from protobuf field <code>int64 seconds = 1;</code>
+     */
+    private $seconds = 0;
+    /**
+     * Non-negative fractions of a second at nanosecond resolution. Negative
+     * second values with fractions must still have non-negative nanos values
+     * that count forward in time. Must be from 0 to 999,999,999
+     * inclusive.
+     *
+     * Generated from protobuf field <code>int32 nanos = 2;</code>
+     */
+    private $nanos = 0;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type int|string $seconds
+     *           Represents seconds of UTC time since Unix epoch
+     *           1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
+     *           9999-12-31T23:59:59Z inclusive.
+     *     @type int $nanos
+     *           Non-negative fractions of a second at nanosecond resolution. Negative
+     *           second values with fractions must still have non-negative nanos values
+     *           that count forward in time. Must be from 0 to 999,999,999
+     *           inclusive.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Timestamp::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Represents seconds of UTC time since Unix epoch
+     * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
+     * 9999-12-31T23:59:59Z inclusive.
+     *
+     * Generated from protobuf field <code>int64 seconds = 1;</code>
+     * @return int|string
+     */
+    public function getSeconds()
+    {
+        return $this->seconds;
+    }
+
+    /**
+     * Represents seconds of UTC time since Unix epoch
+     * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
+     * 9999-12-31T23:59:59Z inclusive.
+     *
+     * Generated from protobuf field <code>int64 seconds = 1;</code>
+     * @param int|string $var
+     * @return $this
+     */
+    public function setSeconds($var)
+    {
+        GPBUtil::checkInt64($var);
+        $this->seconds = $var;
+
+        return $this;
+    }
+
+    /**
+     * Non-negative fractions of a second at nanosecond resolution. Negative
+     * second values with fractions must still have non-negative nanos values
+     * that count forward in time. Must be from 0 to 999,999,999
+     * inclusive.
+     *
+     * Generated from protobuf field <code>int32 nanos = 2;</code>
+     * @return int
+     */
+    public function getNanos()
+    {
+        return $this->nanos;
+    }
+
+    /**
+     * Non-negative fractions of a second at nanosecond resolution. Negative
+     * second values with fractions must still have non-negative nanos values
+     * that count forward in time. Must be from 0 to 999,999,999
+     * inclusive.
+     *
+     * Generated from protobuf field <code>int32 nanos = 2;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setNanos($var)
+    {
+        GPBUtil::checkInt32($var);
+        $this->nanos = $var;
+
+        return $this;
+    }
+
+    /*
+     * Converts PHP DateTime to Timestamp.
+     *
+     * @param \DateTime $datetime
+     */
+    public function fromDateTime(\DateTime $datetime)
+    {
+        $this->seconds = $datetime->getTimestamp();
+        $this->nanos = 1000 * $datetime->format('u');
+    }
+
+    /**
+     * Converts Timestamp to PHP DateTime.
+     *
+     * @return \DateTime $datetime
+     */
+    public function toDateTime()
+    {
+        $time = sprintf('%s.%06d', $this->seconds, $this->nanos / 1000);
+        return \DateTime::createFromFormat('U.u', $time);
+    }
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Type.php b/vendor/google/protobuf/src/Google/Protobuf/Type.php
new file mode 100644
index 0000000..1b47811
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Type.php
@@ -0,0 +1,237 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/type.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * A protocol buffer message type.
+ *
+ * Generated from protobuf message <code>google.protobuf.Type</code>
+ */
+class Type extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * The fully qualified message name.
+     *
+     * Generated from protobuf field <code>string name = 1;</code>
+     */
+    private $name = '';
+    /**
+     * The list of fields.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Field fields = 2;</code>
+     */
+    private $fields;
+    /**
+     * The list of types appearing in `oneof` definitions in this type.
+     *
+     * Generated from protobuf field <code>repeated string oneofs = 3;</code>
+     */
+    private $oneofs;
+    /**
+     * The protocol buffer options.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Option options = 4;</code>
+     */
+    private $options;
+    /**
+     * The source context.
+     *
+     * Generated from protobuf field <code>.google.protobuf.SourceContext source_context = 5;</code>
+     */
+    private $source_context = null;
+    /**
+     * The source syntax.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Syntax syntax = 6;</code>
+     */
+    private $syntax = 0;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type string $name
+     *           The fully qualified message name.
+     *     @type \Google\Protobuf\Field[]|\Google\Protobuf\Internal\RepeatedField $fields
+     *           The list of fields.
+     *     @type string[]|\Google\Protobuf\Internal\RepeatedField $oneofs
+     *           The list of types appearing in `oneof` definitions in this type.
+     *     @type \Google\Protobuf\Option[]|\Google\Protobuf\Internal\RepeatedField $options
+     *           The protocol buffer options.
+     *     @type \Google\Protobuf\SourceContext $source_context
+     *           The source context.
+     *     @type int $syntax
+     *           The source syntax.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Type::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * The fully qualified message name.
+     *
+     * Generated from protobuf field <code>string name = 1;</code>
+     * @return string
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * The fully qualified message name.
+     *
+     * Generated from protobuf field <code>string name = 1;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setName($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->name = $var;
+
+        return $this;
+    }
+
+    /**
+     * The list of fields.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Field fields = 2;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getFields()
+    {
+        return $this->fields;
+    }
+
+    /**
+     * The list of fields.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Field fields = 2;</code>
+     * @param \Google\Protobuf\Field[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setFields($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Field::class);
+        $this->fields = $arr;
+
+        return $this;
+    }
+
+    /**
+     * The list of types appearing in `oneof` definitions in this type.
+     *
+     * Generated from protobuf field <code>repeated string oneofs = 3;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getOneofs()
+    {
+        return $this->oneofs;
+    }
+
+    /**
+     * The list of types appearing in `oneof` definitions in this type.
+     *
+     * Generated from protobuf field <code>repeated string oneofs = 3;</code>
+     * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setOneofs($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
+        $this->oneofs = $arr;
+
+        return $this;
+    }
+
+    /**
+     * The protocol buffer options.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Option options = 4;</code>
+     * @return \Google\Protobuf\Internal\RepeatedField
+     */
+    public function getOptions()
+    {
+        return $this->options;
+    }
+
+    /**
+     * The protocol buffer options.
+     *
+     * Generated from protobuf field <code>repeated .google.protobuf.Option options = 4;</code>
+     * @param \Google\Protobuf\Option[]|\Google\Protobuf\Internal\RepeatedField $var
+     * @return $this
+     */
+    public function setOptions($var)
+    {
+        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class);
+        $this->options = $arr;
+
+        return $this;
+    }
+
+    /**
+     * The source context.
+     *
+     * Generated from protobuf field <code>.google.protobuf.SourceContext source_context = 5;</code>
+     * @return \Google\Protobuf\SourceContext
+     */
+    public function getSourceContext()
+    {
+        return $this->source_context;
+    }
+
+    /**
+     * The source context.
+     *
+     * Generated from protobuf field <code>.google.protobuf.SourceContext source_context = 5;</code>
+     * @param \Google\Protobuf\SourceContext $var
+     * @return $this
+     */
+    public function setSourceContext($var)
+    {
+        GPBUtil::checkMessage($var, \Google\Protobuf\SourceContext::class);
+        $this->source_context = $var;
+
+        return $this;
+    }
+
+    /**
+     * The source syntax.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Syntax syntax = 6;</code>
+     * @return int
+     */
+    public function getSyntax()
+    {
+        return $this->syntax;
+    }
+
+    /**
+     * The source syntax.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Syntax syntax = 6;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setSyntax($var)
+    {
+        GPBUtil::checkEnum($var, \Google\Protobuf\Syntax::class);
+        $this->syntax = $var;
+
+        return $this;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/UInt32Value.php b/vendor/google/protobuf/src/Google/Protobuf/UInt32Value.php
new file mode 100644
index 0000000..f5a522d
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/UInt32Value.php
@@ -0,0 +1,68 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/wrappers.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Wrapper message for `uint32`.
+ * The JSON representation for `UInt32Value` is JSON number.
+ *
+ * Generated from protobuf message <code>google.protobuf.UInt32Value</code>
+ */
+class UInt32Value extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * The uint32 value.
+     *
+     * Generated from protobuf field <code>uint32 value = 1;</code>
+     */
+    private $value = 0;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type int $value
+     *           The uint32 value.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Wrappers::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * The uint32 value.
+     *
+     * Generated from protobuf field <code>uint32 value = 1;</code>
+     * @return int
+     */
+    public function getValue()
+    {
+        return $this->value;
+    }
+
+    /**
+     * The uint32 value.
+     *
+     * Generated from protobuf field <code>uint32 value = 1;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setValue($var)
+    {
+        GPBUtil::checkUint32($var);
+        $this->value = $var;
+
+        return $this;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/UInt64Value.php b/vendor/google/protobuf/src/Google/Protobuf/UInt64Value.php
new file mode 100644
index 0000000..89e69cd
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/UInt64Value.php
@@ -0,0 +1,68 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/wrappers.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * Wrapper message for `uint64`.
+ * The JSON representation for `UInt64Value` is JSON string.
+ *
+ * Generated from protobuf message <code>google.protobuf.UInt64Value</code>
+ */
+class UInt64Value extends \Google\Protobuf\Internal\Message
+{
+    /**
+     * The uint64 value.
+     *
+     * Generated from protobuf field <code>uint64 value = 1;</code>
+     */
+    private $value = 0;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type int|string $value
+     *           The uint64 value.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Wrappers::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * The uint64 value.
+     *
+     * Generated from protobuf field <code>uint64 value = 1;</code>
+     * @return int|string
+     */
+    public function getValue()
+    {
+        return $this->value;
+    }
+
+    /**
+     * The uint64 value.
+     *
+     * Generated from protobuf field <code>uint64 value = 1;</code>
+     * @param int|string $var
+     * @return $this
+     */
+    public function setValue($var)
+    {
+        GPBUtil::checkUint64($var);
+        $this->value = $var;
+
+        return $this;
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/Google/Protobuf/Value.php b/vendor/google/protobuf/src/Google/Protobuf/Value.php
new file mode 100644
index 0000000..5c1e864
--- /dev/null
+++ b/vendor/google/protobuf/src/Google/Protobuf/Value.php
@@ -0,0 +1,214 @@
+<?php
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: google/protobuf/struct.proto
+
+namespace Google\Protobuf;
+
+use Google\Protobuf\Internal\GPBType;
+use Google\Protobuf\Internal\RepeatedField;
+use Google\Protobuf\Internal\GPBUtil;
+
+/**
+ * `Value` represents a dynamically typed value which can be either
+ * null, a number, a string, a boolean, a recursive struct value, or a
+ * list of values. A producer of value is expected to set one of that
+ * variants, absence of any variant indicates an error.
+ * The JSON representation for `Value` is JSON value.
+ *
+ * Generated from protobuf message <code>google.protobuf.Value</code>
+ */
+class Value extends \Google\Protobuf\Internal\Message
+{
+    protected $kind;
+
+    /**
+     * Constructor.
+     *
+     * @param array $data {
+     *     Optional. Data for populating the Message object.
+     *
+     *     @type int $null_value
+     *           Represents a null value.
+     *     @type float $number_value
+     *           Represents a double value.
+     *     @type string $string_value
+     *           Represents a string value.
+     *     @type bool $bool_value
+     *           Represents a boolean value.
+     *     @type \Google\Protobuf\Struct $struct_value
+     *           Represents a structured value.
+     *     @type \Google\Protobuf\ListValue $list_value
+     *           Represents a repeated `Value`.
+     * }
+     */
+    public function __construct($data = NULL) {
+        \GPBMetadata\Google\Protobuf\Struct::initOnce();
+        parent::__construct($data);
+    }
+
+    /**
+     * Represents a null value.
+     *
+     * Generated from protobuf field <code>.google.protobuf.NullValue null_value = 1;</code>
+     * @return int
+     */
+    public function getNullValue()
+    {
+        return $this->readOneof(1);
+    }
+
+    /**
+     * Represents a null value.
+     *
+     * Generated from protobuf field <code>.google.protobuf.NullValue null_value = 1;</code>
+     * @param int $var
+     * @return $this
+     */
+    public function setNullValue($var)
+    {
+        GPBUtil::checkEnum($var, \Google\Protobuf\NullValue::class);
+        $this->writeOneof(1, $var);
+
+        return $this;
+    }
+
+    /**
+     * Represents a double value.
+     *
+     * Generated from protobuf field <code>double number_value = 2;</code>
+     * @return float
+     */
+    public function getNumberValue()
+    {
+        return $this->readOneof(2);
+    }
+
+    /**
+     * Represents a double value.
+     *
+     * Generated from protobuf field <code>double number_value = 2;</code>
+     * @param float $var
+     * @return $this
+     */
+    public function setNumberValue($var)
+    {
+        GPBUtil::checkDouble($var);
+        $this->writeOneof(2, $var);
+
+        return $this;
+    }
+
+    /**
+     * Represents a string value.
+     *
+     * Generated from protobuf field <code>string string_value = 3;</code>
+     * @return string
+     */
+    public function getStringValue()
+    {
+        return $this->readOneof(3);
+    }
+
+    /**
+     * Represents a string value.
+     *
+     * Generated from protobuf field <code>string string_value = 3;</code>
+     * @param string $var
+     * @return $this
+     */
+    public function setStringValue($var)
+    {
+        GPBUtil::checkString($var, True);
+        $this->writeOneof(3, $var);
+
+        return $this;
+    }
+
+    /**
+     * Represents a boolean value.
+     *
+     * Generated from protobuf field <code>bool bool_value = 4;</code>
+     * @return bool
+     */
+    public function getBoolValue()
+    {
+        return $this->readOneof(4);
+    }
+
+    /**
+     * Represents a boolean value.
+     *
+     * Generated from protobuf field <code>bool bool_value = 4;</code>
+     * @param bool $var
+     * @return $this
+     */
+    public function setBoolValue($var)
+    {
+        GPBUtil::checkBool($var);
+        $this->writeOneof(4, $var);
+
+        return $this;
+    }
+
+    /**
+     * Represents a structured value.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Struct struct_value = 5;</code>
+     * @return \Google\Protobuf\Struct
+     */
+    public function getStructValue()
+    {
+        return $this->readOneof(5);
+    }
+
+    /**
+     * Represents a structured value.
+     *
+     * Generated from protobuf field <code>.google.protobuf.Struct struct_value = 5;</code>
+     * @param \Google\Protobuf\Struct $var
+     * @return $this
+     */
+    public function setStructValue($var)
+    {
+        GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class);
+        $this->writeOneof(5, $var);
+
+        return $this;
+    }
+
+    /**
+     * Represents a repeated `Value`.
+     *
+     * Generated from protobuf field <code>.google.protobuf.ListValue list_value = 6;</code>
+     * @return \Google\Protobuf\ListValue
+     */
+    public function getListValue()
+    {
+        return $this->readOneof(6);
+    }
+
+    /**
+     * Represents a repeated `Value`.
+     *
+     * Generated from protobuf field <code>.google.protobuf.ListValue list_value = 6;</code>
+     * @param \Google\Protobuf\ListValue $var
+     * @return $this
+     */
+    public function setListValue($var)
+    {
+        GPBUtil::checkMessage($var, \Google\Protobuf\ListValue::class);
+        $this->writeOneof(6, $var);
+
+        return $this;
+    }
+
+    /**
+     * @return string
+     */
+    public function getKind()
+    {
+        return $this->whichOneof("kind");
+    }
+
+}
+
diff --git a/vendor/google/protobuf/src/phpdoc.dist.xml b/vendor/google/protobuf/src/phpdoc.dist.xml
new file mode 100644
index 0000000..dd31302
--- /dev/null
+++ b/vendor/google/protobuf/src/phpdoc.dist.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!-- Install phpDocumentor to generate docs. -->
+<phpdoc>
+  <parser>
+    <target>doc</target>
+  </parser>
+  <transformer>
+    <target>doc</target>
+  </transformer>
+  <files>
+    <file>Google/Protobuf/Internal/MapField.php</file>
+    <file>Google/Protobuf/Internal/Message.php</file>
+    <file>Google/Protobuf/Internal/RepeatedField.php</file>
+  </files>
+</phpdoc>
