deploy: 20e162cc6590f203de26c51b4c10873004391bbf
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
var e=Object.defineProperty,t=Object.defineProperties,a=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,i=(t,a,r)=>a in t?e(t,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[a]=r,n=(e,t)=>{for(var a in t||(t={}))o.call(t,a)&&i(e,a,t[a]);if(r)for(var a of r(t))s.call(t,a)&&i(e,a,t[a]);return e},c=(e,r)=>t(e,a(r));import{C as l,J as d,K as m,L as p,M as u,N as y,O as g}from"./vendor-e1627d60.js";import{_ as f}from"./preload-helper-c90670b7.js";const h=l({loading:!1}),O=async(e,t)=>{h.set({loading:!0,message:e});const a=await t;return h.set({loading:!1}),a};let b;const v=async()=>{if(!b)try{const{Analytics:e}=await f((()=>import("./analytics.browser.es-afad5c8e.js")),[]),t=await f((()=>import("./analytics-plugin-ga.browser.es-1cdb0512.js")),[]);b=e({app:"mermaid-live-editor",plugins:[t.init({trackingId:"UA-153180559-1"})]})}catch{console.info("Analytics blocked ;)")}};let S;const j={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},E=d(l(j),m(),"codeStore"),L=p([E],(([e],t)=>{t(u(JSON.stringify(e),!0))})),_=e=>{let t;try{const a=g(e);console.log(`Trying to load state: ${a}`),t=JSON.parse(a);const r="string"==typeof t.mermaid?JSON.parse(t.mermaid):t.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,t.mermaid=JSON.stringify(r,null,2)}catch(a){e&&console.error("Init error",a),t=y(E),console.log(t)}w(c(n({},t),{updateEditor:!0}))},w=e=>{E.update((t=>n(n({},t),e)))};let C=!1;const T=(e,t,a=!1)=>{var r;r=e,b&&(clearTimeout(S),S=setTimeout((function(){const e=r.replace(/^\s*%%.*\n/g,"\n").trimStart().split(" ")[0];console.debug("ga:","send","event","render",e),b.track("render",{graphType:e})}),5e3));if((e.match(/\n/g)||"").length+1>50&&!C&&y(E).autoSync){const e=confirm("Long diagram detected. Turn off Auto Sync? Click the sync logo to manually sync.");C=!0,e&&w({autoSync:!1})}E.update((r=>c(n({},r),{code:e,updateEditor:t,updateDiagram:a})))},k=(e,t)=>{E.update((a=>c(n({},a),{mermaid:e,updateEditor:t})))},J=e=>{E.update((t=>{const a=JSON.parse(t.mermaid);return a.theme&&!["dark","default"].includes(a.theme)||(a.theme=e?"dark":"default"),c(n({},t),{mermaid:JSON.stringify(a,null,2),updateEditor:!0})}))},N=()=>{L.subscribe((e=>{history.replaceState(void 0,void 0,`#${e}`)}))},D=()=>JSON.stringify(y(E));export{b as a,L as b,E as c,k as d,j as e,w as f,D as g,N as h,O as i,v as j,_ as k,h as l,J as t,T as u};
|
||||
@@ -0,0 +1 @@
|
||||
import{J as e,K as s,C as t}from"./vendor-e1627d60.js";const a=e(t({isDark:!1,theme:""}),s(),"themeStore"),o=["dark","synthwave","halloween","aqua","forest","luxury","black","dracula"],r=e=>{e.includes(" ")&&(e=e.split(" ")[1].trim());const s=o.includes(e);console.log("Setting theme",e),a.set({theme:e,isDark:s})};export{r as s,a as t};
|
||||
@@ -0,0 +1 @@
|
||||
var t=Object.defineProperty,a=Object.defineProperties,e=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,i=(a,e,o)=>e in a?t(a,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):a[e]=o,n=(t,a)=>{for(var e in a||(a={}))s.call(a,e)&&i(t,e,a[e]);if(o)for(var e of o(a))r.call(a,e)&&i(t,e,a[e]);return t},c=(t,o)=>a(t,e(o));import{C as l,S as d,i as u,s as p,e as f,c as m,a as h,d as g,b as y,Z as w,f as v,E as b,P as j,I as O,A as S,ab as x,ac as D,R as E,J as $,K as P,L as I,ad as L,N as H}from"./vendor-e1627d60.js";import{c as R,e as T,f as J,i as N,h as U,j as V,a as _,k}from"./state-3d886ed7.js";const M=l(void 0);function z(t){let a,e;return{c(){a=f("div"),e=f("div"),this.h()},l(t){a=m(t,"DIV",{id:!0,class:!0});var o=h(a);e=m(o,"DIV",{id:!0,class:!0}),h(e).forEach(g),o.forEach(g),this.h()},h(){y(e,"id","container"),y(e,"class","flex-1 overflow-auto"),y(a,"id","view"),y(a,"class","p-2 svelte-5ndy2s"),w(a,"error",t[2]),w(a,"outOfSync",t[3])},m(o,s){v(o,a,s),b(a,e),t[4](e),t[5](a)},p(t,[e]){4&e&&w(a,"error",t[2]),8&e&&w(a,"outOfSync",t[3])},i:j,o:j,d(e){e&&g(a),t[4](null),t[5](null)}}}function A(t,a,e){let o;O(t,R,(t=>e(9,o=t)));let s,r,i="",n="",c=!1,l=!1,d=!0;return S((()=>{R.subscribe((t=>{try{if(s&&t&&(t.updateDiagram||t.autoSync)){if(t.autoSync||x(R,o.updateDiagram=!1,o),e(3,l=!1),d=!0,i===t.code&&n===t.mermaid)return;i=t.code,n=t.mermaid;const a=r.parentElement.scrollTop;delete s.dataset.processed,D.exports.initialize(Object.assign({},JSON.parse(t.mermaid))),D.exports.render("graph-div",i,(t=>{e(0,s.innerHTML=t,s)})),e(1,r.parentElement.scrollTop=a,r),e(2,c=!1)}else d?d=!1:e(3,l=!0)}catch(a){console.log("view fail",a),e(2,c=!0)}})),M.subscribe((t=>{void 0===t?e(2,c=!1):(e(2,c=!0),console.log("Error: ",t))}))})),[s,r,c,l,function(t){E[t?"unshift":"push"]((()=>{s=t,e(0,s)}))},function(t){E[t?"unshift":"push"]((()=>{r=t,e(1,r)}))}]}class C extends d{constructor(t){super(),u(this,t,A,z,p,{})}}const G=$(l("manual"),P(),"autoHistoryMode"),K=$(l([]),P(),"autoHistoryStore"),Z=$(l([]),P(),"manualHistoryStore"),q=l([]),B=I([G,K,Z,q],(([t,a,e,o],s)=>{s("auto"===t?a:"manual"===t?e:"loader"===t?o:a)})),F=t=>{"loader"!==t.type?(t.name=L(2),"auto"===t.type?K.update((a=>(30===a.length&&a.pop(),[t,...a]))):Z.update((a=>[t,...a]))):q.update((a=>[t,...a]))},Q=t=>{("auto"===H(G)?K:Z).update((a=>("loader"!==H(G)&&(a=a.filter((a=>t&&a.time!=t))),a)))},W=t=>{const a=H(t?K:Z);return a.length>0?JSON.stringify(a[0].state):""},X=async t=>t.truncated?await(await fetch(t.raw_url)).text():t.content,Y=async t=>{const[a,e,o,s]=t.split("github.com").pop().split("/"),{html_url:r,files:i,history:n}=await(await fetch(`https://api.github.com/gists/${o}${s?"/"+s:""}`)).json();if((t=>"code.mmd"in t)(i)){const t=await X(i["code.mmd"]);let a;"config.json"in i&&(a=await X(i["config.json"]));const e=n[0];return{url:`${r}/${e.version}`,code:t,config:a,author:e.user.login,time:new Date(e.committed_at).getTime(),version:e.version.slice(-7)}}throw"Invalid gist provided"},tt=(t,a=t.url)=>{const e=c(n({},T),{code:t.code,loader:{type:"gist",config:{url:a}}});return t.config&&(e.mermaid=t.config),e},at={gist:async t=>{try{const[a,e,o,s]=t.split("github.com").pop().split("/"),{history:r}=await(await fetch(`https://api.github.com/gists/${o}${s?"/"+s:""}`)).json(),i=[];for(const t of r){const a=await Y(t.url).catch((()=>{}));a&&i.push(a)}if(0===i.length)throw"Invalid gist provided";i.reverse();const n=tt(i.slice(-1).pop(),t);for(const t of i)F({state:tt(t),time:t.time,type:"loader",url:t.url,name:`${t.author} v${t.version}`});return n}catch(a){console.error(a)}}},et=()=>{J({updateDiagram:!0})},ot=async()=>{var t;k(window.location.hash.slice(1)),await N("Loading Gist...",(async()=>{const t=new URLSearchParams(window.location.search);let a,e,o=T,s=!1;const r=t.get("code"),i=t.get("config");if(r&&(a=await(await fetch(r)).text(),s=!0),e=i?await(await fetch(i)).text():T.mermaid,a)o={code:a,mermaid:e,loader:{type:"files",config:{codeURL:r,configURL:i}}};else for(const[n,c]of t.entries())if(n in at)try{o=await at[n](c),s=!0;break}catch(l){console.error(l)}s&&J(c(n({},o),{autoSync:!0,updateDiagram:!0,updateEditor:!0}))})().catch(console.error)),et(),U(),await V(),null==(t=_)||t.page()};export{C as V,B as a,F as b,Q as c,M as e,W as g,G as h,ot as i,q as l,et as s};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{S as r,i as s,s as a,e as t,t as e,c as n,a as c,g as o,d as u,f,E as l,h as m,k as p,l as d,n as i,P as h}from"./chunks/vendor-e1627d60.js";function E(r){let s,a,p=r[1].frame+"";return{c(){s=t("pre"),a=e(p)},l(r){s=n(r,"PRE",{});var t=c(s);a=o(t,p),t.forEach(u)},m(r,t){f(r,s,t),l(s,a)},p(r,s){2&s&&p!==(p=r[1].frame+"")&&m(a,p)},d(r){r&&u(s)}}}function k(r){let s,a,p=r[1].stack+"";return{c(){s=t("pre"),a=e(p)},l(r){s=n(r,"PRE",{});var t=c(s);a=o(t,p),t.forEach(u)},m(r,t){f(r,s,t),l(s,a)},p(r,s){2&s&&p!==(p=r[1].stack+"")&&m(a,p)},d(r){r&&u(s)}}}function v(r){let s,a,v,P,g,R,x,N,$=r[1].message+"",j=r[1].frame&&E(r),H=r[1].stack&&k(r);return{c(){s=t("h1"),a=e(r[0]),v=p(),P=t("pre"),g=e($),R=p(),j&&j.c(),x=p(),H&&H.c(),N=d()},l(t){s=n(t,"H1",{});var e=c(s);a=o(e,r[0]),e.forEach(u),v=i(t),P=n(t,"PRE",{});var f=c(P);g=o(f,$),f.forEach(u),R=i(t),j&&j.l(t),x=i(t),H&&H.l(t),N=d()},m(r,t){f(r,s,t),l(s,a),f(r,v,t),f(r,P,t),l(P,g),f(r,R,t),j&&j.m(r,t),f(r,x,t),H&&H.m(r,t),f(r,N,t)},p(r,[s]){1&s&&m(a,r[0]),2&s&&$!==($=r[1].message+"")&&m(g,$),r[1].frame?j?j.p(r,s):(j=E(r),j.c(),j.m(x.parentNode,x)):j&&(j.d(1),j=null),r[1].stack?H?H.p(r,s):(H=k(r),H.c(),H.m(N.parentNode,N)):H&&(H.d(1),H=null)},i:h,o:h,d(r){r&&u(s),r&&u(v),r&&u(P),r&&u(R),j&&j.d(r),r&&u(x),H&&H.d(r),r&&u(N)}}}function P({error:r,status:s}){return{props:{error:r,status:s}}}function g(r,s,a){let{status:t}=s,{error:e}=s;return r.$$set=r=>{"status"in r&&a(0,t=r.status),"error"in r&&a(1,e=r.error)},[t,e]}class R extends r{constructor(r){super(),s(this,r,g,v,a,{status:0,error:1})}}export{R as default,P as load};
|
||||
@@ -0,0 +1 @@
|
||||
import{S as s,i as e,s as a,D as t,e as r,k as o,t as c,c as l,a as n,d as i,n as d,g as h,b as m,f as u,E as p,h as f,l as g,F as v,G as k,H as $,x as b,u as x,I as j,A as E}from"../chunks/vendor-e1627d60.js";import{b as y}from"../chunks/paths-45dac81d.js";import{l as D,t as I}from"../chunks/state-3d886ed7.js";import{t as w,s as V}from"../chunks/theme-58d4242d.js";import"../chunks/preload-helper-c90670b7.js";function A(s){let e,a,t,g,v,k,$=s[0].message+"";return{c(){e=r("div"),a=r("div"),t=r("div"),g=o(),v=r("div"),k=c($),this.h()},l(s){e=l(s,"DIV",{class:!0});var r=n(e);a=l(r,"DIV",{class:!0});var o=n(a);t=l(o,"DIV",{class:!0}),n(t).forEach(i),g=d(o),v=l(o,"DIV",{});var c=n(v);k=h(c,$),c.forEach(i),o.forEach(i),r.forEach(i),this.h()},h(){m(t,"class","loader mx-auto svelte-1ub1m40"),m(a,"class","text-indigo-100 text-4xl font-bold my-auto"),m(e,"class","w-screen h-screen z-50 absolute left-0 top-0 bg-gray-600 opacity-50 flex align-middle justify-center")},m(s,r){u(s,e,r),p(e,a),p(a,t),p(a,g),p(a,v),p(v,k)},p(s,e){1&e&&$!==($=s[0].message+"")&&f(k,$)},d(s){s&&i(e)}}}function N(s){let e,a,c,h;const p=s[2].default,f=t(p,s,s[1],null);let j=s[0].loading&&A(s);return{c(){e=r("main"),f&&f.c(),a=o(),j&&j.c(),c=g(),this.h()},l(s){e=l(s,"MAIN",{class:!0});var t=n(e);f&&f.l(t),t.forEach(i),a=d(s),j&&j.l(s),c=g(),this.h()},h(){m(e,"class","h-screen text-primary-content")},m(s,t){u(s,e,t),f&&f.m(e,null),u(s,a,t),j&&j.m(s,t),u(s,c,t),h=!0},p(s,[e]){f&&f.p&&(!h||2&e)&&v(f,p,s,s[1],h?$(p,s[1],e,null):k(s[1]),null),s[0].loading?j?j.p(s,e):(j=A(s),j.c(),j.m(c.parentNode,c)):j&&(j.d(1),j=null)},i(s){h||(b(f,s),h=!0)},o(s){x(f,s),h=!1},d(s){s&&i(e),f&&f.d(s),s&&i(a),j&&j.d(s),s&&i(c)}}}function M(s,e,a){let t,r;j(s,w,(s=>a(3,t=s))),j(s,D,(s=>a(0,r=s)));let{$$slots:o={},$$scope:c}=e;return E((()=>{"serviceWorker"in navigator&&navigator.serviceWorker.register(`${y}/service-worker.js`,{scope:`${y}/`}).then((function(s){console.log("Registration successful, scope is:",s.scope)})).catch((function(s){console.log("Service worker registration failed, error:",s)}));window.matchMedia("(prefers-color-scheme: dark)").matches&&""===t.theme&&V("dark"),w.subscribe((({theme:s,isDark:e})=>{s&&(document.getElementsByTagName("html")[0].setAttribute("data-theme",s),I(e))}))})),s.$$set=s=>{"$$scope"in s&&a(1,c=s.$$scope)},[r,c,o]}class S extends s{constructor(s){super(),e(this,s,M,N,a,{})}}export{S as default};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{S as t,i as n,s as o,A as s}from"../chunks/vendor-e1627d60.js";import{r as e}from"../chunks/singletons-12a22614.js";import{b as i}from"../chunks/paths-45dac81d.js";const a=async function(t,n){return e.goto(t,n,[])};function c(t){var n=this&&this.__awaiter||function(t,n,o,s){return new(o||(o=Promise))((function(e,i){function a(t){try{r(s.next(t))}catch(n){i(n)}}function c(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(a,c)}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 a(`${i}/${n}`,{replaceState:!0})})))),[]}class r extends t{constructor(t){super(),n(this,t,c,null,o,{})}}export{r as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{S as s,i as a,s as t,j as r,m as e,o as n,P as o,x as u,u as c,v as m,A as i}from"../chunks/vendor-e1627d60.js";import{V as d,i as f}from"../chunks/util-9583c11d.js";import"../chunks/state-3d886ed7.js";import"../chunks/preload-helper-c90670b7.js";function p(s){let a,t;return a=new d({}),{c(){r(a.$$.fragment)},l(s){e(a.$$.fragment,s)},m(s,r){n(a,s,r),t=!0},p:o,i(s){t||(u(a.$$.fragment,s),t=!0)},o(s){c(a.$$.fragment,s),t=!1},d(s){m(a,s)}}}function $(s){return i(f),[]}class l extends s{constructor(s){super(),a(this,s,$,p,t,{})}}export{l as default};
|
||||
File diff suppressed because one or more lines are too long
@@ -50,15 +50,15 @@
|
||||
|
||||
|
||||
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/beta/_app/start-3dbacb02.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/beta/_app/chunks/vendor-559fd8dc.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/beta/_app/start-81790e08.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/beta/_app/chunks/vendor-e1627d60.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/beta/_app/chunks/preload-helper-c90670b7.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/beta/_app/chunks/singletons-12a22614.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/beta/_app/chunks/paths-45dac81d.js">
|
||||
<link rel="stylesheet" href="/mermaid-live-editor/beta/_app/assets/start-464e9d0a.css">
|
||||
|
||||
<script type="module">
|
||||
import { start } from "/mermaid-live-editor/beta/_app/start-3dbacb02.js";
|
||||
import { start } from "/mermaid-live-editor/beta/_app/start-81790e08.js";
|
||||
start({
|
||||
target: document.querySelector("#svelte"),
|
||||
paths: {"base":"/mermaid-live-editor/beta","assets":"/mermaid-live-editor/beta"},
|
||||
|
||||
+3
-3
@@ -50,15 +50,15 @@
|
||||
|
||||
|
||||
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/beta/_app/start-3dbacb02.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/beta/_app/chunks/vendor-559fd8dc.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/beta/_app/start-81790e08.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/beta/_app/chunks/vendor-e1627d60.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/beta/_app/chunks/preload-helper-c90670b7.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/beta/_app/chunks/singletons-12a22614.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/beta/_app/chunks/paths-45dac81d.js">
|
||||
<link rel="stylesheet" href="/mermaid-live-editor/beta/_app/assets/start-464e9d0a.css">
|
||||
|
||||
<script type="module">
|
||||
import { start } from "/mermaid-live-editor/beta/_app/start-3dbacb02.js";
|
||||
import { start } from "/mermaid-live-editor/beta/_app/start-81790e08.js";
|
||||
start({
|
||||
target: document.querySelector("#svelte"),
|
||||
paths: {"base":"/mermaid-live-editor/beta","assets":"/mermaid-live-editor/beta"},
|
||||
|
||||
@@ -50,15 +50,15 @@
|
||||
|
||||
|
||||
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/beta/_app/start-3dbacb02.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/beta/_app/chunks/vendor-559fd8dc.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/beta/_app/start-81790e08.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/beta/_app/chunks/vendor-e1627d60.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/beta/_app/chunks/preload-helper-c90670b7.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/beta/_app/chunks/singletons-12a22614.js">
|
||||
<link rel="modulepreload" href="/mermaid-live-editor/beta/_app/chunks/paths-45dac81d.js">
|
||||
<link rel="stylesheet" href="/mermaid-live-editor/beta/_app/assets/start-464e9d0a.css">
|
||||
|
||||
<script type="module">
|
||||
import { start } from "/mermaid-live-editor/beta/_app/start-3dbacb02.js";
|
||||
import { start } from "/mermaid-live-editor/beta/_app/start-81790e08.js";
|
||||
start({
|
||||
target: document.querySelector("#svelte"),
|
||||
paths: {"base":"/mermaid-live-editor/beta","assets":"/mermaid-live-editor/beta"},
|
||||
|
||||
Reference in New Issue
Block a user