static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetBlockByHeightRequest {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetBlockByHeightRequest();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        message.height = reader.readInt64();
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }


static deserializeBinary(bytes: Uint8Array): GetBlockByHeightRequest {
            return GetBlockByHeightRequest.deserialize(bytes);
        }


static fromObject(data: {
            block_id?: ReturnType<typeof dependency_5.tendermint.types.BlockID.prototype.toObject>;
            block?: ReturnType<typeof dependency_4.tendermint.types.Block.prototype.toObject>;
        }) {
            const message = new GetBlockByHeightResponse({});
            if (data.block_id != null) {
                message.block_id = dependency_5.tendermint.types.BlockID.fromObject(data.block_id);
            }
            if (data.block != null) {
                message.block = dependency_4.tendermint.types.Block.fromObject(data.block);
            }
            return message;
        }


toObject() {
            const data: {
                block_id?: ReturnType<typeof dependency_5.tendermint.types.BlockID.prototype.toObject>;
                block?: ReturnType<typeof dependency_4.tendermint.types.Block.prototype.toObject>;
            } = {};
            if (this.block_id != null) {
                data.block_id = this.block_id.toObject();
            }
            if (this.block != null) {
                data.block = this.block.toObject();
            }
            return data;
        }


serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
            const writer = w || new pb_1.BinaryWriter();
            if (this.block_id !== undefined)
                writer.writeMessage(1, this.block_id, () => this.block_id.serialize(writer));
            if (this.block !== undefined)
                writer.writeMessage(2, this.block, () => this.block.serialize(writer));
            if (!w)
                return writer.getResultBuffer();
        }


static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetBlockByHeightResponse {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetBlockByHeightResponse();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        reader.readMessage(message.block_id, () => message.block_id = dependency_5.tendermint.types.BlockID.deserialize(reader));
                        break;
                    case 2:
                        reader.readMessage(message.block, () => message.block = dependency_4.tendermint.types.Block.deserialize(reader));
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }


static deserializeBinary(bytes: Uint8Array): GetBlockByHeightResponse {
            return GetBlockByHeightResponse.deserialize(bytes);
        }


static fromObject(data: {}) {
            const message = new GetLatestBlockRequest({});
            return message;
        }


toObject() {
            const data: {} = {};
            return data;
        }


serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
            const writer = w || new pb_1.BinaryWriter();
            if (!w)
                return writer.getResultBuffer();
        }


static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetLatestBlockRequest {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetLatestBlockRequest();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    default: reader.skipField();
                }
            }
            return message;
        }


static deserializeBinary(bytes: Uint8Array): GetLatestBlockRequest {
            return GetLatestBlockRequest.deserialize(bytes);
        }


static fromObject(data: {
            block_id?: ReturnType<typeof dependency_5.tendermint.types.BlockID.prototype.toObject>;
            block?: ReturnType<typeof dependency_4.tendermint.types.Block.prototype.toObject>;
        }) {
            const message = new GetLatestBlockResponse({});
            if (data.block_id != null) {
                message.block_id = dependency_5.tendermint.types.BlockID.fromObject(data.block_id);
            }
            if (data.block != null) {
                message.block = dependency_4.tendermint.types.Block.fromObject(data.block);
            }
            return message;
        }


static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetLatestBlockResponse {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetLatestBlockResponse();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        reader.readMessage(message.block_id, () => message.block_id = dependency_5.tendermint.types.BlockID.deserialize(reader));
                        break;
                    case 2:
                        reader.readMessage(message.block, () => message.block = dependency_4.tendermint.types.Block.deserialize(reader));
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }


static deserializeBinary(bytes: Uint8Array): GetLatestBlockResponse {
            return GetLatestBlockResponse.deserialize(bytes);
        }


static fromObject(data: {}) {
            const message = new GetSyncingRequest({});
            return message;
        }


static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetSyncingRequest {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetSyncingRequest();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    default: reader.skipField();
                }
            }
            return message;
        }


static deserializeBinary(bytes: Uint8Array): GetSyncingRequest {
            return GetSyncingRequest.deserialize(bytes);
        }


static fromObject(data: {
            syncing?: boolean;
        }) {
            const message = new GetSyncingResponse({});
            if (data.syncing != null) {
                message.syncing = data.syncing;
            }
            return message;
        }


toObject() {
            const data: {
                syncing?: boolean;
            } = {};
            if (this.syncing != null) {
                data.syncing = this.syncing;
            }
            return data;
        }


serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
            const writer = w || new pb_1.BinaryWriter();
            if (this.syncing !== undefined)
                writer.writeBool(1, this.syncing);
            if (!w)
                return writer.getResultBuffer();
        }


static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetSyncingResponse {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetSyncingResponse();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        message.syncing = reader.readBool();
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }


static deserializeBinary(bytes: Uint8Array): GetSyncingResponse {
            return GetSyncingResponse.deserialize(bytes);
        }


static fromObject(data: {}) {
            const message = new GetNodeInfoRequest({});
            return message;
        }


static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetNodeInfoRequest {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetNodeInfoRequest();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    default: reader.skipField();
                }
            }
            return message;
        }


static deserializeBinary(bytes: Uint8Array): GetNodeInfoRequest {
            return GetNodeInfoRequest.deserialize(bytes);
        }


static fromObject(data: {
            default_node_info?: ReturnType<typeof dependency_3.tendermint.p2p.DefaultNodeInfo.prototype.toObject>;
            application_version?: ReturnType<typeof VersionInfo.prototype.toObject>;
        }) {
            const message = new GetNodeInfoResponse({});
            if (data.default_node_info != null) {
                message.default_node_info = dependency_3.tendermint.p2p.DefaultNodeInfo.fromObject(data.default_node_info);
            }
            if (data.application_version != null) {
                message.application_version = VersionInfo.fromObject(data.application_version);
            }
            return message;
        }


toObject() {
            const data: {
                default_node_info?: ReturnType<typeof dependency_3.tendermint.p2p.DefaultNodeInfo.prototype.toObject>;
                application_version?: ReturnType<typeof VersionInfo.prototype.toObject>;
            } = {};
            if (this.default_node_info != null) {
                data.default_node_info = this.default_node_info.toObject();
            }
            if (this.application_version != null) {
                data.application_version = this.application_version.toObject();
            }
            return data;
        }


serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
            const writer = w || new pb_1.BinaryWriter();
            if (this.default_node_info !== undefined)
                writer.writeMessage(1, this.default_node_info, () => this.default_node_info.serialize(writer));
            if (this.application_version !== undefined)
                writer.writeMessage(2, this.application_version, () => this.application_version.serialize(writer));
            if (!w)
                return writer.getResultBuffer();
        }


static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetNodeInfoResponse {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetNodeInfoResponse();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        reader.readMessage(message.default_node_info, () => message.default_node_info = dependency_3.tendermint.p2p.DefaultNodeInfo.deserialize(reader));
                        break;
                    case 2:
                        reader.readMessage(message.application_version, () => message.application_version = VersionInfo.deserialize(reader));
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }


static deserializeBinary(bytes: Uint8Array): GetNodeInfoResponse {
            return GetNodeInfoResponse.deserialize(bytes);
        }


static fromObject(data: {
            name?: string;
            app_name?: string;
            version?: string;
            git_commit?: string;
            build_tags?: string;
            go_version?: string;
            build_deps?: ReturnType<typeof Module.prototype.toObject>[];
            cosmos_sdk_version?: string;
        }) {
            const message = new VersionInfo({});
            if (data.name != null) {
                message.name = data.name;
            }
            if (data.app_name != null) {
                message.app_name = data.app_name;
            }
            if (data.version != null) {
                message.version = data.version;
            }
            if (data.git_commit != null) {
                message.git_commit = data.git_commit;
            }
            if (data.build_tags != null) {
                message.build_tags = data.build_tags;
            }
            if (data.go_version != null) {
                message.go_version = data.go_version;
            }
            if (data.build_deps != null) {
                message.build_deps = data.build_deps.map(item => Module.fromObject(item));
            }
            if (data.cosmos_sdk_version != null) {
                message.cosmos_sdk_version = data.cosmos_sdk_version;
            }
            return message;
        }


toObject() {
            const data: {
                name?: string;
                app_name?: string;
                version?: string;
                git_commit?: string;
                build_tags?: string;
                go_version?: string;
                build_deps?: ReturnType<typeof Module.prototype.toObject>[];
                cosmos_sdk_version?: string;
            } = {};
            if (this.name != null) {
                data.name = this.name;
            }
            if (this.app_name != null) {
                data.app_name = this.app_name;
            }
            if (this.version != null) {
                data.version = this.version;
            }
            if (this.git_commit != null) {
                data.git_commit = this.git_commit;
            }
            if (this.build_tags != null) {
                data.build_tags = this.build_tags;
            }
            if (this.go_version != null) {
                data.go_version = this.go_version;
            }
            if (this.build_deps != null) {
                data.build_deps = this.build_deps.map((item: Module) => item.toObject());
            }
            if (this.cosmos_sdk_version != null) {
                data.cosmos_sdk_version = this.cosmos_sdk_version;
            }
            return data;
        }


serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
            const writer = w || new pb_1.BinaryWriter();
            if (typeof this.name === "string" && this.name.length)
                writer.writeString(1, this.name);
            if (typeof this.app_name === "string" && this.app_name.length)
                writer.writeString(2, this.app_name);
            if (typeof this.version === "string" && this.version.length)
                writer.writeString(3, this.version);
            if (typeof this.git_commit === "string" && this.git_commit.length)
                writer.writeString(4, this.git_commit);
            if (typeof this.build_tags === "string" && this.build_tags.length)
                writer.writeString(5, this.build_tags);
            if (typeof this.go_version === "string" && this.go_version.length)
                writer.writeString(6, this.go_version);
            if (this.build_deps !== undefined)
                writer.writeRepeatedMessage(7, this.build_deps, (item: Module) => item.serialize(writer));
            if (typeof this.cosmos_sdk_version === "string" && this.cosmos_sdk_version.length)
                writer.writeString(8, this.cosmos_sdk_version);
            if (!w)
                return writer.getResultBuffer();
        }


static deserialize(bytes: Uint8Array | pb_1.BinaryReader): VersionInfo {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new VersionInfo();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        message.name = reader.readString();
                        break;
                    case 2:
                        message.app_name = reader.readString();
                        break;
                    case 3:
                        message.version = reader.readString();
                        break;
                    case 4:
                        message.git_commit = reader.readString();
                        break;
                    case 5:
                        message.build_tags = reader.readString();
                        break;
                    case 6:
                        message.go_version = reader.readString();
                        break;
                    case 7:
                        reader.readMessage(message.build_deps, () => pb_1.Message.addToRepeatedWrapperField(message, 7, Module.deserialize(reader), Module));
                        break;
                    case 8:
                        message.cosmos_sdk_version = reader.readString();
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }


static deserializeBinary(bytes: Uint8Array): VersionInfo {
            return VersionInfo.deserialize(bytes);
        }


static fromObject(data: {
            path?: string;
            version?: string;
            sum?: string;
        }) {
            const message = new Module({});
            if (data.path != null) {
                message.path = data.path;
            }
            if (data.version != null) {
                message.version = data.version;
            }
            if (data.sum != null) {
                message.sum = data.sum;
            }
            return message;
        }


