npm package: @pie-framework/pie-fixed-player-static
Description: PIE fixed player static bundle containing: categorize, drag-in-the-blank, hotspot, image-cloze-association, multiple-choice, passage, ebsr. Production-ready, self-contained package with pre-bundled elements (hash: 963a099).
Latest version: 1.0.0-963a099.1

# @pie-framework/pie-fixed-player-static

Version: 1.0.0-963a099.1

Pre-bundled PIE fixed player with static element versions for production use.

**Note:** This is for production use with a fixed set of PIE elements. For development/testing 
in Pieoneer, use `pie-inline-player` instead.

## Included Elements

- @pie-element/categorize@11.3.2
- @pie-element/drag-in-the-blank@8.3.2
- @pie-element/hotspot@9.3.2
- @pie-element/image-cloze-association@8.3.2
- @pie-element/multiple-choice@11.4.3
- @pie-element/passage@5.3.3
- @pie-element/ebsr@12.3.3

## Installation

```bash
npm install @pie-framework/pie-fixed-player-static@1.0.0-963a099.1
```

## Usage

```html
<script type="module">
  import '@pie-framework/pie-fixed-player-static';
</script>

<pie-fixed-player 
  item-id="your-item-id"
  token="your-jwt-token"
  api-base-url="https://api.example.com"
  env='{"mode": "gather", "role": "student"}'>
</pie-fixed-player>
```

## Attributes

- `item-id` - Item identifier
- `api-base-url` - Base URL for API calls
- `token` - JWT authentication token
- `env` - Environment config (mode, role)
- `session` - Session data array
- `add-correct-response` - Show correct answers
- `external-style-urls` - Additional CSS URLs
- `loader-config` - Loader configuration (JSON string, see below)
- Custom styling attributes

## Loader Configuration

Control resource loading behavior and New Relic tracking via the `loader-config` attribute:

```html
<pie-fixed-player 
  item-id="your-item-id"
  loader-config='{"trackPageActions": true, "maxResourceRetries": 3}'>
</pie-fixed-player>
```

**Options:**
- `trackPageActions` (boolean, default: false) - Enable New Relic instrumentation for module imports and resource loading
- `maxResourceRetries` (number, default: 3) - Maximum retry attempts for failed resources
- `resourceRetryDelay` (number, default: 500) - Initial delay in ms before retrying

**Global Configuration:**

Alternatively, set configuration globally before importing the package:

```html
<script>
  window.PIE_LOADER_CONFIG = {
    trackPageActions: true,
    maxResourceRetries: 3,
    resourceRetryDelay: 500
  };
</script>
<script type="module">
  import '@pie-framework/pie-fixed-player-static';
</script>
```

## Resilient Loading

This package includes automatic retry logic for module imports and resource loading:

- **Module imports** (math-rendering, bundle, player): 4 attempts with exponential backoff (200ms, 400ms, 800ms)
- **Runtime resources** (images, audio, video): Configurable retry attempts with exponential backoff
- Console logging: warnings for retries, errors only for permanent failures
- New Relic tracking (when enabled): tracks import timing, retries, and failures

## Events

- `load-complete` - Fired when item loads successfully
- `session-changed` - Fired when user interacts with questions
- `player-error` - Fired on errors

## License

MIT