<commit_before><!DOCTYPE html>
<html dir="ltr">

<head>
  <meta charset="UTF-8">
  <title>Ionic Item Sliding</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <link href="../../../../../css/ionic.bundle.css" rel="stylesheet">
  <link href="../../../../../scripts/testing/styles.css" rel="stylesheet">
  <script src="../../../../../scripts/testing/scripts.js"></script>
  <script nomodule src="../../../../../dist/ionic/ionic.js"></script>
  <script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script></head>

<body>
  <ion-app>


    <ion-header>
      <ion-toolbar>
        <ion-title>Ionic CDN demo</ion-title>
      </ion-toolbar>
    </ion-header>

    <ion-content>

      <ion-virtual-scroll id="virtual">
        <template>
          <ion-card>
            <ion-card-header>
              <ion-card-title>Card Header</ion-card-title>
            </ion-card-header>
            <ion-card-content class="content"></ion-card-content>
          </ion-card>
        </template>
      </ion-virtual-scroll>

    </ion-content>

  </ion-app>

  <script>
    const virtual = document.getElementById('virtual');
    virtual.approxItemHeight = 200;
    virtual.headerFn = (item, index) => {
      if (index % 20 === 0) {
        return 'Header ' + index;
      }
      return null;
    }

    function renderItem(el, item) {
      el.querySelector('.content').textContent = item.content;
      return el;
    }

    function renderHeader(el, item) {
      if (!el) {
        el = document.createElement('ion-item-divider');
      }
      el.textContent = item;
      return el;
    }

    virtual.nodeRender = (el, cell) => {
      if (cell.type === 'item') return renderItem(el, cell.value);
      return renderHeader(el, cell.value);
    };
    const lorem = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
    const items = [];
    for (var i = 0; i < 1000; i++) {
      items.push({
        content: lorem.substring(0, (Math.random() * (lorem.length - 100)) + 100)
      });
    }
    virtual.items = items;
  </script>
<commit_msg>test(virtual-scroll): make cards test deterministic (#19049)<commit_after><!DOCTYPE html>
<html dir="ltr">

<head>
  <meta charset="UTF-8">
  <title>Ionic Item Sliding</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <link href="../../../../../css/ionic.bundle.css" rel="stylesheet">
  <link href="../../../../../scripts/testing/styles.css" rel="stylesheet">
  <script src="../../../../../scripts/testing/scripts.js"></script>
  <script nomodule src="../../../../../dist/ionic/ionic.js"></script>
  <script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script></head>

<body>
  <ion-app>


    <ion-header>
      <ion-toolbar>
        <ion-title>Ionic CDN demo</ion-title>
      </ion-toolbar>
    </ion-header>

    <ion-content>

      <ion-virtual-scroll id="virtual">
        <template>
          <ion-card>
            <ion-card-header>
              <ion-card-title>Card Header</ion-card-title>
            </ion-card-header>
            <ion-card-content class="content"></ion-card-content>
          </ion-card>
        </template>
      </ion-virtual-scroll>

    </ion-content>

  </ion-app>

  <script>
    const virtual = document.getElementById('virtual');
    virtual.approxItemHeight = 200;
    virtual.headerFn = (item, index) => {
      if (index % 20 === 0) {
        return 'Header ' + index;
      }
      return null;
    }

    function renderItem(el, item) {
      el.querySelector('.content').textContent = item.content;
      return el;
    }

    function renderHeader(el, item) {
      if (!el) {
        el = document.createElement('ion-item-divider');
      }
      el.textContent = item;
      return el;
    }

    virtual.nodeRender = (el, cell) => {
      if (cell.type === 'item') return renderItem(el, cell.value);
      return renderHeader(el, cell.value);
    };
    const lorem = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
    const items = [];
    for (var i = 0; i < 1000; i++) {
      items.push({
        content: lorem.substring(0, lorem.length * ((i % 4)+1) / 5)
      });
    }
    virtual.items = items;
  </script>

{'fraction_non_alphanumeric': 0.16995892822217876, 'fraction_numerical': 0.010170154508116565, 'mean_word_length': 2.4694708276797828, 'pattern_counts': {'":': 0, '<': 87, '<?xml version=': 0, '>': 89, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7246252', 'n_tokens_mistral': 1729, 'n_tokens_neox': 1618, 'n_words': 393}