((() => { 'use strict'; requirejs.config(window.getRequirejsCDN()); // Set to false during development to avoid need to minify sources const release = !window.location.href.includes('editor-dev.htm'); requirejs([ 'interface/Interface', release ? '../lib/sequence-diagram.min' : 'sequence/SequenceDiagram', ], ( Interface, SequenceDiagram ) => { const defaultCode = ( 'title Labyrinth\n' + '\n' + 'Bowie -> Goblin: You remind me of the babe\n' + 'Goblin -> Bowie: What babe?\n' + 'Bowie -> Goblin: The babe with the power\n' + 'Goblin -> Bowie: What power?\n' + 'note right of Bowie, Goblin: Most people get muddled here!\n' + 'Bowie -> Goblin: \'The power of voodoo\'\n' + 'Goblin -> Bowie: "Who-do?"\n' + 'Bowie -> Goblin: You do!\n' + 'Goblin -> Bowie: Do what?\n' + 'Bowie -> Goblin: Remind me of the babe!\n' + '\n' + 'Bowie -> Audience: Sings\n' + '\n' + 'terminators box\n' ); const library = [ { title: 'Simple arrow (synchronous)', code: '{Agent1} -> {Agent2}: {Message}', }, { title: 'Arrow with dotted line (response)', code: '{Agent1} --> {Agent2}: {Message}', }, { title: 'Open arrow (asynchronous)', code: '{Agent1} ->> {Agent2}: {Message}', }, { title: 'Lost message', code: '{Agent1} -x {Agent2}: {Message}', }, { title: 'Wavy line', code: '{Agent1} ~> {Agent2}: {Message}', }, { title: 'Self-connection', code: '{Agent1} -> {Agent1}: {Message}', }, { title: 'Request/response pair', code: ( '{Agent1} -> +{Agent2}: {Request}\n' + '{Agent1} <-- -{Agent2}: {Response}' ), }, { title: 'Inline agent creation / destruction', code: ( '{Agent1} -> *{Agent2}: {Request}\n' + '{Agent1} <-- !{Agent2}: {Response}' ), }, { title: 'Agent creation / destruction', code: ( '{Agent1} -> {Agent2}: {Request}\n' + '{Agent1} <-- {Agent2}: {Response}\n' + 'end {Agent2}' ), preview: ( 'begin A\n' + '::\n' + 'A -> B: Request\n' + 'A <-- B: Response\n' + 'end B' ), }, { title: 'Numbered labels', code: 'autolabel "[]