<?xml version="1.0" encoding="UTF-8"?>
<!-- Manifest for the RafikiEarth add-in: one offer, Word and Excel.
     Word  (Document):  two buttons, "Compute" and "References", each with its own pane
                        -> /addin/taskpane.html, /addin/references.html
     Excel (Workbook):  two buttons, "Compute" and "Tools", plus the =RA. cell functions
                        in a shared runtime  -> /excel/checks.html, /excel/tools.html, /excel/cf.html
     Everything it loads is on rafiki.earth. Keep the <Id> the same forever; raise <Version>
     when you change this file.

     PowerPoint comes later: add <Host Name="Presentation" /> below and a matching
     <Host xsi:type="Presentation"> block in VersionOverrides, once /ppt/checks.html and its
     pp.js host adapter exist. The <Id> does not change, so that stays an update to this offer.

     TWO THINGS TO SET BEFORE SUBMITTING
     1. <Id> below. It must be the Id of the offer that is LIVE in Partner Center, because the
        other offer's existing installs break. The two candidates are:
             Word   fcc62722-926e-40ca-bcb9-00dfeb64bf22
             Excel  af0e38f1-df4c-4bb6-92ca-6579b9e6293b
     2. <DisplayName> and <ProviderName> must match the Partner Center offer name and publisher
        display name exactly. DisplayName here drops "for Excel" because the offer is no longer
        Excel-only.

     NOTE ON <Requirements>: the Excel-only manifest declared SharedRuntime 1.1 at the top level,
     which gates the WHOLE add-in and would exclude Word. It is left out here. The shared runtime
     is still requested where it is actually needed, by the <Runtimes> block inside the Workbook
     host. Validate and sideload in BOTH apps before submitting:
         npx office-addin-manifest validate manifest.xml  -->
