<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
           xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides"
           xsi:type="TaskPaneApp">

  <!-- D-08: Manifest GUID - generated ONCE in Phase 1, NEVER changed. -->
  <Id>65b9a52c-48be-40a9-8efb-1b827c6ace5e</Id>
  <Version>1.0.0.0</Version>
  <ProviderName>Outrun</ProviderName>
  <DefaultLocale>en-GB</DefaultLocale>
  <DisplayName DefaultValue="Word Template Plugin"/>
  <Description DefaultValue="Author docxtemplater templates inside Word."/>
  <IconUrl DefaultValue="https://wordtemplates.outrun.network/assets/icon-32.png"/>
  <HighResolutionIconUrl DefaultValue="https://wordtemplates.outrun.network/assets/icon-64.png"/>
  <SupportUrl DefaultValue="https://wordtemplates.outrun.network/support"/>

  <!-- D-12: AppDomains is for navigation only. Outrun + Function are fetch calls, CORS-gated.
       The element is OMITTED (not declared empty) in Phase 1 because the Office add-in XML
       schema requires at least one <AppDomain> child if <AppDomains> is present (validator
       error: "incomplete content. List of possible elements expected: AppDomain"). Phase 1
       has no off-SWA navigation, so the entire element is omitted. Add the element with
       child entries only if a future phase navigates the root pane off-SWA. -->

  <!-- D-13 / project scope: Word desktop M365 only. -->
  <Hosts>
    <Host Name="Document"/>
  </Hosts>

  <!-- STACK.md / CLAUDE.md: WordApi 1.7 minimum. Feature-detect 1.8 / 1.9 / WordApiDesktop 1.5 at runtime. -->
  <Requirements>
    <Sets DefaultMinVersion="1.7">
      <Set Name="WordApi" MinVersion="1.7"/>
    </Sets>
  </Requirements>

  <DefaultSettings>
    <SourceLocation DefaultValue="https://wordtemplates.outrun.network/taskpane.html"/>
  </DefaultSettings>

  <!-- D-10: ReadWriteDocument - highest add-in-only scope, covers every Phase 2-6 need. -->
  <Permissions>ReadWriteDocument</Permissions>

  <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides"
                    xsi:type="VersionOverridesV1_0">
    <Hosts>
      <Host xsi:type="Document">
        <DesktopFormFactor>
          <GetStarted>
            <Title resid="GetStarted.Title"/>
            <Description resid="GetStarted.Description"/>
            <LearnMoreUrl resid="GetStarted.LearnMoreUrl"/>
          </GetStarted>

          <!-- D-09: Single "Show taskpane" button under "Outrun Templates" group on Home tab.
               We deliberately omit the optional commands script-file element here - we have
               no ExecuteFunction actions (per Plan 01 strip of src/commands/). -->
          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <OfficeTab id="TabHome">
              <Group id="OutrunTemplatesGroup">
                <Label resid="OutrunTemplatesGroup.Label"/>
                <Icon>
                  <bt:Image size="16" resid="Icon.16x16"/>
                  <bt:Image size="32" resid="Icon.32x32"/>
                  <bt:Image size="80" resid="Icon.80x80"/>
                </Icon>
                <Control xsi:type="Button" id="ShowTaskpaneButton">
                  <Label resid="ShowTaskpaneButton.Label"/>
                  <Supertip>
                    <Title resid="ShowTaskpaneButton.Label"/>
                    <Description resid="ShowTaskpaneButton.Tooltip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon.16x16"/>
                    <bt:Image size="32" resid="Icon.32x32"/>
                    <bt:Image size="80" resid="Icon.80x80"/>
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>OutrunTemplatesTaskpane</TaskpaneId>
                    <SourceLocation resid="Taskpane.Url"/>
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>

    <Resources>
      <bt:Images>
        <bt:Image id="Icon.16x16" DefaultValue="https://wordtemplates.outrun.network/assets/icon-16.png"/>
        <bt:Image id="Icon.32x32" DefaultValue="https://wordtemplates.outrun.network/assets/icon-32.png"/>
        <bt:Image id="Icon.80x80" DefaultValue="https://wordtemplates.outrun.network/assets/icon-80.png"/>
      </bt:Images>
      <bt:Urls>
        <bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://wordtemplates.outrun.network/support"/>
        <bt:Url id="Taskpane.Url" DefaultValue="https://wordtemplates.outrun.network/taskpane.html"/>
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="GetStarted.Title" DefaultValue="Word Template Plugin is ready"/>
        <bt:String id="OutrunTemplatesGroup.Label" DefaultValue="Outrun Templates"/>
        <bt:String id="ShowTaskpaneButton.Label" DefaultValue="Show taskpane"/>
      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="GetStarted.Description" DefaultValue="The Word Template Plugin lets you author docxtemplater templates against the live Outrun field tree, without leaving Word. Open the taskpane from the Outrun Templates group on the Home tab."/>
        <bt:String id="ShowTaskpaneButton.Tooltip" DefaultValue="Open the Word Template Plugin taskpane"/>
      </bt:LongStrings>
    </Resources>

    <!-- D-11: WebApplicationInfo with Entra app identifiers from Task 2 checkpoint.
         These are PERMANENT - changing requires every staff member to re-sideload + re-consent.
         The <Resource> domain is the production SWA domain (NOT substituted by webpack -
         it is the Application ID URI domain registered with Entra, not a navigable URL). -->
    <WebApplicationInfo>
      <Id>a7a33931-980d-473c-9a65-1844eae1fdfe</Id>
      <Resource>api://wordtemplates.outrun.network/a7a33931-980d-473c-9a65-1844eae1fdfe</Resource>
      <Scopes>
        <Scope>openid</Scope>
        <Scope>profile</Scope>
        <Scope>access_as_user</Scope>
      </Scopes>
    </WebApplicationInfo>
  </VersionOverrides>
</OfficeApp>
