Type.createNamespace('ReCaptchaService');

////////////////////////////////////////////////////////////////////////////////
// ReCaptchaService.ReCaptchaService

ReCaptchaService.ReCaptchaService = function ReCaptchaService_ReCaptchaService() {
    ReCaptchaService.ReCaptchaService.constructBase(this);
    ReCaptchaService.ReCaptchaService._log$1.debug('Stor');
}
ReCaptchaService.ReCaptchaService.prototype = {
    _recaptchaImageUrl$1: 'http://api.recaptcha.net/image',
    
    init: function ReCaptchaService_ReCaptchaService$init(environment, parameters) {
        ReCaptchaService.ReCaptchaService._log$1.debug(String.format('Init parameters=[{0}]', Framework.DictionaryUtil.dumpToString(parameters)));
        ReCaptchaService.ReCaptchaService.callBase(this, 'init', [ environment, parameters ]);
        if (Object.keyExists(parameters, 'recaptcha-image-url')) {
            this._recaptchaImageUrl$1 = (parameters['recaptcha-image-url']);
        }
    },
    
    start: function ReCaptchaService_ReCaptchaService$start() {
        ReCaptchaService.ReCaptchaService._log$1.debug('ReCaptchaService Start()');
    },
    
    _challengeID$1: '',
    
    getReCaptchaChallengeForm: function ReCaptchaService_ReCaptchaService$getReCaptchaChallengeForm(successCallback, failureCallback, componentDomElementId, ReCaptchaDomElementHolderID, RefreshButtonText) {
        this._getReCaptchaChallenge$1(Delegate.create(this, function(result) {
            var oDictionary = result;
            var oImageElement = document.createElement('img');
            oImageElement.id = componentDomElementId + '-ReCaptchaImage';
            this._challengeID$1 = this._getReCaptchaChallengeForImage$1(oDictionary);
            oImageElement.style.width = '300px';
            oImageElement.style.height = '57px';
            oImageElement.src = this._getReCaptchaImageResolvingServer$1(oDictionary) + '?c=' + this._getReCaptchaChallengeForImage$1(oDictionary);
            oImageElement.className = 'ReCaptchaImage';
            var oInputElement = document.createElement('input');
            oInputElement.id = componentDomElementId + '-ReCaptchaInput';
            oInputElement.type = 'text';
            oInputElement.className = 'ReCaptchaInput';
            var oRefreshButton = document.createElement('input');
            oRefreshButton.id = componentDomElementId + '-ReCaptchaRefreshButton';
            oRefreshButton.type = 'button';
            oRefreshButton.value = RefreshButtonText;
            oRefreshButton.className = 'ReCaptchaRefreshButton';
            var oHelpSpanElem = document.createElement('span');
            oHelpSpanElem.setAttribute('behavior.ID', 'ShowHelp|HideHelp');
            oHelpSpanElem.setAttribute('behavior.autobind.ShowHelp', 'onmouseover');
            oHelpSpanElem.setAttribute('behavior.autobind.HideHelp', 'onmouseout');
            oHelpSpanElem.setAttribute('behavior.ShowHelp.helpelementid', componentDomElementId + '.ReCaptcha.help');
            oHelpSpanElem.setAttribute('behavior.HideHelp.helpelementid', componentDomElementId + '.ReCaptcha.help');
            oHelpSpanElem.className = 'fieldQuestion recaptcha';
            var oHelpDivElem = document.createElement('div');
            oHelpDivElem.id = componentDomElementId + '.ReCaptcha.help';
            oHelpDivElem.className = 'helpMsg';
            var oElement = oRefreshButton;
            var behavior = new Framework.Behavior.ElementBehavior(oElement);
            behavior.add_onClick(Delegate.create(this, function(sender, eventArgs) {
                this.refreshImage(componentDomElementId);
                window.event.returnValue = false;
            }));
            var oHolder = document.getElementById(ReCaptchaDomElementHolderID);
            oHolder.innerHTML = '';
            oHolder.appendChild(oImageElement);
            oHolder.appendChild(oInputElement);
            oHolder.appendChild(oRefreshButton);
            oHelpSpanElem.appendChild(oHelpDivElem);
            oHolder.appendChild(oHelpSpanElem);
            successCallback.invoke(result);
        }), Delegate.create(this, function(exception) {
            failureCallback.invoke(exception);
        }));
    },
    
    refreshImage: function ReCaptchaService_ReCaptchaService$refreshImage(componentDomElementId) {
        this._getReCaptchaChallenge$1(Delegate.create(this, function(result) {
            var oDictionary = result;
            var oImageElement = document.getElementById(componentDomElementId + '-ReCaptchaImage');
            if (!oImageElement) {
                return;
            }
            this._challengeID$1 = this._getReCaptchaChallengeForImage$1(oDictionary);
            oImageElement.style.width = '300px';
            oImageElement.style.height = '57px';
            oImageElement.src = this._getReCaptchaImageResolvingServer$1(oDictionary) + '?c=' + this._getReCaptchaChallengeForImage$1(oDictionary);
            oImageElement.className = 'ReCaptchaImage';
        }), Delegate.create(this, function(exception) {
        }));
    },
    
    _getReCaptchaChallenge$1: function ReCaptchaService_ReCaptchaService$_getReCaptchaChallenge$1(successCallback, failureCallback) {
        ReCaptchaService.ReCaptchaService._log$1.debug(String.format('GetReCaptchaChallenge'));
        this._environment.invokeAsync(ReCaptchaService.ReCaptchaService._serviceName$1, 'GetReCaptchaChallenge', {}, Delegate.create(this, function(result) {
            successCallback.invoke(result);
        }), failureCallback);
    },
    
    validateReCaptchaChallenge: function ReCaptchaService_ReCaptchaService$validateReCaptchaChallenge(successCallback, failureCallback, componentDomElementId) {
        var oInputElement = document.getElementById(componentDomElementId + '-ReCaptchaInput');
        ReCaptchaService.ReCaptchaService._log$1.debug(String.format('ValidateReCaptchaChallenge'));
        this._environment.invokeAsync(ReCaptchaService.ReCaptchaService._serviceName$1, 'ValidateReCaptchaChallenge', { recaptcha_challenge_field: this._challengeID$1, recaptcha_response_field: oInputElement.value }, Delegate.create(this, function(result) {
            successCallback.invoke(result);
            var isValid = result;
            if (!isValid) {
                this.refreshImage(componentDomElementId);
            }
        }), failureCallback);
    },
    
    _getReCaptchaImageResolvingServer$1: function ReCaptchaService_ReCaptchaService$_getReCaptchaImageResolvingServer$1(ReCaptchaChallengeResponse) {
        var fullResponse = ReCaptchaChallengeResponse['FullResponse'].toString();
        var ServerStartposition = fullResponse.indexOf('server');
        var fullResponseFromServer = fullResponse.substring(ServerStartposition, fullResponse.length);
        var addressStartPosition = fullResponseFromServer.indexOf('\'');
        var fullResponseFromURL = fullResponseFromServer.substring(addressStartPosition + 1, fullResponseFromServer.length);
        var addressEndPosition = fullResponseFromURL.indexOf('\'');
        var ReCaptchaImageResolvingServerURL = fullResponseFromURL.substring(0, addressEndPosition).replace(' ', '');
        ReCaptchaImageResolvingServerURL = ReCaptchaImageResolvingServerURL.replace('http:', window.location.protocol);
        if (ReCaptchaImageResolvingServerURL.indexOf('www.google.com') > -1) {
            return ReCaptchaImageResolvingServerURL + 'image';
        }
        return this._recaptchaImageUrl$1;
    },
    
    _getReCaptchaChallengeForImage$1: function ReCaptchaService_ReCaptchaService$_getReCaptchaChallengeForImage$1(ReCaptchaChallengeResponse) {
        var fullResponse = ReCaptchaChallengeResponse['FullResponse'].toString();
        var ChallengeStartposition = fullResponse.indexOf('challenge');
        var fullResponseFromChallenge = fullResponse.substring(ChallengeStartposition, fullResponse.length);
        var challengeStartPosition = fullResponseFromChallenge.indexOf('\'');
        var fullResponseFromChallengeValue = fullResponseFromChallenge.substring(challengeStartPosition + 1, fullResponseFromChallenge.length);
        var challengeEndPosition = fullResponseFromChallengeValue.indexOf('\'');
        var ReCaptchaChallengeForImage = fullResponseFromChallengeValue.substring(0, challengeEndPosition);
        return ReCaptchaChallengeForImage;
    }
}


