<commit_before>// Copyright 2015-2022, University of Colorado Boulder

/**
 * CreditsNode displays the credits section in the About dialog.
 * See documentation below for conventions related to each credits field.
 *
 * @author <NAME> (PhET Interactive Simulations)
 * @author <NAME> (PixelZoom, Inc.)
 * @author <NAME> <<EMAIL>>
 */

import merge from '../../phet-core/js/merge.js';
import optionize from '../../phet-core/js/optionize.js';
import StringUtils from '../../phetcommon/js/util/StringUtils.js';
import PhetFont from '../../scenery-phet/js/PhetFont.js';
import { Node, VBox, VBoxOptions, VoicingRichText, VoicingText, VStrut } from '../../scenery/js/imports.js';
import joist from './joist.js';
import joistStrings from './joistStrings.js';

const creditsContributorsString = joistStrings.credits.contributors;
const creditsGraphicArtsString = joistStrings.credits.graphicArts;
const creditsLeadDesignString = joistStrings.credits.leadDesign;
const creditsQualityAssuranceString = joistStrings.credits.qualityAssurance;
const creditsSoftwareDevelopmentString = joistStrings.credits.softwareDevelopment;
const creditsSoundDesignString = joistStrings.credits.soundDesign;
const creditsTeamString = joistStrings.credits.team;
const creditsThanksString = joistStrings.credits.thanks;
const creditsTitleString = joistStrings.credits.title;

type SelfOptions = {
  titleFont?: PhetFont;
  textFont?: PhetFont;
};
type CreditsNodeOptions = SelfOptions & VBoxOptions;

export type CreditsData = {
  leadDesign?: string;
  softwareDevelopment?: string;
  team?: string;
  contributors?: string;
  qualityAssurance?: string;
  graphicArts?: string;
  soundDesign?: string;
  thanks?: string;
};

export default class CreditsNode extends VBox {
  private readonly disposeCreditsNode: () => void;

  public constructor( credits: CreditsData, options: CreditsNodeOptions ) {

    options = optionize<CreditsNodeOptions, SelfOptions, VBoxOptions>()( {
      titleFont: new PhetFont( { size: 18, weight: 'bold' } ),
      textFont: new PhetFont( 16 ),
      align: 'left',
      spacing: 1,
      maxWidth: 550
    }, options );

    const richTextOptions = {
      font: options.textFont,
      align: 'left',
      lineWrap: options.maxWidth,
      tagName: 'p'
    };

    const children: Node[] = [];

    // Credits
    children.push( new VoicingText( creditsTitleString, {<commit_msg>convert voicing types to typescript<commit_after>// Copyright 2015-2022, University of Colorado Boulder

/**
 * CreditsNode displays the credits section in the About dialog.
 * See documentation below for conventions related to each credits field.
 *
 * @author <NAME> (PhET Interactive Simulations)
 * @author <NAME> (PixelZoom, Inc.)
 * @author <NAME> <<EMAIL>>
 */

import merge from '../../phet-core/js/merge.js';
import optionize from '../../phet-core/js/optionize.js';
import StringUtils from '../../phetcommon/js/util/StringUtils.js';
import PhetFont from '../../scenery-phet/js/PhetFont.js';
import { Node, VBox, VBoxOptions, VoicingRichText, VoicingText, VStrut } from '../../scenery/js/imports.js';
import joist from './joist.js';
import joistStrings from './joistStrings.js';

const creditsContributorsString = joistStrings.credits.contributors;
const creditsGraphicArtsString = joistStrings.credits.graphicArts;
const creditsLeadDesignString = joistStrings.credits.leadDesign;
const creditsQualityAssuranceString = joistStrings.credits.qualityAssurance;
const creditsSoftwareDevelopmentString = joistStrings.credits.softwareDevelopment;
const creditsSoundDesignString = joistStrings.credits.soundDesign;
const creditsTeamString = joistStrings.credits.team;
const creditsThanksString = joistStrings.credits.thanks;
const creditsTitleString = joistStrings.credits.title;

type SelfOptions = {
  titleFont?: PhetFont;
  textFont?: PhetFont;
};
type CreditsNodeOptions = SelfOptions & VBoxOptions;

export type CreditsData = {
  leadDesign?: string;
  softwareDevelopment?: string;
  team?: string;
  contributors?: string;
  qualityAssurance?: string;
  graphicArts?: string;
  soundDesign?: string;
  thanks?: string;
};

export default class CreditsNode extends VBox {
  private readonly disposeCreditsNode: () => void;

  public constructor( credits: CreditsData, options: CreditsNodeOptions ) {

    options = optionize<CreditsNodeOptions, SelfOptions, VBoxOptions>()( {
      titleFont: new PhetFont( { size: 18, weight: 'bold' } ),
      textFont: new PhetFont( 16 ),
      align: 'left',
      spacing: 1,
      maxWidth: 550
    }, options );

    const richTextOptions = {
      font: options.textFont,
      align: 'left' as const,
      lineWrap: options.maxWidth,
      tagName: 'p'
    };

    const children: Node[] = [];

    // Credits
    children.push( new VoicingText( creditsTitleString, {
{'fraction_non_alphanumeric': 0.11571279916753383, 'fraction_numerical': 0.006659729448491155, 'mean_word_length': 4.430508474576271, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '302942', 'n_tokens_mistral': 1482, 'n_tokens_neox': 1401, 'n_words': 372}