<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Chrome / Puppeteer configuration for Browsershot-based PDF generation
    |--------------------------------------------------------------------------
    |
    | Leave all values empty/false for local development — Browsershot will
    | auto-detect the system Chrome installation.
    |
    | Production .env example:
    |   CHROME_PATH=/usr/bin/chrome-puppeteer
    |   CHROME_NO_SANDBOX=true
    |   CHROME_BASE_DIR=/var/www/html/storage/app/chrome
    |   CHROME_ARGS=--disable-dev-shm-usage,--disable-gpu,--headless=new
    |
    */

    // Absolute path to the Chrome/Chromium executable.
    // Null = let Browsershot auto-detect.
    'chrome_path' => env('CHROME_PATH'),

    // Set to true in sandboxed environments (Docker, CI).
    'chrome_no_sandbox' => (bool) env('CHROME_NO_SANDBOX', false),

    // Base directory for Chrome's user-data dir and XDG env vars.
    // When set, the following paths are derived from it:
    //   {base}/data          → --user-data-dir
    //   {base}/config        → XDG_CONFIG_HOME / CHROME_CONFIG_HOME
    //   {base}/cache         → XDG_CACHE_HOME
    //   {base}               → HOME
    // Leave empty to skip all of these (fine for local development).
    'chrome_base_dir' => env('CHROME_BASE_DIR'),

    // Comma-separated list of extra Chromium flags.
    // e.g. --disable-dev-shm-usage,--disable-gpu,--headless=new
    'chrome_args' => array_values(array_filter(
        explode(',', env('CHROME_ARGS', ''))
    )),

];