toObject() {
            const data: {
                path?: string;
                version?: string;
                sum?: string;
            } = {};
            if (this.path != null) {
                data.path = this.path;
            }
            if (this.version != null) {
                data.version = this.version;
            }
            if (this.sum != null) {
                data.sum = this.sum;
            }
            return data;
        }


serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
            const writer = w || new pb_1.BinaryWriter();
            if (typeof this.path === "string" && this.path.length)
                writer.writeString(1, this.path);
            if (typeof this.version === "string" && this.version.length)
                writer.writeString(2, this.version);
            if (typeof this.sum === "string" && this.sum.length)
                writer.writeString(3, this.sum);
            if (!w)
                return writer.getResultBuffer();
        }


static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Module {
            const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Module();
            while (reader.nextField()) {
                if (reader.isEndGroup())
                    break;
                switch (reader.getFieldNumber()) {
                    case 1:
                        message.path = reader.readString();
                        break;
                    case 2:
                        message.version = reader.readString();
                        break;
                    case 3:
                        message.sum = reader.readString();
                        break;
                    default: reader.skipField();
                }
            }
            return message;
        }


static deserializeBinary(bytes: Uint8Array): Module {
            return Module.deserialize(bytes);
        }


@Component({
  selector: 'ngx-exercise-wizard-step3',
  templateUrl: 'exercise-wizard-step3.component.html',
  styleUrls: ['./exercise-wizard-step3.component.scss'],
})
export class ExerciseWizardStep3Component extends DoWizardStep {

  public skillData = [
    {
      name: 'Java',
      id: 'java',
      selected: false,
      disabled: false,
    },
    {
      name: 'PHP',
      id: 'php',
      selected: false,
      disabled: false,
    },
    {
      name: 'Angular',
      id: 'angular',
      selected: false,
      disabled: false,
    },
    {
      name: 'C++',
      id: 'c++',
      selected: false,
      disabled: false,
    },
    {
      name: 'C#',
      id: 'C#',
      selected: false,
      disabled: false,
    },
  ];

  constructor(
    public injector: Injector) {
    super(injector, 'step3', {
      skill: [{
        value: null,
        disabled: false,
      }, Validators.required],
      others: [{
        value: null,
        disabled: false,
      }],
    });
  }

  validateRoute() {
    if (!this.formGroup.controls['step2']?.valid) {
      this.router.navigate(['/exercise/wizard/step-2']);
    }
  }

}


validateRoute() {
    if (!this.formGroup.controls['step2']?.valid) {
      this.router.navigate(['/exercise/wizard/step-2']);
    }
  }


(user: UserInfo) => {
            if (user) {
                this.fetchHistoryMessages();
            }
        }


(msg: Message) => {
            if (msg.type == SessionType.GROUP && (<GroupTipMessage>msg).tipType == TipType.NOTICE) {
                //避免接口加载的消息跟websocket的有重复
                if (!~(this.messages || []).findIndex((message: Message) => {
                    return message.msgId == msg.msgId;
                })) {
                    this.addMessage(msg)
                    setTimeout(() => {
                        this.launchNotice()
                    });
                }
            }
        }


(message: Message) => {
                    return message.msgId == msg.msgId;
                }


() => {
                        this.launchNotice()
                    }


(msgs: Message[]) => {
            //当小于一定数量表示为空
            if (msgs.length == 0) {
                // if (this.messages.length > 0) {
                //     this.toastService.info("没有更多历史记录");
                // }
                return;
            }

            msgs = msgs.reverse();

            msgs.forEach((msg, index) => {
                let provMessage = null;
                if (index != 0) {
                    provMessage = msgs[index - 1];
                }
                msg.displayTime = this.timePipe.transform(msg.time);
            });

            this.messages = [].concat(msgs, this.messages);
            setTimeout(() => {
                this.launchNotice();
            });

        }


(msg, index) => {
                let provMessage = null;
                if (index != 0) {
                    provMessage = msgs[index - 1];
                }
                msg.displayTime = this.timePipe.transform(msg.time);
            }


() => {
                this.launchNotice();
            }


(response) => {
            this.toastService.error(response.error.msg)
        }


@Injectable()
export class ChatNoticeService {
    private noticeSubject: BehaviorSubject<Message[]>;
    private messages: Message[];

    constructor(
        private roomService: RoomService,
        private chatMessageService: ChatMessageService,
        private toastService: ToastService,
        private timePipe: IMTimePipe,
        private userService: UserService,
        private im: IMService
    ) {
        this.noticeSubject = new BehaviorSubject([]);
        window['noticeSubject'] = this.noticeSubject;
        this.userService.user.subscribe((user: UserInfo) => {
            if (user) {
                this.fetchHistoryMessages();
            }
        });

        this.im.msgNotify.subscribe((msg: Message) => {
            if (msg.type == SessionType.GROUP && (<GroupTipMessage>msg).tipType == TipType.NOTICE) {
                //避免接口加载的消息跟websocket的有重复
                if (!~(this.messages || []).findIndex((message: Message) => {
                    return message.msgId == msg.msgId;
                })) {
                    this.addMessage(msg)
                    setTimeout(() => {
                        this.launchNotice()
                    });
                }
            }
        })
    }

    launchNotice() {
        this.noticeSubject.next(this.messages);
    }

    fetchHistoryMessages(switchBottom?: boolean) {
        let sessionType = SessionType.GROUP,
        to = this.roomService.room.getValue().roomNo,
        type = TipType.NOTICE,
        topId: string = null

        // if (this.messages.length > 0) {
        //     let message = this.messages.find((msg: Message, index: number, message: any[]) => {
        //         return !!msg.msgId;
        //     });
        //     if (message != null) {
        //         topId = message.msgId;
        //     }
        // }

        this.chatMessageService.getTipHistory(sessionType, to, type, topId).subscribe((msgs: Message[]) => {
            //当小于一定数量表示为空
            if (msgs.length == 0) {
                // if (this.messages.length > 0) {
                //     this.toastService.info("没有更多历史记录");
                // }
                return;
            }

            msgs = msgs.reverse();

            msgs.forEach((msg, index) => {
                let provMessage = null;
                if (index != 0) {
                    provMessage = msgs[index - 1];
                }
                msg.displayTime = this.timePipe.transform(msg.time);
            });

            this.messages = [].concat(msgs, this.messages);
            setTimeout(() => {
                this.launchNotice();
            });

        }, (response) => {
            this.toastService.error(response.error.msg)
        })
    }

    addMessage(msg: Message) {
        msg.displayTime = this.timePipe.transform(msg.time);
        this.messages.push(msg);
        //强行滚动
        // this.toBottom(true);
    }

}


launchNotice() {
        this.noticeSubject.next(this.messages);
    }


fetchHistoryMessages(switchBottom?: boolean) {
        let sessionType = SessionType.GROUP,
        to = this.roomService.room.getValue().roomNo,
        type = TipType.NOTICE,
        topId: string = null

        // if (this.messages.length > 0) {
        //     let message = this.messages.find((msg: Message, index: number, message: any[]) => {
        //         return !!msg.msgId;
        //     });
        //     if (message != null) {
        //         topId = message.msgId;
        //     }
        // }

        this.chatMessageService.getTipHistory(sessionType, to, type, topId).subscribe((msgs: Message[]) => {
            //当小于一定数量表示为空
            if (msgs.length == 0) {
                // if (this.messages.length > 0) {
                //     this.toastService.info("没有更多历史记录");
                // }
                return;
            }

            msgs = msgs.reverse();

            msgs.forEach((msg, index) => {
                let provMessage = null;
                if (index != 0) {
                    provMessage = msgs[index - 1];
                }
                msg.displayTime = this.timePipe.transform(msg.time);
            });

            this.messages = [].concat(msgs, this.messages);
            setTimeout(() => {
                this.launchNotice();
            });

        }, (response) => {
            this.toastService.error(response.error.msg)
        })
    }


addMessage(msg: Message) {
        msg.displayTime = this.timePipe.transform(msg.time);
        this.messages.push(msg);
        //强行滚动
        // this.toBottom(true);
    }


/**
 * Serializer. Converts a JSON serializable tree to an object instance.
 *
 * @param type
 * @param src
 * @returns {any}
 */
export declare function deserialize(type: any, src: any): any;


/**
 * Deserializer function. Converts an object to a JSON serializable graph.
 *
 * @param src
 * @returns {{[p: string]: any}}
 */
export declare function serialize(src: any): {
    [key: string]: any;
};


/**
 * Array scheme type
 * The array function will apply a scheme to all of its children.
 *
 * Example usage:
 * ```
 * class TestClass {
 *  @serializable(array())
 *  public children: string[];
 * }
 * ```
 *
 * @param {Scheme} childScheme
 * @returns {Scheme}
 */
export declare function array(childScheme?: Scheme): Scheme;


/**
 * Object scheme type
 * The object function will serialize a nested object
 *
 * Example usage:
 * ```
 * class A { name: string }
 * class B {
 *   @serializable(object(A))
 *   public nestedObject: A;
 * }
 * ```
 *
 * @param type
 * @returns {Scheme}
 */
export declare function object(type: any): Scheme;


/**
 * Custom scheme type
 * The custom function allows you to create your own serializer functionality. Used in polymorph types and arrays.
 *
 * Example usage:
 * ```
 * class A { public type = 'a'; }
 * class B { public type = 'b'; }
 * class TestClass {
 *  @serializable(custom(
 *      (v:any)=>v,
 *      (v:any) => deserialize({
 *          'a':A,
 *          'b':B
 *      }[v.type],v)
 *  ))
 *  public test: A|B;
 * }
 * ```
 *
 * @param {(v: any) => any} serializer
 * @param {(v: any) => any} deserializer
 * @returns {Scheme}
 */
export declare function custom(serializer: (v: any) => any, deserializer: (v: any) => any): Scheme;


/**
 * Decorator function. This is the only function to decorate your typescript classes with; it servers as both a class
 * decorator and a property decorator.
 *
 * @param {DescriptionSettings} settings
 * @returns {any}
 */
export declare function serializable(settings?: DescriptionSettings): any;


/**
 * postDeserialize decorator. If you are using an AOT build of your project, the class annotation for the
 * serializer cannot be used because functions are not allowed in the class decorator.
 * Therefore, you should create a *static member function* for postDeserialization and annotate it with this function.
 *
 * @returns {any}
 */
export declare function postDeserialize(): any;


/**
 * A scheme is in the context of our serializer defined as a pair of a serializer and a deserializer.
 */
export declare class Scheme {
    serializer: (v: any) => any;
    deserializer: (v: any) => any;
}


/**
 * Property decorator storage.
 *
 * If you ever want to add a class decorator option, you can do so here. Be sure to also add your option to the
 * DescriptionSettings interface defined above, for autocompletion in your favourite IDE.
 */
export declare class PropertyDescription {
    scheme: Scheme;
    name: string;
    serializedName: string;
    constructor(propertyName: string, settings?: DescriptionSettings);
    /**
     * Add new property decorator settings here.
     *
     * @param {DescriptionSettings} settings
     * @returns {PropertyDescription}
     */
    setDecoration(settings: DescriptionSettings): PropertyDescription;
}