ReCaptchaService.ReCaptchaService.createClass('ReCaptchaService.ReCaptchaService', Framework.AbstractService);
ReCaptchaService.ReCaptchaService._serviceName$1 = 'ReCaptchaService';
ReCaptchaService.ReCaptchaService._log$1 = Framework.Logger.getLog(ReCaptchaService.ReCaptchaService._serviceName$1);

// ---- Do not remove this footer ----
// Generated using Script# v0.5.1.0 (http://projects.nikhilk.net)
// -----------------------------------
Type.createNamespace('DrawHistoryService');

////////////////////////////////////////////////////////////////////////////////
// DrawHistoryService.IDrawHistoryChangedListener

DrawHistoryService.IDrawHistoryChangedListener = function() { };
DrawHistoryService.IDrawHistoryChangedListener.prototype = {
    onDrawHistoryChanged : null,
    onDrawHistoryError : null
}
DrawHistoryService.IDrawHistoryChangedListener.createInterface('DrawHistoryService.IDrawHistoryChangedListener');


////////////////////////////////////////////////////////////////////////////////
// DrawHistoryService.DrawHistory

DrawHistoryService.DrawHistory = function DrawHistoryService_DrawHistory() {
}
DrawHistoryService.DrawHistory.prototype = {
    ExternalId: null,
    FromDate: null,
    ToDate: null,
    PageCount: 0,
    CurrentPage: 0,
    Items: null
}


////////////////////////////////////////////////////////////////////////////////
// DrawHistoryService.DrawHistoryItem

DrawHistoryService.DrawHistoryItem = function DrawHistoryService_DrawHistoryItem() {
}
DrawHistoryService.DrawHistoryItem.prototype = {
    DrawNumber: null,
    DrawDate: null,
    DrawnNumbers: null,
    Jackpot: null
}


////////////////////////////////////////////////////////////////////////////////
// DrawHistoryService.DrawHistoryService

DrawHistoryService.DrawHistoryService = function DrawHistoryService_DrawHistoryService() {
    this._drawHistoryChangedListeners$1 = new Framework.ListenerInvoker(true);
    DrawHistoryService.DrawHistoryService.constructBase(this);
    DrawHistoryService.DrawHistoryService._log$1.debug('DrawHistoryService');
}
DrawHistoryService.DrawHistoryService.prototype = {
    _alldrawHistories$1: null,
    
    _getState$1: function DrawHistoryService_DrawHistoryService$_getState$1() {
        return { DrawHistory: this._alldrawHistories$1 };
    },
    
    getDrawHistory: function DrawHistoryService_DrawHistoryService$getDrawHistory(externalID) {
        if (isNullOrUndefined(this._alldrawHistories$1)) {
            return null;
        }
        if (Object.keyExists(this._alldrawHistories$1, externalID)) {
            return this._alldrawHistories$1[externalID];
        }
        return null;
    },
    
    init: function DrawHistoryService_DrawHistoryService$init(environment, parameters) {
        DrawHistoryService.DrawHistoryService._log$1.debug(String.format('Init parameters=[{0}]', Framework.DictionaryUtil.dumpToString(parameters)));
        DrawHistoryService.DrawHistoryService.callBase(this, 'init', [ environment, parameters ]);
        environment.registerPageWillChangeListener(this);
        var state = this._environment.getStoredState(DrawHistoryService.DrawHistoryService._serviceName$1);
        if (state && Object.keyExists(state, 'DrawHistory')) {
            this._alldrawHistories$1 = state['DrawHistory'];
        }
    },
    
    start: function DrawHistoryService_DrawHistoryService$start() {
        DrawHistoryService.DrawHistoryService._log$1.debug('DrawHistoryService Start()');
    },
    
    onPageWillChange: function DrawHistoryService_DrawHistoryService$onPageWillChange() {
        DrawHistoryService.DrawHistoryService._log$1.debug('OnPageWillChange');
        this._environment.storeState(DrawHistoryService.DrawHistoryService._serviceName$1, this._getState$1());
    },
    
    _navigationService$1: null,
    
    setNavigationService: function DrawHistoryService_DrawHistoryService$setNavigationService(navigationService) {
        DrawHistoryService.DrawHistoryService._log$1.debug('SetNavigationService');
        this._navigationService$1 = navigationService;
    },
    
    _userService$1: null,
    
    setUserService: function DrawHistoryService_DrawHistoryService$setUserService(userService) {
        DrawHistoryService.DrawHistoryService._log$1.debug('SetUserService');
        this._userService$1 = userService;
    },
    
    registerDrawHistoryChangedListener: function DrawHistoryService_DrawHistoryService$registerDrawHistoryChangedListener(listener) {
        DrawHistoryService.DrawHistoryService._log$1.debug('RegisterDrawHistoryChangedListener');
        this._drawHistoryChangedListeners$1.registerListener(listener);
    },
    
    unregisterDrawHistoryChangedListener: function DrawHistoryService_DrawHistoryService$unregisterDrawHistoryChangedListener(listener) {
        DrawHistoryService.DrawHistoryService._log$1.debug('UnregisterDrawHistoryChangedListener');
        this._drawHistoryChangedListeners$1.unregisterListener(listener);
    },
    
    _fireDrawHistoryChangedEvent$1: function DrawHistoryService_DrawHistoryService$_fireDrawHistoryChangedEvent$1(externalId) {
        DrawHistoryService.DrawHistoryService._log$1.debug('FireDrawHistoryChangedEvent');
        this._drawHistoryChangedListeners$1.fireUpdateEvent(Delegate.create(this, function(listener) {
            (listener).onDrawHistoryChanged(this, externalId);
        }));
    },
    
    _fireDrawHistoryError$1: function DrawHistoryService_DrawHistoryService$_fireDrawHistoryError$1(externalId) {
        DrawHistoryService.DrawHistoryService._log$1.debug('FireDrawHistoryError');
        this._drawHistoryChangedListeners$1.fireUpdateEvent(Delegate.create(this, function(listener) {
            (listener).onDrawHistoryError(this, externalId);
        }));
    },
    
    retrieveDrawHistory: function DrawHistoryService_DrawHistoryService$retrieveDrawHistory(successCallback, failureCallback, externalID, fromDate, toDate, page, pageSize) {
        DrawHistoryService.DrawHistoryService._log$1.debug('GetDrawHistory');
        var idmdlanguage = this._environment.getLanguage();
        this._environment.invokeAsync(DrawHistoryService.DrawHistoryService._serviceName$1, 'GetDrawHistory', { IDMDLanguage: idmdlanguage, externalID: externalID, fromDate: fromDate, toDate: toDate, page: page, pageSize: pageSize }, Delegate.create(this, function(result) {
            if (isNullOrUndefined(this._alldrawHistories$1)) {
                this._alldrawHistories$1 = {};
            }
            this._alldrawHistories$1[externalID] = result;
            successCallback.invoke(result);
        }), Delegate.create(this, function(exception) {
            if (!isNullOrUndefined(this._alldrawHistories$1) && Object.keyExists(this._alldrawHistories$1, externalID)) {
                delete this._alldrawHistories$1[externalID];
            }
            failureCallback.invoke(exception);
        }));
    },
    
    fetchDrawHistoryXML: function DrawHistoryService_DrawHistoryService$fetchDrawHistoryXML(successCallback, failureCallback, externalID, fromDate, toDate, page, pageSize) {
        DrawHistoryService.DrawHistoryService._log$1.debug('FetchDrawHistoryXML');
        var idmdlanguage = this._environment.getLanguage();
        this._environment.invokeAsync(DrawHistoryService.DrawHistoryService._serviceName$1, 'GetDrawHistoryXML', { IDMDLanguage: idmdlanguage, externalID: externalID, fromDate: fromDate, toDate: toDate, page: page, pageSize: pageSize }, successCallback, failureCallback);
    }
}


