<commit_before>import Component from '@ember/component';
import { typeOf } from '@ember/utils';
import { inject as service } from '@ember/service';
import { computed } from '@ember/object';
import { reads } from '@ember/object/computed';
import { guidFor } from '@ember/object/internals';
import layout from '../templates/components/liquid-wormhole';

export default Component.extend({
  layout,

  to: reads('destination'),
  liquidWormholeService: service('liquid-wormhole'),

  stack: computed(() => guidFor(this)),

  // Truthy value by default
  value: true,

  init() {
    const wormholeClass = this.get('class');
    const wormholeId = this.get('stack') || this.get('id');

    this.set('wormholeClass', wormholeClass);
    this.set('wormholeId', wormholeId);

    if (typeOf(this.get('send')) !== 'function') {
      this.set('hasSend', true);
    }

    this._super(...arguments);
  },

  didUpdateAttrs() {
    this._super(...arguments);
    this.get('liquidWormholeService').removeWormhole(this, this.get('to'));
    this.get('liquidWormholeService').appendWormhole(this, this.get('to'));
  },

  didInsertElement() {
    const nodes = this.$().children();
    this.set('nodes', nodes);

    this.element.className = 'liquid-wormhole-container';
    this.element.id = '';<commit_msg>[bugfix] Ensure we return a unique id per component<commit_after>import Component from '@ember/component';
import { typeOf } from '@ember/utils';
import { inject as service } from '@ember/service';
import { computed } from '@ember/object';
import { reads } from '@ember/object/computed';
import { guidFor } from '@ember/object/internals';
import layout from '../templates/components/liquid-wormhole';

export default Component.extend({
  layout,

  to: reads('destination'),
  liquidWormholeService: service('liquid-wormhole'),

  stack: computed(function() {
    return guidFor(this);
  }),

  // Truthy value by default
  value: true,

  init() {
    const wormholeClass = this.get('class');
    const wormholeId = this.get('stack') || this.get('id');

    this.set('wormholeClass', wormholeClass);
    this.set('wormholeId', wormholeId);

    if (typeOf(this.get('send')) !== 'function') {
      this.set('hasSend', true);
    }

    this._super(...arguments);
  },

  didUpdateAttrs() {
    this._super(...arguments);
    this.get('liquidWormholeService').removeWormhole(this, this.get('to'));
    this.get('liquidWormholeService').appendWormhole(this, this.get('to'));
  },

  didInsertElement() {
    const nodes = this.$().children();
    this.set('nodes', nodes);

    this.element.className = 'liquid-wormhole-container';
    this.element.id = '';
{'fraction_non_alphanumeric': 0.17465107506601282, 'fraction_numerical': 0.0, 'mean_word_length': 4.149514563106796, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '229345', 'n_tokens_mistral': 846, 'n_tokens_neox': 797, 'n_words': 169}