@Post('airportList')
    async findAllAirport(@Query() code: any): Promise<any> {
        const where = [
            { AirportCode: Like(`${code.AirportCode}%`) },
            { AirportName: Like(`${code.AirportCode}%`) },
        ]; // for OR operator

        // {
        //         AirportCode: Like(`${code.AirportCode}%`),
        //         AirportName: Like(`${code.AirportCode}%`),
        // }; // for AND operator
        console.log({ where });
        const reslut = await this.citiesService.findAll({ where });
        return conf.res.ok(reslut);
    }


@Post('cabinClassList')
    async findAllCabins(): Promise<any> {
        const result = await this.cabinClassService.findAll();
        return conf.res.ok(result);
    }


@Post('airlineList')
    async findAirlineList(): Promise<any> {
        const result = await this.airlinesService.findAll();
        return conf.res.ok(result);
    }


function decodeParam(val) {
  if (typeof val !== 'string' || val.length === 0) {
    return val;
  }
  try {
    return decodeURIComponent(val);
  } catch (err) {
    if (err instanceof URIError) {
      err.message = `Failed to decode param ' ${val} '`;
    }
    throw err;
  }
}


export default function(req, mockData) {
  const { path: targetPath, method } = req;
  const targetMethod = method.toLowerCase();

  for (const mock of mockData) {
    const { method, re, keys } = mock;
    if (method === targetMethod) {
      const match = re.exec(targetPath);
      if (match) {
        const params = {};
        for (let i = 1; i < match.length; i += 1) {
          const key = keys[i - 1];
          const prop = key.name;
          const val = decodeParam(match[i]);
          if (val !== undefined || !Object.hasOwnProperty.call(params, prop)) {
            params[prop] = val;
          }
        }
        req.params = params;
        return mock;
      }
    }
  }
}


export declare class WebWorkerPlatformLocation extends PlatformLocation {
    private _serializer;
    private _broker;
    private _popStateListeners;
    private _hashChangeListeners;
    private _location;
    private _channelSource;
    constructor(brokerFactory: ClientMessageBrokerFactory, bus: MessageBus, _serializer: Serializer);
    getBaseHrefFromDOM(): string;
    onPopState(fn: UrlChangeListener): void;
    onHashChange(fn: UrlChangeListener): void;
    pathname: string;
    search: string;
    hash: string;
    pushState(state: any, title: string, url: string): void;
    replaceState(state: any, title: string, url: string): void;
    forward(): void;
    back(): void;
}


getBaseHrefFromDOM(): string;


onPopState(fn: UrlChangeListener): void;


onHashChange(fn: UrlChangeListener): void;


pushState(state: any, title: string, url: string): void;


replaceState(state: any, title: string, url: string): void;


forward(): void;


back(): void;


export class ClientModel {

    name: string;
    email: string;

}


async () => {
  let accessCerts = await getKeys()

  const proxyServer  = createProxyServer({ws: true, toProxy: true, preserveHeaderKeyCase: true});
  const wsServer     = createServer({target: `ws://${process.env.TARGET_URL}`, ws: true})
  const logger       = morgan('combined')
  const customServer = http.createServer((req, res) => {
    // @ts-ignore
    logger(req, res, async () => {
      const { headers } = req

      const cookieHeader = req.headers['cookie']
      const cookieToken  = cookieHeader ? cookie.parse(cookieHeader)['CF_Authorization'] : null
      const headerToken  = headers['cf-access-jwt-assertion'] as string
      const token        = headerToken || cookieToken

      if (!token) {
        res.writeHead(403, 'Missing CF Access token.')
        res.end()
        return
      }

      const jwtChecks   = await Promise.all(accessCerts.public_certs.map(publicCert => jwtAsyncVerify(token, publicCert.cert)))
      const passedCheck = jwtChecks.find(jwtPayload => jwtPayload && jwtPayload.iss === `https://${process.env.LOGIN_DOMAIN!}`)

      if (passedCheck) {
        proxyServer.web(req, res, {
          target: `http://${process.env.TARGET_URL}`
        })

        return
      }

      res.writeHead(403, 'Invalid CF Access token.')
      res.end()
    })
  })

  // Proxy WS
  customServer.on('upgrade', (req, socket, head) => {
    wsServer.ws(req, socket, head);
  })

  const httpPort = process.env.PORT || 80
  customServer.listen({host: process.env.LISTEN, port: httpPort}, () => {
    console.log(`Listening on port ${httpPort}`)
  })

  // Regularly refresh access certs every hour
  setInterval(async () => {
    const newCerts = await getKeys()
    accessCerts = newCerts;
  }, 1000 * 60 * 60)
}


(req, res) => {
    // @ts-ignore
    logger(req, res, async () => {
      const { headers } = req

      const cookieHeader = req.headers['cookie']
      const cookieToken  = cookieHeader ? cookie.parse(cookieHeader)['CF_Authorization'] : null
      const headerToken  = headers['cf-access-jwt-assertion'] as string
      const token        = headerToken || cookieToken

      if (!token) {
        res.writeHead(403, 'Missing CF Access token.')
        res.end()
        return
      }

      const jwtChecks   = await Promise.all(accessCerts.public_certs.map(publicCert => jwtAsyncVerify(token, publicCert.cert)))
      const passedCheck = jwtChecks.find(jwtPayload => jwtPayload && jwtPayload.iss === `https://${process.env.LOGIN_DOMAIN!}`)

      if (passedCheck) {
        proxyServer.web(req, res, {
          target: `http://${process.env.TARGET_URL}`
        })

        return
      }

      res.writeHead(403, 'Invalid CF Access token.')
      res.end()
    })
  }


async () => {
      const { headers } = req

      const cookieHeader = req.headers['cookie']
      const cookieToken  = cookieHeader ? cookie.parse(cookieHeader)['CF_Authorization'] : null
      const headerToken  = headers['cf-access-jwt-assertion'] as string
      const token        = headerToken || cookieToken

      if (!token) {
        res.writeHead(403, 'Missing CF Access token.')
        res.end()
        return
      }

      const jwtChecks   = await Promise.all(accessCerts.public_certs.map(publicCert => jwtAsyncVerify(token, publicCert.cert)))
      const passedCheck = jwtChecks.find(jwtPayload => jwtPayload && jwtPayload.iss === `https://${process.env.LOGIN_DOMAIN!}`)

      if (passedCheck) {
        proxyServer.web(req, res, {
          target: `http://${process.env.TARGET_URL}`
        })

        return
      }

      res.writeHead(403, 'Invalid CF Access token.')
      res.end()
    }


publicCert => jwtAsyncVerify(token, publicCert.cert)


jwtPayload => jwtPayload && jwtPayload.iss === `https://${process.env.LOGIN_DOMAIN!}`


(req, socket, head) => {
    wsServer.ws(req, socket, head);
  }


() => {
    console.log(`Listening on port ${httpPort}`)
  }


async () => {
    const newCerts = await getKeys()
    accessCerts = newCerts;
  }


type i transaktionsmenuen.<


async () => {
    log.debug("Migrating");
    await migrateUp(true);

    sequelize.close();
}


() => {
  it('should render', async () => {
    const mockApi: jest.Mocked<BadgesApi> = {
      getEntityBadgeSpecs: jest.fn().mockResolvedValue([
        {
          id: 'testbadge',
          badge: {
            label: 'test',
            message: 'badge',
          },
          url: 'http://127.0.0.1/badges/entity/.../testbadge',
          markdown: '![test: badge](http://127.0.0.1/catalog/...)',
        },
      ]),
    };
    const mockEntity = { metadata: { name: 'mock' } } as Entity;

    const rendered = await renderWithEffects(
      <ApiProvider
        apis={ApiRegistry.with(badgesApiRef, mockApi).with(
          errorApiRef,
          {} as ErrorApi,
        )}
      >
        <EntityProvider entity={mockEntity}>
          <EntityBadgesDialog open />
        </EntityProvider>
      </ApiProvider>,
    );

    await expect(
      rendered.findByText('![test: badge](http://127.0.0.1/catalog/...)'),
    ).resolves.toBeInTheDocument();
  });
}


async () => {
    const mockApi: jest.Mocked<BadgesApi> = {
      getEntityBadgeSpecs: jest.fn().mockResolvedValue([
        {
          id: 'testbadge',
          badge: {
            label: 'test',
            message: 'badge',
          },
          url: 'http://127.0.0.1/badges/entity/.../testbadge',
          markdown: '![test: badge](http://127.0.0.1/catalog/...)',
        },
      ]),
    };
    const mockEntity = { metadata: { name: 'mock' } } as Entity;

    const rendered = await renderWithEffects(
      <ApiProvider
        apis={ApiRegistry.with(badgesApiRef, mockApi).with(
          errorApiRef,
          {} as ErrorApi,
        )}
      >
        <EntityProvider entity={mockEntity}>
          <EntityBadgesDialog open />
        </EntityProvider>
      </ApiProvider>,
    );

    await expect(
      rendered.findByText('![test: badge](http://127.0.0.1/catalog/...)'),
    ).resolves.toBeInTheDocument();
  }