DrawHistoryService.DrawHistory.createClass('DrawHistoryService.DrawHistory');
DrawHistoryService.DrawHistoryItem.createClass('DrawHistoryService.DrawHistoryItem');
DrawHistoryService.DrawHistoryService.createClass('DrawHistoryService.DrawHistoryService', Framework.AbstractService, Framework.IPageWillChangeListener);
DrawHistoryService.DrawHistoryService._serviceName$1 = 'DrawHistoryService';
DrawHistoryService.DrawHistoryService._log$1 = Framework.Logger.getLog(DrawHistoryService.DrawHistoryService._serviceName$1);

// ---- Do not remove this footer ----
// Generated using Script# v0.5.1.0 (http://projects.nikhilk.net)
// -----------------------------------
Type.createNamespace('ExtNotificationService');

////////////////////////////////////////////////////////////////////////////////
// ExtNotificationService.INotificationPreferencesChangedListener

ExtNotificationService.INotificationPreferencesChangedListener = function() { };
ExtNotificationService.INotificationPreferencesChangedListener.prototype = {
    onNotificationPreferencesChanged : null
}
ExtNotificationService.INotificationPreferencesChangedListener.createInterface('ExtNotificationService.INotificationPreferencesChangedListener');


////////////////////////////////////////////////////////////////////////////////
// ExtNotificationService.IMobileLinkingStastusChangedListener

ExtNotificationService.IMobileLinkingStastusChangedListener = function() { };
ExtNotificationService.IMobileLinkingStastusChangedListener.prototype = {
    onMobileLinkingStatusChanged : null
}
ExtNotificationService.IMobileLinkingStastusChangedListener.createInterface('ExtNotificationService.IMobileLinkingStastusChangedListener');


////////////////////////////////////////////////////////////////////////////////
// ExtNotificationService.ExtServiceResponse

ExtNotificationService.ExtServiceResponse = function ExtNotificationService_ExtServiceResponse() {
}
ExtNotificationService.ExtServiceResponse.prototype = {
    Optinstatus: null,
    Shortcode: null,
    Smsprice: 0,
    Clientid: null,
    Message: null
}


////////////////////////////////////////////////////////////////////////////////
// ExtNotificationService.ExtNotificationLog

ExtNotificationService.ExtNotificationLog = function ExtNotificationService_ExtNotificationLog() {
}
ExtNotificationService.ExtNotificationLog.prototype = {
    IDMMNTNotification: 0,
    XTD: 0,
    IDMMNTType: null,
    IDMMNTMechanism: null,
    IDMMCustomer: 0,
    CustomerAddress: null,
    TSCreated: null,
    TSDelivered: null,
    TypeDescription: null,
    MechanismDescription: null
}


////////////////////////////////////////////////////////////////////////////////
// ExtNotificationService.ExtMessageLog

ExtNotificationService.ExtMessageLog = function ExtNotificationService_ExtMessageLog() {
}
ExtNotificationService.ExtMessageLog.prototype = {
    IDNXMessage: 0,
    IDMMCustomer: 0,
    Msin: null,
    FromMsin: null,
    FromProviderId: null,
    FromAppId: null,
    ProcessingAttempts: 0,
    DTProcessing: null,
    State: null,
    MsgText: null,
    Timestamp: null,
    ToMsin: null,
    ToProviderId: null,
    ToAppId: null,
    IDNXSubscriber: 0
}


////////////////////////////////////////////////////////////////////////////////
// ExtNotificationService.ExtSubscriptionParameter

ExtNotificationService.ExtSubscriptionParameter = function ExtNotificationService_ExtSubscriptionParameter() {
}
ExtNotificationService.ExtSubscriptionParameter.prototype = {
    Name: null,
    Value: null
}


////////////////////////////////////////////////////////////////////////////////
// ExtNotificationService.ExtSubscription

ExtNotificationService.ExtSubscription = function ExtNotificationService_ExtSubscription() {
}
ExtNotificationService.ExtSubscription.prototype = {
    Id: null,
    Status: null,
    Shortcode: null,
    ExtNtTypeId: null,
    ExtMechanism: null,
    Parameters: null
}


////////////////////////////////////////////////////////////////////////////////
// ExtNotificationService.ExtNtParameter

ExtNotificationService.ExtNtParameter = function ExtNotificationService_ExtNtParameter() {
}
ExtNotificationService.ExtNtParameter.prototype = {
    Name: null,
    Description: null,
    ParamType: null,
    Required: false,
    DefaultValue: null,
    Choices: null
}


////////////////////////////////////////////////////////////////////////////////
// ExtNotificationService.ExtNtPreference

