Code Monkey home page Code Monkey logo

laravel-pug's Introduction

Laravel Pug

Packagist GitHub Actions StyleCI codecov Code Climate License

A small package that adds support for compiling Pug (Jade) templates to Laravel via Pug.php (see complete documentation). Both vanilla php and Blade syntax is supported within the view.

This is the documentation for the ongoing version 2.0. Click here to load the documentation for 1.11

Installation

First you need composer if you haven't yet: https://getcomposer.org/download/

Now open a terminal at the root of your Laravel project. If it's a new project, create it with: composer create-project --prefer-dist laravel/laravel my-new-project (replace my-new-project with your own project name, see the documentation for further information)

Then run:

composer require bkwld/laravel-pug

Usage

Route::get('/', function () {
    return view('my-page');
});

Will now try to load views/my-page.pug first, or views/my-page.blade.pug or fallback to the default blade engine loading views/my-page.blade.php.

As with Blade, you can pass variables to your view:

Route::get('/', function () {
    return view('my-page', [
        'user' => Auth::user(),
        'messages' => ['Hello', 'Bye'],
    ]);
});

Any file with the extension .pug will be compiled as a pug template. Laravel Pug also registers the .pug.blade which also compile blade code once Pug code has been compiled; but we highly recommend you to use the clean and standard extension .pug that will be recognized by most systems. It compiles your Pug templates in the same way as Blade templates; the compiled template is put in your storage directory. Thus, you don't suffer compile times on every page load.

In other words, just put your Pug files in the regular views directory and name them like whatever.pug. You reference them in Laravel like normal such as view('home.whatever') for resources/views/home/whatever.pug.

The Pug view files can work side-by-side with regular PHP views.

Use Blade in Pug templates

This feature is designed for transition purpose, since every blade features are available in pug, you would not need both.

To use Blade templating within your Pug, just name the files with .blade.pug extensions.

Read more

Be aware that this mode will first render your template with pug, then give the output to render to blade, it means your template must have a valid pug syntax and must render a valid blade template. This also means blade directives are only available through pug text output, see the example below:

| @if ($one === 1)
div $one = 1
| @endif
p {{ $two }}

If you render this with the following values: ['one' => 1, 'two' => 2], you will get:

<div>$one = 1</div>
<p>2</p>

PS: note that you would get the same output with the following pure pug code:

if one === 1
  div $one = 1
p=two

Use in Lumen

Register the service in bootstrap/app.php (Register Service Providers section is the dedicated place):

$app->register(Bkwld\LaravelPug\ServiceProvider::class);

Then you can use it with view():

$router->get('/', function () use ($router) {
    // will render resources/views/test.pug
    return view('test', [
        'name' => 'Bob',
    ]);
});

Configuration

All Pug.php options are passed through via a Laravel config array file you can edit /config/laravel-pug.php

If for any reason, the config file is missing, just run the following command: php artisan vendor:publish --provider="Bkwld\LaravelPug\ServiceProvider"

Extending Layouts / Include Sub-views

Default root directory for templates is resources/views, so from any template any deep in the directory, you can use absolute paths to get other pug files from the root: extends /layouts/main will extends the file resources/views/layouts/main.pug, include /partial/foo/bar, will include resources/views/partial/foo/bar.pug. You can use the basedir option to set the root to an other directory. Paths that does not start with a slash will be resolved relatively to the current template file.

History

Read the Github project releases for release notes.

laravel-pug's People

Contributors

carusogabriel avatar emanuelecoppola avatar kylekatarnls avatar maxfromua avatar pinekta avatar rivsen avatar spekulatius avatar thelucre avatar weotch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-pug's Issues

Cache for production

Hello there 👋

Can someone please help me in this one: how can I cache compiled files to use in production, to improve storage and performance?

Thanks 😄

[Lumen 6.0] Unsupported Laravel Version

Actually, there's something breaking when checking the version. When you call $app->version(), Lumen 6.0 will actually returns "Lumen (6.0.2) (Laravel Components ^6.0)" (note that there's caret after "Laravel Components").

Interestingly, when this called on Laravel 6.0, that function would return "6.0.3" instead. Also in Lumen 6.0, it didn't have VERSION constant. I feels like there's some inconsistency with Laravel code here.

What do you think? Should this be issue on your package or this should be Laravel's problem?

Thanks,

Same variable name as in loop, causes unexpected behavior

I ran into this issue today where I passed ['bar' => $bar, 'foo' => $foo] to the view. Then when iterationg over $foo->bar as $bar, the $bar passed from the controller got replaced. Even after the loop.

ul
  for $bar in $foo->bars
    li #{ $bar }

section.info
  h1 #{ $bar->name }

$bar is now equal to $foo->bar.

Iteration

Where I can change expressionLanguage

PUG

- var values = [];
ul
  each val in values
    li= val

BLADE

@foreach ($views as $view)
           {{ $view->name }}
@endforeach

BKWLD/laravel-pug
I do not know if it's like that?

- var values = {{$views}};
ul
  each val in values
    li= val

Breaking changes

My project broken after composer update

Pug 3 has breaking changes.

In my case, in last pug version I was using PHP syntax in all except each loop, and in Pug 3 in need use PHP syntax in all.

Example in old pug:

each item in items
    tr
        td= $item->name

In pug 3, I need do:

each $item in $items
    tr
        td= $item->name

This is my breaking change, but are more in Pug 3.

I propose you change this package version thats use Pug 3 to 2.., that allow any person do composer update and doesn't break theirs projects.

Config does not work

Hi, today i've installed laravel-pug. I configured pug with these params but doest not work because is caching, has multiline and doesn't keep filename.

Following instructions i got:
[InvalidArgumentException]
Configuration not found.

Put following on app/config/packages/bkwld/laravel-pug/config.php not works. Config file is not included and config array's length is zero.

    'basedir' => resource_path('views')
    'cache'              => false,
    // 'stream'             => null,
    'extension'          => array('.jade'),
    'prettyprint'        => false,
    'phpSingleLine'      => true,
    'keepBaseName'       => true,
    // 'allowMixinOverride' => true,
    // 'allowMixedIndent'   => true,
    // 'keepNullAttributes' => false,
    // 'restrictedScope'    => false,
    // 'singleQuote'        => false,
    // 'filterAutoLoad'     => true,
    'indentSize'         => 2,
    'indentChar'         => ' ',
    // 'customKeywords'     => array(),
    // 'classAttribute'     => null,

Thanks, regards!

How to access functions through pug variable?

I am porting over existing blade templates to pug.
One of the patterns that is used extensively in the default authentication views bundled with the framework is the use of MessageBags, and a global $errors variable that can be accessed in any view.

I wanted to know how this could be converted into a pug template.

{{-- Show the errors, if any --}}
@if ($errors->any())
    <div class="callout">
        <h4>Errors</h4>
        <ul>
            @foreach($errors->all() as $error)
                <li>{{ $error }}</li>
            @endforeach
        </ul>
    </div>
@endif

As you can see, it accesses the errors objects, runs the any() method which returns an array of error messages as strings and then loops over the messages and outputs them to a list.

I have tried the following:

    if errors
        .callout
            h4 Errors
            ul
            each error in errors.all()
               li=error

However, it seems I cannot access the all method in this way. Am I doing this incorrectly?

Another issue with the Exception Class

Hi, on another project of mine I get this Exception

Class 'Facade\Ignition\Exceptions\ViewException' not found 

The project runs on Laravel version 5.8.

Ternary Operator issue

The Pug code like below:

mixin avatar_img(default_src)
  - var _default_src = default_src || 'default-xxx.png'
  img(src=$userinfo['user_thumb'] ? $userinfo['user_thumb'] : _default_src)

When I call the mixin with +avatar_img('abc') or +avatar_img(), I got the error like below:

Use of undefined constant _default_src - assumed '_default_src' (View: xxx\xxxx\index.pug)

It looks like did not support the ternary operator like a ? b : (c ? d : 'xxx') or a ? b : ( c || 'xxx').

Thanks.

Indent of blade code

Consider I have this blade code in my template:

...

@if (Route::has('login'))
    <div class="top-right links">
        @if (Auth::check())
            <a href="{{ url('/home') }}">Home</a>
        @else
            <a href="{{ url('/login') }}">Login</a>
            <a href="{{ url('/register') }}">Register</a>
        @endif
    </div>
@endif

...

which looks like this in pug:

...

@if (Route::has('login'))
div.top-right.links
@if (Auth::check())
a(href="{{ url('/home') }}") Home
@else
a(href="{{ url('/login') }}") Login
a(href="{{ url('/register') }}") Register
@endif
@endif

...

For the sake of better structure I like to indent the blade keywords here too, so that I have the snippet which looks like:

@if (Route::has('login'))
    div.top-right.links
    @if (Auth::check())
        a(href="{{ url('/home') }}") Home
    @else
        a(href="{{ url('/login') }}") Login
        a(href="{{ url('/register') }}") Register
    @endif
@endif

However, I get a ErrorException in Parser.php line 248: (24) : Unexpected token "indent" error

Is there a workaround or hidden feature in pug?

extend pug.blade

Hello, is it possible to extend a pug.blade file? So that legacy layouts can remain usable, but also extendable.

So as to be able to do something like this:

@extends('layouts/admin')
include /cltvo/front/my-pug-mixins.pug

@section('content')
block content
@endsection

How to call static methods in Pug 3?

@kylekatarnls is it no longer possible in version 3 of https://github.com/pug-php/pug to call static methods from pug? Like Laravel facade methods?

For instance:

html
  head
    title= Layout::title()

This currently errors with:

Parse error: syntax error, unexpected ';', expecting ',' or ')'

The compiled PHP looks like:

<title><?= htmlspecialchars((is_bool($_pug_temp = (isset($Layout) ? $Layout : null);
(function_exists('title') ? title() : call_user_func((isset($title) ? $title : null)))) ? var_export($_pug_temp, true) : $_pug_temp)) ?></title>

Do I have to use the share() helper function? https://github.com/pug-php/pug#php-helpers-functions

laravel-pug is now compatibile with Lumen!

@weotch You can add the lumen tag to this project and maybe change the description:

Pug view adapter for Laravel and Lumen

I will just wait for the unit tests results before tagging a version with the new Lumen compatibility.

PhpStorm

Hello, how can I get help with all the Laravel methods and global variables inside a .pug or .pug.blade file? if I use
:php dd(app())
It works and shows the app() data, but how can I get help as when I'm Working with Blade?

lots of php code in my output

Hello,

I’m quite new to laravel, pug, phug, composer and all that stuff … but I like it! so thanks to you for building this bridge to pug.

What I don’t understand is, why the compiled file in the storage/framework/views folder contains so much php code?

Here is my *.pug file:

doctype html
html
	head
		meta(charset="UTF-8")
		title test
	body
		h1 hello
		p.
			what about that crazy php lines in the compiled file?

and it compiles to:

