<commit_before>import React from 'react'
import PropTypes from 'prop-types'
import { Person } from 'blockstack'
import { Buttons, ShellScreen, Type, UserButton, Shell } from '@blockstack/ui'
const basicInfo = 'read your basic info'
const readEmail = 'read your email address'
const publishData = 'publish data stored for this app'

const Accounts = ({ list, handleClick, processing, selectedIndex }) => {
  if (list.length) {
    return list.map(({ username, ownerAddress, profile, ...account }, i) => {
      const person = new Person(profile)
      return (
        <UserButton
          key={i}
          username={username || `ID-${ownerAddress}`}
          id={ownerAddress}
          avatarUrl={person.avatarUrl()}
          onClick={() => handleClick(i)}
          loading={processing && i === selectedIndex}
          disabled={processing}
          placeholder="Signing in..."
          hideID
        />
      )
    })
  }
  return null
}

const PermissionsList = ({ list }) => (
  <React.Fragment>
    {list.length === 1 ?
      <React.Fragment>
        <strong>{list[0]}</strong>
      </React.Fragment>
      :
      list.map((item, i) => {
      if (i !== list.length - 1) {
        return (
          <React.Fragment key={i}>
            <strong>{item}</strong>
            {', '}
          </React.Fragment>
        )
      } else {
        return (
          <React.Fragment key={i}>
            {' '}
            and <strong>{item}</strong>
          </React.Fragment>
        )
      }
    })}
  </React.Fragment>
)
/**
 * TODO: give more details on what these permissions mean
 */
const PermissionsContent = ({ permissions, app }) => (
  <React.Fragment>
    <Type.p>
      <strong>"{app && app.name}"</strong> wants to{' '}
      <PermissionsList list={permissions} />.
    </Type.p>
  </React.Fragment>
)
const InitialScreen = ({
  app,
  accounts,
  permissions,
  processing,
  selectedIndex,
  login,
  ...rest
}) => {
  const generatePermissionsList = () => {
    const permarray = [basicInfo]
    if (permissions.email) {
      permarray.push(readEmail)
    }
    if (permissions.publishData) {
      permarray.push(publishData)
    }
    return permarray
  }

  const props = {
    title: {
      children: 'Select an ID'
    },<commit_msg>Show URL as part of auth copy.<commit_after>import React from 'react'
import PropTypes from 'prop-types'
import { Person } from 'blockstack'
import { Buttons, ShellScreen, Type, UserButton, Shell } from '@blockstack/ui'
const basicInfo = 'read your basic info'
const readEmail = 'read your email address'
const publishData = 'publish data stored for this app'

const Accounts = ({ list, handleClick, processing, selectedIndex }) => {
  if (list.length) {
    return list.map(({ username, ownerAddress, profile, ...account }, i) => {
      const person = new Person(profile)
      return (
        <UserButton
          key={i}
          username={username || `ID-${ownerAddress}`}
          id={ownerAddress}
          avatarUrl={person.avatarUrl()}
          onClick={() => handleClick(i)}
          loading={processing && i === selectedIndex}
          disabled={processing}
          placeholder="Signing in..."
          hideID
        />
      )
    })
  }
  return null
}

const PermissionsList = ({ list }) => (
  <React.Fragment>
    {list.length === 1 ?
      <React.Fragment>
        <strong>{list[0]}</strong>
      </React.Fragment>
      :
      list.map((item, i) => {
      if (i !== list.length - 1) {
        return (
          <React.Fragment key={i}>
            <strong>{item}</strong>
            {', '}
          </React.Fragment>
        )
      } else {
        return (
          <React.Fragment key={i}>
            {' '}
            and <strong>{item}</strong>
          </React.Fragment>
        )
      }
    })}
  </React.Fragment>
)
/**
 * TODO: give more details on what these permissions mean
 */
const PermissionsContent = ({ permissions, app }) => (
  <React.Fragment>
    <Type.p>
      "{app && app.name}" ({app.start_url}){' '}
      wants to{' '}
      <PermissionsList list={permissions} />.{' '}
      Select an ID to use:
    </Type.p>
  </React.Fragment>
)
const InitialScreen = ({
  app,
  accounts,
  permissions,
  processing,
  selectedIndex,
  login,
  ...rest
}) => {
  const generatePermissionsList = () => {
    const permarray = [basicInfo]
    if (permissions.email) {
      permarray.push(readEmail)
    }
    if (permissions.publishData) {
      permarray.push(publishData)
    }
    return permarray
  }

  const props = {
    title: {
      children: 'Select an ID'
    },
{'fraction_non_alphanumeric': 0.14879269088536, 'fraction_numerical': 0.0013051990428540352, 'mean_word_length': 2.175414364640884, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 61, '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': '3192958', 'n_tokens_mistral': 1360, 'n_tokens_neox': 1392, 'n_words': 326}