ExtNotificationService.ExtNtPreference = function ExtNotificationService_ExtNtPreference() {
}
ExtNotificationService.ExtNtPreference.prototype = {
    Remove: false,
    Idmmnttype: null,
    Idmmntmechanism: null,
    Isactive: null,
    Subscription: null
}


////////////////////////////////////////////////////////////////////////////////
// ExtNotificationService.NtCategory

ExtNotificationService.NtCategory = function ExtNotificationService_NtCategory() {
}
ExtNotificationService.NtCategory.prototype = {
    Idmmntcategory: null,
    Description: null,
    NtTypes: null
}


////////////////////////////////////////////////////////////////////////////////
// ExtNotificationService.ExtNtType

ExtNotificationService.ExtNtType = function ExtNotificationService_ExtNtType() {
}
ExtNotificationService.ExtNtType.prototype = {
    Externalid: null,
    Name: null,
    Description: null,
    Mechanisms: null,
    Smsshortcode: null,
    Smsprice: 0,
    Parameters: null
}


////////////////////////////////////////////////////////////////////////////////
// ExtNotificationService.NtType

ExtNotificationService.NtType = function ExtNotificationService_NtType() {
}
ExtNotificationService.NtType.prototype = {
    Idmmnttype: null,
    Externalid: null,
    Description: null,
    Idmmntmechanism_default: null,
    NtMechanisms: null,
    ExtNtTypes: null
}


////////////////////////////////////////////////////////////////////////////////
// ExtNotificationService.NtMechanism

ExtNotificationService.NtMechanism = function ExtNotificationService_NtMechanism() {
}
ExtNotificationService.NtMechanism.prototype = {
    Idmmntmechanism: null,
    Description: null,
    Isactivebydefault: false
}


////////////////////////////////////////////////////////////////////////////////
// ExtNotificationService.ExtNotificationService

