{"version":3,"file":"dereekb-dbx-form-style-demo.mjs","sources":["../../../../packages/dbx-form/style-demo/src/lib/controls.form.directive.ts","../../../../packages/dbx-form/style-demo/src/lib/controls.presets.component.ts","../../../../packages/dbx-form/style-demo/src/lib/controls.sections.component.ts","../../../../packages/dbx-form/style-demo/src/lib/controls.sections.popover.component.ts","../../../../packages/dbx-form/style-demo/src/lib/controls.detach.component.ts","../../../../packages/dbx-form/style-demo/src/lib/fields.section.component.ts","../../../../packages/dbx-form/style-demo/src/lib/form.style.demo.providers.ts","../../../../packages/dbx-form/style-demo/src/dereekb-dbx-form-style-demo.ts"],"sourcesContent":["import { Directive, computed, input } from '@angular/core';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { filter, switchMap } from 'rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { filterMaybe } from '@dereekb/rxjs';\nimport { cleanSubscription } from '@dereekb/dbx-core';\nimport { AbstractSyncForgeFormDirective, dbxFormSourceObservableFromStream } from '@dereekb/dbx-form';\nimport { type DbxStyleDemoControls } from '@dereekb/dbx-web/style-demo';\n\n/**\n * Abstract base for the slim style-demo controls form components ({@link DbxFormStyleDemoPresetsComponent},\n * {@link DbxFormStyleDemoSectionsComponent}).\n *\n * Keeps a single `pickablechipfield` form in two-way sync with the playground's {@link DbxStyleDemoControls} (read from\n * the `controls` input). The controls UI lives in dbx-form because the pickable chip field is a `@dereekb/dbx-form`\n * field, which `@dereekb/dbx-web` cannot import.\n *\n * Both sync directions are driven off the form's state stream so they survive the component being recreated each time\n * the panel/popover reopens:\n *\n * - **Controls → form (seed):** {@link dbxFormSourceObservableFromStream} in `'reset'` mode re-pushes the controls\n *   state into the form every time the form enters its RESET state. This covers the initial ready transition — which\n *   only fires once the forge field delegate has registered — so the chips seed from the live service state even though the\n *   delegate's `init` ignores the context's pending initial value. The `isSettingValue` guard filters the synchronous\n *   reset feedback `setValue` produces, exactly as `DbxFormSourceDirective` documents.\n * - **Form → controls (write-back):** only genuine user edits are applied. `setValue` marks the form pristine and\n *   untouched, so every seed / reset / initialization emission is `pristine: true`; the pickable chip field marks its\n *   control dirty on toggle, so a user edit is the only `pristine: false` emission. Filtering on that keeps init/reset\n *   noise from ever wiping the live service state.\n *\n * This directive is demo/debug-only and disposable — it is not a dbx-form core runtime primitive.\n *\n * @typeParam V - The form value type (a subset of the controls state: enabled sections or active presets).\n */\n@Directive()\nexport abstract class AbstractDbxFormStyleDemoControlsFormDirective<V extends object> extends AbstractSyncForgeFormDirective<V> {\n  /**\n   * The playground control surface to keep the chip field in sync with.\n   */\n  readonly controls = input<Maybe<DbxStyleDemoControls>>(undefined);\n\n  /**\n   * Guards the controls→form seed against the `setValue` → `resetForm` feedback loop: set before `setValue` and cleared\n   * on the next microtask, so the synchronous reset emission `setValue` triggers on the stream is filtered out.\n   */\n  private _isSettingValue = false;\n\n  /**\n   * Builds the form value from the controls service signals.\n   */\n  protected abstract readControlsValue(controls: DbxStyleDemoControls): V;\n\n  /**\n   * Diff-applies the form value to the controls service via its setters, writing only the deltas.\n   */\n  protected abstract applyValueToControls(controls: DbxStyleDemoControls, value: V): void;\n\n  /**\n   * The controls state as a form value, recomputed whenever the controls signals change.\n   */\n  private readonly _controlsValue$ = toObservable(\n    computed<Maybe<V>>(() => {\n      const controls = this.controls();\n      return controls == null ? undefined : this.readControlsValue(controls);\n    })\n  ).pipe(filterMaybe());\n\n  /**\n   * Controls → form: seed the form with the controls state on every RESET (see class docs).\n   */\n  protected readonly _seedFormSub = cleanSubscription(\n    dbxFormSourceObservableFromStream(this.context.stream$.pipe(filter(() => !this._isSettingValue)), this._controlsValue$, 'reset').subscribe((value) => {\n      this._isSettingValue = true;\n      this.context.setValue(value);\n      void Promise.resolve().then(() => (this._isSettingValue = false));\n    })\n  );\n\n  /**\n   * Form → controls: write back only genuine user edits (`pristine: false`), diff-applied as deltas (see class docs).\n   */\n  protected readonly _writeBackSub = cleanSubscription(\n    this.context.stream$\n      .pipe(\n        filter((event) => event.pristine === false),\n        switchMap(() => this.context.getValue())\n      )\n      .subscribe((value) => {\n        const controls = this.controls();\n\n        if (controls != null && value != null) {\n          this.applyValueToControls(controls, value);\n        }\n      })\n  );\n}\n","import { Component } from '@angular/core';\nimport type { FieldDef, FormConfig } from '@ng-forge/dynamic-forms';\nimport { of } from 'rxjs';\nimport { DbxForgeFormComponentImportsModule, dbxForgeFormComponentProviders, dbxForgePickableChipField, type PickableValueFieldValue } from '@dereekb/dbx-form';\nimport { type DbxStyleDemoControls, type DbxStyleDemoStyleTemplateKey, type DbxStyleDemoTemplateToggle } from '@dereekb/dbx-web/style-demo';\nimport { AbstractDbxFormStyleDemoControlsFormDirective } from './controls.form.directive';\n\n/**\n * Form value for the {@link DbxFormStyleDemoPresetsComponent}: the keys of the active style-lever presets.\n */\nexport interface DbxFormStyleDemoPresetsFormValue {\n  readonly presets: DbxStyleDemoStyleTemplateKey[];\n}\n\n/**\n * Slim chip-field controls UI picking which style-lever presets are active, kept in two-way sync with the playground's\n * {@link DbxStyleDemoControls}. Presets restyle the whole app, so this is what the global \"Style Controls\" detach panel\n * renders.\n *\n * Because the chip field is a `dbx-forge` field, the host app must register its forge field declarations (the demo\n * app does so via `provideDbxFormConfiguration()` + `provideDbxForgeFormFieldDeclarations()`).\n *\n * This component is demo/debug-only and disposable — it is not a dbx-form core runtime primitive.\n */\n@Component({\n  selector: 'dbx-form-style-demo-presets',\n  template: `\n    <dbx-forge></dbx-forge>\n  `,\n  imports: [DbxForgeFormComponentImportsModule],\n  providers: dbxForgeFormComponentProviders()\n})\nexport class DbxFormStyleDemoPresetsComponent extends AbstractDbxFormStyleDemoControlsFormDirective<DbxFormStyleDemoPresetsFormValue> {\n  readonly formConfig: FormConfig = {\n    fields: [\n      dbxForgePickableChipField<DbxStyleDemoStyleTemplateKey, DbxStyleDemoTemplateToggle>({\n        key: 'presets',\n        label: 'Presets',\n        props: {\n          loadValues: () => of((this.controls()?.templateTogglesSignal() ?? []).map((toggle) => ({ value: toggle.templateName, meta: toggle }))),\n          displayForValue: (values: PickableValueFieldValue<DbxStyleDemoStyleTemplateKey, DbxStyleDemoTemplateToggle>[]) => {\n            const toggleMap = new Map((this.controls()?.templateTogglesSignal() ?? []).map((toggle) => [toggle.templateName, toggle]));\n            return of(\n              values.map((x) => {\n                const toggle = x.meta ?? toggleMap.get(x.value);\n                return { ...x, meta: toggle, label: toggle?.label ?? x.value, sublabel: toggle?.group ?? undefined };\n              })\n            );\n          },\n          filterSelectedValues: (input) => {\n            const toggles = this.controls()?.templateTogglesSignal() ?? [];\n            const groupForKey = new Map(toggles.map((toggle) => [toggle.templateName, toggle.group]));\n            const beforeValuesSet = new Set(input.beforeValues);\n            const addedKeys = input.afterValues.filter((key) => !beforeValuesSet.has(key));\n\n            let result = input.afterValues;\n\n            addedKeys.forEach((addedKey) => {\n              const group = groupForKey.get(addedKey);\n\n              if (group != null) {\n                // Same-group presets are mutually exclusive: keep only the newly added key in its group.\n                result = result.filter((key) => key === addedKey || groupForKey.get(key) !== group);\n              }\n            });\n\n            return result;\n          }\n        }\n      })\n    ] as FieldDef<unknown>[]\n  } as FormConfig;\n\n  protected readControlsValue(controls: DbxStyleDemoControls): DbxFormStyleDemoPresetsFormValue {\n    return { presets: Array.from(controls.activeTemplateKeysSignal()) };\n  }\n\n  protected applyValueToControls(controls: DbxStyleDemoControls, value: DbxFormStyleDemoPresetsFormValue): void {\n    const formPresets = new Set(value.presets ?? []);\n    const activeKeys = controls.activeTemplateKeysSignal();\n\n    controls.templateTogglesSignal().forEach((toggle) => {\n      const shouldActivate = formPresets.has(toggle.templateName);\n\n      if (shouldActivate !== activeKeys.has(toggle.templateName)) {\n        controls.setTemplateActive(toggle.templateName, shouldActivate);\n      }\n    });\n  }\n}\n","import { Component } from '@angular/core';\nimport type { FieldDef, FormConfig } from '@ng-forge/dynamic-forms';\nimport { of } from 'rxjs';\nimport { DbxForgeFormComponentImportsModule, dbxForgeFormComponentProviders, dbxForgePickableChipField, type PickableValueFieldValue } from '@dereekb/dbx-form';\nimport { type DbxStyleDemoControls, type DbxStyleDemoSection, type DbxStyleDemoSectionId } from '@dereekb/dbx-web/style-demo';\nimport { AbstractDbxFormStyleDemoControlsFormDirective } from './controls.form.directive';\n\n/**\n * Form value for the {@link DbxFormStyleDemoSectionsComponent}: the ids of the enabled (visible) sections.\n */\nexport interface DbxFormStyleDemoSectionsFormValue {\n  readonly sections: DbxStyleDemoSectionId[];\n}\n\n/**\n * Slim chip-field controls UI picking which showcase sections are visible, kept in two-way sync with the playground's\n * {@link DbxStyleDemoControls}. Sections only affect the `<dbx-style-demo>` playground page, so this renders inside a\n * popover opened from the playground header rather than the global controls panel.\n *\n * Because the chip field is a `dbx-forge` field, the host app must register its forge field declarations (the demo\n * app does so via `provideDbxFormConfiguration()` + `provideDbxForgeFormFieldDeclarations()`).\n *\n * This component is demo/debug-only and disposable — it is not a dbx-form core runtime primitive.\n */\n@Component({\n  selector: 'dbx-form-style-demo-sections',\n  template: `\n    <dbx-forge></dbx-forge>\n  `,\n  imports: [DbxForgeFormComponentImportsModule],\n  providers: dbxForgeFormComponentProviders()\n})\nexport class DbxFormStyleDemoSectionsComponent extends AbstractDbxFormStyleDemoControlsFormDirective<DbxFormStyleDemoSectionsFormValue> {\n  readonly formConfig: FormConfig = {\n    fields: [\n      dbxForgePickableChipField<DbxStyleDemoSectionId, DbxStyleDemoSection>({\n        key: 'sections',\n        label: 'Sections',\n        props: {\n          showSelectAllButton: true,\n          loadValues: () => of((this.controls()?.sectionsSignal() ?? []).map((section) => ({ value: section.id, meta: section }))),\n          displayForValue: (values: PickableValueFieldValue<DbxStyleDemoSectionId, DbxStyleDemoSection>[]) => {\n            const sectionMap = new Map((this.controls()?.sectionsSignal() ?? []).map((section) => [section.id, section]));\n            return of(\n              values.map((x) => {\n                const section = x.meta ?? sectionMap.get(x.value);\n                return { ...x, meta: section, label: section?.title ?? x.value, sublabel: section?.group ?? undefined };\n              })\n            );\n          }\n        }\n      })\n    ] as FieldDef<unknown>[]\n  } as FormConfig;\n\n  protected readControlsValue(controls: DbxStyleDemoControls): DbxFormStyleDemoSectionsFormValue {\n    return { sections: Array.from(controls.enabledIdsSignal()) };\n  }\n\n  protected applyValueToControls(controls: DbxStyleDemoControls, value: DbxFormStyleDemoSectionsFormValue): void {\n    const formSections = new Set(value.sections ?? []);\n    const enabledIds = controls.enabledIdsSignal();\n\n    controls.sectionsSignal().forEach((section) => {\n      const shouldEnable = formSections.has(section.id);\n\n      if (shouldEnable !== enabledIds.has(section.id)) {\n        controls.setSectionEnabled(section.id, shouldEnable);\n      }\n    });\n  }\n}\n","import { Component, inject } from '@angular/core';\nimport { AbstractPopoverDirective, DbxPopoverCloseButtonComponent, DbxPopoverContentComponent, DbxPopoverHeaderComponent, DbxPopoverScrollContentDirective } from '@dereekb/dbx-web';\nimport { DbxStyleDemoControlsService } from '@dereekb/dbx-web/style-demo';\nimport { DbxFormStyleDemoSectionsComponent } from './controls.sections.component';\n\n/**\n * Popover that renders {@link DbxFormStyleDemoSectionsComponent} inside the shared popover chrome, registered as the\n * style-demo sections component via `DBX_STYLE_DEMO_SECTIONS_COMPONENT` (see `provideDbxFormStyleDemo()`).\n *\n * `DbxStyleDemoControlsService` opens this through `DbxPopoverService`, anchored to the playground header's \"Sections\"\n * button, because sections only affect the `<dbx-style-demo>` playground page (unlike presets, which restyle the whole\n * app). `dbx-popover-scroll-content` gives the long sections list correct scrolling. The component reads the same\n * {@link DbxStyleDemoControlsService} instance and forwards it to the sections component, which owns the chip field and\n * the controls↔form sync.\n *\n * This component is demo/debug-only and disposable — it is not a dbx-form core runtime primitive.\n */\n@Component({\n  selector: 'dbx-form-style-demo-sections-popover',\n  template: `\n    <dbx-popover-content>\n      <dbx-popover-header icon=\"tune\" header=\"Sections\">\n        <dbx-popover-close-button></dbx-popover-close-button>\n      </dbx-popover-header>\n      <dbx-popover-scroll-content>\n        <div class=\"dbx-p2\"><dbx-form-style-demo-sections [controls]=\"controlsService\" /></div>\n      </dbx-popover-scroll-content>\n    </dbx-popover-content>\n  `,\n  imports: [DbxPopoverContentComponent, DbxPopoverHeaderComponent, DbxPopoverCloseButtonComponent, DbxPopoverScrollContentDirective, DbxFormStyleDemoSectionsComponent]\n})\nexport class DbxFormStyleDemoSectionsPopoverComponent extends AbstractPopoverDirective {\n  readonly controlsService = inject(DbxStyleDemoControlsService);\n}\n","import { Component, inject } from '@angular/core';\nimport { DbxDetachContentComponent, DbxDetachControlsComponent } from '@dereekb/dbx-web';\nimport { DbxStyleDemoControlsService } from '@dereekb/dbx-web/style-demo';\nimport { DbxFormStyleDemoPresetsComponent } from './controls.presets.component';\n\n/**\n * Detach panel that renders {@link DbxFormStyleDemoPresetsComponent} inside the shared detach chrome, registered as the\n * style-demo controls component via `DBX_STYLE_DEMO_CONTROLS_COMPONENT` (see `provideDbxFormStyleDemo()`).\n *\n * `DbxStyleDemoControlsService` opens this through `DbxDetachService`, so the panel survives navigation and is available\n * app-wide. It renders the presets chips (which restyle the whole app); sections (which only affect the playground page)\n * live in their own popover opened from the playground header. The component reads the same\n * {@link DbxStyleDemoControlsService} instance and forwards it to the presets component, which owns the chip field and\n * the controls↔form sync. Scrolling within the fixed-height pane comes from `.dbx-detach-content-container`.\n *\n * This component is demo/debug-only and disposable — it is not a dbx-form core runtime primitive.\n */\n@Component({\n  selector: 'dbx-form-style-demo-controls-detach',\n  template: `\n    <dbx-detach-content>\n      <dbx-detach-controls controls header=\"Style Controls\"></dbx-detach-controls>\n      <div class=\"dbx-p3\">\n        <dbx-form-style-demo-presets [controls]=\"controlsService\" />\n      </div>\n    </dbx-detach-content>\n  `,\n  imports: [DbxDetachContentComponent, DbxDetachControlsComponent, DbxFormStyleDemoPresetsComponent]\n})\nexport class DbxFormStyleDemoControlsDetachComponent {\n  readonly controlsService = inject(DbxStyleDemoControlsService);\n}\n","import { Component } from '@angular/core';\nimport type { FieldDef, FormConfig } from '@ng-forge/dynamic-forms';\nimport { AbstractSyncForgeFormDirective, DbxForgeFormComponentImportsModule, dbxForgeCheckboxField, dbxForgeEmailField, dbxForgeFormComponentProviders, dbxForgeNameField, dbxForgeTextAreaField, dbxForgeToggleField, dbxForgeValueSelectionField } from '@dereekb/dbx-form';\nimport { DbxDocsUiExampleComponent, DbxDocsUiExampleContentComponent, DbxDocsUiExampleInfoComponent } from '@dereekb/dbx-web/docs';\n\n/**\n * Style-demo section rendering a representative `<dbx-forge>` form (name, email, select, textarea, checkbox, toggle)\n * so the form-field surfaces are visible in the playground. Fields paint from the `--mat-form-field-*` and surface\n * tokens, so they respond live to the Shape and Surface levers and flip with light/dark.\n *\n * Requires the host app to register its forge field declarations (the demo app does so via\n * `provideDbxFormConfiguration()` + `provideDbxForgeFormFieldDeclarations()`).\n *\n * @dbxDocsUiExample\n * @dbxDocsUiExampleSlug style-demo-form-fields\n * @dbxDocsUiExampleCategory style-demo\n * @dbxDocsUiExampleSummary A representative dbx-forge form (name, email, select, textarea, checkbox, toggle).\n * @dbxDocsUiExampleRelated text, value-selection, checkbox\n */\n@Component({\n  selector: 'dbx-form-style-demo-fields-section',\n  imports: [DbxDocsUiExampleComponent, DbxDocsUiExampleInfoComponent, DbxDocsUiExampleContentComponent, DbxForgeFormComponentImportsModule],\n  providers: dbxForgeFormComponentProviders(),\n  template: `\n    <dbx-docs-ui-example header=\"Form Fields\" hint=\"A representative dbx-forge form.\">\n      <dbx-docs-ui-example-info>\n        <p>\n          A mix of forge fields — name, email,\n          <code>valueSelectionField</code>\n          , textarea, checkbox, and toggle. Each draws its container colour and corner radius from the\n          <code>--mat-form-field-*</code>\n          tokens layered over the surface ramp, so the fields respond live to the Shape and Surface levers and flip with light/dark. The host app must register its forge field declarations for this section to render.\n        </p>\n      </dbx-docs-ui-example-info>\n      <dbx-docs-ui-example-content>\n        <dbx-forge></dbx-forge>\n      </dbx-docs-ui-example-content>\n    </dbx-docs-ui-example>\n  `\n})\nexport class DbxFormStyleDemoFieldsSectionComponent extends AbstractSyncForgeFormDirective<object> {\n  readonly formConfig: FormConfig = {\n    fields: [\n      dbxForgeNameField({ key: 'name', label: 'Full Name', required: true }),\n      dbxForgeEmailField({ key: 'email', label: 'Email', required: true }),\n      dbxForgeValueSelectionField({\n        key: 'role',\n        label: 'Role',\n        props: {\n          options: [\n            { label: 'Admin', value: 'admin' },\n            { label: 'Editor', value: 'editor' },\n            { label: 'Viewer', value: 'viewer' }\n          ]\n        }\n      }),\n      dbxForgeTextAreaField({ key: 'bio', label: 'Bio', rows: 3 }),\n      dbxForgeCheckboxField({ key: 'subscribe', label: 'Subscribe to updates' }),\n      dbxForgeToggleField({ key: 'notifications', label: 'Enable notifications' })\n    ] as FieldDef<unknown>[]\n  } as FormConfig;\n}\n","import { type EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { DBX_STYLE_DEMO_CONTROLS_COMPONENT, DBX_STYLE_DEMO_SECTIONS_COMPONENT, type DbxStyleDemoSectionGroup, provideDbxStyleDemoSections } from '@dereekb/dbx-web/style-demo';\nimport { DbxFormStyleDemoControlsDetachComponent } from './controls.detach.component';\nimport { DbxFormStyleDemoSectionsPopoverComponent } from './controls.sections.popover.component';\nimport { DbxFormStyleDemoFieldsSectionComponent } from './fields.section.component';\n\n/**\n * The `@dereekb/dbx-form/style-demo` section group.\n */\nexport const DBX_FORM_STYLE_DEMO_SECTION_GROUP: DbxStyleDemoSectionGroup = {\n  libId: 'dbx-form',\n  sections: [{ id: 'dbx-form-fields', title: 'Form Fields', group: 'form', tags: ['dbx-form', 'form'], component: DbxFormStyleDemoFieldsSectionComponent, defaultEnabled: true }]\n};\n\n/**\n * Registers the `@dereekb/dbx-form/style-demo` sections with the `<dbx-style-demo>` playground, registers\n * {@link DbxFormStyleDemoControlsDetachComponent} as the global style-demo controls (presets) detach panel, and registers\n * {@link DbxFormStyleDemoSectionsPopoverComponent} as the style-demo sections popover opened from the playground header.\n *\n * The Form Fields section, the controls panel, and the sections popover all render `<dbx-forge>` forms, so the host app\n * must register its forge field declarations (e.g. `provideDbxFormConfiguration()` + `provideDbxForgeFormFieldDeclarations()`) for them to render.\n *\n * Pair with `provideDbxStyleDemo()` (the shell from `@dereekb/dbx-web/style-demo`).\n *\n * @returns EnvironmentProviders contributing the form sections, the controls detach component, and the sections popover component.\n *\n * @__NO_SIDE_EFFECTS__\n */\nexport function provideDbxFormStyleDemo(): EnvironmentProviders {\n  return makeEnvironmentProviders([provideDbxStyleDemoSections(DBX_FORM_STYLE_DEMO_SECTION_GROUP), { provide: DBX_STYLE_DEMO_CONTROLS_COMPONENT, useValue: DbxFormStyleDemoControlsDetachComponent }, { provide: DBX_STYLE_DEMO_SECTIONS_COMPONENT, useValue: DbxFormStyleDemoSectionsPopoverComponent }]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AASA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AAEG,MAAgB,6CAAgE,SAAQ,8BAAiC,CAAA;AAC7H;;AAEG;IACM,QAAQ,GAAG,KAAK,CAA8B,SAAS;iFAAC;AAEjE;;;AAGG;IACK,eAAe,GAAG,KAAK;AAY/B;;AAEG;AACc,IAAA,eAAe,GAAG,YAAY,CAC7C,QAAQ,CAAW,MAAK;AACtB,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE;AAChC,QAAA,OAAO,QAAQ,IAAI,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC;IACxE,CAAC,CAAC,CACH,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;AAErB;;AAEG;AACgB,IAAA,YAAY,GAAG,iBAAiB,CACjD,iCAAiC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,KAAI;AACnJ,QAAA,IAAI,CAAC,eAAe,GAAG,IAAI;AAC3B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