diff --git a/.gitignore b/.gitignore index fcc335a6..7d4ae8da 100755 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,11 @@ node_modules .vscode-test/ -*.vsix yarn.lock test/components/*.html -.vscode/settings.json versions docs +dist +example ### OSX ### # General @@ -34,4 +34,4 @@ Icon Network Trash Folder Temporary Items .apdisk -test/ + diff --git a/.liquidrc b/.liquidrc deleted file mode 100644 index 258bbb6b..00000000 --- a/.liquidrc +++ /dev/null @@ -1,67 +0,0 @@ -{ - "prettify": { - "wrap": 0, - "indentSize": 2, - "preserveLine": 2, - "preserveComment": false, - "crlf": false, - "commentIndent": false, - "endNewLine": false, - "markup": { - "attributeSort": false, - "attributeSortList": [], - "attributeValues": "preserve", - "commentNewline": false, - "correct": false, - "delimiterSpacing": false, - "forceAttribute": false, - "forceIndent": false, - "forceLeadAttribute": false, - "preserveAttributes": false, - "preserveText": true, - "quoteConvert": "none", - "selfCloseSpace": false - }, - "style": { - "braceAllman": false, - "classPadding": false, - "comments": false, - "compressedCSS": false, - "correct": false, - "noLeadZero": false, - "selectorList": false, - }, - "json": { - "braceAllman": false, - "bracePadding": false, - "braceStyle": "none", - "formatArray": "indent", - "objectIndent": "indent" - }, - "script": { - "arrayFormat": "indent", - "braceAllman": false, - "braceNewline": false, - "bracePadding": false, - "braceStyle": "none", - "caseSpace": false, - "commentIndent": false, - "correct": false, - "elseNewline": false, - "endComma": "none", - "functionNameSpace": false, - "functionSpace": false, - "inlineReturn": false, - "methodChain": 3, - "neverFlatten": false, - "noCaseIndent": false, - "noSemicolon": false, - "objectIndent": "indent", - "preserveComment": false, - "quoteConvert": "none", - "styleGuide": "none", - "ternaryLine": false, - "variableList": false - } - } -} diff --git a/.prettierignore b/.prettierignore index 80e4d4fa..99066eb6 100755 --- a/.prettierignore +++ b/.prettierignore @@ -3,3 +3,5 @@ src/language/liquid.configuration.json test/format.html *.ts *.js +*.cjs +example diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 3ac9aeb6..9986e418 100755 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,7 +1,13 @@ { - // See http://go.microsoft.com/fwlink/?LinkId=827846 - // for the documentation about the extensions.json format - "recommendations": [ - "dbaeumer.vscode-eslint" - ] + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode" + ], + "unwantedRecommendations": [ + "neilding.language-liquid", + "Shopify.theme-check-vscode", + "killalau.vscode-liquid-snippets" + ] } diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..3379bc95 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + "cSpell.words": [ + "Allman", + "Mansedan", + "packagejson", + "VSIX" + ] +} diff --git a/.vscodeignore b/.vscodeignore index 34fae477..4ca218b4 100755 --- a/.vscodeignore +++ b/.vscodeignore @@ -11,10 +11,11 @@ jsconfig.json tsconfig.json node_modules -src/extension/** +src docs test versions rollup.config.js yarn.lock +pnpm-lock.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100755 index 4b99e326..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,413 +0,0 @@ -# Change Log - -All notable changes are listed below. - -> Documentation of the Change log started at version 0.3.1. All version prior 0.3.1 were beta variations. - -## [2.3.0] – 04/08/2019 - -### Added -- Tag associations can now be applied to singular HTML tags. -- All HTML comments are forcefully ignored from formatting. PrettyDiff has issues parsing nested comments, it is better to avoid HTML comment formatting all together, you can override this by setting `ignore_comments: false` in the HTML language ruleset. -- JSON ` - }, - { - "type": "html", - "begin": "style", // ` tags and files that use the `.css.liquid` extension name.

- -

Currently liquid syntax contained within `` tags and `.css.liquid` files will cause formatting to fail, so please avoid formatting CSS which contains Liquid.

- -

- -| Property | Default | Description | -| ---------------- | ------- | ----------------------------------------------- | -| indent_size | `2` | Tab size / indentation | -| css_insert_lines | `true` | Should use new lines in CSS/SCSS | -| preserve | `2` | Lines to preserve | -| brace_block | `true` | Inserts newline before and after inner content. | -| tags | `[]` | An array of included tags | - -

- - - -
- - SCSS and SASS - - -

Format rules for SCSS and SASS code. This ruleset controls formatting for tags like the shopify section `{% stylesheet 'scss' %}` tag. These rules will also be applied to files that use the `.scss.liquid` or `sass.liquid` extension name.

- -

Currently liquid syntax contained within `.scss.liquid` or `.sass.` files will cause formatting to fail, so please avoid formatting SCSS/SASS which contains Liquid.

- -

- -| Property | Default | Description | -| ---------------- | ------- | ----------------------------------------------- | -| indent_size | `2` | Tab size / indentation | -| css_insert_lines | `true` | Should use new lines in CSS/SCSS | -| preserve | `2` | Lines to preserve | -| brace_block | `true` | Inserts newline before and after inner content. | -| tags | `[]` | An array of included tags | - -

- -
- -
- - JSON - - -

Format rules for JSON code. This ruleset controls formatting for tags like the shopify `{% schema %}` tag. These rules will also be applied to HTML `` tags.

- -

- -| Property | Default | Description | -| ------------ | -------- | ----------------------------------------------- | -| indent_size | `2` | Tab size / indentation | -| format_array | `indent` | Format Array, Accepts `indent` or `newline`. | -| no_semicolon | `true` | Prevents semicons for being added. | -| brace_block | `false` | Inserts newline before and after inner content. | -| tags | `[]` | An array of included tags | - -

-
- -# Key binding - -You can use the Liquid formatter by using the below key binding. - -``` -cmd + shift + L -> Format Document -``` - -> Use `ctrl` for windows - -
- -Custom keybindings
-_If you don't like the defaults then rebind editor.action.formatDocument in the keyboard shortcuts menu of vscode._ - -# Snippets - -Liquid snippets are supported in this extension. The Filter and Tag snippets which have been included were forked from [vscode-liquid-snippets](https://github.com/killalau/vscode-liquid-snippets). The reason for forking this extension is to avoid conflicts due to the extension dependency it relies on, however additionally the extension includes over 50+ snippet helpers for both Jekyll and Shopify development. - -### Schema Snippets (Shopify Liquid Variation) - -Shopify `{% schema %}` section snippets are supported when using the `schema` prefix followed by the input type setting name. The schema snippets inject complete input types and allow you to quickly apply the schema setting. - -
- - - -# Support this extension! - -This extension brings sufficient support of the Liquid language to VS Code and aims to provide a well integrated IDE experience for developers using all variations of the language. Prior to the release of this extension Liquid support in vscode and text editors in general was extremely limited with developers stuck using outdated and sometimes broken solutions. - -Developing this extension has taken a considerable amount of time. For now, this extension is available free of cost but will require a small license fee in the future. To help keep this extension free and open source for as long as possible, please consider supporting its growth and maintainance: - -**PayPal**: [Donate](https://www.paypal.me/paynicos)
-**BTC**: `35wa8ChA5XvzfFAn5pMiWHWg251xDqxT51` - -# Changelog - -Refer to the [Changelog](https://github.com/panoply/vscode-liquid/blob/master/CHANGELOG.md) for each per-version update and/or fixes. - -
- -Currently made with 🖤 by Nikolas Savvidis diff --git a/demo/.liquidrc b/demo/.liquidrc deleted file mode 100644 index 2dc38be8..00000000 --- a/demo/.liquidrc +++ /dev/null @@ -1,62 +0,0 @@ -{ - "prettify": { - "crlf": false, - "commentIndent": true, - "endNewline": false, - "indentChar": " ", - "indentSize": 2, - "preserveComment": false, - "preserveLine": 2, - "wrap": 0, - "markup": { - "correct": false, - "commentNewline": false, - "attributeCasing": "preserve", - "attributeValues": "preserve", - "attributeSort": false, - "attributeSortList": [], - "forceAttribute": false, - "forceLeadAttribute": false, - "forceIndent": false, - "preserveText": false, - "preserveAttributes": false, - "selfCloseSpace": false, - "quoteConvert": "none" - }, - "style": { - "correct": false, - "classPadding": false, - "noLeadZero": false, - "sortSelectors": false, - "sortProperties": false - }, - "script": { - "correct": false, - "braceNewline": false, - "bracePadding": false, - "braceStyle": "none", - "braceAllman": false, - "caseSpace": false, - "inlineReturn": true, - "elseNewline": false, - "endComma": "never", - "arrayFormat": "default", - "objectIndent": "default", - "functionNameSpace": false, - "functionSpace": false, - "styleGuide": "none", - "ternaryLine": false, - "methodChain": 4, - "neverFlatten": false, - "noCaseIndent": false, - "noSemicolon": false, - "quoteConvert": "none" - }, - "json": { - "arrayFormat": "default", - "braceAllman": false, - "bracePadding": false, - "objectIndent": "default" - } - } -} diff --git a/demo/test.js b/demo/test.js deleted file mode 100644 index 7701808b..00000000 --- a/demo/test.js +++ /dev/null @@ -1 +0,0 @@ -const foo = 'bar' diff --git a/demo/test.liquid b/demo/test.liquid deleted file mode 100644 index 828d4cad..00000000 --- a/demo/test.liquid +++ /dev/null @@ -1,63 +0,0 @@ - diff --git a/extension/extension.js b/extension/extension.js deleted file mode 100644 index 541ef4ed..00000000 --- a/extension/extension.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";var lt=Object.create;var Ye=Object.defineProperty;var at=Object.getOwnPropertyDescriptor;var ft=Object.getOwnPropertyNames;var ut=Object.getPrototypeOf;var ct=Object.prototype.hasOwnProperty;var pt=(o,a,f,e)=>{if(a&&typeof a==="object"||typeof a==="function"){for(let l of ft(a))if(!ct.call(o,l)&&l!==f)Ye(o,l,{get:()=>a[l],enumerable:!(e=at(a,l))||e.enumerable})}return o};var Ze=(o,a,f)=>(f=o!=null?lt(ut(o)):{},pt(a||!o||!o.__esModule?Ye(f,"default",{value:o,enumerable:true}):f,o));var Le=require("vscode");var xe=require("vscode");var _e=require("vscode");var ht=Object.defineProperty;var dt=(o,a)=>{for(var f in a)ht(o,f,{get:a[f],enumerable:true})};var H=function(){const o=typeof process!=="undefined"&&process.versions!=null?"node":"browser";let a="";return{env:o,mode:"beautify",end:0,iterator:0,start:0,scopes:[],beautify:{},lexers:{},get source(){return o==="node"&&Buffer.isBuffer(a)?a.toString():a},set source(f){a=o==="node"?Buffer.isBuffer(f)?f:Buffer.from(f):f},data:{begin:[],ender:[],lexer:[],lines:[],stack:[],token:[],types:[]},hooks:{before:[],language:[],rules:[],after:[]},stats:{chars:-1,time:-1,size:"",language:""},options:{lexer:"auto",language:"text",languageName:"Plain Text",mode:"beautify",indentLevel:0,crlf:false,commentIndent:true,endNewline:false,indentChar:" ",indentSize:2,preserveComment:false,preserveLine:2,wrap:0,grammar:{html:{tags:[],voids:[],embedded:{}},liquid:{tags:[],else:[],singletons:[],embedded:{}},script:{keywords:[]},style:{units:[]}},markup:{correct:false,commentNewline:false,attributeCasing:"preserve",attributeValues:"preserve",attributeSort:false,attributeSortList:[],forceAttribute:false,forceLeadAttribute:false,forceIndent:false,preserveText:false,preserveAttributes:false,selfCloseSpace:false,quoteConvert:"none"},style:{correct:false,compressCSS:false,classPadding:false,noLeadZero:false,sortSelectors:false,sortProperties:false,quoteConvert:"none",forceValue:"preserve"},script:{correct:false,braceNewline:false,bracePadding:false,braceStyle:"none",braceAllman:false,commentNewline:false,caseSpace:false,inlineReturn:true,elseNewline:false,endComma:"never",arrayFormat:"default",objectSort:false,objectIndent:"default",functionNameSpace:false,functionSpace:false,styleGuide:"none",ternaryLine:false,methodChain:4,neverFlatten:false,noCaseIndent:false,noSemicolon:false,quoteConvert:"none",variableList:"none",vertical:false},json:{arrayFormat:"default",braceAllman:false,bracePadding:false,objectIndent:"default",objectSort:false}}}}();var v="";var Ie=Object.assign;var je=Object.create;var Ne=Object.keys;var Ge=Object.defineProperty;var Ue=Array.isArray;var we;var pe=new(we=class{constructor(){this.html={};this.liquid={};this.script={};this.style={};this.script.keywords=new Set(we.defaults.script.keywords);this.style.units=new Set(we.defaults.style.units);this.html.tags=new Set(we.defaults.html.tags);this.html.voids=new Set(we.defaults.html.voids);this.html.embed={};this.liquid.tags=new Set(we.defaults.liquid.tags);this.liquid.else=new Set(we.defaults.liquid.else);this.liquid.singletons=new Set(we.defaults.liquid.singletons);this.liquid.embed={};this.defaults()}embed(o,a){return a in this[o].embed}defaults(){for(const o in we.defaults.html.embedded){this.html.embed[o]={};for(const{language:a,attribute:f=null}of we.defaults.html.embedded[o]){this.html.embed[o].language=a;if(typeof f==="object"){for(const e in f){this.html.embed[o].attribute=e;if(Array.isArray(f[e])){this.html.embed[o].value=l=>new Set(f[e]).has(l)}else{this.html.embed[o].value=l=>new RegExp(f[e]).test(l)}}}else{this.html.embed[o].attribute=null}}}for(const o in we.defaults.liquid.embedded){this.liquid.embed[o]={end:a=>new RegExp(`^{%-?\\s*end${o}`).test(a)};for(const{language:a,argument:f}of we.defaults.liquid.embedded[o]){this.liquid.embed[o].language=a;if(f){if(Array.isArray(f)){this.liquid.embed[o].attribute=e=>new Set(f).has(e)}else{this.liquid.embed[o].attribute=e=>new RegExp(f).test(e)}}else{this.liquid.embed[o].attribute=null}}}}extend(o){for(const a in o){if(a==="html"){if("tags"in o[a]&&Array.isArray(o[a].tags)){for(const f of o[a].tags){if(!this.html.tags.has(f))this.html.tags.add(f)}}if("voids"in o[a]&&Array.isArray(o[a].voids)){for(const f of o[a].voids){if(!this.html.voids.has(f))this.html.voids.add(f)}}if("embedded"in o[a]);}if(a==="liquid"){if("tags"in o[a]&&Array.isArray(o[a].tags)){for(const f of o[a].tags){if(!this.liquid.tags.has(f))this.liquid.tags.add(f)}}if("else"in o[a]&&Array.isArray(o[a].else)){for(const f of o[a].else){if(!this.liquid.else.has(f))this.liquid.else.add(f)}}if("singletons"in o[a]&&Array.isArray(o[a].singletons)){for(const f of o[a].singletons){if(!this.liquid.singletons.has(f))this.liquid.singletons.add(f)}}if("embedded"in o[a]&&typeof o[a].embedded==="object"){for(const f in o[a].embedded){if(!(f in this.liquid.embed)){this.liquid.embed[f]={end:e=>new RegExp(`{%-?\\s*end${f}`).test(e)}}for(const{language:e,argument:l}of o[a].embedded[f]){if(this.liquid.embed[f].language!==e){this.liquid.embed[f].language=e}if(l){if(this.liquid.embed[f].attribute===null){if(Array.isArray(l)){this.liquid.embed[f].attribute=m=>new Set(l).has(m)}else{this.liquid.embed[f].attribute=m=>new RegExp(l).test(m)}}else{const m=[];for(const I of we.defaults.liquid.embedded[f]){if(Array.isArray(I.argument)){for(const L of I.argument){if(l!==L)m.push(l);else m.push(L)}this.liquid.embed[f].attribute=L=>new Set(m).has(L)}else{if(I.argument!==l){this.liquid.embed[f].attribute=L=>new RegExp(l).test(L)}}}}}}}}}if(a==="style"){if("units"in o[a]&&Array.isArray(o[a].units)){for(const f of o[a].units){if(!this.style.units.has(f))this.style.units.add(f)}}}if(a==="script"){if("keywords"in o[a]&&Array.isArray(o[a].keywords)){for(const f of o[a].keywords){if(!this.script.keywords.has(f))this.script.keywords.add(f)}}}}}},we.defaults={script:{keywords:["ActiveXObject","ArrayBuffer","AudioContext","Canvas","CustomAnimation","DOMParser","DataView","Date","Error","EvalError","FadeAnimation","FileReader","Flash","Float32Array","Float64Array","FormField","Frame","Generator","HotKey","Image","Iterator","Intl","Int16Array","Int32Array","Int8Array","InternalError","Loader","Map","MenuItem","MoveAnimation","Notification","ParallelArray","Point","Promise","Proxy","RangeError","Rectangle","ReferenceError","Reflect","RegExp","ResizeAnimation","RotateAnimation","Set","SQLite","ScrollBar","Set","Shadow","StopIteration","Symbol","SyntaxError","Text","TextArea","Timer","TypeError","URL","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray","URIError","WeakMap","WeakSet","Web","Window","XMLHttpRequest"]},style:{units:["%","cap","ch","cm","deg","dpcm","dpi","dppx","em","ex","fr","grad","Hz","ic","in","kHz","lh","mm","ms","mS","pc","pt","px","Q","rad","rem","rlh","s","turn","vb","vh","vi","vmax","vmin","vw"]},html:{embedded:{script:[{language:"javascript"},{language:"json",attribute:{type:["application/json","application/ld+json"]}},{language:"jsx",attribute:{type:["text/jsx","application/jsx"]}}],style:[{language:"css"}]},voids:["area","base","basefont","br","col","embed","eventsource","frame","hr","image","img","input","isindex","keygen","link","meta","path","param","progress","source","wbr","use"],tags:["body","colgroup","dd","dt","head","html","li","option","p","tbody","td","tfoot","th","thead","tr"]},liquid:{embedded:{schema:[{language:"json"}],style:[{language:"css"}],stylesheet:[{language:"css"},{language:"scss",argument:/\s*['"]scss['"]/}],javascript:[{language:"javascript"}]},tags:["case","capture","comment","embed","filter","for","form","if","macro","paginate","raw","switch","tablerow","unless","verbatim","schema","style","javascript","highlight","stylesheet"],else:["default","else","when","elsif"],singletons:["assign","increment","decrement","render","include"]}},we);function gt(o){const a=je(null);if(o)return Ie(a,o);return a}function Te(o,a=" "){if(o===0)return a;let f=v;let e=1;do{f+=a}while(e++{let I=0;const L=e.length;if(I{let L=a;let j=0;let t=0;let i=0;let r=[];let q=e[a];let W="";const s=typeof q;if(L{let I=0;const L=e.length;if(I{let L=a;let j=0;let t=0;let i=0;let r=e[a];let q=[];let W="";const s=typeof r;if(Lr||W>s){r=e[L];q=[L]}else if(e[L]===r){q.push(L)}L=L+1}while(L{let m=0;const I=a.length;if(m{let I=0;const L=[];const j=a.length;if(I0){f.push(L[0]);l(L[0])}else{if(this.recursive===true)e();o=a}};l(this.array[0]);return o}var n=new class St{constructor(){this.datanames=["begin","ender","lexer","lines","stack","token","types"];this.data={begin:[],ender:[],lexer:[],lines:[],stack:[],token:[],types:[]};this.structure=[["global",-1]];this.references=[[]];this.count=-1;this.lineNumber=1;this.linesSpace=0;this.error=""}get current(){const{begin:a,ender:f,lexer:e,lines:l,stack:m,token:I,types:L}=this.data;return{begin:a[a.length-1],ender:f[f.length-1],lexer:e[e.length-1],lines:l[l.length-1],stack:m[m.length-1],token:I[a.length-1],types:L[a.length-1]}}init(){this.error="";this.count=-1;this.linesSpace=0;this.lineNumber=1;this.references=[[]];this.data.begin=[];this.data.ender=[];this.data.lexer=[];this.data.lines=[];this.data.stack=[];this.data.token=[];this.data.types=[];this.structure=[["global",-1]];this.structure.pop=()=>{const a=this.structure.length-1;const f=this.structure[a];if(a>0)this.structure.splice(a,1);return f};return this.data}concat(a,f){for(const e of this.datanames)a[e]=a[e].concat(f[e]);if(a===this.data)this.count=a.token.length-1}objectSort(a){let f=this.count;let e=this.structure[this.structure.length-1][1];let l=0;let m=0;let I=0;let L=0;let j=true;let t=0;let i=0;let r=0;const q=[];const W=e;const s=H.options.language==="json";const C=a.lexer[f]==="style"&&this.structure[this.structure.length-1][0]==="global";const x=a.lexer[f]==="style";const d=x===true?[";","separator"]:[",","separator"];const z=this.linesSpace;const p=this.count;const G=C===true?"global":this.structure[this.structure.length-1][0];function R(g,k){let O=g[0];let P=k[0];if(a.types[O]==="comment"){do{O=O+1}while(Oa.token[P].toLowerCase())return 1;return-1}const u={begin:[],ender:[],lexer:[],lines:[],stack:[],token:[],types:[]};L=f;do{if(a.begin[f]===e||C===true&&f-1)return;if(a.token[f]===d[0]||x===true&&a.token[f]==="}"&&a.token[f+1]!==";"){j=true;t=f+1}else if(x===true&&a.token[f-1]==="}"){j=true;t=f}if(t===0&&a.types[0]==="comment"){do{t=t+1}while(a.types[t]==="comment")}else if(a.types[t]==="comment"&&a.lines[t]<2){t=t+1}if(j===true&&(a.token[f]===d[0]||x===true&&a.token[f-1]==="}")&&t<=L){if(x===true&&"};".indexOf(a.token[L])<0){L=L+1}else if(x===false&&a.token[L]!==","){L=L+1}q.push([t,L]);if(x===true&&a.token[t]==="}"){L=t}else{L=t-1}}}f=f-1}while(f>e);if(q.length>0&&q[q.length-1][0]>f+1){l=q[q.length-1][0]-1;if(a.types[l]==="comment"&&a.lines[l]>1){do{l=l-1}while(l>0&&a.types[l]==="comment");q[q.length-1][0]=l+1}if(a.types[f+1]==="comment"&&f===-1){do{f=f+1}while(a.types[f+1]==="comment")}q.push([f+1,l])}if(q.length>1){if(s===true||x===true||a.token[f-1]==="="||a.token[f-1]===":"||a.token[f-1]==="("||a.token[f-1]==="["||a.token[f-1]===","||a.types[f-1]==="word"||f===0){q.sort(R);r=q.length;j=false;e=0;do{i=q[e][1];if(x===true){I=i;if(a.types[I]==="comment")I=I-1;if(a.token[I]==="}"){i=i+1;d[0]="}";d[1]="end"}else{d[0]=";";d[1]="separator"}}l=q[e][0];if(x===true&&a.types[i-1]!=="end"&&a.types[i]==="comment"&&a.types[i+1]!=="comment"&&e0&&u.types[l]==="comment")}l=l+1;this.splice({data:u,howmany:0,index:l,record:{begin:W,stack:G,ender:this.count,lexer:u.lexer[l-1],lines:0,token:d[0],types:d[1]}});m=m+1}e=e+1}while(e{let m=this.count;const I=a.begin[m];if(a.lexer[m]==="style"&&H.options.style.sortProperties===true||a.lexer[m]==="script"&&(H.options.script.objectSort===true||H.options.json.objectSort===true)){return}do{if(a.begin[m]===I||a.begin[a.begin[m]]===I&&a.types[m].indexOf("attribute")>-1&&a.types[m].indexOf("attribute_end")<0){a.ender[m]=this.count}else{m=a.begin[m]}m=m-1}while(m>I);if(m>-1)a.ender[m]=this.count};this.datanames.forEach(m=>a[m].push(f[m]));if(a===this.data){this.count=this.count+1;this.linesSpace=0;if(f.lexer!=="style"){if(e.replace(/(\{|\}|@|<|>|%|#|)/g,"")===""){e=f.types==="else"?"else":e=f.token}}if(f.types==="start"||f.types.indexOf("_start")>0){this.structure.push([e,this.count])}else if(f.types==="end"||f.types.indexOf("_end")>0){let m=0;if(this.structure.length>2&&(a.types[this.structure[this.structure.length-1][1]]==="else"||a.types[this.structure[this.structure.length-1][1]].indexOf("_else")>0)&&(a.types[this.structure[this.structure.length-2][1]]==="start"||a.types[this.structure[this.structure.length-2][1]].indexOf("_start")>0)&&(a.types[this.structure[this.structure.length-2][1]+1]==="else"||a.types[this.structure[this.structure.length-2][1]+1].indexOf("_else")>0)){this.structure.pop();a.begin[this.count]=this.structure[this.structure.length-1][1];a.stack[this.count]=this.structure[this.structure.length-1][0];a.ender[this.count-1]=this.count;m=a.ender[a.begin[this.count]+1]}l();if(m>0)a.ender[a.begin[this.count]+1]=m;this.structure.pop()}else if(f.types==="else"||f.types.indexOf("_else")>0){if(e==="")e="else";if(this.count>0&&(a.types[this.count-1]==="start"||a.types[this.count-1].indexOf("_start")>0)){this.structure.push([e,this.count])}else{l();if(e===""){this.structure[this.structure.length-1]=["else",this.count]}else{this.structure[this.structure.length-1]=[e,this.count]}}}}}safeSort(a,f,e){if(Ue(a)===false)return a;if(f==="normal"){return tt.call({array:a,recursive:e},a)}else if(f==="descend"){return et.call({recursive:e},a)}return Qe.call({recursive:e},a)}sortCorrection(a,f){let e=a;let l=-1;const m=this.data;const I=[];const L=this.structure.length<2?[-1]:[this.structure[this.structure.length-2][1]];do{if(e>0&&m.types[e].indexOf("attribute")>-1&&m.types[e].indexOf("end")<0&&m.types[e-1].indexOf("start")<0&&m.types[e-1].indexOf("attribute")<0&&m.lexer[e]==="markup"){L.push(e-1)}if(e>0&&m.types[e-1].indexOf("attribute")>-1&&m.types[e].indexOf("attribute")<0&&m.lexer[L[L.length-1]]==="markup"&&m.types[L[L.length-1]].indexOf("start")<0){L.pop()}if(m.begin[e]!==L[L.length-1]){if(L.length>0){m.begin[e]=L[L.length-1]}else{m.begin[e]=-1}}if(m.types[e].indexOf("else")>-1){if(L.length>0){L[L.length-1]=e}else{L.push(e)}}if(m.types[e].indexOf("end")>-1)L.pop();if(m.types[e].indexOf("start")>-1)L.push(e);e=e+1}while(e-1){I.push(e);l=l+1}m.ender[e]=l>-1?I[l]:-1;if(m.types[e].indexOf("start")>-1){I.pop();l=l-1}}while(e>a)}spacer(a){this.linesSpace=1;do{if(a.array[a.index]==="\n"){this.linesSpace=this.linesSpace+1;this.lineNumber=this.lineNumber+1}if(ce(a.array[a.index+1])===false)break;a.index=a.index+1}while(a.index{if(Z.charCodeAt(0)===123)return"{%-?\\s*";return"\\s*-?%}"})}$`)}const X=()=>{if(/^\s+$/.test(C[r+1])||C[r+1]===""){do{r=r+1}while(ra.start);if(a.opening==="/*"&&a.chars[r]==="*"){Z="*/"}else if(a.opening!=="/*"){Z=a.terminator}g=Z.length-1;k=Z.charAt(g);if(Z!=="\n"||a.chars[i]!=="\n"){do{m.push(a.chars[i]);if(Z==="\n"&&a.chars[i+1]==="\n")break;if(a.chars[i]===k&&a.chars.slice(i-g,i+1).join("")===Z)break;i=i+1}while(i0&&u.replace("\n","").indexOf("\n")>0&&/\n(?!(\s*\*))/.test(u)===false){return[u,i]}r=a.start;if(r>0&&a.chars[r-1]!=="\n"&&ce(a.chars[r-1])){do{r=r-1}while(r>0&&a.chars[r-1]!=="\n"&&ce(a.chars[r-1]))}x=a.chars.slice(r,a.start).join("");const Q=new RegExp("\n"+x,"g");C=u.replace(/\r\n/g,"\n").replace(Q,"\n").split("\n");s=C.length;C[0]=C[0].replace($,"");C[s-1]=C[s-1].replace(P,"");if(s<2)C=C[0].split(" ");if(C[0]===""){C[0]=a.opening}else{C.splice(0,0,a.opening)}s=C.length;r=0;do{d=rf&&C[r].replace(/^\s+/,"").indexOf(" ")>f){C[r]=C[r].replace(/^\s+/,"");q=C[r].indexOf(" ");I.push(C[r].slice(0,q));C[r]=C[r].slice(q+1);r=r-1}else{C[r]=a.opening==="/*"&&C[r].indexOf("/*")!==0?` ${C[r].replace(/^\s+/,"").replace(/\s+$/,"").replace(/\s+/g," ")}`:`${C[r].replace(/^\s+/,"").replace(/\s+$/,"").replace(/\s+/g," ")}`;O=r<1?f-(a.opening.length+1):f;q=C[r].length;W=C[r].replace(/^\s+/,"").indexOf(" ");if(q>O&&W>0&&W0);if(C[r].slice(0,4)!==" "&&/^\s*(\*|-)\s/.test(C[r])===true&&/^\s*(\*|-)\s/.test(C[r+1])===false){C.splice(r+1,0,"* ")}if(C[r].slice(0,4)!==" "&&/^\s*\d+\.\s/.test(C[r])===true&&/^\s*\d+\.\s/.test(C[r+1])===false){C.splice(r+1,0,"1. ")}if(q<4){I.push(C[r]);R=true}else if(r===s-1){I.push(C[r].slice(0,q));C[r]=C[r].slice(q+1);R=true;r=r-1}else if(/^\s+$/.test(C[r+1])===true||C[r+1]===""){I.push(C[r].slice(0,q));C[r]=C[r].slice(q+1);z=true;r=r-1}else if(C[r+1].slice(0,4)!==" "&&/^\s*(\*|-)\s/.test(C[r+1])){I.push(C[r].slice(0,q));C[r]=C[r].slice(q+1);p=true;r=r-1}else if(C[r+1].slice(0,4)!==" "&&/^\s*\d+\.\s/.test(C[r+1])){I.push(C[r].slice(0,q));C[r]=C[r].slice(q+1);G=true;r=r-1}else if(C[r+1].slice(0,4)===" "){I.push(C[r].slice(0,q));C[r]=C[r].slice(q+1);R=true;r=r-1}else if(q+d.length>f&&d.indexOf(" ")<0){I.push(C[r].slice(0,q));C[r]=C[r].slice(q+1);R=true;r=r-1}else if(C[r].replace(/^\s+/,"").indexOf(" ")f?C[r].slice(q+1)+L+C[r+1]:`${C[r].slice(q+1)} ${C[r+1]}`}if(z===false&&p===false&&G===false&&R===false){C[r]=C[r].slice(0,q)}}else if(C[r+1]!==void 0&&(C[r].length+d.indexOf(" ")>f&&d.indexOf(" ")>0||C[r].length+d.length>f&&d.indexOf(" ")<0)){I.push(C[r]);r=r+1}else if(C[r+1]!==void 0&&/^\s+$/.test(C[r+1])===false&&C[r+1]!==""&&C[r+1].slice(0,4)!==" "&&/^\s*(\*|-|(\d+\.))\s/.test(C[r+1])===false){C[r+1]=`${C[r]} ${C[r+1]}`;z=true}if(R===false&&p===false&&G===false){if(z===true){z=false}else if(/^\s*(\*|-|(\d+\.))\s*$/.test(C[r])===false){if(r0){if(I[I.length-1].length>f-(a.terminator.length+1)){I.push(a.terminator)}else{I[I.length-1]=`${I[I.length-1]} ${a.terminator}`}u=I.join(L)}else{C[C.length-1]=C[C.length-1]+a.terminator;u=C.join(L)}return[u,i]}wrapCommentLine(a){let f=a.start;let e=0;let l="";let m=[];const{wrap:I,preserveComment:L}=H.options;function j(){let i="";do{e=e+1;if(a.chars[e+1]==="\n")return}while(e{const i=[];const r={ender:-1,types:"comment",lexer:a.lexer,lines:this.linesSpace};if(this.count>-1){r.begin=this.structure[this.structure.length-1][1];r.stack=this.structure[this.structure.length-1][0];r.token=this.data.token[this.count]}else{r.begin=-1;r.stack="global";r.token=""}let q=0;let W=0;l=l.replace(/\s+/g," ").replace(/\s+$/,"");W=l.length;if(I>W)return;do{q=I;if(l.charAt(q)!==" "){do{q=q-1}while(q>0&&l.charAt(q)!==" ");if(q<3){q=I;do{q=q+1}while(qa.start&&a.chars[e-1]==="/"&&(a.chars[e]==="*"||a.chars[e]==="/"));if(a.chars[e]==="*")i="*/";if(i!=="\n"||a.chars[f]!=="\n"){do{m.push(a.chars[f]);if(i==="\n"&&a.chars[f+1]==="\n")break;f=f+1}while(f0);return(u-R)%2===1}function s(R){const u=R.replace(/\s*!important/," !important").split(v);const g=/-?transition$/.test(l.token[n.count-2]);const k=[];const O=/(\s|\(|,)-?0+\.?\d+([a-z]|\)|,|\s)/g;const P=/(\s|\(|,)-?\.?\d+([a-z]|\)|,|\s)/g;let _=0;let F=0;let $=v;let oe=u.length;let X=[];const Q=ie=>{return ie};const Z=ie=>{ie=ie.replace(/\s*/g,v);return/\/\d/.test(ie)&&R.indexOf("url(")===0?ie:` ${ie.charAt(0)} ${ie.charAt(1)}`};const le=ie=>{if(e.noLeadZero===true){return ie.replace(/^-?\D0+(\.|\d)/,B=>B.replace(/0+/,v))}else if(/0*\./.test(ie)){return ie.replace(/0*\./,"0.")}else if(/0+/.test(/\d+/.exec(ie)[0])){return/^\D*0+\D*$/.test(ie)?ie.replace(/0+/,"0"):ie.replace(/\d+/.exec(ie)[0],/\d+/.exec(ie)[0].replace(/^0+/,v))}return ie};const V=ie=>ie.replace(",",", ");const ae=ie=>`${ie} `;const D=()=>{const ie=_-1;let B=ie;if(ie<1)return true;do{B=B-1}while(B>0&&u[B]==="\\");return(ie-B)%2===1};if(_0)){k[_]=k[_].replace(/,\S/g,V)}_=_+1}while(_{u.push(m[k]);if(ce(m[k+1])){do{k=k+1}while(k-1&&l.token[n.count].indexOf("extend(")===0){i="pseudo"}else if(_===true&&/\d/.test(r.charAt(0))===false&&/^rgba?\(/.test(r)===false&&r.indexOf("url(")!==0&&(r.indexOf(" ")<0||r.indexOf(" ")>r.indexOf("("))&&r.charAt(r.length-1)===")"){if(c(l.token[n.count],58)){i="value"}else{r=r.replace(/,\u0020?/g,", ");i="function"}r=s(r)}else if(n.count>-1&&`"'`.indexOf(l.token[n.count].charAt(0))>-1&&l.types[n.count]==="variable"){i="item"}else if(c(u[0],64)||u[0]==="$"){if(l.types[n.count]==="colon"&&f.language==="css"&&(l.types[n.count-1]==="property"||l.types[n.count-1]==="variable")){i="value"}else if(n.count>-1){i="item";P=l.token[n.count];k=P.indexOf("(");if(c(P[P.length-1],41)&&k>0){P=P.slice(k+1,P.length-1);l.token[n.count]=l.token[n.count].slice(0,k+1)+s(P)+")"}}r=s(r)}else{i="item"}q(v)}function x(R){let u=n.count;let g=0;let k=v;const O=[];const P=()=>{if(n.count<0)return;if(u>0&&(l.types[u]==="comment"||l.types[u]==="ignore")){do{u=u-1;O.push(l.token[u])}while(u>0&&l.lexer[u]==="style"&&(l.types[u]==="comment"||l.types[u]==="ignore"))}g=u-1;if(g>0&&(l.types[g]==="comment"||l.types[g]==="ignore")){do{g=g-1}while(g>0&&l.lexer[u]==="style"&&(l.types[g]==="comment"||l.types[g]==="ignore"))}if(g<0)g=0;if(u<0)u=0;k=l.token[u].charAt(0)};function _(F){let $=F;const oe=l.begin[$];l.token[F]=l.token[F].replace(/\s*&/," &").replace(/(\s*>\s*)/g," > ").replace(/(\s*\+\s*)/g," + ").replace(/:\s+/g,": ").replace(/^(\s+)/,v).replace(/(\s+)$/,v).replace(/\s+::\s+/,"::");if(c(l.token[$-1],44)||c(l.token[$-1],58)||l.types[$-1]==="comment"||l.types[$-1]==="pseudo"){if(l.types[$-1]==="pseudo"){l.token[$-1]=`${l.token[$-1]}${l.token[$]}`;l.types[$-1]="selector";n.splice({data:l,howmany:1,index:$})}else{do{$=$-1;if(l.begin[$]===oe){if(c(l.token[$],59)||l.types[$].indexOf("template")>-1)break;if(ne(l.token[$],44)&&l.types[$]!=="comment"){l.types[$]="selector"}if(c(l.token[$],58)){if(ne(l.token[$-1],58)&&l.stack[u]==="global"&&(l.types[$-1]==="comment"||l.types[$-1]==="ignore"||l.types[$-1].indexOf("template")>-1)){l.token[$]=`${l.token[$]}${l.token[$+1]}`;n.pop(l)}else if(n.count===1){l.token[$]=`${l.token[$]}${l.token[$+1]}`;n.pop(l)}else if(l.types[$]==="selector"&&l.types[$+1]==="item"){l.token[$]=`${l.token[$]}${l.token[$+1]}`;n.pop(l)}else{l.token[$]=`${l.token[$-1]}:${l.token[$+1]}`;l.lines[$]=l.lines[$-1];n.splice({data:l,howmany:2,index:$})}}}else{break}}while($>0)}}$=n.count;if(e.sortSelectors===true&&c(l.token[$-1],44)){const X=[l.token[$]];do{$=$-1;if(l.types[$]==="comment"||l.types[$]==="ignore"){do{$=$-1}while($>0&&(l.types[$]==="comment"||l.types[$]==="ignore"))}if(c(l.token[$],44))$=$-1;X.push(l.token[$])}while($>0&&(c(l.token[$-1],44)||l.types[$-1]==="selector"||l.types[$-1]==="comment"||l.types[$-1]==="ignore"));X.sort();$=n.count;l.token[$]=X.pop();do{$=$-1;if(l.types[$]==="comment"||l.types[$]==="ignore"){do{$=$-1}while($>0&&(l.types[$]==="comment"||l.types[$]==="ignore"))}if(c(l.token[$],44))$=$-1;l.token[$]=X.pop()}while($>0&&(c(l.token[$-1],44)||l.token[$-1]==="selector"||l.types[$-1]==="comment"||l.types[$-1]==="ignore"))}u=n.count;P()}P();if(R==="start"&&(l.types[u]==="value"||l.types[u]==="variable")){l.types[u]="item"}if(l.lexer[n.count-1]!=="style"||g<0){if(R==="colon"){if(k==="$"||c(k,64)){l.types[u]="variable"}else{if(l.stack[u]!=="global"&&(l.types[u]!=="comment"||l.types[u]!=="ignore")){l.types[u]="property"}}}else if(l.lexer[u]==="style"){l.types[u]="selector";_(u)}}else if(R==="start"&&l.types[u]==="function"&&l.lexer[u]==="style"){l.types[u]="selector";_(u)}else if(l.types[u]==="item"&&l.lexer[u]==="style"){if(R==="start"){_(u);l.types[u]="selector";if(c(l.token[u],58))l.types[g]="selector";if(l.token[u].indexOf("=\u201C")>0){n.error=`Invalid Quote (\u201C, \\201c) used on line number ${n.lineNumber}`}else if(l.token[u].indexOf("=\u201D")>0){n.error=`Invalid Quote (\u201D, \\201d) used on line number ${n.lineNumber}`}}else if(R==="end"){if(k==="$"||c(k,64)){l.types[u]="variable"}else{l.types[u]="value"}l.token[u]=s(l.token[u])}else if(R==="separator"){if(l.types[g]==="colon"||c(l.token[g],44)||c(l.token[g],123)){if(ne(m[t],59)&&(l.types[g]==="selector"||c(l.token[g],123))){l.types[u]="selector";_(u)}else if(l.token[u].charAt(0)==="$"||c(l.token[u],64)){l.types[u]="variable"}else{l.types[u]="value"}l.token[u]=s(l.token[u]);if(l.token[u].charAt(0)==="\u201C"){n.error=`Invalid Quote (\u201C, \\201c) used on line number ${n.lineNumber}`}else if(l.token[u].charAt(0)==="\u201D"){n.error=`Invalid (\u201D, \\201d) used on line number ${n.lineNumber}`}}else{if(k==="$"||c(k,64)){l.types[u]="variable"}else if(l.types[g]==="value"||l.types[g]==="variable"){l.token[g]=l.token[g]+l.token[u];n.pop(l)}else{l.types[u]="value"}}}else if(R==="colon"){if(k==="$"||c(k,64)){l.types[u]="variable"}else{l.types[u]="property"}}else if(c(l.token[g],64)&&(l.types[g-2]!=="variable"&&l.types[g-2]!=="property"||l.types[g-1]==="separator")){l.types[g]="variable";i="variable";l.token[g]=s(l.token[g])}}}function d(){let R=n.count;do{R=R-1}while(R>0&&l.types[R]==="comment");if(l.token[R]===";")return;n.splice({data:l,howmany:0,index:R+1,record:{begin:n.structure[n.structure.length-1][1],ender:-1,lexer:"style",lines:n.linesSpace,stack:n.structure[n.structure.length-1][0],token:";",types:"separator"}})}function z(R,u){const g=[];let k=v;let O=v;let P=0;let _=R.length;const F=$=>{const oe=l.types[n.count-1];if(i==="item"){if(oe==="colon"){l.types[n.count]="value"}else{x(oe)}}i=$;if(i.indexOf("start")>-1||i.indexOf("else")>-1){q(r)}else{q(v)}};j[j.length-1]=true;if(t0){O=O.slice(0,O.indexOf("("))}if(O==="else"||O==="elseif"||O==="when"||O==="elsif"){F("template_else");return}oe=$.length-1;if(oe>-1){do{if(O===$[oe]){F("template_start");return}if(O==="end"+$[oe]){F("template_end");return}oe=oe-1}while(oe>-1)}}else if(R==="{{"){let $=k.slice(2);const oe=$.length;let X=0;do{X=X+1}while(X-1)u.data[F[4]]=true;if(oe>3){if(u.data[F][0]===v)u.data[F][0]=$[0];if(u.data[F][1]===v)u.data[F][1]=$[1];if(u.data[F][2]===v)u.data[F][2]=$[2];if(u.data[F][3]===v)u.data[F][3]=$[3]}else if(oe>2){if(u.data[F][0]===v)u.data[F][0]=$[0];if(u.data[F][1]===v)u.data[F][1]=$[1];if(u.data[F][2]===v)u.data[F][2]=$[2];if(u.data[F][3]===v)u.data[F][3]=$[1]}else if(oe>1){if(u.data[F][0]===v)u.data[F][0]=$[0];if(u.data[F][1]===v)u.data[F][1]=$[1];if(u.data[F][2]===v)u.data[F][2]=$[0];if(u.data[F][3]===v)u.data[F][3]=$[1]}else{if(u.data[F][0]===v)u.data[F][0]=$[0];if(u.data[F][1]===v)u.data[F][1]=$[0];if(u.data[F][2]===v)u.data[F][2]=$[0];if(u.data[F][3]===v)u.data[F][3]=$[0]}}else if(l.token[P-2]===`${F}-bottom`){if(u.data[F][2]===v)u.data[F][2]=l.token[P]}else if(l.token[P-2]===`${F}-left`){if(u.data[F][3]===v)u.data[F][3]=l.token[P]}else if(l.token[P-2]===`${F}-right`){if(u.data[F][1]===v)u.data[F][1]=l.token[P]}else if(l.token[P-2]===`${F}-top`){if(u.data[F][0]===v)u.data[F][0]=l.token[P]}else{return}u.removes.push([P,F]);u.last[F]=P}function O(){let F=0;let $=v;const oe=/^(0+([a-z]+|%))/;const X=u.removes.length;const Q=u.data.margin[0]!==v&&u.data.margin[1]!==v&&u.data.margin[2]!==v&&u.data.margin[3]!==v;const Z=u.data.padding[0]!==v&&u.data.padding[1]!==v&&u.data.padding[2]!==v&&u.data.padding[3]!==v;function le(V){if(oe.test(u.data[V][0])===true)u.data[V][0]="0";if(oe.test(u.data[V][1])===true)u.data[V][1]="0";if(oe.test(u.data[V][2])===true)u.data[V][2]="0";if(oe.test(u.data[V][3])===true)u.data[V][3]="0";if(u.data[V][0]===u.data[V][1]&&u.data[V][0]===u.data[V][2]&&u.data[V][0]===u.data[V][3]){$=u.data[V][0]}else if(u.data[V][0]===u.data[V][2]&&u.data[V][1]===u.data[V][3]&&u.data[V][0]!==u.data[V][1]){$=`${u.data[V][0]} ${u.data[V][1]}`}else if(u.data[V][1]===u.data[V][3]&&u.data[V][0]!==u.data[V][2]){$=`${u.data[V][0]} ${u.data[V][1]} ${u.data[V][2]}`}else{$=`${u.data[V][0]} ${u.data[V][1]} ${u.data[V][2]} ${u.data[V][3]}`}if(u.data[V[4]]===true)$=`${$.replace(" !important",v)} !important`;if(u.last[V]>n.count){F=g<1?1:g+1;do{if(l.begin[F]===g&&l.types[F]==="value"&&l.token[F-2].indexOf(V)===0){u.last[V]=F;break}F=F+1}while(F1&&(Q===true||Z===true)){do{if(u.removes[F][0]!==u.last.margin&&u.removes[F][0]!==u.last.padding&&(Q===true&&u.removes[F][1]==="margin"||Z===true&&u.removes[F][1]==="padding")){n.splice({data:l,howmany:l.types[u.removes[F][0]+1]==="separator"?4:3,index:u.removes[F][0]-2})}F=F+1}while(Fg);O();n.linesSpace=R}do{if(ce(m[t])){t=n.spacer({array:m,end:I,index:t})}else if(c(m[t],47)&&c(m[t+1],42)){p(false)}else if(c(m[t],47)&&c(m[t+1],47)){p(true)}else if(c(m[t],123)&&c(m[t+1],37)){z("{%","%}")}else if(c(m[t],123)&&c(m[t+1],123)){z("{{","}}")}else if(c(m[t],123)||c(m[t],40)&&c(l.token[n.count],58)&&l.types[n.count-1]==="variable"){x("start");i="start";r=m[t];if(c(m[t],40)){q("map");L.push(0)}else if(l.types[n.count]==="selector"||l.types[n.count]==="variable"){q(l.token[n.count])}else if(l.types[n.count]==="colon"){q(l.token[n.count-1])}else{q("block")}j.push(false)}else if(c(m[t],125)||m[t]===")"&&n.structure[n.structure.length-1][0]==="map"&&L[L.length-1]===0){if(c(m[t],125)&&c(l.token[n.count-1],123)&&l.types[n.count]==="item"&&l.token[n.count-2]!==void 0&&l.token[n.count-2].charAt(l.token[n.count-2].length-1)==="@"){l.token[n.count-2]=l.token[n.count-2]+"{"+l.token[n.count]+"}";n.pop(l);n.pop(l);n.structure.pop()}else{if(c(m[t],41))L.pop();x("end");if(c(m[t],125)&&ne(l.token[n.count],59)){if(l.types[n.count]==="value"||l.types[n.count]==="function"||l.types[n.count]==="variable"&&(c(l.token[n.count-1],58)||c(l.token[n.count-1],59))){if(e.correct===true){r=";"}else{r="x;"}i="separator";q(v)}else if(l.types[n.count]==="comment"){d()}}j.pop();r=m[t];i="end";if(c(m[t],125))G();if(e.sortProperties===true&&c(m[t],125))n.objectSort(l);q(v)}}else if(c(m[t],59)||c(m[t],44)){if(l.types[n.count-1]==="selector"||l.types[n.count]!=="function"&&c(l.token[n.count-1],125)){x("start")}else{x("separator")}if(l.types[n.count]!=="separator"&&W(t)===true){r=m[t];i="separator";q(v)}}else if(c(m[t],58)&&l.types[n.count]!=="end"){if(c(m[t+1],58)){t=t+1;x("pseudo");r="::";i="pseudo";q(v)}else{x("colon");r=":";i="colon";q(v)}}else{if(n.structure[n.structure.length-1][0]==="map"&&c(m[t],40)){L[L.length-1]=L[L.length-1]+1}C()}t=t+1}while(t-1&&w.types.indexOf("template_string")<0){return}if(c(S,59)&&h===false)return;if(s.lexer[n.count-1]!=="script"&&(e0&&s.token[b]!==")"&&s.stack[b]!=="arguments");b=s.begin[b]}else{b=s.begin[w.begin-1]}if(c(s.token[b],40)){b=b-1;if(s.token[b-1]==="function")b=b-1;if(s.stack[b-1]==="object"||s.stack[b-1]==="switch")return;if(s.token[b-1]!=="="&&s.token[b-1]!=="return"&&s.token[b-1]!==":"){return}}else{return}}if(w.types==="comment"||E==="method"||E==="paren"||E==="expression"||E==="array"||E==="object"||E==="switch"&&w.stack!=="method"&&s.token[s.begin[n.count]]==="("&&s.token[s.begin[n.count]-1]!=="return"&&s.types[s.begin[n.count]-1]!=="operator"){return}if(s.stack[n.count]==="expression"&&(s.token[s.begin[n.count]-1]!=="while"||s.token[s.begin[n.count]-1]==="while"&&s.stack[s.begin[n.count]-2]!=="do")){return}if(S!==""&&"=<>+*?|^:&%~,.()]".indexOf(S)>-1&&h===false)return;if(w.types==="comment"){b=n.count;do{b=b-1}while(b>0&&s.types[b]==="comment");if(b<1)return;w.token=s.token[b];w.types=s.types[b];w.stack=s.stack[b]}if(w.token===void 0||w.types==="start"||w.types==="separator"||w.types==="operator"&&w.token!=="++"&&w.token!=="--"||w.token==="x}"||w.token==="var"||w.token==="let"||w.token==="const"||w.token==="else"||w.token.indexOf("#!/")===0||w.token==="instanceof"){return}if(w.stack==="method"&&(s.token[w.begin-1]==="function"||s.token[w.begin-2]==="function")){return}if(f.script.variableList==="list")k.index[k.len]=n.count;l=f.script.correct===true?";":"x;";m="separator";b=n.linesSpace;n.linesSpace=0;B("");n.linesSpace=b;$()}function P(){let h=n.count;do{h=h-1}while(h>-1&&s.token[h]==="x}");if(s.stack[h]==="else")return B("");h=h+1;n.splice({data:s,howmany:0,index:h,record:{begin:s.begin[h],ender:-1,lexer:"script",lines:n.linesSpace,stack:s.stack[h],token:l,types:m}});B("")}function _(){let h=n.count;if(s.types[h]==="comment"){do{h=h-1}while(h>0&&s.types[h]==="comment")}if(s.token[h]==="from")h=h-2;if(s.token[h]==="x;"){n.splice({data:s,howmany:1,index:h})}}function F(){O(false);if(j>-1)y();W=n.wrapCommentBlock({chars:d,end:x,lexer:"script",opening:"/*",start:e,terminator:"*/"});e=W[1];if(s.token[n.count]==="var"||s.token[n.count]==="let"||s.token[n.count]==="const"){r=n.pop(s);B("");n.push(s,r,"");if(s.lines[n.count-2]===0)s.lines[n.count-2]=s.lines[n.count];s.lines[n.count]=0}else if(W[0]!==""){l=W[0];m=/^\/\*\s*@ignore\s*\bstart\b/.test(l)?"ignore":"comment";if(l.indexOf("# sourceMappingURL=")===2){R[0]=n.count+1;R[1]=l}n.push(s,{begin:n.structure[n.structure.length-1][1],ender:-1,lexer:"script",lines:n.linesSpace,stack:n.structure[n.structure.length-1][0],token:l,types:m},"")}if(/\/\*\s*global\s+/.test(s.token[n.count])===true&&s.types.indexOf("word")<0){C[0]=s.token[n.count].replace(/\/\*\s*global\s+/,"").replace("*/","").replace(/,\s+/g,",").split(",")}}function $(){let h="";const b=V(5,false);const S=n.count;const E=n.linesSpace;if(f.language==="json"||p.length<1||p[p.length-1].charAt(0)!=="x"||/^x?(;|\}|\))$/.test(l)===false){return}if(s.stack[n.count]==="do"&&b==="while"&&s.token[n.count]==="}"){return}if(l===";"&&s.token[S-1]==="x{"){h=s.token[s.begin[S-2]-1];if(s.token[S-2]==="do"||s.token[S-2]===")"&&"ifforwhilecatch".indexOf(h)>-1){r=n.pop(s);l=f.script.correct===true?"}":"x}";m="end";q=n.structure[n.structure.length-1];B("");p.pop();n.linesSpace=E;return}r=n.pop(s);l=f.script.correct===true?"}":"x}";m="end";q=n.structure[n.structure.length-1];B("");p.pop();l=";";m="end";n.push(s,r,"");n.linesSpace=E;return}l=f.script.correct===true?"}":"x}";m="end";if(s.token[n.count]==="x}")return;if(s.stack[n.count]==="if"&&(s.token[n.count]===";"||s.token[n.count]==="x;")&&b==="else"){q=n.structure[n.structure.length-1];B("");p.pop();n.linesSpace=E;return}do{q=n.structure[n.structure.length-1];B("");p.pop();if(s.stack[n.count]==="do")break}while(p[p.length-1]==="x{");n.linesSpace=E}function oe(){let h=n.count;if(s.stack[h]==="object"&&f.script.objectSort===true){l=",";m="separator";_();B("")}else{do{h=h-1}while(h>0&&s.types[h-1]==="comment");n.splice({data:s,howmany:0,index:h,record:{begin:s.begin[h],ender:-1,lexer:"script",lines:n.linesSpace,stack:s.stack[h],token:",",types:"separator"}});B("")}}function X(h){let b=false;let S=false;const E=V(1,false);const w=s.token[n.count]==="("?n.count:s.begin[n.count];function T(){let M=0;const K=s.token[w-1]==="Array";const ee=K===true?"[":"{";const J=K===true?"]":"}";const fe=K===true?"array":"object";if(K===true&&s.types[n.count]==="number"){M=Number(s.token[n.count]);r=n.pop(s)}r=n.pop(s);r=n.pop(s);r=n.pop(s);n.structure.pop();l=ee;m="start";B(fe);if(M>0){l=",";m="separator";do{B("");M=M-1}while(M>0)}l=J;m="end";B("")}if(j>-1)y();if(G.length>0){if(G[G.length-1]===0){G.pop()}else{G[G.length-1]=G[G.length-1]-1}}if(c(h,41)||h==="x)"||c(h,93)){if(f.script.correct===true)ie();_()}if(c(h,41)||h==="x)")O(false);if(k.len>-1){if(c(h,125)&&(f.script.variableList==="list"&&k.count[k.len]===0||s.token[n.count]==="x;"&&f.script.variableList==="each")){N()}k.count[k.len]=k.count[k.len]-1;if(k.count[k.len]<0)N()}if(c(l,44)&&s.stack[n.count]!=="initializer"&&(c(h,93)&&c(s.token[n.count-1],91)||c(h,125))){r=n.pop(s)}if(c(h,41)||h==="x)"){l=h;if(z.length>0){I=z[z.length-1];if(I.length>1&&ne(E,123)&&(I[0]==="if"||I[0]==="for"||I[0]==="with"||I[0]==="while"&&s.stack[I[1]-2]!==void 0&&s.stack[I[1]-2]!=="do")){b=true}}}else if(c(h,93)){l="]"}else if(c(h,125)){if(ne(l,44)&&f.script.correct===true)ie();if(n.structure.length>0&&n.structure[n.structure.length-1][0]!=="object")O(true);if((f.script.objectSort===true||f.language==="json"&&f.json.objectSort===true)&&n.structure[n.structure.length-1][0]==="object"){n.objectSort(s)}if(m==="comment"){l=s.token[n.count];m=s.types[n.count]}l="}"}if(n.structure[n.structure.length-1][0]==="data_type"){m="type_end"}else{m="end"}z.pop();q=n.structure[n.structure.length-1];if(c(h,41)&&f.script.correct===true&&w-n.count<2&&(c(s.token[n.count],40)||s.types[n.count]==="number")&&(s.token[w-1]==="Array"||s.token[w-1]==="Object")&&s.token[w-2]==="new"){T();S=true}if(p[p.length-1]==="x{"&&c(h,125)){$();p.pop();if(s.stack[n.count]!=="try"){if(ne(E,58)&&ne(E,59)&&s.token[s.begin[e]-1]!=="?")$()}l="}"}else{p.pop()}if(f.script.endComma!==void 0&&f.script.endComma!=="none"&&n.structure[n.structure.length-1][0]==="array"||n.structure[n.structure.length-1][0]==="object"||n.structure[n.structure.length-1][0]==="data_type"){if(f.script.endComma==="always"&&s.token[n.count]!==","){const M=n.structure[n.structure.length-1][1];let K=n.count;do{if(s.begin[K]===M){if(c(s.token[K],44))break}else{K=s.begin[K]}K=K-1}while(K>M);if(K>M){const ee=m;const J=l;l=",";m="separator";B("");l=J;m=ee}}else if(f.script.endComma==="never"&&c(s.token[n.count],44)){n.pop(s)}}if(S===false){B("");if(l==="}"&&s.stack[n.count]!=="object"&&s.stack[n.count]!=="class"&&s.stack[n.count]!=="data_type"){C.pop();$()}}if(b===true){l=f.script.correct===true?"{":"x{";m="start";B(I[0]);p.push("x{");I[1]=n.count}u.pop();if(n.structure[n.structure.length-1][0]!=="data_type")u[u.length-1]=false}function Q(h,b,S){let E=0;let w=false;let T=false;let M=[h];let K;const ee=b.split(v);const J=ee.length;const fe=e;const se=e+h.length;const ue=f.script.quoteConvert===void 0?"none":f.script.quoteConvert;function me(){let ge=0;M=[];m=S;E=e;if(S==="string"&&/\s/.test(d[E+1])===true){ge=1;do{E=E+1;if(d[E]==="\n")ge=ge+1}while(Ede.replace(/\s*$/," ");const Oe=de=>de.replace(/^\s*/," ");if(/\{(#|\/|(%>)|(%\]))/.test(he)||/\}%(>|\])/.test(he))return he;he=he.replace(/\{((\{+)|%-?)\s*/g,be);he=he.replace(/\s*((\}\}+)|(-?%\}))/g,Oe);return he}return he}if(c(h,34)&&ue==="single"){M[0]="'";M[M.length-1]="'"}else if(c(h,39)&&ue==="double"){M[0]='"';M[M.length-1]='"'}else if(w===true){ge=M[M.length-1];M.pop();M.pop();M.push(ge)}e=E;if(b==="\n"){e=e-1;M.pop()}l=M.join(v);if(c(h,34)||c(h,39)||h==="{{"||h==="{%"){l=qe(l)}if(h==="{%"||h==="{{"){K=A(l);m=K[0];B(K[1]);return}if(S==="string"){m="string";if(f.language==="json"){l=l.replace(/\u0000/g,"\\u0000").replace(/\u0001/g,"\\u0001").replace(/\u0002/g,"\\u0002").replace(/\u0003/g,"\\u0003").replace(/\u0004/g,"\\u0004").replace(/\u0005/g,"\\u0005").replace(/\u0006/g,"\\u0006").replace(/\u0007/g,"\\u0007").replace(/\u0008/g,"\\u0008").replace(/\u0009/g,"\\u0009").replace(/\u000a/g,"\\u000a").replace(/\u000b/g,"\\u000b").replace(/\u000c/g,"\\u000c").replace(/\u000d/g,"\\u000d").replace(/\u000e/g,"\\u000e").replace(/\u000f/g,"\\u000f").replace(/\u0010/g,"\\u0010").replace(/\u0011/g,"\\u0011").replace(/\u0012/g,"\\u0012").replace(/\u0013/g,"\\u0013").replace(/\u0014/g,"\\u0014").replace(/\u0015/g,"\\u0015").replace(/\u0016/g,"\\u0016").replace(/\u0017/g,"\\u0017").replace(/\u0018/g,"\\u0018").replace(/\u0019/g,"\\u0019").replace(/\u001a/g,"\\u001a").replace(/\u001b/g,"\\u001b").replace(/\u001c/g,"\\u001c").replace(/\u001d/g,"\\u001d").replace(/\u001e/g,"\\u001e").replace(/\u001f/g,"\\u001f")}else if(h.indexOf("#!")===0){l=l.slice(0,l.length-1);n.linesSpace=2}else if(n.structure[n.structure.length-1][0]!=="object"||n.structure[n.structure.length-1][0]==="object"&&V(1,false)!==":"&&ne(s.token[n.count],44)&&ne(s.token[n.count],123)){if(l.length>f.wrap&&f.wrap>0||f.wrap!==0&&s.token[n.count]==="+"&&(s.token[n.count-1].charAt(0)==='"'||s.token[n.count-1].charAt(0)==="'")){let he=l;let be="";let Oe=ue==="double"?'"':ue==="single"?"'":he.charAt(0);const de=f.wrap;const We=/u[0-9a-fA-F]{4}/;const Xe=/x[0-9a-fA-F]{2}/;he=he.slice(1,he.length-1);if(s.token[n.count]==="+"&&(s.token[n.count-1].charAt(0)==='"'||s.token[n.count-1].charAt(0)==="'")){n.pop(s);Oe=s.token[n.count].charAt(0);he=s.token[n.count].slice(1,s.token[n.count].length-1)+he;n.pop(s)}if(he.length>de&&de>0){do{be=he.slice(0,de);if(be.charAt(de-5)==="\\"&&We.test(he.slice(de-4,de+1))){be=be.slice(0,de-5)}else if(be.charAt(de-4)==="\\"&&We.test(he.slice(de-3,de+2))){be=be.slice(0,de-4)}else if(be.charAt(de-3)==="\\"&&(We.test(he.slice(de-2,de+3))||Xe.test(he.slice(de-2,de+1)))){be=be.slice(0,de-3)}else if(be.charAt(de-2)==="\\"&&(We.test(he.slice(de-1,de+4))||Xe.test(he.slice(de-1,de+2)))){be=be.slice(0,de-2)}else if(be.charAt(de-1)==="\\"){be=be.slice(0,de-1)}be=Oe+be+Oe;he=he.slice(be.length-2);l=be;m="string";B(v);n.linesSpace=0;l="+";m="operator";B(v)}while(he.length>de)}if(he===v){l=Oe+Oe}else{l=Oe+he+Oe}m="string"}}}else if(/\{\s*\?>$/.test(l)){m="template_start"}else{m=S}if(l.length>0)B(v)}if(j>-1)y();if(d[e-1]==="\\"&&te(e-1)===true&&(d[e]==='"'||d[e]==="'")){n.pop(s);if(s.token[0]==="{"){if(d[e]==='"'){h='"';b='\\"';M=['"']}else{h="'";b="\\'";M=["'"]}w=true}else{if(d[e]==='"'){M=['\\"'];re();return}M=["\\'"];re();return}}E=se;if(Efe){T=true;if(c(d[E],123)&&c(d[E+1],37)&&d[E+2]!==h){re();Q("{%","%}","template");me()}else if(c(d[E],123)&&c(d[E+1],123)&&d[E+2]!==h){re();Q("{{","}}","template");me()}else{T=false;M.push(d[E])}}else{M.push(d[E])}if((c(h,34)||c(h,39))&&(T===true||E>fe)&&f.language!=="json"&&f.language!=="javascript"&&d[E-1]!=="\\"&&ne(d[E],34)&&ne(d[E],39)&&(c(d[E],10)||E===x-1===true)){n.error="Unterminated string in script on line number "+n.lineNumber;break}if(d[E]===ee[J-1]&&(d[E-1]!=="\\"||te(E-1)===false)){if(J===1)break;if(M[E-se]===ee[0]&&M.slice(E-se-J+2).join("")===b)break}E=E+1}while(E-1)y();W=n.wrapCommentLine({chars:d,end:x,lexer:"script",opening:"//",start:e,terminator:"\n"});e=W[1];if(W[0]!==""){l=W[0];m=/^(\/\/\s*@prettify-ignore-start)/.test(l)?"ignore":"comment";if(l.indexOf("# sourceMappingURL=")===2){R[0]=n.count+1;R[1]=l}n.push(s,{begin:n.structure[n.structure.length-1][1],ender:-1,lexer:"script",lines:n.linesSpace,stack:n.structure[n.structure.length-1][0],token:l,types:m},"")}}function le(){let h=0;let b=false;let S=false;let E=0;let w=0;let T=0;let M="";let K="";let ee="";const J=[];const fe=u[u.length-1];const se="0123456789=<>+-*?|^:&.,;%(){}[]~";function ue(){if(l==="(")n.structure[n.structure.length-1]=["paren",n.count];H.lexers.markup(J.join(""))}if(j>-1)y();K=n.count>0?s.token[n.count-1]:"";ee=n.count>0?s.types[n.count-1]:"";M=V(1,false);if(f.language!=="jsx"&&f.language!=="tsx"&&/\d/.test(M)===false&&(l==="function"||K==="=>"||K==="void"||K==="."||s.stack[n.count]==="arguments"||m==="type"&&K==="type"||m==="reference"&&(ee==="operator"||K==="function"||K==="class"||K==="new")||m==="type"&&ee==="operator"||l==="return"||m==="operator")){const me=[];let re=0;let ge=0;h=e;do{me.push(d[h]);if(d[h]==="<"){re=re+1}else if(d[h]===">"){re=re-1;if(re<1)break}h=h+1}while(h"&&(fe===true||K==="=>"||K==="."||ee!=="operator"||ee==="operator"&&(M==="("||M==="="))){m="generic";l=me.join("").replace(/^<\s+/,"<").replace(/\s+>$/,">").replace(/,\s*/g,", ");B("");return}e=ge}h=n.count;if(s.types[h]==="comment"){do{h=h-1}while(h>0&&s.types[h]==="comment")}if(fe===false&&V(1,false)!==">"&&(d[e]!=="<"&&se.indexOf(d[e+1])>-1||s.token[h]==="++"||s.token[h]==="--"||/\s/.test(d[e+1])===true||/\d/.test(d[e+1])===true&&(m==="operator"||m==="string"||m==="number"||m==="reference"||m==="word"&&l!=="return"))){m="operator";l=D();return B("")}if(f.language!=="typescript"&&(s.token[h]==="return"||s.types[h]==="operator"||s.types[h]==="start"||s.types[h]==="separator"||s.types[h]==="jsx_attribute_start"||s.token[h]==="}"&&n.structure[n.structure.length-1][0]==="global")){m="markup";f.language="jsx";do{J.push(d[e]);if(d[e]==="{"){w=w+1;b=true}else if(d[e]==="}"){w=w-1;if(w===0)b=false}else if(d[e]==="<"&&b===false){if(d[e+1]==="<"){do{J.push(d[e]);e=e+1}while(e"&&b===false){if(d[e+1]===">"){do{J.push(d[e]);e=e+1}while(d[e+1]===">")}E=E-1;if(S===true){T=T-1}else if(d[e-1]!=="/"){T=T+1}if(E===0&&w===0&&T<1){M=V(2,false);if(M.charAt(0)!=="<")return ue();if(M.charAt(0)==="<"&&se.indexOf(M.charAt(1))<0&&/\s/.test(M.charAt(1))===false){h=e+1;do{h=h+1;if(d[h]===">"||/\s/.test(d[h-1])&&se.indexOf(d[h])<0)break;if(se.indexOf(d[h])>-1)return ue()}while(h","+","*","?","|","^",":","&","%","~"];const T=w.length;if(j>-1)y();if(d[e]==="/"&&(n.count>-1&&(m!=="word"&&m!=="reference"||l==="typeof"||l==="return"||l==="else")&&m!=="number"&&m!=="string"&&m!=="end")){if(l==="return"||l==="typeof"||l==="else"||m!=="word"){l=ye();m="regex"}else{l="/";m="operator"}B("");return"regex"}if(d[e]==="?"&&("+-*/.?".indexOf(d[e+1])>-1||d[e+1]===":"&&w.join("").indexOf(d[e+2])<0)){if(d[e+1]==="."&&/\d/.test(d[e+2])===false){E="?."}else if(d[e+1]==="?"){E="??"}if(E==="")return"?"}if(d[e]===":"&&"+-*/".indexOf(d[e+1])>-1)return":";if(e"){E="->"}if(E==="")return"-"}if(d[e]==="+"){u[u.length-1]=false;if(d[e+1]==="+"){E="++"}else if(d[e+1]==="="){E="+="}if(E==="")return"+"}if(d[e]==="="&&d[e+1]!=="="&&d[e+1]!=="!"&&d[e+1]!==">"){u[u.length-1]=false;return"="}}if(d[e]===":"){if(f.language==="typescript"){if(s.stack[n.count]==="arguments"){if(s.token[n.count]==="?"){n.pop(s);E="?:";e=e-1}u[u.length-1]=true}else if(l===")"&&(s.token[s.begin[n.count]-1]==="function"||s.token[s.begin[n.count]-2]==="function")){u[u.length-1]=true}else if(m==="reference"){h=n.count;let M=false;do{if(s.begin[h]===s.begin[n.count]){if(hs.begin[n.count])}}else if(s.token[n.count-1]==="["&&(s.types[n.count]==="word"||s.types[n.count]==="reference")){n.structure[n.structure.length-1][0]="attribute";s.stack[n.count]="attribute"}}if(E===""){if(d[e+1]==="+"&&d[e+2]==="+"||d[e+1]==="-"&&d[e+2]==="-"){E=d[e]}else{const M=[d[e]];h=e+1;if(h"&&l===")"){h=n.count;S=s.begin[h];do{if(s.begin[h]===S)s.stack[h]="method";h=h-1}while(h>S-1)}return E}function ie(){let h=true;let b="+";let S="";let E="";let w="";let T=0;let M=0;let K=0;let ee="";const J=[];function fe(){K=s.begin[K]-1;if(s.types[K]==="end"){fe()}else if(s.token[K-1]==="."){se()}}function se(){K=K-2;if(s.types[K]==="end"){fe()}else if(s.token[K-1]==="."){se()}}function ue(){let re=0;const ge=J.length;if(re-1)return;T=K;if(T0)}}while(T>0&&(s.token[T]==="."||s.types[T]==="word"||s.types[T]==="reference"||s.types[T]==="end"));if(s.token[T]===","&&d[e]!==";"&&ee!==";"&&d[e]!=="}"&&ee!=="}"&&d[e]!==")"&&ee!==")"){return}if(s.types[T]==="operator"){if(s.stack[T]==="switch"&&s.token[T]===":"){do{T=T-1;if(s.types[T]==="start"){M=M-1;if(M<0)break}else if(s.types[T]==="end"){M=M+1}if(s.token[T]==="?"&&M===0)return}while(T>0)}else{return}}h=false;b=S==="--"?"-":"+"}else if(w==="["||w===";"||w==="x;"||w==="}"||w==="{"||w==="("||w===")"||w===","||w==="return"){if(S==="++"||S==="--"){if(w==="["||w==="("||w===","||w==="return")return;if(S==="--")b="-";h=false}else if(E==="--"||S==="--"){b="-"}}else{return}if(h===false)r=n.pop(s);K=n.count;if(s.types[K]==="end"){fe()}else if(s.token[K-1]==="."){se()}T=K;if(T0){do{if(d[b]==="\\"){S=S+1}else{break}b=b-1}while(b>0)}if(S%2===0){break}}else{break}}h=h+1}while(h0);return(b-h)%2===1}function U(h){let b=n.count;let S="";let E="";let w="";let T=false;p.push(h);if(h==="{"&&(s.types[n.count]==="type"||s.types[n.count]==="type_end"||s.types[n.count]==="generic")){let M=0;if(s.types[n.count]==="type_end")b=s.begin[n.count];M=b;do{b=b-1;if(s.begin[b]!==M&&s.begin[b]!==-1)break;if(s.token[b]===":")break}while(b>s.begin[b]);if(s.token[b]===":"&&s.stack[b-1]==="arguments"){u.push(false);T=true}else{u.push(u[u.length-1])}b=n.count}else if(h==="["&&s.types[n.count]==="type_end"){u.push(true)}else{u.push(u[u.length-1])}if(j>-1){y();b=n.count}if(k.len>-1)k.count[k.len]=k.count[k.len]+1;if(s.token[b-1]==="function"){z.push(["function",b+1])}else{z.push([l,b+1])}l=h;if(u[u.length-1]===true){m="type_start"}else{m="start"}if(h==="("||h==="x("){_()}else if(h==="{"){if(t>-1){if(s.begin[t-1]===s.begin[s.begin[b]-1]||s.token[s.begin[b]]==="x("){t=-1;if(f.script.correct===true){X(")")}else{X("x)")}_();l="{";m="start"}}else if(l===")"){_()}if(m==="comment"&&s.token[b-1]===")"){l=s.token[b];s.token[b]="{";m=s.types[b];s.types[b]="start"}}S=(()=>{let M=n.count;if(s.types[M]==="comment"){do{M=M-1}while(M>0&&s.types[M]==="comment")}return s.token[M]})();E=s.stack[b]===void 0?"":(()=>{let M=n.count;if(s.types[M]==="comment"){do{M=M-1}while(M>0&&s.types[M]==="comment")}return s.token[s.begin[M]-1]})();if(c(l,123)&&(s.types[b]==="word"||s.token[b]==="]")){let M=b;if(s.token[M]==="]"){do{M=s.begin[M]-1}while(s.token[M]==="]")}do{if(s.types[M]==="start"||s.types[M]==="end"||s.types[M]==="operator")break;M=M-1}while(M>0);if(s.token[M]===":"&&s.stack[M-1]==="arguments"){w="function";C.push(i);i=[]}}if(m==="type_start"){w="data_type"}else if(w===""&&(c(l,123)||l==="x{")){if(S==="else"||S==="do"||S==="try"||S==="finally"||S==="switch"){w=S}else if(G[G.length-1]===0&&S!=="return"){G.pop();w="class"}else if(s.token[b-1]==="class"){w="class"}else if(s.token[b]==="]"&&s.token[b-1]==="["){w="array"}else if((s.types[b]==="word"||s.types[b]==="reference")&&(s.types[b-1]==="word"||s.types[b-1]==="reference"||s.token[b-1]==="?"&&(s.types[b-2]==="word"||s.types[b-2]==="reference"))&&s.token[b]!=="in"&&s.token[b-1]!=="export"&&s.token[b-1]!=="import"){w="map"}else if(s.stack[b]==="method"&&s.types[b]==="end"&&(s.types[s.begin[b]-1]==="word"||s.types[s.begin[b]-1]==="reference")&&s.token[s.begin[b]-2]==="new"){w="initializer"}else if(c(l,123)&&(c(S,41)||S==="x)")&&(s.types[s.begin[b]-1]==="word"||s.types[s.begin[b]-1]==="reference"||s.token[s.begin[b]-1]==="]")){if(E==="if"){w="if"}else if(E==="for"){w="for"}else if(E==="while"){w="while"}else if(E==="class"){w="class"}else if(E==="switch"||s.token[s.begin[b]-1]==="switch"){w="switch"}else if(E==="catch"){w="catch"}else{w="function"}}else if(c(l,123)&&(S===";"||S==="x;")){w="block"}else if(c(l,123)&&s.token[b]===":"&&s.stack[b]==="switch"){w="block"}else if(s.token[b-1]==="import"||s.token[b-2]==="import"||s.token[b-1]==="export"||s.token[b-2]==="export"){w="object"}else if(c(S,41)&&(I[0]==="function"||I[0]==="if"||I[0]==="for"||I[0]==="class"||I[0]==="while"||I[0]==="switch"||I[0]==="catch")){w=I[0]}else if(s.stack[b]==="notation"){w="function"}else if((s.types[b]==="number"||s.types[b]==="string"||s.types[b]==="word"||s.types[b]==="reference")&&(s.types[b-1]==="word"||s.types[b-1]==="reference")&&s.token[s.begin[b]-1]!=="for"){w="function"}else if(n.structure.length>0&&s.token[b]!==":"&&n.structure[n.structure.length-1][0]==="object"&&(s.token[s.begin[b]-2]==="{"||s.token[s.begin[b]-2]===",")){w="function"}else if(s.types[I[1]-1]==="markup"&&s.token[I[1]-3]==="function"){w="function"}else if(S==="=>"){w="function"}else if(T===true||s.types[n.count]==="type_end"&&s.stack[s.begin[n.count]-2]==="arguments"){w="function"}else if(c(S,41)&&s.stack[b]==="method"&&(s.types[s.begin[b]-1]==="word"||s.types[s.begin[b]-1]==="property"||s.types[s.begin[b]-1]==="reference")){w="function"}else if(s.types[b]==="word"&&c(l,123)&&s.token[b]!=="return"&&s.token[b]!=="in"&&s.token[b]!=="import"&&s.token[b]!=="const"&&s.token[b]!=="let"&&s.token[b]!==""){w="block"}else if(c(l,123)&&"if|else|for|while|function|class|switch|catch|finally".indexOf(s.stack[b])>-1&&(s.token[b]==="x}"||s.token[b]==="}")){w="block"}else if(s.stack[b]==="arguments"){w="function"}else if(s.types[b]==="generic"){do{b=b-1;if(s.token[b]==="function"||s.stack[b]==="arguments"){w="function";break}if(s.token[b]==="interface"){w="map";break}if(s.token[b]===";"){w="object";break}}while(b>s.begin[n.count])}else{w="object"}if(w!=="object"&&w!=="class"){if(w==="function"){C.push(i);i=[]}else{C.push([])}}}else if(l==="["){w="array"}else if(l==="("||l==="x("){if(S==="function"||s.token[b-1]==="function"||s.token[b-1]==="function*"||s.token[b-2]==="function"){w="arguments"}else if(s.token[b-1]==="."||s.token[s.begin[b]-2]==="."){w="method"}else if(s.types[b]==="generic"){w="method"}else if(s.token[b]==="}"&&s.stack[b]==="function"){w="method"}else if(S==="if"||S==="for"||S==="class"||S==="while"||S==="catch"||S==="finally"||S==="switch"||S==="with"){w="expression"}else if(s.types[b]==="word"||s.types[b]==="property"||s.types[b]==="reference"){w="method"}else{w="paren"}}B(w);if(G.length>0)G[G.length-1]=G[G.length-1]+1}function Y(){const h=[d[e]];e=e+1;if(e-1){do{if(E===g[S]&&(E!=="block"||/\{%\s*\w/.test(a)===false)){return["template_start",`template_${E}`]}if(E==="end"+g[S]){return["template_end",""]}S=S-1}while(S>-1)}return["template",""]}function N(){k.count.pop();k.index.pop();k.word.pop();k.len=k.len-1}function y(){let h=j;let b=1;let S="";let E="";let w=l;let T=m;const M=[];function K(){p.push("x{");n.splice({data:s,howmany:1,index:n.count-3})}function ee(J,fe,se){const ue=s.begin[J];let me=0;do{if(s.token[J]===fe&&s.types[J]==="word"){if(se===true){s.types[J]="reference"}else if(s.begin[J]>ue&&s.token[s.begin[J]]==="{"&&s.stack[J]!=="object"&&s.stack[J]!=="class"&&s.stack[J]!=="data_type"){if(s.stack[J]==="function"){s.types[J]="reference"}else{me=s.begin[J];do{if(s.stack[me]==="function"){s.types[J]="reference";break}me=s.begin[me]}while(me>ue)}}}J=J-1}while(J>ue)}do{M.push(d[h]);if(d[h]==="\\"){n.error=`Illegal escape in JavaScript on line number ${n.lineNumber}`}h=h+1}while(h0&&S==="function"&&s.token[n.count]==="("&&(s.token[n.count-1]==="{"||s.token[n.count-1]==="x{")){s.types[n.count]="start"}if(n.count>1&&S==="function"&&l==="("&&(s.token[n.count-1]==="}"||s.token[n.count-1]==="x}")){if(s.token[n.count-1]==="}"){h=n.count-2;if(h>-1){do{if(s.types[h]==="end"){b=b+1}else if(s.types[h]==="start"||s.types[h]==="end"){b=b-1}if(b===0)break;h=h-1}while(h>-1)}if(s.token[h]==="{"&&s.token[h-1]===")"){b=1;h=h-2;if(h>-1){do{if(s.types[h]==="end"){b=b+1}else if(s.types[h]==="start"||s.types[h]==="end"){b=b-1}if(b===0)break;h=h-1}while(h>-1)}if(s.token[h-1]!=="function"&&s.token[h-2]!=="function"){s.types[n.count]="start"}}}else{s.types[n.count]="start"}}if(f.script.correct===true&&(S==="Object"||S==="Array")&&d[e+1]==="("&&d[e+2]===")"&&s.token[n.count-1]==="="&&s.token[n.count]==="new"){if(S==="Object"){s.token[n.count]="{";l="}";s.stack[n.count]="object";n.structure[n.structure.length-1][0]="object"}else{s.token[n.count]="[";l="]";s.stack[n.count]="array";n.structure[n.structure.length-1][0]="array"}s.types[n.count]="start";m="end";d[e+1]="";d[e+2]="";e=e+2}else{b=n.count;h=b;if(f.script.variableList!=="none"&&(S==="var"||S==="let"||S==="const")){if(s.types[b]==="comment"){do{b=b-1}while(b>0&&s.types[b]==="comment")}if(f.script.variableList==="list"&&k.len>-1&&k.index[k.len]===b&&S===k.word[k.len]){l=",";m="separator";s.token[b]=l;s.types[b]=m;k.count[k.len]=0;k.index[k.len]=b;k.word[k.len]=S;return}k.len=k.len+1;k.count.push(0);k.index.push(b);k.word.push(S);b=h}else if(k.len>-1&&S!==k.word[k.len]&&n.count===k.index[k.len]&&s.token[k.index[k.len]]===";"&&l!==k.word[k.len]&&f.script.variableList==="list"){N()}if(S==="from"&&s.token[n.count]==="x;"&&s.token[n.count-1]==="}"){_()}if(S==="while"&&s.token[n.count]==="x;"&&s.token[n.count-1]==="}"){let J=0;let fe=n.count-2;if(fe>-1){do{if(s.types[fe]==="end"){J=J+1}else if(s.types[fe]==="start"){J=J-1}if(J<0){if(s.token[fe]==="{"&&s.token[fe-1]==="do")_();return}fe=fe-1}while(fe>-1)}}if(T==="comment"){let J=n.count;do{J=J-1}while(J>0&&s.types[J]==="comment");T=s.types[J];w=s.token[J]}E=V(2,false);if(S==="void"){if(w===":"&&s.stack[n.count-1]==="arguments"){m="type"}else{m="word"}}else if((n.structure[n.structure.length-1][0]==="object"||n.structure[n.structure.length-1][0]==="class"||n.structure[n.structure.length-1][0]==="data_type")&&(s.token[n.count]==="{"||s.token[s.begin[n.count]]==="{"&&s.token[n.count]===","||s.types[n.count]==="template_end"&&(s.token[s.begin[n.count]-1]==="{"||s.token[s.begin[n.count]-1]===","))){if(S==="return"||S==="break"){m="word"}else{m="property"}}else if(u[u.length-1]===true||(f.language==="typescript"||f.language==="flow")&&w==="type"){m="type"}else if(C.length>0&&(w==="function"||w==="class"||w==="const"||w==="let"||w==="var"||w==="new"||w==="void")){m="reference";C[C.length-1].push(S);if(f.language==="javascript"||f.language==="jsx"||f.language==="typescript"||f.language==="tsx"){if(w==="var"||w==="function"&&s.types[n.count-1]!=="operator"&&s.types[n.count-1]!=="start"&&s.types[n.count-1]!=="end"){ee(n.count,S,true)}else{ee(n.count,S,false)}}else{ee(n.count,S,false)}}else if(n.structure[n.structure.length-1][0]==="arguments"&&m!=="operator"){m="reference";i.push(S)}else if(w===","&&s.stack[n.count]!=="method"&&(s.stack[n.count]!=="expression"||s.token[s.begin[n.count]-1]==="for")){let J=n.count;const fe=n.structure[n.structure.length-1][1];do{if(s.begin[J]===fe){if(s.token[J]===";")break;if(s.token[J]==="var"||s.token[J]==="let"||s.token[J]==="const"||s.token[J]==="type"){break}}else if(s.types[J]==="end"){J=s.begin[J]}J=J-1}while(J>fe);if(C.length>0&&s.token[J]==="var"){m="reference";C[C.length-1].push(S);if(f.language==="javascript"||f.language==="jsx"||f.language==="typescript"||f.language==="tsx"){ee(J,S,true)}else{ee(J,S,false)}}else if(C.length>0&&(s.token[J]==="let"||s.token[J]==="const"||s.token[J]==="type"&&(f.language==="typescript"||f.language==="tsx"))){m="reference";C[C.length-1].push(S);ee(J,S,false)}else{m="word"}}else if(n.structure[n.structure.length-1][0]!=="object"||n.structure[n.structure.length-1][0]==="object"&&l!==","&&l!=="{"){let J=C.length;let fe=0;if(J>0){do{J=J-1;fe=C[J].length;if(fe>0){do{fe=fe-1;if(S===C[J][fe])break}while(fe>0);if(S===C[J][fe])break}}while(J>0);if(C[J][fe]===S&&w!=="."){m="reference"}else{m="word"}}else{m="word"}}else{m="word"}l=S;if(S==="from"&&s.token[n.count]==="}")_()}B("");if(S==="class")G.push(0);if(S==="do"){E=V(1,true);if(E!=="{"){l=f.script.correct===true?"{":"x{";m="start";p.push("x{");B("do")}}if(S==="else"){E=V(2,true);let J=n.count-1;if(s.types[J]==="comment"){do{J=J-1}while(J>0&&s.types[J]==="comment")}if(s.token[J]==="x}"){if(s.token[n.count]==="else"){if(s.stack[n.count-1]!=="if"&&s.types[n.count-1]!=="comment"&&s.stack[n.count-1]!=="else"){p.pop();n.splice({data:s,howmany:0,index:n.count-1,record:{begin:s.begin[s.begin[s.begin[n.count-1]-1]-1],ender:-1,lexer:"script",lines:0,stack:"if",token:f.script.correct===true?"}":"x}",types:"end"}});if(n.structure.length>1){n.structure.splice(n.structure.length-2,1);n.structure[n.structure.length-1][1]=n.count}}else if(s.token[n.count-2]==="x}"&&q[0]!=="if"&&s.stack[n.count]==="else"){K()}else if(s.token[n.count-2]==="}"&&s.stack[n.count-2]==="if"&&q[0]==="if"&&s.token[q[1]-1]!=="if"&&s.token[s.begin[n.count-1]]==="x{"){K()}}else if(s.token[n.count]==="x}"&&s.stack[n.count]==="if"){K()}}if(E!=="if"&&E.charAt(0)!=="{"){l=f.script.correct===true?"{":"x{";m="start";p.push("x{");B("else")}}if((S==="for"||S==="if"||S==="switch"||S==="catch")&&s.token[n.count-1]!=="."){E=V(1,true);if(E!=="("){t=n.count;if(f.script.correct===true){U("(")}else{U("x(")}}}}do{if(/\s/.test(d[e])){if(j>-1)y();e=n.spacer({array:d,end:x,index:e});if(n.linesSpace>1&&l!==";"&&L","comment")}else if(d[e]==="<"){le()}else if(d[e]==="/"&&(e===x-1||d[e+1]==="*")){F()}else if((n.count<0||s.lines[n.count]>0)&&d[e]==="#"&&d[e+1]==="!"&&(d[e+2]==="/"||d[e+2]==="[")){Q("#!"+d[e+2],"\n","string")}else if(d[e]==="/"&&(e===x-1||d[e+1]==="/")){Z()}else if(c(d[e],96)||c(d[e],125)&&n.structure[n.structure.length-1][0]==="template_string"){if(j>-1)y();l=Y();if(c(l,125)&&l.slice(l.length-2)==="${"){m="template_string_else";B("template_string")}else if(l.slice(l.length-2)==="${"){m="template_string_start";B("template_string")}else if(c(l[0],125)){m="template_string_end";B("")}else{m="string";B("")}}else if(d[e]==='"'||d[e]==="'"){Q(d[e],d[e],"string")}else if(d[e]==="-"&&(e-1)y();l="-";m="operator";B("")}else if(j===-1&&(d[e]!=="0"||d[e]==="0"&&d[e+1]!=="b")&&(/\d/.test(d[e])||e!==x-2&&d[e]==="-"&&d[e+1]==="."&&/\d/.test(d[e+2])||e!==x-1&&(d[e]==="-"||d[e]===".")&&/\d/.test(d[e+1]))){if(j>-1)y();if(m==="end"&&d[e]==="-"){l="-";m="operator"}else{l=ae();m="number"}B("")}else if(d[e]===":"&&d[e+1]===":"){if(j>-1)y();if(f.script.correct===true)ie();_();e=e+1;l="::";m="separator";B("")}else if(d[e]===","){if(j>-1)y();if(f.script.correct===true)ie();if(u[u.length-1]===true&&s.stack[n.count].indexOf("type")<0){u[u.length-1]=false}if(m==="comment"){oe()}else if(k.len>-1&&k.count[k.len]===0&&f.script.variableList==="each"){_();l=";";m="separator";B("");l=k.word[k.len];m="word";B("");k.index[k.len]=n.count}else{l=",";m="separator";_();B("")}}else if(d[e]==="."){if(j>-1)y();u[u.length-1]=false;if(d[e+1]==="."&&d[e+2]==="."){l="...";m="operator";e=e+2}else{_();l=".";m="separator"}if(/\s/.test(d[e-1])===true)n.linesSpace=1;B("")}else if(d[e]===";"){if(j>-1)y();if(u[u.length-1]===true&&s.stack[n.count].indexOf("type")<0){u[u.length-1]=false}if(G[G.length-1]===0)G.pop();if(k.len>-1&&k.count[k.len]===0){if(f.script.variableList==="each"){N()}else{k.index[k.len]=n.count+1}}if(f.script.correct===true)ie();l=";";m="separator";if(s.token[n.count]==="x}"){P()}else{B("")}$()}else if(d[e]==="("||d[e]==="["||d[e]==="{"){U(d[e])}else if(d[e]===")"||d[e]==="]"||d[e]==="}"){X(d[e])}else if(d[e]==="*"&&s.stack[n.count]==="object"&&j<0&&/\s/.test(d[e+1])===false&&d[e+1]!=="="&&/\d/.test(d[e+1])===false){j=e}else if(d[e]==="="||d[e]==="&"||d[e]==="<"||d[e]===">"||d[e]==="+"||d[e]==="-"||d[e]==="*"||d[e]==="/"||d[e]==="!"||d[e]==="?"||d[e]==="|"||d[e]==="^"||d[e]===":"||d[e]==="%"||d[e]==="~"){l=D();if(l==="regex"){l=s.token[n.count]}else if(l==="*"&&s.token[n.count]==="function"){s.token[n.count]="function*"}else{m="operator";if(l!=="!"&&l!=="++"&&l!=="--")_();B("")}}else if(j<0&&d[e]!==""){j=e}if(k.len>-1&&n.count===k.index[k.len]+1&&s.token[k.index[k.len]]===";"&&l!==k.word[k.len]&&m!=="comment"&&f.script.variableList==="list"){N()}e=e+1}while(e-1)y();if((s.token[n.count]!=="}"&&s.token[0]==="{"||s.token[0]!=="{")&&(s.token[n.count]!=="]"&&s.token[0]==="["||s.token[0]!=="[")){O(false)}if(R[0]===n.count){l="\n"+R[1];m="string";B("")}if(s.token[n.count]==="x;"&&(s.token[n.count-1]==="}"||s.token[n.count-1]==="]")&&s.begin[n.count-1]===0){n.pop(s)}return s};var Be={markup:"markup",html:"markup",liquid:"markup",xml:"markup",javascript:"script",typescript:"script",jsx:"script",tsx:"script",json:"script",less:"style",scss:"style",sass:"style",css:"style",text:"text"};var Ke={html:"HTML",xhtml:"XHTML",liquid:"Liquid",xml:"XML",jsx:"JSX",tsx:"TSX",json:"JSON",yaml:"YAML",css:"CSS",scss:"SCSS",sass:"SASS",less:"LESS",text:"Plain Text",javascript:"JavaScript",typescript:"TypeScript"};function st(o){return typeof o!=="string"||o.indexOf("html")>-1||Be[o]===void 0?"markup":Be[o]}function yt(o){if(typeof o!=="string"||Ke[o]===void 0)return o.toUpperCase();return Ke[o]}function ke(o){const a={};if(o==="unknown"){a.language=o;a.languageName="Unknown";a.lexer="markup"}else if(o==="xhtml"||o==="markup"){a.language="xml";a.languageName="XHTML";a.lexer="markup"}else{a.language=o;a.languageName=yt(o);a.lexer=st(o)}if(H.hooks.language.length>0){for(const f of H.hooks.language){const e=f(a);if(typeof e==="object")Ie(a,e)}}return a}Ve.reference=ke;Ve.listen=function(o){H.hooks.language.push(o)};function Ve(o){let a=[];let f=0;const e=/(((var)|(let)|(const)|(function)|(import))\s+(\w|\$)+[a-zA-Z0-9]*)/.test(o)&&/@import/.test(o)===false;const l=/((((final)|(public)|(private))\s+static)|(static\s+void))/.test(o);function m(){if(/\n\s*#+\s+/.test(o)||/^#+\s+/.test(o))return ke("markdown");if(/\$[a-zA-Z]/.test(o)||/\{\s*(\w|\.|\$|#)+\s*\{/.test(o)||/^[.#]?[\w][\w-]+\s+\{(?:\s+[a-z][a-z-]+:\s*\S+;)+\s+[&>+]?\s+[.#:]?[\w][\w-]\s+\{/.test(o)&&/:\s*@[a-zA-Z];/.test(o)===false)return ke("scss");if(/@[a-zA-Z]:/.test(o)||/\.[a-zA-Z]\(\);/.test(o))return ke("less");return ke("css")}function I(){let j=1;let t=v;let i=false;let r=false;const q=/((public)|(private))\s+(static\s+)?(((v|V)oid)|(class)|(final))/.test(o);function W(){if(o.indexOf("(")>-1||o.indexOf("=")>-1||o.indexOf(";")>-1&&o.indexOf("{")>-1){if(l===true||/\w<\w+(,\s+\w+)*>/.test(o))return ke("typescript");if(/(?:var|let|const)\s+\w+\s*:/.test(o)||/=\s*<\w+/.test(o))return ke("typescript");return ke("javascript")}return ke("unknown")}function s(){if(/:\s*(?:number|string|boolean|any|unknown)(?:\[\])?/.test(o)||/(?:public|private)\s+/.test(o)||/(?:export|declare)\s+type\s+\w+\s*=/.test(o)||/(?:namespace|interface|enum|implements|declare)\s+\w+/.test(o)||/(?:typeof|keyof|as)\s+\w+/.test(o)||/\w+\s+as\s+\w+/.test(o)||/\[\w+(?:(?::\s*\w+)|(?:\s+in\s+\w+))\]:/.test(o)||/\):\s*\w+(?:\[\])?\s*(?:=>|\{)\s+/.test(o)||/(var|const|let)\s+\w+:\s*(string|number|boolean|string|any)(\[\])?/.test(o))return ke("typescript");if(/\s(class|var|const|let)\s+\w/.test(o)===false&&/<[a-zA-Z](?:-[a-zA-Z])?/.test(o)&&/<\/[a-zA-Z-](?:-[a-zA-Z])?/.test(o)&&(/\s?\{%/.test(o)||/{{/.test(o)))return ke("liquid");if(/^(\s*[$@])/.test(o)===false&&/([}\]];?\s*)$/.test(o)){if(/^\s*import\s+\*\s+as\s+\w+\s+from\s+['"]/.test(o)||/module\.export\s+=\s+/.test(o)||/export\s+default\s+\{/.test(o)||/[?:]\s*[{[]/.test(o)||/^(?:\s*return;?(?:\s+[{[])?)/.test(o)){return ke("javascript")}}if(/{%/.test(o)&&/{{/.test(o)&&/<\w/.test(o))return ke("liquid");if(/{\s*(?:\w|\.|@|#)+\s*\{/.test(o))return ke("less");if(/\$(\w|-)/.test(o))return ke("scss");if(/[;{:]\s*@\w/.test(o)===true)return ke("less");return ke("css")}if(j-1&&(/^(\s*[\u007b\u0024\u002e#@a-z0-9])/i.test(o)||/^(\s*\/(\*|\/))/.test(o)||/^(\s*\*\s*\{)/.test(o))&&/^(\s*if\s*\()/.test(o)===false&&/=\s*(\{|\[|\()/.test(t)===false&&(/(\+|-|=|\?)=/.test(t)===false||/\/\/\s*=+/.test(t)||/=+('|")?\)/.test(o)&&/;\s*base64/.test(o))&&/function(\s+\w+)*\s*\(/.test(t)===false)return s();return o.indexOf("{%")>-1?ke("liquid"):ke("unknown")}function L(){function j(){return/{%-?\s*(schema|for|if|unless|render|include)/.test(o)||/{%-?\s*end\w+/.test(o)||/{{-?\s*content_for/.test(o)||/{{-?\s*[a-zA-Z0-9_'".[\]]+\s*-?}}/.test(o)||/{%/.test(o)&&/%}/.test(o)&&/{{/.test(o)&&/}}/.test(o)?ke("liquid"):ke("html")}return/^(\s*)/i.test(o)||/^(\s*/i.test(o)&&/<\/ul>/i.test(o)||//.test(o)&&/<\/head>/.test(o)||/^(\s*)/i.test(o))return L();if(/^\s*@(?:charset|import|include|keyframes|media|namespace|page)\b/.test(o))return m();if(l===false&&/=(>|=|-|\+|\*)/.test(o)===false&&/^(?:\s*((if)|(for)|(function))\s*\()/.test(o)===false&&/(?:\s|;|\})((if)|(for)|(function\s*\w*))\s*\(/.test(o)===false&&e===false&&/return\s*\w*\s*(;|\})/.test(o)===false&&(o===void 0||/^(?:\s*#(?!(!\/)))/.test(o)||/\n\s*(\.|@)\w+(\(|(\s*:))/.test(o)&&/>\s*<\w/.test(o)===false||(/^\s*:root\s*\{/.test(o)||/-{2}\w+\s*\{/.test(o)||/^\s*(?:body|button|hr|section|h[1-6]|p|strong|\*)\s+\{\s+/.test(o))))return m();a=o.replace(/\[[a-zA-Z][\w-]*=['"]?[a-zA-Z][\w-]*['"]?\]/g,v).split(v);f=a.length;if(/^(\s*({{|{%|<))/.test(o))return L();if(l===true||/^(?:[\s\w-]*<)/.test(o)===false&&/(?:>[\s\w-]*)$/.test(o)===false)return I();return(/^(?:\s*<\?xml)/.test(o)||/(?:>[\w\s:]*)?<(?:\/|!|#)?[\w\s:\-[]+/.test(o)||/^\s*\s*$/.test(o))&&(/^(?:[\s\w]*<)/.test(o)||/(?:>[\s\w]*)$/.test(o))||/^(?:\s*\s*)$/i.test(o)?/^(?:[\s\w]*<)/.test(o)===false||/(?:>[\s\w]*)$/.test(o)===false?I():L():ke("unknown")}H.lexers.markup=function o(a){const{options:f}=H;const{data:e}=n;const l=f.language==="jsx"||f.language==="tsx";const m=f.language==="html"||f.language==="liquid";const I=f.markup;const L=I.attributeSortList.length;const j={end:0,index:-1,start:0,line:1};const t=a.split(v);const i=t.length;let r=0;let q=false;let W="javascript";let s=m?f.language:"html";let C=0;function x(u){if(m===true&&l===false){if(/(?:{[=#/]|%[>\]])|\}%[>\]]/.test(u))return u;if(I.delimiterSpacing===true){u=u.replace(/{[{%]-?\s*/g,g=>g.replace(/\s*$/," "));u=u.replace(/\s*-?[%}]}/g,g=>g.replace(/^\s*/," "))}return u}return u}function d(u,g,k){if(u===e){if(g.types.indexOf("end")>-1){j.end=j.end+1}else if(g.types.indexOf("start")>-1){j.start=j.start+1}}j.index=n.count;j.line=n.lineNumber;n.push(u,g,k)}function z(u){let g=0;let k=v;const O=/^(?:<|{%-?|{{-?)=?\s*/;if(typeof u!=="string")return v;g=u.replace(O,"%").replace(/\s+/," ").indexOf(" ");k=u.replace(O," ");k=g<0?k.slice(1,u.length-1):k.slice(1,g);if(s==="html")k=k.toLowerCase();k=k.replace(/-?[%}]}$/,v);if(k.indexOf("(")>0)k=k.slice(0,k.indexOf("("));if(k==="?xml?")return"xml";return k}function p(u,g){const k=z(u);const O=gt({begin:n.structure[n.structure.length-1][1],ender:-1,lexer:"markup",lines:e.lines[n.count]>0?1:0,stack:n.structure[n.structure.length-1][0],token:``,types:"end"});d(e,O,v);if(pe.html.tags.has(n.structure[n.structure.length-1][0])&&(g===true&&n.structure.length>1||g===false&&`/${n.structure[n.structure.length-1][0]}`!==k)){do{O.begin=n.structure[n.structure.length-1][1];O.stack=n.structure[n.structure.length-1][0];O.token=``;d(e,O,v)}while(pe.html.tags.has(n.structure[n.structure.length-1][0])&&(g===true&&n.structure.length>1||g===false&&`/${n.structure[n.structure.length-1][0]}`!==k))}}function G(u){const g={begin:n.structure[n.structure.length-1][1],ender:-1,lexer:"markup",lines:n.linesSpace,stack:n.structure[n.structure.length-1][0],token:v,types:v};let k=0;let O=v;let P=v;let _=v;let F=v;let $=v;let oe=false;let X=false;let Q=false;let Z=false;let le=false;let V=false;let ae=false;let D=[];let ie=[v,0];function B(te){const U=te.indexOf("=");if(U>0&&(U0||U0)){return[te.slice(0,U),te.slice(U+1)]}return[te,v]}function ye(){const te=n.count;const U=F.replace(/(\/)$/,v);const Y=I.quoteConvert;let A=0;let N=0;let y=0;let h=v;let b=v;let S=[];let E=D.length;function w(){let T=Ce(g.token,5);if(Q===true||Y==="none"||g.types.indexOf("attribute")<0||T===false&&Y==="single"&&g.token.indexOf('"')<0||T===false&&Y==="double"&&g.token.indexOf("'")<0){d(e,g,v)}else{let M=0;let K=false;const ee=g.token.split(v);const J=g.token.indexOf("=");const fe=ee.length-1;if(ne(ee[J+1],34)&&ne(ee[ee.length-1],34)&&Y==="single"&&T===false){d(e,g,v)}else if(ne(ee[J+1],39)&&ne(ee[ee.length-1],39)&&Y==="double"&&T===false){d(e,g,v)}else{M=J+2;if(Y==="double"){if(g.token.slice(J+2,fe).indexOf('"')>-1)K=true;ee[J+1]='"';ee[ee.length-1]='"'}else if(Y==="single"){if(g.token.slice(J+2,fe).indexOf("'")>-1)K=true;ee[J+1]="'";ee[ee.length-1]="'"}if(K===true||T===true){T=false;do{if(c(ee[M-1],123)&&(c(ee[M],37)||c(ee[M],123))){T=true}else if(c(ee[M],125)&&(c(ee[M-1],37)||c(ee[M-1],125))){T=false}if(T===true){if(c(ee[M],34)&&Y==="double"){ee[M]="'"}else if(c(ee[M],39)&&Y==="single"){ee[M]='"'}}else{if(c(ee[M],39)&&Y==="double"){ee[M]='"'}else if(c(ee[M],34)&&Y==="single"){ee[M]="'"}}M=M+1}while(M$/,"/>")}N=D.length;y=1;if(y0){const T=[];y=0;N=0;E=D.length;do{N=0;do{h=D[N][0].split("=")[0];if(I.attributeSortList[y]===h){T.push(D[N]);D.splice(N,1);E=E-1;break}N=N+1}while(N0){g.token=S.join(" ");w()}}q=false;if(u==="---"){$="---";_="comment"}else if(c(t[r],60)){if(c(t[r+1],47)){u=">";_="end"}else if(c(t[r+1],33)){if((t[r+2].charCodeAt(0)===100||t[r+2].charCodeAt(0)===68)&&(t[r+3].charCodeAt(0)===111||t[r+3].charCodeAt(0)===79)&&(t[r+4].charCodeAt(0)===99||t[r+4].charCodeAt(0)===67)&&(t[r+5].charCodeAt(0)===116||t[r+5].charCodeAt(0)===84)&&(t[r+6].charCodeAt(0)===121||t[r+6].charCodeAt(0)===89)&&(t[r+7].charCodeAt(0)===112||t[r+7].charCodeAt(0)===80)&&(t[r+8].charCodeAt(0)===101||t[r+8].charCodeAt(0)===69)){u=">";_="doctype";V=true}else if(c(t[r+2],45)&&c(t[r+3],45)){u="-->";_="comment";$=""}else if(c(t[r],123)&&ne(A[0],123)&&ne(u,10)&&(c(t[r+1],123)||c(t[r+1],37))){if(c(t[r+1],123)){w="}}"}else{w=t[r+1]+"}";if(se.length<1&&(D.length<1||ce(t[r-1]))){A.pop();do{if(c(t[r],10))E=E+1;se.push(t[r]);r=r+1}while(ru.length+1||c(A[0],93))&&(l===false||M===0)){if(c(u,10)){if(ce(A[A.length-1])){do{A.pop();r=r-1}while(ce(A[A.length-1]))}break}y=A.length;N=u.length-1;if(N>-1){do{y=y-1;if(A[y]!==u.charAt(N))break;N=N-1}while(N>-1)}if(N<0){if(c(A[y],62)&&c(t[r],62)&&D.length>0){if(D[D.length-1][1]===0&&c(t[r-1],125)&&ce(t[r+1])){D[D.length-1][1]=c(t[r+1],32)?1:2}}break}}}else if(t[r].charCodeAt(0)===w.charCodeAt(w.length-1)&&(l&&c(u,125)&&(t[r-1]!=="\\"||U()===false)||(l===false||ne(u,125)))){y=0;N=w.length-1;if(N>-1){do{if(t[r-y]!==w.charAt(N))break;y=y+1;N=N-1}while(N>-1)}if(N<0)w=v}}r=r+1}while(r{A=b===v?0:b.split("\n").length;return v};const h=b=>{N=b===v?0:b.split("\n").length;return v};g.begin=n.structure[n.structure.length-1][1];g.ender=n.count+3;g.stack=n.structure[n.structure.length-1][0];g.types="template_start";g.token=te;d(e,g,"comment");O=U.replace(/^\s*/,y);O=O.replace(/\s*$/,h);g.begin=n.count;g.lines=A;g.stack="comment";g.token=O;g.types="comment";d(e,g,v);g.types="template_end";g.stack="comment";g.lines=N;g.token=Y;d(e,g,v);return}g.types=_;oe=(()=>{const te=/(\/>)$/;const U=(A,N)=>{if(!pe.html.tags.has(A))return false;if(A===N)return true;if(A==="dd"&&N==="dt")return true;if(A==="dt"&&N==="dd")return true;if(A==="td"&&N==="th")return true;if(A==="th"&&N==="td")return true;if(A==="colgroup"&&(N==="tbody"||N==="tfoot"||N==="thead"||N==="tr"))return true;if(A==="tbody"&&(N==="colgroup"||N==="tfoot"||N==="thead"))return true;if(A==="tfoot"&&(N==="colgroup"||N==="tbody"||N==="thead"))return true;if(A==="thead"&&(N==="colgroup"||N==="tbody"||N==="tfoot"))return true;if(A==="tr"&&N==="colgroup")return true;return false};const Y=A=>{g.lines=e.lines[n.count]>0?1:0;g.token=``;g.types="end";d(e,g,v);if(A>0){do{g.begin=n.structure[n.structure.length-1][1];g.stack=n.structure[n.structure.length-1][0];g.token=``;d(e,g,v);A=A-1}while(A>0)}g.begin=n.structure[n.structure.length-1][1];g.lines=n.linesSpace;g.stack=n.structure[n.structure.length-1][0];g.token=O;g.types="end";e.lines[n.count-1]=0};if(_==="end"){const A=e.token[n.count];if(e.types[n.count-1]==="singleton"&&A.charCodeAt(A.length-2)!==47&&`/${z(A)}`===F){e.types[n.count-1]="start"}}if(s==="html"){if(c(O[0],60)&&ne(O[1],33)&&ne(O[1],63)&&(n.count<0||e.types[n.count].indexOf("template")<0))O=O.toLowerCase();if(pe.html.tags.has(n.structure[n.structure.length-1][0])&&U(F.slice(1),n.structure[n.structure.length-2][0])){Y(0)}else if(n.structure.length>3&&pe.html.tags.has(n.structure[n.structure.length-1][0])&&pe.html.tags.has(n.structure[n.structure.length-2][0])&&pe.html.tags.has(n.structure[n.structure.length-3][0])&&U(F,n.structure[n.structure.length-4][0])){Y(3)}else if(n.structure.length>2&&pe.html.tags.has(n.structure[n.structure.length-1][0])&&pe.html.tags.has(n.structure[n.structure.length-2][0])&&U(F,n.structure[n.structure.length-3][0])){Y(2)}else if(n.structure.length>1&&pe.html.tags.has(n.structure[n.structure.length-1][0])&&U(F,n.structure[n.structure.length-2][0])){Y(1)}else if(U(F,n.structure[n.structure.length-1][0])){Y(0)}else if(c(F[0],47)&&pe.html.tags.has(n.structure[n.structure.length-1][0])&&n.structure[n.structure.length-1][0]!==F.slice(1)){p(O,false);g.begin=n.structure[n.structure.length-1][1];g.lines=n.linesSpace;g.stack=n.structure[n.structure.length-1][0];g.token=O;g.types="end";e.lines[n.count-1]=0}if(l===false&&pe.html.voids.has(F)){if(I.correct===true&&te.test(O)===false)O=O.slice(0,O.length-1)+" />";return true}}return false})();if(pe.embed("html",F)&&O.slice(O.length-2)!=="/>"||pe.embed("liquid",F)&&O.slice(O.length-2)==="%}"){const te=Ce(O,3);let U=D.length-1;let Y=v;let A=[];if(U>-1){do{A=B(D[U][0]);if(A[0]==="type"){Y=A[1];if(Y.charCodeAt(0)===34||Y.charCodeAt(0)===39){Y=Y.slice(1,Y.length-1)}break}U=U-1}while(U>-1)}if(te===false&&pe.embed("html",F)){q=true;if(Y===v){W=pe.html.embed[F].language}else if(pe.html.embed[F].value(Y)){W=pe.html.embed[F].language}}else if(te===true&&pe.embed("liquid",F)){q=true;if(Y===v){W=pe.liquid.embed[F].language}else{W=pe.liquid.embed[F].language}}if(q===true){U=r+1;if(U"){_="singleton"}else{_="start"}g.types=_}if(ae&&V===false&&Q&&c(u,62)&&O.slice(O.length-2)!=="/>"){const te=[];const U=[];if(oe===true){_="singleton"}else{D.forEach(Y=>U.push(Y[0]));V=true;_="ignore";r=r+1;if(r-1){do{if(ne(t[r-N],Y.charCodeAt(A)))break;N=N+1;A=A-1}while(A>-1)}if(A<0)Y=v}r=r+1}while(r",` ${U.join(" ")}>`);g.token=O;g.types="content-ignore";D=[]}if(g.types.indexOf("template")>-1){if(c(O[0],123)&&c(O[1],37)){if((F==="case"||F==="default")&&(n.structure[n.structure.length-1][0]==="switch"||n.structure[n.structure.length-1][0]==="case")){g.types="template_else"}else if(pe.liquid.else.has(F)){g.types="template_else"}else{if(pe.liquid.tags.has(F)){g.types="template_start"}else if(F.charCodeAt(0)===101&&F.charCodeAt(1)===110&&F.charCodeAt(2)===100&&pe.liquid.tags.has(F.slice(3))){g.types="template_end"}else if(F.charCodeAt(0)===101&&F.charCodeAt(1)===110&&F.charCodeAt(2)===100){g.types="template_end";g.stack=F.slice(3);let te=0;do{if(e.types[te]==="template"&&e.stack[te]===g.stack){e.types[te]="template_start";j.start=j.start+1;break}else{te=e.stack.indexOf(g.stack,te+1)}}while(te>-1)}else{g.stack=F}}}else if(g.types==="template"){if(O.indexOf("else")>2)g.types="template_else"}if(g.types==="template_start"||g.types==="template_else"){if(F===v||c(F,37)){F=F+O.slice(1).replace(F,v).replace(/^\s+/,v);F=F.slice(0,F.indexOf("(")).replace(/\s+/,v)}}if(I.quoteConvert==="double"){g.token=g.token.replace(/'/g,'"')}else if(I.quoteConvert==="single"){g.token=g.token.replace(/"/g,"'")}}if(_==="cdata"&&(g.stack==="script"||g.stack==="style")){let te=n.count;let U=n.count;const Y=g.stack;if(e.types[U]==="attribute"){do{te=te-1;U=U-1}while(e.types[U]==="attribute"&&U>-1)}g.begin=te;g.token="\s*)$/,v);d(e,g,v);n.structure.push(["cdata",n.count]);if(Y==="script"){H.lexers.script(O)}else{H.lexers.style(O)}g.begin=n.structure[n.structure.length-1][1];g.token="]]>";g.types="cdata_end";d(e,g,v);n.structure.pop()}else{d(e,g,F)}ye();if(f.wrap>0&&l===true){let te=0;let U=n.count;let Y=0;if(e.types[U].indexOf("attribute")>-1){do{te=te+e.token[U].length+1;U=U-1}while(e.lexer[U]!=="markup"||e.types[U].indexOf("attribute")>-1);if(e.lines[U]===1)te=te+e.token[U].length+1}else if(e.lines[U]===1){te=e.token[U].length+1}Y=U-1;if(te>0&&e.types[Y]!=="script_end"){if(e.types[Y].indexOf("attribute")>-1){do{te=te+e.token[Y].length+1;Y=Y-1}while(e.lexer[Y]!=="markup"||e.types[Y].indexOf("attribute")>-1);if(e.lines[Y]===1)te=te+e.token[Y].length+1}else if(e.lines[Y]===1){te=e.token[Y].length+1}}}n.linesSpace=0}function R(){const u=[];const g=r;const k=c(e.token[n.count],123)&&l===true;let O=v;let P=n.linesSpace;let _=v;if(q===true){if(k===true){_="script"}else if(n.structure[n.structure.length-1][1]>-1){_=z(e.token[n.structure[n.structure.length-1][1]].toLowerCase())}else if(e.begin[n.count]>1){_=z(e.token[e.begin[n.count]].toLowerCase())}else{_=z(e.token[e.begin[n.count]].toLowerCase())}}const F=e.types[n.count]==="template_start"&&e.token[n.count].indexOf("-1){do{if(t[X]!=="\\")break;Q=Q+1;X=X-1}while(X>-1)}return Q%2===1}if(r".indexOf(t[r-1])>-1){if(l===false||ne(t[r-1],60))Q="reg"}}else if((c(t[r],34)||c(t[r],39)||c(t[r],96))&&oe()===false){Q=t[r]}else if(c(t[r],123)&&k===true){le=le+1}else if(c(t[r],125)&&k===true){if(le===0){Z=u.join(v).replace(/^\s+/,v).replace(/\s+$/,v);H.lexers.script(Z);n.structure[n.structure.length-1][1]+=1;if(e.types[n.count]==="end"&&e.lexer[e.begin[n.count]-1]==="script"){$.lexer="script";$.token=I.correct===true?";":"x;";$.types="separator";d(e,$,v);$.lexer="markup"}$.token="}";$.types="script_end";d(e,$,v);n.structure.pop();break}le=le-1}if(Ce(e.token[n.count],3)===false){X=t.slice(r,r+10).join(v).toLowerCase();if(_==="script"){X=r===i-9?X.slice(0,X.length-1):X.slice(0,X.length-2);if(X==="<\/script"){Z=u.join(v).replace(/^\s+/,v).replace(/\s+$/,v);r=r-1;if(u.length<1)break;if(/^";d(e,$,v)}else{H.options.language=W;H.lexers.script(Z);if(W==="json"&&f.json.objectSort===true||W!=="json"&&f.script.objectSort===true)n.sortCorrection(0,n.count+1);H.options.language="html"}break}}if(_==="style"){if(r===i-8){X=X.slice(0,X.length-1)}else if(r===i-9){X=X.slice(0,X.length-2)}else{X=X.slice(0,X.length-3)}if(X==="$/.test(V)){$.token="";d(e,$,v)}else{H.options.language=W;H.lexers.style(V);if(f.style.sortProperties===true)n.sortCorrection(0,n.count+1);H.options.language="html"}break}}}else{if(pe.embed("liquid",_)){X=t.slice(r).join(v).toLowerCase();if(pe.liquid.embed[_].end(X)){X=X.slice(0,X.indexOf("%}")+2);Z=u.join(v).replace(/^\s+/,v).replace(/\s+$/,v);r=r+X.length-1;if(u.length<1)break;const V=Be[pe.liquid.embed[_].language];if(/^";d(e,$,v)}else{H.options.language=pe.liquid.embed[_].language;H.lexers[V](Z);if(W==="json"&&f.json.objectSort===true||W==="javascript"&&f.script.objectSort===true||(W==="css"||W==="scss")&&f.style.sortProperties===true)n.sortCorrection(0,n.count+1);H.options.language="liquid";$.token=X;$.types="template_end";d(e,$,v)}break}}}}else if(Q===t[r]&&(c(Q,34)||c(Q,39)||c(Q,96)||c(Q,42)&&c(t[r+1],47))&&oe()===false){Q=v}else if(c(Q,96)&&t[r]==="$"&&c(t[r+1],123)&&oe()===false){Q="}"}else if(c(Q,125)&&c(t[r],125)&&oe()===false){Q="`"}else if(c(Q,47)&&(c(t[r],10)||t[r]==="\r")){Q=v}else if(Q==="reg"&&c(t[r],47)&&oe()===false){Q=v}else if(c(Q,47)&&c(t[r],60)&&c(t[r-1],45)&&c(t[r-2],45)){X=t.slice(r+1,r+11).join(v).toLowerCase();X=X.slice(0,X.length-2);if(_==="script"&&X==="<\/script")Q=v;X=X.slice(0,X.length-1);if(_==="style"&&X==="0&&(c(t[r],60)&&ne(t[r+1],61)&&!/\s|\d/.test(t[r+1])||c(t[r],91)&&c(t[r+1],37)||c(t[r],123)&&(l===true||c(t[r+1],123)||c(t[r+1],37)))){r=r-1;if(n.structure[n.structure.length-1][0]==="comment"){O=u.join(v)}else{O=u.join(v).replace(/\s+$/,v)}O=x(O);P=0;$.token=O;if(f.wrap>0&&I.preserveText===false){const{wrap:V}=f;const ae=v;const D=v;const ie=[];let B=V;let ye=O.length;const te=()=>{if(O.charCodeAt(B)===32){ie.push(O.slice(0,B));O=O.slice(B+1);ye=O.length;B=V;return}do{B=B-1}while(B>0&&O.charCodeAt(B)!==32);if(B>0){ie.push(O.slice(0,B));O=O.slice(B+1);ye=O.length;B=V}else{B=V;do{B=B+1}while(B"&&e.token[e.begin[e.begin[n.count]]]==="
  • "&&e.lines[e.begin[n.count]]===0&&n.linesSpace===0&&O.length-1)B=B-1;if(e.lines[U]>0&&e.types[U].indexOf("attribute")<0)break;U=U-1}while(U>0&&B>0);if(B<1)B=O.indexOf(" ")}O=u.join(v);O=O.replace(/^\s+/,v).replace(/\s+$/,v).replace(/\s+/g," ");do{te()}while(Bg&&rg&&ce(t[X]))}else{n.linesSpace=0}}else if(r!==g||r===g&&q===false){O=u.join(v).replace(/\s+$/,v);P=0;if($.token!==O){$.token=O;d(e,$,v);n.linesSpace=0}}q=false}if(L>0){do{I.attributeSortList[r]=I.attributeSortList[r].replace(/^\s+/,v).replace(/\s+$/,v);r=r+1}while(rj.start){const u=j.end-j.start;const g=u===1?v:"s";n.error=["Prettify Error:","",`${u} more end type${g} than start types`].join("\n")}else{const u=j.start-j.end;const g=u===1?v:"s";n.error=["Prettify Error:","",`${u} more start type${g} than end types`].join("\n")}}return e};H.beautify.markup=o=>{const a={};const f="markup";const{data:e}=n;const l=o.language==="jsx"||o.language==="tsx";const m=o.crlf===true?String.fromCharCode(13,10):String.fromCharCode(10);const I=o.markup;const L=H.end<1||H.end>e.token.length?e.token.length:H.end+1;const j={is:(x,d)=>e.types[x]===d,not:(x,d)=>e.types[x]!==d,idx:(x,d)=>x>-1&&(e.types[x]||v).indexOf(d)};const t={is:(x,d)=>e.token[x]===d,not:(x,d)=>e.token[x]!==d};let i=H.start;let r=-1;let q=0;let W=0;let s=isNaN(o.indentLevel)?0:Number(o.indentLevel);const C=(()=>{const x=H.start>0?Array(H.start).fill(0,0,H.start):[];function d(){let g=i+1;let k=0;if(j.is(g,void 0))return g-1;if(j.is(g,"comment")||i-1){do{if(j.is(g,"jsx_attribute_start")){k=g;do{if(j.is(g,"jsx_attribute_end")&&e.begin[g]===k)break;g=g+1}while(g")&&t.is(k-1,"")&&e.begin[e.begin[k]]===g&&e.begin[k-1]===e.begin[k]+1){k=e.begin[k]}else{return}}while(k>g+1);k=i;do{k=k-1;if(j.is(k+1,"attribute")){x[k]=-10}else if(t.not(k,"
  • ")){x[k]=-20}}while(k>g+1)}function p(){let g=i;let k=false;if(e.lines[i+1]===0&&I.forceIndent===false){do{if(e.lines[g]>0){k=true;break}g=g-1}while(g>r);g=i}else{k=true}if(k===true){const O=j.is(q,"comment")||j.is(q,"end")||j.is(q,"template_end")?s+1:s;do{x.push(O);g=g-1}while(g>r);if(O===s+1)x[i]=s;if(j.is(g,"attribute")||j.is(g,"template_attribute")||j.is(g,"jsx_attribute_start")){x[e.begin[g]]=O}else{x[g]=O}}else{do{x.push(-20);g=g-1}while(g>r);x[g]=-20}r=-1}function G(){let g=s;if(I.forceIndent===true||I.forceAttribute===true){x.push(s);return}if(q-1||j.idx(q,"start")>-1)&&e.lines[q]>0){x.push(s);g=g+1;if(j.is(i,"singleton")&&i>0&&j.idx(i-1,"attribute")>-1&&j.is(e.begin[i-1],"singleton")){if(e.begin[i]<0||j.is(e.begin[i-1],"singleton")&&e.begin[e.ender[i]-1]!==i){x[i-1]=s}else{x[i-1]=s+1}}}else if(i>0&&j.is(i,"singleton")&&j.idx(i-1,"attribute")>-1){x[i-1]=s;W=e.token[i].length;x.push(-10)}else if(e.lines[q]===0){x.push(-20)}else if((o.wrap===0||io.wrap&&j.idx(i+2,"attribute")>-1||e.token[i]!==void 0&&e.token[i+1]!==void 0&&e.token[i].length+e.token[i+1].length>o.wrap)&&(j.is(i+1,"singleton")||j.is(i+1,"template"))){x.push(s)}else{W=W+1;x.push(-10)}if(i>0&&j.idx(i-1,"attribute")>-1&&e.lines[i]<1){x[i-1]=-20}if(W>o.wrap){let k=i;let O=Math.max(e.begin[i],0);if(j.is(i,"content")&&I.preserveText===false){let P=0;const _=e.token[i].replace(/\s+/g," ").split(" ");do{k=k-1;if(x[k]<0){P=P+e.token[k].length;if(x[k]===-10)P=P+1}else{break}}while(k>0);k=0;O=_.length;do{if(_[k].length+P>o.wrap){_[k]=m+_[k];P=_[k].length}else{_[k]=` ${_[k]}`;P=P+_[k].length}k=k+1}while(k0){W=e.token[i].length-e.token[i].lastIndexOf(m)}}else{do{k=k-1;if(x[k]>-1){W=e.token[i].length;if(e.lines[i+1]>0)W=W+1;return}if(j.idx(k,"start")>-1){W=0;return}if(e.lines[k+1]>0&&(j.not(k,"attribute")||j.is(k,"attribute")&&j.is(k+1,"attribute"))){if(j.not(k,"singleton")||j.is(k,"attribute")&&j.is(k+1,"attribute")){W=e.token[i].length;if(e.lines[i+1]>0)W=W+1;break}}}while(k>O);x[k]=g}}}function R(){const g=i;if(e.types[g-1]==="script_start"&&c(e.token[g-1],123)){x[g-1]=-20}do{if(e.lexer[i+1]===f&&e.begin[i+1]0&&(le0||le0)){return[Z.slice(0,le),Z.slice(le+1)]}return[Z,v]}function k(Z){const le=g(Z);if(le[1]===v||le[0]==="href"||le[0].charCodeAt(0)===111&&le[0].charCodeAt(1)===110){return Z}else if(I.attributeValues==="preserve"){return le[0]+"="+le[1]}else if(I.attributeValues==="strip"){return`${le[0].trimStart()}=${le[1].replace(/\s+/g," ").replace(/^["']\s+/,'"')}`}const V=I.attributeValues;const ae=[];const D=o.wrap>0?le[1].length>o.wrap:false;let ie;let B=false;let ye=v;let te=v;let U=0;let Y=0;if(V==="collapse"){ie=le[1].replace(/\s+/g," ")}else if(V==="wrap"){ie=le[1].replace(/\s+/g,A=>/\n/.test(A)?"\n":A.replace(/\s+/," "))}do{if(c(ie[U],123)&&(c(ie[U+1],123)||c(ie[U+1],37))){if(V==="collapse"){if(ce(ie[U-1])===true&&ae[ae.length-1]!=="\n"){ae.push("\n")}}if(c(ie[U+1],37)){Y=ie.indexOf("%}",U+1);ye=ie.slice(U,Y+2);te=c(ye[2],45)?ye.slice(3).trimStart():ye.slice(2).trimStart();U=Y+2;if(te.startsWith("end")){B=false;if(V==="collapse"&&ae[ae.length-1]!=="\n"){ae.push("\n")}}else if(pe.liquid.tags.has(te.slice(0,te.search(/\s/)))){B=true;if(V==="collapse"&&ae[ae.length-1]!=="\n"){ae.push("\n")}}ae.push(ye)}else{if(B&&V==="collapse"&&ae[ae.length-1]!=="\n"){ae.push("\n")}Y=ie.indexOf("}}",U+1);ye=ie.slice(U,Y+2);U=Y+2;ae.push(ye)}if(V==="collapse"){if(ce(ie[U])===true&&ae[ae.length-1]!=="\n"&&U-1){e.token[Z]=k(e.token[Z])}else{const le=e.token[Z].replace(/\s+/g," ").split(" ");const V=le.length;let ae=1;let D=le[0].length;do{if(D+le[ae].length>o.wrap){D=le[ae].length;le[ae]=m+le[ae]}else{le[ae]=` ${le[ae]}`;D=D+le[ae].length}ae=ae+1}while(ae{if(j.idx(i,"start")>0){let Z=i;do{if(e.types[Z].indexOf("end")>0&&e.begin[Z]===i){if(Z-1){F=true;break}}Z=Z+1}while(Z-1){F=true}if(j.is(q,"end")||j.is(q,"template_end")){return s+(j.is(_,"singleton")?2:1)}if(j.is(_,"singleton"))return s+1;return s})();if(F===false&&j.is(i,"comment_attribute")){x.push(s);x[_]=e.types[_]==="singleton"?s+1:s;return}if(Q<1)Q=1;do{W=W+e.token[i].length+1;if(e.types[i].indexOf("attribute")>0){if(e.types[i]==="template_attribute_start"){if(I.preserveAttributes===true){x.push(-10)}else{let Z=1;do{if(e.lines[i]===0){x.push(-20)}else if(e.lines[i]===1){if(I.forceAttribute===true){x.push(Q)}else{x.push(-10)}}else{x.push(Q)}if(Z===0)break;i=i+1;if(j.is(i,"template_attribute_start")){Z=Z+1}else if(j.is(i,"template_attribute_end")){Z=Z-1}oe=oe+1;if(e.token[i]!==void 0){W=W+e.token[i].length+1;X=X+e.token[i].length+1}}while(i0){$=true;if(i0){x.push(-20);i=i+1;a[i]=i}else{if(_===i-1&&F===false){if(l){x.push(-20)}else{x.push(Q)}}else{if(l){x.push(-20)}else{x.push(Q+1)}}if(e.lexer[i+1]!==f){i=i+1;R()}}}else if(e.types[i].indexOf("end")>0&&e.types[i].indexOf("template")<0){if(x[i-1]!==-20)x[i-1]=x[e.begin[i]]-1;if(e.lexer[i+1]!==f){x.push(-20)}else{x.push(Q)}}else{x.push(Q)}}else if(j.is(i,"attribute")){X=X+e.token[i].length+1;if(I.preserveAttributes===true){x.push(-10)}else if(I.forceAttribute===true||I.forceAttribute>=1||$===true||i-1&&e.lines[i+1]!==-20||j.idx(i+1,"attribute")>0)){e.token[i]=k(e.token[i]);if(I.forceAttribute===false&&e.lines[i]===1){if(j.is(i+1,"template_attribute_start")&&e.lines[i+1]>1){x.push(Q)}else{x.push(-10)}}else{x.push(Q)}}else{x.push(-10)}}else if(e.begin[i]<_+1){break}i=i+1;oe=oe+1}while(i0&&j.idx(i,"attribute")>0&&j.not(_,"singleton")&&x[i-1]>0&&F===true){x[i-1]=x[i-1]-1}if(x[i]!==-20){if(l===true&&j.idx(_,"start")>-1&&j.is(i+1,"script_start")){x[i]=Q}else{if(t.is(i,"/")&&x[i-1]!==10){x[i-1]=-10}else{x[i]=x[_]}}}if(I.forceAttribute===true){W=0;x[_]=Q}else if(I.forceAttribute>=1){if(oe>=I.forceAttribute){x[_]=Q}else{x[_]=-10}}else{x[_]=-10}if(I.preserveAttributes===true||t.is(_,"<%xml%>")||t.is(_,"")){W=0;return}P=i;if(P>_+1){if(I.selfCloseSpace===false)X=X-1;if(X>o.wrap&&o.wrap>0&&I.forceAttribute===false){if(I.forceLeadAttribute===true){x[_]=Q;P=P-1}W=e.token[i].length;do{if(e.token[P].length>o.wrap&&ce(e.token[P]))O(P);if(j.idx(P,"template")>-1&&x[P]===-10){x[P]=Q}else if(j.is(P,"attribute")&&x[P]===-10){x[P]=Q}P=P-1}while(P>_)}}else if(o.wrap>0&&j.is(i,"attribute")&&e.token[i].length>o.wrap&&ce(e.token[i])){O(i)}}do{if(e.lexer[i]===f){if(e.token[i].toLowerCase().indexOf("-1){u()}else if(j.is(i,"comment")){if(r<0)r=i;if(j.not(i+1,"comment")||i>0&&j.idx(i-1,"end")>-1)p()}else if(j.not(i,"comment")){q=d();if(j.is(q,"end")||j.is(q,"template_end")){s=s-1;if(j.is(q,"template_end")&&j.is(e.begin[q]+1,"template_else"))s=s-1;if(t.is(i,"")||t.is(i,"")||t.is(i,""))z()}if(j.is(i,"script_end")&&j.is(i+1,"end")){if(e.lines[q]<1){x.push(-20)}else if(e.lines[q]>1){x.push(s)}else{x.push(-10)}}else if((I.forceIndent===false||I.forceIndent===true&&j.is(q,"script_start"))&&(j.is(i,"content")||j.is(i,"singleton")||j.is(i,"template"))){W=W+e.token[i].length;if(j.is(i,"template")){x.push(s);const g=e.token[i].indexOf(m);if(g>0){const k=[];const O=x[i-1]*o.indentSize+e.token[i].charCodeAt(2)===45?o.indentSize:o.indentSize-1;let P=0;do{k.push(" ");P=P+1}while(P`${_}${k.join(v)}`)}}else if(e.lines[q]>0&&j.is(q,"script_start")){x.push(-10)}else if(o.wrap>0&&(j.idx(i,"template")<0||q-1&&j.idx(i,"template")<0)){G()}else if(q-1||j.idx(q,"start")>-1)&&(e.lines[q]>0||j.idx(i,"template_")>-1)){x.push(s)}else if(e.lines[q]===0){x.push(-20)}else{x.push(s)}}else if(j.is(i,"start")||j.is(i,"template_start")){s=s+1;if(j.is(i,"template_start")&&j.is(i+1,"template_else")){s=s+1}if(l===true&&t.is(i+1,"{")){if(e.lines[q]===0){x.push(-20)}else if(e.lines[q]>1){x.push(s)}else{x.push(-10)}}else if(j.is(i,"start")&&j.is(q,"end")){x.push(-20)}else if(j.is(i,"start")&&j.is(q,"script_start")){x.push(-10)}else if(I.forceIndent===true){x.push(s)}else if(j.is(i,"template_start")&&j.is(q,"template_end")){x.push(-20)}else if(e.lines[q]===0&&(j.is(q,"content")||j.is(q,"singleton")||j.is(q,"start")&&j.is(q,"template"))){x.push(-20)}else{x.push(s)}}else if(I.forceIndent===false&&e.lines[q]===0&&(j.is(q,"content")||j.is(q,"singleton"))){x.push(-20)}else if(j.is(i+2,"script_end")){x.push(-20)}else if(j.is(i,"template_else")){if(j.is(q,"template_end")){x[i-1]=s+1}else{x[i-1]=s-1}x.push(s)}else{x.push(s)}}if(j.not(i,"content")&&j.not(i,"singleton")&&j.not(i,"template")&&j.not(i,"attribute")){W=0}}else{W=0;R()}i=i+1}while(i{const x=[];const d=(()=>{const u=[o.indentChar];const g=o.indentSize-1;let k=0;if(k0){P=0;do{g.push(d);P=P+1}while(P_.trimStart());const k=C[i-1]>-1?j.is(i,"attribute")?C[i-1]+1:C[i-1]:(()=>{let _=i-1;let F=_>-1&&j.idx(_,"start")>-1;if(C[i]>-1&&j.is(i,"attribute")){return C[i]+1}do{_=_-1;if(C[_]>-1){return j.is(i,"content")&&F===false?C[_]:C[_]+1}if(j.idx(_,"start")>-1)F=true}while(_>0);return _===-2?0:1})();let O=0;e.lines[i+1]=0;const P=u.length-1;do{if(j.is(i,"comment")){if(u[O]!==v){if(u[O+1].trimStart()!==v){x.push(u[O],z(k))}else{x.push(u[O],"\n")}}else{if(u[O+1].trimStart()===v){x.push("\n")}else{x.push(z(k))}}}else{x.push(u[O]);x.push(z(k))}O=O+1}while(O1){x.push(z(C[i]))}}function G(){const u=/\/?>$/;const g=e.token[i];const k=u.exec(g);if(k===null)return;let O=i+1;let P=false;let _=I.selfCloseSpace===true&&k!==null&&k[0]==="/>"?" ":v;e.token[i]=g.replace(u,v);do{if(j.is(O,"jsx_attribute_end")&&e.begin[e.begin[O]]===i){P=false}else if(e.begin[O]===i){if(j.is(O,"jsx_attribute_start")){P=true}else if(j.idx(O,"attribute")<0&&P===false){break}}else if(P===false&&(e.begin[O]-1){G()}if(t.not(i,void 0)&&e.token[i].indexOf(m)>0&&(j.is(i,"content")&&I.preserveText===false||j.is(i,"comment")||j.is(i,"attribute"))){p()}else{x.push(e.token[i]);if(C[i]===-10&&i-1){R=C[i];x.push(z(C[i]))}}}else{if(a[i]===i&&j.not(i,"reference")){x.push(e.token[i])}else{H.end=a[i];o.indentLevel=R;H.start=i;x.push(H.beautify[e.lexer[i]](o).replace(/\s+$/,v));if(C[H.iterator]>-1&&a[i]>i){x.push(z(C[H.iterator]))}i=H.iterator;o.indentLevel=0}}i=i+1}while(i{const a=[];const f=H.data;const e=o.crlf===true?"\r\n":"\n";const l=H.end>0?H.end+1:f.token.length;const m=o.preserveLine+1;const I=Te(o.indentSize);const L=(()=>{let s=0;const C=[];do{C.push(o.indentChar);s=s+1}while(s0?o.wrap:0;let i=H.start;let r=[v,v];function q(s){const C=[];const x=(()=>{if(i===l-1)return 1;if(f.lines[i+1]-1>m)return m;if(f.lines[i+1]>1)return f.lines[i+1]-1;return 1})();let d=0;if(s<0)s=0;do{C.push(e);d=d+1;t=j}while(d0){d=0;do{C.push(L);d=d+1}while(ds+1);if(G[1]>R)R=G[1];d.push(G)}}else if(f.types[z]==="end"){if(zs);z=d.length;if(z<2)return;do{z=z-1;if(d[z][1]0)}if(o.script.vertical===true&&o.style.compressCSS===false){i=l;do{i=i-1;if(c(f.token[i],125)||c(f.token[i],41))W()}while(i>0);i=H.start}do{if(f.types[i]==="property")t=j+f.token[i].length;if(f.types[i+1]==="end"||f.types[i+1]==="template_end"||f.types[i+1]==="template_else"){j=j-1}if(f.types[i]==="template"&&f.lines[i]===0){a.push(f.token[i]);if(f.types[i+1]==="template"&&f.lines[i+1]>0)q(j)}else if(f.types[i]==="template"&&f.lines[i]>0){if(f.types[i-2]!=="property"&&f.types[i-1]!=="colon"){t=j;a.push(f.token[i]);q(j)}else if(f.types[i-2]==="property"&&f.types[i-1]==="colon"&&f.types[i+1]==="separator"&&c(f.token[i+1],44)){t=t+f.token[i].length;if(t>o.wrap)q(j);a.push(f.token[i]);do{i=i+1;a.push(f.token[i]);if(f.lines[i+1]>0)q(j)}while(f.types[i]!=="separator"&&ne(f.token[i],59));if(c(f.token[i],59)&&f.types[i]==="separator"){a.push(f.token[i]);if(f.lines[i+1]>0)q(j);i=i+1;continue}}else{t=t+f.token[i].length;if(t>o.wrap||o.style.forceValue==="collapse"){q(j);if(ne(f.token[i][2],45)){a.push(I,f.token[i].replace("{{","{{-"))}else{a.push(I,f.token[i])}}else{a.push(f.token[i])}}}else if(f.types[i]==="template_else"){a.push(f.token[i]);j=j+1;q(j)}else if(f.types[i]==="start"||f.types[i]==="template_start"){j=j+1;a.push(f.token[i]);if(f.types[i+1]!=="end"&&f.types[i+1]!=="template_end"&&(o.style.compressCSS===false||o.style.compressCSS===true&&f.types[i+1]==="selector")){q(j)}}else if(c(f.token[i],59)&&(o.style.compressCSS===false||o.style.compressCSS===true&&f.types[i+1]==="selector")||(f.types[i]==="end"||f.types[i]==="template_end"||f.types[i]==="comment")){a.push(f.token[i]);if(f.types[i+1]==="value"){if(f.lines[i+1]===1){a.push(" ")}else if(f.lines[i+1]>1){q(j)}}else if(f.types[i+1]!=="separator"){if(f.types[i+1]!=="comment"||f.types[i+1]==="comment"&&f.lines[i+1]>1){q(j)}else{a.push(" ")}}}else if(c(f.token[i],58)){a.push(f.token[i]);if(o.style.compressCSS===false)a.push(" ")}else if(f.types[i]==="selector"){if(o.style.classPadding===true&&f.types[i-1]==="end"&&f.lines[i]<3){a.push(e)}if(f.token[i].indexOf("and(")>0){f.token[i]=f.token[i].replace(/and\(/,"and (");a.push(f.token[i])}else if(f.token[i].indexOf("when(")>0){r=f.token[i].split("when(");a.push(r[0].replace(/\s+$/,v));q(j+1);a.push(`when (${r[1]}`)}else{a.push(f.token[i])}if(f.types[i+1]==="start"){if(o.script.braceAllman===true){q(j)}else if(o.style.compressCSS===false){a.push(" ")}}}else if(c(f.token[i],44)){a.push(f.token[i]);if(f.types[i+1]==="selector"||f.types[i+1]==="property"){q(j)}else if(o.style.compressCSS===false){a.push(" ")}}else if(f.stack[i]==="map"&&c(f.token[i+1],41)&&i-f.begin[i]>5){a.push(f.token[i]);q(j)}else if(f.token[i]==="x;"){q(j)}else if((f.types[i]==="variable"||f.types[i]==="function")&&o.style.classPadding===true&&f.types[i-1]==="end"&&f.lines[i]<3){a.push(e);a.push(f.token[i])}else if(ne(f.token[i],59)||c(f.token[i],59)&&(o.style.compressCSS===false||o.style.compressCSS===true&&ne(f.token[i+1],125))){a.push(f.token[i])}i=i+1}while(i{const a=new Set(["ActiveXObject","ArrayBuffer","AudioContext","Canvas","CustomAnimation","DOMParser","DataView","Date","Error","EvalError","FadeAnimation","FileReader","Flash","Float32Array","Float64Array","FormField","Frame","Generator","HotKey","Image","Iterator","Intl","Int16Array","Int32Array","Int8Array","InternalError","Loader","Map","MenuItem","MoveAnimation","Notification","ParallelArray","Point","Promise","Proxy","RangeError","Rectangle","ReferenceError","Reflect","RegExp","ResizeAnimation","RotateAnimation","Set","SQLite","ScrollBar","Set","Shadow","StopIteration","Symbol","SyntaxError","Text","TextArea","Timer","TypeError","URL","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray","URIError","WeakMap","WeakSet","Web","Window","XMLHttpRequest"]);const f=je(null);const e=H.data;const l="script";const m=H.scopes;const I=H.end<1||H.end>e.token.length?e.token.length:H.end+1;const L=(()=>{let t=H.start;let i=isNaN(o.indentLevel)?0:Number(o.indentLevel);let r=false;let q=false;let W="";let s="";let C=e.types[0];let x=e.token[0];const d=[-1];const z=[];const p=H.start>0?Array(H.start).fill(0,0,H.start):[];const G=[];const R=[[]];const u=[];const g=[];const k=[];const O=[false];const P=[];const _=[];function F(){$(false,false);const A=o.commentIndent===true?i:0;if(r===false&&/\/\u002a\s*global\s/.test(e.token[t])){const N=e.token[t].replace(/\/\u002a\s*global\s+/,"").replace(/\s*\u002a\/$/,"").split(",");let y=N.length;do{y=y-1;N[y]=N[y].replace(/\s+/g,"");if(N[y]!=="")m.push([N[y],-1])}while(y>0)}if(e.types[t-1]==="comment"||e.types[t+1]==="comment"){p[t-1]=A}else if(e.lines[t]<2){let N=t+1;if(e.types[N]==="comment"){do{N=N+1}while(N0){do{y=y-1;if(m[y][1]===N){m[y][1]=t}else if(m[y][1]0)}N=N+1;e.begin.splice(N,1);e.ender.splice(N,1);e.lexer.splice(N,1);e.lines.splice(N,1);e.stack.splice(N,1);e.token.splice(N,1);e.types.splice(N,1);y=t+1;do{e.begin[y]=t;e.stack[y]=e.stack[N];y=y+1}while(y-1&&e.lines[t]<3){e.lines[t]=3}}if(e.types[t+1]!=="comment")r=true;return}else if(e.token[t-1]===","){p[t-1]=A}else if(x==="="&&e.types[t-1]!=="comment"&&/^(\/\*\*\s*@[a-z_]+\s)/.test(s)===true){p[t-1]=-10}else if(x==="{"&&e.types[t-1]!=="comment"&&e.lines[0]<2){if(e.stack[t]==="function"){p[t-1]=A}else{p[t-1]=/\n/.test(s)?A:-10}}else{p[t-1]=A}if(e.types[t+1]!=="comment")r=true;if(e.token[e.begin[t]]==="("){p.push(i+1)}else{p.push(i)}if(p[t]>-1&&e.lines[t]<3){if(e.types[t-1]==="comment"&&s.startsWith("//")){e.lines[t]=2}else{e.lines[t]=3}}if(o.script.commentNewline===true&&s.startsWith("//")===false&&e.lines[t]>=3){e.lines[t]=2}}function $(A,N){let y=t-1;let h=A===true?0:1;const b=R[R.length-1]===void 0?[]:R[R.length-1];const S=N===false&&e.stack[t]==="array"&&A===true&&s!=="[";if(g[g.length-1]===false||e.stack[t]==="array"&&o.script.arrayFormat==="inline"||e.stack[t]==="object"&&o.script.objectIndent==="inline"){return}g[g.length-1]=false;do{if(e.types[y]==="end"){h=h+1}else if(e.types[y]==="start"){h=h-1}if(e.stack[y]==="global")break;if(h===0){if(e.stack[t]==="class"||e.stack[t]==="map"||S===false&&(A===false&&e.token[y]!=="("&&e.token[y]!=="x("||A===true&&e.token[y]===",")){if(e.types[y+1]==="template_start"){if(e.lines[y]<1){p[y]=-20}else{p[y]=i-1}}else if(b.length>0&&b[b.length-1]>-1){p[y]=i-1}else{p[y]=i}}else if(e.stack[t]==="array"&&e.types[t]==="operator"){if(e.token[y]===",")p[y]=i;if(y===e.begin[t])break}if(A===false)break}if(h<0){if(e.types[y+1]==="template_start"||e.types[y+1]==="template_string_start"){if(e.lines[y]<1){p[y]=-20}else{p[y]=i-1}}else if(b.length>0&&b[b.length-1]>-1){p[y]=i-1}else{p[y]=i}break}y=y-1}while(y>-1)}function oe(){const A=R[R.length-1]===void 0?[]:R[R.length-1];const N=()=>{let y=t;let h=false;const b=e.begin[y];do{y=y-1;if(e.lexer[y]==="markup"){h=true;break}if(e.begin[y]!==b)y=e.begin[y]}while(y>b);if(h===true){y=t;do{y=y-1;if(e.begin[y]!==b){y=e.begin[y]}else if(e.token[y]===","){p[y]=i+1}}while(y>b);p[b]=i+1;p[t-1]=i}else{p[t-1]=-20}};if(s===")"&&e.token[t+1]==="."&&A[A.length-1]>-1&&e.token[A[0]]!==":"){let y=e.begin[t];let h=false;let b=false;do{y=y-1}while(y>0&&p[y]<-9);h=p[y]===i;y=t+1;do{y=y+1;if(e.token[y]==="{"){b=true;break}if(e.begin[y]===e.begin[t+1]&&(e.types[y]==="separator"||e.types[y]==="end")){break}}while(y1){R[R.length-2].push(e.begin[t]);i=i+1}}if(C!=="separator")Z();if(e.token[t+1]===","&&(e.stack[t]==="object"||e.stack[t]==="array")){$(true,false)}if(e.token[e.begin[t]-1]===","&&(e.token[t+1]==="}"||e.token[t+1]==="]")&&(e.stack[t]==="object"||e.stack[t]==="array")){$(true,false)}if(e.stack[t]!=="attribute"){if(s!==")"&&s!=="x)"&&(e.lexer[t-1]!=="markup"||e.lexer[t-1]==="markup"&&e.token[t-2]!=="return")){i=i-1}if(s==="}"&&e.stack[t]==="switch"&&o.script.noCaseIndent===false){i=i-1}}if(s==="}"||s==="x}"){if(e.types[t-1]!=="comment"&&x!=="{"&&x!=="x{"&&C!=="end"&&C!=="string"&&C!=="number"&&C!=="separator"&&x!=="++"&&x!=="--"&&(t<2||e.token[t-2]!==";"||e.token[t-2]!=="x;"||x==="break"||x==="return")){let y=t-1;let h=false;const b=e.begin[t];const S=z.length;do{if(e.begin[y]===b){if(e.token[y]==="="||e.token[y]===";"||e.token[y]==="x;"){h=true}if(e.token[y]==="."&&p[y-1]>-1){g[g.length-1]=false;p[b]=i+1;p[t-1]=i;break}if(y>0&&e.token[y]==="return"&&(e.token[y-1]===")"||e.token[y-1]==="x)"||e.token[y-1]==="{"||e.token[y-1]==="x{"||e.token[y-1]==="}"||e.token[y-1]==="x}"||e.token[y-1]===";"||e.token[y-1]==="x;")){i=i-1;p[t-1]=i;break}if(e.token[y]===":"&&G.length===0||e.token[y]===","&&h===false){break}if(y===0||e.token[y-1]==="{"||e.token[y-1]==="x{"||e.token[y]==="for"||e.token[y]==="if"||e.token[y]==="do"||e.token[y]==="function"||e.token[y]==="while"||e.token[y]==="var"||e.token[y]==="let"||e.token[y]==="const"||e.token[y]==="with"){if(z[S-1]===false&&S>1&&(t===I-1||e.token[t+1]!==")"&&e.token[t+1]!=="x)")&&e.stack[t]!=="object"){i=i-1}break}}else{y=e.begin[y]}y=y-1}while(y>b)}d.pop()}if(o.script.bracePadding===false&&s!=="}"&&C!=="markup"){p[t-1]=-20}if(o.script.bracePadding===true&&C!=="start"&&x!==";"&&(p[e.begin[t]]<-9||g[g.length-1]===true)){p[e.begin[t]]=-10;p[t-1]=-10;p.push(-20)}else if(e.stack[t]==="attribute"){p[t-1]=-20;p.push(i)}else if(e.stack[t]==="array"&&(A.length>0||u[u.length-1]===true)){X();g[g.length-1]=false;p[e.begin[t]]=i+1;p[t-1]=i;p.push(-20)}else if((e.stack[t]==="object"||e.begin[t]===0&&s==="}")&&A.length>0){X();g[g.length-1]=false;p[e.begin[t]]=i+1;p[t-1]=i;p.push(-20)}else if(s===")"||s==="x)"){const y=s===")"&&x!=="("&&_.length>0?_.pop()+1:0;const h=e.token[e.begin[t]-1]==="if"?(()=>{let b=t;do{b=b-1;if(e.token[b]===")"&&p[b-1]>-1)return y}while(b>e.begin[t]);return y+5})():y;if(y>0&&(o.language!=="jsx"||o.language==="jsx"&&e.token[e.begin[t]-1]!=="render")){const b=o.wrap;const S=e.begin[t];const E=_.length;let w=t-2;if(h>b){p[e.begin[t]]=i+1;p[t-1]=i;do{if(e.begin[w]===S){if(e.token[w]==="&&"||e.token[w]==="||"){p[w]=i+1}else if(p[w]>-1&&e.types[w]!=="comment"&&e.token[w+1]!=="."){p[w]=p[w]+1}}else if(p[w]>-1&&e.token[w+1]!=="."){p[w]=p[w]+1}w=w-1}while(w>S)}else if(E>0){_[E-1]=_[E-1]+y}}else if(s===")"&&t>e.begin[t]+2&&e.lexer[e.begin[t]+1]===l&&e.token[e.begin[t]+1]!=="function"){const b=e.begin[t]<0?0:e.begin[t];const S=o.wrap;const E=A.length;let w=0;let T=0;let M=0;let K=0;let ee=0;let J=false;let fe=false;let se=i+1;let ue=false;let me=false;let re=false;if(p[b]<-9){T=b;do{T=T+1}while(T0&&M0)M=w;T=T-1}while(T>b&&p[T]<-9);if(e.token[T+1]===".")se=p[T]+1;if(w>S-1&&S>0&&x!=="("&&M!==-1&&g[g.length-2]===false){if(e.token[b-1]==="if"&&z[z.length-1]===true||e.token[b-1]!=="if"){p[b]=se;if(e.token[b-1]==="for"){T=b;do{T=T+1;if(e.token[T]===";"&&e.begin[T]===b){p[T]=se}}while(T=S&&S>0)ue=true}else if(e.types[T]==="markup"&&me===false){me=true}if(p[T]>-9&&e.token[T]!==","&&e.types[T]!=="markup"){w=0}else{if(p[T]===-10)w=w+1;w=w+e.token[T].length;if(w>=S&&S>0&&(J===true||me===true)){ue=true}}}else{if(p[T]>-9){w=0}else{w=w+e.token[T].length;if(w>=S&&S>0&&(J===true||me===true)){ue=true}}}}while(T>b&&ue===false);if(J===false&&e.token[e.begin[t]+1].charAt(0)==="`"){p[e.begin[t]]=-20;p[t-1]=-20}else if((J===true||me===true)&&w>=S&&S>0||p[b]>-9){if(re===true){se=p[b];if(e.token[b-1]==="["){T=t;do{T=T+1;if(e.types[T]==="end"||e.token[T]===","||e.token[T]===";"){break}}while(T0&&A[E-1]>T){se=se-E}g[g.length-1]=false;T=t;do{T=T-1;if(e.begin[T]===b){if(e.token[T].indexOf("=")>-1&&e.types[T]==="operator"&&e.token[T].indexOf("!")<0&&e.token[T].indexOf("==")<0&&e.token[T]!=="<="&&e.token[T].indexOf(">")<0){w=T;do{w=w-1;if(e.begin[w]===b&&(e.token[w]===";"||e.token[w]===","||w===b)){break}}while(w>b)}else if(e.token[T]===","){p[T]=se}else if(p[T]>-9&&fe===false&&(e.token[b-1]!=="for"||e.token[T+1]==="?"||e.token[T+1]===":")&&(e.token[e.begin[t]]!=="("||e.token[T]!=="+")){p[T]=p[T]+1}}else if(p[T]>-9&&fe===false){p[T]=p[T]+1}}while(T>b);p[b]=se;p[t-1]=se-1}else{p[t-1]=-20}if(e.token[e.begin[t]-1]==="+"&&p[e.begin[t]]>-9){p[e.begin[t]-1]=-10}}else if(o.language==="jsx"){N()}else{p[t-1]=-20}p.push(-20)}else if(g[g.length-1]===true){if(s==="]"&&e.begin[t]-1>0&&e.token[e.begin[e.begin[t]-1]]==="["){g[g.length-2]=false}if(e.begin[t]-1){p[t-1]=p[e.begin[t]]-1}else{p[t-1]=-20}p.push(-20)}else if(e.types[t-1]==="comment"&&e.token[t-1].substring(0,2)==="//"){if(e.token[t-2]==="x}")p[t-3]=i+1;p[t-1]=i;p.push(-20)}else if(e.types[t-1]!=="comment"&&(x==="{"&&s==="}"||x==="["&&s==="]")){p[t-1]=-20;p.push(-20)}else if(s==="]"){if(z[z.length-1]===true&&g[g.length-1]===false&&o.script.arrayFormat!=="inline"||x==="]"&&p[t-2]===i+1){p[t-1]=i;p[e.begin[t]]=i+1}else if(p[t-1]===-10){p[t-1]=-20}if(e.token[e.begin[t]+1]==="function"){p[t-1]=i}else if(z[z.length-1]===false){if(x==="}"||x==="x}")p[t-1]=i;let y=t-1;let h=1;do{if(e.token[y]==="]")h=h+1;if(e.token[y]==="["){h=h-1;if(h===0){if(y>0&&(e.token[y+1]==="{"||e.token[y+1]==="x{"||e.token[y+1]==="[")){p[y]=i+1;break}if(e.token[y+1]!=="["||q===false){p[y]=-20;break}break}}if(h===1&&e.token[y]==="+"&&p[y]>1){p[y]=p[y]-1}y=y-1}while(y>-1)}else if(o.language==="jsx"){N()}if(o.script.arrayFormat==="inline"){let y=t;const h=e.begin[t];do{y=y-1;if(e.types[y]==="end")break}while(y>h);if(y>h){p[e.begin[t]]=i+1;p[t-1]=i}else{p[e.begin[t]]=-20;p[t-1]=-20}}else if(p[e.begin[t]]>-1){p[t-1]=p[e.begin[t]]-1}p.push(-20)}else if(s==="}"||s==="x}"||z[z.length-1]===true){if(s==="}"&&x==="x}"&&e.token[t+1]==="else"){p[t-2]=i+2;p.push(-20)}else{p.push(i)}p[t-1]=i}else{p.push(-20)}if(e.types[t-1]==="comment")p[t-1]=i;if(o.script.inlineReturn&&o.script.correct===false&&s==="x}"&&(e.stack[t]==="if"||e.stack[t]==="else")&&e.token[e.begin[e.begin[t-1]-1]-2]!=="else"){p[t-1]=-20}X();q=z[z.length-1];z.pop();R.pop();u.pop();k.pop();P.pop();g.pop();O.pop()}function X(){let A=0;const N=R[R.length-1];if(N===void 0)return;A=N.length-1;if(A<1&&N[A]<0&&(s===";"||s==="x;"||s===")"||s==="x)"||s==="}"||s==="x}")){N.pop();return}if(A<0||N[A]<0)return;if(s===":"){if(e.token[N[A]]!=="?"){do{N.pop();A=A-1;i=i-1}while(A>-1&&N[A]>-1&&e.token[N[A]]!=="?")}N[A]=t;p[t-1]=i}else{do{N.pop();A=A-1;i=i-1}while(A>-1&&N[A]>-1)}if((e.stack[t]==="array"||s===",")&&N.length<1)N.push(-1)}function Q(){const A=t;do{if(e.lexer[t+1]===l&&e.begin[t+1]0){if(e.token[N-1]==="if"){i=i-2}else{i=i-1}}break}}A=A-1}while(A>0&&A>N)}function le(){if(e.token[t+1]!==","&&s.indexOf("/>")!==s.length-2||e.token[t+1]===","&&e.token[e.begin[t]-3]!=="React"){$(false,false)}if(x==="return"||x==="?"||x===":"){p[t-1]=-10;p.push(-20)}else if(C==="start"||e.token[t-2]==="return"&&e.stack[t-1]==="method"){p.push(i)}else{p.push(-20)}}function V(){const A=R[R.length-1]===void 0?[]:R[R.length-1];function N(){const y=e.token[t+1];let h=0;let b=0;let S=t;let E=s==="+"?i+2:i;let w=0;if(o.wrap<1){p.push(-10);return}do{S=S-1;if(e.token[e.begin[t]]==="("){if(S===e.begin[t]){w=h}if(e.token[S]===","&&e.begin[S]===e.begin[t]&&z[z.length-1]===true){break}}if(h>o.wrap-1)break;if(p[S]>-9)break;if(e.types[S]==="operator"&&e.token[S]!=="="&&e.token[S]!=="+"&&e.begin[S]===e.begin[t]){break}h=h+e.token[S].length;if(S===e.begin[t]&&e.token[S]==="["&&h-9)break;if(p[S]===-10)h=h+1}while(S>0);if(w>0)w=w+y.length;h=h+y.length;b=S;if(h>o.wrap-1&&p[S]<-9){do{b=b-1}while(b>0&&p[b]<-9)}if(e.token[b+1]==="."&&e.begin[t]<=e.begin[b]){E=E+1}else if(e.types[b]==="operator"){E=p[b]}b=y.length;if(h+b0){S=o.wrap-w}else{S=o.wrap-h}if(S>0&&S<5){p.push(E);if(e.token[t].charAt(0)==='"'||e.token[t].charAt(0)==="'"){t=t+1;p.push(-10)}return}if(e.token[e.begin[t]]!=="("||w>o.wrap-1||w===0){if(w>0)h=w;if(h-y.lengtho.wrap-4){p.push(E);return}p.push(-10);return}p.push(E);return}p.push(-10)}Z();if(A.length>0&&A[A.length-1]>-1&&e.stack[t]==="array"){u[u.length-1]=true}if(s!==":"){if(e.token[e.begin[t]]!=="("&&e.token[e.begin[t]]!=="x("&&g.length>0){$(true,false)}if(s!=="?"&&e.token[A[A.length-1]]==="."){let y=0;let h=t;const b=e.begin[h];do{if(e.begin[h]===b){if(e.token[h+1]==="{"||e.token[h+1]==="["||e.token[h]==="function"){break}if(e.token[h]===","||e.token[h]===";"||e.types[h]==="end"||e.token[h]===":"){A.pop();i=i-1;break}if(e.token[h]==="?"||e.token[h]===":"){if(e.token[A[A.length-1]]==="."&&y<2)A[A.length-1]=b+1;break}if(e.token[h]===".")y=y+1}h=h+1}while(h-1&&p[y]<-9);A.push(t);i=i+1;if(p[y]===i&&e.token[y+1]!==":"){i=i+1;A.push(t)}p[t-1]=i;if(e.token[e.begin[t]]==="("&&(A.length<2||A[0]===A[1])){g[g.length-1]=false;if(t-2===e.begin[t]){p[e.begin[t]]=i-1}else{p[e.begin[t]]=i}y=t-2;do{if(e.types[y]==="end"&&p[y-1]>-1)break;if(p[y]>-1)p[y]=p[y]+1;y=y-1}while(y>e.begin[t])}}p.push(-10);return}if(s===":"){if(e.stack[t]==="map"||e.types[t+1]==="type"||e.types[t+1]==="type_start"){p[t-1]=-20;p.push(-10);return}if(G.length>0&&e.begin[G[G.length-1]]===e.begin[t]){let y=t;const h=e.begin[t];do{y=y-1;if(e.begin[y]===h){if(e.token[y]===","||e.token[y]===";"){p[t-1]=-20;break}if(e.token[y]==="?"){G.pop();X();if(o.script.ternaryLine===true)p[t-1]=-10;p.push(-10);return}}else if(e.types[y]==="end"){y=e.begin[y]}}while(y>h)}if(e.token[t-2]==="where"&&e.stack[t-2]===e.stack[t]){p[t-1]=-10;p.push(-10);return}if(C==="reference"&&e.token[e.begin[t]]!=="("&&e.token[e.begin[t]]!=="x("){p[t-1]=-20;p.push(-10);return}if((x===")"||x==="x)")&&e.token[e.begin[t-1]-2]==="function"){p[t-1]=-20;p.push(-10);return}if(e.stack[t]==="attribute"){p[t-1]=-20;p.push(-10);return}if(e.token[e.begin[t]]!=="("&&e.token[e.begin[t]]!=="x("&&(C==="reference"||x===")"||x==="]"||x==="?")&&(e.stack[t]==="map"||e.stack[t]==="class"||e.types[t+1]==="reference")&&(G.length===0||G[G.length-1]-1||e.types[t-2]==="word"&&e.stack[t]!=="switch")){p[t-1]=-20;p.push(-10);return}if(e.stack[t]==="switch"&&(G.length<1||G[G.length-1]0){p[t-1]=i}else{p[t-1]=-10}p.push(-10);return}if(s==="++"||s==="--"){if(C==="number"||C==="reference"){p[t-1]=-20;p.push(-10)}else if(t-1&&(/\d/.test(y.charAt(1))===true||y.charAt(1)==="."||y.charAt(1)==="-"||y.charAt(1)==="+")){p.push(-20);return}}return N()}if(e.types[t-1]!=="comment"){if(x==="("){p[t-1]=-20}else if(s==="*"&&e.stack[t]==="object"&&e.types[t+1]==="reference"&&(x==="{"||x===",")){p[t-1]=i}else if(s!=="?"||G.length===0){p[t-1]=-10}}if(s.indexOf("=")>-1&&s!=="=="&&s!=="==="&&s!=="!="&&s!=="!=="&&s!==">="&&s!=="<="&&s!=="=>"&&e.stack[t]!=="method"&&e.stack[t]!=="object"){let y=t+1;let h=0;let b=false;let S="";if((e.token[e.begin[t]]==="("||e.token[e.begin[t]]==="x(")&&e.token[t+1]!=="function"){return}do{if(e.types[y]==="start"){if(b===true&&e.token[y]!=="["){if(O[O.length-1]===true){O[O.length-1]=false}break}h=h+1}if(e.types[y]==="end")h=h-1;if(h<0){if(O[O.length-1]===true){O[O.length-1]=false}break}if(h===0){S=e.token[y];if(b===true){if(e.types[y]==="operator"||e.token[y]===";"||e.token[y]==="x;"||e.token[y]==="?"||e.token[y]==="var"||e.token[y]==="let"||e.token[y]==="const"){if(S!==void 0&&(S==="?"||S.indexOf("=")>-1&&S!=="=="&&S!=="==="&&S!=="!="&&S!=="!=="&&S!==">="&&S!=="<=")){if(O[O.length-1]===false){O[O.length-1]=true}}if((S===";"||S==="x;"||S==="var"||S==="let"||S==="const")&&O[O.length-1]===true){O[O.length-1]=false}break}if(O[O.length-1]===true&&(S==="return"||S==="break"||S==="continue"||S==="throw")){O[O.length-1]=false}}if(S===";"||S==="x;"||S===",")b=true}y=y+1}while(y{let N=e.begin[t];if(N<0){m.push([e.token[t],-1])}else{if(e.stack[N+1]!=="function"){do{N=e.begin[N]}while(N>-1&&e.stack[N+1]!=="function")}m.push([e.token[t],N])}};if(e.types[t-1]==="comment"){p[t-1]=i}else if(C==="end"&&x!==")"&&e.token[e.begin[t-1]-1]!==")"){p[t-1]=-10}else if(C!=="separator"&&C!=="start"&&C!=="end"&&C.indexOf("template_string")<0){if(C==="word"||C==="operator"||C==="property"||C==="type"||C==="reference"){p[t-1]=-10}else{p[t-1]=-20}}if(x==="var"&&e.lexer[t-1]===l){A()}else if(x==="function"){m.push([e.token[t],t])}else if(x==="let"||x==="const"){m.push([e.token[t],t])}else if(e.stack[t]==="arguments"){m.push([e.token[t],t])}else if(x===","){let N=t;do{N=N-1}while(N>e.begin[t]&&e.token[N]!=="var"&&e.token[N]!=="let"&&e.token[N]!=="const");if(e.token[N]==="var"){A()}else if(e.token[N]==="let"||e.token[N]==="const"){m.push([e.token[t],t])}}p.push(-10)}function D(){const A=R[R.length-1]===void 0?[]:R[R.length-1];const N=()=>{if(o.script.methodChain>0){let y=t;let h=e.begin[t];const b=[t];const S=e.token[h-1]==="if";do{y=y-1;if(e.types[y]==="end")y=e.begin[y];if(e.begin[y]===h){if(e.types[y]==="string"&&e.token[y].indexOf("${")===e.token[y].length-2){break}if(e.token[y]==="."){if(p[y-1]>0){p[t-1]=S===true?i+1:i;return}b.push(y)}else if(e.token[y]===";"||e.token[y]===","||e.types[y]==="operator"||(e.types[y]==="word"||e.types[y]==="reference")&&(e.types[y-1]==="word"||e.types[y-1]==="reference")){break}}}while(y>h);if(b.length-1)p[y]=p[y]+1;y=y+1}while(y0){if(e.stack[t]==="object"||e.stack[t]==="array"){$(true,false)}else{$(false,false)}}if(o.script.methodChain===0){p[t-1]=-20}else if(o.script.methodChain<0){if(e.lines[t]>0){N()}else{p[t-1]=-20}}else{N()}p.push(-20);return}if(s===","){Z();if(z[z.length-1]===false&&(e.stack[t]==="object"||e.stack[t]==="array"||e.stack[t]==="paren"||e.stack[t]==="expression"||e.stack[t]==="method")){z[z.length-1]=true;if(e.token[e.begin[t]]==="("){let y=t;do{y=y-1;if(e.begin[y]===e.begin[t]&&e.token[y]==="+"&&p[y]>-9){p[y]=p[y]+2}}while(y>e.begin[t])}}if(e.stack[t]==="array"&&o.script.arrayFormat==="indent"){p[t-1]=-20;p.push(i);return}if(e.stack[t]==="array"&&o.script.arrayFormat==="inline"){p[t-1]=-20;p.push(-10);return}if(e.stack[t]==="object"&&o.script.objectIndent==="indent"){p[t-1]=-20;p.push(i);return}if(e.stack[t]==="object"&&o.script.objectIndent==="inline"){p[t-1]=-20;p.push(-10);return}if(A.length>0){if(A[A.length-1]>-1)X();p[t-1]=-20;p.push(i);return}if(e.token[t-2]===":"&&e.token[t-4]==="where"){p[t-1]=-20;p.push(-10);return}p[t-1]=-20;if(e.types[t+1]!=="end"){k[k.length-1]=k[k.length-1]+1}if((e.token[e.begin[t]]==="("||e.token[e.begin[t]]==="x(")&&o.language!=="jsx"&&e.stack[t]!=="global"&&(e.types[t-1]!=="string"&&e.types[t-1]!=="number"||e.token[t-2]!=="+"||e.types[t-1]==="string"&&e.types[t-1]!=="number"&&e.token[t-2]==="+"&&e.types[t-3]!=="string"&&e.types[t-3]!=="number")){p.push(-10);return}if(C==="reference"&&e.types[t-2]==="word"&&"var-let-const-from".indexOf(e.token[t-2])<0&&(e.types[t-3]==="end"||e.token[t-3]===";")){P[P.length-1]=true;p.push(-10);return}if(P[P.length-1]===true||e.stack[t]==="notation"){p.push(-10);return}if(k[k.length-1]>3&&(e.stack[t]==="array"||e.stack[t]==="object")){if(g[g.length-1]===true)$(true,true);p[t-1]=-20;if(u[u.length-1]===true){p.push(i);return}const y=e.begin[t];let h=t;do{if(e.types[h]==="end"){h=e.begin[h]}else{if(e.token[h]===","&&e.types[h+1]!=="comment"){p[h]=i}}h=h-1}while(h>y);p[y]=i;u[u.length-1]=true;return}if(e.stack[t]==="object"){if(g[g.length-1]===true&&e.types[e.begin[t]-1]!=="word"&&e.types[e.begin[t]-1]!=="reference"&&e.token[e.begin[t]-1]!=="("&&e.token[e.begin[t]-1]!=="x("){const y=e.begin[t];let h=t-1;do{if(e.begin[h]===y){if(e.token[h]===",")break;if(e.token[h]===":"){$(true,false);break}}h=h-1}while(h>y)}}if(g[g.length-1]===false||e.token[t-2]==="+"&&(C==="string"||C==="number")&&p[t-2]>0&&(x.charAt(0)==='"'||x.charAt(0)==="'")){if(e.stack[t]==="method"){if(e.token[t-2]==="+"&&(x.charAt(0)==='"'||x.charAt(0)==="'")&&(e.token[t-3].charAt(0)==='"'||e.token[t-3].charAt(0)==="'")){p.push(i+2);return}if(e.token[t-2]!=="+"){p.push(-10);return}}p.push(i);return}if(g[g.length-1]===true&&e.stack[t]!=="object"){p.push(-10);return}if(k[k.length-1]<4&&(e.stack[t]==="array"||e.stack[t]==="object")){p.push(-10);return}p.push(i);return}if(s===";"||s==="x;"){Z();if(e.token[t+1]!==void 0&&e.types[t+1].indexOf("attribute")>0&&e.types[t+1].indexOf("end")>0){p[t-1]=-20;p.push(i-1);return}if(d[d.length-1]>-1&&e.stack[d[d.length-1]]!=="expression"){let y=t;do{y=y-1;if(e.token[y]===";")break;if(e.token[y]===","){i=i-1;break}if(e.types[y]==="end")y=e.begin[y]}while(y>0&&y>e.begin[t])}d[d.length-1]=-1;X();if(e.token[e.begin[t]-1]!=="for")$(false,false);P[P.length-1]=false;p[t-1]=-20;if(e.begin[t]>0&&e.token[e.begin[t]-1]==="for"&&e.stack[t]!=="for"){p.push(-10);return}p.push(i);return}p.push(-20)}function ie(){const A=e.stack[t+1];const N=t===0?e.stack[t]:e.stack[t-1];if(x===")"||(N==="object"||N==="array")&&x!=="]"){if(A!=="method"||A==="method"&&e.token[t+1]!==")"&&e.token[t+2]!==")"){if(x===")"&&(A!=="function"||e.token[e.begin[e.begin[t-1]-1]]==="("||e.token[e.begin[e.begin[t-1]-1]]==="x(")){$(false,false)}else if(e.types[t+1]!=="end"&&e.types[t+2]!=="end"){$(true,false)}}}z.push(false);R.push([]);O.push(false);u.push(false);P.push(false);k.push(0);if(o.script.neverFlatten===true||A==="array"&&o.script.arrayFormat==="indent"||A==="attribute"||C==="generic"||A==="class"&&x!=="("&&x!=="x("||s==="["&&e.token[t+1]==="function"){g.push(false)}else{if(A==="expression"||A==="method"){g.push(true)}else if((A==="object"||A==="class")&&(x==="("||x==="x("||C==="word"||C==="reference")){g.push(true)}else if(A==="array"||s==="("||s==="x("){g.push(true)}else if(s==="{"&&A==="object"&&C!=="operator"&&C!=="start"&&C!=="string"&&C!=="number"&&N!=="object"&&N!=="array"&&t>0){g.push(true)}else{g.push(false)}}if(s!=="("&&s!=="x("&&e.stack[t+1]!=="attribute"){i=i+1}if(s==="{"||s==="x{"){d.push(-1);if(e.types[t-1]!=="comment"){if(C==="markup"){p[t-1]=i}else if(o.script.braceAllman===true&&C!=="operator"&&x!=="return"){p[t-1]=i-1}else if(e.stack[t+1]!=="block"&&(A==="function"||x===")"||x==="x)"||x===","||x==="}"||C==="markup")){p[t-1]=-10}else if(x==="{"||x==="x{"||x==="["||x==="}"||x==="x}"){p[t-1]=i-1}}if(A==="object"){if(o.script.objectIndent==="indent"){g[g.length-1]=false;p.push(i);return}if(o.script.objectIndent==="inline"){g[g.length-1]=true;p.push(-20);return}}if(A==="switch"){if(o.script.noCaseIndent===true){p.push(i-1);return}i=i+1;p.push(i);return}if(g[g.length-1]===true){if(C!=="word"&&C!=="reference"){p.push(-20);return}}p.push(i);return}if(s==="("||s==="x("){if(o.wrap>0&&s==="("&&e.token[t+1]!==")"){_.push(1)}if(x==="-"&&(e.token[t-2]==="("||e.token[t-2]==="x(")){p[t-2]=-20}if(C==="end"&&N!=="if"&&N!=="for"&&N!=="catch"&&N!=="else"&&N!=="do"&&N!=="try"&&N!=="finally"&&N!=="catch"){if(e.types[t-1]==="comment"){p[t-1]=i}else{p[t-1]=-20}}if(x==="async"){p[t-1]=-10}else if(A==="method"||e.token[t-2]==="function"&&C==="reference"){if(x==="import"||x==="in"||o.script.functionNameSpace===true){p[t-1]=-10}else if(x==="}"&&e.stack[t-1]==="function"||C==="word"||C==="reference"||C==="property"){p[t-1]=-20}else if(N!=="method"&&A!=="method"){p[t-1]=i}}if(x==="+"&&(e.token[t-2].charAt(0)==='"'||e.token[t-2].charAt(0)==="'")){p.push(i);return}if(x==="}"||x==="x}"){p.push(-20);return}if(x==="-"&&(t<2||e.token[t-2]!==")"&&e.token[t-2]!=="x)"&&e.token[t-2]!=="]"&&e.types[t-2]!=="reference"&&e.types[t-2]!=="string"&&e.types[t-2]!=="number")||o.script.functionSpace===false&&x==="function"){p[t-1]=-20}p.push(-20);return}if(s==="["){if(x==="[")z[z.length-2]=true;if(x==="return"||x==="var"||x==="let"||x==="const"){p[t-1]=-10}else if(e.types[t-1]!=="comment"&&e.stack[t-1]!=="attribute"&&(C==="end"||C==="word"||C==="reference")){p[t-1]=-20}else if(x==="["||x==="{"||x==="x{"){p[t-1]=i-1}if(e.stack[t]==="attribute"){p.push(-20);return}if(o.script.arrayFormat==="indent"){g[g.length-1]=false;p.push(i);return}if(o.script.arrayFormat==="inline"){g[g.length-1]=true;p.push(-20);return}if(A==="method"||g[g.length-1]===true){p.push(-20);return}let y=t+1;do{if(e.token[y]==="]"){p.push(-20);return}if(e.token[y]===","){p.push(i);return}y=y+1}while(y0){p[t-1]=i}}function ye(){if(W==="template_else"){p[t-1]=i-1;p.push(i)}else if(W==="template_start"){i=i+1;if(e.lines[t-1]<1)p[t-1]=-20;if(e.lines[t]>0||x.length===1&&C==="string"){p.push(i)}else{p.push(-20)}}else if(W==="template_end"){i=i-1;if(C==="template_start"||e.lines[t-1]<1){p[t-1]=-20}else{p[t-1]=i}if(e.lines[t]>0){p.push(i)}else{p.push(-20)}}else if(W==="template"){if(e.lines[t]>0){p.push(i)}else{p.push(-20)}}}function te(){if(W==="template_string_start"){i=i+1;p.push(i)}else if(W==="template_string_else"){Z();p[t-1]=i-1;p.push(i)}else{Z();i=i-1;p[t-1]=i;p.push(-10)}if(t>2&&(e.types[t-2]==="template_string_else"||e.types[t-2]==="template_string_start")){if(o.script.bracePadding===true){p[t-2]=-10;p[t-1]=-10}else{p[t-2]=-20;p[t-1]=-20}}}function U(){if(e.token[t-1]===","||e.token[t-1]===":"&&e.stack[t-1]!=="data_type"){p[t-1]=-10}else{p[t-1]=-20}if(e.types[t]==="type"||e.types[t]==="type_end"){p.push(-10)}if(e.types[t]==="type_start"){p.push(-20)}}function Y(){if((x===")"||x==="x)")&&e.stack[t]==="class"&&(e.token[e.begin[t-1]-1]==="static"||e.token[e.begin[t-1]-1]==="final"||e.token[e.begin[t-1]-1]==="void")){p[t-1]=-10;p[e.begin[t-1]-1]=-10}if(x==="]")p[t-1]=-10;if(s==="else"&&x==="}"){if(e.token[t-2]==="x}")p[t-3]=p[t-3]-1;if(o.script.braceAllman===true||o.script.elseNewline===true){p[t-1]=i}}if(s==="new"&&a.has(e.token[t+1]));if(s==="from"&&C==="end"&&t>0&&(e.token[e.begin[t-1]-1]==="import"||e.token[e.begin[t-1]-1]===",")){p[t-1]=-10}if(s==="function"){if(o.script.functionSpace===false&&t1){if(e.types[t-2]==="operator"||e.token[t-2]===","){p[t-1]=-20}else if(e.types[t-2]==="start"){p[t-2]=-20;p[t-1]=-20}}else if(s==="while"&&(x==="}"||x==="x}")){let A=t-1;let N=0;do{if(e.token[A]==="}"||e.token[A]==="x}")N=N+1;if(e.token[A]==="{"||e.token[A]==="x{")N=N-1;if(N===0){if(e.token[A-1]==="do"){p[t-1]=-10;break}p[t-1]=i;break}A=A-1}while(A>-1)}else if(s==="in"||(s==="else"&&o.script.elseNewline===false&&o.script.braceAllman===false||s==="catch")&&(x==="}"||x==="x}")){p[t-1]=-10}else if(s==="var"||s==="let"||s==="const"){d[d.length-1]=t;if(C==="end")p[t-1]=i;if(e.token[e.begin[t]-1]!=="for"){let A=t+1;let N=0;do{if(e.types[A]==="end")N=N-1;if(e.types[A]==="start")N=N+1;if(N<0||N===0&&(e.token[A]===";"||e.token[A]===",")){break}A=A+1}while(A0&&e.token[t]!==")"){if(e.types[t]==="comment"&&_[_.length-1]>-1){_[_.length-1]=o.wrap+1}else if(p[t]>-1||e.token[t].charAt(0)==="`"&&e.token[t].indexOf("\n")>0){_[_.length-1]=-1}else if(_[_.length-1]>-1){_[_.length-1]=_[_.length-1]+e.token[t].length;if(p[t]===-10)_[_.length-1]=_[_.length-1]+1}}}else{Q()}t=t+1}while(t{const t=[];const i=(()=>{const z=[];const p=o.indentChar;let G=o.indentSize;if(typeof G!=="number"||G<1)return"";do{z.push(p);G=G-1}while(G>0);return z.join("")})();const r=o.crlf===true?"\r\n":"\n";const q=o.preserveLine+1;const W=["x;","x}","x{","x(","x)"];let s=H.start;let C="";let x=o.indentLevel;function d(z){const p=[];const G=(()=>{if(s===I-1)return 1;if(e.lines[s+1]-1>q)return q;if(e.lines[s+1]>1)return e.lines[s+1]-1;return 1})();let R=0;if(z<0)z=0;do{p.push(r);R=R+1}while(R0){R=0;do{p.push(i);R=R+1}while(R-1&&e.types[g]!=="comment"){if(e.token[g+1]==="."){R=R+o.indentSize*o.indentChar.length}break}}else if(L[g]>-1){break}if(e.types[g]!=="comment"){if(L[g-1]===-10)R=R+1;R=e.token[g].length+R}g=g-1}while(g>O);k=g;if(e.token[k]===","&&e.token[u+1]==="="){do{if(e.types[k]==="end")k=e.begin[k];if(e.begin[k]===O){if(e.token[k]===";"||e.token[k]==="x;")break;if(e.token[k]==="var"||e.token[k]==="const"||e.token[k]==="let"){R=R+o.indentSize*o.indentChar.length;break}}k=k-1}while(k>O)}if(R>G)G=R;P.push([u,R]);u=g}else if(e.types[u]==="end"){u=e.begin[u]}u=u-1}while(u>O);u=P.length;if(u>0){do{u=u-1;g=P[u][1];if(g0)}};s=I;do{s=s-1;if(e.lexer[s]==="script"){if(e.token[s]==="}"&&e.token[s-1]!=="{"&&L[e.begin[s]]>0){z(s)}}else{s=e.begin[s]}}while(s>0)}s=H.start;do{if(e.lexer[s]===l||H.beautify[e.lexer[s]]===void 0){if(e.types[s]==="comment"&&o.commentIndent===true){if(/\n/.test(e.token[s])){const z=e.begin[s]>-1?e.token[s].charAt(2)==="*"?Te(L[s],i)+o.indentChar:Te(L[s],i):o.indentChar;const p=e.token[s].split(/\n/);let G=1;do{p[G]=z+p[G].trimStart();G=G+1}while(G-1){if((L[s]>-1&&e.token[s]==="{"||L[s]>-1&&e.token[s+1]==="}")&&e.lines[s]<3&&o.script.braceNewline===true){if(e.lines[s+1]<3)t.push(d(0))}t.push(d(L[s]));x=L[s]}else if(L[s]===-10){t.push(" ");if(e.lexer[s+1]!==l)x=x+1}}else{if(f[s]===s){t.push(e.token[s])}else{H.end=f[s];H.start=s;o.indentLevel=x;C=H.beautify[e.lexer[s]](o);t.push(C.replace(/\s+$/,""));s=H.iterator;if(L[s]===-10){t.push(" ")}else if(L[s]>-1){t.push(d(L[s]))}o.indentLevel=0}}s=s+1}while(s" instead of "/>".',lexer:"markup",type:"boolean"},classPadding:{description:"Inserts new line characters between every CSS code block.",default:false,type:"boolean",lexer:"style"},sortSelectors:{default:false,type:"boolean",description:"If comma separated CSS selectors should present on a single line of code.",lexer:"style"},sortProperties:{lexer:"style",description:"This option will alphabetically sort CSS properties contained within classes.",default:false,type:"boolean"},noLeadZero:{lexer:"style",description:"This will eliminate leading zeros from numbers expressed within values.",default:false,type:"boolean"},compressCSS:{lexer:"style",description:"If CSS should be beautified in a style where the properties and values are minifed for faster reading of selectors.",default:false,type:"boolean"},forceValue:{lexer:"style",description:"If CSS selector property values should be indented onto newlines",default:"preserve",type:"select",values:[{rule:"preserve",description:"Preserves property values, output does not augment provided structures"},{rule:"collapse",description:"Collapsed all selector property values onto newlines"},{rule:"wrap",description:"Collapase only selector property values which exceed wrap limit"}]},braceAllman:{lexer:"script",default:false,description:'Determines if opening curly braces will exist on the same line as their condition or be forced onto a new line, otherwise known as "Allman Style" indentation.',type:"boolean"},bracePadding:{default:false,description:"This will create a newline before and after objects values",type:"boolean",lexer:"script"},braceNewline:{default:false,description:"If true an empty line will be inserted after opening curly braces and before closing curly braces.",type:"boolean",lexer:"script"},braceStyle:{default:"none",description:"Emulates JSBeautify's brace_style option using existing Prettify options",type:"select",lexer:"script",values:[{rule:"none",description:"Ignores this option"},{rule:"collapse",description:"Sets formatObject to indent and neverflatten to true."},{rule:"collapse-preserve-inline",description:"Sets formatObject to inline and bracePadding to true"},{rule:"expand",description:"Sets objectIndent to indent and braceNewline + neverflatten to true."}]},arrayFormat:{lexer:"script",description:"Determines if all array indexes should be indented, never indented, or left to the default",type:"select",default:"default",values:[{rule:"default",description:"Default formatting"},{rule:"indent",description:"Always indent each index of an array"},{rule:"inline",description:"Ensure all array indexes appear on a single line"}]},objectSort:{default:false,description:"This option will alphabetically sort object properties in JSON objects",type:"boolean",lexer:"script"},objectIndent:{description:"This option will alphabetically sort object properties in JSON objects",type:"select",lexer:"script",default:"default",values:[{rule:"default",description:"Default formatting"},{rule:"indent",description:"Always indent each index of an array"},{rule:"inline",description:"Ensure all array indexes appear on a single line"}]},functionSpace:{lexer:"script",default:true,type:"boolean",description:"Inserts a space following the function keyword for anonymous functions."},functionNameSpace:{lexer:"script",default:true,type:"boolean",description:"If a space should follow a JavaScript function name."},methodChain:{lexer:"script",default:-1,description:"When to break consecutively chained methods and properties onto separate lines. A negative value disables this option. A value of 0 ensures method chainsare never broken.",type:"number"},caseSpace:{default:false,type:"boolean",description:"If the colon separating a case's expression (of a switch/case block) from its statement should be followed by a space instead of indentation thereby keeping the case on a single line of code.",lexer:"script"},inlineReturn:{lexer:"script",default:true,type:"boolean",description:"Inlines return statements contained within `if` and `else` conditions. This rules also augments code and will reason about your structure to output the best and most readable results."},elseNewline:{lexer:"script",default:false,type:"boolean",description:'If keyword "else" is forced onto a new line.'},ternaryLine:{lexer:"script",description:"If ternary operators in JavaScript `?` and `:` should remain on the same line.",type:"boolean",default:false},neverFlatten:{lexer:"script",default:true,description:"If destructured lists in script should never be flattend.",type:"boolean"},variableList:{lexer:"script",description:"If consecutive JavaScript variables should be merged into a comma separated list or if variables in a list should be separated. each \u2014 Ensure each reference is a single declaration statement.",type:"select",default:"none",values:[{rule:"none",description:"Ignores this option"},{rule:"each",description:"Ensure each reference is a single declaration statement"},{rule:"list",description:"Ensure consecutive declarations are a comma separated list"}]},vertical:{lexer:"script",description:"If lists of assignments and properties should be vertically aligned",type:"boolean",default:false},noCaseIndent:{lexer:"script",description:"If the colon separating a case's expression (of a switch/case block) from its statement should be followed by a space instead of indentation, thereby keeping the case on a single line of code.",default:false,type:"boolean"},noSemicolon:{lexer:"script",description:"Removes semicolons that would be inserted by ASI. This option is in conflict with option `attemptCorrection` and takes precedence over conflicting features. Use of this option is a possible security/stability risk.",default:false,type:"boolean"},endComma:{description:"If there should be a trailing comma in arrays and objects.",type:"select",lexer:"script",default:"none",values:[{rule:"none",description:"Ignore this option"},{rule:"always",description:"Always ensure there is a tailing comma"},{rule:"never",description:"Remove trailing commas"}]}};var Se={};dt(Se,{format:()=>He,language:()=>Ve,options:()=>Fe,parse:()=>rt});function xt(o){const a=o.source.search(/((\/(\*|\/))|{%-?\s*comment\s*-?%}|")break;if(G==="//"&&t.charAt(r)==="\n")break;if(G==="/*"&&t.slice(r-1,r+1)==="*/")break;if(G.charCodeAt(1)===37&&t.slice(r-1,r+1)==="%"&&t.indexOf("endcomment",t.indexOf("{%",p))>0)break}else if(t.charAt(r)===W&&W!=="${"){W=""}else if(W==="`"&&t.slice(r,r+2)==="${"){W="${"}else if(W==="${"&&t.charAt(r)==="}"){W="`"}}r=r+1}while(r0){W=t.slice(q,r+1);if(G==="" + ], + [ + "<", + ">" + ], + [ + "{{", + "}}" + ], + [ + "{%", + "%}" + ], + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "---", + "---" + ] + ], + "autoClosingPairs": [ + { + "open": "{", + "close": "}" + }, + { + "open": "[", + "close": "]" + }, + { + "open": "(", + "close": ")" + }, + { + "open": "'", + "close": "'" + }, + { + "open": "\"", + "close": "\"" + } + ], + "surroundingPairs": [ + { + "open": "'", + "close": "'" + }, + { + "open": "\"", + "close": "\"" + }, + { + "open": "<", + "close": ">" + }, + { + "open": "{", + "close": "}" + } + ], + "folding": { + "markers": { + "start": "^\\s*//\\s*#?region\\b", + "end": "^\\s*//\\s*#?endregion\\b" + } + }, + "onEnterRules": [ + { + "beforeText": { + "pattern": "<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!\\/)>)[^<]*$", + "flags": "i" + }, + "afterText": { + "pattern": "^<\\/([_:\\w][_:\\w-.\\d]*)\\s*>", + "flags": "i" + }, + "action": { + "indent": "indentOutdent" + } + }, + { + "beforeText": { + "pattern": "<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))(\\w[\\w\\d]*)([^/>]*(?!\\/)>)[^<]*$", + "flags": "i" + }, + "action": { + "indent": "indent" + } + } + ], +} diff --git a/liquidrc.json b/liquidrc.json deleted file mode 100644 index 4cb62d1e..00000000 --- a/liquidrc.json +++ /dev/null @@ -1,601 +0,0 @@ -{ - "title": "JSON formatting schema for the VSCode Liquid extension", - "$schema": "http://json-schema.org/draft-07/schema#", - "definitions": { - "markup": { - "properties": { - "correct": { - "type": "boolean", - "default": false, - "title": "Fix Sloppy Code", - "description": "Automatically attempts to correct some sloppiness in code. Use this option with care, it may wreak havoc in some cases." - }, - "attributeCasing": { - "type": "string", - "default": "preserve", - "description": "Control the casing of attributes", - "oneOf": [ - { - "enum": ["preserve"] - }, - { - "enum": ["lowercase"] - }, - { - "enum": ["lowercase-name"] - }, - { - "enum": ["lowercase-value"] - } - ] - }, - "attributeSort": { - "type": "boolean", - "default": false, - "title": "Sort Attributes", - "description": "Alphanumerically sort HTML attributes from A to Z." - }, - "attributeSortList": { - "type": "array", - "title": "Sort Attribute List", - "items": { - "type": "string" - }, - "description": "A list of HTML attribute names. Attributes will be sorted according to this list and then alphanumerically. This option requires \"attribute_sort\" have a value of true and does not support Liquid tag names, only HTML names are applicable.", - "markdownDescription": "A list of HTML attribute names. Attributes will be sorted according to this list and then alphanumerically. This option requires `attribute_sort` have a value of `true` and does not accept Liquid tag names, only HTML names are applicable." - }, - "attributeValues": { - "default": "preserve", - "type": "string", - "description": "How attribute values should be handled. By default, Prettify strips extraneous whitespaces from HTML attribute values but preserves newlines. You can control how attribute values should be processed.\\n\\nPlease note that this option is experimental and may not fully work as intended.", - "oneOf": [ - { - "enum": ["preserve"] - }, - { - "enum": ["wrap"] - }, - { - "enum": ["strip"] - }, - { - "enum": ["collapse"] - } - ] - }, - "delimiterSpacing": { - "type": "boolean", - "default": false, - "description": "Whether or not delimiter characters should apply a single space at the start and end points." - }, - "commentNewline": { - "type": "boolean", - "default": false, - "description": "This will determine whether comments should always start at position 0 of each line or if comments should be indented according to the code.", - "markdownDescription": "This will determine whether comments should always start at position `0` of each line or if comments should be indented according to the code." - }, - "forceLeadAttribute": { - "type": "boolean", - "default": false, - "description": "Whether the leading attribute should be forced onto a newline when word `wrap` limit is exceeded or if it should be preserved. By default, Prettify preserves the leading attribute when applying wrap indentation. Enabling this option will force indent all attributes if wrap is exceeded." - }, - "forceIndent": { - "type": "boolean", - "default": false, - "description": "Will force indentation upon all content and tags without regard for the text nodes." - }, - "forceAttribute": { - "type": ["boolean", "number"], - "default": false, - "description": "If all document attributes should be indented each onto their own line." - }, - "preserveText": { - "type": "boolean", - "default": true, - "title": "Preserve Markup Text White Space", - "description": "If text in the provided document code should be preserved exactly as provided. This option eliminates beautification and wrapping of text content." - }, - "selfCloseSpace": { - "type": "boolean", - "default": false, - "description": "Markup self-closing tags end will end with ' />' instead of '/>'", - "markdownDescription": "Markup self-closing tags end will end with ' />' instead of '/>' on the ending delimeters.\n\n---\n\n**Disabled**:\n\n\t\n\n**Enabled**:\n\n\t\n\n---\n\n**NOTE:**\n\nThis is optional and self-closing tags are no longer required as of HTML5, so use this how you wish." - }, - "preserveAttributes": { - "type": "boolean", - "default": false, - "description": "If HTML tags should have their insides (attributes) preserved. This option will prevent attributes from being formatted.", - "markdownDescription": "If HTML tags should have their insides (attributes) preserved. This option will prevent attributes from being formatted.\n\n---\n\n**Disabled** 👎\n\n\t
    \n\n**Enabled** 👍\n\n\t\n\n---\n\n**NOTE:**\n\nThere might be some situations where you do not desire attributes to be formatted, in such case use this option." - }, - "quoteConvert": { - "default": "none", - "description": "If quotation character should be converted to specific type or not.", - "oneOf": [ - { - "enum": ["double"], - "description": "Converts single quotes to double quotes" - }, - { - "enum": ["none"], - "description": "Ignores this option" - }, - { - "enum": ["single"], - "description": "Converts double quotes to single quotes" - } - ] - } - } - }, - "style": { - "properties": { - "correct": { - "type": "boolean", - "default": false, - "title": "Fix Sloppy Code", - "description": "Automatically attempts to correct some sloppiness in code. Use this option with care, it may wreak havoc in some cases." - }, - "braceAllman": { - "type": "boolean", - "default": false, - "title": "Style of Indent", - "description": "Determines if opening curly braces will exist on the same line as their condition or be forced onto a new line. (Allman style indentation)" - }, - "comments": { - "type": "boolean", - "default": false, - "description": "This will determine whether comments should always start at position 0 of each line or if comments should be indented according to the code" - }, - "sortSelectors": { - "type": "boolean", - "default": false, - "description": "Sort Selectors" - }, - "sortProperties": { - "type": "boolean", - "default": false, - "description": "Sort Selectors" - }, - "classPadding": { - "type": "boolean", - "default": false, - "title": "Insert Empty Lines", - "description": "Inserts new line characters between every CSS code block." - }, - "noLeadZero": { - "type": "boolean", - "default": false, - "title": "Leading 0s", - "description": "Whether leading 0s in CSS values immediately preceding a decimal should be removed or prevented." - }, - "selectorList": { - "type": "boolean", - "default": false, - "title": "Single Lined Selectors", - "description": "If comma separated CSS selectors should present on a single line of code." - } - } - }, - "script": { - "properties": { - "correct": { - "type": "boolean", - "default": false, - "title": "Fix Sloppy Code", - "description": "Automatically attempts to correct some sloppiness in code. Use this option with care, it may wreak havoc in some cases." - }, - "braceAllman": { - "type": "boolean", - "default": false, - "title": "Style of Indent", - "description": "Determines if opening curly braces will exist on the same line as their condition or be forced onto a new line. (Allman style indentation)" - }, - "braceNewline": { - "type": "boolean", - "default": false, - "title": "Brace Lines", - "description": "If true an empty line will be inserted after opening curly braces and before closing curly braces" - }, - "bracePadding": { - "type": "boolean", - "default": false, - "title": "Brace Padding", - "description": "Inserts a space after the start of a container and before the end of the container if the contents of that container are not indented; such as: conditions, function arguments, and escaped sequences of template strings" - }, - "braceStyle": { - "type": "string", - "default": "none", - "title": "Brace Style", - "description": "Emulates JSBeautify's brace_style option", - "oneOf": [ - { - "enum": ["collapse"], - "description": "Sets options.format_object to 'indent' and options.neverflatten to true" - }, - { - "enum": ["collapse-preserve-inline"], - "description": "Sets options.bracepadding to true and options.format_object to 'inline'" - }, - { - "enum": ["expand"], - "description": "Sets options.braces to true, options.format_object to 'indent', and options.never flatten to true." - }, - { - "enum": ["none"], - "description": "Ignores this option" - } - ] - }, - "caseSpace": { - "type": "boolean", - "default": false, - "title": "Space Following Case", - "description": "If the colon separating a case's expression (of a switch/case block) from its statement should be followed by a space instead of indentation, thereby keeping the case on a single line of code" - }, - "commentIndent": { - "type": "boolean", - "default": false, - "title": "Comment Indentation", - "description": "This will determine whether comments should always start at position 0 of each line or if comments should be indented according to the code" - }, - "inlineReturn": { - "type": "boolean", - "default": false, - "title": "If can return inline" - }, - "elseNewline": { - "type": "boolean", - "default": false, - "title": "Else On New Line", - "description": "If else_line is true then the keyword 'else' is forced onto a new line." - }, - "endComma": { - "type": "string", - "default": "none", - "title": "Trailing Comma", - "description": "If there should be a trailing comma in arrays and objects", - "oneOf": [ - { - "enum": ["always"], - "description": "Always ensure there is a tailing comma" - }, - { - "enum": ["never"], - "description": "Remove trailing commas" - }, - { - "enum": ["none"], - "description": "Ignore this option" - } - ] - }, - "arrayFormat": { - "type": "string", - "default": "default", - "title": "Formatting Arrays", - "description": "Determines if all array indexes should be indented, never indented, or left to the default.", - "oneOf": [ - { - "enum": ["default"], - "description": "Default formatting" - }, - { - "enum": ["indent"], - "description": "Always indent each index of an array" - }, - { - "enum": ["inline"], - "description": "Ensure all array indexes appear on a single line" - } - ] - }, - "objectIndent": { - "type": "string", - "default": "default", - "title": "Formatting Arrays", - "description": "Determines if all object keys should be indented, never indented, or left to the default", - "oneOf": [ - { - "enum": ["default"], - "description": "Default formatting" - }, - { - "enum": ["indent"], - "description": "Always indent each key/value pair" - }, - { - "enum": ["inline"], - "description": "Ensure all key/value pairs appear on the same single line" - } - ] - }, - "functionNameSpace": { - "type": "boolean", - "default": false, - "title": "Space After Function Name", - "description": "If a space should follow a JavaScript function name" - }, - "methodChain": { - "type": "number", - "default": 3, - "title": "Method Chains", - "description": "When to break consecutively chained methods and properties onto separate lines. A negative value disables this option. A value of 0 ensures method chains are never broken" - }, - "neverFlatten": { - "type": "boolean", - "default": false, - "title": "Never Flatten Destructured Lists", - "description": "If destructured lists in script should never be flattend" - }, - "noCaseIndent": { - "type": "boolean", - "default": false, - "title": "Case Indentation", - "description": "If a case statement should receive the same indentation as the containing switch block." - }, - "noSemicolon": { - "type": "boolean", - "default": false, - "title": "No Semicolons", - "description": "Removes semicolons that would be inserted by ASI. This option is in conflict with option 'correct' and takes precedence over conflicting features. Use of this option is a possible security/stability risk" - }, - "preserveComment": { - "type": "boolean", - "default": false, - "title": "Eliminate Word Wrap Upon Comments", - "description": "Prevent comment reformatting due to option wrap" - }, - "quoteConvert": { - "default": "none", - "title": "Convert Quotes", - "description": "If the quotes of script strings or document attributes should be converted to single quotes or double quotes", - "oneOf": [ - { - "enum": ["double"], - "description": "Converts single quotes to double quotes" - }, - { - "enum": ["none"], - "description": "Ignores this option" - }, - { - "enum": ["single"], - "description": "Converts double quotes to single quotes" - } - ] - }, - "functionSpace": { - "type": "boolean", - "default": false, - "title": "Function Space", - "description": "Inserts a space following the function keyword for anonymous functions" - }, - "styleGuide": { - "type": "string", - "default": "none", - "title": "Script Styleguide", - "description": "Provides a collection of option presets to easily conform to popular JavaScript style guides.", - "oneOf": [ - { - "enum": ["none"] - }, - { - "enum": ["airbnb"] - }, - { - "enum": ["crockford"] - }, - { - "enum": ["google"] - }, - { - "enum": ["jquery"] - }, - { - "enum": ["mediawiki"] - }, - { - "enum": ["semistandard"] - }, - { - "enum": ["standard"] - }, - { - "enum": ["yandex"] - } - ] - }, - - "ternaryLine": { - "type": "boolean", - "default": false, - "title": "Keep Ternary Statements On One Line", - "description": "If ternary operators in JavaScript ? and : should remain on the same line" - }, - "variableList": { - "type": "boolean", - "default": false, - "title": "Variable Declaration Lists", - "description": "If consecutive JavaScript variables should be merged into a comma separated list or if variables in a list should be separated" - } - } - }, - "json": { - "properties": { - "arrayFormat": { - "type": "string", - "default": "default", - "title": "Formatting Arrays", - "description": "Determines if all array indexes should be indented, never indented, or left to the default.", - "oneOf": [ - { - "enum": ["default"], - "description": "Default formatting" - }, - { - "enum": ["indent"], - "description": "Always indent each index of an array" - }, - { - "enum": ["inline"], - "description": "Ensure all array indexes appear on a single line" - } - ] - }, - "braceAllman": { - "type": "boolean", - "default": false, - "title": "Style of Indent", - "description": "Determines if opening curly braces will exist on the same line as their condition or be forced onto a new line. (Allman style indentation)" - }, - "bracePadding": { - "type": "boolean", - "default": false, - "title": "Brace Lines", - "description": "If true an empty line will be inserted after opening curly braces and before closing curly braces" - }, - "braceStyle": { - "type": "string", - "default": "none", - "title": "Brace Style", - "description": "Emulates JSBeautify's brace_style option", - "oneOf": [ - { - "enum": ["collapse"], - "description": "Sets options.format_object to 'indent' and options.neverflatten to true" - }, - { - "enum": ["collapse-preserve-inline"], - "description": "Sets options.bracepadding to true and options.format_object to 'inline'" - }, - { - "enum": ["expand"], - "description": "Sets options.braces to true, options.format_object to 'indent', and options.never flatten to true." - }, - { - "enum": ["none"], - "description": "Ignores this option" - } - ] - }, - "formatArray": { - "type": "string", - "default": "default", - "title": "Formatting Arrays", - "description": "Determines if all array indexes should be indented, never indented, or left to the default.", - "oneOf": [ - { - "enum": ["default"], - "description": "Default formatting" - }, - { - "enum": ["indent"], - "description": "Always indent each index of an array" - }, - { - "enum": ["inline"], - "description": "Ensure all array indexes appear on a single line" - } - ] - }, - "objectIndent": { - "type": "string", - "default": "default", - "title": "Formatting Objects", - "description": "Determines if all object keys should be indented, never indented, or left to the default", - "oneOf": [ - { - "enum": ["default"], - "description": "Default formatting" - }, - { - "enum": ["indent"], - "description": "Always indent each key/value pair" - }, - { - "enum": ["inline"], - "description": "Ensure all key/value pairs appear on the same single line" - } - ] - } - } - }, - "ignore": { - "items": [ - { - "type": "string", - "description": "Glob pattern to files and/or directories to be ignored by the formatter" - } - ] - } - }, - "properties": { - "prettify": { - "type": "object", - "title": "Prettify Beautification", - "description": "Formatting rules and options passed to Prettify", - "properties": { - "wrap": { - "type": "number", - "title": "Wrap Limit", - "description": "Character width limit before applying word wrap. A `0` value disables this option. Typically, you can leave this option, as it will defaults to the word wrap limit set within workspace/user settings of your text editor." - }, - "indentSize": { - "type": "number", - "default": 2, - "description": "The level of indentation to be applied to HTML and Liquid syntax. This option does not apply to embedded regions." - }, - "commentIndent": { - "type": "boolean", - "default": false, - "description": "If a blank new line should be forced above comments." - }, - "preserveLine": { - "type": "number", - "default": 3, - "description": "The maximum number of consecutive empty lines to retain." - }, - "preserveComment": { - "type": "boolean", - "default": false, - "title": "Eliminate Word Wrap Upon Comments", - "description": "Prevent comment reformatting due to option wrap." - }, - "endNewLine": { - "type": "boolean", - "default": false, - "description": "Whether or not to insert a final line. When this rule is undefined in a `.liquidrc` file the Text Editors settings will be used, in vscode that is `*.endWithNewline` where `*` is a language name. If an `.editorconfig` file is found present in root, those rules will be applied in **precedence** over Text Editor" - }, - "crlf": { - "type": "boolean", - "default": false, - "description": " If line termination should be Windows (CRLF) format. Unix (LF) format is the default." - }, - "markup": { - "type": "object", - "additionalProperties": false, - "description": "HTML beautification formatting options and rules", - "$ref": "#/definitions/markup" - }, - "script": { - "type": "object", - "additionalProperties": false, - "description": "JavaScript beautification formatting options and rules. Applied to any defined files, HTML + + + + +{%- liquid + if + foo == bar + elsif + 'foo' + endif + assign name = 'bar' | filter: 100 +-%} + + + +{% # TEST: Liquid Schema Tag Block Validations %} + + + +
    + + {%- if section.settings.buttons -%} + + + {%- endif -%} +
    + +{% comment %} + + The JSON in this emebedded code region will be formatted. + Press: cmd + s{% endcomment %} +{% schema %} + { + "name": "Collection list", + "tag": "section", + "class": "collection-list", + "max_blocks": 4, + "settings": [ + { + "type": "header", + "content": "Style", + "info": "Customize a block list of collections" + }, + + + { + "type": "range", + "id": "gutter", + "label": "Gutter", + "min": 0, + "max": 5, + "step": 1, + "default": 2 + }, + { + "type": "range", + "id": "overlay", + "label": "Overlay", + "min": 0, + "max": 1, + "step": 0.1, + "default": 0, + "info": "Use an overlay to better distinguish text" + }, + + + { + "type": "select", + "id": "align", + "label": "Align", + "default": "jc-center ai-end", + "options": [ + { + "value": "jc-start ai-start", + "label": "Top Left" + }, + { + "value": "jc-center ai-start", + "label": "Top Center" + }, + { + "value": "jc-end ai-start", + "label": "Top Right" + }, + { + "value": "jc-start ai-center", + "label": "Middle Left" + }, + { + "value": "jc-center ai-center", + "label": "Middle Center" + }, + { + "value": "jc-end ai-center", + "label": "Middle Right" + }, + { + "value": "jc-start ai-end", + "label": "Bottom Left" + }, + { + "value": "jc-center ai-end", + "label": "Bottom Center" + }, + { + "value": "jc-end ai-end", + "label": "Bottom Right" + } + ] + }, + { + "type": "header", + "content": "Caption", + "info": "Customize the text caption to be displayed on each collection image block" + }, + { + "type": "radio", + "id": "type", + "label": "Text Type", + "default": "text-normal", + "options": [ + { + "value": "text-normal", + "label": "Normal" + }, + { + "value": "text-button", + "label": "Button" + } + ] + }, + { + "type": "range", + "id": "text_size", + "label": "Text Size", + "min": 1, + "max": 6, + "step": 1, + "default": 3 + }, + { + "type": "color", + "label": "Text Colour", + "id": "text_color", + "default": "#ffffff" + }, + { + "type": "color", + "label": "Button Colour", + "id": "button_color", + "info": "Only applicable when Text Type is \"Button\", otherwise the preset is ignored.", + "default": "#111111" + } + ], + "blocks": [ + { + "type": "collection_gender", + "name": { + "en": "Collection Gender" + }, + "settings": [ + { + "type": "text", + "id": "title", + "label": "Title" + }, + { + "type": "collection", + "id": "url_men", + "label": "URL" + }, + { + "type": "collection", + "id": "url_women", + "label": "URL" + }, + { + "type": "image_picker", + "id": "image", + "label": "Image" + } + ] + }, + { + "type": "collection_links", + "name": { + "en": "Collection Item" + }, + "settings": [ + { + "type": "text", + "id": "title", + "label": "Title" + }, + { + "id": "collection", + "type": "collection", + "label": { + "en": "Collection", + "de": "Kategorie", + "fr": "Collection" + } + }, + { + "type": "checkbox", + "id": "gender_popup", + "default": false, + "label": "Gender Popup", + "info": "Should a gender popup overlay be applied onClick?" + }, + { + "type": "image_picker", + "id": "image", + "label": "Image" + } + ] + } + ], + "presets": [ + { + "name": "Collection List", + "category": "Collection", + "settings": { + "align": "jc-center ai-end" + }, + "blocks": [ + { + "type": "collection_links", + "settings": { + "title": "Collection Name" + } + }, + { + "type": "collection_links", + "settings": { + "title": "Collection Name" + } + }, + { + "type": "collection_links", + "settings": { + "title": "Collection Name" + } + } + ] + } + ] + } +{% endschema %} + diff --git a/test/suffixed/test.css.liquid b/test/suffixed/test.css.liquid new file mode 100644 index 00000000..b64ee29d --- /dev/null +++ b/test/suffixed/test.css.liquid @@ -0,0 +1,13 @@ +{% if condition %} + + .class-name + { + background: #FFF; + font-size: {{ object.prop | append: 'px' }}; + {% if some_condition %} + margin: {{ x }}; + {% endif %} + } + +{% endif %} + diff --git a/test/suffixed/test.js.liquid b/test/suffixed/test.js.liquid new file mode 100644 index 00000000..e3b6f901 --- /dev/null +++ b/test/suffixed/test.js.liquid @@ -0,0 +1,42 @@ +const foo = 'bar' + + +function () { + + + const x = 100; + + + const x = function ( param ) { + + + const i = {%- if link.active -%} + 'hello' + {%- else -%} + 'world' + {%- endif -%}; + + const o = [{% for i in arr %}'{{ i }}',{% endif %}]; + + console.log( param['string'][20] ); + + window.prop() + + const c = new Class() + + } + + +} + + +{% if link.active -%} + + {%- assign link_class = 'link mb-2 d-block ' | append: 'active' -%} + +{%- else -%} + + {%- assign link_class = 'link mb-2 d-block' -%} + +{%- endif -%} + diff --git a/test/suffixed/test.json.liquid b/test/suffixed/test.json.liquid new file mode 100644 index 00000000..eea91920 --- /dev/null +++ b/test/suffixed/test.json.liquid @@ -0,0 +1,5 @@ +{ + + 'file': '{{ foo }}' +} + diff --git a/test/suffixed/test.yaml.liquid b/test/suffixed/test.yaml.liquid new file mode 100644 index 00000000..2310b3f9 --- /dev/null +++ b/test/suffixed/test.yaml.liquid @@ -0,0 +1,43 @@ +--- # yaml document beginning + + +integerValue: 1 # integer value +floatingValue: 1 # floating vale + +stringValue: "456" # string with double quotes +stringValue: 'abc' # string with single quotes +stringValue: wer # string without quotes + +{{ object.prop[1200] | form: 'string' }} + +booleanValue: true # boolean values - true or false + + +# Multiline string with literal block syntax -preserved new lines +string1: | + Line1 + line2 + "line3" + line4 + +# Multiline strings with folded block syntax - new lines are not preserved, leading and trailing spaces are ignore + string1: > + Line1 + line2 + "line3" + line4 +# Collection sequence data types + # sequence arraylist example + - One + - two + - Three + + # another way of sequence syntax example + [one, two , three] + +### dictionary + mysqldatabase: + hostname: localhost + port: 3012 + username: root + password: root diff --git a/test/templates/index.json b/test/templates/index.json new file mode 100644 index 00000000..42c4fca6 --- /dev/null +++ b/test/templates/index.json @@ -0,0 +1,8 @@ +{ + "sections": { + "x": { + "" + } + } +}; + diff --git a/test/templates/index.test.json b/test/templates/index.test.json new file mode 100644 index 00000000..6797a7d6 --- /dev/null +++ b/test/templates/index.test.json @@ -0,0 +1,5 @@ +{ + "layout": "", + "name": "", + "sections": {} +} diff --git a/test/test.liquid b/test/test.liquid new file mode 100644 index 00000000..479f576d --- /dev/null +++ b/test/test.liquid @@ -0,0 +1,167 @@ + + + + + + + + {{- page_title -}} + {%- if current_tags -%} + {%- assign meta_tags = current_tags | join: ", " -%} + {{ "general.meta.tags" | t: tags: meta_tags | prepend: " – " }} + {%- endif -%} + {%- if current_page != 1 -%} + {{ "general.meta.page" | t: page: current_page | prepend: " – " }} + {%- endif -%} + {%- unless page_title contains shop.name -%} + {{ shop.name | prepend: " –" }} + {%- endunless -%} + + + + {%- render "favicons" -%} + {%- render "meta_tags" -%} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {%- if template contains "customers" -%} + + + {%- endif -%} + + {%- capture content_header -%} + {{ content_for_header }} + {%- endcapture -%} + + {{ content_header | replace: " + + + +

    + + +
    + {%- if condition -%} + {%- endif -%} + + + {%- render "drawer_menu", overlay: "drawer-overlay" -%} + {%- render "drawer_cart", overlay: "drawer-overlay" -%} + {%- section "header" -%} + {{ content_for_layout }} + + + {%- section "footer" -%} + {%- render "icons" -%} + {%- render "nodes" -%} + {%- render "gdrp", overlay: "bg-visible" -%} + {%- render "discounts" -%} + + + + + + diff --git a/tsconfig.json b/tsconfig.json index 4596d759..6100b3be 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,30 +1,53 @@ { -"typeAcquisition": { -"enable": true, -"include": ["node"], -"exclude": ["node_modules"] -}, -"compilerOptions": { -"types": ["node"], -"incremental": true, -"declaration": false, -"outDir": "package", -"target": "ES6", -"removeComments": true, -"lib": ["es2020"], -"module": "ESNext", -"alwaysStrict": true, -"allowUmdGlobalAccess": true, -"experimentalDecorators": true, -"allowSyntheticDefaultImports": true, -"esModuleInterop": true, -"resolveJsonModule": true, -"preserveSymlinks": true, -"skipDefaultLibCheck": false, -"moduleResolution": "node", -"noEmitOnError": false, -"noUnusedLocals": true, -"noUnusedParameters": true, -"pretty": true -} + "typeAcquisition": { + "enable": true, + "include": [ + "node" + ], + "exclude": [ + "node_modules" + ] + }, + "compilerOptions": { + "types": [ + "node" + ], + "incremental": true, + "declaration": false, + "outDir": "dist", + "target": "ES6", + "removeComments": true, + "lib": [ + "es2020" + ], + "module": "ESNext", + "alwaysStrict": true, + "allowUmdGlobalAccess": true, + "experimentalDecorators": true, + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "preserveSymlinks": true, + "skipDefaultLibCheck": false, + "moduleResolution": "node", + "noEmitOnError": false, + "noUnusedLocals": true, + "noUnusedParameters": true, + "pretty": true, + "baseUrl": "./src", + "paths": { + "providers/*": [ + "providers/*.ts" + ], + "utils": [ + "utils.ts" + ], + "state": [ + "state.ts" + ], + "types": [ + "types.ts" + ] + } + } } diff --git a/vsix/shopify-liquid-3.0.0.vsix b/vsix/shopify-liquid-3.0.0.vsix new file mode 100644 index 00000000..be467842 Binary files /dev/null and b/vsix/shopify-liquid-3.0.0.vsix differ