ExtNotificationService.ExtNotificationService = function ExtNotificationService_ExtNotificationService() {
    this._mobileLinkingStatusChangedListeners$1 = new Framework.ListenerInvoker(true);
    this._notificationPreferencesChangedListeners$1 = new Framework.ListenerInvoker(true);
    ExtNotificationService.ExtNotificationService.constructBase(this);
}
ExtNotificationService.ExtNotificationService.prototype = {
    _linkStatus$1: null,
    
    init: function ExtNotificationService_ExtNotificationService$init(environment, parameters) {
        ExtNotificationService.ExtNotificationService._log$1.debug(String.format('Init parameters=[{0}]', Framework.DictionaryUtil.dumpToString(parameters)));
        ExtNotificationService.ExtNotificationService.callBase(this, 'init', [ environment, parameters ]);
        environment.registerPageWillChangeListener(this);
        var state = this._environment.getStoredState(ExtNotificationService.ExtNotificationService._serviceName$1);
        if (state && Object.keyExists(state, 'linkStatus')) {
            this._linkStatus$1 = Type.safeCast(state['linkStatus'], String);
        }
    },
    
    start: function ExtNotificationService_ExtNotificationService$start() {
        ExtNotificationService.ExtNotificationService._log$1.debug('Start');
        if (this._userService$1.isLoggedIn()) {
            ExtNotificationService.ExtNotificationService._log$1.debug(String.format('VerificationStatusInquiry'));
            var msin = this._userService$1.get_personalDetails().MobilePhone;
            if (String.isNullOrEmpty(msin)) {
                return;
            }
            this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'VerificationStatusInquiry', { msin: msin }, Delegate.create(this, function(result) {
                var response = result;
                this._linkStatus$1 = response.Optinstatus;
            }), Delegate.create(this, function(exception) {
                ExtNotificationService.ExtNotificationService._log$1.debug('FindSubscriber exception ' + exception.message);
                if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                    this._userService$1.handleSessionTimeout(exception);
                }
            }));
        }
    },
    
    _userService$1: null,
    
    setUserService: function ExtNotificationService_ExtNotificationService$setUserService(userService) {
        ExtNotificationService.ExtNotificationService._log$1.debug('SetUserService');
        this._userService$1 = userService;
    },
    
    onUserChanged: function ExtNotificationService_ExtNotificationService$onUserChanged(eventSource) {
        ExtNotificationService.ExtNotificationService._log$1.debug('OnUserChanged');
        if (this._userService$1.isLoggedIn()) {
        }
    },
    
    onPageWillChange: function ExtNotificationService_ExtNotificationService$onPageWillChange() {
        ExtNotificationService.ExtNotificationService._log$1.debug('OnPageWillChange');
        this._environment.storeState(ExtNotificationService.ExtNotificationService._serviceName$1, this._getState$1());
    },
    
    _navigationService$1: null,
    
    setNavigationService: function ExtNotificationService_ExtNotificationService$setNavigationService(navigationService) {
        ExtNotificationService.ExtNotificationService._log$1.debug('SetNavigationService');
        this._navigationService$1 = navigationService;
    },
    
    _getState$1: function ExtNotificationService_ExtNotificationService$_getState$1() {
        return { linkStatus: this._linkStatus$1 };
    },
    
    get_linkStatus: function ExtNotificationService_ExtNotificationService$get_linkStatus() {
        return this._linkStatus$1;
    },
    
    registerMobileLinkingStatusChangedListener: function ExtNotificationService_ExtNotificationService$registerMobileLinkingStatusChangedListener(listener) {
        ExtNotificationService.ExtNotificationService._log$1.debug('RegisterMobileLinkingStatusChangedListener');
        this._mobileLinkingStatusChangedListeners$1.registerListener(listener);
    },
    
    unregisterMobileLinkingStatusChangedListener: function ExtNotificationService_ExtNotificationService$unregisterMobileLinkingStatusChangedListener(listener) {
        ExtNotificationService.ExtNotificationService._log$1.debug('UnregisterMobileLinkingStatusChangedListener');
        this._mobileLinkingStatusChangedListeners$1.unregisterListener(listener);
    },
    
    _fireMobileLinkingStatusChangedEvent$1: function ExtNotificationService_ExtNotificationService$_fireMobileLinkingStatusChangedEvent$1() {
        ExtNotificationService.ExtNotificationService._log$1.debug('FireMobileLinkingStatusChangedEvent');
        this._mobileLinkingStatusChangedListeners$1.fireUpdateEvent(Delegate.create(this, function(listener) {
            (listener).onMobileLinkingStatusChanged(this);
        }));
    },
    
    registerNotificationPreferencesChangedListener: function ExtNotificationService_ExtNotificationService$registerNotificationPreferencesChangedListener(listener) {
        ExtNotificationService.ExtNotificationService._log$1.debug('RegisterNotificationPreferencesChangedListener');
        this._notificationPreferencesChangedListeners$1.registerListener(listener);
    },
    
    unregisterNotificationPreferencesChangedListener: function ExtNotificationService_ExtNotificationService$unregisterNotificationPreferencesChangedListener(listener) {
        ExtNotificationService.ExtNotificationService._log$1.debug('UnregisterNotificationPreferencesChangedListener');
        this._notificationPreferencesChangedListeners$1.unregisterListener(listener);
    },
    
    _fireNotificationPreferencesChangedEvent$1: function ExtNotificationService_ExtNotificationService$_fireNotificationPreferencesChangedEvent$1() {
        ExtNotificationService.ExtNotificationService._log$1.debug('FireMobileLinkingStatusChangedEvent');
        this._notificationPreferencesChangedListeners$1.fireUpdateEvent(Delegate.create(this, function(listener) {
            (listener).onNotificationPreferencesChanged(this);
        }));
    },
    
    findSubscriber: function ExtNotificationService_ExtNotificationService$findSubscriber(successCallback, failureCallback, msin) {
        ExtNotificationService.ExtNotificationService._log$1.debug(String.format('FindSubscriber msin:{0}', msin));
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'FindSubscriber', { msin: msin }, successCallback, Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('FindSubscriber exception ' + exception.message);
            if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                this._userService$1.handleSessionTimeout(exception);
                failureCallback.invoke(exception);
            }
            else {
                failureCallback.invoke(exception);
            }
        }));
    },
    
    startVerification: function ExtNotificationService_ExtNotificationService$startVerification(successCallback, failureCallback, msin) {
        ExtNotificationService.ExtNotificationService._log$1.debug(String.format('StartVerification msin:{0}', msin));
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'StartVerification', { msin: msin }, Delegate.create(this, function(result) {
            successCallback.invoke(result);
            var response = result;
            this._linkStatus$1 = response.Optinstatus;
            this._fireMobileLinkingStatusChangedEvent$1();
        }), Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('StartVerification exception ' + exception.message);
            if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                this._userService$1.handleSessionTimeout(exception);
                failureCallback.invoke(exception);
            }
            else {
                failureCallback.invoke(exception);
            }
        }));
    },
    
    verificationStatusInquiry: function ExtNotificationService_ExtNotificationService$verificationStatusInquiry(successCallback, failureCallback, msin) {
        ExtNotificationService.ExtNotificationService._log$1.debug(String.format('VerificationStatusInquiry  msin:{0}', msin));
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'VerificationStatusInquiry', { msin: msin }, Delegate.create(this, function(result) {
            successCallback.invoke(result);
            var response = result;
            var newLinkStatus = response.Optinstatus;
            if (newLinkStatus !== this._linkStatus$1) {
                this._linkStatus$1 = newLinkStatus;
                this._fireMobileLinkingStatusChangedEvent$1();
            }
        }), Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('FindSubscriber exception ' + exception.message);
            if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                this._userService$1.handleSessionTimeout(exception);
                failureCallback.invoke(exception);
            }
            else {
                failureCallback.invoke(exception);
            }
        }));
    },
    
    unverify: function ExtNotificationService_ExtNotificationService$unverify(successCallback, failureCallback, msin) {
        ExtNotificationService.ExtNotificationService._log$1.debug(String.format('Unverify msin:{0}', msin));
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'Unverify', { msin: msin }, Delegate.create(this, function(result) {
            successCallback.invoke(result);
            var response = result;
            this._linkStatus$1 = response.Optinstatus;
            this._fireMobileLinkingStatusChangedEvent$1();
        }), Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('Unverify exception ' + exception.message);
            if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                this._userService$1.handleSessionTimeout(exception);
                failureCallback.invoke(exception);
            }
            else {
                failureCallback.invoke(exception);
            }
        }));
    },
    
    subscribe: function ExtNotificationService_ExtNotificationService$subscribe(successCallback, failureCallback, extNtTypeId, mechanismId, options) {
        ExtNotificationService.ExtNotificationService._log$1.debug(String.format('Subscribe extNtType:{0}, mechanism:{1}, options:{2}', extNtTypeId, mechanismId, options));
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'Subscribe', { extNtType: extNtTypeId, mechanism: mechanismId, options: options }, successCallback, Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('Subscribe exception ' + exception.message);
            if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                this._userService$1.handleSessionTimeout(exception);
                failureCallback.invoke(exception);
            }
            else {
                failureCallback.invoke(exception);
            }
        }));
    },
    
    subscriptionStatusInquiry: function ExtNotificationService_ExtNotificationService$subscriptionStatusInquiry(successCallback, failureCallback, extNtTypeId, mechanismId) {
        ExtNotificationService.ExtNotificationService._log$1.debug(String.format('SubscriptionStatusInquiry extNtTypeId:{0}, mechanismId:{1}', extNtTypeId, mechanismId));
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'SubscriptionStatusInquiry', { extNtType: extNtTypeId, mechanism: mechanismId }, successCallback, Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('SubscriptionStatusInquiry exception ' + exception.message);
            if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                this._userService$1.handleSessionTimeout(exception);
                failureCallback.invoke(exception);
            }
            else {
                failureCallback.invoke(exception);
            }
        }));
    },
    
    unsubscribe: function ExtNotificationService_ExtNotificationService$unsubscribe(successCallback, failureCallback, extNtTypeId, mechanismId) {
        ExtNotificationService.ExtNotificationService._log$1.debug(String.format('Unsubscribe extNtTypeId:{0}, mechanismId:{1}', extNtTypeId, mechanismId));
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'Unsubscribe', { extNtType: extNtTypeId, mechanism: mechanismId }, successCallback, Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('Unsubscribe exception ' + exception.message);
            if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                this._userService$1.handleSessionTimeout(exception);
                failureCallback.invoke(exception);
            }
            else {
                failureCallback.invoke(exception);
            }
        }));
    },
    
    isUnsubscribeTokenValid: function ExtNotificationService_ExtNotificationService$isUnsubscribeTokenValid(successCallback, failureCallback, token) {
        ExtNotificationService.ExtNotificationService._log$1.debug(String.format('IsUnsubscribeTokenValid token[{0}]', token));
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'IsUnsubscribeTokenValid', { token: token }, successCallback, Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('IsUnsubscribeTokenValid exception ' + exception.message);
            if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                this._userService$1.handleSessionTimeout(exception);
                failureCallback.invoke(exception);
            }
            else {
                failureCallback.invoke(exception);
            }
        }));
    },
    
    unsubscribeWithToken: function ExtNotificationService_ExtNotificationService$unsubscribeWithToken(successCallback, failureCallback, token) {
        ExtNotificationService.ExtNotificationService._log$1.debug(String.format('UnsubscribeWithToken token[{0}]', token));
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'UnsubscribeWithToken', { token: token }, successCallback, Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('UnsubscribeWithToken exception ' + exception.message);
            if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                this._userService$1.handleSessionTimeout(exception);
                failureCallback.invoke(exception);
            }
            else {
                failureCallback.invoke(exception);
            }
        }));
    },
    
    getExtNotificationLog: function ExtNotificationService_ExtNotificationService$getExtNotificationLog(successCallback, failureCallback, from, to, pageNumber, pageSize, orderBy, orderDesc, idmmntType, idmmntmechanism) {
        ExtNotificationService.ExtNotificationService._log$1.debug('GetNotificationLog');
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'GetExtNotificationLog', { from: from, to: to, pageNumber: pageNumber, pageSize: pageSize, orderBy: orderBy, orderDesc: orderDesc, idmmnttype: idmmntType, idmmntmechanism: idmmntmechanism }, Delegate.create(this, function(result) {
            if (successCallback) {
                successCallback.invoke(result);
            }
        }), Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('GetNotificationLog exception ' + exception.message);
            if (exception.message.indexOf('Session has timed out') > 0) {
                this._userService$1.handleSessionTimeout(exception);
            }
            failureCallback.invoke(exception);
        }));
    },
    
    getExtNotificationLogTotalPages: function ExtNotificationService_ExtNotificationService$getExtNotificationLogTotalPages(successCallback, failureCallback, pageSize) {
        ExtNotificationService.ExtNotificationService._log$1.debug('GetExtNotificationLogTotalPages');
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'GetExtNotificationLogPageCount', { pageSize: pageSize }, successCallback, Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('GetNotificationLogTotalPages exception ' + exception.message);
            if (exception.message.indexOf('Session has timed out') > 0) {
                this._userService$1.handleSessionTimeout(exception);
            }
            failureCallback.invoke(exception);
        }));
    },
    
    getExtMessageLog: function ExtNotificationService_ExtNotificationService$getExtMessageLog(successCallback, failureCallback, from, to, pageNumber, pageSize, orderBy, orderDesc) {
        ExtNotificationService.ExtNotificationService._log$1.debug('GetExtMessageLog');
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'GetExtMessageLog', { from: from, to: to, pageNumber: pageNumber, pageSize: pageSize, orderBy: orderBy, orderDesc: orderDesc }, Delegate.create(this, function(result) {
            if (successCallback) {
                successCallback.invoke(result);
            }
        }), Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('GetExtMessageLog exception ' + exception.message);
            if (exception.message.indexOf('Session has timed out') > 0) {
                this._userService$1.handleSessionTimeout(exception);
            }
            failureCallback.invoke(exception);
        }));
    },
    
    getExtMessageLogTotalPages: function ExtNotificationService_ExtNotificationService$getExtMessageLogTotalPages(successCallback, failureCallback, pageSize) {
        ExtNotificationService.ExtNotificationService._log$1.debug('GetExtMessageLogTotalPages');
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'GetExtMessageLogPageCount', { pageSize: pageSize }, successCallback, Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('GetExtMessageLogTotalPages exception ' + exception.message);
            if (exception.message.indexOf('Session has timed out') > 0) {
                this._userService$1.handleSessionTimeout(exception);
            }
            failureCallback.invoke(exception);
        }));
    },
    
    supportedServices: function ExtNotificationService_ExtNotificationService$supportedServices(successCallback, failureCallback) {
        ExtNotificationService.ExtNotificationService._log$1.debug('SupportedServices');
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'SupportedServices', {}, successCallback, Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('SupportedServices exception ' + exception.message);
            if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                this._userService$1.handleSessionTimeout(exception);
                failureCallback.invoke(exception);
            }
            else {
                failureCallback.invoke(exception);
            }
        }));
    },
    
    getFilteredNtCategories: function ExtNotificationService_ExtNotificationService$getFilteredNtCategories(successCallback, failureCallback, categoryIDs) {
        ExtNotificationService.ExtNotificationService._log$1.debug('GetNtCategories');
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'GetFilteredNtCategories', { categoryIDs: categoryIDs }, successCallback, Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('GetNtCategories exception ' + exception.message);
            if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                this._userService$1.handleSessionTimeout(exception);
                failureCallback.invoke(exception);
            }
            else {
                failureCallback.invoke(exception);
            }
        }));
    },
    
    getInverseFilteredNtCategories: function ExtNotificationService_ExtNotificationService$getInverseFilteredNtCategories(successCallback, failureCallback, categoryIDs) {
        ExtNotificationService.ExtNotificationService._log$1.debug('GetNtCategories');
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'GetInverseFilteredNtCategories', { categoryIDs: categoryIDs }, successCallback, Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('GetNtCategories exception ' + exception.message);
            if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                this._userService$1.handleSessionTimeout(exception);
                failureCallback.invoke(exception);
            }
            else {
                failureCallback.invoke(exception);
            }
        }));
    },
    
    getNtCategories: function ExtNotificationService_ExtNotificationService$getNtCategories(successCallback, failureCallback) {
        ExtNotificationService.ExtNotificationService._log$1.debug('GetNtCategories');
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'GetNtCategories', {}, successCallback, Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('GetNtCategories exception ' + exception.message);
            if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                this._userService$1.handleSessionTimeout(exception);
                failureCallback.invoke(exception);
            }
            else {
                failureCallback.invoke(exception);
            }
        }));
    },
    
    getNtTypesForCategory: function ExtNotificationService_ExtNotificationService$getNtTypesForCategory(successCallback, failureCallback, idmmntCategory) {
        ExtNotificationService.ExtNotificationService._log$1.debug('GetNtTypesForCategory');
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'GetNtTypesForCategory', { IDMMNtCategory: idmmntCategory }, successCallback, Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('GetNtTypesForCategory exception ' + exception.message);
            if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                this._userService$1.handleSessionTimeout(exception);
                failureCallback.invoke(exception);
            }
            else {
                failureCallback.invoke(exception);
            }
        }));
    },
    
    getNtTypes: function ExtNotificationService_ExtNotificationService$getNtTypes(successCallback, failureCallback) {
        ExtNotificationService.ExtNotificationService._log$1.debug('GetNtTypes');
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'GetNtTypes', {}, successCallback, Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('GetNtTypes exception ' + exception.message);
            if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                this._userService$1.handleSessionTimeout(exception);
                failureCallback.invoke(exception);
            }
            else {
                failureCallback.invoke(exception);
            }
        }));
    },
    
    getNtMechanismsForType: function ExtNotificationService_ExtNotificationService$getNtMechanismsForType(successCallback, failureCallback, idmmntType) {
        ExtNotificationService.ExtNotificationService._log$1.debug('GetNtMechanismsForType');
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'GetNtMechanismsForType', { IDMMNtType: idmmntType }, successCallback, Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('GetNtMechanismsForType exception ' + exception.message);
            if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                this._userService$1.handleSessionTimeout(exception);
                failureCallback.invoke(exception);
            }
            else {
                failureCallback.invoke(exception);
            }
        }));
    },
    
    getNtMechanisms: function ExtNotificationService_ExtNotificationService$getNtMechanisms(successCallback, failureCallback) {
        ExtNotificationService.ExtNotificationService._log$1.debug('GetNtMechanisms');
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'GetNtMechanisms', {}, successCallback, Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('GetNtMechanisms exception ' + exception.message);
            if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                this._userService$1.handleSessionTimeout(exception);
                failureCallback.invoke(exception);
            }
            else {
                failureCallback.invoke(exception);
            }
        }));
    },
    
    sendNotification: function ExtNotificationService_ExtNotificationService$sendNotification(successCallback, failureCallback, IDMDLanguage, IDMMNTType, IDMMNTMechanism, customerAddress) {
        ExtNotificationService.ExtNotificationService._log$1.debug('SendNotification');
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'CreateNotification', { IDMDLanguage: IDMDLanguage, IDMMNTType: IDMMNTType, IDMMNTMechanism: IDMMNTMechanism, customerAddress: customerAddress, parameters: null }, successCallback, Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('CreateNotification exception ' + exception.message);
            if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                this._userService$1.handleSessionTimeout(exception);
                failureCallback.invoke(exception);
            }
            else {
                failureCallback.invoke(exception);
            }
        }));
    },
    
    getNtPreferencesForCustomer: function ExtNotificationService_ExtNotificationService$getNtPreferencesForCustomer(successCallback, failureCallback) {
        ExtNotificationService.ExtNotificationService._log$1.debug('GetNtPreferencesForCustomer');
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'GetNtPreferencesForCustomer', {}, successCallback, Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('GetNtPreferencesForCustomer exception ' + exception.message);
            if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                this._userService$1.handleSessionTimeout(exception);
                failureCallback.invoke(exception);
            }
            else {
                failureCallback.invoke(exception);
            }
        }));
    },
    
    setNtPreferencesForCustomer: function ExtNotificationService_ExtNotificationService$setNtPreferencesForCustomer(successCallback, failureCallback, extNtPreferences) {
        ExtNotificationService.ExtNotificationService._log$1.debug('SetNtPreferencesForCustomer');
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'SetNtPreferencesForCustomer', { ntPreferences: extNtPreferences }, successCallback, Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('SetNtPreferencesForCustomer exception ' + exception.message);
            if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                this._userService$1.handleSessionTimeout(exception);
                failureCallback.invoke(exception);
            }
            else {
                failureCallback.invoke(exception);
            }
        }));
    },
    
    resetNtPreferencesForCustomer: function ExtNotificationService_ExtNotificationService$resetNtPreferencesForCustomer(successCallback, failureCallback) {
        ExtNotificationService.ExtNotificationService._log$1.debug('ResetCustomerNotificationPreferences');
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'ResetCustomerNotificationPreferences', {}, successCallback, Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('ResetCustomerNotificationPreferences exception ' + exception.message);
            if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                this._userService$1.handleSessionTimeout(exception);
                failureCallback.invoke(exception);
            }
            else {
                failureCallback.invoke(exception);
            }
        }));
    },
    
    getSubscriptionsForCustomer: function ExtNotificationService_ExtNotificationService$getSubscriptionsForCustomer(successCallback, failureCallback) {
        ExtNotificationService.ExtNotificationService._log$1.debug('GetSubscriptionsForCustomer');
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'GetSubscriptionsForCustomer', {}, successCallback, Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('GetSubscriptionsForCustomer exception ' + exception.message);
            if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                this._userService$1.handleSessionTimeout(exception);
                failureCallback.invoke(exception);
            }
            else {
                failureCallback.invoke(exception);
            }
        }));
    },
    
    customerHasPreferences: function ExtNotificationService_ExtNotificationService$customerHasPreferences(successCallback, failureCallback, mechanisms) {
        ExtNotificationService.ExtNotificationService._log$1.debug('CustomerHasPreferences');
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'CustomerHasPreferences', { mechanisms: mechanisms }, successCallback, Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('CustomerHasPreferences exception ' + exception.message);
            if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                this._userService$1.handleSessionTimeout(exception);
                failureCallback.invoke(exception);
            }
            else {
                failureCallback.invoke(exception);
            }
        }));
    },
    
    resetCustomerPreferences: function ExtNotificationService_ExtNotificationService$resetCustomerPreferences(successCallback, failureCallback, mechanisms) {
        ExtNotificationService.ExtNotificationService._log$1.debug('ResetCustomerPreferences');
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'ResetCustomerPreferences', { mechanisms: mechanisms }, successCallback, Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('ResetCustomerPreferences exception ' + exception.message);
            if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                this._userService$1.handleSessionTimeout(exception);
                failureCallback.invoke(exception);
            }
            else {
                failureCallback.invoke(exception);
            }
        }));
    },
    
    dontSendAnyNotifications: function ExtNotificationService_ExtNotificationService$dontSendAnyNotifications(successCallback, failureCallback, mechanisms, fireEvent) {
        ExtNotificationService.ExtNotificationService._log$1.debug('DontSendAnyNotifications');
        this._environment.invokeAsync(ExtNotificationService.ExtNotificationService._serviceName$1, 'DontSendAnyNotifications', { mechanisms: mechanisms }, Delegate.create(this, function(result) {
            successCallback.invoke(result);
            if (fireEvent) {
                this._fireNotificationPreferencesChangedEvent$1();
            }
        }), Delegate.create(this, function(exception) {
            ExtNotificationService.ExtNotificationService._log$1.debug('DontSendAnyNotifications exception ' + exception.message);
            if (Framework.ExceptionUtil.getExceptionDetails(exception).get_exceptionType() === 'Com.Finsoft.Warp.Connecticut.SessionTimeoutException') {
                this._userService$1.handleSessionTimeout(exception);
                failureCallback.invoke(exception);
            }
            else {
                failureCallback.invoke(exception);
            }
        }));
    },
    
    _sessionTimeoutHandler$1: function ExtNotificationService_ExtNotificationService$_sessionTimeoutHandler$1() {
        this._userService$1.logout(Delegate.create(this, function(result) {
        }), Delegate.create(this, function(exception) {
        }));
    }
}


