<?xml version="1.0" encoding="UTF-8"?>
<!--
  WAPD Email Agent (TEST) - throwaway NON-SSO sideload variant.

  No WebApplicationInfo / no Office SSO, so user-sideload accepts it. The task
  pane authenticates via MSAL.js popup against the SAME app reg (ff92e55d),
  requests api://ff92e55d.../access_as_user, and calls GET /api/watch exactly
  like the real pane. A 200 + only-your-row here proves the whole stack
  (auth -> token shape -> API -> ownership filter) and isolates the remaining
  unknown to the Office-SSO token swap alone.

  DELETE this file (and test-taskpane.html / test-taskpane.js) after Gate A is
  confirmed. The real SSO manifest.xml is intentionally untouched.
-->
<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:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0"
  xsi:type="MailApp">

  <Id>7c2f9a14-3e8b-4d6a-bf21-9a0c5e83d1f4</Id>
  <Version>1.0.0.0</Version>
  <ProviderName>Workshop/APD</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="WAPD Email Agent (TEST)" />
  <Description DefaultValue="Throwaway non-SSO test build. Authenticates via MSAL popup and lists your watches. Not for wide deployment." />
  <IconUrl DefaultValue="https://mailagent.workshopapd.com/assets/icon-64.png" />
  <HighResolutionIconUrl DefaultValue="https://mailagent.workshopapd.com/assets/icon-128.png" />
  <SupportUrl DefaultValue="https://mailagent.workshopapd.com/" />

  <!-- API host + AAD (MSAL navigates here for the auth popup). -->
  <AppDomains>
    <AppDomain>https://wapd-email-agent.azurewebsites.net</AppDomain>
    <AppDomain>https://login.microsoftonline.com</AppDomain>
  </AppDomains>

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

  <Requirements>
    <Sets>
      <!-- No SSO -> 1.3 is plenty for a read task pane. -->
      <Set Name="Mailbox" MinVersion="1.3" />
    </Sets>
  </Requirements>

  <FormSettings>
    <Form xsi:type="ItemRead">
      <DesktopSettings>
        <SourceLocation DefaultValue="https://mailagent.workshopapd.com/test-taskpane.html" />
        <RequestedHeight>250</RequestedHeight>
      </DesktopSettings>
    </Form>
  </FormSettings>

  <Permissions>ReadItem</Permissions>

  <Rule xsi:type="RuleCollection" Mode="Or">
    <Rule xsi:type="ItemIs" ItemType="Message" FormType="Read" />
  </Rule>
  <DisableEntityHighlighting>false</DisableEntityHighlighting>

  <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
    <Requirements>
      <bt:Sets DefaultMinVersion="1.3">
        <bt:Set Name="Mailbox" />
      </bt:Sets>
    </Requirements>

    <Hosts>
      <Host xsi:type="MailHost">
        <DesktopFormFactor>
          <FunctionFile resid="functionFile" />
          <ExtensionPoint xsi:type="MessageReadCommandSurface">
            <OfficeTab id="TabDefault">
              <Group id="wapdTestGroup">
                <Label resid="groupLabel" />
                <Control xsi:type="Button" id="openTestPaneButton">
                  <Label resid="buttonLabel" />
                  <Supertip>
                    <Title resid="buttonLabel" />
                    <Description resid="buttonTip" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="icon16" />
                    <bt:Image size="32" resid="icon32" />
                    <bt:Image size="80" resid="icon80" />
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <SourceLocation resid="taskpaneUrl" />
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>

    <Resources>
      <bt:Images>
        <bt:Image id="icon16" DefaultValue="https://mailagent.workshopapd.com/assets/icon-16.png" />
        <bt:Image id="icon32" DefaultValue="https://mailagent.workshopapd.com/assets/icon-32.png" />
        <bt:Image id="icon80" DefaultValue="https://mailagent.workshopapd.com/assets/icon-80.png" />
      </bt:Images>
      <bt:Urls>
        <bt:Url id="taskpaneUrl" DefaultValue="https://mailagent.workshopapd.com/test-taskpane.html" />
        <bt:Url id="functionFile" DefaultValue="https://mailagent.workshopapd.com/commands.html" />
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="groupLabel" DefaultValue="Email Agent TEST" />
        <bt:String id="buttonLabel" DefaultValue="Email Agent TEST" />
      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="buttonTip" DefaultValue="Open the throwaway non-SSO test pane (MSAL auth + GET /api/watch)." />
      </bt:LongStrings>
    </Resources>
  </VersionOverrides>
</OfficeApp>