({ route, ...props }) => {
    const { data, refetch, isLoading, isError } = useStaticData(
      PageLoader,
      {},
      {
        refetchOnWindowFocus: false,
        refetchOnMount: false,
        refetchInterval: false,
        refetchIntervalInBackground: false,
        retry: false,
        useErrorBoundary: false,
      }
    );
    const api = useApi();
    const user = api.getIsServer() ? undefined : api.getCurrentUser();

    const context = useMemo(() => {
      const partialContext: EditorialContext = {};

      if (props.project) {
        partialContext.project = props.project.id;
      }
      if (props.collection) {
        partialContext.collection = props.collection.id;
      }
      if (props.manifest) {
        partialContext.manifest = props.manifest.id;
      }
      if (props.canvas) {
        partialContext.canvas = props.canvas.id;
      }
      return partialContext;
    }, [props.canvas, props.collection, props.manifest, props.project]);

    if (isLoading) {
      return <>Loading


() => {
      const partialContext: EditorialContext = {};

      if (props.project) {
        partialContext.project = props.project.id;
      }
      if (props.collection) {
        partialContext.collection = props.collection.id;
      }
      if (props.manifest) {
        partialContext.manifest = props.manifest.id;
      }
      if (props.canvas) {
        partialContext.canvas = props.canvas.id;
      }
      return partialContext;
    }


(params, _, pathname) => {
      if (params.pagePath) {
        return ['site-page', { pagePath: params.pagePath }];
      }

      return [
        'static-site-page',
        { pagePath: pathname.startsWith('/') ? pathname.slice(1) : pathname, isStatic: true },
      ];
    }


async (key, vars, api) => {
      return await api.pageBlocks.getPage(vars.pagePath, vars.isStatic);
    }


export type PageLoaderType = {
  params: { pagePath?: string };
  variables: { pagePath: string; isStatic?: boolean };
  query: {};
  data: {
    page?: SitePage;
    navigation?: SitePage[];
    root?: {
      id: number;
      title: InternationalString;
      parent_page?: number;
      is_navigation_root: true;
      depth: number;
      path: string;
      findPath: string[];
    };
  };
  context: any;
};


renderUniversalRoutes(route


export default function(
  state: Types.State = initialState,
  action: LoginGen.Actions | SignupGen.RequestAutoInvitePayload | ProvisionGen.StartProvisionPayload
): Types.State {
  switch (action.type) {
    case LoginGen.resetStore:
      return initialState
    case SignupGen.requestAutoInvite: // fallthrough
    case LoginGen.login: // fallthrough
    case ProvisionGen.startProvision:
      return state.merge({error: initialState.error})
    case LoginGen.loginError:
      return state.merge({error: action.payload.error || initialState.error})
    case LoginGen.loadedIsOnline:
      return state.merge({isOnline: action.payload.result})
    // Saga only actions
    case LoginGen.launchAccountResetWebPage:
    case LoginGen.launchForgotPasswordWebPage:
      return state
    default:
      return state
  }
}


() => {
  return (
    <>
      <WorkExperienceItem
        title="Mooseical"
        jobTitle="Canadian Underground Music Database"
        time="Oct. 2020 - Present"
        links={[
          { href: 'https://www.mooseical.com/', name: 'mooseical.com' },
          { href: 'https://mooseical-server.herokuapp.com/graphql', name: 'GraphQL playground' },
        ]}
      >

Passion project that showcases the database of underground Canadian musicians

Users can find musicians and albums based on location and genre, respectively

Front-End built with NextJS, TypeScript, and SCSS

Created a custom GraphQL Express server with Prisma ORM

Server caching is handled by Redis

Docker was used to containerize the Redis and PostgreSQL databases

Nexus Schema manages the back-end GraphQL schema

URQL handles the client side GraphQL

Uploaded Images are compressed and resized and uploaded to Google Firebase Storage

Firebase Firestore and Google ReCaptcha are used to manage user forms

SEO optimizations including Open Graph Protocol and Twitter Cards

Extensive testing is done to reduce time to first byte

Ensured responsive design, image and code optimizations

          100% Score in Performance, Accessibility, Best Practices, and SEO in Google Lighthouse
          score

      </WorkExperienceItem>
      <WorkExperienceItem
        title="nextjs template"
        jobTitle="Template Repository"
        time="Mar. 2021 - Present"
        links={[{ href: 'https://github.com/100BC/nextjs-template', name: 'Source Code' }]}
      >

          Template Repository to quickly bootstrap a NextJS project with TypeScript and SCSS already
          pre-configured

          The repo comes with easy SEO management including Open Graph Protocol and Twitter Cards
          via the Layout component

          The stylesheets contain Normalize.css and my own rules to ensure quick startup without
          reconfiguring global styles

          ESLint, StyleLint, and Prettier come pre-configured to ensure code quality and consistency

Takes my knowledge of past projects to ensure optimal coding comfort

Consistently updated as personal knowledge grows

      </WorkExperienceItem>
      <WorkExperienceItem
        title="Online CV"
        jobTitle="Personal Website"
        time="Jun. 2019 - Present"
        links={[{ href: 'https://github.com/100BC/cv/', name: 'Source Code' }]}
      >

Built with NextJS and TypeScript

Created to better showcase my work, achievements and skill set

Follows Responsive Web Design and has automatic dark theme based on user preference

This website receives continuous updates to improve usability and update technology

      </WorkExperienceItem>
    </>


export function CalendarProvider({ children, ...props }: CalendarProps) {
  return (
    <CalendarContext.Provider value={props}>
      {children}
    </CalendarContext.Provider>
  );
}


export function useCalendarContext<Event>() {
  const context = useContext<ICalendarContext<Event>>(CalendarContext);

  if (!context) {
    throw new Error('Must wrap Element in a Calendar Provider');
  }

  return context;
}


export type ICalendarContext<Event = any> = null | {
  events: Event[];
  targetDate: Date;
  calendarMatrix: Date[][];
  currentWeek: Date[];
  nextWeek: () => void;
  previousWeek: () => void;
  nextCalendar: () => void;
  previousCalendar: () => void;
  goToToday: () => void;
  setTargetDate: Dispatch<SetStateAction<Date>>;
};


type CalendarProps = ICalendarContext & {
  children: ReactNode;
  events: any[];
};


({as, size, iconColor, decorative, title}) => (
  <SpinningWrapper size={size}>
    <LoadingIcon as


interface SpinnerWrapperProps {
  size?: IconSize;
}


export interface SpinnerProps extends LoadingIconProps {
  title: string;
  size?: IconSize;
}


() => {
  it('should render correctly', () => {
    const wrapper = shallow(<SecondPage />);

    expect(wrapper.find(Layout)).toHaveLength(1);
    expect(wrapper.find(SEO).prop('title')).toBe('Page two');
    expect(wrapper.find('h1').text()).toBe('Hi from the second page');
    expect(wrapper.find('p').text()).toBe('Welcome to page 2');
    expect(wrapper.find(Link).prop('to')).toBe('/');
  });
}


() => {
    const wrapper = shallow(<SecondPage />);

    expect(wrapper.find(Layout)).toHaveLength(1);
    expect(wrapper.find(SEO).prop('title')).toBe('Page two');
    expect(wrapper.find('h1').text()).toBe('Hi from the second page');
    expect(wrapper.find('p').text()).toBe('Welcome to page 2');
    expect(wrapper.find(Link).prop('to')).toBe('/');
  }


/**
 * Defines the sound scene component responsible to manage any sounds
 * in a given scene.
 */
export declare class AudioSceneComponent implements ISceneSerializableComponent {
    private static _CameraDirectionLH;
    private static _CameraDirectionRH;
    /**
     * The component name helpfull to identify the component in the list of scene components.
     */
    readonly name = "Audio";
    /**
     * The scene the component belongs to.
     */
    scene: Scene;
    private _audioEnabled;
    /**
     * Gets whether audio is enabled or not.
     * Please use related enable/disable method to switch state.
     */
    get audioEnabled(): boolean;
    private _headphone;
    /**
     * Gets whether audio is outputing to headphone or not.
     * Please use the according Switch methods to change output.
     */
    get headphone(): boolean;
    /**
     * Gets or sets a refresh rate when using 3D audio positioning
     */
    audioPositioningRefreshRate: number;
    private _audioListenerPositionProvider;
    /**
     * Gets the current audio listener position provider
     */
    get audioListenerPositionProvider(): Nullable<() => Vector3>;
    /**
     * Sets a custom listener position for all sounds in the scene
     * By default, this is the position of the first active camera
     */
    set audioListenerPositionProvider(value: Nullable<() => Vector3>);
    /**
     * Creates a new instance of the component for the given scene
     * @param scene Defines the scene to register the component in
     */
    constructor(scene: Scene);
    /**
     * Registers the component in a given scene
     */
    register(): void;
    /**
     * Rebuilds the elements related to this component in case of
     * context lost for instance.
     */
    rebuild(): void;
    /**
     * Serializes the component data to the specified json object
     * @param serializationObject The object to serialize to
     */
    serialize(serializationObject: any): void;
    /**
     * Adds all the elements from the container to the scene
     * @param container the container holding the elements
     */
    addFromContainer(container: AbstractScene): void;
    /**
     * Removes all the elements in the container from the scene
     * @param container contains the elements to remove
     * @param dispose if the removed element should be disposed (default: false)
     */
    removeFromContainer(container: AbstractScene, dispose?: boolean): void;
    /**
     * Disposes the component and the associated ressources.
     */
    dispose(): void;
    /**
     * Disables audio in the associated scene.
     */
    disableAudio(): void;
    /**
     * Enables audio in the associated scene.
     */
    enableAudio(): void;
    /**
     * Switch audio to headphone output.
     */
    switchAudioModeForHeadphones(): void;
    /**
     * Switch audio to normal speakers.
     */
    switchAudioModeForNormalSpeakers(): void;
    private _cachedCameraDirection;
    private _cachedCameraPosition;
    private _lastCheck;
    private _afterRender;
}


interface AbstractScene {
        /**
         * The list of sounds used in the scene.
         */
        sounds: Nullable<Array<Sound>>;
    }


interface Scene {
        /**
         * @hidden
         * Backing field
         */
        _mainSoundTrack: SoundTrack;
        /**
         * The main sound track played by the scene.
         * It cotains your primary collection of sounds.
         */
        mainSoundTrack: SoundTrack;
        /**
         * The list of sound tracks added to the scene
         * @see https://doc.babylonjs.com/how_to/playing_sounds_and_music
         */
        soundTracks: Nullable<Array<SoundTrack>>;
        /**
         * Gets a sound using a given name
         * @param name defines the name to search for
         * @return the found sound or null if not found at all.
         */
        getSoundByName(name: string): Nullable<Sound>;
        /**
         * Gets or sets if audio support is enabled
         * @see https://doc.babylonjs.com/how_to/playing_sounds_and_music
         */
        audioEnabled: boolean;
        /**
         * Gets or sets if audio will be output to headphones
         * @see https://doc.babylonjs.com/how_to/playing_sounds_and_music
         */
        headphone: boolean;
        /**
         * Gets or sets custom audio listener position provider
         * @see https://doc.babylonjs.com/how_to/playing_sounds_and_music
         */
        audioListenerPositionProvider: Nullable<() => Vector3>;
        /**
         * Gets or sets a refresh rate when using 3D audio positioning
         */
        audioPositioningRefreshRate: number;
    }


/**
     * Registers the component in a given scene
     */
register(): void;


/**
     * Rebuilds the elements related to this component in case of
     * context lost for instance.
     */
rebuild(): void;


/**
     * Serializes the component data to the specified json object
     * @param serializationObject The object to serialize to
     */
serialize(serializationObject: any): void;


/**
     * Adds all the elements from the container to the scene
     * @param container the container holding the elements
     */
addFromContainer(container: AbstractScene): void;


/**
     * Removes all the elements in the container from the scene
     * @param container contains the elements to remove
     * @param dispose if the removed element should be disposed (default: false)
     */
removeFromContainer(container: AbstractScene, dispose?: boolean): void;


/**
     * Disposes the component and the associated ressources.
     */
dispose(): void;


/**
     * Disables audio in the associated scene.
     */
disableAudio(): void;


/**
     * Enables audio in the associated scene.
     */
enableAudio(): void;


/**
     * Switch audio to headphone output.
     */
switchAudioModeForHeadphones(): void;


/**
     * Switch audio to normal speakers.
     */
switchAudioModeForNormalSpeakers(): void;


export default function OtherNews() {
  return (
    <Flex direction='column' m={6} mt={10}>
      <NewsContainer title={otherNewsTitle} contents={otherNewsContent} />
      <Center mt={10}>
        <Link href='/news' passHref>
          <ChakraLink color={appAccentColor} fontSize='xl'>
            explore more
          </ChakraLink>
        </Link>
      </Center>
    </Flex>
  );
}


(
    {
      id,
      style,
      testID = 'overlay--footer',
      children,
      className,
      justifyContent = JustifyContent.FlexEnd,
    },
    ref
  ) => {
    const overlayFooterClass = classnames('cf-overlay--footer', {
      [`${className}`]: className,
    })

    return (
      <div
        id={id}
        ref={ref}
        style={style}
        className={overlayFooterClass}
        data-testid={testID}
      >
        <FlexBox
          margin={ComponentSize.Small}
          direction={FlexDirection.Row}
          justifyContent={justifyContent}
          alignItems={AlignItems.Center}
          stretchToFitWidth={true}
        >
          {children}
        </FlexBox>
      </div>


export interface OverlayFooterProps extends StandardFunctionProps {
  justifyContent?: JustifyContent
}


export type OverlayFooterRef = HTMLDivElement


function typescript() {
  //  let interfacesOutput2 = 'export type StringHack=(string & { zz_IGNORE_ME?: never })';
  const commentMap = {} as { [index: string]: string };
  const startIndex = 'export type StringHack=(string & { zz_IGNORE_ME?: never })';

  const filesMap = {} as {
    [index: string]: string;
  };

  for (const item of interfaces) {
    let imports = [] as string[];
    let interfacesOutput = '';
    if (interfacesOutput) {
      interfacesOutput += EOL + EOL;
    }
    let isExtension = false;
    const extendNames = item.extends.map(extend => extend.name);
    const extendList = item.extends.map(extend => extend.name + stringifyGenerics(extend.generics, true)).join(', ');
    imports.push(importGenerics(extendNames, item.generics));

    interfacesOutput += 'export interface ' + item.name + stringifyGenerics(item.generics);
    //f//ilesMap[INDEXFILE] = filesMap[INDEXFILE] + EOL + createFilePath(item.name);
    if (extendList) {
      isExtension = true;
      interfacesOutput += ` extends ${extendList}`;
    }

    interfacesOutput += '{' + EOL;

    for (const property of item.properties) {
      if (property.comment) {
        if (!isExtension && !commentMap[toPropertyDeclarationName(property.name)]) {
          commentMap[toPropertyDeclarationName(property.name)] = property.comment;
        }

        interfacesOutput += property.comment + EOL;
      }

      if (isAliasProperty(property)) {
        const generics = stringifyGenerics(property.generics, true);
        imports.push(property.alias.name);
        interfacesOutput += `${JSON.stringify(property.name)}?: ${
          item.fallback
            ? `${property.alias.name + generics} | ${property.alias.name + generics}[];`
            : `${property.alias.name + generics};`
        }`;
      } else {
        const value = stringifyTypes(property.type);
        interfacesOutput += `${JSON.stringify(property.name)}?: ${
          item.fallback ? `${value} | ${value}[];` : `${value};`
        }`;
      }

      interfacesOutput += EOL;
    }

    interfacesOutput += '}';
    const flattenimports = [
      ...new Set(
        imports
          .filter(Boolean)
          .join(COMMADELIM)
          .split(COMMADELIM),
      ),
    ].join(COMMADELIM);
    filesMap[item.name] = (flattenimports ? `import {${flattenimports}} from './index'` : '') + EOL + interfacesOutput;
    // filesMap[INDEXFILE] = filesMap[INDEXFILE] + EOL + createFilePath(item.name);
  }

  //let declarationsOutput = '';
  for (const declaration of declarations.values()) {
    let imports = [] as string[];
    let declarationsOutput = '';
    if (declarationsOutput) {
      declarationsOutput += EOL + EOL;
    }

    if (commentMap.hasOwnProperty(declaration.name)) {
      declarationsOutput += commentMap[declaration.name] + EOL;
    }
    if (declaration.export) {
      declarationsOutput += 'export ';
    }
    imports.push(importifyGenerics(declaration.generics));
    imports.push(importifyTypes(declaration.types));
    declarationsOutput += `type ${declaration.name + stringifyGenerics(declaration.generics)} = ${stringifyTypes(
      declaration.types,
    ) + EOL}`;
    const flattenimports = [
      ...new Set(
        imports
          .filter(Boolean)
          .join(COMMADELIM)
          .split(COMMADELIM),
      ),
    ].join(COMMADELIM);

    filesMap[declaration.name] =
      (flattenimports ? `import {${flattenimports}} from './index'` : '') + EOL + declarationsOutput;
  }
  filesMap[INDEXFILE] =
    startIndex +
    EOL +
    Object.keys(filesMap)
      .map(file => createFilePath(file))
      .join(EOL);
  return filesMap; //interfacesOutput + EOL + EOL + declarationsOutput;
}


function stringifyTypes(types: DeclarableType | DeclarableType[]) {
  if (!Array.isArray(types)) {
    types = [types];
  }
  const res = types
    .map(type => {
      switch (type.type) {
        case Type.String:
          return 'StringHack';
        case Type.Number:
          return 'number';
        case Type.StringLiteral:
          return JSON.stringify(type.literal);
        case Type.NumericLiteral:
          return type.literal;
        case Type.Alias:
          return type.name + stringifyGenerics(type.generics, true);
        case Type.Length:
          return 'TLength';
      }
    })
    .join(' | ');

  return res === 'StringHack' ? 'string' : res;
}


function importifyTypes(types: DeclarableType | DeclarableType[]) {
  if (!Array.isArray(types)) {
    types = [types];
  }
  const res = types
    .map(type => {
      switch (type.type) {
        case Type.String:
          return 'StringHack';
        case Type.Alias:
          return type.name; //+ stringifyGenerics(type.generics, true);
      }
    })
    .filter(Boolean)
    .join(COMMADELIM);

  return res === 'StringHack' ? 'StringHack' : res;
}


function stringifyGenerics(items: IGenerics[] | undefined, ignoreDefault = false) {
  if (!items || items.length === 0) {
    return '';
  }

  return `<${items
    .map(({ name, defaults }) => (defaults && !ignoreDefault ? `${name} = ${defaults}` : name))
    .join(', ')}>`;
}


function importifyGenerics(items: IGenerics[] | undefined) {
  if (!items || items.length === 0) {
    return '';
  }
  const ds = items
    .map(({ defaults }) => (defaults && defaults.search('StringHack') !== -1 ? `StringHack` : ''))
    .filter(Boolean)
    .filter(x => !['string', 'number'].includes(x))
    .join(COMMADELIM);

  return ds;
}


function importGenerics(extendNames: string[], items: IGenerics[] | undefined) {
  if (!items || items.length === 0) {
    return '';
  }
  const ds = items
    .map(({ defaults }) => (defaults && defaults.search('StringHack') !== -1 ? `StringHack` : ''))
    .filter(Boolean);

  const extended = extendNames.filter(Boolean);
  const all = [...ds, ...extended].join(COMMADELIM);

  return all;
}


() => ({
  typescript: typescript(),
})


(name: string) => `export * from './${name}'`


extend => extend.name


extend => extend.name + stringifyGenerics(extend.generics, true)


file => createFilePath(file)


type => {
      switch (type.type) {
        case Type.String:
          return 'StringHack';
        case Type.Number:
          return 'number';
        case Type.StringLiteral:
          return JSON.stringify(type.literal);
        case Type.NumericLiteral:
          return type.literal;
        case Type.Alias:
          return type.name + stringifyGenerics(type.generics, true);
        case Type.Length:
          return 'TLength';
      }
    }


type => {
      switch (type.type) {
        case Type.String:
          return 'StringHack';
        case Type.Alias:
          return type.name; //+ stringifyGenerics(type.generics, true);
      }
    }


({ name, defaults }) => (defaults && !ignoreDefault ? `${name} = ${defaults}` : name)


({ defaults }) => (defaults && defaults.search('StringHack') !== -1 ? `StringHack` : '')


x => !['string', 'number'].includes(x)


() => {
      console.log(this.refs.filefield)
    }


(value: any) => {
      const file = value.target.files[0]
      const reader = new FileReader()
      reader.onload = () => {
        try {
          const data = JSON.parse(reader.result as string)
          if (data.items === undefined || data.edges === undefined || data.extra === undefined) {
            throw new Error()
          }
          this.props.onData(data)
        } catch (e) {
          alert('File did not contain a valid JSON')
        }
      }
      reader.readAsText(file)
    }


() => {
        try {
          const data = JSON.parse(reader.result as string)
          if (data.items === undefined || data.edges === undefined || data.extra === undefined) {
            throw new Error()
          }
          this.props.onData(data)
        } catch (e) {
          alert('File did not contain a valid JSON')
        }
      }


export default class Restore extends Component<{ onData: (_: any) => any }> {
    state = { data: '' }
    restore = () => {
      console.log(this.refs.filefield)
    }
    update = (value: any) => {
      const file = value.target.files[0]
      const reader = new FileReader()
      reader.onload = () => {
        try {
          const data = JSON.parse(reader.result as string)
          if (data.items === undefined || data.edges === undefined || data.extra === undefined) {
            throw new Error()
          }
          this.props.onData(data)
        } catch (e) {
          alert('File did not contain a valid JSON')
        }
      }
      reader.readAsText(file)
    }
    render() {
      return

              <input type='file' onChange={this.update} name='restore' id='restore' className='inputfile' />
              Upload a .json file

    }
}


render() {
      return

              <input type='file' onChange={this.update} name='restore' id='restore' className='inputfile' />
              Upload a .json file

    }


(fn:Function, name:String):Function=> {
  //Object.defineProperty(fn, 'name', { writable: true });
  //fn.name = name;
  fn['displayName'] = name;
  //Object.defineProperty(fn, 'name', { writable: false });
  return fn;
}


(standaard: systeeminstellingen)


(standaard: 15714 of testnet: 25714)


(standaard: 15715 of testnet: 25715)


(standaard: 100)


() => {
  window.Vue = VueLibrary
  Vue.config.devtools = false
  Vue.config.productionTip = false
  Vue.directive('hit', {
    inserted(el, { value }) {
      if (value && typeof value === 'function') {
        const wrapper = (e: KeyboardEvent | MouseEvent) => {
          if (value.length > 0) {
            value(e)
          } else {
            value()
          }
        }
        el.addEventListener('click', value)
        el.addEventListener('keydown', e => {
          if (e.key === 'Enter' || e.key === ' ') {
            e.preventDefault()
            wrapper(e)
          }
        })
      }
    },
  })
  Vue.use(VueFragmentPlugin)
}


(e: KeyboardEvent | MouseEvent) => {
          if (value.length > 0) {
            value(e)
          } else {
            value()
          }
        }


e => {
          if (e.key === 'Enter' || e.key === ' ') {
            e.preventDefault()
            wrapper(e)
          }
        }


inserted(el, { value }) {
      if (value && typeof value === 'function') {
        const wrapper = (e: KeyboardEvent | MouseEvent) => {
          if (value.length > 0) {
            value(e)
          } else {
            value()
          }
        }
        el.addEventListener('click', value)
        el.addEventListener('keydown', e => {
          if (e.key === 'Enter' || e.key === ' ') {
            e.preventDefault()
            wrapper(e)
          }
        })
      }
    }


() => {
  const exampleDocument = { hello: 'world' };
  const expectedJson = `{
  "hello": "world"
}`;

  it('renders', () => {
    const wrapper = shallow(<ExampleDocumentJson document={exampleDocument} />);

    expect(wrapper.find(EuiCodeBlock).prop('children')).toEqual(expectedJson);
    expect(wrapper.find(EuiCallOut)).toHaveLength(0);
  });

  it('renders invalid documents with error callouts', () => {
    const wrapper = shallow(
      <ExampleDocumentJson document={exampleDocument} errors={['Bad JSON error', 'Schema error']} />
    );

    expect(wrapper.find('h3').text()).toEqual('This document was not indexed!');
    expect(wrapper.find(EuiCallOut)).toHaveLength(2);
    expect(wrapper.find(EuiCallOut).first().prop('title')).toEqual('Bad JSON error');
    expect(wrapper.find(EuiCallOut).last().prop('title')).toEqual('Schema error');
  });
}


() => {
    const wrapper = shallow(<ExampleDocumentJson document={exampleDocument} />);

    expect(wrapper.find(EuiCodeBlock).prop('children')).toEqual(expectedJson);
    expect(wrapper.find(EuiCallOut)).toHaveLength(0);
  }


() => {
    const wrapper = shallow(
      <ExampleDocumentJson document={exampleDocument} errors={['Bad JSON error', 'Schema error']} />
    );

    expect(wrapper.find('h3').text()).toEqual('This document was not indexed!');
    expect(wrapper.find(EuiCallOut)).toHaveLength(2);
    expect(wrapper.find(EuiCallOut).first().prop('title')).toEqual('Bad JSON error');
    expect(wrapper.find(EuiCallOut).last().prop('title')).toEqual('Schema error');
  }


() => {
  it('renders', () => {
    const wrapper = shallow(<MoreDocumentsText documents={100} />);
    expect(wrapper.find('p').text()).toEqual('and 100 other documents.');

    wrapper.setProps({ documents: 1 });
    expect(wrapper.find('p').text()).toEqual('and 1 other document.');
  });
}


() => {
    const wrapper = shallow(<MoreDocumentsText documents={100} />);
    expect(wrapper.find('p').text()).toEqual('and 100 other documents.');

    wrapper.setProps({ documents: 1 });
    expect(wrapper.find('p').text()).toEqual('and 1 other document.');
  }


function CloseCircleOutlined(componentProps: IconProps) {
  const IconNode = (props: React.SVGProps<SVGSVGElement>) => (
    <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
      <path
        fillRule="evenodd"
        clipRule="evenodd"
        d="M4.4 12a7.6 7.6 0 1015.2 0 7.6 7.6 0 00-15.2 0zM12 3a9 9 0 100 18 9 9 0 000-18z"
        fill="currentColor"
      />
      <rect
        x={14.157}
        y={8.8}
        width={1.4}
        height={8}
        rx={0.7}
        transform="rotate(45 14.157 8.8)"
        fill="currentColor"
      />
      <rect
        x={15.288}
        y={14.457}
        width={1.4}
        height={8}
        rx={0.7}
        transform="rotate(135 15.288 14.457)"
        fill="currentColor"
      />
    </svg>
  );

  return <Icon {...componentProps} component={IconNode} />;
}


(props: React.SVGProps<SVGSVGElement>) => (
    <svg viewBox="0 0 24 24"


() => {
    tests.forEach(test =>
      (test.only ? it.only : it)(`should parse ${test.name}`, () =>
        expect(parseFilter(test.filter)).toEqual(test.tree),
      ),
    );
  }


test =>
      (test.only ? it.only : it)(`should parse ${test.name}`, () =>
        expect(parseFilter(test.filter)).toEqual(test.tree),
      )


() =>
        expect(parseFilter(test.filter)).toEqual(test.tree)


() => {
    tests.forEach(test =>
      (test.only ? it.only : it)(`should print ${test.name}`, () =>
        expect(printFilter(test.tree)).toEqual(test.filter),
      ),
    );
  }


test =>
      (test.only ? it.only : it)(`should print ${test.name}`, () =>
        expect(printFilter(test.tree)).toEqual(test.filter),
      )


() =>
        expect(printFilter(test.tree)).toEqual(test.filter)


() => {
    const inputExpected: Array<[string, string]> = [
      ["date '2019-02-01 12:00:00'", "date '2019-02-01 12:00:00'"],
      ["timestamp '2019-02-01'", "timestamp '2019-02-01'"],
      ["true", "true"],
      ["false", "false"],
      ["true, true", "true, true"],
      ["2", "2"],
      ["2, 3, 6", "2, 3, 6"],
      ["'hello'", "'hello'"],
      ["'hello', 'world'", "'hello', 'world'"],
      ["hello", "'hello'"],
      ['"hello"', "'hello'"],
      ["'hello", "'hello'"],
      ["hello'", "'hello'"],
      ["hello, world", "'hello', 'world'"],
      [undefined, undefined],
    ];
    inputExpected.forEach(([input, expected]) =>
      it(`should fix ${input}`, () => {
        expect(fixFilterValue(input)).toEqual(expected);
      }),
    );
  }


([input, expected]) =>
      it(`should fix ${input}`, () => {
        expect(fixFilterValue(input)).toEqual(expected);
      })


() => {
        expect(fixFilterValue(input)).toEqual(expected);
      }


@Directive()
export class PeekABooDirective implements OnInit {
  constructor(private logger: LoggerService) {}

  // implement onInit's `ngOnInit` method
  ngOnInit() { this.logIt(`OnInit`); }

  logIt(msg: string) {
    this.logger.log(`#${nextId++} ${msg}`);
  }
}


@Component({
  selector: 'peek-a-boo',
  template: '
Now you see my hero, {{name}}
',
  styles: ['p {background: LightYellow; padding: 8px}']
})
// Don't HAVE to mention the Lifecycle Hook interfaces
// unless we want typing and tool support.
export class PeekABooComponent extends PeekABooDirective implements
  OnChanges, OnInit, DoCheck, AfterContentInit, AfterContentChecked, AfterViewInit, AfterViewChecked, OnDestroy {
  @Input() name: string;

  private verb = 'initialized';

  constructor(logger: LoggerService) {
    super(logger);

    let is = this.name ? 'is':'is not';
    this.logIt(`name ${is} known at construction`);
  }

  // only called for/if there is an @input variable set by parent.
  ngOnChanges(changes: SimpleChanges) {
    let changeMsgs: string[] = [];
    for (let propName in changes) {
      if (propName === 'name') {
        let name = changes['name'].currentValue;
        changeMsgs.push(`name ${this.verb} to "${name}"`);
      } else {
        changeMsgs.push(propName + ' ' + this.verb);
      }
    }
    this.logIt(`OnChanges: ${changeMsgs.join(';')}`);
    this.verb = 'changed'; // next time it will be a change
  }

  // Beware! Called frequently!
  // Called in every change detection cycle anywhere on the page
  ngDoCheck() {this.logIt(`DoCheck`);}

  ngAfterContentInit() {this.logIt(`AfterContentInit`);}

  // Beware! Called frequently!
  // Called in every change detection cycle anywhere on the page
  ngAfterContentChecked() { this.logIt(`AfterContentChecked`);}

  ngAfterViewInit() {this.logIt(`AfterViewInit`);}

  // Beware! Called frequently!
  // Called in every change detection cycle anywhere on the page
  ngAfterViewChecked() { this.logIt(`AfterViewChecked`);}

  ngOnDestroy() { this.logIt(`onDestroy`);}
}


// implement onInit's `ngOnInit` method
ngOnInit() { this.logIt(`OnInit`); }


logIt(msg: string) {
    this.logger.log(`#${nextId++} ${msg}`);
  }


// only called for/if there is an @input variable set by parent.
ngOnChanges(changes: SimpleChanges) {
    let changeMsgs: string[] = [];
    for (let propName in changes) {
      if (propName === 'name') {
        let name = changes['name'].currentValue;
        changeMsgs.push(`name ${this.verb} to "${name}"`);
      } else {
        changeMsgs.push(propName + ' ' + this.verb);
      }
    }
    this.logIt(`OnChanges: ${changeMsgs.join(';')}`);
    this.verb = 'changed'; // next time it will be a change
  }


// Beware! Called frequently!
// Called in every change detection cycle anywhere on the page
ngDoCheck() {this.logIt(`DoCheck`);}


ngAfterContentInit() {this.logIt(`AfterContentInit`);}


// Beware! Called frequently!
// Called in every change detection cycle anywhere on the page
ngAfterContentChecked() { this.logIt(`AfterContentChecked`);}


ngAfterViewInit() {this.logIt(`AfterViewInit`);}


// Beware! Called frequently!
// Called in every change detection cycle anywhere on the page
ngAfterViewChecked() { this.logIt(`AfterViewChecked`);}


ngOnDestroy() { this.logIt(`onDestroy`);}


/**
 * @interface
 * An interface representing the secret client. For internal use.
 */
export interface SecretClientInterface {
  recoverDeletedSecret(
    secretName: string,
    options?: coreHttp.OperationOptions
  ): Promise<SecretProperties>;
  getSecret(secretName: string, options?: GetSecretOptions): Promise<KeyVaultSecret>;
  deleteSecret(secretName: string, options?: coreHttp.OperationOptions): Promise<DeletedSecret>;
  getDeletedSecret(secretName: string, options?: coreHttp.OperationOptions): Promise<DeletedSecret>;
}


/**
 * @interface
 * An interface representing the complete secret.
 */
export interface KeyVaultSecret {
  /**
   * @member {SecretProperties} [properties] The properties of the secret
   */
  properties: SecretProperties;
  /**
   * @member {string} [value] The secret value.
   */
  value?: string;
  /**
   * @member {string} [name] The name of key/secret/certificate.
   */
  name: string;
}


/**
 * @interface
 * An interface representing the a secret's attributes.
 */
export interface SecretProperties {
  /**
   * @member {string} [vaultUrl] The base URL to the vault.
   */
  vaultUrl: string;
  /**
   * @member {string} [version] The version of key/secret/certificate. May be undefined.
   */
  version?: string;
  /**
   * @member {string} [name] The name of key/secret/certificate.
   */
  name: string;
  /**
   * @member {string} [id] The secret id.
   */
  id?: string;
  /**
   * @member {string} [contentType] The content type of the secret.
   */
  contentType?: string;
  /**
   * @member {boolean} [enabled] Determines whether the object is enabled.
   */
  enabled?: boolean;
  /**
   * @member {Date} [notBefore] Not before date in UTC.
   */
  readonly notBefore?: Date;
  /**
   * @member {Date} [expiresOn] Expiry date in UTC.
   */
  readonly expiresOn?: Date;
  /**
   * @member {{ [propertyName: string]: string }} [tags] Application specific
   * metadata in the form of key-value pairs.
   */
  tags?: { [propertyName: string]: string };
  /**
   * @member {URL} [keyId] If this is a secret backing a KV certificate, then
   * this field specifies the corresponding key backing the KV certificate.
   * **NOTE: This property will not be serialized. It can only be populated by
   * the server.**
   */
  readonly keyId?: URL;
  /**
   * @member {boolean} [managed] True if the secret's lifetime is managed by
   * key vault. If this is a secret backing a certificate, then managed will be
   * true.
   * **NOTE: This property will not be serialized. It can only be populated by
   * the server.**
   */
  readonly managed?: boolean;
  /**
   * @member {Date} [created] Creation time in UTC.
   * **NOTE: This property will not be serialized. It can only be populated by
   * the server.**
   */
  readonly createdOn?: Date;
  /**
   * @member {Date} [updated] Last updated time in UTC.
   * **NOTE: This property will not be serialized. It can only be populated by
   * the server.**
   */
  readonly updatedOn?: Date;
  /**
   * @member {DeletionRecoveryLevel} [recoveryLevel] Reflects the deletion
   * recovery level currently in effect for keys in the current vault. If it
   * contains 'Purgeable' the key can be permanently deleted by a privileged
   * user; otherwise, only the system can purge the key, at the end of the
   * retention interval. Possible values include: 'Purgeable',
   * 'Recoverable+Purgeable', 'Recoverable',
   * 'Recoverable+ProtectedSubscription'
   * **NOTE: This property will not be serialized. It can only be populated by
   * the server.**
   */
  readonly recoveryLevel?: DeletionRecoveryLevel;
}


/**
 * @interface
 * An interface representing a deleted secret.
 */
export interface DeletedSecret {
  /**
   * @member {SecretProperties} [properties] The properties of the secret
   */
  properties: SecretProperties & {
    /**
     * @member {string} [recoveryId] The url of the recovery object, used to
     * identify and recover the deleted secret.
     */
    recoveryId?: string;
    /**
     * @member {Date} [scheduledPurgeDate] The time when the secret is scheduled
     * to be purged, in UTC
     * **NOTE: This property will not be serialized. It can only be populated by
     * the server.**
     */
    scheduledPurgeDate?: Date;
    /**
     * @member {Date} [deletedOn] The time when the secret was deleted, in UTC
     * **NOTE: This property will not be serialized. It can only be populated by
     * the server.**
     */
    deletedOn?: Date;
  };
  /**
   * @member {string} [value] The secret value.
   */
  value?: string;
  /**
   * @member {string} [name] The name of key/secret/certificate.
   */
  name: string;
}


/**
 * @interface
 * An interface representing the optional parameters that can be
 * passed to {@link beginDeleteSecret}
 */
export interface SecretPollerOptions extends coreHttp.OperationOptions {
  /**
   * @member {number} [intervalInMs] Time between each polling
   */
  intervalInMs?: number;
  /**
   * @member {string} [resumeFrom] A serialized poller, used to resume an existing operation
   */
  resumeFrom?: string;
}


/**
 * @interface
 * An interface representing the optional parameters that can be passed to {@link setSecret}.
 */
export interface SetSecretOptions extends coreHttp.OperationOptions {
  /**
   * @member {{ [propertyName: string]: string }} [tags] Application specific
   * metadata in the form of key-value pairs.
   */
  tags?: { [propertyName: string]: string };
  /**
   * @member {string} [contentType] Type of the secret value such as a
   * password.
   */
  contentType?: string;
  /**
   * @member {boolean} [enabled] Determines whether the object is enabled.
   */
  enabled?: boolean;
  /**
   * @member {Date} [notBefore] Not before date in UTC.
   */
  readonly notBefore?: Date;
  /**
   * @member {Date} [expiresOn] Expiry date in UTC.
   */
  readonly expiresOn?: Date;
}


/**
 * @interface
 * An interface representing the optional parameters that can be passed to {@link updateSecret}.
 */
export interface UpdateSecretPropertiesOptions extends coreHttp.OperationOptions {
  /**
   * @member {string} [contentType] Type of the secret value such as a
   * password.
   */
  contentType?: string;
  /**
   * @member {boolean} [enabled] Determines whether the object is enabled.
   */
  enabled?: boolean;
  /**
   * @member {Date} [notBefore] Not before date in UTC.
   */
  readonly notBefore?: Date;
  /**
   * @member {Date} [expiresOn] Expiry date in UTC.
   */
  readonly expiresOn?: Date;
  /**
   * @member {{ [propertyName: string]: string }} [tags] Application specific
   * metadata in the form of key-value pairs.
   */
  tags?: { [propertyName: string]: string };
}


/**
 * @interface
 * An interface representing the optional parameters that can be passed to {@link getSecret}.
 */
export interface GetSecretOptions extends coreHttp.OperationOptions {
  /**
   * @member {string} [version] The version of the secret to retrieve.  If not
   * specified the latest version of the secret will be retrieved.
   */
  version?: string;
}


/**
 * @interface
 * An interface representing optional parameters for the getDeletedSecret method
 */
export interface GetDeletedSecretOptions extends coreHttp.OperationOptions {}


/**
 * @interface
 * An interface representing optional parameters for the purgeDeletedSecret method
 */
export interface PurgeDeletedSecretOptions extends coreHttp.OperationOptions {}


/**
 * @interface
 * An interface representing optional parameters for the backupSecret method
 */
export interface BackupSecretOptions extends coreHttp.OperationOptions {}


/**
 * @interface
 * An interface representing optional parameters for the restoreSecretBackup method
 */
export interface RestoreSecretBackupOptions extends coreHttp.OperationOptions {}


/**
 * @interface
 * An interface representing optional parameters for SecretClient paged operations.
 */
export interface ListOperationOptions extends coreHttp.OperationOptions {}


export default function bundle(program) {
  const steps: StepRunnerStep[] = [
    cleanupStep,
    scanStep,
    compileStep,
    storybookStep,
    analyzeStep,
    writeFilesStep,
  ];
  program
    .command('bundle')
    .option('--storyPath [pathPattern]', 'path pattern to search for stories in')
    .option('-s, --staticDir [paths]', 'path(s) to copy static files from')
    .option('--webpackConfig [path]', 'Path to the webpack config file')
    .option('--storybookConfig [path]', 'Path to the storybook config folder')
    .description('bundles your marked components (does NOT upload to Bojagi)')
    .action(args => {
      render(
        <ConfigProvider config={args}>
          <StepContainer steps={steps} />
        </ConfigProvider>
      );
    });
}


args => {
      render(
        <ConfigProvider config={args}>
          <StepContainer steps={steps} />
        </ConfigProvider>
      );
    }


export interface PhoneConversation {
    id: number;
}


export default function Faq() {
  return (
    <>

FAQ

WTF Is a Banksys Dog?

          Banksys Dog is a collection of 10200 unique CPU generated digital art minted as NFTs on the Ethereum blockchain. Banksys Dog isn’t just about art, it’s also about Web 3.0 and Blockchain technology – every token will get their unique art and samsung frame tv not forgetting exclusive access to the unheard of road map that you can check out at https://banksysdog.io

WE GET 39% OF TBC and NFTYP?

         As part of this collection every token will include 10 class A voting right shares of The Business Catalog and NFT your property which will work out to be 39% of each company (when we figure it out legally) who are both changing the blockchain game – one for businesses and one for everyone. (the profit percentages will be airdropped to token holders.)

EVERY TOKEN WILL GET AIRDROPPED 10 LEGIT BANKSY PRINTS AS AN NFT & AN UNKNOWN NUMBER OF KEITH HARING'S WORK?

         We have partnered with an art gallery who have sourced 10 legit pest controlled certified Banksy prints that we have paid 1.5M for – from Girl with Balloon to Flower Thrower and 8 others which we’ll keep a secret for now. Every token will also own an equal % of the prints and receive royalties from lending and if we vote to sell. We will also buy land in Decentraland that we will use to create a Banksy art gallery. We also plan on airdropping an unknown number of Keith Harings work.

Who Is the Music Artist?

         The music artists name is J-Koda – Go check his music out – He’s pretty f’ing brilliant.

His album is called Beyond the Norm and you also get 1 of 10 album covers created by Koda himself.

All income will be airdropped to wallets of token holders.

We Will Be Giving 5 Million To Charity?

          1 million(USD) will go to the Keith Haring foundation and 1million(USD) is Banksy the UK street artists choice and that will be revealed after minting. The sports clubs will be decided on by voters based on locations of holders. The 2 charities that will get 1 million(USD) each will also be chosen by holders through process of elimination.

ALL VOTES WILL BE MADE THROUGH OUR MASTERMNIND DISCORD THAT ONLY TOKEN HOLDERS GET ACCESS TO!

ALL VOTES WILL BE MADE THROUGH OUR DISCORD THAT ONLY TOKEN HOLDERS GET ACCESS TO

DO THE AIRDROPPED NFT'S HAVE THE SAME UTILITIES AS THE BANKSYS DOG ONES?

          NO. However, the “Beyond the Norm” album cover NFT’s and other NFT’s airdropped can be sold on Opensea.

A goal of ours will be to pay each non-fungible token millions in crypto and give them lots of exciting gifts along the way whilst giving you great satisfaction and pride that you was one of the first holders of this evolutionary ro

GIVING 100 TOKENS TO 100 DIFFERENT NOT FOR PROFITS

         We are giving 100 NFT’s to 100 different charity in 10 different industries.

1 to Keith Haring foundation and to 9 organizations of the foundations choice that Keith would want to support.
1 to NHS Trust and 9 others to healthcare charities for different medical conditions and diseases.
1 to TeamSeas and 9 others to Climate type organizations.
10 to mental health education and support.
10 to helping children access more choices and enjoy some peace of mind.
10 to helping women who are in danger.
10 to helping educate and stop discrimination in any form.
10 to help refugees.
10 to help human beings access clean water.
10 to helping animal type charities.

    </>
  );
}


class A


type organizations.


type charities.


(preloadedState?:any)=>{
  const middleware:Middleware[] = [ReduxThunk, sagaMiddleware];

  // if(process.env.NODE_ENV !== 'production') {
      middleware.push(createLogger());
  // }
  const store = createStore(
      rootReducers,
      preloadedState,
      composeEnhancer(applyMiddleware(...middleware))
   )

  sagaMiddleware.run(rootSaga);
  if(module.hot){
      module.hot.accept("../reducers", ()=>{
          const nextRootReducer = require("../reducers");
          store.replaceReducer(nextRootReducer);
      })
  }
  return store;
}


()=>{
          const nextRootReducer = require("../reducers");
          store.replaceReducer(nextRootReducer);
      }


/**
 *
Represents the output of a get repository triggers operation.

 */
export interface GetRepositoryTriggersOutput {
    /**
     *
The system-generated unique ID for the trigger.

     */
    configurationId?: string;

    /**
     *
The JSON block of configuration information for each trigger.

     */
    triggers?: Array<_UnmarshalledRepositoryTrigger>;

    /**
     * Metadata about the response received, including the HTTP status code, HTTP headers, and any request identifiers recognized by the SDK.
     */
    $metadata: __aws_sdk_types.ResponseMetadata;
}


function setResponseFile(name) {
    process.env['MOCK_RESPONSES'] = path.join(__dirname, name);
}


function runValidations(validator: () => void, tr, done) {
    try {
        validator();
        done();
    }
    catch (error) {
        console.log("STDERR", tr.stderr);
        console.log("STDOUT", tr.stdout);
        done(error);
    }
}


(done) => {
        done();
    }


(done) => {
        process.env["__non_explicit__"] = "true"
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionUtilityVersionCompareTests.js"));
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == false, ("should have thrown and failed"));
            assert(tr.stdout.indexOf("FunctionThrewAsExpected") > -1, "Should have thrown as versions are not explicit and are empty strings.");
        }, tr, done);
    }


() => {
            assert(tr.succeeded == false, ("should have thrown and failed"));
            assert(tr.stdout.indexOf("FunctionThrewAsExpected") > -1, "Should have thrown as versions are not explicit and are empty strings.");
        }


(done) => {
        process.env["__non_explicit__"] = "false";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionUtilityVersionCompareTests.js"));
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == true, ("Should have succeeded"));
            assert(tr.stdout.indexOf("FunctionGaveRightResult") > -1, "Should have given right results for all cases.");
        }, tr, done);
    }


() => {
            assert(tr.succeeded == true, ("Should have succeeded"));
            assert(tr.stdout.indexOf("FunctionGaveRightResult") > -1, "Should have given right results for all cases.");
        }


(done) => {
        process.env["__non_explicit__"] = "false";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionUtilityChannelVersionCompareTests.js"));
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == true, ("Should have succeeded"));
            assert(tr.stdout.indexOf("FunctionGaveRightResult") > -1, "Should have given right results for all cases.");
        }, tr, done);
    }


