'enable aexpr';

System.register(['active-expression-rewriting', 'reactive-jsx', 'src/components/widgets/lively-morph.js', 'src/client/triples/triples.js', 'active-group', 'utils'], function (_export, _context) {
  "use strict";

  var _aexpr, _getAndCallMember, _setMember, _setLocal, _getLocal, _getMember, _getGlobal, _traceMember, _attributeStringLiteral, _attributeExpression, _childElement, _childText, _childSpread, _childExpression, _children, _attributes, _element, Morph, Graph, Triple, _, TAG_URL, select, trackInstance, baseViewForClass, debounce;

  return {
    setters: [function (_activeExpressionRewriting) {
      _aexpr = _activeExpressionRewriting.aexpr;
      _getAndCallMember = _activeExpressionRewriting.getAndCallMember;
      _setMember = _activeExpressionRewriting.setMember;
      _setLocal = _activeExpressionRewriting.setLocal;
      _getLocal = _activeExpressionRewriting.getLocal;
      _getMember = _activeExpressionRewriting.getMember;
      _getGlobal = _activeExpressionRewriting.getGlobal;
      _traceMember = _activeExpressionRewriting.traceMember;
    }, function (_reactiveJsx) {
      _attributeStringLiteral = _reactiveJsx.attributeStringLiteral;
      _attributeExpression = _reactiveJsx.attributeExpression;
      _childElement = _reactiveJsx.childElement;
      _childText = _reactiveJsx.childText;
      _childSpread = _reactiveJsx.childSpread;
      _childExpression = _reactiveJsx.childExpression;
      _children = _reactiveJsx.children;
      _attributes = _reactiveJsx.attributes;
      _element = _reactiveJsx.element;
    }, function (_srcComponentsWidgetsLivelyMorphJs) {
      Morph = _srcComponentsWidgetsLivelyMorphJs.default;
    }, function (_srcClientTriplesTriplesJs) {
      Graph = _srcClientTriplesTriplesJs.Graph;
      Triple = _srcClientTriplesTriplesJs.Triple;
      _ = _srcClientTriplesTriplesJs._;
      TAG_URL = _srcClientTriplesTriplesJs.TAG_URL;
    }, function (_activeGroup) {
      select = _activeGroup.default;
      trackInstance = _activeGroup.trackInstance;
      baseViewForClass = _activeGroup.baseViewForClass;
    }, function (_utils) {
      debounce = _utils.debounce;
    }],
    execute: function () {
      const __SystemJSRewritingHack = {};
      _recorder_._templates_knot_view_js = _recorder_._templates_knot_view_js || {};
      let _scope = {
        isScope: true
      };
      if (self.__expressionAnalysisMode__) _traceMember(Object, 'defineProperty');
      (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).defineProperty(_getMember((self.__expressionAnalysisMode__ ? _getGlobal('_recorder_') : void 0, _recorder_), '_templates_knot_view_js'), 'Morph', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'Morph', Morph) : void 0, Morph;
        },

        set(thisIsVererySecretVariableName) {
          let _scope2 = {
            isScope: true
          };
          Morph = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope2, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'Morph', Morph, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 12,
              line: 3
            },
            start: {
              column: 7,
              line: 3
            },
            source: ''
          }) : void 0, Morph;
          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_), '_templates_knot_view_js'), 'TAG_URL', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'TAG_URL', TAG_URL) : void 0, TAG_URL;
        },

        set(thisIsVererySecretVariableName) {
          let _scope3 = {
            isScope: true
          };
          TAG_URL = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope3, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'TAG_URL', TAG_URL, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 34,
              line: 5
            },
            start: {
              column: 27,
              line: 5
            },
            source: ''
          }) : void 0, TAG_URL;
          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_), '_templates_knot_view_js'), '_', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, '_', _) : void 0, _;
        },

        set(thisIsVererySecretVariableName) {
          let _scope4 = {
            isScope: true
          };
          _ = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope4, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, '_', _, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 25,
              line: 5
            },
            start: {
              column: 24,
              line: 5
            },
            source: ''
          }) : void 0, _;
          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_), '_templates_knot_view_js'), 'Triple', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'Triple', Triple) : void 0, Triple;
        },

        set(thisIsVererySecretVariableName) {
          let _scope5 = {
            isScope: true
          };
          Triple = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope5, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'Triple', Triple, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 22,
              line: 5
            },
            start: {
              column: 16,
              line: 5
            },
            source: ''
          }) : void 0, Triple;
          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_), '_templates_knot_view_js'), 'Graph', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'Graph', Graph) : void 0, Graph;
        },

        set(thisIsVererySecretVariableName) {
          let _scope6 = {
            isScope: true
          };
          Graph = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope6, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'Graph', Graph, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 14,
              line: 5
            },
            start: {
              column: 9,
              line: 5
            },
            source: ''
          }) : void 0, Graph;
          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_), '_templates_knot_view_js'), 'baseViewForClass', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'baseViewForClass', baseViewForClass) : void 0, baseViewForClass;
        },

        set(thisIsVererySecretVariableName) {
          let _scope7 = {
            isScope: true
          };
          baseViewForClass = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope7, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'baseViewForClass', baseViewForClass, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 48,
              line: 6
            },
            start: {
              column: 32,
              line: 6
            },
            source: ''
          }) : void 0, baseViewForClass;
          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_), '_templates_knot_view_js'), 'trackInstance', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'trackInstance', trackInstance) : void 0, trackInstance;
        },

        set(thisIsVererySecretVariableName) {
          let _scope8 = {
            isScope: true
          };
          trackInstance = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope8, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'trackInstance', trackInstance, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 30,
              line: 6
            },
            start: {
              column: 17,
              line: 6
            },
            source: ''
          }) : void 0, trackInstance;
          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_), '_templates_knot_view_js'), 'select', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'select', select) : void 0, select;
        },

        set(thisIsVererySecretVariableName) {
          let _scope9 = {
            isScope: true
          };
          select = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope9, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'select', select, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 13,
              line: 6
            },
            start: {
              column: 7,
              line: 6
            },
            source: ''
          }) : void 0, select;
          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_), '_templates_knot_view_js'), 'debounce', {
        get() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'debounce', debounce) : void 0, debounce;
        },

        set(thisIsVererySecretVariableName) {
          let _scope10 = {
            isScope: true
          };
          debounce = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope10, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName), true ? _setLocal(_scope, 'debounce', debounce, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 17,
              line: 8
            },
            start: {
              column: 9,
              line: 8
            },
            source: ''
          }) : void 0, debounce;
          return true;
        },

        enumerable: true,
        configurable: true
      });
      class KnotView extends Morph {
        get urlString() {
          return _getMember((self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get("#path-to-load")), 'value');
        }
        get tagURLString() {
          return self.__expressionAnalysisMode__ ? _getLocal(_scope, 'TAG_URL', TAG_URL) : void 0, TAG_URL;
        }

        async initialize() {
          let _scope11 = {
            isScope: true
          };

          _setMember(this, 'windowTitle', "Knot View", {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 34,
              line: 15
            },
            start: {
              column: 4,
              line: 15
            },
            source: ''
          });

          var pathToLoad = (self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get("#path-to-load"));
          if (self.__expressionAnalysisMode__) _traceMember(pathToLoad, 'addEventListener');
          (pathToLoad === Object(pathToLoad) ? self.__expressionAnalysisMode__ ? _getLocal(_scope11, 'pathToLoad', pathToLoad) : void 0 : pathToLoad, pathToLoad).addEventListener('keyup', event => {
            let _scope12 = {
              isScope: true
            };

            if (_getMember((event === Object(event) ? self.__expressionAnalysisMode__ ? _getLocal(_scope12, 'event', event) : void 0 : event, event), 'keyCode') == 13) {
              if (self.__expressionAnalysisMode__) _traceMember(this, 'onPathEntered');
              // ENTER
              this.onPathEntered(_getMember(this, 'urlString'));
            }
          });

          let editorComp = (self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#content-editor'));
          // editorComp.editor.setOptions({maxLines:Infinity});

          let urlToLoad = (self.__expressionAnalysisMode__ ? _traceMember(this, 'getAttribute') : void 0, this.getAttribute('data-knot-url'));
          if ((urlToLoad === Object(urlToLoad) ? self.__expressionAnalysisMode__ ? _getLocal(_scope11, 'urlToLoad', urlToLoad) : void 0 : urlToLoad, urlToLoad) && (urlToLoad === Object(urlToLoad) ? self.__expressionAnalysisMode__ ? _getLocal(_scope11, 'urlToLoad', urlToLoad) : void 0 : urlToLoad, urlToLoad) !== "") {
            if (self.__expressionAnalysisMode__) _traceMember(this, 'loadKnotForURL');

            this.loadKnotForURL((urlToLoad === Object(urlToLoad) ? self.__expressionAnalysisMode__ ? _getLocal(_scope11, 'urlToLoad', urlToLoad) : void 0 : urlToLoad, urlToLoad));
          }

          if (self.__expressionAnalysisMode__) _traceMember(this, 'initAExprs');
          this.initAExprs();

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

        knotLabel(knot, altText = "no knot label available") {
          let _scope13 = {
            isScope: true
          };

          return (knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope13, 'knot', knot) : void 0 : knot, knot) && _getMember((knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope13, 'knot', knot) : void 0 : knot, knot), 'label') instanceof (self.__expressionAnalysisMode__ ? _getGlobal('Function') : void 0, Function) && (self.__expressionAnalysisMode__ ? _traceMember(knot, 'label') : void 0, (knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope13, 'knot', knot) : void 0 : knot, knot).label()) || (altText === Object(altText) ? self.__expressionAnalysisMode__ ? _getLocal(_scope13, 'altText', altText) : void 0 : altText, altText);
        }

        async initAExprs() {
          let _scope14 = {
            isScope: true
          };
          if (self.__expressionAnalysisMode__) _traceMember(lively, 'success');

          (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).success('setup aexprs');

          let graph = await (self.__expressionAnalysisMode__ ? _traceMember(Graph, 'getInstance') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'Graph', Graph) : void 0, Graph).getInstance());
          let tag = await (self.__expressionAnalysisMode__ ? _traceMember(graph, 'requestKnot') : void 0, (graph === Object(graph) ? self.__expressionAnalysisMode__ ? _getLocal(_scope14, 'graph', graph) : void 0 : graph, graph).requestKnot(new (self.__expressionAnalysisMode__ ? _getGlobal('URL') : void 0, URL)((self.__expressionAnalysisMode__ ? _getLocal(_scope, 'TAG_URL', TAG_URL) : void 0, TAG_URL))));

          _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#label-container')), 'appendChild', [_element('h1', _attributes(), _children(_childExpression(_aexpr(() => {
            return self.__expressionAnalysisMode__ ? _traceMember(this, 'knotLabel') : void 0, this.knotLabel(_getMember(this, 'knot'));
          }, {
            location: {
              file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
              end: {
                column: 29,
                line: 48
              },
              start: {
                column: 24,
                line: 48
              },
              source: ''
            },
            sourceCode: '() => this.knotLabel(this.knot)'
          }))), {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 68,
              line: 48
            },
            start: {
              column: 19,
              line: 48
            }
          })]);

          const triples = (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'select', select) : void 0, select)((self.__expressionAnalysisMode__ ? _getLocal(_scope, 'Triple', Triple) : void 0, Triple));

          _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#r-po-table')), 'appendChild', [_element('tbody', _attributes(), _children(_childSpread(_getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(triples, 'filter') : void 0, (triples === Object(triples) ? self.__expressionAnalysisMode__ ? _getLocal(_scope14, 'triples', triples) : void 0 : triples, triples).filter(t => {
            let _scope15 = {
              isScope: true
            };
            return _getMember((t === Object(t) ? self.__expressionAnalysisMode__ ? _getLocal(_scope15, 't', t) : void 0 : t, t), 'subject') === _getMember(this, 'knot');
          })), 'map', [t => {
            let _scope16 = {
              isScope: true
            };
            return self.__expressionAnalysisMode__ ? _traceMember(this, 'buildTableRowFor') : void 0, this.buildTableRowFor((t === Object(t) ? self.__expressionAnalysisMode__ ? _getLocal(_scope16, 't', t) : void 0 : t, t), _getMember((t === Object(t) ? self.__expressionAnalysisMode__ ? _getLocal(_scope16, 't', t) : void 0 : t, t), 'predicate'), _getMember((t === Object(t) ? self.__expressionAnalysisMode__ ? _getLocal(_scope16, 't', t) : void 0 : t, t), 'object'));
          }]))), {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 17,
              line: 56
            },
            start: {
              column: 40,
              line: 52
            }
          })]);

          _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#r-so-table')), 'appendChild', [_element('tbody', _attributes(), _children(_childSpread(_getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(triples, 'filter') : void 0, (triples === Object(triples) ? self.__expressionAnalysisMode__ ? _getLocal(_scope14, 'triples', triples) : void 0 : triples, triples).filter(t => {
            let _scope17 = {
              isScope: true
            };
            return _getMember((t === Object(t) ? self.__expressionAnalysisMode__ ? _getLocal(_scope17, 't', t) : void 0 : t, t), 'predicate') === _getMember(this, 'knot');
          })), 'map', [t => {
            let _scope18 = {
              isScope: true
            };
            return self.__expressionAnalysisMode__ ? _traceMember(this, 'buildTableRowFor') : void 0, this.buildTableRowFor((t === Object(t) ? self.__expressionAnalysisMode__ ? _getLocal(_scope18, 't', t) : void 0 : t, t), _getMember((t === Object(t) ? self.__expressionAnalysisMode__ ? _getLocal(_scope18, 't', t) : void 0 : t, t), 'subject'), _getMember((t === Object(t) ? self.__expressionAnalysisMode__ ? _getLocal(_scope18, 't', t) : void 0 : t, t), 'object'));
          }]))), {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 17,
              line: 62
            },
            start: {
              column: 40,
              line: 58
            }
          })]);

          _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#r-sp-table')), 'appendChild', [_element('tbody', _attributes(), _children(_childSpread(_getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(triples, 'filter') : void 0, (triples === Object(triples) ? self.__expressionAnalysisMode__ ? _getLocal(_scope14, 'triples', triples) : void 0 : triples, triples).filter(t => {
            let _scope19 = {
              isScope: true
            };
            return _getMember((t === Object(t) ? self.__expressionAnalysisMode__ ? _getLocal(_scope19, 't', t) : void 0 : t, t), 'object') === _getMember(this, 'knot');
          })), 'map', [t => {
            let _scope20 = {
              isScope: true
            };
            return self.__expressionAnalysisMode__ ? _traceMember(this, 'buildTableRowFor') : void 0, this.buildTableRowFor((t === Object(t) ? self.__expressionAnalysisMode__ ? _getLocal(_scope20, 't', t) : void 0 : t, t), _getMember((t === Object(t) ? self.__expressionAnalysisMode__ ? _getLocal(_scope20, 't', t) : void 0 : t, t), 'subject'), _getMember((t === Object(t) ? self.__expressionAnalysisMode__ ? _getLocal(_scope20, 't', t) : void 0 : t, t), 'predicate'));
          }]))), {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 17,
              line: 68
            },
            start: {
              column: 40,
              line: 64
            }
          })]);
        }

        buildMetadata(knot) {
          let _scope21 = {
            isScope: true
          };

          const metadataTable = (self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get("#metadata-table"));
          _setMember((metadataTable === Object(metadataTable) ? self.__expressionAnalysisMode__ ? _getLocal(_scope21, 'metadataTable', metadataTable) : void 0 : metadataTable, metadataTable), 'innerHTML', "", {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 32,
              line: 73
            },
            start: {
              column: 4,
              line: 73
            },
            source: ''
          });

          _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(Object, 'entries') : void 0, (self.__expressionAnalysisMode__ ? _getGlobal('Object') : void 0, Object).entries((self.__expressionAnalysisMode__ ? _traceMember(knot, 'getMetadata') : void 0, (knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope21, 'knot', knot) : void 0 : knot, knot).getMetadata()))), 'forEach', [entry => {
            let _scope22 = {
              isScope: true
            };

            const key = _getMember((entry === Object(entry) ? self.__expressionAnalysisMode__ ? _getLocal(_scope22, 'entry', entry) : void 0 : entry, entry), 0);
            const value = _getMember((entry === Object(entry) ? self.__expressionAnalysisMode__ ? _getLocal(_scope22, 'entry', entry) : void 0 : entry, entry), 1);
            // for (const [key, value] of Object.entries(knot.getMetadata())) {
            if (self.__expressionAnalysisMode__) _traceMember(metadataTable, 'appendChild');
            (metadataTable === Object(metadataTable) ? self.__expressionAnalysisMode__ ? _getLocal(_scope21, 'metadataTable', metadataTable) : void 0 : metadataTable, metadataTable).appendChild(_element('tr', _attributes(), _children((self.__expressionAnalysisMode__ ? _getGlobal('_childText') : void 0, _childText)('\n        '), (self.__expressionAnalysisMode__ ? _getGlobal('_childElement') : void 0, _childElement)(_element('td', _attributes(), _children(_childExpression((key === Object(key) ? self.__expressionAnalysisMode__ ? _getLocal(_scope22, 'key', key) : void 0 : key, key))), {
              file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
              end: {
                column: 22,
                line: 80
              },
              start: {
                column: 8,
                line: 80
              }
            })), _childText('\n        '), _childElement(_element('td', _attributes(), _children(_childExpression((value === Object(value) ? self.__expressionAnalysisMode__ ? _getLocal(_scope22, 'value', value) : void 0 : value, value))), {
              file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
              end: {
                column: 24,
                line: 81
              },
              start: {
                column: 8,
                line: 81
              }
            })), _childText('\n      ')), {
              file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
              end: {
                column: 11,
                line: 82
              },
              start: {
                column: 32,
                line: 79
              }
            }));
            // }
          }]);
        }

        buildNavigatableLinkFor(knot) {
          let _scope23 = {
            isScope: true
          };

          return _element('a', _attributes(_attributeExpression('click', e => {
            return self.__expressionAnalysisMode__ ? _traceMember(this, 'loadKnotForURL') : void 0, this.loadKnotForURL(_getMember((knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope23, 'knot', knot) : void 0 : knot, knot), 'fileName'));
          })), _children(_childText('\n      '), _childExpression((self.__expressionAnalysisMode__ ? _traceMember(knot, 'label') : void 0, (knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope23, 'knot', knot) : void 0 : knot, knot).label())), _childText('\n    ')), {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 8,
              line: 90
            },
            start: {
              column: 11,
              line: 88
            }
          });
        }
        buildRefFor(knot) {
          let _scope24 = {
            isScope: true
          };

          return self.__expressionAnalysisMode__ ? _traceMember(this, 'buildNavigatableLinkFor') : void 0, this.buildNavigatableLinkFor((knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope24, 'knot', knot) : void 0 : knot, knot));
        }
        buildTableDataFor(knot) {
          let _scope25 = {
            isScope: true
          };

          return _element('td', _attributes(), _children(_childText('\n      '), _childExpression((self.__expressionAnalysisMode__ ? _traceMember(this, 'buildRefFor') : void 0, this.buildRefFor((knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope25, 'knot', knot) : void 0 : knot, knot)))), _childText('\n      '), _childElement(_element('i', _attributes(_attributeStringLiteral('class', 'fa fa-search'), _attributeExpression('click', e => {
            if (self.__expressionAnalysisMode__) _traceMember(lively, 'openInspector');

            (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).openInspector((knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope25, 'knot', knot) : void 0 : knot, knot), (self.__expressionAnalysisMode__ ? _getGlobal('undefined') : void 0, undefined), (self.__expressionAnalysisMode__ ? _traceMember(knot, 'label') : void 0, (knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope25, 'knot', knot) : void 0 : knot, knot).label()));
          })), _children(), {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 13,
              line: 100
            },
            start: {
              column: 6,
              line: 98
            }
          })), _childText('\n    ')), {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 9,
              line: 101
            },
            start: {
              column: 11,
              line: 96
            }
          });
        }
        buildTableRowFor(triple, knot1, knot2) {
          let _scope26 = {
            isScope: true
          };

          return _element('tr', _attributes(), _children(_childText('\n      '), _childExpression((self.__expressionAnalysisMode__ ? _traceMember(this, 'buildTableDataFor') : void 0, this.buildTableDataFor((knot1 === Object(knot1) ? self.__expressionAnalysisMode__ ? _getLocal(_scope26, 'knot1', knot1) : void 0 : knot1, knot1)))), _childText('\n      '), _childExpression((self.__expressionAnalysisMode__ ? _traceMember(this, 'buildTableDataFor') : void 0, this.buildTableDataFor((knot2 === Object(knot2) ? self.__expressionAnalysisMode__ ? _getLocal(_scope26, 'knot2', knot2) : void 0 : knot2, knot2)))), _childText('\n      '), _childExpression((self.__expressionAnalysisMode__ ? _traceMember(this, 'buildTableDataFor') : void 0, this.buildTableDataFor((triple === Object(triple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope26, 'triple', triple) : void 0 : triple, triple)))), _childText('\n    ')), {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 9,
              line: 108
            },
            start: {
              column: 11,
              line: 104
            }
          });
        }
        async replaceTableBodyFor(selector, s, p, o, propForFirstCell, propForSecondCell) {
          let _scope27 = {
            isScope: true
          };

          let graph = await (self.__expressionAnalysisMode__ ? _traceMember(Graph, 'getInstance') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'Graph', Graph) : void 0, Graph).getInstance());
          let poTableBody = (self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get((selector === Object(selector) ? self.__expressionAnalysisMode__ ? _getLocal(_scope27, 'selector', selector) : void 0 : selector, selector) + ' tbody'));
          _setMember((poTableBody === Object(poTableBody) ? self.__expressionAnalysisMode__ ? _getLocal(_scope27, 'poTableBody', poTableBody) : void 0 : poTableBody, poTableBody), 'innerHTML', "", {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 30,
              line: 113
            },
            start: {
              column: 4,
              line: 113
            },
            source: ''
          });
          _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(graph, 'query') : void 0, (graph === Object(graph) ? self.__expressionAnalysisMode__ ? _getLocal(_scope27, 'graph', graph) : void 0 : graph, graph).query((s === Object(s) ? self.__expressionAnalysisMode__ ? _getLocal(_scope27, 's', s) : void 0 : s, s), (p === Object(p) ? self.__expressionAnalysisMode__ ? _getLocal(_scope27, 'p', p) : void 0 : p, p), (o === Object(o) ? self.__expressionAnalysisMode__ ? _getLocal(_scope27, 'o', o) : void 0 : o, o))), 'forEach', [triple => {
            let _scope28 = {
              isScope: true
            };
            if (self.__expressionAnalysisMode__) _traceMember(poTableBody, 'appendChild');

            (poTableBody === Object(poTableBody) ? self.__expressionAnalysisMode__ ? _getLocal(_scope27, 'poTableBody', poTableBody) : void 0 : poTableBody, poTableBody).appendChild((self.__expressionAnalysisMode__ ? _traceMember(this, 'buildTableRowFor') : void 0, this.buildTableRowFor((triple === Object(triple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope28, 'triple', triple) : void 0 : triple, triple), _getMember((triple === Object(triple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope28, 'triple', triple) : void 0 : triple, triple), (propForFirstCell === Object(propForFirstCell) ? self.__expressionAnalysisMode__ ? _getLocal(_scope27, 'propForFirstCell', propForFirstCell) : void 0 : propForFirstCell, propForFirstCell)), _getMember((triple === Object(triple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope28, 'triple', triple) : void 0 : triple, triple), (propForSecondCell === Object(propForSecondCell) ? self.__expressionAnalysisMode__ ? _getLocal(_scope27, 'propForSecondCell', propForSecondCell) : void 0 : propForSecondCell, propForSecondCell)))));
          }]);
        }

        async loadKnotForURL(url) {
          let _scope29 = {
            isScope: true
          };

          return self.__expressionAnalysisMode__ ? _traceMember(this, 'loadKnot') : void 0, this.loadKnot((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope29, 'url', url) : void 0 : url, url));
        }
        async loadKnot(url) {
          let _scope30 = {
            isScope: true
          };

          let graph = await (self.__expressionAnalysisMode__ ? _traceMember(Graph, 'getInstance') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'Graph', Graph) : void 0, Graph).getInstance());
          let knot = await (self.__expressionAnalysisMode__ ? _traceMember(graph, 'requestKnot') : void 0, (graph === Object(graph) ? self.__expressionAnalysisMode__ ? _getLocal(_scope30, 'graph', graph) : void 0 : graph, graph).requestKnot(new (self.__expressionAnalysisMode__ ? _getGlobal('URL') : void 0, URL)((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope30, 'url', url) : void 0 : url, url))));
          _setMember(this, 'knot', (knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope30, 'knot', knot) : void 0 : knot, knot), {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 20,
              line: 131
            },
            start: {
              column: 4,
              line: 131
            },
            source: ''
          });

          _setMember((self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get("#path-to-load")), 'value', _getMember((knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope30, 'knot', knot) : void 0 : knot, knot), 'url'), {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 46,
              line: 133
            },
            start: {
              column: 4,
              line: 133
            },
            source: ''
          });

          let deleteKnot = (self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#delete-button'));
          _setMember((deleteKnot === Object(deleteKnot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope30, 'deleteKnot', deleteKnot) : void 0 : deleteKnot, deleteKnot), 'onclick', event => {
            let _scope31 = {
              isScope: true
            };
            return self.__expressionAnalysisMode__ ? _traceMember(this, 'deleteKnot') : void 0, this.deleteKnot((event === Object(event) ? self.__expressionAnalysisMode__ ? _getLocal(_scope31, 'event', event) : void 0 : event, event));
          }, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 56,
              line: 136
            },
            start: {
              column: 4,
              line: 136
            },
            source: ''
          });

          // URLs
          let urlList = (self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get("#url-list"));
          _setMember((urlList === Object(urlList) ? self.__expressionAnalysisMode__ ? _getLocal(_scope30, 'urlList', urlList) : void 0 : urlList, urlList), 'innerHTML', "", {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 26,
              line: 140
            },
            start: {
              column: 4,
              line: 140
            },
            source: ''
          });
          _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(graph, 'getUrlsByKnot') : void 0, (graph === Object(graph) ? self.__expressionAnalysisMode__ ? _getLocal(_scope30, 'graph', graph) : void 0 : graph, graph).getUrlsByKnot((knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope30, 'knot', knot) : void 0 : knot, knot))), 'forEach', [url => {
            let _scope33 = {
              isScope: true
            };

            function isExternalLink(url) {
              let _scope32 = {
                isScope: true
              };

              try {
                return self.__expressionAnalysisMode__ ? _traceMember(Graph, 'isExternalURL') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'Graph', Graph) : void 0, Graph).isExternalURL(new (self.__expressionAnalysisMode__ ? _getGlobal('URL') : void 0, URL)((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope32, 'url', url) : void 0 : url, url)));
              } catch (e) {
                return false;
              }
            }

            async function followURL(e) {
              let _scope35 = {
                isScope: true
              };

              if ((isExternalLink === Object(isExternalLink) ? self.__expressionAnalysisMode__ ? _getLocal(_scope33, 'isExternalLink', isExternalLink) : void 0 : isExternalLink, isExternalLink)((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope33, 'url', url) : void 0 : url, url))) {
                if (self.__expressionAnalysisMode__) _traceMember(window, 'open');

                (self.__expressionAnalysisMode__ ? _getGlobal('window') : void 0, window).open((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope33, 'url', url) : void 0 : url, url));
              } else {
                let _scope34 = {
                  isScope: true
                };

                const container = await (self.__expressionAnalysisMode__ ? _traceMember(lively, 'openBrowser') : void 0, (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).openBrowser((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope33, 'url', url) : void 0 : url, url), false));
                if (self.__expressionAnalysisMode__) _traceMember(container, 'focus');
                (container === Object(container) ? self.__expressionAnalysisMode__ ? _getLocal(_scope34, 'container', container) : void 0 : container, container).focus();
              }
              if (self.__expressionAnalysisMode__) _traceMember(e, 'preventDefault');
              (e === Object(e) ? self.__expressionAnalysisMode__ ? _getLocal(_scope35, 'e', e) : void 0 : e, e).preventDefault();
              if (self.__expressionAnalysisMode__) _traceMember(e, 'stopPropagation');
              (e === Object(e) ? self.__expressionAnalysisMode__ ? _getLocal(_scope35, 'e', e) : void 0 : e, e).stopPropagation();
              return true;
            }

            if (self.__expressionAnalysisMode__) _traceMember(urlList, 'appendChild');
            (urlList === Object(urlList) ? self.__expressionAnalysisMode__ ? _getLocal(_scope30, 'urlList', urlList) : void 0 : urlList, urlList).appendChild(_element('li', _attributes(_attributeExpression('click', (followURL === Object(followURL) ? self.__expressionAnalysisMode__ ? _getLocal(_scope33, 'followURL', followURL) : void 0 : followURL, followURL))), _children(_childText('\n        '), _childExpression((isExternalLink === Object(isExternalLink) ? self.__expressionAnalysisMode__ ? _getLocal(_scope33, 'isExternalLink', isExternalLink) : void 0 : isExternalLink, isExternalLink)((url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope33, 'url', url) : void 0 : url, url)) ? (url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope33, 'url', url) : void 0 : url, url) + '<i class="fa fa-external-link"></i>' : (url === Object(url) ? self.__expressionAnalysisMode__ ? _getLocal(_scope33, 'url', url) : void 0 : url, url)), _childText('\n      ')), {
              file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
              end: {
                column: 11,
                line: 167
              },
              start: {
                column: 26,
                line: 162
              }
            }));
          }]);

          // Tags
          let tag = await (self.__expressionAnalysisMode__ ? _traceMember(graph, 'requestKnot') : void 0, (graph === Object(graph) ? self.__expressionAnalysisMode__ ? _getLocal(_scope30, 'graph', graph) : void 0 : graph, graph).requestKnot(new (self.__expressionAnalysisMode__ ? _getGlobal('URL') : void 0, URL)((self.__expressionAnalysisMode__ ? _getLocal(_scope, 'TAG_URL', TAG_URL) : void 0, TAG_URL))));
          let tagContainer = (self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#tag-container'));
          _setMember((tagContainer === Object(tagContainer) ? self.__expressionAnalysisMode__ ? _getLocal(_scope30, 'tagContainer', tagContainer) : void 0 : tagContainer, tagContainer), 'innerHTML', "", {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 31,
              line: 173
            },
            start: {
              column: 4,
              line: 173
            },
            source: ''
          });
          _getAndCallMember((self.__expressionAnalysisMode__ ? _traceMember(graph, 'query') : void 0, (graph === Object(graph) ? self.__expressionAnalysisMode__ ? _getLocal(_scope30, 'graph', graph) : void 0 : graph, graph).query((knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope30, 'knot', knot) : void 0 : knot, knot), (tag === Object(tag) ? self.__expressionAnalysisMode__ ? _getLocal(_scope30, 'tag', tag) : void 0 : tag, tag), (self.__expressionAnalysisMode__ ? _getLocal(_scope, '_', _) : void 0, _))), 'forEach', [triple => {
            let _scope36 = {
              isScope: true
            };

            let tagElement = (self.__expressionAnalysisMode__ ? _traceMember(this, 'buildTagWidget') : void 0, this.buildTagWidget(_getMember((triple === Object(triple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope36, 'triple', triple) : void 0 : triple, triple), 'object'), (triple === Object(triple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope36, 'triple', triple) : void 0 : triple, triple)));
            if (self.__expressionAnalysisMode__) _traceMember(tagContainer, 'appendChild');
            (tagContainer === Object(tagContainer) ? self.__expressionAnalysisMode__ ? _getLocal(_scope30, 'tagContainer', tagContainer) : void 0 : tagContainer, tagContainer).appendChild((tagElement === Object(tagElement) ? self.__expressionAnalysisMode__ ? _getLocal(_scope36, 'tagElement', tagElement) : void 0 : tagElement, tagElement));
          }]);
          _setMember((self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#add-tag')), 'onclick', event => {
            let _scope37 = {
              isScope: true
            };
            return self.__expressionAnalysisMode__ ? _traceMember(this, 'addTag') : void 0, this.addTag((event === Object(event) ? self.__expressionAnalysisMode__ ? _getLocal(_scope37, 'event', event) : void 0 : event, event));
          }, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 62,
              line: 178
            },
            start: {
              column: 4,
              line: 178
            },
            source: ''
          });

          // spo tables
          // this.replaceTableBodyFor('#po-table', knot, _, _, 'predicate', 'object');
          // this.replaceTableBodyFor('#so-table', _, knot, _, 'subject', 'object');
          // this.replaceTableBodyFor('#sp-table', _, _, knot, 'subject', 'predicate');

          // add button behavior
          _setMember((self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#r-add-triple-as-subject')), 'onclick', evt => {
            let _scope38 = {
              isScope: true
            };
            return self.__expressionAnalysisMode__ ? _traceMember(this, 'addTripleWithKnotAsSubject') : void 0, this.addTripleWithKnotAsSubject((evt === Object(evt) ? self.__expressionAnalysisMode__ ? _getLocal(_scope38, 'evt', evt) : void 0 : evt, evt));
          }, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 94,
              line: 186
            },
            start: {
              column: 4,
              line: 186
            },
            source: ''
          });
          _setMember((self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#r-add-triple-as-predicate')), 'onclick', evt => {
            let _scope39 = {
              isScope: true
            };
            return self.__expressionAnalysisMode__ ? _traceMember(this, 'addTripleWithKnotAsPredicate') : void 0, this.addTripleWithKnotAsPredicate((evt === Object(evt) ? self.__expressionAnalysisMode__ ? _getLocal(_scope39, 'evt', evt) : void 0 : evt, evt));
          }, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 98,
              line: 187
            },
            start: {
              column: 4,
              line: 187
            },
            source: ''
          });
          _setMember((self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#r-add-triple-as-object')), 'onclick', evt => {
            let _scope40 = {
              isScope: true
            };
            return self.__expressionAnalysisMode__ ? _traceMember(this, 'addTripleWithKnotAsObject') : void 0, this.addTripleWithKnotAsObject((evt === Object(evt) ? self.__expressionAnalysisMode__ ? _getLocal(_scope40, 'evt', evt) : void 0 : evt, evt));
          }, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 92,
              line: 188
            },
            start: {
              column: 4,
              line: 188
            },
            source: ''
          });

          // metadata
          //this.buildMetadata(knot);

          // content
          if (self.__expressionAnalysisMode__) _traceMember(this, 'buildContentFor');
          this.buildContentFor((knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope30, 'knot', knot) : void 0 : knot, knot));
        }

        buildTagWidget(tag, triple) {
          let _scope41 = {
            isScope: true
          };

          return _element('div', _attributes(), _children(_childText('\n      '), _childExpression((self.__expressionAnalysisMode__ ? _traceMember(this, 'buildNavigatableLinkFor') : void 0, this.buildNavigatableLinkFor((tag === Object(tag) ? self.__expressionAnalysisMode__ ? _getLocal(_scope41, 'tag', tag) : void 0 : tag, tag)))), _childText('\n      '), _childExpression((self.__expressionAnalysisMode__ ? _traceMember(this, 'buildDeleteTagElement') : void 0, this.buildDeleteTagElement((triple === Object(triple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope41, 'triple', triple) : void 0 : triple, triple)))), _childText('\n    ')), {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 10,
              line: 202
            },
            start: {
              column: 11,
              line: 199
            }
          });
        }
        buildDeleteTagElement(triple) {
          let _scope42 = {
            isScope: true
          };

          return _element('i', _attributes(_attributeStringLiteral('class', 'fa fa-trash'), _attributeExpression('click', e => {
            if (self.__expressionAnalysisMode__) _traceMember(this, 'deleteTagTriple');

            this.deleteTagTriple((triple === Object(triple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope42, 'triple', triple) : void 0 : triple, triple));
          })), _children(), {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 11,
              line: 207
            },
            start: {
              column: 11,
              line: 205
            }
          });
        }
        async deleteTagTriple(triple) {
          let _scope43 = {
            isScope: true
          };

          const graph = await (self.__expressionAnalysisMode__ ? _traceMember(Graph, 'getInstance') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'Graph', Graph) : void 0, Graph).getInstance());
          const knot = await (self.__expressionAnalysisMode__ ? _traceMember(graph, 'requestKnot') : void 0, (graph === Object(graph) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'graph', graph) : void 0 : graph, graph).requestKnot(new (self.__expressionAnalysisMode__ ? _getGlobal('URL') : void 0, URL)(_getMember((triple === Object(triple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'triple', triple) : void 0 : triple, triple), 'fileName'))));

          if (await (self.__expressionAnalysisMode__ ? _traceMember(graph, 'deleteKnot') : void 0, (graph === Object(graph) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'graph', graph) : void 0 : graph, graph).deleteKnot((knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'knot', knot) : void 0 : knot, knot)))) {
            if (self.__expressionAnalysisMode__) _traceMember(this, 'refresh');

            this.refresh();
          } else {
            if (self.__expressionAnalysisMode__) _traceMember(lively, 'notify');

            (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).notify(`did not delete tag ${_getMember(_getMember((triple === Object(triple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope43, 'triple', triple) : void 0 : triple, triple), 'object'), 'fileName')}`);
          }
        }

        refresh() {
          if (self.__expressionAnalysisMode__) _traceMember(this, 'loadKnot');

          this.loadKnot(_getMember(this, 'urlString'));
        }
        async deleteKnot() {
          let _scope44 = {
            isScope: true
          };

          const graph = await (self.__expressionAnalysisMode__ ? _traceMember(Graph, 'getInstance') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'Graph', Graph) : void 0, Graph).getInstance());
          const knot = await (self.__expressionAnalysisMode__ ? _traceMember(graph, 'requestKnot') : void 0, (graph === Object(graph) ? self.__expressionAnalysisMode__ ? _getLocal(_scope44, 'graph', graph) : void 0 : graph, graph).requestKnot(new (self.__expressionAnalysisMode__ ? _getGlobal('URL') : void 0, URL)(_getMember(this, 'urlString'))));

          if (await (self.__expressionAnalysisMode__ ? _traceMember(graph, 'deleteKnot') : void 0, (graph === Object(graph) ? self.__expressionAnalysisMode__ ? _getLocal(_scope44, 'graph', graph) : void 0 : graph, graph).deleteKnot((knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope44, 'knot', knot) : void 0 : knot, knot)))) {
            let _scope45 = {
              isScope: true
            };

            const elementToRemove = _getMember(_getMember(this, 'parentElement'), 'isWindow') ? _getMember(this, 'parentElement') : this;
            if (self.__expressionAnalysisMode__) _traceMember(elementToRemove, 'remove');
            (elementToRemove === Object(elementToRemove) ? self.__expressionAnalysisMode__ ? _getLocal(_scope45, 'elementToRemove', elementToRemove) : void 0 : elementToRemove, elementToRemove).remove();
          } else {
            if (self.__expressionAnalysisMode__) _traceMember(lively, 'notify');

            (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).notify(`did not delete knot ${_getMember(this, 'urlString')}`);
          }
        }

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

          const addTriple = await (self.__expressionAnalysisMode__ ? _traceMember(lively, 'openComponentInWindow') : void 0, (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).openComponentInWindow("add-triple"));
          _setMember((addTriple === Object(addTriple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope46, 'addTriple', addTriple) : void 0 : addTriple, addTriple), 'afterSubmit', () => {
            _getAndCallMember(_getMember((addTriple === Object(addTriple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope46, 'addTriple', addTriple) : void 0 : addTriple, addTriple), 'parentElement'), 'remove', []);
            if (self.__expressionAnalysisMode__) _traceMember(this, 'refresh');
            this.refresh();
          }, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 5,
              line: 240
            },
            start: {
              column: 4,
              line: 237
            },
            source: ''
          });
          return addTriple === Object(addTriple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope46, 'addTriple', addTriple) : void 0 : addTriple, addTriple;
        }
        async addTag(event) {
          let _scope47 = {
            isScope: true
          };

          const addTriple = await (self.__expressionAnalysisMode__ ? _traceMember(this, 'createAddTriple') : void 0, this.createAddTriple());

          if (self.__expressionAnalysisMode__) _traceMember(addTriple, 'setField');
          (addTriple === Object(addTriple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope47, 'addTriple', addTriple) : void 0 : addTriple, addTriple).setField('subject', _getMember(this, 'urlString'));
          if (self.__expressionAnalysisMode__) _traceMember(addTriple, 'setField');
          (addTriple === Object(addTriple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope47, 'addTriple', addTriple) : void 0 : addTriple, addTriple).setField('predicate', _getMember(this, 'tagURLString'));
          if (self.__expressionAnalysisMode__) _traceMember(addTriple, 'focus');
          (addTriple === Object(addTriple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope47, 'addTriple', addTriple) : void 0 : addTriple, addTriple).focus('object');
        }

        async addTripleWithKnotAsSubject() {
          let _scope48 = {
            isScope: true
          };

          const addTriple = await (self.__expressionAnalysisMode__ ? _traceMember(this, 'createAddTriple') : void 0, this.createAddTriple());

          if (self.__expressionAnalysisMode__) _traceMember(addTriple, 'setField');
          (addTriple === Object(addTriple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope48, 'addTriple', addTriple) : void 0 : addTriple, addTriple).setField('subject', _getMember(this, 'urlString'));
          if (self.__expressionAnalysisMode__) _traceMember(addTriple, 'focus');
          (addTriple === Object(addTriple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope48, 'addTriple', addTriple) : void 0 : addTriple, addTriple).focus('predicate');
        }

        async addTripleWithKnotAsPredicate() {
          let _scope49 = {
            isScope: true
          };

          const addTriple = await (self.__expressionAnalysisMode__ ? _traceMember(this, 'createAddTriple') : void 0, this.createAddTriple());

          if (self.__expressionAnalysisMode__) _traceMember(addTriple, 'setField');
          (addTriple === Object(addTriple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope49, 'addTriple', addTriple) : void 0 : addTriple, addTriple).setField('predicate', _getMember(this, 'urlString'));
          if (self.__expressionAnalysisMode__) _traceMember(addTriple, 'focus');
          (addTriple === Object(addTriple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope49, 'addTriple', addTriple) : void 0 : addTriple, addTriple).focus('subject');
        }

        async addTripleWithKnotAsObject() {
          let _scope50 = {
            isScope: true
          };

          const addTriple = await (self.__expressionAnalysisMode__ ? _traceMember(this, 'createAddTriple') : void 0, this.createAddTriple());

          if (self.__expressionAnalysisMode__) _traceMember(addTriple, 'setField');
          (addTriple === Object(addTriple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope50, 'addTriple', addTriple) : void 0 : addTriple, addTriple).setField('object', _getMember(this, 'urlString'));
          if (self.__expressionAnalysisMode__) _traceMember(addTriple, 'focus');
          (addTriple === Object(addTriple) ? self.__expressionAnalysisMode__ ? _getLocal(_scope50, 'addTriple', addTriple) : void 0 : addTriple, addTriple).focus('subject');
        }

        buildListItemFor(knot, role) {
          let _scope51 = {
            isScope: true
          };

          return _element('li', _attributes(), _children(_childExpression((role === Object(role) ? self.__expressionAnalysisMode__ ? _getLocal(_scope51, 'role', role) : void 0 : role, role)), _childText(': '), _childExpression((self.__expressionAnalysisMode__ ? _traceMember(this, 'buildRefFor') : void 0, this.buildRefFor((knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope51, 'knot', knot) : void 0 : knot, knot))))), {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 52,
              line: 273
            },
            start: {
              column: 11,
              line: 273
            }
          });
        }
        async buildContentFor(knot) {
          let _scope52 = {
            isScope: true
          };

          let editorComp = (self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#content-editor'));
          if (self.__expressionAnalysisMode__) _traceMember(lively, 'removeEventListener');
          (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).removeEventListener('knot-view-editor', (editorComp === Object(editorComp) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'editorComp', editorComp) : void 0 : editorComp, editorComp), 'change');
          let spoList = (self.__expressionAnalysisMode__ ? _traceMember(this, 'get') : void 0, this.get('#spo-list'));
          if (self.__expressionAnalysisMode__ ? _traceMember(knot, 'isTriple') : void 0, (knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'knot', knot) : void 0 : knot, knot).isTriple()) {
            if (self.__expressionAnalysisMode__) _traceMember(this, 'hide');

            this.hide((editorComp === Object(editorComp) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'editorComp', editorComp) : void 0 : editorComp, editorComp));
            if (self.__expressionAnalysisMode__) _traceMember(this, 'show');
            this.show((spoList === Object(spoList) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'spoList', spoList) : void 0 : spoList, spoList));
            _setMember((spoList === Object(spoList) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'spoList', spoList) : void 0 : spoList, spoList), 'innerHTML', '', {
              file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
              end: {
                column: 28,
                line: 282
              },
              start: {
                column: 6,
                line: 282
              },
              source: ''
            });
            if (self.__expressionAnalysisMode__) _traceMember(spoList, 'appendChild');
            (spoList === Object(spoList) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'spoList', spoList) : void 0 : spoList, spoList).appendChild((self.__expressionAnalysisMode__ ? _traceMember(this, 'buildListItemFor') : void 0, this.buildListItemFor(_getMember((knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'knot', knot) : void 0 : knot, knot), 'subject'), 'Subject')));
            if (self.__expressionAnalysisMode__) _traceMember(spoList, 'appendChild');
            (spoList === Object(spoList) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'spoList', spoList) : void 0 : spoList, spoList).appendChild((self.__expressionAnalysisMode__ ? _traceMember(this, 'buildListItemFor') : void 0, this.buildListItemFor(_getMember((knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'knot', knot) : void 0 : knot, knot), 'predicate'), 'Predicate')));
            if (self.__expressionAnalysisMode__) _traceMember(spoList, 'appendChild');
            (spoList === Object(spoList) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'spoList', spoList) : void 0 : spoList, spoList).appendChild((self.__expressionAnalysisMode__ ? _traceMember(this, 'buildListItemFor') : void 0, this.buildListItemFor(_getMember((knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'knot', knot) : void 0 : knot, knot), 'object'), 'Object')));
          } else {
            let _scope53 = {
              isScope: true
            };
            if (self.__expressionAnalysisMode__) _traceMember(this, 'show');

            this.show((editorComp === Object(editorComp) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'editorComp', editorComp) : void 0 : editorComp, editorComp));
            if (self.__expressionAnalysisMode__) _traceMember(this, 'hide');
            this.hide((spoList === Object(spoList) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'spoList', spoList) : void 0 : spoList, spoList));
            if (_getMember((editorComp === Object(editorComp) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'editorComp', editorComp) : void 0 : editorComp, editorComp), 'value') !== _getMember((knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'knot', knot) : void 0 : knot, knot), 'content')) {
              _setMember((editorComp === Object(editorComp) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'editorComp', editorComp) : void 0 : editorComp, editorComp), 'value', _getMember((knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'knot', knot) : void 0 : knot, knot), 'content'), {
                file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
                end: {
                  column: 39,
                  line: 290
                },
                start: {
                  column: 8,
                  line: 290
                },
                source: ''
              });
            }
            if (self.__expressionAnalysisMode__) _traceMember(editorComp, 'enableAutocompletion');
            (editorComp === Object(editorComp) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'editorComp', editorComp) : void 0 : editorComp, editorComp).enableAutocompletion();

            let graph = await (self.__expressionAnalysisMode__ ? _traceMember(Graph, 'getInstance') : void 0, (self.__expressionAnalysisMode__ ? _getLocal(_scope, 'Graph', Graph) : void 0, Graph).getInstance());
            let urls = (self.__expressionAnalysisMode__ ? _traceMember(graph, 'getUrlsByKnot') : void 0, (graph === Object(graph) ? self.__expressionAnalysisMode__ ? _getLocal(_scope53, 'graph', graph) : void 0 : graph, graph).getUrlsByKnot((knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'knot', knot) : void 0 : knot, knot)));
            if (_getMember((urls === Object(urls) ? self.__expressionAnalysisMode__ ? _getLocal(_scope53, 'urls', urls) : void 0 : urls, urls), 'length') >= 1) {
              if (self.__expressionAnalysisMode__) _traceMember(editorComp, 'changeModeForFile');

              (editorComp === Object(editorComp) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'editorComp', editorComp) : void 0 : editorComp, editorComp).changeModeForFile(_getMember((urls === Object(urls) ? self.__expressionAnalysisMode__ ? _getLocal(_scope53, 'urls', urls) : void 0 : urls, urls), 0));
            } else {
              if (self.__expressionAnalysisMode__) _traceMember(lively, 'error');

              (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).error('no url found for ' + (self.__expressionAnalysisMode__ ? _traceMember(knot, 'label') : void 0, (knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'knot', knot) : void 0 : knot, knot).label()));
            }
            const saveKnot = async text => {
              let _scope54 = {
                isScope: true
              };

              await (self.__expressionAnalysisMode__ ? _traceMember(knot, 'save') : void 0, (knot === Object(knot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'knot', knot) : void 0 : knot, knot).save((text === Object(text) ? self.__expressionAnalysisMode__ ? _getLocal(_scope54, 'text', text) : void 0 : text, text)));
              if (self.__expressionAnalysisMode__) _traceMember(lively, 'notify');
              (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).notify('saved knot'
              // this.refresh();
              );
            };
            _setMember((editorComp === Object(editorComp) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'editorComp', editorComp) : void 0 : editorComp, editorComp), 'doSave', (saveKnot === Object(saveKnot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope53, 'saveKnot', saveKnot) : void 0 : saveKnot, saveKnot), {
              file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
              end: {
                column: 34,
                line: 306
              },
              start: {
                column: 6,
                line: 306
              },
              source: ''
            });
            const debouncedSave = _getAndCallMember(() => {
              return (saveKnot === Object(saveKnot) ? self.__expressionAnalysisMode__ ? _getLocal(_scope53, 'saveKnot', saveKnot) : void 0 : saveKnot, saveKnot)(_getMember((editorComp === Object(editorComp) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'editorComp', editorComp) : void 0 : editorComp, editorComp), 'value'));
            }, 'debounce', [2000]);
            if (self.__expressionAnalysisMode__) _traceMember(lively, 'addEventListener');
            (self.__expressionAnalysisMode__ ? _getGlobal('lively') : void 0, lively).addEventListener('knot-view-editor', (editorComp === Object(editorComp) ? self.__expressionAnalysisMode__ ? _getLocal(_scope52, 'editorComp', editorComp) : void 0 : editorComp, editorComp), 'change', (debouncedSave === Object(debouncedSave) ? self.__expressionAnalysisMode__ ? _getLocal(_scope53, 'debouncedSave', debouncedSave) : void 0 : debouncedSave, debouncedSave));
          }
        }

        hide(element) {
          let _scope55 = {
            isScope: true
          };
          _setMember(_getMember((element === Object(element) ? self.__expressionAnalysisMode__ ? _getLocal(_scope55, 'element', element) : void 0 : element, element), 'style'), 'display', "none", {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 48,
              line: 312
            },
            start: {
              column: 18,
              line: 312
            },
            source: ''
          });
        }
        show(element) {
          let _scope56 = {
            isScope: true
          };
          _setMember(_getMember((element === Object(element) ? self.__expressionAnalysisMode__ ? _getLocal(_scope56, 'element', element) : void 0 : element, element), 'style'), 'display', "block", {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 49,
              line: 313
            },
            start: {
              column: 18,
              line: 313
            },
            source: ''
          });
        }

        onPathEntered(path) {
          let _scope57 = {
            isScope: true
          };
          if (self.__expressionAnalysisMode__) _traceMember(this, 'loadKnotForURL');

          this.loadKnotForURL((path === Object(path) ? self.__expressionAnalysisMode__ ? _getLocal(_scope57, 'path', path) : void 0 : path, path));
        }

        livelyPrepareSave() {
          if (self.__expressionAnalysisMode__) _traceMember(this, 'setAttribute');

          this.setAttribute("data-knot-url", _getMember(this, 'urlString'));
        }
      }

      _export('default', KnotView);

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

        set(thisIsVererySecretVariableName) {
          let _scope58 = {
            isScope: true
          };
          _export('default', KnotView = (thisIsVererySecretVariableName === Object(thisIsVererySecretVariableName) ? self.__expressionAnalysisMode__ ? _getLocal(_scope58, 'thisIsVererySecretVariableName', thisIsVererySecretVariableName) : void 0 : thisIsVererySecretVariableName, thisIsVererySecretVariableName)), true ? _setLocal(_scope, 'KnotView', KnotView, {
            file: 'https://lively-kernel.org/lively4/lively4-portal/templates/knot-view.js',
            end: {
              column: 29,
              line: 10
            },
            start: {
              column: 21,
              line: 10
            },
            source: ''
          }) : void 0, KnotView;
          return true;
        },

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