/**
 * Class decorator storage.
 *
 * If you ever want to add a class decorator option, you can do so here. Be sure to also add your option to the
 * DescriptionSettings interface defined above, for autocompletion in your favourite IDE.
 */
export declare class ClassDescription {
    postDeserialize: Function;
    properties: Map<string, PropertyDescription>;
    /**
     * Store decoration
     * @param {DescriptionSettings} settings
     * @returns {ClassDescription}
     */
    setDecoration(settings: DescriptionSettings): ClassDescription;
}


/**
 * Main decorator storage. This class will store and provide access to all decorators. An instance is instantiated
 * below.
 */
export declare class Store {
    private map;
    /**
     * Override Map getter. When no class description is found, we want to instantiate and return one. Class decorators
     * are optional, and this ensures we will get a default one when requested
     *
     * @param key
     * @returns {ClassDescription}
     */
    get(key: any): ClassDescription;
    /**
     * Setter
     * @param key
     * @param {ClassDescription} value
     */
    set(key: any, value: ClassDescription): void;
}


/**
 * This interface should define all decorator parameters you can supply to the @serializable decorator.
 */
export interface DescriptionSettings {
    scheme?: Scheme;
    serializedName?: string;
    postDeserialize?: Function;
}


/**
     * Add new property decorator settings here.
     *
     * @param {DescriptionSettings} settings
     * @returns {PropertyDescription}
     */
setDecoration(settings: DescriptionSettings): PropertyDescription;


/**
     * Store decoration
     * @param {DescriptionSettings} settings
     * @returns {ClassDescription}
     */
setDecoration(settings: DescriptionSettings): ClassDescription;


/**
     * Override Map getter. When no class description is found, we want to instantiate and return one. Class decorators
     * are optional, and this ensures we will get a default one when requested
     *
     * @param key
     * @returns {ClassDescription}
     */
get(key: any): ClassDescription;


/**
     * Setter
     * @param key
     * @param {ClassDescription} value
     */
set(key: any, value: ClassDescription): void;


function promoteStringToFMEvents<
  K extends string & NotString<K> & Extractable<FmEvents, K>
>(k: K): Extract<FmEvents, K> {
  return k;
}


export interface IFmDispatchOptions {
  silent?: boolean;
  silentAcceptance?: boolean;
}


export const enum IFmCrudOperations {
  add = "add",
  update = "update",
  remove = "remove"
}


export type Extractable<T, U> = T extends U ? any : never;


export type NotString<T> = string extends T ? never : any;


export type IFmCrudOperation = "add" | "update" | "remove";


export type IFMEventName<T> = string & NotString<T> & Extractable<FmEvents, T>;


(placement) =>
        PrismaPetPlacementMapper.toPrismaPetPlacement(placement)


(placement) =>
        PrismaPetPlacementMapper.toEntityPetPlacement(placement)


type PrismaPlacement = Prisma.PlacementGetPayload<null>;


type PrismaPlacementWithPets = Prisma.PlacementGetPayload<{
  include: { pet_placements: true };
}>;


async toPrismaPlacement(
    placement: PlacementEntity,
  ): Promise<PrismaPlacement> {
    return {
      id_placement: placement.id,
      name: placement.name,
      created_at: placement.createdAt,
      updated_at: placement.updatedAt,
    };
  }


async toPrismaPlacementWithPets(
    placement: PlacementEntity,
  ): Promise<PrismaPlacementWithPets> {
    const prismaPlacement = await this.toPrismaPlacement(placement);

    const prismaPetPlacements = await Promise.all(
      placement.petPlacements.map((placement) =>
        PrismaPetPlacementMapper.toPrismaPetPlacement(placement),
      ),
    );

    return {
      ...prismaPlacement,
      pet_placements: prismaPetPlacements,
    };
  }


async toEntityPlacement(
    placement: PrismaPlacement,
  ): Promise<PlacementEntity> {
    return PlacementEntity.new({
      id: placement.id_placement,
      name: placement.name,
      createdAt: placement.created_at,
      updatedAt: placement.updated_at,
    });
  }


async toEntityPlacementWithPets(
    placement: PrismaPlacementWithPets,
  ): Promise<PlacementEntity> {
    const placementEntity = await this.toEntityPlacement(placement);

    const petPlacementEntities = await Promise.all(
      placement.pet_placements.map((placement) =>
        PrismaPetPlacementMapper.toEntityPetPlacement(placement),
      ),
    );

    return PlacementEntity.new({
      ...placementEntity,
      petPlacements: petPlacementEntities,
    });
  }


res => {
      if (res.code !== 0) {
        message.error(res.msg);
        return false;
      }
      this.setState({
        data: res.data,
      });
      return true;
    }


(params: any) => {
    const { location: { query: { id } } } = this.props;
    return request(apiUrl+"/update" , {
      method: 'POST',
      data: {
        ...params,
        id:parseInt(id),
      },
    });
  }


export default class Base extends React.Component {
  state = {
    data: null,
  };

  async componentDidMount() {
    const { location: { query: { id } } } = this.props;
    this.reqInfo(id).then(res => {
      if (res.code !== 0) {
        message.error(res.msg);
        return false;
      }
      this.setState({
        data: res.data,
      });
      return true;
    });
  }

  reqInfo(id) {
    return request(apiUrl+"/info?id="+id);
  }

  reqUpdate = (params: any) => {
    const { location: { query: { id } } } = this.props;
    return request(apiUrl+"/update" , {
      method: 'POST',
      data: {
        ...params,
        id:parseInt(id),
      },
    });
  }