(done) => {
        process.env["__empty__"] = "true"
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionUtilityGetMatchingVersionFromListTests.js"));
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == true, ("Should have succeeded"));
            assert(tr.stdout.indexOf("FunctionReturnedNull") > -1, "Should have returned null for all cases and print the message.");
        }, tr, done);
    }


() => {
            assert(tr.succeeded == true, ("Should have succeeded"));
            assert(tr.stdout.indexOf("FunctionReturnedNull") > -1, "Should have returned null for all cases and print the message.");
        }


(done) => {
        process.env["__empty__"] = "false"
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionUtilityGetMatchingVersionFromListTests.js"));
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == true, ("Should have succeeded"));
            assert(tr.stdout.indexOf("FuctionReturnedCorrectVersion") > -1, "Should have returned null for all cases and print the message.");
        }, tr, done);
    }


() => {
            assert(tr.succeeded == true, ("Should have succeeded"));
            assert(tr.stdout.indexOf("FuctionReturnedCorrectVersion") > -1, "Should have returned null for all cases and print the message.");
        }


(done) => {
        process.env["__invalid_versionparts__"] = "true";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "modelsVersionPartsTests.js"));
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == false, ("Should have failed"));
            assert(tr.stdout.indexOf("FunctionThrewAsExpected") > -1, "Should have thrown for all invalid version specs.");
        }, tr, done);
    }


