<?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>05bdc394-41db-459f-ada0-842baf11afae</Id>
  <Version>1.6.0.0</Version>
  <ProviderName>CDX Technologies</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="CDXZipStream"/>
  <Description DefaultValue="ZIP code distance, lookup, radius, demographics, and geocoding custom functions for Excel."/>
  <IconUrl DefaultValue="https://addin.cdxzipstream.com/assets/cdx-rib-32.png"/>
  <HighResolutionIconUrl DefaultValue="https://addin.cdxzipstream.com/assets/cdx-rib-64.png"/>
  <SupportUrl DefaultValue="https://cdxzipstream.com/support"/>
  <AppDomains>
    <AppDomain>https://app.cdxzipstream.com</AppDomain>
    <AppDomain>https://addin.cdxzipstream.com</AppDomain>
    <AppDomain>https://api.cdxzipstream.com</AppDomain>
  </AppDomains>
  <Hosts>
    <Host Name="Workbook"/>
  </Hosts>
  <!-- SHARED runtime. The JS-only runtime was the original choice, but on Excel for Windows it
       gives the cell functions their OWN runtime whose OfficeRuntime.storage is NOT shared with the
       task pane's — proven 2026-07-31: Excel fetched /dist/functions.js, the function ran, found no
       key, and never issued the /v1/batch request (server logs show the fetch and no POST), so every
       =CDX.* returned #VALUE! while the pane showed the key and a live credit balance.
       A shared runtime puts the pane and the cell functions in ONE browser runtime with one storage,
       so the key cannot be visible to one and not the other. Cost: raises the floor to M365 /
       Office 2021 (build 12527.20092+); perpetual/LTSC below that can no longer load the add-in. -->
  <Requirements>
    <Sets DefaultMinVersion="1.1">
      <Set Name="SharedRuntime" MinVersion="1.1"/>
    </Sets>
  </Requirements>
  <DefaultSettings>
    <SourceLocation DefaultValue="https://app.cdxzipstream.com/src/taskpane/taskpane.html"/>
  </DefaultSettings>
  <Permissions>ReadWriteDocument</Permissions>
  <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
    <Hosts>
      <Host xsi:type="Workbook">
        <!-- The shared runtime itself. lifetime="long" keeps it loaded so the cell functions can
             calculate whether or not the pane is open. Must be the FIRST child of Host per schema. -->
        <Runtimes>
          <Runtime resid="Taskpane.Url" lifetime="long"/>
        </Runtimes>
        <!-- Custom functions MUST be under AllFormFactors (and it must precede
             DesktopFormFactor per the schema). Excel silently ignores a CustomFunctions
             ExtensionPoint nested in DesktopFormFactor — functions never register, metadata
             never fetched. Matches Microsoft's official custom-functions manifest. -->
        <AllFormFactors>
          <ExtensionPoint xsi:type="CustomFunctions">
            <Script>
              <SourceLocation resid="Functions.Script.Url"/>
            </Script>
            <!-- Shared runtime: the PAGE is the task pane, so the cell functions run in the same
                 runtime as the pane and read the same OfficeRuntime.storage. (Functions.Page.Url /
                 functions.html stays deployed but unreferenced — reverting is a one-line swap.) -->
            <Page>
              <SourceLocation resid="Taskpane.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>
          <!-- One button opens the product pane (the hub: key + usage + settings + Insert
               wizard). A second Help button runs the openHelp command (commands.html) which
               pops the generic /help web page in a browser via openBrowserWindow. The command
               FunctionFile is separate from the custom-functions runtime (AllFormFactors),
               so functions still register the reliable way; openBrowserWindow needs no consent. -->
          <!-- Shared runtime: ribbon commands run in the shared page too, so openHelp is registered
               by the task pane (commands.js is loaded there). Commands.Url is now unreferenced. -->
          <FunctionFile resid="Taskpane.Url"/>
          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <OfficeTab id="TabHome">
              <Group id="CdxGroup">
                <Label resid="CdxGroup.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="CdxOpenButton">
                  <Label resid="CdxOpen.Label"/>
                  <Supertip>
                    <Title resid="CdxOpen.Label"/>
                    <Description resid="CdxOpen.Tooltip"/>
                  </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>CdxTaskpane</TaskpaneId>
                    <SourceLocation resid="Taskpane.Url"/>
                  </Action>
                </Control>
                <Control xsi:type="Button" id="CdxHelpButton">
                  <Label resid="CdxHelp.Label"/>
                  <Supertip>
                    <Title resid="CdxHelp.Label"/>
                    <Description resid="CdxHelp.Tooltip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="HelpIcon.16"/>
                    <bt:Image size="32" resid="HelpIcon.32"/>
                    <bt:Image size="80" resid="HelpIcon.80"/>
                  </Icon>
                  <Action xsi:type="ExecuteFunction">
                    <FunctionName>openHelp</FunctionName>
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>
    <Resources>
      <bt:Images>
        <bt:Image id="Icon.16" DefaultValue="https://addin.cdxzipstream.com/assets/cdx-rib-16.png"/>
        <bt:Image id="Icon.32" DefaultValue="https://addin.cdxzipstream.com/assets/cdx-rib-32.png"/>
        <bt:Image id="Icon.80" DefaultValue="https://addin.cdxzipstream.com/assets/cdx-rib-80.png"/>
        <bt:Image id="HelpIcon.16" DefaultValue="https://addin.cdxzipstream.com/assets/help-16.png"/>
        <bt:Image id="HelpIcon.32" DefaultValue="https://addin.cdxzipstream.com/assets/help-32.png"/>
        <bt:Image id="HelpIcon.80" DefaultValue="https://addin.cdxzipstream.com/assets/help-80.png"/>
      </bt:Images>
      <bt:Urls>
        <bt:Url id="Functions.Script.Url" DefaultValue="https://app.cdxzipstream.com/dist/functions.js"/>
        <bt:Url id="Functions.Metadata.Url" DefaultValue="https://app.cdxzipstream.com/dist/functions.json"/>
        <bt:Url id="Functions.Page.Url" DefaultValue="https://app.cdxzipstream.com/src/functions/functions.html"/>
        <bt:Url id="Commands.Url" DefaultValue="https://app.cdxzipstream.com/src/commands/commands.html"/>
        <bt:Url id="Taskpane.Url" DefaultValue="https://app.cdxzipstream.com/src/taskpane/taskpane.html"/>
        <bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://app.cdxzipstream.com/help"/>
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="Functions.Namespace" DefaultValue="CDX"/>
        <bt:String id="GetStarted.Title" DefaultValue="CDXZipStream is ready"/>
        <bt:String id="CdxGroup.Label" DefaultValue="CDXZipStream"/>
        <bt:String id="CdxOpen.Label" DefaultValue="CDXZipStream"/>
        <bt:String id="CdxHelp.Label" DefaultValue="Help"/>
      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="GetStarted.Description" DefaultValue="Open the CDXZipStream pane to set your key, then run point-and-click tools — USPS address verification (ZIP+4) and route optimization — or type functions like =CDX.VERIFY, =CDX.DISTANCE, and =CDX.CENSUS in any cell."/>
        <bt:String id="CdxOpen.Tooltip" DefaultValue="Open the CDXZipStream pane — set your key, insert functions, and view usage."/>
        <bt:String id="CdxHelp.Tooltip" DefaultValue="Open CDXZipStream help &amp; support in your browser."/>
      </bt:LongStrings>
    </Resources>
  </VersionOverrides>
</OfficeApp>
