// chrome/common/actor_webui.mojom-webui.ts is auto generated by mojom_bindings_generator.py, do not edit
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import { mojo } from '//resources/mojo/mojo/public/js/bindings.js';
import { FeatureModeSpec as glic_mojom_FeatureModeSpec } from './glic_enums.mojom-webui.js';
import { BitmapN32Spec as skia_mojom_BitmapN32Spec } from '//resources/mojo/skia/public/mojom/bitmap.mojom-webui.js';
import { OriginSpec as url_mojom_OriginSpec } from '//resources/mojo/url/mojom/origin.mojom-webui.js';
export const TaskDurationSpec = { $: mojo.internal.Enum() };
export var TaskDuration;
(function (TaskDuration) {
    TaskDuration[TaskDuration["MIN_VALUE"] = 1] = "MIN_VALUE";
    TaskDuration[TaskDuration["MAX_VALUE"] = 2] = "MAX_VALUE";
    TaskDuration[TaskDuration["kDefault"] = 1] = "kDefault";
    TaskDuration[TaskDuration["kTransient"] = 2] = "kTransient";
})(TaskDuration || (TaskDuration = {}));
export const UserGrantedPermissionDurationSpec = { $: mojo.internal.Enum() };
export var UserGrantedPermissionDuration;
(function (UserGrantedPermissionDuration) {
    UserGrantedPermissionDuration[UserGrantedPermissionDuration["MIN_VALUE"] = 0] = "MIN_VALUE";
    UserGrantedPermissionDuration[UserGrantedPermissionDuration["MAX_VALUE"] = 1] = "MAX_VALUE";
    UserGrantedPermissionDuration[UserGrantedPermissionDuration["kOneTime"] = 0] = "kOneTime";
    UserGrantedPermissionDuration[UserGrantedPermissionDuration["kAlwaysAllow"] = 1] = "kAlwaysAllow";
})(UserGrantedPermissionDuration || (UserGrantedPermissionDuration = {}));
export const CredentialTypeSpec = { $: mojo.internal.Enum() };
export var CredentialType;
(function (CredentialType) {
    CredentialType[CredentialType["MIN_VALUE"] = 0] = "MIN_VALUE";
    CredentialType[CredentialType["MAX_VALUE"] = 1] = "MAX_VALUE";
    CredentialType[CredentialType["kPassword"] = 0] = "kPassword";
    CredentialType[CredentialType["kFederated"] = 1] = "kFederated";
})(CredentialType || (CredentialType = {}));
export const SelectCredentialDialogErrorReasonSpec = { $: mojo.internal.Enum() };
export var SelectCredentialDialogErrorReason;
(function (SelectCredentialDialogErrorReason) {
    SelectCredentialDialogErrorReason[SelectCredentialDialogErrorReason["MIN_VALUE"] = 0] = "MIN_VALUE";
    SelectCredentialDialogErrorReason[SelectCredentialDialogErrorReason["MAX_VALUE"] = 0] = "MAX_VALUE";
    SelectCredentialDialogErrorReason[SelectCredentialDialogErrorReason["kDialogPromiseNoSubscriber"] = 0] = "kDialogPromiseNoSubscriber";
})(SelectCredentialDialogErrorReason || (SelectCredentialDialogErrorReason = {}));
export const SelectAutofillSuggestionsDialogErrorReasonSpec = { $: mojo.internal.Enum() };
export var SelectAutofillSuggestionsDialogErrorReason;
(function (SelectAutofillSuggestionsDialogErrorReason) {
    SelectAutofillSuggestionsDialogErrorReason[SelectAutofillSuggestionsDialogErrorReason["MIN_VALUE"] = 0] = "MIN_VALUE";
    SelectAutofillSuggestionsDialogErrorReason[SelectAutofillSuggestionsDialogErrorReason["MAX_VALUE"] = 2] = "MAX_VALUE";
    SelectAutofillSuggestionsDialogErrorReason[SelectAutofillSuggestionsDialogErrorReason["kDialogPromiseNoSubscriber"] = 0] = "kDialogPromiseNoSubscriber";
    SelectAutofillSuggestionsDialogErrorReason[SelectAutofillSuggestionsDialogErrorReason["kMismatchedTaskId"] = 1] = "kMismatchedTaskId";
    SelectAutofillSuggestionsDialogErrorReason[SelectAutofillSuggestionsDialogErrorReason["kNoActorTaskDelegate"] = 2] = "kNoActorTaskDelegate";
})(SelectAutofillSuggestionsDialogErrorReason || (SelectAutofillSuggestionsDialogErrorReason = {}));
export const ConfirmationRequestErrorReasonSpec = { $: mojo.internal.Enum() };
export var ConfirmationRequestErrorReason;
(function (ConfirmationRequestErrorReason) {
    ConfirmationRequestErrorReason[ConfirmationRequestErrorReason["MIN_VALUE"] = 0] = "MIN_VALUE";
    ConfirmationRequestErrorReason[ConfirmationRequestErrorReason["MAX_VALUE"] = 1] = "MAX_VALUE";
    ConfirmationRequestErrorReason[ConfirmationRequestErrorReason["kRequestPromiseNoSubscriber"] = 0] = "kRequestPromiseNoSubscriber";
    ConfirmationRequestErrorReason[ConfirmationRequestErrorReason["kPreemptedByNewRequest"] = 1] = "kPreemptedByNewRequest";
})(ConfirmationRequestErrorReason || (ConfirmationRequestErrorReason = {}));
export const GmailOtpOptInErrorReasonSpec = { $: mojo.internal.Enum() };
export var GmailOtpOptInErrorReason;
(function (GmailOtpOptInErrorReason) {
    GmailOtpOptInErrorReason[GmailOtpOptInErrorReason["MIN_VALUE"] = 0] = "MIN_VALUE";
    GmailOtpOptInErrorReason[GmailOtpOptInErrorReason["MAX_VALUE"] = 0] = "MAX_VALUE";
    GmailOtpOptInErrorReason[GmailOtpOptInErrorReason["kRequestPromiseNoSubscriber"] = 0] = "kRequestPromiseNoSubscriber";
})(GmailOtpOptInErrorReason || (GmailOtpOptInErrorReason = {}));
export const TaskOptionsSpec = { $: {} };
export const CredentialSpec = { $: {} };
export const SelectCredentialDialogRequestSpec = { $: {} };
export const SelectCredentialDialogResponseSpec = { $: {} };
export const AutofillSuggestionSpec = { $: {} };
export const FormFillingRequestSpec = { $: {} };
export const SelectAutofillSuggestionsDialogRequestSpec = { $: {} };
export const FormFillingResponseSpec = { $: {} };
export const AutofillSuggestionDialogOnFormPresentedParamsSpec = { $: {} };
export const AutofillSuggestionDialogOnFormPreviewChangedParamsSpec = { $: {} };
export const AutofillSuggestionDialogOnFormConfirmedParamsSpec = { $: {} };
export const SelectAutofillSuggestionsDialogResponseSpec = { $: {} };
export const UserConfirmationDialogPayloadSpec = { $: {} };
export const UserConfirmationDialogRequestSpec = { $: {} };
export const UserConfirmationDialogResponseSpec = { $: {} };
export const NavigationConfirmationRequestSpec = { $: {} };
export const NavigationConfirmationResponseSpec = { $: {} };
export const SelectAutofillSuggestionsDialogResultSpec = { $: {} };
export const UserConfirmationDialogResultSpec = { $: {} };
export const ConfirmationRequestResultSpec = { $: {} };
export const GmailOtpOptInResultSpec = { $: {} };
mojo.internal.Struct(TaskOptionsSpec.$, 'TaskOptions', [
    mojo.internal.StructField('title', 0, 0, mojo.internal.String, null, true /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('duration_$flag', 8, 0, mojo.internal.Bool, false, false /* nullable */, 0, {
        isPrimary: true,
        linkedValueFieldName: "duration_$value",
        originalFieldName: "duration",
    }, undefined),
    mojo.internal.StructField('duration_$value', 12, 0, TaskDurationSpec.$, 1, false /* nullable */, 0, {
        isPrimary: false,
        originalFieldName: "duration",
    }, undefined),
    mojo.internal.StructField('feature_mode_$flag', 8, 1, mojo.internal.Bool, false, false /* nullable */, 0, {
        isPrimary: true,
        linkedValueFieldName: "feature_mode_$value",
        originalFieldName: "featureMode",
    }, undefined),
    mojo.internal.StructField('feature_mode_$value', 16, 0, glic_mojom_FeatureModeSpec.$, 0, false /* nullable */, 0, {
        isPrimary: false,
        originalFieldName: "featureMode",
    }, undefined),
], [[0, 32],]);
mojo.internal.Struct(CredentialSpec.$, 'Credential', [
    mojo.internal.StructField('id', 0, 0, mojo.internal.Int32, 0, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('username', 8, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('sourceSiteOrApp', 16, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('requestOrigin', 24, 0, url_mojom_OriginSpec.$, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('displayOrigin', 32, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('type', 4, 0, CredentialTypeSpec.$, 0, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('accountPicture', 40, 0, skia_mojom_BitmapN32Spec.$, null, true /* nullable */, 0, undefined, undefined),
], [[0, 56],]);
mojo.internal.Struct(SelectCredentialDialogRequestSpec.$, 'SelectCredentialDialogRequest', [
    mojo.internal.StructField('taskId', 0, 0, mojo.internal.Int32, 0, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('showDialog', 4, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('credentials', 8, 0, mojo.internal.Array(CredentialSpec.$, false), null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('icons', 16, 0, mojo.internal.Map(mojo.internal.String, skia_mojom_BitmapN32Spec.$, false), null, false /* nullable */, 0, undefined, undefined),
], [[0, 32],]);
mojo.internal.Struct(SelectCredentialDialogResponseSpec.$, 'SelectCredentialDialogResponse', [
    mojo.internal.StructField('taskId', 0, 0, mojo.internal.Int32, 0, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('error_reason_$flag', 4, 0, mojo.internal.Bool, false, false /* nullable */, 0, {
        isPrimary: true,
        linkedValueFieldName: "error_reason_$value",
        originalFieldName: "errorReason",
    }, undefined),
    mojo.internal.StructField('error_reason_$value', 8, 0, SelectCredentialDialogErrorReasonSpec.$, 0, false /* nullable */, 0, {
        isPrimary: false,
        originalFieldName: "errorReason",
    }, undefined),
    mojo.internal.StructField('permission_duration_$flag', 4, 1, mojo.internal.Bool, false, false /* nullable */, 0, {
        isPrimary: true,
        linkedValueFieldName: "permission_duration_$value",
        originalFieldName: "permissionDuration",
    }, undefined),
    mojo.internal.StructField('permission_duration_$value', 12, 0, UserGrantedPermissionDurationSpec.$, 0, false /* nullable */, 0, {
        isPrimary: false,
        originalFieldName: "permissionDuration",
    }, undefined),
    mojo.internal.StructField('selected_credential_id_$flag', 4, 2, mojo.internal.Bool, false, false /* nullable */, 0, {
        isPrimary: true,
        linkedValueFieldName: "selected_credential_id_$value",
        originalFieldName: "selectedCredentialId",
    }, undefined),
    mojo.internal.StructField('selected_credential_id_$value', 16, 0, mojo.internal.Int32, 0, false /* nullable */, 0, {
        isPrimary: false,
        originalFieldName: "selectedCredentialId",
    }, undefined),
], [[0, 32],]);
mojo.internal.Struct(AutofillSuggestionSpec.$, 'AutofillSuggestion', [
    mojo.internal.StructField('id', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('title', 8, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('details', 16, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('icon', 24, 0, skia_mojom_BitmapN32Spec.$, null, true /* nullable */, 0, undefined, undefined),
], [[0, 40],]);
mojo.internal.Struct(FormFillingRequestSpec.$, 'FormFillingRequest', [
    mojo.internal.StructField('requestedData', 0, 0, mojo.internal.Int64, BigInt(0), false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('formattedRequestOrigin', 8, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('sectionLabel', 16, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('suggestions', 24, 0, mojo.internal.Array(AutofillSuggestionSpec.$, false), null, false /* nullable */, 0, undefined, undefined),
], [[0, 40],]);
mojo.internal.Struct(SelectAutofillSuggestionsDialogRequestSpec.$, 'SelectAutofillSuggestionsDialogRequest', [
    mojo.internal.StructField('taskId', 0, 0, mojo.internal.Int32, 0, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('formFillingRequests', 8, 0, mojo.internal.Array(FormFillingRequestSpec.$, false), null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(FormFillingResponseSpec.$, 'FormFillingResponse', [
    mojo.internal.StructField('selectedSuggestionId', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(AutofillSuggestionDialogOnFormPresentedParamsSpec.$, 'AutofillSuggestionDialogOnFormPresentedParams', [
    mojo.internal.StructField('formFillingRequestIndex', 0, 0, mojo.internal.Int32, 0, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(AutofillSuggestionDialogOnFormPreviewChangedParamsSpec.$, 'AutofillSuggestionDialogOnFormPreviewChangedParams', [
    mojo.internal.StructField('formFillingRequestIndex', 0, 0, mojo.internal.Int32, 0, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('response', 8, 0, FormFillingResponseSpec.$, null, true /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(AutofillSuggestionDialogOnFormConfirmedParamsSpec.$, 'AutofillSuggestionDialogOnFormConfirmedParams', [
    mojo.internal.StructField('formFillingRequestIndex', 0, 0, mojo.internal.Int32, 0, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('response', 8, 0, FormFillingResponseSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(SelectAutofillSuggestionsDialogResponseSpec.$, 'SelectAutofillSuggestionsDialogResponse', [
    mojo.internal.StructField('taskId', 0, 0, mojo.internal.Int32, 0, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('result', 8, 0, SelectAutofillSuggestionsDialogResultSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 32],]);
mojo.internal.Struct(UserConfirmationDialogPayloadSpec.$, 'UserConfirmationDialogPayload', [
    mojo.internal.StructField('navigationOrigin', 0, 0, url_mojom_OriginSpec.$, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('forBlocklistedOrigin', 8, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(UserConfirmationDialogRequestSpec.$, 'UserConfirmationDialogRequest', [
    mojo.internal.StructField('payload', 0, 0, UserConfirmationDialogPayloadSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(UserConfirmationDialogResponseSpec.$, 'UserConfirmationDialogResponse', [
    mojo.internal.StructField('result', 0, 0, ConfirmationRequestResultSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(NavigationConfirmationRequestSpec.$, 'NavigationConfirmationRequest', [
    mojo.internal.StructField('taskId', 0, 0, mojo.internal.Int32, 0, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('navigationOrigin', 8, 0, url_mojom_OriginSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(NavigationConfirmationResponseSpec.$, 'NavigationConfirmationResponse', [
    mojo.internal.StructField('result', 0, 0, ConfirmationRequestResultSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Union(SelectAutofillSuggestionsDialogResultSpec.$, 'SelectAutofillSuggestionsDialogResult', {
    'errorReason': {
        'ordinal': 0,
        'type': SelectAutofillSuggestionsDialogErrorReasonSpec.$,
    },
    'selectedSuggestions': {
        'ordinal': 1,
        'type': mojo.internal.Array(FormFillingResponseSpec.$, false),
    },
});
export var SelectAutofillSuggestionsDialogResultFieldTags;
(function (SelectAutofillSuggestionsDialogResultFieldTags) {
    SelectAutofillSuggestionsDialogResultFieldTags[SelectAutofillSuggestionsDialogResultFieldTags["ERROR_REASON"] = 0] = "ERROR_REASON";
    SelectAutofillSuggestionsDialogResultFieldTags[SelectAutofillSuggestionsDialogResultFieldTags["SELECTED_SUGGESTIONS"] = 1] = "SELECTED_SUGGESTIONS";
})(SelectAutofillSuggestionsDialogResultFieldTags || (SelectAutofillSuggestionsDialogResultFieldTags = {}));
export function whichSelectAutofillSuggestionsDialogResult(u) {
    if (u.errorReason !== null && u.errorReason !== undefined) {
        return SelectAutofillSuggestionsDialogResultFieldTags.ERROR_REASON;
    }
    if (u.selectedSuggestions !== null && u.selectedSuggestions !== undefined) {
        return SelectAutofillSuggestionsDialogResultFieldTags.SELECTED_SUGGESTIONS;
    }
    throw new Error("no union field has been set, this is an illegal state");
}
mojo.internal.Union(UserConfirmationDialogResultSpec.$, 'UserConfirmationDialogResult', {
    'permissionGranted': {
        'ordinal': 0,
        'type': mojo.internal.Bool,
    },
    'errorReason': {
        'ordinal': 1,
        'type': ConfirmationRequestErrorReasonSpec.$,
    },
});
export var UserConfirmationDialogResultFieldTags;
(function (UserConfirmationDialogResultFieldTags) {
    UserConfirmationDialogResultFieldTags[UserConfirmationDialogResultFieldTags["PERMISSION_GRANTED"] = 0] = "PERMISSION_GRANTED";
    UserConfirmationDialogResultFieldTags[UserConfirmationDialogResultFieldTags["ERROR_REASON"] = 1] = "ERROR_REASON";
})(UserConfirmationDialogResultFieldTags || (UserConfirmationDialogResultFieldTags = {}));
export function whichUserConfirmationDialogResult(u) {
    if (u.permissionGranted !== null && u.permissionGranted !== undefined) {
        return UserConfirmationDialogResultFieldTags.PERMISSION_GRANTED;
    }
    if (u.errorReason !== null && u.errorReason !== undefined) {
        return UserConfirmationDialogResultFieldTags.ERROR_REASON;
    }
    throw new Error("no union field has been set, this is an illegal state");
}
mojo.internal.Union(ConfirmationRequestResultSpec.$, 'ConfirmationRequestResult', {
    'permissionGranted': {
        'ordinal': 0,
        'type': mojo.internal.Bool,
    },
    'errorReason': {
        'ordinal': 1,
        'type': ConfirmationRequestErrorReasonSpec.$,
    },
});
export var ConfirmationRequestResultFieldTags;
(function (ConfirmationRequestResultFieldTags) {
    ConfirmationRequestResultFieldTags[ConfirmationRequestResultFieldTags["PERMISSION_GRANTED"] = 0] = "PERMISSION_GRANTED";
    ConfirmationRequestResultFieldTags[ConfirmationRequestResultFieldTags["ERROR_REASON"] = 1] = "ERROR_REASON";
})(ConfirmationRequestResultFieldTags || (ConfirmationRequestResultFieldTags = {}));
export function whichConfirmationRequestResult(u) {
    if (u.permissionGranted !== null && u.permissionGranted !== undefined) {
        return ConfirmationRequestResultFieldTags.PERMISSION_GRANTED;
    }
    if (u.errorReason !== null && u.errorReason !== undefined) {
        return ConfirmationRequestResultFieldTags.ERROR_REASON;
    }
    throw new Error("no union field has been set, this is an illegal state");
}
mojo.internal.Union(GmailOtpOptInResultSpec.$, 'GmailOtpOptInResult', {
    'permissionGranted': {
        'ordinal': 0,
        'type': mojo.internal.Bool,
    },
    'errorReason': {
        'ordinal': 1,
        'type': GmailOtpOptInErrorReasonSpec.$,
    },
});
export var GmailOtpOptInResultFieldTags;
(function (GmailOtpOptInResultFieldTags) {
    GmailOtpOptInResultFieldTags[GmailOtpOptInResultFieldTags["PERMISSION_GRANTED"] = 0] = "PERMISSION_GRANTED";
    GmailOtpOptInResultFieldTags[GmailOtpOptInResultFieldTags["ERROR_REASON"] = 1] = "ERROR_REASON";
})(GmailOtpOptInResultFieldTags || (GmailOtpOptInResultFieldTags = {}));
export function whichGmailOtpOptInResult(u) {
    if (u.permissionGranted !== null && u.permissionGranted !== undefined) {
        return GmailOtpOptInResultFieldTags.PERMISSION_GRANTED;
    }
    if (u.errorReason !== null && u.errorReason !== undefined) {
        return GmailOtpOptInResultFieldTags.ERROR_REASON;
    }
    throw new Error("no union field has been set, this is an illegal state");
}