() => {
            assert(tr.succeeded == false, ("Should have failed"));
            assert(tr.stdout.indexOf("FunctionThrewAsExpected") > -1, "Should have thrown for all invalid version specs.");
        }


(done) => {
        process.env["__invalid_versionparts__"] = "false";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "modelsVersionPartsTests.js"));
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == true, ("Should have returned right objects"));
            assert(tr.stdout.indexOf("VersionPartsCreatedSuccessfully") > -1, "Should have returned the correct objects and print the statement.");
        }, tr, done);
    }


() => {
            assert(tr.succeeded == true, ("Should have returned right objects"));
            assert(tr.stdout.indexOf("VersionPartsCreatedSuccessfully") > -1, "Should have returned the correct objects and print the statement.");
        }


(done) => {
        process.env["__invalid_channelobject__"] = "true";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "modelsChannelTests.js"));
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == false, ("Should have failed for incorrect objects."));
            assert(tr.stdout.indexOf("FunctionThrewAsExpected") > -1, "Should have thrown error in all cases.");
        }, tr, done);
    }


() => {
            assert(tr.succeeded == false, ("Should have failed for incorrect objects."));
            assert(tr.stdout.indexOf("FunctionThrewAsExpected") > -1, "Should have thrown error in all cases.");
        }


(done) => {
        process.env["__invalid_channelobject__"] = "false";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "modelsChannelTests.js"));
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == true, ("Should have successfully created channel objects."));
            assert(tr.stdout.indexOf("ChannelCreatedSuccessfully") > -1, "Should have returned the correct objects and print the statement.");
        }, tr, done);
    }


