parseLoops(rootElement) {
      Logger.debug("Parsing loops with data-for...");
      const loopElements = rootElement.querySelectorAll("[data-for]");
      Logger.debug("Found elements with data-for:", loopElements.length);
      loopElements.forEach((element2) => {
        const expression = element2.getAttribute("data-for").trim();
        const matches2 = expression.match(/^\s*(\w+)(?:\s*,\s*(\w+))?\s+in\s+(\w+(?:\.\w+)*)\s*$/);
        if (!matches2) {
          console.error("Invalid expression format data-for:", expression);
          return;
        }
        const [_5, itemName, indexName, arrayPath] = matches2;
        const array = this.model.store.get(arrayPath);
        if (!Array.isArray(array)) {
          console.error(`The value in the ${arrayPath} path is not an array:`, array);
          return;
        }
        const template = element2.cloneNode(true);
        this.loops.set(element2, {
          template,
          itemName,
          indexName,
          arrayPath,
          parentNode: element2.parentNode
        });
        this.domManager.registerDomDependency(arrayPath, element2, {
          type: "loop",
          arrayPath
        });
        this.updateLoop(element2);
      });
      Logger.debug("Parsing loops with data-in...");
      const inLoops = rootElement.querySelectorAll("[data-in]");
      Logger.debug("Found elements with data-in:", inLoops.length);
      inLoops.forEach((element2) => {
        const attributeValue = element2.getAttribute("data-in");
        const match = attributeValue.match(/^\s*(\w+)\s+in\s+(\S+)\s*$/);
        if (!match) {
          console.error(`Invalid data-in syntax: ${attributeValue}`);
          return;
        }
        const [_5, keyVar, objectPath] = match;
        const template = element2.innerHTML;
        const parent2 = element2.parentNode;
        const placeholder = document.createComment(`data-in: ${attributeValue}`);
        element2.style.display = "none";
        parent2.insertBefore(placeholder, element2);
        this.loopsIn.push({
          type: "in",
          originalElement: element2,
          template,
          placeholder,
          objectPath,
          keyVar,
          elements: []
        });
        const objectData = this.model.store.get(objectPath);
        if (objectData && typeof objectData === "object" && !Array.isArray(objectData)) {
          this.updateInLoop(this.loopsIn[this.loopsIn.length - 1], objectData);
        }
      });
    }
Parses and initializes both array and object loops in the DOM.

For data-for loops:
- Validates loop expression syntax (item[, index] in array)
- Creates template clones for future updates
- Registers array dependencies for reactive updates
- Performs initial loop rendering

For data-in loops:
- Validates loop expression (key in object)
- Stores original templates
- Creates placeholder comments for loop position
- Hides original elements
- Performs initial object iteration rendering

@param {HTMLElement} rootElement - Root element to scan for loop directives
@throws {Error} Logs error for invalid loop expressions