ExtNotificationService.ExtServiceResponse.createClass('ExtNotificationService.ExtServiceResponse');
ExtNotificationService.ExtNotificationLog.createClass('ExtNotificationService.ExtNotificationLog');
ExtNotificationService.ExtMessageLog.createClass('ExtNotificationService.ExtMessageLog');
ExtNotificationService.ExtSubscriptionParameter.createClass('ExtNotificationService.ExtSubscriptionParameter');
ExtNotificationService.ExtSubscription.createClass('ExtNotificationService.ExtSubscription');
ExtNotificationService.ExtNtParameter.createClass('ExtNotificationService.ExtNtParameter');
ExtNotificationService.ExtNtPreference.createClass('ExtNotificationService.ExtNtPreference');
ExtNotificationService.NtCategory.createClass('ExtNotificationService.NtCategory');
ExtNotificationService.ExtNtType.createClass('ExtNotificationService.ExtNtType');
ExtNotificationService.NtType.createClass('ExtNotificationService.NtType');
ExtNotificationService.NtMechanism.createClass('ExtNotificationService.NtMechanism');
ExtNotificationService.ExtNotificationService.createClass('ExtNotificationService.ExtNotificationService', Framework.AbstractService, UserService.IUserChangedListener, Framework.IPageWillChangeListener);
ExtNotificationService.ExtNotificationService._serviceName$1 = 'ExtNotificationService';
ExtNotificationService.ExtNotificationService._log$1 = Framework.Logger.getLog(ExtNotificationService.ExtNotificationService._serviceName$1);

