/* Minification failed. Returning unminified contents.
(1,1): run-time error CSS1019: Unexpected token, found '$'
(1,2): run-time error CSS1019: Unexpected token, found '('
(1,12): run-time error CSS1031: Expected selector, found '('
(1,12): run-time error CSS1025: Expected comma or open brace, found '('
(33,2): run-time error CSS1019: Unexpected token, found ')'
 */
$(function () {
    rarabuy.vuemodel = new Vue({
        el: '#my-app',
        data: {
            mailAddress: null
        },
        mounted: function () {
            rarabuy.vuemodel = this;
        },
        methods: {
            doSubmit: async function (event) {
                console.log(event);
                this.$validator.validateAll()
                    .then((result) => {
                        if (result) {
                            // 二重クリック防止
                            rarabuy.loading(true);
                            rarabuy.post(rarabuy.apiUrls.storeResetPassword, rarabuy.vuemodel.$data)
                                .done(function (data) {
                                    console.log(data);
                                    rarabuy.loading(false);
                                    rarabuy.redirect(rarabuy.urls.passwordResetCompleted + '?mailAddress=' + encodeURIComponent(data.MailAddress));
                                })
                                .fail(function (error) {
                                    console.log(error);
                                    rarabuy.handleError(error);
                                });
                        }
                    });
            }
        }
    });
});
