<?xml version="1.0" encoding="UTF-8"?>
<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">

  <Id>a1b2c3d4-e5f6-7890-abcd-ef1234567890</Id>
  <Version>1.0.0.0</Version>
  <ProviderName>IndexFacile</ProviderName>
  <DefaultLocale>fr-FR</DefaultLocale>
  <DisplayName DefaultValue="IndexFacile" />
  <Description DefaultValue="Révision de prix et indices INSEE directement dans Excel" />

  <IconUrl DefaultValue="https://indexfacile.fr/icon-32.png" />
  <HighResolutionIconUrl DefaultValue="https://indexfacile.fr/icon-64.png" />

  <SupportUrl DefaultValue="https://indexfacile.fr/aide" />
  <AppDomains>
    <AppDomain>https://indexfacile.fr</AppDomain>
  </AppDomains>

  <Hosts>
    <Host Name="Workbook" />
  </Hosts>

  <DefaultSettings>
    <SourceLocation DefaultValue="https://localhost:3001/taskpane.html" />
  </DefaultSettings>

  <Permissions>ReadWriteDocument</Permissions>

  <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">

    <Hosts>
      <Host xsi:type="Workbook">

        <!-- Fonctions personnalisées -->
        <AllFormFactors>
          <ExtensionPoint xsi:type="CustomFunctions">
            <Script>
              <SourceLocation resid="Functions.Script.Url" />
            </Script>
            <Page>
              <SourceLocation resid="Functions.Page.Url" />
            </Page>
            <Metadata>
              <SourceLocation resid="Functions.Metadata.Url" />
            </Metadata>
            <Namespace resid="Functions.Namespace" />
          </ExtensionPoint>
        </AllFormFactors>

        <!-- Panneau latéral -->
        <DesktopFormFactor>
          <GetStarted>
            <Title resid="GetStarted.Title" />
            <Description resid="GetStarted.Description" />
            <LearnMoreUrl resid="LearnMore.Url" />
          </GetStarted>

          <FunctionFile resid="Functions.Script.Url" />

          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <OfficeTab id="TabHome">
              <Group id="CommandsGroup">
                <Label resid="CommandsGroup.Label" />
                <Icon>
                  <bt:Image size="16" resid="Icon.16x16" />
                  <bt:Image size="32" resid="Icon.32x32" />
                  <bt:Image size="80" resid="Icon.80x80" />
                </Icon>

                <!-- Bouton ouvrir panneau -->
                <Control xsi:type="Button" id="TaskpaneButton">
                  <Label resid="TaskpaneButton.Label" />
                  <Supertip>
                    <Title resid="TaskpaneButton.Label" />
                    <Description resid="TaskpaneButton.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>ButtonId1</TaskpaneId>
                    <SourceLocation resid="Taskpane.Url" />
                  </Action>
                </Control>

                <!-- Bouton insérer justificatif -->
                <Control xsi:type="Button" id="JustifButton">
                  <Label resid="JustifButton.Label" />
                  <Supertip>
                    <Title resid="JustifButton.Label" />
                    <Description resid="JustifButton.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="ExecuteFunction">
                    <FunctionName>insertJustificationSheet</FunctionName>
                  </Action>
                </Control>

              </Group>
            </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>

    <Resources>
      <!-- URLs -->
      <bt:Urls>
        <bt:Url id="Functions.Script.Url" DefaultValue="https://localhost:3001/functions.js" />
        <bt:Url id="Functions.Page.Url" DefaultValue="https://localhost:3001/functions.html" />
        <bt:Url id="Functions.Metadata.Url" DefaultValue="https://localhost:3001/functions-metadata.json" />
        <bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3001/taskpane.html" />
        <bt:Url id="LearnMore.Url" DefaultValue="https://indexfacile.fr/aide" />
      </bt:Urls>

      <!-- Chaînes -->
      <bt:ShortStrings>
        <bt:String id="GetStarted.Title" DefaultValue="IndexFacile est prêt" />
        <bt:String id="CommandsGroup.Label" DefaultValue="IndexFacile" />
        <bt:String id="TaskpaneButton.Label" DefaultValue="Calculateur" />
        <bt:String id="JustifButton.Label" DefaultValue="Justificatif" />
        <bt:String id="Functions.Namespace" DefaultValue="INDEX" />
      </bt:ShortStrings>

      <bt:LongStrings>
        <bt:String id="GetStarted.Description" DefaultValue="Calcul de révision de prix et indices INSEE directement dans vos tableaux." />
        <bt:String id="TaskpaneButton.Tooltip" DefaultValue="Ouvrir le panneau de calcul guidé IndexFacile" />
        <bt:String id="JustifButton.Tooltip" DefaultValue="Insérer une feuille justificatif de révision" />
      </bt:LongStrings>

      <!-- Icônes (placeholders — remplacer par les vraies icônes) -->
      <bt:Images>
        <bt:Image id="Icon.16x16" DefaultValue="https://localhost:3001/assets/icon-16.png" />
        <bt:Image id="Icon.32x32" DefaultValue="https://localhost:3001/assets/icon-32.png" />
        <bt:Image id="Icon.80x80" DefaultValue="https://localhost:3001/assets/icon-80.png" />
      </bt:Images>
    </Resources>
  </VersionOverrides>
</OfficeApp>