// ---- Do not remove this footer ----
// Generated using Script# v0.5.1.0 (http://projects.nikhilk.net)
// -----------------------------------
Type.createNamespace('IVoucherService');

////////////////////////////////////////////////////////////////////////////////
// IVoucherService.IIVoucherActionListener

IVoucherService.IIVoucherActionListener = function() { };
IVoucherService.IIVoucherActionListener.prototype = {
    onIVoucherValidationResponded : null,
    onIVoucherValidationException : null
}
IVoucherService.IIVoucherActionListener.createInterface('IVoucherService.IIVoucherActionListener');


////////////////////////////////////////////////////////////////////////////////
// IVoucherService.IIVoucherContentListener

IVoucherService.IIVoucherContentListener = function() { };
IVoucherService.IIVoucherContentListener.prototype = {
    onIVoucherContentChanged : null
}
IVoucherService.IIVoucherContentListener.createInterface('IVoucherService.IIVoucherContentListener');


////////////////////////////////////////////////////////////////////////////////
// IVoucherService.IVoucherResponse

IVoucherService.IVoucherResponse = function IVoucherService_IVoucherResponse() {
}
IVoucherService.IVoucherResponse.prototype = {
    IVoucherId: 0,
    SerialNumber: null,
    ResponseSerialNumber: null,
    PIN: null,
    State: null,
    Amount: 0,
    ErrorMessage: null,
    ResultText: null,
    ErrorCode: null
}


