@lensjs/core 2.0.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -0
- package/dist/abstracts/store.cjs +13 -0
- package/dist/abstracts/store.d.cts +6 -3
- package/dist/abstracts/store.d.ts +6 -3
- package/dist/abstracts/store.js +13 -0
- package/dist/core/api_controller.cjs +22 -1
- package/dist/core/api_controller.d.cts +4 -2
- package/dist/core/api_controller.d.ts +4 -2
- package/dist/core/api_controller.js +22 -1
- package/dist/core/lens.cjs +52 -4
- package/dist/core/lens.js +52 -4
- package/dist/exception-3AZsPtAg.d.ts +52 -0
- package/dist/exception-C69UCHPk.d.cts +52 -0
- package/dist/index.cjs +207 -29
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +204 -29
- package/dist/stores/better_sqlite.cjs +19 -3
- package/dist/stores/better_sqlite.d.cts +9 -1
- package/dist/stores/better_sqlite.d.ts +9 -1
- package/dist/stores/better_sqlite.js +19 -3
- package/dist/stores/index.cjs +19 -3
- package/dist/stores/index.js +19 -3
- package/dist/types/index.cjs +1 -0
- package/dist/types/index.d.cts +26 -2
- package/dist/types/index.d.ts +26 -2
- package/dist/types/index.js +1 -0
- package/dist/ui/assets/{CacheActionBadge-3jjmNjC6.js → CacheActionBadge-CK7JdKoE.js} +1 -1
- package/dist/ui/assets/CacheEntriesTable-C5HcgCZI.js +1 -0
- package/dist/ui/assets/CacheEntryContainer-C0no2_6_.js +2 -0
- package/dist/ui/assets/{CacheEntryDetails-CHt_pNTk.js → CacheEntryDetails-D9Xy7d9u.js} +1 -1
- package/dist/ui/assets/CacheEntryDetailsContainer-BcwliP55.js +2 -0
- package/dist/ui/assets/ExceptionContainer-CQalcd8x.js +2 -0
- package/dist/ui/assets/ExceptionDetails-BbIFoM7M.js +16 -0
- package/dist/ui/assets/ExceptionDetailsContainer-fajmF7id.js +2 -0
- package/dist/ui/assets/ExceptionTable-DY3mmGT4.js +1 -0
- package/dist/ui/assets/{LoadMore-DHOrhPsi.js → LoadMore-CJh7FLbl.js} +1 -1
- package/dist/ui/assets/QueriesContainer-DWTsKzEk.js +2 -0
- package/dist/ui/assets/{QueryDetailsContainer-eoLkgEjj.js → QueryDetailsContainer-7CA9a5de.js} +7 -7
- package/dist/ui/assets/{QueryTable-BXSzT-Cm.js → QueryTable-pn7Ayura.js} +1 -1
- package/dist/ui/assets/RequestDetails-CYSM4og8.js +1 -0
- package/dist/ui/assets/{RequestDetailsContainer-BaH6fUK7.js → RequestDetailsContainer-BECT0XJh.js} +2 -2
- package/dist/ui/assets/RequestsContainer-DLkjpX67.js +2 -0
- package/dist/ui/assets/{RequetsTable-B51VXisk.js → RequetsTable-Cgas07Fe.js} +1 -1
- package/dist/ui/assets/{StatusCode-DVhX11V3.js → StatusCode-C5lihzKZ.js} +1 -1
- package/dist/ui/assets/TabbedDataViewer-BUMQ0QVm.js +1 -0
- package/dist/ui/assets/{Table-D1Kpw7PA.js → Table-BesHc4Lc.js} +1 -1
- package/dist/ui/assets/columns-C1CwS8yE.js +1 -0
- package/dist/ui/assets/{columns-jYfhBxOM.js → columns-CULxhcpY.js} +1 -1
- package/dist/ui/assets/{columns-BIDLCW64.js → columns-gYFQU5qH.js} +1 -1
- package/dist/ui/assets/index-B2QCOgug.css +1 -0
- package/dist/ui/assets/{index-CpP2Ap5X.js → index-BRRKsoNv.js} +1 -1
- package/dist/ui/assets/{index-BdvbrZNf.js → index-PEcJ5nx0.js} +26 -21
- package/dist/ui/assets/{useCacheEntries-vuHEIj6E.js → useCacheEntries-jbGe2CRY.js} +1 -1
- package/dist/ui/assets/useExceptions-uYUhAW-J.js +1 -0
- package/dist/ui/assets/useLensApi-BsDmB7vx.js +1 -0
- package/dist/ui/assets/{useLoadMore-twYxPJ-d.js → useLoadMore-sLsrekV5.js} +1 -1
- package/dist/ui/assets/{useQueries-BYFLoUQR.js → useQueries-DJE91mYq.js} +1 -1
- package/dist/ui/index.html +2 -2
- package/dist/utils/async_context.cjs +113 -0
- package/dist/utils/async_context.d.cts +6 -1
- package/dist/utils/async_context.d.ts +6 -1
- package/dist/utils/async_context.js +102 -0
- package/dist/utils/exception.cjs +130 -0
- package/dist/utils/exception.d.cts +3 -0
- package/dist/utils/exception.d.ts +3 -0
- package/dist/utils/exception.js +91 -0
- package/dist/utils/index.cjs +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/watchers/cache_watcher.cjs +12 -16
- package/dist/watchers/cache_watcher.js +12 -16
- package/dist/watchers/exception_watcher.cjs +108 -0
- package/dist/watchers/exception_watcher.d.cts +10 -0
- package/dist/watchers/exception_watcher.d.ts +10 -0
- package/dist/watchers/exception_watcher.js +75 -0
- package/dist/watchers/index.cjs +53 -16
- package/dist/watchers/index.d.cts +1 -0
- package/dist/watchers/index.d.ts +1 -0
- package/dist/watchers/index.js +42 -16
- package/package.json +8 -6
- package/dist/ui/assets/CacheEntriesTable-DPLre6br.js +0 -1
- package/dist/ui/assets/CacheEntryContainer-WN6LkoCR.js +0 -2
- package/dist/ui/assets/CacheEntryDetailsContainer-BhquSApO.js +0 -2
- package/dist/ui/assets/QueriesContainer-Cl6rq4dH.js +0 -2
- package/dist/ui/assets/RequestDetails-CIB7_XWh.js +0 -1
- package/dist/ui/assets/RequestsContainer-DLS17BWP.js +0 -2
- package/dist/ui/assets/TabbedDataViewer-CNSEhc6h.js +0 -1
- package/dist/ui/assets/index-C04tuZDI.css +0 -1
- package/dist/ui/assets/useLensApi-Bzmx8hps.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CacheEntriesTable-C5HcgCZI.js","./index-PEcJ5nx0.js","./index-B2QCOgug.css","./LoadMore-CJh7FLbl.js","./Table-BesHc4Lc.js","./columns-gYFQU5qH.js","./index-BRRKsoNv.js","./CacheActionBadge-CK7JdKoE.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as t,j as a,_ as s}from"./index-PEcJ5nx0.js";import{u as i}from"./useLoadMore-sLsrekV5.js";import{u as m}from"./useCacheEntries-jbGe2CRY.js";import"./useLensApi-BsDmB7vx.js";const n=t.lazy(()=>s(()=>import("./CacheEntriesTable-C5HcgCZI.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)),_=()=>{const{loadMoreItems:e,getItems:r}=m(),o=i({paginatedPage:e});return t.useEffect(()=>{r()},[]),a.jsx(n,{hasMoreObject:o})};export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a,L as s,q as i,k as r}from"./index-
|
|
1
|
+
import{j as a,L as s,q as i,k as r}from"./index-PEcJ5nx0.js";import{D as n,T as o,J as u}from"./TabbedDataViewer-BUMQ0QVm.js";import{C as d}from"./CacheActionBadge-CK7JdKoE.js";function y({data:e}){const t=[e.lens_entry_id?{label:"Request",value:a.jsx(s,{to:`${i(r()).REQUESTS}/${e.lens_entry_id}`,className:"text-blue-600 hover:underline font-semibold",children:"View Request"}),className:"text-gray-900 dark:text-gray-100"}:null,{label:"Operation",value:a.jsx(d,{action:e.data.action}),className:"text-gray-900 dark:text-gray-100"},e.data.data.key?{label:"Key",value:e.data.data.key??"__",className:"text-gray-900 dark:text-gray-100"}:null].filter(l=>!!l);return a.jsxs("div",{className:"flex flex-col gap-4",children:[a.jsx(n,{title:"Details",items:t}),a.jsx(o,{tabs:[{id:"value",label:"Value",shouldShow:!!e.data.data.value,content:a.jsx(u,{data:e.data.data.value})}],defaultActiveTab:"value"})]})}export{y as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CacheEntryDetails-D9Xy7d9u.js","./index-PEcJ5nx0.js","./index-B2QCOgug.css","./TabbedDataViewer-BUMQ0QVm.js","./CacheActionBadge-CK7JdKoE.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{m as o,r as s,j as r,_ as i}from"./index-PEcJ5nx0.js";import{u as m}from"./useCacheEntries-jbGe2CRY.js";import"./useLensApi-BsDmB7vx.js";const n=s.lazy(()=>i(()=>import("./CacheEntryDetails-D9Xy7d9u.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),E=()=>{const{item:e,getItem:a}=m(),{id:t}=o();return s.useEffect(()=>{t&&a(t)},[t]),r.jsx("div",{children:e&&r.jsx(n,{data:e})})};export{E as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ExceptionTable-DY3mmGT4.js","./index-PEcJ5nx0.js","./index-B2QCOgug.css","./LoadMore-CJh7FLbl.js","./Table-BesHc4Lc.js","./columns-C1CwS8yE.js","./index-BRRKsoNv.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as t,j as s,_ as a}from"./index-PEcJ5nx0.js";import{u as i}from"./useLoadMore-sLsrekV5.js";import{u as m}from"./useExceptions-uYUhAW-J.js";import"./useLensApi-BsDmB7vx.js";const n=t.lazy(()=>a(()=>import("./ExceptionTable-DY3mmGT4.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)),_=()=>{const{loadMoreItems:e,getItems:o}=m(),r=i({paginatedPage:e});return t.useEffect(()=>{o()},[]),s.jsx(n,{hasMoreObject:r})};export{_ as default};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{o as g,j as e,L as j,q as N,k as v}from"./index-PEcJ5nx0.js";import{D as w,T as S}from"./TabbedDataViewer-BUMQ0QVm.js";/**
|
|
2
|
+
* @license lucide-react v0.542.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const $=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],y=g("circle-alert",$);/**
|
|
7
|
+
* @license lucide-react v0.542.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const E=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],p=g("file-text",E);/**
|
|
12
|
+
* @license lucide-react v0.542.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const F=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],u=g("list",F),_=r=>{try{const a=[],s=[{type:"comment",regex:/(\/\/.*$|\/\*[\s\S]*?\*\/)/g},{type:"string",regex:/(["'`])((?:\\.|(?!\1)[^\\])*?)\1/g},{type:"template",regex:/`([^`\\]|\\.)*`/g},{type:"keyword",regex:/\b(const|let|var|function|class|if|else|for|while|return|import|export|from|try|catch|throw|async|await|new|this|super|extends|implements|interface|type|enum|namespace|public|private|protected|static|readonly|abstract|void|null|undefined|true|false)\b/g},{type:"function",regex:/\b([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?=\()/g},{type:"className",regex:/\bclass\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/g},{type:"property",regex:/\.([a-zA-Z_$][a-zA-Z0-9_$]*)/g},{type:"number",regex:/\b\d+(\.\d+)?\b/g},{type:"operator",regex:/[+\-*/%=<>!&|^~?:]/g},{type:"bracket",regex:/[(){}\[\]]/g}],t=[];s.forEach(({type:l,regex:c})=>{try{let n;for(;(n=c.exec(r))!==null;)l==="className"&&n[1]?t.push({start:n.index+n[0].indexOf(n[1]),end:n.index+n[0].indexOf(n[1])+n[1].length,type:"className",text:n[1]}):l==="property"&&n[1]?t.push({start:n.index+1,end:n.index+n[0].length,type:"property",text:n[1]}):t.push({start:n.index,end:n.index+n[0].length,type:l,text:n[0]})}catch(n){console.warn(`Regex error for type ${l}:`,n)}}),t.sort((l,c)=>l.start-c.start);const o=[];let i=0;for(const l of t)l.start>=i&&(o.push(l),i=l.end);let d=0;for(const l of o)l.start>d&&a.push({text:r.slice(d,l.start),type:"text"}),a.push({text:l.text,type:l.type}),d=l.end;return d<r.length&&a.push({text:r.slice(d),type:"text"}),a}catch(a){return console.error("Error highlighting code:",a),[{text:r,type:"text"}]}},M=r=>{switch(r){case"comment":return"text-green-600 dark:text-green-400 italic";case"string":case"template":return"text-orange-600 dark:text-orange-400";case"keyword":return"text-blue-600 dark:text-blue-400 font-semibold";case"function":return"text-yellow-600 dark:text-yellow-400 font-medium";case"className":return"text-teal-600 dark:text-teal-400 font-semibold";case"property":return"text-indigo-600 dark:text-indigo-400";case"number":return"text-purple-600 dark:text-purple-400";case"operator":return"text-pink-600 dark:text-pink-400";case"bracket":return"text-gray-600 dark:text-gray-400 font-semibold";default:return"text-gray-800 dark:text-gray-200"}},f=({message:r})=>e.jsxs("div",{className:"p-4 text-center text-red-500 dark:text-red-400 bg-red-50 dark:bg-red-900/20 rounded-lg border border-red-200 dark:border-red-800",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[e.jsx(y,{className:"w-5 h-5"}),e.jsx("span",{className:"font-semibold",children:"Error Loading Code Frame"})]}),e.jsx("p",{className:"text-sm",children:r})]}),z=({code:r})=>{try{const a=_(r);return e.jsx("code",{className:"font-mono text-sm leading-5 whitespace-pre tracking-normal",children:a.map((s,t)=>e.jsx("span",{className:M(s.type),children:s.text},t))})}catch(a){return console.error("Error rendering syntax highlighter:",a),e.jsx("code",{className:"font-mono text-sm leading-5 whitespace-pre text-gray-800 dark:text-gray-200",children:r})}},L=({file:r,line:a,column:s})=>e.jsx("div",{className:"px-4 py-2 bg-gradient-to-r from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-700 border-b border-gray-200 dark:border-gray-600",children:e.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(y,{className:"w-4 h-4 text-red-500 dark:text-red-400"}),e.jsx("span",{className:"font-semibold text-red-600 dark:text-red-400",children:"Error Location"})]}),e.jsx("div",{className:"h-4 w-px bg-gray-300 dark:bg-gray-600"}),e.jsx("div",{className:"font-mono text-gray-700 dark:text-gray-300 bg-gray-200 dark:bg-gray-600 px-2 py-1 rounded text-xs truncate max-w-xs",title:r,children:r||"Unknown file"}),e.jsxs("span",{className:"text-gray-500 dark:text-gray-400 text-xs",children:["Line ",a||"?",":",s||"?"]})]})}),C=({column:r})=>e.jsx("div",{className:"mt-2",children:e.jsx("div",{className:"absolute flex items-center gap-2 z-20",style:{left:`${Math.max(0,(r-1)*.6)}em`},children:e.jsx("span",{className:"text-red-500 -mt-2 dark:text-red-400 font-semibold font-mono",children:"^"})})}),T=({codeLine:r,lineNumber:a,isErrorLine:s,column:t})=>e.jsxs("div",{className:`flex group ${s?"bg-red-50 dark:bg-red-950/30":"hover:bg-gray-50 dark:hover:bg-gray-800/30"}`,children:[e.jsx("div",{className:`flex-shrink-0 w-16 py-1 px-3 text-right select-none text-sm font-mono tabular-nums border-r ${s?"text-red-500 dark:text-red-400 font-bold bg-red-100 dark:bg-red-900/40 border-red-300 dark:border-red-700":"text-gray-500 dark:text-gray-400 bg-gray-50 dark:bg-gray-800 border-gray-200 dark:border-gray-700 group-hover:bg-gray-100 dark:group-hover:bg-gray-700"}`,children:a}),e.jsx("div",{className:"flex-1 py-1 px-3 relative min-h-[1.5rem] flex items-start overflow-hidden",children:e.jsxs("div",{className:"w-full font-mono text-sm",children:[e.jsx(z,{code:r||""}),s&&t&&e.jsx(C,{column:t,codeLine:r||""})]})})]}),I=({totalLines:r})=>e.jsx("div",{className:"px-4 py-2 bg-gray-50 dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 text-xs",children:e.jsx("div",{className:"flex items-center justify-between text-gray-600 dark:text-gray-400",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 bg-red-500 rounded-full animate-pulse"}),"Error line highlighted :",e.jsxs("span",{children:[r," lines of context"]})]})})}),h=({message:r})=>e.jsxs("div",{className:"p-4 text-center text-gray-500 dark:text-gray-400 bg-gray-50 dark:bg-gray-800 rounded-lg",children:[e.jsx(p,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:r})]}),q=({codeFrame:r})=>{if(!r)return e.jsx(h,{message:"No code frame available"});try{const{file:a,line:s,column:t,context:o}=r;if(!o||!o.pre&&!o.error&&!o.post)return e.jsx(h,{message:"No code context available"});const{pre:i,error:d,post:l}=o,c=[...i||[],d||"",...l||[]],n=(i||[]).length;return e.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden bg-white dark:bg-gray-900 shadow-lg",children:[e.jsx(L,{file:a||"",line:s||0,column:t||0}),e.jsx("div",{className:"overflow-auto max-h-80 font-mono",children:e.jsx("div",{className:"relative",children:c.map((b,x)=>{const k=(s||1)-n+x,m=x===n;return e.jsx(T,{codeLine:b,lineNumber:k,isErrorLine:m,column:m?t:void 0},x)})})}),e.jsx(I,{totalLines:c.length})]})}catch(a){return console.error("Error rendering CodeFrameViewer:",a),e.jsx(f,{message:"Unable to display code context. Please check the console for details."})}},A=()=>e.jsxs("div",{className:"p-4 text-center text-gray-500 dark:text-gray-400 bg-gray-50 dark:bg-gray-800 rounded-lg",children:[e.jsx(u,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:"No stack trace available"})]}),H=({frameCount:r})=>e.jsx("div",{className:"px-4 py-2 bg-gradient-to-r from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-700 border-b border-gray-200 dark:border-gray-600",children:e.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(u,{className:"w-4 h-4 text-orange-500 dark:text-orange-400"}),e.jsx("span",{className:"font-semibold text-orange-600 dark:text-orange-400",children:"Stack Trace"})]}),e.jsx("div",{className:"h-4 w-px bg-gray-300 dark:bg-gray-600"}),e.jsxs("span",{className:"text-gray-500 dark:text-gray-400 text-xs",children:[r," stack frame",r!==1?"s":""]})]})}),V=({file:r,line:a,column:s})=>e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-600 dark:text-gray-400 mb-1",children:[e.jsx(p,{className:"w-3 h-3"}),e.jsx("span",{className:"font-mono truncate max-w-xs",title:r,children:r}),a&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"•"}),e.jsxs("span",{className:"font-mono",children:[a,s?`:${s}`:""]})]})]}),Z=({index:r,isFirst:a})=>e.jsx("div",{className:`flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center text-xs font-semibold ${a?"bg-orange-500 text-white":"bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400"}`,children:r+1}),D=({functionName:r})=>e.jsx("div",{className:"font-mono text-sm font-medium text-gray-900 dark:text-gray-100 mb-1",children:e.jsx("span",{className:"text-blue-600 dark:text-blue-400",children:r})}),R=r=>{const a=[/at\s+(.+?)\s+\((.+?):(\d+):(\d+)\)/,/at\s+(.+?):(\d+):(\d+)/,/(.+?)@(.+?):(\d+):(\d+)/,/(.+)/];for(const s of a){const t=r.match(s);if(t){if(t.length>=5)return{function:t[1]?.trim(),file:t[2]?.trim(),line:t[3],column:t[4],raw:r};if(t.length>=4)return{function:null,file:t[1]?.trim(),line:t[2],column:t[3],raw:r};if(t.length>=4&&t[0].includes("@"))return{function:t[1]?.trim(),file:t[2]?.trim(),line:t[3],column:t[4],raw:r}}}return{function:null,file:null,line:null,column:null,raw:r}},P=({line:r,index:a,isFirst:s})=>{const t=R(r);return e.jsx("div",{className:`group hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors ${s?"bg-orange-50 dark:bg-orange-950/20":""}`,children:e.jsxs("div",{className:"flex items-start gap-3 p-3",children:[e.jsx(Z,{index:a,isFirst:s}),e.jsxs("div",{className:"flex-1 min-w-0",children:[t.function&&e.jsx(D,{functionName:t.function}),t.file&&e.jsx(V,{file:t.file,line:t.line||void 0,column:t.column||void 0}),!t.function&&!t.file&&e.jsx("div",{className:"font-mono text-sm text-gray-700 dark:text-gray-300 break-all",children:t.raw})]}),s&&e.jsx("div",{className:"flex-shrink-0",children:e.jsx("div",{className:"bg-orange-500 text-white px-2 py-1 rounded text-xs font-medium",children:"Origin"})})]})})},O=({traceDepth:r})=>e.jsx("div",{className:"px-4 py-2 bg-gray-50 dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 text-xs",children:e.jsxs("div",{className:"flex items-center justify-between text-gray-600 dark:text-gray-400",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-2 h-2 bg-orange-500 rounded-full"}),"Call stack from error origin"]}),e.jsxs("span",{children:["Trace depth: ",r]})]}),e.jsx("span",{className:"font-mono",children:"Stack Trace"})]})}),U=({trace:r})=>{if(!r||r.length===0)return e.jsx(A,{});try{return e.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden bg-white dark:bg-gray-900 shadow-lg",children:[e.jsx(H,{frameCount:r.length}),e.jsx("div",{className:"overflow-auto max-h-96",children:e.jsx("div",{className:"divide-y divide-gray-100 dark:divide-gray-800",children:r.map((a,s)=>e.jsx(P,{line:a,index:s,isFirst:s===0},s))})}),e.jsx(O,{traceDepth:r.length})]})}catch(a){return console.error("Error rendering StackTraceViewer:",a),e.jsx(f,{message:"Unable to display stack trace. Please check the console for details."})}},G=({data:r})=>{const a=[r.lens_entry_id?{label:"Request",value:e.jsx(j,{to:`${N(v()).REQUESTS}/${r.lens_entry_id}`,className:"text-blue-600 hover:underline font-semibold",children:"View Request"}),className:"text-gray-900 dark:text-gray-100"}:null,r.data.name?{label:"Name",value:r.data.name,className:"text-gray-900 dark:text-gray-100"}:null,r.data.fileInfo?.file?{label:"File",value:r.data.fileInfo?.file,className:"text-gray-900 dark:text-gray-100"}:null,r.data.fileInfo?.function?{label:"Function",value:r.data.fileInfo?.function,className:"text-gray-900 dark:text-gray-100"}:null].filter(t=>!!t),s=[{id:"message",label:"Message",data:r.data.message,shouldShow:!!r.data.message},{id:"stack-trace",label:"Stacktrace",content:e.jsx(U,{trace:r.data.trace||[]}),shouldShow:!!r.data.trace&&r.data.trace.length>0},{id:"location",label:"Location",content:e.jsx(q,{codeFrame:r.data.codeFrame}),shouldShow:!!r.data.codeFrame},{id:"cause",label:"Cause",data:r.data.cause??"",shouldShow:!!r.data.cause&&r.data.cause.length>0},{id:"original-stack",label:"Original Stack",data:r.data.originalStack??"",shouldShow:!!r.data.originalStack&&r.data.originalStack.length>0}];return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(w,{title:"Exception Details",items:a}),e.jsx(S,{tabs:s})]})};export{G as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ExceptionDetails-BbIFoM7M.js","./index-PEcJ5nx0.js","./index-B2QCOgug.css","./TabbedDataViewer-BUMQ0QVm.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{m as a,r as s,j as r,_ as i}from"./index-PEcJ5nx0.js";import{u as m}from"./useExceptions-uYUhAW-J.js";import"./useLensApi-BsDmB7vx.js";const n=s.lazy(()=>i(()=>import("./ExceptionDetails-BbIFoM7M.js"),__vite__mapDeps([0,1,2,3]),import.meta.url)),x=()=>{const{item:e,getItem:o}=m(),{id:t}=a();return s.useEffect(()=>{t&&o(t)},[t]),r.jsx("div",{children:e&&r.jsx(n,{data:e})})};export{x as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as a}from"./index-PEcJ5nx0.js";import{L as s}from"./LoadMore-CJh7FLbl.js";import{T as t}from"./Table-BesHc4Lc.js";import{g as r}from"./columns-C1CwS8yE.js";import"./index-BRRKsoNv.js";const d=({hasMoreObject:o})=>a.jsxs("div",{className:"w-full",children:[a.jsx("div",{className:"overflow-x-auto",children:a.jsx(t,{columns:r(),data:o.data})}),a.jsx(s,{paginatedPage:o})]});export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o}from"./index-
|
|
1
|
+
import{j as o}from"./index-PEcJ5nx0.js";import{t}from"./Table-BesHc4Lc.js";function n({paginatedPage:r}){return r.hasMore?o.jsx("div",{className:"flex justify-center p-4",children:o.jsx("button",{onClick:r.loadMore,disabled:r.loading,className:t("px-4 py-2 rounded-md bg-gray-200 text-gray-800 dark:bg-neutral-800 dark:text-white text-sm hover:bg-gray-300 dark:hover:bg-neutral-700 transition-colors",r.loading&&"opacity-50 cursor-not-allowed"),children:r.loading?"Loading...":"Load More"})}):null}export{n as L};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./QueryTable-pn7Ayura.js","./index-PEcJ5nx0.js","./index-B2QCOgug.css","./LoadMore-CJh7FLbl.js","./Table-BesHc4Lc.js","./columns-CULxhcpY.js","./index-BRRKsoNv.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e,j as s,_ as a}from"./index-PEcJ5nx0.js";import{u as i}from"./useQueries-DJE91mYq.js";import{u}from"./useLoadMore-sLsrekV5.js";import"./useLensApi-BsDmB7vx.js";const m=e.lazy(()=>a(()=>import("./QueryTable-pn7Ayura.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)),f=()=>{const{loadMoreRequests:r,fetchQueries:t}=i(),o=u({paginatedPage:r});return e.useEffect(()=>{t()},[]),s.jsx(m,{hasMoreObject:o})};export{f as default};
|
package/dist/ui/assets/{QueryDetailsContainer-eoLkgEjj.js → QueryDetailsContainer-7CA9a5de.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as zt,
|
|
1
|
+
import{o as zt,j as N,r as D,L as Ht,q as Jt,k as Zt,m as te}from"./index-PEcJ5nx0.js";import{u as ee}from"./useQueries-DJE91mYq.js";import{D as ie,T as se}from"./TabbedDataViewer-BUMQ0QVm.js";import{f as ne}from"./index-BRRKsoNv.js";import"./useLensApi-BsDmB7vx.js";function _e(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h}/**
|
|
2
2
|
* @license lucide-react v0.542.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -8,7 +8,7 @@ import{o as zt,r as D,j as N,L as Ht,q as Jt,k as Zt,m as te}from"./index-BdvbrZ
|
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const re=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],qt=zt("copy",re),ue=["SELECT","FROM","WHERE","JOIN","INNER","LEFT","RIGHT","OUTER","FULL","ON","AND","OR","NOT","IN","EXISTS","BETWEEN","LIKE","IS","NULL","INSERT","INTO","VALUES","UPDATE","SET","DELETE","CREATE","TABLE","ALTER","DROP","INDEX","PRIMARY","KEY","FOREIGN","REFERENCES","CONSTRAINT","UNIQUE","CHECK","DEFAULT","AUTO_INCREMENT","IDENTITY","GROUP","BY","HAVING","ORDER","ASC","DESC","LIMIT","OFFSET","UNION","ALL","DISTINCT","COUNT","SUM","AVG","MIN","MAX","CASE","WHEN","THEN","ELSE","END","IF","IFNULL","COALESCE","CAST","CONVERT","SUBSTRING","LENGTH","UPPER","LOWER","TRIM"],
|
|
11
|
+
*/const re=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],qt=zt("copy",re),ue=["db","find","insertOne","insertMany","updateOne","updateMany","deleteOne","deleteMany","aggregate","project","match","group","sort","limit","skip","$match","$project","$group","$sort","$limit","$skip","$and","$or","$eq","$ne","$in","$nin"],oe=["SELECT","FROM","WHERE","JOIN","INNER","LEFT","RIGHT","OUTER","FULL","ON","AND","OR","NOT","IN","EXISTS","BETWEEN","LIKE","IS","NULL","INSERT","INTO","VALUES","UPDATE","SET","DELETE","CREATE","TABLE","ALTER","DROP","INDEX","PRIMARY","KEY","FOREIGN","REFERENCES","CONSTRAINT","UNIQUE","CHECK","DEFAULT","AUTO_INCREMENT","IDENTITY","GROUP","BY","HAVING","ORDER","ASC","DESC","LIMIT","OFFSET","UNION","ALL","DISTINCT","COUNT","SUM","AVG","MIN","MAX","CASE","WHEN","THEN","ELSE","END","IF","IFNULL","COALESCE","CAST","CONVERT","SUBSTRING","LENGTH","UPPER","LOWER","TRIM"],le=["NOW","CURRENT_TIMESTAMP","CURRENT_DATE","CURRENT_TIME","DATE","TIME","YEAR","MONTH","DAY","HOUR","MINUTE","SECOND"],he=["VARCHAR","CHAR","TEXT","INT","INTEGER","BIGINT","SMALLINT","TINYINT","DECIMAL","NUMERIC","FLOAT","DOUBLE","REAL","BIT","BOOLEAN","BOOL","DATE","TIME","DATETIME","TIMESTAMP","YEAR","BINARY","VARBINARY","BLOB","CLOB","JSON","UUID"];function pe(h){return h.split(/(\s+|[{}[\]()=,:])/).map((s,e)=>s.trim()?/^['"`].*['"`]$/.test(s)?N.jsx("span",{className:"text-green-600 dark:text-green-400",children:s},e):/^\d+\.?\d*$/.test(s)?N.jsx("span",{className:"text-orange-600 dark:text-orange-400",children:s},e):ue.includes(s)?N.jsx("span",{className:"text-blue-600 dark:text-blue-400 font-semibold",children:s},e):N.jsx("span",{children:s},e):N.jsx("span",{children:s},e))}function fe(h){return h.split(/(\s+|[(),;]|'[^']*'|"[^"]*"|\b\d+\.?\d*\b|--[^\n]*|\/\*[\s\S]*?\*\/)/).map((s,e)=>{const n=s.trim();return n?s.startsWith("'")&&s.endsWith("'")||s.startsWith('"')&&s.endsWith('"')?N.jsx("span",{className:"text-green-600 dark:text-green-400",children:s},e):/^\d+\.?\d*$/.test(n)?N.jsx("span",{className:"text-orange-600 dark:text-orange-400",children:s},e):s.startsWith("--")||s.startsWith("/*")&&s.endsWith("*/")?N.jsx("span",{className:"text-neutral-500 dark:text-neutral-400",children:s},e):oe.some(_=>_.toLowerCase()===n.toLowerCase())?N.jsx("span",{className:"text-blue-600 dark:text-blue-400 font-semibold",children:s.toUpperCase()},e):le.some(_=>_.toLowerCase()===n.toLowerCase())?N.jsx("span",{className:"text-purple-600 dark:text-purple-400",children:s.toUpperCase()},e):he.some(_=>_.toLowerCase()===n.toLowerCase())?N.jsx("span",{className:"text-indigo-600 dark:text-indigo-400",children:s.toUpperCase()},e):N.jsx("span",{children:s},e):N.jsx("span",{children:s},e)})}const ce=({sql:h})=>{const[p,s]=D.useState(!1),e=async()=>{try{await navigator.clipboard.writeText(h),s(!0),setTimeout(()=>s(!1),2e3)}catch(_){console.error("Failed to copy: ",_)}},n=D.useMemo(()=>fe(h),[h]);return N.jsxs("div",{className:"bg-neutral-50 dark:bg-slate-900 rounded-lg p-4 font-mono text-sm overflow-x-auto relative",children:[N.jsx("button",{onClick:e,className:`absolute top-3 right-3 p-2 rounded-md transition-colors ${p?"bg-green-100 text-green-600 dark:bg-green-900/30 dark:text-green-400":"bg-white text-neutral-500 hover:text-neutral-700 hover:bg-neutral-100 dark:bg-slate-800 dark:text-neutral-400 dark:hover:text-neutral-300 dark:hover:bg-slate-700"}`,title:p?"Copied!":"Copy to clipboard",children:p?N.jsx($t,{size:16}):N.jsx(qt,{size:16})}),N.jsx("pre",{className:"whitespace-pre-wrap pr-12 text-neutral-800 dark:text-neutral-200",children:n})]})};var Q={exports:{}},M={},U={exports:{}},Y={},H={},mt;function ht(){if(mt)return H;mt=1;function h(e){this.__parent=e,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}h.prototype.clone_empty=function(){var e=new h(this.__parent);return e.set_indent(this.__indent_count,this.__alignment_count),e},h.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]},h.prototype.has_match=function(e){for(var n=this.__items.length-1;n>=0;n--)if(this.__items[n].match(e))return!0;return!1},h.prototype.set_indent=function(e,n){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=n||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},h.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},h.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},h.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,e.__items[0]===" "&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1},h.prototype.is_empty=function(){return this.__items.length===0},h.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},h.prototype.push=function(e){this.__items.push(e);var n=e.lastIndexOf(`
|
|
12
12
|
`);n!==-1?this.__character_count=e.length-n:this.__character_count+=e.length},h.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e},h.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},h.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},h.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},h.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e};function p(e,n){this.__cache=[""],this.__indent_size=e.indent_size,this.__indent_string=e.indent_char,e.indent_with_tabs||(this.__indent_string=new Array(e.indent_size+1).join(e.indent_char)),n=n||"",e.indent_level>0&&(n=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=n,this.__base_string_length=n.length}p.prototype.get_indent_size=function(e,n){var _=this.__base_string_length;return n=n||0,e<0&&(_=0),_+=e*this.__indent_size,_+=n,_},p.prototype.get_indent_string=function(e,n){var _=this.__base_string;return n=n||0,e<0&&(e=0,_=""),n+=e*this.__indent_size,this.__ensure_cache(n),_+=this.__cache[n],_},p.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var e=this.__cache.length,n=0,_="";this.__indent_size&&e>=this.__indent_size&&(n=Math.floor(e/this.__indent_size),e-=n*this.__indent_size,_=new Array(n+1).join(this.__indent_string)),e&&(_+=new Array(e+1).join(" ")),this.__cache.push(_)};function s(e,n){this.__indent_cache=new p(e,n),this.raw=!1,this._end_with_newline=e.end_with_newline,this.indent_size=e.indent_size,this.wrap_line_length=e.wrap_line_length,this.indent_empty_lines=e.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new h(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}return s.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},s.prototype.get_line_number=function(){return this.__lines.length},s.prototype.get_indent_string=function(e,n){return this.__indent_cache.get_indent_string(e,n)},s.prototype.get_indent_size=function(e,n){return this.__indent_cache.get_indent_size(e,n)},s.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},s.prototype.add_new_line=function(e){return this.is_empty()||!e&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},s.prototype.get_code=function(e){this.trim(!0);var n=this.current_line.pop();n&&(n[n.length-1]===`
|
|
13
13
|
`&&(n=n.replace(/\n+$/g,"")),this.current_line.push(n)),this._end_with_newline&&this.__add_outputline();var _=this.__lines.join(`
|
|
14
14
|
`);return e!==`
|
|
@@ -18,24 +18,24 @@ import{o as zt,r as D,j as N,L as Ht,q as Jt,k as Zt,m as te}from"./index-BdvbrZ
|
|
|
18
18
|
`+n+`
|
|
19
19
|
You passed in: '`+this.raw_options[e]+"'");return c[0]},h.prototype._get_selection_list=function(e,n,_){if(!n||n.length===0)throw new Error("Selection list cannot be empty.");if(_=_||[n[0]],!this._is_valid_selection(_,n))throw new Error("Invalid Default Value!");var c=this._get_array(e,_);if(!this._is_valid_selection(c,n))throw new Error("Invalid Option Value: The option '"+e+`' can contain only the following values:
|
|
20
20
|
`+n+`
|
|
21
|
-
You passed in: '`+this.raw_options[e]+"'");return c},h.prototype._is_valid_selection=function(e,n){return e.length&&n.length&&!e.some(function(_){return n.indexOf(_)===-1})};function p(e,n){var _={};e=s(e);var c;for(c in e)c!==n&&(_[c]=e[c]);if(n&&e[n])for(c in e[n])_[c]=e[n][c];return _}function s(e){var n={},_;for(_ in e){var c=_.replace(/-/g,"_");n[c]=e[_]}return n}return B.Options=h,B.normalizeOpts=s,B.mergeOpts=p,B}var wt;function Vt(){if(wt)return tt;wt=1;var h=pt().Options,p=["before-newline","after-newline","preserve-newline"];function s(e){h.call(this,e,"js");var n=this.raw_options.brace_style||null;n==="expand-strict"?this.raw_options.brace_style="expand":n==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var _=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var c=0;c<_.length;c++)_[c]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=_[c];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",p),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}return s.prototype=new h,tt.Options=s,tt}var P={},et={},xt;function ft(){if(xt)return et;xt=1;var h=RegExp.prototype.hasOwnProperty("sticky");function p(s){this.__input=s||"",this.__input_length=this.__input.length,this.__position=0}return p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position<this.__input_length},p.prototype.next=function(){var s=null;return this.hasNext()&&(s=this.__input.charAt(this.__position),this.__position+=1),s},p.prototype.peek=function(s){var e=null;return s=s||0,s+=this.__position,s>=0&&s<this.__input_length&&(e=this.__input.charAt(s)),e},p.prototype.__match=function(s,e){s.lastIndex=e;var n=s.exec(this.__input);return n&&!(h&&s.sticky)&&n.index!==e&&(n=null),n},p.prototype.test=function(s,e){return e=e||0,e+=this.__position,e>=0&&e<this.__input_length?!!this.__match(s,e):!1},p.prototype.testChar=function(s,e){var n=this.peek(e);return s.lastIndex=0,n!==null&&s.test(n)},p.prototype.match=function(s){var e=this.__match(s,this.__position);return e?this.__position+=e[0].length:e=null,e},p.prototype.read=function(s,e,n){var _="",c;return s&&(c=this.match(s),c&&(_+=c[0])),e&&(c||!s)&&(_+=this.readUntil(e,n)),_},p.prototype.readUntil=function(s,e){var n="",_=this.__position;s.lastIndex=this.__position;var c=s.exec(this.__input);return c?(_=c.index,e&&(_+=c[0].length)):_=this.__input_length,n=this.__input.substring(this.__position,_),this.__position=_,n},p.prototype.readUntilAfter=function(s){return this.readUntil(s,!0)},p.prototype.get_regexp=function(s,e){var n=null,_="g";return e&&h&&(_="y"),typeof s=="string"&&s!==""?n=new RegExp(s,_):s&&(n=new RegExp(s.source,_)),n},p.prototype.get_literal_regexp=function(s){return RegExp(s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(s){var e=this.__position,n=this.readUntilAfter(s);return this.__position=e,n},p.prototype.lookBack=function(s){var e=this.__position-1;return e>=s.length&&this.__input.substring(e-s.length,e).toLowerCase()===s},et.InputScanner=p,et}var K={},it={},Et;function fe(){if(Et)return it;Et=1;function h(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}return h.prototype.restart=function(){this.__position=0},h.prototype.isEmpty=function(){return this.__tokens_length===0},h.prototype.hasNext=function(){return this.__position<this.__tokens_length},h.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__tokens[this.__position],this.__position+=1),p},h.prototype.peek=function(p){var s=null;return p=p||0,p+=this.__position,p>=0&&p<this.__tokens_length&&(s=this.__tokens[p]),s},h.prototype.add=function(p){this.__parent_token&&(p.parent=this.__parent_token),this.__tokens.push(p),this.__tokens_length+=1},it.TokenStream=h,it}var st={},nt={},Ot;function V(){if(Ot)return nt;Ot=1;function h(p,s){this._input=p,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,s&&(this._starting_pattern=this._input.get_regexp(s._starting_pattern,!0),this._match_pattern=this._input.get_regexp(s._match_pattern,!0),this._until_pattern=this._input.get_regexp(s._until_pattern),this._until_after=s._until_after)}return h.prototype.read=function(){var p=this._input.read(this._starting_pattern);return(!this._starting_pattern||p)&&(p+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),p},h.prototype.read_match=function(){return this._input.match(this._match_pattern)},h.prototype.until_after=function(p){var s=this._create();return s._until_after=!0,s._until_pattern=this._input.get_regexp(p),s._update(),s},h.prototype.until=function(p){var s=this._create();return s._until_after=!1,s._until_pattern=this._input.get_regexp(p),s._update(),s},h.prototype.starting_with=function(p){var s=this._create();return s._starting_pattern=this._input.get_regexp(p,!0),s._update(),s},h.prototype.matching=function(p){var s=this._create();return s._match_pattern=this._input.get_regexp(p,!0),s._update(),s},h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){},nt.Pattern=h,nt}var Tt;function ce(){if(Tt)return st;Tt=1;var h=V().Pattern;function p(s,e){h.call(this,s,e),e?this._line_regexp=this._input.get_regexp(e._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}return p.prototype=new h,p.prototype.__set_whitespace_patterns=function(s,e){s+="\\t ",e+="\\n\\r",this._match_pattern=this._input.get_regexp("["+s+e+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+e+"]")},p.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var s=this._input.read(this._match_pattern);if(s===" ")this.whitespace_before_token=" ";else if(s){var e=this.__split(this._newline_regexp,s);this.newline_count=e.length-1,this.whitespace_before_token=e[this.newline_count]}return s},p.prototype.matching=function(s,e){var n=this._create();return n.__set_whitespace_patterns(s,e),n._update(),n},p.prototype._create=function(){return new p(this._input,this)},p.prototype.__split=function(s,e){s.lastIndex=0;for(var n=0,_=[],c=s.exec(e);c;)_.push(e.substring(n,c.index)),n=c.index+c[0].length,c=s.exec(e);return n<e.length?_.push(e.substring(n,e.length)):_.push(""),_},st.WhitespacePattern=p,st}var Rt;function X(){if(Rt)return K;Rt=1;var h=ft().InputScanner,p=Ft().Token,s=fe().TokenStream,e=ce().WhitespacePattern,n={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},_=function(c,a){this._input=new h(c),this._options=a||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new e(this._input)};return _.prototype.tokenize=function(){this._input.restart(),this.__tokens=new s,this._reset();for(var c,a=new p(n.START,""),u=null,E=[],b=new s;a.type!==n.EOF;){for(c=this._get_next_token(a,u);this._is_comment(c);)b.add(c),c=this._get_next_token(a,u);b.isEmpty()||(c.comments_before=b,b=new s),c.parent=u,this._is_opening(c)?(E.push(u),u=c):u&&this._is_closing(c,u)&&(c.opened=u,u.closed=c,u=E.pop(),c.parent=u),c.previous=a,a.next=c,this.__tokens.add(c),a=c}return this.__tokens},_.prototype._is_first_token=function(){return this.__tokens.isEmpty()},_.prototype._reset=function(){},_.prototype._get_next_token=function(c,a){this._readWhitespace();var u=this._input.read(/.+/g);return u?this._create_token(n.RAW,u):this._create_token(n.EOF,"")},_.prototype._is_comment=function(c){return!1},_.prototype._is_opening=function(c){return!1},_.prototype._is_closing=function(c,a){return!1},_.prototype._create_token=function(c,a){var u=new p(c,a,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return u},_.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},K.Tokenizer=_,K.TOKEN=n,K}var _t={},kt;function ct(){if(kt)return _t;kt=1;function h(p,s){p=typeof p=="string"?p:p.source,s=typeof s=="string"?s:s.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+s,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+s,"g")}return h.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var s={};this.__directive_pattern.lastIndex=0;for(var e=this.__directive_pattern.exec(p);e;)s[e[1]]=e[2],e=this.__directive_pattern.exec(p);return s},h.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},_t.Directives=h,_t}var at={},Nt;function Gt(){if(Nt)return at;Nt=1;var h=V().Pattern,p={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function s(e,n){h.call(this,e,n),this.__template_pattern=null,this._disabled=Object.assign({},p),this._excluded=Object.assign({},p),n&&(this.__template_pattern=this._input.get_regexp(n.__template_pattern),this._excluded=Object.assign(this._excluded,n._excluded),this._disabled=Object.assign(this._disabled,n._disabled));var _=new h(e);this.__patterns={handlebars_comment:_.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:_.starting_with(/{{{/).until_after(/}}}/),handlebars:_.starting_with(/{{/).until_after(/}}/),php:_.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:_.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:_.starting_with(/{%/).until_after(/%}/),django_value:_.starting_with(/{{/).until_after(/}}/),django_comment:_.starting_with(/{#/).until_after(/#}/),smarty:_.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:_.starting_with(/{\*/).until_after(/\*}/),smarty_literal:_.starting_with(/{literal}/).until_after(/{\/literal}/)}}return s.prototype=new h,s.prototype._create=function(){return new s(this._input,this)},s.prototype._update=function(){this.__set_templated_pattern()},s.prototype.disable=function(e){var n=this._create();return n._disabled[e]=!0,n._update(),n},s.prototype.read_options=function(e){var n=this._create();for(var _ in p)n._disabled[_]=e.templating.indexOf(_)===-1;return n._update(),n},s.prototype.exclude=function(e){var n=this._create();return n._excluded[e]=!0,n._update(),n},s.prototype.read=function(){var e="";this._match_pattern?e=this._input.read(this._starting_pattern):e=this._input.read(this._starting_pattern,this.__template_pattern);for(var n=this._read_template();n;)this._match_pattern?n+=this._input.read(this._match_pattern):n+=this._input.readUntil(this.__template_pattern),e+=n,n=this._read_template();return this._until_after&&(e+=this._input.readUntilAfter(this._until_pattern)),e},s.prototype.__set_templated_pattern=function(){var e=[];this._disabled.php||e.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||e.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(e.push(this.__patterns.django._starting_pattern.source),e.push(this.__patterns.django_value._starting_pattern.source),e.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||e.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&e.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+e.join("|")+")")},s.prototype._read_template=function(){var e="",n=this._input.peek();if(n==="<"){var _=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&_==="?"&&(e=e||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&_==="%"&&(e=e||this.__patterns.erb.read())}else n==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(e=e||this.__patterns.handlebars_comment.read(),e=e||this.__patterns.handlebars_unescaped.read(),e=e||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(e=e||this.__patterns.django_value.read()),this._excluded.django||(e=e||this.__patterns.django_comment.read(),e=e||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(e=e||this.__patterns.smarty_comment.read(),e=e||this.__patterns.smarty_literal.read(),e=e||this.__patterns.smarty.read()));return e},at.TemplatablePattern=s,at}var At;function z(){if(At)return P;At=1;var h=ft().InputScanner,p=X().Tokenizer,s=X().TOKEN,e=ct().Directives,n=Xt(),_=V().Pattern,c=Gt().TemplatablePattern;function a(f,m){return m.indexOf(f)!==-1}var u={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:s.START,RAW:s.RAW,EOF:s.EOF},E=new e(/\/\*/,/\*\//),b=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,v=/[0-9]/,y=/[^\d\.]/,A=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),S=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";S=S.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),S="\\?\\.(?!\\d) "+S,S=S.replace(/ /g,"|");var L=new RegExp(S),r="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),i=r.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),o=new RegExp("^(?:"+i.join("|")+")$"),O,w=function(f,m){p.call(this,f,m),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var l=new _(this._input),x=new c(this._input).read_options(this._options);this.__patterns={template:x,identifier:x.starting_with(n.identifier).matching(n.identifierMatch),number:l.matching(b),punct:l.matching(L),comment:l.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:l.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:l.matching(/<!--/),html_comment_end:l.matching(/-->/),include:l.starting_with(/#include/).until_after(n.lineBreak),shebang:l.starting_with(/#!/).until_after(n.lineBreak),xml:l.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:x.until(/['\\\n\r\u2028\u2029]/),double_quote:x.until(/["\\\n\r\u2028\u2029]/),template_text:x.until(/[`\\$]/),template_expression:x.until(/[`}\\]/)}};w.prototype=new p,w.prototype._is_comment=function(f){return f.type===u.COMMENT||f.type===u.BLOCK_COMMENT||f.type===u.UNKNOWN},w.prototype._is_opening=function(f){return f.type===u.START_BLOCK||f.type===u.START_EXPR},w.prototype._is_closing=function(f,m){return(f.type===u.END_BLOCK||f.type===u.END_EXPR)&&m&&(f.text==="]"&&m.text==="["||f.text===")"&&m.text==="("||f.text==="}"&&m.text==="{")},w.prototype._reset=function(){O=!1},w.prototype._get_next_token=function(f,m){var l=null;this._readWhitespace();var x=this._input.peek();return x===null?this._create_token(u.EOF,""):(l=l||this._read_non_javascript(x),l=l||this._read_string(x),l=l||this._read_pair(x,this._input.peek(1)),l=l||this._read_word(f),l=l||this._read_singles(x),l=l||this._read_comment(x),l=l||this._read_regexp(x,f),l=l||this._read_xml(x,f),l=l||this._read_punctuation(),l=l||this._create_token(u.UNKNOWN,this._input.next()),l)},w.prototype._read_word=function(f){var m;if(m=this.__patterns.identifier.read(),m!=="")return m=m.replace(n.allLineBreaks,`
|
|
21
|
+
You passed in: '`+this.raw_options[e]+"'");return c},h.prototype._is_valid_selection=function(e,n){return e.length&&n.length&&!e.some(function(_){return n.indexOf(_)===-1})};function p(e,n){var _={};e=s(e);var c;for(c in e)c!==n&&(_[c]=e[c]);if(n&&e[n])for(c in e[n])_[c]=e[n][c];return _}function s(e){var n={},_;for(_ in e){var c=_.replace(/-/g,"_");n[c]=e[_]}return n}return B.Options=h,B.normalizeOpts=s,B.mergeOpts=p,B}var wt;function Vt(){if(wt)return tt;wt=1;var h=pt().Options,p=["before-newline","after-newline","preserve-newline"];function s(e){h.call(this,e,"js");var n=this.raw_options.brace_style||null;n==="expand-strict"?this.raw_options.brace_style="expand":n==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var _=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var c=0;c<_.length;c++)_[c]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=_[c];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",p),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}return s.prototype=new h,tt.Options=s,tt}var P={},et={},xt;function ft(){if(xt)return et;xt=1;var h=RegExp.prototype.hasOwnProperty("sticky");function p(s){this.__input=s||"",this.__input_length=this.__input.length,this.__position=0}return p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position<this.__input_length},p.prototype.next=function(){var s=null;return this.hasNext()&&(s=this.__input.charAt(this.__position),this.__position+=1),s},p.prototype.peek=function(s){var e=null;return s=s||0,s+=this.__position,s>=0&&s<this.__input_length&&(e=this.__input.charAt(s)),e},p.prototype.__match=function(s,e){s.lastIndex=e;var n=s.exec(this.__input);return n&&!(h&&s.sticky)&&n.index!==e&&(n=null),n},p.prototype.test=function(s,e){return e=e||0,e+=this.__position,e>=0&&e<this.__input_length?!!this.__match(s,e):!1},p.prototype.testChar=function(s,e){var n=this.peek(e);return s.lastIndex=0,n!==null&&s.test(n)},p.prototype.match=function(s){var e=this.__match(s,this.__position);return e?this.__position+=e[0].length:e=null,e},p.prototype.read=function(s,e,n){var _="",c;return s&&(c=this.match(s),c&&(_+=c[0])),e&&(c||!s)&&(_+=this.readUntil(e,n)),_},p.prototype.readUntil=function(s,e){var n="",_=this.__position;s.lastIndex=this.__position;var c=s.exec(this.__input);return c?(_=c.index,e&&(_+=c[0].length)):_=this.__input_length,n=this.__input.substring(this.__position,_),this.__position=_,n},p.prototype.readUntilAfter=function(s){return this.readUntil(s,!0)},p.prototype.get_regexp=function(s,e){var n=null,_="g";return e&&h&&(_="y"),typeof s=="string"&&s!==""?n=new RegExp(s,_):s&&(n=new RegExp(s.source,_)),n},p.prototype.get_literal_regexp=function(s){return RegExp(s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(s){var e=this.__position,n=this.readUntilAfter(s);return this.__position=e,n},p.prototype.lookBack=function(s){var e=this.__position-1;return e>=s.length&&this.__input.substring(e-s.length,e).toLowerCase()===s},et.InputScanner=p,et}var K={},it={},Et;function de(){if(Et)return it;Et=1;function h(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}return h.prototype.restart=function(){this.__position=0},h.prototype.isEmpty=function(){return this.__tokens_length===0},h.prototype.hasNext=function(){return this.__position<this.__tokens_length},h.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__tokens[this.__position],this.__position+=1),p},h.prototype.peek=function(p){var s=null;return p=p||0,p+=this.__position,p>=0&&p<this.__tokens_length&&(s=this.__tokens[p]),s},h.prototype.add=function(p){this.__parent_token&&(p.parent=this.__parent_token),this.__tokens.push(p),this.__tokens_length+=1},it.TokenStream=h,it}var st={},nt={},Ot;function V(){if(Ot)return nt;Ot=1;function h(p,s){this._input=p,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,s&&(this._starting_pattern=this._input.get_regexp(s._starting_pattern,!0),this._match_pattern=this._input.get_regexp(s._match_pattern,!0),this._until_pattern=this._input.get_regexp(s._until_pattern),this._until_after=s._until_after)}return h.prototype.read=function(){var p=this._input.read(this._starting_pattern);return(!this._starting_pattern||p)&&(p+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),p},h.prototype.read_match=function(){return this._input.match(this._match_pattern)},h.prototype.until_after=function(p){var s=this._create();return s._until_after=!0,s._until_pattern=this._input.get_regexp(p),s._update(),s},h.prototype.until=function(p){var s=this._create();return s._until_after=!1,s._until_pattern=this._input.get_regexp(p),s._update(),s},h.prototype.starting_with=function(p){var s=this._create();return s._starting_pattern=this._input.get_regexp(p,!0),s._update(),s},h.prototype.matching=function(p){var s=this._create();return s._match_pattern=this._input.get_regexp(p,!0),s._update(),s},h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){},nt.Pattern=h,nt}var Tt;function ge(){if(Tt)return st;Tt=1;var h=V().Pattern;function p(s,e){h.call(this,s,e),e?this._line_regexp=this._input.get_regexp(e._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}return p.prototype=new h,p.prototype.__set_whitespace_patterns=function(s,e){s+="\\t ",e+="\\n\\r",this._match_pattern=this._input.get_regexp("["+s+e+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+e+"]")},p.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var s=this._input.read(this._match_pattern);if(s===" ")this.whitespace_before_token=" ";else if(s){var e=this.__split(this._newline_regexp,s);this.newline_count=e.length-1,this.whitespace_before_token=e[this.newline_count]}return s},p.prototype.matching=function(s,e){var n=this._create();return n.__set_whitespace_patterns(s,e),n._update(),n},p.prototype._create=function(){return new p(this._input,this)},p.prototype.__split=function(s,e){s.lastIndex=0;for(var n=0,_=[],c=s.exec(e);c;)_.push(e.substring(n,c.index)),n=c.index+c[0].length,c=s.exec(e);return n<e.length?_.push(e.substring(n,e.length)):_.push(""),_},st.WhitespacePattern=p,st}var Rt;function X(){if(Rt)return K;Rt=1;var h=ft().InputScanner,p=Ft().Token,s=de().TokenStream,e=ge().WhitespacePattern,n={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},_=function(c,a){this._input=new h(c),this._options=a||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new e(this._input)};return _.prototype.tokenize=function(){this._input.restart(),this.__tokens=new s,this._reset();for(var c,a=new p(n.START,""),u=null,E=[],b=new s;a.type!==n.EOF;){for(c=this._get_next_token(a,u);this._is_comment(c);)b.add(c),c=this._get_next_token(a,u);b.isEmpty()||(c.comments_before=b,b=new s),c.parent=u,this._is_opening(c)?(E.push(u),u=c):u&&this._is_closing(c,u)&&(c.opened=u,u.closed=c,u=E.pop(),c.parent=u),c.previous=a,a.next=c,this.__tokens.add(c),a=c}return this.__tokens},_.prototype._is_first_token=function(){return this.__tokens.isEmpty()},_.prototype._reset=function(){},_.prototype._get_next_token=function(c,a){this._readWhitespace();var u=this._input.read(/.+/g);return u?this._create_token(n.RAW,u):this._create_token(n.EOF,"")},_.prototype._is_comment=function(c){return!1},_.prototype._is_opening=function(c){return!1},_.prototype._is_closing=function(c,a){return!1},_.prototype._create_token=function(c,a){var u=new p(c,a,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return u},_.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},K.Tokenizer=_,K.TOKEN=n,K}var _t={},kt;function ct(){if(kt)return _t;kt=1;function h(p,s){p=typeof p=="string"?p:p.source,s=typeof s=="string"?s:s.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+s,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+s,"g")}return h.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var s={};this.__directive_pattern.lastIndex=0;for(var e=this.__directive_pattern.exec(p);e;)s[e[1]]=e[2],e=this.__directive_pattern.exec(p);return s},h.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},_t.Directives=h,_t}var at={},Nt;function Gt(){if(Nt)return at;Nt=1;var h=V().Pattern,p={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function s(e,n){h.call(this,e,n),this.__template_pattern=null,this._disabled=Object.assign({},p),this._excluded=Object.assign({},p),n&&(this.__template_pattern=this._input.get_regexp(n.__template_pattern),this._excluded=Object.assign(this._excluded,n._excluded),this._disabled=Object.assign(this._disabled,n._disabled));var _=new h(e);this.__patterns={handlebars_comment:_.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:_.starting_with(/{{{/).until_after(/}}}/),handlebars:_.starting_with(/{{/).until_after(/}}/),php:_.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:_.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:_.starting_with(/{%/).until_after(/%}/),django_value:_.starting_with(/{{/).until_after(/}}/),django_comment:_.starting_with(/{#/).until_after(/#}/),smarty:_.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:_.starting_with(/{\*/).until_after(/\*}/),smarty_literal:_.starting_with(/{literal}/).until_after(/{\/literal}/)}}return s.prototype=new h,s.prototype._create=function(){return new s(this._input,this)},s.prototype._update=function(){this.__set_templated_pattern()},s.prototype.disable=function(e){var n=this._create();return n._disabled[e]=!0,n._update(),n},s.prototype.read_options=function(e){var n=this._create();for(var _ in p)n._disabled[_]=e.templating.indexOf(_)===-1;return n._update(),n},s.prototype.exclude=function(e){var n=this._create();return n._excluded[e]=!0,n._update(),n},s.prototype.read=function(){var e="";this._match_pattern?e=this._input.read(this._starting_pattern):e=this._input.read(this._starting_pattern,this.__template_pattern);for(var n=this._read_template();n;)this._match_pattern?n+=this._input.read(this._match_pattern):n+=this._input.readUntil(this.__template_pattern),e+=n,n=this._read_template();return this._until_after&&(e+=this._input.readUntilAfter(this._until_pattern)),e},s.prototype.__set_templated_pattern=function(){var e=[];this._disabled.php||e.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||e.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(e.push(this.__patterns.django._starting_pattern.source),e.push(this.__patterns.django_value._starting_pattern.source),e.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||e.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&e.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+e.join("|")+")")},s.prototype._read_template=function(){var e="",n=this._input.peek();if(n==="<"){var _=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&_==="?"&&(e=e||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&_==="%"&&(e=e||this.__patterns.erb.read())}else n==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(e=e||this.__patterns.handlebars_comment.read(),e=e||this.__patterns.handlebars_unescaped.read(),e=e||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(e=e||this.__patterns.django_value.read()),this._excluded.django||(e=e||this.__patterns.django_comment.read(),e=e||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(e=e||this.__patterns.smarty_comment.read(),e=e||this.__patterns.smarty_literal.read(),e=e||this.__patterns.smarty.read()));return e},at.TemplatablePattern=s,at}var At;function z(){if(At)return P;At=1;var h=ft().InputScanner,p=X().Tokenizer,s=X().TOKEN,e=ct().Directives,n=Xt(),_=V().Pattern,c=Gt().TemplatablePattern;function a(f,m){return m.indexOf(f)!==-1}var u={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:s.START,RAW:s.RAW,EOF:s.EOF},E=new e(/\/\*/,/\*\//),b=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,v=/[0-9]/,y=/[^\d\.]/,A=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),S=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";S=S.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),S="\\?\\.(?!\\d) "+S,S=S.replace(/ /g,"|");var L=new RegExp(S),r="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),i=r.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),o=new RegExp("^(?:"+i.join("|")+")$"),O,w=function(f,m){p.call(this,f,m),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var l=new _(this._input),x=new c(this._input).read_options(this._options);this.__patterns={template:x,identifier:x.starting_with(n.identifier).matching(n.identifierMatch),number:l.matching(b),punct:l.matching(L),comment:l.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:l.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:l.matching(/<!--/),html_comment_end:l.matching(/-->/),include:l.starting_with(/#include/).until_after(n.lineBreak),shebang:l.starting_with(/#!/).until_after(n.lineBreak),xml:l.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:x.until(/['\\\n\r\u2028\u2029]/),double_quote:x.until(/["\\\n\r\u2028\u2029]/),template_text:x.until(/[`\\$]/),template_expression:x.until(/[`}\\]/)}};w.prototype=new p,w.prototype._is_comment=function(f){return f.type===u.COMMENT||f.type===u.BLOCK_COMMENT||f.type===u.UNKNOWN},w.prototype._is_opening=function(f){return f.type===u.START_BLOCK||f.type===u.START_EXPR},w.prototype._is_closing=function(f,m){return(f.type===u.END_BLOCK||f.type===u.END_EXPR)&&m&&(f.text==="]"&&m.text==="["||f.text===")"&&m.text==="("||f.text==="}"&&m.text==="{")},w.prototype._reset=function(){O=!1},w.prototype._get_next_token=function(f,m){var l=null;this._readWhitespace();var x=this._input.peek();return x===null?this._create_token(u.EOF,""):(l=l||this._read_non_javascript(x),l=l||this._read_string(x),l=l||this._read_pair(x,this._input.peek(1)),l=l||this._read_word(f),l=l||this._read_singles(x),l=l||this._read_comment(x),l=l||this._read_regexp(x,f),l=l||this._read_xml(x,f),l=l||this._read_punctuation(),l=l||this._create_token(u.UNKNOWN,this._input.next()),l)},w.prototype._read_word=function(f){var m;if(m=this.__patterns.identifier.read(),m!=="")return m=m.replace(n.allLineBreaks,`
|
|
22
22
|
`),!(f.type===u.DOT||f.type===u.RESERVED&&(f.text==="set"||f.text==="get"))&&o.test(m)?(m==="in"||m==="of")&&(f.type===u.WORD||f.type===u.STRING)?this._create_token(u.OPERATOR,m):this._create_token(u.RESERVED,m):this._create_token(u.WORD,m);if(m=this.__patterns.number.read(),m!=="")return this._create_token(u.WORD,m)},w.prototype._read_singles=function(f){var m=null;return f==="("||f==="["?m=this._create_token(u.START_EXPR,f):f===")"||f==="]"?m=this._create_token(u.END_EXPR,f):f==="{"?m=this._create_token(u.START_BLOCK,f):f==="}"?m=this._create_token(u.END_BLOCK,f):f===";"?m=this._create_token(u.SEMICOLON,f):f==="."&&y.test(this._input.peek(1))?m=this._create_token(u.DOT,f):f===","&&(m=this._create_token(u.COMMA,f)),m&&this._input.next(),m},w.prototype._read_pair=function(f,m){var l=null;return f==="#"&&m==="{"&&(l=this._create_token(u.START_BLOCK,f+m)),l&&(this._input.next(),this._input.next()),l},w.prototype._read_punctuation=function(){var f=this.__patterns.punct.read();if(f!=="")return f==="="?this._create_token(u.EQUALS,f):f==="?."?this._create_token(u.DOT,f):this._create_token(u.OPERATOR,f)},w.prototype._read_non_javascript=function(f){var m="";if(f==="#"){if(this._is_first_token()&&(m=this.__patterns.shebang.read(),m))return this._create_token(u.UNKNOWN,m.trim()+`
|
|
23
23
|
`);if(m=this.__patterns.include.read(),m)return this._create_token(u.UNKNOWN,m.trim()+`
|
|
24
24
|
`);f=this._input.next();var l="#";if(this._input.hasNext()&&this._input.testChar(v)){do f=this._input.next(),l+=f;while(this._input.hasNext()&&f!=="#"&&f!=="=");return f==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(l+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(l+="{}",this._input.next(),this._input.next())),this._create_token(u.WORD,l)}this._input.back()}else if(f==="<"&&this._is_first_token()){if(m=this.__patterns.html_comment_start.read(),m){for(;this._input.hasNext()&&!this._input.testChar(n.newline);)m+=this._input.next();return O=!0,this._create_token(u.COMMENT,m)}}else if(O&&f==="-"&&(m=this.__patterns.html_comment_end.read(),m))return O=!1,this._create_token(u.COMMENT,m);return null},w.prototype._read_comment=function(f){var m=null;if(f==="/"){var l="";if(this._input.peek(1)==="*"){l=this.__patterns.block_comment.read();var x=E.get_directives(l);x&&x.ignore==="start"&&(l+=E.readIgnored(this._input)),l=l.replace(n.allLineBreaks,`
|
|
25
25
|
`),m=this._create_token(u.BLOCK_COMMENT,l),m.directives=x}else this._input.peek(1)==="/"&&(l=this.__patterns.comment.read(),m=this._create_token(u.COMMENT,l))}return m},w.prototype._read_string=function(f){if(f==="`"||f==="'"||f==='"'){var m=this._input.next();return this.has_char_escapes=!1,f==="`"?m+=this._read_string_recursive("`",!0,"${"):m+=this._read_string_recursive(f),this.has_char_escapes&&this._options.unescape_strings&&(m=R(m)),this._input.peek()===f&&(m+=this._input.next()),m=m.replace(n.allLineBreaks,`
|
|
26
26
|
`),this._create_token(u.STRING,m)}return null},w.prototype._allow_regexp_or_xml=function(f){return f.type===u.RESERVED&&a(f.text,["return","case","throw","else","do","typeof","yield"])||f.type===u.END_EXPR&&f.text===")"&&f.opened.previous.type===u.RESERVED&&a(f.opened.previous.text,["if","while","for"])||a(f.type,[u.COMMENT,u.START_EXPR,u.START_BLOCK,u.START,u.END_BLOCK,u.OPERATOR,u.EQUALS,u.EOF,u.SEMICOLON,u.COMMA])},w.prototype._read_regexp=function(f,m){if(f==="/"&&this._allow_regexp_or_xml(m)){for(var l=this._input.next(),x=!1,t=!1;this._input.hasNext()&&(x||t||this._input.peek()!==f)&&!this._input.testChar(n.newline);)l+=this._input.peek(),x?x=!1:(x=this._input.peek()==="\\",this._input.peek()==="["?t=!0:this._input.peek()==="]"&&(t=!1)),this._input.next();return this._input.peek()===f&&(l+=this._input.next(),l+=this._input.read(n.identifier)),this._create_token(u.STRING,l)}return null},w.prototype._read_xml=function(f,m){if(this._options.e4x&&f==="<"&&this._allow_regexp_or_xml(m)){var l="",x=this.__patterns.xml.read_match();if(x){for(var t=x[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),d=t.indexOf("{")===0,g=0;x;){var T=!!x[1],k=x[2],C=!!x[x.length-1]||k.slice(0,8)==="![CDATA[";if(!C&&(k===t||d&&k.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(T?--g:++g),l+=x[0],g<=0)break;x=this.__patterns.xml.read_match()}return x||(l+=this._input.match(/[\s\S]*/g)[0]),l=l.replace(n.allLineBreaks,`
|
|
27
27
|
`),this._create_token(u.STRING,l)}}return null};function R(f){for(var m="",l=0,x=new h(f),t=null;x.hasNext();)if(t=x.match(/([\s]|[^\\]|\\\\)+/g),t&&(m+=t[0]),x.peek()==="\\"){if(x.next(),x.peek()==="x")t=x.match(/x([0-9A-Fa-f]{2})/g);else if(x.peek()==="u")t=x.match(/u([0-9A-Fa-f]{4})/g),t||(t=x.match(/u\{([0-9A-Fa-f]+)\}/g));else{m+="\\",x.hasNext()&&(m+=x.next());continue}if(!t||(l=parseInt(t[1],16),l>126&&l<=255&&t[0].indexOf("x")===0))return f;l>=0&&l<32||l>1114111?m+="\\"+t[0]:l===34||l===39||l===92?m+="\\"+String.fromCharCode(l):m+=String.fromCharCode(l)}return m}return w.prototype._read_string_recursive=function(f,m,l){var x,t;f==="'"?t=this.__patterns.single_quote:f==='"'?t=this.__patterns.double_quote:f==="`"?t=this.__patterns.template_text:f==="}"&&(t=this.__patterns.template_expression);for(var d=t.read(),g="";this._input.hasNext();){if(g=this._input.next(),g===f||!m&&n.newline.test(g)){this._input.back();break}else g==="\\"&&this._input.hasNext()?(x=this._input.peek(),x==="x"||x==="u"?this.has_char_escapes=!0:x==="\r"&&this._input.peek(1)===`
|
|
28
|
-
`&&this._input.next(),g+=this._input.next()):l&&(l==="${"&&g==="$"&&this._input.peek()==="{"&&(g+=this._input.next()),l===g&&(f==="`"?g+=this._read_string_recursive("}",m,"`"):g+=this._read_string_recursive("`",m,"${"),this._input.hasNext()&&(g+=this._input.next())));g+=t.read(),d+=g}return d},P.Tokenizer=w,P.TOKEN=u,P.positionable_operators=A.slice(),P.line_starters=r.slice(),P}var St;function
|
|
28
|
+
`&&this._input.next(),g+=this._input.next()):l&&(l==="${"&&g==="$"&&this._input.peek()==="{"&&(g+=this._input.next()),l===g&&(f==="`"?g+=this._read_string_recursive("}",m,"`"):g+=this._read_string_recursive("`",m,"${"),this._input.hasNext()&&(g+=this._input.next())));g+=t.read(),d+=g}return d},P.Tokenizer=w,P.TOKEN=u,P.positionable_operators=A.slice(),P.line_starters=r.slice(),P}var St;function me(){if(St)return Y;St=1;var h=ht().Output,p=Ft().Token,s=Xt(),e=Vt().Options,n=z().Tokenizer,_=z().line_starters,c=z().positionable_operators,a=z().TOKEN;function u(t,d){return d.indexOf(t)!==-1}function E(t){return t.replace(/^\s+/g,"")}function b(t){for(var d={},g=0;g<t.length;g++)d[t[g].replace(/-/g,"_")]=t[g];return d}function v(t,d){return t&&t.type===a.RESERVED&&t.text===d}function y(t,d){return t&&t.type===a.RESERVED&&u(t.text,d)}var A=["case","return","do","if","throw","else","await","break","continue","async"],S=["before-newline","after-newline","preserve-newline"],L=b(S),r=[L.before_newline,L.preserve_newline],i={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function o(t,d){d.multiline_frame||d.mode===i.ForInitializer||d.mode===i.Conditional||t.remove_indent(d.start_line_index)}function O(t){t=t.replace(s.allLineBreaks,`
|
|
29
29
|
`);for(var d=[],g=t.indexOf(`
|
|
30
30
|
`);g!==-1;)d.push(t.substring(0,g)),t=t.substring(g+1),g=t.indexOf(`
|
|
31
31
|
`);return t.length&&d.push(t),d}function w(t){return t===i.ArrayLiteral}function R(t){return u(t,[i.Expression,i.ForInitializer,i.Conditional])}function f(t,d){for(var g=0;g<t.length;g++){var T=t[g].trim();if(T.charAt(0)!==d)return!1}return!0}function m(t,d){for(var g=0,T=t.length,k;g<T;g++)if(k=t[g],k&&k.indexOf(d)!==0)return!1;return!0}function l(t,d){d=d||{},this._source_text=t||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new e(d)}l.prototype.create_flags=function(t,d){var g=0;t&&(g=t.indentation_level,!this._output.just_added_newline()&&t.line_indent_level>g&&(g=t.line_indent_level));var T={mode:d,parent:t,last_token:t?t.last_token:new p(a.START_BLOCK,""),last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:g,alignment:0,line_indent_level:t?t.line_indent_level:g,start_line_index:this._output.get_line_number(),ternary_depth:0};return T},l.prototype._reset=function(t){var d=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new h(this._options,d),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(i.BlockStatement);var g=new n(t,this._options);return this._tokens=g.tokenize(),t},l.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t,d=this._reset(this._source_text),g=this._options.eol;this._options.eol==="auto"&&(g=`
|
|
32
32
|
`,d&&s.lineBreak.test(d||"")&&(g=d.match(s.lineBreak)[0]));for(var T=this._tokens.next();T;)this.handle_token(T),this._last_last_text=this._flags.last_token.text,this._flags.last_token=T,T=this._tokens.next();return t=this._output.get_code(g),t},l.prototype.handle_token=function(t,d){t.type===a.START_EXPR?this.handle_start_expr(t):t.type===a.END_EXPR?this.handle_end_expr(t):t.type===a.START_BLOCK?this.handle_start_block(t):t.type===a.END_BLOCK?this.handle_end_block(t):t.type===a.WORD?this.handle_word(t):t.type===a.RESERVED?this.handle_word(t):t.type===a.SEMICOLON?this.handle_semicolon(t):t.type===a.STRING?this.handle_string(t):t.type===a.EQUALS?this.handle_equals(t):t.type===a.OPERATOR?this.handle_operator(t):t.type===a.COMMA?this.handle_comma(t):t.type===a.BLOCK_COMMENT?this.handle_block_comment(t,d):t.type===a.COMMENT?this.handle_comment(t,d):t.type===a.DOT?this.handle_dot(t):t.type===a.EOF?this.handle_eof(t):t.type===a.UNKNOWN?this.handle_unknown(t,d):this.handle_unknown(t,d)},l.prototype.handle_whitespace_and_comments=function(t,d){var g=t.newlines,T=this._options.keep_array_indentation&&w(this._flags.mode);if(t.comments_before)for(var k=t.comments_before.next();k;)this.handle_whitespace_and_comments(k,d),this.handle_token(k,d),k=t.comments_before.next();if(T)for(var C=0;C<g;C+=1)this.print_newline(C>0,d);else if(this._options.max_preserve_newlines&&g>this._options.max_preserve_newlines&&(g=this._options.max_preserve_newlines),this._options.preserve_newlines&&g>1){this.print_newline(!1,d);for(var j=1;j<g;j+=1)this.print_newline(!0,d)}};var x=["async","break","continue","return","throw","yield"];return l.prototype.allow_wrap_or_preserved_newline=function(t,d){if(d=d===void 0?!1:d,!this._output.just_added_newline()){var g=this._options.preserve_newlines&&t.newlines||d,T=u(this._flags.last_token.text,c)||u(t.text,c);if(T){var k=u(this._flags.last_token.text,c)&&u(this._options.operator_position,r)||u(t.text,c);g=g&&k}if(g)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(y(this._flags.last_token,x))return;this._output.set_wrap_point()}}},l.prototype.print_newline=function(t,d){if(!d&&this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==a.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))for(var g=this._tokens.peek();this._flags.mode===i.Statement&&!(this._flags.if_block&&v(g,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(t)&&(this._flags.multiline_frame=!0)},l.prototype.print_token_line_indentation=function(t){this._output.just_added_newline()&&(this._options.keep_array_indentation&&t.newlines&&(t.text==="["||w(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(t.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},l.prototype.print_token=function(t){if(this._output.raw){this._output.add_raw_token(t);return}if(this._options.comma_first&&t.previous&&t.previous.type===a.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var d=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(d),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(t),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(t),this._output.non_breaking_space=!0,this._output.add_token(t.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},l.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},l.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},l.prototype.set_mode=function(t){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,t),this._flags=this.create_flags(this._previous_flags,t),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},l.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===i.Statement&&o(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},l.prototype.start_of_object_property=function(){return this._flags.parent.mode===i.ObjectLiteral&&this._flags.mode===i.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||y(this._flags.last_token,["get","set"]))},l.prototype.start_of_statement=function(t){var d=!1;return d=d||y(this._flags.last_token,["var","let","const"])&&t.type===a.WORD,d=d||v(this._flags.last_token,"do"),d=d||!(this._flags.parent.mode===i.ObjectLiteral&&this._flags.mode===i.Statement)&&y(this._flags.last_token,x)&&!t.newlines,d=d||v(this._flags.last_token,"else")&&!(v(t,"if")&&!t.comments_before),d=d||this._flags.last_token.type===a.END_EXPR&&(this._previous_flags.mode===i.ForInitializer||this._previous_flags.mode===i.Conditional),d=d||this._flags.last_token.type===a.WORD&&this._flags.mode===i.BlockStatement&&!this._flags.in_case&&!(t.text==="--"||t.text==="++")&&this._last_last_text!=="function"&&t.type!==a.WORD&&t.type!==a.RESERVED,d=d||this._flags.mode===i.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||y(this._flags.last_token,["get","set"])),d?(this.set_mode(i.Statement),this.indent(),this.handle_whitespace_and_comments(t,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t,y(t,["do","for","if","while"])),!0):!1},l.prototype.handle_start_expr=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t);var d=i.Expression;if(t.text==="["){if(this._flags.last_token.type===a.WORD||this._flags.last_token.text===")"){y(this._flags.last_token,_)&&(this._output.space_before_token=!0),this.print_token(t),this.set_mode(d),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}d=i.ArrayLiteral,w(this._flags.mode)&&(this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline()),u(this._flags.last_token.type,[a.START_EXPR,a.END_EXPR,a.WORD,a.OPERATOR,a.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===a.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,d=i.ForInitializer):u(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,d=i.Conditional):u(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&t.whitespace_before===""?this._output.space_before_token=!1:(u(this._flags.last_token.text,_)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t);else if(this._flags.last_token.type===a.WORD){this._output.space_before_token=!1;var g=this._tokens.peek(-3);if(this._options.space_after_named_function&&g){var T=this._tokens.peek(-4);y(g,["async","function"])||g.text==="*"&&y(T,["async","function"])?this._output.space_before_token=!0:this._flags.mode===i.ObjectLiteral?(g.text==="{"||g.text===","||g.text==="*"&&(T.text==="{"||T.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(t);(this._flags.last_token.type===a.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(u(this._last_last_text,["function","yield"])||this._flags.mode===i.ObjectLiteral&&u(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===a.START_BLOCK?this.print_newline():(this._flags.last_token.type===a.END_EXPR||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===a.COMMA)&&this.allow_wrap_or_preserved_newline(t,t.newlines),this.print_token(t),this.set_mode(d),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},l.prototype.handle_end_expr=function(t){for(;this._flags.mode===i.Statement;)this.restore_mode();this.handle_whitespace_and_comments(t),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(t,t.text==="]"&&w(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===a.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(t),this.restore_mode(),o(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===i.Conditional&&(this._previous_flags.mode=i.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},l.prototype.handle_start_block=function(t){this.handle_whitespace_and_comments(t);var d=this._tokens.peek(),g=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===a.END_EXPR?(this.set_mode(i.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(i.BlockStatement):g&&(u(g.text,[":",","])&&u(d.type,[a.STRING,a.WORD,a.RESERVED])||u(d.text,["get","set","..."])&&u(g.type,[a.WORD,a.RESERVED]))?u(this._last_last_text,["class","interface"])&&!u(g.text,[":",","])?this.set_mode(i.BlockStatement):this.set_mode(i.ObjectLiteral):this._flags.last_token.type===a.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(i.BlockStatement):u(this._flags.last_token.type,[a.EQUALS,a.START_EXPR,a.COMMA,a.OPERATOR])||y(this._flags.last_token,["return","throw","import","default"])?this.set_mode(i.ObjectLiteral):this.set_mode(i.BlockStatement),this._flags.last_token&&y(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var T=!d.comments_before&&d.text==="}",k=T&&this._flags.last_word==="function"&&this._flags.last_token.type===a.END_EXPR;if(this._options.brace_preserve_inline){var C=0,j=null;this._flags.inline_frame=!0;do if(C+=1,j=this._tokens.peek(C-1),j.newlines){this._flags.inline_frame=!1;break}while(j.type!==a.EOF&&!(j.type===a.END_BLOCK&&j.opened===t))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&t.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==a.OPERATOR&&(k||this._flags.last_token.type===a.EQUALS||y(this._flags.last_token,A)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(w(this._previous_flags.mode)&&(this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.COMMA)&&((this._flags.last_token.type===a.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(t),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==a.OPERATOR&&this._flags.last_token.type!==a.START_EXPR&&(u(this._flags.last_token.type,[a.START_BLOCK,a.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(t),this.indent(),!T&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},l.prototype.handle_end_block=function(t){for(this.handle_whitespace_and_comments(t);this._flags.mode===i.Statement;)this.restore_mode();var d=this._flags.last_token.type===a.START_BLOCK;this._flags.inline_frame&&!d?this._output.space_before_token=!0:this._options.brace_style==="expand"?d||this.print_newline():d||(w(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(t)},l.prototype.handle_word=function(t){if(t.type===a.RESERVED){if(u(t.text,["set","get"])&&this._flags.mode!==i.ObjectLiteral)t.type=a.WORD;else if(t.text==="import"&&u(this._tokens.peek().text,["(","."]))t.type=a.WORD;else if(u(t.text,["as","from"])&&!this._flags.import_block)t.type=a.WORD;else if(this._flags.mode===i.ObjectLiteral){var d=this._tokens.peek();d.text===":"&&(t.type=a.WORD)}}if(this.start_of_statement(t)?y(this._flags.last_token,["var","let","const"])&&t.type===a.WORD&&(this._flags.declaration_statement=!0):t.newlines&&!R(this._flags.mode)&&(this._flags.last_token.type!==a.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==a.EQUALS&&(this._options.preserve_newlines||!y(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(t),this.print_newline()):this.handle_whitespace_and_comments(t),this._flags.do_block&&!this._flags.do_while)if(v(t,"while")){this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&v(t,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===i.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&y(t,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(t),this._flags.in_case=!0;return}if((this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR)&&!this.start_of_object_property()&&!(u(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===i.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(t),v(t,"function")){(u(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(u(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===a.OPERATOR))&&!this._output.just_added_blankline()&&!t.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD?y(this._flags.last_token,["get","set","new","export"])||y(this._flags.last_token,x)?this._output.space_before_token=!0:v(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===a.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(R(this._flags.mode)||w(this._flags.mode))||this.print_newline(),this.print_token(t),this._flags.last_word=t.text;return}var g="NONE";if(this._flags.last_token.type===a.END_BLOCK?this._previous_flags.inline_frame?g="SPACE":y(t,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&t.newlines?g="NEWLINE":(g="SPACE",this._output.space_before_token=!0):g="NEWLINE":this._flags.last_token.type===a.SEMICOLON&&this._flags.mode===i.BlockStatement?g="NEWLINE":this._flags.last_token.type===a.SEMICOLON&&R(this._flags.mode)?g="SPACE":this._flags.last_token.type===a.STRING?g="NEWLINE":this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD||this._flags.last_token.text==="*"&&(u(this._last_last_text,["function","yield"])||this._flags.mode===i.ObjectLiteral&&u(this._last_last_text,["{",","]))?g="SPACE":this._flags.last_token.type===a.START_BLOCK?this._flags.inline_frame?g="SPACE":g="NEWLINE":this._flags.last_token.type===a.END_EXPR&&(this._output.space_before_token=!0,g="NEWLINE"),y(t,_)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?g="SPACE":g="NEWLINE"),y(t,["else","catch","finally"]))if((!(this._flags.last_token.type===a.END_BLOCK&&this._previous_flags.mode===i.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&t.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var T=this._output.current_line;T.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else g==="NEWLINE"?y(this._flags.last_token,A)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&y(t,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==a.END_EXPR?(this._flags.last_token.type!==a.START_EXPR||!y(t,["var","let","const"]))&&this._flags.last_token.text!==":"&&(v(t,"if")&&v(t.previous,"else")?this._output.space_before_token=!0:this.print_newline()):y(t,_)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&w(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():g==="SPACE"&&(this._output.space_before_token=!0);t.previous&&(t.previous.type===a.WORD||t.previous.type===a.RESERVED)&&(this._output.space_before_token=!0),this.print_token(t),this._flags.last_word=t.text,t.type===a.RESERVED&&(t.text==="do"?this._flags.do_block=!0:t.text==="if"?this._flags.if_block=!0:t.text==="import"?this._flags.import_block=!0:this._flags.import_block&&v(t,"from")&&(this._flags.import_block=!1))},l.prototype.handle_semicolon=function(t){this.start_of_statement(t)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(t);for(var d=this._tokens.peek();this._flags.mode===i.Statement&&!(this._flags.if_block&&v(d,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(t)},l.prototype.handle_string=function(t){t.text.startsWith("`")&&t.newlines===0&&t.whitespace_before===""&&(t.previous.text===")"||this._flags.last_token.type===a.WORD)||(this.start_of_statement(t)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(t),this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):t.text.startsWith("`")&&this._flags.last_token.type===a.END_EXPR&&(t.previous.text==="]"||t.previous.text===")")&&t.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(t)},l.prototype.handle_equals=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0},l.prototype.handle_comma=function(t){this.handle_whitespace_and_comments(t,!0),this.print_token(t),this._output.space_before_token=!0,this._flags.declaration_statement?(R(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)):this._flags.mode===i.ObjectLiteral||this._flags.mode===i.Statement&&this._flags.parent.mode===i.ObjectLiteral?(this._flags.mode===i.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)},l.prototype.handle_operator=function(t){var d=t.text==="*"&&(y(this._flags.last_token,["function","yield"])||u(this._flags.last_token.type,[a.START_BLOCK,a.COMMA,a.END_BLOCK,a.SEMICOLON])),g=u(t.text,["-","+"])&&(u(this._flags.last_token.type,[a.START_BLOCK,a.START_EXPR,a.EQUALS,a.OPERATOR])||u(this._flags.last_token.text,_)||this._flags.last_token.text===",");if(!this.start_of_statement(t)){var T=!d;this.handle_whitespace_and_comments(t,T)}if(t.text==="*"&&this._flags.last_token.type===a.DOT){this.print_token(t);return}if(t.text==="::"){this.print_token(t);return}if(u(t.text,["-","+"])&&this.start_of_object_property()){this.print_token(t);return}if(this._flags.last_token.type===a.OPERATOR&&u(this._options.operator_position,r)&&this.allow_wrap_or_preserved_newline(t),t.text===":"&&this._flags.in_case){this.print_token(t),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==a.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var k=!0,C=!0,j=!1;if(t.text===":"?this._flags.ternary_depth===0?k=!1:(this._flags.ternary_depth-=1,j=!0):t.text==="?"&&(this._flags.ternary_depth+=1),!g&&!d&&this._options.preserve_newlines&&u(t.text,c)){var I=t.text===":",W=I&&j,G=I&&!j;switch(this._options.operator_position){case L.before_newline:this._output.space_before_token=!G,this.print_token(t),(!I||W)&&this.allow_wrap_or_preserved_newline(t),this._output.space_before_token=!0;return;case L.after_newline:this._output.space_before_token=!0,!I||W?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(t):this._output.space_before_token=!1,this.print_token(t),this._output.space_before_token=!0;return;case L.preserve_newline:G||this.allow_wrap_or_preserved_newline(t),k=!(this._output.just_added_newline()||G),this._output.space_before_token=k,this.print_token(t),this._output.space_before_token=!0;return}}if(d){this.allow_wrap_or_preserved_newline(t),k=!1;var dt=this._tokens.peek();C=dt&&u(dt.type,[a.WORD,a.RESERVED])}else if(t.text==="...")this.allow_wrap_or_preserved_newline(t),k=this._flags.last_token.type===a.START_BLOCK,C=!1;else if(u(t.text,["--","++","!","~"])||g){if((this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR)&&this.allow_wrap_or_preserved_newline(t),k=!1,C=!1,t.newlines&&(t.text==="--"||t.text==="++"||t.text==="~")){var gt=y(this._flags.last_token,A)&&t.newlines;gt&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(gt,!0)}this._flags.last_token.text===";"&&R(this._flags.mode)&&(k=!0),this._flags.last_token.type===a.RESERVED?k=!0:this._flags.last_token.type===a.END_EXPR?k=!(this._flags.last_token.text==="]"&&(t.text==="--"||t.text==="++")):this._flags.last_token.type===a.OPERATOR&&(k=u(t.text,["--","-","++","+"])&&u(this._flags.last_token.text,["--","-","++","+"]),u(t.text,["+","-"])&&u(this._flags.last_token.text,["--","++"])&&(C=!0)),(this._flags.mode===i.BlockStatement&&!this._flags.inline_frame||this._flags.mode===i.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||k,this.print_token(t),this._output.space_before_token=C},l.prototype.handle_block_comment=function(t,d){if(this._output.raw){this._output.add_raw_token(t),t.directives&&t.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(t.directives){this.print_newline(!1,d),this.print_token(t),t.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!s.newline.test(t.text)&&!t.newlines){this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0;return}else this.print_block_commment(t,d)},l.prototype.print_block_commment=function(t,d){var g=O(t.text),T,k=!1,C=!1,j=t.whitespace_before,I=j.length;if(this.print_newline(!1,d),this.print_token_line_indentation(t),this._output.add_token(g[0]),this.print_newline(!1,d),g.length>1){for(g=g.slice(1),k=f(g,"*"),C=m(g,j),k&&(this._flags.alignment=1),T=0;T<g.length;T++)k?(this.print_token_line_indentation(t),this._output.add_token(E(g[T]))):C&&g[T]?(this.print_token_line_indentation(t),this._output.add_token(g[T].substring(I))):(this._output.current_line.set_indent(-1),this._output.add_token(g[T])),this.print_newline(!1,d);this._flags.alignment=0}},l.prototype.handle_comment=function(t,d){t.newlines?this.print_newline(!1,d):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(t),this.print_newline(!1,d)},l.prototype.handle_dot=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),y(this._flags.last_token,A)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(t,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(t)},l.prototype.handle_unknown=function(t,d){this.print_token(t),t.text[t.text.length-1]===`
|
|
33
|
-
`&&this.print_newline(!1,d)},l.prototype.handle_eof=function(t){for(;this._flags.mode===i.Statement;)this.restore_mode();this.handle_whitespace_and_comments(t)},Y.Beautifier=l,Y}var Lt;function
|
|
33
|
+
`&&this.print_newline(!1,d)},l.prototype.handle_eof=function(t){for(;this._flags.mode===i.Statement;)this.restore_mode();this.handle_whitespace_and_comments(t)},Y.Beautifier=l,Y}var Lt;function be(){if(Lt)return U.exports;Lt=1;var h=me().Beautifier,p=Vt().Options;function s(e,n){var _=new h(e,n);return _.beautify()}return U.exports=s,U.exports.defaultOptions=function(){return new p},U.exports}var $={exports:{}},rt={},ut={},Ct;function Qt(){if(Ct)return ut;Ct=1;var h=pt().Options;function p(s){h.call(this,s,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var e=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||e;var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var _=0;_<n.length;_++)n[_]!=="expand"?this.brace_style="collapse":this.brace_style=n[_]}return p.prototype=new h,ut.Options=p,ut}var jt;function ve(){if(jt)return rt;jt=1;var h=Qt().Options,p=ht().Output,s=ft().InputScanner,e=ct().Directives,n=new e(/\/\*/,/\*\//),_=/\r\n|[\r\n]/,c=/\r\n|[\r\n]/g,a=/\s/,u=/(?:\s|\n)+/g,E=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,b=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function v(y,A){this._source_text=y||"",this._options=new h(A),this._ch=null,this._input=null,this.NESTED_AT_RULE={page:!0,"font-face":!0,keyframes:!0,media:!0,supports:!0,document:!0},this.CONDITIONAL_GROUP_RULE={media:!0,supports:!0,document:!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}return v.prototype.eatString=function(y){var A="";for(this._ch=this._input.next();this._ch;){if(A+=this._ch,this._ch==="\\")A+=this._input.next();else if(y.indexOf(this._ch)!==-1||this._ch===`
|
|
34
34
|
`)break;this._ch=this._input.next()}return A},v.prototype.eatWhitespace=function(y){for(var A=a.test(this._input.peek()),S=0;a.test(this._input.peek());)this._ch=this._input.next(),y&&this._ch===`
|
|
35
35
|
`&&(S===0||S<this._options.max_preserve_newlines)&&(S++,this._output.add_new_line(!0));return A},v.prototype.foundNestedPseudoClass=function(){for(var y=0,A=1,S=this._input.peek(A);S;){if(S==="{")return!0;if(S==="(")y+=1;else if(S===")"){if(y===0)return!1;y-=1}else if(S===";"||S==="}")return!1;A++,S=this._input.peek(A)}return!1},v.prototype.print_string=function(y){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(y)},v.prototype.preserveSingleSpace=function(y){y&&(this._output.space_before_token=!0)},v.prototype.indent=function(){this._indentLevel++},v.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},v.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var y=this._source_text,A=this._options.eol;A==="auto"&&(A=`
|
|
36
36
|
`,y&&_.test(y||"")&&(A=y.match(_)[0])),y=y.replace(c,`
|
|
37
37
|
`);var S=y.match(/^[\t ]*/)[0];this._output=new p(this._options,S),this._input=new s(y),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var L=0,r=!1,i=!1,o=!1,O=!1,w=!1,R=this._ch,f=!1,m,l,x;m=this._input.read(u),l=m!=="",x=R,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),R=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var t=this._input.read(E),d=n.get_directives(t);d&&d.ignore==="start"&&(t+=n.readIgnored(this._input)),this.print_string(t),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(b)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(l),this.print_string(this._ch);var g=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);g.match(/[ :]$/)&&(g=this.eatString(": ").replace(/\s+$/,""),this.print_string(g),this._output.space_before_token=!0),L===0&&g.indexOf(":")!==-1&&(i=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(l),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var T=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);T.match(/[ :]$/)&&(T=this.eatString(": ").replace(/\s+$/,""),this.print_string(T),this._output.space_before_token=!0),L===0&&T.indexOf(":")!==-1?(i=!0,this.indent()):T in this.NESTED_AT_RULE?(this._nestedLevel+=1,T in this.CONDITIONAL_GROUP_RULE&&(o=!0)):L===0&&!i&&(O=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(l),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")i&&(i=!1,this.outdent()),O=!1,o?(o=!1,r=this._indentLevel>=this._nestedLevel):r=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&r&&this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(x==="("?this._output.space_before_token=!1:x!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),x==="{"&&this._output.trim(!0),i&&(this.outdent(),i=!1),this.print_string(this._ch),r=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&this._input.peek()!=="}"&&this._output.add_new_line(!0),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var k=0;k<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;k++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[k])){f=!0;break}(r||o)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!O&&L===0?(this.print_string(":"),i||(i=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var C=x==='"'||x==="'";this.preserveSingleSpace(C||l),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")f=!1,L===0?(i&&(this.outdent(),i=!1),O=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),L++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),L&&(L--,this.outdent()));else{var j=!1;this._input.lookBack("with")&&(j=!0),this.preserveSingleSpace(l||j),this.print_string(this._ch),i&&x==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),w=!0):(this.eatWhitespace(),L++,this.indent())}else if(this._ch===")")L&&(L--,this.outdent()),w&&this._input.peek()===";"&&this._options.selector_separator_newline&&(w=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!i||w)&&L===0&&!O?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!i&&L===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&a.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(l),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),a.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var I=x==='"'||x==="'";this.preserveSingleSpace(I||l),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
38
|
-
`&&f&&this._output.add_new_line()}var W=this._output.get_code(A);return W},rt.Beautifier=v,rt}var It;function be(){if(It)return $.exports;It=1;var h=me().Beautifier,p=Qt().Options;function s(e,n){var _=new h(e,n);return _.beautify()}return $.exports=s,$.exports.defaultOptions=function(){return new p},$.exports}var q={exports:{}},ot={},lt={},Pt;function Yt(){if(Pt)return lt;Pt=1;var h=pt().Options;function p(s){h.call(this,s,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_min_attrs=this._get_number("wrap_attributes_min_attrs",2),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.inline_custom_elements=this._get_boolean("inline_custom_elements",!0),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}return p.prototype=new h,lt.Options=p,lt}var F={},Dt;function Mt(){if(Dt)return F;Dt=1;var h=X().Tokenizer,p=X().TOKEN,s=ct().Directives,e=Gt().TemplatablePattern,n=V().Pattern,_={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",CONTROL_FLOW_OPEN:"TK_CONTROL_FLOW_OPEN",CONTROL_FLOW_CLOSE:"TK_CONTROL_FLOW_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:p.START,RAW:p.RAW,EOF:p.EOF},c=new s(/<\!--/,/-->/),a=function(u,E){h.call(this,u,E),this._current_tag_name="";var b=new e(this._input).read_options(this._options),v=new n(this._input);if(this.__patterns={word:b.until(/[\n\r\t <]/),word_control_flow_close_excluded:b.until(/[\n\r\t <}]/),single_quote:b.until_after(/'/),double_quote:b.until_after(/"/),attribute:b.until(/[\n\r\t =>]|\/>/),element_name:b.until(/[\n\r\t >\/]/),angular_control_flow_start:v.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:v.starting_with(/{{!--/).until_after(/--}}/),handlebars:v.starting_with(/{{/).until_after(/}}/),handlebars_open:v.until(/[\n\r\t }]/),handlebars_raw_close:v.until(/}}/),comment:v.starting_with(/<!--/).until_after(/-->/),cdata:v.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:v.starting_with(/<!\[/).until_after(/]>/),processing:v.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars"),this.__patterns.word_control_flow_close_excluded=this.__patterns.word_control_flow_close_excluded.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var y=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=v.matching(y).until_after(y)}};return a.prototype=new h,a.prototype._is_comment=function(u){return!1},a.prototype._is_opening=function(u){return u.type===_.TAG_OPEN||u.type===_.CONTROL_FLOW_OPEN},a.prototype._is_closing=function(u,E){return u.type===_.TAG_CLOSE&&E&&((u.text===">"||u.text==="/>")&&E.text[0]==="<"||u.text==="}}"&&E.text[0]==="{"&&E.text[1]==="{")||u.type===_.CONTROL_FLOW_CLOSE&&u.text==="}"&&E.text.endsWith("{")},a.prototype._reset=function(){this._current_tag_name=""},a.prototype._get_next_token=function(u,E){var b=null;this._readWhitespace();var v=this._input.peek();return v===null?this._create_token(_.EOF,""):(b=b||this._read_open_handlebars(v,E),b=b||this._read_attribute(v,u,E),b=b||this._read_close(v,E),b=b||this._read_script_and_style(v,u),b=b||this._read_control_flows(v,E),b=b||this._read_raw_content(v,u,E),b=b||this._read_content_word(v,E),b=b||this._read_comment_or_cdata(v),b=b||this._read_processing(v),b=b||this._read_open(v,E),b=b||this._create_token(_.UNKNOWN,this._input.next()),b)},a.prototype._read_comment_or_cdata=function(u){var E=null,b=null,v=null;if(u==="<"){var y=this._input.peek(1);y==="!"&&(b=this.__patterns.comment.read(),b?(v=c.get_directives(b),v&&v.ignore==="start"&&(b+=c.readIgnored(this._input))):b=this.__patterns.cdata.read()),b&&(E=this._create_token(_.COMMENT,b),E.directives=v)}return E},a.prototype._read_processing=function(u){var E=null,b=null,v=null;if(u==="<"){var y=this._input.peek(1);(y==="!"||y==="?")&&(b=this.__patterns.conditional_comment.read(),b=b||this.__patterns.processing.read()),b&&(E=this._create_token(_.COMMENT,b),E.directives=v)}return E},a.prototype._read_open=function(u,E){var b=null,v=null;return(!E||E.type===_.CONTROL_FLOW_OPEN)&&u==="<"&&(b=this._input.next(),this._input.peek()==="/"&&(b+=this._input.next()),b+=this.__patterns.element_name.read(),v=this._create_token(_.TAG_OPEN,b)),v},a.prototype._read_open_handlebars=function(u,E){var b=null,v=null;return(!E||E.type===_.CONTROL_FLOW_OPEN)&&(this._options.templating.includes("angular")||this._options.indent_handlebars)&&u==="{"&&this._input.peek(1)==="{"&&(this._options.indent_handlebars&&this._input.peek(2)==="!"?(b=this.__patterns.handlebars_comment.read(),b=b||this.__patterns.handlebars.read(),v=this._create_token(_.COMMENT,b)):(b=this.__patterns.handlebars_open.read(),v=this._create_token(_.TAG_OPEN,b))),v},a.prototype._read_control_flows=function(u,E){var b="",v=null;if(!this._options.templating.includes("angular"))return v;if(u==="@"){if(b=this.__patterns.angular_control_flow_start.read(),b==="")return v;for(var y=b.endsWith("(")?1:0,A=0;!(b.endsWith("{")&&y===A);){var S=this._input.next();if(S===null)break;S==="("?y++:S===")"&&A++,b+=S}v=this._create_token(_.CONTROL_FLOW_OPEN,b)}else u==="}"&&E&&E.type===_.CONTROL_FLOW_OPEN&&(b=this._input.next(),v=this._create_token(_.CONTROL_FLOW_CLOSE,b));return v},a.prototype._read_close=function(u,E){var b=null,v=null;return E&&E.type===_.TAG_OPEN&&(E.text[0]==="<"&&(u===">"||u==="/"&&this._input.peek(1)===">")?(b=this._input.next(),u==="/"&&(b+=this._input.next()),v=this._create_token(_.TAG_CLOSE,b)):E.text[0]==="{"&&u==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),v=this._create_token(_.TAG_CLOSE,"}}"))),v},a.prototype._read_attribute=function(u,E,b){var v=null,y="";if(b&&b.text[0]==="<")if(u==="=")v=this._create_token(_.EQUALS,this._input.next());else if(u==='"'||u==="'"){var A=this._input.next();u==='"'?A+=this.__patterns.double_quote.read():A+=this.__patterns.single_quote.read(),v=this._create_token(_.VALUE,A)}else y=this.__patterns.attribute.read(),y&&(E.type===_.EQUALS?v=this._create_token(_.VALUE,y):v=this._create_token(_.ATTRIBUTE,y));return v},a.prototype._is_content_unformatted=function(u){return this._options.void_elements.indexOf(u)===-1&&(this._options.content_unformatted.indexOf(u)!==-1||this._options.unformatted.indexOf(u)!==-1)},a.prototype._read_raw_content=function(u,E,b){var v="";if(b&&b.text[0]==="{")v=this.__patterns.handlebars_raw_close.read();else if(E.type===_.TAG_CLOSE&&E.opened.text[0]==="<"&&E.text[0]!=="/"){var y=E.opened.text.substr(1).toLowerCase();this._is_content_unformatted(y)&&(v=this._input.readUntil(new RegExp("</"+y+"[\\n\\r\\t ]*?>","ig")))}return v?this._create_token(_.TEXT,v):null},a.prototype._read_script_and_style=function(u,E){if(E.type===_.TAG_CLOSE&&E.opened.text[0]==="<"&&E.text[0]!=="/"){var b=E.opened.text.substr(1).toLowerCase();if(b==="script"||b==="style"){var v=this._read_comment_or_cdata(u);if(v)return v.type=_.TEXT,v;var y=this._input.readUntil(new RegExp("</"+b+"[\\n\\r\\t ]*?>","ig"));if(y)return this._create_token(_.TEXT,y)}}return null},a.prototype._read_content_word=function(u,E){var b="";return this._options.unformatted_content_delimiter&&u===this._options.unformatted_content_delimiter[0]&&(b=this.__patterns.unformatted_content_delimiter.read()),b||(b=E&&E.type===_.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),b?this._create_token(_.TEXT,b):null},F.Tokenizer=a,F.TOKEN=_,F}var Bt;function ve(){if(Bt)return ot;Bt=1;var h=Yt().Options,p=ht().Output,s=Mt().Tokenizer,e=Mt().TOKEN,n=/\r\n|[\r\n]/,_=/\r\n|[\r\n]/g,c=function(r,i){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=r.max_preserve_newlines,this.preserve_newlines=r.preserve_newlines,this._output=new p(r,i)};c.prototype.current_line_has_match=function(r){return this._output.current_line.has_match(r)},c.prototype.set_space_before_token=function(r,i){this._output.space_before_token=r,this._output.non_breaking_space=i},c.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},c.prototype.add_raw_token=function(r){this._output.add_raw_token(r)},c.prototype.print_preserved_newlines=function(r){var i=0;r.type!==e.TEXT&&r.previous.type!==e.TEXT&&(i=r.newlines?1:0),this.preserve_newlines&&(i=r.newlines<this.max_preserve_newlines+1?r.newlines:this.max_preserve_newlines+1);for(var o=0;o<i;o++)this.print_newline(o>0);return i!==0},c.prototype.traverse_whitespace=function(r){return r.whitespace_before||r.newlines?(this.print_preserved_newlines(r)||(this._output.space_before_token=!0),!0):!1},c.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},c.prototype.print_newline=function(r){this._output.add_new_line(r)},c.prototype.print_token=function(r){r.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(r.text))},c.prototype.indent=function(){this.indent_level++},c.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},c.prototype.get_full_indent=function(r){return r=this.indent_level+(r||0),r<1?"":this._output.get_indent_string(r)};var a=function(r){for(var i=null,o=r.next;o.type!==e.EOF&&r.closed!==o;){if(o.type===e.ATTRIBUTE&&o.text==="type"){o.next&&o.next.type===e.EQUALS&&o.next.next&&o.next.next.type===e.VALUE&&(i=o.next.next.text);break}o=o.next}return i},u=function(r,i){var o=null,O=null;return i.closed?(r==="script"?o="text/javascript":r==="style"&&(o="text/css"),o=a(i)||o,o.search("text/css")>-1?O="css":o.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?O="javascript":o.search(/(text|application|dojo)\/(x-)?(html)/)>-1?O="html":o.search(/test\/null/)>-1&&(O="null"),O):null};function E(r,i){return i.indexOf(r)!==-1}function b(r,i,o){this.parent=r||null,this.tag=i?i.tag_name:"",this.indent_level=o||0,this.parser_token=i||null}function v(r){this._printer=r,this._current_frame=null}v.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},v.prototype.record_tag=function(r){var i=new b(this._current_frame,r,this._printer.indent_level);this._current_frame=i},v.prototype._try_pop_frame=function(r){var i=null;return r&&(i=r.parser_token,this._printer.indent_level=r.indent_level,this._current_frame=r.parent),i},v.prototype._get_frame=function(r,i){for(var o=this._current_frame;o&&r.indexOf(o.tag)===-1;){if(i&&i.indexOf(o.tag)!==-1){o=null;break}o=o.parent}return o},v.prototype.try_pop=function(r,i){var o=this._get_frame([r],i);return this._try_pop_frame(o)},v.prototype.indent_to_tag=function(r){var i=this._get_frame(r);i&&(this._printer.indent_level=i.indent_level)};function y(r,i,o,O){this._source_text=r||"",i=i||{},this._js_beautify=o,this._css_beautify=O,this._tag_stack=null;var w=new h(i,"html");this._options=w,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,5)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,8)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}y.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var r=this._source_text,i=this._options.eol;this._options.eol==="auto"&&(i=`
|
|
38
|
+
`&&f&&this._output.add_new_line()}var W=this._output.get_code(A);return W},rt.Beautifier=v,rt}var It;function ye(){if(It)return $.exports;It=1;var h=ve().Beautifier,p=Qt().Options;function s(e,n){var _=new h(e,n);return _.beautify()}return $.exports=s,$.exports.defaultOptions=function(){return new p},$.exports}var q={exports:{}},ot={},lt={},Pt;function Yt(){if(Pt)return lt;Pt=1;var h=pt().Options;function p(s){h.call(this,s,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_min_attrs=this._get_number("wrap_attributes_min_attrs",2),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.inline_custom_elements=this._get_boolean("inline_custom_elements",!0),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}return p.prototype=new h,lt.Options=p,lt}var F={},Dt;function Mt(){if(Dt)return F;Dt=1;var h=X().Tokenizer,p=X().TOKEN,s=ct().Directives,e=Gt().TemplatablePattern,n=V().Pattern,_={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",CONTROL_FLOW_OPEN:"TK_CONTROL_FLOW_OPEN",CONTROL_FLOW_CLOSE:"TK_CONTROL_FLOW_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:p.START,RAW:p.RAW,EOF:p.EOF},c=new s(/<\!--/,/-->/),a=function(u,E){h.call(this,u,E),this._current_tag_name="";var b=new e(this._input).read_options(this._options),v=new n(this._input);if(this.__patterns={word:b.until(/[\n\r\t <]/),word_control_flow_close_excluded:b.until(/[\n\r\t <}]/),single_quote:b.until_after(/'/),double_quote:b.until_after(/"/),attribute:b.until(/[\n\r\t =>]|\/>/),element_name:b.until(/[\n\r\t >\/]/),angular_control_flow_start:v.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:v.starting_with(/{{!--/).until_after(/--}}/),handlebars:v.starting_with(/{{/).until_after(/}}/),handlebars_open:v.until(/[\n\r\t }]/),handlebars_raw_close:v.until(/}}/),comment:v.starting_with(/<!--/).until_after(/-->/),cdata:v.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:v.starting_with(/<!\[/).until_after(/]>/),processing:v.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars"),this.__patterns.word_control_flow_close_excluded=this.__patterns.word_control_flow_close_excluded.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var y=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=v.matching(y).until_after(y)}};return a.prototype=new h,a.prototype._is_comment=function(u){return!1},a.prototype._is_opening=function(u){return u.type===_.TAG_OPEN||u.type===_.CONTROL_FLOW_OPEN},a.prototype._is_closing=function(u,E){return u.type===_.TAG_CLOSE&&E&&((u.text===">"||u.text==="/>")&&E.text[0]==="<"||u.text==="}}"&&E.text[0]==="{"&&E.text[1]==="{")||u.type===_.CONTROL_FLOW_CLOSE&&u.text==="}"&&E.text.endsWith("{")},a.prototype._reset=function(){this._current_tag_name=""},a.prototype._get_next_token=function(u,E){var b=null;this._readWhitespace();var v=this._input.peek();return v===null?this._create_token(_.EOF,""):(b=b||this._read_open_handlebars(v,E),b=b||this._read_attribute(v,u,E),b=b||this._read_close(v,E),b=b||this._read_script_and_style(v,u),b=b||this._read_control_flows(v,E),b=b||this._read_raw_content(v,u,E),b=b||this._read_content_word(v,E),b=b||this._read_comment_or_cdata(v),b=b||this._read_processing(v),b=b||this._read_open(v,E),b=b||this._create_token(_.UNKNOWN,this._input.next()),b)},a.prototype._read_comment_or_cdata=function(u){var E=null,b=null,v=null;if(u==="<"){var y=this._input.peek(1);y==="!"&&(b=this.__patterns.comment.read(),b?(v=c.get_directives(b),v&&v.ignore==="start"&&(b+=c.readIgnored(this._input))):b=this.__patterns.cdata.read()),b&&(E=this._create_token(_.COMMENT,b),E.directives=v)}return E},a.prototype._read_processing=function(u){var E=null,b=null,v=null;if(u==="<"){var y=this._input.peek(1);(y==="!"||y==="?")&&(b=this.__patterns.conditional_comment.read(),b=b||this.__patterns.processing.read()),b&&(E=this._create_token(_.COMMENT,b),E.directives=v)}return E},a.prototype._read_open=function(u,E){var b=null,v=null;return(!E||E.type===_.CONTROL_FLOW_OPEN)&&u==="<"&&(b=this._input.next(),this._input.peek()==="/"&&(b+=this._input.next()),b+=this.__patterns.element_name.read(),v=this._create_token(_.TAG_OPEN,b)),v},a.prototype._read_open_handlebars=function(u,E){var b=null,v=null;return(!E||E.type===_.CONTROL_FLOW_OPEN)&&(this._options.templating.includes("angular")||this._options.indent_handlebars)&&u==="{"&&this._input.peek(1)==="{"&&(this._options.indent_handlebars&&this._input.peek(2)==="!"?(b=this.__patterns.handlebars_comment.read(),b=b||this.__patterns.handlebars.read(),v=this._create_token(_.COMMENT,b)):(b=this.__patterns.handlebars_open.read(),v=this._create_token(_.TAG_OPEN,b))),v},a.prototype._read_control_flows=function(u,E){var b="",v=null;if(!this._options.templating.includes("angular"))return v;if(u==="@"){if(b=this.__patterns.angular_control_flow_start.read(),b==="")return v;for(var y=b.endsWith("(")?1:0,A=0;!(b.endsWith("{")&&y===A);){var S=this._input.next();if(S===null)break;S==="("?y++:S===")"&&A++,b+=S}v=this._create_token(_.CONTROL_FLOW_OPEN,b)}else u==="}"&&E&&E.type===_.CONTROL_FLOW_OPEN&&(b=this._input.next(),v=this._create_token(_.CONTROL_FLOW_CLOSE,b));return v},a.prototype._read_close=function(u,E){var b=null,v=null;return E&&E.type===_.TAG_OPEN&&(E.text[0]==="<"&&(u===">"||u==="/"&&this._input.peek(1)===">")?(b=this._input.next(),u==="/"&&(b+=this._input.next()),v=this._create_token(_.TAG_CLOSE,b)):E.text[0]==="{"&&u==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),v=this._create_token(_.TAG_CLOSE,"}}"))),v},a.prototype._read_attribute=function(u,E,b){var v=null,y="";if(b&&b.text[0]==="<")if(u==="=")v=this._create_token(_.EQUALS,this._input.next());else if(u==='"'||u==="'"){var A=this._input.next();u==='"'?A+=this.__patterns.double_quote.read():A+=this.__patterns.single_quote.read(),v=this._create_token(_.VALUE,A)}else y=this.__patterns.attribute.read(),y&&(E.type===_.EQUALS?v=this._create_token(_.VALUE,y):v=this._create_token(_.ATTRIBUTE,y));return v},a.prototype._is_content_unformatted=function(u){return this._options.void_elements.indexOf(u)===-1&&(this._options.content_unformatted.indexOf(u)!==-1||this._options.unformatted.indexOf(u)!==-1)},a.prototype._read_raw_content=function(u,E,b){var v="";if(b&&b.text[0]==="{")v=this.__patterns.handlebars_raw_close.read();else if(E.type===_.TAG_CLOSE&&E.opened.text[0]==="<"&&E.text[0]!=="/"){var y=E.opened.text.substr(1).toLowerCase();this._is_content_unformatted(y)&&(v=this._input.readUntil(new RegExp("</"+y+"[\\n\\r\\t ]*?>","ig")))}return v?this._create_token(_.TEXT,v):null},a.prototype._read_script_and_style=function(u,E){if(E.type===_.TAG_CLOSE&&E.opened.text[0]==="<"&&E.text[0]!=="/"){var b=E.opened.text.substr(1).toLowerCase();if(b==="script"||b==="style"){var v=this._read_comment_or_cdata(u);if(v)return v.type=_.TEXT,v;var y=this._input.readUntil(new RegExp("</"+b+"[\\n\\r\\t ]*?>","ig"));if(y)return this._create_token(_.TEXT,y)}}return null},a.prototype._read_content_word=function(u,E){var b="";return this._options.unformatted_content_delimiter&&u===this._options.unformatted_content_delimiter[0]&&(b=this.__patterns.unformatted_content_delimiter.read()),b||(b=E&&E.type===_.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),b?this._create_token(_.TEXT,b):null},F.Tokenizer=a,F.TOKEN=_,F}var Bt;function we(){if(Bt)return ot;Bt=1;var h=Yt().Options,p=ht().Output,s=Mt().Tokenizer,e=Mt().TOKEN,n=/\r\n|[\r\n]/,_=/\r\n|[\r\n]/g,c=function(r,i){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=r.max_preserve_newlines,this.preserve_newlines=r.preserve_newlines,this._output=new p(r,i)};c.prototype.current_line_has_match=function(r){return this._output.current_line.has_match(r)},c.prototype.set_space_before_token=function(r,i){this._output.space_before_token=r,this._output.non_breaking_space=i},c.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},c.prototype.add_raw_token=function(r){this._output.add_raw_token(r)},c.prototype.print_preserved_newlines=function(r){var i=0;r.type!==e.TEXT&&r.previous.type!==e.TEXT&&(i=r.newlines?1:0),this.preserve_newlines&&(i=r.newlines<this.max_preserve_newlines+1?r.newlines:this.max_preserve_newlines+1);for(var o=0;o<i;o++)this.print_newline(o>0);return i!==0},c.prototype.traverse_whitespace=function(r){return r.whitespace_before||r.newlines?(this.print_preserved_newlines(r)||(this._output.space_before_token=!0),!0):!1},c.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},c.prototype.print_newline=function(r){this._output.add_new_line(r)},c.prototype.print_token=function(r){r.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(r.text))},c.prototype.indent=function(){this.indent_level++},c.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},c.prototype.get_full_indent=function(r){return r=this.indent_level+(r||0),r<1?"":this._output.get_indent_string(r)};var a=function(r){for(var i=null,o=r.next;o.type!==e.EOF&&r.closed!==o;){if(o.type===e.ATTRIBUTE&&o.text==="type"){o.next&&o.next.type===e.EQUALS&&o.next.next&&o.next.next.type===e.VALUE&&(i=o.next.next.text);break}o=o.next}return i},u=function(r,i){var o=null,O=null;return i.closed?(r==="script"?o="text/javascript":r==="style"&&(o="text/css"),o=a(i)||o,o.search("text/css")>-1?O="css":o.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?O="javascript":o.search(/(text|application|dojo)\/(x-)?(html)/)>-1?O="html":o.search(/test\/null/)>-1&&(O="null"),O):null};function E(r,i){return i.indexOf(r)!==-1}function b(r,i,o){this.parent=r||null,this.tag=i?i.tag_name:"",this.indent_level=o||0,this.parser_token=i||null}function v(r){this._printer=r,this._current_frame=null}v.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},v.prototype.record_tag=function(r){var i=new b(this._current_frame,r,this._printer.indent_level);this._current_frame=i},v.prototype._try_pop_frame=function(r){var i=null;return r&&(i=r.parser_token,this._printer.indent_level=r.indent_level,this._current_frame=r.parent),i},v.prototype._get_frame=function(r,i){for(var o=this._current_frame;o&&r.indexOf(o.tag)===-1;){if(i&&i.indexOf(o.tag)!==-1){o=null;break}o=o.parent}return o},v.prototype.try_pop=function(r,i){var o=this._get_frame([r],i);return this._try_pop_frame(o)},v.prototype.indent_to_tag=function(r){var i=this._get_frame(r);i&&(this._printer.indent_level=i.indent_level)};function y(r,i,o,O){this._source_text=r||"",i=i||{},this._js_beautify=o,this._css_beautify=O,this._tag_stack=null;var w=new h(i,"html");this._options=w,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,5)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,8)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}y.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var r=this._source_text,i=this._options.eol;this._options.eol==="auto"&&(i=`
|
|
39
39
|
`,r&&n.test(r)&&(i=r.match(n)[0])),r=r.replace(_,`
|
|
40
40
|
`);var o=r.match(/^[\t ]*/)[0],O={text:"",type:""},w=new A(this._options),R=new c(this._options,o),f=new s(r,this._options).tokenize();this._tag_stack=new v(R);for(var m=null,l=f.next();l.type!==e.EOF;)l.type===e.TAG_OPEN||l.type===e.COMMENT?(m=this._handle_tag_open(R,l,w,O,f),w=m):l.type===e.ATTRIBUTE||l.type===e.EQUALS||l.type===e.VALUE||l.type===e.TEXT&&!w.tag_complete?m=this._handle_inside_tag(R,l,w,O):l.type===e.TAG_CLOSE?m=this._handle_tag_close(R,l,w):l.type===e.TEXT?m=this._handle_text(R,l,w):l.type===e.CONTROL_FLOW_OPEN?m=this._handle_control_flow_open(R,l):l.type===e.CONTROL_FLOW_CLOSE?m=this._handle_control_flow_close(R,l):R.add_raw_token(l),O=m,l=f.next();var x=R._output.get_code(i);return x},y.prototype._handle_control_flow_open=function(r,i){var o={text:i.text,type:i.type};return r.set_space_before_token(i.newlines||i.whitespace_before!=="",!0),i.newlines?r.print_preserved_newlines(i):r.set_space_before_token(i.newlines||i.whitespace_before!=="",!0),r.print_token(i),r.indent(),o},y.prototype._handle_control_flow_close=function(r,i){var o={text:i.text,type:i.type};return r.deindent(),i.newlines?r.print_preserved_newlines(i):r.set_space_before_token(i.newlines||i.whitespace_before!=="",!0),r.print_token(i),o},y.prototype._handle_tag_close=function(r,i,o){var O={text:i.text,type:i.type};return r.alignment_size=0,o.tag_complete=!0,r.set_space_before_token(i.newlines||i.whitespace_before!=="",!0),o.is_unformatted?r.add_raw_token(i):(o.tag_start_char==="<"&&(r.set_space_before_token(i.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&o.has_wrapped_attrs&&r.print_newline(!1)),r.print_token(i)),o.indent_content&&!(o.is_unformatted||o.is_content_unformatted)&&(r.indent(),o.indent_content=!1),!o.is_inline_element&&!(o.is_unformatted||o.is_content_unformatted)&&r.set_wrap_point(),O},y.prototype._handle_inside_tag=function(r,i,o,O){var w=o.has_wrapped_attrs,R={text:i.text,type:i.type};return r.set_space_before_token(i.newlines||i.whitespace_before!=="",!0),o.is_unformatted?r.add_raw_token(i):o.tag_start_char==="{"&&i.type===e.TEXT?r.print_preserved_newlines(i)?(i.newlines=0,r.add_raw_token(i)):r.print_token(i):(i.type===e.ATTRIBUTE?r.set_space_before_token(!0):(i.type===e.EQUALS||i.type===e.VALUE&&i.previous.type===e.EQUALS)&&r.set_space_before_token(!1),i.type===e.ATTRIBUTE&&o.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(r.traverse_whitespace(i),w=w||i.newlines!==0),this._is_wrap_attributes_force&&o.attr_count>=this._options.wrap_attributes_min_attrs&&(O.type!==e.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(r.print_newline(!1),w=!0)),r.print_token(i),w=w||r.previous_token_wrapped(),o.has_wrapped_attrs=w),R},y.prototype._handle_text=function(r,i,o){var O={text:i.text,type:"TK_CONTENT"};return o.custom_beautifier_name?this._print_custom_beatifier_text(r,i,o):o.is_unformatted||o.is_content_unformatted?r.add_raw_token(i):(r.traverse_whitespace(i),r.print_token(i)),O},y.prototype._print_custom_beatifier_text=function(r,i,o){var O=this;if(i.text!==""){var w=i.text,R,f=1,m="",l="";o.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?R=this._js_beautify:o.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?R=this._css_beautify:o.custom_beautifier_name==="html"&&(R=function(k,C){var j=new y(k,C,O._js_beautify,O._css_beautify);return j.beautify()}),this._options.indent_scripts==="keep"?f=0:this._options.indent_scripts==="separate"&&(f=-r.indent_level);var x=r.get_full_indent(f);if(w=w.replace(/\n[ \t]*$/,""),o.custom_beautifier_name!=="html"&&w[0]==="<"&&w.match(/^(<!--|<!\[CDATA\[)/)){var t=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(w);if(!t){r.add_raw_token(i);return}m=x+t[1]+`
|
|
41
41
|
`,w=t[4],t[5]&&(l=x+t[5]),w=w.replace(/\n[ \t]*$/,""),(t[2]||t[3].indexOf(`
|
|
@@ -45,4 +45,4 @@ You passed in: '`+this.raw_options[e]+"'");return c},h.prototype._is_valid_selec
|
|
|
45
45
|
`)),w=x+w.replace(/\n/g,`
|
|
46
46
|
`+x)}m&&(w?w=m+w+`
|
|
47
47
|
`+l:w=m+l),r.print_newline(!1),w&&(i.text=w,i.whitespace_before="",i.newlines=0,r.add_raw_token(i),r.print_newline(!0))}},y.prototype._handle_tag_open=function(r,i,o,O,w){var R=this._get_tag_open_token(i);if((o.is_unformatted||o.is_content_unformatted)&&!o.is_empty_element&&i.type===e.TAG_OPEN&&!R.is_start_tag?(r.add_raw_token(i),R.start_tag_token=this._tag_stack.try_pop(R.tag_name)):(r.traverse_whitespace(i),this._set_tag_position(r,i,R,o,O),R.is_inline_element||r.set_wrap_point(),r.print_token(i)),R.is_start_tag&&this._is_wrap_attributes_force){var f=0,m;do m=w.peek(f),m.type===e.ATTRIBUTE&&(R.attr_count+=1),f+=1;while(m.type!==e.EOF&&m.type!==e.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(R.alignment_size=i.text.length+1),!R.tag_complete&&!R.is_unformatted&&(r.alignment_size=R.alignment_size),R};var A=function(r,i,o){if(this.parent=i||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!o)this.tag_complete=!0;else{var O;this.tag_start_char=o.text[0],this.text=o.text,this.tag_start_char==="<"?(O=o.text.match(/^<([^\s>]*)/),this.tag_check=O?O[1]:""):(O=o.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=O?O[1]:"",(o.text.startsWith("{{#>")||o.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&o.next!==null?this.tag_check=o.next.text.split(" ")[0]:this.tag_check=o.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),o.type===e.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||o.closed&&o.closed.text==="/>";var w=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(w=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(!r.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(w)))}};y.prototype._get_tag_open_token=function(r){var i=new A(this._options,this._tag_stack.get_parser_token(),r);return i.alignment_size=this._options.wrap_attributes_indent_size,i.is_end_tag=i.is_end_tag||E(i.tag_check,this._options.void_elements),i.is_empty_element=i.tag_complete||i.is_start_tag&&i.is_end_tag,i.is_unformatted=!i.tag_complete&&E(i.tag_check,this._options.unformatted),i.is_content_unformatted=!i.is_empty_element&&E(i.tag_check,this._options.content_unformatted),i.is_inline_element=E(i.tag_name,this._options.inline)||this._options.inline_custom_elements&&i.tag_name.includes("-")||i.tag_start_char==="{",i},y.prototype._set_tag_position=function(r,i,o,O,w){if(o.is_empty_element||(o.is_end_tag?o.start_tag_token=this._tag_stack.try_pop(o.tag_name):(this._do_optional_end_element(o)&&(o.is_inline_element||r.print_newline(!1)),this._tag_stack.record_tag(o),(o.tag_name==="script"||o.tag_name==="style")&&!(o.is_unformatted||o.is_content_unformatted)&&(o.custom_beautifier_name=u(o.tag_check,i)))),E(o.tag_check,this._options.extra_liners)&&(r.print_newline(!1),r._output.just_added_blankline()||r.print_newline(!0)),o.is_empty_element){if(o.tag_start_char==="{"&&o.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),o.indent_content=!0;var R=r.current_line_has_match(/{{#if/);R||r.print_newline(!1)}o.tag_name==="!--"&&w.type===e.TAG_CLOSE&&O.is_end_tag&&o.text.indexOf(`
|
|
48
|
-
`)===-1||(o.is_inline_element||o.is_unformatted||r.print_newline(!1),this._calcluate_parent_multiline(r,o))}else if(o.is_end_tag){var f=!1;f=o.start_tag_token&&o.start_tag_token.multiline_content,f=f||!o.is_inline_element&&!(O.is_inline_element||O.is_unformatted)&&!(w.type===e.TAG_CLOSE&&o.start_tag_token===O)&&w.type!=="TK_CONTENT",(o.is_content_unformatted||o.is_unformatted)&&(f=!1),f&&r.print_newline(!1)}else o.indent_content=!o.custom_beautifier_name,o.tag_start_char==="<"&&(o.tag_name==="html"?o.indent_content=this._options.indent_inner_html:o.tag_name==="head"?o.indent_content=this._options.indent_head_inner_html:o.tag_name==="body"&&(o.indent_content=this._options.indent_body_inner_html)),!(o.is_inline_element||o.is_unformatted)&&(w.type!=="TK_CONTENT"||o.is_content_unformatted)&&r.print_newline(!1),this._calcluate_parent_multiline(r,o)},y.prototype._calcluate_parent_multiline=function(r,i){i.parent&&r._output.just_added_newline()&&!((i.is_inline_element||i.is_unformatted)&&i.parent.is_inline_element)&&(i.parent.multiline_content=!0)};var S=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","menu","nav","ol","p","pre","section","table","ul"],L=["a","audio","del","ins","map","noscript","video"];return y.prototype._do_optional_end_element=function(r){var i=null;if(!(r.is_empty_element||!r.is_start_tag||!r.parent)){if(r.tag_name==="body")i=i||this._tag_stack.try_pop("head");else if(r.tag_name==="li")i=i||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(r.tag_name==="dd"||r.tag_name==="dt")i=i||this._tag_stack.try_pop("dt",["dl"]),i=i||this._tag_stack.try_pop("dd",["dl"]);else if(r.parent.tag_name==="p"&&S.indexOf(r.tag_name)!==-1){var o=r.parent.parent;(!o||L.indexOf(o.tag_name)===-1)&&(i=i||this._tag_stack.try_pop("p"))}else r.tag_name==="rp"||r.tag_name==="rt"?(i=i||this._tag_stack.try_pop("rt",["ruby","rtc"]),i=i||this._tag_stack.try_pop("rp",["ruby","rtc"])):r.tag_name==="optgroup"?i=i||this._tag_stack.try_pop("optgroup",["select"]):r.tag_name==="option"?i=i||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):r.tag_name==="colgroup"?i=i||this._tag_stack.try_pop("caption",["table"]):r.tag_name==="thead"?(i=i||this._tag_stack.try_pop("caption",["table"]),i=i||this._tag_stack.try_pop("colgroup",["table"])):r.tag_name==="tbody"||r.tag_name==="tfoot"?(i=i||this._tag_stack.try_pop("caption",["table"]),i=i||this._tag_stack.try_pop("colgroup",["table"]),i=i||this._tag_stack.try_pop("thead",["table"]),i=i||this._tag_stack.try_pop("tbody",["table"])):r.tag_name==="tr"?(i=i||this._tag_stack.try_pop("caption",["table"]),i=i||this._tag_stack.try_pop("colgroup",["table"]),i=i||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(r.tag_name==="th"||r.tag_name==="td")&&(i=i||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),i=i||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return r.parent=this._tag_stack.get_parser_token(),i}},ot.Beautifier=y,ot}var Wt;function
|
|
48
|
+
`)===-1||(o.is_inline_element||o.is_unformatted||r.print_newline(!1),this._calcluate_parent_multiline(r,o))}else if(o.is_end_tag){var f=!1;f=o.start_tag_token&&o.start_tag_token.multiline_content,f=f||!o.is_inline_element&&!(O.is_inline_element||O.is_unformatted)&&!(w.type===e.TAG_CLOSE&&o.start_tag_token===O)&&w.type!=="TK_CONTENT",(o.is_content_unformatted||o.is_unformatted)&&(f=!1),f&&r.print_newline(!1)}else o.indent_content=!o.custom_beautifier_name,o.tag_start_char==="<"&&(o.tag_name==="html"?o.indent_content=this._options.indent_inner_html:o.tag_name==="head"?o.indent_content=this._options.indent_head_inner_html:o.tag_name==="body"&&(o.indent_content=this._options.indent_body_inner_html)),!(o.is_inline_element||o.is_unformatted)&&(w.type!=="TK_CONTENT"||o.is_content_unformatted)&&r.print_newline(!1),this._calcluate_parent_multiline(r,o)},y.prototype._calcluate_parent_multiline=function(r,i){i.parent&&r._output.just_added_newline()&&!((i.is_inline_element||i.is_unformatted)&&i.parent.is_inline_element)&&(i.parent.multiline_content=!0)};var S=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","menu","nav","ol","p","pre","section","table","ul"],L=["a","audio","del","ins","map","noscript","video"];return y.prototype._do_optional_end_element=function(r){var i=null;if(!(r.is_empty_element||!r.is_start_tag||!r.parent)){if(r.tag_name==="body")i=i||this._tag_stack.try_pop("head");else if(r.tag_name==="li")i=i||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(r.tag_name==="dd"||r.tag_name==="dt")i=i||this._tag_stack.try_pop("dt",["dl"]),i=i||this._tag_stack.try_pop("dd",["dl"]);else if(r.parent.tag_name==="p"&&S.indexOf(r.tag_name)!==-1){var o=r.parent.parent;(!o||L.indexOf(o.tag_name)===-1)&&(i=i||this._tag_stack.try_pop("p"))}else r.tag_name==="rp"||r.tag_name==="rt"?(i=i||this._tag_stack.try_pop("rt",["ruby","rtc"]),i=i||this._tag_stack.try_pop("rp",["ruby","rtc"])):r.tag_name==="optgroup"?i=i||this._tag_stack.try_pop("optgroup",["select"]):r.tag_name==="option"?i=i||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):r.tag_name==="colgroup"?i=i||this._tag_stack.try_pop("caption",["table"]):r.tag_name==="thead"?(i=i||this._tag_stack.try_pop("caption",["table"]),i=i||this._tag_stack.try_pop("colgroup",["table"])):r.tag_name==="tbody"||r.tag_name==="tfoot"?(i=i||this._tag_stack.try_pop("caption",["table"]),i=i||this._tag_stack.try_pop("colgroup",["table"]),i=i||this._tag_stack.try_pop("thead",["table"]),i=i||this._tag_stack.try_pop("tbody",["table"])):r.tag_name==="tr"?(i=i||this._tag_stack.try_pop("caption",["table"]),i=i||this._tag_stack.try_pop("colgroup",["table"]),i=i||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(r.tag_name==="th"||r.tag_name==="td")&&(i=i||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),i=i||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return r.parent=this._tag_stack.get_parser_token(),i}},ot.Beautifier=y,ot}var Wt;function xe(){if(Wt)return q.exports;Wt=1;var h=we().Beautifier,p=Yt().Options;function s(e,n,_,c){var a=new h(e,n,_,c);return a.beautify()}return q.exports=s,q.exports.defaultOptions=function(){return new p},q.exports}var Ut;function Ee(){if(Ut)return M;Ut=1;var h=be(),p=ye(),s=xe();function e(n,_,c,a){return c=c||h,a=a||p,s(n,_,c,a)}return e.defaultOptions=s.defaultOptions,M.js=h,M.css=p,M.html=e,M}var Kt;function Oe(){return Kt||(Kt=1,(function(h){function p(s,e,n){var _=function(c,a){return s.js_beautify(c,a)};return _.js=s.js_beautify,_.css=e.css_beautify,_.html=n.html_beautify,_.js_beautify=s.js_beautify,_.css_beautify=e.css_beautify,_.html_beautify=n.html_beautify,_}(function(s){var e=Ee();e.js_beautify=e.js,e.css_beautify=e.css,e.html_beautify=e.html,s.exports=p(e,e,e)})(h)})(Q)),Q.exports}var Te=Oe();const Re=_e(Te);function ke({query:h}){const[p,s]=D.useState(!1),e=D.useMemo(()=>{try{return Re.js(h,{indent_size:2,space_in_empty_paren:!0,max_preserve_newlines:2})}catch{return h}},[h]),n=async()=>{try{await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),2e3)}catch(c){console.error("Failed to copy: ",c)}},_=D.useMemo(()=>pe(e),[e]);return N.jsxs("div",{className:"bg-neutral-50 dark:bg-slate-900 rounded-lg p-4 font-mono text-sm overflow-x-auto relative",children:[N.jsx("button",{onClick:n,className:`absolute top-3 right-3 p-2 rounded-md transition-colors ${p?"bg-green-100 text-green-600 dark:bg-green-900/30 dark:text-green-400":"bg-white text-neutral-500 hover:text-neutral-700 hover:bg-neutral-100 dark:bg-slate-800 dark:text-neutral-400 dark:hover:text-neutral-300 dark:hover:bg-slate-700"}`,title:p?"Copied!":"Copy to clipboard",children:p?N.jsx($t,{size:16}):N.jsx(qt,{size:16})}),N.jsx("pre",{className:"whitespace-pre-wrap pr-12 text-neutral-800 dark:text-neutral-200",children:_})]})}const Ne=({queryPayload:h})=>{switch(h.type){case"mongodb":return N.jsx(ke,{query:h.query});default:return N.jsx(ce,{sql:h.query})}};function Ae({query:h}){const p=[h.lens_entry_id&&{label:"Request",value:N.jsx(Ht,{to:`${Jt(Zt()).REQUESTS}/${h.lens_entry_id}`,className:"text-blue-600 hover:underline font-semibold",children:"View Request"}),className:"text-gray-900 dark:text-gray-100"},{label:"Time",value:N.jsx("span",{children:ne(h.data.createdAt)}),className:"text-gray-900 dark:text-gray-100"},{label:"Duration",value:N.jsx("span",{children:h.data.duration}),className:"text-gray-900 dark:text-gray-100"},{label:"Provider",value:N.jsx("span",{children:h.data.type}),className:"text-gray-900 dark:text-gray-100"}].filter(s=>!!s);return N.jsxs("div",{className:"flex flex-col gap-4",children:[" ",N.jsx(ie,{title:"Query Details",items:p}),N.jsx(se,{tabs:[{id:"query",data:["query"],label:"Query",content:N.jsx(Ne,{queryPayload:h.data})}],defaultActiveTab:"query"})]})}const Pe=()=>{const{query:h,fetchQuery:p}=ee(),{id:s}=te();return D.useEffect(()=>{s&&p(s)},[s]),N.jsx("div",{children:h&&N.jsx(Ae,{query:h})})};export{Pe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a}from"./index-
|
|
1
|
+
import{j as a}from"./index-PEcJ5nx0.js";import{L as s}from"./LoadMore-CJh7FLbl.js";import{T as r}from"./Table-BesHc4Lc.js";import{g as t}from"./columns-CULxhcpY.js";import"./index-BRRKsoNv.js";const n=({hasMoreObject:o})=>a.jsxs("div",{className:"w-full",children:[a.jsx("div",{className:"overflow-x-auto",children:a.jsx(r,{columns:t(),data:o.data})}),a.jsx(s,{paginatedPage:o})]});export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as n,j as e}from"./index-PEcJ5nx0.js";import{D as r,T as o}from"./TabbedDataViewer-BUMQ0QVm.js";import{T as d}from"./Table-BesHc4Lc.js";import{g as i}from"./columns-CULxhcpY.js";import{g as m}from"./columns-C1CwS8yE.js";import{g as u}from"./columns-gYFQU5qH.js";import{f as c}from"./index-BRRKsoNv.js";import{R as x,S as b}from"./StatusCode-C5lihzKZ.js";import"./CacheActionBadge-CK7JdKoE.js";const h=({request:a})=>{const t=n.useMemo(()=>c(a?.request.data?.createdAt),[a?.request.data.createdAt]);if(!a||!a.request)return e.jsx(r,{title:"Request Details",items:[],emptyMessage:"No request data available"});const s=()=>a?.request.data?.headers?.host||"Unknown",l=n.useMemo(()=>[{label:"Time",value:t,className:"text-gray-900 dark:text-gray-100"},{label:"Hostname",value:s(),className:"text-gray-900 dark:text-gray-100 font-mono"},{label:"Method",value:a.request.data.method?e.jsx(x,{method:a.request.data.method}):"Unknown"},{label:"Request ID",value:a.request.data.id||"N/A",className:"text-gray-700 dark:text-gray-300 font-mono text-sm"},{label:"Path",value:a.request.data.path||"N/A",className:"text-gray-900 dark:text-gray-100 font-mono"},{label:"Status",value:a.request.data.status?e.jsx(b,{status:a.request.data.status}):"N/A"},{label:"Duration",value:a.request.data.duration||"N/A",className:"text-gray-900 dark:text-gray-100 font-medium"},{label:"IP Address",value:a.request.data.ip||"N/A",className:"text-gray-900 dark:text-gray-100 font-mono"}],[a.request.data,t]);return e.jsx(r,{title:"Request Details",items:l})},A=({request:a})=>{const t=[{id:"payload",label:"Payload",data:a.request.data.body},{id:"headers",label:"Headers",data:a.request.data.headers}],s=[{id:"response-body",label:"Body",data:a.request.data.response.json},{id:"response-headers",label:"Headers",data:a.request.data.response.headers}],l=[{id:"request-queries",label:`Queries (${a.queries.length})`,shouldShow:a.queries.length>0,content:e.jsx(d,{columns:i(),data:a?.queries})},{id:"request-cache",label:`Cache (${a.cacheEntries.length})`,shouldShow:a.cacheEntries.length>0,content:e.jsx(d,{columns:u(),data:a.cacheEntries})},{id:"request-exceptions",label:`Exceptions (${a.exceptions.length})`,shouldShow:a.exceptions.length>0,content:e.jsx(d,{columns:m(),data:a.exceptions})}];return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(h,{request:a}),a.request.data.user&&e.jsx(r,{title:"User",items:[{label:"ID",value:a.request.data.user?.id},{label:"Email",value:a.request.data.user?.email},{label:"Name",value:a.request.data.user?.name}]}),e.jsx(o,{tabs:t,title:"Request Data",defaultActiveTab:"payload"}),e.jsx(o,{tabs:s,title:"Response Data",defaultActiveTab:"response-body"}),e.jsx(o,{tabs:l})]})};export{A as default};
|