text: import { ConstReference } from '@glimmer/reference';
  export class PrimitiveReference extends ConstReference {
      constructor(value) {
          super(value);
      }
      static create(value) {
          if (value === undefined) {
              return UNDEFINED_REFERENCE;
          } else if (value === null) {
              return NULL_REFERENCE;
          } else if (value === true) {
              return TRUE_REFERENCE;
          } else if (value === false) {
              return FALSE_REFERENCE;
          } else if (typeof value === 'number') {
              return new ValueReference(value);
          } else {
              return new StringReference(value);
          }
      }
      get(_key) {
          return UNDEFINED_REFERENCE;
      }
  }
  class StringReference extends PrimitiveReference {
      constructor() {
          super(...arguments);
          this.lengthReference = null;
      }
      get(key) {
          if (key === 'length') {
              let { lengthReference } = this;
              if (lengthReference === null) {
                  lengthReference = this.lengthReference = new ValueReference(this.inner.length);
              }
              return lengthReference;
          } else {
              return super.get(key);
          }
      }
  }
  class ValueReference extends PrimitiveReference {
      constructor(value) {
          super(value);
      }
  }
  export const UNDEFINED_REFERENCE = new ValueReference(undefined);
  export const NULL_REFERENCE = new ValueReference(null);
  export const TRUE_REFERENCE = new ValueReference(true);
  export const FALSE_REFERENCE = new ValueReference(false);
  export class ConditionalReference {
      constructor(inner) {
          this.inner = inner;
          this.tag = inner.tag;
      }
      value() {
          return this.toBool(this.inner.value());
      }
      toBool(value) {
          return !!value;
      }
  }