  render() {
    const { data } = this.state;
    return (
      <PageHeaderWrapper>
        <Card>
          { data && <FormConfig  initialValues={data} request={this.reqUpdate} />}


async componentDidMount() {
    const { location: { query: { id } } } = this.props;
    this.reqInfo(id).then(res => {
      if (res.code !== 0) {
        message.error(res.msg);
        return false;
      }
      this.setState({
        data: res.data,
      });
      return true;
    });
  }


reqInfo(id) {
    return request(apiUrl+"/info?id="+id);
  }


render() {
    const { data } = this.state;
    return (
      <PageHeaderWrapper>
        <Card>
          { data && <FormConfig  initialValues={data} request={this.reqUpdate} />}


export interface FrownOutlinedIconType extends FunctionalComponent<AntdIconProps> {
    displayName: string;
}


({ size, fill, ...props }) => (
  <svg width={size}


export interface ITheme {
    mode: ThemeMode;
}


export interface IPalette {
    title: string,
    primary: PaletteColor;
    secondary: PaletteColor;
    appBar: string;
    background?: TypeBackground;
}


export type ThemeMode = "dark" | "light";


async (t) => {
    const key = (await openpgp.key.readArmored(rsa512BitsKey)).keys[0];
    const error = t.throws(() => checkKeyStrength(key));
    t.is(error.message, 'Keys shorter than 2047 bits are considered unsafe');
}


() => checkKeyStrength(key)


async (t) => {
    const key = (await openpgp.key.readArmored(eddsaElGamalSubkey)).keys[0];
    const error = t.throws(() => checkKeyStrength(key));
    t.is(error.message, 'elgamal keys are considered unsafe');
}


async (t) => {
    const key = (await openpgp.key.readArmored(ecc25519Key)).keys[0];
    checkKeyStrength(key);
    t.pass();
}


(multimediaPlugins: PluginRegistry) =>
  object({
    explanation: child('rows'),
    multimedia: child(multimediaPlugins[0].name),
    illustrating: boolean(true),
    width: number(50) //percent
  })


(
  multimediaPlugins: PluginRegistry
): StatefulPlugin<MultimediaExplanationState> => {
  return {
    Component: createMultimediaExplanationEditor(multimediaPlugins),
    state: multimediaExplanationState(multimediaPlugins),
    icon: createIcon(faPhotoVideo),
    title: 'Erklärung mit Multimedia-Inhalt',
    description:
      'Erstelle einen veranschaulichenden oder erklärenden Multimedia-Inhalt mit zugehöriger Erklärung.'
  }
}


export type MultimediaExplanationState = ReturnType<
  typeof multimediaExplanationState
>


export type PluginRegistry = {
  name: string
  title?: string
  icon?: React.ComponentType
  description?: string
}[]


export interface UserProfile {
  email: EmailAddress,
  boughtProductIds: Array<number>
}


export type EmailAddress = string;


() => {
  const fbqSpy = jest.fn();

  jest.spyOn(global.console, 'warn').mockImplementation(() => {});
  jest.spyOn(global.console, 'log').mockImplementation(() => {});

  beforeEach(() => {
    global.window.fbq = fbqSpy;
    jest.resetAllMocks();
  });

  it('Tracks an event for a specific pixel ID with data', () => {
    FacebookPixel.trackSingleCustom('7890', 'EventTitle', { id: '1' });

    expect(fbqSpy).toHaveBeenCalledTimes(1);
    expect(fbqSpy).toHaveBeenCalledWith(
      'trackSingleCustom',
      '7890',
      'EventTitle',
      { id: '1' }
    );
  });

  it('Tracks an event for a specific pixel ID without data', () => {
    FacebookPixel.trackSingleCustom('7890', 'EventTitle');

    expect(fbqSpy).toHaveBeenCalledTimes(1);
    expect(fbqSpy).toHaveBeenCalledWith(
      'trackSingleCustom',
      '7890',
      'EventTitle',
      undefined
    );
  });
}


() => {
    global.window.fbq = fbqSpy;
    jest.resetAllMocks();
  }


() => {
    FacebookPixel.trackSingleCustom('7890', 'EventTitle', { id: '1' });

    expect(fbqSpy).toHaveBeenCalledTimes(1);
    expect(fbqSpy).toHaveBeenCalledWith(
      'trackSingleCustom',
      '7890',
      'EventTitle',
      { id: '1' }
    );
  }


() => {
    FacebookPixel.trackSingleCustom('7890', 'EventTitle');

    expect(fbqSpy).toHaveBeenCalledTimes(1);
    expect(fbqSpy).toHaveBeenCalledWith(
      'trackSingleCustom',
      '7890',
      'EventTitle',
      undefined
    );
  }


({ saleArtwork }) => {
  const { lotState } = saleArtwork

  const bidCount = lotState?.bidCount
  const sellingPrice = saleArtwork?.currentBid?.display || saleArtwork?.estimate
  const tracking = useTracking()
  const { isSmallScreen } = useScreenDimensions()

  const displayBidCount = (): string | undefined => {
    if (isSmallScreen) {
      return
    }

    return `(${bidCount?.toString() + (bidCount === 1 ? " bid" : " bids")})`
  }

  const handleLotTap = () => {
    tracking.trackEvent({
      action: ActionType.tappedArtworkGroup,
      context_module: ContextModule.inboxActiveBids,
      context_screen_owner_type: OwnerType.inboxBids,
      destination_screen_owner_typ: OwnerType.artwork,
      destination_screen_owner_id: saleArtwork?.artwork?.internalID,
      destination_screen_owner_slug: saleArtwork?.artwork?.slug,
    })
    navigate(saleArtwork?.artwork?.href as string)
  }

  return (
    <TouchableOpacity style={{ marginHorizontal: 0, width: "100%" }}


(): string | undefined => {
    if (isSmallScreen) {
      return
    }

    return `(${bidCount?.toString() + (bidCount === 1 ? " bid" : " bids")})`
  }


() => {
    tracking.trackEvent({
      action: ActionType.tappedArtworkGroup,
      context_module: ContextModule.inboxActiveBids,
      context_screen_owner_type: OwnerType.inboxBids,
      destination_screen_owner_typ: OwnerType.artwork,
      destination_screen_owner_id: saleArtwork?.artwork?.internalID,
      destination_screen_owner_slug: saleArtwork?.artwork?.slug,
    })
    navigate(saleArtwork?.artwork?.href as string)
  }


interface WatchedLotProps {
  saleArtwork: WatchedLot_saleArtwork
}


@NgModule({
    bootstrap: [ AppComponent ],
    declarations: [
        AppComponent,
        NavMenuComponent,
        CounterComponent,
        GameComponent,
        HomeComponent
    ],
    imports: [
        UniversalModule, // Must be first import. This automatically imports BrowserModule, HttpModule, and JsonpModule too.
        RouterModule.forRoot([
            { path: '', redirectTo: 'home', pathMatch: 'full' },
            { path: 'home', component: HomeComponent },
            { path: 'counter', component: CounterComponent },
            { path: 'game', component: GameComponent },
            { path: '**', redirectTo: 'home' }
        ])
    ]
})
export class AppModule {
}


function getUserName(user: IUserSearchResultRow) {
    return (user.fullname || user.username || 'No Name').trim();
}


(name, callback) => {
        SearchUserResource.search({ name }).then(({ data }) => {
            callback(
                data.map((user) => ({
                    value: user.id,
                    label: <UserSelectOptionRow user={user} />,
                    name: getUserName(user),
                })


({ data }) => {
            callback(
                data.map((user) => ({
                    value: user.id,
                    label: <UserSelectOptionRow user={user} />,
                    name: getUserName(user),
                }


(user) => ({
                    value: user.id,
                    label: <UserSelectOptionRow user=


({
    onSelect,
    usePortalMenu = true,
    selectProps = {},
    clearAfterSelect = false,
}) => {
    const [searchText, setSearchText] = React.useState('');
    const asyncSelectProps: Partial<AsyncProps<any, false>> = {};
    const userReactSelectStyle = makeReactSelectStyle(usePortalMenu);
    if (usePortalMenu) {
        asyncSelectProps.menuPortalTarget = overlayRoot;
    }
    if (clearAfterSelect) {
        asyncSelectProps.value = null;
    }

    return (
        <AsyncSelect
            styles={userReactSelectStyle}
            placeholder={'username...'}
            onChange={(option: any)


({
    user,
}) => {
    const name = React.useMemo(() => getUserName(user), [user]);
    return (

            <UserAvatar tiny uid={user.id} />
            {name}


() => getUserName(user)


interface IUserSearchResultRow {
    id: number;
    username: string;
    fullname: string;
}


interface IUserSelectProps {
    onSelect: (uid: number, name: string) => any;
    usePortalMenu?: boolean;

    selectProps?: Partial<AsyncProps<any, false>>;

    // remove the selected user name after select
    clearAfterSelect?: boolean;
}


export declare type LogoProps = PropsOf<typeof chakra.svg>;


(data: OrderedShipment[]) => {
      return data;
    }


(data: Voyage[]) => {
      return data;
    }


(data: Voyage) => {
      return data;
    }


@Injectable({
  providedIn: 'root'
})
export class ShipmentsService {
  private shipmentBFFURL: string = "/api/shipments";
  private voyageBFFURL: string = "/api/voyages";

  constructor(private http: HttpClient) { }

  public getCurrentOrders(): Observable<OrderedShipment[]> {
    return this.http.get<OrderedShipment[]>(this.shipmentBFFURL)
    .pipe(map((data: OrderedShipment[]) => {
      return data;
    }));
  }

  public saveOrderShipment(os: OrderedShipment) {
    console.log('Save order shipment');
    let httpOptions = {
      headers: new HttpHeaders({ 'Content-Type': 'application/json' })
    };
    return this.http.put<OrderedShipment>(this.shipmentBFFURL+ "/" + os.orderID, OrderedShipment, httpOptions);
  }

  public getVoyages(): Observable<Voyage[]>{
    return this.http.get<Voyage[]>(this.voyageBFFURL)
    .pipe(map((data: Voyage[]) => {
      return data;
    }));
  }

  public getVoyage(voyageID: string): Observable<Voyage>{
    return this.http.get<Voyage>(this.voyageBFFURL + "/" + voyageID )
    .pipe(map((data: Voyage) => {
      return data;
    }));
  }
}


public getCurrentOrders(): Observable<OrderedShipment[]> {
    return this.http.get<OrderedShipment[]>(this.shipmentBFFURL)
    .pipe(map((data: OrderedShipment[]) => {
      return data;
    }));
  }


public saveOrderShipment(os: OrderedShipment) {
    console.log('Save order shipment');
    let httpOptions = {
      headers: new HttpHeaders({ 'Content-Type': 'application/json' })
    };
    return this.http.put<OrderedShipment>(this.shipmentBFFURL+ "/" + os.orderID, OrderedShipment, httpOptions);
  }


public getVoyages(): Observable<Voyage[]>{
    return this.http.get<Voyage[]>(this.voyageBFFURL)
    .pipe(map((data: Voyage[]) => {
      return data;
    }));
  }


public getVoyage(voyageID: string): Observable<Voyage>{
    return this.http.get<Voyage>(this.voyageBFFURL + "/" + voyageID )
    .pipe(map((data: Voyage) => {
      return data;
    }));
  }


@Controller('fees-details')
export class FeesDetailsController {
    constructor(private readonly feesDetailsService: FeesDetailsService) {}

    @Post()
    create(@Body() createFeesDetailDto: CreateFeesDetailDto) {
        return this.feesDetailsService.create(createFeesDetailDto)
    }

    @Get()
    findAll() {
        return this.feesDetailsService.findAll()
    }

    @Get(':id')
    findOne(@Param('id') id: string) {
        return this.feesDetailsService.findOne(+id)
    }

    @Patch(':id')
    update(
        @Param('id') id: string,
        @Body() updateFeesDetailDto: UpdateFeesDetailDto
    ) {
        return this.feesDetailsService.update(+id, updateFeesDetailDto)
    }

    @Delete(':id')
    remove(@Param('id') id: string) {
        return this.feesDetailsService.remove(+id)
    }
}


@Post()
    create(@Body() createFeesDetailDto: CreateFeesDetailDto) {
        return this.feesDetailsService.create(createFeesDetailDto)
    }


@Get()
    findAll() {
        return this.feesDetailsService.findAll()
    }


@Get(':id')
    findOne(@Param('id') id: string) {
        return this.feesDetailsService.findOne(+id)
    }


@Patch(':id')
    update(
        @Param('id') id: string,
        @Body() updateFeesDetailDto: UpdateFeesDetailDto
    ) {
        return this.feesDetailsService.update(+id, updateFeesDetailDto)
    }


@Delete(':id')
    remove(@Param('id') id: string) {
        return this.feesDetailsService.remove(+id)
    }


export interface HealthKitPermissions {
    permissions: {
      read: string[];
      write: string[];
    };
  }


export interface MindfulSessionData {
    startDate?: Date;
    endDate?: Date;
    limit?: number;
  }


export interface SampleOptions {
    startDate: string;
    endDate?: string;
    ascending?: boolean;
    limit?: number;
  }


export interface StartEndDateOptions {
    startDate: string;
    endDate?: string;
  }


export interface DateUnitQueryOptions {
    unit?: string;
    startDate: string;
    endDate?: string;
    ascending?: boolean;
    limit?: number;
  }


export interface DistanceOptions {
    unit?: string;
    date?: string;
  }


export interface SampleQuery {
    startDate: string;
    endDate: string;
    type: SampleQueryOptionType;
  }


export interface UnitOnlyOptions {
    unit: string;
  }


export interface Date {
    startDate: string;
    endDate: string;
  }


export interface Value {
    value: number;
  }


export interface ValueDate {
    value: number;
    startDate: string;
    endDate: string;
  }


export interface DistanceSaveOptions {
    unit: DistanceUnit;
    value: number;
    startDate: string;
    endDate: string;
  }


export interface WorkoutOptions {
    type: Activities;
    startDate: string;
    endDate: string;
    duration?: number;
    energyBurned?: number;
    energyBurnedUnit?: EnergyUnit;
    totalDistance: number;
    totalDistanceUnit: DistanceUnit;
  }


export interface AppleHealthKit {
    authorizationStatusForType(type: string): Promise<string>;

    isAvailable(callback: (error: Object, results: boolean) => void): void;

    initHealthKit(
      permissions: HealthKitPermissions,
      callback: (error: string, result: Object) => void
    ): void;

    initStepCountObserver(
      options: Object,
      callback: (error: string, result: Object) => void
    ): void;

    getActiveEnergyBurned(
      options: StartEndDateOptions,
      callback: (error: Object, resutls: Object) => void
    ): void;

    getBasalEnergyBurned(
      options: StartEndDateOptions,
      callback: (error: Object, results: Object) => void
    ): void;

    getBiologicalSex(
      options: Object,
      callback: (error: string, result: Object) => void
    ): void;

    getBloodGlucoseSamples(
      options: DateUnitQueryOptions,
      callback: (error: Object, results: Array<Object>) => void
    ): void;

    getBloodPressureSamples(
      options: DateUnitQueryOptions,
      callback: (error: Object, results: Array<Object>) => void
    ): void;

    getBodyTemperatureSamples(
      options: DateUnitQueryOptions,
      callback: (error: Object, results: Array<Object>) => void
    ): void;

    getDateOfBirth(
      options: Object,
      callback: (error: string, result: Object) => void
    ): void;

    getWeightSamples(
      options: Object,
      callback: (error: string, result: Object) => void
    ): void;

    getHeightSamples(
      options: DateUnitQueryOptions,
      callback: (error: Object, results: Array<ValueDate>) => void
    ): void;

    getLatestBmi(
      options: null,
      callback: (error: string, result: ValueDate) => void
    ): void;

    getLatestBodyFatPercentage(
      options: null,
      callback: (error: Object, results: ValueDate) => void
    ): void;

    getBodyFatPercentageSamples(
      options: SampleOptions,
      callback: (error: Object, results: Array<ValueDate>) => void
    ): void;

    getLeanBodyMassSamples(
      options: DateUnitQueryOptions,
      callback: (err: Object, results: Array<ValueDate>) => void
    ): void;

    saveBmi(
      options: Value,
      callback: (error: string, result: Object) => void
    ): void;

    saveBodyFatPercentage(
      options: Value,
      callback: (error: Object, result: Object) => void
    ): void;

    saveLeanBodyMass(
      options: Value,
      callbacK: (error: Object, result: Object) => void
    ): void;

    saveWeight(
      options: Value,
      callback: (error: string, result: Object) => void
    ): void;

    saveHeight(
      options: Value,
      callback: (error: string, result: Object) => void
    ): void;

    saveMindfulSession(
      options: Date,
      callback: (error: Object, result: Object) => void
    ): void;

    saveSteps(
      options: ValueDate,
      callback: (error: Object, result: Object) => void
    ): void;

    saveDistanceWalkingRunning(
      options: DistanceSaveOptions,
      callback: (err: Object, result: Object) => void
    ): void;

    saveDistanceCycling(
      options: DistanceSaveOptions,
      callback: (err: Object, results: Object) => void
    ): void;

    saveActiveEnergyBurned(
      options: ValueDate,
      callback: (err: Object, result: Object) => void
    ): void;

    saveWorkout(
      options: WorkoutOptions,
      callback: (err: Object, result: Object) => void
    ): void;

    getDateOfBirth(
      options: any,
      callback: (error: Object, results: HealthDateOfBirth) => void
    ): void;

    getLatestHeight(
      options: null,
      callback: (err: string, results: ValueDate) => void
    ): void;

    getLatestWeight(
      options: UnitOnlyOptions,
      callback: (err: string, results: ValueDate) => void
    ): void;

    getLatestLeanBodyMass(
      options: null,
      callback: (err: Object, results: ValueDate) => void
    ): void;

    getMindfulSession(
      options: MindfulSessionData,
      callback: (err: string, results: Date) => void
    ): void;

    getStepCount(
      options?: Object | undefined,
      callback: (err: Object, results: Object) => void
    ): void;

    getSleepSamples(
      options: Object,
      callback: (err: Object, results: Array<Object>) => void
    ): void;

    getSamples(
      options: SampleQuery,
      callback: (err: Object, results: Array<Object>) => void
    ): void;

    getDailyDistanceWalkingRunningSamples(
      options: SampleOptions,
      callback: (error: string, results: Array<Object>) => void
    ): void;

    getDailyDistanceCyclingSamples(
      options: SampleOptions,
      callback: (error: string, results: Array<Object>) => void
    ): void;

    getDailyFlightsClimbedSamples(
      options: SampleOptions,
      callback: (error: string, results: Array<Object>) => void
    ): void;

    getStepCountSamples(
      options: StartEndDateOptions,
      callback: (error: string, results: Array<Object>) => void
    ): void;

    getDistanceCycling(
      options: DistanceOptions,
      callback: (error: string, results: ValueDate) => void
    ): void;

    getDistanceWalkingRunning(
      options: DistanceOptions,
      callback: (error: string, results: ValueDate) => void
    ): void;

    getFlightsClimbed(
      options: Object,
      callback: (error: Object, results: ValueDate) => void
    ): void;

    getHeartRateSamples(
      options: DateUnitQueryOptions,
      callback: (error: Object, results: Array<ValueDate>) => void
    ): void;

    getRespiratoryRateSamples(
      options: DateUnitQueryOptions,
      callback: (error: Object, results: Array<Object>) => void
    ): void;

    Constants: {
      Permissions: Permissions;
      Units: HealthUnit;
    };
  }


export interface HealthDateOfBirth {
    value: string;
    age: number;
  }


export interface HealthValue {
    value: number;
    startDate: string;
    endDate: string;
  }


export interface HealthUnitOptions {
    unit: HealthUnit;
  }


export enum SampleQueryOptionType {
    Walking = 'Walking',
    StairClimbing = 'StairClimbing',
    Running = 'Running',
    Cycling = 'Cycling',
    Workout = 'Workout',
  }


export enum Permissions {
    ActiveEnergyBurned = 'ActiveEnergyBurned',
    AppleExerciseTime = 'AppleExerciseTime',
    BasalEnergyBurned = 'BasalEnergyBurned',
    BiologicalSex = 'BiologicalSex',
    BloodGlucose = 'BloodGlucose',
    BloodPressureDiastolic = 'BloodPressureDiastolic',
    BloodPressureSystolic = 'BloodPressureSystolic',
    BodyFatPercentage = 'BodyFatPercentage',
    BodyMass = 'BodyMass',
    BodyMassIndex = 'BodyMassIndex',
    BodyTemperature = 'BodyTemperature',
    DateOfBirth = 'DateOfBirth',
    Biotin = 'Biotin',
    Caffeine = 'Caffeine',
    Calcium = 'Calcium',
    Carbohydrates = 'Carbohydrates',
    Chloride = 'Chloride',
    Cholesterol = 'Cholesterol',
    Copper = 'Copper',
    EnergyConsumed = 'EnergyConsumed',
    FatMonounsaturated = 'FatMonounsaturated',
    FatPolyunsaturated = 'FatPolyunsaturated',
    FatSaturated = 'FatSaturated',
    FatTotal = 'FatTotal',
    Fiber = 'Fiber',
    Folate = 'Folate',
    Iodine = 'Iodine',
    Iron = 'Iron',
    Magnesium = 'Magnesium',
    Manganese = 'Manganese',
    Molybdenum = 'Molybdenum',
    Niacin = 'Niacin',
    PantothenicAcid = 'PantothenicAcid',
    Phosphorus = 'Phosphorus',
    Potassium = 'Potassium',
    Protein = 'Protein',
    Riboflavin = 'Riboflavin',
    Selenium = 'Selenium',
    Sodium = 'Sodium',
    Sugar = 'Sugar',
    Thiamin = 'Thiamin',
    VitaminA = 'VitaminA',
    VitaminB12 = 'VitaminB12',
    VitaminB6 = 'VitaminB6',
    VitaminC = 'VitaminC',
    VitaminD = 'VitaminD',
    VitaminE = 'VitaminE',
    VitaminK = 'VitaminK',
    Zinc = 'Zinc',
    Water = 'Water',
    DistanceCycling = 'DistanceCycling',
    DistanceSwimming = 'DistanceSwimming',
    DistanceWalkingRunning = 'DistanceWalkingRunning',
    FlightsClimbed = 'FlightsClimbed',
    HeartRate = 'HeartRate',
    Height = 'Height',
    LeanBodyMass = 'LeanBodyMass',
    MindfulSession = 'MindfulSession',
    NikeFuel = 'NikeFuel',
    RespiratoryRate = 'RespiratoryRate',
    SleepAnalysis = 'SleepAnalysis',
    StepCount = 'StepCount',
    Steps = 'Steps',
    Weight = 'Weight',
    Workout = 'Workout',
  }


export enum HealthUnit {
    bpm = 'bpm',
    calorie = 'calorie',
    kilocalorie = 'kilocalorie',
    smallCalorie = 'smallCalorie',
    largeCalorie = 'largeCalorie',
    celsius = 'celsius',
    count = 'count',
    day = 'day',
    fahrenheit = 'fahrenheit',
    foot = 'foot',
    gram = 'gram',
    hour = 'hour',
    inch = 'inch',
    joule = 'joule',
    meter = 'meter',
    mgPerdL = 'mgPerdL',
    mile = 'mile',
    minute = 'minute',
    mmhg = 'mmhg',
    mmolPerL = 'mmolPerL',
    percent = 'percent',
    pound = 'pound',
    second = 'second',
    yard = 'yard',
  }


export enum Activities {
    archery = 2,
    bowling = 7,
    fencing = 18,
    gymnastics = 22,
    trackAndField = 49,
    americanFootball = 1,
    australianFootball = 3,
    baseball = 5,
    basketball = 6,
    cricket = 10,
    discSports = 75,
    handball = 23,
    hockey = 25,
    lacrosse = 27,
    rugby = 36,
    soccer = 41,
    softball = 42,
    volleyball = 51,
    preparationAndRecovery = 33,
    flexibility = 62,
    walking = 52,
    running = 37,
    wheelchairWalkPace = 70,
    wheelchairRunPace = 71,
    cycling = 13,
    handCycling = 74,
    coreTraining = 59,
    elliptical = 16,
    functionalStrengthTraining = 20,
    traditionalStrengthTraining = 50,
    crossTraining = 11,
    mixedCardio = 73,
    highIntensityIntervalTraining = 63,
    jumpRope = 64,
    stairClimbing = 44,
    stairs = 68,
    stepTraining = 69,
    fitnessGaming = 76,
    barre = 58,
    dance = 14,
    yoga = 57,
    mindAndBody = 28,
    pilates = 66,
    badminton = 4,
    racquetball = 34,
    squash = 43,
    tableTennis = 47,
    tennis = 48,
    climbing = 9,
    equestrianSports = 17,
    fishing = 19,
    golf = 21,
    hiking = 24,
    hunting = 26,
    play = 32,
    crossCountrySkiing = 60,
    curling = 12,
    downhillSkiing = 61,
    snowSports = 40,
    snowboarding = 67,
    skatingSports = 39,
    paddleSports = 31,
    rowing = 35,
    sailing = 38,
    surfingSports = 45,
    swimming = 46,
    waterFitness = 53,
    waterPolo = 54,
    waterSports = 55,
    boxing = 8,
    kickboxing = 65,
    martialArts = 28,
    taiChi = 72,
    wrestling = 56,
    other = 3000,
  }


export type DistanceUnit = 'meter' | 'mile' | 'inch' | 'foot' | 'yard';


export type EnergyUnit =
    | 'calorie'
    | 'kilocalorie'
    | 'smallCalorie'
    | 'largeCalorie';


export function message(auth: AuthenticationData, data: MessageData, ws: WS) {
  switch (data.method) {
    case 'logs':
      return logs(auth, data, ws);

    case 'ping':
      return ping(auth, data, ws);

    case 'subscribe':
      return subscribe(auth, data, ws);
  }
}


(response: any) => response.data


(err) => { throw err }


(response: any) =>
    response.data


@Injectable({
  providedIn: 'root'
})
export class ProductService {
  private hostServer = environment.hostServer
  private host = this.hostServer + '/api/Products'

  constructor (private http: HttpClient) { }

  search (criteria: any) {
    console.log("criteria"+criteria)
    return this.http.get(this.hostServer + '/rest/products/search?q=' + criteria).pipe(map((response: any) => response.data), catchError((err) => { throw err }))
  }

  find (params: any) {
    return this.http.get(this.host + '/', { params: params }).pipe(map((response: any) => response.data), catchError((err) => { throw err }))
  }

  get (id: number) {
    return this.http.get(this.host + '/' + id + '?d=' + encodeURIComponent(new Date().toDateString())).pipe(map((response: any) =>
    response.data), catchError((err) => { throw err }))
  }

  put (id, params) {
    return this.http.put(this.host + '/' + id, params).pipe(map((response: any) => response.data), catchError((err) => { throw err }))
  }
}


search (criteria: any) {
    console.log("criteria"+criteria)
    return this.http.get(this.hostServer + '/rest/products/search?q=' + criteria).pipe(map((response: any) => response.data), catchError((err) => { throw err }))
  }


find (params: any) {
    return this.http.get(this.host + '/', { params: params }).pipe(map((response: any) => response.data), catchError((err) => { throw err }))
  }


get (id: number) {
    return this.http.get(this.host + '/' + id + '?d=' + encodeURIComponent(new Date().toDateString())).pipe(map((response: any) =>
    response.data), catchError((err) => { throw err }))
  }


put (id, params) {
    return this.http.put(this.host + '/' + id, params).pipe(map((response: any) => response.data), catchError((err) => { throw err }))
  }


/**
* A collection of transition rules.
*/
export class WorkflowRules {
    /**
    * The workflow conditions.
    */
    'conditions': Array<WorkflowTransitionRule>;
    /**
    * The workflow validators.
    */
    'validators': Array<WorkflowTransitionRule>;
    /**
    * The workflow post functions.
    */
    'postFunctions': Array<WorkflowTransitionRule>;

    static discriminator: string | undefined = undefined;

    static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
        {
            "name": "conditions",
            "baseName": "conditions",
            "type": "Array<WorkflowTransitionRule>"
        },
        {
            "name": "validators",
            "baseName": "validators",
            "type": "Array<WorkflowTransitionRule>"
        },
        {
            "name": "postFunctions",
            "baseName": "postFunctions",
            "type": "Array<WorkflowTransitionRule>"
        }    ];

    static getAttributeTypeMap() {
        return WorkflowRules.attributeTypeMap;
    }
}


static getAttributeTypeMap() {
        return WorkflowRules.attributeTypeMap;
    }


() => {
  let component: Reto1Component;
  let fixture: ComponentFixture<Reto1Component>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ Reto1Component ]
    })
    .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(Reto1Component);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });
}


() => {
    TestBed.configureTestingModule({
      declarations: [ Reto1Component ]
    })
    .compileComponents();
  }


() => {
    fixture = TestBed.createComponent(Reto1Component);
    component = fixture.componentInstance;
    fixture.detectChanges();
  }


() => {
  let control: FormControl;

  it('"" should equal to "null"', () => {
    control = new FormControl('');
    expect(minDate('2016-09-09')(control)).toBeNull();
  });

  it('"2016-09-08" should equal to "{minDate: true, reason: \'xxx\'}"', () => {
    control = new FormControl('2016-09-08');
    expect(minDate('2016-09-09')(control)).toEqual({ minDate: { value: '2016-09-09', control: undefined } });
  });

  it('"2016-09-10" should equal to "null"', () => {
    control = new FormControl('2016-09-10');
    expect(minDate('2016-09-09')(control)).toBeNull();
  });

  it('Date("2016-09-08)" should equal to "{minDate: true, reason: \'xxx\'}"', () => {
    control = new FormControl('2016-09-08');
    expect(minDate('2016-09-09')(control)).toEqual({ minDate: { value: '2016-09-09', control: undefined } });
  });

  it('"Date(2016-09-10)" should equal to "null"', () => {
    control = new FormControl('2016-09-10');
    expect(minDate('2016-09-09')(control)).toBeNull();
  });

  it('"Date(2016-09-10)" moment should equal to "null"', () => {
    control = new FormControl('2016-09-10');
    expect(minDate(moment('2016-09-09'))(control)).toBeNull();
  });

  it('() => Date("2016-09-08)" should equal to "{minDate: true, reason: \'xxx\'}"', () => {
    control = new FormControl('2016-09-08');
    expect(minDate('2016-09-09')(control)).toEqual({ minDate: { value: '2016-09-09', control: undefined } });
  });

  it('"() => Date(2016-09-10)" should equal to "null"', () => {
    control = new FormControl('2016-09-10');
    expect(minDate('2016-09-09')(control)).toBeNull();
  });

  it('Date object { year: 2017, month: 10, day: 11} should equal to "null"', () => {
    const obj = { year: 2017, month: 10, day: 11 };
    control = new FormControl('2017-11-01');
    expect(minDate(obj)(control)).toBeNull();
  });

  it('Date control object { year: 2017, month: 10, day: 11} should equal to "{minDate: true, reason: \'xxx\'}"', () => {
    const obj = new FormControl('2018-10-01');
    control = new FormControl({ year: 2017, month: 10, day: 11 });
    expect(minDate(obj)(control)).toEqual({ minDate: { value: obj.value, control: obj } });
  });

  it('Date control object { year: 2017, month: 10, day: 11} should equal to "null"', () => {
    const obj = { year: 2016, month: 10, day: 11 };
    control = new FormControl({ year: 2017, month: 10, day: 11 });
    expect(minDate(obj)(control)).toBeNull();
  });

  it('Date object { year: 2017, month: 11, day: 11} should equal to "{minDate: true, reason: \'xxx\'}"', () => {
    const obj = { year: 2017, month: 11, day: 11 };
    control = new FormControl('2017-10-01');
    expect(minDate(obj)(control)).toEqual({ minDate: { value: obj, control: undefined } });
  });

  it('Date object { year: 2017, month: 11, day: 11} moment should equal to "{minDate: true, reason: \'xxx\'}"', () => {
    const obj = { year: 2017, month: 11, day: 11 };
    control = new FormControl(moment('2017-10-01'));
    expect(minDate(obj)(control)).toEqual({ minDate: { value: obj, control: undefined } });
  });

  it('Date form control should equal to "null"', () => {
    const control2 = new FormControl('2017-01-01');
    control = new FormControl('2018-11-01');
    expect(minDate(control2)(control)).toBeNull();
  });

  it('Date form control should equal to "{minDate: true, reason: \'xxx\'}"', () => {
    const control2 = new FormControl('2018-01-01');
    control = new FormControl('2017-11-01');
    expect(minDate(control2)(control)).toEqual({ minDate: { value: control2.value, control: control2 }});
  });
}


() => {
    control = new FormControl('');
    expect(minDate('2016-09-09')(control)).toBeNull();
  }


() => {
    control = new FormControl('2016-09-08');
    expect(minDate('2016-09-09')(control)).toEqual({ minDate: { value: '2016-09-09', control: undefined } });
  }


() => {
    control = new FormControl('2016-09-10');
    expect(minDate('2016-09-09')(control)).toBeNull();
  }


() => {
    control = new FormControl('2016-09-10');
    expect(minDate(moment('2016-09-09'))(control)).toBeNull();
  }


() => {
    const obj = { year: 2017, month: 10, day: 11 };
    control = new FormControl('2017-11-01');
    expect(minDate(obj)(control)).toBeNull();
  }


() => {
    const obj = new FormControl('2018-10-01');
    control = new FormControl({ year: 2017, month: 10, day: 11 });
    expect(minDate(obj)(control)).toEqual({ minDate: { value: obj.value, control: obj } });
  }


() => {
    const obj = { year: 2016, month: 10, day: 11 };
    control = new FormControl({ year: 2017, month: 10, day: 11 });
    expect(minDate(obj)(control)).toBeNull();
  }


() => {
    const obj = { year: 2017, month: 11, day: 11 };
    control = new FormControl('2017-10-01');
    expect(minDate(obj)(control)).toEqual({ minDate: { value: obj, control: undefined } });
  }


() => {
    const obj = { year: 2017, month: 11, day: 11 };
    control = new FormControl(moment('2017-10-01'));
    expect(minDate(obj)(control)).toEqual({ minDate: { value: obj, control: undefined } });
  }


() => {
    const control2 = new FormControl('2017-01-01');
    control = new FormControl('2018-11-01');
    expect(minDate(control2)(control)).toBeNull();
  }


() => {
    const control2 = new FormControl('2018-01-01');
    control = new FormControl('2017-11-01');
    expect(minDate(control2)(control)).toEqual({ minDate: { value: control2.value, control: control2 }});
  }


@Component({
  selector: 'app-tab',
  templateUrl: './tab.component.html',
  styleUrls: ['./tab.component.scss']
})
export class TabComponent implements OnInit, Tab {

  @Input() title:string;
  @Output() onClick:EventEmitter<void> = new EventEmitter<void>();
  public isActive:boolean = false;

  constructor() {

  }

   ngOnInit() {
   }

   clickTabContent() {
     this.onClick.emit();
   }

}


ngOnInit() {
   }


clickTabContent() {
     this.onClick.emit();
   }


export class ScoreCalculator {
    public getAdditionalScore(speed: number): number {
        return speed * 10;
    }
}


public getAdditionalScore(speed: number): number {
        return speed * 10;
    }


(value) => value == null


(value, index) => value + currentScores[index]


export class Game {
    constructor(
        private render: () => void) {
    }

    state = GameState.Players;
    players: GamePlayer[] = [];
    turns: GameTurn[] = [];
    current: GameCurrentTurn;

    setPlayer(index: number, name: string) {
        let players = [
            new GamePlayer(),
            new GamePlayer(),
            new GamePlayer(),
            new GamePlayer()
        ];

        for (let i = 0; i < 4; i++) {
            players[i].name = index == i ? name : this.players.length > i ? this.players[i].name : null;
        }

        for (let i = 3; i >= 0; i--) {
            if (players[i].name) {
                break;
            }

            players.pop();
        }

        this.players = players;

        this.save();
        this.render();
    }

    clear() {
        this.state = GameState.Players;
        for (let player of this.players) {
            player.canDrop = true;
            player.isRestricted = false;
        }

        this.turns = [];
        this.current = null;

        this.save();
        this.render();
    }

    play() {
        this.state = GameState.Game;
        this.current = new GameCurrentTurn(this.players.length);

        this.save();
        this.render();
    }

    next(scores: number[], dropped: number) {
        if (scores.every((value) => value == null)) {
            return;
        }

        let currentScores: number[] = this.turns.length > 0 ? this.turns[this.turns.length - 1].totals : [0, 0, 0, 0];
        let turn = new GameTurn();
        turn.scores = scores;
        turn.totals = scores.map((value, index) => value + currentScores[index]);
        turn.dropped = dropped;
        this.turns.push(turn);
        this.current = new GameCurrentTurn(this.players.length);

        if (dropped != null) {
            this.players[dropped].canDrop = false;
        }

        for (let i = 0; i < this.players.length; i++) {
            let score = turn.totals[i];
            this.players[i].isRestricted = score >= 900;
        }

        this.save();
        this.render();
    }

    undo() {
        if (this.turns.length === 0) {
            return;
        }

        let lastTurn = this.turns.pop();
        let current = new GameCurrentTurn(this.players.length);
        current.dropped = lastTurn.dropped;
        if (lastTurn.dropped != null) {
            this.players[lastTurn.dropped].canDrop = true;
        }

        for (let i = 0; i < this.players.length; i++) {
            current.scores[i] = lastTurn.scores[i];
            this.players[i].isRestricted = lastTurn.totals[i] >= 900;
        }

        this.current = current;

        this.save();
        this.render();
    }

    private save() {
        localStorage.setItem('game', JSON.stringify(this));
    }

    static load(render: () => void) {
        let game = new Game(render);
        let data = localStorage.getItem('game');
        if (data) {
            let state = JSON.parse(data);
            game.state = state.state;
            game.players = state.players;
            game.turns = state.turns;
            game.current = state.current;
        }

        return game;
    }
}


setPlayer(index: number, name: string) {
        let players = [
            new GamePlayer(),
            new GamePlayer(),
            new GamePlayer(),
            new GamePlayer()
        ];

        for (let i = 0; i < 4; i++) {
            players[i].name = index == i ? name : this.players.length > i ? this.players[i].name : null;
        }

        for (let i = 3; i >= 0; i--) {
            if (players[i].name) {
                break;
            }

            players.pop();
        }

        this.players = players;

        this.save();
        this.render();
    }


clear() {
        this.state = GameState.Players;
        for (let player of this.players) {
            player.canDrop = true;
            player.isRestricted = false;
        }

        this.turns = [];
        this.current = null;

        this.save();
        this.render();
    }


play() {
        this.state = GameState.Game;
        this.current = new GameCurrentTurn(this.players.length);

        this.save();
        this.render();
    }


next(scores: number[], dropped: number) {
        if (scores.every((value) => value == null)) {
            return;
        }

        let currentScores: number[] = this.turns.length > 0 ? this.turns[this.turns.length - 1].totals : [0, 0, 0, 0];
        let turn = new GameTurn();
        turn.scores = scores;
        turn.totals = scores.map((value, index) => value + currentScores[index]);
        turn.dropped = dropped;
        this.turns.push(turn);
        this.current = new GameCurrentTurn(this.players.length);

        if (dropped != null) {
            this.players[dropped].canDrop = false;
        }

        for (let i = 0; i < this.players.length; i++) {
            let score = turn.totals[i];
            this.players[i].isRestricted = score >= 900;
        }

        this.save();
        this.render();
    }


undo() {
        if (this.turns.length === 0) {
            return;
        }

        let lastTurn = this.turns.pop();
        let current = new GameCurrentTurn(this.players.length);
        current.dropped = lastTurn.dropped;
        if (lastTurn.dropped != null) {
            this.players[lastTurn.dropped].canDrop = true;
        }

        for (let i = 0; i < this.players.length; i++) {
            current.scores[i] = lastTurn.scores[i];
            this.players[i].isRestricted = lastTurn.totals[i] >= 900;
        }

        this.current = current;

        this.save();
        this.render();
    }


private save() {
        localStorage.setItem('game', JSON.stringify(this));
    }


static load(render: () => void) {
        let game = new Game(render);
        let data = localStorage.getItem('game');
        if (data) {
            let state = JSON.parse(data);
            game.state = state.state;
            game.players = state.players;
            game.turns = state.turns;
            game.current = state.current;
        }

        return game;
    }


export interface PinchDragData {
  readonly deltaX: number;
  readonly deltaY: number;
  readonly deltaDistance: number;
}


export interface PinchingBehaviour extends Behaviour.AlloyBehaviour<PinchingConfigSpec, PinchingConfig> {
  readonly config: (config: PinchingConfigSpec) => Behaviour.NamedConfiguredBehaviour<PinchingConfigSpec, PinchingConfig>;
}


export interface PinchingConfig extends Behaviour.BehaviourConfigDetail {
  readonly onPinch: (element: SugarElement, changeX: number, changeY: number) => void;
  readonly onPunch: (element: SugarElement, changeX: number, changeY: number) => void;
}


export interface PinchingConfigSpec extends Behaviour.BehaviourConfigSpec {
  readonly onPinch: (element: SugarElement, changeX: number, changeY: number) => void;
  readonly onPunch: (element: SugarElement, changeX: number, changeY: number) => void;
}


export interface PinchingState extends BaseDraggingState<PinchDragData> { }


() => Address


() => Sale


() => ShippingCompany


@Entity({ name: 'deliveries' })
export class Delivery extends DatabaseEntity {
	@PrimaryColumn()
	id: string;

	@Column()
	delivery_fee: string;

	@Column()
	customer_fee: boolean;

	@Column({ default: false })
	shipped: boolean;

	@Column()
	type: string;

	@OneToOne(() => Address)
	@JoinColumn({ name: 'address_id' })
	address: Address;

	@OneToOne(() => Sale)
	@JoinColumn({ name: 'sale_id' })
	sale: Sale;

	@ManyToOne(() => ShippingCompany)
	@JoinColumn({ name: 'shipping_company_id' })
	shippingCompany: ShippingCompany;
}


export function Welcome(){
    const { navigate } = useNavigation();

    function handleStart(){
        navigate("UserIdentification");
    }
    return (
        <SafeAreaView style={styles.container}>
            <View style={styles.wrapper}>
                <Text style={styles.title}>Gerencie {'\n'}
                    suas plantas de {'\n'}
                    forma fácil
                </Text>
                <Image source={wateringImg} style={styles.image} resizeMode="contain" />
                <Text style={styles.subtitle}>Não esqueça mais de regar suas plantas. Nós cuidamos de lembrar você sempre que precisar.</Text>
                <TouchableOpacity
                    style={styles.button}
                    activeOpacity={0.7}
                    onPress={handleStart}
                >
                    <Feather
                        style={styles.buttonIcon}
                        name="chevron-right"
                    />
                </TouchableOpacity>
            </View>
        </SafeAreaView>
    );
}


function handleStart(){
        navigate("UserIdentification");
    }


export function useCreateBridgeApi(): {
  createBridge: (bridgeRequest: BridgeRequest) => void;
  bridge?: BridgeResponse;
  isLoading: boolean;
  error: unknown;
} {
  const [bridge, setBridge] = useState<BridgeResponse>();
  const [error, setError] = useState<unknown>();
  const [isLoading, setIsLoading] = useState(false);
  const auth = useAuth();

  const getToken = useCallback(async (): Promise<string> => {
    return (await auth.kas.getToken()) || "";
  }, [auth]);

  const createBridge = (bridgeRequest: BridgeRequest): void => {
    setIsLoading(true);
    setBridge(undefined);
    setError(undefined);
    const bridgeApi = new BridgesApi(
      new Configuration({
        accessToken: getToken,
        basePath: config.apiBasePath,
      })
    );
    bridgeApi
      .createBridge(bridgeRequest)
      .then((response) => setBridge(response.data))
      .catch((err) => setError(err))
      .finally(() => setIsLoading(false));
  };

  return { createBridge, isLoading, bridge, error };
}


async (): Promise<string> => {
    return (await auth.kas.getToken()) || "";
  }


(bridgeRequest: BridgeRequest): void => {
    setIsLoading(true);
    setBridge(undefined);
    setError(undefined);
    const bridgeApi = new BridgesApi(
      new Configuration({
        accessToken: getToken,
        basePath: config.apiBasePath,
      })
    );
    bridgeApi
      .createBridge(bridgeRequest)
      .then((response) => setBridge(response.data))
      .catch((err) => setError(err))
      .finally(() => setIsLoading(false));
  }


(response) => setBridge(response.data)


(err) => setError(err)


() => setIsLoading(false)


export function is(thing: object): thing is ISnippetPick {
		return thing && URI.isUri((<ISnippetPick>thing).filepath);
	}


async function computePicks(snippetService: ISnippetsService, envService: IEnvironmentService, modeService: IModeService) {

	const existing: ISnippetPick[] = [];
	const future: ISnippetPick[] = [];

	const seen = new Set<string>();

	for (const file of await snippetService.getSnippetFiles()) {

		if (file.source === SnippetSource.Extension) {
			// skip extension snippets
			continue;
		}

		if (file.isGlobalSnippets) {

			await file.load();

			// list scopes for global snippets
			const names = new Set<string>();
			outer: for (const snippet of file.data) {
				for (const scope of snippet.scopes) {
					const name = modeService.getLanguageName(scope);
					if (name) {
						if (names.size >= 4) {
							names.add(`${name}...`);
							break outer;
						} else {
							names.add(name);
						}
					}
				}
			}

			existing.push({
				label: basename(file.location),
				filepath: file.location,
				description: names.size === 0
					? nls.localize('global.scope', "(global)")
					: nls.localize('global.1', "({0})", [...names].join(', '))
			});

		} else {
			// language snippet
			const mode = basename(file.location).replace(/\.json$/, '');
			existing.push({
				label: basename(file.location),
				description: `(${modeService.getLanguageName(mode)})`,
				filepath: file.location
			});
			seen.add(mode);
		}
	}

	const dir = joinPath(envService.userRoamingDataHome, 'snippets');
	for (const mode of modeService.getRegisteredModes()) {
		const label = modeService.getLanguageName(mode);
		if (label && !seen.has(mode)) {
			future.push({
				label: mode,
				description: `(${label})`,
				filepath: joinPath(dir, `${mode}.json`),
				hint: true
			});
		}
	}

	existing.sort((a, b) => {
		let a_ext = extname(a.filepath.path);
		let b_ext = extname(b.filepath.path);
		if (a_ext === b_ext) {
			return a.label.localeCompare(b.label);
		} else if (a_ext === '.code-snippets') {
			return -1;
		} else {
			return 1;
		}
	});

	future.sort((a, b) => {
		return a.label.localeCompare(b.label);
	});

	return { existing, future };
}


async function createSnippetFile(scope: string, defaultPath: URI, quickInputService: IQuickInputService, fileService: IFileService, textFileService: ITextFileService, opener: IOpenerService) {

	function createSnippetUri(input: string) {
		const filename = extname(input) !== '.code-snippets'
			? `${input}.code-snippets`
			: input;
		return joinPath(defaultPath, filename);
	}

	await fileService.createFolder(defaultPath);

	const input = await quickInputService.input({
		placeHolder: nls.localize('name', "Type snippet file name"),
		async validateInput(input) {
			if (!input) {
				return nls.localize('bad_name1', "Invalid file name");
			}
			if (!isValidBasename(input)) {
				return nls.localize('bad_name2', "'{0}' is not a valid file name", input);
			}
			if (await fileService.exists(createSnippetUri(input))) {
				return nls.localize('bad_name3', "'{0}' already exists", input);
			}
			return undefined;
		}
	});

	if (!input) {
		return undefined;
	}

	const resource = createSnippetUri(input);

	await textFileService.write(resource, [
		'{',
		'\t// Place your ' + scope + ' snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and ',
		'\t// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope ',
		'\t// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is ',
		'\t// used to trigger the snippet and the body will be expanded and inserted. Possible variables are: ',
		'\t// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. ',
		'\t// Placeholders with the same ids are connected.',
		'\t// Example:',
		'\t// "Print to console": {',
		'\t// \t"scope": "javascript,typescript",',
		'\t// \t"prefix": "log",',
		'\t// \t"body": [',
		'\t// \t\t"console.log(\'$1\');",',
		'\t// \t\t"$2"',
		'\t// \t],',
		'\t// \t"description": "Log output to console"',
		'\t// }',
		'}'
	].join('\n'));

	await opener.open(resource);
	return undefined;
}


function createSnippetUri(input: string) {
		const filename = extname(input) !== '.code-snippets'
			? `${input}.code-snippets`
			: input;
		return joinPath(defaultPath, filename);
	}


async function createLanguageSnippetFile(pick: ISnippetPick, fileService: IFileService, textFileService: ITextFileService) {
	if (await fileService.exists(pick.filepath)) {
		return;
	}
	const contents = [
		'{',
		'\t// Place your snippets for ' + pick.label + ' here. Each snippet is defined under a snippet name and has a prefix, body and ',
		'\t// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:',
		'\t// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the ',
		'\t// same ids are connected.',
		'\t// Example:',
		'\t// "Print to console": {',
		'\t// \t"prefix": "log",',
		'\t// \t"body": [',
		'\t// \t\t"console.log(\'$1\');",',
		'\t// \t\t"$2"',
		'\t// \t],',
		'\t// \t"description": "Log output to console"',
		'\t// }',
		'}'
	].join('\n');
	await textFileService.write(pick.filepath, contents);
}


(a, b) => {
		let a_ext = extname(a.filepath.path);
		let b_ext = extname(b.filepath.path);
		if (a_ext === b_ext) {
			return a.label.localeCompare(b.label);
		} else if (a_ext === '.code-snippets') {
			return -1;
		} else {
			return 1;
		}
	}


(a, b) => {
		return a.label.localeCompare(b.label);
	}


async (accessor): Promise<any> => {

	const snippetService = accessor.get(ISnippetsService);
	const quickInputService = accessor.get(IQuickInputService);
	const opener = accessor.get(IOpenerService);
	const modeService = accessor.get(IModeService);
	const envService = accessor.get(IEnvironmentService);
	const workspaceService = accessor.get(IWorkspaceContextService);
	const fileService = accessor.get(IFileService);
	const textFileService = accessor.get(ITextFileService);

	const picks = await computePicks(snippetService, envService, modeService);
	const existing: QuickPickInput[] = picks.existing;

	type SnippetPick = IQuickPickItem & { uri: URI } & { scope: string };
	const globalSnippetPicks: SnippetPick[] = [{
		scope: nls.localize('new.global_scope', 'global'),
		label: nls.localize('new.global', "New Global Snippets file..."),
		uri: joinPath(envService.userRoamingDataHome, 'snippets')
	}];

	const workspaceSnippetPicks: SnippetPick[] = [];
	for (const folder of workspaceService.getWorkspace().folders) {
		workspaceSnippetPicks.push({
			scope: nls.localize('new.workspace_scope', "{0} workspace", folder.name),
			label: nls.localize('new.folder', "New Snippets file for '{0}'...", folder.name),
			uri: folder.toResource('.vscode')
		});
	}

	if (existing.length > 0) {
		existing.unshift({ type: 'separator', label: nls.localize('group.global', "Existing Snippets") });
		existing.push({ type: 'separator', label: nls.localize('new.global.sep', "New Snippets") });
	} else {
		existing.push({ type: 'separator', label: nls.localize('new.global.sep', "New Snippets") });
	}

	const pick = await quickInputService.pick(([] as QuickPickInput[]).concat(existing, globalSnippetPicks, workspaceSnippetPicks, picks.future), {
		placeHolder: nls.localize('openSnippet.pickLanguage', "Select Snippets File or Create Snippets"),
		matchOnDescription: true
	});

	if (globalSnippetPicks.indexOf(pick as SnippetPick) >= 0) {
		return createSnippetFile((pick as SnippetPick).scope, (pick as SnippetPick).uri, quickInputService, fileService, textFileService, opener);
	} else if (workspaceSnippetPicks.indexOf(pick as SnippetPick) >= 0) {
		return createSnippetFile((pick as SnippetPick).scope, (pick as SnippetPick).uri, quickInputService, fileService, textFileService, opener);
	} else if (ISnippetPick.is(pick)) {
		if (pick.hint) {
			await createLanguageSnippetFile(pick, fileService, textFileService);
		}
		return opener.open(pick.filepath);
	}
}


interface ISnippetPick extends IQuickPickItem {
	filepath: URI;
	hint?: true;
}


type SnippetPick = IQuickPickItem & { uri: URI } & { scope: string };


async validateInput(input) {
			if (!input) {
				return nls.localize('bad_name1', "Invalid file name");
			}
			if (!isValidBasename(input)) {
				return nls.localize('bad_name2', "'{0}' is not a valid file name", input);
			}
			if (await fileService.exists(createSnippetUri(input))) {
				return nls.localize('bad_name3', "'{0}' already exists", input);
			}
			return undefined;
		}


@Component({
  selector: 'ngx-app',
  template: `
    <router-outlet>
      <ngx-one-column-layout>
        <router-outlet></router-outlet>
      </ngx-one-column-layout>
    </router-outlet>
  `,
})
export class AppComponent implements OnInit {

  constructor() {
  }

  ngOnInit(): void {
  }
}


value => this.setState({switchIsOn: value})


() => {
    throw new Error('This is a test exception');
  }


() => {
    this.setState({mouseEntered: true});
  }


() => {
    this.setState({mouseEntered: false});
  }


() => {
    this.setState({highlightPressed: !this.state.highlightPressed});

    Linking.canOpenURL('https://www.microsoft.com')
      .then(canOpen => {
        if (canOpen) {
          void Linking.openURL('https://www.microsoft.com');
        }
      })
      .catch(() => {
        console.error('exception from Linking.canOpenURL');
      });
  }


canOpen => {
        if (canOpen) {
          void Linking.openURL('https://www.microsoft.com');
        }
      }


() => {
        console.error('exception from Linking.canOpenURL');
      }


() => {
    this.inputRef!.current!.focus();
  }


() => {
    this.inputRef!.current!.blur();
  }


() => {
    this.inputRef!.current!.clear();
  }


(text: string) => {
    console.log(text);
  }


() => {
    console.log('textbox focused');
  }


() => {
    console.log('textbox blurred');
  }


(
    event: NativeSyntheticEvent<TextInputSelectionChangeEventData>,
  ) => {
    console.log(
      'selection start: ' +
        event.nativeEvent.selection.start +
        ', end: ' +
        event.nativeEvent.selection.end,
    );
  }


(
    event: NativeSyntheticEvent<TextInputEndEditingEventData>,
  ) => {
    console.log(event.nativeEvent.text);
  }


(
    event: NativeSyntheticEvent<TextInputContentSizeChangeEventData>,
  ) => {
    console.log(
      'new size width: ' +
        event.nativeEvent.contentSize.width +
        ', height: ' +
        event.nativeEvent.contentSize.height,
    );
  }


() => Bootstrap


class TicTacButton extends React.Component<{}, {text: string}> {
  constructor(props: {}) {
    super(props);
    this._onPress = this._onPress.bind(this);
    this.state = {text: '?'};
  }

  render() {
    return (
      <Button
        onPress={this._onPress}
        title={this.state.text}
        accessibilityLabel={this.state.text}
      />
    );
  }

  _onPress(_event: NativeSyntheticEvent<NativeTouchEvent>) {
    if (this.state.text === 'X') {
      this.setState({text: 'o'});
    } else {
      this.setState({text: 'X'});
    }
  }
}


class PopupButton extends React.Component<
  {},
  {
    buttonTitle: string;
    isFlyoutVisible: boolean;
    popupSwitchState: boolean;
    isLightDismissEnabled: boolean;
  }
> {
  constructor(props: {}) {
    super(props);
    this._onPress = this._onPress.bind(this);
    this._onPopupButtonPressed = this._onPopupButtonPressed.bind(this);
    this._onPopupDismissed = this._onPopupDismissed.bind(this);
    this.state = {
      buttonTitle: 'Open Flyout',
      isFlyoutVisible: false,
      popupSwitchState: true,
      isLightDismissEnabled: false,
    };
  }

  render() {
    return (
      <View style={{flexDirection: 'row', padding: 20}}


export default class Bootstrap extends React.Component<
  {},
  {
    checkBoxIsOn: boolean;
    switchIsOn: boolean;
    highlightPressed: boolean;
    mouseEntered: boolean;
  }
> {
  constructor(props: {}) {
    super(props);
    this.inputRef = React.createRef();
    this.state = {
      checkBoxIsOn: true,
      mouseEntered: false,
      switchIsOn: true,
      highlightPressed: false,
    };
  }

  inputRef: React.RefObject<TextInput>;

  render() {
    return (
      <ScrollView>
        <View style={styles.container}>
          <Text style={styles.welcome}>Welcome to React Native</Text>
          <Text style={styles.instructions}>
            To get started, edit index.windows.js
          </Text>
          <Text>
            Nested text
            <Text style={{color: '#3333ff'}}


render() {
    return (
      <Button
        onPress={this._onPress}
        title={this.state.text}
        accessibilityLabel={this.state.text}
      />
    );
  }


_onPress(_event: NativeSyntheticEvent<NativeTouchEvent>) {
    if (this.state.text === 'X') {
      this.setState({text: 'o'});
    } else {
      this.setState({text: 'X'});
    }
  }


render() {
    return (
      <View style={{flexDirection: 'row', padding: 20}}


render() {
    return (
      <ScrollView>
        <View style={styles.container}>
          <Text style={styles.welcome}>Welcome to React Native</Text>
          <Text style={styles.instructions}>
            To get started, edit index.windows.js
          </Text>
          <Text>
            Nested text
            <Text style={{color: '#3333ff'}}


export function Api() {
  return (
    <Layout description>
      <Block>

              All endpoints are under the <CodeInline>/api</CodeInline> endpoint

            <Endpoint method="GET" path="/get/:id">
              returns the file associated with the id, optionally takes a file
              extension
            </Endpoint>
            <Endpoint method="GET" path="/get/:alias@:tag">
              returns the file associated with the alias and tag, optionally
              takes a file extension
            </Endpoint>
            <Endpoint
              method="POST"
              path="/add"
              requestBody={{
                content_type: "application/json",
                content: {
                  name: {
                    type: "string",
                    description: "The name of the script including extension",
                  },
                  content: {
                    type: "string",
                    description: "The file content base64-encoded",
                  },
                },
              }}


export function createAppWindow(): {
  window: BrowserWindow
  load(): Promise<void>
} {
  const window = new BrowserWindow({
    width: 600
  , height: 500
  , minWidth: 600
  , minHeight: 500
  , resizable: true
  , webPreferences: {
      preload: path.join(app.getAppPath(), 'lib/renderer/app-preload.js')
    , devTools: isDev
    }
  })

  window.removeMenu()

  // 阻止在Electron里打开新链接
  window.webContents.setWindowOpenHandler(details => {
    shell.openExternal(details.url)
    return { action: 'deny' }
  })

  // 将关闭窗口改为隐藏窗口
  window.addListener('close', evt => {
    evt.preventDefault()
    window.hide()
  })

  return {
    window
  , async load() {
      await window.loadURL(
        isDev
        ? 'http://localhost:8080/app.html'
        : `file://${path.join(app.getAppPath(), 'dist/app.html')}`
      )

      if (isDev) {
        window.webContents.openDevTools({ mode: 'detach' })
      }
    }
  }
}


details => {
    shell.openExternal(details.url)
    return { action: 'deny' }
  }


evt => {
    evt.preventDefault()
    window.hide()
  }


async load() {
      await window.loadURL(
        isDev
        ? 'http://localhost:8080/app.html'
        : `file://${path.join(app.getAppPath(), 'dist/app.html')}`
      )

      if (isDev) {
        window.webContents.openDevTools({ mode: 'detach' })
      }
    }


export function __wbg_wasmriscv_free(a: number): void;


export function wasmriscv_new(): number;


export function wasmriscv_setup_program(a: number, b: number, c: number): void;


export function wasmriscv_load_program_for_symbols(a: number, b: number, c: number): void;


export function wasmriscv_setup_filesystem(a: number, b: number, c: number): void;


export function wasmriscv_setup_dtb(a: number, b: number, c: number): void;


export function wasmriscv_run(a: number): void;


export function wasmriscv_run_cycles(a: number, b: number): void;


export function wasmriscv_run_until_breakpoints(a: number, b: number, c: number, d: number): number;


export function wasmriscv_disassemble_next_instruction(a: number): void;


export function wasmriscv_load_doubleword(a: number, b: number, c: number, d: number, e: number, f: number): void;


export function wasmriscv_read_register(a: number, b: number, c: number): void;


export function wasmriscv_read_pc(a: number, b: number): void;


export function wasmriscv_get_output(a: number): number;


export function wasmriscv_put_input(a: number, b: number): void;


export function wasmriscv_enable_page_cache(a: number, b: number): void;


export function wasmriscv_get_address_of_symbol(a: number, b: number, c: number, d: number, e: number, f: number): void;


export function __wbindgen_malloc(a: number): number;


export function __wbindgen_free(a: number, b: number): void;


export function __wbindgen_realloc(a: number, b: number, c: number): number;