"enable aexpr";

System.register(['active-expression-rewriting', 'reactive-jsx', 'lang', 'src/external/focalStorage.js', './../contextmenu.js', 'utils', 'active-group'], function (_export, _context) {
  "use strict";

  var _setMember, _getAndCallMember, _setLocal, _getLocal, _getMember, _getGlobal, _traceMember, _childText, _childExpression, _children, _attributeStringLiteral, _attributes, _element, focalStorage, ContextMenu, through, uuid, fileName, hintForLabel, getTempKeyFor, asDragImageFor, trackInstance;

  return {
    setters: [function (_activeExpressionRewriting) {
      _setMember = _activeExpressionRewriting.setMember;
      _getAndCallMember = _activeExpressionRewriting.getAndCallMember;
      _setLocal = _activeExpressionRewriting.setLocal;
      _getLocal = _activeExpressionRewriting.getLocal;
      _getMember = _activeExpressionRewriting.getMember;
      _getGlobal = _activeExpressionRewriting.getGlobal;
      _traceMember = _activeExpressionRewriting.traceMember;
    }, function (_reactiveJsx) {
      _childText = _reactiveJsx.childText;
      _childExpression = _reactiveJsx.childExpression;
      _children = _reactiveJsx.children;
      _attributeStringLiteral = _reactiveJsx.attributeStringLiteral;
      _attributes = _reactiveJsx.attributes;
      _element = _reactiveJsx.element;
    }, function (_lang) {}, function (_srcExternalFocalStorageJs) {
      focalStorage = _srcExternalFocalStorageJs.default;
    }, function (_contextmenuJs) {
      ContextMenu = _contextmenuJs.default;
    }, function (_utils) {
      through = _utils.through;
      uuid = _utils.uuid;
      fileName = _utils.fileName;
      hintForLabel = _utils.hintForLabel;
      getTempKeyFor = _utils.getTempKeyFor;
      asDragImageFor = _utils.asDragImageFor;
    }, function (_activeGroup) {
      trackInstance = _activeGroup.trackInstance;
    }],
    execute: function () {
      const __SystemJSRewritingHack = {};
      _recorder_._src_client_triples_triples_js = _recorder_._src_client_triples_triples_js || {};
      let _scope = {
        isScope: true
      },
          _scope20 = {
        isScope: true
      },
          _scope55 = {
        isScope: true
      };
      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_client_triples_triples_js'), 'isExternalURL', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'isExternalURL', isExternalURL) : void 0, isExternalURL;
        },

        set(thisIsVererySecretVariableName) {
          let _scope2 = {
            isScope: true
          };
          isExternalURL = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope2, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'isExternalURL', isExternalURL, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 22,
              line: 170
            },
            start: {
              column: 9,
              line: 170
            },
            source: ''
          }) : void 0, isExternalURL;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_client_triples_triples_js'), 'isInternalURL', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'isInternalURL', isInternalURL) : void 0, isInternalURL;
        },

        set(thisIsVererySecretVariableName) {
          let _scope3 = {
            isScope: true
          };
          isInternalURL = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope3, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'isInternalURL', isInternalURL, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 22,
              line: 166
            },
            start: {
              column: 9,
              line: 166
            },
            source: ''
          }) : void 0, isInternalURL;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_client_triples_triples_js'), 'parseMarkdown', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'parseMarkdown', parseMarkdown) : void 0, parseMarkdown;
        },

        set(thisIsVererySecretVariableName) {
          let _scope4 = {
            isScope: true
          };
          parseMarkdown = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope4, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'parseMarkdown', parseMarkdown, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 28,
              line: 16
            },
            start: {
              column: 15,
              line: 16
            },
            source: ''
          }) : void 0, parseMarkdown;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_client_triples_triples_js'), 'getJSYaml', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'getJSYaml', getJSYaml) : void 0, getJSYaml;
        },

        set(thisIsVererySecretVariableName) {
          let _scope5 = {
            isScope: true
          };
          getJSYaml = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope5, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'getJSYaml', getJSYaml, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 24,
              line: 9
            },
            start: {
              column: 15,
              line: 9
            },
            source: ''
          }) : void 0, getJSYaml;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_client_triples_triples_js'), 'focalStorage', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'focalStorage', focalStorage) : void 0, focalStorage;
        },

        set(thisIsVererySecretVariableName) {
          let _scope6 = {
            isScope: true
          };
          focalStorage = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope6, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'focalStorage', focalStorage, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 19,
              line: 4
            },
            start: {
              column: 7,
              line: 4
            },
            source: ''
          }) : void 0, focalStorage;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_client_triples_triples_js'), 'ContextMenu', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'ContextMenu', ContextMenu) : void 0, ContextMenu;
        },

        set(thisIsVererySecretVariableName) {
          let _scope7 = {
            isScope: true
          };
          ContextMenu = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope7, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'ContextMenu', ContextMenu, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 18,
              line: 5
            },
            start: {
              column: 7,
              line: 5
            },
            source: ''
          }) : void 0, ContextMenu;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_client_triples_triples_js'), 'asDragImageFor', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'asDragImageFor', asDragImageFor) : void 0, asDragImageFor;
        },

        set(thisIsVererySecretVariableName) {
          let _scope8 = {
            isScope: true
          };
          asDragImageFor = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope8, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'asDragImageFor', asDragImageFor, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 77,
              line: 6
            },
            start: {
              column: 63,
              line: 6
            },
            source: ''
          }) : void 0, asDragImageFor;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_client_triples_triples_js'), 'getTempKeyFor', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'getTempKeyFor', getTempKeyFor) : void 0, getTempKeyFor;
        },

        set(thisIsVererySecretVariableName) {
          let _scope9 = {
            isScope: true
          };
          getTempKeyFor = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope9, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'getTempKeyFor', getTempKeyFor, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 61,
              line: 6
            },
            start: {
              column: 48,
              line: 6
            },
            source: ''
          }) : void 0, getTempKeyFor;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_client_triples_triples_js'), 'hintForLabel', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'hintForLabel', hintForLabel) : void 0, hintForLabel;
        },

        set(thisIsVererySecretVariableName) {
          let _scope10 = {
            isScope: true
          };
          hintForLabel = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope10, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'hintForLabel', hintForLabel, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 46,
              line: 6
            },
            start: {
              column: 34,
              line: 6
            },
            source: ''
          }) : void 0, hintForLabel;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_client_triples_triples_js'), 'fileName', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'fileName', fileName) : void 0, fileName;
        },

        set(thisIsVererySecretVariableName) {
          let _scope11 = {
            isScope: true
          };
          fileName = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope11, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'fileName', fileName, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 32,
              line: 6
            },
            start: {
              column: 24,
              line: 6
            },
            source: ''
          }) : void 0, fileName;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_client_triples_triples_js'), 'uuid', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'uuid', uuid) : void 0, uuid;
        },

        set(thisIsVererySecretVariableName) {
          let _scope12 = {
            isScope: true
          };
          uuid = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope12, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'uuid', uuid, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 22,
              line: 6
            },
            start: {
              column: 18,
              line: 6
            },
            source: ''
          }) : void 0, uuid;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_client_triples_triples_js'), 'through', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'through', through) : void 0, through;
        },

        set(thisIsVererySecretVariableName) {
          let _scope13 = {
            isScope: true
          };
          through = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope13, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'through', through, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 16,
              line: 6
            },
            start: {
              column: 9,
              line: 6
            },
            source: ''
          }) : void 0, through;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_client_triples_triples_js'), 'trackInstance', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'trackInstance', trackInstance) : void 0, trackInstance;
        },

        set(thisIsVererySecretVariableName) {
          let _scope14 = {
            isScope: true
          };
          trackInstance = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope14, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'trackInstance', trackInstance, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 22,
              line: 7
            },
            start: {
              column: 9,
              line: 7
            },
            source: ''
          }) : void 0, trackInstance;
          return true;
        },

        enumerable: true,
        configurable: true
      });


      async function getJSYaml() {
        await (self.__expressionAnalysisMode__ ? _traceMember(lively, 'loadJavaScriptThroughDOM') : void 0, (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).loadJavaScriptThroughDOM("esprima", "https://lively-kernel.org/lively4/foo/src/external/esprima.js"));
        await (self.__expressionAnalysisMode__ ? _traceMember(lively, 'loadJavaScriptThroughDOM') : void 0, (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).loadJavaScriptThroughDOM("js-yaml", "https://lively-kernel.org/lively4/foo/src/external/js-yaml.js"));
        return self.__expressionAnalysisMode__ ? _getGlobal('jsyaml') : void 0, jsyaml;
      }

      // #TODO: unused
      async function parseMarkdown(markdown, filename) {
        let _scope15 = {
          isScope: true
        };

        try {
          let _scope16 = {
            isScope: true
          };

          const frontmatterSeparator = "---\r\n";
          if (self.__expressionAnalysisMode__ ? _traceMember(markdown, 'startsWith') : void 0, (markdown === Object(markdown) ? self.__expressionAnalysisMode__ ? _getLocal(_scope15, 'markdown', markdown) : void 0 : markdown, markdown).startsWith((frontmatterSeparator === Object(frontmatterSeparator) ? self.__expressionAnalysisMode__ ? _getLocal(_scope16, 'frontmatterSeparator', frontmatterSeparator) : void 0 : frontmatterSeparator, frontmatterSeparator))) {
            let _scope17 = {
              isScope: true
            };

            const parts = (self.__expressionAnalysisMode__ ? _traceMember(markdown, 'split') : void 0, (markdown === Object(markdown) ? self.__expressionAnalysisMode__ ? _getLocal(_scope15, 'markdown', markdown) : void 0 : markdown, markdown).split((frontmatterSeparator === Object(frontmatterSeparator) ? self.__expressionAnalysisMode__ ? _getLocal(_scope16, 'frontmatterSeparator', frontmatterSeparator) : void 0 : frontmatterSeparator, frontmatterSeparator)));
            if (_getMember((parts === Object(parts) ? self.__expressionAnalysisMode__ ? _getLocal(_scope17, 'parts', parts) : void 0 : parts, parts), 'length') >= 3) {
              let _scope18 = {
                isScope: true
              };
              if (self.__expressionAnalysisMode__) _traceMember(parts, 'shift');

              (parts === Object(parts) ? self.__expressionAnalysisMode__ ? _getLocal(_scope17, 'parts', parts) : void 0 : parts, parts).shift(); // empty
              const frontmatterString = (self.__expressionAnalysisMode__ ? _traceMember(parts, 'shift') : void 0, (parts === Object(parts) ? self.__expressionAnalysisMode__ ? _getLocal(_scope17, 'parts', parts) : void 0 : parts, parts).shift());
              return {
                textContent: (self.__expressionAnalysisMode__ ? _traceMember(parts, 'join') : void 0, (parts === Object(parts) ? self.__expressionAnalysisMode__ ? _getLocal(_scope17, 'parts', parts) : void 0 : parts, parts).join((frontmatterSeparator === Object(frontmatterSeparator) ? self.__expressionAnalysisMode__ ? _getLocal(_scope16, 'frontmatterSeparator', frontmatterSeparator) : void 0 : frontmatterSeparator, frontmatterSeparator))),
                metadata: _getAndCallMember((await (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'getJSYaml', getJSYaml) : void 0, getJSYaml)()), 'load', [(frontmatterString === Object(frontmatterString) ? self.__expressionAnalysisMode__ ? _getLocal(_scope18, 'frontmatterString', frontmatterString) : void 0 : frontmatterString, frontmatterString)])
              };
            }
          }
        } catch (e) {
          if (self.__expressionAnalysisMode__) _traceMember(lively, 'notify');

          (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).notify("failed frontmatter parsing", "", (self.__expressionAnalysisMode__ ? _getGlobal('undefined') : void 0, undefined), (self.__expressionAnalysisMode__ ? _getGlobal('undefined') : void 0, undefined), "red");
        }
        return {
          textContent: markdown,
          metadata: {}
        };
      }

      class Knot {
        constructor(fileName, content) {
          let _scope19 = {
            isScope: true
          };

          _setMember(this, 'fileName', (fileName === Object(fileName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope19, 'fileName', fileName) : void 0 : fileName, fileName), {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 28,
              line: 41
            },
            start: {
              column: 4,
              line: 41
            },
            source: ''
          });
          _setMember(this, 'content', (content === Object(content) ? self.__expressionAnalysisMode__ ? _getLocal(_scope19, 'content', content) : void 0 : content, content), {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 26,
              line: 42
            },
            start: {
              column: 4,
              line: 42
            },
            source: ''
          });

          if (new.target === (self.__expressionAnalysisMode__ ? _getLocal(_scope20, 'Knot', Knot) : void 0, Knot)) {
            if (self.__expressionAnalysisMode__) _traceMember(trackInstance, 'call');

            (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'trackInstance', trackInstance) : void 0, trackInstance).call((self.__expressionAnalysisMode__ ? _getLocal(_scope20, 'Knot', Knot) : void 0, Knot), this);
          }

          _setMember(this, '__classFilePath__', 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js', (self.__expressionAnalysisMode__ ? _getGlobal('undefined') : void 0, undefined));
        }
        get url() {
          return _getMember(this, 'fileName');
        }
        getMetadata() {
          return _getMember(this, 'metadata');
        }
        label() {
          if (_getAndCallMember(_getMember(this, 'fileName'), 'endsWith', ['.md'])) {
            let _scope21 = {
              isScope: true
            };

            const firstLine = _getMember(_getAndCallMember(_getMember(this, 'content'), 'split', ['\n']), 0);
            return self.__expressionAnalysisMode__ ? _traceMember(firstLine, 'replace') : void 0, (firstLine === Object(firstLine) ? self.__expressionAnalysisMode__ ? _getLocal(_scope21, 'firstLine', firstLine) : void 0 : firstLine, firstLine).replace(/^#\s/, '');
          }
          return _getMember(this, 'fileName');
        }
        isTriple() {
          return false;
        }
        async save(newContent) {
          let _scope22 = {
            isScope: true
          };

          _setMember(this, 'content', (newContent === Object(newContent) ? self.__expressionAnalysisMode__ ? _getLocal(_scope22, 'newContent', newContent) : void 0 : newContent, newContent), {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 29,
              line: 59
            },
            start: {
              column: 4,
              line: 59
            },
            source: ''
          });
          await _getAndCallMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively), 'files'), 'saveFile', [_getMember(this, 'url'), (newContent === Object(newContent) ? self.__expressionAnalysisMode__ ? _getLocal(_scope22, 'newContent', newContent) : void 0 : newContent, newContent)]);
        }
        async openViewInWindow() {
          let _scope23 = {
            isScope: true
          };

          const knotView = await (self.__expressionAnalysisMode__ ? _traceMember(lively, 'openComponentInWindow') : void 0, (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).openComponentInWindow("knot-view"));
          if (self.__expressionAnalysisMode__) _traceMember(knotView, 'loadKnotForURL');
          (knotView === Object(knotView) ? self.__expressionAnalysisMode__ ? _getLocal(_scope23, 'knotView', knotView) : void 0 : knotView, knotView).loadKnotForURL(_getMember(this, 'url'));
        }
        collectContextMenuItems() {
          return [["Knot View", evt => {
            if (self.__expressionAnalysisMode__) _traceMember(ContextMenu, 'hide');

            (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'ContextMenu', ContextMenu) : void 0, ContextMenu).hide();
            if (self.__expressionAnalysisMode__) _traceMember(this, 'openViewInWindow');
            this.openViewInWindow();
          }, "", '<i class="fa fa-window-maximize" aria-hidden="true"></i>'], ["Danger Zone", [["Delete", async evt => {
            let _scope24 = {
              isScope: true
            };
            if (self.__expressionAnalysisMode__) _traceMember(ContextMenu, 'hide');

            (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'ContextMenu', ContextMenu) : void 0, ContextMenu).hide();
            const graph = await (self.__expressionAnalysisMode__ ? _traceMember(Graph, 'getInstance') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'Graph', Graph) : void 0, Graph).getInstance());

            const label = (self.__expressionAnalysisMode__ ? _traceMember(this, 'label') : void 0, this.label());
            if (await (self.__expressionAnalysisMode__ ? _traceMember(graph, 'deleteKnot') : void 0, (graph === Object(graph) ? self.__expressionAnalysisMode__ ? _getLocal(_scope24, 'graph', graph) : void 0 : graph, graph).deleteKnot(this))) {
              if (self.__expressionAnalysisMode__) _traceMember(lively, 'notify');

              // #TODO: use reactivity to update views and search results
              (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).notify(`${(label === Object(label) ? self.__expressionAnalysisMode__ ? _getLocal(_scope24, 'label', label) : void 0 : label, label)} deleted!`, null, 4, null, "red");
            } else {
              if (self.__expressionAnalysisMode__) _traceMember(lively, 'notify');

              (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).notify('did not delete knot ' + (label === Object(label) ? self.__expressionAnalysisMode__ ? _getLocal(_scope24, 'label', label) : void 0 : label, label), _getMember(this, 'url'));
            }
          }, "Delete for good", '<i class="fa fa-trash" aria-hidden="true"></i>']]]];
        }

        toListItem() {
          let _scope25 = {
            isScope: true
          };

          const listItem = _element('li', _attributes(_attributeStringLiteral('tabindex', '1'), _attributeStringLiteral('draggable', 'true')), _children(_childExpression((self.__expressionAnalysisMode__ ? _traceMember(this, 'label') : void 0, this.label()))), {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 74,
              line: 90
            },
            start: {
              column: 21,
              line: 90
            }
          });
          _setMember((listItem === Object(listItem) ? self.__expressionAnalysisMode__ ? _getLocal(_scope25, 'listItem', listItem) : void 0 : listItem, listItem), 'knot', this, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 24,
              line: 91
            },
            start: {
              column: 4,
              line: 91
            },
            source: ''
          });

          if (self.__expressionAnalysisMode__) _traceMember(listItem, 'addEventListener');
          (listItem === Object(listItem) ? self.__expressionAnalysisMode__ ? _getLocal(_scope25, 'listItem', listItem) : void 0 : listItem, listItem).addEventListener('keydown', event => {
            let _scope26 = {
              isScope: true
            };

            if (_getMember((event === Object(event) ? self.__expressionAnalysisMode__ ? _getLocal(_scope26, 'event', event) : void 0 : event, event), 'keyCode') == 13) {
              if (self.__expressionAnalysisMode__) _traceMember(this, 'openViewInWindow');
              // ENTER
              this.openViewInWindow();
              if (self.__expressionAnalysisMode__) _traceMember(event, 'stopPropagation');
              (event === Object(event) ? self.__expressionAnalysisMode__ ? _getLocal(_scope26, 'event', event) : void 0 : event, event).stopPropagation();
              if (self.__expressionAnalysisMode__) _traceMember(event, 'preventDefault');
              (event === Object(event) ? self.__expressionAnalysisMode__ ? _getLocal(_scope26, 'event', event) : void 0 : event, event).preventDefault();
            }
          });
          if (self.__expressionAnalysisMode__) _traceMember(listItem, 'addEventListener');
          (listItem === Object(listItem) ? self.__expressionAnalysisMode__ ? _getLocal(_scope25, 'listItem', listItem) : void 0 : listItem, listItem).addEventListener("dblclick", event => {
            let _scope27 = {
              isScope: true
            };
            if (self.__expressionAnalysisMode__) _traceMember(this, 'openViewInWindow');

            this.openViewInWindow();
            if (self.__expressionAnalysisMode__) _traceMember(event, 'stopPropagation');
            (event === Object(event) ? self.__expressionAnalysisMode__ ? _getLocal(_scope27, 'event', event) : void 0 : event, event).stopPropagation();
            if (self.__expressionAnalysisMode__) _traceMember(event, 'preventDefault');
            (event === Object(event) ? self.__expressionAnalysisMode__ ? _getLocal(_scope27, 'event', event) : void 0 : event, event).preventDefault();
          });
          if (self.__expressionAnalysisMode__) _traceMember(listItem, 'addEventListener');
          (listItem === Object(listItem) ? self.__expressionAnalysisMode__ ? _getLocal(_scope25, 'listItem', listItem) : void 0 : listItem, listItem).addEventListener("contextmenu", event => {
            let _scope28 = {
              isScope: true
            };
            if (self.__expressionAnalysisMode__) _traceMember(ContextMenu, 'openIn');

            (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'ContextMenu', ContextMenu) : void 0, ContextMenu).openIn(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('document') : void 0, document), 'body'), (event === Object(event) ? self.__expressionAnalysisMode__ ? _getLocal(_scope28, 'event', event) : void 0 : event, event), this, (self.__expressionAnalysisMode__ ? _getGlobal('undefined') : void 0, undefined), (self.__expressionAnalysisMode__ ? _traceMember(this, 'collectContextMenuItems') : void 0, this.collectContextMenuItems()));
            if (self.__expressionAnalysisMode__) _traceMember(event, 'stopPropagation');
            (event === Object(event) ? self.__expressionAnalysisMode__ ? _getLocal(_scope28, 'event', event) : void 0 : event, event).stopPropagation();
            if (self.__expressionAnalysisMode__) _traceMember(event, 'preventDefault');
            (event === Object(event) ? self.__expressionAnalysisMode__ ? _getLocal(_scope28, 'event', event) : void 0 : event, event).preventDefault();
          });

          return listItem === Object(listItem) ? self.__expressionAnalysisMode__ ? _getLocal(_scope25, 'listItem', listItem) : void 0 : listItem, listItem;
        }

        asDataForDrag(evt) {
          var _context2;

          let _scope29 = {
            isScope: true
          };

          const dt = _getMember((evt === Object(evt) ? self.__expressionAnalysisMode__ ? _getLocal(_scope29, 'evt', evt) : void 0 : evt, evt), 'dataTransfer');
          //listItem.style.color = "blue";
          if (self.__expressionAnalysisMode__) _traceMember(dt, 'setData');
          (dt === Object(dt) ? self.__expressionAnalysisMode__ ? _getLocal(_scope29, 'dt', dt) : void 0 : dt, dt).setData("knot/url", _getMember(this, 'url'));
          if (self.__expressionAnalysisMode__) _traceMember(dt, 'setData');
          (dt === Object(dt) ? self.__expressionAnalysisMode__ ? _getLocal(_scope29, 'dt', dt) : void 0 : dt, dt).setData("text/uri-list", _getMember(this, 'url'));
          if (self.__expressionAnalysisMode__) _traceMember(dt, 'setData');
          (dt === Object(dt) ? self.__expressionAnalysisMode__ ? _getLocal(_scope29, 'dt', dt) : void 0 : dt, dt).setData("text/plain", _getMember(this, 'url'));
          if (self.__expressionAnalysisMode__) _traceMember(dt, 'setData');
          (dt === Object(dt) ? self.__expressionAnalysisMode__ ? _getLocal(_scope29, 'dt', dt) : void 0 : dt, dt).setData("javascript/object", (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'getTempKeyFor', getTempKeyFor) : void 0, getTempKeyFor)(this));
          const mimeType = 'text/plain';
          const filename = (_context2 = _getMember(this, 'url'), (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'fileName', fileName) : void 0, fileName)).call(_context2);
          const url = _getMember(this, 'url');
          if (self.__expressionAnalysisMode__) _traceMember(dt, 'setData');
          (dt === Object(dt) ? self.__expressionAnalysisMode__ ? _getLocal(_scope29, 'dt', dt) : void 0 : dt, dt).setData("DownloadURL", `${(mimeType === Object(mimeType) ? self.__expressionAnalysisMode__ ? _getLocal(_scope29, 'mimeType', mimeType) : void 0 : mimeType, mimeType)}:${(filename === Object(filename) ? self.__expressionAnalysisMode__ ? _getLocal(_scope29, 'filename', filename) : void 0 : filename, filename)}:${(url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope29, 'url', url) : void 0 : url, url)}`);

          // #TODO: remove duplication
          const dragInfo = _element('div', _attributes(_attributeStringLiteral('style', 'width: 150px;')), _children(_childText('\n      '), _childExpression((self.__expressionAnalysisMode__ ? _getLocal(_scope, 'hintForLabel', hintForLabel) : void 0, hintForLabel)((self.__expressionAnalysisMode__ ? _traceMember(this, 'label') : void 0, this.label()))), _childText('\n    ')), {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 10,
              line: 129
            },
            start: {
              column: 21,
              line: 127
            }
          });
          (_context2 = (dragInfo === Object(dragInfo) ? self.__expressionAnalysisMode__ ? _getLocal(_scope29, 'dragInfo', dragInfo) : void 0 : dragInfo, dragInfo), (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'asDragImageFor', asDragImageFor) : void 0, asDragImageFor)).call(_context2, (evt === Object(evt) ? self.__expressionAnalysisMode__ ? _getLocal(_scope29, 'evt', evt) : void 0 : evt, evt), 50, 60);
        }
      }

      _export('Knot', Knot);

      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_client_triples_triples_js'), 'Knot', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'Knot', Knot) : void 0, Knot;
        },

        set(thisIsVererySecretVariableName) {
          let _scope30 = {
            isScope: true
          };
          _export('Knot', Knot = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope30, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName)), true ? _setLocal(_scope, 'Knot', Knot, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 17,
              line: 39
            },
            start: {
              column: 13,
              line: 39
            },
            source: ''
          }) : void 0, Knot;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      class Triple extends Knot {
        constructor(fileName, content) {
          let _scope31 = {
            isScope: true
          };

          try {
            if (self.__expressionAnalysisMode__) _traceMember(JSON, 'parse');

            (self.__expressionAnalysisMode__ ? _getGlobal('JSON') : void 0, JSON).parse((content === Object(content) ? self.__expressionAnalysisMode__ ? _getLocal(_scope31, 'content', content) : void 0 : content, content));
          } catch (e) {
            debugger;
            if (self.__expressionAnalysisMode__) _traceMember(console, 'log');
            (self.__expressionAnalysisMode__ ? _getGlobal('console') : void 0, console).log((fileName === Object(fileName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope31, 'fileName', fileName) : void 0 : fileName, fileName));
          }

          super((fileName === Object(fileName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope31, 'fileName', fileName) : void 0 : fileName, fileName), (self.__expressionAnalysisMode__ ? _traceMember(JSON, 'parse') : void 0, (self.__expressionAnalysisMode__ ? _getGlobal('JSON') : void 0, JSON).parse((content === Object(content) ? self.__expressionAnalysisMode__ ? _getLocal(_scope31, 'content', content) : void 0 : content, content))));

          // track this Triple for ROQs after full initialization

          _setMember(this, '__classFilePath__', 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js', (self.__expressionAnalysisMode__ ? _getGlobal('undefined') : void 0, undefined));
        }

        label() {
          if (_getMember(this, 'predicate')) {
            return 't: ' + _getAndCallMember(_getMember(this, 'predicate'), 'label', []);
          }
          return _getAndCallMember(_getMember(this, 'filename'), 'replace', ['.triple.json', '']);
        }
        isTriple() {
          return true;
        }
      }

      _export('Triple', Triple);

      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_client_triples_triples_js'), 'Triple', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'Triple', Triple) : void 0, Triple;
        },

        set(thisIsVererySecretVariableName) {
          let _scope32 = {
            isScope: true
          };
          _export('Triple', Triple = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope32, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName)), true ? _setLocal(_scope, 'Triple', Triple, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 19,
              line: 134
            },
            start: {
              column: 13,
              line: 134
            },
            source: ''
          }) : void 0, Triple;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      const DEFAULT_FOLDER_URL = 'https://lively4/notes/';

      _export('DEFAULT_FOLDER_URL', DEFAULT_FOLDER_URL);

      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_client_triples_triples_js'), 'DEFAULT_FOLDER_URL', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'DEFAULT_FOLDER_URL', DEFAULT_FOLDER_URL) : void 0, DEFAULT_FOLDER_URL;
        },

        set(thisIsVererySecretVariableName) {
          let _scope33 = {
            isScope: true
          };
          _export('DEFAULT_FOLDER_URL', DEFAULT_FOLDER_URL = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope33, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName)), true ? _setLocal(_scope, 'DEFAULT_FOLDER_URL', DEFAULT_FOLDER_URL, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 31,
              line: 157
            },
            start: {
              column: 13,
              line: 157
            },
            source: ''
          }) : void 0, DEFAULT_FOLDER_URL;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      const TAG_URL = (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'DEFAULT_FOLDER_URL', DEFAULT_FOLDER_URL) : void 0, DEFAULT_FOLDER_URL) + 'tag.md';

      _export('TAG_URL', TAG_URL);

      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_client_triples_triples_js'), 'TAG_URL', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'TAG_URL', TAG_URL) : void 0, TAG_URL;
        },

        set(thisIsVererySecretVariableName) {
          let _scope34 = {
            isScope: true
          };
          _export('TAG_URL', TAG_URL = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope34, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName)), true ? _setLocal(_scope, 'TAG_URL', TAG_URL, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 20,
              line: 158
            },
            start: {
              column: 13,
              line: 158
            },
            source: ''
          }) : void 0, TAG_URL;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      const IS_A_URL = (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'DEFAULT_FOLDER_URL', DEFAULT_FOLDER_URL) : void 0, DEFAULT_FOLDER_URL) + 'is_a.md';

      _export('IS_A_URL', IS_A_URL);

      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_client_triples_triples_js'), 'IS_A_URL', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'IS_A_URL', IS_A_URL) : void 0, IS_A_URL;
        },

        set(thisIsVererySecretVariableName) {
          let _scope35 = {
            isScope: true
          };
          _export('IS_A_URL', IS_A_URL = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope35, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName)), true ? _setLocal(_scope, 'IS_A_URL', IS_A_URL, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 21,
              line: 159
            },
            start: {
              column: 13,
              line: 159
            },
            source: ''
          }) : void 0, IS_A_URL;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      const SAME_AS_URL = (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'DEFAULT_FOLDER_URL', DEFAULT_FOLDER_URL) : void 0, DEFAULT_FOLDER_URL) + 'same_as.md';

      _export('SAME_AS_URL', SAME_AS_URL);

      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_client_triples_triples_js'), 'SAME_AS_URL', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'SAME_AS_URL', SAME_AS_URL) : void 0, SAME_AS_URL;
        },

        set(thisIsVererySecretVariableName) {
          let _scope36 = {
            isScope: true
          };
          _export('SAME_AS_URL', SAME_AS_URL = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope36, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName)), true ? _setLocal(_scope, 'SAME_AS_URL', SAME_AS_URL, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 24,
              line: 160
            },
            start: {
              column: 13,
              line: 160
            },
            source: ''
          }) : void 0, SAME_AS_URL;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      const CONTAINS_URL = (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'DEFAULT_FOLDER_URL', DEFAULT_FOLDER_URL) : void 0, DEFAULT_FOLDER_URL) + 'contains.md';

      _export('CONTAINS_URL', CONTAINS_URL);

      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_client_triples_triples_js'), 'CONTAINS_URL', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'CONTAINS_URL', CONTAINS_URL) : void 0, CONTAINS_URL;
        },

        set(thisIsVererySecretVariableName) {
          let _scope37 = {
            isScope: true
          };
          _export('CONTAINS_URL', CONTAINS_URL = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope37, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName)), true ? _setLocal(_scope, 'CONTAINS_URL', CONTAINS_URL, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 25,
              line: 161
            },
            start: {
              column: 13,
              line: 161
            },
            source: ''
          }) : void 0, CONTAINS_URL;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      const ROOT_KNOWLEDGE_BASES_KEY = 'triple-notes-root-knowledge-bases';
      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_client_triples_triples_js'), 'ROOT_KNOWLEDGE_BASES_KEY', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'ROOT_KNOWLEDGE_BASES_KEY', ROOT_KNOWLEDGE_BASES_KEY) : void 0, ROOT_KNOWLEDGE_BASES_KEY;
        },

        set(thisIsVererySecretVariableName) {
          let _scope38 = {
            isScope: true
          };
          ROOT_KNOWLEDGE_BASES_KEY = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope38, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'ROOT_KNOWLEDGE_BASES_KEY', ROOT_KNOWLEDGE_BASES_KEY, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 30,
              line: 163
            },
            start: {
              column: 6,
              line: 163
            },
            source: ''
          }) : void 0, ROOT_KNOWLEDGE_BASES_KEY;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      const PREFERRED_KNOWLEDGE_BASE_KEY = 'triple-notes-preferred-knowledge-base';

      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_client_triples_triples_js'), 'PREFERRED_KNOWLEDGE_BASE_KEY', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'PREFERRED_KNOWLEDGE_BASE_KEY', PREFERRED_KNOWLEDGE_BASE_KEY) : void 0, PREFERRED_KNOWLEDGE_BASE_KEY;
        },

        set(thisIsVererySecretVariableName) {
          let _scope39 = {
            isScope: true
          };
          PREFERRED_KNOWLEDGE_BASE_KEY = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope39, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'PREFERRED_KNOWLEDGE_BASE_KEY', PREFERRED_KNOWLEDGE_BASE_KEY, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 34,
              line: 164
            },
            start: {
              column: 6,
              line: 164
            },
            source: ''
          }) : void 0, PREFERRED_KNOWLEDGE_BASE_KEY;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      function isInternalURL(url) {
        let _scope40 = {
          isScope: true
        };

        const origin = _getMember((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope40, 'url', url) : void 0 : url, url), 'origin');
        return (origin === Object(origin) ? self.__expressionAnalysisMode__ ? _getLocal(_scope40, 'origin', origin) : void 0 : origin, origin) === 'https://lively4' || (origin === Object(origin) ? self.__expressionAnalysisMode__ ? _getLocal(_scope40, 'origin', origin) : void 0 : origin, origin) === 'https://localhost:8800';
      }
      function isExternalURL(url) {
        let _scope41 = {
          isScope: true
        };
        return !(self.__expressionAnalysisMode__ ? _getLocal(_scope, 'isInternalURL', isInternalURL) : void 0, isInternalURL)((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope41, 'url', url) : void 0 : url, url));
      }

      class Graph {
        constructor() {
          _setMember(this, 'knots', [], {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 19,
              line: 174
            },
            start: {
              column: 4,
              line: 174
            },
            source: ''
          });
          _setMember(this, 'loadedDirectoryPromises', new (self.__expressionAnalysisMode__ ? _getGlobal('Map') : void 0, Map)(), {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 44,
              line: 175
            },
            start: {
              column: 4,
              line: 175
            },
            source: ''
          });
          // url string -> Promise for Knot
          _setMember(this, 'requestedKnots', new (self.__expressionAnalysisMode__ ? _getGlobal('Map') : void 0, Map)(), {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 35,
              line: 177
            },
            start: {
              column: 4,
              line: 177
            },
            source: ''
          });

          _setMember(this, '__classFilePath__', 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js', (self.__expressionAnalysisMode__ ? _getGlobal('undefined') : void 0, undefined));
        }
        async prepare() {
          let _scope42 = {
            isScope: true
          };

          const rootKnowledgeBases = await (self.__expressionAnalysisMode__ ? _traceMember(this, 'getRootKnowledgeBases') : void 0, this.getRootKnowledgeBases());
          return self.__expressionAnalysisMode__ ? _traceMember(Promise, 'all') : void 0, (self.__expressionAnalysisMode__ ? _getGlobal('Promise') : void 0, Promise).all((self.__expressionAnalysisMode__ ? _traceMember(rootKnowledgeBases, 'map') : void 0, (rootKnowledgeBases === Object(rootKnowledgeBases) ? self.__expressionAnalysisMode__ ? _getLocal(_scope42, 'rootKnowledgeBases', rootKnowledgeBases) : void 0 : rootKnowledgeBases, rootKnowledgeBases).map(this.loadFromDir.bind(this))));
        }

        async getRootKnowledgeBases() {
          return (await (self.__expressionAnalysisMode__ ? _traceMember(focalStorage, 'getItem') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'focalStorage', focalStorage) : void 0, focalStorage).getItem((self.__expressionAnalysisMode__ ? _getLocal(_scope, 'ROOT_KNOWLEDGE_BASES_KEY', ROOT_KNOWLEDGE_BASES_KEY) : void 0, ROOT_KNOWLEDGE_BASES_KEY)))) || [(self.__expressionAnalysisMode__ ? _getLocal(_scope, 'DEFAULT_FOLDER_URL', DEFAULT_FOLDER_URL) : void 0, DEFAULT_FOLDER_URL)];
        }

        async addRootKnowledgeBase(urlString) {
          let _scope43 = {
            isScope: true
          },
              _scope45 = {
            isScope: true
          };

          try {
            let _scope44 = {
              isScope: true
            };

            new (self.__expressionAnalysisMode__ ? _getGlobal('URL') : void 0, URL)((urlString === Object(urlString) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'urlString', urlString) : void 0 : urlString, urlString));
            const stats = (self.__expressionAnalysisMode__ ? _traceMember(JSON, 'parse') : void 0, (self.__expressionAnalysisMode__ ? _getGlobal('JSON') : void 0, JSON).parse((await _getAndCallMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively), 'files'), 'statFile', [(urlString === Object(urlString) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'urlString', urlString) : void 0 : urlString, urlString)]))));
            if (!(stats === Object(stats) ? self.__expressionAnalysisMode__ ? _getLocal(_scope44, 'stats', stats) : void 0 : stats, stats) || _getMember((stats === Object(stats) ? self.__expressionAnalysisMode__ ? _getLocal(_scope44, 'stats', stats) : void 0 : stats, stats), 'type') !== "directory") {
              throw new (self.__expressionAnalysisMode__ ? _getGlobal('Error') : void 0, Error)((stats === Object(stats) ? self.__expressionAnalysisMode__ ? _getLocal(_scope44, 'stats', stats) : void 0 : stats, stats));
            }
          } catch (e) {
            if (self.__expressionAnalysisMode__) _traceMember(lively, 'notify');

            (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).notify(`Knowledge base ${(urlString === Object(urlString) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'urlString', urlString) : void 0 : urlString, urlString)} not valid.`, _getMember((e === Object(e) ? self.__expressionAnalysisMode__ ? _getLocal(_scope45, 'e', e) : void 0 : e, e), 'message'), (self.__expressionAnalysisMode__ ? _getGlobal('undefined') : void 0, undefined), (self.__expressionAnalysisMode__ ? _getGlobal('undefined') : void 0, undefined), "red");
            return;
          }

          const rootKnowledgeBases = (await (self.__expressionAnalysisMode__ ? _traceMember(this, 'getRootKnowledgeBases') : void 0, this.getRootKnowledgeBases())) || [];
          if (!(self.__expressionAnalysisMode__ ? _traceMember(rootKnowledgeBases, 'includes') : void 0, (rootKnowledgeBases === Object(rootKnowledgeBases) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'rootKnowledgeBases', rootKnowledgeBases) : void 0 : rootKnowledgeBases, rootKnowledgeBases).includes((urlString === Object(urlString) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'urlString', urlString) : void 0 : urlString, urlString)))) {
            if (self.__expressionAnalysisMode__) _traceMember(rootKnowledgeBases, 'push');

            (rootKnowledgeBases === Object(rootKnowledgeBases) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'rootKnowledgeBases', rootKnowledgeBases) : void 0 : rootKnowledgeBases, rootKnowledgeBases).push((urlString === Object(urlString) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'urlString', urlString) : void 0 : urlString, urlString));
            await (self.__expressionAnalysisMode__ ? _traceMember(focalStorage, 'setItem') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'focalStorage', focalStorage) : void 0, focalStorage).setItem((self.__expressionAnalysisMode__ ? _getLocal(_scope, 'ROOT_KNOWLEDGE_BASES_KEY', ROOT_KNOWLEDGE_BASES_KEY) : void 0, ROOT_KNOWLEDGE_BASES_KEY), (rootKnowledgeBases === Object(rootKnowledgeBases) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'rootKnowledgeBases', rootKnowledgeBases) : void 0 : rootKnowledgeBases, rootKnowledgeBases)));
            return await (self.__expressionAnalysisMode__ ? _traceMember(this, 'loadFromDir') : void 0, this.loadFromDir((urlString === Object(urlString) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'urlString', urlString) : void 0 : urlString, urlString)));
          }
        }

        async removeRootKnowledgeBase(urlString) {
          let _scope46 = {
            isScope: true
          };

          let rootKnowledgeBases = (await (self.__expressionAnalysisMode__ ? _traceMember(this, 'getRootKnowledgeBases') : void 0, this.getRootKnowledgeBases())) || [];
          if (self.__expressionAnalysisMode__ ? _traceMember(rootKnowledgeBases, 'includes') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope46, 'rootKnowledgeBases', rootKnowledgeBases) : void 0, rootKnowledgeBases).includes((urlString === Object(urlString) ? self.__expressionAnalysisMode__ ? _getLocal(_scope46, 'urlString', urlString) : void 0 : urlString, urlString))) {
            // remove via filter
            rootKnowledgeBases = (self.__expressionAnalysisMode__ ? _traceMember(rootKnowledgeBases, 'filter') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope46, 'rootKnowledgeBases', rootKnowledgeBases) : void 0, rootKnowledgeBases).filter(rootBase => {
              let _scope47 = {
                isScope: true
              };
              return (rootBase === Object(rootBase) ? self.__expressionAnalysisMode__ ? _getLocal(_scope47, 'rootBase', rootBase) : void 0 : rootBase, rootBase) !== (urlString === Object(urlString) ? self.__expressionAnalysisMode__ ? _getLocal(_scope46, 'urlString', urlString) : void 0 : urlString, urlString);
            })), true ? _setLocal(_scope46, 'rootKnowledgeBases', rootKnowledgeBases, {
              file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
              end: {
                column: 88,
                line: 215
              },
              start: {
                column: 6,
                line: 215
              },
              source: ''
            }) : void 0, rootKnowledgeBases;
            await (self.__expressionAnalysisMode__ ? _traceMember(focalStorage, 'setItem') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'focalStorage', focalStorage) : void 0, focalStorage).setItem((self.__expressionAnalysisMode__ ? _getLocal(_scope, 'ROOT_KNOWLEDGE_BASES_KEY', ROOT_KNOWLEDGE_BASES_KEY) : void 0, ROOT_KNOWLEDGE_BASES_KEY), (self.__expressionAnalysisMode__ ? _getLocal(_scope46, 'rootKnowledgeBases', rootKnowledgeBases) : void 0, rootKnowledgeBases)));
            return true;
          } else {
            return false;
          }
        }

        getKnots() {
          return _getMember(this, 'knots');
        }
        hasKnotWithURL(url) {
          let _scope49 = {
            isScope: true
          };

          return !!_getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(this, 'getKnots') : void 0, this.getKnots()), 'find', [knot => {
            let _scope48 = {
              isScope: true
            };
            return _getMember((knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope48, 'knot', knot) : void 0 : knot, knot), 'url') === (url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope49, 'url', url) : void 0 : url, url);
          }]);
        }
        get triples() {
          return _getAndCallMember(_getMember(this, 'knots'), 'filter', [knot => {
            let _scope50 = {
              isScope: true
            };
            return self.__expressionAnalysisMode__ ? _traceMember(knot, 'isTriple') : void 0, (knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope50, 'knot', knot) : void 0 : knot, knot).isTriple();
          }]);
        }
        async deleteKnot(knot) {
          let _scope51 = {
            isScope: true
          };

          // check for triples on top of the knot
          const referingTriples = _getAndCallMember(_getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(this, 'query') : void 0, this.query((knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope51, 'knot', knot) : void 0 : knot, knot), (self.__expressionAnalysisMode__ ? _getLocal(_scope, '_', _) : void 0, _), (self.__expressionAnalysisMode__ ? _getLocal(_scope, '_', _) : void 0, _))), 'concat', [(self.__expressionAnalysisMode__ ? _traceMember(this, 'query') : void 0, this.query((self.__expressionAnalysisMode__ ? _getLocal(_scope, '_', _) : void 0, _), (knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope51, 'knot', knot) : void 0 : knot, knot), (self.__expressionAnalysisMode__ ? _getLocal(_scope, '_', _) : void 0, _)))]), 'concat', [(self.__expressionAnalysisMode__ ? _traceMember(this, 'query') : void 0, this.query((self.__expressionAnalysisMode__ ? _getLocal(_scope, '_', _) : void 0, _), (self.__expressionAnalysisMode__ ? _getLocal(_scope, '_', _) : void 0, _), (knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope51, 'knot', knot) : void 0 : knot, knot)))]);
          if (_getMember((referingTriples === Object(referingTriples) ? self.__expressionAnalysisMode__ ? _getLocal(_scope51, 'referingTriples', referingTriples) : void 0 : referingTriples, referingTriples), 'length') > 0) {
            if (self.__expressionAnalysisMode__) _traceMember(lively, 'notify');

            (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).notify('Deletion aborted!', `${_getMember((referingTriples === Object(referingTriples) ? self.__expressionAnalysisMode__ ? _getLocal(_scope51, 'referingTriples', referingTriples) : void 0 : referingTriples, referingTriples), 'length')} triples refer to this knot.`);
            return false;
          }

          let url = _getMember((knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope51, 'knot', knot) : void 0 : knot, knot), 'url');
          if (!(self.__expressionAnalysisMode__ ? _traceMember(window, 'confirm') : void 0, (self.__expressionAnalysisMode__ ? _getGlobal('window') : void 0, window).confirm("delete knot " + (url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope51, 'url', url) : void 0 : url, url)))) {
            return false;
          }

          let index = _getAndCallMember(_getMember(this, 'knots'), 'indexOf', [(knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope51, 'knot', knot) : void 0 : knot, knot)]);
          if ((index === Object(index) ? self.__expressionAnalysisMode__ ? _getLocal(_scope51, 'index', index) : void 0 : index, index) > -1) {
            _getAndCallMember(_getMember(this, 'knots'), 'splice', [(index === Object(index) ? self.__expressionAnalysisMode__ ? _getLocal(_scope51, 'index', index) : void 0 : index, index), 1]);
            if (self.__expressionAnalysisMode__) _traceMember(lively, 'notify');
            (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).notify(`Removed knot ${(url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope51, 'url', url) : void 0 : url, url)} in local graph instance.`);
          } else {
            if (self.__expressionAnalysisMode__) _traceMember(lively, 'notify');

            (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).notify(`Did not find knot ${(url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope51, 'url', url) : void 0 : url, url)} in local graph instance.`);
          }

          let urlURL = new (self.__expressionAnalysisMode__ ? _getGlobal('URL') : void 0, URL)((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope51, 'url', url) : void 0 : url, url));
          if (!(self.__expressionAnalysisMode__ ? _getLocal(_scope, 'isInternalURL', isInternalURL) : void 0, isInternalURL)((urlURL === Object(urlURL) ? self.__expressionAnalysisMode__ ? _getLocal(_scope51, 'urlURL', urlURL) : void 0 : urlURL, urlURL))) {
            var result = await _getAndCallMember((self.__expressionAnalysisMode__ ? _getGlobal('fetch') : void 0, fetch)((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope51, 'url', url) : void 0 : url, url), { method: 'DELETE' }), 'then', [r => {
              let _scope52 = {
                isScope: true
              };
              return self.__expressionAnalysisMode__ ? _traceMember(r, 'text') : void 0, (r === Object(r) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'r', r) : void 0 : r, r).text();
            }]);
            if (self.__expressionAnalysisMode__) _traceMember(lively, 'notify');
            (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).notify(`Deleted knot ${(url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope51, 'url', url) : void 0 : url, url)} in remote storage`, (result === Object(result) ? self.__expressionAnalysisMode__ ? _getLocal(_scope51, 'result', result) : void 0 : result, result));
          }

          if (self.__expressionAnalysisMode__) _traceMember(lively, 'notify');
          (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).notify('Knot removed from graph.');

          return true;
        }

        async createReferree(triple, propName) {
          let _scope53 = {
            isScope: true
          };

          let subjectUrlString = _getMember(_getMember((triple === Object(triple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope53, 'triple', triple) : void 0 : triple, triple), 'content'), (propName === Object(propName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope53, 'propName', propName) : void 0 : propName, propName));
          let subjectUrl = new (self.__expressionAnalysisMode__ ? _getGlobal('URL') : void 0, URL)((subjectUrlString === Object(subjectUrlString) ? self.__expressionAnalysisMode__ ? _getLocal(_scope53, 'subjectUrlString', subjectUrlString) : void 0 : subjectUrlString, subjectUrlString), _getMember((triple === Object(triple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope53, 'triple', triple) : void 0 : triple, triple), 'fileName'));
          let searchString = (self.__expressionAnalysisMode__ ? _traceMember(subjectUrl, 'toString') : void 0, (subjectUrl === Object(subjectUrl) ? self.__expressionAnalysisMode__ ? _getLocal(_scope53, 'subjectUrl', subjectUrl) : void 0 : subjectUrl, subjectUrl).toString());

          let subject = await (self.__expressionAnalysisMode__ ? _traceMember(this, 'requestKnot') : void 0, this.requestKnot((subjectUrl === Object(subjectUrl) ? self.__expressionAnalysisMode__ ? _getLocal(_scope53, 'subjectUrl', subjectUrl) : void 0 : subjectUrl, subjectUrl)));
          //let subject = this.knots.find(knot => knot.fileName === searchString);
          if (subject === Object(subject) ? self.__expressionAnalysisMode__ ? _getLocal(_scope53, 'subject', subject) : void 0 : subject, subject) {
            _setMember((triple === Object(triple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope53, 'triple', triple) : void 0 : triple, triple), (propName === Object(propName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope53, 'propName', propName) : void 0 : propName, propName), (subject === Object(subject) ? self.__expressionAnalysisMode__ ? _getLocal(_scope53, 'subject', subject) : void 0 : subject, subject), {
              file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
              end: {
                column: 32,
                line: 273
              },
              start: {
                column: 6,
                line: 273
              },
              source: ''
            });
          } else {
            throw new (self.__expressionAnalysisMode__ ? _getGlobal('Error') : void 0, Error)(`${(searchString === Object(searchString) ? self.__expressionAnalysisMode__ ? _getLocal(_scope53, 'searchString', searchString) : void 0 : searchString, searchString)} ${_getMember((triple === Object(triple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope53, 'triple', triple) : void 0 : triple, triple), 'fileName')} external referrees not yet implemented!`);
          }
        }
        async linkUpTriple(triple) {
          let _scope54 = {
            isScope: true
          };

          return self.__expressionAnalysisMode__ ? _traceMember(Promise, 'all') : void 0, (self.__expressionAnalysisMode__ ? _getGlobal('Promise') : void 0, Promise).all([(self.__expressionAnalysisMode__ ? _traceMember(this, 'createReferree') : void 0, this.createReferree((triple === Object(triple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope54, 'triple', triple) : void 0 : triple, triple), 'subject')), (self.__expressionAnalysisMode__ ? _traceMember(this, 'createReferree') : void 0, this.createReferree((triple === Object(triple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope54, 'triple', triple) : void 0 : triple, triple), 'predicate')), (self.__expressionAnalysisMode__ ? _traceMember(this, 'createReferree') : void 0, this.createReferree((triple === Object(triple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope54, 'triple', triple) : void 0 : triple, triple), 'object'))]);
        }

        static async getInstance() {
          if (!_getMember(this, 'instance')) {
            _setMember(this, 'instance', new (self.__expressionAnalysisMode__ ? _getLocal(_scope55, 'Graph', Graph) : void 0, Graph)(), {
              file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
              end: {
                column: 33,
                line: 288
              },
              start: {
                column: 6,
                line: 288
              },
              source: ''
            });
          }

          await _getAndCallMember(_getMember(this, 'instance'), 'prepare', []);

          return _getMember(this, 'instance');
        }
        static clearInstance() {
          _setMember(this, 'instance', (self.__expressionAnalysisMode__ ? _getGlobal('undefined') : void 0, undefined), {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 29,
              line: 296
            },
            start: {
              column: 4,
              line: 296
            },
            source: ''
          });
        }

        query(s, p, o) {
          let _scope56 = {
            isScope: true
          };

          return _getAndCallMember(_getAndCallMember(_getAndCallMember(_getMember(this, 'triples'), 'filter', [triple => {
            let _scope57 = {
              isScope: true
            };
            return (s === Object(s) ? self.__expressionAnalysisMode__ ? _getLocal(_scope56, 's', s) : void 0 : s, s) === (self.__expressionAnalysisMode__ ? _getLocal(_scope, '_', _) : void 0, _) || _getMember((triple === Object(triple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope57, 'triple', triple) : void 0 : triple, triple), 'subject') === (s === Object(s) ? self.__expressionAnalysisMode__ ? _getLocal(_scope56, 's', s) : void 0 : s, s);
          }]), 'filter', [triple => {
            let _scope58 = {
              isScope: true
            };
            return (p === Object(p) ? self.__expressionAnalysisMode__ ? _getLocal(_scope56, 'p', p) : void 0 : p, p) === (self.__expressionAnalysisMode__ ? _getLocal(_scope, '_', _) : void 0, _) || _getMember((triple === Object(triple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope58, 'triple', triple) : void 0 : triple, triple), 'predicate') === (p === Object(p) ? self.__expressionAnalysisMode__ ? _getLocal(_scope56, 'p', p) : void 0 : p, p);
          }]), 'filter', [triple => {
            let _scope59 = {
              isScope: true
            };
            return (o === Object(o) ? self.__expressionAnalysisMode__ ? _getLocal(_scope56, 'o', o) : void 0 : o, o) === (self.__expressionAnalysisMode__ ? _getLocal(_scope, '_', _) : void 0, _) || _getMember((triple === Object(triple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope59, 'triple', triple) : void 0 : triple, triple), 'object') === (o === Object(o) ? self.__expressionAnalysisMode__ ? _getLocal(_scope56, 'o', o) : void 0 : o, o);
          }]);
        }

        getUrlsByKnot(knot) {
          let _scope60 = {
            isScope: true
          };

          // TODO: we simply return the single reference url for now
          return [_getMember((knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope60, 'knot', knot) : void 0 : knot, knot), 'fileName')];
        }

        // returns a promise for the Knot
        async requestKnot(url) {
          let _scope61 = {
            isScope: true
          };

          const filePath = (self.__expressionAnalysisMode__ ? _traceMember(url, 'toString') : void 0, (url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope61, 'url', url) : void 0 : url, url).toString());
          if (!_getAndCallMember(_getMember(this, 'requestedKnots'), 'has', [(filePath === Object(filePath) ? self.__expressionAnalysisMode__ ? _getLocal(_scope61, 'filePath', filePath) : void 0 : filePath, filePath)])) {
            _getAndCallMember(_getMember(this, 'requestedKnots'), 'set', [(filePath === Object(filePath) ? self.__expressionAnalysisMode__ ? _getLocal(_scope61, 'filePath', filePath) : void 0 : filePath, filePath), (self.__expressionAnalysisMode__ ? _traceMember(this, 'loadSingleKnot') : void 0, this.loadSingleKnot((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope61, 'url', url) : void 0 : url, url)))]);
          }
          return _getAndCallMember(_getMember(this, 'requestedKnots'), 'get', [(filePath === Object(filePath) ? self.__expressionAnalysisMode__ ? _getLocal(_scope61, 'filePath', filePath) : void 0 : filePath, filePath)]);
        }

        async loadSingleKnot(urlOrString) {
          let _scope62 = {
            isScope: true
          };

          const url = new (self.__expressionAnalysisMode__ ? _getGlobal('URL') : void 0, URL)((urlOrString === Object(urlOrString) ? self.__expressionAnalysisMode__ ? _getLocal(_scope62, 'urlOrString', urlOrString) : void 0 : urlOrString, urlOrString));

          let fileName = (self.__expressionAnalysisMode__ ? _traceMember(url, 'toString') : void 0, (url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope62, 'url', url) : void 0 : url, url).toString());
          let text = (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'isExternalURL', isExternalURL) : void 0, isExternalURL)((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope62, 'url', url) : void 0 : url, url)) ? _getMember((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope62, 'url', url) : void 0 : url, url), 'hostname') + _getMember((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope62, 'url', url) : void 0 : url, url), 'pathname') : await _getAndCallMember(_getAndCallMember((self.__expressionAnalysisMode__ ? _getGlobal('fetch') : void 0, fetch)((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope62, 'url', url) : void 0 : url, url)), 'then', [r => {
            let _scope63 = {
              isScope: true
            };
            return self.__expressionAnalysisMode__ ? _traceMember(r, 'text') : void 0, (r === Object(r) ? self.__expressionAnalysisMode__ ? _getLocal(_scope63, 'r', r) : void 0 : r, r).text();
          }]), 'catch', [err => {
            let _scope64 = {
              isScope: true
            };
            return `ERROR loading this knot: ${(err === Object(err) ? self.__expressionAnalysisMode__ ? _getLocal(_scope64, 'err', err) : void 0 : err, err)}`;
          }]);

          // deserializeKnot
          const isTriple = (self.__expressionAnalysisMode__ ? _traceMember(fileName, 'endsWith') : void 0, (fileName === Object(fileName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope62, 'fileName', fileName) : void 0 : fileName, fileName).endsWith(".triple.json"));

          let knot;
          if (isTriple === Object(isTriple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope62, 'isTriple', isTriple) : void 0 : isTriple, isTriple) {
            knot = new (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'Triple', Triple) : void 0, Triple)((fileName === Object(fileName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope62, 'fileName', fileName) : void 0 : fileName, fileName), (text === Object(text) ? self.__expressionAnalysisMode__ ? _getLocal(_scope62, 'text', text) : void 0 : text, text)), true ? _setLocal(_scope62, 'knot', knot, {
              file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
              end: {
                column: 39,
                line: 333
              },
              start: {
                column: 6,
                line: 333
              },
              source: ''
            }) : void 0, knot;
            await (self.__expressionAnalysisMode__ ? _traceMember(this, 'linkUpTriple') : void 0, this.linkUpTriple((self.__expressionAnalysisMode__ ? _getLocal(_scope62, 'knot', knot) : void 0, knot)));
            if (self.__expressionAnalysisMode__) _traceMember(trackInstance, 'call');
            (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'trackInstance', trackInstance) : void 0, trackInstance).call((self.__expressionAnalysisMode__ ? _getLocal(_scope, 'Triple', Triple) : void 0, Triple), (self.__expressionAnalysisMode__ ? _getLocal(_scope62, 'knot', knot) : void 0, knot));
          } else {
            knot = new (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'Knot', Knot) : void 0, Knot)((fileName === Object(fileName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope62, 'fileName', fileName) : void 0 : fileName, fileName), (text === Object(text) ? self.__expressionAnalysisMode__ ? _getLocal(_scope62, 'text', text) : void 0 : text, text)), true ? _setLocal(_scope62, 'knot', knot, {
              file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
              end: {
                column: 37,
                line: 337
              },
              start: {
                column: 6,
                line: 337
              },
              source: ''
            }) : void 0, knot;
          }

          _getAndCallMember(_getMember(this, 'knots'), 'push', [(self.__expressionAnalysisMode__ ? _getLocal(_scope62, 'knot', knot) : void 0, knot)]);

          return self.__expressionAnalysisMode__ ? _getLocal(_scope62, 'knot', knot) : void 0, knot;
        }

        async loadFromDir(directory) {
          let _scope65 = {
            isScope: true
          };

          if (!_getAndCallMember(_getMember(this, 'loadedDirectoryPromises'), 'has', [(directory === Object(directory) ? self.__expressionAnalysisMode__ ? _getLocal(_scope65, 'directory', directory) : void 0 : directory, directory)])) {
            _getAndCallMember(_getMember(this, 'loadedDirectoryPromises'), 'set', [(directory === Object(directory) ? self.__expressionAnalysisMode__ ? _getLocal(_scope65, 'directory', directory) : void 0 : directory, directory), new (self.__expressionAnalysisMode__ ? _getGlobal('Promise') : void 0, Promise)(async resolve => {
              let _scope66 = {
                isScope: true
              };

              const progress = await (self.__expressionAnalysisMode__ ? _traceMember(lively, 'showProgress') : void 0, (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).showProgress(`loading dir ${(directory === Object(directory) ? self.__expressionAnalysisMode__ ? _getLocal(_scope65, 'directory', directory) : void 0 : directory, directory)}`));
              _setMember((progress === Object(progress) ? self.__expressionAnalysisMode__ ? _getLocal(_scope66, 'progress', progress) : void 0 : progress, progress), 'value', 0, {
                file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
                end: {
                  column: 26,
                  line: 349
                },
                start: {
                  column: 8,
                  line: 349
                },
                source: ''
              });

              const directoryURL = new (self.__expressionAnalysisMode__ ? _getGlobal('URL') : void 0, URL)((directory === Object(directory) ? self.__expressionAnalysisMode__ ? _getLocal(_scope65, 'directory', directory) : void 0 : directory, directory));
              const json = await _getAndCallMember((self.__expressionAnalysisMode__ ? _getGlobal('fetch') : void 0, fetch)((directory === Object(directory) ? self.__expressionAnalysisMode__ ? _getLocal(_scope65, 'directory', directory) : void 0 : directory, directory), { method: 'OPTIONS' }), 'then', [r => {
                let _scope67 = {
                  isScope: true
                };
                return self.__expressionAnalysisMode__ ? _traceMember(r, 'json') : void 0, (r === Object(r) ? self.__expressionAnalysisMode__ ? _getLocal(_scope67, 'r', r) : void 0 : r, r).json();
              }]);
              const fileNames = _getAndCallMember(_getAndCallMember(_getMember((json === Object(json) ? self.__expressionAnalysisMode__ ? _getLocal(_scope66, 'json', json) : void 0 : json, json), 'contents'), 'filter', [desc => {
                let _scope68 = {
                  isScope: true
                };
                return _getMember((desc === Object(desc) ? self.__expressionAnalysisMode__ ? _getLocal(_scope68, 'desc', desc) : void 0 : desc, desc), 'type') === "file";
              }]), 'map', [desc => {
                let _scope69 = {
                  isScope: true
                };
                return _getMember((desc === Object(desc) ? self.__expressionAnalysisMode__ ? _getLocal(_scope69, 'desc', desc) : void 0 : desc, desc), 'name');
              }]);

              const total = _getMember((fileNames === Object(fileNames) ? self.__expressionAnalysisMode__ ? _getLocal(_scope66, 'fileNames', fileNames) : void 0 : fileNames, fileNames), 'length');
              let i = 0;
              const pool = new (self.__expressionAnalysisMode__ ? _getGlobal('Set') : void 0, Set)();
              const limit = 100;
              const arr = [1, 2, 3, 4, 5, 6];
              let ii = 0;
              const groups = (self.__expressionAnalysisMode__ ? _traceMember(fileNames, 'groupBy') : void 0, (fileNames === Object(fileNames) ? self.__expressionAnalysisMode__ ? _getLocal(_scope66, 'fileNames', fileNames) : void 0 : fileNames, fileNames).groupBy((...args) => {
                return _getAndCallMember(((ii += 1, true ? _setLocal(_scope66, 'ii', ii, {
                  file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
                  end: {
                    column: 59,
                    line: 363
                  },
                  start: {
                    column: 55,
                    line: 363
                  },
                  source: ''
                }) : void 0, ii) - 1) / (limit === Object(limit) ? self.__expressionAnalysisMode__ ? _getLocal(_scope66, 'limit', limit) : void 0 : limit, limit), 'floor', []);
              }));
              for (let group of (self.__expressionAnalysisMode__ ? _traceMember(Object, 'values') : void 0, (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).values((groups === Object(groups) ? self.__expressionAnalysisMode__ ? _getLocal(_scope66, 'groups', groups) : void 0 : groups, groups)))) {
                let _scope70 = {
                  isScope: true
                };

                await (self.__expressionAnalysisMode__ ? _traceMember(Promise, 'all') : void 0, (self.__expressionAnalysisMode__ ? _getGlobal('Promise') : void 0, Promise).all((self.__expressionAnalysisMode__ ? _traceMember(group, 'map') : void 0, (group === Object(group) ? self.__expressionAnalysisMode__ ? _getLocal(_scope70, 'group', group) : void 0 : group, group).map(fileName => {
                  let _scope71 = {
                    isScope: true
                  };

                  const knotURL = new (self.__expressionAnalysisMode__ ? _getGlobal('URL') : void 0, URL)((fileName === Object(fileName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope71, 'fileName', fileName) : void 0 : fileName, fileName), (directoryURL === Object(directoryURL) ? self.__expressionAnalysisMode__ ? _getLocal(_scope66, 'directoryURL', directoryURL) : void 0 : directoryURL, directoryURL));
                  const prom = (self.__expressionAnalysisMode__ ? _traceMember(this, 'requestKnot') : void 0, this.requestKnot((knotURL === Object(knotURL) ? self.__expressionAnalysisMode__ ? _getLocal(_scope71, 'knotURL', knotURL) : void 0 : knotURL, knotURL)));
                  _setMember((progress === Object(progress) ? self.__expressionAnalysisMode__ ? _getLocal(_scope66, 'progress', progress) : void 0 : progress, progress), 'value', ((i += 1, true ? _setLocal(_scope66, 'i', i, {
                    file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
                    end: {
                      column: 32,
                      line: 368
                    },
                    start: {
                      column: 29,
                      line: 368
                    },
                    source: ''
                  }) : void 0, i) - 1) / (total === Object(total) ? self.__expressionAnalysisMode__ ? _getLocal(_scope66, 'total', total) : void 0 : total, total), {
                    file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
                    end: {
                      column: 40,
                      line: 368
                    },
                    start: {
                      column: 12,
                      line: 368
                    },
                    source: ''
                  });
                  return prom === Object(prom) ? self.__expressionAnalysisMode__ ? _getLocal(_scope71, 'prom', prom) : void 0 : prom, prom;
                }))));
              }

              await (resolve === Object(resolve) ? self.__expressionAnalysisMode__ ? _getLocal(_scope66, 'resolve', resolve) : void 0 : resolve, resolve)();
              await (self.__expressionAnalysisMode__ ? _traceMember(progress, 'remove') : void 0, (progress === Object(progress) ? self.__expressionAnalysisMode__ ? _getLocal(_scope66, 'progress', progress) : void 0 : progress, progress).remove());
            })]);
          }
          return _getAndCallMember(_getMember(this, 'loadedDirectoryPromises'), 'get', [(directory === Object(directory) ? self.__expressionAnalysisMode__ ? _getLocal(_scope65, 'directory', directory) : void 0 : directory, directory)]);
        }

        escapeSpecialCharacters(str) {
          let _scope72 = {
            isScope: true
          };

          return self.__expressionAnalysisMode__ ? _traceMember(str, 'replace') : void 0, (str === Object(str) ? self.__expressionAnalysisMode__ ? _getLocal(_scope72, 'str', str) : void 0 : str, str).replace(/[^A-Za-z0-9-]/g, '_');
        }

        async fileForNameExists(name) {
          let _scope73 = {
            isScope: true
          };

          const url = new (self.__expressionAnalysisMode__ ? _getGlobal('URL') : void 0, URL)(`${(self.__expressionAnalysisMode__ ? _traceMember(this, 'escapeSpecialCharacters') : void 0, this.escapeSpecialCharacters((self.__expressionAnalysisMode__ ? _getGlobal('str') : void 0, str)))}.md`, (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'DEFAULT_FOLDER_URL', DEFAULT_FOLDER_URL) : void 0, DEFAULT_FOLDER_URL));
          return _getMember((await (self.__expressionAnalysisMode__ ? _getGlobal('fetch') : void 0, fetch)((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope73, 'url', url) : void 0 : url, url))), 'status') === 200;
        }

        async getOrCreateKnotForTitle(name, defaultText = '# Default Text') {
          let _scope74 = {
            isScope: true
          };

          const escapedName = (self.__expressionAnalysisMode__ ? _traceMember(this, 'escapeSpecialCharacters') : void 0, this.escapeSpecialCharacters((name === Object(name) ? self.__expressionAnalysisMode__ ? _getLocal(_scope74, 'name', name) : void 0 : name, name)));
          const proposedURL = `${(self.__expressionAnalysisMode__ ? _getLocal(_scope, 'DEFAULT_FOLDER_URL', DEFAULT_FOLDER_URL) : void 0, DEFAULT_FOLDER_URL)}${(escapedName === Object(escapedName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope74, 'escapedName', escapedName) : void 0 : escapedName, escapedName)}.md`;

          const existingKnot = _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(this, 'getKnots') : void 0, this.getKnots()), 'find', [knot => {
            let _scope75 = {
              isScope: true
            };

            return _getMember((knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope75, 'knot', knot) : void 0 : knot, knot), 'url') === (proposedURL === Object(proposedURL) ? self.__expressionAnalysisMode__ ? _getLocal(_scope74, 'proposedURL', proposedURL) : void 0 : proposedURL, proposedURL);
          }]);
          if (existingKnot === Object(existingKnot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope74, 'existingKnot', existingKnot) : void 0 : existingKnot, existingKnot) {
            if (self.__expressionAnalysisMode__) _traceMember(lively, 'success');

            (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).success('EXISTS IN MEMORY');
            return existingKnot === Object(existingKnot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope74, 'existingKnot', existingKnot) : void 0 : existingKnot, existingKnot;
          }

          const fileExists = _getMember((await (self.__expressionAnalysisMode__ ? _getGlobal('fetch') : void 0, fetch)((proposedURL === Object(proposedURL) ? self.__expressionAnalysisMode__ ? _getLocal(_scope74, 'proposedURL', proposedURL) : void 0 : proposedURL, proposedURL))), 'status') === 200;
          if (fileExists === Object(fileExists) ? self.__expressionAnalysisMode__ ? _getLocal(_scope74, 'fileExists', fileExists) : void 0 : fileExists, fileExists) {
            if (self.__expressionAnalysisMode__) _traceMember(lively, 'success');

            (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).success('EXISTS REMOTELY');
            return self.__expressionAnalysisMode__ ? _traceMember(this, 'requestKnot') : void 0, this.requestKnot((proposedURL === Object(proposedURL) ? self.__expressionAnalysisMode__ ? _getLocal(_scope74, 'proposedURL', proposedURL) : void 0 : proposedURL, proposedURL));
          }

          if (self.__expressionAnalysisMode__) _traceMember(lively, 'warn');
          (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).warn('NON EXISTENT');
          return self.__expressionAnalysisMode__ ? _traceMember(this, 'createKnot') : void 0, this.createKnot((self.__expressionAnalysisMode__ ? _getLocal(_scope, 'DEFAULT_FOLDER_URL', DEFAULT_FOLDER_URL) : void 0, DEFAULT_FOLDER_URL), (name === Object(name) ? self.__expressionAnalysisMode__ ? _getLocal(_scope74, 'name', name) : void 0 : name, name), 'md');
        }

        async getNonCollidableURL(directory, name, fileEnding) {
          let _scope76 = {
            isScope: true
          };

          const maxTries = 10;
          const fileName = (self.__expressionAnalysisMode__ ? _traceMember(this, 'escapeSpecialCharacters') : void 0, this.escapeSpecialCharacters((name === Object(name) ? self.__expressionAnalysisMode__ ? _getLocal(_scope76, 'name', name) : void 0 : name, name)));
          let offset = 0;
          let i = 0;

          for (; i < maxTries; i++) {
            let _scope77 = {
              isScope: true
            };

            let bust = (self.__expressionAnalysisMode__ ? _getLocal(_scope76, 'offset', offset) : void 0, offset) === 0 ? '' : (self.__expressionAnalysisMode__ ? _getLocal(_scope76, 'offset', offset) : void 0, offset);
            let url = new (self.__expressionAnalysisMode__ ? _getGlobal('URL') : void 0, URL)(`${(fileName === Object(fileName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope76, 'fileName', fileName) : void 0 : fileName, fileName)}${(bust === Object(bust) ? self.__expressionAnalysisMode__ ? _getLocal(_scope77, 'bust', bust) : void 0 : bust, bust)}.${(fileEnding === Object(fileEnding) ? self.__expressionAnalysisMode__ ? _getLocal(_scope76, 'fileEnding', fileEnding) : void 0 : fileEnding, fileEnding)}`, (directory === Object(directory) ? self.__expressionAnalysisMode__ ? _getLocal(_scope76, 'directory', directory) : void 0 : directory, directory));
            let fileExists = _getMember((await (self.__expressionAnalysisMode__ ? _getGlobal('fetch') : void 0, fetch)((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope77, 'url', url) : void 0 : url, url))), 'status') === 200;
            if (fileExists === Object(fileExists) ? self.__expressionAnalysisMode__ ? _getLocal(_scope77, 'fileExists', fileExists) : void 0 : fileExists, fileExists) {
              (offset += 1, true ? _setLocal(_scope76, 'offset', offset, {
                file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
                end: {
                  column: 16,
                  line: 422
                },
                start: {
                  column: 8,
                  line: 422
                },
                source: ''
              }) : void 0, offset) - 1;
            } else {
              return url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope77, 'url', url) : void 0 : url, url;
            }
          }
          throw new (self.__expressionAnalysisMode__ ? _getGlobal('Error') : void 0, Error)('too many tries for '); // TODO: improve error message
        }
        async createKnot(directory, name, fileEnding) {
          let _scope78 = {
            isScope: true
          };

          if ((fileEnding === Object(fileEnding) ? self.__expressionAnalysisMode__ ? _getLocal(_scope78, 'fileEnding', fileEnding) : void 0 : fileEnding, fileEnding) !== 'md') {
            throw new (self.__expressionAnalysisMode__ ? _getGlobal('Error') : void 0, Error)('only .md files supported by now, instead found ', +(fileEnding === Object(fileEnding) ? self.__expressionAnalysisMode__ ? _getLocal(_scope78, 'fileEnding', fileEnding) : void 0 : fileEnding, fileEnding));
          }

          let url = await (self.__expressionAnalysisMode__ ? _traceMember(this, 'getNonCollidableURL') : void 0, this.getNonCollidableURL((directory === Object(directory) ? self.__expressionAnalysisMode__ ? _getLocal(_scope78, 'directory', directory) : void 0 : directory, directory), (name === Object(name) ? self.__expressionAnalysisMode__ ? _getLocal(_scope78, 'name', name) : void 0 : name, name), (fileEnding === Object(fileEnding) ? self.__expressionAnalysisMode__ ? _getLocal(_scope78, 'fileEnding', fileEnding) : void 0 : fileEnding, fileEnding)));
          let content = `# ${(name === Object(name) ? self.__expressionAnalysisMode__ ? _getLocal(_scope78, 'name', name) : void 0 : name, name)}

`;
          await _getAndCallMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively), 'files'), 'saveFile', [(url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope78, 'url', url) : void 0 : url, url), (content === Object(content) ? self.__expressionAnalysisMode__ ? _getLocal(_scope78, 'content', content) : void 0 : content, content)]);

          return self.__expressionAnalysisMode__ ? _traceMember(this, 'requestKnot') : void 0, this.requestKnot((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope78, 'url', url) : void 0 : url, url));
        }
        async createTriple(subjectUrlString, predicateURLString, objectURLString, knowledgeBaseURLString) {
          let _scope79 = {
            isScope: true
          };

          await (self.__expressionAnalysisMode__ ? _traceMember(this, 'requestKnot') : void 0, this.requestKnot((subjectUrlString === Object(subjectUrlString) ? self.__expressionAnalysisMode__ ? _getLocal(_scope79, 'subjectUrlString', subjectUrlString) : void 0 : subjectUrlString, subjectUrlString)));
          await (self.__expressionAnalysisMode__ ? _traceMember(this, 'requestKnot') : void 0, this.requestKnot((predicateURLString === Object(predicateURLString) ? self.__expressionAnalysisMode__ ? _getLocal(_scope79, 'predicateURLString', predicateURLString) : void 0 : predicateURLString, predicateURLString)));
          await (self.__expressionAnalysisMode__ ? _traceMember(this, 'requestKnot') : void 0, this.requestKnot((objectURLString === Object(objectURLString) ? self.__expressionAnalysisMode__ ? _getLocal(_scope79, 'objectURLString', objectURLString) : void 0 : objectURLString, objectURLString)));

          const url = await (self.__expressionAnalysisMode__ ? _traceMember(this, 'getNonCollidableURL') : void 0, this.getNonCollidableURL((knowledgeBaseURLString === Object(knowledgeBaseURLString) ? self.__expressionAnalysisMode__ ? _getLocal(_scope79, 'knowledgeBaseURLString', knowledgeBaseURLString) : void 0 : knowledgeBaseURLString, knowledgeBaseURLString), 'triple-' + (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'uuid', uuid) : void 0, uuid)(), 'triple.json'));
          const content = (self.__expressionAnalysisMode__ ? _traceMember(JSON, 'stringify') : void 0, (self.__expressionAnalysisMode__ ? _getGlobal('JSON') : void 0, JSON).stringify({
            subject: subjectUrlString,
            predicate: predicateURLString,
            object: objectURLString
          }));
          await _getAndCallMember(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively), 'files'), 'saveFile', [(url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope79, 'url', url) : void 0 : url, url), (content === Object(content) ? self.__expressionAnalysisMode__ ? _getLocal(_scope79, 'content', content) : void 0 : content, content)]);

          //await invalidateFetchCache(knowledgeBaseURLString);

          return self.__expressionAnalysisMode__ ? _traceMember(this, 'requestKnot') : void 0, this.requestKnot((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope79, 'url', url) : void 0 : url, url));
        }

      }

      // wild card for querying

      _export('Graph', Graph);

      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_client_triples_triples_js'), 'Graph', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'Graph', Graph) : void 0, Graph;
        },

        set(thisIsVererySecretVariableName) {
          let _scope80 = {
            isScope: true
          };
          _export('Graph', Graph = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope80, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName)), true ? _setLocal(_scope, 'Graph', Graph, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 18,
              line: 172
            },
            start: {
              column: 13,
              line: 172
            },
            source: ''
          }) : void 0, Graph;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      const _ = {};

      _export('_', _);

      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_src_client_triples_triples_js'), '_', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, '_', _) : void 0, _;
        },

        set(thisIsVererySecretVariableName) {
          let _scope81 = {
            isScope: true
          };
          _export('_', _ = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope81, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName)), true ? _setLocal(_scope, '_', _, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/src/client/triples/triples.js',
            end: {
              column: 14,
              line: 461
            },
            start: {
              column: 13,
              line: 461
            },
            source: ''
          }) : void 0, _;
          return true;
        },

        enumerable: true,
        configurable: true
      });
    }
  };
});