<?xml version="1.0" encoding="UTF-8"?>
<!--
  BankRegReports for Excel.

  XML manifest, not the unified JSON manifest: JSON is still preview for Excel,
  and a manifest format is not the place to be early.

  The <Runtimes> block plus lifetime="long" is what gives the task pane and the
  custom functions ONE shared JavaScript runtime. Without it they are separate
  contexts, the API key pasted into the pane is invisible to the functions, and
  the batching queue in one context cannot coalesce cells evaluated in the other.
  Everything in this add-in depends on that block.
-->
<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">

  <!-- The add-in's permanent identity. Office keys installs, updates and
       centralized deployment off this GUID, so it must never change again:
       altering it makes every installed copy a different, orphaned add-in. -->
  <Id>a9dc233c-211a-4b48-93b5-0d44fa217512</Id>
  <Version>1.0.1.0</Version>
  <ProviderName>BankRegReports</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="BankRegReports"/>
  <Description DefaultValue="Live US bank, credit union and holding company regulatory data in your cells."/>
  <IconUrl DefaultValue="https://www.bankregreports.com/addin/assets/icon-32.png"/>
  <HighResolutionIconUrl DefaultValue="https://www.bankregreports.com/addin/assets/icon-64.png"/>
  <SupportUrl DefaultValue="https://www.bankregreports.com/api/excel/"/>

  <AppDomains>
    <AppDomain>https://www.bankregreports.com</AppDomain>
    <AppDomain>https://api.bankregreports.com</AppDomain>
  </AppDomains>

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

  <Requirements>
    <Sets DefaultMinVersion="1.1">
      <Set Name="SharedRuntime" MinVersion="1.1"/>
    </Sets>
  </Requirements>

  <DefaultSettings>
    <SourceLocation DefaultValue="https://www.bankregreports.com/addin/taskpane.html"/>
  </DefaultSettings>

  <Permissions>ReadWriteDocument</Permissions>

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

      <!--
        The shared-runtime requirement has to be declared HERE, inside
        VersionOverrides, not only at the top of the manifest. Declared only at
        the top, Office loads the task pane happily and never processes the
        CustomFunctions extension point at all: functions.json is never
        requested, no BRR.* function is registered, and every formula in the
        workbook reads #NAME? with nothing in any log to say why. The top-level
        Requirements block stays because it is what platform availability is
        computed from.
      -->
      <Requirements>
        <bt:Sets DefaultMinVersion="1.1">
          <bt:Set Name="SharedRuntime"/>
        </bt:Sets>
      </Requirements>

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

          <Runtimes>
            <Runtime resid="Shared.Url" lifetime="long"/>
          </Runtimes>

          <AllFormFactors>
            <ExtensionPoint xsi:type="CustomFunctions">
              <Script>
                <SourceLocation resid="Functions.Script.Url"/>
              </Script>
              <Page>
                <SourceLocation resid="Shared.Url"/>
              </Page>
              <Metadata>
                <SourceLocation resid="Functions.Metadata.Url"/>
              </Metadata>
              <Namespace resid="Functions.Namespace"/>
            </ExtensionPoint>
          </AllFormFactors>

          <DesktopFormFactor>
            <GetStarted>
              <Title resid="GetStarted.Title"/>
              <Description resid="GetStarted.Description"/>
              <LearnMoreUrl resid="GetStarted.LearnMoreUrl"/>
            </GetStarted>

            <FunctionFile resid="Shared.Url"/>

            <ExtensionPoint xsi:type="PrimaryCommandSurface">
              <CustomTab id="BRR.Tab">
                <Group id="BRR.Group.Data">
                  <Label resid="Group.Data.Label"/>
                  <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="BRR.OpenPane">
                    <Label resid="Cmd.OpenPane.Label"/>
                    <Supertip>
                      <Title resid="Cmd.OpenPane.Label"/>
                      <Description resid="Cmd.OpenPane.Tip"/>
                    </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>BRR.Taskpane</TaskpaneId>
                      <SourceLocation resid="Shared.Url"/>
                    </Action>
                  </Control>

                  <Control xsi:type="Button" id="BRR.RefreshSheet">
                    <Label resid="Cmd.RefreshSheet.Label"/>
                    <Supertip>
                      <Title resid="Cmd.RefreshSheet.Label"/>
                      <Description resid="Cmd.RefreshSheet.Tip"/>
                    </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="ExecuteFunction">
                      <FunctionName>refreshSheet</FunctionName>
                    </Action>
                  </Control>

                  <Control xsi:type="Button" id="BRR.RefreshWorkbook">
                    <Label resid="Cmd.RefreshWorkbook.Label"/>
                    <Supertip>
                      <Title resid="Cmd.RefreshWorkbook.Label"/>
                      <Description resid="Cmd.RefreshWorkbook.Tip"/>
                    </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="ExecuteFunction">
                      <FunctionName>refreshWorkbook</FunctionName>
                    </Action>
                  </Control>
                </Group>
                <Label resid="Tab.Label"/>
              </CustomTab>
            </ExtensionPoint>
          </DesktopFormFactor>
        </Host>
      </Hosts>

      <Resources>
        <bt:Images>
          <bt:Image id="Icon.16" DefaultValue="https://www.bankregreports.com/addin/assets/icon-16.png"/>
          <bt:Image id="Icon.32" DefaultValue="https://www.bankregreports.com/addin/assets/icon-32.png"/>
          <bt:Image id="Icon.80" DefaultValue="https://www.bankregreports.com/addin/assets/icon-80.png"/>
        </bt:Images>
        <bt:Urls>
          <bt:Url id="Shared.Url" DefaultValue="https://www.bankregreports.com/addin/taskpane.html"/>
          <bt:Url id="Functions.Script.Url" DefaultValue="https://www.bankregreports.com/addin/functions.js"/>
          <bt:Url id="Functions.Metadata.Url" DefaultValue="https://www.bankregreports.com/addin/functions.json"/>
          <bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://www.bankregreports.com/api/excel/"/>
        </bt:Urls>
        <bt:ShortStrings>
          <bt:String id="Functions.Namespace" DefaultValue="BRR"/>
          <bt:String id="Tab.Label" DefaultValue="BankRegReports"/>
          <bt:String id="Group.Data.Label" DefaultValue="Data"/>
          <bt:String id="Cmd.OpenPane.Label" DefaultValue="Open pane"/>
          <bt:String id="Cmd.RefreshSheet.Label" DefaultValue="Refresh sheet"/>
          <bt:String id="Cmd.RefreshWorkbook.Label" DefaultValue="Refresh workbook"/>
          <bt:String id="GetStarted.Title" DefaultValue="Connect BankRegReports"/>
        </bt:ShortStrings>
        <bt:LongStrings>
          <bt:String id="Cmd.OpenPane.Tip" DefaultValue="Browse fields and institutions, build a table, and manage your connection."/>
          <bt:String id="Cmd.RefreshSheet.Tip" DefaultValue="Recalculate every BankRegReports formula on this sheet."/>
          <bt:String id="Cmd.RefreshWorkbook.Tip" DefaultValue="Recalculate every BankRegReports formula in this workbook."/>
          <bt:String id="GetStarted.Description" DefaultValue="Open the pane and paste your API key to start pulling live regulatory data."/>
        </bt:LongStrings>
      </Resources>
    </VersionOverrides>
  </VersionOverrides>
</OfficeApp>