() => {
            assert(tr.succeeded == true, ("Should have successfully created channel objects."));
            assert(tr.stdout.indexOf("ChannelCreatedSuccessfully") > -1, "Should have returned the correct objects and print the statement.");
        }


(done) => {
        process.env["__sdk_runtime__"] = "true";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "modelsGetRuntimeVersionTests.js"));
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == true, ("Should have successfully returned runtime versions for sdk package type."));
            assert(tr.stdout.indexOf("RuntimeVersionsReturnedForSdkAreCorrect") > -1, "Should have returned correct runtime versions for all cases of packageType sdk.");
        }, tr, done);
    }


() => {
            assert(tr.succeeded == true, ("Should have successfully returned runtime versions for sdk package type."));
            assert(tr.stdout.indexOf("RuntimeVersionsReturnedForSdkAreCorrect") > -1, "Should have returned correct runtime versions for all cases of packageType sdk.");
        }


(done) => {
        process.env["__sdk_runtime__"] = "false";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "modelsGetRuntimeVersionTests.js"));
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == true, ("Should have successfully returned runtime versions for runtime package type."));
            assert(tr.stdout.indexOf("RuntimeVersionsReturnedAreCorrect") > -1, "Should have returned correct runtime versions for all cases of packageType runtime.");
        }, tr, done);
    }


