123456789101112131415 |
- /**
- * IBM Confidential OCO Source Materials IBM Business Platform: CA Share
- * (C) Copyright IBM Corp. 2017, 2018
- *
- * The source code for this program is not published or otherwise divested of
- * its trade secrets, irrespective of what has been deposited with the U.S.
- * Copyright Office
- */
- define("bi/schedule/app/appControler",["jquery","q","bi/sharecommon/utils/translator"],function(e,t,i){var s={};return s.SUBSCRIPTION_SLIDEOUT_PANE_WIDTH="400px",s.createUserCredential=function(e,i){var s=t.defer();return require(["bi/schedule/service/service"],function(t){t.createUserCredential(e,i).then(function(){s.resolve()},function(e){s.reject(e)})}),s.promise},s.getUserCredential=function(e){var i=t.defer();return require(["bi/schedule/service/service"],function(t){t.getUserCredential(e).then(function(){i.resolve()},function(){i.reject()})}),i.promise},s.createSchedule=function(e,i){var s=t.defer();return require(["bi/schedule/service/service"],function(t){t.createOrUpdateSchedule(e,i).then(function(e){s.resolve(e)}).fail(function(e){s.reject(e)})}),s.promise},s.updateSchedule=function(e,i){var s=t.defer();return require(["bi/schedule/service/service"],function(t){t.createOrUpdateSchedule(e,i).then(function(e){s.resolve(e)}).fail(function(e){s.reject()})}),s.promise},s.deleteSchedule=function(e,i){var s=t.defer();return require(["bi/schedule/service/service"],function(t){t.deleteSchedule(e,i).then(function(e){s.resolve()}).fail(function(e){s.reject()})}),s.promise},s.getSchedule=function(e,i){var s=t.defer();return require(["bi/schedule/service/service"],function(t){t.getSchedule(e,i).then(function(e){s.resolve(e)}).fail(function(e){s.reject(e)})}),s.promise},s.getRawSchedule=function(e,i){var s=t.defer();return require(["bi/schedule/service/service"],function(t){t.readRawSchedule(e,i).then(function(e){return s.resolve(e)}.bind(this)).fail(function(e){return s.reject(e)})}),s.promise},s.updateSaveToCloudOptions=function(e,i,n){if(e&&i){var l=t.defer();return require(["bi/schedule/service/service"],function(t){s.getRawSchedule(e,n).then(function(e){return t.updateScheduleCloudOptions(e.data[0],i,n)}).then(function(e){return l.resolve(e)}.bind(this)).fail(function(e){return l.reject(e)})}),l.promise}return Promise.resolve()},s.getSingleSchedule=function(e,i){var s=t.defer();return require(["bi/schedule/service/service"],function(t){t.getSingleSchedule(e,i).then(function(e){s.resolve(e)}).fail(function(e){})}),s.promise},s.showSubscriptionPane=function(e,n,l,a){var r=t.defer(),o={module:"bi/schedule/views/SubscriptionView",glassContext:e,descriptor:n};return void 0!==a&&(o.callback=a),e.appController.showSlideOut({position:"right",content:o,width:s.SUBSCRIPTION_SLIDEOUT_PANE_WIDTH,enableTabLooping:!0,label:i.translate("subscription_header_region"),launchPoint:l}),r.promise},s.showSubscriptionManagementPane=function(e){var i=t.defer(),s={id:"subscribe_mgmt",content:{}};return e.appController.openAppView("subscribe_mgmt",s),i.resolve(),i.promise},s.createSubscription=function(e,i){var s=t.defer();return require(["bi/schedule/service/service"],function(t){t.createSubscription(e,i).then(function(e){s.resolve()}).fail(function(e){s.reject()})}),s.promise},s.updateSubscription=function(e,i){var s=t.defer();return require(["bi/schedule/service/service"],function(t){t.updateSubscription(e,i).then(function(e){s.resolve(e)}).fail(function(e){s.reject()})}),s.promise},s.getSubscriptions=function(e){var i=t.defer();return require(["bi/schedule/service/service"],function(t){t.getSubscriptions(e).then(function(e){i.resolve(e)}).fail(function(e){i.reject(e)})}),i.promise},s.deleteSubscription=function(e,i){var s=t.defer();return require(["bi/schedule/service/service"],function(t){t.deleteSubscription(e,i).then(function(e){s.resolve(e)}).fail(function(e){s.reject(e)})}),s.promise},s.getSubscriptionDetails=function(e,i){var s=t.defer();return require(["bi/schedule/service/service"],function(t){t.getSubscriptionDetails(e,i).then(function(e){s.resolve(e)}).fail(function(e){s.reject(e)})}),s.promise},s.getSubscriptionRunHistory=function(e,i){var s=t.defer();return require(["bi/schedule/service/service"],function(t){t.getObjectProperties(e,i).then(function(e){s.resolve(e)}).fail(function(e){s.reject(e)})}),s.promise},s.showVersionsPane=function(e,t,s){var n={module:"bi/content_apps/VersionsView",glassContext:e,objectInformation:t.data[0]};e.appController.showSlideOut({position:"right",content:n,width:"350px",enableTabLooping:!0,label:i.translate("schedule_subscription_version_aria_label"),launchPoint:s})},s.getPrinters=function(e){var i=t.defer();return require(["bi/schedule/service/service"],function(t){t.getPrinters(e).then(function(e){i.resolve(e)}).fail(function(e){i.reject(e)})}),i.promise},s.getArchiveLocations=function(e){var i=t.defer();return require(["bi/schedule/service/service"],function(t){t.getArchiveLocations(e).then(function(e){i.resolve(e)}).fail(function(e){i.reject(e)})}),i.promise},s.getS3ConnectionDetails=function(e){var i=t.defer();return require(["bi/schedule/service/service"],function(t){t.getS3ConnectionDetails(e).then(function(e){i.resolve(e)}).fail(function(e){i.reject(e)})}),i.promise},s.getS3LocationsDetails=function(e,i){var s=t.defer();return require(["bi/schedule/service/service"],function(t){t.getS3LocationsDetails(e,i).then(function(e){s.resolve(e)}).fail(function(e){s.reject(e)})}),s.promise},s.getS3LocationParentConnectionID=function(e,i){var s=t.defer();return require(["bi/schedule/service/service"],function(t){t.getS3LocationParentConnectionID(e,i).then(function(e){s.resolve(e)}).fail(function(e){s.reject(e)})}),s.promise},s}),define("bi/sharecommon/utils/simpledoT",["doT"],function(e){var t=e;return t.NOT_REPLACED="__NOT_REPLACED__",t.options={verbose:!1},t.simpleTemplate=function(i){var s=i;return t.options.verbose&&(s=i.replace(/\{\{(=[\s\S]+?(\}?)+)\}\}/g,"{{$1 || '"+t.NOT_REPLACED+"($1)'}}")),e.template(s)},t}),define("text!bi/schedule/templates/ScheduleView.html",[],function(){return'<!-- /*\n * Licensed Materials - Property of IBM\n *\n * IBM Cognos Products: SHARE\n *\n * (C) Copyright IBM Corp. 2015, 2017\n *\n * US Government Users Restricted Rights - Use, duplication or disclosure\n * restricted by GSA ADP Schedule Contract with IBM Corp.\n */ -->\n<div>\n <div class="schedule_section schedule_type_section">\n <div class="schedule_input_section schedule_type_input_selector" id="schedule_type_selector_container_{{=it.uniqueid}}"></div>\n </div>\n\n\n <div class="schedule_section schedule_period_section">\n <div class="schedule_datetime_range_picker"></div>\n <div class="invalid_input_warning_message"></div>\n <div class="schedule_cadence_picker"></div>\n </div>\n\n\n <div class="schedule_section schedule_options_section">\n\n {{? it.showOptions}}\n\n <!-- Output Format -->\n <div class="schedule_input_section options_picker schedule_input_section_first_option schedule_output_format_picker">\n <div class="schedule_form_label format_label">\n <label id=\'schedule_output_{{=it.uniqueid}}\' class="schedule_label">{{=it.schedule_output_label}}</label>\n </div>\n <div class="schedule_form_input schedule_format_icon_list">\n <div class="output_format_list clearfix"></div>\n <button class="btn btn-link rightArrow output_format_toggler" aria-label="{{=it.schedule_output_label}}"\n aria-haspopup="true"></button>\n </div>\n </div>\n\n <!-- Delivery Options -->\n <div class="schedule_input_section options_picker schedule_delivery_picker">\n <div class="delivery_picker">\n <div class="schedule_form_label delivery_label">\n <label id=\'schedule_delivery_{{=it.uniqueid}}\' class="schedule_label">{{=it.schedule_delivery_label}}</label>\n </div>\n <div class="schedule_form_input">\n <div class="delivery_list clearfix"></div>\n <button class="btn btn-link rightArrow delivery_toggler" aria-label="{{=it.schedule_delivery_label}}"\n aria-haspopup="true"></button>\n </div>\n </div>\n </div>\n\n {{? it.canShowPrompt}}\n <!-- Report Prompts -->\n <div class="schedule_input_section">\n <div class="schedule_form_label">\n <label id=\'prompt_label{{=it.uniqueid}}\' class="schedule_label">{{=it.schedule_prompts_label}}</label>\n </div>\n <div class="schedule_form_input clickable prompt_picker_target">\n <div id="prompt_value{{=it.uniqueid}}" class="schedule_form_value currentPromptValues"></div>\n <button class="btn btn-link rightArrow output_prompt_toggler" aria-label="{{=it.schedule_prompts_label}}"\n aria-haspopup="true"></button>\n </div>\n </div>\n {{?}}\n\n <!-- Language Selection -->\n <div class="schedule_input_section options_picker schedule_language_picker">\n <div class="schedule_form_label">\n <label class="schedule_label">{{=it.schedule_languages_label}}</label>\n </div>\n\n <div class="schedule_form_input schedule_format_icon_list">\n <div class="output_language_list clearfix"></div>\n <button class="btn btn-link rightArrow schedule_language_option_toggler" aria-label="{{=it.schedule_languages_label}}"\n aria-haspopup="true"></button>\n </div>\n </div>\n\n <!-- PDF Options -->\n {{? it.showPDFOption}}\n <div class="schedule_input_section options_picker schedule_pdf_options_picker" role="button" aria-label="{{=it.schedule_select_text}}"\n aria-haspopup="true">\n <div class="schedule_form_label">\n <label class="schedule_label">{{=it.schedule_pdf_options_label}}</label>\n </div>\n <div class="schedule_form_input">\n <div class="schedule_select_toggler_label">{{=it.schedule_select_text}}</div>\n </div>\n </div>\n {{?}}\n\n {{? it.canBurst}}\n <div class="schedule_input_section">\n <div class="schedule_burst_option_container"></div>\n </div>\n {{?}}\n\n {{?}}\n\n {{? it.canShowClassic}}\n <div style="padding-bottom: 10px;">\n <a class="classicViewLink">{{=it.schedule_classic_view_label}}</a>\n </div>\n {{?}}\n <div class="new_schedule_panel_footer clearfix">\n <div class="pull-right" role="region" aria-label="{{=it.schedule_controls_description}}">\n <button class="new_schedule_panel_button schedule_primary_button">{{=it.schedule_create_btn}}</button>\n <button class="new_schedule_panel_button schedule_secondary_button">{{=it.schedule_cancel_btn}}</button>\n </div>\n </div>\n </div>\n <div class="progress-overlay"></div>\n</div>\n'}),define("bi/schedule/utils/htmlIds",[],function(){var e={SCHEDULE_BUTTON_CONTAINER:"schedule_top_container",SCHEDULE_CONTAINER:"schedule_container",SCHEDULE_BUTTON:"schedule_button",REPORT_ID:"SCH_reportid",CREATE_BUTTON:"createScheduleBtn",CANCEL_SCHEDULE_BUTTOM:"cancelScheduleBtn",CLOSE_SCHEDULE:"close_schedule",SCHEDULE_PANEL_MESSAGE:"sch_panel_msg",SCHEDULE_VIEW_CSS:"schedule_view_css",SCHEDULE_CONTENT_APP_VIEW:"schedule_content_app_view",SCHEDULE_ASSET_ID:"schedule_asset_id",SCHEDULE_NAME:"schedule_name",SCHEDULE_CREATE_BUTTON:"scheduleCreateBtn",SCHEDULE_CANCEL_BUTTON:"scheduleCancelBtn",SCHEDULE_AVAILABLE_SCHEDULE:"available_schedule",SCHEDULE_NEW_SCHEDULE:"new_schedule",SCHEDULE_PANEL_CLOSE:"schedule_pane_back",SCHEDULE_WEEK_DAY_EVERY_N:"schedule_weekly_every_n",SCHEDULE_WEEKLY_MONDAY:"scheduleWeeklyMonday",SCHEDULE_WEEKLY_TUESDAY:"scheduleWeeklyTuesday",SCHEDULE_WEEKLY_WEDNESDAY:"scheduleWeeklyWednesday",SCHEDULE_WEEKLY_THURSDAY:"scheduleWeeklyThursday",SCHEDULE_WEEKLY_FRIDAY:"scheduleWeeklyFriday",SCHEDULE_WEEKLY_SATURDAY:"scheduleWeeklySaturday",SCHEDULE_WEEKLY_SUNDAY:"scheduleWeeklySunday",SCHEDULE_WEEKLY_REPEAT_CHECKBOX:"schedule_weekly_time_interval_checkbox",SCHEDULE_WEEKLY_REPEAT_INPUT:"schedule_weekly_repeat_input_field",SCHEDULE_WEEKLY_TIME_DROP_DOWN:"schedule_weekly_repeat_time_drop_down"};return e.toCssSelector=function(e){return"#"+e},e}),define("bi/schedule/views/CadencePickerView",["bi/commons/ui/View","bi/schedule/app/appControler","jquery","bi/sharecommon/utils/translator","q","bi/sharecommon/utils/simpledoT","bi/schedule/utils/htmlIds","underscore"],function(e,t,i,s,n,l,a,r,o){"use strict";var d=e.extend({everyNperiods:1,init:function(t){i.extend(this,t),e.inherited("init",this,[t])},render:function(){var e=i.Deferred();return e.resolve(this),e.promise()},toDescriptor:function(e){return e},validate:function(e){return e}});return d}),define("text!bi/schedule/templates/DateTimeRangeCadencePicker.html",[],function(){return'<!-- /*\n * Licensed Materials - Property of IBM\n * \n * IBM Cognos Products: SHARE\n * \n * (C) Copyright IBM Corp. 2016\n * \n * US Government Users Restricted Rights - Use, duplication or disclosure\n * restricted by GSA ADP Schedule Contract with IBM Corp.\n */ -->\n <div class="schedule_input_section schedule_input_section_first_option">\n <div class="schedule_date_section_start">\n <div class="schedule_date_time_range_form_label">\n <label class="schedule_date schedule_label">{{=it.schedule_datepicker_start}}</label>\n </div>\n <!-- Date start -->\n <div class="schedule_date_range_input">\n <div class="schedule_start_container schedule_period_start"></div>\n </div>\n <!-- Time start -->\n <div class="schedule_time_range_input">\n <div class="schedule_start_container schedule_time_start"></div>\n </div>\n </div>\n <div class="schedule_date_section_end">\n <div class="schedule_date_time_range_form_label">\n <label class="schedule_date schedule_label">{{=it.schedule_datepicker_end}}</label>\n </div>\n <!-- Date end -->\n <div class="schedule_date_range_input">\n <div class="schedule_end_container schedule_period_end"></div>\n </div>\n <!-- Time end -->\n <div class="schedule_time_range_input">\n <div class="schedule_end_container schedule_time_end"></div>\n </div>\n </div>\n <div class="no_endDate_checkbox"></div>\n </div>\n'}),define("bi/schedule/views/DateTimeRangeCadencePickerView",["bi/schedule/views/CadencePickerView","bi/schedule/app/appControler","jquery","bi/sharecommon/utils/translator","bi/content_apps/utils/GlassContextHelper","q","moment-timezone","bi/sharecommon/utils/simpledoT","text!bi/schedule/templates/DateTimeRangeCadencePicker.html","underscore","bi/commons/ui/widgets/DatePicker","bi/commons/ui/widgets/TimePicker","bi/commons/ui/properties/CheckBox","bi/commons/utils/DateTimeUtils"],function(e,t,i,s,n,l,a,r,o,d,c,h,u,_){"use strict";var p=e.extend({init:function(e){p.inherited("init",this,arguments),d.extend(this,e),this.descriptor=this.objectInformation.descriptor,this.isEditMode="undefined"!=typeof this.descriptor,this.noEndDateCheckbox=null,this.uniqueId=d.uniqueId(),this.timezone=this.glassContext.services.userProfile.preferences.timeZoneID,this.locale=this._determineDateLocale(),this.logger=this.glassContext.getCoreSvc&&this.glassContext.getCoreSvc(".Logger")},_determineDateLocale:function(){var e=n.getUserPreference(this.glassContext,"productLocale"),t=n.getUserPreference(this.glassContext,"contentLocale");return e===t.substring(0,2)?t:e},_renderDateStartEndPeriod:function(e){var t=a.tz(this.timezone).startOf("day"),i=this.isEditMode?a.utc(this.descriptor.scheduleInfo.startDate).toDate():t.toDate();return this.startDate=new c({$el:this.$el.find(".schedule_period_start"),ariaLabelText:e.schedule_datepicker_start,timezone:this.timezone,locale:this.locale,logger:this.logger,attributes:{inputFieldDate:i}}),this.startDate.render().then(function(){var t=new Date(i);return t.setMonth(t.getMonth()+3),this.isEditMode&&"onDate"===this.descriptor.scheduleInfo.endType&&(t=a.utc(this.descriptor.scheduleInfo.endDate).toDate()),this.endDate=new c({$el:this.$el.find(".schedule_period_end"),ariaLabelText:e.schedule_datepicker_end,timezone:this.timezone,locale:this.locale,logger:this.logger,attributes:{defaultDate:"+3m",inputFieldDate:t}}),this.endDate.render()}.bind(this))},_renderNoEndDateCheckBox:function(){var e=!1;this.isEditMode&&this.descriptor.scheduleInfo&&this.descriptor.scheduleInfo.endType&&"onDate"!=this.descriptor.scheduleInfo.endType&&(this.$el.find(".schedule_date_section_end").hide(),e=!0),this.noEndDateCheckbox=new u({id:"schedule_noEndDate_checkbox_"+this.uniqueId,el:this.$el.find(".no_endDate_checkbox"),name:"schedule_DateTimeRange_noEndDate",label:s.translate("schedule_date_noEndDate"),ariaLabel:s.translate("schedule_date_noEndDate"),checked:e,controlOnLeft:!0,onChange:this._hideShowEndDate.bind(this)}),this.noEndDateCheckbox.doRender()},render:function(){var e=l.defer(),t=r.simpleTemplate(o),i={schedule_datepicker_label:s.translate("schedule_datepicker_label"),schedule_datepicker_start:s.translate("period_start_label"),schedule_datepicker_end:s.translate("period_end_label"),schedule_timepicker_label:s.translate("schedule_timepicker_label"),schedule_timepicker_start:s.translate("period_start_time_label"),schedule_timepicker_end:s.translate("period_end_time_label"),uniqueid:this.uniqueId};return this.$el.append(t(i)),this._renderDateStartEndPeriod(i).then(function(){this._renderDateTimeRangeTimePickers(),this._renderNoEndDateCheckBox(),e.resolve(this)}.bind(this)),e.promise},toDescriptor:function(e){var t=this.startDate.getDateAsISOString(),i=a(t).toDate(),s=this.rangeStartTime.getDateTimeUTC(i),n=this.noEndDateCheckbox.isChecked()?"indefinite":"onDate",l="";if("onDate"===n){var r=this.endDate.getDateAsISOString(),o=a(r).toDate();l=this.rangeEndTime.getDateTimeUTC(o)}return e.startDate=s,e.endDate=l,e.endType=n,e},validate:function(e){var t={},i=this.noEndDateCheckbox.isChecked(),n=this.$el.find(".schedule_period_start"),l=this.$el.find(".schedule_period_end");n.removeAttr("aria-invalid aria-describedby"),l.removeAttr("aria-invalid aria-describedby");var a=this.$el.find(".schedule_time_start"),r=this.$el.find(".schedule_time_end");if(a.removeAttr("aria-invalid aria-describedby"),r.removeAttr("aria-invalid aria-describedby"),this.startDate.isValidDate())if(i||this.endDate.isValidDate())if(this.rangeStartTime.isValidTime())if(i||this.rangeEndTime.isValidTime()){if(this.startDate.isValidDate()&&this.endDate.isValidDate()&&!i){var o=this.startDate.getDateObj(),d=this.endDate.getDateObj();o>d&&(t.param1=s.translate("schedule_period"),t.param2=s.translate("schedule_datepicker_label"),e.push(s.translate("schedule_invalid_date_range",t)),l.attr({"aria-invalid":"true","aria-describedby":e[0]}))}}else t.param1=s.translate("schedule_period"),t.param2=s.translate("period_end_label"),e.push(s.translate("schedule_invalid_time",t)),r.attr({"aria-invalid":"true","aria-describedby":e[0]});else t.param1=s.translate("schedule_period"),t.param2=s.translate("period_start_label"),e.push(s.translate("schedule_invalid_time",t)),a.attr({"aria-invalid":"true","aria-describedby":e[0]});else t.param1=s.translate("schedule_period"),t.param2=s.translate("schedule_datepicker_label"),t.param3=s.translate("period_end_label"),e.push(s.translate("schedule_invalid_date",t)),l.attr({"aria-invalid":"true","aria-describedby":e[0]});else t.param1=s.translate("schedule_period"),t.param2=s.translate("schedule_datepicker_label"),t.param3=s.translate("period_start_label"),e.push(s.translate("schedule_invalid_date",t)),n.attr({"aria-invalid":"true","aria-describedby":e[0]});return e},_renderDateTimeRangeTimePickers:function(){this.rangeStartTime=new h({$el:this.$el.find(".schedule_time_start"),timezone:this.timezone,ariaLabel:s.translate("period_start_time_label"),attributes:{showMeridian:!_.is24HrFormat(this.locale)}}),this.rangeStartTime.render(),this.rangeEndTime=new h({$el:this.$el.find(".schedule_time_end"),timezone:this.timezone,ariaLabel:s.translate("period_end_time_label"),attributes:{showMeridian:!_.is24HrFormat(this.locale)}}),this.rangeEndTime.render(),this.isEditMode&&(this.descriptor.scheduleInfo&&this.descriptor.scheduleInfo.startDate&&this.rangeStartTime.setDateTimeUTC(this.descriptor.scheduleInfo.startDate),this.descriptor.scheduleInfo&&this.descriptor.scheduleInfo.endDate&&this.rangeEndTime.setDateTimeUTC(this.descriptor.scheduleInfo.endDate))},_hideShowEndDate:function(e,t){t?this.$el.find(".schedule_date_section_end").hide():this.$el.find(".schedule_date_section_end").show()}});return p}),define("text!bi/schedule/templates/DailyCadencePicker.html",[],function(){return'<!-- /*\n * Licensed Materials - Property of IBM\n * \n * IBM Cognos Products: SHARE\n * \n * (C) Copyright IBM Corp. 2015\n * \n * US Government Users Restricted Rights - Use, duplication or disclosure\n * restricted by GSA ADP Schedule Contract with IBM Corp.\n */ -->\n <div class="schedule_input_section propertyUIControl">\n\n <div class="schedule_form_label">\n <label class="schedule_label schedule_daily_label" for="schDaily_every_{{=it.uniqueid}}">{{=it.schedule_every_label}}</label>\n </div>\n <div class="schedule_form_input">\n <div class="schedule_dailyinterval_controls_container">\n <input id="schDaily_every_{{=it.uniqueid}}" class="schedule_input_field schedule_every_days_input" type="text" value="{{=it.defaultPeriod}}" maxlength="3"></input>\n <div class="schedule_frequency_daily_container" id="schedule_frequency_container_{{=it.uniqueid}}"></div>\n </div>\n </div>\n </div>\n <div class="schedule_daily_interval_container"></div>\n \n'}),define("text!bi/schedule/templates/DailyIntervalCadencePicker.html",[],function(){return'<!-- /*\n * Licensed Materials - Property of IBM\n * \n * IBM Cognos Products: SHARE\n * \n * (C) Copyright IBM Corp. 2015, 2016\n * \n * US Government Users Restricted Rights - Use, duplication or disclosure\n * restricted by GSA ADP Schedule Contract with IBM Corp.\n */ -->\n <div class="schedule_input_section schedule_daily_interval_container">\n <!-- Radio group now becomes a checkbox -->\n <div id="schedule_daily_interval_cadence_picker_container_{{=it.uniqueid}}" class="schedule_interval_checkbox"></div>\n </div>\n <div class="schedule_indent schedule_dailyinterval">\n <div class="schedule_form_space"> \n <div class="schedule_form_label">\n <label class="schedule_label" for="schWeekly_run_every_{{=it.uniqueid}}">{{=it.schedule_repeat_label}}</label>\n </div>\n <div class="schedule_dailyinterval_controls_container">\n <input id="schWeekly_run_every_{{=it.uniqueid}}" class="schedule_input_field schedule_run_every_input" type="text" value="{{=it.defaultPeriod}}" maxlength="3"></input>\n <div id="schedule_daily_time_interval_selector_container_{{=it.uniqueid}}" class="schedule_daily_time_interval_selector_container"></div>\n </div>\n </div>\n <div class="schedule_form_space"> \n <div class="schedule_form_label"> \n <label class="schedule_date schedule_label">{{=it.schedule_timepicker_label}}</label> \n </div>\n <div class="schedule_form_input schedule_interval_time_container"> \n <div class="schedule_date_section">\n <div class="schedule_form_label">\n <label class="schedule_date schedule_label">{{=it.schedule_timepicker_start}}</label>\n </div>\n <div class="schedule_form_input">\n <div class="schedule_start_container schedule_time_interval_start"></div>\n </div>\n </div>\n \n <div class="schedule_date_section">\n <div class="schedule_form_label">\n <label class="schedule_date schedule_label">{{=it.schedule_timepicker_end}}</label>\n </div>\n <div class="schedule_form_input">\n <div class="schedule_end_container schedule_time_interval_end"></div>\n </div>\n </div>\n </div> \n </div> \n </div>\n'}),define("bi/schedule/views/DailyIntervalCadencePickerView",["bi/schedule/views/CadencePickerView","bi/schedule/app/appControler","jquery","bi/sharecommon/utils/translator","q","momentjs","bi/sharecommon/utils/simpledoT","text!bi/schedule/templates/DailyIntervalCadencePicker.html","underscore","bi/commons/ui/widgets/TimePicker","bi/commons/ui/properties/CheckBox","bi/commons/ui/properties/DropDown","bi/commons/utils/DateTimeUtils","bi/content_apps/utils/GlassContextHelper"],function(e,t,i,s,n,l,a,r,o,d,c,h,u,_){"use strict";var p=e.extend({init:function(e){p.inherited("init",this,arguments),o.extend(this,e),this.descriptor=this.objectInformation.descriptor,this.isEditMode="undefined"!=typeof this.descriptor,this.dailyIntervalCheckbox=null,this.uniqueId=o.uniqueId(),this.frequencyTypeSelector=null,this.renderDailyIntervalCheckbox=!1,this.timezone=_.getUserPreference(this.glassContext,"timeZoneID"),this.locale=this._determineDateLocale()},render:function(){var e=n.defer(),t=a.simpleTemplate(r),i=1;if(this.isEditMode&&this.descriptor.intradayRecurrence){var l=this.descriptor.intradayRecurrence.intradayRecurrenceInterval;i=l.substring(2,l.length-1)}var o={daily_time_interval_label:s.translate("daily_time_interval_label"),schedule_repeat_label:s.translate("schedule_repeat_label"),schedule_time_dropdown_hours_t:s.translate("schedule_time_dropdown_hours_t"),schedule_time_dropdown_minutes_t:s.translate("schedule_time_dropdown_minutes_t"),schedule_timepicker_label:s.translate("schedule_timepicker_label"),schedule_timepicker_start:s.translate("period_start_time_label"),schedule_timepicker_end:s.translate("period_end_time_label"),defaultPeriod:i,uniqueid:this.uniqueId};if(this.$el.append(t(o)),(this.glassContext.hasCapability("canUseSchedulingByHour")||this.glassContext.hasCapability("canUseSchedulingByMinute"))&&this.objectInformation.showDailyIntervalCheckbox&&(this.renderDailyIntervalCheckbox=!0),this.renderDailyIntervalCheckbox&&(this._renderDailyIntervalCheckbox(),this._renderDailyIntervalTimePickers(),this._renderSelectors()),this.isEditMode){if(this.descriptor.scheduleInfo&&this.descriptor.scheduleInfo.intradayRecurrence&&this.renderDailyIntervalCheckbox){this.$el.find(".schedule_dailyinterval").slideDown();var d=this.descriptor.scheduleInfo.intradayRecurrence.intradayRecurrenceInterval,c=d.replace(/[^0-9]/g,"");this.$el.find(".schedule_run_every_input").val(c);var h=d.charAt(d.length-1);this.frequencyTypeSelector.getHTMLControl().val(h)}}else this.renderDailyIntervalCheckbox&&(this.glassContext.hasCapability("canUseSchedulingByHour")?this.frequencyTypeSelector.getHTMLControl().val("H"):this.frequencyTypeSelector.getHTMLControl().val("M"));return this._setEvents(),e.resolve(this),e.promise},_setEvents:function(){i(".schedule_run_every_input").on("input",function(e){this.value=this.value.replace(/[^0-9]/g,"")})},toDescriptor:function(e){if(this.renderDailyIntervalCheckbox&&this.dailyIntervalCheckbox.isChecked()){var t=this.frequencyTypeSelector.getHTMLControl().val(),i=this.$el.find(".schedule_run_every_input").val(),s=this.intervalStartTime.getTime24H(),n=this.intervalEndTime.getTime24H();e.intradayRecurrence={intradayRecurrenceInterval:"PT"+i+t,intradayRecurrenceStart:s,intradayRecurrenceEnd:n}}return e},validate:function(e){if(this.renderDailyIntervalCheckbox&&this.dailyIntervalCheckbox.isChecked()){var t={param1:"",param2:"",param3:""},i=this.$el.find(".schedule_dailyinterval_controls_container"),n=this.$el.find(".schedule_time_interval_start"),l=this.$el.find(".schedule_time_interval_end");i.removeAttr("aria-invalid aria-describedby"),n.removeAttr("aria-invalid aria-describedby"),l.removeAttr("aria-invalid aria-describedby");var a=parseInt(this.$el.find(".schedule_run_every_input").val(),10);if(isNaN(a)||0===a)t.param1=s.translate("daily_time_interval_label"),t.param2=s.translate("schedule_repeat_label"),e.push(s.translate("schedule_invalid_form_input",t)),i.attr({"aria-invalid":"true","aria-describedby":e[0]});else if(this.intervalStartTime.isValidTime())if(this.intervalEndTime.isValidTime()){if(this.intervalStartTime.isValidTime()&&this.intervalEndTime.isValidTime()){var r=new Date(this.intervalStartTime.getDateTimeUTC()),o=new Date(this.intervalEndTime.getDateTimeUTC());r>o&&(t.param1=s.translate("daily_time_interval_label"),t.param2=s.translate("schedule_timepicker_label"),e.push(s.translate("schedule_invalid_time_range",t)),l.attr({"aria-invalid":"true","aria-describedby":e[0]}))}}else t.param1=s.translate("daily_time_interval_label"),t.param2=s.translate("schedule_timepicker_label"),t.param3=s.translate("period_end_label"),e.push(s.translate("schedule_invalid_interval_time",t)),l.attr({"aria-invalid":"true","aria-describedby":e[0]});else t.param1=s.translate("daily_time_interval_label"),t.param2=s.translate("schedule_timepicker_label"),t.param3=s.translate("period_start_label"),e.push(s.translate("schedule_invalid_interval_time",t)),n.attr({"aria-invalid":"true","aria-describedby":e[0]})}return e},_renderDailyIntervalCheckbox:function(){var e=!1;this.descriptor&&this.descriptor.scheduleInfo&&this.descriptor.scheduleInfo.intradayRecurrence&&(e=!0),this.dailyIntervalCheckbox=new c({id:"schedule_daily_interval_cadence_picker",el:this.$el.find("#schedule_daily_interval_cadence_picker_container_"+this.uniqueId),name:"schedule_daily_pick",label:s.translate("daily_time_interval_label"),ariaLabel:s.translate("daily_time_interval_label"),checked:e,controlOnLeft:!0,readOnly:this.readOnly,onChange:this._toggleOption.bind(this)}),this.dailyIntervalCheckbox.doRender()},_renderDailyIntervalTimePickers:function(){if(this.intervalStartTime=new d({$el:this.$el.find(".schedule_time_interval_start"),timezone:this.timezone,ariaLabel:s.translate("period_start_time_label"),attributes:{showMeridian:!u.is24HrFormat(this.locale)}}),this.intervalStartTime.render(),this.intervalEndTime=new d({$el:this.$el.find(".schedule_time_interval_end"),timezone:this.timezone,ariaLabel:s.translate("period_end_time_label"),attributes:{showMeridian:!u.is24HrFormat(this.locale)}}),this.intervalEndTime.render(),this.isEditMode&&this.descriptor.scheduleInfo&&this.descriptor.scheduleInfo.intradayRecurrence){var e=this.descriptor.scheduleInfo.intradayRecurrence.intradayRecurrenceStart;this.intervalStartTime.setTime24H(e);var t=this.descriptor.scheduleInfo.intradayRecurrence.intradayRecurrenceEnd;this.intervalEndTime.setTime24H(t)}},_toggleOption:function(e,t){t===!0?this.$el.find(".schedule_dailyinterval").slideDown():this.$el.find(".schedule_dailyinterval").slideUp()},_renderSelectors:function(){var e=[];this.glassContext.hasCapability("canUseSchedulingByHour")&&e.push({label:s.translate("schedule_time_dropdown_hours_t"),value:"H",selected:!1}),this.glassContext.hasCapability("canUseSchedulingByMinute")&&e.push({label:s.translate("schedule_time_dropdown_minutes_t"),value:"M",selected:!1}),this.frequencyTypeSelector=new h({id:"schedule_cadence_id_"+this.uniqueId,el:this.$el.find("#schedule_daily_time_interval_selector_container_"+this.uniqueId),ariaLabel:s.translate("schedule_repeat_label"),name:"schedule_interval_repeat_type",responsive:!1,onChange:function(){},options:e}),this.frequencyTypeSelector.doRender()},_determineDateLocale:function(){var e=_.getUserPreference(this.glassContext,"productLocale"),t=_.getUserPreference(this.glassContext,"contentLocale");return e===t.substring(0,2)?t:e}});return p}),define("bi/schedule/views/DailyCadencePickerView",["bi/schedule/views/CadencePickerView","bi/schedule/app/appControler","jquery","bi/sharecommon/utils/translator","q","bi/sharecommon/utils/simpledoT","text!bi/schedule/templates/DailyCadencePicker.html","underscore","bi/schedule/views/DailyIntervalCadencePickerView","bi/commons/ui/properties/DropDown"],function(e,t,i,s,n,l,a,r,o,d){"use strict";var c=e.extend({isEditMode:!1,init:function(e){c.inherited("init",this,arguments),r.extend(this,e),"undefined"!=typeof this.objectInformation.descriptor&&(this.scheduleInfo=this.objectInformation.descriptor.scheduleInfo,
- this.isEditMode=!0),this.uniqueId=r.uniqueId(),this.dayFrequencySelector=null,this.readOnly=!1},render:function(){var e=n.defer(),t=l.simpleTemplate(a),i=1;this.isEditMode&&this.scheduleInfo.everyNPeriods>1&&(i=this.scheduleInfo.everyNPeriods),this.readOnly=this.isEditMode&&this.hasPermission&&!this.hasPermission.write&&this.hasPermission.read;var r={schedule_every_label:s.translate("schedule_every_label"),schedule_time_dropdown_days_t:s.translate("schedule_time_dropdown_days_t"),schedule_time_dropdown_hours_t:s.translate("schedule_time_dropdown_hours_t"),schedule_time_dropdown_minutes_t:s.translate("schedule_time_dropdown_minutes_t"),defaultPeriod:i,uniqueid:this.uniqueId};if(this.$el.append(t(r)),this._renderSelectors(),this.isEditMode&&this.scheduleInfo.daily&&this.dayFrequencySelector.getHTMLControl().val(this.scheduleInfo.daily.dailyPeriod||"day"),this.objectInformation.showDailyInterval){var d={descriptor:this.objectInformation.descriptor};this.isEditMode?this.scheduleInfo&&this.scheduleInfo.intradayRecurrence||this.scheduleInfo&&"daily"!=this.scheduleInfo.type||this.scheduleInfo&&this.scheduleInfo.daily&&"day"==this.scheduleInfo.daily.dailyPeriod?d.showDailyIntervalCheckbox=!0:d.showDailyIntervalCheckbox=!1:d.showDailyIntervalCheckbox=!0;var c=this.$el.find(".schedule_daily_interval_container");this.dailyInterval=new o({$el:c,objectInformation:d,glassContext:this.glassContext,readOnly:this.readOnly}),this.dailyInterval.render()}return this._setEvents(),e.resolve(this),e.promise},_setEvents:function(){i(".schedule_every_days_input").on("input",function(e){this.value=this.value.replace(/[^0-9]/g,"")})},toDescriptor:function(e){return e.daily={dailyPeriod:this.dayFrequencySelector.getHTMLControl().val()},e.type="daily",e.everyNPeriods=parseInt(this.$el.find(".schedule_every_days_input").val(),10),this.dailyInterval&&(e=this.dailyInterval.toDescriptor(e)),e},validate:function(e){if(this.dailyInterval&&(e=this.dailyInterval.validate(e),e.length>0))return e;var t={},i=this.$el.find(".schedule_dailyinterval_controls_container");i.removeAttr("aria-invalid aria-describedby");var n=parseInt(this.$el.find(".schedule_every_days_input").val(),10);return isNaN(n)&&(t.param=s.translate("schedule_every_label"),e.push(s.translate("schedule_invalid_form_input_every_days_input",t)),i.attr({"aria-invalid":"true","aria-describedby":e[0]})),e},_renderSelectors:function(){var e=[];e.push({label:s.translate("schedule_time_dropdown_days_t"),value:"day",selected:!0}),this.glassContext.hasCapability("canUseSchedulingByHour")&&e.push({label:s.translate("schedule_time_dropdown_hours_t"),value:"hour",selected:!1}),this.glassContext.hasCapability("canUseSchedulingByMinute")&&e.push({label:s.translate("schedule_time_dropdown_minutes_t"),value:"minute",selected:!1}),this.dayFrequencySelector=new d({id:"schedule_cadence_id_"+this.uniqueId,el:this.$el.find("#schedule_frequency_container_"+this.uniqueId),label:"",name:"schedule_daily_period",responsive:!1,onChange:function(e,t){this._handleSelectors(e,t)}.bind(this),options:e,readOnly:this.readOnly}),this.dayFrequencySelector.doRender()},_handleSelectors:function(e,t){var i=this.$el.find(".schedule_daily_interval_container"),s={descriptor:this.objectInformation.descriptor};"schedule_daily_period"===e&&("hour"===t||"minute"===t?s.showDailyIntervalCheckbox=!1:"day"===t&&(s.showDailyIntervalCheckbox=!0),i.empty(),this.dailyInterval=new o({$el:i,objectInformation:s,glassContext:this.glassContext}),this.dailyInterval.render())}});return c}),define("text!bi/schedule/templates/WeeklyCadencePicker.html",[],function(){return'<!-- /*\n * Licensed Materials - Property of IBM\n * \n * IBM Cognos Products: SHARE\n * \n * (C) Copyright IBM Corp. 2015, 2016\n * \n * US Government Users Restricted Rights - Use, duplication or disclosure\n * restricted by GSA ADP Schedule Contract with IBM Corp.\n */ -->\n {{? it.showRunEvery}}\n <div class="schedule_input_section ">\n <div class="schedule_form_label">\n <label class="schedule_label" for="schWeekly_run_every_{{=it.run_everyid}}">{{=it.schedule_run_every_label}}</label>\n </div>\n <div class="schedule_frequency_input_container">\n <input id="schWeekly_run_every_{{=it.run_everyid}}" class="schedule_input_field schedule_every_weeks_input" type="text" value="{{=it.schedule_every_weeks_value}}" maxlength="3"></input>\n <span>{{=it.schedule_run_every_week_label}}</span>\n </div>\n</div>\n{{?}}\n<div class="schedule_form_space">\n <div class="weekly_on_days_label schedule_form_label schedule_label">{{=it.schedule_weekly_on_days_label}}</div>\n <div class="schedule_form_input">\n <div class="schedule_button_groups" role="region" aria-label="{{=it.weekly_cadence_buttons_description}}">\n <button class="weeklyMonday" role="button" aria-label="{{=it.schedule_weekday_Monday}}" aria-pressed="false">{{=it.schedule_weekday_button_Monday}}</button>\n <button class ="weeklyTuesday" role="button" aria-label="{{=it.schedule_weekday_Tuesday}}" aria-pressed="false">{{=it.schedule_weekday_button_Tuesday}}</button>\n <button class="weeklyWednesday" role="button" aria-label="{{=it.schedule_weekday_Wednesday}}" aria-pressed="false">{{=it.schedule_weekday_button_Wednesday}}</button>\n <button class ="weeklyThursday" role="button" aria-label="{{=it.schedule_weekday_Thursday}}" aria-pressed="false">{{=it.schedule_weekday_button_Thursday}}</button>\n <button class ="weeklyFriday" role="button" aria-label="{{=it.schedule_weekday_Friday}}" aria-pressed="false">{{=it.schedule_weekday_button_Friday}}</button>\n <button class ="weeklySaturday" role="button" aria-label="{{=it.schedule_weekday_Saturday}}" aria-pressed="false">{{=it.schedule_weekday_button_Saturday}}</button>\n <button class="weeklySunday" role="button" aria-label="{{=it.schedule_weekday_Sunday}}" aria-pressed="false">{{=it.schedule_weekday_button_Sunday}}</button>\n </div>\n </div>\n</div>'}),define("bi/schedule/views/WeeklyCadencePickerView",["bi/schedule/views/CadencePickerView","bi/schedule/app/appControler","jquery","bi/sharecommon/utils/translator","q","bi/sharecommon/utils/simpledoT","bi/commons/utils/ContentFormatter","text!bi/schedule/templates/WeeklyCadencePicker.html","underscore","moment-timezone","bi/schedule/views/DailyIntervalCadencePickerView"],function(e,t,i,s,n,l,a,r,o,d,c){"use strict";var h=e.extend({isEditMode:!1,buttonClassName:["weeklySunday","weeklyMonday","weeklyTuesday","weeklyWednesday","weeklyThursday","weeklyFriday","weeklySaturday"],dayNumberMap:{weeklySunday:0,weeklyMonday:1,weeklyTuesday:2,weeklyWednesday:3,weeklyThursday:4,weeklyFriday:5,weeklySaturday:6},init:function(e){h.inherited("init",this,arguments),i.extend(this,e),"undefined"!=typeof this.objectInformation.descriptor&&(this.scheduleInfo=this.objectInformation.descriptor.scheduleInfo,this.isEditMode=!0),this.readOnly=!1,this.timezone=this.glassContext.services.userProfile.preferences.timeZoneID},render:function(){var e=n.defer(),t=l.simpleTemplate(r),i=1;"undefined"!=typeof this.scheduleInfo&&this.scheduleInfo.everyNPeriods>1&&(i=this.scheduleInfo.everyNPeriods),this.readOnly=this.isEditMode&&this.hasPermission&&!this.hasPermission.write&&this.hasPermission.read;var d={weekly_cadence_buttons_description:s.translate("weekly_cadence_buttons_description"),schedule_run_every_label:s.translate("schedule_run_every_label"),schedule_run_every_week_label:s.translate("schedule_run_every_week_label"),schedule_weekly_on_days_label:s.translate("schedule_weekly_on_days_label"),schedule_every_weeks_value:i,schedule_weekday_Sunday:s.translate("schedule_run_on_the_sun_label"),schedule_weekday_Saturday:s.translate("schedule_run_on_the_sat_label"),schedule_weekday_Friday:s.translate("schedule_run_on_the_fri_label"),schedule_weekday_Thursday:s.translate("schedule_run_on_the_thu_label"),schedule_weekday_Wednesday:s.translate("schedule_run_on_the_wed_label"),schedule_weekday_Tuesday:s.translate("schedule_run_on_the_tue_label"),schedule_weekday_Monday:s.translate("schedule_run_on_the_mon_label"),schedule_weekday_button_Sunday:s.translate("schedule_weekday_button_Sunday_t"),schedule_weekday_button_Saturday:s.translate("schedule_weekday_button_Saturday_t"),schedule_weekday_button_Friday:s.translate("schedule_weekday_button_Friday_t"),schedule_weekday_button_Thursday:s.translate("schedule_weekday_button_Thursday_t"),schedule_weekday_button_Wednesday:s.translate("schedule_weekday_button_Wednesday_t"),schedule_weekday_button_Tuesday:s.translate("schedule_weekday_button_Tuesday_t"),schedule_weekday_button_Monday:s.translate("schedule_weekday_button_Monday_t"),run_everyid:o.uniqueId(),showRunEvery:this.objectInformation.showRunEvery};if(this.$el.append(t(d)),this._setDay(),this.objectInformation.showDailyInterval&&(this.dailyInterval=new c({$el:this.$el,objectInformation:{descriptor:this.objectInformation.descriptor,showDailyIntervalCheckbox:!0},glassContext:this.glassContext,readOnly:this.readOnly}),this.dailyInterval.render()),this.readOnly)for(var h=0;h<this.buttonClassName.length;h++)this.$el.find("."+this.buttonClassName[h]).prop("disabled",!0);return a.middleShortenString(this.$el.find(".weekly_on_days_label")),this._setEvents(),e.resolve(this),e.promise},toDescriptor:function(e){var t={weeklySunday:!1,weeklyMonday:!1,weeklyTuesday:!1,weeklyWednesday:!1,weeklyThursday:!1,weeklyFriday:!1,weeklySaturday:!1};for(var i in t)this.$el.find("."+i).hasClass("selectedButton")&&(t[i]=!0);e.weekly=t;var s=this.objectInformation.showRunEvery?parseInt(this.$el.find(".schedule_every_weeks_input").val(),10):1;return e.everyNPeriods=s,e.type="weekly",this.dailyInterval&&(e=this.dailyInterval.toDescriptor(e)),e},validate:function(e){if(this.dailyInterval&&(e=this.dailyInterval.validate(e),e.length>0))return e;var t={},i=this.$el.find(".schedule_frequency_input_container");i.removeAttr("aria-invalid aria-describedby");var n=this.objectInformation.showRunEvery?parseInt(this.$el.find(".schedule_every_weeks_input").val(),10):1;return(isNaN(n)||0===n)&&(t.param1=s.translate("schedule_run_every_label"),t.param2=s.translate("schedule_run_every_week_label"),e.push(s.translate("schedule_invalid_form_input",t)),i.attr({"aria-invalid":"true","aria-describedby":e[0]})),e},_setEvents:function(){for(var e=function(e){for(var t=e.currentTarget.className.split(/\s+/),i=0;i<t.length;i++)0===t[i].indexOf("weekly")&&this._toggleWeekday(t[i])}.bind(this),t=0;t<this.buttonClassName.length;t++)this.$el.find("."+this.buttonClassName[t]).on("clicktap",e);i(".schedule_every_weeks_input").on("input",function(e){this.value=this.value.replace(/[^0-9]/g,"")})},_setDay:function(){var e=!1;if("undefined"!=typeof this.scheduleInfo&&this.scheduleInfo.weekly)for(var t in this.scheduleInfo.weekly)if(this.scheduleInfo.weekly[t]===!0){var i=this._convertTimezone(this.dayNumberMap[t]);this._toggleWeekday(this.buttonClassName[i]),e=!0}if(!e){var s=d().tz(this.timezone).day();this._toggleWeekday(this.buttonClassName[s])}},_convertTimezone:function(e){var t=d(this.scheduleInfo.startDate).tz(this.scheduleInfo.timezone).day(),i=d(this.scheduleInfo.startDate).tz(this.timezone).day(),s=e+(i-t);return 0>s?s+=7:s>6&&(s-=7),s},_toggleWeekday:function(e){var t="."+e,i=this.$el.find(t);i.hasClass("selectedButton")?this.$el.find(".selectedButton").length>1&&(i.removeClass("selectedButton"),i.attr("aria-pressed","false")):(i.addClass("selectedButton"),i.attr("aria-pressed","true"))}});return h}),define("text!bi/schedule/templates/MonthlyCadencePicker.html",[],function(){return'<!-- /*\n * Licensed Materials - Property of IBM\n * \n * IBM Cognos Products: SHARE\n * \n * (C) Copyright IBM Corp. 2015, 2017\n * \n * US Government Users Restricted Rights - Use, duplication or disclosure\n * restricted by GSA ADP Schedule Contract with IBM Corp.\n */ -->\n\n<div class="schedule_input_section schedule_input_select_section" id="schedule_day_type_selector_container_{{=it.uniqueid}}">{{=it.schedule_run_on_label}}</div>\n<div class="schedule_input_select_section" id="schedule_day_selector_container_{{=it.uniqueid}}"></div>\n<div class="schedule_form_space">\n <div class="schedule_form_label"><label class="schedule_label" for="schMonthly_repeat_interval_{{=it.uniqueid}}">{{=it.schedule_repeat_interval_label}}</label></div>\n <div class="schedule_frequency_input_container">\n <input id="schMonthly_repeat_interval_{{=it.uniqueid}}" class="schedule_input_field schedule_every_weeks_input" type="text" value="{{=it.schedule_of_every_n_months_value}}" maxlength="3"></input>\n <span>{{=it.schedule_repeat_interval_months_label}}</span>\n </div>\n</div>\n'}),define("bi/schedule/views/MonthlyCadencePickerView",["bi/schedule/views/CadencePickerView","bi/schedule/app/appControler","jquery","bi/sharecommon/utils/translator","q","bi/sharecommon/utils/simpledoT","text!bi/schedule/templates/MonthlyCadencePicker.html","underscore","bi/schedule/views/DailyIntervalCadencePickerView","bi/commons/ui/properties/DropDown","bi/commons/ui/properties/RadioButtonGroup"],function(e,t,i,s,n,l,a,r,o,d,c){"use strict";var h=e.extend({isEditMode:!1,init:function(e){h.inherited("init",this,arguments),r.extend(this,e),"undefined"!=typeof this.objectInformation.descriptor&&(this.scheduleInfo=this.objectInformation.descriptor.scheduleInfo,this.isEditMode=!0),this.uniqueId=r.uniqueId(),this.dayTypeSelector=null,this.daySelector=null,this.dayOfMonthSelector=null,this.readOnly=!1},render:function(){var e=n.defer(),t=l.simpleTemplate(a),i=1;this.isEditMode&&this.scheduleInfo.everyNPeriods>1&&(i=this.scheduleInfo.everyNPeriods),this.readOnly=this.isEditMode&&this.hasPermission&&!this.hasPermission.write&&this.hasPermission.read;var r={schedule_run_on_label:s.translate("schedule_run_on_label"),schedule_repeat_interval_label:s.translate("schedule_repeat_interval_label"),schedule_of_every_n_months_value:i,schedule_repeat_interval_months_label:s.translate("schedule_repeat_interval_months_label"),uniqueid:this.uniqueId};if(this.$el.append(t(r)),this._renderSelectors(),this.dayTypeSelector.setValue("relative",!0),this.isEditMode)if(this.scheduleInfo.monthlyRelative){var d=this.scheduleInfo.monthlyRelative.monthlyRelativeDay||"monday",c=this.scheduleInfo.monthlyRelative.monthlyRelativeWeek||"first";this.daySelector.getHTMLControl().val(c+"|"+d)}else this.scheduleInfo.monthlyAbsolute&&(this.dayTypeSelector.setValue("absolute",!0),this.dayOfMonthSelector.getHTMLControl().val(this.scheduleInfo.monthlyAbsolute.monthlyAbsoluteDay||25));return this.objectInformation.showDailyInterval&&(this.dailyInterval=new o({$el:this.$el,objectInformation:{descriptor:this.objectInformation.descriptor,showDailyIntervalCheckbox:!0},glassContext:this.glassContext,readOnly:this.readOnly}),this.dailyInterval.render()),this._setEvents(),e.resolve(this),e.promise},_setEvents:function(){i(".schedule_every_weeks_input").on("input",function(e){this.value=this.value.replace(/[^0-9]/g,"")})},toDescriptor:function(e){if("absolute"===this.dayTypeSelector.getValue())e.monthlyAbsolute={monthlyAbsoluteDay:parseInt(this.dayOfMonthSelector.getHTMLControl().val(),10)},e.type="monthlyAbsolute";else{var t=this.daySelector.getHTMLControl().val(),i=t.split("|");e.monthlyRelative={monthlyRelativeDay:i[1],monthlyRelativeWeek:i[0]},e.type="monthlyRelative"}return e.everyNPeriods=parseInt(this.$el.find(".schedule_every_weeks_input").val(),10),this.dailyInterval&&(e=this.dailyInterval.toDescriptor(e)),e},validate:function(e){if(this.dailyInterval&&(e=this.dailyInterval.validate(e),e.length>0))return e;var t={},i=this.$el.find(".schedule_frequency_input_container");i.removeAttr("aria-invalid aria-describedby");var n=parseInt(this.$el.find(".schedule_every_weeks_input").val(),10);return isNaN(n)&&(t.param1=s.translate("schedule_repeat_interval_label"),e.push(s.translate("schedule_invalid_form_input_every_month_repeat_input",t)),i.attr({"aria-invalid":"true","aria-describedby":e[0]})),e},_renderSelectors:function(){this.dayTypeSelector=new c({id:"schedule_day_type_selector_"+this.uniqueId,el:this.$el.find("#schedule_day_type_selector_container_"+this.uniqueId),label:s.translate("schedule_run_on_label"),ariaLabel:s.translate("schedule_run_on_select_description"),name:"schedule_day_type_selector",value:"relative",indent:2,separator:!1,onChange:function(e,t){this._handleSelectors(e,t)}.bind(this),controlOnLeft:!0,items:[{label:s.translate("schedule_relative_absolute_radio_absolute"),value:"absolute"},{label:s.translate("schedule_relative_absolute_radio_relative"),value:"relative"}],readOnly:this.readOnly}),this.dayTypeSelector.render(),this.daySelector=new d({id:"schedule_run_on_the_"+this.uniqueId,el:this.$el.find("#schedule_day_selector_container_"+this.uniqueId),label:s.translate("schedule_run_on_day_label"),ariaDescribedby:s.translate("schedule_run_on_select_description"),name:"schedule_relative_day_of_month",responsive:!1,options:[{label:s.translate("schedule_run_on_first_monday_label"),value:"first|monday",selected:!1},{label:s.translate("schedule_run_on_the_second_monday_label"),value:"second|monday",selected:!1},{label:s.translate("schedule_run_on_the_third_monday_label"),value:"third|monday",selected:!1},{label:s.translate("schedule_run_on_the_fourth_monday_label"),value:"fourth|monday",selected:!1},{label:s.translate("schedule_run_on_the_last_monday_label"),value:"last|monday",selected:!1},{label:s.translate("schedule_run_on_first_tuesday_label"),value:"first|tuesday",selected:!1},{label:s.translate("schedule_run_on_the_second_tuesday_label"),value:"second|tuesday",selected:!1},{label:s.translate("schedule_run_on_the_third_tuesday_label"),value:"third|tuesday",selected:!1},{label:s.translate("schedule_run_on_the_fourth_tuesday_label"),value:"fourth|tuesday",selected:!1},{label:s.translate("schedule_run_on_the_last_tuesday_label"),value:"last|tuesday",selected:!1},{label:s.translate("schedule_run_on_first_wednesday_label"),value:"first|wednesday",selected:!1},{label:s.translate("schedule_run_on_the_second_wednesday_label"),value:"second|wednesday",selected:!1},{label:s.translate("schedule_run_on_the_third_wednesday_label"),value:"third|wednesday",selected:!1},{label:s.translate("schedule_run_on_the_fourth_wednesday_label"),value:"fourth|wednesday",selected:!1},{label:s.translate("schedule_run_on_the_last_wednesday_label"),value:"last|wednesday",selected:!1},{label:s.translate("schedule_run_on_first_thursday_label"),value:"first|thursday",selected:!1},{label:s.translate("schedule_run_on_the_second_thursday_label"),value:"second|thursday",selected:!1},{label:s.translate("schedule_run_on_the_third_thursday_label"),value:"third|thursday",selected:!1},{label:s.translate("schedule_run_on_the_fourth_thursday_label"),value:"fourth|thursday",selected:!1},{label:s.translate("schedule_run_on_the_last_thursday_label"),value:"last|thursday",selected:!1},{label:s.translate("schedule_run_on_first_friday_label"),value:"first|friday",selected:!1},{label:s.translate("schedule_run_on_the_second_friday_label"),value:"second|friday",selected:!1},{label:s.translate("schedule_run_on_the_third_friday_label"),value:"third|friday",selected:!1},{label:s.translate("schedule_run_on_the_fourth_friday_label"),value:"fourth|friday",selected:!1},{label:s.translate("schedule_run_on_the_last_friday_label"),value:"last|friday",selected:!1},{label:s.translate("schedule_run_on_first_saturday_label"),value:"first|saturday",selected:!1},{label:s.translate("schedule_run_on_the_second_saturday_label"),value:"second|saturday",selected:!1},{label:s.translate("schedule_run_on_the_third_saturday_label"),value:"third|saturday",selected:!1},{label:s.translate("schedule_run_on_the_fourth_saturday_label"),value:"fourth|saturday",selected:!1},{label:s.translate("schedule_run_on_the_last_saturday_label"),value:"last|saturday",selected:!1},{label:s.translate("schedule_run_on_first_sunday_label"),value:"first|sunday",selected:!1},{label:s.translate("schedule_run_on_the_second_sunday_label"),value:"second|sunday",selected:!1},{label:s.translate("schedule_run_on_the_third_sunday_label"),value:"third|sunday",selected:!1},{label:s.translate("schedule_run_on_the_fourth_sunday_label"),value:"fourth|sunday",selected:!1},{label:s.translate("schedule_run_on_the_last_sunday_label"),value:"last|sunday",selected:!1}],readOnly:this.readOnly}),this.daySelector.doRender(),this.dayOfMonthSelector=new d({id:"schedule_absolute_day_of_month_"+this.uniqueId,el:this.$el.find("#schedule_day_selector_container_"+this.uniqueId),label:s.translate("schedule_run_on_day_label"),ariaDescribedby:s.translate("schedule_run_on_select_description"),name:"schedule_absolute_day_of_month",responsive:!1,readOnly:this.readOnly,options:[{label:"1",value:"1",selected:!1},{label:"2",value:"2",selected:!1},{label:"3",value:"3",selected:!1},{label:"4",value:"4",selected:!1},{label:"5",value:"5",selected:!1},{label:"6",value:"6",selected:!1},{label:"7",value:"7",selected:!1},{label:"8",value:"8",selected:!1},{label:"9",value:"9",selected:!1},{label:"10",value:"10",selected:!1},{label:"11",value:"11",selected:!1},{label:"12",value:"12",selected:!1},{label:"13",value:"13",selected:!1},{label:"14",value:"14",selected:!1},{label:"15",value:"15",selected:!1},{label:"16",value:"16",selected:!1},{label:"17",value:"17",selected:!1},{label:"18",value:"18",selected:!1},{label:"19",value:"19",selected:!1},{label:"20",value:"20",selected:!1},{label:"21",value:"21",selected:!1},{label:"22",value:"22",selected:!1},{label:"23",value:"23",selected:!1},{label:"24",value:"24",selected:!1},{label:"25",value:"25",selected:!1},{label:"26",value:"26",selected:!1},{label:"27",value:"27",selected:!1},{label:"28",value:"28",selected:!1},{label:"29",value:"29",selected:!1},{label:"30",value:"30",selected:!1},{label:"31",value:"31",selected:!1}]}),this.dayOfMonthSelector.doRender()},_handleSelectors:function(e,t){"absolute"===t?(this.daySelector.hide(),this.dayOfMonthSelector.show()):(this.daySelector.show(),this.dayOfMonthSelector.hide())}});return h}),define("text!bi/schedule/templates/YearlyCadencePicker.html",[],function(){return'<!-- /*\n * Licensed Materials - Property of IBM\n * \n * IBM Cognos Products: SHARE\n * \n * (C) Copyright IBM Corp. 2015, 2017\n * \n * US Government Users Restricted Rights - Use, duplication or disclosure\n * restricted by GSA ADP Schedule Contract with IBM Corp.\n */ -->\n<div class="schedule_input_section schedule_input_select_section" id="schedule_day_type_selector_container_{{=it.uniqueid}}">{{=it.schedule_run_on_label}}</div>\n<div class="schedule_input_select_section" id="schedule_day_selector_container_{{=it.uniqueid}}"></div>\n\n<div class="schedule_form_space schedule_input_select_section" id="schedule_month_selector_container_{{=it.uniqueid}}"></div>\n'}),define("bi/schedule/views/YearlyCadencePickerView",["bi/schedule/views/CadencePickerView","bi/schedule/app/appControler","jquery","bi/sharecommon/utils/translator","q","bi/sharecommon/utils/simpledoT","text!bi/schedule/templates/YearlyCadencePicker.html","underscore","bi/schedule/views/DailyIntervalCadencePickerView","bi/commons/ui/properties/DropDown","bi/commons/ui/properties/RadioButtonGroup"],function(e,t,i,s,n,l,a,r,o,d,c){"use strict";var h=e.extend({isEditMode:!1,showAbsolute:!1,init:function(e){h.inherited("init",this,arguments),r.extend(this,e),"undefined"!=typeof this.objectInformation.descriptor&&(this.scheduleInfo=this.objectInformation.descriptor.scheduleInfo,this.isEditMode=!0),this.uniqueId=r.uniqueId(),this.dayTypeSelector=null,this.daySelector=null,this.dayOfMonthSelector=null,this.monthSelector=null,this.readOnly=!1},render:function(){var e=n.defer();this.readOnly=this.isEditMode&&this.hasPermission&&!this.hasPermission.write&&this.hasPermission.read;var t=l.simpleTemplate(a),i={schedule_run_on_label:s.translate("schedule_run_on_label"),uniqueid:this.uniqueId};if(this.$el.append(t(i)),this._renderSelectors(),this.dayTypeSelector.setValue("relative",!0),this.isEditMode)if(this.scheduleInfo.yearlyRelative){var r=this.scheduleInfo.yearlyRelative.yearlyRelativeDay||"monday",d=this.scheduleInfo.yearlyRelative.yearlyRelativeWeek||"first";this.daySelector.getHTMLControl().val(d+"|"+r),this.monthSelector.getHTMLControl().val(this.scheduleInfo.yearlyRelative.yearlyRelativeMonth||"september")}else this.scheduleInfo.yearlyAbsolute&&(this.dayTypeSelector.setValue("absolute",!0),this.dayOfMonthSelector.getHTMLControl().val(this.scheduleInfo.yearlyAbsolute.yearlyAbsoluteDay||25),this.monthSelector.getHTMLControl().val(this.scheduleInfo.yearlyAbsolute.yearlyAbsoluteMonth||"september"));return this.objectInformation.showDailyInterval&&(this.dailyInterval=new o({$el:this.$el,objectInformation:{descriptor:this.objectInformation.descriptor,showDailyIntervalCheckbox:!0},glassContext:this.glassContext,readOnly:this.readOnly}),this.dailyInterval.render()),e.resolve(this),e.promise},toDescriptor:function(e){if("absolute"===this.dayTypeSelector.getValue())e.yearlyAbsolute={yearlyAbsoluteDay:parseInt(this.dayOfMonthSelector.getHTMLControl().val(),10),yearlyAbsoluteMonth:this.monthSelector.getHTMLControl().val()},e.type="yearlyAbsolute";else{var t=this.daySelector.getHTMLControl().val(),i=t.split("|");e.yearlyRelative={yearlyRelativeDay:i[1],yearlyRelativeWeek:i[0],yearlyRelativeMonth:this.monthSelector.getHTMLControl().val()},e.type="yearlyRelative"}return e.everyNPeriods=1,this.dailyInterval&&(e=this.dailyInterval.toDescriptor(e)),e},validate:function(e){return this.dailyInterval&&(e=this.dailyInterval.validate(e)),e},_renderSelectors:function(){this.dayTypeSelector=new c({id:"schedule_day_type_selector_"+this.uniqueId,el:this.$el.find("#schedule_day_type_selector_container_"+this.uniqueId),label:s.translate("schedule_run_on_label"),ariaLabel:s.translate("schedule_run_on_select_description"),name:"schedule_day_type_selector",value:"relative",indent:2,separator:!1,onChange:function(e,t){this._handleSelectors(e,t)}.bind(this),controlOnLeft:!0,items:[{label:s.translate("schedule_relative_absolute_radio_absolute"),value:"absolute"},{label:s.translate("schedule_relative_absolute_radio_relative"),value:"relative"}],readOnly:this.readOnly}),this.dayTypeSelector.render(),this.daySelector=new d({id:"schedule_run_on_the_"+this.uniqueId,el:this.$el.find("#schedule_day_selector_container_"+this.uniqueId),label:s.translate("schedule_run_on_day_label"),ariaDescribedby:s.translate("schedule_run_on_select_description"),name:"schedule_relative_day_of_month",responsive:!1,readOnly:this.readOnly,options:[{label:s.translate("schedule_run_on_first_monday_label"),value:"first|monday",selected:!1},{label:s.translate("schedule_run_on_the_second_monday_label"),value:"second|monday",selected:!1},{label:s.translate("schedule_run_on_the_third_monday_label"),value:"third|monday",selected:!1},{label:s.translate("schedule_run_on_the_fourth_monday_label"),value:"fourth|monday",selected:!1},{label:s.translate("schedule_run_on_the_last_monday_label"),value:"last|monday",selected:!1},{label:s.translate("schedule_run_on_first_tuesday_label"),value:"first|tuesday",selected:!1},{label:s.translate("schedule_run_on_the_second_tuesday_label"),value:"second|tuesday",selected:!1},{label:s.translate("schedule_run_on_the_third_tuesday_label"),value:"third|tuesday",selected:!1},{label:s.translate("schedule_run_on_the_fourth_tuesday_label"),value:"fourth|tuesday",selected:!1},{label:s.translate("schedule_run_on_the_last_tuesday_label"),value:"last|tuesday",selected:!1},{label:s.translate("schedule_run_on_first_wednesday_label"),value:"first|wednesday",selected:!1},{label:s.translate("schedule_run_on_the_second_wednesday_label"),value:"second|wednesday",selected:!1},{label:s.translate("schedule_run_on_the_third_wednesday_label"),value:"third|wednesday",selected:!1},{label:s.translate("schedule_run_on_the_fourth_wednesday_label"),value:"fourth|wednesday",selected:!1},{label:s.translate("schedule_run_on_the_last_wednesday_label"),value:"last|wednesday",selected:!1},{label:s.translate("schedule_run_on_first_thursday_label"),value:"first|thursday",selected:!1},{label:s.translate("schedule_run_on_the_second_thursday_label"),value:"second|thursday",selected:!1},{label:s.translate("schedule_run_on_the_third_thursday_label"),value:"third|thursday",selected:!1},{label:s.translate("schedule_run_on_the_fourth_thursday_label"),value:"fourth|thursday",selected:!1},{label:s.translate("schedule_run_on_the_last_thursday_label"),value:"last|thursday",selected:!1},{label:s.translate("schedule_run_on_first_friday_label"),value:"first|friday",selected:!1},{label:s.translate("schedule_run_on_the_second_friday_label"),value:"second|friday",selected:!1},{label:s.translate("schedule_run_on_the_third_friday_label"),value:"third|friday",selected:!1},{label:s.translate("schedule_run_on_the_fourth_friday_label"),value:"fourth|friday",selected:!1},{label:s.translate("schedule_run_on_the_last_friday_label"),value:"last|friday",selected:!1},{label:s.translate("schedule_run_on_first_saturday_label"),value:"first|saturday",selected:!1},{label:s.translate("schedule_run_on_the_second_saturday_label"),value:"second|saturday",selected:!1},{label:s.translate("schedule_run_on_the_third_saturday_label"),value:"third|saturday",selected:!1},{label:s.translate("schedule_run_on_the_fourth_saturday_label"),value:"fourth|saturday",selected:!1},{label:s.translate("schedule_run_on_the_last_saturday_label"),value:"last|saturday",selected:!1},{label:s.translate("schedule_run_on_first_sunday_label"),value:"first|sunday",selected:!1},{label:s.translate("schedule_run_on_the_second_sunday_label"),value:"second|sunday",selected:!1},{label:s.translate("schedule_run_on_the_third_sunday_label"),value:"third|sunday",selected:!1},{label:s.translate("schedule_run_on_the_fourth_sunday_label"),value:"fourth|sunday",selected:!1},{label:s.translate("schedule_run_on_the_last_sunday_label"),value:"last|sunday",selected:!1}]}),this.daySelector.doRender(),this.dayOfMonthSelector=new d({id:"schedule_absolute_day_of_month_"+this.uniqueId,el:this.$el.find("#schedule_day_selector_container_"+this.uniqueId),label:s.translate("schedule_run_on_day_label"),ariaDescribedby:s.translate("schedule_run_on_select_description"),name:"schedule_absolute_day_of_month",responsive:!1,readOnly:this.readOnly,options:[{label:"1",value:"1",selected:!1},{label:"2",value:"2",selected:!1},{label:"3",value:"3",selected:!1},{label:"4",value:"4",selected:!1},{label:"5",value:"5",selected:!1},{label:"6",value:"6",selected:!1},{label:"7",value:"7",selected:!1},{label:"8",value:"8",selected:!1},{label:"9",value:"9",selected:!1},{label:"10",value:"10",selected:!1},{label:"11",value:"11",selected:!1},{label:"12",value:"12",selected:!1},{label:"13",value:"13",selected:!1},{label:"14",value:"14",selected:!1},{label:"15",value:"15",selected:!1},{label:"16",value:"16",selected:!1},{label:"17",value:"17",selected:!1},{label:"18",value:"18",selected:!1},{label:"19",value:"19",selected:!1},{label:"20",value:"20",selected:!1},{label:"21",value:"21",selected:!1},{label:"22",value:"22",selected:!1},{label:"23",value:"23",selected:!1},{label:"24",value:"24",selected:!1},{label:"25",value:"25",selected:!1},{label:"26",value:"26",selected:!1},{label:"27",value:"27",selected:!1},{label:"28",value:"28",selected:!1},{label:"29",value:"29",selected:!1},{label:"30",value:"30",selected:!1},{label:"31",value:"31",selected:!1}]}),this.dayOfMonthSelector.doRender(),this.monthSelector=new d({id:"schedule_run_on_the_month_"+this.uniqueId,el:this.$el.find("#schedule_month_selector_container_"+this.uniqueId),label:s.translate("schedule_repeat_month_label"),name:"schedule_month_of_year",responsive:!1,options:[{label:s.translate("schedule_run_on_the_jan_label"),value:"january",selected:!1},{label:s.translate("schedule_run_on_the_feb_label"),value:"february",selected:!1},{label:s.translate("schedule_run_on_the_mar_label"),value:"march",selected:!1},{label:s.translate("schedule_run_on_the_apr_label"),value:"april",selected:!1},{label:s.translate("schedule_run_on_the_may_label"),
- value:"may",selected:!1},{label:s.translate("schedule_run_on_the_jun_label"),value:"june",selected:!1},{label:s.translate("schedule_run_on_the_jul_label"),value:"july",selected:!1},{label:s.translate("schedule_run_on_the_aug_label"),value:"august",selected:!1},{label:s.translate("schedule_run_on_the_sep_label"),value:"september",selected:!1},{label:s.translate("schedule_run_on_the_oct_label"),value:"october",selected:!1},{label:s.translate("schedule_run_on_the_nov_label"),value:"november",selected:!1},{label:s.translate("schedule_run_on_the_dec_label"),value:"december",selected:!1}],readOnly:this.readOnly}),this.monthSelector.doRender()},_handleSelectors:function(e,t){"absolute"===t?(this.daySelector.hide(),this.dayOfMonthSelector.show()):(this.daySelector.show(),this.dayOfMonthSelector.hide())}});return h}),define("text!bi/schedule/templates/TriggerCadencePicker.html",[],function(){return'<!-- /*\n * Licensed Materials - Property of IBM\n * \n * IBM Cognos Products: SHARE\n * \n * (C) Copyright IBM Corp. 2015, 2016\n * \n * US Government Users Restricted Rights - Use, duplication or disclosure\n * restricted by GSA ADP Schedule Contract with IBM Corp.\n */ -->\n<div class="schedule_input_section ">\n <div class="schedule_form_label">\n <label class="schedule_label" for="trigger_name_{{=it.uniqueId}}">{{=it.schedule_trigger_name_label}}</label>\n </div>\n <div class="schedule_form_input">\n <input id="trigger_name_{{=it.uniqueId}}" class="schedule_input_field schedule_trigger_name_input" type="text" value="{{=it.schedule_trigger_name_value}}"></input>\n </div>\n</div>'}),define("bi/schedule/views/TriggerCadencePickerView",["bi/schedule/views/CadencePickerView","bi/schedule/app/appControler","jquery","bi/sharecommon/utils/translator","q","bi/sharecommon/utils/simpledoT","text!bi/schedule/templates/TriggerCadencePicker.html","underscore"],function(e,t,i,s,n,l,a,r){"use strict";var o=e.extend({init:function(e){o.inherited("init",this,arguments),this.isEditMode=!1,this.scheduleInfo={},r.extend(this,e),"undefined"!=typeof this.objectInformation.descriptor&&(this.scheduleInfo=this.objectInformation.descriptor.scheduleInfo,this.isEditMode=!0),this.uniqueId=r.uniqueId()},render:function(){var e=n.defer(),t=l.simpleTemplate(a),i=" ";this.isEditMode&&this.scheduleInfo.trigger&&(i=this.scheduleInfo.trigger.triggerName);var r={schedule_trigger_name_label:s.translate("schedule_trigger_name_label"),schedule_trigger_name_value:i,uniqueId:this.uniqueId};return this.$el.append(t(r)),e.resolve(this),e.promise},toDescriptor:function(e){return e.trigger={triggerName:r.escape(this.$el.find(".schedule_trigger_name_input").val().trim())},e.everyNPeriods=1,e},validate:function(e){return""===this.$el.find(".schedule_trigger_name_input").val().trim()&&e.push(s.translate("schedule_invalid_trigger_name_empty")),e}});return o}),define("text!bi/schedule/templates/FormatPicker.html",[],function(){return'<!-- /*\n * Licensed Materials - Property of IBM\n * \n * IBM Cognos Products: SHARE\n * \n * (C) Copyright IBM Corp. 2015, 2016\n * \n * US Government Users Restricted Rights - Use, duplication or disclosure\n * restricted by GSA ADP Schedule Contract with IBM Corp.\n */ -->\n<div>\n <div class="output_format_container">\n <div class="propertyUIControl">\n {{? it.showHTML }}\n <div class="output_option html_format_option_{{=it.uniqueId}}"></div>\n {{?}}\n {{? it.showPDF }}\n <div class="output_option pdf_format_option_{{=it.uniqueId}}"></div>\n {{?}}\n {{? it.showExcel }}\n <div class="output_option spreadsheet_format_option_{{=it.uniqueId}}"></div>\n <div class="output_option xlsxdata_format_option_{{=it.uniqueId}}"></div>\n {{?}}\n {{? it.showCSV }}\n <div class="output_option csv_format_option_{{=it.uniqueId}}"></div>\n {{?}}\n {{? it.showXML }}\n <div class="output_option xml_format_option_{{=it.uniqueId}}"></div>\n {{?}}\n {{? it.showUnsupported }}\n <div class="output_option unsupported_format_option_{{=it.uniqueId}}"></div>\n {{?}}\n <div class="new_schedule_panel_footer clearfix">\n <div class="pull-right" role="region"aria-label="{{=it.schedule_controls_description}}">\n <button class="new_schedule_panel_button schedule_primary_button">{{=it.schedule_done_btn}}</button>\n </div>\n </div>\n </div>\n </div>\n</div>\n'}),define("bi/schedule/views/FormatPickerView",["underscore","jquery","q","bi/sharecommon/utils/simpledoT","bi/commons/ui/View","bi/sharecommon/utils/translator","bi/commons/utils/Utils","bi/commons/utils/ContentFormatter","text!bi/schedule/templates/FormatPicker.html","bi/commons/ui/properties/CheckBox","bi/content_apps/authoring/AuthoringHelper","bootstrap"],function(e,t,i,s,n,l,a,r,o,d,c){"use strict";var h="350px",u=n.extend({init:function(i){if(u.inherited("init",this,arguments),this._initVariables(),void 0===i.$toggler)throw"Error: $toggler parameter must be provided.";t.extend(this,i),Array.isArray(this.outputFormats)&&0!==this.outputFormats.length||(this.showHTML?this.outputFormats=["HTML"]:this.showPDF&&c.userCanGenerateFormat(i.glassContext,"PDF")?this.outputFormats=["PDF"]:this.showExcel&&c.userCanGenerateFormat(i.glassContext,"spreadsheetML")?this.outputFormats=["spreadsheetML"]:this.showCSV&&c.userCanGenerateFormat(i.glassContext,"CSV")?this.outputFormats=["CSV"]:this.showXML&&c.userCanGenerateFormat(i.glassContext,"XML")?this.outputFormats=["XML"]:this.outputFormats=["HTML"]),e.contains(this.outputFormats,"XLWA")&&(this.showUnsupported=!0)},getOutputFormats:function(){return this.outputFormats},render:function(){var e=s.simpleTemplate(o),n={schedule_done_btn:l.translate("schedule_delivery_done_label"),uniqueId:this.uniqueId,showHTML:this.showHTML,showPDF:this.showPDF,showExcel:this.showExcel,showCSV:this.showCSV,showXML:this.showXML,showUnsupported:this.showUnsupported};return this._popoverContent=e(n),this.$popoverContent=t(this._popoverContent),this._renderCheckBoxes(this.$popoverContent),this._updateFormatList(this.$popoverContent),this.hasPermission&&!this.hasPermission.write&&this.hasPermission.read&&this.$toggler.prop("disabled",!0),this._setEvents(),i(this)},_renderCheckBoxes:function(t){this.htmlCheckbox=new d({id:"output_html_checkbox_"+this.uniqueId,el:t.find(".html_format_option_"+this.uniqueId),name:"HTML",label:l.translate(this.formatLabels.HTML),ariaLabel:l.translate(this.formatLabels.HTML),svgIcon:"html_icon",checked:e.contains(this.outputFormats,"HTML"),onChange:function(e,i){this._handleCheckBoxes(e,i,t)}.bind(this)}),this.pdfCheckbox=new d({id:"output_pdf_checkbox_"+this.uniqueId,el:t.find(".pdf_format_option_"+this.uniqueId),name:"PDF",label:l.translate(this.formatLabels.PDF),ariaLabel:l.translate(this.formatLabels.PDF),svgIcon:"pdf_icon",checked:e.contains(this.outputFormats,"PDF"),onChange:function(e,i){this._handleCheckBoxes(e,i,t)}.bind(this)}),this.spreadsheetCheckbox=new d({id:"output_spreadsheet_checkbox_"+this.uniqueId,el:t.find(".spreadsheet_format_option_"+this.uniqueId),name:"spreadsheetML",label:l.translate(this.formatLabels.spreadsheetML),ariaLabel:l.translate(this.formatLabels.spreadsheetML),svgIcon:"excel_icon",checked:e.contains(this.outputFormats,"spreadsheetML"),onChange:function(e,i){this._handleCheckBoxes(e,i,t)}.bind(this)}),this.xlsxDataCheckbox=new d({id:"output_xlsxdata_checkbox_"+this.uniqueId,el:t.find(".xlsxdata_format_option_"+this.uniqueId),name:"xlsxData",label:l.translate(this.formatLabels.xlsxData),ariaLabel:l.translate(this.formatLabels.xlsxData),svgIcon:"excel_icon",checked:e.contains(this.outputFormats,"xlsxData"),onChange:function(e,i){this._handleCheckBoxes(e,i,t)}.bind(this)}),this.csvCheckbox=new d({id:"output_csv_checkbox_"+this.uniqueId,el:t.find(".csv_format_option_"+this.uniqueId),name:"CSV",label:l.translate(this.formatLabels.CSV),ariaLabel:l.translate(this.formatLabels.CSV),svgIcon:"csv_icon",checked:e.contains(this.outputFormats,"CSV"),onChange:function(e,i){this._handleCheckBoxes(e,i,t)}.bind(this)}),this.xmlCheckbox=new d({id:"output_xml_checkbox_"+this.uniqueId,el:t.find(".xml_format_option_"+this.uniqueId),name:"XML",label:l.translate(this.formatLabels.XML),ariaLabel:l.translate(this.formatLabels.XML),svgIcon:"xml_icon",checked:e.contains(this.outputFormats,"XML"),onChange:function(e,i){this._handleCheckBoxes(e,i,t)}.bind(this)}),this.unsupportedCheckbox=new d({id:"output_unsupported_checkbox_"+this.uniqueId,el:t.find(".unsupported_format_option_"+this.uniqueId),name:"XLWA",label:l.translate(this.formatLabels.XLWA),ariaLabel:l.translate(this.formatLabels.XLWA),svgIcon:"unsupportedformat_icon",checked:e.contains(this.outputFormats,"XLWA"),onChange:function(e,i){this._handleCheckBoxes(e,i,t)}.bind(this)}),this.showHTML&&this.htmlCheckbox.doRender(),this.showPDF&&this.pdfCheckbox.doRender(),this.showExcel&&(this.spreadsheetCheckbox.doRender(),this.xlsxDataCheckbox.doRender()),this.showCSV&&this.csvCheckbox.doRender(),this.showXML&&this.xmlCheckbox.doRender(),this.showUnsupported&&this.unsupportedCheckbox.doRender()},_handleCheckBoxes:function(e,t,i){this._updateOutputFormats(e),0===this.outputFormats.length&&(this.showHTML?this.htmlCheckbox.check():this.showPDF?this.pdfCheckbox.check():this.showExcel?this.spreadsheetCheckbox.check():this.showCSV?this.csvCheckbox.check():this.showXML?this.xmlCheckbox.check():console.error("No checkboxes shown, nothing to select.")),this._updateFormatList(i)},_setEvents:function(){this.$toggler.on("primaryaction",function(i){if(this.isVisible=!this.isVisible,e.contains(this.outputFormats,"XLWA")||(this.showUnsupported=!1),this.isVisible){var s=t(this._popoverContent);this._renderCheckBoxes(s),this.glassContext.appController.showSlideOut({parent:this.slideoutparent,overlay:this.overlay,width:h,enableTabLooping:!0,label:l.translate("schedule_format_picker_name"),onHide:this._close(),content:{module:"bi/schedule/views/OptionsSlideoutView",content:s,title:l.translate("schedule_output_label")}})}}.bind(this)),this.hideHandler=function(e){var i=t(e.target),s=i.closest(".popover"),n=i.closest(".output_format_toggler");this.isVisible&&0===s.length&&0===n.length&&this._close()}.bind(this),t(document).on("clicktap",this.hideHandler)},_close:function(){this.isVisible=!1},_updateFormatList:function(e){if("object"==typeof e){this.$el.html("");for(var i=0;i<this.outputFormats.length;i++){var s=this.outputFormats[i],n=t("<div/>").addClass("subscription_link").html(l.translate(this.formatLabels[s]));t("<div/>").addClass("format_type_container").append("<span class='subscription_icon' data-icon='"+this.formatIcons[s]+"'></span>").append(n).appendTo(this.$el)}this._setActiveOutputSvg()}},_setActiveOutputSvg:function(){for(var e=this.$el.find(".subscription_icon"),i=this.$el.find(".subscription_link"),s=0;s<e.length;s++){var n=t(e[s]);a.setIcon(n,"common-"+n.data("icon")+"_icon",t(i[s]).html())}for(var l=0;l<i.length;l++)r.middleShortenString(i[l])},_updateOutputFormats:function(t){e.contains(this.outputFormats,t)?this._removeOutputFormats(t):e.contains(this.outputFormats,t)||this.outputFormats.push(t)},_removeOutputFormats:function(e){var t=this.outputFormats.indexOf(e);t>=0&&this.outputFormats.splice(t,1)},_initVariables:function(){this.$el={},this.$toggler={},this.isVisible=!1,this.showHTML=!0,this.showPDF=!0,this.showExcel=!0,this.showCSV=!0,this.showXML=!0,this.showUnsupported=!1,this.placement="left",this.outputFormats=[],this._popoverContent="",this.formatLabels={HTML:"schedule_format_web",PDF:"schedule_format_pdf",spreadsheetML:"schedule_format_xlsx",xlsxData:"schedule_format_xlsx_data",CSV:"schedule_format_csv",XML:"schedule_format_xml",XLWA:"schedule_format_unsupported"},this.formatIcons={HTML:"html",PDF:"pdf",spreadsheetML:"excel",xlsxData:"excel",CSV:"csv",XML:"xml",XLWA:"unsupportedformat"},this.uniqueId=e.uniqueId("id_")}});return u}),define("bi/schedule/utils/TextFormatter",["jquery"],function(e){"use strict";var t="...",i=5,s=15,n={};return n.middleShortenString=function(e,n,l){var a=e,n="number"!=typeof n?i:n,l="number"!=typeof l?s:l;return e.length>n+l&&(a=e.substring(0,n)+t+e.substring(e.length-l,e.length)),a},n.escapeSpecialCharacters=function(e,t){for(var i=t?t:["\\","/"],s="",n=0;n<e.length;n++){for(var l=0;l<i.length;l++)if(e.charAt(n)===i[l]){s+="\\";break}s+=e.charAt(n)}return s},n}),define("text!bi/schedule/templates/DeliveryPickerOptions.html",[],function(){return'<!-- /*\n * Licensed Materials - Property of IBM\n * \n * IBM Cognos Products: SHARE\n * \n * (C) Copyright IBM Corp. 2015, 2016\n * \n * US Government Users Restricted Rights - Use, duplication or disclosure\n * restricted by GSA ADP Schedule Contract with IBM Corp.\n */ -->\n \n<div class="schedule_delivery_container propertyUIControl">\n <div class="schedule_delivery_option">\n <div id="delivery_email_container_{{=it.uniqueid}}"></div>\n <div class="schedule_nested_delivery_option delivery_email_options">\n <div id="delivery_attachment_container_{{=it.uniqueid}}"></div>\n </div>\n {{? it.advanced}}\n <div class="schedule_email_delivery_body delivery_advanced_content delivery_email_options">\n {{? it.allowRecipients}}\n <div class="delivery_email_section delivery_input_section delivery_email_to_section">\n <div class="schedule_form_label schedule_delivery_header">\n <label for=\'delivery_email_recipients_edit_field_{{=it.uniqueid}}\' class="schedule_label">{{=it.schedule_delivery_recipient_label}}</label>\n <button class="btn btn-link arrow rightArrow rightAlignArrow">\n <span class="btn-hidden-label">{{=it.schedule_delivery_recipient_label}}</span>\n </button>\n </div>\n <div class="schedule_form_input schedule_delivery_input">\n <div id="delivery_email_recipients_{{=it.uniqueid}}" class="delivery_recipients_field" data-recipienttype="email">\n <div class="delivery_recipients_edit_field">\n <input id="delivery_email_recipients_edit_field_{{=it.uniqueid}}" class="delivery_recipients_edit_box">\n </div>\n </div>\n <span class="delivery_ellipsis" id="delivery_email_ellipsis_{{=it.uniqueid}}">...</span>\n </div>\n </div>\n \n <div class="delivery_email_section delivery_input_section delivery_cc_section">\n <div class="schedule_form_label schedule_delivery_header">\n <label for=\'delivery_cc_recipients_edit_field_{{=it.uniqueid}}\' class="schedule_label">{{=it.schedule_delivery_cc_label}}</label>\n <button class="btn btn-link arrow rightArrow rightAlignArrow">\n <span class="btn-hidden-label">{{=it.schedule_delivery_cc_label}}</span>\n </button>\n </div>\n <div class="schedule_form_input schedule_delivery_input">\n <div id="delivery_cc_recipients_{{=it.uniqueid}}" class="delivery_recipients_field" data-recipienttype="cc">\n <div class="delivery_recipients_edit_field">\n <input id="delivery_cc_recipients_edit_field_{{=it.uniqueid}}" class="delivery_recipients_edit_box">\n </div>\n </div>\n <span class="delivery_ellipsis" id="delivery_cc_ellipsis_{{=it.uniqueid}}">...</span>\n </div>\n </div>\n \n <div class="delivery_email_section delivery_input_section delivery_bcc_section">\n <div class="schedule_form_label schedule_delivery_header">\n <label for=\'delivery_bcc_recipients_edit_field_{{=it.uniqueid}}\' class="schedule_label">{{=it.schedule_delivery_bcc_label}}</label>\n <button class="btn btn-link arrow rightArrow rightAlignArrow">\n <span class="btn-hidden-label">{{=it.schedule_delivery_bcc_label}}</span>\n </button>\n </div>\n <div class="schedule_form_input schedule_delivery_input">\n <div id="delivery_bcc_recipients_{{=it.uniqueid}}" class="delivery_recipients_field" data-recipienttype="bcc">\n <div class="delivery_recipients_edit_field">\n <input id="delivery_bcc_recipients_edit_field_{{=it.uniqueid}}" class="delivery_recipients_edit_box">\n </div>\n </div>\n <span class="delivery_ellipsis" id="delivery_bcc_ellipsis_{{=it.uniqueid}}">...</span>\n </div>\n </div>\n {{?}}\n \n <div class="delivery_email_section delivery_subject_section">\n <div class="schedule_form_label schedule_delivery_header">\n <label for=\'schedule_email_subject_{{=it.uniqueid}}\' class="schedule_label">{{=it.schedule_delivery_subject_label}}</label>\n </div>\n <div class="schedule_form_input schedule_delivery_input">\n <input id="schedule_email_subject_{{=it.uniqueid}}" class="schedule_input_field delivery_subject_input" type="text" value="" />\n </div>\n </div>\n \n {{? it.allowRecipients}}\n <button class="delivery_email_copy_toggler delivery_cc_toggler">{{=it.schedule_delivery_cc_label}}</button>\n <button class="delivery_email_copy_toggler delivery_bcc_toggler">{{=it.schedule_delivery_bcc_label}}</button>\n {{?}}\n \n <form class="delivery_email_message_container">\n <textarea name="delivery_email_message" id="delivery_email_message_{{=it.uniqueid}}"></textarea>\n </form>\n </div>\n {{?}}\n <div class="schedule_nested_delivery_option delivery_email_options">\n <div id="delivery_link_container_{{=it.uniqueid}}"></div>\n </div>\n </div>\n <div class="schedule_delivery_option">\n <div id="delivery_print_container_{{=it.uniqueid}}"></div>\n <div class="schedule_nested_delivery_option delivery_print_options">\n <div class="delivery_printer_label">{{=it.schedule_delivery_printer_name_label}}</div>\n <select class="schedule_printer_names"></select>\n <div class="delivery_other_printer_section">\n <input id="delivery_print_other_name_{{=it.uniqueid}}" class="schedule_input_field delivery_printer_input_field" type="text" value="" />\n </div>\n </div>\n </div>\n {{? it.showMobile }}\n <div class="schedule_delivery_option">\n <div id="delivery_mobile_container_{{=it.uniqueid}}"></div>\n {{? it.advanced && it.allowRecipients}}\n <div class="schedule_form_space delivery_advanced_content delivery_mobile_options">\n <div class="delivery_input_section delivery_mobile_to_section">\n <div class="schedule_form_label schedule_delivery_header">\n <label for=\'delivery_mobile_recipients_{{=it.uniqueid}}\' class="schedule_label">{{=it.schedule_delivery_recipient_label}}</label>\n <button class="btn btn-link arrow rightArrow rightAlignArrow">\n <span class="btn-hidden-label">{{=it.schedule_delivery_recipient_label}}</span>\n </button>\n </div>\n <div class="schedule_form_input schedule_delivery_input">\n <div id="delivery_mobile_recipients_{{=it.uniqueid}}" class="delivery_recipients_field" data-recipienttype="mobile"></div>\n <span class="delivery_ellipsis" id="delivery_mobile_ellipsis_{{=it.uniqueid}}">...</span>\n </div>\n </div>\n </div>\n {{?}}\n </div>\n {{?}}\n <div class="schedule_delivery_option">\n <div id="delivery_saveTOS3_container_{{=it.uniqueid}}"></div>\n <div class="schedule_nested_delivery_option delivery_print_options delivery_s3_options">\n <div style=\'display: flex; flex-direction: column\'>\n <label for=\'delivery_saveToS3_reportName_{{=it.uniqueid}}\' class="schedule_label">{{=it.schedule_delivery_s3ReportName_label}}</label>\n <input type=\'text\' id="delivery_saveToS3_reportName_{{=it.uniqueid}}"/> \n \n <label for=\'delivery_saveToS3_connectionName_{{=it.uniqueid}}\' class="schedule_label">{{=it.schedule_delivery_s3ConnectionName_label}}</label>\n <select id=\'delivery_saveToS3_connectionName_{{=it.uniqueid}}\' class="schedule_save_to_file_system_connection_selection"></select>\n \n <!-- <div class="location-selction-section"> -->\n <label for=\'delivery_saveToS3_locationName_{{=it.uniqueid}}\' class="schedule_label location-selction-section-label location-selction-section">{{=it.schedule_delivery_s3LocationName_label}}</label>\n <select id=\'delivery_saveToS3_locationName_{{=it.uniqueid}}\' class="saveToS3_location_selection location-selction-section-select location-selction-section"></select>\n <!-- </div> -->\n </div> \n </div>\n </div>\n <div class="schedule_delivery_option">\n <div id="delivery_save_container_{{=it.uniqueid}}"></div>\n </div>\n \n <!-- Delivery to save to file system -->\n {{? it.showSaveToFileSystem }}\n <div class="schedule_delivery_option">\n <div id="delivery_save_to_file_system_checkbox_container_{{=it.uniqueid}}"></div>\n <div class="schedule_nested_delivery_option delivery_save_to_file_system_options">\n <div class="delivery_save_to_file_system_file_name_section">\n <div class="delivery_name_label">{{=it.schedule_name_label}}</div>\n <div class="delivery_save_to_file_system_file_name_input_section">\n <input id="delivery_save_to_file_system_file_name_{{=it.uniqueid}}" class="schedule_input_field delivery_save_to_file_system_input_field" type="text" value="" />\n </div>\n </div>\n <div class="delivery_name_label">{{=it.schedule_delivery_location_label}}</div>\n <select class="schedule_save_to_file_system_locations"></select>\n <div id="schedule_delivery_conflict_resolution_section_{{=it.uniqueid}}" class="conflict_resolution_radio_group"></div>\n </div>\n </div>\n {{?}}\n\n <div class="new_schedule_panel_footer clearfix">\n <div class="pull-right" role="region"aria-label="{{=it.schedule_controls_description}}">\n <button class="new_schedule_panel_button schedule_primary_button">{{=it.schedule_done_btn}}</button>\n </div>\n </div>\n</div>\n'}),define("text!bi/schedule/templates/RecipientsList.html",[],function(){return'<!-- Licensed Materials - Property of IBM\n \n IBM Cognos Products: SHARE\n \n (C) Copyright IBM Corp. 2015, 2019\n \n US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n-->\n{{~it.recipients :recipient:index}}\n<div class="delivery_recipient " id="{{=recipient.id}}">\n <div class="delivery_recipient_label" title="{{!recipient.type}}">{{!recipient.defaultName}}</div>\n <button class="btn btn-link delivery_icon delivery_delete_recipient_icon" data-icon="close-cancel-error" tabindex=0>\n <span class="btn-hidden-label">{{=it.removeLabel}}</span>\n </button>\n <div class="delivery_recipient_underline" aria-label="{{=it.invalidLabel}}"/>\n</div>\n{{~}}\n'}),define("bi/schedule/views/DeliveryPickerView",["jquery","underscore","bi/sharecommon/utils/simpledoT","q","ckeditor","ckeditor/jquery","bi/commons/ui/View","bi/schedule/app/appControler","bi/sharecommon/utils/translator","bi/commons/utils/Utils","bi/commons/ui/properties/PropertyUIControl","bi/commons/utils/ContentFormatter","bi/schedule/utils/TextFormatter","text!bi/schedule/templates/DeliveryPickerOptions.html","text!bi/schedule/templates/RecipientsList.html","bi/commons/ui/properties/CheckBox","bi/commons/ui/properties/RadioButtonGroup","bootstrap"],function(e,t,i,s,n,l,a,r,o,d,c,h,u,_,p,v,b){"use strict";var m=500,y="<html><body></body></html>",f=a.extend({init:function(i,s){f.inherited("init",this,arguments),this.reportName="",this.isEditMode=!1,this.enableAdvancedSettings=!1,this.deliveryOptions={},this.overlay=!1,this.showMobile=!0,this.s3Connection="",this.showSaveToFileSystem=!0;var n=this._initS3Loc(i);if(this.s3SaveToCloud=n&&""!==n,this.s3SaveToCloud){this.s3Location=n.value;var l=this._initS3ReportName(i);l&&(this.s3ReportName=l.value)}if(this.canSave=!0,this._icons={email:"email",print:"print_icon",mobile:"mobile_icon",save:"save",archive:"saveExternal",saveToCloud:"saveExternal"},this._archiveLocations=[],void 0===i.reportName)throw"Error: report name parameter must be provided.";if(void 0===i.glassContext)throw"Error: glassContext parameter must be provided.";if(void 0===i.$toggler)throw"Error: $toggler parameter must be provided.";e.extend(this,i),this.notifyOnSave=!this.enableAdvancedSettings||!1,i.deliveryOptions&&i.deliveryOptions.save&&(this.notifyOnSave=i.deliveryOptions.save.notify),this.save={notify:this.notifyOnSave},this.print={name:""},this.archive={filenameStub:this.reportName,location:"",conflictResolution:"replace"},void 0===i.hasPermission&&(this.hasPermission={write:!0}),this.canSave=this.hasPermission.write||t.contains(this.hasPermission,"write")?!0:!1,(!i.deliveryOptions||e.isEmptyObject(i.deliveryOptions)&&!this._hasSaveToCloudOption())&&(this.canSave?this.deliveryOptions={save:{notify:this.notifyOnSave}}:this.deliveryOptions={print:{name:""}}),this.enableAdvancedSettings?(this.email={emailAsAttachment:!this.canSave,emailAsURL:this.canSave,subject:"",memoPart:"",to:[],bcc:[],cc:[]},this.mobile={to:[]}):(this.email={emailAsAttachment:!this.canSave,emailAsURL:this.canSave,subject:"",memoPart:""},this.mobile={}),this.isEditMode?this.isEditMode&&!this.enableAdvancedSettings&&(this.email.subject=o.translate("subscription_email_subject",{report_name:this.reportName}),this.email.memoPart="<html><body><p>"+o.translate("subscription_email_body")+"</p></body></html>",this.deliveryOptions.email&&(this.deliveryOptions.email.subject=o.translate("subscription_email_subject",{report_name:this.reportName}),this.deliveryOptions.email.memoPart="<html><body><p>"+o.translate("subscription_email_body")+"</p></body></html>")):(this.email.subject=o.translate("subscription_email_subject",{report_name:this.reportName}),this.enableAdvancedSettings||(this.email.memoPart="<html><body><p>"+o.translate("subscription_email_body")+"</p></body></html>"))},_initS3Loc:function(e){if(e.deliveryOptions.saveToCloud){var i={value:e.deliveryOptions.cloudLocation};return i}return t.find(e.rawOptions,function(e){return"runOptionEnum#saveToCloud"===e.name})},_initS3ReportName:function(e){if(e.deliveryOptions.cloudName){var i={value:e.deliveryOptions.cloudName};return i}return t.find(e.rawOptions,function(e){return"runOptionEnum#cloudName"===e.name})},close:function(){e(document).removeData(["setemail","setmobile"])},render:function(){return s()},getDeliveryOptions:function(){if(this.deliveryOptions.email&&(this.emailCheckbox&&this.emailCheckbox.isChecked()&&this.attachmentCheckbox&&this.attachmentCheckbox.isChecked()&&"undefined"!=typeof this.deliveryOptions.email.memoPart&&this.deliveryOptions.email.memoPart===y&&delete this.deliveryOptions.email.memoPart,this.deliveryOptions.email.to&&this.deliveryOptions.email.to.length>0&&(this.deliveryOptions.email.to=this._cleanRecipientsArray(this.deliveryOptions.email.to.slice())),this.deliveryOptions.email.cc&&this.deliveryOptions.email.cc.length>0&&(this.deliveryOptions.email.cc=this._cleanRecipientsArray(this.deliveryOptions.email.cc.slice())),this.deliveryOptions.email.bcc&&this.deliveryOptions.email.bcc.length>0&&(this.deliveryOptions.email.bcc=this._cleanRecipientsArray(this.deliveryOptions.email.bcc.slice()))),this.deliveryOptions.mobile&&this.deliveryOptions.mobile.to&&this.deliveryOptions.mobile.to.length>0&&(this.deliveryOptions.mobile.to=this._cleanRecipientsArray(this.deliveryOptions.mobile.to.slice())),this._isSaveToCloudOptionsSelected()){var e=this.getCloudOptions();e.location&&(this.deliveryOptions.cloudLocation=e.location,e.cloudReportName&&(this.deliveryOptions.cloudName=e.cloudReportName))}else delete this.deliveryOptions.cloudLocation,delete this.deliveryOptions.cloudName;return this.deliveryOptions},getDeliveryContent:function(e){var s=i.simpleTemplate(_);"boolean"!=typeof e&&(e=!0),this.contentUniqueId=t.uniqueId("id_");var n={schedule_delivery_s3ReportName_label:o.translate("schedule_delivery_s3ReportName_label"),schedule_delivery_s3ConnectionName_label:o.translate("schedule_delivery_s3ConnectionName_label"),schedule_delivery_s3LocationName_label:o.translate("schedule_delivery_s3LocationName_label"),schedule_delivery_printer_name_label:o.translate("schedule_delivery_printer_name_label"),schedule_name_label:o.translate("schedule_name_label"),schedule_delivery_location_label:o.translate("schedule_delivery_location_label"),schedule_delivery_conflict_resolution_label:o.translate("schedule_delivery_conflict_resolution_label"),showSaveToFileSystem:this.showSaveToFileSystem,advanced:this.enableAdvancedSettings,schedule_delivery_recipient_label:o.translate("schedule_delivery_recipient_label"),schedule_delivery_subject_label:o.translate("schedule_delivery_subject_label"),schedule_delivery_cc_label:o.translate("schedule_delivery_cc_label"),schedule_delivery_bcc_label:o.translate("schedule_delivery_bcc_label"),schedule_done_btn:o.translate("schedule_delivery_done_label"),uniqueid:this.contentUniqueId,showMobile:this.showMobile,allowRecipients:e};return s(n)},setCloudEvents:function(e){var t=e.find("#delivery_saveToS3_reportName_"+this.contentUniqueId),i=this.getCloudOptions();i.cloudReportName?t.val(i.cloudReportName):i.reportName?t.val(i.reportName):t.val(this.reportName),t.on("change",function(){this.cloudReportName=t.val()}.bind(this))},_renderOptions:function(i,s){i.empty(),i.append(e("<option>",{value:"",text:""})),t.each(s,function(t){i.append(e("<option>",{value:t.id,text:t.defaultName}))})},_setS3ConnectionOptionsForUpdate:function(e){var t=this.s3Location;this.cloudLocation&&(t=this.cloudLocation),r.getS3LocationParentConnectionID(this.glassContext,t).done(function(i){if(i.data[0]&&i.data[0].parent[0]&&i.data[0].parent[0].id){var s=i.data[0].parent[0].id;r.getS3ConnectionDetails(this.glassContext).done(function(i){var n=e.find(".schedule_save_to_file_system_connection_selection"),l=e.find(".location-selction-section-select"),a=e.find(".location-selction-section");this._renderOptions(n,i.data),n.val(s),this._handleConnectionChange(n,l,a,e),r.getS3LocationsDetails(this.glassContext,s).done(function(e){this._renderOptions(l,e.data),l.val(t),this._handleLocationChange(l)}.bind(this))}.bind(this))}}.bind(this))},_handleConnectionChange:function(e,t,i,s){e.change(function(){i.hide(),this.cloudConnection=e.val(),t.val(""),t.empty(),r.getS3LocationsDetails(this.glassContext,e.val()).done(function(e){this._renderOptions(t,e.data),i.show(),this._handleLocationChange(t)}.bind(this))}.bind(this))},_handleLocationChange:function(e){e.change(function(){this.cloudLocation=e.val()}.bind(this))},_setS3ConnectionOptions:function(e){var t=s.defer();return r.getS3ConnectionDetails(this.glassContext).done(function(i){var s=e.find(".schedule_save_to_file_system_connection_selection"),n=e.find(".location-selction-section-select"),l=e.find(".location-selction-section");l.hide(),this._handleConnectionChange(s,n,l,e),this._handleLocationChange(n),this._renderOptions(s,i.data),t.resolve()}.bind(this)),t.promise},setDeliveryOptions:function(e,t){var i=s.defer();return r.getArchiveLocations(this.glassContext).done(function(s){s&&s.data&&s.data.length>0?this._archiveLocations=s.data:this.showSaveToFileSystem=!1,this._renderCheckBoxes(e,t),this.setCloudEvents(e),this._isSaveToCloudOptionsSelected()&&e.find(".delivery_s3_options").show(m),this.showSaveToFileSystem&&this._renderRadioButtonGroup(e),t&&this.updateActiveDeliveryList(t),i.resolve()}.bind(this)),i.promise},getCloudOptions:function(){var e={};return this.cloudLocation&&""!==this.cloudLocation?(e.location=this.cloudLocation,this.cloudReportName&&""!==this.cloudReportName&&(e.reportName=this.cloudReportName,e.cloudReportName=this.cloudReportName)):this.s3Location&&""!==this.s3Location&&(e.location=this.s3Location,this.cloudReportName&&""!==this.cloudReportName?(e.reportName=this.cloudReportName,e.cloudReportName=this.cloudReportName):this.s3ReportName&&""!==this.s3ReportName&&(e.reportName=this.s3ReportName,
- e.cloudReportName=this.cloudReportName)),e},_isSaveToCloudOptionsSelected:function(){return this.s3SaveToCloud||this.cloudLocation||this.s3Location?!0:!1},_renderCheckBoxes:function(e,i){var s=!1,n=!1,l=!1,a=!1,r=!1,d=!1,c=!1;this.deliveryOptions.save&&(d=!0),(this.s3SaveToCloud||this.cloudLocation)&&this._setS3ConnectionOptionsForUpdate(e),this.deliveryOptions.email?(s=!0,e.find(".delivery_email_options").show(),this.deliveryOptions.email.emailAsAttachment?(this.email.emailAsAttachment=!0,n=!0):this.email.emailAsAttachment=!1,this.deliveryOptions.email.emailAsURL?(this.email.emailAsURL=!0,l=!0,d=!0):this.email.emailAsURL=!1,this.enableAdvancedSettings&&this.setAdvancedEmailStoredContent(e)):e.find(".delivery_email_options").hide(),this.deliveryOptions.mobile?(r=!0,e.find(".delivery_mobile_options").show(),this.enableAdvancedSettings&&this.setAdvancedMobileStoredContent(e)):e.find(".delivery_mobile_options").hide(),this.deliveryOptions.print?(a=!0,this._setPrinters(e),e.find(".delivery_print_options").show()):e.find(".delivery_print_options").hide(),this.deliveryOptions.archive?(c=!0,this.archive.conflictResolution=this.deliveryOptions.archive.conflictResolution,this._setSaveToFileSystemValues(e),e.find(".delivery_save_to_file_system_options").show()):e.find(".delivery_save_to_file_system_options").hide(),this.emailCheckbox=new v({id:"delivery_email_checkbox_"+this.contentUniqueId,el:e.find("#delivery_email_container_"+this.contentUniqueId),name:"delivery_email_option",label:o.translate("schedule_delivery_email_label"),ariaLabel:o.translate("schedule_delivery_email_label"),svgIcon:"email",checked:s,onChange:function(t,s){this._handleCheckBoxes(t,s,e,i)}.bind(this)}),this.attachmentCheckbox=new v({id:"delivery_attachment_checkbox_"+this.contentUniqueId,el:e.find("#delivery_attachment_container_"+this.contentUniqueId),name:"delivery_attachment_option",label:o.translate("schedule_delivery_attach_label"),ariaLabel:o.translate("schedule_delivery_attach_label"),checked:n,onChange:function(t,s){this._handleCheckBoxes(t,s,e,i)}.bind(this)}),this.printCheckbox=new v({id:"delivery_print_checkbox_"+this.contentUniqueId,el:e.find("#delivery_print_container_"+this.contentUniqueId),name:"delivery_print_option",label:o.translate("schedule_delivery_print_label"),ariaLabel:o.translate("schedule_delivery_print_label"),svgIcon:"print_icon",checked:a,onChange:function(t,s){this._handleCheckBoxes(t,s,e,i)}.bind(this)}),this.mobileCheckbox=new v({id:"delivery_mobile_checkbox_"+this.contentUniqueId,el:e.find("#delivery_mobile_container_"+this.contentUniqueId),name:"delivery_mobile_option",label:o.translate("schedule_delivery_mobile_label"),ariaLabel:o.translate("schedule_delivery_mobile_label"),svgIcon:"mobile_icon",checked:r,onChange:function(t,s){this._handleCheckBoxes(t,s,e,i)}.bind(this)}),this.saveToFSCheckbox=new v({id:"delivery_save_to_file_system_checkbox_container_"+this.contentUniqueId,el:e.find("#delivery_save_to_file_system_checkbox_container_"+this.contentUniqueId),name:"delivery_save_to_file_system_options",label:o.translate("schedule_delivery_save_to_file_system_label"),ariaLabel:o.translate("schedule_delivery_save_to_file_system_label"),svgIcon:"saveExternal",checked:c,onChange:function(t,s){this._handleCheckBoxes(t,s,e,i)}.bind(this)}),(this.hasPermission.write||t.contains(this.hasPermission,"write"))&&(this.linkCheckbox=new v({id:"delivery_link_checkbox_"+this.contentUniqueId,el:e.find("#delivery_link_container_"+this.contentUniqueId),name:"delivery_link_option",label:o.translate("schedule_delivery_link_label"),ariaLabel:o.translate("schedule_delivery_link_label"),checked:l,onChange:function(t,s){this._handleCheckBoxes(t,s,e,i)}.bind(this)}),this.saveTOS3Checkbox=new v({id:"delivery_saveTOS3_checkbox_"+this.contentUniqueId,el:e.find("#delivery_saveTOS3_container_"+this.contentUniqueId),name:"delivery_saveTOS3_option",label:o.translate("saveToCloud"),ariaLabel:o.translate("schedule_delivery_save_label"),svgIcon:"saveExternal",checked:this._isSaveToCloudOptionsSelected(),onChange:function(t,s){this._handleCheckBoxes(t,s,e,i)}.bind(this)}),this.saveCheckbox=new v({id:"delivery_save_checkbox_"+this.contentUniqueId,el:e.find("#delivery_save_container_"+this.contentUniqueId),name:"delivery_save_option",label:o.translate("schedule_delivery_save_label"),ariaLabel:o.translate("schedule_delivery_save_label"),svgIcon:"save",checked:d,onChange:function(t,s){this._handleCheckBoxes(t,s,e,i)}.bind(this)}),this._checkCapabilities("canIncludeLinkInEmail")&&this.linkCheckbox.doRender(),this.saveTOS3Checkbox.doRender(),this.saveCheckbox.doRender()),this.showSaveToFileSystem&&this.saveToFSCheckbox.doRender(),this._checkCapabilities("canEmail")&&this.emailCheckbox.doRender(),this._checkCapabilities("canAttach")&&this.attachmentCheckbox.doRender(),this.printCheckbox.doRender(),this.mobileCheckbox.doRender()},_checkCapabilities:function(e){return t.find(this.glassContext.services.userProfile.capabilities,function(t){return t===e})},_handleCheckBoxes:function(i,s,n,l){switch(i){case"delivery_saveTOS3_option":s?(this._setS3ConnectionOptions(n),this.deliveryOptions.saveToCloud=!0,n.find(".delivery_s3_options").show(m)):(n.find(".delivery_s3_options").hide(m),delete this.deliveryOptions.saveToCloud,delete this.deliveryOptions.cloudLocation,this.rawOptions=t.filter(this.rawOptions,function(e){return!("runOptionEnum#saveToCloud"===e.name||"runOptionEnum#cloudName"===e.name)}),delete this.s3SaveToCloud,delete this.s3Location,delete this.cloudConnection,delete this.cloudLocation);break;case"delivery_attachment_option":this.deliveryOptions.email&&(s?(this.email.emailAsAttachment=!0,this.deliveryOptions.email=this.email):(this.email.emailAsAttachment=!1,this.deliveryOptions.email=this.email));break;case"delivery_link_option":this.deliveryOptions.email&&(s?(this.email.emailAsURL=!0,this.deliveryOptions.email=this.email,this.deliveryOptions.save||(this.saveCheckbox.check(),this.glassContext.appController.showToast(o.translate("schedule_delivery_email_save_info_label"),{type:"info",preventDuplicates:!0}))):(this.email.emailAsURL=!1,this.deliveryOptions.email=this.email));break;case"delivery_email_option":s?(this.deliveryOptions.email=this.email,this.deliveryOptions.email.emailAsAttachment?this.attachmentCheckbox.check():this.attachmentCheckbox.uncheck(),this.linkCheckbox&&(this.deliveryOptions.email.emailAsURL?this.linkCheckbox.check():this.linkCheckbox.uncheck()),n.find(".delivery_email_options").show(m),this.enableAdvancedSettings&&this.setAdvancedEmailStoredContent(n)):(delete this.deliveryOptions.email,this.email.to=[],n.find("#delivery_email_recipients_"+this.contentUniqueId+" .delivery_recipient").remove(),n.find(".delivery_email_options").hide(m));break;case"delivery_save_option":s?this.deliveryOptions.save=this.save:this.deliveryOptions.email&&this.deliveryOptions.email.emailAsURL?(this.saveCheckbox.check(),this.glassContext.appController.showToast(o.translate("schedule_delivery_email_save_info_label"),{type:"info",preventDuplicates:!0})):delete this.deliveryOptions.save;break;case"delivery_mobile_option":s?(this.deliveryOptions.mobile=this.mobile,n.find(".delivery_mobile_options").show(m),this.enableAdvancedSettings&&this.setAdvancedMobileStoredContent(n)):(delete this.deliveryOptions.mobile,n.find(".delivery_mobile_options").hide(m));break;case"delivery_print_option":s?(n.find(".delivery_print_options").show(m),this._setPrinters(n,l)):(delete this.deliveryOptions.print,n.find(".delivery_print_options").hide(m));break;case"delivery_save_to_file_system_options":s?(n.find(".delivery_save_to_file_system_options").show(m),this._setSaveToFileSystemValues(n,l)):(delete this.deliveryOptions.archive,n.find(".delivery_save_to_file_system_options").hide(m))}e.isEmptyObject(this.deliveryOptions)&&!this._isSaveToCloudOptionsSelected()&&(this.hasPermission.write||t.contains(this.hasPermission,"write")?this.saveCheckbox.check():this.printCheckbox.check(),this.glassContext.appController.showToast(o.translate("schedule_delivery_min_select_label"),{type:"info",preventDuplicates:!0})),l&&this.updateActiveDeliveryList(l)},_hasSaveToCloudOption:function(){if(this.deliveryOptions.saveToCloud)return!0;var e=t.find(this.rawOptions,function(e){return"runOptionEnum#saveToCloud"===e.name?!0:void 0});return e?!0:!1},_setPrinters:function(e,t){var i=e.find(".schedule_printer_names:not(.clickBound)");i.addClass("clickBound");var s=e.find("#delivery_print_other_name_"+this.contentUniqueId+":not(.clickBound)");s.addClass("clickBound"),i.change(function(){var s=i.val();s===o.translate("schedule_delivery_printer_other_label")?e.find(".delivery_other_printer_section").show(m):(e.find(".delivery_other_printer_section").hide(m),this._updatePrintDeliveryOption(s,t))}.bind(this)),s.on("change",function(e){this._updatePrintDeliveryOption(e.target.value,t)}.bind(this)),i.length?r.getPrinters(this.glassContext).done(function(n){var l=[];n&&n.data&&(l=n.data),this._setPrinterSelectionValues(l,i,s,e,t)}.bind(this)):this.deliveryOptions.print=this.print},_setPrinterSelectionValues:function(t,i,s,n,l){var a="";this.deliveryOptions&&this.deliveryOptions.print&&this.deliveryOptions.print.name&&(a=this.deliveryOptions.print.name);for(var r=0;r<t.length;r++){var d=u.middleShortenString(t[r].defaultName),c=t[r].defaultScreenTip?t[r].defaultScreenTip:t[r].defaultDescription?t[r].defaultDescription:t[r].printerAddress;i.append(e("<option>",{value:t[r].printerAddress,title:c}).text(d))}i.append(e("<option>",{value:o.translate("schedule_delivery_printer_other_label")}).text(o.translate("schedule_delivery_printer_other_label"))),t.length>0&&n.find(".delivery_other_printer_section").hide(),a?this._setDropDownValueToPresetPrinter(a,i,s,n,l):this._setDefaultDeliveryPrintOption(t,s,l)},_setDropDownValueToPresetPrinter:function(e,t,i,s,n){var l=u.escapeSpecialCharacters(e);t.find("option[value='"+l+"']").length>0?(t.val(e),s.find(".delivery_other_printer_section").hide()):(t.val(o.translate("schedule_delivery_printer_other_label")),s.find(".delivery_other_printer_section").show(m),i.val(e)),this._updatePrintDeliveryOption(e,n)},_setDefaultDeliveryPrintOption:function(e,t,i){var s;s=e&&e.length>0?e[0].printerAddress:t.val(),this._updatePrintDeliveryOption(s,i)},_updatePrintDeliveryOption:function(e,t){this.print.name=e,this.deliveryOptions.print=this.print,t&&this.updateActiveDeliveryList(t)},_setSaveToFileSystemValues:function(i,s){var n=i.find("#delivery_save_to_file_system_file_name_"+this.contentUniqueId+":not(.clickBound)");n.addClass("clickBound"),this.deliveryOptions&&this.deliveryOptions.archive&&this.deliveryOptions.archive.filenameStub?this.archive.filenameStub=this.deliveryOptions.archive.filenameStub:this.archive.filenameStub=this.reportName,n.val(this.archive.filenameStub);var l=i.find(".delivery_save_to_file_system_file_name_input_section");h.middleShortenString(l);var a=i.find(".schedule_save_to_file_system_locations:not(.clickBound)");a.addClass("clickBound"),this._archiveLocations=t.sortBy(this._archiveLocations,"defaultName");for(var r=0;r<this._archiveLocations.length;r++){var o=u.middleShortenString(this._archiveLocations[r].defaultName);a.append(e("<option>",{value:this._archiveLocations[r].defaultName,title:this._archiveLocations[r].defaultName}).text(o))}if(this.deliveryOptions&&this.deliveryOptions.archive&&this.deliveryOptions.archive.location){this.archive.location=this.deliveryOptions.archive.location;var d=this._getDisplayNameFromStoreIDOrSearchPath(this.archive.location);a.val(d)}else this.archive.location=this._archiveLocations[0].searchPath;a.change(function(){var e=a.val(),t=this._getSearchPathForLocation(e);this.archive.location=t,this.deliveryOptions.archive.location=this.archive.location,s&&this.updateActiveDeliveryList(s)}.bind(this)),n.on("change",function(e){this.archive.filenameStub=e.target.value,this.deliveryOptions.archive.filenameStub=this.archive.filenameStub,s&&this.updateActiveDeliveryList(s)}.bind(this)),this._archiveLocations.length>0&&""===this.archive.location&&(this.archive.location=this._archiveLocations[0].searchPath),this.deliveryOptions.archive=this.archive,s&&this.updateActiveDeliveryList(s)},_getSearchPathForLocation:function(e){var i=t.find(this._archiveLocations,function(t){return t.defaultName===e}.bind(this));return i?i.searchPath:""},_getDisplayNameFromStoreIDOrSearchPath:function(e){var i=t.find(this._archiveLocations,function(t){return-1!==e.indexOf(t.id)||e===t.searchPath}.bind(this));return i?i.defaultName:""},_renderRadioButtonGroup:function(e){var t=s.defer(),i=[this._getConflictResolutionContainer(e)];return this._conflictResolutionOptionsControl=new c({el:e.find("#schedule_delivery_conflict_resolution_section_"+this.contentUniqueId),items:i,glassContext:this.glassContext}),this._conflictResolutionOptionsControl.render().then(function(){this._conflictResolutionOptionsControl=this._conflictResolutionOptionsControl.getProperty("conflictResolutionOptions"),t.resolve()}.bind(this)),t.promise},_getConflictResolutionContainer:function(e){return{type:"CollapsibleSection",name:"conflictResolutionOptions",styleAsSimpleRow:!0,label:o.translate("schedule_delivery_conflict_resolution_label"),items:[this._getConflictResolutionOptions(e)]}},_getConflictResolutionOptions:function(){var e=[];return e.push({name:"fail",label:o.translate("schedule_delivery_keep_existing_label"),id:"delivery_keep_"+this.contentUniqueId,value:"fail"}),e.push({name:"replace",label:o.translate("schedule_delivery_replace_label"),id:"delivery_replace_"+this.contentUniqueId,value:"replace"}),e.push({name:"appendDateTime",label:o.translate("schedule_delivery_timestamp_label"),id:"delivery_timestamp_"+this.contentUniqueId,value:"appendDateTime"}),e.push({name:"appendSequenceNumber",label:o.translate("schedule_delivery_version_number_label"),id:"delivery_version_number_"+this.contentUniqueId,value:"appendSequenceNumber"}),{type:"RadioButtonGroup",name:"delivery_conflict_resolution_pick",ariaLabel:o.translate("schedule_delivery_conflict_resolution_label"),value:this.archive.conflictResolution,separator:!1,onChange:this._updateConflictResolutionValue.bind(this),items:e}},_updateConflictResolutionValue:function(e,t){this.archive.conflictResolution=t},updateActiveDeliveryList:function(t){if(this.deliveryOptions){t.html("");for(var i in this.deliveryOptions)if("cloudLocation"!==i){var s=e("<div/>").addClass("delivery_link").text(o.translate("schedule_delivery_"+i+"_short_label"));e("<div/>").addClass("delivery_type_container").append("<span class='delivery_icon' data-icon='"+this._icons[i]+"'></span>").append(s).appendTo(t)}if(this._hasSaveToCloudOption()&&!this.deliveryOptions.saveToCloud&&0===this.$el.find(".delivery_type_container.saveToCloud").length){var s=e("<div/>").addClass("delivery_link").text(o.translate("schedule_delivery_saveToCloud_short_label"));e("<div/>").addClass("delivery_type_container saveToCloud").append("<span class='delivery_icon' data-icon='"+this._icons.saveToCloud+"'></span>").append(s).appendTo(t)}this.setIcons(t),this.shortenLinks(t)}},setIcons:function(t){for(var i=t.find(".delivery_icon"),s=t.find(".delivery_link"),n=0;n<i.length;n++){var l=e(i[n]),a=e(s[n]);d.setIcon(l,"common-"+l.data("icon"),a.html())}},shortenLinks:function(e){for(var t=e.find(".delivery_link"),i=0;i<t.length;i++)h.middleShortenString(t[i])},setAdvancedMobileStoredContent:function(t){var i=t.find("#delivery_mobile_recipients_"+this.contentUniqueId),s=t.find(".delivery_mobile_to_section:not(.clickBound)");s.addClass("clickBound"),s.on("clicktap",function(){this.glassContext.appController.showSlideOut({position:"right",overlay:!0,parent:this.slideout,width:this.slideout.width,label:o.translate("schedule_delivery_accounts_aria_label"),content:{module:"bi/schedule/views/AccountPickerSlideoutView",glassContext:this.glassContext,addCallback:function(e){var i=Object.keys(e).map(function(t){return e[t]});return this._addMobileRecipients(i,t,!0),Promise.resolve()}.bind(this)}})}.bind(this));var n=t.find("#delivery_mobile_ellipsis_"+this.contentUniqueId+":not(.clickBound)");n.addClass("clickBound"),n.on("clicktap",function(e){e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation(),i.addClass("expanded"),n.hide()}.bind(this)),this.deliveryOptions&&this.deliveryOptions.mobile&&this.deliveryOptions.mobile.to&&e.isArray(this.deliveryOptions.mobile.to)&&0!==this.deliveryOptions.mobile.to.length&&this._addMobileRecipients(this.deliveryOptions.mobile.to,t,!1);var l=t.find('label[for="delivery_mobile_recipients_'+this.contentUniqueId+'"]');e(document).data("setmobile")||e(document).data("setmobile",!0).on("clicktap",function(e){s.is(e.target)||0!==s.has(e.target).length||(i.removeClass("expanded"),this._checkForEllipsis(i,l,function(e){e?n.show(m):n.hide(m)}.bind(this)))}.bind(this))},setAdvancedEmailStoredContent:function(i){var s=i.find("#schedule_email_subject_"+this.contentUniqueId);this.deliveryOptions.email.subject?(s.val(this.deliveryOptions.email.subject),this.email.subject=s.val()):this.email.subject&&s.val(this.email.subject),s.on("change",function(e){this.deliveryOptions.email.subject=e.target.value,this.email.subject=e.target.value}.bind(this));var n=i.find("#delivery_email_message_"+this.contentUniqueId),l=n.ckeditor({customConfig:"../../../js/schedule/utils/cke_editor_delivery_config.js"}).editor;l.config&&l.config.language&&(l.config.language=this.glassContext.services.userProfile.preferences.productLocale),this._setEditorDialogHideHandler(),this.deliveryOptions.email.memoPart?(l.setData(this.deliveryOptions.email.memoPart),this.email.memoPart=l.getData()):this.email.memoPart?l.setData(this.email.memoPart):(this.deliveryOptions.email.memoPart=y,this.email.memoPart=y),l.on("change",function(e){this.deliveryOptions.email.memoPart="<html><body>"+e.editor.getData()+"</body></html>",this.email.memoPart="<html><body>"+e.editor.getData()+"</body></html>"}.bind(this));var a=i.find("#delivery_email_recipients_"+this.contentUniqueId),r=i.find("#delivery_cc_recipients_"+this.contentUniqueId),d=i.find("#delivery_bcc_recipients_"+this.contentUniqueId),c=i.find(".delivery_email_to_section"),h=c.find(".schedule_delivery_header:not(.clickBound)");h.addClass("clickBound"),h.on("clicktap",function(){this.glassContext.appController.showSlideOut({position:"right",overlay:!0,parent:this.slideout,width:this.slideout.width,label:o.translate("schedule_delivery_accounts_aria_label"),content:{module:"bi/schedule/views/AccountPickerSlideoutView",glassContext:this.glassContext,addCallback:function(e){var t=Object.keys(e).map(function(t){return e[t]});return this._addEmailRecipients(t,i,!0),Promise.resolve()}.bind(this)}})}.bind(this)),this._handleRecipientEdit(i,a,this._addEmailAddress.bind(this)),this._handleRecipientEdit(i,r,this._addCCEmailAddress.bind(this)),this._handleRecipientEdit(i,d,this._addBCCEmailAddress.bind(this));var u=i.find("#delivery_email_ellipsis_"+this.contentUniqueId+":not(.clickBound)");if(u.addClass("clickBound"),u.on("clicktap",function(e){e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation(),a.addClass("expanded"),u.hide()}.bind(this)),this.deliveryOptions&&this.deliveryOptions.email&&this.deliveryOptions.email.to&&e.isArray(this.deliveryOptions.email.to))if(0!==this.deliveryOptions.email.to.length)this._addEmailRecipients(this.deliveryOptions.email.to,i,!1);else if(this.glassContext.profile.account&&this.glassContext.profile.account.defaultName&&this.glassContext.profile.account.email){var _=[{defaultName:this.glassContext.profile.account.defaultName,address:this.glassContext.profile.account.email,type:o.translate("currentUser"),id:t.uniqueId("recipientId_")}];this._addEmailRecipients(_,i)}var p=i.find(".delivery_cc_section"),v=p.find(".schedule_delivery_header:not(.clickBound)");v.addClass("clickBound"),v.on("clicktap",function(){this.glassContext.appController.showSlideOut({position:"right",overlay:!0,parent:this.slideout,width:this.slideout.width,label:o.translate("schedule_delivery_accounts_aria_label"),content:{module:"bi/schedule/views/AccountPickerSlideoutView",glassContext:this.glassContext,addCallback:function(e){var t=Object.keys(e).map(function(t){return e[t]});return this._addCCRecipients(t,i,!0),Promise.resolve()}.bind(this)}})}.bind(this));var b=i.find("#delivery_cc_ellipsis_"+this.contentUniqueId+":not(.clickBound)");b.addClass("clickBound"),b.on("clicktap",function(e){e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation(),r.addClass("expanded"),b.hide()}.bind(this));var f=i.find(".delivery_cc_toggler:not(.clickBound)");f.addClass("clickBound"),f.on("clicktap",function(){f.hide(),i.find(".delivery_cc_section").show(m)}.bind(this)),this.deliveryOptions&&this.deliveryOptions.email&&this.deliveryOptions.email.cc&&e.isArray(this.deliveryOptions.email.cc)?0===this.deliveryOptions.email.cc.length?p.hide():(f.hide(),this._addCCRecipients(this.deliveryOptions.email.cc,i,!1)):p.hide();var g=i.find(".delivery_bcc_section"),C=g.find(".schedule_delivery_header:not(.clickBound)");C.addClass("clickBound"),C.on("clicktap",function(){this.glassContext.appController.showSlideOut({position:"right",overlay:!0,parent:this.slideout,width:this.slideout.width,label:o.translate("schedule_delivery_accounts_aria_label"),content:{module:"bi/schedule/views/AccountPickerSlideoutView",glassContext:this.glassContext,addCallback:function(e){var t=Object.keys(e).map(function(t){return e[t]});return this._addBCCRecipients(t,i,!0),Promise.resolve()}.bind(this)}})}.bind(this));var w=i.find("#delivery_bcc_ellipsis_"+this.contentUniqueId+":not(.clickBound)");w.addClass("clickBound"),w.on("clicktap",function(e){e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation(),d.addClass("expanded"),w.hide()}.bind(this));var k=i.find(".delivery_bcc_toggler:not(.clickBound)");k.addClass("clickBound"),k.on("clicktap",function(){k.hide(),i.find(".delivery_bcc_section").show(m)}.bind(this)),this.deliveryOptions&&this.deliveryOptions.email&&this.deliveryOptions.email.bcc&&e.isArray(this.deliveryOptions.email.bcc)?0===this.deliveryOptions.email.bcc.length?g.hide():(k.hide(),this._addBCCRecipients(this.deliveryOptions.email.bcc,i,!1)):g.hide();var I=i.find('label[for="delivery_email_recipients_edit_field_'+this.contentUniqueId+'"]'),S=i.find('label[for="delivery_cc_recipients_edit_field_'+this.contentUniqueId+'"]'),x=i.find('label[for="delivery_bcc_recipients_edit_field_'+this.contentUniqueId+'"]');e(document).data("setemail")||e(document).data("setemail",!0).on("clicktap",function(e){c.is(e.target)||0!==c.has(e.target).length||(a.removeClass("expanded"),this._checkForEllipsis(a,I,function(e){e?u.show(m):u.hide(m)}.bind(this))),p.is(e.target)||0!==p.has(e.target).length||(r.removeClass("expanded"),this._checkForEllipsis(r,S,function(e){e?b.show(m):b.hide(m)}.bind(this))),g.is(e.target)||0!==g.has(e.target).length||(d.removeClass("expanded"),this._checkForEllipsis(d,x,function(e){e?w.show(m):w.hide(m)}.bind(this)))}.bind(this))},_validateEmail:function(e){var t=/^[-!#$%&'*+\/0-9=?A-Z^_a-z{|}~](\.?[-!#$%&'*+\/0-9=?A-Z^_a-z{|}~])*@[a-zA-Z](-?[a-zA-Z0-9])*(\.[a-zA-Z](-?[a-zA-Z0-9])*)+$/;return e.match(t)},_handleRecipientEdit:function(e,i,s){var n=i.find(".delivery_recipients_edit_box");n.on("keydown",function(t){var l=t.keyCode||t.which;if(t.target.value.length>0)(9==l||13==l||188==l||186==l)&&(s(t.target.value,e,i),n.val(""),t.preventDefault());else if(8==l){var a=i.find(".delivery_recipient:last");0!==a.length&&this._removeRecipient(e,a),t.preventDefault()}}.bind(this)),n.on("paste",function(l){setTimeout(function(){var a=this._checkForMultipleEmails(l.target.value);t.each(a,function(t){s(t,e,i)}),n.val("")}.bind(this),0)}.bind(this)),n.on("focusout",function(t){t.target.value.length>0&&(s(t.target.value,e,i),n.val(""))}.bind(this)),n.on("clicktap",function(e){return e.preventDefault(),!1}.bind(this))},_checkForMultipleEmails:function(e){var t=e.split(/,|;/);return t},_addAddress:function(s,n,l){var a=[{defaultName:s,address:s,type:s,id:t.uniqueId("recipientId_")}],r={recipients:a,removeLabel:o.translate("schdeule_delivery_remove_recipient_label"),invalidLabel:o.translate("schedule_delivery_invalid_address")},d=i.simpleTemplate(p),c=e(d(r));if(this._validateEmail(s)?c.find(".delivery_recipient_underline").hide():c.find(".delivery_recipient_underline").show(),l.find(".delivery_recipients_edit_field").before(c),!l.hasClass("expanded")){var h=n.find('label[for="'+l.id+'"]');l.prop("scrollHeight")>1.25*h.height()&&l.addClass("expanded")}return this.setIcons(c),a},_addEmailAddress:function(e,t,i){var s=this._addAddress(e,t,i);this.email.to=this.email.to.slice().concat(s),this._updateEmailRecipients(t),this._setRecipientsListEvents(t)},_addCCEmailAddress:function(e,t,i){var s=this._addAddress(e,t,i);this.email.cc=this.email.cc.slice().concat(s),this._updateCCRecipients(t),this._setRecipientsListEvents(t)},_addBCCEmailAddress:function(e,t,i){var s=this._addAddress(e,t,i);this.email.bcc=this.email.bcc.slice().concat(s),this._updateBCCRecipients(t),this._setRecipientsListEvents(t)},_addEmailRecipients:function(s,n,l){var a,r=[];l?a=this._verifyNewRecipients(s,this.email.to.slice())||[]:(this.email.to=[],a=s||[]);for(var d=0;d<a.length;d++)r.push({defaultName:a[d].defaultName||"",address:a[d].searchPath||a[d].address||"",type:a[d].type?o.translate(a[d].type):a[d].address?a[d].address:"",id:t.uniqueId("recipientId_")});var c={recipients:r,removeLabel:o.translate("schdeule_delivery_remove_recipient_label"),invalidLabel:o.translate("schedule_delivery_invalid_address")},h=i.simpleTemplate(p),u=e(h(c));n.find("#delivery_email_recipients_"+this.contentUniqueId+" .delivery_recipients_edit_field").before(u),this.email.to=this.email.to.slice().concat(r),this._updateEmailRecipients(n),l&&(1===r.length?this.glassContext.appController.showToast(o.translate("schedule_delivery_single_recipient_added")):r.length>1&&this.glassContext.appController.showToast(o.translate("schedule_delivery_multiple_recipient_added",{recipient_count:r.length}))),this.setIcons(u),this._setRecipientsListEvents(n)},_addCCRecipients:function(s,n,l){var a,r=[];l?a=this._verifyNewRecipients(s,this.email.cc.slice())||[]:(this.email.cc=[],a=s||[]);for(var d=0;d<a.length;d++)r.push({defaultName:a[d].defaultName||"",address:a[d].searchPath||a[d].address||"",type:a[d].type?o.translate(a[d].type):a[d].address?a[d].address:"",id:t.uniqueId("recipientId_")});var c={recipients:r,removeLabel:o.translate("schdeule_delivery_remove_recipient_label"),invalidLabel:o.translate("schedule_delivery_invalid_address")},h=i.simpleTemplate(p),u=e(h(c));n.find("#delivery_cc_recipients_"+this.contentUniqueId+" .delivery_recipients_edit_field").before(u),this.email.cc=this.email.cc.slice().concat(r),this._updateCCRecipients(n),l&&(1===r.length?this.glassContext.appController.showToast(o.translate("schedule_delivery_single_recipient_added")):r.length>1&&this.glassContext.appController.showToast(o.translate("schedule_delivery_multiple_recipient_added",{recipient_count:r.length}))),this.setIcons(u),this._setRecipientsListEvents(n)},_addBCCRecipients:function(s,n,l){var a,r=[];l?a=this._verifyNewRecipients(s,this.email.bcc.slice())||[]:(this.email.bcc=[],a=s||[]);for(var d=0;d<a.length;d++)r.push({defaultName:a[d].defaultName||"",address:a[d].searchPath||a[d].address||"",type:a[d].type?o.translate(a[d].type):a[d].address?a[d].address:"",id:t.uniqueId("recipientId_")});var c={recipients:r,removeLabel:o.translate("schdeule_delivery_remove_recipient_label"),invalidLabel:o.translate("schedule_delivery_invalid_address")},h=i.simpleTemplate(p),u=e(h(c));n.find("#delivery_bcc_recipients_"+this.contentUniqueId+" .delivery_recipients_edit_field").before(u),this.email.bcc=this.email.bcc.slice().concat(r),this._updateBCCRecipients(n),l&&(1===r.length?this.glassContext.appController.showToast(o.translate("schedule_delivery_single_recipient_added")):r.length>1&&this.glassContext.appController.showToast(o.translate("schedule_delivery_multiple_recipient_added",{recipient_count:r.length}))),this.setIcons(u),this._setRecipientsListEvents(n)},_addMobileRecipients:function(s,n,l){var a,r=[];l?a=this._verifyNewRecipients(s,this.mobile.to.slice())||[]:(this.mobile.to=[],a=s||[]);for(var d=0;d<a.length;d++)r.push({defaultName:a[d].defaultName||"",address:a[d].searchPath||a[d].address||"",type:a[d].type?o.translate(a[d].type):a[d].address?a[d].address:"",id:t.uniqueId("recipientId_")});var c={recipients:r,removeLabel:o.translate("schdeule_delivery_remove_recipient_label"),invalidLabel:o.translate("schedule_delivery_invalid_address")},h=i.simpleTemplate(p),u=e(h(c));n.find("#delivery_mobile_recipients_"+this.contentUniqueId).append(u),this.mobile.to=this.mobile.to.slice().concat(r),this._updateMobileRecipients(n),l&&(1===r.length?this.glassContext.appController.showToast(o.translate("schedule_delivery_single_recipient_added")):r.length>1&&this.glassContext.appController.showToast(o.translate("schedule_delivery_multiple_recipient_added",{recipient_count:r.length}))),this.setIcons(u),this._setRecipientsListEvents(n)},_verifyNewRecipients:function(e,t){for(var i=[],s=0;s<e.length;s++){for(var n=!0,l=0;l<t.length;l++)if(e[s].searchPath===t[l].address||e[s].address===t[l].address){n=!1;break}n&&i.push(e[s])}return i},_setRecipientsListEvents:function(t){var i=t.find(".delivery_recipient:not(.clickBound)");i.addClass("clickBound"),i.on("clicktap",function(e){e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation()});var s=t.find(".delivery_delete_recipient_icon:not(.clickBound)");s.addClass("clickBound"),s.on("clicktap",function(i){i.cancelBubble=!0,i.stopPropagation&&i.stopPropagation();var s=e(i.target).closest(".delivery_recipient");this._removeRecipient(t,s)}.bind(this))},_removeRecipient:function(e,t){var i=t.attr("id"),s=t.closest(".delivery_recipients_field").data("recipienttype");switch(t.hide(m),t.remove(),s){case"email":this.email.to=this._removeRecipientFromList(i,this.email.to.slice()),this._updateEmailRecipients(e);break;case"cc":this.email.cc=this._removeRecipientFromList(i,this.email.cc.slice()),this._updateCCRecipients(e);break;case"bcc":this.email.bcc=this._removeRecipientFromList(i,this.email.bcc.slice()),this._updateBCCRecipients(e);break;case"mobile":this.mobile.to=this._removeRecipientFromList(i,this.mobile.to.slice()),this._updateMobileRecipients(e)}},_removeRecipientFromList:function(e,t){for(var i=-1,s=0;s<t.length;s++)if(e===t[s].id){i=s;break}i>=0&&t.splice(i,1);var n=t;return n},_updateEmailRecipients:function(e){var t=e.find("#delivery_email_ellipsis_"+this.contentUniqueId),i=e.find("#delivery_email_recipients_"+this.contentUniqueId),s=e.find('label[for="delivery_email_recipients_edit_field_'+this.contentUniqueId+'"]');this.deliveryOptions.email.to=this.email.to.slice(),this._checkForEllipsis(i,s,function(e){e?i.hasClass("expanded")||t.show(m):(t.hide(m),i.removeClass("expanded"))}.bind(this))},_updateCCRecipients:function(e){var t=e.find("#delivery_cc_ellipsis_"+this.contentUniqueId),i=e.find("#delivery_cc_recipients_"+this.contentUniqueId),s=e.find('label[for="delivery_cc_recipients_edit_field_'+this.contentUniqueId+'"]');this.deliveryOptions.email.cc=this.email.cc.slice(),this._checkForEllipsis(i,s,function(e){e?i.hasClass("expanded")||t.show(m):(t.hide(m),i.removeClass("expanded"))}.bind(this))},_updateBCCRecipients:function(e){var t=e.find("#delivery_bcc_ellipsis_"+this.contentUniqueId),i=e.find("#delivery_bcc_recipients_"+this.contentUniqueId),s=e.find('label[for="delivery_bcc_recipients_edit_field_'+this.contentUniqueId+'"]');this.deliveryOptions.email.bcc=this.email.bcc.slice(),this._checkForEllipsis(i,s,function(e){e?i.hasClass("expanded")||t.show(m):(t.hide(m),i.removeClass("expanded"))}.bind(this))},_updateMobileRecipients:function(e){var t=e.find("#delivery_mobile_ellipsis_"+this.contentUniqueId),i=e.find("#delivery_mobile_recipients_"+this.contentUniqueId),s=e.find('label[for="delivery_mobile_recipients_'+this.contentUniqueId+'"]');this.deliveryOptions.mobile.to=this.mobile.to.slice(),
- this._checkForEllipsis(i,s,function(e){e?i.hasClass("expanded")||t.show(m):(t.hide(m),i.removeClass("expanded"))}.bind(this))},_checkForEllipsis:function(t,i,s,n){var l=t.offset().left+t.width();if(1!==t.width()){n||(n=0),t.find("#invisibleSpan").remove();var a=!1;if(0!==t.prop("scrollHeight")&&0!==i.height()||n>10)t.prop("scrollHeight")>1.25*i.height()?("function"==typeof s&&s(!0),t.hasClass("expanded")||t.find(".delivery_recipient").each(function(){e(this).offset().left+e(this).width()>l-30&&0===e(this).position().top&&!a&&(e(this).before("<span id='invisibleSpan' style='width:30px; height:30px; visability:hidden'> </span>"),a=!0)})):"function"==typeof s&&s(!1);else{var r=m;setTimeout(function(){this._checkForEllipsis(t,i,s,n+1)}.bind(this),r)}}},_cleanRecipientsArray:function(e){for(var t=[],i=0;i<e.length;i++)t.push({address:e[i].address,defaultName:e[i].defaultName,type:e[i].type?o.translate(e[i].type):e[i].address?e[i].address:""});return t},_setEditorDialogHideHandler:function(){e("body").hasClass("editorHideHandlerSet")||e("body").addClass("editorHideHandlerSet").on("clicktap.ckeditorDialog",function(t){var i=e("body").find(".cke_dialog"),s=e("body").find(".cke_dialog_background_cover");(i.is(t.target)||i.has(t.target).length>0||s.is(t.target)||s.has(t.target).length>0)&&t.stopPropagation()})}});return f}),define("bi/schedule/views/ScheduleDeliveryPickerView",["jquery","bi/sharecommon/utils/simpledoT","q","bi/schedule/views/DeliveryPickerView","bi/sharecommon/utils/translator","bi/commons/utils/Utils","bootstrap"],function(e,t,i,s,n,l){"use strict";var a="350px",r=s.extend({init:function(t){if(e.extend(this,t),r.inherited("init",this,arguments),void 0==t.slideoutparent)throw"Error: slideoutparent parameter must be provided.";this.isVisible=!1,this.slideout=null},render:function(){this.hasPermission&&!this.hasPermission.write&&this.hasPermission.read&&this.$toggler.prop("disabled",!0),this._setEvents(),this.$activeOptionsContainer&&this.updateActiveDeliveryList(this.$activeOptionsContainer)},_setEvents:function(){this.$toggler.on("primaryaction",function(e){this._showDeliveryOptions()}.bind(this))},_setpanelContent:function(){var t="function"==typeof this.allowRecipients?this.allowRecipients():!0,i=this.getDeliveryContent(t);this.$panelContent=e(i)},_showDeliveryOptions:function(){this.isVisible=!0,this._setpanelContent(),this.slideout=this.glassContext.appController.showSlideOut({parent:this.slideoutparent,overlay:this.overlay,width:a,enableTabLooping:!0,label:n.translate("schedule_delivery_picker_name"),content:{module:"bi/schedule/views/OptionsSlideoutView",content:this.$panelContent,title:n.translate("schedule_delivery_label"),closeCallback:function(){this._close()}.bind(this),setUpCallback:function(e){this.setDeliveryOptions(e,this.$activeOptionsContainer)}.bind(this)}})},_close:function(){if(this.isVisible=!1,e("body").hasClass("editorHideHandlerSet")){e("body").removeClass("editorHideHandlerSet"),e("body").off(".ckeditorDialog");var t=e("body").find(".cke_reset_all"),i=e("body").find(".cke_dialog_background_cover");t.remove(),i.remove()}this.close()}});return r}),define("bi/schedule/views/PdfOptionsView",["jquery","q","bi/sharecommon/utils/translator","bi/commons/ui/View"],function(e,t,i,s){"use strict";var n=s.extend({init:function(t){n.inherited("init",this,arguments),this._initVariables(),e.extend(this,t)},render:function(){var e=t.defer();return this._setEvents(),e.resolve(),e.promise},getOptions:function(){return this.pdfOptions},_setEvents:function(){var t=this;this.$toggler.on("clicktap",function(){t._closeOpenSiblings().then(function(){var s={module:"bi/content_apps/PdfOptionsView",glassContext:t.glassContext,closeCallback:t._setPdfOptions.bind(t),pdfOptions:e.map(t.pdfOptions,function(e,t){return[{name:t,value:e}]})};t.slideout=t.glassContext.appController.showSlideOut({parent:t.parentSlideout,position:t.parentSlideout.position,width:"350",label:i.translate("schedule_pdf_options_name"),content:s})}).done()})},_setPdfOptions:function(t){if(t){var i={};t.forEach(function(t){var s=t.value;if(-1!==t.name.indexOf("Password")&&t.value.length){var n=e.parseXML(t.value),l=e(n).find("password");l.text().length&&(s=l.text())}(void 0!==s||null!==s)&&(i[t.name]=s)}.bind(this)),this.pdfOptions=i}},_initVariables:function(){this.glassContext={},this.$toggler={},this.parentSlideout={},this.slideout=null,this.pdfOptions={},this.updatedPdfOptions={}},_closeOpenSiblings:function(){var e=t.defer();return this.slideout&&this.slideout.open?this.slideout.hide().then(function(){e.resolve()}).done():e.resolve(),e.promise}});return n}),define("bi/schedule/views/ScheduleView",["bi/glass/app/ContentView","bi/schedule/app/appControler","jquery","bi/commons/utils/Utils","bi/sharecommon/utils/translator","q","bi/sharecommon/utils/simpledoT","text!bi/schedule/templates/ScheduleView.html","underscore","moment-timezone","bi/schedule/views/DateTimeRangeCadencePickerView","bi/schedule/views/DailyCadencePickerView","bi/schedule/views/WeeklyCadencePickerView","bi/schedule/views/MonthlyCadencePickerView","bi/schedule/views/YearlyCadencePickerView","bi/schedule/views/TriggerCadencePickerView","bi/schedule/views/FormatPickerView","bi/schedule/views/ScheduleDeliveryPickerView","bi/commons/ui/properties/DropDown","bi/commons/ui/properties/CheckBox","ca_portal/features/mypreferences/MyPreferences","bi/schedule/views/PdfOptionsView","bi/commons/ui/properties/PropertyUIControl","bi/content_apps/utils/ContentStoreObject","bi/commons/ui/dialogs/ConfirmationDialog","bi/content_apps/utils/C10Utils","caglass/ajax/CAAuthentication","bi/content_apps/authoring/AuthoringHelper"],function(e,t,i,s,n,l,a,r,o,d,c,h,u,_,p,v,b,m,y,f,g,C,w,k,I,S,x,O){"use strict";var P="350px",D=e.extend({init:function(e){D.inherited("init",this,arguments),this.showOptions=!0,this.defaultLocale=e.glassContext.services.userProfile.preferences.contentLocale||"en-us",this.options={delivery:{save:{notify:!1}},outputLocale:[this.defaultLocale],pdf:{},burst:!1,outputFormat:[]},this.options.outputFormat.push(this._getDefaultOutputFormat()),o.extend(this,e),this.currentRenderedCadenceType="weekly",this.outputLocale=[this.defaultLocale],this.msgs=[],this.warningMessage=null,this.parameterValues=[],this.reportParameterValues=[],this.scheduleTypeSelector=null,this.uniqueId=o.uniqueId("id_"),this.readOnly=!1,this.deliveryPicker=null,this.outputFormatPicker=null,this.pdfOptionsView=null,this.timezone=this.glassContext.services.userProfile.preferences.timeZoneID,this.canBurst=this.canBurst&&this.glassContext.hasCapability("canUseBursting"),this.showPDFOption=this.glassContext.hasCapability("canGeneratePDFOutput")&&"interactiveReport"!==this.objectInformation.type&&"powerPlay8Report"!==this.objectInformation.type&&"powerPlay8ReportView"!==this.objectInformation.type,this.initScheduleDescriptor={reportId:null,reportType:null,scheduleInfo:{active:null,startDate:null,endDate:null,endType:null,timezone:null,weekly:null,everyNPeriods:null,type:null},options:{outputFormat:null,delivery:null,outputLocale:null,pdf:null,burst:null},parameters:null},this.showOptions=this._supportsOptions()},_supportsOptions:function(){var e=["dataSet2","agentDefinition","agentDefinitionView","jobDefinition","jupyterNotebook"];return-1===e.indexOf(this.objectInformation.type)},_openClassicView:function(){var e=this._prepareScheduleDescriptor();this._confirmChanges(function(){o.isEqual(e,this.initDesc)?(this.setDone(),this.slideout.hide(),this.slideout.parent&&this.slideout.parent.hide(),S.openC10Morphlet("portal/schedule/report.xts",this.objectInfo.type,this.objectInfo.id)):this._createOrUpdateScheduleRoutine(e).then(function(){this.slideout.hide(),this.slideout.parent&&this.slideout.parent.hide(),S.openC10Morphlet("portal/schedule/report.xts",this.objectInfo.type,this.objectInfo.id)}.bind(this))}.bind(this),function(){},n.translate("schedule_update_confirm"),n.translate("schedule_update_save_before_classicview"),e)},setFocus:function(){this.$el.focus()},_confirmChanges:function(e,t,i,s,n){if(n&&o.isEqual(n,this.initDesc))return void e();var l=new I("warning",i,s);l.confirm(e,t)},_hasRestrictedFormats:function(){for(var e=this.outputFormatPicker&&this.outputFormatPicker.getOutputFormats()||[],t=0;t<e.length;t+=1)if(!O.userCanGenerateFormat(this.glassContext,e[t]))return!0;return!1},_resetRestrictedFormats:function(e){var t=o.reject(e.options.outputFormat,function(e){return!O.userCanGenerateFormat(this.glassContext,e)}.bind(this));0===t.length&&t.push("HTML"),e.options.outputFormat=t},_handleUpdate:function(){return this._closeOpenChildren().then(function(){this.setWorking(),this.hideWarningMessage();var e=this._prepareScheduleDescriptor();if(this.initDesc=e,this.validate(e)){if(this.descriptor){var t=this._hasOnlyTimezoneBeenChanged(this.initScheduleDescriptor,e),i=this._hasRestrictedFormats(),s="";return t&&i?s=n.translate("schedule_update_restricted_formats_timezone_confirm_message"):t?s=n.translate("schedule_update_timezone_difference_confirm_message"):i&&(s=n.translate("schedule_update_restricted_formats_confirm_message")),s.length>0?this._confirmChanges(function(){i&&this._resetRestrictedFormats(e),this._createOrUpdateScheduleRoutine(e)}.bind(this),this.setDone.bind(this),n.translate("schedule_update_confirm"),s):this._createOrUpdateScheduleRoutine(e)}return this._createOrUpdateScheduleRoutine(e)}return this.showWarningMessage(),this.setDone(),Promise.resolve()}.bind(this))},_setEvents:function(){this.$el.find(".classicViewLink").on("primaryaction",this._openClassicView.bind(this)),this.$el.find(".schedule_primary_button").on("clicktap",this._handleUpdate.bind(this)),this.$el.find(".schedule_language_picker").on("clicktap",function(){this._closeOpenChildren().then(function(){this.glassContext.appController.showSlideOut({parent:this.slideout,overlay:!1,width:P,label:n.translate("schedule_language_picker_name"),content:{module:"bi/content_apps/common/ui/LanguagePickerView",glassContext:this.glassContext,supportedContentLocales:this.supportedContentLocales,enabledLanguages:this.outputLocale,closeCallback:function(e){this.outputLocale=e;for(var t=n.translate("schedule_no_languages_label"),i=[],s=0;s<this.outputLocale.length;s++)i.push(this.supportedContentLocales[this.outputLocale[s]]);t=i.join(", "),this.$el.find(".output_language_list").text(t),this.$el.find(".output_language_list").attr("title",t)}.bind(this)}})}.bind(this)).done()}.bind(this));var e=function(){this.close()}.bind(this);this.$el.find(".schedule_secondary_button").on("clicktap",e)},_prepareScheduleDescriptor:function(){var e=this.objectInformation.id,t=this.objectInformation.type,i=this.isEditMode?this.objectInformation.descriptor.scheduleInfo.active:!0,s=this.options.outputFormat;null!==this.outputFormatPicker&&(s=this.outputFormatPicker.getOutputFormats());var n={active:i,timezone:this.timezone};n=this.datetimeRangeCadencePicker.toDescriptor(n),n=this.cadencePicker.toDescriptor(n);var l=this.options.delivery;null!==this.deliveryPicker&&(l=this.deliveryPicker.getDeliveryOptions());var a=this.outputLocale||this.options.outputLocale,r=this.pdfOptionsView?this.pdfOptionsView.getOptions():this.options.pdf,d=this._getBurstValue(),c=o.extend({},{reportId:e,reportType:t,scheduleInfo:n,options:{outputFormat:s,delivery:l,outputLocale:a,pdf:r,burst:d},parameters:this.parameterValues});return("agentDefinition"===this.objectInformation.type||"agentDefinitionView"===this.objectInformation.type)&&delete c.options,c},_hasOnlyTimezoneBeenChanged:function(e,t){var s=!1,n=i.extend(!0,{},e),l=i.extend(!0,{},t),a=n.scheduleInfo.timezone,r=l.scheduleInfo.timezone;return a!==r&&(delete n.scheduleInfo.timezone,delete l.scheduleInfo.timezone,"indefinite"===n.scheduleInfo.endType&&delete n.scheduleInfo.endDate,"indefinite"===l.scheduleInfo.endType&&delete l.scheduleInfo.endDate,s=o.isEqual(n,l)),s},_closeOpenChildren:function(){var e=l.defer();if(this.slideout&&this.slideout.hasOpenChild()){var t=this.slideout.child;t.hide().then(function(){e.resolve()}).done()}else e.resolve();return e.promise},_getOutputFormat:function(e){var t="";try{for(var i=0;i<e.length;i++)if("outputFormat"===e[i].name){t=e[i].value.join(",");break}}catch(s){}return t},_createOrUpdateSchedule:function(e){var i=this;return i.objectInformation&&i.objectInformation.type&&"jobDefinition"===i.objectInformation.type&&e.options&&delete e.options,t.createSchedule(e,i.glassContext).then(function(e){var s=null===this.deliveryPicker?{}:this.deliveryPicker.getCloudOptions();return e||(e={}),t.updateSaveToCloudOptions(e.id,s,this.glassContext).then(function(){i.onCreateOrUpdateCallback&&"function"==typeof i.onCreateOrUpdateCallback&&i.onCreateOrUpdateCallback();var e,t={objectType:this.objectInformation.type,object:this.objectInformation.id,"custom.outputFormat":this._getOutputFormat(this.objectInformation.outputFormat)};i.isEditMode?(t.type="Updated Object",t.action="scheduleEdited",t.milestoneName="scheduleEdited_"+this.objectInformation.type,e=n.translate("sch_update_success_msg")):(t.type="Created Object",t.action="scheduleCreated",t.milestoneName="scheduleCreated_"+this.objectInformation.type,e=n.translate("sch_create_success_msg"));var s=this.glassContext.getCoreSvc(".Instrumentation");return s&&s.track&&s.track(t),i.glassContext.appController.showToast(e,{newestOnTop:!0,preventDuplicates:!1,timeOut:6e3,extendedTimeOut:1e3}),i.setDone(),i.close(),Promise.resolve()}.bind(this))}.bind(this)).fail(function(){i.setDone()})},_getFormatFromObject:function(){if(this.objectInformation&&this.objectInformation.options){var e=o.find(this.objectInformation.options,function(e){return"outputFormat"===e.name});if(e){var t;return t="string"===(typeof e.value).toLocaleLowerCase()?e.value:e.value[0],O.userCanGenerateFormat(this.glassContext,t)||(t="HTML"),t}}else;},_getDefaultOutputFormat:function(){var e=this._getFormatFromObject(),t=this.glassContext.services.userProfile.preferences.format;return e?e:t&&O.userCanGenerateFormat(this.glassContext,t)?t:"HTML"},_createOrUpdateScheduleRoutine:function(e){return t.getUserCredential(this.glassContext).then(function(){return this._createOrUpdateSchedule(e)}.bind(this)).fail(function(){this.glassContext.appController.showToast(n.translate("sub_credentials_expired_msg"),{type:"warning",preventDuplicates:!0,btnLabel:n.translate("sub_renew_credentials_button"),callback:function(){return this._caAuthentication=new x,this._caAuthentication.storeCredentials(this.glassContext).then(function(){this._createOrUpdateSchedule(e)}.bind(this)).fail(function(t){return t&&t.displayObjects?(this._myPreferences=new g({glassContext:this.glassContext}),this._myPreferences.openCreateCredentialDialog(t.displayObjects).then(function(){this._createOrUpdateSchedule(e)}.bind(this)).fail(function(){this.setDone()}.bind(this))):void 0}.bind(this)).fail(function(){this.setDone()}.bind(this))}.bind(this)})}.bind(this))},render:function(){var e=l.defer();this.descriptor=this.objectInformation.descriptor,this.isEditMode="undefined"!=typeof this.descriptor,this.readOnly=this.isEditMode&&this.objectInformation.hasPermission&&!this.objectInformation.hasPermission.write&&this.objectInformation.hasPermission.read;var t=a.simpleTemplate(r),s=this.objectInformation||{},d=this.canBurst||!1,c=this.showPDFOption;s.defaultName=this.objectInformation.defaultName||"",this.canShowPrompt=!S.isPowerPlay(this.objectInformation.type),this.canShowPrompt&&(this.reportParameterValues=this.objectInformation.parameters||[]);var h=this.getScheduleType(),u=this.isEditMode?n.translate("schedule_panel_title_update_text"):n.translate("schedule_panel_title_text"),_={canShowClassic:this._supportsOptions(),asset_name:o.escape(s.defaultName),schedule_panel_back:n.translate("schedule_panel_back_text"),schedule_panel_title:u,schedule_type_label:n.translate("schedule_type_label"),schedule_output_label:n.translate("schedule_output_label"),schedule_delivery_label:n.translate("schedule_delivery_label"),schedule_prompts_label:n.translate("schedule_prompts_label"),schedule_select_text:n.translate("schedule_select_text"),schedule_create_btn:this.isEditMode?n.translate("schedule_update_btn_label"):n.translate("schedule_create_btn_label"),schedule_cancel_btn:n.translate("schedule_cancel_btn_label"),schedule_period:n.translate("schedule_period"),uniqueid:this.uniqueId,output_format_select_text:n.translate("output_format_select_text"),showOptions:this.showOptions,showPDFOption:c,canBurst:d,schedule_languages_label:n.translate("schedule_languages_label"),schedule_pdf_options_label:n.translate("schedule_pdf_options_label"),schedule_classic_view_label:n.translate("classicViewLink"),canShowPrompt:this.canShowPrompt};_.schedule_controls_description=n.translate("schedule_controls_description",{action1:_.schedule_create_btn,action2:_.schedule_cancel_btn});var p=[{type:"Banner",centerLabel:!0,backButton:this.slideout.overlay,value:u},{type:"SectionLabel",label:n.translate("schedule_period")}];return this.showOptions&&p.push({type:"SectionLabel",label:n.translate("schedule_options")}),this._propertyUIControl=new w({glassContext:this.glassContext,el:this.$el,closeCallback:this.close.bind(this),items:p}),this._propertyUIControl.render().then(function(){var e=i(t(_));return this.$el=this.$el.find(".propertiesUIControlPageView"),this.$el.prepend(e.find(".schedule_type_section")),e.find(".schedule_period_section").insertAfter(this.$el.find(".sectionLabel:first")),this.$el.append(e.find(".schedule_options_section")),this.$el.append(e.find(".progress-overlay")),this.$el.addClass("new_schedule_slideout"),this.renderDateTimeRangeCadencePicker()}.bind(this)).then(function(){this.renderCadencePicker(h),this.showOptions&&(this.renderOutputFormatPicker(),this.renderPromptRow(),this.renderDeliveryPicker(),c&&this.renderPdfOptionsView(),this.setLanguageLabel(),d&&this.renderBurstCheckBox()),this._renderTypeSelector(h),this.isEditMode&&(this.currentRenderedCadenceType=h,this.scheduleTypeSelector.getHTMLControl().val(this.currentRenderedCadenceType)),this._setIcons(),this.readOnly&&(this.$el.find(".schedule_primary_button").prop("disabled",!0),this.$el.find(".schedule_secondary_button").prop("disabled",!0),this.$el.find(".schedule_language_option_toggler").prop("disabled",!0),this.$el.find(".schedule_pdf_option_toggler").prop("disabled",!0),this.$el.find("input").prop("disabled",!0)),this._saveExistingScheduleInitialState(),this._setEvents(),this.initDesc=this._prepareScheduleDescriptor(),e.resolve()}.bind(this)),e.promise},setLanguageLabel:function(){this.objectInformation.descriptor&&this.objectInformation.descriptor.options.outputLocale&&(this.outputLocale=this.objectInformation.descriptor.options.outputLocale),this.glassContext.services.config.getContentLocales().then(function(e){this.supportedContentLocales=e,this.objectInformation.descriptor&&this.objectInformation.descriptor.options.outputLocale&&(this.outputLocale=this.objectInformation.descriptor.options.outputLocale);var t=n.translate("schedule_no_languages_label");if(this.isEditMode){if(this.objectInformation.descriptor&&this.objectInformation.descriptor.options.outputLocale){for(var i=[],s=0;s<this.outputLocale.length;s++)i.push(e[this.outputLocale[s]]);t=i.length>0?i.join(", "):e[this.defaultLocale]}}else t=e[this.defaultLocale];this.$el.find(".output_language_list").text(t),this.$el.find(".output_language_list").attr("title",t)}.bind(this)).done()},shouldShowMobile:function(){var e=["interactiveReport","report","query","analysis"];return-1!==e.indexOf(this.objectInformation.type)||"reportView"===this.objectInformation.type&&-1!==e.indexOf(this.objectInformation.base[0].type)},renderDeliveryPicker:function(){var e={},t=this.objectInformation.defaultName;this.isEditMode&&this.objectInformation.descriptor.options.delivery&&(e=this.objectInformation.descriptor.options.delivery);try{this.deliveryPicker=new m({$el:this.$el.find(".schedule_delivery_picker"),$toggler:this.$el.find(".schedule_delivery_picker"),$activeOptionsContainer:this.$el.find(".delivery_list"),reportName:t,deliveryOptions:e,rawOptions:this.objectInformation.rawOptions,isEditMode:this.isEditMode,glassContext:this.glassContext,slideoutparent:this.slideout,hasPermission:this.objectInformation.hasPermission,showMobile:this.shouldShowMobile(),enableAdvancedSettings:!0,allowRecipients:function(){return!this._getBurstValue()}.bind(this)}),this.deliveryPicker.render()}catch(i){console.log("There was an error initializing the DeliveryPicker.",i)}},renderPdfOptionsView:function(){var e=this,t={};this.isEditMode&&this.objectInformation.descriptor.options.pdf&&(t=this.objectInformation.descriptor.options.pdf),this.pdfOptionsView=new C({glassContext:e.glassContext,$toggler:e.$el.find(".schedule_pdf_options_picker"),parentSlideout:e.slideout,pdfOptions:t}),this.pdfOptionsView.render()},_saveExistingScheduleInitialState:function(){this.isEditMode&&(this.initScheduleDescriptor=this._prepareScheduleDescriptor(),this.initScheduleDescriptor.scheduleInfo.timezone=this.descriptor.scheduleInfo.timezone)},_renderTypeSelector:function(e){var t=[];this.glassContext.hasCapability("canUseSchedulingByDay")&&t.push({label:n.translate("daily_label"),value:"daily",selected:"daily"==e?!0:!1}),this.glassContext.hasCapability("canUseSchedulingByWeek")&&t.push({label:n.translate("weekly_label"),value:"weekly",selected:"weekly"==e?!0:!1}),this.glassContext.hasCapability("canUseSchedulingByMonth")&&t.push({label:n.translate("monthly_label"),value:"monthly",selected:"monthly"==e?!0:!1}),this.glassContext.hasCapability("canUseSchedulingByYear")&&t.push({label:n.translate("yearly_label"),value:"yearly",selected:"yearly"==e?!0:!1}),this.glassContext.hasCapability("canUseSchedulingByTrigger")&&t.push({label:n.translate("trigger_label"),value:"trigger",selected:"trigger"==e?!0:!1}),0===t.length&&t.push({label:n.translate(e+"_label"),value:e,selected:!0});var i="schedule_type_"+this.uniqueId,s="schedule_type_option";this.scheduleTypeSelector=new y({id:i,el:this.$el.find("#schedule_type_selector_container_"+this.uniqueId),label:n.translate("schedule_type_label"),name:s,responsive:!1,onChange:function(e,t){this._toggleCadenceView(e,t)}.bind(this),options:t,readOnly:this.readOnly,ariaLabel:n.translate("schedule_type_aria_label"),ariaDescribedby:n.translate("schedule_type_description")}),this.scheduleTypeSelector.doRender()},_toggleCadenceView:function(e,t){var i=this.$el.find(".schedule_cadence_picker");t!=this.currentRenderedCadenceType&&(this.currentRenderedCadenceType=t,i.empty(),this.renderCadencePicker(t))},renderDateTimeRangeCadencePicker:function(){return this.datetimeRangeCadencePicker=new c({$el:this.$el.find(".schedule_datetime_range_picker"),objectInformation:{descriptor:this.objectInformation.descriptor},glassContext:this.glassContext}),this.datetimeRangeCadencePicker.render()},renderCadencePicker:function(e){var t=this.$el.find(".schedule_cadence_picker");switch(e){case"daily":this.cadencePicker=new h({$el:t,objectInformation:{descriptor:this.objectInformation.descriptor,showDailyInterval:!0},glassContext:this.glassContext,hasPermission:this.objectInformation.hasPermission});break;case"weekly":this.cadencePicker=new u({$el:t,objectInformation:{descriptor:this.objectInformation.descriptor,showRunEvery:!0,showDailyInterval:!0},glassContext:this.glassContext,hasPermission:this.objectInformation.hasPermission});break;case"monthly":this.cadencePicker=new _({$el:t,objectInformation:{descriptor:this.objectInformation.descriptor,showDailyInterval:!0},glassContext:this.glassContext,hasPermission:this.objectInformation.hasPermission});break;case"yearly":this.cadencePicker=new p({$el:t,objectInformation:{descriptor:this.objectInformation.descriptor,showDailyInterval:!0},glassContext:this.glassContext,hasPermission:this.objectInformation.hasPermission});break;case"trigger":this.cadencePicker=new v({$el:t,objectInformation:{descriptor:this.objectInformation.descriptor},glassContext:this.glassContext});break;default:console.log("Wrong cadence type.")}this.cadencePicker&&this.cadencePicker.render()},renderOutputFormatPicker:function(){var e=this.options.outputFormat;this.isEditMode&&this.objectInformation.descriptor.options.outputFormat&&(e=this.objectInformation.descriptor.options.outputFormat.slice());try{var t="interactiveReport"===this.objectInformation.type||"reportView"===this.objectInformation.type&&this.objectInformation.base&&this.objectInformation.base[0]&&this.objectInformation.base[0].type&&"interactiveReport"===this.objectInformation.base[0].type,i="powerPlay8Report"===this.objectInformation.type||"powerPlay8ReportView"===this.objectInformation.type;this.outputFormatPicker=new b({$el:this.$el.find(".output_format_list"),$toggler:this.$el.find(".schedule_output_format_picker"),outputFormats:i?this._getOutputFormatsForPowerPlayObjects(e):e.slice(),hasPermission:this.objectInformation.hasPermission,showHTML:!i,showPDF:!t&&this.glassContext.hasCapability("canGeneratePDFOutput"),showExcel:!t&&!i&&this.glassContext.hasCapability("canGenerateXLSOutput"),showCSV:!t&&!i&&this.glassContext.hasCapability("canGenerateCSVOutput"),showXML:!t&&!i&&this.glassContext.hasCapability("canGenerateXMLOutput"),glassContext:this.glassContext,slideoutparent:this.slideout,overlay:!1}),this.outputFormatPicker.render()}catch(s){console.log("There was an error initializing the FormatPicker.",s)}},_getOutputFormatsForPowerPlayObjects:function(e){return this.objectInformation.options?e.slice():["PDF"]},_renderPromptRowForReport:function(){var e=this;this.objectInfo=this.objectInformation,this.isEditMode&&this.descriptor.parameters&&(this.parameterValues=this.descriptor.parameters);var t=this.parameterValues.length>0,i=t?this.parameterValues:this.reportParameterValues;this.$el.find(".prompt_picker_target").on("clicktap",function(){e._closeOpenChildren().then(function(){e.glassContext.appController.showSlideOut({position:e.slideout?null:"right",parent:e.slideout,width:"350",enableTabLooping:!0,label:n.translate("schedule_prompt_picker_name"),content:{module:"bi/content_apps/PromptValuesView",parentView:e,glassContext:e.glassContext,promptDisplayValues:k.getPromptsDisplayValues(i),parameters:e.parameterValues,hasPermission:e.objectInformation.hasPermission,clearCallback:e._updatePromptValueLabelCB.bind(e),editCallback:e._updatePromptValueLabelCB.bind(e)}})}).done()}),this._updatePromptValueLabel(i,!t)},renderPromptRow:function(){return this.canShowPrompt?this._renderPromptRowForReport():void 0},_updatePromptValueLabelCB:function(e){this.parameterValues=e?e:[];var t=this.$el.find(".currentPromptValues");t.text(this._getPromptValueLabel(this.parameterValues))},_updatePromptValueLabel:function(e,t){var i=this.$el.find(".currentPromptValues");i.text(this._getPromptValueLabel(e,t))},_getPromptValueLabel:function(e,t){var i=n.translate("schedule_prompt_value_label_default"),s=t?"report":"schedule";return e&&e.length>0&&(i=1==e.length?n.translate(s+"_prompt_value_label_single"):n.translate(s+"_prompt_value_label_multiple",{number:e.length})),i},renderBurstCheckBox:function(){var e=!1;this.objectInformation&&this.objectInformation.descriptor&&this.objectInformation.descriptor.options&&this.objectInformation.descriptor.options.burst&&(e=this.objectInformation.descriptor.options.burst||!1),this.burstCheckbox=new f({id:"schedule_burst_checkbox_"+this.uniqueId,el:this.$el.find(".schedule_burst_option_container"),name:"schedule_burst_report",label:n.translate("schedule_burst_label"),ariaLabel:n.translate("schedule_burst_label"),checked:e,controlOnLeft:!0,onChange:function(){}}),this.burstCheckbox.doRender()},close:function(){this.slideout.hide(),i(".flyoutPane .pane-child").css("z-index","-1")},setWorking:function(){this.$overlay=this.$el.find(".progress-overlay"),this.$overlay.show()},setDone:function(){this.$overlay&&this.$overlay.hide()},_setIcons:function(){for(var e=this.$el.find(".common_schedule_icon"),t=0;t<e.length;t++){var l=i(e[t]);s.setIcon(l,"common-"+l.data("icon"),n.translate("svg_expand_icon"))}},getScheduleType:function(){var e=this.getCapabilityScheduleType();if(!this.isEditMode)return e;switch(this.descriptor.scheduleInfo.type){case"daily":case"dailyWithIntradayRecurrence":return"daily";case"monthlyRelative":case"monthlyAbsolute":case"monthlyRelativeWithIntradayRecurrence":case"monthlyAbsoluteWithIntradayRecurrence":return"monthly";case"yearlyRelative":case"yearlyAbsolute":case"yearlyRelativeWithIntradayRecurrence":case"yearlyAbsoluteWithIntradayRecurrence":return"yearly";case"trigger":return"trigger";default:return"weekly"}},getCapabilityScheduleType:function(){return this.glassContext.hasCapability("canUseSchedulingByWeek")?"weekly":this.glassContext.hasCapability("canUseSchedulingByDay")?"daily":this.glassContext.hasCapability("canUseSchedulingByMonth")?"monthly":this.glassContext.hasCapability("canUseSchedulingByYear")?"yearly":this.glassContext.hasCapability("canUseSchedulingByTrigger")?"trigger":"weekly"},validate:function(){if(this.msgs=[],this.msgs=this.datetimeRangeCadencePicker.validate(this.msgs),this.msgs.length>0)return!1;if(this.msgs=this.cadencePicker.validate(this.msgs),this.msgs.length>0)return!1;var e=this._getBurstValue();if(this.deliveryPicker){var t=this.deliveryPicker.getDeliveryOptions(),s=this.$el.find(".delivery_list");if(s.removeAttr("aria-invalid aria-describedby"),!e){if(t.email){if(t.email.to=t.email.to?t.email.to:[],t.email.cc=t.email.cc?t.email.cc:[],t.email.bcc=t.email.bcc?t.email.bcc:[],0===t.email.to.length&&0===t.email.cc.length&&0===t.email.bcc.length)return this.msgs.push(n.translate("schedule_delivery_no_email_recipients_error")),s.attr({"aria-invalid":"true","aria-describedby":this.msgs[0]}),!1;if(!t.email.emailAsAttachment&&!t.email.emailAsURL)return this.msgs.push(n.translate("schedule_delivery_email_require_include")),s.attr({"aria-invalid":"true","aria-describedby":this.msgs[0]}),!1}if(t.mobile&&("undefined"==typeof t.mobile.to||0===t.mobile.to.length))return this.msgs.push(n.translate("schedule_delivery_no_mobile_recipients_error")),s.attr({"aria-invalid":"true","aria-describedby":this.msgs[0]}),!1}if(t.print&&""===i.trim(t.print.name))return this.msgs.push(n.translate("schedule_delivery_printer_empty_error")),s.attr({"aria-invalid":"true","aria-describedby":this.msgs[0]}),!1;if(t.archive&&""===i.trim(t.archive.filenameStub))return this.msgs.push(n.translate("schedule_delivery_archive_name_empty_error")),s.attr({"aria-invalid":"true","aria-describedby":this.msgs[0]}),!1}return 0===this.msgs.length},showWarningMessage:function(){this.warningMessage=this.$el.find(".invalid_input_warning_message"),this.warningMessage&&(this.warningMessage.text(this.msgs[0]),this.warningMessage.show())},hideWarningMessage:function(){this.warningMessage&&this.warningMessage.hide()},_getBurstValue:function(){var e=!1;return this.canBurst&&"undefined"!=typeof this.burstCheckbox&&(e=this.burstCheckbox.isChecked()),e}});return D}),define("text!bi/schedule/templates/SchedulesView.html",[],function(){return'<!-- /*\n * Licensed Materials - Property of IBM\n * \n * IBM Cognos Products: SHARE\n * \n * (C) Copyright IBM Corp. 2015, 2016\n * \n * US Government Users Restricted Rights - Use, duplication or disclosure\n * restricted by GSA ADP Schedule Contract with IBM Corp.\n */ -->\n<div class="schedule_view_panel">\n{{? it.show_create}}\n <div class="schedule_create_new" role="region" aria-label="{{=it.schedule_toolbar_label}}">\n <button class=\'btn btn-link\' aria-label="{{=it.schedule_new_btn_label}}">\n <span class="schedule_common_icon schedule_create_new_icon" data-icon="add"></span>\n {{=it.schedule_new_label}}\n </button>\n </div>\n <div class="schedule_no_schedule_container"></div>\n{{??}}\n <div class="schedule_toolbar propertyUIControl" role="region" aria-label="{{=it.schedule_toolbar_label}}">\n <div class="schedules_controls_container">\n <div class="schedule_toggle_container">\n <span class="schedule_toggle_button_label">{{=it.schedule_toggle_label}}</span>\n <div class="schedule_toggle_button_container"></div>\n </div>\n <button class=\'btn btn-link schedule_delete_button\'>\n <span class="schedule_common_icon schedule_delete_schedule_icon" data-icon="remove-trash"></span>\n {{=it.schedule_delete_label}}\n </button>\n </div>\n </div>\n <div class="schedule_display">\n <div class="schedule_short_summary">\n <div class="schedule_name"><span class=\'interval\'>{{=it.schedule_type}}</span> - {{=it.schedule_cadence_label}}</div>\n {{?it.show_formats}}\n <div class="schedule_formats">\n {{~it.outputFormat :format:index}}\n <div class="schedule_format">\n <span class="schedule_common_icon schedule_format_icon" data-icon="{{=format.icon}}"></span>\n <span class="schedule_format_label">{{=format.displayName}}</span>\n </div>\n {{~}}\n </div>\n {{?}}\n </div>\n <div class="schedule_expand_schedule">\n <button class="btn btn-link schedule_expand" title="{{=it.schedule_update_label}}">\n <svg class="svgIcon">\n <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#common-chevron_right"></use>\n </svg>\n </button>\n </div>\n </div>\n{{?}}\n</div>\n\n';
- }),define("bi/schedule/utils/CadenceLabelGenerator",["jquery","moment-timezone","bi/sharecommon/utils/translator"],function(e,t,i){var s={},n="LT",l=function(e,s){var n=e.timezone;n||(console.error("Schedule was created with no timezone. Defaulting to 'America/New_York'."),n="America/New_York");var l={},a=[],r=[i.translate("schedule_weekday_sunday_t"),i.translate("schedule_weekday_monday_t"),i.translate("schedule_weekday_tuesday_t"),i.translate("schedule_weekday_wednesday_t"),i.translate("schedule_weekday_thursday_t"),i.translate("schedule_weekday_friday_t"),i.translate("schedule_weekday_saturday_t")],o={weeklySunday:0,weeklyMonday:1,weeklyTuesday:2,weeklyWednesday:3,weeklyThursday:4,weeklyFriday:5,weeklySaturday:6},d=e.weekly;for(var c in d)d[c]&&a.push(o[c]);a.sort();for(var h=t(e.startDate).tz(n).day(),u=t(e.startDate).tz(s).day(),_=u-h,p=0;p<a.length;p++){var v=a[p]+_;0>v?v+=7:v>6&&(v-=7),l["param"+(p+1)]=r[v]}return l};return s.getLabelFor=function(e,s,a){if(!e)return"";var r="",o={},d="undefined"!=typeof e.intradayRecurrence?!0:!1;if("daily"===e.type||"dailyWithIntradayRecurrence"===e.type)if("undefined"!=typeof e.daily){var c=parseInt(e.everyNPeriods,10);1==c?d&&"day"==e.daily.dailyPeriod?r="cadence_daily_day_repeat_label":(r="cadence_daily_"+e.daily.dailyPeriod+"_label","day"==e.daily.dailyPeriod&&(o.param=t(e.startDate).locale(a).tz(s).format(n))):d&&"day"==e.daily.dailyPeriod?(r="cadence_daily_every_day_repeat_label",o.param=c):(r="cadence_daily_every_"+e.daily.dailyPeriod+"_label",o.param=c)}else r="cadence_daily_label",o.param=t(e.startDate).locale(a).tz(s).format(n);else if("weekly"===e.type||"weeklyWithIntradayRecurrence"===e.type)if("undefined"!=typeof e.weekly){o=l(e,s);var c=parseInt(e.everyNPeriods,10);1==c?(r=d?"cadence_weekly_"+Object.keys(o).length+"_repeat_label":"cadence_weekly_"+Object.keys(o).length+"_label",o.param=t(e.startDate).locale(a).tz(s).format(n)):d?(r="cadence_week_"+Object.keys(o).length+"_repeat_label",o.param=c):(r="cadence_week_"+Object.keys(o).length+"_label",o.param=c)}else r="cadence_weekly_label",o.param=t(e.startDate).locale(a).tz(s).format(n);else if("monthlyRelative"===e.type||"monthlyRelativeWithIntradayRecurrence"===e.type)if("undefined"!=typeof e.monthlyRelative){o.param1=i.translate("schedule_weekday_"+e.monthlyRelative.monthlyRelativeDay+"_t");var c=parseInt(e.everyNPeriods,10);1==c?r=d?"cadence_monthly_relative_"+e.monthlyRelative.monthlyRelativeWeek+"_repeat":"cadence_monthly_relative_"+e.monthlyRelative.monthlyRelativeWeek:d?(r="cadence_monthly_relative_repeat_"+e.monthlyRelative.monthlyRelativeWeek+"_repeat",o.param=c):(r="cadence_monthly_relative_repeat_"+e.monthlyRelative.monthlyRelativeWeek,o.param=c)}else r="cadence_monthly_label";else if("monthlyAbsolute"===e.type||"monthlyAbsoluteWithIntradayRecurrence"===e.type)if("undefined"!=typeof e.monthlyAbsolute){o.param1=e.monthlyAbsolute.monthlyAbsoluteDay;var c=parseInt(e.everyNPeriods,10);1==c?r=d?"cadence_monthly_absolute_daily_repeat":"cadence_monthly_absolute":d?(r="cadence_monthly_absolute_repeat_daily_repeat",o.param=c):(r="cadence_monthly_absolute_repeat",o.param=c)}else r="cadence_monthly_label";else if("yearlyRelative"===e.type||"yearlyRelativeWithIntradayRecurrence"===e.type)if("undefined"!=typeof e.yearlyRelative){o.weekDay=i.translate("schedule_weekday_"+e.yearlyRelative.yearlyRelativeDay+"_t"),o.month=i.translate("schedule_month_short_"+e.yearlyRelative.yearlyRelativeMonth+"_label");var c=parseInt(e.everyNPeriods,10);1==c?r=d?"cadence_yearly_relative_"+e.yearlyRelative.yearlyRelativeWeek+"_repeat":"cadence_yearly_relative_"+e.yearlyRelative.yearlyRelativeWeek:d?(r="cadence_yearly_relative_repeat_"+e.yearlyRelative.yearlyRelativeWeek+"_repeat",o.param=c):(r="cadence_yearly_relative_repeat_"+e.yearlyRelative.yearlyRelativeWeek,o.param=c)}else r="cadence_yearly_label";else if("yearlyAbsolute"===e.type||"yearlyAbsoluteWithIntradayRecurrence"===e.type)if("undefined"!=typeof e.yearlyAbsolute){o.day=e.yearlyAbsolute.yearlyAbsoluteDay,o.month=i.translate("schedule_month_short_"+e.yearlyAbsolute.yearlyAbsoluteMonth+"_label");var c=parseInt(e.everyNPeriods,10);1==c?r=d?"cadence_yearly_absolute_daily_repeat":"cadence_yearly_absolute":d?(r="cadence_yearly_absolute_repeat_daily_repeat",o.param=c):(r="cadence_yearly_absolute_repeat",o.param=c)}else r="cadence_yearly_label";else"trigger"===e.type&&("undefined"!=typeof e.trigger?(o.triggerName=e.trigger.triggerName,r="cadence_trigger_name_label"):r="");var h="";return""!=r&&(h=i.translate(r,o)),h},s}),define("text!bi/notifications/templates/emptyMessageList.html",[],function(){return'<!-- Licensed Materials - Property of IBM\n \n IBM Cognos Products: SHARE\n \n (C) Copyright IBM Corp. 2015\n \n US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n-->\n<div class="emptyTableContent">\n <div class = \'empty_notifications_illustration_128\'></div>\n\n <div class="emptyTableText">{{=it.text}}</div>\n</div>\n'}),define("bi/schedule/views/SchedulesView",["react","react-dom","ba-react-admin/ba-react-admin.min","bi/commons/ui/View","jquery","bi/sharecommon/utils/translator","q","underscore","bi/sharecommon/utils/simpledoT","bi/commons/utils/Utils","text!bi/schedule/templates/SchedulesView.html","bi/schedule/utils/CadenceLabelGenerator","bi/commons/ui/properties/ToggleButton","bi/schedule/app/appControler","text!bi/notifications/templates/emptyMessageList.html","bi/commons/ui/dialogs/ConfirmationDialog"],function(e,t,i,s,n,l,a,r,o,d,c,h,u,_,p,v){"use strict";var b=s.extend({schedule:{},init:function(e){b.inherited("init",this,arguments),this.stateToggler=null,this.hasPermission={execute:!0,read:!0,setPolicy:!0,traverse:!0,write:!0},n.extend(this,e),this.timezone=this.glassContext.services.userProfile.preferences.timeZoneID,this.productLocale=this.glassContext.services.userProfile.preferences.productLocale||"en-us","undefined"==typeof this.objectInfo.descriptor&&(this.hasPermission={execute:-1!=n.inArray("execute",this.objectInfo.permissions),read:-1!=n.inArray("read",this.objectInfo.permissions),setPolicy:-1!=n.inArray("setPolicy",this.objectInfo.permissions),traverse:-1!=n.inArray("traverse",this.objectInfo.permissions),write:-1!=n.inArray("write",this.objectInfo.permissions)})},renderOld:function(){var s=a.defer();return this.updateScheduleList().then(function(){_.getSchedule(this.objectInfo.id,this.glassContext).then(function(n){if(!this.glassContext.isDevInstall||!this.glassContext.isDevInstall()){this.$el.append("<div class='newSchedPane'/>");var a=this.$el.find(".newSchedPane"),r=e.createElement(i.SchedulesListView,{glassContext:this.glassContext,StringResource:l,runnable:this.objectInfo,shareAppController:_,schedule:n,deleteFunction:this._deleteFunction.bind(this)});t.render(r,a[0])}s.resolve(this)}.bind(this))}.bind(this)),s.promise},renderNew:function(){var s=a.defer();return _.getSchedule(this.objectInfo.id,this.glassContext).then(function(n){this.$el.append("<div class='newSchedPane'/>");var a=this.$el.find(".newSchedPane"),r=JSON.parse(JSON.stringify(this.objectInfo)),o=e.createElement(i.SchedulesListView,{glassContext:this.glassContext,StringResource:l,runnable:r,shareAppController:_,schedule:n,deleteRequest:_.deleteSchedule});t.render(o,a[0]),s.resolve(this)}.bind(this)),this.slideout.contentView&&(this.slideout.contentView.canHide=this._canHide.bind(this)),s.promise},_canHide:function(){return!i.ScheduleUIStore.isDialogOpen},render:function(){return this.glassContext.isDevInstall&&this.glassContext.isDevInstall()?this.renderOld():this.renderNew()},_supportsFormats:function(){var e=["agentDefinition","agentDefinitionView","jobDefinition","jupyterNotebook"];return-1===e.indexOf(this.objectInfo.type)},updateScheduleList:function(){var e=a.defer(),t=!0,i=null;return _.getSchedule(this.objectInfo.id,this.glassContext).then(function(e){var s=h.getLabelFor(e.scheduleInfo,this.timezone,this.productLocale),n=[],a=this._supportsFormats();if(this.schedule=e,e&&e.scheduleInfo){t=!1,i=l.translate(this._getScheduleType()+"_label");for(var r=e.options&&e.options.outputFormat?e.options.outputFormat.length:0,o=0;r>o;o++){var d={format:e.options.outputFormat[o]};switch(d.format){case"HTML":d.icon="html_icon",d.displayName=l.translate("schedule_format_web");break;case"PDF":d.icon="pdf_icon",d.displayName=l.translate("schedule_format_pdf");break;case"spreadsheetML":d.icon="excel_icon",d.displayName=l.translate("schedule_format_xlsx");break;case"xlsxData":d.icon="excel_icon",d.displayName=l.translate("schedule_format_xlsx_data");break;case"XLWA":d.icon="unsupportedformat_icon",d.displayName=l.translate("schedule_format_unsupported");break;case"CSV":d.icon="csv_icon",d.displayName=l.translate("schedule_format_csv");break;case"XML":d.icon="xml_icon",d.displayName=l.translate("schedule_format_xml");break;case"dataSet":d.icon="dataset",d.displayName=l.translate("schedule_format_dataset");break;default:continue}n.push(d)}0===n.length&&n.push({format:"HTML",icon:"html_icon",displayName:l.translate("schedule_format_web")})}var c={schedule_toolbar_label:l.translate("schedule_toolbar_label"),schedule_new_label:l.translate("schedule_new_label"),schedule_delete_label:l.translate("schedule_delete_label"),schedule_update_label:l.translate("schedule_update_label"),schedule_toggle_label:l.translate("schedule_enable_label"),schedule_new_btn_label:l.translate("schedule_new_btn_label"),report_id:e.reportId,schedule_type:i,schedule_cadence_label:s||"",show_create:t,show_formats:a,outputFormat:n};return this._loadTemplates(c,t),t||this._renderToggleButton(),!this.hasPermission.write&&t&&this.$el.find(".schedule_create_new").remove(),this.hasPermission.write||t||(this.$el.find(".schedule_toolbar").remove(),this.hasPermission.read||this.$el.find(".schedule_expand").prop("disabled",!0)),this.schedule.id?_.getRawSchedule(this.schedule.id,this.glassContext):Promise.resolve({data:[{options:[]}]})}.bind(this)).then(function(t){this.schedule.id?this.objectInfo.rawOptions=t.data[0].options:this.schedule.reportId&&(this.objectInfo.rawOptions=t.data[0].options),console.log("raw result is",t),e.resolve()}.bind(this)),e.promise},_getScheduleType:function(){switch(this.schedule.scheduleInfo.type){case"daily":case"dailyWithIntradayRecurrence":return"daily";case"monthlyRelative":case"monthlyAbsolute":case"monthlyRelativeWithIntradayRecurrence":case"monthlyAbsoluteWithIntradayRecurrence":return"monthly";case"yearlyRelative":case"yearlyAbsolute":case"yearlyRelativeWithIntradayRecurrence":case"yearlyAbsoluteWithIntradayRecurrence":return"yearly";case"trigger":return"trigger";default:return"weekly"}},_loadTemplates:function(e,t){var i=o.simpleTemplate(c);if(this.$el.html(i(e)),t){var s=o.template(p)({text:l.translate("no_schedule_label",{type:l.translate(this.objectInfo.type+"_type")})});this.$el.find(".schedule_no_schedule_container").append(s)}this._setIcons(),this._setEvents()},_renderToggleButton:function(){var e=!1;this.schedule&&this.schedule.scheduleInfo&&(e=this.schedule.scheduleInfo.active),this.stateToggler=new u({id:"schedule_toggler_"+this.schedule.reportId,el:this.$el.find(".schedule_toggle_button_container"),name:"schedule_status_toggler",ariaLabel:l.translate("schedule_toggle_label"),checked:e,onChange:this._handleToggler.bind(this)}),this.stateToggler.doRender()},_handleToggler:function(e,t){if("schedule_status_toggler"===e){var i=this.schedule;i.scheduleInfo.active=t,delete i.name,_.updateSchedule(i,this.glassContext).then(function(e){this.schedule=e}.bind(this))}},_openScheduleView:function(e){var t=this;"boolean"!=typeof e&&(e=!1),this.glassContext.getSvc(".Content").then(function(i){var s=i.getBaseObjectsURL()+"/"+t.schedule.reportId+"?fields=canBurst";i.get(s,{}).done(function(i,s,n){e&&(t.objectInfo.descriptor=t.schedule),t.objectInfo.hasPermission=t.hasPermission;var a=t._getScheduleModule();t.glassContext.appController.showSlideOut({parent:t.slideout,overlay:!0,enableTabLooping:!0,label:l.translate("schedule_report_properties_name"),content:{module:a,objectInformation:t.objectInfo,onCreateOrUpdateCallback:t.updateScheduleList.bind(t),canBurst:i.data[0].canBurst,glassContext:t.glassContext,slideoutparent:t.slideout}})})})},remove:function(){var e=this.$el.find(".newSchedPane");e&&1===e.length?t.unmountComponentAtNode(e[0]):this.glassContext.getCoreSvc(".Logger").log("could not remove schedule react element")},_getScheduleModule:function(){return"dataSet2"===this.objectInfo.type?"bi/schedule/views/DatasetScheduleView":"jobDefinition"===this.objectInfo.type?"bi/schedule/views/JobScheduleView":"bi/schedule/views/ScheduleView"},_getOutputFormat:function(e){var t="";try{for(var i=0;i<e.length;i++)if("outputFormat"===e[i].name){t=e[i].value.join(",");break}}catch(s){}return t},_deleteFunction:function(){var e=new v("warning",l.translate("delete_confirm"),l.translate("delete_schedule_confirm_message"));e.confirm(function(){_.deleteSchedule(this.objectInfo.id,this.glassContext).done(function(){var e={type:"Deleted Object",objectType:this.objectInfo.type,object:this.objectInfo.id,action:"scheduleDeleted",milestoneName:"scheduleDeleted_"+this.objectInfo.type,"custom.outputFormat":this._getOutputFormat(this.schedule.options.outputFormat)},t=this.glassContext.getCoreSvc(".Instrumentation");t&&t.track&&t.track(e),this.objectInfo&&this.objectInfo.descriptor&&delete this.objectInfo.descriptor,this.updateScheduleList()}.bind(this))}.bind(this))},_setEvents:function(){this.$el.find(".schedule_create_new button").on("clicktap",function(){return this._openScheduleView(!1),!1}.bind(this)),this.$el.find(".schedule_expand").on("clicktap",function(){return this._openScheduleView(!0),!1}.bind(this)),this.$el.find(".schedule_delete_button").on("clicktap",function(){var e=new v("warning",l.translate("delete_confirm"),l.translate("delete_schedule_confirm_message"));e.confirm(function(){_.deleteSchedule(this.objectInfo.id,this.glassContext).done(function(){var e={type:"Deleted Object",objectType:this.objectInfo.type,object:this.objectInfo.id,action:"scheduleDeleted",milestoneName:"scheduleDeleted_"+this.objectInfo.type,"custom.outputFormat":this._getOutputFormat(this.schedule.options.outputFormat)},t=this.glassContext.getCoreSvc(".Instrumentation");t&&t.track&&t.track(e),this.objectInfo&&this.objectInfo.descriptor&&delete this.objectInfo.descriptor,this.updateScheduleList()}.bind(this))}.bind(this))}.bind(this))},_setIcons:function(){for(var e=this.$el.find(".schedule_common_icon"),t=0;t<e.length;t++){var i=n(e[t]),s=e[t].dataset.displayName;d.setIcon(i,"common-"+e[t].dataset.icon,s?s:e[t].dataset.icon)}}});return b}),define("js/schedule/scheduleBundle",function(){});
|