{"version":3,"file":"sm.portal.vm.continuingEducation.min.js","names":["jQuery","sm","portal","extend","vm","custom","continuing_education","LocalizeKeys","HideTaxID","HideHispanic","HideVeteran","HideCurrentEmployerSearch","HideAddressFormat","ResidentState","TaxIdTemplate","CurrentEmployerTemplate","AddressFormatTemplate","HideCoreFields","LoadTemplates","UpdateAddressFields","data","defaultTemplate","availableTemplates","forEach","element","DefaultSiteTemplate","DefaultCountryTemplate","IsObsolete","selectedTemplateID","ID","BusinessMeaningName","UpdateEmploymentDataItem","dataItem","CurrentEmployerFlexi","ko","observable","settings","UpdateEmploymentInfo","stdEmploymentInformation","FlexiFieldValues","CurrentEmployer","currentEmployerFlexi","RedirectToCustomPage","params","btoa","ajax","url","window","AdaptorAjaxURI","type","action","success","textStatus","jqXHR","location","error","exception"],"sources":["customization/assets/js/canada/continuing_education/sm.portal.vm.continuingEducation.js"],"mappings":"CAAA,SAAWA,QAEkB,IAAdC,GAAGC,QACVF,EAAOG,OAAOF,GAAI,CAAEC,OAAQ,CAAC,SAEL,IAAjBD,GAAGC,OAAOE,IACjBJ,EAAOG,OAAOF,GAAGC,OAAQ,CAAEE,GAAI,CAAC,SAED,IAAxBH,GAAGC,OAAOE,GAAGC,QACpBL,EAAOG,OAAOF,GAAGC,OAAOE,GAAI,CAAEC,OAAQ,CAAC,SAEa,IAA7CJ,GAAGC,OAAOE,GAAGC,OAAOC,sBAC3BN,EAAOG,OAAOF,GAAGC,OAAOE,GAAGC,OAAQ,CAAEC,qBAAsB,CAAC,IAyEhEN,EAAOG,QAAO,EAAMF,GAAGC,OAAOE,GAAGC,OAAOC,qBAAsB,CAC1DC,aAvEJ,WAaE,MAZW,CACTC,WAAY,EACZC,cAAe,EACfC,aAAc,EACdC,2BAA4B,EAC5BC,mBAAoB,EACpBC,cAAgB,WAChBC,cAAgB,4BAChBC,wBAA0B,sCAC1BC,sBAAwB,oCACxBC,gBAAgB,EAGpB,EA0DIC,cAxDJ,WAGI,MAFW,CAAC,sBAGhB,EAqDIC,oBAnDJ,SAA6BC,GACzB,IAAIC,GAAkB,EACtBD,EAAKE,qBAAqBC,SAAQ,SAAUC,GACpCA,EAAQC,uBAAyBD,EAAQE,0BAAoD,GAAxBF,EAAQG,cAC7EP,EAAKQ,mBAAmBJ,EAAQK,MAChCR,GAAkB,GAEoB,iCAAjCG,EAAQM,uBAA6DN,EAAQG,cAAiBN,EAI7D,8BAAjCG,EAAQM,uBAA0DN,EAAQG,cAAiBN,GAChGD,EAAKQ,mBAAmBJ,EAAQK,OAJhCT,EAAKQ,mBAAmBJ,EAAQK,MAChCR,GAAkB,EAK1B,GACJ,EAqCIU,yBAnCJ,SAAkCX,GAC9BA,EAAKY,SAASC,qBAAuBC,GAAGC,WAAWf,EAAKgB,SAASH,qBACrE,EAkCII,qBAhCJ,SAA8BjB,GAC1BA,EAAKkB,yBAAyBC,iBAAmB,CAC7CC,gBAAiB,CAAC,CACdA,gBAAiBpB,EAAKqB,yBAGlC,EA2BIC,qBAzBJ,WACI,IAAIC,EAAS,SAAWC,KAAK,uBAE7B5C,EAAO6C,KAAK,CACRC,IAAKC,OAAOC,eACZC,KAAM,MACN7B,KAAM,CACF8B,OAAQ,eACRP,OAAQA,GAEZQ,QAAS,SAAU/B,EAAMgC,EAAYC,GACjCN,OAAOO,SAASlC,CACpB,EACAmC,MAAO,SAAUF,EAAOG,GACpBT,OAAOO,SAAW,YACtB,GAER,GAWH,CA9FD,CA8FGtD","ignoreList":[],"sourcesContent":["(function (jQuery, undefined) {\r\n\r\n if (typeof sm.portal === \"undefined\") {\r\n jQuery.extend(sm, { portal: {} });\r\n }\r\n if (typeof sm.portal.vm === \"undefined\") {\r\n jQuery.extend(sm.portal, { vm: {} });\r\n }\r\n if (typeof sm.portal.vm.custom === \"undefined\") {\r\n jQuery.extend(sm.portal.vm, { custom: {}});\r\n }\r\n if (typeof sm.portal.vm.custom.continuing_education === \"undefined\") {\r\n jQuery.extend(sm.portal.vm.custom, { continuing_education: {}});\r\n }\r\n\r\n function LocalizeKeys() {\r\n var keys = {\r\n HideTaxID : true,\r\n HideHispanic : true,\r\n HideVeteran : true,\r\n HideCurrentEmployerSearch : true,\r\n HideAddressFormat : true,\r\n ResidentState : 'Province',\r\n TaxIdTemplate : 'ContinuingEducation.TaxId',\r\n CurrentEmployerTemplate : 'ContinuingEducation.CurrentEmployer',\r\n AddressFormatTemplate : 'ContinuingEducation.AddressFormat',\r\n HideCoreFields: true\r\n }\r\n return keys; \r\n }\r\n\r\n function LoadTemplates() {\r\n var data = ['ContinuingEducation'];\r\n\r\n return data;\r\n }\r\n\r\n function UpdateAddressFields(data) {\r\n var defaultTemplate = false;\r\n data.availableTemplates().forEach(function (element) {\r\n if (element.DefaultSiteTemplate() && element.DefaultCountryTemplate() && element.IsObsolete() == false) {\r\n data.selectedTemplateID(element.ID());\r\n defaultTemplate = true;\r\n }\r\n else if (element.BusinessMeaningName() == \"MailAddressTemplate.AllFields\" && !element.IsObsolete() && !defaultTemplate) {\r\n data.selectedTemplateID(element.ID());\r\n defaultTemplate = true;\r\n }\r\n else if (element.BusinessMeaningName() == \"MailAddressTemplate.Simple\" && !element.IsObsolete() && !defaultTemplate) {\r\n data.selectedTemplateID(element.ID());\r\n }\r\n });\r\n }\r\n\r\n function UpdateEmploymentDataItem(data) {\r\n data.dataItem.CurrentEmployerFlexi = ko.observable(data.settings.CurrentEmployerFlexi);\r\n }\r\n\r\n function UpdateEmploymentInfo(data) {\r\n data.stdEmploymentInformation.FlexiFieldValues = {\r\n CurrentEmployer: [{\r\n CurrentEmployer: data.currentEmployerFlexi()\r\n }]\r\n }\r\n }\r\n\r\n function RedirectToCustomPage() {\r\n var params = 'title=' + btoa('CA-Online Enrolment');\r\n\r\n jQuery.ajax({\r\n url: window.AdaptorAjaxURI,\r\n type: 'GET',\r\n data: {\r\n action: 'get_page_url',\r\n params: params\r\n },\r\n success: function (data, textStatus, jqXHR) {\r\n window.location=data;\r\n },\r\n error: function (jqXHR, exception) {\r\n window.location = '/index.php';\r\n }\r\n });\r\n }\r\n\r\n jQuery.extend(true, sm.portal.vm.custom.continuing_education, {\r\n LocalizeKeys: LocalizeKeys,\r\n LoadTemplates: LoadTemplates,\r\n UpdateAddressFields: UpdateAddressFields,\r\n UpdateEmploymentDataItem: UpdateEmploymentDataItem,\r\n UpdateEmploymentInfo: UpdateEmploymentInfo,\r\n RedirectToCustomPage: RedirectToCustomPage\r\n });\r\n\r\n})(jQuery);"]}