() => {
            assert(tr.succeeded == true, ("Should have successfully returned runtime versions for runtime package type."));
            assert(tr.stdout.indexOf("RuntimeVersionsReturnedAreCorrect") > -1, "Should have returned correct runtime versions for all cases of packageType runtime.");
        }


(done) => {
        process.env["__failat__"] = "versionnotfound";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionFetcherGetVersionInfoFailTests.js"));
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == false, ("Should have failed as the wanted version of package type can not be found."));
            assert(tr.stdout.indexOf("VersionNotFound") > -1, "Should have thrown version not found exception.");
        }, tr, done);
    }


() => {
            assert(tr.succeeded == false, ("Should have failed as the wanted version of package type can not be found."));
            assert(tr.stdout.indexOf("VersionNotFound") > -1, "Should have thrown version not found exception.");
        }


(done) => {
        process.env["__failat__"] = "channelfetch";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionFetcherGetVersionInfoFailTests.js"));
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == false, ("Should have failed as channels could not be fetched."));
            assert(tr.stdout.indexOf("ExceptionWhileDownloadOrReadReleasesIndex") > -1, "Should have thrown exception and returned.");
        }, tr, done);
    }


() => {
            assert(tr.succeeded == false, ("Should have failed as channels could not be fetched."));
            assert(tr.stdout.indexOf("ExceptionWhileDownloadOrReadReleasesIndex") > -1, "Should have thrown exception and returned.");
        }


(done) => {
        process.env["__versionspec__"] = "2.2.103";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionFetcherGetVersionInfoTestsCorrect.js"));
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == true, ("Should have returned the correct version info."));
        }, tr, done);
    }


() => {
            assert(tr.succeeded == true, ("Should have returned the correct version info."));
        }


(done) => {
        process.env["__versionspec__"] = "2.1.104";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionFetcherGetVersionInfoTestsCorrect.js"));
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == true, ("Should have returned the correct version info."));
        }, tr, done);
    }


(done) => {
        process.env["__versionspec__"] = "2.x";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionFetcherGetVersionInfoTestsCorrect.js"));
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == true, ("Should have returned the correct version info."));
        }, tr, done);
    }


(done) => {
        process.env["__versionspec__"] = "2.2.x";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionFetcherGetVersionInfoTestsCorrect.js"));
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == true, ("Should have returned the correct version info."));
        }, tr, done);
    }


(done) => {
        process.env["__versionspec__"] = "2.2.x";
        process.env["__inlcudepreviewversion__"] = "true";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionFetcherGetVersionInfoTestsCorrect.js"));
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == true, ("Should have returned the correct version info."));
        }, tr, done);
    }


(done) => {
        process.env["__versionSpec__"] = "2.3.x";
        process.env["__inlcudepreviewversion__"] = "true";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionFetcherGetVersionInfoTestsCorrect.js"));
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == true, ("Should have returned the correct version info."));
        }, tr, done);
    }


(done) => {
        process.env["__ostype__"] = "win";
        process.env["__getmachineosfail__"] = "false";
        process.env["__versioninfo__"] = `{"version":"2.2.104", "files": [{"name":"winpackage.zip", "rid":"win-x64", "url": ""}]}`;
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionFetcherGetDownloadUrlFailTests.js"));
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == false, ("Should have failed as download URL is missing."));
            assert(tr.stdout.indexOf("DownloadUrlForMatchingOsNotFound") > 0, ("Should have thrown the error message as download URL is not present."))
        }, tr, done);
    }


() => {
            assert(tr.succeeded == false, ("Should have failed as download URL is missing."));
            assert(tr.stdout.indexOf("DownloadUrlForMatchingOsNotFound") > 0, ("Should have thrown the error message as download URL is not present."))
        }


(done) => {
        process.env["__ostype__"] = "win";
        process.env["__getmachineosfail__"] = "false";
        process.env["__versioninfo__"] = `{"version":"2.2.104", "files": [{"name": "linux.tar.gz", "rid":"linux-x64", "url": ""}, {"name": "win.zip", "rid":"win-x86", "url": ""}]}`;
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionFetcherGetDownloadUrlFailTests.js"));
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == false, ("Should have failed as download URL is missing."));
            assert(tr.stdout.indexOf("DownloadUrlForMatchingOsNotFound") > 0, ("Should have thrown the error message as download URL is not present."))
        }, tr, done);
    }


(done) => {
        process.env["__ostype__"] = "win";
        process.env["__getmachineosfail__"] = "true";
        process.env["__versioninfo__"] = `{"version":"2.2.104", "files": [{"name": "linux.tar.gz", "rid":"linux-x64", "url": ""}, {"name":"winpackage.zip", "rid":"win-x86", "url": ""}]}`;
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionFetcherGetDownloadUrlFailTests.js"));
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == false, ("Should have failed as machine os could not be detected."));
            assert(tr.stdout.indexOf("getMachinePlatformFailed") > 0, ("Should have thrown the error message as getMachineOs script execution was not successful."))
        }, tr, done);
    }


() => {
            assert(tr.succeeded == false, ("Should have failed as machine os could not be detected."));
            assert(tr.stdout.indexOf("getMachinePlatformFailed") > 0, ("Should have thrown the error message as getMachineOs script execution was not successful."))
        }


(done) => {
        process.env["__ostype__"] = "win";
        process.env["__getmachineosfail__"] = "false";
        process.env["__versioninfo__"] = `{"version":"2.2.104", "files": [{"name": "winpacakage.exe", "rid":"win-x64", "url": "https://path.to/file.exe"}, {"name": "winpacakage2.exe", "rid":"win-x86", "url": "https://path.to/file.exe"}]}`;
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionFetcherGetDownloadUrlFailTests.js"));
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == false, ("Should have failed as download URL is missing."));
            assert(tr.stdout.indexOf("DownloadUrlForMatchingOsNotFound") > 0, ("Should have thrown the error message as download url of zip could not be found for windows."))
        }, tr, done);
    }


() => {
            assert(tr.succeeded == false, ("Should have failed as download URL is missing."));
            assert(tr.stdout.indexOf("DownloadUrlForMatchingOsNotFound") > 0, ("Should have thrown the error message as download url of zip could not be found for windows."))
        }


(done) => {
        process.env["__ostype__"] = "osx";
        process.env["__getmachineosfail__"] = "false";
        process.env["__versioninfo__"] = `{"version":"2.2.104", "files": [{"name": "linux.tar", "rid":"linux-x64", "url": "https://path.to/file.pkg"}, {"name": "osx.pkg", "rid":"osx-x64", "url": "https://path.to/file.pkg"}]}`;
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionFetcherGetDownloadUrlFailTests.js"));
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == false, ("Should have failed as download URL is missing."));
            assert(tr.stdout.indexOf("DownloadUrlForMatchingOsNotFound") > 0, ("Should have thrown the error message as download url of tar file could not be found for mac os."))
        }, tr, done);
    }