////////////////////////////////////////////////////////////////////////////////
// IVoucherService.IVoucherContentEvent

IVoucherService.IVoucherContentEvent = function IVoucherService_IVoucherContentEvent(source) {
    this.source = source;
}
IVoucherService.IVoucherContentEvent.prototype = {
    source: null,
    _serialNumber: null,
    _pin: null,
    
    get_serialNumber: function IVoucherService_IVoucherContentEvent$get_serialNumber() {
        return this._serialNumber;
    },
    set_serialNumber: function IVoucherService_IVoucherContentEvent$set_serialNumber(value) {
        this._serialNumber = value;
        return value;
    },
    
    get_pin: function IVoucherService_IVoucherContentEvent$get_pin() {
        return this._pin;
    },
    set_pin: function IVoucherService_IVoucherContentEvent$set_pin(value) {
        this._pin = value;
        return value;
    },
    
    toString: function IVoucherService_IVoucherContentEvent$toString() {
        return 'sn: ' + this._serialNumber + ', pin: ' + this._pin;
    }
}


////////////////////////////////////////////////////////////////////////////////
// IVoucherService.IVoucherRequest

IVoucherService.IVoucherRequest = function IVoucherService_IVoucherRequest() {
}
IVoucherService.IVoucherRequest.prototype = {
    SerialNumber: null,
    PIN: null,
    PinBitmap: null
}


////////////////////////////////////////////////////////////////////////////////
// IVoucherService.IVoucherService

IVoucherService.IVoucherService = function IVoucherService_IVoucherService() {
    this._ivoucherActionListeners$1 = new Framework.ListenerInvoker(true);
    IVoucherService.IVoucherService.constructBase(this);
    this._log$1 = Framework.Logger.getLog(IVoucherService.IVoucherService._serviceName$1);
}
IVoucherService.IVoucherService.prototype = {
    _navigationService$1: null,
    _userService$1: null,
    _accountService$1: null,
    _log$1: null,
    
    setNavigationService: function IVoucherService_IVoucherService$setNavigationService(navigationService) {
        this._log$1.debug('SetNavigationService');
        this._navigationService$1 = navigationService;
    },
    
    setUserService: function IVoucherService_IVoucherService$setUserService(userService) {
        this._log$1.debug('SetUserService');
        this._userService$1 = userService;
    },
    
    setAccountService: function IVoucherService_IVoucherService$setAccountService(accountService) {
        this._log$1.debug('AccountService');
        this._accountService$1 = accountService;
    },
    
    onPageWillChange: function IVoucherService_IVoucherService$onPageWillChange() {
    },
    
    onUserChanged: function IVoucherService_IVoucherService$onUserChanged(eventSource) {
    },
    
    init: function IVoucherService_IVoucherService$init(environment, parameters) {
        this._log$1.debug(String.format('Init parameters=[{0}]', Framework.DictionaryUtil.dumpToString(parameters)));
        IVoucherService.IVoucherService.callBase(this, 'init', [ environment, parameters ]);
        environment.registerPageWillChangeListener(this);
    },
    
    start: function IVoucherService_IVoucherService$start() {
        this._log$1.debug('Start');
    },
    
    validateIVoucher: function IVoucherService_IVoucherService$validateIVoucher(successCallback, failureCallback, iVoucherRequest) {
        this._log$1.debug(String.format('validateIVoucher'));
        this._environment.invokeAsync(IVoucherService.IVoucherService._serviceName$1, 'validateIVoucher', { iVoucherRequest: iVoucherRequest }, Delegate.create(this, function(result) {
            this._accountService$1.fetchAccountsDetails();
            successCallback.invoke(result);
            this._dispatchValidationResponded$1(result);
        }), Delegate.create(this, function(exception) {
            this._log$1.debug('exception ' + exception.message);
            failureCallback.invoke(exception);
            this._dispatchValidationException$1(exception);
        }));
    },
    
    registerIVoucherActionListener: function IVoucherService_IVoucherService$registerIVoucherActionListener(iVoucherActionListener) {
        this._log$1.debug('RegisterIVoucherActionListener');
        this._ivoucherActionListeners$1.registerListener(iVoucherActionListener);
    },
    
    _dispatchValidationResponded$1: function IVoucherService_IVoucherService$_dispatchValidationResponded$1(iVoucherResponse) {
        this._log$1.debug('DispatchValidationResponded');
        this._ivoucherActionListeners$1.fireUpdateEvent(Delegate.create(this, function(listener) {
            (listener).onIVoucherValidationResponded(iVoucherResponse);
        }));
    },
    
    _dispatchValidationException$1: function IVoucherService_IVoucherService$_dispatchValidationException$1(exception) {
        this._log$1.debug('DispatchValidationException');
        this._ivoucherActionListeners$1.fireUpdateEvent(Delegate.create(this, function(listener) {
            (listener).onIVoucherValidationException(exception);
        }));
    }
}


IVoucherService.IVoucherResponse.createClass('IVoucherService.IVoucherResponse');
IVoucherService.IVoucherContentEvent.createClass('IVoucherService.IVoucherContentEvent');
IVoucherService.IVoucherRequest.createClass('IVoucherService.IVoucherRequest');
IVoucherService.IVoucherService.createClass('IVoucherService.IVoucherService', Framework.AbstractService, Framework.IPageWillChangeListener, UserService.IUserChangedListener);
IVoucherService.IVoucherService._serviceName$1 = 'IVoucherService';

// ---- Do not remove this footer ----
// Generated using Script# v0.5.1.0 (http://projects.nikhilk.net)
// -----------------------------------
// ---- Do not remove this footer ----
// Generated using Script# v0.5.1.0 (http://projects.nikhilk.net)
// -----------------------------------
