This commit is contained in:
sidharthv96
2021-06-26 15:17:12 +00:00
parent 8e191f103b
commit 8da112a969
12 changed files with 26 additions and 9 deletions
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
var e=Object.defineProperty,a=Object.defineProperties,t=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,i=(a,t,r)=>t in a?e(a,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[t]=r,n=(e,a)=>{for(var t in a||(a={}))s.call(a,t)&&i(e,t,a[t]);if(r)for(var t of r(a))o.call(a,t)&&i(e,t,a[t]);return e},c=(e,r)=>a(e,t(r));import{a2 as l,a3 as d,C as p,a4 as u,Z as m,a6 as f,a9 as y,S as g,i as h,s as b,e as v,c as O,a as S,d as E,b as w,N as D,f as T,F as j,G as L,H as _,z as C,a8 as x,J}from"./vendor-954b7cab.js";import{_ as N}from"./preload-helper-9f12a5fd.js";let P;let A;const I=l(p({code:"graph TD\n A[Christmas] --\x3e|Get money| B(Go shopping)\n B --\x3e C{Let me think}\n C --\x3e|One| D[Laptop]\n C --\x3e|Two| E[iPhone]\n C --\x3e|Three| F[fa:fa-car Car]\n ",mermaid:JSON.stringify({theme:"default"},null,2),updateEditor:!1,autoSync:!0,updateDiagram:!0}),d(),"codeStore"),k=u([I],(([e],a)=>{a(m(JSON.stringify(e),!0))})),V=e=>{I.update((a=>n(n({},a),e)))};let G=!1;const R=(e,a,t=!1)=>{var r;r=e,P&&(clearTimeout(A),A=setTimeout((function(){const e=r.replace(/^\s*%%.*\n/g,"\n").trimStart().split(" ")[0];console.debug("ga:","send","event","render",e),P.track("render",{graphType:e})}),5e3));if((e.match(/\n/g)||"").length+1>50&&!G&&f(I).autoSync){const e=confirm("Long diagram deteced. Turn off Auto Sync? Click the sync logo to manually sync.");G=!0,e&&V({autoSync:!1})}I.update((r=>c(n({},r),{code:e,updateEditor:a,updateDiagram:t})))},$=(e,a)=>{I.update((t=>c(n({},t),{mermaid:e,updateEditor:a})))},z=()=>JSON.stringify(f(I)),B=p(void 0);function F(e){let a,t;return{c(){a=v("div"),t=v("div"),this.h()},l(e){a=O(e,"DIV",{id:!0,class:!0});var r=S(a);t=O(r,"DIV",{id:!0,class:!0}),S(t).forEach(E),r.forEach(E),this.h()},h(){w(t,"id","container"),w(t,"class","flex-1 overflow-auto"),w(a,"id","view"),w(a,"class","p-2 svelte-5ndy2s"),D(a,"error",e[1]),D(a,"outOfSync",e[2])},m(r,s){T(r,a,s),j(a,t),e[3](t)},p(e,[t]){2&t&&D(a,"error",e[1]),4&t&&D(a,"outOfSync",e[2])},i:L,o:L,d(t){t&&E(a),e[3](null)}}}function H(e,a,t){let r;_(e,I,(e=>t(7,r=e)));const s=window.mermaid;let o,i="",n="",c=!1,l=!1,d=!0;return C((()=>{I.subscribe((e=>{try{if(o&&e&&(e.updateDiagram||e.autoSync)){if(e.autoSync||x(I,r.updateDiagram=!1,r),t(2,l=!1),d=!0,i===e.code&&n===e.mermaid)return;i=e.code,n=e.mermaid;const a=o.parentElement.parentElement.parentElement.scrollTop;delete o.dataset.processed,s.initialize(Object.assign({},JSON.parse(e.mermaid))),s.render("graph-div",i,(e=>{t(0,o.innerHTML=e,o)})),t(0,o.parentElement.parentElement.parentElement.scrollTop=a,o),t(1,c=!1)}else d?d=!1:t(2,l=!0)}catch(a){console.log("view fail",a),t(1,c=!0)}})),B.subscribe((e=>{void 0===e?t(1,c=!1):(t(1,c=!0),console.log("Error: ",e))}))})),[o,c,l,function(e){J[e?"unshift":"push"]((()=>{o=e,t(0,o)}))}]}class M extends g{constructor(e){super(),h(this,e,H,F,b,{})}}const U=()=>{(e=>{let a;try{const t=y(e);console.log(`Tring to load state: ${t}`),a=JSON.parse(t);const r="string"==typeof a.mermaid?JSON.parse(a.mermaid):a.mermaid;r.securityLevel&&"strict"!==r.securityLevel&&confirm(`Removing "securityLevel":"${r.securityLevel}" from the config for safety.\nClick Cancel if you trust the source of this Diagram.`)&&delete r.securityLevel,a.mermaid=JSON.stringify(r,null,2)}catch(t){e&&console.error("Init error",t),a=f(I),console.log(a)}V(c(n({},a),{updateEditor:!0}))})(window.location.hash.slice(1))},Z=()=>{V({updateDiagram:!0})},q=async()=>{U(),Z(),k.subscribe((e=>{history.replaceState(void 0,void 0,`#${e}`)})),await(async()=>{if(!P)try{const{Analytics:e}=await N((()=>import("./analytics.browser.es-eaddcc60.js")),void 0),a=await N((()=>import("./analytics-plugin-ga.browser.es-1cdb0512.js")),void 0);P=e({app:"mermaid-live-editor",plugins:[a.init({trackingId:"UA-153180559-1"})]})}catch{console.info("Analytics blocked ;)")}})(),null==P||P.page()};export{M as V,P as a,k as b,I as c,$ as d,B as e,z as g,q as i,Z as s,R as u};
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
import{S as s,i as r,s as a,e as t,t as e,c as o,a as c,g as n,d as u,f as p,F as l,h as f,k as i,l as d,n as m,G as h}from"./chunks/vendor-954b7cab.js";function k(s){let r,a,i=s[1].stack+"";return{c(){r=t("pre"),a=e(i)},l(s){r=o(s,"PRE",{});var t=c(r);a=n(t,i),t.forEach(u)},m(s,t){p(s,r,t),l(r,a)},p(s,r){2&r&&i!==(i=s[1].stack+"")&&f(a,i)},d(s){s&&u(r)}}}function v(s){let r,a,v,E,g,x,b,P=s[1].message+"",$=s[1].stack&&k(s);return{c(){r=t("h1"),a=e(s[0]),v=i(),E=t("p"),g=e(P),x=i(),$&&$.c(),b=d()},l(t){r=o(t,"H1",{});var e=c(r);a=n(e,s[0]),e.forEach(u),v=m(t),E=o(t,"P",{});var p=c(E);g=n(p,P),p.forEach(u),x=m(t),$&&$.l(t),b=d()},m(s,t){p(s,r,t),l(r,a),p(s,v,t),p(s,E,t),l(E,g),p(s,x,t),$&&$.m(s,t),p(s,b,t)},p(s,[r]){1&r&&f(a,s[0]),2&r&&P!==(P=s[1].message+"")&&f(g,P),s[1].stack?$?$.p(s,r):($=k(s),$.c(),$.m(b.parentNode,b)):$&&($.d(1),$=null)},i:h,o:h,d(s){s&&u(r),s&&u(v),s&&u(E),s&&u(x),$&&$.d(s),s&&u(b)}}}function E({error:s,status:r}){return{props:{error:s,status:r}}}function g(s,r,a){let{status:t}=r,{error:e}=r;return s.$$set=s=>{"status"in s&&a(0,t=s.status),"error"in s&&a(1,e=s.error)},[t,e]}export default class extends s{constructor(s){super(),r(this,s,g,v,a,{status:0,error:1})}}export{E as load};
+1
View File
@@ -0,0 +1 @@
import{S as s,i as e,s as r,D as o,e as a,c,a as t,d as n,b as i,f as l,E as u,v as h,r as p,z as f}from"../chunks/vendor-954b7cab.js";import{b as $}from"../chunks/paths-45dac81d.js";function d(s){let e,r;const f=s[1].default,$=o(f,s,s[0],null);return{c(){e=a("main"),$&&$.c(),this.h()},l(s){e=c(s,"MAIN",{class:!0});var r=t(e);$&&$.l(r),r.forEach(n),this.h()},h(){i(e,"class","h-screen")},m(s,o){l(s,e,o),$&&$.m(e,null),r=!0},p(s,[e]){$&&$.p&&(!r||1&e)&&u($,f,s,s[0],r?e:-1,null,null)},i(s){r||(h($,s),r=!0)},o(s){p($,s),r=!1},d(s){s&&n(e),$&&$.d(s)}}}function v(s,e,r){let{$$slots:o={},$$scope:a}=e;return f((()=>{"serviceWorker"in navigator&&navigator.serviceWorker.register(`${$}/service-worker.js`,{scope:`${$}/`}).then((function(s){console.log("Registration successful, scope is:",s.scope)})).catch((function(s){console.log("Service worker registration failed, error:",s)}))})),s.$$set=s=>{"$$scope"in s&&r(0,a=s.$$scope)},[a,o]}export default class extends s{constructor(s){super(),e(this,s,v,d,r,{})}}
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
import{S as t,i as n,s as o,z as s}from"../chunks/vendor-954b7cab.js";import{r as e}from"../chunks/singletons-bb9012b7.js";import{b as i}from"../chunks/paths-45dac81d.js";const c=async function(t,n){return e.goto(t,n,[])};function a(t){var n=this&&this.__awaiter||function(t,n,o,s){return new(o||(o=Promise))((function(e,i){function c(t){try{r(s.next(t))}catch(n){i(n)}}function a(t){try{r(s.throw(t))}catch(n){i(n)}}function r(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(t){t(n)}))).then(c,a)}r((s=s.apply(t,n||[])).next())}))};return s((()=>n(void 0,void 0,void 0,(function*(){const t=window.location.hash.split("/");let n="edit";t.length>2&&(n=`${t[1]}#${t[2]}`),yield c(`${i}/${n}`,{replaceState:!0})})))),[]}export default class extends t{constructor(t){super(),n(this,t,a,null,o,{})}}
+1
View File
@@ -0,0 +1 @@
import{S as s,i as a,s as r,j as t,m as e,o as n,G as o,v as c,r as f,w as m,z as u}from"../chunks/vendor-954b7cab.js";import{V as i,i as p}from"../chunks/util-1bc8bcc1.js";import"../chunks/preload-helper-9f12a5fd.js";function $(s){let a,r;return a=new i({}),{c(){t(a.$$.fragment)},l(s){e(a.$$.fragment,s)},m(s,t){n(a,s,t),r=!0},p:o,i(s){r||(c(a.$$.fragment,s),r=!0)},o(s){f(a.$$.fragment,s),r=!1},d(s){m(a,s)}}}function l(s){return u(p),[]}export default class extends s{constructor(s){super(),a(this,s,l,$,r,{})}}
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -55,15 +55,15 @@
<link rel="modulepreload" href="/mermaid-live-editor/_app/start-8a056348.js">
<link rel="modulepreload" href="/mermaid-live-editor/_app/chunks/vendor-ad39e53d.js">
<link rel="modulepreload" href="/mermaid-live-editor/_app/start-1ccabd4f.js">
<link rel="modulepreload" href="/mermaid-live-editor/_app/chunks/vendor-954b7cab.js">
<link rel="modulepreload" href="/mermaid-live-editor/_app/chunks/preload-helper-9f12a5fd.js">
<link rel="modulepreload" href="/mermaid-live-editor/_app/chunks/singletons-bb9012b7.js">
<link rel="modulepreload" href="/mermaid-live-editor/_app/chunks/paths-45dac81d.js">
<link rel="stylesheet" href="/mermaid-live-editor/_app/assets/start-0826e215.css">
<script type="module">
import { start } from "/mermaid-live-editor/_app/start-8a056348.js";
import { start } from "/mermaid-live-editor/_app/start-1ccabd4f.js";
start({
target: document.querySelector("#svelte"),
paths: {"base":"/mermaid-live-editor","assets":"/mermaid-live-editor"},
+3 -3
View File
@@ -55,15 +55,15 @@
<link rel="modulepreload" href="/mermaid-live-editor/_app/start-8a056348.js">
<link rel="modulepreload" href="/mermaid-live-editor/_app/chunks/vendor-ad39e53d.js">
<link rel="modulepreload" href="/mermaid-live-editor/_app/start-1ccabd4f.js">
<link rel="modulepreload" href="/mermaid-live-editor/_app/chunks/vendor-954b7cab.js">
<link rel="modulepreload" href="/mermaid-live-editor/_app/chunks/preload-helper-9f12a5fd.js">
<link rel="modulepreload" href="/mermaid-live-editor/_app/chunks/singletons-bb9012b7.js">
<link rel="modulepreload" href="/mermaid-live-editor/_app/chunks/paths-45dac81d.js">
<link rel="stylesheet" href="/mermaid-live-editor/_app/assets/start-0826e215.css">
<script type="module">
import { start } from "/mermaid-live-editor/_app/start-8a056348.js";
import { start } from "/mermaid-live-editor/_app/start-1ccabd4f.js";
start({
target: document.querySelector("#svelte"),
paths: {"base":"/mermaid-live-editor","assets":"/mermaid-live-editor"},
+3 -3
View File
@@ -55,15 +55,15 @@
<link rel="modulepreload" href="/mermaid-live-editor/_app/start-8a056348.js">
<link rel="modulepreload" href="/mermaid-live-editor/_app/chunks/vendor-ad39e53d.js">
<link rel="modulepreload" href="/mermaid-live-editor/_app/start-1ccabd4f.js">
<link rel="modulepreload" href="/mermaid-live-editor/_app/chunks/vendor-954b7cab.js">
<link rel="modulepreload" href="/mermaid-live-editor/_app/chunks/preload-helper-9f12a5fd.js">
<link rel="modulepreload" href="/mermaid-live-editor/_app/chunks/singletons-bb9012b7.js">
<link rel="modulepreload" href="/mermaid-live-editor/_app/chunks/paths-45dac81d.js">
<link rel="stylesheet" href="/mermaid-live-editor/_app/assets/start-0826e215.css">
<script type="module">
import { start } from "/mermaid-live-editor/_app/start-8a056348.js";
import { start } from "/mermaid-live-editor/_app/start-1ccabd4f.js";
start({
target: document.querySelector("#svelte"),
paths: {"base":"/mermaid-live-editor","assets":"/mermaid-live-editor"},