import { html } from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js';
export function getTemplate() {
    return html `<!--_html_template_start_--><style include="cr-icons cr-shared-style settings-columned-section settings-shared">
  .keyboard-shortcut-setting {
    align-items: start;
  }

  #mainShortcutSetting {
    /* Remove the separator. */
    border-top: none;
  }

  .shortcut-input {
    margin-top: 2px;
  }

  .section {
    padding: 0 var(--cr-section-padding);
  }

  .separator {
    margin-inline-end: 4px;
    margin-inline-start: 0;
  }

  .toggle-actions-container {
    display: flex;
    align-items: center;
  }

  .learn-more-label[href=''] {
    display: none;
  }
</style>

<settings-subpage page-title="$i18n{glicPageTitle}" route-path$="[[routePath]]">
  <template is="dom-if" if="[[disallowedByAdmin_]]" restamp>
    <div class="section">
      <cr-icon icon="cr:domain"></cr-icon>
      $i18n{glicPolicyDisabledMessage}
    </div>
  </template>
  <div class="section">
    <h2 class="cr-title-text">$i18n{glicPreferencesSection}</h2>
    <!-- Glic Policy Disabled - show disabled controls -->
    <template is="dom-if" if="[[disallowedByAdmin_]]" restamp>
      <settings-toggle-button id="launcherToggle" pref="[[fakePref_]]"
          disabled label="$i18n{glicOsWidgetToggle}">
      </settings-toggle-button>
    </template>

    <!-- Glic Policy Enabled -->
    <template is="dom-if"
        on-dom-change="onEnabledTemplateDomChange_"
        if="[[!disallowedByAdmin_]]"
        restamp>
      <settings-toggle-button
          id="tabstripButtonToggle"
          pref="{{prefs.glic.pinned_to_tabstrip}}"
          label="$i18n{glicTabstripButtonToggle}"
          sub-label="$i18n{glicTabstripButtonToggleSublabel}"
          on-settings-boolean-control-change="onTabstripButtonToggleChange_">
      </settings-toggle-button>
      <settings-toggle-button class="hr"
          id="launcherToggle" pref="{{prefs.glic.launcher_enabled}}"
          label="$i18n{glicOsWidgetToggle}"
          sub-label="$i18n{glicOsWidgetToggleSublabel}"
          learn-more-url="$i18n{glicLauncherToggleLearnMoreUrl}"
          on-learn-more-clicked="onLauncherToggleLearnMoreClick_"
          checked="{{launcherToggleOn_}}"
          on-settings-boolean-control-change="onLauncherToggleChange_">
      </settings-toggle-button>
      <cr-collapse opened="[[launcherToggleOn_]]">
        <div class="cr-row keyboard-shortcut-setting"
             id="mainShortcutSetting">
          <div class="flex cr-padded-text">
            <div class="shortcut-label" aria-hidden>
              $i18n{glicKeyboardShortcut}
            </div>
            <div class="secondary"
                learn-more-url="$i18n{glicKeyboardShortcutLearnMoreUrl}">
              $i18n{glicKeyboardShortcutSublabel}
              <a id="shortcutsLearnMoreLabel" class="learn-more-label"
                  href="$i18n{glicKeyboardShortcutLearnMoreUrl}"
                  aria-label="$i18n{glicKeyboardShortcutLearnMoreAriaLabel}"
                  aria-description="$i18n{opensInNewTab}"
                  on-click="onShortcutsLearnMoreClick_" target="_blank">
                $i18n{glicKeyboardShortcutLearnMoreLabel}
              </a>
            </div>
          </div>
          <cr-shortcut-input class="cr-padded-text shortcut-input"
              input-aria-label="$i18n{glicKeyboardShortcut}"
              edit-button-aria-label="$i18n{glicKeyboardShortcutEditLabel}"
              clear-button-aria-label="$i18n{glicKeyboardShortcutClearLabel}"
              shortcut="[[registeredShortcut_]]"
              allow-ctrl-alt-shortcuts
              on-input-capture-change="onInputCaptureChange_"
              on-shortcut-updated="onShortcutUpdated_">
          </cr-shortcut-input>
        </div>
        <div class="hr cr-row keyboard-shortcut-setting"
            hidden="[[!glicSelectionFeatureEnabled_]]"
            id="selectionShortcutSetting">
          <div class="flex cr-padded-text">
            <div class="shortcut-label" aria-hidden>
              $i18n{glicSelectionShortcut}
            </div>
            <div class="secondary">$i18n{glicSelectionShortcutSublabel}
                <a id="shortcutsSelectionLearnMoreLabel"
                    class="learn-more-label"
                    href="$i18n{glicKeyboardShortcutLearnMoreUrl}"
                    aria-label="$i18n{glicSelectionShortcutLearnMoreAriaLabel}"
                    aria-description="$i18n{opensInNewTab}"
                    on-click="onShortcutsLearnMoreClick_" target="_blank">
                  $i18n{glicKeyboardShortcutLearnMoreLabel}
                </a>
            </div>
          </div>
          <cr-shortcut-input class="cr-padded-text shortcut-input"
              input-aria-label="$i18n{glicNavigationShortcut}"
              edit-button-aria-label="$i18n{glicSelectionShortcutEditLabel}"
              clear-button-aria-label="$i18n{glicSelectionShortcutClearLabel}"
              shortcut="[[registeredSelectionShortcut_]]"
              allow-ctrl-alt-shortcuts
              on-shortcut-updated="onSelectionShortcutUpdated_">
          </cr-shortcut-input>
        </div>
      </cr-collapse>
      <div class="hr cr-row keyboard-shortcut-setting"
           id="focusToggleShortcutSetting">
        <div class="flex cr-padded-text">
          <div class="shortcut-label" aria-hidden>
            $i18n{glicNavigationShortcut}
          </div>
          <div class="secondary">$i18n{glicNavigationShortcutSublabel}
              <a id="shortcutsNavigationLearnMoreLabel"
                  class="learn-more-label"
                  href="$i18n{glicKeyboardShortcutLearnMoreUrl}"
                  aria-label="$i18n{glicNavigationShortcutLearnMoreAriaLabel}"
                  aria-description="$i18n{opensInNewTab}"
                  on-click="onShortcutsLearnMoreClick_" target="_blank">
                $i18n{glicKeyboardShortcutLearnMoreLabel}
              </a>
          </div>
        </div>
        <cr-shortcut-input class="cr-padded-text shortcut-input"
            input-aria-label="$i18n{glicNavigationShortcut}"
            edit-button-aria-label="$i18n{glicNavigationShortcutEditLabel}"
            clear-button-aria-label="$i18n{glicNavigationShortcutClearLabel}"
            shortcut="[[registeredFocusToggleShortcut_]]"
            allow-ctrl-alt-shortcuts
            on-shortcut-updated="onFocusToggleShortcutUpdated_">
        </cr-shortcut-input>
      </div>
      <settings-toggle-button class="hr"
          id="closedCaptionsToggle"
          hidden="[[!closedCaptionsToggleEnabled_]]"
          pref="{{prefs.glic.closed_captioning_enabled}}"
          label="$i18n{glicClosedCaptionsToggle}"
          sub-label="$i18n{glicClosedCaptionsToggleSublabel}"
          on-settings-boolean-control-change="onClosedCaptionsToggleChange_">
      </settings-toggle-button>
      <settings-toggle-button class="hr"
          id="keepSidepanelOpenOnNewTabsToggle"
          hidden="[[!showGlicKeepSidepanelOpenOnNewTabsSetting_]]"
          pref="{{prefs.glic.keep_sidepanel_open_on_new_tabs_enabled}}"
          label="$i18n{glicKeepSidepanelOpenOnNewTabsToggle}"
          sub-label="$i18n{glicKeepSidepanelOpenOnNewTabsToggleSublabel}"
          on-settings-boolean-control-change=
              "onKeepSidepanelOpenOnNewTabsToggleChange_">
      </settings-toggle-button>
    </template>
  </div>
  <div class="section">
    <h2 class="cr-title-text">$i18n{glicDataSection}</h2>
    <!-- Glic Policy Disabled - show disabled controls -->
    <template is="dom-if" if="[[disallowedByAdmin_]]" restamp>
      <settings-toggle-button
          id="geolocationToggle" pref="[[fakePref_]]" disabled
          label="$i18n{glicLocationToggle}"
          sub-label="[[locationSubLabel_]]">
      </settings-toggle-button>
      <settings-toggle-button class="hr"
          id="microphoneToggle" pref="[[fakePref_]]" disabled
          label="$i18n{glicMicrophoneToggle}"
          sub-label="[[microphoneSubLabel_]]">
      </settings-toggle-button>
      <settings-toggle-button class="hr"
          id="tabAccessToggle" pref="[[fakePref_]]" disabled
          label="$i18n{glicTabAccessToggle}"
          sub-label="[[tabAccessSubLabel_]]"
          hidden="[[showGlicDefaultTabContextSetting_]]">
      </settings-toggle-button>
      <settings-toggle-button class="hr"
          id="defaultTabAccessToggle" pref="[[fakePref_]]" disabled
          label="$i18n{glicDefaultTabAccessToggle}"
          sub-label-with-link="[[defaultTabAccessSubLabel_]]"
          on-sub-label-link-clicked="onDefaultTabAccessToggleLearnMoreClick_"
          hidden="[[!showGlicDefaultTabContextSetting_]]">
      </settings-toggle-button>
      <settings-toggle-button class="hr"
          id="keepSidepanelOpenOnNewTabsToggle" pref="[[fakePref_]]" disabled
          label="$i18n{glicKeepSidepanelOpenOnNewTabsToggle}"
          sub-label="$i18n{glicKeepSidepanelOpenOnNewTabsToggleSublabel}"
          hidden="[[!showGlicKeepSidepanelOpenOnNewTabsSetting_]]">
      </settings-toggle-button>
    </template>

    <!-- Glic Policy Enabled -->
    <template is="dom-if" if="[[!disallowedByAdmin_]]" restamp>
      <settings-toggle-button
          id="geolocationToggle" pref="{{prefs.glic.geolocation_enabled}}"
          label="$i18n{glicLocationToggle}"
          sub-label="[[locationSubLabel_]]"
          learn-more-url="[[locationLearnMoreUrl_]]"
          on-learn-more-clicked="onLocationToggleLearnMoreClick_"
          on-settings-boolean-control-change="onGeolocationToggleChange_">
      </settings-toggle-button>
      <settings-toggle-button class="hr"
          id="microphoneToggle" pref="{{prefs.glic.microphone_enabled}}"
          label="$i18n{glicMicrophoneToggle}"
          sub-label="[[microphoneSubLabel_]]"
          hidden="[[!microphoneToggleEnabled_]]"
          on-settings-boolean-control-change="onMicrophoneToggleChange_">
      </settings-toggle-button>
      <div hidden="[[showGlicDefaultTabContextSetting_]]">
      <settings-toggle-button class="hr"
          id="tabAccessToggle" pref="{{prefs.glic.tab_context_enabled}}"
          label="$i18n{glicTabAccessToggle}"
          sub-label="[[tabAccessSubLabel_]]"
          on-learn-more-clicked="onTabAccessToggleLearnMoreClick_"
          on-settings-boolean-control-change="onTabAccessToggleChange_"
          no-toggle-on-host-click on-click="onTabAccessExpand_"
          hidden="[[showGlicDefaultTabContextSetting_]]">
        <div id="tabAccessToggleActions" class="toggle-actions-container"
            slot="more-actions">
          <cr-expand-button id="tabAccessExpandButton" no-hover
              expanded="{{tabAccessToggleExpanded_}}"
              aria-label="$i18n{glicTabAccessToggle}">
          </cr-expand-button>
          <div class="separator"></div>
        </div>
      </settings-toggle-button>
      <cr-collapse id="tabAccessInfoCollapse"
          opened="[[tabAccessToggleExpanded_]]"
          hidden="[[showGlicDefaultTabContextSetting_]]">
        <div class="settings-columned-section">
          <div class="column">
            <h2 class="description-header">$i18n{columnHeadingWhenOn}</h2>
            <ul class="icon-bulleted-list">
              <li>
                <cr-icon aria-hidden="true"

                      icon="settings20:edit-square">


                  </cr-icon>
                  <div class="secondary">$i18n{glicTabAccessWhenOn1}</div>
                </li>
              </ul>
            </div>
            <div class="column">
              <h2 class="description-header">$i18n{columnHeadingConsider}</h2>
              <ul class="icon-bulleted-list">
                <li>
                  <cr-icon aria-hidden="true"

                      icon="settings20:web">


                  </cr-icon>
                  <div class="secondary">$i18n{glicTabAccessConsider1}
                    <a id="shortcutTabAccessConsider1LearnMoreLabel"
                        class="learn-more-label"
                        href="[[tabAccessLearnMoreUrl_]]"
                        on-click="onTabAccessToggleLearnMoreClick_"
                        aria-label=
                           "$i18n{glicTabAccessConsider1LearnMoreLabel}"
                        aria-description="$i18n{opensInNewTab}"
                        target="_blank">
                    $i18n{glicTabAccessConsider1LearnMoreLabel}
                  </a>
                  </div>
                </li>
              </ul>
            </div>
          </div>
        </cr-collapse>
      </div>
      <div hidden="[[!showGlicDefaultTabContextSetting_]]">
        <settings-toggle-button class="hr"
            id="defaultTabAccessToggle"
            pref="{{prefs.glic.default_tab_context_enabled}}"
            label="$i18n{glicDefaultTabAccessToggle}"
            sub-label-with-link="[[defaultTabAccessSubLabel_]]"
            on-sub-label-link-clicked="onDefaultTabAccessToggleLearnMoreClick_"
            on-settings-boolean-control-change="onDefaultTabAccessToggleChange_"
            no-toggle-on-host-click on-click="onDefaultTabAccessExpand_">
          <div id="defaultTabAccessToggleActions"
              class="toggle-actions-container"
              slot="more-actions">
            <cr-expand-button id="defaultTabAccessExpandButton" no-hover
                expanded="{{defaultTabAccessToggleExpanded_}}"
                aria-label="$i18n{glicDefaultTabAccessToggle}">
            </cr-expand-button>
            <div class="separator"></div>
          </div>
        </settings-toggle-button>
        <cr-collapse id="defaultTabAccessInfoCollapse"
            opened="[[defaultTabAccessToggleExpanded_]]">
          <div class="settings-columned-section">
            <div class="column">
              <h2 class="description-header">$i18n{columnHeadingWhenOn}</h2>
              <ul class="icon-bulleted-list">
                <li>
                  <cr-icon aria-hidden="true"

                      icon="settings20:edit-square">


                  </cr-icon>
                  <div class="secondary">
                    $i18n{glicDefaultTabAccessWhenOn1}
                  </div>
                </li>
                <li>
                  <cr-icon aria-hidden="true"

                    icon="settings20:edit-square">


                  </cr-icon>
                  <div class="secondary">
                    $i18n{glicDefaultTabAccessWhenOn2}
                  </div>
                </li>
              </ul>
            </div>
            <div class="column">
              <h2 class="description-header">$i18n{columnHeadingConsider}</h2>
              <ul class="icon-bulleted-list">
                <li>
                  <cr-icon aria-hidden="true"

                      icon="settings20:web">


                  </cr-icon>
                  <div class="secondary">
                    $i18n{glicDefaultTabAccessConsider1}
                  </div>
                </li>
                <li hidden="[[isEnterpriseAccountDataProtected_]]">
                  <cr-icon aria-hidden="true" 
                    icon="settings20:web">
                    
                    
                  </cr-icon>
                  <div class="secondary">
                    $i18n{glicDefaultTabAccessConsider2}
                  </div>
                </li>
              </ul>
            </div>
          </div>
        </cr-collapse>
      </div>
      <template is="dom-if" if="[[headlessCaptionsEnabled_]]" restamp>
        <settings-toggle-button class="hr"
            id="mediaUnderstandingToggle"
            pref="{{prefs.glic.media_understanding_enabled}}"
            label="$i18n{glicMediaUnderstandingToggle}"
            sub-label-with-link="[[i18nAdvanced('glicMediaUnderstandingToggleSublabel')]]"
            on-sub-label-link-clicked="onMediaUnderstandingToggleLearnMoreClick_">
        </settings-toggle-button>
      </template>
      <template is="dom-if" if="[[actorLoginFederatedLoginSupportEnabled_]]"
          restamp>
        <cr-link-row id="actorLoginPermissionsButton" class="hr"
            on-click="onActorLoginPermissionsRowClick_"
            label="$i18n{glicActorLoginPermissionsSectionTitle}"
            sub-label="$i18n{glicActorLoginPermissionsSectionSublabel}">
        </cr-link-row>
      </template>
      <cr-link-row id="activityButton" class="hr" on-click="onActivityRowClick_"
          label="$i18n{glicActivityButton}"
          sub-label="$i18n{glicActivityButtonSublabel}" external>
      </cr-link-row>
      <cr-link-row id="extensionsButton" class="hr"
          hidden="[[!glicExtensionsFeatureEnabled_]]"
          on-click="onExtensionsRowClick_"
          label="$i18n{glicExtensionsButton}"
          sub-label="$i18n{glicExtensionsButtonSublabel}" external>
      </cr-link-row>
      <cr-link-row id="geminiPersonalContextLink" class="hr"
          hidden="[[!showGlicPersonalContextLink_]]"
          on-click="onGeminiPersonalContextClick_"
          label="$i18n{glicPersonalContextSettingButton}"
          sub-label="$i18n{glicPersonalContextSettingSublabel}" external>
      </cr-link-row>
      <cr-link-row id="InstructionLink" class="hr"
          hidden="[[!showGlicInstructionLink_]]"
          on-click="onGeminiPersonalContextClick_"
          label="$i18n{glicInstructionsSettingButton}"
          sub-label="$i18n{glicInstructionsSettingSublabel}" external>
      </cr-link-row>
    </template>
  </div>
  <div class="section" hidden="[[!webActuationFeatureEnabled_]]">
    <h2 class="cr-title-text">$i18n{glicAutoBrowseSection}</h2>
    <!-- Glic Policy Disabled - show disabled controls -->
    <template is="dom-if" if="[[disallowedByAdmin_]]" restamp>
      <settings-toggle-button
          id="webActuationToggleDisabled" pref="[[fakePref_]]" disabled
          label="$i18n{glicWebActuationToggle}"
          sub-label-with-link="[[webActuationSubLabel_]]"
          on-sub-label-link-clicked="onWebActuationToggleLearnMoreClick_">
      </settings-toggle-button>
    </template>

    <!-- Glic Policy Enabled -->
    <template is="dom-if" if="[[!disallowedByAdmin_]]" restamp>
      <template is="dom-if"
                if="[[!isWebActuationDisabledForEnterprise_]]" restamp>
        <settings-toggle-button
            id="webActuationToggle"
            pref="{{webActuationEnabledPref_}}"
            no-set-pref
            label="$i18n{glicWebActuationToggle}"
            sub-label-with-link="[[webActuationSubLabel_]]"
            on-sub-label-link-clicked="onWebActuationToggleLearnMoreClick_"
            on-settings-boolean-control-change="onWebActuationToggleChange_"
            no-toggle-on-host-click on-click="onWebActuationExpand_">
            <div id="webActuationToggleActions"
              class="toggle-actions-container"
              slot="more-actions">
            <cr-expand-button id="webActuationExpandButton" no-hover
                expanded="{{webActuationEnabledExpanded_}}"
                aria-label="$i18n{glicWebActuationToggle}">
            </cr-expand-button>
            <div class="separator"></div>
          </div>
        </settings-toggle-button>
      </template>
      <template is="dom-if"
                if="[[isWebActuationDisabledForEnterprise_]]" restamp>
        <settings-toggle-button disabled
            id="webActuationToggle"
            pref="[[webActuationDisabledForEnterprisePref_]]"
            label="$i18n{glicWebActuationToggle}"
            sub-label-with-link="[[webActuationSubLabel_]]"
            on-sub-label-link-clicked="onWebActuationToggleLearnMoreClick_"
            no-toggle-on-host-click on-click="onWebActuationExpand_">
            <div id="webActuationToggleActions"
              class="toggle-actions-container"
              slot="more-actions">
            <cr-expand-button id="webActuationExpandButton" no-hover
                expanded="{{webActuationEnabledExpanded_}}"
                aria-label="$i18n{glicWebActuationToggle}">
            </cr-expand-button>
            <div class="separator"></div>
          </div>
        </settings-toggle-button>
      </template>
      <cr-collapse id="webActuationInfoCollapse"
          opened="[[webActuationEnabledExpanded_]]">
        <div class="settings-columned-section">
          <div class="column">
            <h2 class="description-header">$i18n{columnHeadingWhenOn}</h2>
            <ul class="icon-bulleted-list">
              <li>
                <cr-icon aria-hidden="true"

                    icon="settings20:arrow-selector-tool">


                </cr-icon>
                <div class="secondary">
                  $i18n{glicWebActuationToggleWhenOn1}
                </div>
              </li>
              <li>
                <cr-icon aria-hidden="true"
                    icon="cr:check-circle">
                </cr-icon>
                <div class="secondary">
                  $i18n{glicWebActuationToggleWhenOn2}
                </div>
              </li>
            </ul>
          </div>
          <div class="column">
            <h2 class="description-header">$i18n{columnHeadingConsider}</h2>
            <ul class="icon-bulleted-list">
              <li>
                <cr-icon aria-hidden="true"
                  
                    icon="settings20:web">
                  
                  
                </cr-icon>
                <div class="secondary">
                  $i18n{glicWebActuationToggleConsider1}
                </div>
              </li>
              <li>
                <cr-icon aria-hidden="true"
                    icon="settings20:shield">
                </cr-icon>
                <div class="secondary">
                  $i18nRaw{glicWebActuationToggleConsider2}
                </div>
              </li>
            </ul>
          </div>
        </div>
      </cr-collapse>
      <template is="dom-if" if="[[showGlicExperimentalTriggering_]]">
        <settings-toggle-button
            id="glicExperimentalTriggeringToggle"
            class="hr"
            disabled="[[isExperimentalTriggeringDisabled_(
                webActuationEnabledPref_.value,
                isWebActuationDisabledForEnterprise_)]]"
            pref="{{experimentalTriggeringEnabledPref_}}"
            no-set-pref
            label="$i18n{glicExperimentalTriggering}"
            sub-label-with-link="[[experimentalTriggeringSubLabel_]]"
            on-sub-label-link-clicked=
                "onExperimentalTriggeringToggleLearnMoreClick_"
            on-settings-boolean-control-change=
                "onExperimentalTriggeringToggleChange_"
            no-toggle-on-host-click on-click="onExperimentalTriggeringExpand_">
            <div id="experimentalTriggeringToggleActions"
              class="toggle-actions-container"
              slot="more-actions">
            <cr-expand-button id="experimentalTriggeringExpandButton" no-hover
                expanded="{{experimentalTriggeringExpanded_}}"
                aria-label="$i18n{glicExperimentalTriggering}">
            </cr-expand-button>
            <div class="separator"></div>
          </div>
        </settings-toggle-button>
        <cr-collapse id="experimentalTriggeringInfoCollapse"
            opened="[[experimentalTriggeringExpanded_]]">
          <div class="settings-columned-section">
            <div class="column">
              <h2 class="description-header">$i18n{columnHeadingWhenOn}</h2>
              <ul class="icon-bulleted-list">
                <li>
                  <cr-icon aria-hidden="true"

                      icon="settings20:arrow-selector-tool">


                  </cr-icon>
                  <div class="secondary">
                    $i18n{glicExperimentalTriggeringWhenOn1}
                  </div>
                </li>
                <li>
                  <cr-icon aria-hidden="true"
                      icon="settings20:agent-mode2">
                  </cr-icon>
                  <div class="secondary">
                    $i18n{glicExperimentalTriggeringWhenOn2}
                  </div>
                </li>
              </ul>
            </div>
            <div class="column">
              <h2 class="description-header">$i18n{columnHeadingConsider}</h2>
              <ul class="icon-bulleted-list">
                <li>
                  <cr-icon aria-hidden="true"
                      icon="privacy:cookie">
                  </cr-icon>
                  <div class="secondary">
                    $i18n{glicExperimentalTriggeringConsider1}
                  </div>
                </li>
                <li>
                  <cr-icon aria-hidden="true"
                      icon="settings20:shield">
                  </cr-icon>
                  <div class="secondary">
                    $i18n{glicExperimentalTriggeringConsider2}
                  </div>
                </li>
                <li>
                  <cr-icon aria-hidden="true"
                      icon="settings20:stream-science">
                  </cr-icon>
                  <div class="secondary">
                    $i18nRaw{glicExperimentalTriggeringConsider3}
                  </div>
                </li>
              </ul>
            </div>
          </div>
        </cr-collapse>
      </template>
    </template>
  </div>
</settings-subpage>
<!--_html_template_end_-->`;
}
