{"version":3,"file":"Template.fixture.cjs","names":["defineWebPlugin","STORY_WORKSPACE_ID","STORY_SESSION_ID"],"sources":["../../../src/web/components/Template.fixture.tsx"],"sourcesContent":["import { defineWebPlugin } from '@agimon-ai/po-core/web';\n\nimport type { SettingsConfigView } from '../../types/settings.ts';\nimport { webPluginCompositionStore } from '../lib/pluginCompositions';\nimport { installWebPlugins, resetWebPlugins } from '../lib/pluginRegistry';\nimport { templateStore } from '../stores/templateStore';\nimport { STORY_SESSION_ID, STORY_WORKSPACE_ID } from './Story.fixture.tsx';\n\nexport const templateConfig: SettingsConfigView = {\n  repoRoot: '/workspace/po',\n  values: {\n    'web.template': { value: 'story-layout', origin: 'host', scope: 'both' },\n  },\n  hashes: { host: 'story-global', repository: 'story-repository' },\n};\n\nexport const storyTemplate = defineWebPlugin({\n  id: 'story-template',\n  templates: [\n    {\n      id: 'story-layout',\n      label: 'Story layout',\n      description: 'An isolated complete application for the host boundary.',\n      contractVersion: 3,\n      app: () => (\n        <main data-testid=\"story-dashboard\" className=\"h-full bg-po-bg p-6 text-po-text\">\n          The selected template owns this application.\n        </main>\n      ),\n    },\n  ],\n});\n\nexport function seedTemplateStory(phase: 'ready' | 'loading' | 'error' = 'ready', includeTemplate = true): void {\n  resetWebPlugins();\n  installWebPlugins(includeTemplate ? [storyTemplate] : []);\n  const state = { phase, ...(phase === 'error' ? { error: 'The template package could not be loaded.' } : {}) };\n  webPluginCompositionStore.setState(() => ({\n    ...state,\n    mounts: {\n      host: state,\n      [`workspace:${STORY_WORKSPACE_ID}`]: state,\n      [`session:${STORY_SESSION_ID}`]: state,\n    },\n  }));\n  templateStore.setState(() => ({\n    host: { config: templateConfig, loading: false, saving: false },\n    [`workspace:${STORY_WORKSPACE_ID}`]: { config: templateConfig, loading: false, saving: false },\n  }));\n}\n"],"mappings":";;;;;;;AAQA,MAAa,iBAAqC;CAChD,UAAU;CACV,QAAQ,EACN,gBAAgB;EAAE,OAAO;EAAgB,QAAQ;EAAQ,OAAO;CAAO,EACzE;CACA,QAAQ;EAAE,MAAM;EAAgB,YAAY;CAAmB;AACjE;AAEA,MAAa,iBAAA,GAAgBA,uBAAAA,gBAAAA,CAAgB;CAC3C,IAAI;CACJ,WAAW,CACT;EACE,IAAI;EACJ,OAAO;EACP,aAAa;EACb,iBAAiB;EACjB,WACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;GAAM,eAAY;GAAkB,WAAU;GAAmC,UAAA;EAE3E,CAAA;CAEV,CACF;AACF,CAAC;AAED,SAAgB,kBAAkB,QAAuC,SAAS,kBAAkB,MAAY;CAC9G,uBAAA,gBAAgB;CAChB,uBAAA,kBAAkB,kBAAkB,CAAC,aAAa,IAAI,CAAC,CAAC;CACxD,MAAM,QAAQ;EAAE;EAAO,GAAI,UAAU,UAAU,EAAE,OAAO,4CAA4C,IAAI,CAAC;CAAG;CAC5G,2BAAA,0BAA0B,gBAAgB;EACxC,GAAG;EACH,QAAQ;GACN,MAAM;IACL,aAAaC,sBAAAA,uBAAuB;IACpC,WAAWC,sBAAAA,qBAAqB;EACnC;CACF,EAAE;CACF,sBAAA,cAAc,gBAAgB;EAC5B,MAAM;GAAE,QAAQ;GAAgB,SAAS;GAAO,QAAQ;EAAM;GAC7D,aAAaD,sBAAAA,uBAAuB;GAAE,QAAQ;GAAgB,SAAS;GAAO,QAAQ;EAAM;CAC/F,EAAE;AACJ"}