() => {
            assert(tr.succeeded == false, ("Should have failed as download URL is missing."));
            assert(tr.stdout.indexOf("DownloadUrlForMatchingOsNotFound") > 0, ("Should have thrown the error message as download url of tar file could not be found for mac os."))
        }


(done) => {
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionFetcherGetDownloadUrlPassTests.js"));
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == true, ("Should have passed as download URL for all windows, linux and osx are available for correct rid."));
            assert(tr.stdout.indexOf("CorrectDownloadUrlsSuccessfullyReturnedForAllOs") > 0, ("Should have printed success message on receiving correct urls for all os's."))
        }, tr, done);
    }


() => {
            assert(tr.succeeded == true, ("Should have passed as download URL for all windows, linux and osx are available for correct rid."));
            assert(tr.stdout.indexOf("CorrectDownloadUrlsSuccessfullyReturnedForAllOs") > 0, ("Should have printed success message on receiving correct urls for all os's."))
        }


(done) => {
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionInstallerTests.js"))
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == false, ("Should have failed as the installation path doesn't exist and cannot be created or the process doesn't have permission over it."))
        }, tr, done);
    }


() => {
            assert(tr.succeeded == false, ("Should have failed as the installation path doesn't exist and cannot be created or the process doesn't have permission over it."))
        }


(done) => {
        process.env["__case__"] = "urlerror";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionInstallerDownloadAndInstallTests.js"))
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == false, ("Should have failed as the arguments passed are not correct."));
            assert(tr.stdout.indexOf("VersionCanNotBeDownloadedFromUrl") > -1, "Should have thrown this error: VersionCanNotBeDownloadedFromUrl");
            assert(tr.stdout.lastIndexOf("VersionCanNotBeDownloadedFromUrl") > tr.stdout.indexOf("VersionCanNotBeDownloadedFromUrl"), "Should have thrown this error: VersionCanNotBeDownloadedFromUrl");
        }, tr, done);
    }


() => {
            assert(tr.succeeded == false, ("Should have failed as the arguments passed are not correct."));
            assert(tr.stdout.indexOf("VersionCanNotBeDownloadedFromUrl") > -1, "Should have thrown this error: VersionCanNotBeDownloadedFromUrl");
            assert(tr.stdout.lastIndexOf("VersionCanNotBeDownloadedFromUrl") > tr.stdout.indexOf("VersionCanNotBeDownloadedFromUrl"), "Should have thrown this error: VersionCanNotBeDownloadedFromUrl");
        }


(done) => {
        process.env["__case__"] = "downloaderror";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionInstallerDownloadAndInstallTests.js"))
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == false, ("Should have failed as downloading the package from url did not complete."));
            assert(tr.stdout.indexOf("CouldNotDownload") > -1, "Should have thrown this error: CouldNotDownload");
        }, tr, done);
    }


() => {
            assert(tr.succeeded == false, ("Should have failed as downloading the package from url did not complete."));
            assert(tr.stdout.indexOf("CouldNotDownload") > -1, "Should have thrown this error: CouldNotDownload");
        }


(done) => {
        process.env["__case__"] = "extracterror";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionInstallerDownloadAndInstallTests.js"))
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == false, ("Should have failed as extraction of package was not successfull."));
            assert(tr.stdout.indexOf("FailedWhileExtractingPacakge") > -1, "Should have thrown this error: FailedWhileExtractingPacakge");
        }, tr, done);
    }


() => {
            assert(tr.succeeded == false, ("Should have failed as extraction of package was not successfull."));
            assert(tr.stdout.indexOf("FailedWhileExtractingPacakge") > -1, "Should have thrown this error: FailedWhileExtractingPacakge");
        }


(done) => {
        process.env["__case__"] = "filecopyerror";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionInstallerDownloadAndInstallTests.js"))
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == true, ("Should have passed."));
            assert(tr.stdout.indexOf("FailedToCopyTopLevelFiles") > -1, "Should not have caused function failure when root file's copying failed.");
            assert(tr.stdout.indexOf("SuccessfullyInstalled") > -1, "Function should have completed successfully.");
        }, tr, done);
    }


() => {
            assert(tr.succeeded == true, ("Should have passed."));
            assert(tr.stdout.indexOf("FailedToCopyTopLevelFiles") > -1, "Should not have caused function failure when root file's copying failed.");
            assert(tr.stdout.indexOf("SuccessfullyInstalled") > -1, "Function should have completed successfully.");
        }


(done) => {
        process.env["__case__"] = "conditionalfilecopy";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionInstallerDownloadAndInstallTests.js"))
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == true, ("Should have passed."));
            assert(tr.stdout.lastIndexOf("CopyingFilesIntoPath [ 'installationPath' ]") == tr.stdout.indexOf("CopyingFilesIntoPath [ 'installationPath' ]"), "Should have copied root files in only one case where the version being installed is latest among already installed ones.");
        }, tr, done);
    }


() => {
            assert(tr.succeeded == true, ("Should have passed."));
            assert(tr.stdout.lastIndexOf("CopyingFilesIntoPath [ 'installationPath' ]") == tr.stdout.indexOf("CopyingFilesIntoPath [ 'installationPath' ]"), "Should have copied root files in only one case where the version being installed is latest among already installed ones.");
        }


(done) => {
        process.env["__case__"] = "versioncompletefileerror";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionInstallerDownloadAndInstallTests.js"))
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == false, ("Should have failed as creating completion markup file failed for package."));
            assert(tr.stdout.indexOf("CreatingInstallationCompeleteFile") > -1, "Should have tried creating the file.");
            assert(tr.stdout.indexOf("FailedWhileInstallingVersionAtPath") > -1, "Should have thrown this error as the parent error.");
        }, tr, done);
    }


() => {
            assert(tr.succeeded == false, ("Should have failed as creating completion markup file failed for package."));
            assert(tr.stdout.indexOf("CreatingInstallationCompeleteFile") > -1, "Should have tried creating the file.");
            assert(tr.stdout.indexOf("FailedWhileInstallingVersionAtPath") > -1, "Should have thrown this error as the parent error.");
        }


(done) => {
        process.env["__case__"] = "successfullinstall";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionInstallerDownloadAndInstallTests.js"))
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == true, ("Should have passed."));
            assert(tr.stdout.indexOf("SuccessfullyInstalled") > -1, "Should have SuccessfullyInstalled.")
        }, tr, done);
    }


() => {
            assert(tr.succeeded == true, ("Should have passed."));
            assert(tr.stdout.indexOf("SuccessfullyInstalled") > -1, "Should have SuccessfullyInstalled.")
        }


(done) => {
        process.env["__case__"] = "nonexplicit";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionInstallerIsVersionInstalledTests.js"))
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == false, ("Should have failed."));
            assert(tr.stdout.indexOf("ExplicitVersionRequired") > -1, "Should have printed ExplicitVersionRequired.")
        }, tr, done);
    }


() => {
            assert(tr.succeeded == false, ("Should have failed."));
            assert(tr.stdout.indexOf("ExplicitVersionRequired") > -1, "Should have printed ExplicitVersionRequired.")
        }


(done) => {
        process.env["__case__"] = "folderorfilemissing";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionInstallerIsVersionInstalledTests.js"))
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == true, ("Should have returned false without failure."));
            assert(tr.stdout.indexOf("VersionFoundInCache") <= -1, "Should not have found any version in cache as either file or folder for that version were missing");
        }, tr, done);
    }


() => {
            assert(tr.succeeded == true, ("Should have returned false without failure."));
            assert(tr.stdout.indexOf("VersionFoundInCache") <= -1, "Should not have found any version in cache as either file or folder for that version were missing");
        }


(done) => {
        process.env["__case__"] = "success";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "versionInstallerIsVersionInstalledTests.js"))
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == true, ("Should have returned false without failure."));
            assert(tr.stdout.indexOf("VersionFoundInCache") > -1, "Should not have found any version in cache as either file or folder for that version were missing");
        }, tr, done);
    }


() => {
            assert(tr.succeeded == true, ("Should have returned false without failure."));
            assert(tr.stdout.indexOf("VersionFoundInCache") > -1, "Should not have found any version in cache as either file or folder for that version were missing");
        }


(done) => {
        process.env["__case__"] = "matchingversionnotfound";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "dotnetcoreInstallerTests.js"))
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == false, ("Should have failed."));
            assert(tr.stdout.indexOf("MatchingVersionNotFound") > -1, "Should not have thrown this message as versionInfo for a matching version could not be found.");
        }, tr, done);
    }


() => {
            assert(tr.succeeded == false, ("Should have failed."));
            assert(tr.stdout.indexOf("MatchingVersionNotFound") > -1, "Should not have thrown this message as versionInfo for a matching version could not be found.");
        }


(done) => {
        process.env["__case__"] = "skipinstallation";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "dotnetcoreInstallerTests.js"))
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == true, ("Should have passed."));
            assert(tr.stdout.indexOf("PrependingInstallationPath") > -1, "Should have prepended installation path");
            assert(tr.stdout.indexOf("PrependGlobalToolPath") > -1, "Should have printed this message as addDotNetCoreToolPath function should have been called.");
            assert(tr.stdout.indexOf("PrependingGlobalToolPath") > -1, "Should have prepended global tool path");
            assert(tr.stdout.indexOf("DownloadAndInstallCalled") == -1, "Should not have printed this message as DownloadAndInstall function should not have been called.");
        }, tr, done);
    }


() => {
            assert(tr.succeeded == true, ("Should have passed."));
            assert(tr.stdout.indexOf("PrependingInstallationPath") > -1, "Should have prepended installation path");
            assert(tr.stdout.indexOf("PrependGlobalToolPath") > -1, "Should have printed this message as addDotNetCoreToolPath function should have been called.");
            assert(tr.stdout.indexOf("PrependingGlobalToolPath") > -1, "Should have prepended global tool path");
            assert(tr.stdout.indexOf("DownloadAndInstallCalled") == -1, "Should not have printed this message as DownloadAndInstall function should not have been called.");
        }


(done) => {
        process.env["__case__"] = "installversion";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "dotnetcoreInstallerTests.js"))
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == true, ("Should have passed."));
            assert(tr.stdout.indexOf("PrependingInstallationPath") > -1, "Should have prepended installation path");
            assert(tr.stdout.indexOf("PrependGlobalToolPath") > -1, "Should have printed this message as addDotNetCoreToolPath function should have been called.");
            assert(tr.stdout.indexOf("PrependingGlobalToolPath") > -1, "Should have prepended global tool path");
            assert(tr.stdout.indexOf("DownloadAndInstallCalled") > -1, "Should have printed this message as DownloadAndInstall function should have been called.");
        }, tr, done);
    }


() => {
            assert(tr.succeeded == true, ("Should have passed."));
            assert(tr.stdout.indexOf("PrependingInstallationPath") > -1, "Should have prepended installation path");
            assert(tr.stdout.indexOf("PrependGlobalToolPath") > -1, "Should have printed this message as addDotNetCoreToolPath function should have been called.");
            assert(tr.stdout.indexOf("PrependingGlobalToolPath") > -1, "Should have prepended global tool path");
            assert(tr.stdout.indexOf("DownloadAndInstallCalled") > -1, "Should have printed this message as DownloadAndInstall function should have been called.");
        }


