From d590d27c7483e4a1999cb353d12686289c10a0a2 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 22 May 2021 19:12:08 +0000 Subject: [PATCH] Release 1.22.10 --- docs/_app/pages/edit.svelte-19fcd0a0.js | 1 + docs/_app/start-6a449612.js | 1 + docs/edit/index.html | 4 ++-- docs/index.html | 4 ++-- docs/view/index.html | 4 ++-- package.json | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 docs/_app/pages/edit.svelte-19fcd0a0.js create mode 100644 docs/_app/start-6a449612.js diff --git a/docs/_app/pages/edit.svelte-19fcd0a0.js b/docs/_app/pages/edit.svelte-19fcd0a0.js new file mode 100644 index 00000000..2aa27474 --- /dev/null +++ b/docs/_app/pages/edit.svelte-19fcd0a0.js @@ -0,0 +1 @@ +import{S as e,i as t,s as a,e as n,c as s,a as l,d as o,b as i,f as r,G as c,I as h,z as d,J as f,k as u,t as m,n as g,g as p,F as v,K as $,L as w,M as x,N as b,O as E,P as y,Q as k,h as I,R as D,T as C,U as O,v as T,B as S,r as A,u as M,V,D as _,E as R,j as N,m as L,o as P,W as U,w as B,X as j,Y as G,Z as H,_ as Y,$ as z,a0 as J,a1 as q,a2 as F,a3 as K,C as Z,a4 as W,a5 as Q,a6 as X,a7 as ee,H as te,a8 as ae}from"../chunks/vendor-a9bf48e1.js";import{u as ne,b as se,c as le,g as oe,V as ie,e as re,i as ce,s as he,a as de}from"../chunks/util-bfd89a15.js";import{g as fe}from"../chunks/navigation-20968cc5.js";import"../chunks/singletons-bb9012b7.js";function ue(e){let t;return{c(){t=n("div"),this.h()},l(e){t=s(e,"DIV",{class:!0}),l(t).forEach(o),this.h()},h(){i(t,"class","overflow-hidden")},m(a,n){r(a,t,n),e[7](t)},p:c,i:c,o:c,d(a){a&&o(t),e[7](null)}}}function me(e,t,a){var n=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(s,l){function o(e){try{r(n.next(e))}catch(t){l(t)}}function i(e){try{r(n.throw(e))}catch(t){l(t)}}function r(e){var t;e.done?s(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(o,i)}r((n=n.apply(e,t||[])).next())}))};let s,l,o=null,{text:i}=t,{language:r}=t,{editorOptions:c={value:i,language:r,scrollBeyondLastLine:!1,minimap:{enabled:!1},overviewRulerLanes:0}}=t,{errorMarkers:u=[]}=t;const m=h();return d((()=>n(void 0,void 0,void 0,(function*(){var e;a(6,l=monaco),(e=l).languages.register({id:"mermaid"}),e.languages.setMonarchTokensProvider("mermaid",{typeKeywords:["graph","stateDiagram","sequenceDiagram","classDiagram","pie","flowchart","gantt"],keywords:["patricipant","as"],arrows:["---","===","--\x3e","==>"],tokenizer:{root:[[/[{}]/,"delimiter.bracket"],[/[a-z_$][\w$]*/,{cases:{"@typeKeywords":"keyword","@keywords":"keyword"}}],[/[-=>ox]+/,{cases:{"@arrows":"transition"}}],[/[\[\{\(}]+.+?[\)\]\}]+/,"string"],[/\".*\"/,"string"]]},whitespace:[[/[ \t\r\n]+/,"white"],[/\%\%.*$/,"comment"]]}),e.editor.defineTheme("myCoolTheme",{base:"vs",inherit:!1,rules:[{token:"keyword",foreground:"880000",fontStyle:"bold"},{token:"custom-error",foreground:"ff0000",fontStyle:"bold"},{token:"string",foreground:"AA8500"},{token:"transition",foreground:"008800",fontStyle:"bold"},{token:"delimiter.bracket",foreground:"000000",fontStyle:"bold"}]}),e.languages.registerCompletionItemProvider("mermaid",{provideCompletionItems:()=>({suggestions:[{label:"simpleText",kind:e.languages.CompletionItemKind.Text,insertText:"simpleText"},{label:"testing",kind:e.languages.CompletionItemKind.Keyword,insertText:"testing(${1:condition})",insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"ifelse",kind:e.languages.CompletionItemKind.Snippet,insertText:["if (${1:condition}) {","\t$0","} else {","\t","}"].join("\n"),insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"If-Else Statement"}]})}),a(5,s=l.editor.create(o,c)),s.onDidChangeModelContent((()=>n(void 0,void 0,void 0,(function*(){m("update",{text:s.getValue()})}))));return new ResizeObserver((e=>{s.layout({height:e[0].contentRect.height,width:e[0].contentRect.width})})).observe(o.parentElement),()=>{s.dispose()}})))),e.$$set=e=>{"text"in e&&a(1,i=e.text),"language"in e&&a(2,r=e.language),"editorOptions"in e&&a(3,c=e.editorOptions),"errorMarkers"in e&&a(4,u=e.errorMarkers)},e.$$.update=()=>{100&e.$$.dirty&&(null==l||l.editor.setModelLanguage(s.getModel(),r)),34&e.$$.dirty&&(null==s||s.setValue(i)),112&e.$$.dirty&&(null==l||l.editor.setModelMarkers(s.getModel(),"test",u))},[o,i,r,c,u,s,l,function(e){f[e?"unshift":"push"]((()=>{o=e,a(0,o)}))}]}class ge extends e{constructor(e){super(),t(this,e,me,ue,a,{text:1,language:2,editorOptions:3,errorMarkers:4})}}function pe(e,t,a){const n=e.slice();return n[1]=t[a].title,n[2]=t[a].href,n[3]=t[a].icon,n}function ve(e){let t,a,h,d,f,$=e[1]+"",w=e[3]&&function(e){let t;return{c(){t=n("i"),this.h()},l(e){t=s(e,"I",{class:!0}),l(t).forEach(o),this.h()},h(){i(t,"class",b(e[3])+" svelte-1q1rl80")},m(e,a){r(e,t,a)},p:c,d(e){e&&o(t)}}}(e);return{c(){t=n("li"),a=n("a"),w&&w.c(),h=u(),d=m($),f=u(),this.h()},l(e){t=s(e,"LI",{});var n=l(t);a=s(n,"A",{class:!0,target:!0,href:!0});var i=l(a);w&&w.l(i),h=g(i),d=p(i,$),i.forEach(o),f=g(n),n.forEach(o),this.h()},h(){i(a,"class","nav-btn svelte-1q1rl80"),i(a,"target","_blank"),i(a,"href",e[2])},m(e,n){r(e,t,n),v(t,a),w&&w.m(a,null),v(a,h),v(a,d),v(t,f)},p(e,t){e[3]&&w.p(e,t)},d(e){e&&o(t),w&&w.d()}}}function $e(e){let t,a,h,d,f,b,E,y,k,I,D,C,O,T,S,A,M,V,_,R,N=e[0],L=[];for(let n=0;n{a||(a=C(t,O,{},!0)),a.run(1)})),c=!0)},o(e){a||(a=C(t,O,{},!1)),a.run(0),c=!1},d(e){e&&o(t),x(d,e),e&&a&&a.end()}}}function ke(e){let t,a,c,h,d,f,$,w,x,E,D=e[10].title+"";function C(){return e[7](e[10])}return{c(){t=n("li"),a=n("div"),c=n("i"),d=u(),f=m(D),w=u(),this.h()},l(e){t=s(e,"LI",{class:!0});var n=l(t);a=s(n,"DIV",{class:!0});var i=l(a);c=s(i,"I",{class:!0}),l(c).forEach(o),d=g(i),f=p(i,D),i.forEach(o),w=g(n),n.forEach(o),this.h()},h(){i(c,"class",h=b(e[10].icon)+" svelte-1j9xzww"),i(a,"class",$="text cursor-pointer font-semibold min-w-16 w-auto px-2 py-1 -mb-4 rounded-t block leading-normal "+(e[4]===e[10].id?"text-indigo-500 bg-white border-white":"text-white bg-indigo-500 border-indigo-500 hover:bg-indigo-600")),i(t,"class","mr-2 last:mr-0 w-28 flex-auto text-center")},m(e,n){r(e,t,n),v(t,a),v(a,c),v(a,d),v(a,f),v(t,w),x||(E=y(a,"click",k(C)),x=!0)},p(t,n){e=t,4&n&&h!==(h=b(e[10].icon)+" svelte-1j9xzww")&&i(c,"class",h),4&n&&D!==(D=e[10].title+"")&&I(f,D),20&n&&$!==($="text cursor-pointer font-semibold min-w-16 w-auto px-2 py-1 -mb-4 rounded-t block leading-normal "+(e[4]===e[10].id?"text-indigo-500 bg-white border-white":"text-white bg-indigo-500 border-indigo-500 hover:bg-indigo-600"))&&i(a,"class",$)},d(e){e&&o(t),x=!1,E()}}}function Ie(e){let t,a,c,h,d,f,$,w,x=e[1]&&Ee(e),b=e[0]&&e[2]&&ye(e);return{c(){t=n("div"),a=n("span"),x&&x.c(),c=u(),h=m(e[3]),d=u(),b&&b.c(),this.h()},l(n){t=s(n,"DIV",{class:!0});var i=l(t);a=s(i,"SPAN",{class:!0});var r=l(a);x&&x.l(r),c=g(r),h=p(r,e[3]),r.forEach(o),d=g(i),b&&b.l(i),i.forEach(o),this.h()},h(){i(a,"class","text-white mr-2 font-semibold"),i(t,"class","flex cursor-default")},m(n,s){r(n,t,s),v(t,a),x&&x.m(a,null),v(a,c),v(a,h),v(t,d),b&&b.m(t,null),f=!0,$||(w=y(a,"click",k(e[6])),$=!0)},p(e,[n]){e[1]?x?x.p(e,n):(x=Ee(e),x.c(),x.m(a,c)):x&&(x.d(1),x=null),(!f||8&n)&&I(h,e[3]),e[0]&&e[2]?b?(b.p(e,n),5&n&&T(b,1)):(b=ye(e),b.c(),T(b,1),b.m(t,null)):b&&(S(),A(b,1,1,(()=>{b=null})),M())},i(e){f||(T(b),f=!0)},o(e){A(b),f=!1},d(e){e&&o(t),x&&x.d(),b&&b.d(),$=!1,w()}}}function De(e,t,a){var n;let{isCloseable:s=!0}=t,{tabs:l=[]}=t,{title:o}=t,{isOpen:i=!1}=t,r=null===(n=l[0])||void 0===n?void 0:n.id;const c=h(),d=e=>{a(4,r=e.id),c("select",e)};return e.$$set=e=>{"isCloseable"in e&&a(1,s=e.isCloseable),"tabs"in e&&a(2,l=e.tabs),"title"in e&&a(3,o=e.title),"isOpen"in e&&a(0,i=e.isOpen)},[i,s,l,o,r,d,()=>a(0,i=!i),e=>d(e)]}class Ce extends e{constructor(e){super(),t(this,e,De,Ie,a,{isCloseable:1,tabs:2,title:3,isOpen:0})}}const Oe=e=>({}),Te=e=>({});function Se(e){let t,a,c;const h=e[5].default,d=_(h,e,e[4],null);return{c(){t=n("div"),d&&d.c(),this.h()},l(e){t=s(e,"DIV",{class:!0});var a=l(t);d&&d.l(a),a.forEach(o),this.h()},h(){i(t,"class","flex-grow overflow-auto")},m(e,a){r(e,t,a),d&&d.m(t,null),c=!0},p(e,t){d&&d.p&&(!c||16&t)&&R(d,h,e,e[4],t,null,null)},i(e){c||(T(d,e),D((()=>{a||(a=C(t,j,{},!0)),a.run(1)})),c=!0)},o(e){A(d,e),a||(a=C(t,j,{},!1)),a.run(0),c=!1},d(e){e&&o(t),d&&d.d(e),e&&a&&a.end()}}}function Ae(e){let t,a,c,h,d,m,p,$,w,x,b;function E(t){e[6](t)}let k={tabs:e[2],title:e[3],isCloseable:e[1]};void 0!==e[0]&&(k.isOpen=e[0]),h=new Ce({props:k}),f.push((()=>V(h,"isOpen",E))),h.$on("select",e[7]);const I=e[5].actions,D=_(I,e,e[4],Te);let C=e[0]&&Se(e);return{c(){t=n("div"),a=n("div"),c=n("div"),N(h.$$.fragment),m=u(),p=n("div"),D&&D.c(),$=u(),C&&C.c(),this.h()},l(e){t=s(e,"DIV",{class:!0});var n=l(t);a=s(n,"DIV",{class:!0});var i=l(a);c=s(i,"DIV",{class:!0});var r=l(c);L(h.$$.fragment,r),m=g(r),p=s(r,"DIV",{class:!0});var d=l(p);D&&D.l(d),d.forEach(o),r.forEach(o),i.forEach(o),$=g(n),C&&C.l(n),n.forEach(o),this.h()},h(){i(p,"class","flex gap-x-4 items-center text-white"),i(c,"class","flex justify-between"),i(a,"class","bg-indigo-400 border-gray-400 p-2 flex-none"),i(t,"class","bg-white rounded overflow-hidden shadow m-2 flex-grow flex flex-col ")},m(n,s){r(n,t,s),v(t,a),v(a,c),P(h,c,null),v(c,m),v(c,p),D&&D.m(p,null),v(t,$),C&&C.m(t,null),w=!0,x||(b=y(a,"click",e[8]),x=!0)},p(e,[a]){const n={};4&a&&(n.tabs=e[2]),8&a&&(n.title=e[3]),2&a&&(n.isCloseable=e[1]),!d&&1&a&&(d=!0,n.isOpen=e[0],U((()=>d=!1))),h.$set(n),D&&D.p&&(!w||16&a)&&R(D,I,e,e[4],a,Oe,Te),e[0]?C?(C.p(e,a),1&a&&T(C,1)):(C=Se(e),C.c(),T(C,1),C.m(t,null)):C&&(S(),A(C,1,1,(()=>{C=null})),M())},i(e){w||(T(h.$$.fragment,e),T(D,e),T(C),w=!0)},o(e){A(h.$$.fragment,e),A(D,e),A(C),w=!1},d(e){e&&o(t),B(h),D&&D.d(e),C&&C.d(),x=!1,b()}}}function Me(e,t,a){let{$$slots:n={},$$scope:s}=t,{isCloseable:l=!0}=t,{isOpen:o=!0}=t,{tabs:i=[]}=t,{title:r}=t;return e.$$set=e=>{"isCloseable"in e&&a(1,l=e.isCloseable),"isOpen"in e&&a(0,o=e.isOpen),"tabs"in e&&a(2,i=e.tabs),"title"in e&&a(3,r=e.title),"$$scope"in e&&a(4,s=e.$$scope)},e.$$.update=()=>{3&e.$$.dirty&&a(0,o=!l||o)},[o,l,i,r,s,n,function(e){o=e,a(0,o),a(1,l)},function(t){G(e,t)},()=>a(0,o=!o)]}class Ve extends e{constructor(e){super(),t(this,e,Me,Ae,a,{isCloseable:1,isOpen:0,tabs:2,title:3})}}function _e(e,t,a){const n=e.slice();return n[3]=t[a],n}function Re(e){let t,a,c,h,d=e[3]+"";function f(){return e[2](e[3])}return{c(){t=n("button"),a=m(d),this.h()},l(e){t=s(e,"BUTTON",{class:!0});var n=l(t);a=p(n,d),n.forEach(o),this.h()},h(){i(t,"class","rounded p-2 bg-indigo-400 shadow flex-auto text-white hover:bg-indigo-500")},m(e,n){r(e,t,n),v(t,a),c||(h=y(t,"click",f),c=!0)},p(t,a){e=t},d(e){e&&o(t),c=!1,h()}}}function Ne(e){let t,a=Object.keys(e[0]),c=[];for(let n=0;n>+John: Hello John, how are you?\n Alice->>+John: John, can you hear me?\n John--\x3e>-Alice: Hi Alice, I can hear you!\n John--\x3e>-Alice: I feel great!\n ","Class Diagram":"classDiagram\n Animal <|-- Duck\n Animal <|-- Fish\n Animal <|-- Zebra\n Animal : +int age\n Animal : +String gender\n Animal: +isMammal()\n Animal: +mate()\n class Duck{\n +String beakColor\n +swim()\n +quack()\n }\n class Fish{\n -int sizeInFeet\n -canEat()\n }\n class Zebra{\n +bool is_wild\n +run()\n }\n ","State Diagram":"stateDiagram-v2\n [*] --\x3e Still\n Still --\x3e [*]\n Still --\x3e Moving\n Moving --\x3e Still\n Moving --\x3e Crash\n Crash --\x3e [*]\n ","Gantt Chart":"gantt\n title A Gantt Diagram\n dateFormat YYYY-MM-DD\n section Section\n A task :a1, 2014-01-01, 30d\n Another task :after a1 , 20d\n section Another\n Task in sec :2014-01-12 , 12d\n another task : 24d\n ","Pie Chart":'pie title Pets adopted by volunteers\n "Dogs" : 386\n "Cats" : 85\n "Rats" : 15\n ',"ER Diagram":'erDiagram\n CUSTOMER }|..|{ DELIVERY-ADDRESS : has\n CUSTOMER ||--o{ ORDER : places\n CUSTOMER ||--o{ INVOICE : "liable for"\n DELIVERY-ADDRESS ||--o{ ORDER : receives\n INVOICE ||--|{ ORDER : covers\n ORDER ||--|{ ORDER-ITEM : includes\n PRODUCT-CATEGORY ||--|{ PRODUCT : contains\n PRODUCT ||--o{ ORDER-ITEM : "ordered in"\n ',"Git Graph":'gitGraph:\noptions\n{\n "nodeSpacing": 150,\n "nodeRadius": 10\n}\nend\ncommit\nbranch newbranch\ncheckout newbranch\ncommit\ncommit\ncheckout master\ncommit\ncommit\nmerge newbranch\n\n ',"User Journey":" journey\n title My working day\n section Go to work\n Make tea: 5: Me\n Go upstairs: 3: Me\n Do work: 1: Me, Cat\n section Go home\n Go downstairs: 5: Me\n Sit down: 3: Me\n "},a=e=>{ne(t[e],!0,!0)};return[t,a,e=>a(e)]}class Ue extends e{constructor(e){super(),t(this,e,Pe,Le,a,{})}}function Be(e){let t,a,l;return{c(){t=n("input"),this.h()},l(e){t=s(e,"INPUT",{id:!0,type:!0,min:!0,max:!0}),this.h()},h(){i(t,"id","height"),i(t,"type","number"),i(t,"min","3"),i(t,"max","10000")},m(n,s){r(n,t,s),H(t,e[4]),a||(l=y(t,"input",e[14]),a=!0)},p(e,a){16&a&&Y(t.value)!==e[4]&&H(t,e[4])},d(e){e&&o(t),a=!1,l()}}}function je(e){let t,a,h,d,f,$,w,x,b,E,k,I,D,C,O,T,S,A,M,V,_,R,N,L,P,U,B,j,G,H,Y,J,q,F,K,Z,W,Q,X,ee,te,ae,ne,se,le,oe=e[5](),ie=oe&&function(e){let t,a,h,d,f;return{c(){t=n("button"),a=n("i"),h=m(" Copy Image to clipboard"),this.h()},l(e){t=s(e,"BUTTON",{class:!0});var n=l(t);a=s(n,"I",{class:!0}),l(a).forEach(o),h=p(n," Copy Image to clipboard"),n.forEach(o),this.h()},h(){i(a,"class","far fa-copy"),i(t,"class","btn w-full svelte-1ygdo6x")},m(n,s){r(n,t,s),v(t,a),v(t,h),d||(f=y(t,"click",e[6]),d=!0)},p:c,d(e){e&&o(t),d=!1,f()}}}(e),re="auto"!==e[3]&&Be(e);return{c(){t=n("div"),ie&&ie.c(),a=u(),h=n("button"),d=n("i"),f=m(" PNG"),$=u(),w=n("button"),x=n("i"),b=m(" SVG"),E=u(),k=n("button"),I=n("a"),D=n("i"),C=m(" PNG"),O=u(),T=n("button"),S=n("a"),A=n("i"),M=m(" SVG"),V=u(),_=n("div"),R=m("PNG size\n\t\t\t"),N=n("input"),L=u(),P=n("label"),U=m("Auto"),B=u(),j=n("input"),G=u(),H=n("label"),Y=m("Width"),J=u(),q=n("input"),F=u(),K=n("label"),Z=m("Height"),W=u(),re&&re.c(),Q=u(),X=n("div"),ee=n("label"),te=m("Copy Markdown"),ae=u(),ne=n("input"),this.h()},l(e){t=s(e,"DIV",{class:!0});var n=l(t);ie&&ie.l(n),a=g(n),h=s(n,"BUTTON",{class:!0});var i=l(h);d=s(i,"I",{class:!0}),l(d).forEach(o),f=p(i," PNG"),i.forEach(o),$=g(n),w=s(n,"BUTTON",{class:!0});var r=l(w);x=s(r,"I",{class:!0}),l(x).forEach(o),b=p(r," SVG"),r.forEach(o),E=g(n),k=s(n,"BUTTON",{class:!0});var c=l(k);I=s(c,"A",{class:!0,target:!0,href:!0});var u=l(I);D=s(u,"I",{class:!0}),l(D).forEach(o),C=p(u," PNG"),u.forEach(o),c.forEach(o),O=g(n),T=s(n,"BUTTON",{class:!0});var m=l(T);S=s(m,"A",{class:!0,target:!0,href:!0});var v=l(S);A=s(v,"I",{class:!0}),l(A).forEach(o),M=p(v," SVG"),v.forEach(o),m.forEach(o),V=g(n),_=s(n,"DIV",{class:!0});var y=l(_);R=p(y,"PNG size\n\t\t\t"),N=s(y,"INPUT",{type:!0,value:!0,id:!0}),L=g(y),P=s(y,"LABEL",{for:!0});var z=l(P);U=p(z,"Auto"),z.forEach(o),B=g(y),j=s(y,"INPUT",{type:!0,value:!0,id:!0}),G=g(y),H=s(y,"LABEL",{for:!0});var se=l(H);Y=p(se,"Width"),se.forEach(o),J=g(y),q=s(y,"INPUT",{type:!0,value:!0,id:!0}),F=g(y),K=s(y,"LABEL",{for:!0});var le=l(K);Z=p(le,"Height"),le.forEach(o),W=g(y),re&&re.l(y),y.forEach(o),Q=g(n),X=s(n,"DIV",{class:!0});var oe=l(X);ee=s(oe,"LABEL",{for:!0});var ce=l(ee);te=p(ce,"Copy Markdown"),ce.forEach(o),ae=g(oe),ne=s(oe,"INPUT",{class:!0,id:!0,type:!0,value:!0}),oe.forEach(o),n.forEach(o),this.h()},h(){i(d,"class","fas fa-download"),i(h,"class","btn flex-auto svelte-1ygdo6x"),i(x,"class","fas fa-download"),i(w,"class","btn flex-auto svelte-1ygdo6x"),i(D,"class","fas fa-external-link-alt"),i(I,"class","link-style"),i(I,"target","_blank"),i(I,"href",e[0]),i(k,"class","btn flex-auto svelte-1ygdo6x"),i(A,"class","fas fa-external-link-alt"),i(S,"class","link-style"),i(S,"target","_blank"),i(S,"href",e[1]),i(T,"class","btn flex-auto svelte-1ygdo6x"),i(N,"type","radio"),N.__value="auto",N.value=N.__value,i(N,"id","autosize"),e[11][0].push(N),i(P,"for","autosize"),i(j,"type","radio"),j.__value="width",j.value=j.__value,i(j,"id","width-active"),e[11][0].push(j),i(H,"for","width"),i(q,"type","radio"),q.__value="height",q.value=q.__value,i(q,"id","height-active"),e[11][0].push(q),i(K,"for","height"),i(_,"class","flex gap-2 items-center"),i(ee,"for","markdown"),i(ne,"class","flex-1"),i(ne,"id","markdown"),i(ne,"type","text"),ne.value=e[2],i(X,"class","w-full flex gap-2 items-center"),i(t,"class","flex flex-wrap gap-2 m-2")},m(n,s){r(n,t,s),ie&&ie.m(t,null),v(t,a),v(t,h),v(h,d),v(h,f),v(t,$),v(t,w),v(w,x),v(w,b),v(t,E),v(t,k),v(k,I),v(I,D),v(I,C),v(t,O),v(t,T),v(T,S),v(S,A),v(S,M),v(t,V),v(t,_),v(_,R),v(_,N),N.checked=N.__value===e[3],v(_,L),v(_,P),v(P,U),v(_,B),v(_,j),j.checked=j.__value===e[3],v(_,G),v(_,H),v(H,Y),v(_,J),v(_,q),q.checked=q.__value===e[3],v(_,F),v(_,K),v(K,Z),v(_,W),re&&re.m(_,null),v(t,Q),v(t,X),v(X,ee),v(ee,te),v(X,ae),v(X,ne),se||(le=[y(h,"click",e[7]),y(w,"click",e[8]),y(N,"change",e[10]),y(j,"change",e[12]),y(q,"change",e[13]),y(ne,"click",e[9])],se=!0)},p(e,t){oe&&ie.p(e,t),1&t&&i(I,"href",e[0]),2&t&&i(S,"href",e[1]),8&t&&(N.checked=N.__value===e[3]),8&t&&(j.checked=j.__value===e[3]),8&t&&(q.checked=q.__value===e[3]),"auto"!==e[3]?re?re.p(e,t):(re=Be(e),re.c(),re.m(_,null)):re&&(re.d(1),re=null),4&t&&ne.value!==e[2]&&(ne.value=e[2])},d(a){a&&o(t),ie&&ie.d(),e[11][0].splice(e[11][0].indexOf(N),1),e[11][0].splice(e[11][0].indexOf(j),1),e[11][0].splice(e[11][0].indexOf(q),1),re&&re.d(),se=!1,z(le)}}}function Ge(e){let t,a;return t=new Ve({props:{title:"Actions",isOpen:!1,$$slots:{default:[je]},$$scope:{ctx:e}}}),{c(){N(t.$$.fragment)},l(e){L(t.$$.fragment,e)},m(e,n){P(t,e,n),a=!0},p(e,[a]){const n={};2097183&a&&(n.$$scope={dirty:a,ctx:e}),t.$set(n)},i(e){a||(T(t.$$.fragment,e),a=!0)},o(e){A(t.$$.fragment,e),a=!1},d(e){B(t,e)}}}function He(e,t,a){const n=()=>{const e=document.getElementById("container").innerHTML.replaceAll("
","
");return J(e)},s=(e,t)=>{const a=document.createElement("canvas"),s=document.querySelector("#container svg").getBoundingClientRect();if(a.width=s.width,a.height=s.height,"width"===d){const e=s.height/s.width;a.width=f,a.height=f*e}else if("height"===d){const e=s.width/s.height;a.width=f*e,a.height=f}const l=a.getContext("2d");l.fillStyle="white",l.fillRect(0,0,a.width,a.height);const o=new Image;o.onload=t(a,l,o),o.src=`data:image/svg+xml;base64,${n()}`,e.stopPropagation(),e.preventDefault()},l=(e,t)=>{const a=document.createElement("a");a.download=e,a.href=t,a.click(),a.remove()},o=(e,t,a)=>()=>{t.drawImage(a,0,0,e.width,e.height),l(`mermaid-diagram-${q().format("YYYYMMDDHHmmss")}.png`,e.toDataURL("image/png").replace("image/png","image/octet-stream"))},i=(e,t,a)=>()=>{t.drawImage(a,0,0,e.width,e.height),e.toBlob((e=>{try{navigator.clipboard.write([new ClipboardItem({[e.type]:e})])}catch(t){console.error(t)}}))};let r,c,h,d="auto",f=1080;se.subscribe((e=>{a(0,r=`https://mermaid.ink/img/${e}`),a(1,c=`https://mermaid.ink/svg/${e}`),a(2,h=`[![](${r})](${window.location.protocol}//${window.location.host}${window.location.pathname}/edit#${e})`)}));return[r,c,h,d,f,()=>null===window||void 0===window?void 0:window.hasOwnProperty("ClipboardItem"),e=>{s(e,i)},e=>{s(e,o)},e=>{l(`mermaid-diagram-${q().format("YYYYMMDDHHmmss")}.svg`,`data:image/svg+xml;base64,${n()}`)},e=>{e.target.select(),document.execCommand("Copy")},function(){d=this.__value,a(3,d)},[[]],function(){d=this.__value,a(3,d)},function(){d=this.__value,a(3,d)},function(){f=Y(this.value),a(4,f)}]}class Ye extends e{constructor(e){super(),t(this,e,He,Ge,a,{})}}const ze=F(Z(!0),K(),"autoHistoryMode"),Je=F(Z([]),K(),"autoHistoryStore"),qe=F(Z([]),K(),"manualHistoryStore"),Fe=W([ze,Je,qe],(([e,t,a],n)=>{n(e?t:a)}));function Ke(e,t,a){const n=e.slice();return n[14]=t[a].state,n[15]=t[a].time,n[16]=t[a].name,n}function Ze(e){let t,a,c,h,d,f,$,w,x,b,E,k,D,C,O,T,S,A,M,V,_,R=e[16]+"",N=e[7](e[15])+"";function L(){return e[10](e[14])}function P(){return e[11](e[15])}return{c(){t=n("li"),a=n("div"),c=n("div"),h=n("div"),d=n("span"),f=m(R),$=u(),w=n("span"),x=m(N),b=u(),E=n("div"),k=n("button"),D=n("i"),C=m(" Restore"),O=u(),T=n("button"),S=n("i"),A=m(" Delete"),M=u(),this.h()},l(e){t=s(e,"LI",{class:!0});var n=l(t);a=s(n,"DIV",{class:!0});var i=l(a);c=s(i,"DIV",{class:!0});var r=l(c);h=s(r,"DIV",{class:!0});var u=l(h);d=s(u,"SPAN",{});var m=l(d);f=p(m,R),m.forEach(o),$=g(u),w=s(u,"SPAN",{class:!0});var v=l(w);x=p(v,N),v.forEach(o),u.forEach(o),r.forEach(o),b=g(i),E=s(i,"DIV",{class:!0});var y=l(E);k=s(y,"BUTTON",{class:!0});var I=l(k);D=s(I,"I",{class:!0}),l(D).forEach(o),C=p(I," Restore"),I.forEach(o),O=g(y),T=s(y,"BUTTON",{class:!0});var V=l(T);S=s(V,"I",{class:!0}),l(S).forEach(o),A=p(V," Delete"),V.forEach(o),y.forEach(o),i.forEach(o),M=g(n),n.forEach(o),this.h()},h(){i(w,"class","text-gray-400 text-sm"),i(h,"class","flex flex-col"),i(c,"class","flex-1"),i(D,"class","fas fa-undo"),i(k,"class","rounded px-2 w-24 bg-green-200 hover:bg-green-300"),i(S,"class","fas fa-trash-alt"),i(T,"class","rounded px-2 w-24 bg-red-200 hover:bg-red-300"),i(E,"class","flex gap-2 content-center"),i(a,"class","flex"),i(t,"class","rounded p-2 shadow flex-col")},m(e,n){r(e,t,n),v(t,a),v(a,c),v(c,h),v(h,d),v(d,f),v(h,$),v(h,w),v(w,x),v(a,b),v(a,E),v(E,k),v(k,D),v(k,C),v(E,O),v(E,T),v(T,S),v(T,A),v(t,M),V||(_=[y(k,"click",L),y(T,"click",P)],V=!0)},p(t,a){e=t,2&a&&R!==(R=e[16]+"")&&I(f,R),2&a&&N!==(N=e[7](e[15])+"")&&I(x,N)},d(e){e&&o(t),V=!1,z(_)}}}function We(e){let t,a=e[1],c=[];for(let n=0;nV(t,"isOpen",s))),t.$on("select",e[2]),{c(){N(t.$$.fragment)},l(e){L(t.$$.fragment,e)},m(e,a){P(t,e,a),n=!0},p(e,[n]){const s={};524290&n&&(s.$$scope={dirty:n,ctx:e}),!a&&1&n&&(a=!0,s.isOpen=e[0],U((()=>a=!1))),t.$set(s)},i(e){n||(T(t.$$.fragment,e),n=!0)},o(e){A(t.$$.fragment,e),n=!1},d(e){B(t,e)}}}function et(e,t,a){let n,s;ee(e,le,(e=>a(13,n=e))),ee(e,Fe,(e=>a(1,s=e)));const l=(e=!1)=>{const t=oe();var a;(e=>{const t=X(e?Je:qe);return t.length>0?JSON.stringify(t[0].state):""})(e)!==t?((a={state:n,time:Date.now(),auto:e}).name=Q.generateSlug(2),a.auto?Je.update((e=>(30===e.length&&e.pop(),[a,...e]))):qe.update((e=>[a,...e]))):e||alert("State already saved.")},o=e=>{var t;(e||confirm("Clear all saved items?"))&&(t=e,(X(ze)?Je:qe).update((e=>e.filter((e=>t&&e.time!=t)))))},i=e=>{le.set(Object.assign(Object.assign({},e),{updateEditor:!0,updateDiagram:!0}))};d((()=>{ze.set(!1),setInterval((()=>{l(!0)}),6e4)}));let r=!0;return[r,s,e=>{ze.set("timeline"===e.detail.id)},[{id:"saved",title:"Saved",icon:"far fa-bookmark"},{id:"timeline",title:"Timeline",icon:"fas fa-history"}],l,o,i,e=>{const t=new Date(e);return`${new Date(t).toLocaleString()} (${q(t).fromNow()})`},()=>l(),()=>o(),e=>i(e),e=>o(e),function(e){r=e,a(0,r)}]}class tt extends e{constructor(e){super(),t(this,e,et,Xe,a,{})}}function at(e){let t,a;return t=new ge({props:{language:e[2],text:e[1],errorMarkers:e[3]}}),t.$on("update",e[6]),{c(){N(t.$$.fragment)},l(e){L(t.$$.fragment,e)},m(e,n){P(t,e,n),a=!0},p(e,a){const n={};4&a&&(n.language=e[2]),2&a&&(n.text=e[1]),8&a&&(n.errorMarkers=e[3]),t.$set(n)},i(e){a||(T(t.$$.fragment,e),a=!0)},o(e){A(t.$$.fragment,e),a=!1},d(e){B(t,e)}}}function nt(e){let t,a,h,d;return{c(){t=n("button"),a=n("i"),this.h()},l(e){t=s(e,"BUTTON",{class:!0,title:!0});var n=l(t);a=s(n,"I",{class:!0}),l(a).forEach(o),n.forEach(o),this.h()},h(){i(a,"class","fas fa-sync"),i(t,"class","bg-indigo-500 hover:bg-indigo-700 rounded px-4 mx-2"),i(t,"title","Sync Diagram")},m(e,n){r(e,t,n),v(t,a),h||(d=y(t,"click",he),h=!0)},p:c,d(e){e&&o(t),h=!1,d()}}}function st(e){let t,a,c,h,d,f,$,w=!e[0].autoSync&&nt();return{c(){t=n("div"),w&&w.c(),a=u(),c=n("label"),h=n("input"),d=m("\n\t\t\t\t\t\tAuto sync"),this.h()},l(e){t=s(e,"DIV",{slot:!0});var n=l(t);w&&w.l(n),a=g(n),c=s(n,"LABEL",{for:!0});var i=l(c);h=s(i,"INPUT",{type:!0,name:!0}),d=p(i,"\n\t\t\t\t\t\tAuto sync"),i.forEach(o),n.forEach(o),this.h()},h(){i(h,"type","checkbox"),i(h,"name","autoSync"),i(c,"for","autoSync"),i(t,"slot","actions")},m(n,s){r(n,t,s),w&&w.m(t,null),v(t,a),v(t,c),v(c,h),h.checked=e[0].autoSync,v(c,d),f||($=y(h,"change",e[9]),f=!0)},p(e,n){e[0].autoSync?w&&(w.d(1),w=null):w?w.p(e,n):(w=nt(),w.c(),w.m(t,a)),1&n&&(h.checked=e[0].autoSync)},d(e){e&&o(t),w&&w.d(),f=!1,$()}}}function lt(e){let t,a,c;return a=new ie({}),{c(){t=n("div"),N(a.$$.fragment),this.h()},l(e){t=s(e,"DIV",{class:!0});var n=l(t);L(a.$$.fragment,n),n.forEach(o),this.h()},h(){i(t,"class","flex-1 overflow-auto")},m(e,n){r(e,t,n),P(a,t,null),c=!0},i(e){c||(T(a.$$.fragment,e),c=!0)},o(e){A(a.$$.fragment,e),c=!1},d(e){e&&o(t),B(a)}}}function ot(e){let t,a,h,d,f;return{c(){t=n("button"),a=n("i"),h=m(" View"),this.h()},l(e){t=s(e,"BUTTON",{slot:!0,class:!0,title:!0});var n=l(t);a=s(n,"I",{class:!0}),l(a).forEach(o),h=p(n," View"),n.forEach(o),this.h()},h(){i(a,"class","far fa-eye"),i(t,"slot","actions"),i(t,"class","rounded shadow px-2 bg-indigo-500 hover:bg-indigo-700"),i(t,"title","View diagram in new page")},m(n,s){r(n,t,s),v(t,a),v(t,h),d||(f=y(t,"click",k(e[10])),d=!0)},p:c,d(e){e&&o(t),d=!1,f()}}}function it(e){let t,a,c,h,d,f,$,w,x,b,E,y,k,I,D,C,O,S,M,V,_;return c=new xe({}),$=new Ve({props:{tabs:e[5],isCloseable:!1,title:"Mermaid",$$slots:{actions:[st],default:[at]},$$scope:{ctx:e}}}),$.$on("select",e[4]),b=new Ue({}),y=new tt({}),I=new Ye({}),O=new Ve({props:{title:"Diagram",isCloseable:!1,$$slots:{actions:[ot],default:[lt]},$$scope:{ctx:e}}}),{c(){t=u(),a=n("div"),N(c.$$.fragment),h=u(),d=n("div"),f=n("div"),N($.$$.fragment),w=u(),x=n("div"),N(b.$$.fragment),E=u(),N(y.$$.fragment),k=u(),N(I.$$.fragment),D=u(),C=n("div"),N(O.$$.fragment),S=u(),M=n("div"),V=m("Code editing not supported on mobile. Please use a desktop browser"),this.h()},l(e){te('[data-svelte="svelte-1ry7oa8"]',document.head).forEach(o),t=g(e),a=s(e,"DIV",{class:!0});var n=l(a);L(c.$$.fragment,n),h=g(n),d=s(n,"DIV",{class:!0});var i=l(d);f=s(i,"DIV",{class:!0});var r=l(f);L($.$$.fragment,r),w=g(r),x=s(r,"DIV",{class:!0});var u=l(x);L(b.$$.fragment,u),E=g(u),L(y.$$.fragment,u),k=g(u),L(I.$$.fragment,u),u.forEach(o),r.forEach(o),D=g(i),C=s(i,"DIV",{class:!0});var m=l(C);L(O.$$.fragment,m),S=g(m),M=s(m,"DIV",{class:!0});var v=l(M);V=p(v,"Code editing not supported on mobile. Please use a desktop browser"),v.forEach(o),m.forEach(o),i.forEach(o),n.forEach(o),this.h()},h(){document.title="Edit",i(x,"class","flex-1"),i(f,"class","w-2/5 hidden md:flex flex-col"),i(M,"class","flex md:hidden bg-white rounded shadow p-2 mx-2"),i(C,"class","flex-1 flex flex-col overflow-hidden"),i(d,"class","flex-1 flex overflow-hidden"),i(a,"class","h-full flex flex-col overflow-hidden bg-gray-100")},m(e,n){r(e,t,n),r(e,a,n),P(c,a,null),v(a,h),v(a,d),v(d,f),P($,f,null),v(f,w),v(f,x),P(b,x,null),v(x,E),P(y,x,null),v(x,k),P(I,x,null),v(d,D),v(d,C),P(O,C,null),v(C,S),v(C,M),v(M,V),_=!0},p(e,[t]){const a={};131087&t&&(a.$$scope={dirty:t,ctx:e}),$.$set(a);const n={};131072&t&&(n.$$scope={dirty:t,ctx:e}),O.$set(n)},i(e){_||(T(c.$$.fragment,e),T($.$$.fragment,e),T(b.$$.fragment,e),T(y.$$.fragment,e),T(I.$$.fragment,e),T(O.$$.fragment,e),_=!0)},o(e){A(c.$$.fragment,e),A($.$$.fragment,e),A(b.$$.fragment,e),A(y.$$.fragment,e),A(I.$$.fragment,e),A(O.$$.fragment,e),_=!1},d(e){e&&o(t),e&&o(a),B(c),B($),B(b),B(y),B(I),B(O)}}}function rt(e,t,a){let n,s;ee(e,le,(e=>a(0,n=e))),ee(e,se,(e=>a(11,s=e)));var l=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(s,l){function o(e){try{r(n.next(e))}catch(t){l(t)}}function i(e){try{r(n.throw(e))}catch(t){l(t)}}function r(e){var t;e.done?s(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(o,i)}r((n=n.apply(e,t||[])).next())}))};const o=window.mermaid;let i="code";const r={code:"mermaid",config:"json"};let c="",h="mermaid",f=[];const u=()=>l(void 0,void 0,void 0,(function*(){yield fe(`/view#${s}`,{replaceState:!0})}));d(ce);return e.$$.update=()=>{256&e.$$.dirty&&a(2,h=r[i]),257&e.$$.dirty&&n.updateEditor&&a(1,c="code"===i?n.code:n.mermaid)},[n,c,h,f,e=>{ae(le,n.updateEditor=!0,n),a(8,i=e.detail.id)},[{id:"code",title:"Code",icon:"fas fa-code"},{id:"config",title:"Config",icon:"fas fa-cogs"}],e=>l(void 0,void 0,void 0,(function*(){try{"code"===i?yield(n=e.detail.text,l(void 0,void 0,void 0,(function*(){o.parse(n),ne(n,!1)}))):(t=e.detail.text,JSON.parse(t),de(t,!1)),re.set(void 0),a(3,f=[])}catch(s){if(re.set(s),s.hash){const e={severity:8,startLineNumber:s.hash.loc.first_line,startColumn:s.hash.loc.first_column,endLineNumber:s.hash.loc.last_line,endColumn:s.hash.loc.last_column+1,message:s.str};f.push(e),a(3,f=f.filter((t=>t.startLineNumber>=e.startLineNumber&&t.startColumn>=e.startColumn)))}console.error(s)}var t,n})),u,i,function(){n.autoSync=this.checked,le.set(n)},()=>u()]}export default class extends e{constructor(e){super(),t(this,e,rt,it,a,{})}} diff --git a/docs/_app/start-6a449612.js b/docs/_app/start-6a449612.js new file mode 100644 index 00000000..1b8b356c --- /dev/null +++ b/docs/_app/start-6a449612.js @@ -0,0 +1 @@ +var t=Object.defineProperty,e=Object.prototype.hasOwnProperty,r=Object.getOwnPropertySymbols,s=Object.prototype.propertyIsEnumerable,a=(e,r,s)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[r]=s,n=(t,n)=>{for(var o in n||(n={}))e.call(n,o)&&a(t,o,n[o]);if(r)for(var o of r(n))s.call(n,o)&&a(t,o,n[o]);return t};import{S as o,i,s as l,e as c,c as u,a as h,d,b as p,f,t as g,g as m,h as _,j as y,k as v,l as b,m as $,n as w,o as E,p as x,q,r as R,u as L,v as S,w as k,x as O,y as j,z as P,A as U,B as T,C as A}from"./chunks/vendor-a9bf48e1.js";import{i as I}from"./chunks/singletons-bb9012b7.js";import{s as N}from"./chunks/paths-45dac81d.js";function C(t){let e,r,s;const a=[t[2]||{}];var n=t[0][1];function o(t){let e={$$slots:{default:[D]},$$scope:{ctx:t}};for(let r=0;r{k(t,1)})),L()}n?(e=new n(o(t)),y(e.$$.fragment),S(e.$$.fragment,1),E(e,r.parentNode,r)):e=null}else n&&e.$set(i)},i(t){s||(e&&S(e.$$.fragment,t),s=!0)},o(t){e&&R(e.$$.fragment,t),s=!1},d(t){t&&d(r),e&&k(e,t)}}}function V(t){let e,r,s;const a=[t[3]||{}];var n=t[0][2];function o(t){let e={};for(let r=0;r{k(t,1)})),L()}n?(e=new n(o()),y(e.$$.fragment),S(e.$$.fragment,1),E(e,r.parentNode,r)):e=null}else n&&e.$set(i)},i(t){s||(e&&S(e.$$.fragment,t),s=!0)},o(t){e&&R(e.$$.fragment,t),s=!1},d(t){t&&d(r),e&&k(e,t)}}}function D(t){let e,r,s=t[0][2]&&V(t);return{c(){s&&s.c(),e=b()},l(t){s&&s.l(t),e=b()},m(t,a){s&&s.m(t,a),f(t,e,a),r=!0},p(t,r){t[0][2]?s?(s.p(t,r),1&r&&S(s,1)):(s=V(t),s.c(),S(s,1),s.m(e.parentNode,e)):s&&(T(),R(s,1,1,(()=>{s=null})),L())},i(t){r||(S(s),r=!0)},o(t){R(s),r=!1},d(t){s&&s.d(t),t&&d(e)}}}function B(t){let e,r,s=t[0][1]&&C(t);return{c(){s&&s.c(),e=b()},l(t){s&&s.l(t),e=b()},m(t,a){s&&s.m(t,a),f(t,e,a),r=!0},p(t,r){t[0][1]?s?(s.p(t,r),1&r&&S(s,1)):(s=C(t),s.c(),S(s,1),s.m(e.parentNode,e)):s&&(T(),R(s,1,1,(()=>{s=null})),L())},i(t){r||(S(s),r=!0)},o(t){R(s),r=!1},d(t){s&&s.d(t),t&&d(e)}}}function K(t){let e,r=t[5]&&W(t);return{c(){e=c("div"),r&&r.c(),this.h()},l(t){e=u(t,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,class:!0});var s=h(e);r&&r.l(s),s.forEach(d),this.h()},h(){p(e,"id","svelte-announcer"),p(e,"aria-live","assertive"),p(e,"aria-atomic","true"),p(e,"class","svelte-1pdgbjn")},m(t,s){f(t,e,s),r&&r.m(e,null)},p(t,s){t[5]?r?r.p(t,s):(r=W(t),r.c(),r.m(e,null)):r&&(r.d(1),r=null)},d(t){t&&d(e),r&&r.d()}}}function W(t){let e;return{c(){e=g(t[6])},l(r){e=m(r,t[6])},m(t,r){f(t,e,r)},p(t,r){64&r&&_(e,t[6])},d(t){t&&d(e)}}}function M(t){let e,r,s,a;const n=[t[1]||{}];var o=t[0][0];function i(t){let e={$$slots:{default:[B]},$$scope:{ctx:t}};for(let r=0;r{k(t,1)})),L()}o?(e=new o(i(t)),y(e.$$.fragment),S(e.$$.fragment,1),E(e,r.parentNode,r)):e=null}else o&&e.$set(c);t[4]?l?l.p(t,a):(l=K(t),l.c(),l.m(s.parentNode,s)):l&&(l.d(1),l=null)},i(t){a||(e&&S(e.$$.fragment,t),a=!0)},o(t){e&&R(e.$$.fragment,t),a=!1},d(t){e&&k(e,t),t&&d(r),l&&l.d(t),t&&d(s)}}}function Y(t,e,r){let{stores:s}=e,{page:a}=e,{components:n}=e,{props_0:o=null}=e,{props_1:i=null}=e,{props_2:l=null}=e;O("__svelte__",s),j(s.page.notify);let c=!1,u=!1,h=null;return P((()=>{const t=s.page.subscribe((()=>{c&&(r(5,u=!0),r(6,h=document.title||"untitled page"))}));return r(4,c=!0),t})),t.$$set=t=>{"stores"in t&&r(7,s=t.stores),"page"in t&&r(8,a=t.page),"components"in t&&r(0,n=t.components),"props_0"in t&&r(1,o=t.props_0),"props_1"in t&&r(2,i=t.props_1),"props_2"in t&&r(3,l=t.props_2)},t.$$.update=()=>{384&t.$$.dirty&&s.page.set(a)},[n,o,i,l,c,u,h,s,a]}class z extends o{constructor(t){super(),i(this,t,Y,M,l,{stores:7,page:8,components:0,props_0:1,props_1:2,props_2:3})}}let G;const J={},X=function(t,e){if(!e)return t();if(void 0===G){const t=document.createElement("link").relList;G=t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"}return Promise.all(e.map((t=>{if(t in J)return;J[t]=!0;const e=t.endsWith(".css"),r=e?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${t}"]${r}`))return;const s=document.createElement("link");return s.rel=e?"stylesheet":G,e||(s.as="script",s.crossOrigin=""),s.href=t,document.head.appendChild(s),e?new Promise(((t,e)=>{s.addEventListener("load",t),s.addEventListener("error",e)})):void 0}))).then((()=>t()))},F=[()=>X((()=>import("./pages/__layout.svelte-7d8b2086.js")),["/mermaid-svelte-kit/_app/pages/__layout.svelte-7d8b2086.js","/mermaid-svelte-kit/_app/assets/pages/__layout.svelte-e1cd0550.css","/mermaid-svelte-kit/_app/chunks/vendor-a9bf48e1.js"]),()=>X((()=>import("./error.svelte-77232d5a.js")),["/mermaid-svelte-kit/_app/error.svelte-77232d5a.js","/mermaid-svelte-kit/_app/chunks/vendor-a9bf48e1.js"]),()=>X((()=>import("./pages/index.svelte-0bb74b08.js")),["/mermaid-svelte-kit/_app/pages/index.svelte-0bb74b08.js","/mermaid-svelte-kit/_app/chunks/vendor-a9bf48e1.js","/mermaid-svelte-kit/_app/chunks/navigation-20968cc5.js","/mermaid-svelte-kit/_app/chunks/singletons-bb9012b7.js","/mermaid-svelte-kit/_app/chunks/paths-45dac81d.js"]),()=>X((()=>import("./pages/edit.svelte-19fcd0a0.js")),["/mermaid-svelte-kit/_app/pages/edit.svelte-19fcd0a0.js","/mermaid-svelte-kit/_app/assets/pages/edit.svelte-a37f5076.css","/mermaid-svelte-kit/_app/chunks/vendor-a9bf48e1.js","/mermaid-svelte-kit/_app/chunks/util-bfd89a15.js","/mermaid-svelte-kit/_app/assets/util-53f38408.css","/mermaid-svelte-kit/_app/chunks/navigation-20968cc5.js","/mermaid-svelte-kit/_app/chunks/singletons-bb9012b7.js"]),()=>X((()=>import("./pages/view.svelte-b7a48005.js")),["/mermaid-svelte-kit/_app/pages/view.svelte-b7a48005.js","/mermaid-svelte-kit/_app/chunks/vendor-a9bf48e1.js","/mermaid-svelte-kit/_app/chunks/util-bfd89a15.js","/mermaid-svelte-kit/_app/assets/util-53f38408.css"])],H=[[/^\/$/,[F[0],F[2]],[F[1]]],[/^\/edit\/?$/,[F[0],F[3]],[F[1]]],[/^\/view\/?$/,[F[0],F[4]],[F[1]]]],Q=[F[0](),F[1]()];function Z(){return{x:pageXOffset,y:pageYOffset}}function tt(t){for(;t&&"A"!==t.nodeName.toUpperCase();)t=t.parentNode;return t}class et{constructor({base:t,routes:e}){this.base=t,this.routes=e}init(t){let e;this.renderer=t,t.router=this,this.enabled=!0,"scrollRestoration"in history&&(history.scrollRestoration="manual"),addEventListener("beforeunload",(()=>{history.scrollRestoration="auto"})),addEventListener("load",(()=>{history.scrollRestoration="manual"})),addEventListener("scroll",(()=>{clearTimeout(e),e=setTimeout((()=>{const t=n(n({},history.state||{}),{"sveltekit:scroll":Z()});history.replaceState(t,document.title,window.location.href)}),50)}));const r=t=>{const e=tt(t.target);e&&e.href&&e.hasAttribute("sveltekit:prefetch")&&this.prefetch(new URL(e.href))};let s;addEventListener("touchstart",r),addEventListener("mousemove",(t=>{clearTimeout(s),s=setTimeout((()=>{r(t)}),20)})),addEventListener("click",(t=>{var e;if(!this.enabled)return;if(t.button||1!==t.which)return;if(t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;if(t.defaultPrevented)return;const r=tt(t.target);if(!r)return;if(!r.href)return;const s="object"==typeof r.href&&"SVGAnimatedString"===r.href.constructor.name,a=String(s?r.href.baseVal:r.href);if(a===location.href)return void(location.hash||t.preventDefault());const n=null==(e=r.getAttribute("rel"))?void 0:e.split(/\s+/);if(r.hasAttribute("download")||n&&n.includes("external"))return;if(s?r.target.baseVal:r.target)return;const o=new URL(a);if(o.pathname===location.pathname&&o.search===location.search)return;const i=r.hasAttribute("sveltekit:noscroll");history.pushState({},"",o.href),this._navigate(o,i?Z():null,[],o.hash),t.preventDefault()})),addEventListener("popstate",(t=>{if(t.state&&this.enabled){const e=new URL(location.href);this._navigate(e,t.state["sveltekit:scroll"],[])}})),document.body.setAttribute("tabindex","-1"),history.replaceState(history.state||{},"",location.href)}parse(t){if(t.origin!==location.origin)return null;if(!t.pathname.startsWith(this.base))return null;const e=decodeURIComponent(t.pathname.slice(this.base.length)||"/"),r=this.routes.filter((([t])=>t.test(e))),s=new URLSearchParams(t.search);return{id:`${e}?${s}`,routes:r,path:e,query:s}}async goto(t,{noscroll:e=!1,replaceState:r=!1}={},s){if(this.enabled){const a=new URL(t,function(t){let e=t.baseURI;if(!e){const r=t.getElementsByTagName("base");e=r.length?r[0].href:t.URL}return e}(document));return history[r?"replaceState":"pushState"]({},"",t),this._navigate(a,e?Z():null,s,a.hash)}return location.href=t,new Promise((()=>{}))}enable(){this.enabled=!0}disable(){this.enabled=!1}async prefetch(t){return this.renderer.load(this.parse(t))}async _navigate(t,e,r,s){const a=this.parse(t);this.renderer.notify({path:a.path,query:a.query}),location.pathname.endsWith("/")&&"/"!==location.pathname&&history.replaceState({},"",`${location.pathname.slice(0,-1)}${location.search}`),await this.renderer.update(a,r,!1),document.body.focus();const n=s&&document.getElementById(s.slice(1));e?scrollTo(e.x,e.y):n?scrollTo(0,n.getBoundingClientRect().top+scrollY):scrollTo(0,0)}}function rt(t){const e=A(t);let r=!0;return{notify:function(){r=!0,e.update((t=>t))},set:function(t){r=!1,e.set(t)},subscribe:function(t){let s;return e.subscribe((e=>{(void 0===s||r&&e!==s)&&t(s=e)}))}}}function st(t,a){const n="string"==typeof t?t:t.url,o=document.querySelector(`script[type="svelte-data"][url="${n}"]`);if(o){const t=JSON.parse(o.textContent),{body:a}=t,n=((t,a)=>{var n={};for(var o in t)e.call(t,o)&&a.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&r)for(var o of r(t))a.indexOf(o)<0&&s.call(t,o)&&(n[o]=t[o]);return n})(t,["body"]);return Promise.resolve(new Response(a,n))}return fetch(t,a)}class at{constructor({Root:t,fallback:e,target:r,session:s,host:a}){this.Root=t,this.fallback=e,this.host=a,this.router=null,this.target=r,this.started=!1,this.session_id=1,this.invalid=new Set,this.invalidating=null,this.current={page:null,session_id:null,branch:[]},this.cache=new Map,this.loading={id:null,promise:null},this.stores={page:rt({}),navigating:A(null),session:A(s)},this.$session=null,this.root=null;let n=!1;this.stores.session.subscribe((async t=>{if(this.$session=t,!n)return;this.session_id+=1;const e=this.router.parse(new URL(location.href));this.update(e,[],!0)})),n=!0}async start({status:t,error:e,nodes:r,page:s}){const a=[];let o,i,l,c={};try{for(let o=0;o10||e.includes(t.path)))return void(this.router?this.router.goto(a.redirect,{replaceState:!0},[...e,t.path]):location.href=new URL(a.redirect,location.href).href);a=await this._load_error({status:500,error:new Error("Redirect loop"),path:t.path,query:t.query})}a.reload?location.reload():this.started?(this.current=a.state,this.root.$set(a.props),this.stores.navigating.set(null),await 0):this._init(a),dispatchEvent(new CustomEvent("sveltekit:navigation-end")),this.loading.promise=null,this.loading.id=null;const n=a.state.branch[a.state.branch.length-1];n&&!1===n.module.router?this.router.disable():this.router.enable()}load(t){return this.loading.promise=this._get_navigation_result(t,!1),this.loading.id=t.id,this.loading.promise}invalidate(t){return this.invalid.add(t),this.invalidating||(this.invalidating=Promise.resolve().then((async()=>{const t=this.router.parse(new URL(location.href));await this.update(t,[],!0),this.invalidating=null}))),this.invalidating}_init(t){this.current=t.state;const e=document.querySelector("style[data-svelte]");e&&e.remove(),this.root=new this.Root({target:this.target,props:n({stores:this.stores},t.props),hydrate:!0}),this.started=!0}async _get_navigation_result(t,e){if(this.loading.id===t.id)return this.loading.promise;for(let r=0;rt())),a+=1}const n=await this._load({route:s,path:t.path,query:t.query},e);if(n)return n}return await this._load_error({status:404,error:new Error(`Not found: ${t.path}`),path:t.path,query:t.query})}async _get_navigation_result_from_branch({page:t,branch:e}){const r=e.filter(Boolean),s={state:{page:t,branch:e,session_id:this.session_id},props:{components:r.map((t=>t.module.default))}};for(let o=0;o{this.cache.get(e)===s&&this.cache.delete(e),i(),clearTimeout(o)},o=setTimeout(a,1e3*n),i=this.stores.session.subscribe((()=>{r&&a()}));r=!0,this.cache.set(e,s)}return s}async _load_node({status:t,error:e,module:r,page:s,context:a}){const o={module:r,uses:{params:new Set,path:!1,query:!1,session:!1,context:!1,dependencies:[]},loaded:null,context:a},i={};for(const n in s.params)Object.defineProperty(i,n,{get:()=>(o.uses.params.add(n),s.params[n]),enumerable:!0});const l=this.$session;if(r.load){const{started:c}=this,u={page:{host:s.host,params:i,get path(){return o.uses.path=!0,s.path},get query(){return o.uses.query=!0,s.query}},get session(){return o.uses.session=!0,l},get context(){return o.uses.context=!0,n({},a)},fetch(t,e){const r="string"==typeof t?t:t.url,{href:a}=new URL(r,new URL(s.path,document.baseURI));return o.uses.dependencies.push(a),c?fetch(t,e):st(t,e)}};e&&(u.status=t,u.error=e);const h=await r.load.call(null,u);if(!h)return;o.loaded=function(t){if(t.error){const e="string"==typeof t.error?new Error(t.error):t.error,r=t.status;return e instanceof Error?!r||r<400||r>599?(console.warn('"error" returned from load() without a valid status code — defaulting to 500'),{status:500,error:e}):{status:r,error:e}:{status:500,error:new Error(`"error" property returned from load() must be a string or instance of Error, received type "${typeof e}"`)}}if(t.redirect){if(!t.status||3!==Math.floor(t.status/100))return{status:500,error:new Error('"redirect" property returned from load() must be accompanied by a 3xx status code')};if("string"!=typeof t.redirect)return{status:500,error:new Error('"redirect" property returned from load() must be a string')}}return t}(h),o.loaded.context&&(o.context=o.loaded.context)}return o}async _load({route:t,path:e,query:r},s){const a=`${e}?${r}`;if(!s&&this.cache.has(a))return this.cache.get(a);const[o,i,l,c]=t,u=c?c(o.exec(e)):{},h=this.current.page&&{path:e!==this.current.page.path,params:Object.keys(u).filter((t=>this.current.page.params[t]!==u[t])),query:r.toString()!==this.current.page.query.toString(),session:this.session_id!==this.current.session_id},d={host:this.host,path:e,query:r,params:u},p=[];let f={},g=!1,m=200,_=null;i.forEach((t=>t()));t:for(let v=0;vr.uses.params.has(t)))||h.query&&r.uses.query||h.session&&r.uses.session||r.uses.dependencies.some((t=>this.invalid.has(t)))||g&&r.uses.context){t=await this._load_node({module:e,page:d,context:f});const r=v===i.length-1;if(t&&t.loaded){if(t.loaded.error&&(m=t.loaded.status,_=t.loaded.error),t.loaded.redirect)return{redirect:t.loaded.redirect};t.loaded.context&&(g=!0)}else if(r&&e.load)return}else t=r}catch(y){m=500,_=y}if(_){for(;v--;)if(l[v]){let t,e,r=v;for(;!(e=p[r]);)r-=1;try{if(t=await this._load_node({status:m,error:_,module:await l[v](),page:d,context:e.context}),t.loaded.error)continue;p.push(t);break t}catch(y){continue}}return await this._load_error({status:m,error:_,path:e,query:r})}t&&t.loaded&&t.loaded.context&&(f=n(n({},f),t.loaded.context)),p.push(t)}return await this._get_navigation_result_from_branch({page:d,branch:p})}async _load_error({status:t,error:e,path:r,query:s}){const a={host:this.host,path:r,query:s,params:{}},n=await this._load_node({module:await this.fallback[0],page:a,context:{}}),o=[n,await this._load_node({status:t,error:e,module:await this.fallback[1],page:a,context:n&&n.loaded&&n.loaded.context})];return await this._get_navigation_result_from_branch({page:a,branch:o})}}async function nt({paths:t,target:e,session:r,host:s,route:a,spa:n,hydrate:o}){const i=a&&new et({base:t.base,routes:H}),l=new at({Root:z,fallback:Q,target:e,session:r,host:s});I(i),N(t),o&&await l.start(o),a&&i.init(l),n&&i.goto(location.href,{replaceState:!0},[]),dispatchEvent(new CustomEvent("sveltekit:start"))}export{nt as start}; diff --git a/docs/edit/index.html b/docs/edit/index.html index 2856a76a..77f6ba36 100644 --- a/docs/edit/index.html +++ b/docs/edit/index.html @@ -57,14 +57,14 @@ - +