<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">
  <!-- SET THIS: see "TWO THINGS TO SET" above -->
  <Id>fcc62722-926e-40ca-bcb9-00dfeb64bf22</Id>
  <Version>1.3.2.0</Version>
  <ProviderName>Rafiki Earth</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="Research Calculator" />
  <Description DefaultValue="Plausibility checks for research results, an equation checker, reference list checks in Word, spreadsheet checks for formula mistakes and impossible values, and cell functions such as =RA.CCC(). No AI; nothing leaves your computer." />
  <IconUrl DefaultValue="https://rafiki.earth/addin/icon-32.png" />
  <HighResolutionIconUrl DefaultValue="https://rafiki.earth/addin/icon-64.png" />
  <SupportUrl DefaultValue="https://rafiki.earth/install-addin.html" />
  <AppDomains>
    <AppDomain>https://rafiki.earth</AppDomain>
  </AppDomains>
  <Hosts>
    <Host Name="Document" />
    <Host Name="Workbook" />
  </Hosts>
  <!-- the fallback pane for clients that do not read VersionOverrides; each host overrides it below -->
  <DefaultSettings>
    <SourceLocation DefaultValue="https://rafiki.earth/excel/checks.html" />
  </DefaultSettings>
  <!-- reads the selection and the document or workbook, adds sheets, comments and pictures -->
  <Permissions>ReadWriteDocument</Permissions>

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

      <!-- ============================ WORD ============================ -->
      <Host xsi:type="Document">
        <DesktopFormFactor>
          <FunctionFile resid="Word.Taskpane.Url" />
          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <OfficeTab id="TabHome">
              <Group id="RA.Group.WD">
                <Label resid="RA.GroupLabel" />
                <Icon>
                  <bt:Image size="16" resid="Icon.16" />
                  <bt:Image size="32" resid="Icon.32" />
                  <bt:Image size="80" resid="Icon.80" />
                </Icon>
                <Control xsi:type="Button" id="RA.Open">
                  <Label resid="RA.ButtonLabel" />
                  <Supertip>
                    <Title resid="RA.ButtonLabel" />
                    <Description resid="RA.ButtonTip" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Compute.16" />
                    <bt:Image size="32" resid="Compute.32" />
                    <bt:Image size="80" resid="Compute.80" />
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>RA.Pane</TaskpaneId>
                    <SourceLocation resid="Word.Taskpane.Url" />
                  </Action>
                </Control>
                <Control xsi:type="Button" id="RA.Refs">
                  <Label resid="RA.RefsLabel" />
                  <Supertip>
                    <Title resid="RA.RefsLabel" />
                    <Description resid="RA.RefsTip" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Refs.16" />
                    <bt:Image size="32" resid="Refs.32" />
                    <bt:Image size="80" resid="Refs.80" />
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>RA.RefsPane</TaskpaneId>
                    <SourceLocation resid="Word.Refs.Url" />
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>

      <!-- ============================ EXCEL ============================ -->
      <Host xsi:type="Workbook">
        <!-- the shared runtime the =RA. cell functions need; Excel only -->
        <Runtimes>
          <Runtime resid="Functions.Page.Url" lifetime="long" />
        </Runtimes>
        <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>
        <DesktopFormFactor>
          <FunctionFile resid="Functions.Page.Url" />
          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <OfficeTab id="TabHome">
              <Group id="RA.Group.XL">
                <Label resid="RA.GroupLabel" />
                <Icon>
                  <bt:Image size="16" resid="Icon.16" />
                  <bt:Image size="32" resid="Icon.32" />
                  <bt:Image size="80" resid="Icon.80" />
                </Icon>
                <Control xsi:type="Button" id="RA.Checks">
                  <Label resid="RA.ChecksLabel" />
                  <Supertip>
                    <Title resid="RA.ChecksLabel" />
                    <Description resid="RA.ChecksTip" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Compute.16" />
                    <bt:Image size="32" resid="Compute.32" />
                    <bt:Image size="80" resid="Compute.80" />
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>RA.Pane</TaskpaneId>
                    <SourceLocation resid="Checks.Url" />
                  </Action>
                </Control>
                <Control xsi:type="Button" id="RA.Tools">
                  <Label resid="RA.ToolsLabel" />
                  <Supertip>
                    <Title resid="RA.ToolsLabel" />
                    <Description resid="RA.ToolsTip" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon.16" />
                    <bt:Image size="32" resid="Icon.32" />
                    <bt:Image size="80" resid="Icon.80" />
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>RA.Pane</TaskpaneId>
                    <SourceLocation resid="Tools.Url" />
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>

    </Hosts>
    <Resources>
      <bt:Images>
        <bt:Image id="Icon.16" DefaultValue="https://rafiki.earth/addin/icon-16.png" />
        <bt:Image id="Icon.32" DefaultValue="https://rafiki.earth/addin/icon-32.png" />
        <bt:Image id="Icon.80" DefaultValue="https://rafiki.earth/addin/icon-80.png" />
        <bt:Image id="Compute.16" DefaultValue="https://rafiki.earth/addin/compute-16.png" />
        <bt:Image id="Compute.32" DefaultValue="https://rafiki.earth/addin/compute-32.png" />
        <bt:Image id="Compute.80" DefaultValue="https://rafiki.earth/addin/compute-80.png" />
        <bt:Image id="Refs.16" DefaultValue="https://rafiki.earth/addin/ref-16.png" />
        <bt:Image id="Refs.32" DefaultValue="https://rafiki.earth/addin/ref-32.png" />
        <bt:Image id="Refs.80" DefaultValue="https://rafiki.earth/addin/ref-80.png" />
      </bt:Images>
      <bt:Urls>
        <bt:Url id="Word.Taskpane.Url" DefaultValue="https://rafiki.earth/addin/taskpane.html" />
        <bt:Url id="Word.Refs.Url" DefaultValue="https://rafiki.earth/addin/references.html" />
        <bt:Url id="Checks.Url" DefaultValue="https://rafiki.earth/excel/checks.html" />
        <bt:Url id="Tools.Url" DefaultValue="https://rafiki.earth/excel/tools.html" />
        <bt:Url id="Functions.Script.Url" DefaultValue="https://rafiki.earth/excel/functions.js" />
        <bt:Url id="Functions.Metadata.Url" DefaultValue="https://rafiki.earth/excel/functions.json" />
        <bt:Url id="Functions.Page.Url" DefaultValue="https://rafiki.earth/excel/cf.html" />
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="RA.GroupLabel" DefaultValue="Rafiki Earth" />
        <bt:String id="Functions.Namespace" DefaultValue="RA" />
        <bt:String id="RA.ButtonLabel" DefaultValue="Compute" />
        <bt:String id="RA.RefsLabel" DefaultValue="References" />
        <bt:String id="RA.ChecksLabel" DefaultValue="Compute" />
        <bt:String id="RA.ToolsLabel" DefaultValue="Tools" />
      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="RA.ButtonTip" DefaultValue="Plausibility checks, the equation checker and R." />
        <bt:String id="RA.RefsTip" DefaultValue="Read the reference list in your document and check it against the citations in the text." />
        <bt:String id="RA.ChecksTip" DefaultValue="Plausibility checks on the selected cells or the whole workbook, and R." />
        <bt:String id="RA.ToolsTip" DefaultValue="Research tools that use your selected cells and write results to new sheets." />
      </bt:LongStrings>
    </Resources>
  </VersionOverrides>
</OfficeApp>