<?php $pugModule = [
  'Phug\\Formatter\\Format\\HtmlFormat::dependencies_storage' => 'pugModule',
  'Phug\\Formatter\\Format\\HtmlFormat::helper_prefix' => 'Phug\\Formatter\\Format\\HtmlFormat::',
  'Phug\\Formatter\\Format\\HtmlFormat::get_helper' => function ($name) use (&$pugModule) {
    $dependenciesStorage = $pugModule['Phug\\Formatter\\Format\\HtmlFormat::dependencies_storage'];
    $prefix = $pugModule['Phug\\Formatter\\Format\\HtmlFormat::helper_prefix'];
    $format = $pugModule['Phug\\Formatter\\Format\\HtmlFormat::dependencies_storage'];

                            if (!isset($$dependenciesStorage)) {
                                return $format->getHelper($name);
                            }

                            $storage = $$dependenciesStorage;

                            if (!array_key_exists($prefix.$name, $storage) &&
                                !isset($storage[$prefix.$name])
                            ) {
                                throw new \Exception(
                                    var_export($name, true).
                                    ' dependency not found in the namespace: '.
                                    var_export($prefix, true)
                                );
                            }

                            return $storage[$prefix.$name];
                        },
  'Phug\\Formatter\\Format\\HtmlFormat::pattern' => function ($pattern) use (&$pugModule) {

                    $args = func_get_args();
                    $function = 'sprintf';
                    if (is_callable($pattern)) {
                        $function = $pattern;
                        $args = array_slice($args, 1);
                    }

                    return call_user_func_array($function, $args);
                },
  'Phug\\Formatter\\Format\\HtmlFormat::patterns.html_text_escape' => 'htmlspecialchars',
  'Phug\\Formatter\\Format\\HtmlFormat::pattern.html_text_escape' => function () use (&$pugModule) {
    $proceed = $pugModule['Phug\\Formatter\\Format\\HtmlFormat::pattern'];
    $pattern = $pugModule['Phug\\Formatter\\Format\\HtmlFormat::patterns.html_text_escape'];

                    $args = func_get_args();
                    array_unshift($args, $pattern);

                    return call_user_func_array($proceed, $args);
                },
  'Phug\\Formatter\\Format\\HtmlFormat::available_attribute_assignments' => array (
  0 => 'class',
  1 => 'style',
),
  'Phug\\Formatter\\Format\\HtmlFormat::patterns.attribute_pattern' => ' %s="%s"',
  'Phug\\Formatter\\Format\\HtmlFormat::pattern.attribute_pattern' => function () use (&$pugModule) {
    $proceed = $pugModule['Phug\\Formatter\\Format\\HtmlFormat::pattern'];
    $pattern = $pugModule['Phug\\Formatter\\Format\\HtmlFormat::patterns.attribute_pattern'];

                    $args = func_get_args();
                    array_unshift($args, $pattern);

                    return call_user_func_array($proceed, $args);
                },
  'Phug\\Formatter\\Format\\HtmlFormat::patterns.boolean_attribute_pattern' => ' %s',
  'Phug\\Formatter\\Format\\HtmlFormat::pattern.boolean_attribute_pattern' => function () use (&$pugModule) {
    $proceed = $pugModule['Phug\\Formatter\\Format\\HtmlFormat::pattern'];
    $pattern = $pugModule['Phug\\Formatter\\Format\\HtmlFormat::patterns.boolean_attribute_pattern'];

                    $args = func_get_args();
                    array_unshift($args, $pattern);

                    return call_user_func_array($proceed, $args);
                },
  'Phug\\Formatter\\Format\\HtmlFormat::attribute_assignments' => function (&$attributes, $name, $value) use (&$pugModule) {
    $availableAssignments = $pugModule['Phug\\Formatter\\Format\\HtmlFormat::available_attribute_assignments'];
    $getHelper = $pugModule['Phug\\Formatter\\Format\\HtmlFormat::get_helper'];

                    if (!in_array($name, $availableAssignments)) {
                        return $value;
                    }

                    $helper = $getHelper($name.'_attribute_assignment');

                    return $helper($attributes, $value);
                },
  'Phug\\Formatter\\Format\\HtmlFormat::attribute_assignment' => function (&$attributes, $name, $value) use (&$pugModule) {
    $attributeAssignments = $pugModule['Phug\\Formatter\\Format\\HtmlFormat::attribute_assignments'];

                    if (isset($name) && $name !== '') {
                        $result = $attributeAssignments($attributes, $name, $value);
                        if (($result !== null && $result !== false && ($result !== '' || $name !== 'class'))) {
                            $attributes[$name] = $result;
                        }
                    }
                },
  'Phug\\Formatter\\Format\\HtmlFormat::merge_attributes' => function () use (&$pugModule) {
    $attributeAssignment = $pugModule['Phug\\Formatter\\Format\\HtmlFormat::attribute_assignment'];

                    $attributes = [];
                    foreach (array_filter(func_get_args(), 'is_array') as $input) {
                        foreach ($input as $name => $value) {
                            $attributeAssignment($attributes, $name, $value);
                        }
                    }

                    return $attributes;
                },
  'Phug\\Formatter\\Format\\HtmlFormat::attributes_mapping' => array (
),
  'Phug\\Formatter\\Format\\HtmlFormat::attributes_assignment' => function () use (&$pugModule) {
    $attrMapping = $pugModule['Phug\\Formatter\\Format\\HtmlFormat::attributes_mapping'];
    $mergeAttr = $pugModule['Phug\\Formatter\\Format\\HtmlFormat::merge_attributes'];
    $pattern = $pugModule['Phug\\Formatter\\Format\\HtmlFormat::pattern'];
    $escape = $pugModule['Phug\\Formatter\\Format\\HtmlFormat::pattern.html_text_escape'];
    $attr = $pugModule['Phug\\Formatter\\Format\\HtmlFormat::pattern.attribute_pattern'];
    $bool = $pugModule['Phug\\Formatter\\Format\\HtmlFormat::pattern.boolean_attribute_pattern'];

                        $attributes = call_user_func_array($mergeAttr, func_get_args());
                        $code = '';
                        foreach ($attributes as $originalName => $value) {
                            if ($value !== null && $value !== false && ($value !== '' || $originalName !== 'class')) {
                                $name = isset($attrMapping[$originalName])
                                    ? $attrMapping[$originalName]
                                    : $originalName;
                                if ($value === true) {
                                    $code .= $pattern($bool, $name, $name);

                                    continue;
                                }
                                if (is_array($value) || is_object($value) &&
                                    !method_exists($value, '__toString')) {
                                    $value = json_encode($value);
                                }

                                $code .= $pattern($attr, $name, $value);
                            }
                        }

                        return $code;
                    },
  'Phug\\Formatter\\Format\\HtmlFormat::class_attribute_assignment' => function (&$attributes, $value) use (&$pugModule) {

            $split = function ($input) {
                return preg_split('/(?<![\[\{\<\=\%])\s+(?![\]\}\>\=\%])/', strval($input));
            };
            $classes = isset($attributes['class']) ? array_filter($split($attributes['class'])) : [];
            foreach ((array) $value as $key => $input) {
                if (!is_string($input) && is_string($key)) {
                    if (!$input) {
                        continue;
                    }

                    $input = $key;
                }
                foreach ($split($input) as $class) {
                    if (!in_array($class, $classes)) {
                        $classes[] = $class;
                    }
                }
            }

            return implode(' ', $classes);
        },
  'Phug\\Formatter\\Format\\HtmlFormat::style_attribute_assignment' => function (&$attributes, $value) use (&$pugModule) {

            if (is_string($value) && mb_substr($value, 0, 7) === '{&quot;') {
                $value = json_decode(htmlspecialchars_decode($value));
            }
            $styles = isset($attributes['style']) ? array_filter(explode(';', $attributes['style'])) : [];
            foreach ((array) $value as $propertyName => $propertyValue) {
                if (!is_int($propertyName)) {
                    $propertyValue = $propertyName.':'.$propertyValue;
                }
                $styles[] = $propertyValue;
            }

            return implode(';', $styles);
        },
]; ?><?php 
\Phug\Renderer\Profiler\ProfilerModule::recordProfilerDisplayEvent(11);
// PUG_DEBUG:11
 ?><?php 
\Phug\Renderer\Profiler\ProfilerModule::recordProfilerDisplayEvent(0);
// PUG_DEBUG:0
 ?><!DOCTYPE html><?php 
\Phug\Renderer\Profiler\ProfilerModule::recordProfilerDisplayEvent(10);
// PUG_DEBUG:10
 ?><html><?php 
\Phug\Renderer\Profiler\ProfilerModule::recordProfilerDisplayEvent(4);
// PUG_DEBUG:4
 ?><head><?php 
\Phug\Renderer\Profiler\ProfilerModule::recordProfilerDisplayEvent(1);
// PUG_DEBUG:1
 ?><meta<?= (is_bool($_pug_temp = $pugModule['Phug\\Formatter\\Format\\HtmlFormat::attributes_assignment'](array(  ), ['charset' => 'UTF-8'])) ? var_export($_pug_temp, true) : $_pug_temp) ?>><?php 
\Phug\Renderer\Profiler\ProfilerModule::recordProfilerDisplayEvent(3);
// PUG_DEBUG:3
 ?><title><?php 
\Phug\Renderer\Profiler\ProfilerModule::recordProfilerDisplayEvent(2);
// PUG_DEBUG:2
 ?>test</title></head><?php 
\Phug\Renderer\Profiler\ProfilerModule::recordProfilerDisplayEvent(9);
// PUG_DEBUG:9
 ?><body><?php 
\Phug\Renderer\Profiler\ProfilerModule::recordProfilerDisplayEvent(6);
// PUG_DEBUG:6
 ?><h1><?php 
\Phug\Renderer\Profiler\ProfilerModule::recordProfilerDisplayEvent(5);
// PUG_DEBUG:5
 ?>hello</h1><?php 
\Phug\Renderer\Profiler\ProfilerModule::recordProfilerDisplayEvent(8);
// PUG_DEBUG:8
 ?><p><?php 
\Phug\Renderer\Profiler\ProfilerModule::recordProfilerDisplayEvent(7);
// PUG_DEBUG:7
 ?>what about that crazy php lines in the compiled file?</p></body></html>

But I only want it to compile simply to:

<!DOCTYPE html><html><head><meta charset="UTF-8"><title>test</title></head><body><h1>hello</h1><p>what about that crazy php lines in the compiled file?</p></body></html>

Why is that?
What do I overlook?

Seems like it is in debug-mode … ?

THX!

composer update issue

After adding a dependency composer require bkwld/laravel-pug I get questions whether to install node packages but to which I answer Y and after it said that it is added to be installed with npm. It NEVER adds to composer.json extra field of my Laravel project and every time I do composer update it keeps asking same questions over and over.

Some extra details:

Environment: Laravel Homestead on Vagrant (latest version)
I use yarn instead of npm update but should still work.
php v7.2
Terminal output:

The node package [jstransformer] can be installed:
It allows you to use any jstransformer npm package as filter by adding it in your extra.npm section of composer.json.
Would you like to install/update it? (if you're not sure, you can safely press Y to get the package ready to use if you need it later) [Y/N] y
The node package [pug-cli] can be installed:
It allows you to use the native JS pug engine instead of the default PHP one with the `pugjs` option set to `true`
Would you like to install/update it? (if you're not sure, you can safely press Y to get the package ready to use if you need it later) [Y/N] y
The node package [less] can be installed:
It allows you to use less filter and link less files inside minify/concat tags.
Would you like to install/update it? (if you're not sure, you can safely press Y to get the package ready to use if you need it later) [Y/N] y
The node package [clean-css] can be installed:
It allows you to use minify option on CSS files and contents (recommended in production).
Would you like to install/update it? (if you're not sure, you can safely press Y to get the package ready to use if you need it later) [Y/N] y
The node package [stylus] can be installed:
It allows you to use stylus filter and link stylus files inside minify/concat tags.
Would you like to install/update it? (if you're not sure, you can safely press Y to get the package ready to use if you need it later) [Y/N] y
The node package [coffee-script] can be installed:
It allows you to use coffee-script filter and coffee-script files inside minify/concat tags.
Would you like to install/update it? (if you're not sure, you can safely press Y to get the package ready to use if you need it later) [Y/N] y
The node package [babel-cli] can be installed:
It allows you to use react/jsx filter and react/jsx files inside minify/concat tags.
Would you like to install/update it? (if you're not sure, you can safely press Y to get the package ready to use if you need it later) [Y/N] y
The node package [babel-plugin-transform-react-jsx] can be installed:
It allows you to use react/jsx filter and react/jsx files inside minify/concat tags.
Would you like to install/update it? (if you're not sure, you can safely press Y to get the package ready to use if you need it later) [Y/N] y
The node package [babel-preset-es2015] can be installed:
It allows you to use react/jsx filter and react/jsx files inside minify/concat tags.
Would you like to install/update it? (if you're not sure, you can safely press Y to get the package ready to use if you need it later) [Y/N] y
The node package [babel-preset-react] can be installed:
It allows you to use react/jsx filter and react/jsx files inside minify/concat tags.
Would you like to install/update it? (if you're not sure, you can safely press Y to get the package ready to use if you need it later) [Y/N] y
The node package [uglify-js] can be installed:
It allows you to use minify option on JS files and contents (recommended in production).
Would you like to install/update it? (if you're not sure, you can safely press Y to get the package ready to use if you need it later) [Y/N] y
Package added to be installed/updated with npm: jstransformer@"^1.0.0"
Package added to be installed/updated with npm: coffee-script@"*"
Package added to be installed/updated with npm: less@"*"
Package added to be installed/updated with npm: clean-css@"*"
Package added to be installed/updated with npm: babel-cli@"^6.10.1"
Package added to be installed/updated with npm: babel-plugin-transform-react-jsx@"^6.8.0"
Package added to be installed/updated with npm: babel-preset-es2015@"^6.8.0"
Package added to be installed/updated with npm: babel-preset-react@"^6.11.1"
Package added to be installed/updated with npm: stylus@"*"
Package added to be installed/updated with npm: uglify-js@"*"
Package added to be installed/updated with npm: clean-css@"*"
Package added to be installed/updated with npm: pug-cli@"^1.0.0-alpha6"
Packages installed.

Any ideas?

Assets management

pug-symfony embed pug-assets and pug-minify

This stack allow any symfony user to have less, stylus, coffee and jsx files right in templates with no more install:

doctype 5
html
  head
    title Foo
    minify top
      script(src="foo/test.js")
      script(src="coffee/test.coffee")
      script(src="react-pug/test.jsxp" type="text/babel")
      link(rel="stylesheet" href="foo/test.css")
      link(rel="stylesheet" href="less/test.less")
      link(rel="stylesheet" href="stylus/test.styl")
      meta(name="foo" content="bar")
  body
    h1 Foobar
    minify bottom
      script(src="react/test.jsx" type="text/babel")
      script(src="coffee-pug/test.cofp")
      //- some comment

It also permit to concat and minify scripts and styles in production and provide a command to build all assets on deploy: php bin/console assets:publish --env=prod

I propose to implement the same feature in laravel-pug. What do you think about it?

Options blade in pure pug

Sorry for this beginner question I'm a novice @kylekatarnls.

I'm using only pug as you advised me. But I do not know how you can use this type of options that we offer balde

link(rel='stylesheet', href='{{ URL::asset('css/main.css') }}')
html(lang="{{ app()->getLocale() }}")

Using @ directives in js mode

How do I use @error or @guest or @auth or things like that in js pug mode?

for example something like this

@error('email')
	<span class="invalid-feedback" role="alert">
		<strong>{{ $message }}</strong>
	</span>
@enderror

how to minify

Thanks for this works very well, you can modify the file.pug

View::compose() doesn't pass data to pug partials

Laravel version: 5.4

app/Http/Composers/CurrentUserComposer

<?php namespace App\Http\Composers;
 
use Illuminate\Http\Request;
use Auth;
use App\User;
use Illuminate\View\View;
 
class CurrentUserComposer
 {
     public function compose(View $view)
     {
          $view->with('user', Auth::user());
     }
 }

app/Providers/ComposerServiceProvider.php

View::composer('admin.dashboard', 'App\Http\Composers\CurrentUserComposer');
^ Passes $user to the admin.dashboard.pug template

View::composer('admin.partials.header', 'App\Http\Composers\CurrentUserComposer');
^ But this doesn't send $user to the admin.partials.header.pug partial

The partial is rendering when called with include in the master layout, but the data isn't being passed.

1.1 does not have the basedir config default value

For reasons I can't explain my /config/pug.php is not getting picked up at render time. When I tinker in the terminal the configurations seem to be there, but when I load the page I get the "The 'basedir' option need to be set to use absolute path like..." message. My fix was to manually add the line that's in the current master branch in config.php that has the basedir, but that does not appear in the 1.1 release. A quick solution would be to do a release that has the basedir in the config, though I'm still not clear why my config isn't loading (I'm new to Laravel, so learning how to debug such things in order to solve this problem). I'm on Laravel 5.3.29.

How to pass variables using View::composer()?

Hello,

I try to use View::composer to share variables to specific view, but it not working.

View::share('myvar', 'myval'); // is working as well but share the variable to all view.

View::composer('partials._footer', function ($view) {
            $view->with('myvar', 'myval');
}); // This code is not working

My pug view is called in another pug file like :

footer
    include /partials/_footer

I also tried that code as suggest in #23 but it's not working too :
footer!= view('partials._footer')

Thank you for your help,

Ben.

Error Page Render Error on Laravel 6.0.1

Hi,

the error pages don't render properly in development mode witrh the new Laravel 6.0.1

All I get is:
\n"},a.fence=function(t,e,n,r,a){var s,c,u,l,f=t[e],p=f.info?o(f.info).trim():"",d="";return p&&(d=p.split(/\s+/g)[0]),0===(s=n.highlight&&n.highlight(f.content,d)||i(f.content)).indexOf(""+s+"\n"):"

"+s+"

\n"},a.image=function(t,e,n,r,o){var i=t[e];return i.attrs[i.attrIndex("alt")][1]=o.renderInlineAsText(i.children,n,r),o.renderToken(t,e,n)},a.hardbreak=function(t,e,n){return n.xhtmlOut?"
\n":"
\n"},a.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?"
\n":"
\n":"\n"},a.text=function(t,e){return i(t[e].content)},a.html_block=function(t,e){return t[e].content},a.html_inline=function(t,e){return t[e].content},s.prototype.renderAttrs=function(t){var e,n,r;if(!t.attrs)return"";for(r="",e=0,n=t.attrs.length;e\n":">")},s.prototype.renderInline=function(t,e,n){for(var r,o="",i=this.rules,a=0,s=t.length;a/i.test(t)}t.exports=function(t){var e,n,i,a,s,c,u,l,f,p,d,h,m,v,g,b,y,_,E=t.tokens;if(t.md.options.linkify)for(n=0,i=E.length;n=0;e--)if("link_close"!==(c=a[e]).type){if("html_inline"===c.type&&(_=c.content,/^\s]/i.test(_)&&m>0&&m--,o(c.content)&&m++),!(m>0)&&"text"===c.type&&t.md.linkify.test(c.content)){for(f=c.content,y=t.md.linkify.match(f),u=[],h=c.level,d=0,l=0;ld&&((s=new t.Token("text","",0)).content=f.slice(d,p),s.level=h,u.push(s)),(s=new t.Token("link_open","a",1)).attrs=[["href",g]],s.level=h++,s.markup="linkify",s.info="auto",u.push(s),(s=new t.Token("text","",0)).content=b,s.level=h,u.push(s),(s=new t.Token("link_close","a",-1)).level=--h,s.markup="linkify",s.info="auto",u.push(s),d=y[l].lastIndex);d=0;e--)"text"!==(n=t[e]).type||r||(n.content=n.content.replace(i,s)),"link_open"===n.type&&"auto"===n.info&&r--,"link_close"===n.type&&"auto"===n.info&&r++}function u(t){var e,n,o=0;for(e=t.length-1;e>=0;e--)"text"!==(n=t[e]).type||o||r.test(n.content)&&(n.content=n.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2")),"link_open"===n.type&&"auto"===n.info&&o--,"link_close"===n.type&&"auto"===n.info&&o++}t.exports=function(t){var e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)"inline"===t.tokens[e].type&&(o.test(t.tokens[e].content)&&c(t.tokens[e].children),r.test(t.tokens[e].content)&&u(t.tokens[e].children))}},function(t,e,n){"use strict";var r=n(1).isWhiteSpace,o=n(1).isPunctChar,i=n(1).isMdAsciiPunct,a=/['"]/,s=/['"]/g,c="’";function u(t,e,n){return t.substr(0,e)+n+t.substr(e+1)}function l(t,e){var n,a,l,f,p,d,h,m,v,g,b,y,_,E,k,x,C,w,A,T,S;for(A=[],n=0;n=0&&!(A[C].level<=h);C--);if(A.length=C+1,"text"===a.type){p=0,d=(l=a.content).length;t:for(;p=0)v=l.charCodeAt(f.index-1);else for(C=n-1;C>=0&&("softbreak"!==t[C].type&&"hardbreak"!==t[C].type);C--)if("text"===t[C].type){v=t[C].content.charCodeAt(t[C].content.length-1);break}if(g=32,p=48&&v<=57&&(x=k=!1),k&&x&&(k=!1,x=y),k||x){if(x)for(C=A.length-1;C>=0&&(m=A[C],!(A[C].level=0;e--)"inline"===t.tokens[e].type&&a.test(t.tokens[e].content)&&l(t.tokens[e].children,t)}},function(t,e,n){"use strict";var r=n(38);function o(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}o.prototype.Token=r,t.exports=o},function(t,e,n){"use strict";var r=n(37),o=[["table",n(121),["paragraph","reference"]],["code",n(122)],["fence",n(123),["paragraph","reference","blockquote","list"]],["blockquote",n(124),["paragraph","reference","blockquote","list"]],["hr",n(125),["paragraph","reference","blockquote","list"]],["list",n(126),["paragraph","reference","blockquote"]],["reference",n(127)],["heading",n(128),["paragraph","reference","blockquote"]],["lheading",n(129)],["html_block",n(130),["paragraph","reference","blockquote"]],["paragraph",n(132)]];function i(){this.ruler=new r;for(var t=0;t=n))&&!(t.sCount[a]=c){t.line=n;break}for(r=0;rn)return!1;if(f=e+1,t.sCount[f]=4)return!1;if((u=t.bMarks[f]+t.tShift[f])>=t.eMarks[f])return!1;if(124!==(s=t.src.charCodeAt(u++))&&45!==s&&58!==s)return!1;for(;u=4)return!1;if((d=(p=i(c.replace(/^\||\|$/g,""))).length)>m.length)return!1;if(a)return!0;for((h=t.push("table_open","table",1)).map=g=[e,0],(h=t.push("thead_open","thead",1)).map=[e,e+1],(h=t.push("tr_open","tr",1)).map=[e,e+1],l=0;l=4);f++){for(p=i(c.replace(/^\||\|$/g,"")),h=t.push("tr_open","tr",1),l=0;l=4))break;o=++r}return t.line=o,(i=t.push("code_block","code",0)).content=t.getLines(e,o,4+t.blkIndent,!0),i.map=[e,t.line],!0}},function(t,e,n){"use strict";t.exports=function(t,e,n,r){var o,i,a,s,c,u,l,f=!1,p=t.bMarks[e]+t.tShift[e],d=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(p+3>d)return!1;if(126!==(o=t.src.charCodeAt(p))&&96!==o)return!1;if(c=p,(i=(p=t.skipChars(p,o))-c)<3)return!1;if(l=t.src.slice(c,p),a=t.src.slice(p,d),96===o&&a.indexOf(String.fromCharCode(o))>=0)return!1;if(r)return!0;for(s=e;!(++s>=n)&&!((p=c=t.bMarks[s]+t.tShift[s])<(d=t.eMarks[s])&&t.sCount[s]=4||(p=t.skipChars(p,o))-c=4)return!1;if(62!==t.src.charCodeAt(A++))return!1;if(o)return!0;for(c=d=t.sCount[e]+A-(t.bMarks[e]+t.tShift[e]),32===t.src.charCodeAt(A)?(A++,c++,d++,i=!1,_=!0):9===t.src.charCodeAt(A)?(_=!0,(t.bsCount[e]+d)%4==3?(A++,c++,d++,i=!1):i=!0):_=!1,h=[t.bMarks[e]],t.bMarks[e]=A;A=T,b=[t.sCount[e]],t.sCount[e]=d-c,y=[t.tShift[e]],t.tShift[e]=A-t.bMarks[e],k=t.md.block.ruler.getRules("blockquote"),g=t.parentType,t.parentType="blockquote",C=!1,p=e+1;p=(T=t.eMarks[p])));p++)if(62!==t.src.charCodeAt(A++)||C){if(l)break;for(E=!1,s=0,u=k.length;s=T,m.push(t.bsCount[p]),t.bsCount[p]=t.sCount[p]+1+(_?1:0),b.push(t.sCount[p]),t.sCount[p]=d-c,y.push(t.tShift[p]),t.tShift[p]=A-t.bMarks[p]}for(v=t.blkIndent,t.blkIndent=0,(x=t.push("blockquote_open","blockquote",1)).markup=">",x.map=f=[e,0],t.md.block.tokenize(t,e,p),(x=t.push("blockquote_close","blockquote",-1)).markup=">",t.lineMax=w,t.parentType=g,f[1]=t.line,s=0;s=4)return!1;if(42!==(i=t.src.charCodeAt(u++))&&45!==i&&95!==i)return!1;for(a=1;u=a)return-1;if((n=t.src.charCodeAt(i++))<48||n>57)return-1;for(;;){if(i>=a)return-1;if(!((n=t.src.charCodeAt(i++))>=48&&n<=57)){if(41===n||46===n)break;return-1}if(i-o>=10)return-1}return i=4)return!1;if(t.listIndent>=0&&t.sCount[e]-t.listIndent>=4&&t.sCount[e]=t.blkIndent&&(D=!0),(S=i(t,e))>=0){if(p=!0,O=t.bMarks[e]+t.tShift[e],b=Number(t.src.substr(O,S-O-1)),D&&1!==b)return!1}else{if(!((S=o(t,e))>=0))return!1;p=!1}if(D&&t.skipSpaces(S)>=t.eMarks[e])return!1;if(g=t.src.charCodeAt(S-1),r)return!0;for(v=t.tokens.length,p?(I=t.push("ordered_list_open","ol",1),1!==b&&(I.attrs=[["start",b]])):I=t.push("bullet_list_open","ul",1),I.map=m=[e,0],I.markup=String.fromCharCode(g),_=e,R=!1,N=t.md.block.ruler.getRules("list"),x=t.parentType,t.parentType="list";_=y?1:E-f)>4&&(l=1),u=f+l,(I=t.push("list_item_open","li",1)).markup=String.fromCharCode(g),I.map=d=[e,0],A=t.tight,w=t.tShift[e],C=t.sCount[e],k=t.listIndent,t.listIndent=t.blkIndent,t.blkIndent=u,t.tight=!0,t.tShift[e]=s-t.bMarks[e],t.sCount[e]=E,s>=y&&t.isEmpty(e+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,e,n,!0),t.tight&&!R||(M=!1),R=t.line-e>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=k,t.tShift[e]=w,t.sCount[e]=C,t.tight=A,(I=t.push("list_item_close","li",-1)).markup=String.fromCharCode(g),_=e=t.line,d[1]=_,s=t.bMarks[e],_>=n)break;if(t.sCount[_]=4)break;for(L=!1,c=0,h=N.length;c=4)return!1;if(91!==t.src.charCodeAt(x))return!1;for(;++x3||t.sCount[w]<0)){for(y=!1,f=0,p=_.length;f=4)return!1;if(35!==(i=t.src.charCodeAt(u))||u>=l)return!1;for(a=1,i=t.src.charCodeAt(++u);35===i&&u6||uu&&r(t.src.charCodeAt(s-1))&&(l=s),t.line=e+1,(c=t.push("heading_open","h"+String(a),1)).markup="########".slice(0,a),c.map=[e,t.line],(c=t.push("inline","",0)).content=t.src.slice(u,l).trim(),c.map=[e,t.line],c.children=[],(c=t.push("heading_close","h"+String(a),-1)).markup="########".slice(0,a),!0))}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r,o,i,a,s,c,u,l,f,p,d=e+1,h=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;for(p=t.parentType,t.parentType="paragraph";d3)){if(t.sCount[d]>=t.blkIndent&&(c=t.bMarks[d]+t.tShift[d])<(u=t.eMarks[d])&&(45===(f=t.src.charCodeAt(c))||61===f)&&(c=t.skipChars(c,f),(c=t.skipSpaces(c))>=u)){l=61===f?1:2;break}if(!(t.sCount[d]<0)){for(o=!1,i=0,a=h.length;i|$))/i,/<\/(script|pre|style)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(o.source+"\\s*$"),/^$/,!1]];t.exports=function(t,e,n,r){var o,a,s,c,u=t.bMarks[e]+t.tShift[e],l=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(!t.md.options.html)return!1;if(60!==t.src.charCodeAt(u))return!1;for(c=t.src.slice(u,l),o=0;o3||t.sCount[c]<0)){for(r=!1,o=0,i=u.length;o0&&this.level++,this.tokens.push(o),o},i.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},i.prototype.skipEmptyLines=function(t){for(var e=this.lineMax;te;)if(!o(this.src.charCodeAt(--t)))return t+1;return t},i.prototype.skipChars=function(t,e){for(var n=this.src.length;tn;)if(e!==this.src.charCodeAt(--t))return t+1;return t},i.prototype.getLines=function(t,e,n,r){var i,a,s,c,u,l,f,p=t;if(t>=e)return"";for(l=new Array(e-t),i=0;pn?new Array(a-n+1).join(" ")+this.src.slice(c,u):this.src.slice(c,u)}return l.join("")},i.prototype.Token=r,t.exports=i},function(t,e,n){"use strict";var r=n(37),o=[["text",n(135)],["newline",n(136)],["escape",n(137)],["backticks",n(138)],["strikethrough",n(60).tokenize],["emphasis",n(61).tokenize],["link",n(139)],["image",n(140)],["autolink",n(141)],["html_inline",n(142)],["entity",n(143)]],i=[["balance_pairs",n(144)],["strikethrough",n(60).postProcess],["emphasis",n(61).postProcess],["text_collapse",n(145)]];function a(){var t;for(this.ruler=new r,t=0;t=i)break}else t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()},a.prototype.parse=function(t,e,n,r){var o,i,a,s=new this.State(t,e,n,r);for(this.tokenize(s),a=(i=this.ruler2.getRules("")).length,o=0;o=0&&32===t.pending.charCodeAt(n)?n>=1&&32===t.pending.charCodeAt(n-1)?(t.pending=t.pending.replace(/ +$/,""),t.push("hardbreak","br",0)):(t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0)):t.push("softbreak","br",0)),i++;i?@[]^_`{|}~-".split("").forEach(function(t){o[t.charCodeAt(0)]=1}),t.exports=function(t,e){var n,i=t.pos,a=t.posMax;if(92!==t.src.charCodeAt(i))return!1;if(++i=m)return!1;for(v=u,(l=t.md.helpers.parseLinkDestination(t.src,u,t.posMax)).ok&&(d=t.md.normalizeLink(l.str),t.md.validateLink(d)?u=l.pos:d=""),v=u;u=m||41!==t.src.charCodeAt(u))&&(g=!0),u++}if(g){if(void 0===t.env.references)return!1;if(u=0?a=t.src.slice(v,u++):u=s+1):u=s+1,a||(a=t.src.slice(c,s)),!(f=t.env.references[r(a)]))return t.pos=h,!1;d=f.href,p=f.title}return e||(t.pos=c,t.posMax=s,t.push("link_open","a",1).attrs=n=[["href",d]],p&&n.push(["title",p]),t.md.inline.tokenize(t),t.push("link_close","a",-1)),t.pos=u,t.posMax=m,!0}},function(t,e,n){"use strict";var r=n(1).normalizeReference,o=n(1).isSpace;t.exports=function(t,e){var n,i,a,s,c,u,l,f,p,d,h,m,v,g="",b=t.pos,y=t.posMax;if(33!==t.src.charCodeAt(t.pos))return!1;if(91!==t.src.charCodeAt(t.pos+1))return!1;if(u=t.pos+2,(c=t.md.helpers.parseLinkLabel(t,t.pos+1,!1))<0)return!1;if((l=c+1)=y)return!1;for(v=l,(p=t.md.helpers.parseLinkDestination(t.src,l,t.posMax)).ok&&(g=t.md.normalizeLink(p.str),t.md.validateLink(g)?l=p.pos:g=""),v=l;l=y||41!==t.src.charCodeAt(l))return t.pos=b,!1;l++}else{if(void 0===t.env.references)return!1;if(l=0?s=t.src.slice(v,l++):l=c+1):l=c+1,s||(s=t.src.slice(u,c)),!(f=t.env.references[r(s)]))return t.pos=b,!1;g=f.href,d=f.title}return e||(a=t.src.slice(u,c),t.md.inline.parse(a,t.md,t.env,m=[]),(h=t.push("image","img",0)).attrs=n=[["src",g],["alt",""]],h.children=m,h.content=a,d&&n.push(["title",d])),t.pos=l,t.posMax=y,!0}},function(t,e,n){"use strict";var r=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,o=/^<([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)>/;t.exports=function(t,e){var n,i,a,s,c,u,l=t.pos;return 60===t.src.charCodeAt(l)&&(!((n=t.src.slice(l)).indexOf(">")<0)&&(o.test(n)?(s=(i=n.match(o))[0].slice(1,-1),c=t.md.normalizeLink(s),!!t.md.validateLink(c)&&(e||((u=t.push("link_open","a",1)).attrs=[["href",c]],u.markup="autolink",u.info="auto",(u=t.push("text","",0)).content=t.md.normalizeLinkText(s),(u=t.push("link_close","a",-1)).markup="autolink",u.info="auto"),t.pos+=i[0].length,!0)):!!r.test(n)&&(s=(a=n.match(r))[0].slice(1,-1),c=t.md.normalizeLink("mailto:"+s),!!t.md.validateLink(c)&&(e||((u=t.push("link_open","a",1)).attrs=[["href",c]],u.markup="autolink",u.info="auto",(u=t.push("text","",0)).content=t.md.normalizeLinkText(s),(u=t.push("link_close","a",-1)).markup="autolink",u.info="auto"),t.pos+=a[0].length,!0))))}},function(t,e,n){"use strict";var r=n(59).HTML_TAG_RE;t.exports=function(t,e){var n,o,i,a=t.pos;return!!t.md.options.html&&(i=t.posMax,!(60!==t.src.charCodeAt(a)||a+2>=i)&&(!(33!==(n=t.src.charCodeAt(a+1))&&63!==n&&47!==n&&!function(t){var e=32|t;return e>=97&&e<=122}(n))&&(!!(o=t.src.slice(a).match(r))&&(e||(t.push("html_inline","",0).content=t.src.slice(a,a+o[0].length)),t.pos+=o[0].length,!0))))}},function(t,e,n){"use strict";var r=n(54),o=n(1).has,i=n(1).isValidEntityCode,a=n(1).fromCodePoint,s=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,c=/^&([a-z][a-z0-9]{1,31});/i;t.exports=function(t,e){var n,u,l=t.pos,f=t.posMax;if(38!==t.src.charCodeAt(l))return!1;if(l+1=0;){if((o=i[n]).open&&o.marker===r.marker&&o.end<0&&o.level===r.level){var s=!1;if((o.close||r.open)&&void 0!==o.length&&void 0!==r.length&&(o.length+r.length)%3==0&&(o.length%3==0&&r.length%3==0||(s=!0)),!s){r.jump=e-n,r.open=!1,o.end=e,o.jump=0;break}}n-=o.jump+1}}},function(t,e,n){"use strict";t.exports=function(t){var e,n,r=0,o=t.tokens,i=t.tokens.length;for(e=n=0;e0&&r++,"text"===o[e].type&&e+10&&this.level++,this.pendingLevel=this.level,this.tokens.push(o),o},s.prototype.scanDelims=function(t,e){var n,r,s,c,u,l,f,p,d,h=t,m=!0,v=!0,g=this.posMax,b=this.src.charCodeAt(t);for(n=t>0?this.src.charCodeAt(t-1):32;h=3&&":"===t[e-3]?0:e>=3&&"/"===t[e-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,n){var r=t.slice(e);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},u="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",l="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function f(t){var e=t.re=n(148)(t.__opts__),r=t.__tlds__.slice();function s(t){return t.replace("%TLDS%",e.src_tlds)}t.onCompile(),t.__tlds_replaced__||r.push(u),r.push(e.src_xn),e.src_tlds=r.join("|"),e.email_fuzzy=RegExp(s(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(s(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(s(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(s(e.tpl_host_fuzzy_test),"i");var c=[];function l(t,e){throw new Error('(LinkifyIt) Invalid schema "'+t+'": '+e)}t.__compiled__={},Object.keys(t.__schemas__).forEach(function(e){var n=t.__schemas__[e];if(null!==n){var r={validate:null,link:null};if(t.__compiled__[e]=r,"[object Object]"===o(n))return!function(t){return"[object RegExp]"===o(t)}(n.validate)?i(n.validate)?r.validate=n.validate:l(e,n):r.validate=function(t){return function(e,n){var r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}(n.validate),void(i(n.normalize)?r.normalize=n.normalize:n.normalize?l(e,n):r.normalize=function(t,e){e.normalize(t)});!function(t){return"[object String]"===o(t)}(n)?l(e,n):c.push(e)}}),c.forEach(function(e){t.__compiled__[t.__schemas__[e]]&&(t.__compiled__[e].validate=t.__compiled__[t.__schemas__[e]].validate,t.__compiled__[e].normalize=t.__compiled__[t.__schemas__[e]].normalize)}),t.__compiled__[""]={validate:null,normalize:function(t,e){e.normalize(t)}};var f=Object.keys(t.__compiled__).filter(function(e){return e.length>0&&t.__compiled__[e]}).map(a).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+f+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+f+")","ig"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),function(t){t.__index__=-1,t.__text_cache__=""}(t)}function p(t,e){var n=t.__index__,r=t.__last_index__,o=t.__text_cache__.slice(n,r);this.schema=t.__schema__.toLowerCase(),this.index=n+e,this.lastIndex=r+e,this.raw=o,this.text=o,this.url=o}function d(t,e){var n=new p(t,e);return t.__compiled__[n.schema].normalize(n,t),n}function h(t,e){if(!(this instanceof h))return new h(t,e);var n;e||(n=t,Object.keys(n||{}).reduce(function(t,e){return t||s.hasOwnProperty(e)},!1)&&(e=t,t={})),this.__opts__=r({},s,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=r({},c,t),this.__compiled__={},this.__tlds__=l,this.__tlds_replaced__=!1,this.re={},f(this)}h.prototype.add=function(t,e){return this.__schemas__[t]=e,f(this),this},h.prototype.set=function(t){return this.__opts__=r(this.__opts__,t),this},h.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;var e,n,r,o,i,a,s,c;if(this.re.schema_test.test(t))for((s=this.re.schema_search).lastIndex=0;null!==(e=s.exec(t));)if(o=this.testSchemaAt(t,e[2],s.lastIndex)){this.__schema__=e[2],this.__index__=e.index+e[1].length,this.__last_index__=e.index+e[0].length+o;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=t.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||c=0&&null!==(r=t.match(this.re.email_fuzzy))&&(i=r.index+r[1].length,a=r.index+r[0].length,(this.__index__<0||ithis.__last_index__)&&(this.__schema__="mailto:",this.__index__=i,this.__last_index__=a)),this.__index__>=0},h.prototype.pretest=function(t){return this.re.pretest.test(t)},h.prototype.testSchemaAt=function(t,e,n){return this.__compiled__[e.toLowerCase()]?this.__compiled__[e.toLowerCase()].validate(t,n,this):0},h.prototype.match=function(t){var e=0,n=[];this.__index__>=0&&this.__text_cache__===t&&(n.push(d(this,e)),e=this.__last_index__);for(var r=e?t.slice(e):t;this.test(r);)n.push(d(this,e)),r=r.slice(this.__last_index__),e+=this.__last_index__;return n.length?n:null},h.prototype.tlds=function(t,e){return t=Array.isArray(t)?t:[t],e?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(t,e,n){return t!==n[e-1]}).reverse(),f(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,f(this),this)},h.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),"mailto:"!==t.schema||/^mailto:/i.test(t.url)||(t.url="mailto:"+t.url)},h.prototype.onCompile=function(){},t.exports=h},function(t,e,n){"use strict";t.exports=function(t){var e={};e.src_Any=n(56).source,e.src_Cc=n(57).source,e.src_Z=n(58).source,e.src_P=n(36).source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");return e.src_pseudo_letter="(?:(?![><|]|"+e.src_ZPCc+")"+e.src_Any+")",e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|[><|]|"+e.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|[><|]|[()[\\]{}.,\"'?!\\-]).|\\[(?:(?!"+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-]).|\\.{2,4}[a-zA-Z0-9%/]|\\.(?!"+e.src_ZCc+"|[.]).|"+(t&&t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+e.src_ZCc+").|\\!(?!"+e.src_ZCc+"|[!]).|\\?(?!"+e.src_ZCc+"|[?]).)+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy='(^|[><|]|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}},function(t,e,n){"use strict";t.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}}},function(t,e,n){"use strict";t.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","text_collapse"]}}}},function(t,e,n){"use strict";t.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","text_collapse"]}}}},function(t,e,n){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(153),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(11))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,o,i,a,s,c=1,u={},l=!1,f=t.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(t);p=p&&p.setTimeout?p:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick(function(){h(t)})}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((i=new MessageChannel).port1.onmessage=function(t){h(t.data)},r=function(t){i.port2.postMessage(t)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(t){var e=f.createElement("script");e.onreadystatechange=function(){h(t),e.onreadystatechange=null,o.removeChild(e),e=null},o.appendChild(e)}):r=function(t){setTimeout(h,0,t)}:(a="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&h(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),r=function(e){t.postMessage(a+e,"*")}),p.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n1)for(var n=1;n1&&void 0!==arguments[1]&&arguments[1];if("string"!=typeof t||!t.trim())throw new Error("Invalid url.");return e&&("object"!==(void 0===e?"undefined":r(e))&&(e={stripFragment:!1}),t=i(t,e)),o(t)}},function(t,e,n){"use strict";var r=n(63),o=n(64),i=n(65);t.exports=function(t){t=(t||"").trim();var e={protocols:r(t),protocol:null,port:null,resource:"",user:"",pathname:"",hash:"",search:"",href:t,query:Object.create(null)},n=t.indexOf("://"),a=null,s=null;t.startsWith(".")&&(t.startsWith("./")&&(t=t.substring(2)),e.pathname=t,e.protocol="file");var c=t.charAt(1);return e.protocol||(e.protocol=e.protocols[0],e.protocol||(o(t)?e.protocol="ssh":"/"===c||"~"===c?(t=t.substring(2),e.protocol="file"):e.protocol="file")),-1!==n&&(t=t.substring(n+3)),s=t.split("/"),"file"!==e.protocol?e.resource=s.shift():e.resource="",2===(a=e.resource.split("@")).length&&(e.user=a[0],e.resource=a[1]),2===(a=e.resource.split(":")).length&&(e.resource=a[0],a[1]?(e.port=Number(a[1]),isNaN(e.port)&&(e.port=null,s.unshift(a[1]))):e.port=null),s=s.filter(Boolean),"file"===e.protocol?e.pathname=e.href:e.pathname=e.pathname||("file"!==e.protocol||"/"===e.href[0]?"/":"")+s.join("/"),2===(a=e.pathname.split("#")).length&&(e.pathname=a[0],e.hash=a[1]),2===(a=e.pathname.split("?")).length&&(e.pathname=a[0],e.search=a[1]),e.query=i.parse(e.search),e.href=e.href.replace(/\/$/,""),e.pathname=e.pathname.replace(/\/$/,""),e}},function(t,e,n){"use strict";function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,n,i){e=e||"&",n=n||"=";var a={};if("string"!=typeof t||0===t.length)return a;var s=/\+/g;t=t.split(e);var c=1e3;i&&"number"==typeof i.maxKeys&&(c=i.maxKeys);var u=t.length;c>0&&u>c&&(u=c);for(var l=0;l=0?(f=m.substr(0,v),p=m.substr(v+1)):(f=m,p=""),d=decodeURIComponent(f),h=decodeURIComponent(p),r(a,d)?o(a[d])?a[d].push(h):a[d]=[a[d],h]:a[d]=h}return a};var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,n){"use strict";var r=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,n,s){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?i(a(t),function(a){var s=encodeURIComponent(r(a))+n;return o(t[a])?i(t[a],function(t){return s+encodeURIComponent(r(t))}).join(e):s+encodeURIComponent(r(t[a]))}).join(e):s?encodeURIComponent(r(s))+n+encodeURIComponent(r(t)):""};var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t,e){if(t.map)return t.map(e);for(var n=[],r=0;re.some(e=>e instanceof RegExp?e.test(t):e===t);t.exports=(t,e)=>{e=Object.assign({defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripHash:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0},e),Reflect.has(e,"normalizeHttps")&&(e.forceHttp=e.normalizeHttps),Reflect.has(e,"normalizeHttp")&&(e.forceHttps=e.normalizeHttp),Reflect.has(e,"stripFragment")&&(e.stripHash=e.stripFragment);const n=(t=t.trim()).startsWith("//");!n&&/^\.*\//.test(t)||(t=t.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,e.defaultProtocol));const i=new r(t);if(e.forceHttp&&e.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(e.forceHttp&&"https:"===i.protocol&&(i.protocol="http:"),e.forceHttps&&"http:"===i.protocol&&(i.protocol="https:"),e.stripHash&&(i.hash=""),i.pathname&&(i.pathname=i.pathname.replace(/((?![https?:]).)\/{2,}/g,(t,e)=>/^(?!\/)/g.test(e)?`${e}/`:"/")),i.pathname&&(i.pathname=decodeURI(i.pathname)),!0===e.removeDirectoryIndex&&(e.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let t=i.pathname.split("/");const n=t[t.length-1];o(n,e.removeDirectoryIndex)&&(t=t.slice(0,t.length-1),i.pathname=t.slice(1).join("/")+"/")}if(i.hostname&&(i.hostname=i.hostname.replace(/\.$/,""),e.stripWWW&&/^www\.([a-z\-\d]{2,63})\.([a-z\.]{2,5})$/.test(i.hostname)&&(i.hostname=i.hostname.replace(/^www\./,""))),Array.isArray(e.removeQueryParameters))for(const t of[...i.searchParams.keys()])o(t,e.removeQueryParameters)&&i.searchParams.delete(t);return e.sortQueryParameters&&i.searchParams.sort(),t=i.toString(),(e.removeTrailingSlash||"/"===i.pathname)&&(t=t.replace(/\/$/,"")),n&&!e.normalizeProtocol&&(t=t.replace(/^http:\/\//,"//")),t}},function(t,e,n){"use strict";var r=n(62),o=n(168);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}e.parse=y,e.resolve=function(t,e){return y(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?y(t,!1,!0).resolveObject(e):e},e.format=function(t){o.isString(t)&&(t=y(t));return t instanceof i?t.format():i.prototype.format.call(t)},e.Url=i;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(u),f=["%","/","?",";","#"].concat(l),p=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=n(65);function y(t,e,n){if(t&&o.isObject(t)&&t instanceof i)return t;var r=new i;return r.parse(t,e,n),r}i.prototype.parse=function(t,e,n){if(!o.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),s=-1!==i&&i127?I+="x":I+=N[D];if(!I.match(d)){var P=O.slice(0,T),j=O.slice(T+1),F=N.match(h);F&&(P.push(F[1]),j.unshift(F[2])),j.length&&(y="/"+j.join(".")+y),this.hostname=P.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=r.toASCII(this.hostname));var U=this.port?":"+this.port:"",$=this.hostname||"";this.host=$+U,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==y[0]&&(y="/"+y))}if(!m[k])for(T=0,L=l.length;T0)&&n.host.split("@"))&&(n.auth=R.shift(),n.host=n.hostname=R.shift());return n.search=t.search,n.query=t.query,o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!x.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var w=x.slice(-1)[0],A=(n.host||t.host||x.length>1)&&("."===w||".."===w)||""===w,T=0,S=x.length;S>=0;S--)"."===(w=x[S])?x.splice(S,1):".."===w?(x.splice(S,1),T++):T&&(x.splice(S,1),T--);if(!E&&!k)for(;T--;T)x.unshift("..");!E||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),A&&"/"!==x.join("/").substr(-1)&&x.push("");var R,O=""===x[0]||x[0]&&"/"===x[0].charAt(0);C&&(n.hostname=n.host=O?"":x.length?x.shift():"",(R=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=R.shift(),n.host=n.hostname=R.shift()));return(E=E||n.host&&x.length)&&!O&&x.unshift(""),x.length?n.pathname=x.join("/"):(n.pathname=null,n.path=null),o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,n){"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},function(t,e,n){var r=n(66),o=n(67),i=n(68),a=n(16);t.exports=function(t){return function(e){e=a(e);var n=o(e)?i(e):void 0,s=n?n[0]:e.charAt(0),c=n?r(n,1).join(""):e.slice(1);return s[t]()+c}}},function(t,e){t.exports=function(t,e,n){var r=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(o);++r-1;);return n}},function(t,e){t.exports=function(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i0;){if("top-level"!==this.indentTypes.pop())break}},t}();e.default=a,t.exports=e.default},function(t,e,n){var r=n(185),o=n(186),i=n(187),a=n(16);t.exports=function(t,e,n){return e=(n?o(t,e,n):void 0===e)?1:i(e),r(a(t),e)}},function(t,e){var n=9007199254740991,r=Math.floor;t.exports=function(t,e){var o="";if(!t||e<1||e>n)return o;do{e%2&&(o+=t),(e=r(e/2))&&(t+=t)}while(e);return o}},function(t,e,n){var r=n(40),o=n(41),i=n(43),a=n(19);t.exports=function(t,e,n){if(!a(n))return!1;var s=typeof e;return!!("number"==s?o(n)&&i(e,n.length):"string"==s&&e in n)&&r(n[e],t)}},function(t,e,n){var r=n(188);t.exports=function(t){var e=r(t),n=e%1;return e==e?n?e-n:e:0}},function(t,e,n){var r=n(189),o=1/0,i=17976931348623157e292;t.exports=function(t){return t?(t=r(t))===o||t===-o?(t<0?-1:1)*i:t==t?t:0:0===t?t:0}},function(t,e,n){var r=n(19),o=n(23),i=NaN,a=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,u=/^0o[0-7]+$/i,l=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return i;if(r(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=r(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(a,"");var n=c.test(t);return n||u.test(t)?l(t.slice(2),n?2:8):s.test(t)?i:+t}},function(t,e){t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},function(t,e,n){"use strict";e.__esModule=!0;var r,o=n(39),i=(r=o)&&r.__esModule?r:{default:r};var a=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.level=0}return t.prototype.beginIfPossible=function(t,e){0===this.level&&this.isInlineBlock(t,e)?this.level=1:this.level>0?this.level++:this.level=0},t.prototype.end=function(){this.level--},t.prototype.isActive=function(){return this.level>0},t.prototype.isInlineBlock=function(t,e){for(var n=0,r=0,o=e;o50)return!1;if(a.type===i.default.OPEN_PAREN)r++;else if(a.type===i.default.CLOSE_PAREN&&0===--r)return!0;if(this.isForbiddenToken(a))return!1}return!1},t.prototype.isForbiddenToken=function(t){var e=t.type,n=t.value;return e===i.default.RESERVED_TOPLEVEL||e===i.default.RESERVED_NEWLINE||e===i.default.COMMENT||e===i.default.BLOCK_COMMENT||";"===n},t}();e.default=a,t.exports=e.default},function(t,e,n){"use strict";e.__esModule=!0;var r=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.params=e,this.index=0}return t.prototype.get=function(t){var e=t.key,n=t.value;return this.params?e?this.params[e]:this.params[this.index++]:n},t}();e.default=r,t.exports=e.default},function(t,e,n){var r=n(73),o=n(75),i=n(45),a=n(8),s=n(41),c=n(46),u=n(74),l=n(47),f="[object Map]",p="[object Set]",d=Object.prototype.hasOwnProperty;t.exports=function(t){if(null==t)return!0;if(s(t)&&(a(t)||"string"==typeof t||"function"==typeof t.splice||c(t)||l(t)||i(t)))return!t.length;var e=o(t);if(e==f||e==p)return!t.size;if(u(t))return!r(t).length;for(var n in t)if(d.call(t,n))return!1;return!0}},function(t,e,n){var r=n(195)(Object.keys,Object);t.exports=r},function(t,e){t.exports=function(t,e){return function(n){return t(e(n))}}},function(t,e,n){var r=n(12)(n(7),"DataView");t.exports=r},function(t,e,n){var r=n(72),o=n(198),i=n(19),a=n(76),s=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,l=c.toString,f=u.hasOwnProperty,p=RegExp("^"+l.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||o(t))&&(r(t)?p:s).test(a(t))}},function(t,e,n){var r,o=n(199),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!i&&i in t}},function(t,e,n){var r=n(7)["__core-js_shared__"];t.exports=r},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,n){var r=n(12)(n(7),"Promise");t.exports=r},function(t,e,n){var r=n(12)(n(7),"WeakMap");t.exports=r},function(t,e,n){var r=n(17),o=n(18),i="[object Arguments]";t.exports=function(t){return o(t)&&r(t)==i}},function(t,e){t.exports=function(){return!1}},function(t,e,n){var r=n(17),o=n(42),i=n(18),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return i(t)&&o(t.length)&&!!a[r(t)]}},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e,n){(function(t){var r=n(70),o=e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===o&&r.process,s=function(){try{var t=i&&i.require&&i.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=s}).call(this,n(21)(t))},function(t,e,n){var r=n(16),o=/[\\^$.*+?()[\]{}|]/g,i=RegExp(o.source);t.exports=function(t){return(t=r(t))&&i.test(t)?t.replace(o,"\\$&"):t}},function(t,e,n){"use strict";e.__esModule=!0;var r=i(n(24)),o=i(n(25));function i(t){return t&&t.__esModule?t:{default:t}}var a=["ALL","ALTER","ANALYZE","AND","ANY","ARRAY","AS","ASC","BEGIN","BETWEEN","BINARY","BOOLEAN","BREAK","BUCKET","BUILD","BY","CALL","CASE","CAST","CLUSTER","COLLATE","COLLECTION","COMMIT","CONNECT","CONTINUE","CORRELATE","COVER","CREATE","DATABASE","DATASET","DATASTORE","DECLARE","DECREMENT","DELETE","DERIVED","DESC","DESCRIBE","DISTINCT","DO","DROP","EACH","ELEMENT","ELSE","END","EVERY","EXCEPT","EXCLUDE","EXECUTE","EXISTS","EXPLAIN","FALSE","FETCH","FIRST","FLATTEN","FOR","FORCE","FROM","FUNCTION","GRANT","GROUP","GSI","HAVING","IF","IGNORE","ILIKE","IN","INCLUDE","INCREMENT","INDEX","INFER","INLINE","INNER","INSERT","INTERSECT","INTO","IS","JOIN","KEY","KEYS","KEYSPACE","KNOWN","LAST","LEFT","LET","LETTING","LIKE","LIMIT","LSM","MAP","MAPPING","MATCHED","MATERIALIZED","MERGE","MINUS","MISSING","NAMESPACE","NEST","NOT","NULL","NUMBER","OBJECT","OFFSET","ON","OPTION","OR","ORDER","OUTER","OVER","PARSE","PARTITION","PASSWORD","PATH","POOL","PREPARE","PRIMARY","PRIVATE","PRIVILEGE","PROCEDURE","PUBLIC","RAW","REALM","REDUCE","RENAME","RETURN","RETURNING","REVOKE","RIGHT","ROLE","ROLLBACK","SATISFIES","SCHEMA","SELECT","SELF","SEMI","SET","SHOW","SOME","START","STATISTICS","STRING","SYSTEM","THEN","TO","TRANSACTION","TRIGGER","TRUE","TRUNCATE","UNDER","UNION","UNIQUE","UNKNOWN","UNNEST","UNSET","UPDATE","UPSERT","USE","USER","USING","VALIDATE","VALUE","VALUED","VALUES","VIA","VIEW","WHEN","WHERE","WHILE","WITH","WITHIN","WORK","XOR"],s=["DELETE FROM","EXCEPT ALL","EXCEPT","EXPLAIN DELETE FROM","EXPLAIN UPDATE","EXPLAIN UPSERT","FROM","GROUP BY","HAVING","INFER","INSERT INTO","INTERSECT ALL","INTERSECT","LET","LIMIT","MERGE","NEST","ORDER BY","PREPARE","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","UNION ALL","UNION","UNNEST","UPDATE","UPSERT","USE KEYS","VALUES","WHERE"],c=["AND","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","XOR"],u=void 0,l=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.cfg=e}return t.prototype.format=function(t){return u||(u=new o.default({reservedWords:a,reservedToplevelWords:s,reservedNewlineWords:c,stringTypes:['""',"''","``"],openParens:["(","[","{"],closeParens:[")","]","}"],namedPlaceholderTypes:["$"],lineCommentTypes:["#","--"]})),new r.default(this.cfg,u).format(t)},t}();e.default=l,t.exports=e.default},function(t,e,n){"use strict";e.__esModule=!0;var r=i(n(24)),o=i(n(25));function i(t){return t&&t.__esModule?t:{default:t}}var a=["A","ACCESSIBLE","AGENT","AGGREGATE","ALL","ALTER","ANY","ARRAY","AS","ASC","AT","ATTRIBUTE","AUTHID","AVG","BETWEEN","BFILE_BASE","BINARY_INTEGER","BINARY","BLOB_BASE","BLOCK","BODY","BOOLEAN","BOTH","BOUND","BULK","BY","BYTE","C","CALL","CALLING","CASCADE","CASE","CHAR_BASE","CHAR","CHARACTER","CHARSET","CHARSETFORM","CHARSETID","CHECK","CLOB_BASE","CLONE","CLOSE","CLUSTER","CLUSTERS","COALESCE","COLAUTH","COLLECT","COLUMNS","COMMENT","COMMIT","COMMITTED","COMPILED","COMPRESS","CONNECT","CONSTANT","CONSTRUCTOR","CONTEXT","CONTINUE","CONVERT","COUNT","CRASH","CREATE","CREDENTIAL","CURRENT","CURRVAL","CURSOR","CUSTOMDATUM","DANGLING","DATA","DATE_BASE","DATE","DAY","DECIMAL","DEFAULT","DEFINE","DELETE","DESC","DETERMINISTIC","DIRECTORY","DISTINCT","DO","DOUBLE","DROP","DURATION","ELEMENT","ELSIF","EMPTY","ESCAPE","EXCEPTIONS","EXCLUSIVE","EXECUTE","EXISTS","EXIT","EXTENDS","EXTERNAL","EXTRACT","FALSE","FETCH","FINAL","FIRST","FIXED","FLOAT","FOR","FORALL","FORCE","FROM","FUNCTION","GENERAL","GOTO","GRANT","GROUP","HASH","HEAP","HIDDEN","HOUR","IDENTIFIED","IF","IMMEDIATE","IN","INCLUDING","INDEX","INDEXES","INDICATOR","INDICES","INFINITE","INSTANTIABLE","INT","INTEGER","INTERFACE","INTERVAL","INTO","INVALIDATE","IS","ISOLATION","JAVA","LANGUAGE","LARGE","LEADING","LENGTH","LEVEL","LIBRARY","LIKE","LIKE2","LIKE4","LIKEC","LIMITED","LOCAL","LOCK","LONG","MAP","MAX","MAXLEN","MEMBER","MERGE","MIN","MINUS","MINUTE","MLSLABEL","MOD","MODE","MONTH","MULTISET","NAME","NAN","NATIONAL","NATIVE","NATURAL","NATURALN","NCHAR","NEW","NEXTVAL","NOCOMPRESS","NOCOPY","NOT","NOWAIT","NULL","NULLIF","NUMBER_BASE","NUMBER","OBJECT","OCICOLL","OCIDATE","OCIDATETIME","OCIDURATION","OCIINTERVAL","OCILOBLOCATOR","OCINUMBER","OCIRAW","OCIREF","OCIREFCURSOR","OCIROWID","OCISTRING","OCITYPE","OF","OLD","ON","ONLY","OPAQUE","OPEN","OPERATOR","OPTION","ORACLE","ORADATA","ORDER","ORGANIZATION","ORLANY","ORLVARY","OTHERS","OUT","OVERLAPS","OVERRIDING","PACKAGE","PARALLEL_ENABLE","PARAMETER","PARAMETERS","PARENT","PARTITION","PASCAL","PCTFREE","PIPE","PIPELINED","PLS_INTEGER","PLUGGABLE","POSITIVE","POSITIVEN","PRAGMA","PRECISION","PRIOR","PRIVATE","PROCEDURE","PUBLIC","RAISE","RANGE","RAW","READ","REAL","RECORD","REF","REFERENCE","RELEASE","RELIES_ON","REM","REMAINDER","RENAME","RESOURCE","RESULT_CACHE","RESULT","RETURN","RETURNING","REVERSE","REVOKE","ROLLBACK","ROW","ROWID","ROWNUM","ROWTYPE","SAMPLE","SAVE","SAVEPOINT","SB1","SB2","SB4","SECOND","SEGMENT","SELF","SEPARATE","SEQUENCE","SERIALIZABLE","SHARE","SHORT","SIZE_T","SIZE","SMALLINT","SOME","SPACE","SPARSE","SQL","SQLCODE","SQLDATA","SQLERRM","SQLNAME","SQLSTATE","STANDARD","START","STATIC","STDDEV","STORED","STRING","STRUCT","STYLE","SUBMULTISET","SUBPARTITION","SUBSTITUTABLE","SUBTYPE","SUCCESSFUL","SUM","SYNONYM","SYSDATE","TABAUTH","TABLE","TDO","THE","THEN","TIME","TIMESTAMP","TIMEZONE_ABBR","TIMEZONE_HOUR","TIMEZONE_MINUTE","TIMEZONE_REGION","TO","TRAILING","TRANSACTION","TRANSACTIONAL","TRIGGER","TRUE","TRUSTED","TYPE","UB1","UB2","UB4","UID","UNDER","UNIQUE","UNPLUG","UNSIGNED","UNTRUSTED","USE","USER","USING","VALIDATE","VALIST","VALUE","VARCHAR","VARCHAR2","VARIABLE","VARIANCE","VARRAY","VARYING","VIEW","VIEWS","VOID","WHENEVER","WHILE","WITH","WORK","WRAPPED","WRITE","YEAR","ZONE"],s=["ADD","ALTER COLUMN","ALTER TABLE","BEGIN","CONNECT BY","DECLARE","DELETE FROM","DELETE","END","EXCEPT","EXCEPTION","FETCH FIRST","FROM","GROUP BY","HAVING","INSERT INTO","INSERT","INTERSECT","LIMIT","LOOP","MODIFY","ORDER BY","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","START WITH","UNION ALL","UNION","UPDATE","VALUES","WHERE"],c=["AND","CROSS APPLY","CROSS JOIN","ELSE","END","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER APPLY","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","WHEN","XOR"],u=void 0,l=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.cfg=e}return t.prototype.format=function(t){return u||(u=new o.default({reservedWords:a,reservedToplevelWords:s,reservedNewlineWords:c,stringTypes:['""',"N''","''","``"],openParens:["(","CASE"],closeParens:[")","END"],indexedPlaceholderTypes:["?"],namedPlaceholderTypes:[":"],lineCommentTypes:["--"],specialWordChars:["_","$","#",".","@"]})),new r.default(this.cfg,u).format(t)},t}();e.default=l,t.exports=e.default},function(t,e,n){"use strict";e.__esModule=!0;var r=i(n(24)),o=i(n(25));function i(t){return t&&t.__esModule?t:{default:t}}var a=["ACCESSIBLE","ACTION","AGAINST","AGGREGATE","ALGORITHM","ALL","ALTER","ANALYSE","ANALYZE","AS","ASC","AUTOCOMMIT","AUTO_INCREMENT","BACKUP","BEGIN","BETWEEN","BINLOG","BOTH","CASCADE","CASE","CHANGE","CHANGED","CHARACTER SET","CHARSET","CHECK","CHECKSUM","COLLATE","COLLATION","COLUMN","COLUMNS","COMMENT","COMMIT","COMMITTED","COMPRESSED","CONCURRENT","CONSTRAINT","CONTAINS","CONVERT","CREATE","CROSS","CURRENT_TIMESTAMP","DATABASE","DATABASES","DAY","DAY_HOUR","DAY_MINUTE","DAY_SECOND","DEFAULT","DEFINER","DELAYED","DELETE","DESC","DESCRIBE","DETERMINISTIC","DISTINCT","DISTINCTROW","DIV","DO","DROP","DUMPFILE","DUPLICATE","DYNAMIC","ELSE","ENCLOSED","END","ENGINE","ENGINES","ENGINE_TYPE","ESCAPE","ESCAPED","EVENTS","EXEC","EXECUTE","EXISTS","EXPLAIN","EXTENDED","FAST","FETCH","FIELDS","FILE","FIRST","FIXED","FLUSH","FOR","FORCE","FOREIGN","FULL","FULLTEXT","FUNCTION","GLOBAL","GRANT","GRANTS","GROUP_CONCAT","HEAP","HIGH_PRIORITY","HOSTS","HOUR","HOUR_MINUTE","HOUR_SECOND","IDENTIFIED","IF","IFNULL","IGNORE","IN","INDEX","INDEXES","INFILE","INSERT","INSERT_ID","INSERT_METHOD","INTERVAL","INTO","INVOKER","IS","ISOLATION","KEY","KEYS","KILL","LAST_INSERT_ID","LEADING","LEVEL","LIKE","LINEAR","LINES","LOAD","LOCAL","LOCK","LOCKS","LOGS","LOW_PRIORITY","MARIA","MASTER","MASTER_CONNECT_RETRY","MASTER_HOST","MASTER_LOG_FILE","MATCH","MAX_CONNECTIONS_PER_HOUR","MAX_QUERIES_PER_HOUR","MAX_ROWS","MAX_UPDATES_PER_HOUR","MAX_USER_CONNECTIONS","MEDIUM","MERGE","MINUTE","MINUTE_SECOND","MIN_ROWS","MODE","MODIFY","MONTH","MRG_MYISAM","MYISAM","NAMES","NATURAL","NOT","NOW()","NULL","OFFSET","ON DELETE","ON UPDATE","ON","ONLY","OPEN","OPTIMIZE","OPTION","OPTIONALLY","OUTFILE","PACK_KEYS","PAGE","PARTIAL","PARTITION","PARTITIONS","PASSWORD","PRIMARY","PRIVILEGES","PROCEDURE","PROCESS","PROCESSLIST","PURGE","QUICK","RAID0","RAID_CHUNKS","RAID_CHUNKSIZE","RAID_TYPE","RANGE","READ","READ_ONLY","READ_WRITE","REFERENCES","REGEXP","RELOAD","RENAME","REPAIR","REPEATABLE","REPLACE","REPLICATION","RESET","RESTORE","RESTRICT","RETURN","RETURNS","REVOKE","RLIKE","ROLLBACK","ROW","ROWS","ROW_FORMAT","SECOND","SECURITY","SEPARATOR","SERIALIZABLE","SESSION","SHARE","SHOW","SHUTDOWN","SLAVE","SONAME","SOUNDS","SQL","SQL_AUTO_IS_NULL","SQL_BIG_RESULT","SQL_BIG_SELECTS","SQL_BIG_TABLES","SQL_BUFFER_RESULT","SQL_CACHE","SQL_CALC_FOUND_ROWS","SQL_LOG_BIN","SQL_LOG_OFF","SQL_LOG_UPDATE","SQL_LOW_PRIORITY_UPDATES","SQL_MAX_JOIN_SIZE","SQL_NO_CACHE","SQL_QUOTE_SHOW_CREATE","SQL_SAFE_UPDATES","SQL_SELECT_LIMIT","SQL_SLAVE_SKIP_COUNTER","SQL_SMALL_RESULT","SQL_WARNINGS","START","STARTING","STATUS","STOP","STORAGE","STRAIGHT_JOIN","STRING","STRIPED","SUPER","TABLE","TABLES","TEMPORARY","TERMINATED","THEN","TO","TRAILING","TRANSACTIONAL","TRUE","TRUNCATE","TYPE","TYPES","UNCOMMITTED","UNIQUE","UNLOCK","UNSIGNED","USAGE","USE","USING","VARIABLES","VIEW","WHEN","WITH","WORK","WRITE","YEAR_MONTH"],s=["ADD","AFTER","ALTER COLUMN","ALTER TABLE","DELETE FROM","EXCEPT","FETCH FIRST","FROM","GROUP BY","GO","HAVING","INSERT INTO","INSERT","INTERSECT","LIMIT","MODIFY","ORDER BY","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","UNION ALL","UNION","UPDATE","VALUES","WHERE"],c=["AND","CROSS APPLY","CROSS JOIN","ELSE","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER APPLY","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","WHEN","XOR"],u=void 0,l=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.cfg=e}return t.prototype.format=function(t){return u||(u=new o.default({reservedWords:a,reservedToplevelWords:s,reservedNewlineWords:c,stringTypes:['""',"N''","''","``","[]"],openParens:["(","CASE"],closeParens:[")","END"],indexedPlaceholderTypes:["?"],namedPlaceholderTypes:["@",":"],lineCommentTypes:["#","--"]})),new r.default(this.cfg,u).format(t)},t}();e.default=l,t.exports=e.default},function(t,e,n){var r=n(78),o=n(232),i=n(233),a=n(79),s=n(234),c=n(49),u=200;t.exports=function(t,e,n){var l=-1,f=o,p=t.length,d=!0,h=[],m=h;if(n)d=!1,f=i;else if(p>=u){var v=e?null:s(t);if(v)return c(v);d=!1,f=a,m=new r}else m=e?[]:h;t:for(;++l-1}},function(t,e,n){var r=n(28);t.exports=function(t,e){var n=this.__data__,o=r(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}},function(t,e,n){var r=n(29);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,n){var r=n(29);t.exports=function(t){return r(this,t).get(t)}},function(t,e,n){var r=n(29);t.exports=function(t){return r(this,t).has(t)}},function(t,e,n){var r=n(29);t.exports=function(t,e){var n=r(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this}},function(t,e){var n="__lodash_hash_undefined__";t.exports=function(t){return this.__data__.set(t,n),this}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(71);t.exports=function(t,e){return!(null==t||!t.length)&&r(t,e,0)>-1}},function(t,e){t.exports=function(t,e,n){for(var r=-1,o=null==t?0:t.length;++r>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&r.rotl(t,8)|4278255360&r.rotl(t,24);for(var e=0;e0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],n=0,r=0;n>>5]|=t[n]<<24-r%32;return e},wordsToBytes:function(t){for(var e=[],n=0;n<32*t.length;n+=8)e.push(t[n>>>5]>>>24-n%32&255);return e},bytesToHex:function(t){for(var e=[],n=0;n>>4).toString(16)),e.push((15&t[n]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],n=0;n>>6*(3-i)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],r=0,o=0;r>>6-2*o);return e}},t.exports=r},function(t,e){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)} /*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT */ t.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},function(t,e,n){"use strict";n.r(e);n(92);var r,o,i,a=n(6),s=n.n(a),c=n(31),u=n.n(c),l=n(32),f=n.n(l),p=n(9),d=n(5),h=n(14),m={props:{name:{required:!0},maxLength:{default:500}},data:function(){return{fullException:!1}},computed:{tooLong:function(){return this.name.length>this.maxLength}}},v=n(0),g=Object(v.a)(m,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"ui-exception-message ui-exception-message-full"},[t.tooLong?n("span",{staticClass:"cursor-pointer select-none",attrs:{title:t.name},on:{click:function(e){t.fullException=!t.fullException}}},[t.fullException?[t._v(t._s(t.name))]:[t._v(t._s(t.name.substring(0,t.maxLength))+"…")]],2):[t._v(t._s(t.name))]],2)},[],!1,null,null,null).exports,b={components:{ExceptionClass:n(13).a,ExceptionMessage:g,LineNumber:h.a,FilePath:d.a},inject:["report"],computed:{firstFrame:function(){return this.report.stacktrace[0]}}},y={inject:["report","telescopeUrl","config"],components:{OccurrenceDetails:Object(v.a)(b,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"card-details-overflow scrollbar p-12 pt-10"},[n("div",{staticClass:"text-2xl"},[n("ExceptionClass",{attrs:{name:t.report.exception_class}}),t._v(" "),n("ExceptionMessage",{attrs:{name:t.report.message}})],1),t._v(" "),n("div",[n("a",{staticClass:"ui-url",attrs:{href:t.report.context.request.url,target:"_blank"}},[t._v("\n "+t._s(t.report.context.request.url)+"\n ")])])])},[],!1,null,null,null).exports,FilePath:d.a}},_=Object(v.a)(y,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mt-12 card card-has-header card-no-props"},[n("div",{staticClass:"card-header"},[n("div",{staticClass:"grid items-center rounded-t border-b border-tint-300 text-xs text-tint-600 ",staticStyle:{"grid-template-columns":"1fr 1fr"}},[n("div",{staticClass:"grid cols-auto justify-start gap-2 px-4 py-2"},[n("div",{staticClass:"flex items-center"},[n("a",{attrs:{href:"http://flareapp.io/docs/ignition-for-laravel/introduction",target:"_blank",title:"Ignition docs"}},[n("svg",{staticClass:"w-4 h-5 mr-4",attrs:{viewBox:"0 0 428 988"}},[n("polygon",{staticStyle:{fill:"#FA4E79"},attrs:{points:"428,247.1 428,494.1 214,617.5 214,369.3 \t\t"}}),t._v(" "),n("polygon",{staticStyle:{fill:"#FFF082"},attrs:{points:"0,988 0,741 214,617.5 214,864.1 \t\t"}}),t._v(" "),n("polygon",{staticStyle:{fill:"#E6003A"},attrs:{points:"214,123.9 214,617.5 0,494.1 0,0 \t\t"}}),t._v(" "),n("polygon",{staticStyle:{fill:"#FFE100"},attrs:{points:"214,864.1 214,617.5 428,741 428,988 \t\t"}})])]),t._v(" "),n("FilePath",{attrs:{pathClass:"font-normal",file:t.report.application_path+t.config.directorySeparator,relative:!1}})],1)]),t._v(" "),n("div",{staticClass:"grid cols-auto items-center justify-end gap-4 px-4 py-2"},[t.telescopeUrl?n("div",[n("a",{staticClass:"link-dimmed sm:ml-6",attrs:{href:t.telescopeUrl,target:"_blank"}},[t._v("Telescope")])]):t._e()])])]),t._v(" "),n("div"),t._v(" "),n("div",{staticClass:"card-details"},[n("OccurrenceDetails")],1)])},[],!1,null,null,null).exports,E=n(10),k=n.n(E),x=n(20),C=n.n(x),w=n(98)(),A=null,T={inject:["config"],props:{solution:{required:!0}},data:function(){return{isHidingSolutions:this.hasHideSolutionsCookie(),canExecuteSolutions:null,executionSuccessful:null}},computed:{healthCheckEndpoint:function(){return this.solution.execute_endpoint.replace("execute-solution","health-check")}},created:function(){this.configureRunnableSolutions()},mounted:function(){this.isHidingSolutions&&this.$refs.solutionCard.classList.add("solution-hidden")},methods:{configureRunnableSolutions:function(){this.config.enableRunnableSolutions?this.checkExecutionEndpoint():this.canExecuteSolutions=!1},markdown:function(t){return w.render(t)},checkExecutionEndpoint:(o=C()(k.a.mark(function t(){var e;return k.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch(this.healthCheckEndpoint);case 3:return t.next=5,t.sent.json();case 5:e=t.sent,this.canExecuteSolutions=e.can_execute_commands,t.next=12;break;case 9:t.prev=9,t.t0=t.catch(0),this.canExecuteSolutions=!1;case 12:case"end":return t.stop()}},t,this,[[0,9]])})),function(){return o.apply(this,arguments)}),execute:(r=C()(k.a.mark(function t(){var e;return k.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch(this.solution.execute_endpoint,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({solution:this.solution.class,parameters:this.solution.run_parameters})});case 3:e=t.sent,this.executionSuccessful=200===e.status,t.next=11;break;case 7:t.prev=7,t.t0=t.catch(0),console.error(t.t0),this.executionSuccessful=!1;case 11:case"end":return t.stop()}},t,this,[[0,7]])})),function(){return r.apply(this,arguments)}),refresh:function(){location.reload()},getUrlLabel:function(t){var e=document.createElement("a");return e.href=t,e.hostname},toggleSolutions:function(){var t=this;this.isHidingSolutions?(window.clearTimeout(A),this.toggleHidingSolutions()):(this.$refs.solutionCard.classList.add("solution-hiding"),A=window.setTimeout(function(){t.$refs.solutionCard.classList.remove("solution-hiding"),t.toggleHidingSolutions()},100))},toggleHidingSolutions:function(){if(this.isHidingSolutions)return document.cookie="".concat("hide_solutions","=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=/;"),void(this.isHidingSolutions=!1);var t=new Date;t.setTime(t.getTime()+31536e6),document.cookie="".concat("hide_solutions","=true;expires=").concat(t.toUTCString(),";path=/;"),this.isHidingSolutions=!0},hasHideSolutionsCookie:function(){return document.cookie.includes("hide_solutions")}}},S={components:{SolutionCard:Object(v.a)(T,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"solution-toggle",class:{"solution-toggle-show":t.isHidingSolutions},on:{click:t.toggleSolutions}},[t.isHidingSolutions?n("a",{staticClass:"link-solution",attrs:{target:"_blank"}},[n("i",{staticClass:"far fa-lightbulb text-xs mr-1"}),t._v(" Show solutions")]):n("a",{staticClass:"link-solution",attrs:{target:"_blank"}},[t._v("Hide solutions")])]),t._v(" "),n("div",{ref:"solutionCard",staticClass:"solution",class:{"solution-hidden":t.isHidingSolutions}},[n("div",{staticClass:"solution-main"},[n("div",{staticClass:"solution-background mx-0"},[n("svg",{staticClass:"hidden absolute right-0 h-full | md:block",attrs:{x:"0px",y:"0px",viewBox:"0 0 299 452"}},[n("g",{staticStyle:{opacity:"0.075"}},[n("polygon",{staticStyle:{fill:"rgb(63,63,63)"},attrs:{points:"298.1,451.9 150.9,451.9 21,226.9 298.1,227.1"}}),t._v(" "),n("polygon",{staticStyle:{fill:"rgb(151,151,151)"},attrs:{points:"298.1,227.1 21,226.9 150.9,1.9 298.1,1.9"}})])])]),t._v(" "),n("div",{staticClass:"p-12"},[n("div",{staticClass:"solution-content ml-0"},[n("h2",{staticClass:"solution-title"},[t._v(t._s(t.solution.title))]),t._v(" "),t.solution.description?n("div",{domProps:{innerHTML:t._s(t.markdown(t.solution.description))}}):t._e(),t._v(" "),t.solution.is_runnable?n("div",[n("p",{domProps:{innerHTML:t._s(t.markdown(t.solution.action_description))}}),t._v(" "),null===t.canExecuteSolutions?n("p",{staticClass:"py-4 text-sm italic"},[t._v("\n Loading...\n ")]):t._e(),t._v(" "),n("div",{staticClass:"mt-4"},[t.solution.is_runnable&&!0===t.canExecuteSolutions&&null===t.executionSuccessful?n("button",{staticClass:"button-secondary button-lg bg-tint-300 hover:bg-tint-400",on:{click:t.execute}},[t._v("\n "+t._s(t.solution.run_button_text)+"\n ")]):t._e(),t._v(" "),t.executionSuccessful?n("p",[n("strong",{staticClass:"font-semibold"},[t._v("The solution was executed succesfully.")]),t._v(" "),n("a",{staticClass:"link-solution",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.refresh(e)}}},[t._v("Refresh now.")])]):t._e(),t._v(" "),!1===t.executionSuccessful?n("p",[t._v("\n Something went wrong when executing the solution. Please try\n refresh the page and try again.\n ")]):t._e()])]):t._e(),t._v(" "),Object.entries(t.solution.links).length>0?n("div",{staticClass:"mt-8 grid justify-start"},[n("div",{staticClass:"border-t-2 border-gray-700 opacity-25 "}),t._v(" "),n("div",{staticClass:"pt-2 grid cols-auto-1fr gapx-4 gapy-2 text-sm"},[n("label",{staticClass:"font-semibold uppercase tracking-wider"},[t._v("Read more")]),t._v(" "),n("ul",t._l(t.solution.links,function(e,r){return n("li",{key:r},[n("a",{staticClass:"link-solution",attrs:{href:e,target:"_blank"}},[t._v(t._s(r))])])}),0)])]):t._e()])])])])])},[],!1,null,null,null).exports,ErrorCard:_,FilePath:d.a},inject:["report","solutions"],data:function(){return{activeSolutionKey:0}},computed:{firstFrame:function(){return this.report.stacktrace[0]},solution:function(){return this.solutions[this.activeSolutionKey]}}},R=Object(v.a)(S,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"layout-col z-10"},[n("ErrorCard")],1),t._v(" "),t.solutions.length>0?n("div",{staticClass:"layout-col z-1"},[n("SolutionCard",t._b({},"SolutionCard",{solution:t.solution},!1)),t._v(" "),t.solutions.length>1?n("div",{staticClass:"absolute left-0 bottom-0 w-full h-8 mb-2 px-4 text-sm z-10"},[n("ul",{staticClass:"grid cols-auto place-center gap-1"},t._l(t.solutions,function(e,r){return n("li",{key:e.class,on:{click:function(e){t.activeSolutionKey=r}}},[n("a",{staticClass:"grid place-center h-8 min-w-8 px-2 rounded-full",class:{"bg-tint-200 font-semibold":t.activeSolutionKey===r,"hover:bg-tint-100 cursor-pointer":t.activeSolutionKey!==r}},[t._v("\n "+t._s(r+1)+"\n ")])])}),0)]):t._e()],1):t._e()])},[],!1,null,null,null).exports,O={components:{CheckboxField:n(35).a},props:["error"],computed:{selectedTabs:function(){return this.tabs.filter(function(t){return t.checked}).map(function(t){return t.name})}},data:function(){return{tabs:[{label:"Stack trace",name:"stackTraceTab",checked:!0},{label:"Request",name:"requestTab",checked:!0},{label:"App",name:"appTab",checked:!0},{label:"User",name:"userTab",checked:!0},{label:"Context",name:"contextTab",checked:!0},{label:"Debug",name:"debugTab",checked:!0}]}},methods:{shareError:function(){this.$emit("share",this.selectedTabs)}}},L=Object(v.a)(O,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"grid cols-2 justify-start gapx-6 gapy-2"},t._l(t.tabs,function(e){return n("CheckboxField",{key:e.name,staticClass:"text-gray-200 hover:text-white",attrs:{label:e.label,name:e.name},on:{change:function(t){e.checked=!e.checked}},model:{value:e.checked,callback:function(n){t.$set(e,"checked",n)},expression:"tab.checked"}})}),1),t._v(" "),n("div",{staticClass:"mt-4"},[t.error?n("div",{staticClass:"mb-3"},[t._v("\n We were unable to share your error."),n("br"),t._v("\n Please try again later.\n ")]):t._e(),t._v(" "),n("button",{staticClass:"button-secondary button-sm bg-tint-600 text-white",on:{click:t.shareError}},[t._v("\n Share\n ")])])])},[],!1,null,null,null).exports,N={props:{text:{required:!0}},data:function(){return{copied:!1,timeout:!1}},methods:{copy:function(t){var e=this;this.timeout&&window.clearTimeout(this.timeout);var n=document.createElement("textarea");n.value=t,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n),this.copied=!0,this.timeout=window.setTimeout(function(){return e.copied=!1},3e3)}}},I={components:{CopyButton:Object(v.a)(N,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("button",{attrs:{title:"Copy to clipboard"},on:{click:function(e){return t.copy(t.text)}}},[n("i",{staticClass:"far fa-clipboard",class:t.copied?"text-green-300":"text-gray-200 hover:text-white"}),t._v(" "),t.copied?n("div",{staticClass:"ml-2 absolute top-0 left-full text-green-300"},[t._v("\n Copied!\n ")]):t._e()])},[],!1,null,null,null).exports},props:{publicUrl:{required:!0},ownerUrl:{required:!0}}},D={components:{ShareLinks:Object(v.a)(I,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"text-left"},[n("p",{staticClass:"mt-2 text-gray-300"},[t._v("Share your error with others:")]),t._v(" "),n("div",{staticClass:"grid cols-auto items-center justify-start gap-2 mt-2"},[n("a",{staticClass:"button-secondary button-sm bg-tint-600 hover:bg-tint-700 text-white",attrs:{href:t.publicUrl,target:"_blank"}},[t._v("Open public share")]),t._v(" "),n("CopyButton",{attrs:{text:t.publicUrl}})],1),t._v(" "),n("p",{staticClass:"mt-4 text-gray-300"},[t._v("Administer your shared error here:")]),t._v(" "),n("div",{staticClass:"grid cols-auto items-center justify-start gap-2 mt-2"},[n("a",{staticClass:"button-secondary button-sm bg-tint-600 hover:bg-tint-700 text-white",attrs:{href:t.ownerUrl,target:"_blank"}},[t._v("Open share admin")]),t._v(" "),n("CopyButton",{attrs:{text:t.ownerUrl}})],1)])},[],!1,null,null,null).exports,ShareForm:L},inject:["report","shareEndpoint"],data:function(){return{shareHadError:!1,sharedErrorUrls:null,menuVisible:!1}},watch:{menuVisible:function(t){t?window.addEventListener("click",this.toggleMenu):window.removeEventListener("click",this.toggleMenu)}},methods:{toggleMenu:function(){this.menuVisible=!this.menuVisible},shareError:(i=C()(k.a.mark(function t(e){var n,r;return k.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch(this.shareEndpoint,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({report:JSON.stringify(this.report),tabs:e,lineSelection:window.location.hash})});case 3:return n=t.sent,t.next=6,n.json();case 6:r=t.sent,n.ok?this.sharedErrorUrls=r:this.shareHadError=!0,t.next=13;break;case 10:t.prev=10,t.t0=t.catch(0),this.shareHadError=!0;case 13:case"end":return t.stop()}},t,this,[[0,10]])})),function(t){return i.apply(this,arguments)})}},M={inject:["config"],components:{ShareButton:Object(v.a)(D,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{on:{click:function(t){t.stopPropagation()}}},[n("button",{staticClass:"tab",class:t.menuVisible?"tab-active":"",on:{click:t.toggleMenu}},[t._v("\n Share\n "),n("i",{staticClass:"ml-2 fas fa-share"})]),t._v(" "),n("div",{staticClass:"dropdown z-10 right-0 top-full p-4 overflow-visible",class:{hidden:!t.menuVisible},staticStyle:{"min-width":"18rem","margin-right":"-1px"},on:{click:function(t){t.stopPropagation()}}},[n("div",{staticClass:"flex items-center mb-4"},[n("svg",{staticClass:"w-4 h-5 mr-2",attrs:{viewBox:"0 0 682 1024"}},[n("polygon",{staticStyle:{fill:"#51DB9E"},attrs:{points:"235.3,510.5 21.5,387 21.5,140.2 236.5,264.1 "}}),t._v(" "),n("polygon",{staticStyle:{fill:"#7900F5"},attrs:{points:"235.3,1004.8 21.5,881.4 21.5,634.5 234.8,757.9 "}}),t._v(" "),n("polygon",{staticStyle:{fill:"#94F2C8"},attrs:{points:"448.9,386.9 21.5,140.2 235.3,16.7 663.2,263.4 "}}),t._v(" "),n("polygon",{staticStyle:{fill:"#A475F4"},attrs:{points:"234.8,757.9 21.5,634.5 235.3,511 449.1,634.5 "}})]),t._v(" "),n("h5",{staticClass:"text-left font-semibold uppercase tracking-wider whitespace-no-wrap"},[t._v("\n "+t._s(t.sharedErrorUrls?"Shared":"Share")+" on Flare\n ")]),t._v(" "),n("a",{staticClass:"ml-auto underline",attrs:{target:"_blank",href:"https://flareapp.io/docs/ignition-for-laravel/sharing-errors",title:"Flare documentation"}},[t._v("Docs\n ")])]),t._v(" "),t.sharedErrorUrls?n("div",[n("ShareLinks",{attrs:{publicUrl:t.sharedErrorUrls.public_url,ownerUrl:t.sharedErrorUrls.owner_url}})],1):n("ShareForm",{attrs:{error:t.shareHadError},on:{share:t.shareError}})],1)])},[],!1,null,null,null).exports},props:{value:{required:!0},customTabs:{required:!0}},data:function(){return{defaultTabs:[{component:"StackTab",title:"Stack trace"},{component:"RequestTab",title:"Request"},{component:"AppTab",title:"App"},{component:"UserTab",title:"User"},{component:"ContextTab",title:"Context"},{component:"DebugTab",title:"Debug"}],shareButtonEnabled:this.config.enableShareButton}},mounted:function(){this.$emit("input",this.tabs[this.currentTabIndex])},computed:{currentTabIndex:function(){var t=this;return this.tabs.findIndex(function(e){return e.component===t.value.component})},nextTab:function(){return this.tabs[this.currentTabIndex+1]||this.tabs[0]},previousTab:function(){return this.tabs[this.currentTabIndex-1]||this.tabs[this.tabs.length-1]},tabs:function(){var t={};return this.defaultTabs.forEach(function(e){t[e.component]=e}),this.customTabs.forEach(function(e){t[e.component]=e}),Object.values(t)}}},P={props:{tab:{required:!0}},render:function(t){return t(this.tab.component,{props:this.tab.props||{}})}},j={props:{report:{required:!0},config:{required:!0},solutions:{required:!0},telescopeUrl:{required:!0},shareEndpoint:{required:!0}},data:function(){return{customTabs:window.tabs,tab:{component:"StackTab"}}},provide:function(){return{config:this.config,report:this.report,solutions:this.solutions,telescopeUrl:this.telescopeUrl,shareEndpoint:this.shareEndpoint,setTab:this.setTab}},components:{Summary:R,Tabs:Object(v.a)(M,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("nav",{staticClass:"tab-nav"},[n("ul",{staticClass:"tab-bar"},t._l(t.tabs,function(e){return n("li",{key:e.component},[n("button",{staticClass:"tab",class:t.value.component===e.component?"tab-active":"",on:{click:function(n){return n.preventDefault(),t.$emit("input",e)}}},[t._v("\n "+t._s(e.title)+"\n ")])])}),0),t._v(" "),t.shareButtonEnabled?[n("div",{staticClass:"tab-delimiter"}),t._v(" "),n("ShareButton")]:t._e()],2)},[],!1,null,null,null).exports,Details:Object(v.a)(P,void 0,void 0,!1,null,null,null).exports},methods:{setTab:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.tab={component:t,props:e}}},created:function(){}},F=Object(v.a)(j,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("Summary"),t._v(" "),n("div",{staticClass:"layout-col mt-12"},[n("div",{staticClass:"tabs"},[n("Tabs",t._b({model:{value:t.tab,callback:function(e){t.tab=e},expression:"tab"}},"Tabs",{customTabs:t.customTabs},!1)),t._v(" "),n("div",{staticClass:"tab-main"},[n("Details",t._b({},"Details",{tab:t.tab},!1))],1)],1)])],1)},[],!1,null,null,null).exports;function U(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function $(t){for(var e=1;e=this.selectedRange[0]&&t<=this.selectedRange[1])},editorUrl:function(t){return Object(a.a)(this.config,this.selectedFrame.file,t)}}},c=n(0),u=Object(c.a)(s,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"stack-main"},[n("div",{staticClass:"stack-main-header"},[n("div",{staticClass:"grid cols-auto gap-2 justify-start items-center"},[n("ExceptionClass",{attrs:{name:t.selectedFrame.class||"",method:t.selectedFrame.method||""}}),t._v(" "),n("LineNumber",{attrs:{"line-number":t.selectedFrame.line_number}})],1),t._v(" "),t.selectedFrame.file?n("FilePath",{staticClass:"mt-1",attrs:{"line-number":t.selectedFrame.line_number,file:t.selectedFrame.file,editable:!0}}):t._e()],1),t._v(" "),n("div",{staticClass:"stack-main-content"},[n("div",{staticClass:"stack-viewer scrollbar"},[n("div",{staticClass:"stack-ruler"},[n("div",{staticClass:"stack-lines"},t._l(t.selectedFrame.code_snippet,function(e,r){return n("p",{key:r,staticClass:"stack-line cursor-pointer",class:{"stack-line-selected":t.withinSelectedRange(parseInt(r)),"stack-line-highlight":parseInt(r)===t.selectedFrame.line_number},on:{click:function(e){t.handleLineNumberClick(e,parseInt(r))}}},[t._v("\n "+t._s(r)+"\n ")])}),0)]),t._v(" "),n("pre",{ref:"codeContainer",staticClass:"stack-code"},[t._l(t.selectedFrame.code_snippet,function(e,r){return n("p",{key:r,staticClass:"stack-code-line",class:{"stack-code-line-highlight":parseInt(r)===t.selectedFrame.line_number,"stack-code-line-selected":t.withinSelectedRange(parseInt(r))}},[t._v(t._s(e||" ")),n("a",{staticClass:"editor-link",attrs:{href:t.editorUrl(r)}},[n("i",{staticClass:"fa fa-pencil-alt"})])])}),t._v("\n ")],2)])])])},[],!1,null,null,null).exports,l={props:{frameGroup:{required:!0}},components:{ExceptionClass:r.a,FilePath:o.a,LineNumber:i.a}},f=Object(c.a)(l,function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.frameGroup.expanded||"vendor"!==t.frameGroup.type?"unknown"===t.frameGroup.type?n("li",{staticClass:"stack-frame-group stack-frame-group-unknown"},[n("div",{staticClass:"stack-frame"},[n("button",{staticClass:"stack-frame-number"}),t._v(" "),n("div",{staticClass:"span-2 stack-frame-text"},[n("span",{staticClass:"text-left text-gray-500"},[t._v("\n "+t._s(t.frameGroup.frames.length>1?t.frameGroup.frames.length+" unknown frames":"1 unknown frame")+"\n ")])])])]):n("li",[n("ul",{staticClass:"stack-frame-group",class:"vendor"===t.frameGroup.type?"stack-frame-group-vendor":""},t._l(t.frameGroup.frames,function(e,r){return n("li",{key:r,staticClass:"stack-frame | cursor-pointer",class:e.selected?"stack-frame-selected":"",on:{click:function(n){return t.$emit("select",e.frame_number)}}},[n("div",{staticClass:"stack-frame-number"},[t._v(t._s(e.frame_number))]),t._v(" "),n("div",{staticClass:"stack-frame-text"},[0===r?n("header",{staticClass:"stack-frame-header",class:e.class?"mb-1":""},[n("FilePath",{staticClass:"stack-frame-path",attrs:{pathClass:"vendor"===t.frameGroup.type?"text-gray-800":"text-purple-800",file:e.relative_file}})],1):t._e(),t._v(" "),e.class?n("span",{staticClass:"stack-frame-exception-class"},[n("ExceptionClass",{staticClass:"stack-frame-exception-class",attrs:{name:e.class}})],1):t._e()]),t._v(" "),n("div",{staticClass:"stack-frame-line"},[n("LineNumber",{attrs:{lineNumber:e.line_number}})],1)])}),0)]):n("li",{staticClass:"stack-frame-group stack-frame-group-vendor",on:{click:function(e){return t.$emit("expand")}}},[n("div",{staticClass:"stack-frame | cursor-pointer"},[t._m(0),t._v(" "),n("div",{staticClass:"span-2 stack-frame-text"},[n("button",{staticClass:"text-left text-gray-500"},[t._v("\n "+t._s(t.frameGroup.frames.length>1?t.frameGroup.frames.length+" vendor frames…":"1 vendor frame…")+"\n ")])])])])},[function(){var t=this.$createElement,e=this._self._c||t;return e("button",{staticClass:"stack-frame-number"},[e("i",{staticClass:"fas fa-plus-circle text-gray-500"})])}],!1,null,null,null).exports,p=n(6),d=n.n(p),h=n(4),m=n.n(h),v=n(15),g=n.n(v);function b(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function y(t){return t.map(function(e,n){return function(t){for(var e=1;e

Nested renders cause mangled view cache

I have a template search.pug which uses Laravel's database pagination. I therefore have two views, search.pug and vendor/pagination/default.pug, and the search view calls $results->links() which renders the pagination. When I clear the view cache and load this page, it apparently caches the search view code into the cache file for the pagination view, causing errors when it later tries to render the search recursively into the spot where the pagination belongs.

This is confusing to explain, so I will try with a diagram. It is supposed to look like this:

controller renders search view which calls $results->links() which renders pagination view

but instead the code for the search view is cached as the pagination view, causing this:

controller renders search view which calls $results->links() which renders (cached) search view which causes an error.

I guess that this is because the Pug renderer is a shared singleton and something is getting confused, but I'm not entirely clear on how the cache file is selected. Possibly this is a problem with the Pug renderer itself, in which case let me know and I will file it there instead.

Question about pugjs => true

Hey there, I'm having issues getting 'pugjs' => true to work in the /config/laravel-pug.php file. I've set the option but it doesn't seem to be working. I've surfed issues and saw someone else had this issue but they were on a vagrant setup. I'm currently working on XUbuntu 18.04. I'm able to reach the site just fine but I'm getting errors that would indicate that PHP is still rendering out of the .pug files. Any help with this would be appreciated.

cache is not cleared when i modify something I'm extending

say pages/home.pug extends layout/core.pug

if i modify home.pug the cache is cleared and upon refresh i see the updated content, but this is not the case when i modify layout/core.pug , the cache will not reload until i again modify pages/home.pug

Custom directives just echo out to page

I am using critical-css which has a custom directive

@criticalCss('some/route')

This works in blade fine, so I can work around this by @including('critical') but has anybody else experienced this problem with custom directives on Laravel 5.4 & laravel-pug 1.3.1?

@php directive doesn't work

I have a loop that I set a variable so I use the @php & @endphp directives.

This worked in 1.4.1 and below, but broke in ^1.5.0

I get a weird doubling up of php tags in the compiled view.

<?php<?php 
\Phug\Renderer\Profiler\ProfilerModule::recordProfilerDisplayEvent(17);
// PUG_DEBUG:17
 ?>

Route::is('home')

Hello, after i do composer update All the pug templates are broken even the variables with $value i have to remove the $ to pass, but for Route::is('home') not working i spend all the day trying fix the problem with no result.
some help please...

Unit tests and continuous integration

Hi,

I started to code unit tests to ensure all still working as expected in all PHP and Laravel versions:

kylekatarnls#1

I have not enough rights to enable TravisCI (https://travis-ci.org) to execute unit tests on different PHP/dependencies versions.

I would also recommand to enable the tools we use on our projects:

All those CI tools will check every commits and every pull-request to ensure they can be merged safely.

Errors with evaluating expressions

Im using this pug expression to spit out some inline js in a .pug template

script
    = "SUBSCRIBED = " . (isset(stripe) && stripe.product ? "true" : "false") . ";"

I want this to spit out something like this:

<script>
    SUBSCRIBED = true;
</script>

The current error Im getting is

syntax error, unexpected ';', expecting ',' or ')' 

I have tried all manner of variations on this and im constantly getting errors which I dont understand. I tried using + for the string concatenation, I tried using backticks, none of it is working. I dont understand if im in php mode or js mode, I havent set the mode in the config so I assume its js mode, but its so hard to tell what the hell is going on or how to fix it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.