public/be-assets/node_modules/@yaireo/tagify/dist/tagify.esm.js
/**
   * Enters a tag into "edit" mode
   * @param {Node} tagElm the tag element to edit. if nothing specified, use last last
   */
Enters a tag into "edit" mode
@param {Node} tagElm the tag element to edit. if nothing specified, use last last
Enters a tag into " edit " mode @param { Node } tagElm the tag element to edit . if nothing specified use last last
editTag(tagElm, opts) {
    tagElm = tagElm || this.getLastTag();
    opts = opts || {};
    this.dropdown.hide();
    var _s = this.settings;
    function getEditableElm() {
      return tagElm.querySelector(_s.classNames.tagTextSelector);
    }
    var editableElm = getEditableElm(),
        tagIdx = this.getNodeIndex(tagElm),
        tagData = this.tagData(tagElm),
        _CB = this.events.callbacks,
        that = this,
        isValid = true,
        delayed_onEditTagBlur = function () {
      setTimeout(() => _CB.onEditTagBlur.call(that, getEditableElm()));
    };
    if (!editableElm) {
      console.warn('Cannot find element in Tag template: .', _s.classNames.tagTextSelector);
      return;
    }
    if (tagData instanceof Object && "editable" in tagData && !tagData.editable) return;
    editableElm.setAttribute('contenteditable', true);
    tagElm.classList.add(_s.classNames.tagEditing); 
    this.tagData(tagElm, {
      __originalData: extend({}, tagData),
      __originalHTML: tagElm.innerHTML
    });
    editableElm.addEventListener('focus', _CB.onEditTagFocus.bind(this, tagElm));
    editableElm.addEventListener('blur', delayed_onEditTagBlur);
    editableElm.addEventListener('input', _CB.onEditTagInput.bind(this, editableElm));
    editableElm.addEventListener('keydown', e => _CB.onEditTagkeydown.call(this, e, tagElm));
    editableElm.focus();
    this.setRangeAtStartEnd(false, editableElm);
    if (!opts.skipValidation) isValid = this.editTagToggleValidity(tagElm);
    editableElm.originalIsValid = isValid;
    this.trigger("edit:start", {
      tag: tagElm,
      index: tagIdx,
      data: tagData,
      isValid
    });
    return this;
  }
editTag ( tagElm , opts ) { tagElm = tagElm || this . getLastTag ( ) ; opts = opts || { } ; this . dropdown . hide ( ) ; var _s = this . settings ; function getEditableElm ( ) { return tagElm . querySelector ( _s . classNames . tagTextSelector ) ; } var editableElm = getEditableElm ( ) , tagIdx = this . getNodeIndex ( tagElm ) , tagData = this . tagData ( tagElm ) , _CB = this . events . callbacks , that = this , isValid = true , delayed_onEditTagBlur = function ( ) { setTimeout ( ( ) => _CB . onEditTagBlur . call ( that , getEditableElm ( ) ) ) ; } ; if ( ! editableElm ) { console . warn ( 'Cannot find element in Tag template: .' , _s . classNames . tagTextSelector ) ; return ; } if ( tagData instanceof Object && "editable" in tagData && ! tagData . editable ) return ; editableElm . setAttribute ( 'contenteditable' , true ) ; tagElm . classList . add ( _s . classNames . tagEditing ) ; this . tagData ( tagElm , { __originalData : extend ( { } , tagData ) , __originalHTML : tagElm . innerHTML } ) ; editableElm . addEventListener ( 'focus' , _CB . onEditTagFocus . bind ( this , tagElm ) ) ; editableElm . addEventListener ( 'blur' , delayed_onEditTagBlur ) ; editableElm . addEventListener ( 'input' , _CB . onEditTagInput . bind ( this , editableElm ) ) ; editableElm . addEventListener ( 'keydown' , e => _CB . onEditTagkeydown . call ( this , e , tagElm ) ) ; editableElm . focus ( ) ; this . setRangeAtStartEnd ( false , editableElm ) ; if ( ! opts . skipValidation ) isValid = this . editTagToggleValidity ( tagElm ) ; editableElm . originalIsValid = isValid ; this . trigger ( "edit:start" , { tag : tagElm , index : tagIdx , data : tagData , isValid } ) ; return this ; }
Enters a tag into "edit" mode
 @param {Node} tagElm the tag element to edit.
Enters a tag into " edit " mode @param { Node } tagElm the tag element to edit .
// cache the original data, on the DOM node, before any modification ocurs, for possible revert