(done) => {
        process.env["__case__"] = "globaltoolpathfailure";
        let tr = new ttm.MockTestRunner(path.join(__dirname, "dotnetcoreInstallerTests.js"))
        tr.run();
        runValidations(() => {
            assert(tr.succeeded == true, ("Should have passed."));
            assert(tr.stdout.indexOf("PrependingInstallationPath") > -1, "Should have prepended installation path");
            assert(tr.stdout.indexOf("PrependGlobalToolPath") > -1, "Should have printed this message as addDotNetCoreToolPath function should have been called.");
            assert(tr.stdout.indexOf("ErrorWhileSettingDotNetToolPath") > -1, "Should have printed this message as error must have been encountered while setting GlobalToolPath.");
        }, tr, done);
    }


() => {
            assert(tr.succeeded == true, ("Should have passed."));
            assert(tr.stdout.indexOf("PrependingInstallationPath") > -1, "Should have prepended installation path");
            assert(tr.stdout.indexOf("PrependGlobalToolPath") > -1, "Should have printed this message as addDotNetCoreToolPath function should have been called.");
            assert(tr.stdout.indexOf("ErrorWhileSettingDotNetToolPath") > -1, "Should have printed this message as error must have been encountered while setting GlobalToolPath.");
        }


/**
 * A link label begins with a left bracket '[' and ends with the first right bracket ']'
 * that is not backslash-escaped. Between these brackets there must be at least one
 * non-whitespace character. Unescaped square bracket characters are not allowed inside
 * the opening and closing square brackets of link labels. A link label can have at most
 * 999 characters inside the square brackets.
 *
 * One label matches another just in case their normalized forms are equal. To normalize
 * a label, strip off the opening and closing brackets, perform the Unicode case fold,
 * strip leading and trailing whitespace and collapse consecutive internal whitespace to
 * a single space. If there are multiple matching reference link definitions, the one that
 * comes first in the document is used. (It is desirable in such cases to emit a warning.)
 *
 * @param nodePoints
 * @param startIndex
 * @param endIndex
 * @param state
 * @see https://github.github.com/gfm/#link-label
 */
export function eatAndCollectLinkLabel(
  nodePoints: ReadonlyArray<NodePoint>,
  startIndex: number,
  endIndex: number,
  state: LinkLabelCollectingState | null,
): { nextIndex: number; state: LinkLabelCollectingState } {
  let i = startIndex

  // init token
  if (state == null) {
    // eslint-disable-next-line no-param-reassign
    state = {
      saturated: false,
      nodePoints: [],
      hasNonWhitespaceCharacter: false,
    }
  }

  /**
   * Although link label may span multiple lines,
   * they may not contain a blank line.
   */
  const firstNonWhitespaceIndex = eatOptionalWhitespaces(
    nodePoints,
    i,
    endIndex,
  )
  if (firstNonWhitespaceIndex >= endIndex)
    return { nextIndex: -1, state: state }

  if (state.nodePoints.length <= 0) {
    i = firstNonWhitespaceIndex

    // check whether in brackets
    const p = nodePoints[i]
    if (p.codePoint !== AsciiCodePoint.OPEN_BRACKET) {
      return { nextIndex: -1, state: state }
    }

    i += 1
    // eslint-disable-next-line no-param-reassign
    state.nodePoints.push(p)
  }

  for (; i < endIndex; ++i) {
    const p = nodePoints[i]
    switch (p.codePoint) {
      case AsciiCodePoint.BACKSLASH:
        // eslint-disable-next-line no-param-reassign
        state.hasNonWhitespaceCharacter = true
        if (i + 1 < endIndex) {
          state.nodePoints.push(p)
          state.nodePoints.push(nodePoints[i + 1])
        }
        i += 1
        break
      case AsciiCodePoint.OPEN_BRACKET:
        return { nextIndex: -1, state: state }
      case AsciiCodePoint.CLOSE_BRACKET:
        state.nodePoints.push(p)
        if (state.hasNonWhitespaceCharacter) {
          // eslint-disable-next-line no-param-reassign
          state.saturated = true
          return { nextIndex: i + 1, state: state }
        }
        return { nextIndex: -1, state: state }
      default:
        if (!isWhitespaceCharacter(p.codePoint)) {
          // eslint-disable-next-line no-param-reassign
          state.hasNonWhitespaceCharacter = true
        }
        state.nodePoints.push(p)
    }
  }

  return { nextIndex: 1, state: state }
}


/**
 * The processing token of eatAndCollectLinkLabel, used to save
 * intermediate data to support multiple codePosition fragment processing
 *
 * @see https://github.github.com/gfm/#link-label
 */
export interface LinkLabelCollectingState {
  /**
   * Whether the current token has collected a legal LinkDestination
   */
  saturated: boolean
  /**
   * Collected token points
   */
  nodePoints: NodePoint[]
  /**
   * Does it contain non-blank characters
   */
  hasNonWhitespaceCharacter: boolean
}


function assertNonMaybe<T>(input: T): asserts input is Exclude<T, null | undefined>{
  if (input == null) {
    throw new Error(`Value should be neither null nor undefined. But received: ${inspect(input)}`)
  }
}


() => {
  monorepo.correctCWD();

  runTests({
    async: loadSchema,
    sync: loadSchemaSync
  })(load => {
    it('should work with glob correctly', async () => {
      const glob = './tests/loaders/schema/test-files/schema-dir/query.graphql';
      const schema = await load(glob, {
        loaders: [new GraphQLFileLoader()]
      });

      expect(schema.getTypeMap()['User']).toBeDefined();
      expect(schema.getTypeMap()['Query']).toBeDefined();
    });

    it('should ignore empty files when using glob expressions', async () => {
      const glob = './tests/loaders/schema/test-files/schema-dir/*.empty.graphql';

      try {
        await load(glob, {
          loaders: [new GraphQLFileLoader()]
        });
        expect(true).toBeFalsy();
      } catch (e: any) {
        expect(e.message).toContain(`Unable to find any GraphQL type definitions for the following pointers:`);
        expect(e.message).toContain(`/tests/loaders/schema/test-files/schema-dir/*.empty.graphql`);
      }
    });

    it('should point to a broken file with parsing error message', async () => {
      const glob = './tests/loaders/schema/test-files/schema-dir/*.broken.graphql';

      try {
        const schema = await load(glob, {
          loaders: [new GraphQLFileLoader()]
        });
        expect(schema).toBeFalsy();
      } catch (e: any) {
        expect(e.message).toContain(`Unable to find any GraphQL type definitions for the following pointers:`);
      }
    });

    it('should ignore graphql documents when loading a schema', async () => {
      const glob = './tests/loaders/schema/test-files/schema-dir/*.non-schema.graphql';

      try {
        await load(glob, {
          loaders: [new GraphQLFileLoader()]
        });
        expect(true).toBeFalsy();
      } catch (e: any) {
        expect(e.message).toContain(`Unable to find any GraphQL type definitions for the following pointers:`);
        expect(e.message).toContain(`./tests/loaders/schema/test-files/schema-dir/*.non-schema.graphql`);
      }
    });

    it('should work with graphql-tag', async () => {
      const schemaPath = './tests/loaders/schema/test-files/schema-dir/*.ts';

      const schema = await load(schemaPath, {
        loaders: [new CodeFileLoader()]
      });

      expect(schema.getTypeMap()['User']).toBeDefined();
      expect(schema.getTypeMap()['Query']).toBeDefined();
    });

    it('should work without globs correctly', async () => {
      const schemaPath = './tests/loaders/schema/test-files/schema-dir/type-defs/graphql-tag.ts';
      const schema = await load(schemaPath, {
        loaders: [new CodeFileLoader()]
      });

      expect(schema.getTypeMap()['User']).toBeDefined();
      expect(schema.getTypeMap()['Query']).toBeDefined();
    });

    it('should work with import notations', async () => {
      const schemaPath = './tests/loaders/schema/test-files/schema-dir/query.graphql';
      const schema = await load(schemaPath, {
        loaders: [new GraphQLFileLoader()]
      });

      expect(schema.getTypeMap()['User']).toBeDefined();
      expect(schema.getTypeMap()['Query']).toBeDefined();
    });

    it('should work with extensions (static graphql file)', async () => {
      const schemaPath = './tests/loaders/schema/test-files/schema-dir/extensions/schema-with-extend.graphql';
      const schema = await load(schemaPath, {
        loaders: [new GraphQLFileLoader()]
      });
      const QueryType = schema.getQueryType()
      assertNonMaybe(QueryType)
      const queryFields = Object.keys(QueryType.getFields());

      expect(queryFields).toContain('foo');
      expect(queryFields).toContain('bar');
    });

    it('should work with extensions (multiple graphql files)', async () => {
      const schemaPath = './tests/loaders/schema/test-files/schema-dir/extensions/*.graphql';
      const schema = await load(schemaPath, {
        loaders: [new GraphQLFileLoader()]
      });
      const QueryType = schema.getQueryType()
      assertNonMaybe(QueryType)
      const queryFields = Object.keys(QueryType.getFields());

      expect(queryFields).toContain('foo');
      expect(queryFields).toContain('bar');
      expect(queryFields).toContain('baz');
    });

    it('should work with extensions (static js file with typedefs)', async () => {
      const schemaPath = './tests/loaders/schema/test-files/schema-dir/extensions/type-defs.js';
      const schema = await load(schemaPath, {
        loaders: [new CodeFileLoader()]
      });
      const QueryType = schema.getQueryType()
      assertNonMaybe(QueryType)
      const queryFields = Object.keys(QueryType.getFields());

      expect(queryFields).toContain('foo');
      expect(queryFields).toContain('bar');
    });

    it('should include sources on demand', async () => {
      const glob = './tests/loaders/schema/test-files/schema-dir/query.graphql';
      const schemaWithSources = await load(glob, {
        loaders: [new GraphQLFileLoader()],
        includeSources: true,
      });
      assertNonMaybe(schemaWithSources.extensions)
      const sourcesFromExtensions = schemaWithSources.extensions['sources'] as any;
      expect(sourcesFromExtensions).toBeDefined();
      expect(sourcesFromExtensions).toHaveLength(1);
      expect(sourcesFromExtensions[0]).toMatchObject(expect.objectContaining({
        name: path.resolve(process.cwd(), glob).replace(/\\/g, '/')
      }))

      const schemaWithoutSources = await load(glob, {
        loaders: [new GraphQLFileLoader()]
      });
      assertNonMaybe(schemaWithoutSources.extensions)
      expect(schemaWithoutSources.extensions['sources']).not.toBeDefined();
    });

    it('should be able to exclude documents via negative glob', async () => {
      const result = await load([
        './tests/loaders/schema/test-files/schema-dir/user.graphql',
        './tests/loaders/schema/test-files/schema-dir/invalid.graphql',
        '!./tests/loaders/schema/test-files/schema-dir/i*.graphql',
      ], {
        loaders: [new GraphQLFileLoader()],
        includeSources: true,
      });
      expect(result.getTypeMap()["User"]).toBeDefined()
    })

    it('should be able to exclude documents via nested negative glob', async () => {
      await load([
        './tests/loaders/schema/test-files/schema-dir/user.graphql',
        './tests/loaders/schema/test-files/schema-dir/invalid.graphql',
         {
        '!./tests/loaders/schema/test-files/schema-dir/i*.graphql' : {}
         }
      ], {
        loaders: [new GraphQLFileLoader()],
        includeSources: true,
      });
    })
  })
}