<?xml version="1.0" encoding="UTF-8"?>
<!--
  beskæftigelse.dk for Excel — production manifest.

  The manifest is the add-in's identity: Excel keys an installation on <Id>,
  and the URLs below are what a kommune's machine loads for years after the
  workbook was saved. Two rules follow from that:

    1. Every URL below uses the punycode serving origin. The shorter SEO origin
       redirects there, and an add-in URL that redirects across origins breaks
       both AppDomains and the taskpane's own fetches. See dev-loop.md section 4.
    2. Namespace BESK matches EXCEL_FUNCTION_NAMESPACE, and the function ids
       live in the GENERATED /addin/functions.json — never listed here by hand.
       src/lib/addin/__tests__/functions-metadata.test.ts fails if this file and
       the contract disagree.
    3. The icons are the committed PNGs in public/addin/ (masters in
       addin/icons/, regenerate with `npm run addin:icons`). Excel shows a
       missing or unreadable icon as a black square in every kommune's ribbon,
       so the same test pins that each referenced icon exists at its declared
       size. IconUrl is 32x32 and HighResolutionIconUrl 64x64 per Microsoft's
       manifest reference; the ribbon states are 16 / 32 / 80.

  A local variant with localhost URLs and its own <Id> is generated by
  `npm run addin:manifest:dev` (never committed — Excel would see two add-ins
  fighting over the same identity).
-->
<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>1db76317-45b3-4a93-b0a5-66aa97191601</Id>
  <Version>1.1.0.0</Version>
  <ProviderName>beskaeftigelse.dk</ProviderName>
  <DefaultLocale>da-DK</DefaultLocale>
  <DisplayName DefaultValue="beskæftigelse.dk"/>
  <Description DefaultValue="Hent tal fra beskæftigelse.dk direkte ind i Excel — samme formler som regnearket på nettet. Kilde: Jobindsats.dk / STAR."/>
  <IconUrl DefaultValue="https://www.xn--beskftigelse-9cb.dk/addin/icon-32.png"/>
  <HighResolutionIconUrl DefaultValue="https://www.xn--beskftigelse-9cb.dk/addin/icon-64.png"/>
  <SupportUrl DefaultValue="https://www.xn--beskftigelse-9cb.dk/om"/>

  <AppDomains>
    <AppDomain>https://www.xn--beskftigelse-9cb.dk</AppDomain>
  </AppDomains>

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

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

  <DefaultSettings>
    <SourceLocation DefaultValue="https://www.xn--beskftigelse-9cb.dk/addin"/>
  </DefaultSettings>

  <Permissions>ReadWriteDocument</Permissions>

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

        <!--
          One shared runtime for the taskpane AND the custom functions. This is
          what makes OfficeRuntime.storage exist for the pane and lets the
          BESK functions read the login token the pane wrote — the token seam in
          docs/addin/auth.md section 5 assumes it. Without <Runtimes>, Excel
          isolates the two in separate sandboxes: the first live sideload
          (2026-08-15) showed a permanently disabled Log ind because
          OfficeRuntime.storage never appeared in the pane.
        -->
        <Runtimes>
          <Runtime resid="Taskpane.Url" lifetime="long"/>
        </Runtimes>

        <AllFormFactors>
          <ExtensionPoint xsi:type="CustomFunctions">
            <Script>
              <SourceLocation resid="Functions.Script.Url"/>
            </Script>
            <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>
          <!--
            Where ExecuteFunction commands are answered. Under the shared runtime
            declared above, that is the taskpane page itself: it registers the
            handler with `Office.actions.associate`
            (src/app/addin/_lib/ribbon-actions.ts). A separate function file
            would be a second JavaScript world with no session in it.
          -->
          <FunctionFile resid="Taskpane.Url"/>
          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <OfficeTab id="TabHome">
              <Group id="BeskGroup">
                <Label resid="Group.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="BeskTaskpaneButton">
                  <Label resid="Taskpane.Label"/>
                  <Supertip>
                    <Title resid="Taskpane.Label"/>
                    <Description resid="Taskpane.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>BeskTaskpane</TaskpaneId>
                    <SourceLocation resid="Taskpane.Url"/>
                  </Action>
                </Control>
                <!--
                  The rescue verb, in the ribbon rather than only in the pane. A
                  workbook whose formulas Excel stamped `@` shows `#NAME?` in
                  every cell and gives its owner no reason to open a sidepanel;
                  this is the button that repairs it. `opdaterAlle` is
                  OPDATER_ALLE_ACTION in src/app/addin/_lib/ribbon-actions.ts.
                -->
                <Control xsi:type="Button" id="BeskOpdaterAlleButton">
                  <Label resid="OpdaterAlle.Label"/>
                  <Supertip>
                    <Title resid="OpdaterAlle.Label"/>
                    <Description resid="OpdaterAlle.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="ExecuteFunction">
                    <FunctionName>opdaterAlle</FunctionName>
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>

      </Host>
    </Hosts>

    <Resources>
      <bt:Images>
        <bt:Image id="Icon.16" DefaultValue="https://www.xn--beskftigelse-9cb.dk/addin/icon-16.png"/>
        <bt:Image id="Icon.32" DefaultValue="https://www.xn--beskftigelse-9cb.dk/addin/icon-32.png"/>
        <bt:Image id="Icon.80" DefaultValue="https://www.xn--beskftigelse-9cb.dk/addin/icon-80.png"/>
      </bt:Images>
      <bt:Urls>
        <bt:Url id="Functions.Script.Url" DefaultValue="https://www.xn--beskftigelse-9cb.dk/addin/functions.js"/>
        <bt:Url id="Functions.Page.Url" DefaultValue="https://www.xn--beskftigelse-9cb.dk/addin/functions.html"/>
        <bt:Url id="Functions.Metadata.Url" DefaultValue="https://www.xn--beskftigelse-9cb.dk/addin/functions.json"/>
        <bt:Url id="Taskpane.Url" DefaultValue="https://www.xn--beskftigelse-9cb.dk/addin"/>
        <!--
          Post-install "learn more" for someone who has not logged in yet, so
          it points at the public install/usage guide rather than the
          login-gated /regneark app.
        -->
        <bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://www.xn--beskftigelse-9cb.dk/vaerktoejer/regneark/excel"/>
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="Functions.Namespace" DefaultValue="BESK"/>
        <bt:String id="Group.Label" DefaultValue="beskæftigelse.dk"/>
        <bt:String id="Taskpane.Label" DefaultValue="Åbn sidepanel"/>
        <bt:String id="OpdaterAlle.Label" DefaultValue="Opdater alle"/>
        <bt:String id="GetStarted.Title" DefaultValue="beskæftigelse.dk er klar"/>
      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="Taskpane.Tooltip" DefaultValue="Log ind, find målinger og indsæt tal fra beskæftigelse.dk i arket."/>
        <bt:String id="OpdaterAlle.Tooltip" DefaultValue="Skriv formler, som Excel ikke kunne binde, ind igen, og hent alle tal forfra. Kræver at du er logget ind i sidepanelet."/>
        <bt:String id="GetStarted.Description" DefaultValue="Åbn sidepanelet for at logge ind og hente tal. Skriv fx =BESK.HENT(&quot;y25i02&quot;;&quot;aarhus&quot;) i en celle."/>
      </bt:LongStrings>
    </Resources>

  </VersionOverrides>
</OfficeApp>
