consumeDashboardBundle.js 556 KB

123456789101112131415
  1. /**
  2. * IBM Confidential OCO Source Materials IBM Business Platform: Dashboards
  3. * (C) Copyright IBM Corp. 2016, 2020
  4. *
  5. * The source code for this program is not published or otherwise divested of
  6. * its trade secrets, irrespective of what has been deposited with the U.S.
  7. * Copyright Office
  8. */
  9. function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},_createClass=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};define("dashboard-core/js/dashboard/glass/controllers/OpenActionHandler",["../../../lib/@waca/core-client/js/core-client/ui/core/Class","../../../app/util/ErrorUtils","underscore","../util/InstrumentationUtil"],(function(e,t,n,o){return e.extend({isItemVisible:function(e){return this.canExecute(e)},canExecute:function(e){var n=!1;return 1===(e.target&&e.target.activeObject&&e.target.activeObject.aSelectedContext).length&&(n=this._isSelectionValid(e,!0)),n&&t.hasCapability(e.glassContext)},doAction:function(e){return this._openDashboardView(e)},onSelectItem:function(e){return this._openDashboardView(e)},_openDashboardView:function(e){var t=e.target.activeObject.aSelectedContext[0].id;return this._getTargetPerspective(t,e).then((function(n){return o.track(e.glassContext,"viewed",{objectType:n,object:t,type:"Read Object"}),e.glassContext.appController.openAppView(n,{id:t,content:{boardId:t,isAuthoringMode:!1,objRef:t}})}))},_getTargetPerspective:function(){return Promise.resolve("dashboard")},_hasValidTags:function(e){return-1!==(e.tags||[]).indexOf("dashboard")},_isSelectionValid:function(e,t){var o=e.target&&e.target.activeObject&&e.target.activeObject.aSelectedContext;if(o){var i=o,r=Array.isArray(i),A=0;for(i=r?i:i[Symbol.iterator]();;){var a;if(r){if(A>=i.length)break;a=i[A++]}else{if((A=i.next()).done)break;a=A.value}var s=a;if(!this._hasValidTags(s))return!1;if(n.intersection([s.type],["exploration","page_asset"]).length<1)return!1;var l=["read","execute"];if(n.intersection(s.permissions,l).length<l.length)return!1;if(s.disabled&&"true"===s.disabled.toString().toLowerCase())return!1}return!0}return t||!1}})})),define("dashboard-core/js/dashboard/glass/controllers/LegacyOpenActionHandler",["./OpenActionHandler","../../../app/util/ErrorUtils"],(function(e,t){return e.extend({_getTargetPerspective:function(e,t){return this._getSpec(e,t).then((function(e){return e.timeline?"story":"dashboard"}))},_hasValidTags:function(e){return!e.tags||!e.tags.length},_getSpec:function(e,n){return n.glassContext.getSvc(".Content").then((function(o){return new Promise((function(i,r){var A=o.getBaseObjectsURL()+"/"+e;o.get(A,{dataType:"json",data:{fields:"specification"},MRUInfo:{}}).then((function(e){var t=e.data&&e.data.length&&e.data[0].specification;if(t)try{i(JSON.parse(t))}catch(e){r(e)}else i(o.get(A+"/content"))})).fail((function(o,r){t.showError(n.glassContext,r,e),i({})}))}))}))}})})),define("dashboard-core/js/dashboard/glass/controllers/DSContextMenuActionHandler",["../../../lib/@waca/core-client/js/core-client/ui/core/Class","../../../lib/@waca/core-client/js/core-client/utils/ClassFactory"],(function(e,t){return e.extend({isItemVisible:function(){return!0},onSelectItem:function(e){var n,o=e.target;switch(o.itemId){case"com.ibm.bi.dashboard.relinkDataset":var i=o.activeObject;n=i?t.loadModule(i.dialogModule).then((function(t){var n=new t({glassContext:e.glassContext,dataset:i.dataset});return n.open(),n})):Promise.resolve();break;default:n=Promise.resolve()}return n}})})),define("dashboard-core/js/dashboard/glass/ModeButton",["../../lib/@waca/baglass/js/baglass/app/plugins/Button","../../app/nls/StringResources"],(function(e,t){var n=e.extend({init:function(){n.inherited("init",this,arguments),this.pressedTitle=t.get("togglePreviewModeLabel"),this.unpressedTitle=t.get("toggleEditModeLabel")},setPressed:function(){n.inherited("setPressed",this,arguments),this.$el.attr("title",this.pressedTitle),this.getIcon().attr("aria-label",this.pressedTitle)},setUnpressed:function(){n.inherited("setUnpressed",this,arguments),this.$el.attr("title",this.unpressedTitle),this.getIcon().attr("aria-label",this.unpressedTitle)},getIcon:function(){return this.$icon||(this.$icon=this.$el.find("*[role=img],img")),this.$icon}});return n})),define("dashboard-core/js/dashboard/glass/controllers/ModeActionHandler",["../ModeButton","../../../api/DashboardAPI"],(function(e,t){return function(e){function n(){return _classCallCheck(this,n),_possibleConstructorReturn(this,e.apply(this,arguments))}return _inherits(n,e),n.prototype.onPress=function(e){var n=e.glassContext.appController.getCurrentContentView().getDashboardApi();n.getFeature("DashboardState").setAuthoring(n.getMode()===t.MODES.VIEW)},n}(e)})),define("dashboard-core/js/dashboard/glass/controllers/OpenTemplateActionHandler",["./OpenActionHandler"],(function(e){return function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,e.apply(this,arguments))}return _inherits(t,e),t.prototype.canExecute=function(t){return!t.glassContext.getCoreSvc(".FeatureChecker").checkValue("dashboard","dashboardTemplates","disabled")&&e.prototype.canExecute.call(this,t)},t.prototype._getTargetPerspective=function(){return Promise.resolve("dashboardTemplate")},t.prototype._hasValidTags=function(e){return-1!==(e.tags||[]).indexOf("dashboard_template")},t}(e)})),define("dashboard-core/js/dashboard/glass/UndoRedoButton",["../../lib/@waca/baglass/js/baglass/app/plugins/Button"],(function(e){return e.extend({canEnable:function(){return!0},onRender:function(e){this._toggleState(e.target.plugin)},onStateChange:function(e){this._toggleState(this,e)},_toggleState:function(e,t){e&&(t&&this.canEnable(t)?e.enable():e.disable())}})})),define("dashboard-core/js/dashboard/glass/controllers/RedoActionHandler",["../UndoRedoButton"],(function(e){return e.extend({onPress:function(e){var t=e.glassContext.appController.getCurrentContentView().getDashboardApi();t&&t.redo()},canEnable:function(e){return e.canRedo()}})})),define("dashboard-core/js/dashboard/glass/controllers/SaveActionHandler",["underscore","../../../lib/@waca/core-client/js/core-client/ui/core/Class","../../../app/util/ErrorUtils","../../../app/util/GlassUtil","../../../dashboard/glass/util/SaveActionUtil"],(function(e,t,n,o,i){var r=["status","name","saveRequest","assetId","url","savedSpec","cmSpec"];return t.extend({getContentView:function(e){return e.glassContext.appController.currentAppView.currentContentView},getDashboardView:function(e){return this.getContentView(e)},getStringResourcesService:function(e){return this.getContentView(e).services.getSvcSync(".StringResources")},_getDashboardApi:function(e){return this.getContentView(e).getDashboardApi()},_getContextContent:function(e){return this.getContentView(e).getContent()},onSelectItem:function(e){var t=this.getContentView(e).getBoardId(),n="com.ibm.bi.dashboard.save"===e.target.itemId;t&&n&&this.getContentView(e).canAuthor()?this.save(e,!0,!0):this.saveAs(e,t)},isItemVisible:function(e){var t=this.getContentView(e).getDashboardApi().getType().toUpperCase(),o="com.ibm.bi.dashboard.save"===e.target.itemId;return"EXPLORE"===t?!o||this.getContentView(e).canAuthor():o?this.getContentView(e).canAuthor()&&n.hasCapability(e.glassContext,"canAuthorDashboard"):n.hasCapability(e.glassContext,"canAuthorDashboard")},_require:function(e,t){return require(e,t)},saveAs:function(e,t){var n=this,o=this.getDashboardView(e).boardModel.name;return this._getAncestors(e,t).then((function(t){return e.glassContext.getSvc(".ContentDialogFactory").then((function(i){n._saveAsDialog=i.createSaveAsDialog({glassContext:e.glassContext,defaultFileName:o,service:{context:e,save:n.onSaveAs.bind(n)},ancestors:t}),n._saveAsDialog.open()}))}))},_getAncestors:function(e,t){return this._getContentService(e).then((function(e){return e.getAncestors({id:t})}))},onSaveAs:function(e,t,n,o){var i=e.context;return this._getSaveFeature(i).saveAs(n,t.url,o,r).then(this._onSaveAsSuccess.bind(this,i),this._onSaveAsError.bind(this,i)).then(this._invokeLifeCycleHandlers.bind(this,"saveas.after",i)).finally(this._saveAsDialog.hide.bind(this._saveAsDialog))},_onSaveAsError:function(e,t){var o=n.getErrorCode(t.saveRequest);if("cmDuplicateName"===o){var i={isDuplicate:!0};return Promise.reject(i)}return 0===o.lastIndexOf("cmAddWithReplaceFailed",0)||0===o.lastIndexOf("cmInvalidReference",0)?(i={isReplaceFailed:!0},Promise.reject(i)):(n.showError(e.glassContext,t.saveRequest,t.cmSpec),Promise.resolve())},_onSaveAsSuccess:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getContentView(e);return n.setSavedInstance(t.savedSpec),this._getContentService(e).then((function(e){return e.onSaveAsSuccess({url:t.url})})).done(function(o){var i=this._getDashboardApi(e);o&&(o.id&&n.boardModel.set({id:o.id},{silent:!0}),o.permissions&&n.setPermissions(o.permissions)),n.boardModel.set({name:t.name},{silent:!0});var r=i.getFeature("segment"),A={type:"Updated Object"};r.track("savedAs",(function(){return A})),i.getFeature("DashboardState").setDirty(!1),n.boardController.undoRedoController.registerSaveAction(),e.glassContext.appController.updateCurrentCachedAppView();var a=this._getAppConfig(e);a&&a.saveThumbnail&&this._saveThumbnail(e,o&&o.id);var s=this.getStringResourcesService(e);return e.glassContext.appController.showToast(s.get("dashboard_save_success")),this._invokeSaveServiceHandlers(e,{saveAs:!0,stringResources:s,context:e,spec:i.getFeature("Serializer").toJSON()})}.bind(this))},_getContentService:function(e){return e.glassContext.getSvc(".DashboardContent")},save:function(e,t,o){var A=this,a=this.getDashboardView(e),s=a.getDashboardApi(),l=a.getBoardId(),c=a.boardModel,d=s.getFeature("Serializer").toJSON(),u=null;return i.cleanUnusedCustomColors(s,d,c),this._getSaveFeature(e).save(r).then((function(t){var n=t.savedSpec;return n&&(u=n),A._invokeLifeCycleHandlers("save.after",e)})).then((function(){var n=A.getStringResourcesService(e),i=s.getFeature("segment"),r={type:"Updated Object"};i.track("saved",(function(){return r})),s.getFeature("DashboardState").setDirty(!1),a.boardController.undoRedoController.registerSaveAction(),a.setSavedInstance(u);var c=A._getAppConfig(e);c&&c.saveThumbnail&&A._saveThumbnail(e,l),o&&e.glassContext.appController.showToast(n.get("dashboard_save_success")),t&&A._invokeSaveServiceHandlers(e,{saveAs:!1,stringResources:n,context:e,spec:d})})).catch((function(t){"cmEmptySelection"===n.showError(e.glassContext,t)&&A.saveAs(e)}))},_invokeLifeCycleHandlers:function(e,t){var n=this.getDashboardView(t).getDashboardApi();return n.getFeature("LifeCycle").invokeHandlers(e).catch((function(e){n.getGlassCoreSvc(".Logger").error("[SaveActionHandler] Life cycle handlers error",e)}))},_invokeSaveServiceHandlers:function(e,t){var n=this._getDashboardApi(e);return this._getSaveServiceExtensionCollection(e.glassContext,n).then(function(o){var i=[];return o&&(t.resaveDashboardSpecCallback=this.save.bind(this,e,!1,!1),o.forEach((function(e){var o=n.getFeature(e.name);o&&o.onDashboardSave&&i.push(o.onDashboardSave(t))}))),Promise.all(i)}.bind(this))},_getSaveServiceExtensionCollection:function(e,t){var n=t.getCollectionConfig("saveServices");return n?Promise.all([e.appController.findCollection(n.id)]).then((function(e){return e[0]})):Promise.resolve()},_getAppConfig:function(e){var t=this._getContextContent(e);return t&&t.options&&t.options.config},_saveThumbnail:function(e,t){var n=this;return this._createThumbnail(e).then((function(o){return n._getContentService(e).then((function(e){return e.saveThumbnail({thumbnailDataUri:o,id:t})}))}))},_createThumbnail:function(e){var t=this.getDashboardView(e),n=t.getDashboardApi().getFeature(".Thumbnail");return n&&n.generateImage(t.el)},_getSaveFeature:function(e){return this._getDashboardApi(e).getFeature("Save")}})})),define("dashboard-core/js/dashboard/glass/controllers/SaveAsTemplateActionHandler",["./SaveActionHandler","../../../dashboard/glass/util/SaveActionUtil","../../../app/util/ErrorUtils","../../../app/util/GlassUtil"],(function(e,t,n,o){return e.extend({onSelectItem:function(e){var t=this.getContentView(e).getBoardId();this.saveAsTemplate(e,t)},isItemVisible:function(e){return!e.glassContext.getCoreSvc(".FeatureChecker").checkValue("dashboard","dashboardTemplates","disabled")&&this._isBoardTypeSupported(e)&&n.hasCapability(e.glassContext,"canAuthorDashboard")},_isBoardTypeSupported:function(e){return"dashboard"===this.getContentView(e).getDashboardApi().getType()},saveAsTemplate:function(e,t){var n=this,o=this.getDashboardView(e);return this._getAncestors(e,t).then((function(t){return e.glassContext.getSvc(".ContentDialogFactory").then((function(i){var r=n.getStringResourcesService(e);n._saveAsTemplateDialog=i.createSaveAsDialog({glassContext:e.glassContext,defaultFileName:r.get("dashboard_template_prefix",{name:o.boardModel.name}),service:{context:e,save:n.onSaveAsTemplate.bind(n)},ancestors:t}),n._saveAsTemplateDialog.open()}))}))},onSaveAsTemplate:function(e,t,n,o){return this._executeSaveAsTemplateRequest(e.context,t.url,n,o).then(this._onSaveAsTemplateSuccess.bind(this),this._onSaveAsError.bind(this,e.context)).finally(this._saveAsTemplateDialog.hide.bind(this._saveAsTemplateDialog))},_onSaveAsTemplateSuccess:function(e){var t=this,n=e.context,o=n.glassContext;return o.appController.openAppView("dashboardTemplate",{perspective:"dashboardTemplate",content:{perspective:"dashboardTemplate",objectUrl:e.saveRequest.getResponseHeader("location"),isAuthoringMode:o.appController.getCurrentContentView().isAuthoringMode}}).then((function(){var e=t.getStringResourcesService(n),i=t.getContentView(n),r=i.getBoardId(),A=i.getDashboardApi().getCanvas(),a=A.findContent({type:"widget"}).filter((function(e){return"widget.filter"===e.getType()}));a.length&&(a.forEach((function(e){A.removeContent(e.getId())})),o.appController.showToast(e.get("dashboard_template_filters_removed"),{type:"warning"}),t.save(n,!0,!1));var s=A.getContent(i.boardModel.getSelectedLayout()).findContent({type:"widget"}).map((function(e){var t=e.getFeature("state");return t.whenStatusChanges(t.STATUS.RENDERED)}));return Promise.all(s).then((function(){return t._saveThumbnail(n,r).catch((function(e){o.getCoreSvc(".Logger").error(e)}))})).then((function(){o.appController.showToast(e.get("dashboard_template_save_success"))}))}))},_executeSaveAsTemplateRequest:function(e,n,i,r){var A=this,a=e.glassContext,s=o.getAjaxService(a),l=this.getDashboardView(e),c=l.getDashboardApi(),d=c.getFeature("ConvertToTemplate"),u=c.getFeature("Serializer").toJSON();return t.cleanUnusedCustomColors(c,u,l.boardModel),i&&(u.name=i),new Promise((function(t,o){d.convertToTemplate(u).then((function(i){var l=A._getCMSpec(i,e);n+=r?"?updateAction=replace&ignoreInvalidObjectReference=true":"?ignoreInvalidObjectReference=true",s.post(n,{contentType:"application/json",processData:!1,dataType:"text",data:JSON.stringify(l)}).done((function(n,o,i){t({saveRequest:i,context:e})})).fail((function(e,t){o({saveRequest:t,cmSpec:u,glassContext:a})}))}))}))},_getCMSpec:function(e,n){var o=Object.assign(e,{dataSources:{}}),i=this.getContentView(n).getDashboardApi();return{defaultName:o.name,type:t.getAssetType(i),specification:JSON.stringify(o),tags:["dashboard_template"]}}})})),define("dashboard-core/js/dashboard/glass/controllers/ShareActionHandler",["../../../lib/@waca/core-client/js/core-client/ui/core/Class","../../../app/nls/StringResources"],(function(e,t){return e.extend({init:function(e){this.vidaMapAnimTimeout=e&&e.vidaMapAnimTimeout||1e4},execute:function(e){if(e.urlMap.objRef){var t={perspective:e&&e.target&&e.target.activeObject&&e.target.activeObject.aSelectedContext&&e.target.activeObject.aSelectedContext[0].tags&&-1!==e.target.activeObject.aSelectedContext[0].tags.indexOf("story")?"story":"dashboard",objRef:e.urlMap.objRef,action:"view",mode:e.urlMap.mode?e.urlMap.mode:"dashboard"},n=e.glassContext.appController.getCurrentContentView();return"dashboard"===n.perspective&&"function"==typeof n.boardController.layoutController.getCurrentSubViewId&&(t.subView=n.boardController.layoutController.getCurrentSubViewId()),t}throw new Error("Unable to resolve share context. Missing objRef.")},getShareableItems:function(e){var n=[],o=e.glassContext.appController.getCurrentContentView();if("dashboard"===o.perspective){var i={};i.el=o.el,"function"==typeof o.boardController.layoutController.getCurrentSubViewTitle?i.label=t.get("screenshot_label_tab",{title:o.getTitle(),tabName:o.boardController.layoutController.getCurrentSubViewTitle()}):i.label=t.get("screenshot_label",{title:o.getTitle()}),n.push(i)}return this.reRenderMaps(o).then((function(){return n}))},isEnabled:function(e){var t=e.context;if(t){var n=1===t.length&&t[0]&&t[0].tags;return n&&(-1!==n.indexOf("dashboard")||-1!==n.indexOf("story"))}return!0},_triggerDataPlayerEvent:function(e,t){var n=t.dashboardApi;n&&n.triggerDashboardEvent(e)},enterShareState:function(e){var t=this;return Promise.resolve().then((function(){var n=e.glassContext.appController.getCurrentContentView();t._triggerDataPlayerEvent("open:sharePanel",n)}))},leaveShareState:function(e){var t=this;return Promise.resolve().then((function(){var n=e.glassContext.appController.getCurrentContentView();t._triggerDataPlayerEvent("close:sharePanel",n)}))},reRenderMaps:function(e){var t=e.boardController.layoutController,n=e.boardModel.getSelectedLayout(),o=e.dashboardApi.getCanvas().getContent(n).findContent({type:"widget"}).filter((function(e){var t=e.getFeature("Visualization");return!(!t||"Tiledmap"!==t.getType())})).map((function(e){return e.getId()}));return o.length>0?Promise.map(o,(function(e){return t.widgetLoader.getWidget(e).mapVizRenderForPrint()})).delay(this.vidaMapAnimTimeout):Promise.resolve()},canExportToPDF:function(){return!0},getInstrumentation:function(e){return e.glassContext.appController.getCurrentContentView().getDashboardApi().getFeature("segment").getInfo({type:"Shared Object"})},exportToPDF:function(e,t,n){var o=e.glassContext.appController.getCurrentContentView().getDashboardApi(),i=o.getFeature("Print"),r={pageSize:t,printFilters:n},A=o.getCanvas().getContent().getId();return i.print(A,e.glassContext.appController,r)}})})),define("dashboard-core/js/dashboard/glass/controllers/UndoActionHandler",["../UndoRedoButton"],(function(e){return e.extend({onPress:function(e){var t=e.glassContext.appController.getCurrentContentView().getDashboardApi();t&&t.undo()},canEnable:function(e){return e.canUndo()}})})),define("dashboard-core/js/dashboard/glass/controllers/DisabledActionHandler",["../../../lib/@waca/baglass/js/baglass/app/plugins/Button"],(function(e){return function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,e.apply(this,arguments))}return _inherits(t,e),t.prototype.onRender=function(e){e.target.plugin.disable()},t}(e)})),define("dashboard-core/js/dashboard/glass/controllers/CustomWidgetButton",["../../../lib/@waca/baglass/js/baglass/app/plugins/Button"],(function(e){var t=e.extend({init:function(e){t.inherited("init",this,arguments);var n=e.glassContext.appController;this._determineVisibility(n)},_determineVisibility:function(e){var t=this;e.findCollection("com.ibm.bi.dashboard.widgets").then((function(t){return t.filter((function(e){return!e.builtin})).length>0||e.findCollection("com.ibm.bi.dashboard.contentTypes").then((function(e){return(e||[]).some((function(e){return e.expose}))}))})).then((function(e){e?t.show():(t.hideForever=!0,t.hide())}))}});return t})),define("dashboard-core/js/dashboard/UndoRedoController",["underscore","chronology","./util/EventConstants","../lib/@waca/dashboard-common/dist/core/APIContext"],(function(e,t,n,o){return function(){function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return _classCallCheck(this,i),this.canvas=t.canvas,this._registerCanvasEvents(),this.undoRedoExclusionList={"change:name":1,"change:id":1,"change:_meta":1},this.canvasModel=e,this.transactionApi=t.transaction,this.listeners={},this.canvasModel.on("all",this.addToUndoRedoStack.bind(this),this.canvasModel),this.logger=t.logger,this.currentMode=t.mode||"canvasMode",this.isStateDirty=t.isStateDirty||!1,this.undoRedoStacks={},this.changeModeName=n.changeModeAction,this._getUndoRedoStack(),this.getPublicProperties()}return i.prototype._registerCanvasEvents=function(){var e=this;this.canvas&&this.canvas.on("all",(function(t){t.info&&t.info.supportsUndoRedo&&e._addCanvasActionToUndoRedo(t)}))},i.prototype._addCanvasActionToUndoRedo=function(e){e.tracking&&e.tracking.undoActions&&this.addToUndoRedoStack(this._convertCanvasEventToUndoAction(e))},i.prototype._convertCanvasEventToUndoAction=function(e){return{value:"redo",prevValue:"undo",data:{undoRedoTransactionId:e&&e.transactionToken&&e.transactionToken.transactionId,transactionToken:e.transactionToken,transactionParamIndex:e.info.transactionParamIndex},sender:e.context&&e.context.undoRedo?"UndoRedoController":"canvas",senderContext:{applyFn:this._canvasEventApplyFn.bind(this,e)}}},i.prototype._canvasEventApplyFn=function(e,t,n,i,r){var A=this,a=void 0,s=r&&r.transactionToken,l=new o({undoRedo:!0,transactionToken:s}),c=this._executeTrace(e.tracking.callStack,[this.canvas]);if("undo"===t){var d=e.tracking.undoActions,u=[];d.forEach((function(e){u.push({fn:A._executeAction.bind(A),args:[e,c,l]})})),a=this._executeActions(u)}else{var h=e.tracking.action;a=this._executeAction(h,c,l)}return a instanceof Promise&&(a=a.catch((function(e){throw A.logger.error("An error occured while executing an API undo trace",e),e}))),a},i.prototype._executeTrace=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[].concat(t);return e&&e.forEach((function(e){var t=n[n.length-1];e&&".."===e.name?n.pop():e&&t&&"function"==typeof t[e.name]&&n.push(t[e.name].apply(t,e.params))})),n},i.prototype._executeAction=function(e,t,n){var o=this,i=void 0,r=this._executeTrace(e.callStack,t),A=r[r.length-1];if(e&&A&&"function"==typeof A[e.name]){var a=JSON.parse(JSON.stringify(e.params||[]));if(a.unshift(n),i=A[e.name].apply(A,a),e.resultActions)(Array.isArray(i)?i:[i]).forEach((function(t,i){var r=e.resultActions[i];r&&r.forEach((function(e){o._executeAction(e,t,n)}))}))}else this.logger.warn("undo/redo: missing action in event or action does not exist in API ",e,A);return i},i.prototype.getPublicProperties=function(){return{addToUndoRedoStack:this.addToUndoRedoStack.bind(this),clearStack:this.clearStack.bind(this),addListener:this.addListener.bind(this),removeListener:this.removeListener.bind(this),canUndo:this.canUndo.bind(this),canRedo:this.canRedo.bind(this),undo:this.undo.bind(this),redo:this.redo.bind(this),setMode:this.setMode.bind(this),setDirty:this.setDirty.bind(this),registerSaveAction:this.registerSaveAction.bind(this),isDirty:this.isDirty.bind(this)}},i.prototype._validateUndoRedoAction=function(e){return!!(e&&e.senderContext&&e.senderContext.applyFn)&&("UndoRedoController"!==e.sender&&((!e.data||!e.data.undoRedoTransactionId||0!==e.data.undoRedoTransactionId.indexOf("undoRedoTransaction"))&&(!e.data||!e.data.transactionToken||!(e.data.transactionToken||{}).eventGenerated)))},i.prototype.addToUndoRedoStack=function(e){if(this._validateUndoRedoAction(e)){var t=this._checkTransaction(e);if(t){var n={up:function(){this.call||t.up(e.upValue?e.upValue:e.value,"UndoRedoController",e.name)},down:function(){t.down(e.prevValue,"UndoRedoController",e.name)},call:!1,name:e.name,prevDirtyState:this.isStateDirty};this.logger.debug("UndoRedoController:addToUndoRedoStack",e.data?e.data.undoRedoTransactionId:e.data,e.name,e.value,e.prevValue),this._getUndoRedoStack().add(n)}}},i.prototype.setDirty=function(e){this.isStateDirty=e},i.prototype.clearStack=function(){var t=this,n=this._getUndoRedoStack();n&&n.clear(),e.each(this.listeners,(function(e){e.onStateChange(t)}))},i.prototype._checkTransaction=function(e){if(e.data&&(e.data.saveOnly||e.data.skipUndoRedo||e.data.runtimeOnly))return null;var t={up:e.senderContext.applyFn,down:e.senderContext.applyFn},n=e.data?e.data.undoRedoTransactionId:null;if(n){var o=this._getTransactionsMap(),i=o[n];if(i)return i.push(e),null;i=[e],o[n]=i,t.up=function(){this._redoTransaction(i)}.bind(this),t.down=function(){delete o[n],this._undoTransaction(i)}.bind(this)}return t},i.prototype._createTransation=function(){var t=e.uniqueId("undoRedoTransaction");return this.transactionApi.startTransactionById(t)},i.prototype._redoTransaction=function(e){for(var t=this,n=this._createTransation(),o=void 0,i=void 0,r=[],A=0;A<e.length;A++)(i=(o=e[A]).senderContext.applyFn)&&(o.data.transactionToken=n,o.data.undoRedoTransactionId=n.transactionId,o.data.undoRedoTransactionType="redo",r.push({fn:i,args:[o.upValue?o.upValue:o.value,"UndoRedoController",o.name,o.data]}));var a=this._executeActions(r);a instanceof Promise?this.lastUndoRedoOpPromise=a.catch((function(e){throw t.logger.error("An error occured while executing the redo stack",e),e})).finally((function(){t.transactionApi.endTransaction(n)})):this.transactionApi.endTransaction(n)},i.prototype._undoTransaction=function(e){for(var t=this,n=this._createTransation(),o=void 0,i=void 0,r=[],A=e.length-1;A>=0;A--)(i=(o=e[A]).senderContext.applyFn)&&(o.data.transactionToken=n,o.data.undoRedoTransactionId=n.transactionId,o.data.undoRedoTransactionType="undo",r.push({fn:i,args:[o.prevValue,"UndoRedoController",o.name,o.data]}));var a=this._executeActions(r);a instanceof Promise?this.lastUndoRedoOpPromise=a.catch((function(e){throw t.logger.error("An error occured while executing the undo stack",e),e})).finally((function(){t.transactionApi.endTransaction(n)})):this.transactionApi.endTransaction(n)},i.prototype._executeActions=function(e){for(var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=void 0;n<e.length;){var i;if(o=(i=e[n]).fn.apply(i,e[n].args),n++,o instanceof Promise){o=o.then((function(){return t._executeActions(e,n)}));break}}return o},i.prototype.addListener=function(e,t){"function"==typeof t.onStateChange&&(this.listeners[e]=t)},i.prototype.removeListener=function(e){delete this.listeners[e]},i.prototype.canUndo=function(){return this._getUndoRedoStack().undos.length>0},i.prototype.canRedo=function(){return this._getUndoRedoStack().redos.length>0},i.prototype._trackDirtyState=function(e){if(e&&e[0]){var t=e[0].prevDirtyState;e[0].prevDirtyState=this.isStateDirty,e[0].name!==this.changeModeName&&this.setDirty(t)}},i.prototype.undo=function(){var e=this._getUndoRedoStack();this._trackDirtyState(e.undos),e.undo();var t=this.lastUndoRedoOpPromise||Promise.resolve();return this.lastUndoRedoOpPromise&&(this.lastUndoRedoOpPromise=null),t},i.prototype.redo=function(){var e=this._getUndoRedoStack();this._trackDirtyState(e.redos),e.redo();var t=this.lastUndoRedoOpPromise||Promise.resolve();return this.lastUndoRedoOpPromise&&(this.lastUndoRedoOpPromise=null),t},i.prototype.onAdd=function(){this.enableState("undo",!0),this.enableState("redo",!1)},i.prototype.enableState=function(t,n){this.canvasModel.trigger("undo:state",{senderContext:this,stack:t,enabled:n}),e.each(this.listeners,function(e){e.onStateChange(this)}.bind(this))},i.prototype.setMode=function(e){var t=void 0;"canvasMode"!==this.currentMode&&(t=this.undoRedoStacks[this.currentMode].transactions,delete this.undoRedoStacks[this.currentMode]),this.currentMode=e||"canvasMode",this._mergeUndoStacks(t);var n=this._getUndoRedoStack();this.enableState("undo",n.undos.length>0),this.enableState("redo",n.redos.length>0)},i.prototype.registerSaveAction=function(){var t=this._getUndoRedoStack();e.forEach(t.undos,(function(e){e.prevDirtyState=!0}))},i.prototype.isDirty=function(){return this.isStateDirty},i.prototype._getUndoRedoStack=function(){return this.undoRedoStacks[this.currentMode]||(this.undoRedoStacks[this.currentMode]=new t({limit:150,onAdd:this.onAdd.bind(this),onRedo:this.enableState.bind(this,"undo",!0),onUndo:this.enableState.bind(this,"redo",!0),onBegin:this.enableState.bind(this,"undo",!1),onEnd:this.enableState.bind(this,"redo",!1)}),this.undoRedoStacks[this.currentMode].transactions={}),this.undoRedoStacks[this.currentMode]},i.prototype._getTransactionsMap=function(){return this.undoRedoStacks[this.currentMode].transactions},i.prototype._mergeUndoStacks=function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.each(n,(function(e){e.forEach((function(e){t.addToUndoRedoStack(e)}))}))},i}()})),define("dashboard-core/js/dashboard/CopyPasteController",["underscore","./util/DashboardSpecHelper","../app/nls/StringResources"],(function(e,t,n){return function(){function o(e){_classCallCheck(this,o),this.layoutController=e.layoutController,this.dashboardApi=e.dashboardApi,this.logger=e.logger,this.model=e.model,this.api=e.api,this.specType=e.type||"DASHBOARD",this.clipboard=this.dashboardApi.getGlassCoreSvc(".Clipboard")}return o.prototype.destroy=function(){this.layoutController=null,this.dashboardApi=null,this.logger=null,this.model=null,this.api=null,this.clipboard=null},o.prototype.getSpecHelper=function(){var e=this;return this.specHelper?Promise.resolve(this.specHelper):this.layoutController.getInteractionController().then((function(n){return e.specHelper=new t(n),e.specHelper}))},o.prototype.doCopy=function(e){var t=this;return this.getSpecHelper().then((function(n){var o,i=(new Date).getTime(),r=void 0;return(o=e)&&"DASHBOARD"!==o.type&&o.count?r=e:(r=t.selectFromSpecForCopyPaste(n)).type=t.specType,r.timestamp=i,t.clipboard.set(r).then((function(){return r.errMsg&&t._showToast(r.errMsg),r.count>0?t._showToast("copy",{count:r.count}):null}))})).catch((function(e){return t._showError("specCopyErr",e)}))},o.prototype.doPaste=function(e){var t=this;return e?this.getConvertedSpec(e).then((function(e){return e})).catch((function(e){return t._showError("specConvertErr",e)})):this.getConvertedSpec(this.specType).then((function(e){if(e)return t.getSpecHelper().then((function(t){return t.validateDashboardSpec(e)}))})).then((function(e){if(e)return t.layoutController.interactionController.selectionHandler.deselectAll(),t._performPaste(e)})).catch((function(e){return t._showError("specConvertErr",e)}))},o.prototype.getConvertedSpec=function(e){var t=this;return this.clipboard.get().then((function(n){return t._doConvert(n,e)}))},o.prototype._doConvert=function(e,t){var o=e.type,i=e.spec;return"REPORT"==o?(this._showError("pasteNotSupportedErr",{name:n.get("reportParam")}),null):o!==t&&i?this.dashboardApi.getGlassSvc(".ConversionService").then((function(e){return e.convert(o,t,i)})):Promise.resolve(i)},o.prototype.selectFromSpecForCopyPaste=function(e){var t={spec:null,count:0};return this.dashboardApi.getCanvas().getSelectedContentList().length&&(t=e.getContentsToJSONSpec()),t},o.prototype._performPaste=function(t){var n=this;t.nonMergedWidgets&&(t.widgets=t.nonMergedWidgets,delete t.nonMergedWidgets);function o(n,o,i){var r=function(t,n){return e.find(t,(function(e){return n===e.id}))}(t.widgets,n);r&&(!function(n,o){n.data&&n.data.dataViews&&e.each(n.data.dataViews,(function(n){var i=e.find(t.dataSources.sources,(function(e){return e.id===n.modelRef}));o[n.modelRef]=i}))}(r,i),o.push(r))}var i=function(i){var r={},A=null;if(n._isTypeRegistered(i.type))A=i;else{if(r.layout=i,t.widgets&&t.widgets.length){var a=[],s={};if(i.items?function t(n,i,r){e.each(n,(function(e){return e.items?t(e.items,i,r):o(e.id,i,r)}))}(i.items,a,s):o(i.id,a,s),a.length)if(r.widgets=a,r.dataSources={version:t.dataSources.version,sources:e.values(s)},i.content&&i.content.properties)-1!==Object.keys(i.content.properties).indexOf("explicitScale")&&delete i.content.properties.explicitScale}t.drillThrough&&t.drillThrough.length&&(r.drillThrough=t.drillThrough),t.properties&&(r.properties=t.properties),t.fredIsRed&&(r.fredIsRed=t.fredIsRed),t.episodes&&(r.episodes=t.episodes)}return{content:A,model:r}},r=function(e,o){var r=function(e){return e<t.layout.length?t.layout[e]:void 0}(e);if(r){var A=i(r);return A.copyPaste=!0,A&&(A.content||A.model&&A.model.layout)?n.dashboardApi.getFeature("Canvas").addContent({spec:A.content||A.model,copyPaste:!0},o).then((function(e){var t=e.getId();return n.layoutController.whenWidgetRenderComplete(t).then((function(e){n.layoutController.interactionController.selectionHandler.selectNode(e.domNode,{isTouch:!1})}))})):Promise.reject(new Error("Unable to complete pasting of widget(s). Can not determine the layout fragment"))}return Promise.reject(new Error("Unable to complete pasting of widget(s). Checking for a layout that is not there"))};if(t){if(t.layout){for(var A=[],a=this.dashboardApi.getFeature("Transaction"),s=a.startTransaction(),l=0;l<t.layout.length;l++)A.push(r(l,s));return a.endTransaction(s),Promise.all(A)}return Promise.resolve()}return Promise.resolve()},o.prototype._isTypeRegistered=function(e){return this.dashboardApi.getFeature("ContentTypeRegistry").isTypeRegistered(e)},o.prototype._showError=function(e,t){return this.logger.error(n.get(e),t),this._showToast(e,t,{type:"error",preventDuplicates:!0})},o.prototype._showToast=function(e,t,o){var i=t?n.get(e,t):n.get(e);return this.dashboardApi.showToast(i,o)},o}()})),define("dashboard-core/js/dashboard/contentpane/SlideoutHelper",["jquery","../../lib/@waca/core-client/js/core-client/ui/core/Class"],(function(e,t){return t.extend({createAndShowSlideout:function(t,n){var o=this;this._slideout=this.glassContext.appController.showSlideOut(t),this._slideout.$el.addClass("dashboardPane");var i=function(){try{e(window).resize()}catch(e){console.error(e)}};this._slideout.on("done:show",i),this._slideout.on("hide",(function(){o._closeSlideout(),n&&n.target&&n.target.plugin&&n.target.plugin.setUnpressed&&n.target.plugin.setUnpressed(),i()}))},isSlideoutOpen:function(){return this._slideout&&this._slideout.isOpen()},_closeSlideout:function(){this._slideout&&(this._slideout.hide({force:!0}),delete this._slideout)},onHide:function(){this.isSlideoutOpen()&&this._closeSlideout()}})})),define("dashboard-core/js/dashboard/contentpane/PropertyUIControlView",["../../lib/@waca/core-client/js/core-client/ui/core/View","../../lib/@waca/core-client/js/core-client/ui/properties/PropertyUIControl"],(function(e,t){var n=e.extend({init:function(e){n.inherited("init",this,arguments),this.options=e||{},this._propertyUIControl=null,this._isMainPropertyUIControl=this.options.items&&"Banner"===this.options.items[0].type,this.setFocus=this.options.onSetFocus,this.node=this.options.node,this.setPropertySpec(this.options.items)},setPropertySpec:function(e){this._propertySpec={el:this.node||this.$el,glassContext:this.options.glassContext,items:e},this._isMainPropertyUIControl&&e&&e.length&&(this._propertySpec.ariaLabel=e[0].value),this._propertySpec.primaryUIControl=!1,this.options&&(this._propertySpec.onCloseCb=this.options.onCloseCb||null,this._propertySpec.closeCallback=this.options.closeCallback||null)},render:function(e){var n=this;this.$el.parent().addClass("dashboardPropertiesPane");return(this._propertyUIControl?this._propertyUIControl.onClose().then((function(){n._propertyUIControl.remove(),n.$el.empty()})):Promise.resolve()).then((function(){return n._propertySpec&&n._propertySpec.items&&n._propertySpec.items.length?(n._propertyUIControl=new t(n._propertySpec),n._propertyUIControl.render().then((function(){return n._isMainPropertyUIControl&&!e&&n._propertyUIControl.focus(),n.options&&n.options.renderCallback&&n.options.renderCallback(),n._propertySpec&&n._showMissingTranslationsIcon(n._propertySpec.items),n._propertyUIControl}))):Promise.resolve()}))},getPropertyUIControl:function(){return this._propertyUIControl},onClose:function(){return this._propertyUIControl.onClose()},_showMissingTranslationsIcon:function(e){e.forEach(function(e){e.items?this._showMissingTranslationsIcon(e.items):!e.appendTranslationIcon||e.translationIconNode&&0!==e.translationIconNode.length||(e.translationIconNode=this.$el.find(".property_"+e.id),e.appendTranslationIcon(e.translationIconNode))}.bind(this))},remove:function(){this._propertyUIControl&&(this._propertyUIControl.remove(),this._propertyUIControl=null),this._propertySpec=null,this.options=null}});return n})),define("dashboard-core/js/dashboard/contentpane/PropertiesManager",["../../lib/@waca/core-client/js/core-client/ui/core/Class","./SlideoutHelper","jquery","underscore","../widgets/PropertyListUtil","../../app/nls/StringResources","../../lib/@waca/dashboard-common/dist/ui/interaction/Utils","../contentpane/PropertyUIControlView"],(function(e,t,n,o,i,r,A,a){var s=e.extend([t],{init:function(e){s.inherited("init",this,arguments),o.extend(this,e),this.dashboard=this.canvasController.dashboardApi,this._layoutController=this.canvasController.layoutController,this._eventRouter=this.canvasController.eventRouter,this.canvas=this.dashboard.getFeature("Canvas"),this.canvas.on("change:content:property",this.onContentPropertyChange,this),this.canvas.on("change:property",this.onDashboardPropertyChange,this),this.slideoutFeature=this.dashboard.getFeature("InAppSlideoutState"),this.slideoutDOMFeature=this.dashboard.getFeature("InAppSlideoutDOM"),this._eventRouter.on("properties:refreshProperty",this.refreshProperty,this),this._eventRouter.on("properties:updateVisiblilty",this.updateVisiblilty,this),this._eventRouter.on("properties:updateEnabled",this.updateEnabled,this),this._eventRouter.on("properties:setValue",this.setPropertyValue,this),this._eventRouter.on("selection:ready",this.onPropertiesSelectionReady,this),this._eventRouter.on("properties:refreshPane",this.refreshApplicationPropertiesPane,this),this._eventRouter.on("properties:refreshChild",this.refreshChildProperty,this),this._eventRouter.on("properties:setChildValue",this.setChildValue,this),this._lastEventId="",this._expandedSections={},this._defaultTabOrder=[r.get("tabName_visualization"),r.get("tabName_visDetails"),r.get("tabName_textDetails"),r.get("tabName_mediaDetails"),r.get("tabName_webDetails"),r.get("tabName_imageDetails"),r.get("tabName_animation"),r.get("tabName_general")],this.logger=e.glassContext.getCoreSvc(".Logger"),this._children=[]},onContentPropertyChange:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.info){var n=[t.info],o=t.info.events;if(o){var i={};o.forEach((function(e){e.info&&e.info.contentId&&(i[e.info.contentId]=e.info)})),n=Object.values(i)}n.forEach((function(t){var n=t.contentId,o=n&&e.canvas.getContent(n);if(o&&"widget.live"!==o.getType()){var i=t.options||{};e.getCurrentChild()?e.refreshChildProperty(_extends({content:e.canvas.getContent(n)},i)):e.refreshApplicationPropertiesPane(_extends({},i))}}))}},onDashboardPropertyChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.info&&e.info.supportsUndoRedo){var t=e.info.options||{};this.refreshApplicationPropertiesPane(_extends({},t))}},show:function(e){var t=this,n=e&&e.context;this._hideChild();var o=this._layoutController.getSelectedNodes(),i=this._getSelectedLayouts(o);return this._selectedTab="",this._expandedSections={},this._handleButtonState(!0),this.getProperties(i).then((function(o){var i=o&&o[0]&&"Banner"===o[0].type?o[0].value:"";return t.createAndShowSlideout({enableTabLooping:!0,width:"320px",position:"right",pinning:{isPinned:!0,float:!1,display:!1},content:{module:"dashboard-core/js/dashboard/contentpane/PropertyUIControlView",glassContext:t.glassContext,renderCallback:t._renderCallback.bind(t),items:o,onSetFocus:e?e.onSetFocus:null},label:i},n)}))},getPropertiesView:function(e){var t=this,n=this.dashboard.getCanvas().getContent(e),o=void 0;if(e)o=this.getPropertyLayoutList([n]);else{var i=this._getSelectedLayouts([]);o=this.getProperties(i)}return o.then((function(e){var n=new a({node:document.createElement("div"),items:e,glassContext:t.glassContext,renderCallback:t._renderCallback.bind(t)});return t.contentView=n,n.render()}))},_renderCallback:function(){this._eventRouter&&this._eventRouter.trigger("properties:hasRendered",{})},hide:function(){this._hideChild(),this._handleButtonState(!1),this._closeSlideout(),this._clearSelectedNodeIds()},_handleButtonState:function(e){var t=this.glassContext.appController.findPlugin("com.ibm.bi.dashboard.propertyBtn");t&&(!0===e?t.setPressed():!1===e&&t.setUnpressed())},getProperties:function(e){var t=this.dashboard.getCanvas(),n=e&&e.length&&!e[0].parentLayout?[t]:o.map(e,(function(e){return t.getContent(e.id)}));return this.getPropertyLayoutList(n)},getPropertyLayoutList:function(e){var t=this,n=[],r=0,A=void 0;return o.each(e,(function(e){var a=e&&e.getPropertyLayoutList&&e.getPropertyLayoutList();if(!o.isEmpty(a)){if(!A){var s=o.find(a,(function(e){return"Banner"===e.type}));A=t._getCoreClientLayout(s)}var l=o.chain(a).filter((function(e){return"Group"===e.type})).sortBy((function(e){if(void 0!==e.position)return e.position;var n=t._defaultTabOrder.indexOf(e.label);return n>=0?n:10})).map(t._getCoreClientLayout.bind(t)).value();e.getType&&"group"===e.getType()?(r++,n.push(i.processProperties(l,e,t.dashboard).then((function(){return l})))):n.unshift(i.processProperties(l,e,t.dashboard).then((function(){return l})))}})),Promise.all(n).then((function(e){for(;e.length>1+r;)e[0]=t._mergePropertySpecs(e[1],e[0],!0),e.splice(1,1);var n=e[0],o=void 0;if(r>0){for(e.splice(0,1);e.length>1;)e[0]=t._mergePropertySpecs(e[1],e[0],!0),e.splice(1,1);o=e[0]}n&&(e[0]=t._mergeGroupPropertySpecs(n,o));var i=[];if(e.length<1)return i;if(i.push(A),e[0].length>1){var a={type:"TabControl",name:"tabControl",items:e[0],onTabChange:function(e,t){this._selectedTab=t.name}.bind(t)};i.push(a)}return 1===e[0].length&&i.push.apply(i,e[0][0].items),i}))},_getCoreClientLayout:function(e,t){var n=this,i=o.extend({},e);if(e)switch(e.items&&e.items.length&&o.extend(i,{items:o.chain(e.items).map((function(e,t){return n._getCoreClientLayout(e,t)})).flatten().value()}),i.type){case"Group":return this._processCoreClientTabControl(i);case"Section":return this._processCoreClientSectionControl(i,t);case"DropDown":return this._processCoreClientDropDownControl(i)}return i},_processCoreClientTabControl:function(e){return o.extend(e,{name:e.label,selected:this._selectedTab===e.label,module:"dashboard-core/js/dashboard/contentpane/PropertyUIControlView"})},_getSectionExpandState:function(e,t){if(void 0===this._expandedSections[e.id]){var n=e.open;void 0===n&&(n=0===t),this._expandedSections[e.id]=n}return this._expandedSections[e.id]},_processCoreClientSectionControl:function(e,t){var n=o.extend(e,{name:e.id,styleAsSimpleRow:!0,type:!1===e.collapsible?"SectionLabel":"CollapsibleSection",open:this._getSectionExpandState(e,t),onOpenChange:function(e,t){this._expandedSections[e]=t}.bind(this)}),i=t>0&&!e.noSeparator?[{type:"Separator"},n]:[n];return"SectionLabel"===n.type&&(i.push.apply(i,n.items),delete n.items),i},_processCoreClientDropDownControl:function(e){return e.name=e.id,!e.options&&e.getOptions&&(e.options=e.getOptions()),e},_hideChild:function(){var e=this.getCurrentChild();e&&e.hide({force:!0})},closeChild:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.getCurrentChild();t&&(e&&"function"==typeof e?e():t.node&&t.node.parentNode&&t.node.parentNode.contains(t.node)?(t.node.nextElementSibling.style.display="block",t.node.parentNode.removeChild(t.node)):t.$el&&t.parentNode&&t.parentNode.contains(t.$el[0])&&(t.$el.next().show(),t.parentNode.removeChild(t.$el[0])),this._children.pop(),t.remove&&t.remove())},closeAllChild:function(){for(var e=this._children.length;e>0;)this.closeChild(),--e},getChildPropertiesView:function(e){var t=this;e.glassContext=this.glassContext,e.onCloseCb=this.closeChild.bind(this,e.onCloseCb);var n=e.module.split("/").pop();return new Promise((function(o,i){switch(n){case"PropertyUIControlView":o(t._createChildPropertyUIControlView(e.items));break;case"changePaletteView":require(["authoring-common"],(function(t){o(new t.ChangePaletteView(e))}),(function(e){i(e)}));break;case"ConditionalFormatting":require([e.module],(function(t){o(new t.CurrentConditionalPalette(e))}),(function(e){i(e)}));break;default:o()}})).then((function(n){return n?(n.options=e,t._children.push(n),n.render()):Promise.resolve()}))},getCurrentChild:function(){return this._children.length>0?this._children[this._children.length-1]:null},addChild:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.childPropertyDisplayed=!0,e.content=e.content||{},e.content.isChild=!0,e.content.childPanelId=o.uniqueId("childPanelId_"),e.pageChildId&&(this.pageChildId=e.pageChildId),this.slideoutDOMFeature.render(e.content),!0},_removeNonPublicProperties:function(e){for(var t=0;t<e.length;t++){!1===e[t].public?(e.splice(t,1),t--):e.items&&this._removeNonPublicProperties(e.items)}},_groupIntoTabs:function(e){var t=this;if(e){var i={},r=null;this._sectionMap={};for(var A=0;A<e.length;A++){var a=e[A];if(a.tabName){if(i[a.tabName])void 0!==a.tabPosition&&(i[a.tabName].tabPosition=a.tabPosition);else{r||(r={type:"TabControl",name:"tabControl",onTabChange:function(e,t){this._selectedTab=t.name}.bind(this),items:[]},e.splice(A,0,r),A++);var s=this._genTabUIControlSpec(a);r.items.push(s),i[a.tabName]=s,this._sectionMap[a.tabName]={}}this._insertPropIntoTab(a,i[a.tabName]),e.splice(A,1),A--}}if(r)0===n.grep(r.items,(function(e){return!0===e.selected})).length&&(this._selectedTab=""),r.items=o.sortBy(r.items,(function(e){if(void 0!==e.tabPosition)return e.tabPosition;var n=t._defaultTabOrder.indexOf(e.name);return n>=0?n:10})),o.each(r.items,(function(e){if(e.items){e.items=o.sortBy(e.items,"sectionPosition");for(var n=!0,i=0;i<e.items.length;i++)if("CollapsibleSection"!==e.items[i].type||e.items[i].open||e.items[i].expansionRuleExists){n=!1;break}t._addSeparatorBetweenSections(e.items),n&&(e.items[0].open=!0)}}));this._sectionMap=null}},_addSeparatorBetweenSections:function(e){if(e)for(var t=0;t<e.length;t++){"CollapsibleSection"===e[t].type&&t<e.length-1&&e.splice(t+1,0,{type:"Separator"})}},_insertPropIntoTab:function(e,t){var n=t;if(e.sectionName){var o=e.tabName;if(this._sectionMap[o][e.sectionName])n=this._sectionMap[o][e.sectionName];else{var i=this._genSectionUIControlSpec(e);this._insertPropIntoItemContainer(i,t),this._sectionMap[o][e.sectionName]=i,n=i}void 0!==e.sectionPosition&&(n.sectionPosition=e.sectionPosition),void 0===e.sectionOpened||n.expansionRuleExists||(n.open=e.sectionOpened,n.expansionRuleExists=!0)}this._insertPropIntoItemContainer(e,n)},_insertPropIntoItemContainer:function(e,t){for(var n=!1,o=0;o<t.items.length;o++)if(!e.displayPos&&t.items[o].displayPos||(t.items[o].displayPos||-1)>(e.displayPos||-1)){t.items.splice(o,0,e),n=!0;break}n||t.items.push(e)},_genTabUIControlSpec:function(e){var t=e.tabModule?e.tabModule:"dashboard-core/js/dashboard/contentpane/PropertyUIControlView",n={name:e.tabName,module:t,items:[]};return e.tabName===this._selectedTab&&(n.selected=!0),void 0!==e.tabPosition&&(n.tabPosition=e.tabPosition),n},_genSectionUIControlSpec:function(e){var t=this,n=e.tabName+"|"+e.sectionName,o={label:e.sectionName,name:n,type:"CollapsibleSection",items:[],styleAsSimpleRow:!0,onOpenChange:function(e,n){t._expandedSections[e]=n}};return null!=this._expandedSections[n]&&(o.open=this._expandedSections[n],o.expansionRuleExists=!0),o},_mergeGroupPropertySpecs:function(e,t){var n=this;if(!t)return e;var o=[];return e.forEach((function(e){if(e.name){for(var i=null,r=0;r<t.length;r++)if(t[r].name===e.name){i=t[r];break}i?(i.items&&e.items&&(i.items=n._mergeGroupPropertySpecs(e.items,i.items)),o.push(i)):o.push(e)}else o.push(e)})),o},_mergePropertySpecs:function(e,t,n){if(!e)return t;if(!t)return e;var o=n?[]:e;return t.forEach(function(t){if(t.name){for(var i=null,r=0;r<e.length;r++)if(e[r].name===t.name){i=e[r];break}i?(i.items&&t.items&&(i.items=this._mergePropertySpecs(i.items,t.items,n)),this._mergeCallback("onChange",i,t),this._mergeCallback("onChangePalette",i,t),n&&o.push(i)):n||o.push(t)}else o.push(t)}.bind(this)),o},_mergeCallback:function(e,t,n){if(t[e]||n[e]){var o=t[e];t[e]=function(i,r){o&&o.call(t,i,r),n[e]&&n[e].call(n,i,r)}}},updateVisiblilty:function(e){if(!e)return!1;var t=this.getPropertyControl(e.propertyName);return!!t&&(!0===e.visible?t.show():t.hide(),!0)},updateEnabled:function(e){if(!e)return!1;var t=this.getPropertyControl(e.propertyName);return!!t&&(!0===e.enabled?(t.readOnly=!1,t.enable()):t.disable(),!0)},refreshProperty:function(e){if(!e||!e.propertySpec)return!1;var t=this.getPropertyControl(e.propertySpec.name);return!!t&&(t.$el.empty(),!0!==e.removeProperty&&(o.extend(t,e.propertySpec),t.doRender()),!0)},setChildPropertyValue:function(e){if(this.isSlideoutOpen()){var t=this.getCurrentChild();if(t&&t.pageChildId===e.contentId&&e.value){var n=this.getPropertyControl(e.propertyName,t);n&&n.setValue&&n.setValue(e.value)}}},setChildValue:function(e){if(this._isPropertiesPaneOpen()){var t=this.getCurrentChild();if(t&&this.pageChildId===e.contentId&&e.value){var n=this.getPropertyControl(e.propertyName,t);n&&n.setValue&&n.setValue(e.value)}}},refreshChildProperty:function(e){var t=this;return Promise.resolve().then((function(){if(t._isPropertiesPaneOpen()){var n=t.getCurrentChild(),o=e&&e.content;o&&n&&t.pageChildId===o.getId()&&t.slideoutDOMFeature.render({content:o,refreshChild:!0,isChild:!0})}}))},updateChildPropertiesView:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.refreshChild&&t.content?this.getPropertyLayoutList([t.content]):Promise.resolve();return n.then((function(n){n&&(t.items=n);var o=e.getCurrentChild();return o&&o.options&&o.options.childPanelId===t.childPanelId&&(o instanceof a?(o.getPropertyUIControl()&&o.getPropertyUIControl().remove(),e._children.pop(),t.module=t.module||"dashboard-core/js/dashboard/contentpane/PropertyUIControlView"):t.onCloseCb()),t.onCloseCb=t.originalOnCloseCb,e.getChildPropertiesView(t)}))},_createChildPropertyUIControlView:function(e){return new a({node:document.createElement("div"),items:e,glassContext:this.glassContext,onCloseCb:this.closeChild,closeCallback:this.closeChild.bind(this),renderCallback:this._renderCallback.bind(this)})},refreshChild:function(e){var t=this;return Promise.resolve().then((function(){if(t.isSlideoutOpen()){var n=e&&e.content,o=t.getCurrentChild();return n&&o&&o.pageChildId===n.getId()?t.getPropertyLayoutList([n]).then((function(n){var i={module:"dashboard/contentpane/PropertyUIControlView",items:n};return i.onCloseCb=t._hideChild.bind(t),i.closeCallback=t._hideChild.bind(t),!!o.contentView&&o.setContent(i).then((function(){e.focusSelector&&o.$el.find(e.focusSelector).focus()}))})):void 0}}))},setPropertyValue:function(e){if(!e||void 0===e.value)return!1;var t=this.getPropertyControl(e.propertyName);return!(!t||!t.setValue)&&(t.propertiesManagerChange=!0,e.subPropertyName?t.setValue(e.subPropertyName,e.value):t.setValue(e.value),t._lastChangedValue="undefined",t.propertiesManagerChange=!1,!0)},getPropertyControl:function(e,t){if(!this._isPropertiesPaneOpen())return null;t||(t=this._slideout);var n=(t||this.contentView).getPropertyUIControl();return this._getPropertyControlFromUIControl(e,n)},_getPropertyControlFromUIControl:function(e,t){if(!t)return null;var n,o=e;"string"!=typeof e&&e.length&&(o=(n=e.slice()).shift());var i=t.getProperty(o);return!i&&t.propertyUIControlLeft&&!(i=t.propertyUIControlLeft.getProperty(o))&&t.propertyUIControlRight&&(i=t.propertyUIControlRight.getProperty(o)),i?n&&n.length?this._getPropertyControlFromUIControl(n,i):i:null},_isPropertiesPaneOpen:function(){if(!this.slideoutFeature.isOpen())return!1;var e=this.slideoutFeature.getCurrent();return!(!e||"PropertiesPane"!==e.id)},refreshApplicationPropertiesPane:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._isPropertiesPaneOpen()){var t=this._layoutController.getSelectedNodes(),n=t&&this._getSelectedLayouts(t);if(n){e.selectedTab&&(this._selectedTab=e.selectedTab);var o=this.slideoutFeature.getCurrent().id,i=this.slideoutDOMFeature.getView(o).instance.getRenderNode();e.currentScrollTop=i.scrollTop,this.updatePropertiesPanel(n,e)}}},refreshPropertiesPane:function(e){if(this.isSlideoutOpen()){this._dashboardPropertiesPane=this._slideout.el.querySelector(".pane-content"),e&&e.selectedTab&&(this._selectedTab=e.selectedTab);var t=this._layoutController.getSelectedNodes();e?e.currentScrollTop=this._dashboardPropertiesPane.scrollTop:e={currentScrollTop:this._dashboardPropertiesPane.scrollTop};var n=this._getSelectedLayouts(t);this._updatePropertiesPane(n,e)}},onPropertiesSelectionReady:function(e){if(this._isPropertiesPaneOpen()){var t=e.selectedNodes.map((function(e){return e.id})).sort().join();if(t!==this._lastSelectedNodeIds){e.selectedNodes&&1===e.selectedNodes.length&&(this._selectedTab="",this._expandedSections={});var n=this._getSelectedLayouts(e.selectedNodes);this.closeAllChild(),this.updatePropertiesPanel(n,e),this._lastSelectedNodeIds=t}}},onSelectionReady:function(e){if(this.isSlideoutOpen()){var t=e.selectedNodes.map((function(e){return e.id})).sort().join();if(t!==this._lastSelectedNodeIds){e.selectedNodes&&1===e.selectedNodes.length&&(this._selectedTab="",this._expandedSections={});var n=this._getSelectedLayouts(e.selectedNodes);this._hideChild(),this._updatePropertiesPane(n),this._lastSelectedNodeIds=t}}},updatePropertiesPanel:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=o.uniqueId("eventQueue_");this._lastEventId=i,setTimeout((function(){t._isPropertiesPaneOpen()&&t.getProperties(e).then((function(e){i===t._lastEventId&&(t.contentView.setPropertySpec(e),t.contentView.render(!0).then((function(e){n.currentScrollTop&&(e.el.parentNode.scrollTop=n.currentScrollTop),n.focusSelector&&e.$el.find(n.focusSelector).focus(),t._updateChildPropertiesSelection()})))}))}),0)},getMostRecentChildOptions:function(e){if(!e||e.childPanelId)return e;var t=this.getCurrentChild();return t&&t.options&&t.options.childPanelId?o.clone(t.options):e},_updatePropertiesPane:function(e,t){var n=this,i=o.uniqueId("eventQueue_");this._lastEventId=i,setTimeout((function(){n.isSlideoutOpen()&&n.getProperties(e).then((function(e){i===n._lastEventId&&(n._slideout.contentView.setPropertySpec(e),n._slideout.contentView.render(!0).then((function(){t&&t.focusSelector&&n._slideout.$el.find(t.focusSelector).focus(),t&&t.currentScrollTop&&(n._dashboardPropertiesPane.scrollTop=t.currentScrollTop)})),n._updateChildSelection())}))}),0)},_getSelectedLayouts:function(e){var t=this,o=[];if(e.forEach((function(e){if(e._layout){if(e._layout.model&&"group"===e._layout.model.type)for(var i=A.getContentWithoutDecoration(e),r=0;r<i.length;r++)n.merge(o,t._getSelectedLayouts([i[r]]));o.push(e._layout)}})),0===o.length){var i=this._layoutController.getTopLayoutView();i&&o.push(i)}return o},_getSelectedContents:function(){var e=this.dashboard.getCanvas();return o.map(e.getSelectedWidgets(),(function(t){return e.getContent(t.getId())}))},_clearSelectedNodeIds:function(){delete this._lastSelectedNodeIds},_updateChildPropertiesSelection:function(){var e=this.getCurrentChild();e&&e.updateSelection&&e.updateSelection()},_updateChildSelection:function(){var e=this._slideout.child&&this._slideout.child.open?this._slideout.child:null;e&&e.contentView.updateSelection&&e.contentView.updateSelection()}});return s})),define("dashboard-core/js/dashboard/CanvasController",["../lib/@waca/core-client/js/core-client/ui/core/Class","./layout/LayoutController","./UndoRedoController","./CopyPasteController","./contentpane/PropertiesManager","../app/EventRouter","../api/impl/LegacyViewControllers","jquery","underscore"],(function(e,t,n,o,i,r,A,a,s){return e.extend({_MAX_DATASET_REFRESH_RATE:5e3,_datasetRefreshInfo:{},init:function(e){this.$el=e.$el,this.glassContext=e.glassContext,this.services=e.services,this.dashboardApi=e.dashboardApi,this.model=e.boardModel,this.widgetLoader=e.widgetLoader,this.loader=e.widgetLoader,this.boardLoader=e.boardLoader,this._extensions={},this.logger=this.dashboardApi.getGlassCoreSvc(".Logger"),this.addRemoveNotifier=new r,this.addRemoveNotifier.on("widget:removeDone",this.onWidgetRemoveDone,this),this.undoRedoController=new n(this.model,{logger:this.logger,canvas:this.boardLoader.getCanvas(),transaction:this.dashboardApi.getFeature("Transaction")}),this.layoutController=new t({glassContext:this.glassContext,services:this.services,appSettings:e.appSettings,contentFeatureLoader:e.contentFeatureLoader,dashboardApi:this.dashboardApi,eventRouter:e.eventRouter,$el:this.$el,boardModel:this.model,boardModuleFactory:e.boardModuleFactory,widgetLoader:this.widgetLoader,canvasNotifier:this.addRemoveNotifier,layoutExtensions:e.layoutExtensions,gatewayUrl:e.gatewayUrl,cdnUrl:e.cdnUrl,canvasController:this,canvas:this.boardLoader.getCanvas()}),this.layoutController.createLayoutModules();var s=new A({layoutController:this.layoutController});this.dashboardApi.getFeature("FeatureRegistry.internal").registerFeature("LegacyViewControllers",s),this.dashboardApi.registerDashboardSvc("boardService",this.getDeprecatedCanvas()),this.eventRouter=e.eventRouter,this.propertiesManager=new i({glassContext:this.glassContext,canvasController:this}),this.registerExtension("propertiesManager",this.propertiesManager),this.dashboardApi.registerDashboardSvc("propertiesManager",this.propertiesManager),this.copyPasteController=new o({layoutController:this.layoutController,dashboardApi:this.dashboardApi,logger:this.logger,model:this.model,api:this.getDeprecatedCanvas(),type:this.dashboardApi.getType().toUpperCase()}),this.model.on("change:datasetShaping",function(e){this.model.datasetShaping.each(function(t){t.eventInfo=e,this._onChangeShapingSpec(t)}.bind(this))}.bind(this)),a(document).on("keydown",this._onDocumentKeyDown),this._features={}},initialize:function(){return null!=this.layoutController?this.layoutController.initialize():Promise.reject()},_prepareAsyncCallback:function(e){return function(){return this._destroyed?Promise.reject("The live widget object was destroyed"):e.apply(void 0,arguments)}.bind(this)},getDeprecatedCanvas:function(){return null!=this.layoutController?this.layoutController.getDeprecatedCanvas():null},destroy:function(){this._destroyed=!0,this.layoutController.destroy(),this._features=null,this.widgetLoader=null,this.loader=null,this.boardLoader=void 0,this.layoutController=null,this.addRemoveNotifier&&(this.addRemoveNotifier.off(),this.addRemoveNotifier=null),this.eventRouter&&(this.eventRouter.off(),this.eventRouter=null),this.undoRedoController&&(this.undoRedoController.clearStack(),this.undoRedoController=null),s.each(this._datasetRefreshInfo,(function(e,t){this._stopDatasetRefresh(t)})),a(document).off("keydown",this._onDocumentKeyDown)},_getSelectedWidget:function(){var e=this.$el.find(".widget.nodeSelected:visible");return e.length?this.widgetLoader.getWidget(e[0]._layout.id):null},_addWidget:function(e,t){var n=this,o=this.dashboardApi.getFeature("Transaction"),i=o.startTransaction(),r=e.model,A={containerId:e.parentId,properties:e.layoutProperties.style,spec:r,type:"widget."+r.type};return this.dashboardApi.getCanvas().addContent(A,i).then((function(e){return o.endTransaction(i),n.layoutController.whenWidgetRenderComplete(e.getId())})).then((function(e){var o=n.layoutController.interactionController.selectionHandler;o.deselectAll(),o.selectNode(e.domNode,{isTouch:t})}))},addDataItemsOrAddWidget:function(e,t){var n=this,o=this._getSelectedWidget();return o&&o.accepts&&o.accepts(e)?Promise.resolve(o.onDrop(e)):this.getWidgetSpecFromDragObject(e).then((function(e){return n._addWidget(e,t)}))},getWidgetSpecFromDragObject:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={parentId:this.id,layoutProperties:t},o=this.dashboardApi.getFeature("CanvasDnD");return o.onDrop(e).then((function(e){return e&&(n.model=e),n}))},addPin:function(e,t){var n=this.getDeprecatedCanvas().addFragment(e);this.getDeprecatedCanvas().selectWidget(n,{isTouch:t})},onWidgetRemoveDone:function(e){this.widgetLoader.isLoaded(e.id)&&this.widgetLoader.unLoadWidget(e.id,void 0,e)},changeToAuthorMode:function(){return this.layoutController.pageReady.then(this._prepareAsyncCallback(this.layoutController.changeToAuthorMode.bind(this.layoutController,{canvasNotifier:this.addRemoveNotifier})))},changeToConsumeMode:function(){return this.layoutController.changeToConsumeMode()},changeToEventGroupMode:function(){return this.layoutController.pageReady.then(this._prepareAsyncCallback(this.layoutController.changeToEventGroupMode.bind(this.layoutController)))},addProviderForExtension:function(e,t){var n=this.getExtension(e);n?n.addProvider?n.addProvider(t):this.logger.debug("Extension with id "+e+' does not have a "addProvider" method'):(this._extensionProviders||(this._extensionProviders={}),this._extensionProviders[e]||(this._extensionProviders[e]=[]),this._extensionProviders[e].push(t))},registerExtension:function(e,t){this._extensions[e]=t,this._extensionProviders&&this._extensionProviders[e]&&(t.addProvider?this._extensionProviders[e].forEach((function(e){t.addProvider(e)})):this.logger.debug("Extension with id "+e+' does not have a "addProvider" method'))},getExtension:function(e){return this._extensions[e]||null},_onDocumentKeyDown:function(e){if(e&&8===e.keyCode&&!e.metaKey&&!e.shiftKey){var t=e.srcElement||e.target;t.tagName.toLowerCase().match(/input|textarea|select/gim)||"true"===t.getAttribute("contentEditable")||e.preventDefault()}},onPageRenderComplete:function(){return this.layoutController.onPageRenderComplete},onPageReady:function(){return this.layoutController.pageReady},getFeature:function(e){var t=this;return new Promise((function(n,o){t._features[e]?n(t._features[e]):o("Feature not found")}))},registerFeature:function(e,t){return this._features[e]=t,Promise.resolve()}})})),define("dashboard-core/js/api/LayoutAPI",[],(function(){return function(){function e(){_classCallCheck(this,e)}return e.prototype.getChildrenList=function(){},e.prototype.getParentLayout=function(){},e.prototype.getWidget=function(){},e.prototype.render=function(){},e}()})),define("dashboard-core/js/api/deprecated/LayoutAPI",[],(function(){return function(){function e(){_classCallCheck(this,e)}return e.prototype.getChildren=function(){},e.prototype.getId=function(){},e.prototype.getSelfRatio=function(){},e.prototype.getWidgetAPI=function(){},e}()})),define("dashboard-core/js/api/impl/Layout",["../../lib/@waca/core-client/js/core-client/ui/core/Class","underscore","../../lib/@waca/dashboard-common/dist/core/APIFactory","../LayoutAPI","../deprecated/LayoutAPI"],(function(e,t,n,o,i){return e.extend({model:null,controller:null,init:function(e){this.model=e.model,this.controller=e,this.layoutController=e.layoutController},destroy:function(){this.model=null,this.controller=null,this.layoutController=null},getId:function(){return this.model.id},getChildren:function(){var e=this;return this.model.items.map((function(t){var n=t.id,o=e.layoutController.getView(n);if(o&&o.view&&o.view.getAPI)return o.view.getAPI()})).filter((function(e){return!!e}))},render:function(e){this.controller.render(e)},getSelfRatio:function(){return this.controller.getSelfRatio()},getParentLayout:function(){return this.controller.getParentLayout()},getWidgetAPI:function(){return this.controller.widgetAPI},getAPI:function(){return n.createAPI(this,[o,i])},getChildrenList:function(){return this.getChildren()},getWidget:function(){return this.getWidgetAPI()}})})),define("dashboard-core/js/app/util/UnderscoreExt",["underscore"],(function(e){e.objDifference=function(e,t,n){return e.filter((function(e){return 0===t.filter((function(t){return e[n]===t[n]})).length}))},e.doubleDebounce=function(e,t){var n=null,o=0,i=function(t){n=null,o=Date.now(),e(t)},r=function(r){Date.now()-o>t&&!n?(o=Date.now(),e(r)):(clearTimeout(n),n=setTimeout(i,t,r))};return r.cancel=function(){return clearTimeout(n)},r}})),define("dashboard-core/js/dashboard/layout/views/LayoutBaseView",["../../../lib/@waca/core-client/js/core-client/ui/core/Class","../../../view/features/content/contentViewDom/api/impl/ContentViewDomImpl","../../../lib/@waca/baglass/js/baglass/utils/Utils","jquery","underscore","../../../lib/@waca/core-client/js/core-client/utils/ClassFactory","../../../app/nls/StringResources","../../widgets/PropertiesUtil","react-dom","../../../lib/@waca/dashboard-common/dist/ui/CenterLoadingSpinner","../../../api/impl/Layout","../LayoutHelper","../../../lib/@waca/core-client/js/core-client/ui/dialogs/ConfirmationDialog","../../widgets/PropertyListUtil","../../util/ContentRegistryUtil","../../../app/util/UnderscoreExt"],(function(e,t,n,o,i,r,A,a,s,l,c,d,u,h,g){var f={width:320,height:200},p={"16:9":{width:1280,height:720},"4:3":{width:1280,height:960},letter:{width:612,height:792},legal:{width:612,height:1008},a4:{width:595,height:842},tabloid:{width:792,height:1224},infographic:{width:512,height:1024}},m=e.extend({init:function(e){m.inherited("init",this,arguments),this.layoutController=e.layoutController,this.isAuthoringMode=this.layoutController.isAuthoring,this.model=e.model,this.id=this.model.id,this.parentLayout=e.parentLayout,this.glassContext=e.services.biGlass.glassContext,this.appSettings=e.appSettings,this.dashboardApi=e.dashboardApi,this.additionalWidgetData=e.additionalWidgetData,this.contentFeatureLoader=e.contentFeatureLoader,this.content=e.content,this.dashboardApi&&(this.colorsService=this.dashboardApi.getFeature("Colors"),this.translationService=this.dashboardApi.getDashboardCoreSvc("TranslationService"),this.contentTypeRegistry=this.dashboardApi.getFeature("ContentTypeRegistry"));var t=this.layoutController.modelIdToNodeId(this.id),n=!1;this.parentLayout?(this.domNode=o(this.parentLayout.domNode).find("#"+t)[0],this.domNode||(this.domNode=document.getElementById(t),this.domNode&&(n=!0))):this.domNode=document.getElementById(t),this._attachedHandles=[],this._isTopLevelPage()&&this._attachedHandles.push(this.model.on("change:pageSize",this.onPageSizeChange.bind(this),this));var r=e.services.getSvcSync("htmlTemplates");if(this.domNode){if(n){var A=o(this.domNode),a=A.children(),s=A;this.domNode=o(r.getHtml(this.model,this.model.boardModel.widgetInstances))[0];var l=o(this.domNode);a.appendTo(l),s.remove(),this.layoutController.layoutReady(this.model.id).then(this.onResize.bind(this))}}else this.domNode=o(r.getHtml(this.model,this.model.boardModel.widgetInstances))[0];this.domNode._layout=this,this.authorHelper=e.authorHelper,this.widgetChromeEventRouter=e.widgetChromeEventRouter,this.widgetChromeEventRouter_disposeEvents=[],this.$el=o(this.domNode),this.logger=this.glassContext.getCoreSvc(".Logger"),this.services=e.services,this.api=new c(this),this.eventRouter||(this.eventRouter=this.layoutController.eventRouter,this.eventRouter&&(this.eventRouter.on("properties:hasRendered",this.setInitialEnabledState,this),this._enableToggleEvents(),this.eventRouter.on("layout:resize",this._onResize,this))),this._debouncedOnResize=i.doubleDebounce(this._onResize.bind(this),200),this._subLayoutViews=[]},setInitialEnabledState:function(){"relative"!==this.model.getValueFromSelfOrParent("layoutPositioning")&&this.eventRouter.trigger("properties:updateEnabled",{propertyName:"fitPage",enabled:!1})},_enableToggleEvents:function(){this.model.on("change:fitPage",this._updatePropertiesPaneToggle,this),this.model.on("change:showGrid",this._updatePropertiesPaneToggle,this),this.model.on("change:snapGrid",this._updatePropertiesPaneToggle,this),this.model.on("change:snapObjects",this._updatePropertiesPaneToggle,this)},_disableToggleEvents:function(){this.model.off("change:fitPage",this._updatePropertiesPaneToggle.bind(this),this),this.model.off("change:showGrid",this._updatePropertiesPaneToggle.bind(this),this),this.model.off("change:snapGrid",this._updatePropertiesPaneToggle.bind(this),this),this.model.off("change:snapObjects",this._updatePropertiesPaneToggle.bind(this),this)},_updatePropertiesPaneToggle:function(e){var t=e.value||!1;this.eventRouter.trigger("properties:setValue",{propertyName:e.name,value:t})},getNodeId:function(e){return this.layoutController.modelIdToNodeId(e)},_destroyAuthoringHelper:function(){this.authorHelper&&(this.authorHelper.destroy(),this.authorHelper=null)},destroy:function(e){if(this._subLayoutViews=null,this.widgetChromeEventRouter_disposeEvents.forEach((function(e){return e.remove()})),this.widgetChromeEventRouter_disposeEvents=[],this._debouncedOnResize&&this._debouncedOnResize.cancel(),this._destroyAuthoringHelper(),this.eventRouter&&(this.eventRouter.off("properties:hasRendered",this.setInitialEnabledState,this),this._disableToggleEvents(),this.eventRouter.off("layout:resize",this._onResize,this)),this._attachedHandles.forEach((function(e){return e.remove()})),this._attachedHandles=[],this.domNode){var t=o(this.domNode);t.off("contextmenu.baselayout"),o(".page,.widget",t).each((function(){this._layout&&this._layout.destroy&&this._layout.destroy(e)})),t.remove(),this.domNode._layout=null}this._contentTitle&&(this._contentTitle=null),this.layoutController&&this.layoutController.removeView(this),this.api&&(this.api.destroy(),this.api=null),this.layoutController=null,this.model=null,this.id=null,this.parentLayout=null,this.glassContext=null,this.appSettings=null,this.dashboardApi=null,this.colorsService=null,this.translationService=null,this.additionalWidgetData=null,this.contentFeatureLoader=null,this.content=null,this.widgetChromeEventRouter=null,this.logger=null,this.services=null,this.authorHelper=null,this.domNode=null,this.layoutController=null,this._debouncedOnResize=null,m.inherited("destroy",this,arguments)},_renderContentTitle:function(){var e=g.getCapabilities(this.content);if(!!e&&e.getCapabilities().title)return this._contentTitle=this.content.getFeature("ContentTitle.internal"),this.$el.addClass("titleSupported"),this._contentTitle.render({id:this.domNode.id,model:this.model,widgetChromeEventRouter:this.widgetChromeEventRouter,eventRouter:this.eventRouter})},renderContent:function(){var e=this,n=this.content.getFeature("state.internal");if(n.setStatus(n.STATUS.RENDERING),this._isRendered){var o=this._subLayoutViews.map((function(e){return e.renderContent()}));return Promise.all(o).then((function(){n.setStatus(n.STATUS.RENDERED)}))}var i=[],r=this.content.getFeature("renderer");if(r){var A=this.domNode;A.className="widget content "+this.content.getType(),this.content.getPropertyValue("canRotate")||(A.className+=" noRotate");var a=r.render({parent:A}).then((function(){var n=e._renderContentTitle();n&&A.prepend(n),e.contentFeatureLoader.registerFeature(e.content.getId(),"ContentViewDOM",new t(A))}));i.push(a)}return(this.model.items||[]).forEach((function(t){var n=t.id;i.push(e.layoutController.createLayoutModule(n,e,e.additionalWidgetData).then((function(t){if(t)return e._subLayoutViews.push(t),t.renderContent()})))})),Promise.all(i).then((function(){return e.registerViewFeatures()})).then((function(){n.setStatus(n.STATUS.RENDERED),e.layoutController.markViewAsReady(e),e._isRendered=!0}))},registerViewFeatures:function(){var e=this;return this._viewFeatureRegistered?Promise.resolve():(this._viewFeatureRegistered=!0,this.contentFeatureLoader.registerFeature(this.id,"ContentViewDOM",new t(this.domNode)).then((function(){return e.contentFeatureLoader.registerFeatureCollection(e.id,"com.ibm.bi.dashboard.content-view-features")})))},onResize:function(e){this._debouncedOnResize(e)},_onResize:function(e){var t=this;this.model.items&&i.each(this.model.items,(function(n){var o=t.layoutController.getLayoutView(n.id);o&&o.onResize&&(o.$el.is(":hidden")?o.resizeOnShow():o.onResize(e))}))},onSelect:function(e){this.contentTypeRegistry.isTypeRegistered(this.content.getType())&&this.widgetChromeEventRouter&&this.isAuthoringMode&&!e&&this.widgetChromeEventRouter.trigger("title:chromeSelected")},onDeselect:function(){this.contentTypeRegistry.isTypeRegistered(this.content.getType())&&this.widgetChromeEventRouter&&this.isAuthoringMode&&this.widgetChromeEventRouter.trigger("title:chromeDeselected")},onShow:function(){this._callChildrenFunction("onShow"),this.isResizeOnShow&&(this.isResizeOnShow=!1,this.onResize())},onHide:function(){this._callChildrenFunction("onHide")},onTransition:function(e){return this._callChildrenFunctionAsync("onTransition",e)},afterTransition:function(e){return this._callChildrenFunctionAsync("afterTransition",e)},resizeOnShow:function(){this.isResizeOnShow=!0},_callChildrenFunctionAsync:function(e,t){var n=this,o=[];return i.each(this.model.items,(function(i){var r=n.layoutController.getLayoutView(i.id);r&&r[e]&&o.push(r[e](t))})),Promise.all(o)},_callChildrenFunction:function(e){var t=this;i.each(this.model.items,(function(n){var o=t.layoutController.getLayoutView(n.id);o&&o[e]&&o[e]()}))},getProperties:function(){var e,t=this,n=[];return n.push(this.getBannerProperty()),this._isTopLevelPage()?((e=n).push.apply(e,this._getCanvasProperties()),this._fetchThemes().then((function(e){return n.push({type:"DropDown",label:A.get("propTheme"),name:"theme",id:"theme",defaultValue:t.layoutController.boardModel.get("theme"),options:e,tabName:A.get("tabName_general"),sectionName:A.get("sectionName_colorsAndThemes"),sectionPosition:2,showLabels:!0,onChange:function(e,n){t.layoutController.boardModel.set({theme:n})}}),Promise.all([t._getDashboardColorSetPropertySpec(),t._getBackgroundColorPropertySpec()]).then((function(e){return(n=n.concat(e)).push(t._getFredIsRedSpec()),n.push(t._getDataCacheSpec()),"Default"===t.translationService.getDefaultLanguage()?t._addLanguageSpecWhenNoLocaleSet(n):t._addMultilingualProperties(n),n}))})).catch((function(e){throw t.logger.error(e,t),e}))):this._getBackgroundColorPropertySpec().then((function(e){return n.push(e),n}))},_getDashboardColorSetPropertySpec:function(){var e=this,t={id:"dashboardColorSet",name:"dashboardColorSet",type:"NewPalette",sectionLabel:A.get("propDashboardColorPalette"),newPaletteLabel:A.get("propNewDashboardPaletteLabel"),linkLabel:A.get("propDashboardChangePaletteLink"),ariaLabel:A.get("propDashboardColorPalette"),tabName:A.get("tabName_general"),sectionName:A.get("sectionName_colorsAndThemes"),paletteType:"ColorPalette",defaultValue:"userPaletteColor",includeUserColorPalette:!0};return a.handleNewPaletteProperty(t,this.layoutController.boardModel.get("properties"),this.dashboardApi,(function(t,n){e.layoutController.boardModel.get("properties").set({dashboardColorSet:n.id}),e.eventRouter.trigger("properties:refreshPane",{sender:e.layoutController.boardModel.get("properties").id})}))},_getBackgroundColorPropertySpec:function(){var e=this,t={name:"fillColor",id:"fillColor",type:"ColorPicker",label:A.get("propDashboardBackgroundColor"),open:!1,ariaLabel:A.get("propDashboardBackgroundColor"),paletteType:"DashboardColorSet",showHexValue:!0,addButton:!0,tabName:A.get("tabName_general"),sectionName:A.get("sectionName_colorsAndThemes"),defaultValue:"transparent"};return a.handleColorPickerProperty(t,this,this.dashboardApi).then((function(t){return t.onChange=function(t,n){var o=e.model,r={undoRedoTransactionId:i.uniqueId("layout_fillColorChange_")},A={fillColor:n.name};o.get("css")==="fill-"+o.get("fillColor")&&(A.css=void 0),e.colorsService.prepareForColorModelChange(A,"fillColor"),o.set(A,{sender:e.senderId,payloadData:r})},t}))},_getFredIsRedSpec:function(){var e=this;return{type:"ToggleButton",label:A.get("propFredIsRed"),name:"fredIsRed",id:"fredIsRed",checked:this.model.boardModel&&this.model.boardModel.properties&&this.model.boardModel.properties.fredIsRed,tabName:A.get("tabName_general"),sectionName:A.get("sectionName_advanced"),onChange:function(t,n){e.layoutController.boardModel.properties.set({fredIsRed:n})}}},_getDataCacheSpec:function(){var e=this;return{type:"DropDown",label:A.get("dataCache"),name:"dataCache",id:"dataCache",defaultValue:this.model.boardModel&&this.model.boardModel.properties&&this.model.boardModel.properties.localCache||"automatic",options:[{label:A.get("dataCache_auto"),value:"automatic"},{label:A.get("dataCache_on"),value:"yes"},{label:A.get("dataCache_off"),value:"no"}],sectionPosition:99,tabName:A.get("tabName_general"),sectionName:A.get("sectionName_advanced"),onChange:function(t,n){"automatic"===n?e.model.boardModel.properties.set({localCache:void 0}):e.model.boardModel.properties.set({localCache:n})}}},_addMultilingualProperties:function(e){var t=this,n=this.translationService.getDefaultLanguage(),o=A.get("tabName_general");return e.push({type:"SingleLineLinks",tabName:o,name:"Languages",sectionName:A.get("sectionName_advanced"),disabled:this.translationService.translationModeOn,items:[{align:"left",items:[{type:"text",value:A.get("multilingualDashboardsLabel")}]}]}),e.push(this._createLanguageRow(n,o,!0)),this.translationService.getSelectedLanguages().sort((function(e,n){return t.translationService.getLanguageName(e)>t.translationService.getLanguageName(n)?1:-1})).forEach((function(i){i!==n&&"Default"!==i&&e.push(t._createLanguageRow(i,o,!1))})),e.push({type:"SingleLineLinks",tabName:o,name:"addLanguage",sectionName:A.get("sectionName_advanced"),disabled:this.translationService.translationModeOn,items:[{align:"right",items:[{type:"text",value:A.get("multilingualDashboardsAddLinkText"),clickCallback:function(){t.launchLanguageSelectSlideout(null,!0)}}]}]}),e},_addLanguageSpecWhenNoLocaleSet:function(e){var t=this,n=A.get("tabName_general"),o=this.translationService.getDefaultLanguage();e.push({type:"SingleLineLinks",tabName:n,name:"language_"+o,sectionName:A.get("sectionName_advanced"),items:[{align:"left",items:[{type:"text",id:"text"+o,value:A.get("multilingualDashboardsLabel")}]},{align:"right",items:[{type:"text",value:A.get("multilingualDashboardsSetDefault"),clickCallback:function(){t.launchLanguageSelectSlideout(o,!1)}}]}]})},_createLanguageRow:function(e,t,n){var o=this,i=[],r=this.translationService.getLanguageName(e);return i.push({type:"text",id:"text"+e,value:n?A.get("multilingualDashboardsDefault",{defaultLanguage:r}):r}),i.push({type:"icon",svgIcon:"common-menuoverflow",iconTooltip:A.get("multilingualDashboardIconMore",{currentLanguage:r}),clickCallback:function(t){o.launchLanguageMenu(t,e)}}),{type:"SingleLineLinks",tabName:t,id:"language_"+e,sectionName:A.get("sectionName_advanced"),indent:2,disabled:this.translationService.translationModeOn,items:[{align:"left",items:[]},{align:"right",items:i}]}},launchLanguageSelectSlideout:function(e,t){var n=this,o=this.layoutController.canvasController.getExtension("propertiesManager");o.addChild({overlay:!0,label:A.get("multilingualSelectLanguage"),content:{module:"dashboard-core/js/dashboard/contentpane/PropertyUIControlView",items:[{value:A.get("multilingualSelectLanguage"),centerLabel:!0,type:"Banner",backButton:!0,ariaLabel:A.get("multilingualSelectLanguage")},{type:"RadioButtonGroup",name:"language",separator:!0,ariaLabel:A.get("multilingualSelectLanguage"),value:e,selectOnNavigation:!1,items:this.translationService.getLanguageRadioItems(),onChange:function(i,r){o.closeChild(),"Default"===e?n.translationService.changeDefaultLanguage(r):t?n.translationService.startTranslationMode(r):n.translationService.switchLanguage({from:e,to:r})}}]}})},launchLanguageMenu:function(e,t){var n={};void 0===e.pageX||e.gesture&&(void 0===e.gesture.center||void 0===e.gesture.center.pageX)?n=o(e.target).offset():(n.left=e.pageX||e.gesture.center.pageX,n.top=e.pageY||e.gesture.center.pageY),this.glassContext.appController.showContextMenu({position:{pageX:n.left,pageY:n.top},menuId:"com.ibm.bi.dashboard.languageMenu",activeObject:{selectedLocale:t,translationService:this.translationService,layoutBaseView:this}})},_isTopLevelPage:function(){return this.model&&this.layoutController.boardModel&&this.model===this.layoutController.boardModel.layout},getBannerProperty:function(){return{value:this._isTopLevelPage()?A.get("dashboardProperties"):A.get("settings"),name:"banner",type:"Banner",editable:!1}},_getCanvasProperties:function(){var e=[this._getLayoutPositioningSpec()];return e=(e=e.concat(this._getPageSizeSpec())).concat(this._getGridOptionsSpec())},_getLayoutPositioningSpec:function(){var e=this._getLayoutPositioning(),t=this._getLayoutPositioningSpecOptions(e),o=this;return{type:"DropDown",label:A.get("propLayoutPositioning"),name:"layoutPositioning",id:"layoutPositioning",defaultValue:e,options:t,tabName:A.get("tabName_general"),sectionName:A.get("sectionName_canvas"),sectionPosition:1,coachMark:{render:function(e){n.addCoachmark({id:"com.ibm.bi.dashboard.dashboardCoreProperties.layoutPositioning",title:A.get("propLayoutPositioningCoachmarkTitle"),contents:A.get("propLayoutPositioningCoachmarkContent"),placement:"bottom",glassContext:e.glassContext,$el:e.$el})}},onChange:function(e,t){o._onChangeLayoutPosition(this,t)}}},_getLayoutPositioningSpecOptions:function(e){var t=[];return e||t.push({label:"",value:"undefined"}),t.push({label:A.get("propLayoutRelative"),value:"relative"},{label:A.get("propLayoutAbsolute"),value:"absolute"}),t},_getLayoutPositioning:function(){return this.model.getValueFromSelfOrParent("layoutPositioning")},_setLayoutPositioning:function(e){var t={undoRedoTransactionId:i.uniqueId("layout_layoutPositioningChange_")};this.model.set({layoutPositioning:e},{payloadData:t,sender:this.senderId}),this.onResize()},_setFitPageLayoutPositioning:function(e,t){var n={undoRedoTransactionId:i.uniqueId("layout_layoutPositioningChange_")};this.model.set({layoutPositioning:e,fitPage:t},{payloadData:n,sender:this.senderId}),this.onResize()},_onChangeLayoutPosition:function(e,t){var n=this;if(this._getLayoutPositioning())if("absolute"===t)this.eventRouter.trigger("properties:updateEnabled",{propertyName:"fitPage",enabled:!1}),this.eventRouter.trigger("properties:setValue",{propertyName:"fitPage",value:!1}),this._setFitPageLayoutPositioning(t,!1);else{this.eventRouter.trigger("properties:updateEnabled",{propertyName:"fitPage",enabled:!0});var o=this.model.get("pageSize"),i=this._getPageSizePreset(o.width,o.height);"16:9"===i||"4:3"===i?(this.eventRouter.trigger("properties:setValue",{propertyName:"fitPage",value:!0}),this._setFitPageLayoutPositioning(t,!0)):(this.eventRouter.trigger("properties:setValue",{propertyName:"fitPage",value:!1}),this._setFitPageLayoutPositioning(t,!1))}else{new u("warning",A.get("confirmLayoutStyleUpgradeTitle"),A.get("confirmLayoutStyleUpgrade")).confirm((function(){n._setLayoutPositioning(t),n.eventRouter.trigger("properties:refreshPane")}),(function(){e._lastChangedValue="undefined",e.setValue("undefined")}))}},_getGridOptionsSpec:function(){var e=this;return[{type:"SectionLabel",label:A.get("gridLabel"),id:"gridLabel",name:"gridLabel",tabName:A.get("tabName_general"),sectionName:A.get("sectionName_canvas")},{type:"ToggleButton",label:A.get("gridText"),name:"showGrid",id:"showGrid",checked:void 0!==this.model.get("showGrid")&&this.model.get("showGrid"),tabName:A.get("tabName_general"),sectionName:A.get("sectionName_canvas"),onChange:function(t,n){e.model.set({showGrid:n})}},{type:"ToggleButton",label:A.get("snapText"),name:"snapGrid",id:"snapGrid",checked:void 0!==this.model.get("snapGrid")&&this.model.get("snapGrid"),tabName:A.get("tabName_general"),sectionName:A.get("sectionName_canvas"),onChange:function(t,n){e.model.set({snapGrid:n})}},{type:"ToggleButton",label:A.get("snapObjectsText"),name:"snapObjects",id:"snapObjects",checked:void 0===this.model.get("snapObjects")||this.model.get("snapObjects"),tabName:A.get("tabName_general"),sectionName:A.get("sectionName_canvas"),onChange:function(t,n){e.model.set({snapObjects:n})}}]},_getPageSizePreset:function(e,t){var n="custom",o=parseInt(e,10),i=parseInt(t,10);for(var r in p)if(p.hasOwnProperty(r)){var A=p[r];if(A.width===o&&A.height===i){n=r;break}}return n},_wrapPageSizeTextProperty:function(){var e=this;return function(){var t=[e].concat(Array.prototype.slice.call(arguments));e._pageSizeTextOnChange.apply(this,t)}},_pageSizeTextOnChange:function(e,t,n){if(this.propertiesManagerChange)this.onChangeValueHold=n;else{var o=parseInt(n,10),r=e.model,a="pageSizeWidth"===t?"width":"height",s={};r.pageSize&&(s=i.extend(s,r.pageSize)),isNaN(o)||s[a]===o||(s[a]=o,o=(s=e._setPageSize(s))[a]);var l=["pageSizeSplit",t];isNaN(o)?e.eventRouter.trigger("properties:setValue",{propertyName:l,value:this.onChangeValueHold}):n!==this.onChangeValueHold&&(this.onChangeValueHold=h.getPropertyDisplayString(o,A.get("pixelUnit"),!0),e.eventRouter.trigger("properties:setValue",{propertyName:l,value:this.onChangeValueHold}))}},_setPageSize:function(e,t){var n=this.model,o=!1,i=d.getBoundingPageSize(n,f);return i&&((isNaN(e.width)||i.width>e.width)&&(e.width=i.width,o=!0),(isNaN(e.height)||i.height>e.height)&&(e.height=i.height,o=!0),o&&this.layoutController.glassContext.appController.showToast(A.get("propPageSizeAdjustedMessage"),{type:"info"})),n.set({pageSize:e},{payloadData:{undoRedoTransactionId:t}}),this.onResize(),e},_getPageSizeDisplayValues:function(){var e=this.model,t=e.pageSize&&e.pageSize.width?h.getPropertyDisplayString(e.pageSize.width,A.get("pixelUnit"),!0):"",n=e.pageSize&&e.pageSize.height?h.getPropertyDisplayString(e.pageSize.height,A.get("pixelUnit"),!0):"";return{width:t,height:n,preset:this._getPageSizePreset(t,n)}},onPageSizeChange:function(){var e=this._getPageSizeDisplayValues();this.eventRouter.trigger("properties:setValue",{propertyName:["pageSizeSplit","pageSizeWidth"],value:e.width}),this.eventRouter.trigger("properties:setValue",{propertyName:["pageSizeSplit","pageSizeHeight"],value:e.height}),this.eventRouter.trigger("properties:setValue",{propertyName:"pageSizePreset",value:e.preset})},_getPageSizeSpec:function(){var e=this,t=this._getPageSizeDisplayValues();return[{type:"SectionLabel",id:"pageSizeLabel",name:"pageSizeLabel",label:A.get("propPageSizeLabel"),tabName:A.get("tabName_general"),sectionName:A.get("sectionName_canvas")},{type:"DropDown",label:A.get("propPageSizePreset"),ariaLabel:A.get("propPageSizePresetAriaLabel"),name:"pageSizePreset",id:"pageSizePreset",readOnly:!1,defaultValue:t.preset,options:[{label:A.get("propPageSizePresetCustom"),value:"custom"},{label:A.get("propPageSizePreset16x9"),value:"16:9"},{label:A.get("propPageSizePreset4x3"),value:"4:3"},{label:A.get("letter"),value:"letter"},{label:A.get("legal"),value:"legal"},{label:A.get("a4"),value:"a4"},{label:A.get("tabloid"),value:"tabloid"},{label:A.get("propPageSizePresetInfographic"),value:"infographic"}],onChange:this._onChangePageSizePreset.bind(this),tabName:A.get("tabName_general"),sectionName:A.get("sectionName_canvas"),sectionPosition:1},{type:"ToggleButton",label:A.get("fitPageText"),name:"fitPage",id:"fitPage",checked:this.getFitPage(),tabName:A.get("tabName_general"),sectionName:A.get("sectionName_canvas"),onChange:function(t,n){e.model.set({fitPage:n})}},{type:"Split",name:"pageSizeSplit",id:"pageSizeSplit",tabName:A.get("tabName_general"),sectionName:A.get("sectionName_canvas"),items:[{align:"left",items:[{type:"InputLabel",label:A.get("propPageSizeWidth"),ariaLabel:A.get("propPageSizeWidthAriaLabel"),name:"pageSizeWidth",id:"pageSizeWidth",readOnly:!1,value:t.width,onChangeValueHold:t.width,multiline:!0,handleReturnKey:!0,onChange:this._wrapPageSizeTextProperty()}]},{align:"right",items:[{type:"InputLabel",label:A.get("propPageSizeHeight"),ariaLabel:A.get("propPageSizeHeightAriaLabel"),name:"pageSizeHeight",id:"pageSizeHeight",readOnly:!1,value:t.height,onChangeValueHold:t.height,multiline:!0,handleReturnKey:!0,onChange:this._wrapPageSizeTextProperty()}]}]}]},_onChangePageSizePreset:function(e,t){var n=p[t];if(n){var o={undoRedoTransactionId:i.uniqueId("layout_layoutPageSizeChange_")},r=this.model;if("absolute"!==r.get("layoutPositioning")){var A="16:9"===t||"4:3"===t;r.set({fitPage:A},{payloadData:o}),this.eventRouter.trigger("properties:setValue",{propertyName:"fitPage",value:A})}r.pageSize&&r.pageSize.width===n.width&&r.pageSize.height===n.height||this._setPageSize({width:n.width,height:n.height},o.undoRedoTransactionId)}},getFitPage:function(){var e=!1;return"absolute"!==this.model.getValueFromSelfOrParent("layoutPositioning")&&(e=this.model.getValueFromSelfOrParent("fitPage")||!1),e},_fetchThemes:function(){var e=this;return this._themeListing?Promise.resolve(this._themeListing):(this._themeListing=[],r.loadModule("text!dashboard-core/js/lib/@waca/dashboard-common/dist/themes/themeListing.json").then((function(t){var n=JSON.parse(t);return i.each(n.themes,(function(t){e._themeListing.push({label:A.get(t.name+"Label"),value:t.name})})),e._themeListing}),(function(){return e._themeListing=[],e._themeListing})))},reduce:function(e,t){return t=e(this,t),this.model.items&&this.model.items.forEach((function(n){var o=this.layoutController.getLayoutView(n.id);o&&o.reduce&&(t=o.reduce(e,t))}),this),t},setLoading:function(e){return this._$loadingIndicatorBlocker||e?(this._$loadingIndicatorBlocker||(this._$loadingIndicatorBlocker=o("<div></div>")),e?(this.$el.append(this._$loadingIndicatorBlocker),s.render(l({size:"normal",variant:"circle"}),this._$loadingIndicatorBlocker[0])):(s.unmountComponentAtNode(this._$loadingIndicatorBlocker[0]),this._$loadingIndicatorBlocker.remove(),this._$loadingIndicatorBlocker=null),Promise.resolve(null)):Promise.resolve(null)},getSelectedSubViewId:function(){return this.id},getSelectedSubViewTitle:function(){return null},getSelfRatio:function(){return{width:1/(this.parentLayout.model.getVisualizations().length||1),height:1}},getParentLayout:function(){return this.parentLayout.getAPI()},getAPI:function(){return this.api.getAPI()},render:function(e){this.onShow(e)}});return m})),define("dashboard-core/js/dashboard/layout/views/PageCollectionView",["./LayoutBaseView","../../../lib/@waca/core-client/js/core-client/utils/EventHelper"],(function(e){var t=null;return t=e.extend({init:function(){t.inherited("init",this,arguments),this._started=!0}})})),define("dashboard-core/js/dashboard/util/ColorUtils",[],(function(){return new function(){return{invertColor:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:180,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this._convertRGBToYUV(e);i.y=this._validateColor(i.y+(i.y>n?-t:t));var r=this._convertYUVToRGB(i);return o?r:this.contrastRatio(e,r)<4.5?this.contrastRatio(e,"#FFFFFF")<4.5?"#000000":"#FFFFFF":r},_convertRGBToYUV:function(e){var t=parseInt(e.substring(1,3),16),n=parseInt(e.substring(3,5),16),o=parseInt(e.substring(5),16);return{y:this._validateColor(.299*t+.587*n+.114*o),u:this._validateColor(-.16874*t+-.33126*n+.5*o+128),v:this._validateColor(.5*t+-.41869*n+-.08131*o+128)}},_convertYUVToRGB:function(e){var t=this._validateColor(e.y+1.402*(e.v-128)),n=this._validateColor(e.y+-.34414*(e.u-128)+-.71414*(e.v-128)),o=this._validateColor(e.y+1.772*(e.u-128));return"#"+(t<16?"0"+t.toString(16):t.toString(16))+(n<16?"0"+n.toString(16):n.toString(16))+(o<16?"0"+o.toString(16):o.toString(16))},_validateColor:function(e){return e<0?0:e>255?255:Math.floor(e)},luminance:function(e){var t=parseInt(e.substring(1,3),16),n=parseInt(e.substring(3,5),16),o=parseInt(e.substring(5),16);return n/=255,o/=255,.2126*(t=(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(n=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.0722*(o=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))},contrastRatio:function(e,t){var n=this.luminance(e),o=this.luminance(t);return n>o?(n+.05)/(o+.05):(o+.05)/(n+.05)}}}})),define("dashboard-core/js/app/ui/dialogs/ConfirmationDialog",["../../../lib/@waca/dashboard-common/dist/ui/dialogs/MessageBox"],(function(e){var t=null;return t=e.extend({_buttons:["ok","cancel"],_confirmCallback:null,_cancelCallback:null,confirm:function(e,n){this._confirmCallback=e,this._cancelCallback=n,t.inherited("open",this)},ok:function(){t.inherited("ok",this,arguments),this._confirmCallback&&this._confirmCallback()},cancel:function(){t.inherited("cancel",this,arguments),this._cancelCallback&&this._cancelCallback()}})})),define("dashboard-core/js/dashboard/layout/views/Tab",["./PageCollectionView","jquery","underscore","react","react-dom","corsair_ship/ba-react-html5-dnd","ca-ui-toolkit","../../util/ColorUtils","../../../app/nls/StringResources","../../widgets/PropertiesUtil","../../../app/ui/dialogs/ConfirmationDialog","../../../app/util/EventChainLocal","../../../lib/@waca/core-client/js/core-client/utils/BidiUtil"],(function(e,t,n,o,i,r,A,a,s,l,c,d,u){var h={top:"bottom",left:"right",bottom:"top",right:"left"},g=[{modelPropertyName:"tabTextColor",toolkitPropertyName:"textColor"},{modelPropertyName:"tabSelectedLineColor",toolkitPropertyName:"lineColor"},{modelPropertyName:"tabBackgroundColor",toolkitPropertyName:"backgroundColor"},{modelPropertyName:"tabIconColor",toolkitPropertyName:"iconColor"}],f=null;return f=e.extend({init:function(e){f.inherited("init",this,arguments),this.eventRouter=e.eventRouter,this.canvas=e.canvas,this.colorsService=this.dashboardApi.getFeature("Colors"),this._icons=this.dashboardApi.getFeature("Icons"),this._dashboardState=this.dashboardApi.getFeature("DashboardState"),this._registerEvents(),this.initialTab=this.model.items[0],e.appSettings&&e.appSettings.subView&&n.each(this.model.items,function(t){t.id===e.appSettings.subView&&(this.initialTab=t)}.bind(this)),this._setTabsVisibility(),this._TabsWidget=null,Object.defineProperty(this,"tabWidget",{get:function(){return this._TabsWidget}})},renderContent:function(){var e=this;return this.rendered?Promise.resolve(!1):f.inherited("renderContent",this,arguments).then((function(){e._renderTabs(e.initialTab.id),e.showView(e.initialTab),e.canvas.selectContent([e.initialTab.id]),e.rendered=!0}))},destroy:function(){this._unregisterEvents(),i.unmountComponentAtNode(this.$el.find(".tabCntr")[0]),t(".tabLabel",this.$el).remove(),f.inherited("destroy",this,arguments)},_registerEvents:function(){this.colorsService&&(this.colorsService.on("theme:changed",this.applyTheme,this),this.colorsService.on("colorSet:changed",this.applyTheme,this)),this.model&&(this.model.on("change:tabTextColor",this.applyTheme,this),this.model.on("change:tabSelectedLineColor",this.applyTheme,this),this.model.on("change:tabBackgroundColor",this.applyTheme,this),this.content.on("add:child",this.onTabAdded,this),this.content.on("remove:child",this.onTabRemoved,this),this.model.on("change:hideTab",this.updateHideTabState,this),this.model.on("change:fillColor",this.applyTheme,this),this.model.on("change:tabPosition",this.updateTabPosition,this),this.model.on("change:tabIconPosition",this.updateTabIconPosition,this)),this.eventRouter&&this.eventRouter.on("properties:hasRendered",this.setInitialEnabledState,this),this.canvas.on("change:selections:select",this.onSelection,this),this._boundSetTabsVisibility=this._setTabsVisibility.bind(this),this._dashboardState.onUiStateChange(this._boundSetTabsVisibility)},_unregisterEvents:function(){this.colorsService&&(this.colorsService.off("theme:changed",this.applyTheme,this),this.colorsService.off("colorSet:changed",this.applyTheme,this)),this.model&&(this.model.off("change:tabTextColor",this.applyTheme,this),this.model.off("change:tabSelectedLineColor",this.applyTheme,this),this.model.off("change:tabBackgroundColor",this.applyTheme,this),this.content.off("add:child",this.onTabAdded,this),this.content.off("remove:child",this.onTabRemoved,this),this.model.off("change:hideTab",this.updateHideTabState,this),this.model.off("change:fillColor",this.applyTheme,this),this.model.off("change:tabPosition",this.updateTabPosition,this),this.model.off("change:tabIconPosition",this.updateTabIconPosition,this)),this.eventRouter&&this.eventRouter.off("properties:hasRendered",this.setInitialEnabledState,this),this.canvas.off("change:selections:select",this.onSelection,this),this._dashboardState.offUiStateChange(this._boundSetTabsVisibility)},_getPanelId:function(e){return e+"_tabpanel"},_getModelIdFromPanel:function(e){return e.slice(0,-9)},_getDefaultLinePostion:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"top";return h[e]},_getDashboardColorProperties:function(){var e=this,t={};return g.forEach((function(o){n.extend(t,e._getColorProperty(e.model,o))})),t},_getColorProperty:function(e,t){var o=t.modelPropertyName,i={},r=e.get("tabBackgroundColor")||e.get("fillColor"),A=this.colorsService.getForegroundColorPropertiesForUIElement(r,"tabs"),a=null;if(t&&e.get(o)&&(a=this.colorsService.getHexColorFromDashboardColorSet(e.get(o))),a||"tabBackgroundColor"!==t.modelPropertyName||(a=this.colorsService.getHexColorFromDashboardColorSet(r)),t&&a)i[t.toolkitPropertyName]=a;else if(t){var s=n.find(A,(function(e){return e.id===o}));s&&(i[t.toolkitPropertyName]=s.value)}return i},_getColorProperties:function(e){var t=this,o=this._getDashboardColorProperties();if(e){var i=this._getChangedPageColorPropertyList(e);if(i.length>0){i.find((function(e){return"tabBackgroundColor"===e.modelPropertyName}))&&(i=g),i.forEach((function(i){var r=t._getColorProperty(e,i);n.extend(o,r)}))}e.get("tabIconColor")||(o.iconColor=o.textColor)}return this._setDeleteColors(o),o},_setDeleteColors:function(e){var t=e.backgroundColor;"transparent"===t&&(t=this.colorsService.getValueForPropertyOfUIElement("board","backgroundColor")),t&&(e.hoverColor=a.invertColor(t,20,100,!0),e.deleteBackgroundColor=a.invertColor(t,40,100,!0),e.deleteIconColor=e.textColor)},_createTabPanel:function(e,i,r){var a=this,s=A.TabPanel,l=e.get("tabIcon"),c=l&&"transparent"!==l?this._icons.getIcon(l).id:null,d={id:this._getPanelId(e.id),label:e.get("title"),icon:c,keepTabContent:!0,tooltipOrient:"top"};return n.extend(d,r),o.createElement(s,d,[o.createElement("div",{ref:function(e){e?t(e).append(i):a.$el.find(".tabPageHolder").append(i)}})])},_renderTabs:function(e){var a=this,s=A.Tabs,l=[],c=[];this.model.items.forEach((function(e){var t=a._getColorProperties(e),n=a.$el.find("#"+e.id+"_tab"),o=a._createTabPanel(e,n,t);l.push(o),c.push(o)}));var d=this.model.get("tabPosition"),h=this.model.get("tabIconPosition"),g=this,f=function(i){function r(t){_classCallCheck(this,r);var n=_possibleConstructorReturn(this,i.call(this,t));return n.state={selectedTab:g._getPanelId(e),tabs:l,editable:!1,vertical:!0,draggable:!1,addable:!1,deleteable:!1,placement:d||"top",linePosition:g._getDefaultLinePostion(d),tabIconPosition:h},n._tabsMirror=c,n._icons=g._icons,n.tabListNode=null,n.toolBarElementsList=[],n}return _inherits(r,i),r.prototype.componentDidUpdate=function(e,t){this._updatedTabs&&(this._updatedTabs=!1,this.state.tabs.length<this._tabsMirror.length&&g.deleteView(g._getModelIdFromPanel(n.difference(this._tabsMirror,this.state.tabs)[0].props.id))),this._tabsMirror=this.state.tabs.slice(),t.selectedTab!==this.state.selectedTab&&g.showView(g.model.findModel(g._getModelIdFromPanel(this.state.selectedTab)))},r.prototype.componentDidMount=function(){var e=g.$el.find(".ba-common-tabList");e.on("click.dbTab",g._tabClick.bind(g)),e.on("keydown.dbTab",g._tabKeydown.bind(g)),e.on("dblclick.dbTab",g._tabDoubleClick.bind(g)),this.tabListNode=e},r.prototype.componentWillUnmount=function(){var e=g.$el.find(".ba-common-tabList");e.off("click.dbTab"),e.off("keydown.dbTab"),e.off("dblckick.dbTab"),this.tabListNode=null,this.hasUnmounted=!0},r.prototype.updateTheme=function(){for(var e=[],t=0;t<this.state.tabs.length;t++){var n=g.model.items[t],i=g._getColorProperties(n);e.push(o.cloneElement(this.state.tabs[t],i))}this.setState({tabs:e})},r.prototype.editTabLabel=function(e,o){var i=this,r=!!e,A=void 0;(A=this.tabListNode?t(this.tabListNode):g.$el.find(".ba-common-tabList")).find("[role=tab][aria-selected=true]").focus(),this.setState({editable:r},(function(){if(r){var e=A.find("[contentEditable=true]"),a=g._getPanelId(o.id),s=void 0,l=n.find(i.state.tabs,(function(e){return a===e.props.id}));l&&(s=l.props.label);var c=new MutationObserver((function(){t.contains(g.$el,e)||(c.disconnect(),(e=A.find("[contentEditable=true]")).on("blur.dashboardtabs",(function(){e.off("blur.dashboardtabs"),i.setState({editable:!1},(function(){var e=n.find(i.state.tabs,(function(e){return a===e.props.id}));if(e){var t=e.props.label;s!==t&&g.updateViewLabel(o,t)}}))})),e.focus())}));c.observe(g.$el[0],{childList:!0,subtree:!0}),e.focus()}}))},r.prototype.updateTabLabel=function(e){for(var t=[],n=!1,i=g._getPanelId(e.id),r=0;r<this.state.tabs.length;r++){var A=this.state.tabs[r];A.props.id==i&&A.props.label!==e.get("title")?(t.push(o.cloneElement(A,{label:e.get("title")})),n=!0):t.push(A)}n&&this.setState({tabs:t})},r.prototype.updateTabIcon=function(e){for(var t=[],n=!1,i=g._getPanelId(e.id),r=0;r<this.state.tabs.length;r++){var A=this.state.tabs[r],a=e.get("tabIcon"),s=void 0;s=a&&"transparent"!==a?this._icons.getIcon(a).id:null,A.props.id!==i||A.props.icon===s||this.translationMode?t.push(A):(t.push(o.cloneElement(A,{icon:s})),n=!0)}n&&this.setState({tabs:t})},r.prototype.updateTranslationIcon=function(e,t){var n=g.dashboardApi.getFeature("Icons");this.translationMode=t;for(var i=[],r=!1,A=0,a=g._getPanelId(e.id),s=0;s<this.state.tabs.length;s++){var l=this.state.tabs[s];if(l.props.id==a){if(t)i.push(o.cloneElement(l,{icon:n.getIcon("warning").id,className:"translateIcon"})),r=!0,A++;else if(l.props.icon){var c=e.get("tabIcon");i.push(o.cloneElement(l,{icon:c?c.name:void 0,className:void 0})),r=!0,A++}}else i.push(l)}return r&&this.setState({tabs:i}),A},r.prototype.render=function(){var e=this,t=g._getColorProperties(),n=this.state.tabs;return n=n.map((function(t){return o.cloneElement(t,{iconPosition:e.state.tabIconPosition})})),g._TabsWidget=this,o.createElement("div",{className:"ba-theme-default",style:{}},[o.createElement(s,{draggable:this.state.draggable,selected:this.state.selectedTab,stateTabs:this.state.tabs,editable:this.state.editable,deleteable:this.state.deleteable,addable:this.state.addable,textDir:u.userPreferredTextDir,onChange:function(e){var t=g._getModelIdFromPanel(e);g.canvas.selectContent([t])},setState:function(t){e._updatedTabs=!0,e.setState({tabs:t})},onAddButtonClick:function(){return g.onAddClick()},onReorder:function(e,t){g.onReorder(n,e,t)},scrollButtonsBackgroundColor:g.colorsService.getLayoutBackgroundColorHex(g.model.get("fillColor")),scrollButtonsTextColor:t.textColor,onDeletePrompt:g.onDeletePrompt,placement:this.state.placement,linePosition:this.state.linePosition},n)])},r}(o.Component),p=r(f);i.render(o.createElement(p),this.$el.find(".tabCntr")[0])},_getPanelFromNode:function(e){if(e){var t=this.$el.find(".ba-common-tabList [role=tab]").index(e);if(t>-1)return this._TabsWidget.state.tabs[t]}return null},_getEventModelInfo:function(e){var n=this,o=void 0,i=t(e.target),r=i.closest("[role=tab]")[0],A=i.is("svg.is-clickable")&&i.closest("span").hasClass("close");if(r&&!A){var a=this._getPanelFromNode(r);if(a){var s=a.props.id;o={selected:this._TabsWidget.state.selectedTab===s,node:r,model:this.model.findModel(this._getModelIdFromPanel(s)),editing:function(){return n._TabsWidget.state.editable}}}}return o},_tabClick:function(e){var n=this;new d(e).setProperty("preventDefaultContextBar",!0);var o=this._getEventModelInfo(e);o&&o.selected&&!o.editing()&&setTimeout((function(){t(o.node).closest(".ba-common-tabList").length&&!o.editing()&&n.showToolbar(o.model,o.node)}),10)},_tabKeydown:function(e){var t=this._getEventModelInfo(e);t&&t.selected&&this._handleKeydown(t.model,e,t.node)},_tabDoubleClick:function(e){var n=this,o=this._getEventModelInfo(e);o&&o.selected&&!o.editing()&&setTimeout((function(){t(o.node).closest(".ba-common-tabList").length&&n.editViewTitle(o.model)}),50)},_attachView:function(){},onAddClick:function(){},onReorder:function(){},onDeletePrompt:function(e){var t=new c("none",s.get("tabDeleteDialogTitle"),s.get("tabDeleteDialogMessage"));t.setDialogOptions({buttons:[{text:s.get("tabDeleteDialogNoButton"),handler:t.cancel,type:"primary",defaultId:"no_button"},{text:s.get("tabDeleteDialogYesButton"),handler:t.ok,type:"secondary",defaultId:"yes_button"}]}),t.confirm(e)},deleteView:function(){},updateViewLabel:function(){},getSelectedSubViewId:function(){return this.selectedModel.id},onSelection:function(e){var t=this;e.info.value.forEach((function(e){var n=t.canvas,o=n.getContent(e);o&&"page"===o.getType()&&(t.selectedModel&&t.selectedModel.id!==e&&n.deselectContent([t.selectedModel.id]),t._TabsWidget.setState({selectedTab:t._getPanelId(e)}))}))},getSelectedSubViewTitle:function(){return this.selectedModel.get("title")},showView:function(e){var n=this._getViewId(e);if(this._currentViewId!==n){if(this.selectedModel){var o=this.layoutController.getLayoutView(this.selectedModel.id);o&&o.onHide()}return this.$el.find(".pageTabContent.selected").removeClass("selected"),t("#"+n,this.$el).addClass("selected"),this._currentViewId=n,this.selectedModel=e,this._TabsWidget.setState({selectedTab:this._getPanelId(this.selectedModel.id)}),this.eventRouter.trigger("tab:tabChanged",{modelId:this.selectedModel.id}),this.layoutController.getLayoutViewWhenReady(this.selectedModel.id).then(function(t){return t.onShow(),this._invokeLifeCycleHandlers("tabs.onShow",{$el:this.$el,model:e}).then(function(){}.bind(this))}.bind(this))}},_getLabelId:function(e){return e.id+"_tablabel"},_handleKeydown:function(){},showToolbar:function(){},editViewTitle:function(){},_showView:function(e){this.showView(e)},_getViewId:function(e){return e.id+"_tab"},_invokeLifeCycleHandlers:function(e,t){return this.dashboardApi.getDashboardSvc(".LifeCycleManager").then((function(n){return n.invokeLifeCycleHandlers(e,t)}))},applyTheme:function(){this._TabsWidget.updateTheme()},onTabAdded:function(e){var t=this;this._updateHideTabProperty();var n=this.canvas.getContent(e.info.newContentId).getFeature("state");return n.whenStatusChanges(n.STATUS.RENDERED).then((function(){t._TabsWidget.updateTheme(),t.eventRouter.trigger("properties:refreshPane")}))},onTabRemoved:function(){this._updateHideTabProperty(),this.eventRouter.trigger("properties:refreshPane")},_updateHideTabProperty:function(){if(!this.content.getPropertyValue("allowHidingMultipleTabs")){var e=this.model.items.length>1;this.eventRouter.trigger("properties:updateEnabled",{propertyName:"showTabsInPreview",enabled:!e}),e&&this.content.setPropertyValue("showTabsInPreview",!0)}},updateHideTabState:function(){var e=!this.model.get("hideTab");this.eventRouter.trigger("properties:setValue",{propertyName:"showTabsInPreview",value:e}),this.eventRouter.trigger("properties:updateEnabled",{propertyName:"tabPosition",enabled:e}),this.eventRouter.trigger("properties:updateEnabled",{propertyName:"tabIconPosition",enabled:e}),this.eventRouter.trigger("properties:updateEnabled",{propertyName:"tabTextColor",enabled:e}),this.eventRouter.trigger("properties:updateEnabled",{propertyName:"tabSelectedLineColor",enabled:e}),this.eventRouter.trigger("properties:updateEnabled",{propertyName:"tabBackgroundColor",enabled:e}),this.eventRouter.trigger("properties:updateEnabled",{propertyName:"tabRestoreDefaults",enabled:e}),this._setTabsVisibility()},updateTabPosition:function(e){if(this._TabsWidget&&e){var t=e.value||"top";this._TabsWidget.setState({placement:t,linePosition:this._getDefaultLinePostion(t)});var n={propertyName:"tabPosition",value:t};this.eventRouter.trigger("properties:setValue",n)}},updateTabIconPosition:function(e){if(this._TabsWidget&&e&&e.value){var t=e.value;this._TabsWidget.setState({tabIconPosition:t})}},setInitialEnabledState:function(){var e=!this.model.get("hideTab");this.eventRouter.trigger("properties:updateEnabled",{propertyName:"tabPosition",enabled:e}),this.eventRouter.trigger("properties:updateEnabled",{propertyName:"tabIconPosition",enabled:e}),this.eventRouter.trigger("properties:updateEnabled",{propertyName:"tabTextColor",enabled:e}),this.eventRouter.trigger("properties:updateEnabled",{propertyName:"tabSelectedLineColor",enabled:e}),this.eventRouter.trigger("properties:updateEnabled",{propertyName:"tabBackgroundColor",enabled:e}),this.eventRouter.trigger("properties:updateEnabled",{propertyName:"tabRestoreDefaults",enabled:e})},updateState:function(e){this._TabsWidget.hasUnmounted||this._TabsWidget.setState(e)},_onTabColorChange:function(e,t){var o=this.model,i={undoRedoTransactionId:n.uniqueId("layout_"+e+"Changed_")},r={};r[e]="transparent"==t.name?null:t.name,this.colorsService.prepareForColorModelChange(r,e),o.set(r,{sender:this.senderId,payloadData:i})},_getChangedPageColorPropertyList:function(e){return g.filter((function(t){return e.get(t.modelPropertyName)}))},_setTabsVisibility:function(){var e=!this.content.getPropertyValue("showTabsInPreview")&&!this._dashboardState.getUiState().authoring;this.$el.toggleClass("tabsHidden",e)}})})),define("dashboard-core/js/dashboard/layout/views/GenericPage",["./LayoutBaseView","jquery"],(function(e,t){var n=e.extend({aspectRatio:0,init:function(){n.inherited("init",this,arguments),this.layoutController.topLayoutModel.on("change:pageSize",this._onChangePageSize,this),this.layoutController.topLayoutModel.on("change:fitPage",this._onFitPage,this),this.layoutController.topLayoutModel.on("change:layoutPositioning",this._onChangeLayoutPositioning,this),this._setPageLayoutStyling()},destroy:function(){this.layoutController.topLayoutModel.off("change:pageSize",this._onChangePageSize,this),this.layoutController.topLayoutModel.off("change:fitPage",this._onFitPage,this),this.layoutController.topLayoutModel.off("change:layoutPositioning",this._onChangeLayoutPositioning,this);var e=this.layoutController.topLayoutModel.findDescendantsWithType("genericPage");0===e.length&&this._clearPageSize(),n.inherited("destroy",this,arguments)},onShow:function(){n.inherited("onShow",this,arguments),this.$el.is(":visible")&&(this._setPageFitStyling(),this._applyPageSize(),this._setPageLayoutStyling())},_applyPageSize:function(){var e=this._getLayoutPositioning();if("absolute"===e){var t=this.model.getValueFromSelfOrParent("pageSize");this._setAbsolutePageSize(t)}else if("relative"===e){var n=this.model.getValueFromSelfOrParent("pageSize");this._setRelativeAspectRatio(n)}},_clearPageSize:function(e){var t=e||this._getLayoutPositioning();"absolute"===t?this.$el.css({width:"",height:""}):"relative"===t&&this._removeDynamicStyles("dashboardRelativeAspectRatio")},_getLayoutPositioning:function(){return this.model.getLayoutPositioning(!1)},_onChangePageSize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.$el.is(":visible")&&(this._clearPageSize(e.prevValue),this._applyPageSize())},_onFitPage:function(){this.$el.is(":visible")&&(this._setPageFitStyling(),this._onChangePageSize()),this.onResize()},_onChangeLayoutPositioning:function(e){this._clearPageSize(e.prevValue),this.$el.is(":visible")&&(this._setPageLayoutStyling(),this._setPageFitStyling(),this._applyPageSize()),this.onResize()},_setPageFitStyling:function(){var e="relative"===this._getLayoutPositioning()&&this.getFitPage();this.$el.toggleClass("fitToPage",e)},_setPageLayoutStyling:function(){var e="relative"===this._getLayoutPositioning();this.$el.toggleClass("templateBox",e)},_setAbsolutePageSize:function(e){this.$el.width(e.width),this.$el.height(e.height)},_setRelativeAspectRatio:function(e){this.aspectRatio=e.height/e.width,this.getFitPage()?this._addAspectRatioForFitToPage():this._createStyleNode(".aspectRatio_default:before { padding-top:"+100*this.aspectRatio+"%; }","dashboardRelativeAspectRatio")},onResize:function(){if(this.$el.is(":visible")){var e=this.getFitPage();e&&this._addAspectRatioForFitToPage()}n.inherited("onResize",this,arguments)},_addAspectRatioForFitToPage:function(){var e=this.$el.parent().height(),t=this.$el.parent().width(),n=".page.pagecontainer .pagegenericPage { width: "+t+"px; height:"+this.aspectRatio*t+"px; max-height: "+e+"px; max-width:"+1/this.aspectRatio*e+"px;}";this._createStyleNode(n,"dashboardRelativeAspectRatio")},_createStyleNode:function(e,n){if(t("#"+n).html()!==e){this._removeDynamicStyles(n);var o=t('<style class=\'dashboardLayoutStyles\' type="text/css" id="'+n+'"></style>');o.html(e),o.appendTo("head")}},_removeDynamicStyles:function(e){t("#"+e).remove()}});return n})),define("dashboard-core/js/dashboard/layout/views/SinglePage",["./LayoutBaseView"],(function(e){var t=null;return t=e.extend({init:function(){t.inherited("init",this,arguments),this.layoutController.layoutReady(this.model.id).done(function(){this.layoutController.getLayoutView(this.model.id).onShow()}.bind(this))},getSelectedLayout:function(){return this.model.items[0]}})})),define("dashboard-core/js/dashboard/layout/views/all",["./LayoutBaseView","./Tab","./GenericPage","./SinglePage"],(function(){})),function(e){"function"==typeof define&&define.amd?define("dashboard-core/js/lib/@waca/textwidget/dist/summernote",["jquery"],e):"object"==typeof module&&module.exports?module.exports=e(require("jquery")):e(window.jQuery)}((function($){"use strict";var func=(idCounter=0,{eq:function(e){return function(t){return e===t}},eq2:function(e,t){return e===t},peq2:function(e){return function(t,n){return t[e]===n[e]}},ok:function(){return!0},fail:function(){return!1},self:function(e){return e},not:function(e){return function(){return!e.apply(e,arguments)}},and:function(e,t){return function(n){return e(n)&&t(n)}},invoke:function(e,t){return function(){return e[t].apply(e,arguments)}},uniqueId:function(e){var t=++idCounter+"";return e?e+t:t},rect2bnd:function(e){var t=$(document);return{top:e.top+t.scrollTop(),left:e.left+t.scrollLeft(),width:e.right-e.left,height:e.bottom-e.top}},invertObject:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t},namespaceToCamel:function(e,t){return(t=t||"")+e.split(".").map((function(e){return e.substring(0,1).toUpperCase()+e.substring(1)})).join("")},debounce:function(e,t,n){var o;return function(){var i=this,r=arguments,A=function(){o=null,n||e.apply(i,r)},a=n&&!o;clearTimeout(o),o=setTimeout(A,t),a&&e.apply(i,r)}}}),idCounter,list=(head=function(e){return e[0]},last=function(e){return e[e.length-1]},tail=function(e){return e.slice(1)},indexOf=function(e,t){return $.inArray(t,e)},contains=function(e,t){return-1!==indexOf(e,t)},{head:head,last:last,initial:function(e){return e.slice(0,e.length-1)},tail:tail,prev:function(e,t){var n=indexOf(e,t);return-1===n?null:e[n-1]},next:function(e,t){var n=indexOf(e,t);return-1===n?null:e[n+1]},find:function(e,t){for(var n=0,o=e.length;n<o;n++){var i=e[n];if(t(i))return i}},contains:contains,all:function(e,t){for(var n=0,o=e.length;n<o;n++)if(!t(e[n]))return!1;return!0},sum:function(e,t){return t=t||func.self,e.reduce((function(e,n){return e+t(n)}),0)},from:function(e){for(var t=[],n=-1,o=e.length;++n<o;)t[n]=e[n];return t},isEmpty:function(e){return!e||!e.length},clusterBy:function(e,t){return e.length?tail(e).reduce((function(e,n){var o=last(e);return t(last(o),n)?o[o.length]=n:e[e.length]=[n],e}),[[head(e)]]):[]},compact:function(e){for(var t=[],n=0,o=e.length;n<o;n++)e[n]&&t.push(e[n]);return t},unique:function(e){for(var t=[],n=0,o=e.length;n<o;n++)contains(t,e[n])||t.push(e[n]);return t}}),head,last,tail,indexOf,contains,isSupportAmd="function"==typeof define&&define.amd,isFontInstalled=function(e){var t="Comic Sans MS"===e?"Courier New":"Comic Sans MS",n=$("<div>").css({position:"absolute",left:"-9999px",top:"-9999px",fontSize:"200px"}).text("mmmmmmmmmwwwwwww").appendTo(document.body),o=n.css("fontFamily",t).width(),i=n.css("fontFamily",e+","+t).width();return n.remove(),o!==i},userAgent=navigator.userAgent,isMSIE=/MSIE|Trident/i.test(userAgent),browserVersion;if(isMSIE){var matches=/MSIE (\d+[.]\d+)/.exec(userAgent);matches&&(browserVersion=parseFloat(matches[1])),matches=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(userAgent),matches&&(browserVersion=parseFloat(matches[1]))}var isEdge=/Edge\/\d+/.test(userAgent),hasCodeMirror=!!window.CodeMirror;if(!hasCodeMirror&&isSupportAmd&&"undefined"!=typeof require)if(void 0!==require.resolve)try{require.resolve("codemirror"),hasCodeMirror=!0}catch(e){}else void 0!==eval("require").specified&&(hasCodeMirror=eval("require").specified("codemirror"));var agent={isMac:navigator.appVersion.indexOf("Mac")>-1,isMSIE:isMSIE,isEdge:isEdge,isFF:!isEdge&&/firefox/i.test(userAgent),isPhantom:/PhantomJS/i.test(userAgent),isWebkit:!isEdge&&/webkit/i.test(userAgent),isChrome:!isEdge&&/chrome/i.test(userAgent),isSafari:!isEdge&&/safari/i.test(userAgent),browserVersion:browserVersion,jqueryVersion:parseFloat($.fn.jquery),isSupportAmd:isSupportAmd,hasCodeMirror:hasCodeMirror,isFontInstalled:isFontInstalled,isW3CRangeSupport:!!document.createRange},NBSP_CHAR=String.fromCharCode(160),ZERO_WIDTH_NBSP_CHAR="\ufeff",dom=(isEditable=function(e){return e&&$(e).hasClass("note-editable")},makePredByNodeName=function(e){return e=e.toUpperCase(),function(t){return t&&t.nodeName.toUpperCase()===e&&!((n=t.className)&&-1!==n.toUpperCase().indexOf("TEXTFITTED"));var n}},isText=function(e){return e&&3===e.nodeType},isVoid=function(e){return e&&/^BR|^IMG|^HR|^IFRAME|^BUTTON/.test(e.nodeName.toUpperCase())},isPara=function(e){return!isEditable(e)&&e&&/^DIV|^P|^LI|^H[1-7]/.test(e.nodeName.toUpperCase())},isPre=makePredByNodeName("PRE"),isLi=makePredByNodeName("LI"),isTable=makePredByNodeName("TABLE"),isData=makePredByNodeName("DATA"),isInline=function(e){return!(isBodyContainer(e)||isList(e)||isHr(e)||isPara(e)||isTable(e)||isBlockquote(e)||isData(e))},isList=function(e){return e&&/^UL|^OL/.test(e.nodeName.toUpperCase())},isHr=makePredByNodeName("HR"),isCell=function(e){return e&&/^TD|^TH/.test(e.nodeName.toUpperCase())},isBlockquote=makePredByNodeName("BLOCKQUOTE"),isBodyContainer=function(e){return isCell(e)||isBlockquote(e)||isEditable(e)},isAnchor=makePredByNodeName("A"),isBody=makePredByNodeName("BODY"),blankHTML=agent.isMSIE&&agent.browserVersion<11?"&nbsp;":"<br>",nodeLength=function(e){return isText(e)?e.nodeValue.length:e?e.childNodes.length:0},isEmpty=function(e){var t=nodeLength(e);return 0===t||!(isText(e)||1!==t||e.innerHTML!==blankHTML&&e.firstChild.innerHTML!==blankHTML)||!(!list.all(e.childNodes,isText)||""!==e.innerHTML)},paddingBlankHTML=function(e){isVoid(e)||nodeLength(e)||(e.innerHTML=blankHTML)},ancestor=function(e,t){for(;e;){if(t(e))return e;if(isEditable(e))break;e=e.parentNode}return null},listAncestor=function(e,t){t=t||func.fail;var n=[];return ancestor(e,(function(e){return isEditable(e)||n.push(e),t(e)})),n},listNext=function(e,t){t=t||func.fail;for(var n=[];e&&!t(e);)n.push(e),e=e.nextSibling;return n},insertAfter=function(e,t){var n=t.nextSibling,o=t.parentNode;return n?o.insertBefore(e,n):o.appendChild(e),e},appendChildNodes=function(e,t){return $.each(t,(function(t,n){e.appendChild(n)})),e},isLeftEdgePoint=function(e){return 0===e.offset},isRightEdgePoint=function(e){return e.offset===nodeLength(e.node)},isEdgePoint=function(e){return isLeftEdgePoint(e)||isRightEdgePoint(e)},isLeftEdgeOf=function(e,t){for(;e&&e!==t;){if(0!==position(e))return!1;e=e.parentNode}return!0},isRightEdgeOf=function(e,t){if(!t)return!1;for(;e&&e!==t;){if(position(e)!==nodeLength(e.parentNode)-1)return!1;e=e.parentNode}return!0},position=function(e){for(var t=0;e=e.previousSibling;)t+=1;return t},hasChildren=function(e){return!!(e&&e.childNodes&&e.childNodes.length)},prevPoint=function(e,t){var n,o;if(0===e.offset){if(isEditable(e.node))return null;n=e.node.parentNode,o=position(e.node)}else hasChildren(e.node)?(n=e.node.childNodes[e.offset-1],o=nodeLength(n)):(n=e.node,o=t?0:e.offset-1);return{node:n,offset:o}},nextPoint=function(e,t){var n,o;if(nodeLength(e.node)===e.offset){if(isEditable(e.node))return null;n=e.node.parentNode,o=position(e.node)+1}else hasChildren(e.node)?(n=e.node.childNodes[e.offset],o=0):(n=e.node,o=t?nodeLength(e.node):e.offset+1);return{node:n,offset:o}},isSamePoint=function(e,t){return e.node===t.node&&e.offset===t.offset},splitNode=function(e,t){var n=t&&t.isSkipPaddingBlankHTML,o=t&&t.isNotSplitEdgePoint;if(isEdgePoint(e)&&(isText(e.node)||o)){if(isLeftEdgePoint(e))return e.node;if(isRightEdgePoint(e))return e.node.nextSibling}if(isText(e.node))return e.node.splitText(e.offset);var i=e.node.childNodes[e.offset],r=insertAfter(e.node.cloneNode(!1),e.node);return appendChildNodes(r,listNext(i)),n||(paddingBlankHTML(e.node),paddingBlankHTML(r)),r},splitTree=function(e,t,n){var o=listAncestor(t.node,func.eq(e));return o.length?1===o.length?splitNode(t,n):o.reduce((function(e,o){return e===t.node&&(e=splitNode(t,n)),splitNode({node:o,offset:e?dom.position(e):nodeLength(o)},n)})):null},create=function(e){return document.createElement(e)},remove=function(e,t){if(e&&e.parentNode){if(e.removeNode)return e.removeNode(t);var n=e.parentNode;if(!t){var o,i,r=[];for(o=0,i=e.childNodes.length;o<i;o++)r.push(e.childNodes[o]);for(o=0,i=r.length;o<i;o++)n.insertBefore(r[o],e)}n.removeChild(e)}},isTextarea=makePredByNodeName("TEXTAREA"),value=function(e,t){var n=isTextarea(e[0])?e.val():e.html();return t?n.replace(/[\n\r]/g,""):n},{NBSP_CHAR:NBSP_CHAR,ZERO_WIDTH_NBSP_CHAR:ZERO_WIDTH_NBSP_CHAR,blank:blankHTML,emptyPara:"<p>"+blankHTML+"</p>",makePredByNodeName:makePredByNodeName,isEditable:isEditable,isControlSizing:function(e){return e&&$(e).hasClass("note-control-sizing")},isText:isText,isElement:function(e){return e&&1===e.nodeType},isVoid:isVoid,isPara:isPara,isPurePara:function(e){return isPara(e)&&!isLi(e)},isHeading:function(e){return e&&/^H[1-7]/.test(e.nodeName.toUpperCase())},isInline:isInline,isBlock:func.not(isInline),isBodyInline:function(e){return isInline(e)&&!ancestor(e,isPara)},isBody:isBody,isParaInline:function(e){return isInline(e)&&!!ancestor(e,isPara)},isPre:isPre,isList:isList,isTable:isTable,isData:isData,isCell:isCell,isBlockquote:isBlockquote,isBodyContainer:isBodyContainer,isAnchor:isAnchor,isDiv:makePredByNodeName("DIV"),isLi:isLi,isBR:makePredByNodeName("BR"),isSpan:makePredByNodeName("SPAN"),isB:makePredByNodeName("B"),isU:makePredByNodeName("U"),isS:makePredByNodeName("S"),isI:makePredByNodeName("I"),isImg:makePredByNodeName("IMG"),isTextarea:isTextarea,isEmpty:isEmpty,isEmptyAnchor:func.and(isAnchor,isEmpty),isClosestSibling:function(e,t){return e.nextSibling===t||e.previousSibling===t},withClosestSiblings:function(e,t){t=t||func.ok;var n=[];return e.previousSibling&&t(e.previousSibling)&&n.push(e.previousSibling),n.push(e),e.nextSibling&&t(e.nextSibling)&&n.push(e.nextSibling),n},nodeLength:nodeLength,isLeftEdgePoint:isLeftEdgePoint,isRightEdgePoint:isRightEdgePoint,isEdgePoint:isEdgePoint,isLeftEdgeOf:isLeftEdgeOf,isRightEdgeOf:isRightEdgeOf,isLeftEdgePointOf:function(e,t){return isLeftEdgePoint(e)&&isLeftEdgeOf(e.node,t)},isRightEdgePointOf:function(e,t){return isRightEdgePoint(e)&&isRightEdgeOf(e.node,t)},prevPoint:prevPoint,nextPoint:nextPoint,isSamePoint:isSamePoint,isVisiblePoint:function(e){if(isText(e.node)||!hasChildren(e.node)||isEmpty(e.node))return!0;var t=e.node.childNodes[e.offset-1],n=e.node.childNodes[e.offset];return!(t&&!isVoid(t)||n&&!isVoid(n))},prevPointUntil:function(e,t){for(;e;){if(t(e))return e;e=prevPoint(e)}return null},nextPointUntil:function(e,t){for(;e;){if(t(e))return e;e=nextPoint(e)}return null},isCharPoint:function(e){if(!isText(e.node))return!1;var t=e.node.nodeValue.charAt(e.offset-1);return t&&" "!==t&&t!==NBSP_CHAR},walkPoint:function(e,t,n,o){for(var i=e;i&&(n(i),!isSamePoint(i,t));){var r=o&&e.node!==i.node&&t.node!==i.node;i=nextPoint(i,r)}},ancestor:ancestor,singleChildAncestor:function(e,t){for(e=e.parentNode;e&&1===nodeLength(e);){if(t(e))return e;if(isEditable(e))break;e=e.parentNode}return null},listAncestor:listAncestor,lastAncestor:function(e,t){var n=listAncestor(e);return list.last(n.filter(t))},listNext:listNext,listPrev:function(e,t){t=t||func.fail;for(var n=[];e&&!t(e);)n.push(e),e=e.previousSibling;return n},listDescendant:function(e,t){var n=[];return t=t||func.ok,function o(i){e!==i&&t(i)&&n.push(i);for(var r=0,A=i.childNodes.length;r<A;r++)o(i.childNodes[r])}(e),n},commonAncestor:function(e,t){for(var n=listAncestor(e),o=t;o;o=o.parentNode)if($.inArray(o,n)>-1)return o;return null},wrap:function(e,t){var n=e.parentNode,o=$("<"+t+">")[0];return n.insertBefore(o,e),o.appendChild(e),o},insertAfter:insertAfter,appendChildNodes:appendChildNodes,position:position,hasChildren:hasChildren,makeOffsetPath:function(e,t){return listAncestor(t,func.eq(e)).map(position).reverse()},fromOffsetPath:function(e,t){for(var n=e,o=0,i=t.length;o<i;o++)n=n.childNodes.length<=t[o]?n.childNodes[n.childNodes.length-1]:n.childNodes[t[o]];return n},splitTree:splitTree,splitPoint:function(e,t){var n,o,i=t?isPara:isBodyContainer,r=listAncestor(e.node,i),A=list.last(r)||e.node;i(A)?(n=r[r.length-2],o=A):o=(n=A).parentNode;var a=n&&splitTree(n,e,{isSkipPaddingBlankHTML:t,isNotSplitEdgePoint:t});return a||o!==e.node||(a=e.node.childNodes[e.offset]),{rightNode:a,container:o}},create:create,createText:function(e){return document.createTextNode(e)},remove:remove,removeWhile:function(e,t){for(;e&&!isEditable(e)&&t(e);){var n=e.parentNode;remove(e),e=n}},replace:function(e,t){if(e.nodeName.toUpperCase()===t.toUpperCase())return e;var n=create(t);return e.style.cssText&&(n.style.cssText=e.style.cssText),appendChildNodes(n,list.from(e.childNodes)),insertAfter(n,e),remove(e),n},html:function(e,t){var n=value(e);return t&&(n=n.replace(/<(\/?)(\b(?!!)[^>\s]*)(.*?)(\s*\/?>)/g,(function(e,t,n){n=n.toUpperCase();var o=/^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(n)&&!!t,i=/^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(n);return e+(o||i?"\n":"")})),n=$.trim(n)),n},value:value,posFromPlaceholder:function(e){var t=$(e),n=t.offset(),o=t.outerHeight(!0);return{left:n.left,top:n.top+o}},attachEvents:function(e,t){Object.keys(t).forEach((function(n){e.on(n,t[n])}))},detachEvents:function(e,t){Object.keys(t).forEach((function(n){e.off(n,t[n])}))}}),isEditable,makePredByNodeName,isText,isVoid,isPara,isPre,isLi,isTable,isData,isInline,isList,isHr,isCell,isBlockquote,isBodyContainer,isAnchor,isBody,blankHTML,nodeLength,isEmpty,paddingBlankHTML,ancestor,listAncestor,listNext,insertAfter,appendChildNodes,isLeftEdgePoint,isRightEdgePoint,isEdgePoint,isLeftEdgeOf,isRightEdgeOf,position,hasChildren,prevPoint,nextPoint,isSamePoint,splitNode,splitTree,create,remove,isTextarea,value,Context=function(e,t){var n=this,o=$.summernote.ui;return this.memos={},this.modules={},this.layoutInfo={},this.options=t,this.initialize=function(){return this.layoutInfo=o.createLayout(e,t),this._initialize(),e.hide(),this},this.destroy=function(){this._destroy(),e.removeData("summernote"),o.removeLayout(e,this.layoutInfo)},this.reset=function(){var e=n.isDisabled();this.code(dom.emptyPara),this._destroy(),this._initialize(),e&&n.disable()},this._initialize=function(){var e=$.extend({},this.options.buttons);Object.keys(e).forEach((function(t){n.memo("button."+t,e[t])}));var t=$.extend({},this.options.modules,$.summernote.plugins||{});Object.keys(t).forEach((function(e){n.module(e,t[e],!0)})),Object.keys(this.modules).forEach((function(e){n.initializeModule(e)}))},this._destroy=function(){Object.keys(this.modules).reverse().forEach((function(e){n.removeModule(e)})),Object.keys(this.memos).forEach((function(e){n.removeMemo(e)})),this.triggerEvent("destroy",this)},this.code=function(t){var n=this.invoke("codeview.isActivated");if(void 0===t)return this.invoke("codeview.sync"),n?this.layoutInfo.codable.val():this.layoutInfo.editable.html();n?this.layoutInfo.codable.val(t):this.layoutInfo.editable.html(t),e.val(t),this.triggerEvent("change",t)},this.isDisabled=function(){return"false"===this.layoutInfo.editable.attr("contenteditable")},this.enable=function(){this.layoutInfo.editable.attr("contenteditable",!0),this.invoke("toolbar.activate",!0)},this.disable=function(){this.invoke("codeview.isActivated")&&this.invoke("codeview.deactivate"),this.layoutInfo.editable.attr("contenteditable",!1),this.invoke("toolbar.deactivate",!0)},this.triggerEvent=function(){var t=list.head(arguments),n=list.tail(list.from(arguments)),o=this.options.callbacks[func.namespaceToCamel(t,"on")];o&&o.apply(e[0],n),e.trigger("summernote."+t,n)},this.initializeModule=function(t){var n=this.modules[t];n.shouldInitialize=n.shouldInitialize||func.ok,n.shouldInitialize()&&(n.initialize&&n.initialize(),n.events&&dom.attachEvents(e,n.events))},this.module=function(e,t,n){if(1===arguments.length)return this.modules[e];this.modules[e]=new t(this),n||this.initializeModule(e)},this.removeModule=function(t){var n=this.modules[t];n.shouldInitialize()&&(n.events&&dom.detachEvents(e,n.events),n.destroy&&n.destroy()),delete this.modules[t]},this.memo=function(e,t){if(1===arguments.length)return this.memos[e];this.memos[e]=t},this.removeMemo=function(e){this.memos[e]&&this.memos[e].destroy&&this.memos[e].destroy(),delete this.memos[e]},this.createInvokeHandler=function(e,t){return function(o){o.preventDefault(),n.invoke(e,t||$(o.target).closest("[data-value]").data("value"))}},this.invoke=function(){var e=list.head(arguments),t=list.tail(list.from(arguments)),n=e.split("."),o=n.length>1,i=o&&list.head(n),r=o?list.last(n):list.head(n),A=this.modules[i||"editor"];return!i&&this[r]?this[r].apply(this,t):A&&A[r]&&A.shouldInitialize()?A[r].apply(A,t):void 0},this.initialize()};$.fn.extend({summernote:function(){var e=$.type(list.head(arguments)),t="string"===e,n="object"===e,o=n?list.head(arguments):{};(o=$.extend({},$.summernote.options,o)).langInfo=$.extend(!0,{},$.summernote.lang["en-US"],$.summernote.lang[o.lang]),o.icons=$.extend(!0,{},$.summernote.options.icons,o.icons),this.each((function(e,t){var n=$(t);if(!n.data("summernote")){var i=new Context(n,o);n.data("summernote",i),n.data("summernote").triggerEvent("init",i.layoutInfo)}}));var i=this.first();if(i.length){var r=i.data("summernote");if(t)return r.invoke.apply(r,list.from(arguments));o.focus&&r.invoke("editor.focus")}return this}});var Renderer=function(e,t,n,o){this.render=function(i){var r=$(e);if(n&&n.contents&&r.html(n.contents),n&&n.className&&r.addClass(n.className),n&&n.data&&$.each(n.data,(function(e,t){r.attr("data-"+e,t)})),n&&n.click&&r.on("click",n.click),t){var A=r.find(".note-children-container");t.forEach((function(e){e.render(A.length?A:r)}))}return o&&o(r,n),n&&n.callback&&n.callback(r),i&&i.append(r),r}},renderer={create:function(e,t){return function(){var n=$.isArray(arguments[0])?arguments[0]:[],o="object"==typeof arguments[1]?arguments[1]:arguments[0];return o&&o.children&&(n=o.children),new Renderer(e,n,o,t)}}},editor=renderer.create('<div class="note-editor note-frame panel panel-default"/>'),toolbar=renderer.create('<div class="note-toolbar panel-heading"/>'),editingArea=renderer.create('<div class="note-editing-area"/>'),codable=renderer.create('<textarea class="note-codable"/>'),editable=renderer.create('<div class="note-editable panel-body" contentEditable="true"/>'),statusbar=renderer.create(['<div class="note-statusbar">',' <div class="note-resizebar">',' <div class="note-icon-bar"/>',' <div class="note-icon-bar"/>',' <div class="note-icon-bar"/>'," </div>","</div>"].join("")),airEditor=renderer.create('<div class="note-editor"/>'),airEditable=renderer.create('<div class="note-editable" contentEditable="true"/>'),buttonGroup=renderer.create('<div class="note-btn-group btn-group">'),button=renderer.create('<button type="button" class="note-btn btn btn-default btn-sm" tabindex="-1">',(function(e,t){t&&t.tooltip&&e.attr({title:t.tooltip}).tooltip({container:"body",trigger:"hover",placement:"bottom"})})),dropdown=renderer.create('<div class="dropdown-menu">',(function(e,t){var n=$.isArray(t.items)?t.items.map((function(e){return'<li><a href="#" data-value="'+("string"==typeof e?e:e.value||"")+'">'+(t.template?t.template(e):e)+"</a></li>"})).join(""):t.items;e.html(n)})),dropdownCheck=renderer.create('<div class="dropdown-menu note-check">',(function(e,t){var n=$.isArray(t.items)?t.items.map((function(e){var n="string"==typeof e?e:e.value||"",o=t.template?t.template(e):e;return'<li><a href="#" data-value="'+n+'">'+icon(t.checkClassName)+" "+o+"</a></li>"})).join(""):t.items;e.html(n)})),palette=renderer.create('<div class="note-color-palette"/>',(function(e,t){for(var n=[],o=0,i=t.colors.length;o<i;o++){for(var r=t.eventName,A=t.colors[o],a=[],s=0,l=A.length;s<l;s++){var c=A[s];a.push(['<button type="button" class="note-color-btn"','style="background-color:',c,'" ','data-event="',r,'" ','data-value="',c,'" ','title="',c,'" ','data-toggle="button" tabindex="-1"></button>'].join(""))}n.push('<div class="note-color-row">'+a.join("")+"</div>")}e.html(n.join("")),e.find(".note-color-btn").tooltip({container:"body",trigger:"hover",placement:"bottom"})})),dialog=renderer.create('<div class="modal" aria-hidden="false" tabindex="-1"/>',(function(e,t){t.fade&&e.addClass("fade"),e.html(['<div class="modal-dialog">',' <div class="modal-content">',t.title?' <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title">'+t.title+"</h4> </div>":"",' <div class="modal-body">'+t.body+"</div>",t.footer?' <div class="modal-footer">'+t.footer+"</div>":""," </div>","</div>"].join(""))})),popover=renderer.create(['<div class="note-popover popover in">',' <div class="arrow"/>',' <div class="popover-content note-children-container"/>',"</div>"].join(""),(function(e,t){var n=void 0!==t.direction?t.direction:"bottom";e.addClass(n),t.hideArrow&&e.find(".arrow").hide()})),icon=function(e,t){return"<"+(t=t||"i")+' class="'+e+'"/>'},ui={editor:editor,toolbar:toolbar,editingArea:editingArea,codable:codable,editable:editable,statusbar:statusbar,airEditor:airEditor,airEditable:airEditable,buttonGroup:buttonGroup,button:button,dropdown:dropdown,dropdownCheck:dropdownCheck,palette:palette,dialog:dialog,popover:popover,icon:icon,toggleBtn:function(e,t){e.toggleClass("disabled",!t),e.attr("disabled",!t)},toggleBtnActive:function(e,t){e.toggleClass("active",t)},onDialogShown:function(e,t){e.one("shown.bs.modal",t)},onDialogHidden:function(e,t){e.one("hidden.bs.modal",t)},showDialog:function(e){e.modal("show")},hideDialog:function(e){e.modal("hide")},createLayout:function(e,t){var n=(t.airMode?ui.airEditor([ui.editingArea([ui.airEditable()])]):ui.editor([ui.toolbar(),ui.editingArea([ui.codable(),ui.editable()]),ui.statusbar()])).render();return n.insertAfter(e),{note:e,editor:n,toolbar:n.find(".note-toolbar"),editingArea:n.find(".note-editing-area"),editable:n.find(".note-editable"),codable:n.find(".note-codable"),statusbar:n.find(".note-statusbar")}},removeLayout:function(e,t){e.html(t.editable.html()),t.editor.remove(),e.show()}};$.summernote=$.summernote||{lang:{}},$.extend($.summernote.lang,{"en-US":{font:{bold:"Bold",italic:"Italic",underline:"Underline",clear:"Remove Font Style",height:"Line Height",name:"Font Family",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript",size:"Font Size"},image:{image:"Picture",insert:"Insert Image",resizeFull:"Resize Full",resizeHalf:"Resize Half",resizeQuarter:"Resize Quarter",floatLeft:"Float Left",floatRight:"Float Right",floatNone:"Float None",shapeRounded:"Shape: Rounded",shapeCircle:"Shape: Circle",shapeThumbnail:"Shape: Thumbnail",shapeNone:"Shape: None",dragImageHere:"Drag image or text here",dropImage:"Drop image or Text",selectFromFiles:"Select from files",maximumFileSize:"Maximum file size",maximumFileSizeError:"Maximum file size exceeded.",url:"Image URL",remove:"Remove Image"},video:{video:"Video",videoLink:"Video Link",insert:"Insert Video",url:"Video URL?",providers:"(YouTube, Vimeo, Vine, Instagram, DailyMotion or Youku)"},link:{link:"Link",insert:"Insert Link",unlink:"Unlink",edit:"Edit",textToDisplay:"Text to display",url:"To what URL should this link go?",openInNewWindow:"Open in new window"},table:{table:"Table"},hr:{insert:"Insert Horizontal Rule"},style:{style:"Style",p:"Normal",blockquote:"Quote",pre:"Code",h1:"Header 1",h2:"Header 2",h3:"Header 3",h4:"Header 4",h5:"Header 5",h6:"Header 6"},lists:{unordered:"Unordered list",ordered:"Ordered list"},options:{help:"Help",fullscreen:"Full Screen",codeview:"Code View"},paragraph:{paragraph:"Paragraph",outdent:"Outdent",indent:"Indent",left:"Align left",center:"Align center",right:"Align right",justify:"Justify full"},color:{recent:"Recent Color",more:"More Color",background:"Background Color",foreground:"Foreground Color",transparent:"Transparent",setTransparent:"Set transparent",reset:"Reset",resetToDefault:"Reset to default"},shortcut:{shortcuts:"Keyboard shortcuts",close:"Close",textFormatting:"Text formatting",action:"Action",paragraphFormatting:"Paragraph formatting",documentStyle:"Document Style",extraKeys:"Extra keys"},help:{insertParagraph:"Insert Paragraph",undo:"Undoes the last command",redo:"Redoes the last command",tab:"Tab",untab:"Untab",bold:"Set a bold style",italic:"Set a italic style",underline:"Set a underline style",strikethrough:"Set a strikethrough style",removeFormat:"Clean a style",justifyLeft:"Set left align",justifyCenter:"Set center align",justifyRight:"Set right align",justifyFull:"Set full align",insertUnorderedList:"Toggle unordered list",insertOrderedList:"Toggle ordered list",outdent:"Outdent on current paragraph",indent:"Indent on current paragraph",formatPara:"Change current block's format as a paragraph(P tag)",formatH1:"Change current block's format as H1",formatH2:"Change current block's format as H2",formatH3:"Change current block's format as H3",formatH4:"Change current block's format as H4",formatH5:"Change current block's format as H5",formatH6:"Change current block's format as H6",insertHorizontalRule:"Insert horizontal rule","linkDialog.show":"Show Link Dialog"},history:{undo:"Undo",redo:"Redo"},specialChar:{specialChar:"SPECIAL CHARACTERS",select:"Select Special characters"}}});var key=(keyMap={BACKSPACE:8,TAB:9,ENTER:13,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,NUM0:48,NUM1:49,NUM2:50,NUM3:51,NUM4:52,NUM5:53,NUM6:54,NUM7:55,NUM8:56,B:66,E:69,I:73,J:74,K:75,L:76,R:82,S:83,U:85,V:86,Y:89,Z:90,SLASH:191,LEFTBRACKET:219,BACKSLASH:220,RIGHTBRACKET:221},{isEdit:function(e){return list.contains([keyMap.BACKSPACE,keyMap.TAB,keyMap.ENTER,keyMap.SPACE],e)},isMove:function(e){return list.contains([keyMap.LEFT,keyMap.UP,keyMap.RIGHT,keyMap.DOWN],e)},nameFromCode:func.invertObject(keyMap),code:keyMap}),keyMap,range=(textRangeToPoint=function(e,t){var n,o,i=e.parentElement(),r=document.body.createTextRange(),A=list.from(i.childNodes);for(n=0;n<A.length;n++)if(!dom.isText(A[n])){if(r.moveToElementText(A[n]),r.compareEndPoints("StartToStart",e)>=0)break;o=A[n]}if(0!==n&&dom.isText(A[n-1])){var a=document.body.createTextRange(),s=null;a.moveToElementText(o||i),a.collapse(!o),s=o?o.nextSibling:i.firstChild;var l=e.duplicate();l.setEndPoint("StartToStart",a);for(var c=l.text.replace(/[\r\n]/g,"").length;c>s.nodeValue.length&&s.nextSibling;)c-=s.nodeValue.length,s=s.nextSibling;s.nodeValue,t&&s.nextSibling&&dom.isText(s.nextSibling)&&c===s.nodeValue.length&&(c-=s.nodeValue.length,s=s.nextSibling),i=s,n=c}return{cont:i,offset:n}},pointToTextRange=function(e){var t=function(e,n){var o,i;if(dom.isText(e)){var r=dom.listPrev(e,func.not(dom.isText)),A=list.last(r).previousSibling;o=A||e.parentNode,n+=list.sum(list.tail(r),dom.nodeLength),i=!A}else{if(o=e.childNodes[n]||e,dom.isText(o))return t(o,0);n=0,i=!1}return{node:o,collapseToStart:i,offset:n}},n=document.body.createTextRange(),o=t(e.node,e.offset);return n.moveToElementText(o.node),n.collapse(o.collapseToStart),n.moveStart("character",o.offset),n},WrappedRange=function(e,t,n,o){this.sc=e,this.so=t,this.ec=n,this.eo=o;var i=function(){if(agent.isW3CRangeSupport){var i=document.createRange();return i.setStart(e,t),i.setEnd(n,o),i}var r=pointToTextRange({node:e,offset:t});return r.setEndPoint("EndToEnd",pointToTextRange({node:n,offset:o})),r};this.getPoints=function(){return{sc:e,so:t,ec:n,eo:o}},this.getStartPoint=function(){return{node:e,offset:t}},this.getEndPoint=function(){return{node:n,offset:o}},this.select=function(){var e=i();if(agent.isW3CRangeSupport){var t=document.getSelection();t.rangeCount>0&&t.removeAllRanges(),t.addRange(e)}else e.select();return this},this.scrollIntoView=function(e){var t=$(e).height();return e.scrollTop+t<this.sc.offsetTop&&(e.scrollTop+=Math.abs(e.scrollTop+t-this.sc.offsetTop)),this},this.normalize=function(){var e=function(e,t){if(dom.isVisiblePoint(e)&&!dom.isEdgePoint(e)||dom.isVisiblePoint(e)&&dom.isRightEdgePoint(e)&&!t||dom.isVisiblePoint(e)&&dom.isLeftEdgePoint(e)&&t||dom.isVisiblePoint(e)&&dom.isBlock(e.node)&&dom.isEmpty(e.node))return e;var n=dom.ancestor(e.node,dom.isBlock);if((dom.isLeftEdgePointOf(e,n)||dom.isVoid(dom.prevPoint(e).node))&&!t||(dom.isRightEdgePointOf(e,n)||dom.isVoid(dom.nextPoint(e).node))&&t){if(dom.isVisiblePoint(e))return e;t=!t}return(t?dom.nextPointUntil(dom.nextPoint(e),dom.isVisiblePoint):dom.prevPointUntil(dom.prevPoint(e),dom.isVisiblePoint))||e},t=e(this.getEndPoint(),!1),n=this.isCollapsed()?t:e(this.getStartPoint(),!0);return new WrappedRange(n.node,n.offset,t.node,t.offset)},this.nodes=function(e,t){e=e||func.ok;var n=t&&t.includeAncestor,o=t&&t.fullyContains,i=this.getStartPoint(),r=this.getEndPoint(),A=[],a=[];return dom.walkPoint(i,r,(function(t){var i;dom.isEditable(t.node)||(o?(dom.isLeftEdgePoint(t)&&a.push(t.node),dom.isRightEdgePoint(t)&&list.contains(a,t.node)&&(i=t.node)):i=n?dom.ancestor(t.node,e):t.node,i&&e(i)&&A.push(i))}),!0),list.unique(A)},this.commonAncestor=function(){return dom.commonAncestor(e,n)},this.expand=function(i){var r=dom.ancestor(e,i),A=dom.ancestor(n,i);if(!r&&!A)return new WrappedRange(e,t,n,o);var a=this.getPoints();return r&&(a.sc=r,a.so=0),A&&(a.ec=A,a.eo=dom.nodeLength(A)),new WrappedRange(a.sc,a.so,a.ec,a.eo)},this.collapse=function(i){return i?new WrappedRange(e,t,e,t):new WrappedRange(n,o,n,o)},this.splitText=function(){var i=e===n,r=this.getPoints();return dom.isText(n)&&!dom.isEdgePoint(this.getEndPoint())&&n.splitText(o),dom.isText(e)&&!dom.isEdgePoint(this.getStartPoint())&&(r.sc=e.splitText(t),r.so=0,i&&(r.ec=r.sc,r.eo=o-t)),new WrappedRange(r.sc,r.so,r.ec,r.eo)},this.deleteContents=function(){if(this.isCollapsed())return this;var e=this.splitText(),t=e.nodes(null,{fullyContains:!0}),n=dom.prevPointUntil(e.getStartPoint(),(function(e){return!list.contains(t,e.node)})),o=[];return $.each(t,(function(e,t){var i=t.parentNode;n.node!==i&&1===dom.nodeLength(i)&&o.push(i),dom.remove(t,!1)})),$.each(o,(function(e,t){dom.remove(t,!1)})),new WrappedRange(n.node,n.offset,n.node,n.offset).normalize()};var r=function(t){return function(){var o=dom.ancestor(e,t);return!!o&&o===dom.ancestor(n,t)}};this.isOnEditable=r(dom.isEditable),this.isOnList=r(dom.isList),this.isOnAnchor=r(dom.isAnchor),this.isOnCell=r(dom.isCell),this.isOnData=r(dom.isData),this.isLeftEdgeOf=function(e){if(!dom.isLeftEdgePoint(this.getStartPoint()))return!1;var t=dom.ancestor(this.sc,e);return t&&dom.isLeftEdgeOf(this.sc,t)},this.isCollapsed=function(){return e===n&&t===o},this.wrapBodyInlineWithPara=function(){if(dom.isBodyContainer(e)&&dom.isEmpty(e))return e.innerHTML=dom.emptyPara,new WrappedRange(e.firstChild,0,e.firstChild,0);var t,n=this.normalize();if(dom.isParaInline(e)||dom.isPara(e))return n;if(dom.isInline(n.sc)){var o=dom.listAncestor(n.sc,func.not(dom.isInline));t=list.last(o),dom.isInline(t)||(t=o[o.length-2]||n.sc.childNodes[n.so])}else t=n.sc.childNodes[n.so>0?n.so-1:0];var i=dom.listPrev(t,dom.isParaInline).reverse();if((i=i.concat(dom.listNext(t.nextSibling,dom.isParaInline))).length){var r=dom.wrap(list.head(i),"p");dom.appendChildNodes(r,list.tail(i))}return this.normalize()},this.insertNode=function(e){var t=this.wrapBodyInlineWithPara().deleteContents(),n=dom.splitPoint(t.getStartPoint(),dom.isInline(e));return n.rightNode?n.rightNode.parentNode.insertBefore(e,n.rightNode):n.container.appendChild(e),e},this.pasteHTML=function(e){var t=$("<div></div>").html(e)[0],n=list.from(t.childNodes),o=this.wrapBodyInlineWithPara().deleteContents();return n.reverse().map((function(e){return o.insertNode(e)})).reverse()},this.toString=function(){var e=i();return agent.isW3CRangeSupport?e.toString():e.text},this.getWordRange=function(e){var t=this.getEndPoint();if(!dom.isCharPoint(t))return this;var n=dom.prevPointUntil(t,(function(e){return!dom.isCharPoint(e)}));return e&&(t=dom.nextPointUntil(t,(function(e){return!dom.isCharPoint(e)}))),new WrappedRange(n.node,n.offset,t.node,t.offset)},this.bookmark=function(i){return{s:{path:dom.makeOffsetPath(i,e),offset:t},e:{path:dom.makeOffsetPath(i,n),offset:o}}},this.paraBookmark=function(i){return{s:{path:list.tail(dom.makeOffsetPath(list.head(i),e)),offset:t},e:{path:list.tail(dom.makeOffsetPath(list.last(i),n)),offset:o}}},this.getClientRects=function(){return i().getClientRects()}},{create:function(e,t,n,o){if(4===arguments.length)return new WrappedRange(e,t,n,o);if(2===arguments.length)return new WrappedRange(e,t,n=e,o=t);var i=this.createFromSelection();return i||1!==arguments.length?i:(i=this.createFromNode(arguments[0])).collapse(dom.emptyPara===arguments[0].innerHTML)},createFromSelection:function(){var e,t,n,o;if(agent.isW3CRangeSupport){var i=document.getSelection();if(!i||0===i.rangeCount)return null;try{if(dom.isBody(i.anchorNode))return null}catch(e){return null}var r=i.getRangeAt(0);e=r.startContainer,t=r.startOffset,n=r.endContainer,o=r.endOffset}else{var A=document.selection.createRange(),a=A.duplicate();a.collapse(!1);var s=A;s.collapse(!0);var l=textRangeToPoint(s,!0),c=textRangeToPoint(a,!1);dom.isText(l.node)&&dom.isLeftEdgePoint(l)&&dom.isTextNode(c.node)&&dom.isRightEdgePoint(c)&&c.node.nextSibling===l.node&&(l=c),e=l.cont,t=l.offset,n=c.cont,o=c.offset}return new WrappedRange(e,t,n,o)},createFromNode:function(e){var t=e,n=0,o=e,i=dom.nodeLength(o);return dom.isVoid(t)&&(n=dom.listPrev(t).length-1,t=t.parentNode),dom.isBR(o)?(i=dom.listPrev(o).length-1,o=o.parentNode):dom.isVoid(o)&&(i=dom.listPrev(o).length,o=o.parentNode),this.create(t,n,o,i)},createFromNodeBefore:function(e){return this.createFromNode(e).collapse(!0)},createFromNodeAfter:function(e){return this.createFromNode(e).collapse()},createFromBookmark:function(e,t){var n=dom.fromOffsetPath(e,t.s.path),o=t.s.offset,i=dom.fromOffsetPath(e,t.e.path),r=t.e.offset;return new WrappedRange(n,o,i,r)},createFromParaBookmark:function(e,t){var n=e.s.offset,o=e.e.offset,i=dom.fromOffsetPath(list.head(t),e.s.path),r=dom.fromOffsetPath(list.last(t),e.e.path);return new WrappedRange(i,n,r,o)}}),textRangeToPoint,pointToTextRange,WrappedRange,async={readFileAsDataURL:function(e){return $.Deferred((function(t){$.extend(new FileReader,{onload:function(e){var n=e.target.result;t.resolve(n)},onerror:function(){t.reject(this)}}).readAsDataURL(e)})).promise()},createImage:function(e){return $.Deferred((function(t){var n=$("<img>");n.one("load",(function(){n.off("error abort"),t.resolve(n)})).one("error abort",(function(){n.off("load").detach(),t.reject(n)})).css({display:"none"}).appendTo(document.body).attr("src",e)})).promise()}},History=function(e){var t=[],n=-1,o=e[0],i=function(t){null!==t.contents&&e.html(t.contents),null!==t.bookmark&&range.createFromBookmark(o,t.bookmark).select()};this.rewind=function(){e.html()!==t[n].contents&&this.recordUndo(),i(t[n=0])},this.reset=function(){t=[],n=-1,e.html(""),this.recordUndo()},this.undo=function(){e.html()!==t[n].contents&&this.recordUndo(),0<n&&(n--,i(t[n]))},this.redo=function(){t.length-1>n&&(n++,i(t[n]))},this.recordUndo=function(){var i;n++,t.length>n&&(t=t.slice(0,n)),t.push((i=range.create(o),{contents:e.html(),bookmark:i?i.bookmark(o):{s:{path:[],offset:0},e:{path:[],offset:0}}}))}},Style=function(){this.fromNode=function(e){var t=function(e,t){if(agent.jqueryVersion<1.9){var n={};return $.each(t,(function(t,o){n[o]=e.css(o)})),n}return e.css.call(e,t)}(e,["font-family","font-size","text-align","list-style-type","line-height","color"])||{};return t["font-size"]=parseInt(t["font-size"],10),t},this.stylePara=function(e,t){$.each(e.nodes(dom.isPara,{includeAncestor:!0}),(function(e,n){$(n).css(t)}))},this.styleNodes=function(e,t){e=e.splitText();var n=t&&t.nodeName||"SPAN",o=!(!t||!t.expandClosestSibling),i=!(!t||!t.onlyPartialContains);if(e.isCollapsed())return[e.insertNode(dom.create(n))];var r=dom.makePredByNodeName(n),A=e.nodes(dom.isText,{fullyContains:!0}).map((function(e){return dom.singleChildAncestor(e,r)||dom.wrap(e,n)}));if(o){if(i){var a=e.nodes();r=func.and(r,(function(e){return list.contains(a,e)}))}return A.map((function(e){var t=dom.withClosestSiblings(e,r),n=list.head(t),o=list.tail(t);return $.each(o,(function(e,t){dom.appendChildNodes(n,t.childNodes),dom.remove(t)})),list.head(t)}))}return A},this.current=function(e){var t=$(dom.isElement(e.sc)?e.sc:e.sc.parentNode),n=this.fromNode(t);try{n=$.extend(n,{"font-bold":document.queryCommandState("bold")?"bold":"normal","font-italic":document.queryCommandState("italic")?"italic":"normal","font-underline":document.queryCommandState("underline")?"underline":"normal","font-subscript":document.queryCommandState("subscript")?"subscript":"normal","font-superscript":document.queryCommandState("superscript")?"superscript":"normal","font-strikethrough":document.queryCommandState("strikethrough")?"strikethrough":"normal"})}catch(e){}if(e.isOnList()){var o=$.inArray(n["list-style-type"],["circle","disc","disc-leading-zero","square"])>-1;n["list-style"]=o?"unordered":"ordered"}else n["list-style"]="none";var i=dom.ancestor(e.sc,dom.isPara);if(i&&i.style["line-height"])n["line-height"]=i.style.lineHeight;else{var r=parseInt(n["line-height"],10)/parseInt(n["font-size"],10);n["line-height"]=r.toFixed(1)}return n.anchor=e.isOnAnchor()&&dom.ancestor(e.sc,dom.isAnchor),n.ancestors=dom.listAncestor(e.sc,dom.isEditable),n.range=e,n}},Bullet=function(){var e=this;this.insertOrderedList=function(e){this.toggleList("OL",e)},this.insertUnorderedList=function(e){this.toggleList("UL",e)},this.indent=function(e){var t=this,n=range.create(e).wrapBodyInlineWithPara(),o=n.nodes(dom.isPara,{includeAncestor:!0}),i=list.clusterBy(o,func.peq2("parentNode"));$.each(i,(function(e,n){var o=list.head(n);dom.isLi(o)?t.wrapList(n,o.parentNode.nodeName):$.each(n,(function(e,t){$(t).css("marginLeft",(function(e,t){return(parseInt(t,10)||0)+25}))}))})),n.select()},this.outdent=function(e){var t=this,n=range.create(e).wrapBodyInlineWithPara(),o=n.nodes(dom.isPara,{includeAncestor:!0}),i=list.clusterBy(o,func.peq2("parentNode"));$.each(i,(function(e,n){var o=list.head(n);dom.isLi(o)?t.releaseList([n]):$.each(n,(function(e,t){$(t).css("marginLeft",(function(e,t){return(t=parseInt(t,10)||0)>25?t-25:""}))}))})),n.select()},this.toggleList=function(t,n){var o=range.create(n).wrapBodyInlineWithPara(),i=o.nodes(dom.isPara,{includeAncestor:!0}),r=o.paraBookmark(i),A=list.clusterBy(i,func.peq2("parentNode"));if(list.find(i,dom.isPurePara)){var a=[];$.each(A,(function(n,o){a=a.concat(e.wrapList(o,t))})),i=a}else{var s=o.nodes(dom.isList,{includeAncestor:!0}).filter((function(e){return!$.nodeName(e,t)}));s.length?$.each(s,(function(e,n){dom.replace(n,t)})):i=this.releaseList(A,!0)}range.createFromParaBookmark(r,i).select()},this.wrapList=function(e,t){var n=list.head(e),o=list.last(e),i=dom.isList(n.previousSibling)&&n.previousSibling,r=dom.isList(o.nextSibling)&&o.nextSibling,A=i||dom.insertAfter(dom.create(t||"UL"),o);return e=e.map((function(e){return dom.isPurePara(e)?dom.replace(e,"LI"):e})),dom.appendChildNodes(A,e),r&&(dom.appendChildNodes(A,list.from(r.childNodes)),dom.remove(r)),e},this.releaseList=function(e,t){var n=[];return $.each(e,(function(e,o){var i=list.head(o),r=list.last(o),A=t?dom.lastAncestor(i,dom.isList):i.parentNode,a=A.childNodes.length>1?dom.splitTree(A,{node:r.parentNode,offset:dom.position(r)+1},{isSkipPaddingBlankHTML:!0}):null,s=dom.splitTree(A,{node:i.parentNode,offset:dom.position(i)},{isSkipPaddingBlankHTML:!0});o=t?dom.listDescendant(s,dom.isLi):list.from(s.childNodes).filter(dom.isLi),!t&&dom.isList(A.parentNode)||(o=o.map((function(e){return dom.replace(e,"P")}))),$.each(list.from(o).reverse(),(function(e,t){dom.insertAfter(t,A)}));var l=list.compact([A,s,a]);$.each(l,(function(e,t){var n=[t].concat(dom.listDescendant(t,dom.isList));$.each(n.reverse(),(function(e,t){dom.nodeLength(t)||dom.remove(t,!0)}))})),n=n.concat(o)})),n}},Typing=function(){var e=new Bullet;this.insertTab=function(e,t){var n=dom.createText(new Array(t+1).join(dom.NBSP_CHAR));(e=e.deleteContents()).insertNode(n,!0),(e=range.create(n,t)).select()},this.insertParagraph=function(t){var n=range.create(t);n=(n=n.deleteContents()).wrapBodyInlineWithPara();var o,i=dom.ancestor(n.sc,dom.isPara);if(i){if(dom.isEmpty(i)&&dom.isLi(i))return void e.toggleList(i.parentNode.nodeName);if(dom.isEmpty(i)&&dom.isPara(i)&&dom.isBlockquote(i.parentNode))dom.insertAfter(i,i.parentNode),o=i;else{o=dom.splitTree(i,n.getStartPoint());var r=dom.listDescendant(i,dom.isEmptyAnchor);r=r.concat(dom.listDescendant(o,dom.isEmptyAnchor)),$.each(r,(function(e,t){dom.remove(t)})),(dom.isHeading(o)||dom.isPre(o))&&dom.isEmpty(o)&&(o=dom.replace(o,"p"))}}else{var A=n.sc.childNodes[n.so];o=$(dom.emptyPara)[0],A?n.sc.insertBefore(o,A):n.sc.appendChild(o)}range.create(o,0).normalize().select().scrollIntoView(t)}},Table=function(){this.tab=function(e,t){var n=dom.ancestor(e.commonAncestor(),dom.isCell),o=dom.ancestor(n,dom.isTable),i=dom.listDescendant(o,dom.isCell),r=list[t?"prev":"next"](i,n);r&&range.create(r,0).select()},this.createTable=function(e,t,n){for(var o,i=[],r=0;r<e;r++)i.push("<td>"+dom.blank+"</td>");o=i.join("");for(var A,a=[],s=0;s<t;s++)a.push("<tr>"+o+"</tr>");A=a.join("");var l=$("<table>"+A+"</table>");return n&&n.tableClassName&&l.addClass(n.tableClassName),l[0]}},KEY_BOGUS="bogus",Editor=function(e){var t=this,n=e.layoutInfo.note,o=e.layoutInfo.editor,i=e.layoutInfo.editable,r=e.options,A=r.langInfo,a=i[0],s=null,l=new Style,c=new Table,d=new Typing,u=new Bullet,h=new History(i);this.initialize=function(){i.on("keydown",(function(n){n.keyCode===key.code.ENTER&&e.triggerEvent("enter",n),e.triggerEvent("keydown",n),n.isDefaultPrevented()||(r.shortcuts?t.handleKeyMap(n):t.preventDefaultEditableShortCuts(n))})).on("keyup",(function(t){e.triggerEvent("keyup",t)})).on("focus",(function(t){e.triggerEvent("focus",t)})).on("blur",(function(t){e.triggerEvent("blur",t)})).on("mousedown",(function(t){e.triggerEvent("mousedown",t)})).on("mouseup",(function(t){e.triggerEvent("mouseup",t)})).on("scroll",(function(t){e.triggerEvent("scroll",t)})).on("paste",(function(t){e.triggerEvent("paste",t)})),i.html(dom.html(n)||dom.emptyPara);var A=agent.isMSIE?"DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted":"input";i.on(A,func.debounce((function(){e.triggerEvent("change",i.html())}),250)),o.on("focusin",(function(t){e.triggerEvent("focusin",t)})).on("focusout",(function(t){e.triggerEvent("focusout",t)})),r.airMode||(r.width&&o.outerWidth(r.width),r.height&&i.outerHeight(r.height),r.maxHeight&&i.css("max-height",r.maxHeight),r.minHeight&&i.css("min-height",r.minHeight)),h.recordUndo()},this.destroy=function(){i.off()},this.handleKeyMap=function(t){var n=r.keyMap[agent.isMac?"mac":"pc"],o=[];t.metaKey&&o.push("CMD"),t.ctrlKey&&!t.altKey&&o.push("CTRL"),t.shiftKey&&o.push("SHIFT");var i=key.nameFromCode[t.keyCode];i&&o.push(i);var A=n[o.join("+")];A?(t.preventDefault(),e.invoke(A)):key.isEdit(t.keyCode)&&this.afterCommand()},this.preventDefaultEditableShortCuts=function(e){(e.ctrlKey||e.metaKey)&&list.contains([66,73,85],e.keyCode)&&e.preventDefault()},this.createRange=function(){return this.focus(),range.create(a)},this.saveRange=function(e){s=this.createRange(),e&&s.collapse().select()},this.restoreRange=function(){s&&(s.select(),this.focus())},this.saveTarget=function(e){i.data("target",e)},this.clearTarget=function(){i.removeData("target")},this.restoreTarget=function(){return i.data("target")},this.currentStyle=function(){var e=range.create();return e&&(e=e.normalize()),e?l.current(e):l.fromNode(i)},this.styleFromNode=function(e){return l.fromNode(e)},this.undo=function(){e.triggerEvent("before.command",i.html()),h.undo(),e.triggerEvent("change",i.html())},e.memo("help.undo",A.help.undo),this.redo=function(){e.triggerEvent("before.command",i.html()),h.redo(),e.triggerEvent("change",i.html())},e.memo("help.redo",A.help.redo);for(var g=this.beforeCommand=function(){e.triggerEvent("before.command",i.html()),t.focus()},f=this.afterCommand=function(t){h.recordUndo(),t||e.triggerEvent("change",i.html())},p=["bold","italic","underline","strikethrough","superscript","subscript","justifyLeft","justifyCenter","justifyRight","justifyFull","formatBlock","removeFormat","backColor","foreColor","fontName"],m=0,B=p.length;m<B;m++)this[p[m]]=function(e){return function(t){g(),document.execCommand(e,!1,t),f(!0)}}(p[m]),e.memo("help."+p[m],A.help[p[m]]);this.tab=function(){var e=this.createRange();e.isCollapsed()&&e.isOnCell()?c.tab(e):(g(),d.insertTab(e,r.tabSize),f())},e.memo("help.tab",A.help.tab),this.untab=function(){var e=this.createRange();e.isCollapsed()&&e.isOnCell()&&c.tab(e,!0)},e.memo("help.untab",A.help.untab),this.updateClassToSelection=function(e,t){var n;if(""!==(n=t||this.createRange()).toString()||e.add){var o=l.styleNodes(n);if(n&&e.remove&&$(o).each((function(){$(this).removeClass(e.remove)})),n&&e.add&&$(o).each((function(){$(this).addClass(e.add)})),n&&n.isCollapsed()){var r=list.head(o);r&&!dom.nodeLength(r)&&(r.innerHTML=dom.ZERO_WIDTH_NBSP_CHAR,range.createFromNodeAfter(r.firstChild).select(),i.data(KEY_BOGUS,r))}}},this.wrapCommand=function(e){return function(){g(),e.apply(t,arguments),f()}},this.insertParagraph=this.wrapCommand((function(){d.insertParagraph(a)})),e.memo("help.insertParagraph",A.help.insertParagraph),this.insertOrderedList=this.wrapCommand((function(){u.insertOrderedList(a)})),e.memo("help.insertOrderedList",A.help.insertOrderedList),this.insertUnorderedList=this.wrapCommand((function(){u.insertUnorderedList(a)})),e.memo("help.insertUnorderedList",A.help.insertUnorderedList),this.indent=this.wrapCommand((function(){u.indent(a)})),e.memo("help.indent",A.help.indent),this.outdent=this.wrapCommand((function(){u.outdent(a)})),e.memo("help.outdent",A.help.outdent),this.insertImage=function(t,n){return async.createImage(t,n).then((function(e){g(),"function"==typeof n?n(e):("string"==typeof n&&e.attr("data-filename",n),e.css("width",Math.min(i.width(),e.width()))),e.show(),range.create(a).insertNode(e[0]),range.createFromNodeAfter(e[0]).select(),f()})).fail((function(t){e.triggerEvent("image.upload.error",t)}))},this.insertImages=function(n){$.each(n,(function(n,o){var i=o.name;r.maximumImageFileSize&&r.maximumImageFileSize<o.size?e.triggerEvent("image.upload.error",A.image.maximumFileSizeError):async.readFileAsDataURL(o).then((function(e){return t.insertImage(e,i)})).fail((function(){e.triggerEvent("image.upload.error")}))}))},this.insertImagesOrCallback=function(t){r.callbacks.onImageUpload?e.triggerEvent("image.upload",t):this.insertImages(t)},this.insertNode=this.wrapCommand((function(e){this.createRange().insertNode(e),range.createFromNodeAfter(e).select()})),this.insertText=this.wrapCommand((function(e){var t=this.createRange().insertNode(dom.createText(e));range.create(t,dom.nodeLength(t)).select()})),this.getSelectedText=function(){var e=this.createRange();return e.isOnAnchor()&&(e=range.createFromNode(dom.ancestor(e.sc,dom.isAnchor))),e.toString()},this.pasteHTML=this.wrapCommand((function(e){var t=this.createRange().pasteHTML(e);range.createFromNodeAfter(list.last(t)).select()})),this.formatBlock=this.wrapCommand((function(e){e=agent.isMSIE?"<"+e+">":e,document.execCommand("FormatBlock",!1,e)})),this.formatPara=function(){this.formatBlock("P")},e.memo("help.formatPara",A.help.formatPara);for(m=1;m<=6;m++)this["formatH"+m]=function(e){return function(){this.formatBlock("H"+e)}}(m),e.memo("help.formatH"+m,A.help["formatH"+m]);this.fontSize=function(e){var t=this.createRange(),n=l.styleNodes(t);if(t&&t.isCollapsed()){var o=list.head(n);$(n).css({"font-size":e+"px"}),o&&!dom.nodeLength(o)&&(o.innerHTML=dom.ZERO_WIDTH_NBSP_CHAR,range.createFromNodeAfter(o.firstChild).select(),i.data(KEY_BOGUS,o))}else g(),$(n).css({"font-size":e+"px"}),f()},this.insertHorizontalRule=this.wrapCommand((function(){var e=this.createRange().insertNode(dom.create("HR"));e.nextSibling&&range.create(e.nextSibling,0).normalize().select()})),e.memo("help.insertHorizontalRule",A.help.insertHorizontalRule),this.removeBogus=function(){var e=i.data(KEY_BOGUS);if(e){var t=list.find(list.from(e.childNodes),dom.isText),n=t.nodeValue.indexOf(dom.ZERO_WIDTH_NBSP_CHAR);-1!==n&&t.deleteData(n,1),dom.isEmpty(e)&&dom.remove(e),i.removeData(KEY_BOGUS)}},this.lineHeight=this.wrapCommand((function(e){l.stylePara(this.createRange(),{lineHeight:e})})),this.unlink=function(){var e=this.createRange();if(e.isOnAnchor()){var t=dom.ancestor(e.sc,dom.isAnchor);(e=range.createFromNode(t)).select(),g(),document.execCommand("unlink"),f()}},this.createLink=this.wrapCommand((function(e){var t=e.url,n=e.text,o=e.isNewWindow,i=e.range||this.createRange(),A=i.toString()!==n;"string"==typeof t&&(t=t.trim()),t=r.onCreateLink?r.onCreateLink(t):/^[A-Za-z][A-Za-z0-9+-.]*\:[\/\/]?/.test(t)?t:"http://"+t;var a=[];if(A){var s=(i=i.deleteContents()).insertNode($("<A>"+n+"</A>")[0]);a.push(s)}else a=l.styleNodes(i,{nodeName:"A",expandClosestSibling:!0,onlyPartialContains:!0});$.each(a,(function(e,n){$(n).attr("href",t),o?$(n).attr("target","_blank"):$(n).removeAttr("target")}));var c=range.createFromNodeBefore(list.head(a)).getStartPoint(),d=range.createFromNodeAfter(list.last(a)).getEndPoint();range.create(c.node,c.offset,d.node,d.offset).select()})),this.getLinkInfo=function(){var e=this.createRange().expand(dom.isAnchor),t=$(list.head(e.nodes(dom.isAnchor)));return{range:e,text:e.toString(),isNewWindow:!!t.length&&"_blank"===t.attr("target"),url:t.length?t.attr("href"):""}},this.color=this.wrapCommand((function(e){var t=e.foreColor,n=e.backColor;t&&document.execCommand("foreColor",!1,t),n&&document.execCommand("backColor",!1,n)})),this.insertTable=this.wrapCommand((function(e){var t=e.split("x");this.createRange().deleteContents().insertNode(c.createTable(t[0],t[1],r))})),this.floatMe=this.wrapCommand((function(e){$(this.restoreTarget()).css("float",e)})),this.resize=this.wrapCommand((function(e){$(this.restoreTarget()).css({width:100*e+"%",height:""})})),this.resizeTo=function(e,t,n){var o;if(n){var i=e.y/e.x,r=t.data("ratio");o={width:r>i?e.x:e.y/r,height:r>i?e.x*r:e.y}}else o={width:e.x,height:e.y};t.css(o)},this.removeMedia=this.wrapCommand((function(){var t=$(this.restoreTarget()).detach();e.triggerEvent("media.delete",t,i)})),this.hasFocus=function(){return i.is(":focus")},this.focus=function(){this.hasFocus()||i.focus()},this.isEmpty=function(){return dom.isEmpty(i[0])||dom.emptyPara===i.html()},this.empty=function(){e.invoke("code",dom.emptyPara)}},Clipboard=function(e){var t=this,n=e.layoutInfo.editable;this.events={"summernote.keydown":function(n,o){t.needKeydownHook()&&(o.ctrlKey||o.metaKey)&&o.keyCode===key.code.V&&(e.invoke("editor.saveRange"),t.$paste.focus(),setTimeout((function(){t.pasteByHook()}),0))}},this.needKeydownHook=function(){return agent.isMSIE&&agent.browserVersion>10||agent.isFF},this.initialize=function(){this.needKeydownHook()?(this.$paste=$('<div tabindex="-1" />').attr("contenteditable",!0).css({position:"absolute",left:-1e5,opacity:0}),n.before(this.$paste),this.$paste.on("paste",(function(t){e.triggerEvent("paste",t)}))):n.on("paste",this.pasteByEvent)},this.destroy=function(){this.needKeydownHook()&&(this.$paste.remove(),this.$paste=null)},this.pasteByHook=function(){var t=this.$paste[0].firstChild;if(dom.isImg(t)){for(var n=t.src,o=atob(n.split(",")[1]),i=new Uint8Array(o.length),r=0;r<o.length;r++)i[r]=o.charCodeAt(r);var A=new Blob([i],{type:"image/png"});A.name="clipboard.png",e.invoke("editor.restoreRange"),e.invoke("editor.focus"),e.invoke("editor.insertImagesOrCallback",[A])}else{var a=$("<div />").html(this.$paste.html()).html();e.invoke("editor.restoreRange"),e.invoke("editor.focus"),a&&e.invoke("editor.pasteHTML",a)}this.$paste.empty()},this.pasteByEvent=function(t){var n=t.originalEvent.clipboardData;if(n&&n.items&&n.items.length){var o=list.head(n.items);"file"===o.kind&&-1!==o.type.indexOf("image/")&&e.invoke("editor.insertImagesOrCallback",[o.getAsFile()]),e.invoke("editor.afterCommand")}}},Dropzone=function(e){var t=$(document),n=e.layoutInfo.editor,o=e.layoutInfo.editable,i=e.options,r=i.langInfo,A={},a=$(['<div class="note-dropzone">',' <div class="note-dropzone-message"/>',"</div>"].join("")).prependTo(n);this.initialize=function(){i.disableDragAndDrop?(A.onDrop=function(e){e.preventDefault()},t.on("drop",A.onDrop)):this.attachDragAndDropEvent()},this.attachDragAndDropEvent=function(){var i=$(),s=a.find(".note-dropzone-message");A.onDragenter=function(t){var o=e.invoke("codeview.isActivated"),A=n.width()>0&&n.height()>0;o||i.length||!A||(n.addClass("dragover"),a.width(n.width()),a.height(n.height()),s.text(r.image.dragImageHere)),i=i.add(t.target)},A.onDragleave=function(e){(i=i.not(e.target)).length||n.removeClass("dragover")},A.onDrop=function(){i=$(),n.removeClass("dragover")},t.on("dragenter",A.onDragenter).on("dragleave",A.onDragleave).on("drop",A.onDrop),a.on("dragenter",(function(){a.addClass("hover"),s.text(r.image.dropImage)})).on("dragleave",(function(){a.removeClass("hover"),s.text(r.image.dragImageHere)})),a.on("drop",(function(t){var n=t.originalEvent.dataTransfer;n&&n.files&&n.files.length?(t.preventDefault(),o.focus(),e.invoke("editor.insertImagesOrCallback",n.files)):$.each(n.types,(function(t,o){var i=n.getData(o);o.toLowerCase().indexOf("text")>-1?e.invoke("editor.pasteHTML",i):$(i).each((function(){e.invoke("editor.insertNode",this)}))}))})).on("dragover",!1)},this.destroy=function(){Object.keys(A).forEach((function(e){t.off(e.substr(2).toLowerCase(),A[e])})),A={}}},CodeMirror;agent.hasCodeMirror&&(agent.isSupportAmd?require(["codemirror"],(function(e){CodeMirror=e})):CodeMirror=window.CodeMirror);var Codeview=function(e){var t=e.layoutInfo.editor,n=e.layoutInfo.editable,o=e.layoutInfo.codable,i=e.options;this.sync=function(){this.isActivated()&&agent.hasCodeMirror&&o.data("cmEditor").save()},this.isActivated=function(){return t.hasClass("codeview")},this.toggle=function(){this.isActivated()?this.deactivate():this.activate(),e.triggerEvent("codeview.toggled")},this.activate=function(){if(o.val(dom.html(n,i.prettifyHtml)),o.height(n.height()),e.invoke("toolbar.updateCodeview",!0),t.addClass("codeview"),o.focus(),agent.hasCodeMirror){var r=CodeMirror.fromTextArea(o[0],i.codemirror);if(i.codemirror.tern){var A=new CodeMirror.TernServer(i.codemirror.tern);r.ternServer=A,r.on("cursorActivity",(function(e){A.updateArgHints(e)}))}r.setSize(null,n.outerHeight()),o.data("cmEditor",r)}},this.deactivate=function(){if(agent.hasCodeMirror){var r=o.data("cmEditor");o.val(r.getValue()),r.toTextArea()}var A=dom.value(o,i.prettifyHtml)||dom.emptyPara,a=n.html()!==A;n.html(A),n.height(i.height?o.height():"auto"),t.removeClass("codeview"),a&&e.triggerEvent("change",n.html(),n),n.focus(),e.invoke("toolbar.updateCodeview",!1)},this.destroy=function(){this.isActivated()&&this.deactivate()}},EDITABLE_PADDING=24,Statusbar=function(e){var t=$(document),n=e.layoutInfo.statusbar,o=e.layoutInfo.editable,i=e.options;this.initialize=function(){i.airMode||i.disableResizeEditor?this.destroy():n.on("mousedown",(function(e){e.preventDefault(),e.stopPropagation();var n=o.offset().top-t.scrollTop();t.on("mousemove",(function(e){var t=e.clientY-(n+EDITABLE_PADDING);t=i.minheight>0?Math.max(t,i.minheight):t,t=i.maxHeight>0?Math.min(t,i.maxHeight):t,o.height(t)})).one("mouseup",(function(){t.off("mousemove")}))}))},this.destroy=function(){n.off(),n.remove()}},Fullscreen=function(e){var t=e.layoutInfo.editor,n=e.layoutInfo.toolbar,o=e.layoutInfo.editable,i=e.layoutInfo.codable,r=$(window),A=$("html, body");this.toggle=function(){var a=function(e){o.css("height",e.h),i.css("height",e.h),i.data("cmeditor")&&i.data("cmeditor").setsize(null,e.h)};t.toggleClass("fullscreen"),this.isFullscreen()?(o.data("orgHeight",o.css("height")),r.on("resize",(function(){a({h:r.height()-n.outerHeight()})})).trigger("resize"),A.css("overflow","hidden")):(r.off("resize"),a({h:o.data("orgHeight")}),A.css("overflow","visible")),e.invoke("toolbar.updateFullscreen",this.isFullscreen())},this.isFullscreen=function(){return t.hasClass("fullscreen")}},Handle=function(e){var t=this,n=$(document),o=e.layoutInfo.editingArea,i=e.options;this.events={"summernote.mousedown":function(e,n){t.update(n.target)&&n.preventDefault()},"summernote.keyup summernote.scroll summernote.change summernote.dialog.shown":function(){t.update()}},this.initialize=function(){this.$handle=$(['<div class="note-handle">','<div class="note-control-selection">','<div class="note-control-selection-bg"></div>','<div class="note-control-holder note-control-nw"></div>','<div class="note-control-holder note-control-ne"></div>','<div class="note-control-holder note-control-sw"></div>','<div class="',i.disableResizeImage?"note-control-holder":"note-control-sizing",' note-control-se"></div>',i.disableResizeImage?"":'<div class="note-control-selection-info"></div>',"</div>","</div>"].join("")).prependTo(o),this.$handle.on("mousedown",(function(o){if(dom.isControlSizing(o.target)){o.preventDefault(),o.stopPropagation();var i=t.$handle.find(".note-control-selection").data("target"),r=i.offset(),A=n.scrollTop();n.on("mousemove",(function(n){e.invoke("editor.resizeTo",{x:n.clientX-r.left,y:n.clientY-(r.top-A)},i,!n.shiftKey),t.update(i[0])})).one("mouseup",(function(t){t.preventDefault(),n.off("mousemove"),e.invoke("editor.afterCommand")})),i.data("ratio")||i.data("ratio",i.height()/i.width())}}))},this.destroy=function(){this.$handle.remove()},this.update=function(t){var n=dom.isImg(t),o=this.$handle.find(".note-control-selection");if(e.invoke("imagePopover.update",t),n){var i=$(t),r=i.position(),A={w:i.outerWidth(!0),h:i.outerHeight(!0)};o.css({display:"block",left:r.left,top:r.top,width:A.w,height:A.h}).data("target",i);var a=A.w+"x"+A.h;o.find(".note-control-selection-info").text(a),e.invoke("editor.saveTarget",t)}else this.hide();return n},this.hide=function(){e.invoke("editor.clearTarget"),this.$handle.children().hide()}},AutoLink=function(e){var t=this,n=/^([A-Za-z][A-Za-z0-9+-.]*\:[\/\/]?|mailto:[A-Z0-9._%+-]+@)?(www\.)?(.+)$/i;this.events={"summernote.keyup":function(e,n){n.isDefaultPrevented()||t.handleKeyup(n)},"summernote.keydown":function(e,n){t.handleKeydown(n)}},this.initialize=function(){this.lastWordRange=null},this.destroy=function(){this.lastWordRange=null},this.replace=function(){if(this.lastWordRange){var t=this.lastWordRange.toString(),o=t.match(n);if(o&&(o[1]||o[2])){var i=o[1]?t:"http://"+t,r=$("<a />").html(t).attr("href",i)[0];this.lastWordRange.insertNode(r),this.lastWordRange=null,e.invoke("editor.focus")}}},this.handleKeydown=function(t){if(list.contains([key.code.ENTER,key.code.SPACE],t.keyCode)){var n=e.invoke("editor.createRange").getWordRange();this.lastWordRange=n}},this.handleKeyup=function(e){list.contains([key.code.ENTER,key.code.SPACE],e.keyCode)&&this.replace()}},AutoSync=function(e){var t=e.layoutInfo.note;this.events={"summernote.change":function(){t.val(e.invoke("code"))}},this.shouldInitialize=function(){return dom.isTextarea(t[0])}},Placeholder=function(e){var t=this,n=e.layoutInfo.editingArea,o=e.options;this.events={"summernote.init summernote.change":function(){t.update()},"summernote.codeview.toggled":function(){t.update()}},this.shouldInitialize=function(){return!!o.placeholder},this.initialize=function(){this.$placeholder=$('<div class="note-placeholder">'),this.$placeholder.on("click",(function(){e.invoke("focus")})).text(o.placeholder).prependTo(n)},this.destroy=function(){this.$placeholder.remove()},this.update=function(){var t=!e.invoke("codeview.isActivated")&&e.invoke("editor.isEmpty");this.$placeholder.toggle(t)}},Buttons=function(e){var t=this,n=$.summernote.ui,o=e.layoutInfo.toolbar,i=e.options,r=i.langInfo,A=func.invertObject(i.keyMap[agent.isMac?"mac":"pc"]),a=this.representShortcut=function(e){var t=A[e];return i.shortcuts&&t?(agent.isMac&&(t=t.replace("CMD","⌘").replace("SHIFT","⇧"))," ("+(t=t.replace("BACKSLASH","\\").replace("SLASH","/").replace("LEFTBRACKET","[").replace("RIGHTBRACKET","]"))+")"):""};this.initialize=function(){this.addToolbarButtons(),this.addImagePopoverButtons(),this.addLinkPopoverButtons(),this.fontInstalledMap={}},this.destroy=function(){delete this.fontInstalledMap},this.isFontInstalled=function(e){return t.fontInstalledMap.hasOwnProperty(e)||(t.fontInstalledMap[e]=agent.isFontInstalled(e)||list.contains(i.fontNamesIgnoreCheck,e)),t.fontInstalledMap[e]},this.addToolbarButtons=function(){e.memo("button.style",(function(){return n.buttonGroup([n.button({className:"dropdown-toggle",contents:n.icon(i.icons.magic)+" "+n.icon(i.icons.caret,"span"),tooltip:r.style.style,data:{toggle:"dropdown"}}),n.dropdown({className:"dropdown-style",items:e.options.styleTags,template:function(e){"string"==typeof e&&(e={tag:e,title:r.style.hasOwnProperty(e)?r.style[e]:e});var t=e.tag,n=e.title;return"<"+t+(e.style?' style="'+e.style+'" ':"")+(e.className?' class="'+e.className+'"':"")+">"+n+"</"+t+">"},click:e.createInvokeHandler("editor.formatBlock")})]).render()})),e.memo("button.bold",(function(){return n.button({className:"note-btn-bold",contents:n.icon(i.icons.bold),tooltip:r.font.bold+a("bold"),click:e.createInvokeHandler("editor.bold")}).render()})),e.memo("button.italic",(function(){return n.button({className:"note-btn-italic",contents:n.icon(i.icons.italic),tooltip:r.font.italic+a("italic"),click:e.createInvokeHandler("editor.italic")}).render()})),e.memo("button.underline",(function(){return n.button({className:"note-btn-underline",contents:n.icon(i.icons.underline),tooltip:r.font.underline+a("underline"),click:e.createInvokeHandler("editor.underline")}).render()})),e.memo("button.clear",(function(){return n.button({contents:n.icon(i.icons.eraser),tooltip:r.font.clear+a("removeFormat"),click:e.createInvokeHandler("editor.removeFormat")}).render()})),e.memo("button.strikethrough",(function(){return n.button({className:"note-btn-strikethrough",contents:n.icon(i.icons.strikethrough),tooltip:r.font.strikethrough+a("strikethrough"),click:e.createInvokeHandler("editor.strikethrough")}).render()})),e.memo("button.superscript",(function(){return n.button({className:"note-btn-superscript",contents:n.icon(i.icons.superscript),tooltip:r.font.superscript,click:e.createInvokeHandler("editor.superscript")}).render()})),e.memo("button.subscript",(function(){return n.button({className:"note-btn-subscript",contents:n.icon(i.icons.subscript),tooltip:r.font.subscript,click:e.createInvokeHandler("editor.subscript")}).render()})),e.memo("button.fontname",(function(){return n.buttonGroup([n.button({className:"dropdown-toggle",contents:'<span class="note-current-fontname"/> '+n.icon(i.icons.caret,"span"),tooltip:r.font.name,data:{toggle:"dropdown"}}),n.dropdownCheck({className:"dropdown-fontname",checkClassName:i.icons.menuCheck,items:i.fontNames.filter(t.isFontInstalled),template:function(e){return'<span style="font-family:'+e+'">'+e+"</span>"},click:e.createInvokeHandler("editor.fontName")})]).render()})),e.memo("button.fontsize",(function(){return n.buttonGroup([n.button({className:"dropdown-toggle",contents:'<span class="note-current-fontsize"/>'+n.icon(i.icons.caret,"span"),tooltip:r.font.size,data:{toggle:"dropdown"}}),n.dropdownCheck({className:"dropdown-fontsize",checkClassName:i.icons.menuCheck,items:i.fontSizes,click:e.createInvokeHandler("editor.fontSize")})]).render()})),e.memo("button.color",(function(){return n.buttonGroup({className:"note-color",children:[n.button({className:"note-current-color-button",contents:n.icon(i.icons.font+" note-recent-color"),tooltip:r.color.recent,click:function(t){var n=$(t.currentTarget);e.invoke("editor.color",{backColor:n.attr("data-backColor"),foreColor:n.attr("data-foreColor")})},callback:function(e){e.find(".note-recent-color").css("background-color","#FFFF00"),e.attr("data-backColor","#FFFF00")}}),n.button({className:"dropdown-toggle",contents:n.icon(i.icons.caret,"span"),tooltip:r.color.more,data:{toggle:"dropdown"}}),n.dropdown({items:["<li>",'<div class="btn-group">',' <div class="note-palette-title">'+r.color.background+"</div>"," <div>",' <button type="button" class="note-color-reset btn btn-default" data-event="backColor" data-value="inherit">',r.color.transparent," </button>"," </div>",' <div class="note-holder" data-event="backColor"/>',"</div>",'<div class="btn-group">',' <div class="note-palette-title">'+r.color.foreground+"</div>"," <div>",' <button type="button" class="note-color-reset btn btn-default" data-event="removeFormat" data-value="foreColor">',r.color.resetToDefault," </button>"," </div>",' <div class="note-holder" data-event="foreColor"/>',"</div>","</li>"].join(""),callback:function(e){e.find(".note-holder").each((function(){var e=$(this);e.append(n.palette({colors:i.colors,eventName:e.data("event")}).render())}))},click:function(t){var n=$(t.target),o=n.data("event"),i=n.data("value");if(o&&i){var r="backColor"===o?"background-color":"color",A=n.closest(".note-color").find(".note-recent-color"),a=n.closest(".note-color").find(".note-current-color-button");A.css(r,i),a.attr("data-"+o,i),e.invoke("editor."+o,i)}}})]}).render()})),e.memo("button.ul",(function(){return n.button({contents:n.icon(i.icons.unorderedlist),tooltip:r.lists.unordered+a("insertUnorderedList"),click:e.createInvokeHandler("editor.insertUnorderedList")}).render()})),e.memo("button.ol",(function(){return n.button({contents:n.icon(i.icons.orderedlist),tooltip:r.lists.ordered+a("insertOrderedList"),click:e.createInvokeHandler("editor.insertOrderedList")}).render()}));var o=n.button({contents:n.icon(i.icons.alignLeft),tooltip:r.paragraph.left+a("justifyLeft"),click:e.createInvokeHandler("editor.justifyLeft")}),A=n.button({contents:n.icon(i.icons.alignCenter),tooltip:r.paragraph.center+a("justifyCenter"),click:e.createInvokeHandler("editor.justifyCenter")}),s=n.button({contents:n.icon(i.icons.alignRight),tooltip:r.paragraph.right+a("justifyRight"),click:e.createInvokeHandler("editor.justifyRight")}),l=n.button({contents:n.icon(i.icons.alignJustify),tooltip:r.paragraph.justify+a("justifyFull"),click:e.createInvokeHandler("editor.justifyFull")}),c=n.button({contents:n.icon(i.icons.outdent),tooltip:r.paragraph.outdent+a("outdent"),click:e.createInvokeHandler("editor.outdent")}),d=n.button({contents:n.icon(i.icons.indent),tooltip:r.paragraph.indent+a("indent"),click:e.createInvokeHandler("editor.indent")});e.memo("button.justifyLeft",func.invoke(o,"render")),e.memo("button.justifyCenter",func.invoke(A,"render")),e.memo("button.justifyRight",func.invoke(s,"render")),e.memo("button.justifyFull",func.invoke(l,"render")),e.memo("button.outdent",func.invoke(c,"render")),e.memo("button.indent",func.invoke(d,"render")),e.memo("button.paragraph",(function(){return n.buttonGroup([n.button({className:"dropdown-toggle",contents:n.icon(i.icons.alignLeft)+" "+n.icon(i.icons.caret,"span"),tooltip:r.paragraph.paragraph,data:{toggle:"dropdown"}}),n.dropdown([n.buttonGroup({className:"note-align",children:[o,A,s,l]}),n.buttonGroup({className:"note-list",children:[c,d]})])]).render()})),e.memo("button.height",(function(){return n.buttonGroup([n.button({className:"dropdown-toggle",contents:n.icon(i.icons.textHeight)+" "+n.icon(i.icons.caret,"span"),tooltip:r.font.height,data:{toggle:"dropdown"}}),n.dropdownCheck({items:i.lineHeights,checkClassName:i.icons.menuCheck,className:"dropdown-line-height",click:e.createInvokeHandler("editor.lineHeight")})]).render()})),e.memo("button.table",(function(){return n.buttonGroup([n.button({className:"dropdown-toggle",contents:n.icon(i.icons.table)+" "+n.icon(i.icons.caret,"span"),tooltip:r.table.table,data:{toggle:"dropdown"}}),n.dropdown({className:"note-table",items:['<div class="note-dimension-picker">',' <div class="note-dimension-picker-mousecatcher" data-event="insertTable" data-value="1x1"/>',' <div class="note-dimension-picker-highlighted"/>',' <div class="note-dimension-picker-unhighlighted"/>',"</div>",'<div class="note-dimension-display">1 x 1</div>'].join("")})],{callback:function(n){n.find(".note-dimension-picker-mousecatcher").css({width:i.insertTableMaxSize.col+"em",height:i.insertTableMaxSize.row+"em"}).mousedown(e.createInvokeHandler("editor.insertTable")).on("mousemove",t.tableMoveHandler)}}).render()})),e.memo("button.link",(function(){return n.button({contents:n.icon(i.icons.link),tooltip:r.link.link+a("linkDialog.show"),click:e.createInvokeHandler("linkDialog.show")}).render()})),e.memo("button.picture",(function(){return n.button({contents:n.icon(i.icons.picture),tooltip:r.image.image,click:e.createInvokeHandler("imageDialog.show")}).render()})),e.memo("button.video",(function(){return n.button({contents:n.icon(i.icons.video),tooltip:r.video.video,click:e.createInvokeHandler("videoDialog.show")}).render()})),e.memo("button.hr",(function(){return n.button({contents:n.icon(i.icons.minus),tooltip:r.hr.insert+a("insertHorizontalRule"),click:e.createInvokeHandler("editor.insertHorizontalRule")}).render()})),e.memo("button.fullscreen",(function(){return n.button({className:"btn-fullscreen",contents:n.icon(i.icons.arrowsAlt),tooltip:r.options.fullscreen,click:e.createInvokeHandler("fullscreen.toggle")}).render()})),e.memo("button.codeview",(function(){return n.button({className:"btn-codeview",contents:n.icon(i.icons.code),tooltip:r.options.codeview,click:e.createInvokeHandler("codeview.toggle")}).render()})),e.memo("button.redo",(function(){return n.button({contents:n.icon(i.icons.redo),tooltip:r.history.redo+a("redo"),click:e.createInvokeHandler("editor.redo")}).render()})),e.memo("button.undo",(function(){return n.button({contents:n.icon(i.icons.undo),tooltip:r.history.undo+a("undo"),click:e.createInvokeHandler("editor.undo")}).render()})),e.memo("button.help",(function(){return n.button({contents:n.icon(i.icons.question),tooltip:r.options.help,click:e.createInvokeHandler("helpDialog.show")}).render()}))},this.addImagePopoverButtons=function(){e.memo("button.imageSize100",(function(){return n.button({contents:'<span class="note-fontsize-10">100%</span>',tooltip:r.image.resizeFull,click:e.createInvokeHandler("editor.resize","1")}).render()})),e.memo("button.imageSize50",(function(){return n.button({contents:'<span class="note-fontsize-10">50%</span>',tooltip:r.image.resizeHalf,click:e.createInvokeHandler("editor.resize","0.5")}).render()})),e.memo("button.imageSize25",(function(){return n.button({contents:'<span class="note-fontsize-10">25%</span>',tooltip:r.image.resizeQuarter,click:e.createInvokeHandler("editor.resize","0.25")}).render()})),e.memo("button.floatLeft",(function(){return n.button({contents:n.icon(i.icons.alignLeft),tooltip:r.image.floatLeft,click:e.createInvokeHandler("editor.floatMe","left")}).render()})),e.memo("button.floatRight",(function(){return n.button({contents:n.icon(i.icons.alignRight),tooltip:r.image.floatRight,click:e.createInvokeHandler("editor.floatMe","right")}).render()})),e.memo("button.floatNone",(function(){return n.button({contents:n.icon(i.icons.alignJustify),tooltip:r.image.floatNone,click:e.createInvokeHandler("editor.floatMe","none")}).render()})),e.memo("button.removeMedia",(function(){return n.button({contents:n.icon(i.icons.trash),tooltip:r.image.remove,click:e.createInvokeHandler("editor.removeMedia")}).render()}))},this.addLinkPopoverButtons=function(){e.memo("button.linkDialogShow",(function(){return n.button({contents:n.icon(i.icons.link),tooltip:r.link.edit,click:e.createInvokeHandler("linkDialog.show")}).render()})),e.memo("button.unlink",(function(){return n.button({contents:n.icon(i.icons.unlink),tooltip:r.link.unlink,click:e.createInvokeHandler("editor.unlink")}).render()}))},this.build=function(t,o){for(var i=0,r=o.length;i<r;i++){for(var A=o[i],a=A[0],s=A[1],l=n.buttonGroup({className:"note-"+a}).render(),c=0,d=s.length;c<d;c++){var u=e.memo("button."+s[c]);u&&l.append("function"==typeof u?u(e):u)}l.appendTo(t)}},this.updateCurrentStyle=function(){var n=e.invoke("editor.currentStyle");if(this.updateBtnStates({".note-btn-bold":function(){return"bold"===n["font-bold"]},".note-btn-italic":function(){return"italic"===n["font-italic"]},".note-btn-underline":function(){return"underline"===n["font-underline"]},".note-btn-subscript":function(){return"subscript"===n["font-subscript"]},".note-btn-superscript":function(){return"superscript"===n["font-superscript"]},".note-btn-strikethrough":function(){return"strikethrough"===n["font-strikethrough"]}}),n["font-family"]){var i=n["font-family"].split(",").map((function(e){return e.replace(/[\'\"]/g,"").replace(/\s+$/,"").replace(/^\s+/,"")})),r=list.find(i,t.isFontInstalled);o.find(".dropdown-fontname li a").each((function(){var e=$(this).data("value")+""==r+"";this.className=e?"checked":""})),o.find(".note-current-fontname").text(r)}if(n["font-size"]){var A=n["font-size"];o.find(".dropdown-fontsize li a").each((function(){var e=$(this).data("value")+""==A+"";this.className=e?"checked":""})),o.find(".note-current-fontsize").text(A)}if(n["line-height"]){var a=n["line-height"];o.find(".dropdown-line-height li a").each((function(){var e=$(this).data("value")+""==a+"";this.className=e?"checked":""}))}},this.updateBtnStates=function(e){$.each(e,(function(e,t){n.toggleBtnActive(o.find(e),t())}))},this.tableMoveHandler=function(e){var t,n=$(e.target.parentNode),o=n.next(),r=n.find(".note-dimension-picker-mousecatcher"),A=n.find(".note-dimension-picker-highlighted"),a=n.find(".note-dimension-picker-unhighlighted");if(void 0===e.offsetX){var s=$(e.target).offset();t={x:e.pageX-s.left,y:e.pageY-s.top}}else t={x:e.offsetX,y:e.offsetY};var l=Math.ceil(t.x/18)||1,c=Math.ceil(t.y/18)||1;A.css({width:l+"em",height:c+"em"}),r.data("value",l+"x"+c),3<l&&l<i.insertTableMaxSize.col&&a.css({width:l+1+"em"}),3<c&&c<i.insertTableMaxSize.row&&a.css({height:c+1+"em"}),o.html(l+" x "+c)}},Toolbar=function(e){var t=$.summernote.ui,n=e.layoutInfo.note,o=e.layoutInfo.toolbar,i=e.options;this.shouldInitialize=function(){return!i.airMode},this.initialize=function(){i.toolbar=i.toolbar||[],i.toolbar.length?e.invoke("buttons.build",o,i.toolbar):o.hide(),i.toolbarContainer&&o.appendTo(i.toolbarContainer),n.on("summernote.keyup summernote.mouseup summernote.change",(function(){e.invoke("buttons.updateCurrentStyle")})),e.invoke("buttons.updateCurrentStyle")},this.destroy=function(){o.children().remove()},this.updateFullscreen=function(e){t.toggleBtnActive(o.find(".btn-fullscreen"),e)},this.updateCodeview=function(e){t.toggleBtnActive(o.find(".btn-codeview"),e),e?this.deactivate():this.activate()},this.activate=function(e){var n=o.find("button");e||(n=n.not(".btn-codeview")),t.toggleBtn(n,!0)},this.deactivate=function(e){var n=o.find("button");e||(n=n.not(".btn-codeview")),t.toggleBtn(n,!1)}},LinkDialog=function(e){var t=this,n=$.summernote.ui,o=e.layoutInfo.editor,i=e.options,r=i.langInfo;this.shouldInitialize=function(){return!i.airMode},this.initialize=function(){var e=i.dialogsInBody?$(document.body):o,t='<div class="form-group"><label>'+r.link.textToDisplay+'</label><input class="note-link-text form-control" type="text" /></div><div class="form-group"><label>'+r.link.url+'</label><input class="note-link-url form-control" type="text" value="http://" /></div>'+(i.disableLinkTarget?"":'<div class="checkbox"><label><input type="checkbox" checked> '+r.link.openInNewWindow+"</label></div>"),A='<button href="#" class="btn btn-primary note-link-btn disabled" disabled>'+r.link.insert+"</button>";this.$dialog=n.dialog({className:"link-dialog",title:r.link.insert,fade:i.dialogsFade,body:t,footer:A}).render().appendTo(e)},this.destroy=function(){n.hideDialog(this.$dialog),this.$dialog.remove()},this.bindEnterKey=function(e,t){e.on("keypress",(function(e){e.keyCode===key.code.ENTER&&t.trigger("click")}))},this.toggleLinkBtn=function(e,t,o){n.toggleBtn(e,t.val()&&o.val())},this.showLinkDialog=function(o){return $.Deferred((function(i){var r=t.$dialog.find(".note-link-text"),A=t.$dialog.find(".note-link-url"),a=t.$dialog.find(".note-link-btn"),s=t.$dialog.find("input[type=checkbox]");n.onDialogShown(t.$dialog,(function(){e.triggerEvent("dialog.shown"),o.url||(o.url=o.text),r.val(o.text);var n=function(){t.toggleLinkBtn(a,r,A),o.text=r.val()};r.on("input",n).on("paste",(function(){setTimeout(n,0)}));var l=function(){t.toggleLinkBtn(a,r,A),o.text||r.val(A.val())};A.on("input",l).on("paste",(function(){setTimeout(l,0)})).val(o.url).trigger("focus"),t.toggleLinkBtn(a,r,A),t.bindEnterKey(A,a),t.bindEnterKey(r,a),s.prop("checked",o.isNewWindow),a.one("click",(function(e){e.preventDefault(),i.resolve({range:o.range,url:A.val(),text:r.val(),isNewWindow:s.is(":checked")}),t.$dialog.modal("hide")}))})),n.onDialogHidden(t.$dialog,(function(){r.off("input paste keypress"),A.off("input paste keypress"),a.off("click"),"pending"===i.state()&&i.reject()})),n.showDialog(t.$dialog)})).promise()},this.show=function(){var t=e.invoke("editor.getLinkInfo");e.invoke("editor.saveRange"),this.showLinkDialog(t).then((function(t){e.invoke("editor.restoreRange"),e.invoke("editor.createLink",t)})).fail((function(){e.invoke("editor.restoreRange")}))},e.memo("help.linkDialog.show",i.langInfo.help["linkDialog.show"])},LinkPopover=function(e){var t=this,n=$.summernote.ui,o=e.options;this.events={"summernote.keyup summernote.mouseup summernote.change summernote.scroll":function(){t.update()},"summernote.dialog.shown":function(){t.hide()}},this.shouldInitialize=function(){return!list.isEmpty(o.popover.link)},this.initialize=function(){this.$popover=n.popover({className:"note-link-popover",callback:function(e){e.find(".popover-content").prepend('<span><a target="_blank"></a>&nbsp;</span>')}}).render().appendTo("body");var t=this.$popover.find(".popover-content");e.invoke("buttons.build",t,o.popover.link)},this.destroy=function(){this.$popover.remove()},this.update=function(){if(e.invoke("editor.hasFocus")){var t=e.invoke("editor.createRange");if(t.isCollapsed()&&t.isOnAnchor()){var n=dom.ancestor(t.sc,dom.isAnchor),o=$(n).attr("href");this.$popover.find("a").attr("href",o).html(o);var i=dom.posFromPlaceholder(n);this.$popover.css({display:"block",left:i.left,top:i.top})}else this.hide()}else this.hide()},this.hide=function(){this.$popover.hide()}},ImageDialog=function(e){var t=this,n=$.summernote.ui,o=e.layoutInfo.editor,i=e.options,r=i.langInfo;this.shouldInitialize=function(){return!i.airMode},this.initialize=function(){var e=i.dialogsInBody?$(document.body):o,t="";if(i.maximumImageFileSize){var A=Math.floor(Math.log(i.maximumImageFileSize)/Math.log(1024)),a=1*(i.maximumImageFileSize/Math.pow(1024,A)).toFixed(2)+" "+" KMGTP"[A]+"B";t="<small>"+r.image.maximumFileSize+" : "+a+"</small>"}var s='<div class="form-group note-group-select-from-files"><label>'+r.image.selectFromFiles+'</label><input class="note-image-input form-control" type="file" name="files" accept="image/*" multiple="multiple" />'+t+'</div><div class="form-group note-group-image-url" style="overflow:auto;"><label>'+r.image.url+'</label><input class="note-image-url form-control col-md-12" type="text" /></div>',l='<button href="#" class="btn btn-primary note-image-btn disabled" disabled>'+r.image.insert+"</button>";this.$dialog=n.dialog({title:r.image.insert,fade:i.dialogsFade,body:s,footer:l}).render().appendTo(e)},this.destroy=function(){n.hideDialog(this.$dialog),this.$dialog.remove()},this.bindEnterKey=function(e,t){e.on("keypress",(function(e){e.keyCode===key.code.ENTER&&t.trigger("click")}))},this.show=function(){e.invoke("editor.saveRange"),this.showImageDialog().then((function(o){n.hideDialog(t.$dialog),e.invoke("editor.restoreRange"),"string"==typeof o?e.invoke("editor.insertImage",o):e.invoke("editor.insertImagesOrCallback",o)})).fail((function(){e.invoke("editor.restoreRange")}))},this.showImageDialog=function(){return $.Deferred((function(o){var i=t.$dialog.find(".note-image-input"),r=t.$dialog.find(".note-image-url"),A=t.$dialog.find(".note-image-btn");n.onDialogShown(t.$dialog,(function(){e.triggerEvent("dialog.shown"),i.replaceWith(i.clone().on("change",(function(){o.resolve(this.files||this.value)})).val("")),A.click((function(e){e.preventDefault(),o.resolve(r.val())})),r.on("keyup paste",(function(){var e=r.val();n.toggleBtn(A,e)})).val("").trigger("focus"),t.bindEnterKey(r,A)})),n.onDialogHidden(t.$dialog,(function(){i.off("change"),r.off("keyup paste keypress"),A.off("click"),"pending"===o.state()&&o.reject()})),n.showDialog(t.$dialog)}))}},ImagePopover=function(e){var t=$.summernote.ui,n=e.options;this.shouldInitialize=function(){return!list.isEmpty(n.popover.image)},this.initialize=function(){this.$popover=t.popover({className:"note-image-popover"}).render().appendTo("body");var o=this.$popover.find(".popover-content");e.invoke("buttons.build",o,n.popover.image)},this.destroy=function(){this.$popover.remove()},this.update=function(e){if(dom.isImg(e)){var t=dom.posFromPlaceholder(e);this.$popover.css({display:"block",left:t.left,top:t.top})}else this.hide()},this.hide=function(){this.$popover.hide()}},VideoDialog=function(e){var t=this,n=$.summernote.ui,o=e.layoutInfo.editor,i=e.options,r=i.langInfo;this.shouldInitialize=function(){return!i.airMode},this.initialize=function(){var e=i.dialogsInBody?$(document.body):o,t='<div class="form-group row-fluid"><label>'+r.video.url+' <small class="text-muted">'+r.video.providers+'</small></label><input class="note-video-url form-control span12" type="text" /></div>',A='<button href="#" class="btn btn-primary note-video-btn disabled" disabled>'+r.video.insert+"</button>";this.$dialog=n.dialog({title:r.video.insert,fade:i.dialogsFade,body:t,footer:A}).render().appendTo(e)},this.destroy=function(){n.hideDialog(this.$dialog),this.$dialog.remove()},this.bindEnterKey=function(e,t){e.on("keypress",(function(e){e.keyCode===key.code.ENTER&&t.trigger("click")}))},this.createVideoNode=function(e){var t,n=e.match(/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/),o=e.match(/(?:www\.|\/\/)instagram\.com\/p\/(.[a-zA-Z0-9_-]*)/),i=e.match(/\/\/vine\.co\/v\/([a-zA-Z0-9]+)/),r=e.match(/\/\/(player\.)?vimeo\.com\/([a-z]*\/)*([0-9]{6,11})[?]?.*/),A=e.match(/.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/),a=e.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),s=e.match(/^.+.(mp4|m4v)$/),l=e.match(/^.+.(ogg|ogv)$/),c=e.match(/^.+.(webm)$/);if(n&&11===n[1].length){var d=n[1];t=$("<iframe>").attr("frameborder",0).attr("src","//www.youtube.com/embed/"+d).attr("width","640").attr("height","360")}else if(o&&o[0].length)t=$("<iframe>").attr("frameborder",0).attr("src","https://instagram.com/p/"+o[1]+"/embed/").attr("width","612").attr("height","710").attr("scrolling","no").attr("allowtransparency","true");else if(i&&i[0].length)t=$("<iframe>").attr("frameborder",0).attr("src",i[0]+"/embed/simple").attr("width","600").attr("height","600").attr("class","vine-embed");else if(r&&r[3].length)t=$("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("frameborder",0).attr("src","//player.vimeo.com/video/"+r[3]).attr("width","640").attr("height","360");else if(A&&A[2].length)t=$("<iframe>").attr("frameborder",0).attr("src","//www.dailymotion.com/embed/video/"+A[2]).attr("width","640").attr("height","360");else if(a&&a[1].length)t=$("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("frameborder",0).attr("height","498").attr("width","510").attr("src","//player.youku.com/embed/"+a[1]);else{if(!(s||l||c))return!1;t=$("<video controls>").attr("src",e).attr("width","640").attr("height","360")}return t.addClass("note-video-clip"),t[0]},this.show=function(){var o=e.invoke("editor.getSelectedText");e.invoke("editor.saveRange"),this.showVideoDialog(o).then((function(o){n.hideDialog(t.$dialog),e.invoke("editor.restoreRange");var i=t.createVideoNode(o);i&&e.invoke("editor.insertNode",i)})).fail((function(){e.invoke("editor.restoreRange")}))},this.showVideoDialog=function(o){return $.Deferred((function(i){var r=t.$dialog.find(".note-video-url"),A=t.$dialog.find(".note-video-btn");n.onDialogShown(t.$dialog,(function(){e.triggerEvent("dialog.shown"),r.val(o).on("input",(function(){n.toggleBtn(A,r.val())})).trigger("focus"),A.click((function(e){e.preventDefault(),i.resolve(r.val())})),t.bindEnterKey(r,A)})),n.onDialogHidden(t.$dialog,(function(){r.off("input"),A.off("click"),"pending"===i.state()&&i.reject()})),n.showDialog(t.$dialog)}))}},HelpDialog=function(e){var t=this,n=$.summernote.ui,o=e.layoutInfo.editor,i=e.options,r=i.langInfo;this.shouldInitialize=function(){return!i.airMode},this.createShortCutList=function(){var t=i.keyMap[agent.isMac?"mac":"pc"];return Object.keys(t).map((function(n){var o=t[n],i=$('<div><div class="help-list-item"/></div>');return i.append($("<label><kbd>"+n+"</kdb></label>").css({width:180,"margin-right":10})).append($("<span/>").html(e.memo("help."+o)||o)),i.html()})).join("")},this.initialize=function(){var e=i.dialogsInBody?$(document.body):o,t=['<p class="text-center">','<a href="http://summernote.org/" target="_blank">Summernote 0.0.0-SNAPSHOT</a> · ','<a href="https://github.com/summernote/summernote" target="_blank">Project</a> · ','<a href="https://github.com/summernote/summernote/issues" target="_blank">Issues</a>',"</p>"].join("");this.$dialog=n.dialog({title:r.options.help,fade:i.dialogsFade,body:this.createShortCutList(),footer:t,callback:function(e){e.find(".modal-body").css({"max-height":300,overflow:"scroll"})}}).render().appendTo(e)},this.destroy=function(){n.hideDialog(this.$dialog),this.$dialog.remove()},this.showHelpDialog=function(){return $.Deferred((function(o){n.onDialogShown(t.$dialog,(function(){e.triggerEvent("dialog.shown"),o.resolve()})),n.showDialog(t.$dialog)})).promise()},this.show=function(){e.invoke("editor.saveRange"),this.showHelpDialog().then((function(){e.invoke("editor.restoreRange")}))}},AirPopover=function(e){var t=this,n=$.summernote.ui,o=e.options;this.events={"summernote.keyup summernote.mouseup summernote.scroll":function(){t.update()},"summernote.change summernote.dialog.shown":function(){t.hide()},"summernote.focusout":function(e,n){agent.isFF||n.relatedTarget&&dom.ancestor(n.relatedTarget,func.eq(t.$popover[0]))||t.hide()}},this.shouldInitialize=function(){return o.airMode&&!list.isEmpty(o.popover.air)},this.initialize=function(){this.$popover=n.popover({className:"note-air-popover"}).render().appendTo("body");var t=this.$popover.find(".popover-content");e.invoke("buttons.build",t,o.popover.air)},this.destroy=function(){this.$popover.remove()},this.update=function(){var t=e.invoke("editor.currentStyle");if(t.range&&!t.range.isCollapsed()){var n=list.last(t.range.getClientRects());if(n){var o=func.rect2bnd(n);this.$popover.css({display:"block",left:Math.max(o.left+o.width/2,0)-20,top:o.top+o.height})}}else this.hide()},this.hide=function(){this.$popover.hide()}},HintPopover=function(e){var t=this,n=$.summernote.ui,o=e.options.hint||[],i=e.options.hintDirection||"bottom",r=$.isArray(o)?o:[o];this.events={"summernote.keyup":function(e,n){n.isDefaultPrevented()||t.handleKeyup(n)},"summernote.keydown":function(e,n){t.handleKeydown(n)},"summernote.dialog.shown":function(){t.hide()}},this.shouldInitialize=function(){return r.length>0},this.initialize=function(){this.lastWordRange=null,this.$popover=n.popover({className:"note-hint-popover",hideArrow:!0,direction:""}).render().appendTo("body"),this.$popover.hide(),this.$content=this.$popover.find(".popover-content"),this.$content.on("click",".note-hint-item",(function(){t.$content.find(".active").removeClass("active"),$(this).addClass("active"),t.replace()}))},this.destroy=function(){this.$popover.remove()},this.selectItem=function(e){this.$content.find(".active").removeClass("active"),e.addClass("active"),this.$content[0].scrollTop=e[0].offsetTop-this.$content.innerHeight()/2},this.moveDown=function(){var e=this.$content.find(".note-hint-item.active"),t=e.next();if(t.length)this.selectItem(t);else{var n=e.parent().next();n.length||(n=this.$content.find(".note-hint-group").first()),this.selectItem(n.find(".note-hint-item").first())}},this.moveUp=function(){var e=this.$content.find(".note-hint-item.active"),t=e.prev();if(t.length)this.selectItem(t);else{var n=e.parent().prev();n.length||(n=this.$content.find(".note-hint-group").last()),this.selectItem(n.find(".note-hint-item").last())}},this.replace=function(){var t=this.$content.find(".note-hint-item.active");if(t.length){var n=this.nodeFromItem(t);this.lastWordRange.insertNode(n),range.createFromNode(n).collapse().select(),this.lastWordRange=null,this.hide(),e.invoke("editor.focus")}},this.nodeFromItem=function(e){var t=r[e.data("index")],n=e.data("item"),o=t.content?t.content(n):n;return"string"==typeof o&&(o=dom.createText(o)),o},this.createItemTemplates=function(e,t){var n=r[e];return t.map((function(t,o){var i=$('<div class="note-hint-item"/>');return i.append(n.template?n.template(t):t+""),i.data({index:e,item:t}),0===e&&0===o&&i.addClass("active"),i}))},this.handleKeydown=function(e){this.$popover.is(":visible")&&(e.keyCode===key.code.ENTER?(e.preventDefault(),this.replace()):e.keyCode===key.code.UP?(e.preventDefault(),this.moveUp()):e.keyCode===key.code.DOWN&&(e.preventDefault(),this.moveDown()))},this.searchKeyword=function(e,t,n){var o=r[e];if(o&&o.match.test(t)&&o.search){var i=o.match.exec(t);o.search(i[1],n)}else n()},this.createGroup=function(e,n){var o=$('<div class="note-hint-group note-hint-group-'+e+'"/>');return this.searchKeyword(e,n,(function(n){(n=n||[]).length&&(o.html(t.createItemTemplates(e,n)),t.show())})),o},this.handleKeyup=function(n){if(list.contains([key.code.ENTER,key.code.UP,key.code.DOWN],n.keyCode)){if(n.keyCode===key.code.ENTER&&this.$popover.is(":visible"))return}else{var o=e.invoke("editor.createRange").getWordRange(),A=o.toString();if(r.length&&A){this.$content.empty();var a=func.rect2bnd(list.last(o.getClientRects()));a&&(this.$popover.hide(),this.lastWordRange=o,r.forEach((function(e,n){e.match.test(A)&&t.createGroup(n,A).appendTo(t.$content)})),"top"===i?this.$popover.css({left:a.left,top:a.top-this.$popover.outerHeight()-5}):this.$popover.css({left:a.left,top:a.top+a.height+5}))}else this.hide()}},this.show=function(){this.$popover.show()},this.hide=function(){this.$popover.hide()}};$.summernote=$.extend($.summernote,{version:"0.0.0-SNAPSHOT",ui:ui,dom:dom,plugins:{},options:{modules:{editor:Editor,clipboard:Clipboard,dropzone:Dropzone,codeview:Codeview,statusbar:Statusbar,fullscreen:Fullscreen,handle:Handle,hintPopover:HintPopover,autoLink:AutoLink,autoSync:AutoSync,placeholder:Placeholder,buttons:Buttons,toolbar:Toolbar,linkDialog:LinkDialog,linkPopover:LinkPopover,imageDialog:ImageDialog,imagePopover:ImagePopover,videoDialog:VideoDialog,helpDialog:HelpDialog,airPopover:AirPopover},buttons:{},lang:"en-US",toolbar:[["style",["style"]],["font",["bold","underline","clear"]],["fontname",["fontname"]],["color",["color"]],["para",["ul","ol","paragraph"]],["table",["table"]],["insert",["link","picture","video"]],["view",["fullscreen","codeview","help"]]],popover:{image:[["imagesize",["imageSize100","imageSize50","imageSize25"]],["float",["floatLeft","floatRight","floatNone"]],["remove",["removeMedia"]]],link:[["link",["linkDialogShow","unlink"]]],air:[["color",["color"]],["font",["bold","underline","clear"]],["para",["ul","paragraph"]],["table",["table"]],["insert",["link","picture"]]]},airMode:!1,width:null,height:null,focus:!1,tabSize:4,styleWithSpan:!0,shortcuts:!0,textareaAutoSync:!0,direction:null,styleTags:["p","blockquote","pre","h1","h2","h3","h4","h5","h6"],fontNames:["Arial","Arial Black","Comic Sans MS","Courier New","Helvetica Neue","Helvetica","Impact","Lucida Grande","Tahoma","Times New Roman","Verdana"],fontSizes:["8","9","10","11","12","14","18","24","36"],colors:[["#000000","#424242","#636363","#9C9C94","#CEC6CE","#EFEFEF","#F7F7F7","#FFFFFF"],["#FF0000","#FF9C00","#FFFF00","#00FF00","#00FFFF","#0000FF","#9C00FF","#FF00FF"],["#F7C6CE","#FFE7CE","#FFEFC6","#D6EFD6","#CEDEE7","#CEE7F7","#D6D6E7","#E7D6DE"],["#E79C9C","#FFC69C","#FFE79C","#B5D6A5","#A5C6CE","#9CC6EF","#B5A5D6","#D6A5BD"],["#E76363","#F7AD6B","#FFD663","#94BD7B","#73A5AD","#6BADDE","#8C7BC6","#C67BA5"],["#CE0000","#E79439","#EFC631","#6BA54A","#4A7B8C","#3984C6","#634AA5","#A54A7B"],["#9C0000","#B56308","#BD9400","#397B21","#104A5A","#085294","#311873","#731842"],["#630000","#7B3900","#846300","#295218","#083139","#003163","#21104A","#4A1031"]],lineHeights:["1.0","1.2","1.4","1.5","1.6","1.8","2.0","3.0"],tableClassName:"table table-bordered",insertTableMaxSize:{col:10,row:10},dialogsInBody:!1,dialogsFade:!1,maximumImageFileSize:null,callbacks:{onInit:null,onFocus:null,onBlur:null,onEnter:null,onKeyup:null,onKeydown:null,onImageUpload:null,onImageUploadError:null},codemirror:{mode:"text/html",htmlMode:!0,lineNumbers:!0},keyMap:{pc:{ENTER:"insertParagraph","CTRL+Z":"undo","CTRL+Y":"redo",TAB:"tab","SHIFT+TAB":"untab","CTRL+B":"bold","CTRL+I":"italic","CTRL+U":"underline","CTRL+SHIFT+S":"strikethrough","CTRL+BACKSLASH":"removeFormat","CTRL+SHIFT+L":"justifyLeft","CTRL+SHIFT+E":"justifyCenter","CTRL+SHIFT+R":"justifyRight","CTRL+SHIFT+J":"justifyFull","CTRL+SHIFT+NUM7":"insertUnorderedList","CTRL+SHIFT+NUM8":"insertOrderedList","CTRL+LEFTBRACKET":"outdent","CTRL+RIGHTBRACKET":"indent","CTRL+NUM0":"formatPara","CTRL+NUM1":"formatH1","CTRL+NUM2":"formatH2","CTRL+NUM3":"formatH3","CTRL+NUM4":"formatH4","CTRL+NUM5":"formatH5","CTRL+NUM6":"formatH6","CTRL+ENTER":"insertHorizontalRule","CTRL+K":"linkDialog.show"},mac:{ENTER:"insertParagraph","CMD+Z":"undo","CMD+SHIFT+Z":"redo",TAB:"tab","SHIFT+TAB":"untab","CMD+B":"bold","CMD+I":"italic","CMD+U":"underline","CMD+SHIFT+S":"strikethrough","CMD+BACKSLASH":"removeFormat","CMD+SHIFT+L":"justifyLeft","CMD+SHIFT+E":"justifyCenter","CMD+SHIFT+R":"justifyRight","CMD+SHIFT+J":"justifyFull","CMD+SHIFT+NUM7":"insertUnorderedList","CMD+SHIFT+NUM8":"insertOrderedList","CMD+LEFTBRACKET":"outdent","CMD+RIGHTBRACKET":"indent","CMD+NUM0":"formatPara","CMD+NUM1":"formatH1","CMD+NUM2":"formatH2","CMD+NUM3":"formatH3","CMD+NUM4":"formatH4","CMD+NUM5":"formatH5","CMD+NUM6":"formatH6","CMD+ENTER":"insertHorizontalRule","CMD+K":"linkDialog.show"}},icons:{align:"note-icon-align",alignCenter:"note-icon-align-center",alignJustify:"note-icon-align-justify",alignLeft:"note-icon-align-left",alignRight:"note-icon-align-right",indent:"note-icon-align-indent",outdent:"note-icon-align-outdent",arrowsAlt:"note-icon-arrows-alt",bold:"note-icon-bold",caret:"note-icon-caret",circle:"note-icon-circle",close:"note-icon-close",code:"note-icon-code",eraser:"note-icon-eraser",font:"note-icon-font",frame:"note-icon-frame",italic:"note-icon-italic",link:"note-icon-link",unlink:"note-icon-chain-broken",magic:"note-icon-magic",menuCheck:"note-icon-check",minus:"note-icon-minus",orderedlist:"note-icon-orderedlist",pencil:"note-icon-pencil",picture:"note-icon-picture",question:"note-icon-question",redo:"note-icon-redo",square:"note-icon-square",strikethrough:"note-icon-strikethrough",subscript:"note-icon-subscript",superscript:"note-icon-superscript",table:"note-icon-table",textHeight:"note-icon-text-height",trash:"note-icon-trash",underline:"note-icon-underline",undo:"note-icon-undo",unorderedlist:"note-icon-unorderedlist",video:"note-icon-video"}}})})),define("dashboard-core/js/dashboard/widgets/staticwidget/text/NormalizedPosition",["../../../../lib/@waca/core-client/js/core-client/ui/core/Class","jquery","underscore"],(function(e,t,n){var o=0,i=1,r=2,A=1,a=3;return e.extend({init:function(e,t){this.container=e,this.offset=t,this._normalize()},_normalize:function(){var e=null;this._setCursorPosition(),this.position===o?(this.container=this._findDeepestDescendant(this.container),(e=this._ensureNodeIsNontrivial(this.container))||(e=this._findNontrivialNode(this.container,!0),this.position=r),this.container=e):this.position===i?this.container.nodeType===A&&(this.container=this._findDeepestDescendant(this.container.childNodes[this.offset]),this.position=o):(this.container=this._findDeepestDescendant(this.container,!0),(e=this._findNontrivialNode(this.container))?this.position=o:e=this._ensureNodeIsNontrivial(this.container,!0),this.container=e),this._updateOffset()},_setCursorPosition:function(){this.container.nodeType===a?0===this.offset?this.position=o:this.offset===this.container.data.length?this.position=r:this.position=i:0===this.offset?this.position=o:this.container.childNodes.length&&this.offset===this.container.childNodes.length?this.position=r:this.container.childNodes.length||1!==this.offset?this.position=i:this.position=r},_updateOffset:function(){this.position===o?this.offset=0:this.position===r&&(this.offset=this.container.nodeType===a?this.container.data.length:this.container.childNodes.length)},_findDeepestDescendant:function(e,t){for(;e.firstChild;)e=t?e.lastChild:e.firstChild;return e},_isTrivialNode:function(e){return e&&e.nodeType===a&&""===e.data.trim()},_collectEquivalentNodes:function(e,t){var n=[];function o(e,t){n.push({container:e,offset:t?e.nodeType===a?e.data.length:e.childNodes.length:0})}o(e,!t);for(var i=null;!i&&e;)(i=t?e.previousSibling:e.nextSibling)?(i.childNodes.length&&(i=this._findDeepestDescendant(i,t)),this._isTrivialNode(i)&&(e=i,i=null,o(e,!1))):e=e.parentNode;return o(e?i:null,t),n},_findNontrivialNode:function(e,t){return this._collectEquivalentNodes(e,t).pop().container},_ensureNodeIsNontrivial:function(e,t){return this._isTrivialNode(e)?this._findNontrivialNode(e,t):e},equals:function(e){return this.container===e.container&&this.offset===e.offset},chooseDocumentPosition:function(e,r){r=r||"*";var A=[];return this.position===i?A.push(this):this.position===o?(A=this._collectEquivalentNodes(this.container,!0),e&&A.reverse()):((A=this._collectEquivalentNodes(this.container,!1)).splice(A.length-1,1),e||A.reverse()),n.find(A,(function(e){var n=e.container;return n.nodeType===a&&(n=n.parentNode),t(n).is(r)}))}})})),define("dashboard-core/js/dashboard/widgets/staticwidget/text/NormalizedRange",["../../../../lib/@waca/core-client/js/core-client/ui/core/Class","./NormalizedPosition"],(function(e,t){return e.extend({init:function(e){this.original=e,this.start=new t(e.startContainer,e.startOffset),this.end=new t(e.endContainer,e.endOffset)},isCursor:function(){return this.start.equals(this.end)},toDocumentRange:function(e){var t=document.createRange(),n=this.start.chooseDocumentPosition(!1,e);if(!n)return null;t.setStart(n.container,n.offset);var o=null;return o=this.isCursor()?n:this.end.chooseDocumentPosition(!0,e),t.setEnd(o.container,o.offset),t}})})),define("dashboard-core/js/dashboard/widgets/staticwidget/text/NormalizedSelection",["../../../../lib/@waca/core-client/js/core-client/ui/core/Class","./NormalizedRange"],(function(e,t){return e.extend({init:function(e){this.original=e,this.isCursor=e.isCollapsed,this.ranges=[];for(var n=0;n<e.rangeCount;n++)this.ranges.push(new t(e.getRangeAt(n)))}})})),define("dashboard-core/js/dashboard/widgets/staticwidget/text/ContentEditableSelectionManager",["../../../../lib/@waca/core-client/js/core-client/ui/core/Class","./NormalizedPosition","./NormalizedSelection","jquery","underscore"],(function(e,t,n,o,i){return e.extend({init:function(e,t){this.node=o(e),this.editableNodesSelector=t},_getEditableNodes:function(){return this.node.find(this.editableNodesSelector)},_isInEditableNode:function(e){return!!this._getEditableNodes().filter((function(t,n){return n===e||o.contains(n,e)})).length},filterKeypress:function(e){var r=!1,A=!1,a=!1;if(8===e.which?(r=!0,A=!0):(e.ctrlKey||e.metaKey)&&(a=83===e.which||90===e.which||89===e.which),r){var s,l=new n(document.getSelection());s=o(this.node[0]).find(".note-editable")?new t(o(this.node[0]).find(".note-editable").get(0),0):new t(this.node[0],0),a=i.find(l.ranges,(function(e){return e.isCursor()===A&&e.start.equals(s)}))}a&&e.preventDefault()}})})),define("dashboard-core/js/dashboard/util/TextFitUtil",["textfit"],(function(e){return function(){function t(){_classCallCheck(this,t)}return t.fillText=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{e(t,n)}catch(e){this._forceFitText(t)}},t._forceFitText=function(e){var t=e.innerHTML,n=e.getElementsByClassName("textFitted");if(n[0])return n[0].style.fontSize="0.1px";(n=document.createElement("span")).className="textFitted",n.style.display="inline-block",n.innerHTML=t,n.style.fontSize="0.1px",e.innerHTML="",e.appendChild(n)},_createClass(t,null,[{key:"_textFit",set:function(t){e=t}}]),t}()})),define("dashboard-core/js/lib/@waca/textwidget/src/js/base/core/agent",["jquery"],(function($){var isSupportAmd="function"==typeof define&&define.amd,isFontInstalled=function(e){var t="Comic Sans MS"===e?"Courier New":"Comic Sans MS",n=$("<div>").css({position:"absolute",left:"-9999px",top:"-9999px",fontSize:"200px"}).text("mmmmmmmmmwwwwwww").appendTo(document.body),o=n.css("fontFamily",t).width(),i=n.css("fontFamily",e+","+t).width();return n.remove(),o!==i},userAgent=navigator.userAgent,isMSIE=/MSIE|Trident/i.test(userAgent),browserVersion;if(isMSIE){var matches=/MSIE (\d+[.]\d+)/.exec(userAgent);matches&&(browserVersion=parseFloat(matches[1])),matches=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(userAgent),matches&&(browserVersion=parseFloat(matches[1]))}var isEdge=/Edge\/\d+/.test(userAgent),hasCodeMirror=!!window.CodeMirror;if(!hasCodeMirror&&isSupportAmd&&"undefined"!=typeof require)if(void 0!==require.resolve)try{require.resolve("codemirror"),hasCodeMirror=!0}catch(e){}else void 0!==eval("require").specified&&(hasCodeMirror=eval("require").specified("codemirror"));var agent={isMac:navigator.appVersion.indexOf("Mac")>-1,isMSIE:isMSIE,isEdge:isEdge,isFF:!isEdge&&/firefox/i.test(userAgent),isPhantom:/PhantomJS/i.test(userAgent),isWebkit:!isEdge&&/webkit/i.test(userAgent),isChrome:!isEdge&&/chrome/i.test(userAgent),isSafari:!isEdge&&/safari/i.test(userAgent),browserVersion:browserVersion,jqueryVersion:parseFloat($.fn.jquery),isSupportAmd:isSupportAmd,hasCodeMirror:hasCodeMirror,isFontInstalled:isFontInstalled,isW3CRangeSupport:!!document.createRange};return agent})),define("dashboard-core/js/dashboard/util/TextEditor",["underscore","../../lib/@waca/core-client/js/core-client/utils/BrowserUtils","../../lib/@waca/core-client/js/core-client/ui/core/Class","../../lib/@waca/core-client/js/core-client/utils/Utils","../../lib/@waca/textwidget/dist/summernote","../../lib/@waca/dashboard-common/dist/utils/HtmlXSSUtils","../widgets/staticwidget/text/ContentEditableSelectionManager","../../lib/@waca/dashboard-common/dist/ui/dialogs/TextToolbarCompactDialog","../../lib/@waca/dashboard-common/dist/ui/AuthoringToolbar","../../app/nls/StringResources","../widgets/PropertiesUtil","jquery","./TextFitUtil","../../lib/@waca/textwidget/src/js/base/core/agent"],(function(e,t,n,o,i,r,A,a,s,l,c,d,u,h){var g=["<div>","<p>","<span>","<b>","<u>","<i>","<br>","<font>","<strong>","<em>","<ul>","<ol>","<li>"],f=["color","font-bold","font-family","font-italic","font-size","font-strikethrough","font-subscript","font-superscript","font-underline","insertOrderedList","insertUnorderedList","text-align","text-format"],p=n.extend({SUMMERNOTE_CLASS:".summernote",EDITING_AREA:".note-editable",TEXT_FITTED:".textFitted",savedSel:null,isResponsive:!1,autoSaveInterval:2e3,isBold:!1,init:function(e){this.node=e.node,this.isResponsive=e.isResponsive,this.initSummernote(),this.getEditingArea().attr("contenteditable",!1),this.container=e.container,this.widget=e.widget,this.colorsService=this.widget.getDashboardApi().getFeature("Colors");var t=this.widget.getDashboardApi().getFeature("DashboardSettings").get("fonts"),n=Array.isArray(t)?t.concat(p.FONTFAMILY_CHOICES):p.FONTFAMILY_CHOICES;this._toolbarDock=this.widget.getDashboardApi().getFeature("ToolbarDock"),this._contentActions=this.widget.getDashboardApi().getFeature("ContentActions"),this._dashboardState=this.widget.getDashboardApi().getFeature("DashboardState"),this._icons=this.widget.getDashboardApi().getFeature("Icons"),this.toolbarNode=e.toolbarNode,this._fontFamilyChoices=e.fonts||n,this._fontSizeChoices=e.fontSizes||p.FONTSIZE_CHOICES,this.shouldResizeViz=e.shouldResizeViz,this.supportsLists=e.supportsLists,this.numberOfLines=1,this.toolbar=new s({container:d("body"),placement:"top",noFocus:!0});var o=!1;this._ext=e.extension||{},this._ext.isTextWrapOn&&(o=!0),this.textToolbar=new a({onStateChange:this.onToolbarStateChange.bind(this),textNode:this.getEditingArea(),properties:this.getToolbarProperties(),initialState:e.initialState,supportsLists:e.supportsLists,supportsTextWrap:o}),this.fillText();var i=this._ext.onInit;i&&i(this),this.lastSavedData=this.getContent(),this.toolbar.on("toolbar:hide",this.hideTextToolbar,this),this.widget.eventRouter.on("textToolbar:hide",this.hideTextToolbar,this),this.widget.eventRouter.on("widget:hideToolbar",this.hideTextToolbar,this)},initSummernote:function(){var e,t=this.node.children(this.SUMMERNOTE_CLASS);if(t.length||(this.node.children().length&&(e=this.node.html(),this.node.children().remove()),t=this.node.append('<div class="summernote"></div>').children(".summernote")),!!!t.data("summernote")&&(e=e||this.getEditingArea().remove().html(),this.node.find(".note-editor").remove(),t.summernote({airMode:!0,popover:{},disableDragAndDrop:!0,lineWrapping:!0,keyMap:this._getSummernoteShortcuts()}),e&&r.isValidHtmlContent(e))){var n=this.getEditingArea();n.html(r.cleanseContentElements(e,g,!0)),n.find(">p").css("font-size","")}},getDefaultFont:function(){var e="";return this._fontFamilyChoices.forEach((function(t){!0===t.default&&(e+=t.value)})),{id:e}},_getSummernoteShortcuts:function(){return{pc:{ENTER:"insertParagraph","CTRL+Z":"undo","CTRL+Y":"redo",TAB:"","SHIFT+TAB":"","CTRL+B":"bold","CTRL+I":"italic","CTRL+U":"underline","CTRL+SHIFT+L":"justifyLeft","CTRL+SHIFT+E":"justifyCenter","CTRL+SHIFT+R":"justifyRight","CTRL+SHIFT+NUM7":"","CTRL+SHIFT+NUM8":""},mac:{ENTER:"insertParagraph","CMD+Z":"undo","CMD+SHIFT+Z":"redo",TAB:"","SHIFT+TAB":"","CMD+B":"bold","CMD+I":"italic","CMD+U":"underline","CMD+SHIFT+L":"justifyLeft","CMD+SHIFT+E":"justifyCenter","CMD+SHIFT+R":"justifyRight","CMD+SHIFT+NUM7":"","CMD+SHIFT+NUM8":""}}},destroy:function(){this.toolbar&&(this.toolbar.remove(),this.toolbar=null),this.textToolbar&&(this.textToolbar.remove(),this.textToolbar=null),this.selectionManager=null,this._getSummerNote().summernote("destroy")},initContentEditable:function(e){this.selectionManager=new A(this.node,e)},setText:function(e){this.getEditingArea().html(r.cleanseContentElements(e,g,!0)),this.editingAreaHeight=this._getHeight();var t=this._ext.onSetText;t&&t(this)},getNode:function(){return this.node},_putBackFocusOnText:function(){this.setFocus(),this.widget.eventRouter.off("widget:hideToolbar:done")},setFocus:function(){this._getSummerNote().summernote("focus")},selectionBindNodeEvents:function(){this.fnSelectionOnKeyDown=this.selectionOnKeyDown.bind(this),this.node.on("keydown",this.fnSelectionOnKeyDown)},selectionUnbindNodeEvents:function(){this.fnSelectionOnKeyDown&&(this.node.off("keydown",this.fnSelectionOnKeyDown),this.fnSelectionOnKeyDown=null)},selectionOnKeyDown:function(e){this.selectionManager.filterKeypress(e)},addEditingEvents:function(e){this.detachEnterEditEvents(),this.bindNodeEvents(),this._startAutoSaver(e);var t=this._ext.onEditStart;t&&t(this)},removeEditingEvents:function(e){this.unbindNodeEvents(),this._stopAutoSaver(e),this.attachEnterEditEvents();var t=this._ext.onEditEnd;t&&t(this)},onInitialTouchDown:function(){this.hasInitiallyTouchedDown=!0},onInitialTouchUp:function(){this.hasInitiallyTouchedDown?(this.hasInitiallyTouchedDown=!1,this.widget.eventRouter.trigger("widget:hideToolbar"),this.widget.eventRouter.on("widget:hideToolbar:done",this._putBackFocusOnText,this),this.toggleEditing(!0)):this.widget.eventRouter.off("widget:hideToolbar:done")},attachEnterEditEvents:function(){!this.fnTouchDown&&this.widget.isAuthoringMode&&this.widget.chromeSelected&&(this.fnTouchDown=this.onInitialTouchDown.bind(this),this.fnTouchUp=this.onInitialTouchUp.bind(this),this.node.on("touchstart",this.fnTouchDown).on("touchend",this.fnTouchUp).on("mousedown",this.fnTouchDown).on("mouseup",this.fnTouchUp))},detachEnterEditEvents:function(){this.fnTouchDown&&(this.node.off("touchstart",this.fnTouchDown).off("touchend",this.fnTouchUp).off("mousedown",this.fnTouchDown).off("mouseup",this.fnTouchUp),this.fnTouchDown=null,this.fnTouchUp=null)},save:function(t){var n=this,o=this.getContent(),i=this.lastSavedData;if(this.isResponsive){var r=function(e){var t=d("<div>"+e+"</div>");return t.find(n.TEXT_FITTED).css("font-size",""),t.html()};o=r(o),i=r(i)}if((o=this._clearTruncateStyle(o))!==(i=this._clearTruncateStyle(i))){if(t)t.category="saveTitle",this.widget.onPropertyUpdate(t);else{var A=e.uniqueId("_text_");this.widget.onPropertyUpdate({category:"saveTitle",transactionId:A})}this.fillText()}},setTruncateOn:function(){this.getEditingArea().find(this.TEXT_FITTED).addClass("truncateTextOn"),this.getEditingArea().find("p").addClass("truncateText")},setTruncateOff:function(){this.getEditingArea().find(this.TEXT_FITTED).removeClass("truncateTextOn"),this.getEditingArea().find("p").removeClass("truncateText")},updateLastSavedText:function(e){this.lastSavedData!==e&&(this.lastSavedData=e)},_clearTruncateStyle:function(e){var t=d("<div>"+e+"</div>");return t.find("p").removeClass("truncateText"),t.html()},updateCssOnParagraphs:function(e,t){this.getEditingArea().find("p").removeClass(t),this.getEditingArea().find("p").addClass(e)},_startAutoSaver:function(e){this.autoSaverInterval||(this.save(e),this.autoSaverInterval=setInterval(this.save.bind(this),this.autoSaveInterval))},_stopAutoSaver:function(e){this.autoSaverInterval&&(this.save(e),clearInterval(this.autoSaverInterval),this.autoSaverInterval=null)},_isModifierKey:function(e){return e.ctrlKey||e.metaKey},onKeyDown:function(e){var t=this;if(e.stopPropagation(),!this.textIsEmpty()||8!==e.which&&46!==e.which||e.preventDefault(),13===e.which&&this._resizeViz(),9===e.which){var n=!1,o=!1,i=this.getSelectedListItems(),r=this._getRefinedSelectionRange();i.forEach((function(e){var i=d(e);!n&&i.parentsUntil(t.EDITING_AREA,"ul, ol").length>3&&(n=!0),!o&&t._isNodeStartSelected(e,r)&&(o=!0)})),i.length&&o?e.shiftKey?this._getSummerNote().summernote("outdent"):n||this._getSummerNote().summernote("indent"):e.shiftKey?this._focusToolbar():this._getSummerNote().summernote("tab"),e.preventDefault(),this.fillText(),this.save()}this.supportsLists&&(55===e.which||56===e.which)&&this._isModifierKey(e)&&e.shiftKey&&(this.modifyList(55===e.which?"insertUnorderedList":"insertOrderedList"),this.fillText(),this.save(),this.updatePropertiesIfNecessary()),this.selectionOnKeyDown(e)},_focusToolbar:function(){this._toolbarDock&&this._toolbarDock.isContentToolbarDocked()?this._toolbarDock.focusODT():this.toolbar.focus()},_isToolbarOpened:function(){return this.toolbar&&this.toolbar.isOpened},hideTextToolbar:function(){this._isToolbarOpened()&&this.toolbar.remove()},show:function(e){this.node.show(),this.fillText(),e&&this.toggleEditing(!0)},hide:function(){this.toggleEditing(!1),this.node.hide()},_getNumberOfLines:function(){return this.getEditingArea().find("p").length},_getHeight:function(){return this.getEditingArea().height()},_resizeVizIfHeightChanged:function(){this._getHeight()!==this.editingAreaHeight&&(this._resizeViz(),this.editingAreaHeight=this._getHeight())},_resizeViz:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{hideToolbar:!1};this.shouldResizeViz&&this.widget.widgetChromeEventRouter.trigger("title:resizeViz",e)},onKeyUp:function(e){27===e.which&&this._isToolbarOpened()?(this.hideTextToolbar(),this.node.focus()):27===e.which||123===e.which&&e.shiftKey?(e.stopPropagation(),this.toggleEditing(!1),this.container.focus()):8!==e.which&&46!==e.which||e.stopPropagation(),this._resizeVizIfHeightChanged(),this.numberOfLines=this._getNumberOfLines(),this.fillText(),this.updatePropertiesIfNecessary()},onMouseMove:function(e){this.hasMouseDownInside&&e.stopPropagation()},onMouseUp:function(e){this.hasMouseDownInside&&(this.hasMouseDownInside=!1,e.stopPropagation(),this.fnMouseMove&&(d(document).off("mousemove",this.fnMouseMove),this.fnMouseMove=null),this.fnMouseUp&&(d(document).off("mouseup",this.fnMouseUp),this.fnMouseUp=null))},onMouseDown:function(e){var t=e.target;"SELECT"===t.tagName||"INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||e.preventDefault()},onBlur:function(){this.selection=this.saveSelection()},onMouseDownInside:function(e){e.stopPropagation(),this.hasMouseDownInside=!0,this.fnMouseMove=this.onMouseMove.bind(this),this.fnMouseUp=this.onMouseUp.bind(this),d(document).on("mousemove",this.fnMouseMove).on("mouseup",this.fnMouseUp)},onTouchStart:function(e){e.stopPropagation()},keepTextSelected:function(){o.isIpad()&&(this.savedSel=this.saveSelection())},onTextSelected:function(){var e=this;if(!this.getEditingArea().is(document.activeElement))return Promise.resolve();this.selection&&(this.selection=null);var t=this._getSummerNote().summernote("createRange").toString();return t&&t===this.lastSelection?void 0:this.showTextToolbar().then((function(){e.delayedPropertyUpdate&&clearTimeout(e.delayedPropertyUpdate),e.delayedPropertyUpdate=setTimeout(function(){o.isIpad()&&d("SELECT:focus").length>0||(this.delayedPropertyUpdate=null,this.updatePropertiesIfNecessary())}.bind(e),500),e.lastSelection=t,o.isIpad()&&(e.savedSel=e.saveSelection())}))},bindNodeEvents:function(){this.fnOnKeyDown=this.onKeyDown.bind(this),this.fnOnKeyUp=this.onKeyUp.bind(this),this.fnOnPaste=this.onPaste.bind(this),this.node.on("keydown",this.fnOnKeyDown).on("keyup",this.fnOnKeyUp).on("paste",this.fnOnPaste),this.fnOnMouseDownInside=this.onMouseDownInside.bind(this),this.fnOnBlur=this.onBlur.bind(this),this.fnOnTouchStart=this.onTouchStart.bind(this),this.fnkeepTextSelected=this.keepTextSelected.bind(this),this.getEditingArea().on("mousedown",this.fnOnMouseDownInside).on("blur",this.fnOnBlur).on("touchstart",this.fnOnTouchStart).on("focusout",this.fnkeepTextSelected),this.fnMouseDown=this.onMouseDown.bind(this),this.fnSelectionChange=this.onTextSelected.bind(this),d(document).on("mousedown",this.fnMouseDown).on("selectionchange",this.fnSelectionChange)},unbindNodeEvents:function(){this.node.off("keydown",this.fnOnKeyDown).off("keyup",this.fnOnKeyUp).off("paste",this.fnOnPaste),this.getEditingArea().off("mousedown",this.fnOnMouseDownInside).off("touchstart",this.fnOnTouchStart).off("blur",this.fnOnBlur).off("focusout",this.fnkeepTextSelected),this.fnSelectionChange&&(d(document).off("selectionchange",this.fnSelectionChange),this.fnSelectionChange=null),this.fnMouseDown&&(d(document).off("mousedown",this.fnMouseDown),this.fnMouseDown=null)},_replaceContent:function(e){var t=this.node.find(this.EDITING_AREA),n=d(e.value).find(this.EDITING_AREA);t.html(n.html()),this._resizeVizIfHeightChanged()},_didContentChange:function(e){if(e){var t=d(e).find(this.EDITING_AREA).html(),n=this.getContent();return t&&n&&t!==n}return!1},applyContent:function(e){this.initSummernote(),this._didContentChange(e.value)?(this._replaceContent(e),"TranslationService"===e.sender&&this.fillText(),this.lastSavedData=this.getContent(),"UndoRedoController"===e.sender&&this.widget.placeholder&&this.widget.updatePlaceholder()):this.lastSavedData=this.getContent()},onPaste:function(e){this._pasteTextExtractedFromHTML(e),this.fillText()},_getWindow:function(){return window},_pasteTextExtractedFromHTML:function(e){var t;if(e.preventDefault(),e.originalEvent.clipboardData)t=e.originalEvent.clipboardData.getData("Text"),this._getWindow().document.execCommand("insertText",!1,t);else{t=this._getWindow().clipboardData.getData("Text");var n=this._getWindow().getSelection().getRangeAt(0);n.deleteContents(),n.insertNode(this._getWindow().document.createTextNode(t))}},isEditing:function(){return this.container.hasClass("editing")},onToolbarStateChange:function(e,t){var n=t&&t.restoreDefaults;for(var o in n&&this._getSummerNote().summernote("removeFormat"),e)if("underline"===o||"bold"===o||"italic"===o){var i=e[o];n&&!i||this.modifyTextFormat(o,t)}else"fontSize"===o?this.onFontSizeUpdate(o,e.fontSize):"font"===o?this.onFontFamilyUpdate("fontFamily",e.font):"color"===o?this._isHexColor(e.color)?this.modifyTextColor(this._findColorIdFromHex(e.color)):this.modifyTextColor(e.color):"justifyLeft"===o||"justifyRight"===o||"justifyCenter"===o?e[o]&&this.modifyTextAlignment(o):"insertUnorderedList"===o||"insertOrderedList"===o?this.modifyList(o,e[o]):"textWrap"===o&&this._ext.onTextWrapChanged(e[o]);this.updatePropertiesIfNecessary(),t&&t.silent||(this.lastActiveStyles=this.getActiveStyles(),this.fillText(),this.save(),this.widget.refreshPropertiesPane())},_findColorHexFromId:function(t){var n=this._getTextColorChoices(),o=e.find(n,(function(e){return e.id===t}));return!o&&this.colorsService.isCustomColor(t)?this.colorsService.getHexColorFromClassName(t):o?o.hexValue:o},_findColorIdFromHex:function(t){var n=this._getTextColorChoices(),o=e.find(n,(function(e){return e.hexValue.toUpperCase()===t.toUpperCase()}));return o?o?o.id:o:this.colorsService.getColorClassName(t)},convertStyleToToolbarState:function(t){var n={};return t["font-size"]&&(n.fontSize=t["font-size"]+""),t.color&&(n.color=this._findColorHexFromId(t.color)),t["font-family"]&&(n.font=this._convertCssToFontId(t["font-family"])[0]),t["text-align"]&&(n[t["text-align"]]=!0),n.insertUnorderedList=t.insertUnorderedList,n.insertOrderedList=t.insertOrderedList,n.bold=n.underline=n.italic=!1,e.each(t["text-format"],(function(e){n[e]=!0})),n},showTextToolbar:function(){var e=this;if(this._toolbarDock&&this._toolbarDock.isContentToolbarDocked()){if(!this.textToolbar.isRendered){var t=this.convertStyleToToolbarState(this.getActiveStyles());this.textToolbar.properties=this.getToolbarProperties(),this._setTextWrapState(t),this.textToolbar.setState(t),this._toolbarDock.updateODTState([{type:"SubView",responsive:!0,editable:!1,changedAction:null,subView:this.textToolbar,removeThenApplyAction:!0,action:function(){}},{name:"textToolbarDock",type:"Button",label:l.get("undockToolbar"),icon:this._icons.getIcon("undock-icon").id,disabled:function(){return e._dashboardState.getUiState().focus},actions:{apply:function(){this._toolbarDock.disableDockedODT(),this.showTextToolbar()}.bind(this)}}])}return Promise.resolve()}if(this._isToolbarOpened())return Promise.resolve();this.textToolbar.remove(),this.toolbar.clearItems();var n=this.convertStyleToToolbarState(this.getActiveStyles());this.textToolbar.properties=this.getToolbarProperties(),this._setTextWrapState(n),this.textToolbar.setState(n);var o=this.toolbarNode[0]===this.container[0]||d.contains(this.toolbarNode[0],this.container[0]),i=this.toolbarNode.find(".moveHandle"),r=o&&i.length?i[0]:this.container[0];return this.toolbar.setSelectionContext([r]),this.toolbar.addItems([{type:"SubView",responsive:!0,editable:!1,changedAction:null,subView:this.textToolbar,removeThenApplyAction:!0,action:function(){}},{name:"textToolbarDock",type:"Button",label:l.get("dockToolbar"),icon:this._icons.getIcon("dock-icon").id,actions:{apply:function(){this._toolbarDock.enableDockedODT(),this.textToolbar.remove(),this.toolbar.remove(),this.showTextToolbar()}.bind(this)}}]).then((function(){return e.toolbar.show()}))},_setTextWrapState:function(e){this._ext&&this._ext.isTextWrapOn&&(e.textWrap=this._ext.isTextWrapOn())},_selectContent:function(){var e=document.createRange(),t=0===this.getEditingArea().find("p").length?this.getEditingArea().get(0):this.getEditingArea().find("p").get(0);e.selectNodeContents(t);var n=window.getSelection();this._clearSelection(n),n.addRange(e)},_focusOnText:function(){var e=this;return this._selectContent(),this.getEditingArea().focus(),this.showTextToolbar().then((function(){e._selectContent(),e.getEditingArea().focus(),e.widget.refreshPropertiesPane({selectedTab:l.get("propText")})}))},toggleEditing:function(e,t){var n=this.isEditing(this.container),o=void 0===e?!n:e;if(this.container.toggleClass("editing",o),this.getEditingArea().attr("contenteditable",o),o!==n&&this._resizeViz(),o)n||this.addEditingEvents(t),this._focusOnText();else if(n&&!o){if(this._clearSelection(window.getSelection()),this.removeEditingEvents(t),this._toolbarDock&&this._toolbarDock.isContentToolbarDocked()){var i=this.widget.getDashboardApi().getCanvas().getSelectedContentList().map((function(e){return e.getId()}));this._toolbarDock.updateODTState(this._contentActions.getContentActionList(i),i)}else this.hideTextToolbar();this.widget.refreshPropertiesPane()}},_removeClassFromSelection:function(e){var t={fontSize:/rt_fontSize(\d+|\w+)/g,fontFamily:/rt_fontFamily\w+(-\w+)?/g,textColor:/customColor.+|color\d+|grayShade\d+|responsiveColor/g};if(e&&t[e])return function(n,o){return(o.match(t[e])||[]).join(" ")}},_addClassToSelection:function(e,t){return{fontSize:"rt_fontSize",fontFamily:"",textColor:""}[e]+t},getToolbarProperties:function(){var t=this._getTextColorChoices(),n=[];return e.each(t,(function(e){n.push(e.hexValue)})),{fonts:this._fontFamilyChoices,fontSizes:this._fontSizeChoices,colors:n}},getPropertyLayoutList:function(){return this.isEditing()?[{id:"textDetail",type:"Group",label:l.get("tabName_textDetails"),position:1},{id:"fontFamily",type:"Section",collapsible:!1,label:l.get("textFontFamily"),position:1},{id:"fontFamilyLine",type:"SingleLineLinks",items:[{id:"left",align:"left",items:[]},{id:"right",align:"right",items:[]}]}].concat(this.getPropertyLayoutControlList()):[]},getPropertyList:function(){return[]},getPropertyLayoutControlList:function(){if(!this.isEditing())return[];var e=[];return this.lastActiveStyles=this.getActiveStyles(),e.push.apply(e,this._getFontFamilyProperties()),e.push(this._getFontSizeProperty()),e.push(this._getTextColorProperty()),e.push(this._getFontWeightProperty()),e.push(this._getTextAlignmentProperty()),this.supportsLists&&e.push(this._getListProperty()),e},_getFontFamilyProperties:function(){var t=this.lastActiveStyles["font-family"],n=t?this._convertCssToFontId(t):[],o=this._findFontFamilyItemFromValue(n[0],this._fontFamilyChoices);o||(n=[this.getDefaultFont().id],o=this._findFontFamilyItemFromValue(n[0],this._fontFamilyChoices));var i=e.find(o.subCssClasses,(function(e){return e.cssClass===o.cssClass}));return[{id:"fontFamily",editor:{sectionId:"textDetail.fontFamily.fontFamilyLine.left",position:1,uiControl:{type:"DropDown",ariaDescribedby:l.get("textFontFamily"),options:this._fontFamilyChoices,responsive:!1,style:"width: 156px;",value:n[0],onChange:this.onFontFamilyUpdate.bind(this)}}},{id:"fontFamilySubClass",editor:{sectionId:"textDetail.fontFamily.fontFamilyLine.left",position:2,hidden:!o||!o.subCssClasses||0===o.subCssClasses.length,uiControl:{type:"DropDown",ariaDescribedby:l.get("textFontFamily"),options:o&&o.subCssClasses,value:i&&i.value,onChange:this.onFontFamilyUpdate.bind(this),style:"width:80px;",responsive:!1}}}]},_getFontSizeProperty:function(){return{id:"fontSize",editor:{sectionId:"textDetail",position:2,uiControl:{type:"DropDown",label:l.get("textFontSize"),options:this._fontSizeChoices,onChange:this.onFontSizeUpdate.bind(this),value:this.isResponsive?"auto":this.lastActiveStyles["font-size"]+""}}}},_getTextColorProperty:function(){var t=this,n=this._getTextColorChoices(),o=e.find(n,(function(e){return e.id===t.lastActiveStyles.color}))||{name:this.lastActiveStyles.color,value:""};return{id:"textColor",editor:{sectionId:"textDetail",position:3,uiControl:{paletteType:"DashboardColorSet",type:"ColorPicker",showHexValue:!0,addButton:!0,label:l.get("propTextColor"),open:!1,ariaLabel:l.get("propTextColor"),items:n,allowSameSelection:!0,selectedName:o?o.name:"",value:o?o.value:"",onChange:this.onTextColorUpdate.bind(this)}}}},getCustomColorList:function(){var e=[],t=[];this.getEditingArea().find("span").each((function(e,n){t.push(n.className)}));var n=t.join(" ");return this.colorsService.getCustomColorSet().forEach((function(t){-1!==n.indexOf(t.id)&&e.push(t.hexValue)})),e},_getFontWeightProperty:function(){return{id:"textFormat",editor:{sectionId:"textDetail",position:4,uiControl:{type:"IconPicker",label:l.get("textStyle"),useToggling:!0,allowMultiple:!0,items:[{name:"bold",label:l.get("propToolbarPickBold"),value:"common-text-bold"},{name:"italic",label:l.get("propToolbarPickItalic"),value:"common-text-italic"},{name:"underline",label:l.get("propToolbarPickUnderline"),value:"common-text-underline"}],values:this.lastActiveStyles["text-format"],onChange:this.onTextFormatUpdate.bind(this)}}}},_getTextAlignmentProperty:function(){return{id:"alignmentPicker",editor:{sectionId:"textDetail",position:5,uiControl:{type:"IconPicker",label:l.get("propAlignPicker"),items:[{name:"justifyLeft",label:l.get("propAlignPickLeft"),value:"common-left-align"},{name:"justifyCenter",label:l.get("propAlignPickCenter"),value:"common-center-align"},{name:"justifyRight",label:l.get("propAlignPickRight"),value:"common-right-align"}],values:this.lastActiveStyles["text-align"],onChange:this.onTextAlignmentUpdate.bind(this)}}}},_getListProperty:function(){var e=void 0;return this.lastActiveStyles.insertUnorderedList?e="insertUnorderedList":this.lastActiveStyles.insertOrderedList&&(e="insertOrderedList"),{id:"listPicker",editor:{sectionId:"textDetail",position:6,uiControl:{type:"IconPicker",label:l.get("propList"),useToggling:!0,items:[{name:"insertUnorderedList",label:l.get("propUnorderedList"),value:this._icons.getIcon("bullet-list").id},{name:"insertOrderedList",label:l.get("propOrderedList"),value:this._icons.getIcon("number-list").id}],values:e,onChange:this.onListUpdate.bind(this)}}}},updateTextToolbar:function(e){var t=e||this.getActiveStyles(),n=this.convertStyleToToolbarState(t);this.textToolbar.properties=this.getToolbarProperties(),this._setTextWrapState(n),this.textToolbar.setState(n)},updatePropertiesIfNecessary:function(){if(this.isEditing()){var t=this.getActiveStyles(),n=e.pick(t,f),o=e.pick(this.lastActiveStyles||{},f);e.isEqual(n,o)||(this.lastActiveStyles=t,this.updateTextToolbar(t),this.widget.refreshPropertiesPane())}},_convertCssToFontId:function(e){var t;return t=(t=(t=e.replace(/["\s]+/g,"")).toLowerCase().split(",")).length?t[0].split("-"):null},getFontFamilySubClassSpec:function(e,t){if(!e)return[];if(!t&&e.subCssClasses)for(var n=0;n<e.subCssClasses.length;n++)if(e.subCssClasses[n].cssClass===e.cssClass){t=e.subCssClasses[n].value;break}var o={type:"DropDown",name:"fontFamilySubClass",id:"fontFamilyGroup",ariaDescribedby:l.get("textFontFamily"),defaultValue:t,options:e.subCssClasses,onChange:this.onFontFamilyUpdate.bind(this),style:"width:80px;",responsive:!1};return e.subCssClasses&&0!==e.subCssClasses.length||(o.hidden=!0),o},modifyTextFormat:function(e){this.isEditing()&&(!h.isFF||"bold"!=e&&"underline"!=e?e&&this._getSummerNote().summernote(e):this.patchUnderline(e),this.fillText())},onListUpdate:function(e,t){if(t&&t[0]&&t[0].name)this.modifyList(t[0].name);else{var n=this.getActiveStyles().insertUnorderedList?"insertUnorderedList":"insertOrderedList";this.modifyList(n)}this.fillText(),this.save(),this.updateTextToolbar()},modifyList:function(e,t){this.isEditing()&&this.getActiveStyles()[e]!==t&&(this._getSummerNote().summernote(e),this._styleListItems())},patchUnderline:function(e){"bold"==e?(this.isBold=!this.isBold,this._getSummerNote().summernote(e)):"underline"==e&&(this.isBold?(this._getSummerNote().summernote("bold"),this._getSummerNote().summernote("underline"),this._getSummerNote().summernote("bold")):this._getSummerNote().summernote("underline"))},modifyFontFamily:function(e){if(this.isEditing()){var t=this._removeClassFromSelection("fontFamily"),n=this._addClassToSelection("fontFamily",e);this._getSummerNote().summernote("updateClassToSelection",{remove:t,add:n}),this._styleListItems(),this.getEditingArea().focus(),this.fillText()}},_findFontFamilyItemFromValue:function(e,t){for(var n=void 0,o=0;o<t.length;o++){if(t[o].value===e)return t[o];this.lastActiveStyles&&this.lastActiveStyles["font-family"]&&t[o].value===this._convertCssToFontId(this.lastActiveStyles["font-family"])[0]&&(n=t[o])}if(n){var i=this._findFontFamilyItemFromValue(e,n.subCssClasses||[]);if(i)return i}return null},_cleanInlineStyle:function(){this.getEditingArea().find("span, li").css("font-size","")},modifyFontSize:function(e){if(this.isEditing()){this.isResponsive="auto"===e;var t=this._removeClassFromSelection("fontSize");this.isResponsive?this._cleanInlineStyle():(this.unFillText(),this._getSummerNote().summernote("fontSize",parseInt(e)),this._styleListItems()),this._getSummerNote().summernote("updateClassToSelection",{remove:t}),this.fillText(),this.getEditingArea().focus(),this._resizeViz()}},_isHexColor:function(e){return 0===e.indexOf("#")&&7===e.length},modifyTextColor:function(e){if(this.isEditing()){var t=void 0,n=this._removeClassFromSelection("textColor");"transparent"!==e&&(t=this._addClassToSelection("textColor",e)),this._getSummerNote().summernote("updateClassToSelection",{remove:n,add:t}),this._styleListItems(),this.getEditingArea().focus()}},onTextFormatUpdate:function(e,t){var n=this.getActiveStyles()["text-format"];["bold","underline","italic"].forEach(function(e){var o=[];t&&(o=d.grep(t,(function(t){return t.name===e}))),(o.length>0&&-1===n.indexOf(e)||0===o.length&&n.indexOf(e)>-1)&&this.modifyTextFormat(e)}.bind(this)),this.fillText(),this.save(),this.updateTextToolbar()},onTextAlignmentUpdate:function(e,t){t&&t[0]&&t[0].name&&this.modifyTextAlignment(t[0].name),this.fillText(),this.save(),this.updateTextToolbar()},modifyTextAlignment:function(e){if(this.isEditing()){var t=e.replace("justify",""),n=this.getSelectedParagraphs(),o=Array.isArray(n),i=0;for(n=o?n:n[Symbol.iterator]();;){var r;if(o){if(i>=n.length)break;r=n[i++]}else{if((i=n.next()).done)break;r=i.value}r.style.textAlign=t}this.getEditingArea().focus()}},onFontSizeUpdate:function(e,t){this.modifyFontSize(t),this.fillText(),o.isIpad()&&this.restoreSelection(),this.getEditingArea().focus(),this.updateTextToolbar()},onFontFamilyUpdate:function(e,t){if(t){var n=this._findFontFamilyItemFromValue(t,this._fontFamilyChoices);if(!n)return;this.modifyFontFamily(n.cssClass),"fontFamily"===e&&this.widget.triggerExternalEvent("properties:refreshProperty",{sender:this.widget.model.id,propertySpec:this.getFontFamilySubClassSpec(n,null),removeProperty:!n.subCssClasses}),this.fillTextAfterDelay(500),o.isIpad()&&this.restoreSelection(),this.getEditingArea().focus(),this.updateTextToolbar()}},onTextColorUpdate:function(e,t){this.selection&&(this.restoreSelection(this.selection),this.selection=null),this.modifyTextColor(t.name),this.fillText(),this.updateTextToolbar()},textIsEmpty:function(){return this._getSummerNote().summernote("isEmpty")||0===this.getEditingArea().get(0).textContent.length&&1==this.numberOfLines},getEditingArea:function(){return this.node.find(this.EDITING_AREA)},_getSummerNote:function(){return this.initSummernote(),this.node.children(this.SUMMERNOTE_CLASS)},getContent:function(){return this.getEditingArea().html()},getTitleFromHtml:function(e){var t="";return d(e).find("p, li").each((function(e,n){t=t+" "+n.textContent})),t.trim()},fillText:function(){if(this.node.is(":visible")&&this.isResponsive){this.node.addClass("textFillNoScroll"),this.node.find(this.TEXT_FITTED).css("word-wrap","normal");var e=[];t.isIE()&&this.getEditingArea().find("p, li").each((function(t,n){e.push(n.style.textAlign),n.style.textAlign="left"}));var n={maxFontSize:Math.ceil(this.node.height()),minFontSize:1,multiLine:!0,detectMultiLine:!1};u.fillText(this.getEditingArea()[0],n),e.length&&this.getEditingArea().find("p, li").each((function(t,n){n.style.textAlign=e[t]}))}},fillTextAfterDelay:function(e){setTimeout(this.fillText.bind(this),e)},unFillText:function(){this.node.find(this.TEXT_FITTED).css({"font-size":"","word-wrap":""}),this.node.removeClass("textFillNoScroll")},getActiveStyles:function(){var e=this._getSummerNote().summernote("currentStyle");return this._getActiveTextFormat(e),this._getActiveTextAlignment(e),this._getActiveTextColor(e),this._getActiveFontSize(e),this._getActiveLists(e),e},_getActiveLists:function(e){e.insertUnorderedList="unordered"===e["list-style"],e.insertOrderedList="ordered"===e["list-style"]},_getActiveTextFormat:function(e){var t=e["text-format"];t||(e["text-format"]=t=[]),"bold"===e["font-bold"]&&t.push("bold"),"underline"===e["font-underline"]&&t.push("underline"),"italic"===e["font-italic"]&&t.push("italic")},_getActiveTextAlignment:function(e){var t=this.getSelectedParagraphs();if(t&&t.length>0){var n=t[0].style.textAlign,o=t,i=Array.isArray(o),r=0;for(o=i?o:o[Symbol.iterator]();;){var A;if(i){if(r>=o.length)break;A=o[r++]}else{if((r=o.next()).done)break;A=r.value}if(A.style.textAlign!==n)return void(e["text-align"]="")}switch(n){case"center":e["text-align"]="justifyCenter";break;case"right":e["text-align"]="justifyRight";break;default:e["text-align"]="justifyLeft"}}},_getActiveTextColor:function(e){if(e.color){var t=this._getActiveTextColor_Checker(e.color);t&&(e.color=t)}},_getActiveTextColor_Checker:function(e){var t=null;if(e){var n=this._getTextColorChoices(),o=this._rgbToHex(e),i=n,r=Array.isArray(i),A=0;for(i=r?i:i[Symbol.iterator]();;){var a;if(r){if(A>=i.length)break;a=i[A++]}else{if((A=i.next()).done)break;a=A.value}var s=a;if(o&&o===s.hexValue){t=s.id;break}}!t&&o&&(t=this.colorsService.getColorClassName(o))}return t},_getActiveFontSize:function(e){e["font-size"]&&this.isResponsive&&(e["font-size"]="auto")},_rgbToHex:function(e){return(e=e.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&4===e.length?"#"+("0"+parseInt(e[1],10).toString(16)).slice(-2)+("0"+parseInt(e[2],10).toString(16)).slice(-2)+("0"+parseInt(e[3],10).toString(16)).slice(-2):""},_getTextColorChoices:function(){return this.colorsService.getDashboardColorSet().filter((function(e){return"transparent"!==e.id}))},_copyTextStyles:function(e,t){var n=this._rgbToHex(e.css("color")),o=this._convertCssToFontId(e.css("font-family"))[0];t.removeClass();var i=this._findColorIdFromHex(n);i&&t.addClass(i);var r=this._findFontFamilyItemFromValue(o,this._fontFamilyChoices);r&&r.cssClass&&t.addClass(r.cssClass),this.isResponsive||t.css({"font-size":e.css("font-size")})},_getRefinedSelectionRange:function(){for(var e=window.getSelection().getRangeAt(0).cloneRange(),t=e.startContainer,n=t.firstChild?0:e.startOffset;t.firstChild;)t=t.firstChild;if(n>0&&"\ufeff"===t.textContent[n-1]&&0===(n-=1)){for(var o=document.createTreeWalker(d(t).closest("p, li")[0],window.NodeFilter.SHOW_TEXT);t!==o.nextNode(););for(var i=o.previousNode();i&&"\ufeff"===i.textContent[i.textContent.length-1];)if(i.textContent=i.textContent.slice(0,-1),""===i.parentNode.innerText){var r=i.parentNode;i=o.previousNode(),r.remove()}}return e.setStart(t,n),e},_isNodeStartSelected:function(e,t){for(;e.firstChild;)e=e.firstChild;var n=document.createRange();return n.setStart(e,0),1!==t.compareBoundaryPoints(window.Range.START_TO_START,n)},_styleListItems:function(){var e=this,t=this.getSelectedListItems();if(t.length){var n=this._getRefinedSelectionRange();t.forEach((function(t){var o=d(t);if(e._isNodeStartSelected(t,n)){for(o.contents().each((function(t,n){var i=d(n);if(n.nodeType===window.Node.TEXT_NODE){var r=d("<span></span>");e._copyTextStyles(o,r),i.wrap(r)}else e._copyTextStyles(i,i)}));t.firstChild;)t=t.firstChild;e._copyTextStyles(d(t.parentNode),o)}}))}},getSelectedListItems:function(){return this.getSelectedParagraphs().filter((function(e){return"LI"===e.nodeName}))},getSelectedParagraphs:function(){var e=window.getSelection();if(!e.rangeCount)return[];var t=e.getRangeAt(0);if(t.startContainer===this.getEditingArea()[0])return this.getEditingArea().find("p, li").toArray();var n=d(t.startContainer).closest("p, li").get(0),o=d(t.endContainer).closest("p, li").get(0);if(n===o)return n?[n]:[];var i=[],r=!1;return d(t.commonAncestorContainer).find("p, li").each((function(){this===n&&(r=!0),r&&i.push(this),this===o&&(r=!1)})),i},saveSelection:function(){if(window.getSelection){var e=window.getSelection();if(e.getRangeAt&&e.rangeCount)return e.getRangeAt(0)}else if(document.selection&&document.selection.createRange)return document.selection.createRange();return null},_clearSelection:function(e){(!t.isIE11()||e.rangeCount>0&&e.getRangeAt(0).getClientRects().length>0)&&e.removeAllRanges()},restoreSelection:function(e){if(e)if(window.getSelection){var t=window.getSelection();this._clearSelection(t),t.addRange(e)}else document.selection&&e.select&&e.select()},hasContent:function(){var e=this.getEditingArea();return!!e.text().length||!!e.find("li").length},hasText:function(){return!!this.getEditingArea().text().length}});return p.cleanContentElements=function(e){return r.cleanseContentElements(e,g,!0)},p.getTextHTML=function(t){var n=t.text?"<span>"+e.escape(t.text)+"</span>":"<br>";return'<span class="textFitted '+t.style+"Color "+t.style+"FontSize "+t.style+'FontFamily"><p>'+n+"</p></span>"},p.FONTFAMILY_CHOICES=[{value:"anton",label:"Anton",cssClass:"rt_fontFamilyAnton"},{value:"cherrycreamsoda",label:"Cherry Cream Soda",cssClass:"rt_fontFamilyCherryCreamSoda"},{value:"condiment",label:"Condiment",cssClass:"rt_fontFamilyCondiment-Regular"},{value:"didactgothic",label:"Didact Gothic",cssClass:"rt_fontFamilyDidactGothic"},{value:"euphoriascript",label:"Euphoria Script",cssClass:"rt_fontFamilyEuphoriaScript-Regular"},{value:"helveticaneueforibm",label:"Helvetica Neue",cssClass:"rt_fontFamilyHelvNeueforIBM-Regular",subCssClasses:[{value:"light",label:l.get("textFontFamilySubClassLight"),cssClass:"rt_fontFamilyHelvNeueforIBM-Light"},{value:"lightitalic",label:l.get("textFontFamilySubClassLightItalic"),cssClass:"rt_fontFamilyHelvNeueforIBM-LightItalic"},{value:"regular",label:l.get("textFontFamilySubClassRegular"),cssClass:"rt_fontFamilyHelvNeueforIBM-Regular"},{value:"italic",label:l.get("textFontFamilySubClassItalic"),cssClass:"rt_fontFamilyHelvNeueforIBM-Italic"},{value:"medium",label:l.get("textFontFamilySubClassMedium"),cssClass:"rt_fontFamilyHelvNeueforIBM-Medium"},{value:"mediumitalic",label:l.get("textFontFamilySubClassMediumItalic"),cssClass:"rt_fontFamilyHelvNeueforIBM-MediumItalic"},{value:"bold",label:l.get("textFontFamilySubClassBold"),cssClass:"rt_fontFamilyHelvNeueforIBM-Bold"},{value:"bolditalic",label:l.get("textFontFamilySubClassBoldItalic"),cssClass:"rt_fontFamilyHelvNeueforIBM-BoldItalic"}]},{value:"kaushanscript",label:"Kaushan Script",cssClass:"rt_fontFamilyKaushanScript-Regular"},{value:"lobster",label:"Lobster",cssClass:"rt_fontFamilyLobster"},{value:"merriweather",label:"Merriweather",cssClass:"rt_fontFamilyMerriweather-Regular",subCssClasses:[{value:"italic",label:l.get("textFontFamilySubClassItalic"),cssClass:"rt_fontFamilyMerriweather-Italic"},{value:"light",label:l.get("textFontFamilySubClassLight"),cssClass:"rt_fontFamilyMerriweather-Light"},{value:"regular",label:l.get("textFontFamilySubClassRegular"),cssClass:"rt_fontFamilyMerriweather-Regular"},{value:"bold",label:l.get("textFontFamilySubClassBold"),cssClass:"rt_fontFamilyMerriweather-Bold"},{value:"bolditalic",label:l.get("textFontFamilySubClassBoldItalic"),cssClass:"rt_fontFamilyMerriweather-BoldItalic"},{value:"black",label:l.get("textFontFamilySubClassBlack"),cssClass:"rt_fontFamilyMerriweather-Black"},{value:"lightitalic",label:l.get("textFontFamilySubClassLightItalic"),cssClass:"rt_fontFamilyMerriweather-LightItalic"},{value:"heavyitalic",label:l.get("textFontFamilySubClassHeavyItalic"),cssClass:"rt_fontFamilyMerriweather-HeavyItalic"}]},{value:"merriweathersans",label:"Merriweather Sans",cssClass:"rt_fontFamilyMerriweatherSans-Regular",subCssClasses:[{value:"italic",label:l.get("textFontFamilySubClassItalic"),cssClass:"rt_fontFamilyMerriweatherSans-Italic"},{value:"light",label:l.get("textFontFamilySubClassLight"),cssClass:"rt_fontFamilyMerriweatherSans-Light"},{value:"lightitalic",label:l.get("textFontFamilySubClassLightItalic"),cssClass:"rt_fontFamilyMerriweatherSans-LightItalic"},{value:"regular",label:l.get("textFontFamilySubClassRegular"),cssClass:"rt_fontFamilyMerriweatherSans-Regular"},{value:"bold",label:l.get("textFontFamilySubClassBold"),cssClass:"rt_fontFamilyMerriweatherSans-Bold"},{value:"bolditalic",label:l.get("textFontFamilySubClassBoldItalic"),cssClass:"rt_fontFamilyMerriweatherSans-BoldItalic"},{value:"extrabold",label:l.get("textFontFamilySubClassExtraBold"),cssClass:"rt_fontFamilyMerriweatherSans-ExtraBold"},{value:"extrabolditalic",label:l.get("textFontFamilySubClassExtraBoldItalic"),cssClass:"rt_fontFamilyMerriweatherSans-ExtraBoldItalic"}]},{value:"monoton",label:"Monoton",cssClass:"rt_fontFamilyMonoton-Regular"},{value:"montserrat",label:"Montserrat",cssClass:"rt_fontFamilyMontserrat-Regular",subCssClasses:[{value:"hairline",label:l.get("textFontFamilySubClassHairline"),cssClass:"rt_fontFamilyMontserrat-Hairline"},{value:"light",label:l.get("textFontFamilySubClassLight"),cssClass:"rt_fontFamilyMontserrat-Light"},{value:"regular",label:l.get("textFontFamilySubClassRegular"),cssClass:"rt_fontFamilyMontserrat-Regular"},{value:"bold",label:l.get("textFontFamilySubClassBold"),cssClass:"rt_fontFamilyMontserrat-Bold"},{value:"black",label:l.get("textFontFamilySubClassBlack"),cssClass:"rt_fontFamilyMontserrat-Black"}]},{value:"opensanscondensed",label:"Open Sans Condensed",cssClass:"rt_fontFamilyOpenSansCondensed-Light",subCssClasses:[{value:"light",label:l.get("textFontFamilySubClassLight"),cssClass:"rt_fontFamilyOpenSansCondensed-Light"},{value:"lightitalic",label:l.get("textFontFamilySubClassLightItalic"),cssClass:"rt_fontFamilyOpenSansCondensed-LightItalic"},{value:"bold",label:l.get("textFontFamilySubClassBold"),cssClass:"rt_fontFamilyOpenSansCondensed-Bold"}]},{value:"oswald",label:"Oswald",cssClass:"rt_fontFamilyOswald-Regular",subCssClasses:[{value:"extralight",label:l.get("textFontFamilySubClassExtraLight"),cssClass:"rt_fontFamilyOswald-ExtraLight"},{value:"extralightitalic",label:l.get("textFontFamilySubClassExtraLightItalic"),cssClass:"rt_fontFamilyOswald-ExtraLightItalic"},{value:"light",label:l.get("textFontFamilySubClassLight"),cssClass:"rt_fontFamilyOswald-Light"},{value:"lightitalic",label:l.get("textFontFamilySubClassLightItalic"),cssClass:"rt_fontFamilyOswald-LightItalic"},{value:"regular",label:l.get("textFontFamilySubClassRegular"),cssClass:"rt_fontFamilyOswald-Regular"},{value:"regularitalic",label:l.get("textFontFamilySubClassRegularItalic"),cssClass:"rt_fontFamilyOswald-RegularItalic"},{value:"medium",label:l.get("textFontFamilySubClassMedium"),cssClass:"rt_fontFamilyOswald-Medium"},{value:"mediumitalic",label:l.get("textFontFamilySubClassMediumItalic"),cssClass:"rt_fontFamilyOswald-MediumItalic"},{value:"demibold",label:l.get("textFontFamilySubClassDemiBold"),cssClass:"rt_fontFamilyOswald-DemiBold"},{value:"demibolditalic",label:l.get("textFontFamilySubClassDemiBoldItalic"),cssClass:"rt_fontFamilyOswald-DemiBoldItalic"},{value:"bold",label:l.get("textFontFamilySubClassBold"),cssClass:"rt_fontFamilyOswald-Bold"},{value:"bolditalic",label:l.get("textFontFamilySubClassBoldItalic"),cssClass:"rt_fontFamilyOswald-BoldItalic"},{value:"heavy",label:l.get("textFontFamilySubClassHeavy"),cssClass:"rt_fontFamilyOswald-Heavy"},{value:"heavyitalic",label:l.get("textFontFamilySubClassHeavyItalic"),cssClass:"rt_fontFamilyOswald-HeavyItalic"},{value:"stencil",label:l.get("textFontFamilySubClassStencil"),cssClass:"rt_fontFamilyOswald-Stencil"}]},{value:"playball",label:"Playball",cssClass:"rt_fontFamilyPlayball"},{value:"ibmplexsans",label:"IBM Plex",default:!0,cssClass:"rt_fontFamilyPlex-Regular",subCssClasses:[{value:"light",label:l.get("textFontFamilySubClassLight"),cssClass:"rt_fontFamilyPlex-Light"},{value:"lightitalic",label:l.get("textFontFamilySubClassLightItalic"),cssClass:"rt_fontFamilyPlex-LightItalic"},{value:"regular",label:l.get("textFontFamilySubClassRegular"),cssClass:"rt_fontFamilyPlex-Regular"},{value:"italic",label:l.get("textFontFamilySubClassItalic"),cssClass:"rt_fontFamilyPlex-Italic"},{value:"medium",label:l.get("textFontFamilySubClassMedium"),cssClass:"rt_fontFamilyPlex-Medium"},{value:"mediumitalic",label:l.get("textFontFamilySubClassMediumItalic"),cssClass:"rt_fontFamilyPlex-MediumItalic"},{value:"bold",label:l.get("textFontFamilySubClassBold"),cssClass:"rt_fontFamilyPlex-Bold"},{value:"bolditalic",label:l.get("textFontFamilySubClassBoldItalic"),cssClass:"rt_fontFamilyPlex-BoldItalic"}]},{value:"roboto",label:"Roboto",cssClass:"rt_fontFamilyRoboto-Regular",subCssClasses:[{value:"thin",label:l.get("textFontFamilySubClassThin"),cssClass:"rt_fontFamilyRoboto-Thin"},{value:"thinitalic",label:l.get("textFontFamilySubClassThinItalic"),cssClass:"rt_fontFamilyRoboto-ThinItalic"},{value:"light",label:l.get("textFontFamilySubClassLight"),cssClass:"rt_fontFamilyRoboto-Light"},{value:"lightitalic",label:l.get("textFontFamilySubClassLightItalic"),cssClass:"rt_fontFamilyRoboto-LightItalic"},{value:"regular",label:l.get("textFontFamilySubClassRegular"),cssClass:"rt_fontFamilyRoboto-Regular"},{value:"italic",label:l.get("textFontFamilySubClassItalic"),cssClass:"rt_fontFamilyRoboto-Italic"},{value:"medium",label:l.get("textFontFamilySubClassMedium"),cssClass:"rt_fontFamilyRoboto-Medium"},{value:"mediumitalic",label:l.get("textFontFamilySubClassMediumItalic"),cssClass:"rt_fontFamilyRoboto-MediumItalic"},{value:"bold",label:l.get("textFontFamilySubClassBold"),cssClass:"rt_fontFamilyRoboto-Bold"},{value:"bolditalic",label:l.get("textFontFamilySubClassBoldItalic"),cssClass:"rt_fontFamilyRoboto-BoldItalic"},{value:"black",label:l.get("textFontFamilySubClassBlack"),cssClass:"rt_fontFamilyRoboto-Black"},{value:"blackitalic",label:l.get("textFontFamilySubClassBlackItalic"),cssClass:"rt_fontFamilyRoboto-BlackItalic"}]},{value:"sortsmillgoudy",label:"Sorts Mill Goudy",cssClass:"rt_fontFamilySortsMillGoudy-Regular",subCssClasses:[{value:"regular",label:l.get("textFontFamilySubClassRegular"),cssClass:"rt_fontFamilySortsMillGoudy-Regular"},{value:"italic",label:l.get("textFontFamilySubClassItalic"),cssClass:"rt_fontFamilySortsMillGoudy-Italic"}]},{value:"specialelite",label:"Special Elite",cssClass:"rt_fontFamilySpecialElite"}],p.INT_FONTSIZE_CHOICES=[{value:"8",label:"8"},{value:"9",label:"9"},{value:"10",label:"10"},{value:"11",label:"11"},{value:"12",label:"12"},{value:"14",label:"14"},{value:"16",label:"16"},{value:"18",label:"18"},{value:"20",label:"20"},{value:"22",label:"22"},{value:"24",label:"24"},{value:"26",label:"26"},{value:"28",label:"28"},{value:"30",label:"30"},{value:"36",label:"36"},{value:"48",label:"48"},{value:"60",label:"60"},{value:"72",label:"72"},{value:"96",label:"96"},{value:"120",label:"120"},{value:"170",label:"170"},{value:"230",label:"230"}],p.FONTSIZE_CHOICES=[{value:"auto",label:l.get("textAutoFontSize")}].concat(p.INT_FONTSIZE_CHOICES),p})),define("dashboard-core/js/app/util/LocaleUtil",[],(function(){var e=null,t=null;return(t=function(){if(t.prototype._singletonInstance)return t.prototype._singletonInstance;this.locale=this.getLocale(),this.isRTL=this.isLocaleRTL(this.locale),t.prototype._singletonInstance=this}).prototype.getLocale=function(){return this.locale||(this.locale=document.documentElement.getAttribute("lang")),this.locale},t.prototype.isLocaleRTL=function(e){if(!this.isRTL){this.isRTL=["ar","he"].indexOf(e)>=0}return this.isRTL},function(){return e||(e=new t),e}()})),define("dashboard-core/js/dashboard/layout/views/WidgetTitleView",["../../../lib/@waca/core-client/js/core-client/ui/core/View","../../../lib/@waca/core-client/js/core-client/utils/BidiUtil","../../../dashboard/util/TextEditor","../../../app/util/LocaleUtil","../../../app/nls/StringResources","jquery","underscore"],(function(e,t,n,o,i,r,A){var a=function(e){return"object"===(void 0===e?"undefined":_typeof(e))?e[document.getElementsByTagName("html")[0].getAttribute("lang")]||e.en||e[Object.keys(e)[0]]:e},s=e.extend({init:function(e){this.titleId=e.id+"Title",this.canEditTitle=e.canEditTitle,this.widgetModel=e.widgetModel,this.widgetChromeEventRouter=e.widgetChromeEventRouter,this.header=e.header,this.dashboardApi=e.dashboardApi,this.registerEvents()},registerEvents:function(){this.widgetChromeEventRouter.on("title:chromeSelected",this.onChromeSelected,this),this.widgetChromeEventRouter.on("title:chromeDeselected",this.onChromeDeselected,this),this.widgetChromeEventRouter.on("title:containerReady",this.onContainerReady,this),this.widgetChromeEventRouter.on("title:enterContainer",this.onEnterContainer,this),this.widgetChromeEventRouter.on("title:updateModel",this.updateModelContent,this),this.widgetChromeEventRouter.on("widget:clearWidgetArialabel",this.clearWidgetArialabel,this),this.widgetChromeEventRouter.on("widget:updateWidgetArialabel",this.updateWidgetArialabel,this),this._isSmartTitleEnabled()?this.widgetModel.on("change:titleMode",this._showTitle,this):this.widgetModel.on("change:showTitle",this._showTitle,this)},getHtmlRender:function(){return this.getStyleNode().get(0).outerHTML},_getTextProperties:function(e){return{style:"responsive",text:e}},render:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=void 0,o="";this.widgetModel&&this.widgetModel.get&&(t=n.cleanContentElements(this.widgetModel.get("titleHtml")),o=this.widgetModel.get("name"));var i=o?a(o):"";t?(this.$el=r(t),this.$el.length||(this.$el=r('<div class="widgetTitle" title="'+i+'">'+t+"</div>")),this._nTitle=this.$el.find(".textArea")):(this.$el=r("<div>",{class:"widgetTitle",title:i}),this.$el.attr("aria-labelledby",this.titleId),this._nTitle=r("<div>",{class:"textArea"}),this.$el.prepend(this._nTitle)),this.$el.attr("appcues-data-id","widgetTitle"),this.$el.toggleClass("titleShown",!(!i||!i.length));var A=this._shouldShowTitle();this._nTitle.toggleClass("hidden",e&&!A)},remove:function(){this.widgetChromeEventRouter.off("title:chromeSelected",this.onChromeSelected,this),this.widgetChromeEventRouter.off("title:chromeDeselected",this.onChromeDeselected,this),this.widgetChromeEventRouter.off("title:containerReady",this.onContainerReady,this),this.widgetChromeEventRouter.off("title:enterContainer",this.onEnterContainer,this),this.widgetChromeEventRouter.off("title:updateModel",this.updateModelContent,this),this.widgetChromeEventRouter.off("widget:clearWidgetArialabel",this.clearWidgetArialabel,this),this.widgetChromeEventRouter.off("widget:updateWidgetArialabel",this.updateWidgetArialabel,this),this._isSmartTitleEnabled()?this.widgetModel.off("change:titleMode",this._showTitle,this):this.widgetModel.off("change:showTitle",this._showTitle,this),this.widgetModel.off("change:titleHtml",this._onTitleHtmlChange,this),this.textEditor&&(this.textEditor.destroy(),this.textEditor=null),s.inherited("remove",this,arguments)},onContainerReady:function(e){var i=this,r=e&&e.content&&e.content.getFeature&&e.content.getFeature("WidgetTitleTruncate"),A=r&&r.getExtensionHooks();return r&&r.setUpdateModelContent(this.updateModelContent.bind(this)),r&&r.setTitleHighlighter(this._highlightTitle.bind(this)),this._handleEditUpdateTruncation=A&&A.onEditUpdate,this.widget=e,this.textEditor=new n({node:this._nTitle,container:this.header,widget:e,fontSizes:n.INT_FONTSIZE_CHOICES,toolbarNode:e.$widgetContainer,shouldResizeViz:!0,initialState:{fontSize:"16",color:"responsiveColor"},extension:A}),o.isLocaleRTL()&&t.initElementForBidi(this._nTitle),this.textEditor.isResponsive=!1,this.widgetModel.on("change:titleHtml",this._onTitleHtmlChange,this),this.textEditor.initContentEditable("p"),this.textEditor.selectionBindNodeEvents(),this._applyTitle(),this._updateAriaInfo(),this.dashboardApi.getCanvasWhenReady().then((function(t){var n=t.getContent(e.id);n.getFeature("Properties").registerProvider(i.textEditor),n.getFeature("TextEditor").registerProvider({widgetId:e.id,textEditor:i.textEditor,titleId:i.titleId})}))},_updateAriaInfo:function(){var e=this.widgetModel.id+"Title";this.$el.find(".note-editable").attr("id",e)},_onTitleHtmlChange:function(e){if(!(e=e||{})||null!==e.value&&""!==e.value&&void 0!==e.value){if(this.textEditor){var t=this.textEditor.applyContent(e),n=this.textEditor.getTitleFromHtml(this.getHtmlRender());return this.$el.prop("title",n),t}}else this._setTitleHtmlFromName()},_applyTitle:function(){var e=this;if(this.textEditor){var t=this.dashboardApi.getFeature("TranslationService");if(this.widgetModel.get("name"))this.widgetModel.get("titleHtml")?t.isInTranslationMode()&&this._updateTextEditor():(this.widgetModel.name&&this.widgetModel.name.translationTable&&A.each(this.widgetModel.name.translationTable,(function(t,n){e.widgetModel.set({name:{locale:n,value:t}}),e._setTitleHtmlFromName(n)})),this._setTitleHtmlFromName());else{var o=this.widget&&this.widget.content&&this.widget.content.getPropertyValue("titleMode"),r=this._isSmartTitleEnabled(),a=!1;if(a=!r||o&&"customTitle"===o,this.canEditTitle&&a){var s=this._getTextProperties(i.get("titlePlaceHolder"));this.textEditor.setText(n.getTextHTML(s)),r&&this.textEditor.toggleEditing(!0)}else this.textEditor.setText(" ")}}},_setTitleHtmlFromName:function(e){if(this.textEditor){var t=this._updateTextEditor(e);t.text&&(this.$el.prop("title",t.text),this.$el.find(".ariaLabelNode").html(n.cleanContentElements(t.text)));var o=n.cleanContentElements(this.getHtmlRender()),i=this.dashboardApi.getFeature("internal").getBoardModel().getLanguageModelOptions();A.extend(i,{silent:!0}),this.widgetModel.set({titleHtml:{value:o,locale:e}},i)}},_updateTextEditor:function(e){var t=this.widgetModel.get("name");e&&this.widgetModel.name&&(t=this.widgetModel.name.getValue(e));var o=this._getTextProperties(t),i=n.getTextHTML(o);return this.textEditor.setText(i),this.textEditor.updateLastSavedText(i),o},_showTitle:function(e){this.updateTitle(e);var t=this.widgetModel.showTitle,n=this.widget.content.getPropertyValue("titleMode");t||"customTitle"!==n||(t=!(!e||"noTitle"!==e.prevValue)),this.canEditTitle&&t&&this.textEditor&&this.widget&&this.widget.chromeSelected&&this.widget.isAuthoringMode&&this.textEditor.toggleEditing(!(e&&e.data&&!1===e.data.edit),e)},_hasHeader:function(){return!!(this.widget&&this.widget.$el&&this.widget.$el.parent()&&this.widget.$el.parent().find)&&0!==this.widget.$el.parent().find(".widgetHeader").length},_toggleEdit:function(e){if(this.textEditor){var t="showTitle",n=!1;this._isSmartTitleEnabled()&&(t="titleMode",n="noTitle"),this.textEditor.isEditing()&&this.textEditor.textIsEmpty()&&!1===e&&this.widget.content.setPropertyValue(t,n),this.textEditor.toggleEditing(e)}},checkAndRecreateHeader:function(){this.widget&&(this.widget.isWidgetMaximized&&this.widget.isWidgetMaximized()||this._hasHeader()||this.widgetChromeEventRouter.trigger("title:resetTitle",{widgetTitleView:this}))},_shouldShowTitle:function(){return void 0===this.widgetModel.titleMode?!!this.widgetModel.showTitle:"noTitle"!==(this.widgetModel.titleMode||"smartTitle")},_isWidgetReady:function(){var e=!0,t=this.widget&&this.widget.content&&this.widget.content.getFeature("Visualization");return t&&t.getSlots()&&!1===t.getSlots().isMappingComplete()&&(e=!1),e},updateTitle:function(e){var t=this._isWidgetReady(),n=this._shouldShowTitle()&&t,o=!this._nTitle.hasClass("hidden");n?(this.checkAndRecreateHeader(),this._applyTitle(),this._nTitle.removeClass("hidden")):(this._nTitle.addClass("hidden"),this.textEditor&&this.textEditor.toggleEditing(!1,e)),n!==o&&this.widgetChromeEventRouter.trigger("title:resizeViz")},onChromeSelected:function(){s.inherited("onChromeSelected",this,arguments),this.textEditor&&this.canEditTitle&&this.textEditor.attachEnterEditEvents()},onChromeDeselected:function(){s.inherited("onChromeDeselected",this,arguments),this._toggleEdit(!1),this.textEditor&&this.textEditor.detachEnterEditEvents()},onChromeOffFocus:function(){this._toggleEdit(!1)},getProperties:function(e){return this.textEditor.getProperties(e)},onEnterContainer:function(){this.textEditor&&this.canEditTitle&&this.textEditor.toggleEditing(!0)},updateModelContent:function(e){if(this.textEditor){var t=this.dashboardApi.getFeature("internal").getBoardModel().getLanguageModelOptions();e.transactionId?A.extend(t,{payloadData:{undoRedoTransactionId:e.transactionId,transactionToken:e.transactionToken}}):A.extend(t,{silent:!0});var o=this.textEditor.getTitleFromHtml(this.getHtmlRender()),i=null;this.widgetModel&&this.widgetModel.get&&(i=this.widgetModel.get("name"));var r=i?a(i):"";this.$el.prop("title",o);var s=n.cleanContentElements(this.getHtmlRender());this._handleEditUpdateTruncation&&this._handleEditUpdateTruncation(r,s,o,e.transactionId),this.widgetModel.set({titleHtml:s,name:o},t)}},_highlightTitle:function(){this.textEditor.toggleEditing(!0)},updateWidgetArialabel:function(e){this._nAriaLabel&&this._nAriaLabel.text(e.value)},clearWidgetArialabel:function(){this._nAriaLabel&&this._nAriaLabel.empty()},getStyleNode:function(){return this.$el},_isSmartTitleEnabled:function(){var e=this.dashboardApi.getGlassCoreSvc(".FeatureChecker");return!!e&&!(e.checkValue&&e.checkValue("dashboard","SmartTitle","disabled"))}});return s})),define("dashboard-core/js/dashboard/layout/views/Widget",["./LayoutBaseView","jquery","underscore","./WidgetTitleView","../../model/LayoutModel","../../widgets/PropertiesUtil","../../../app/nls/StringResources","../../../lib/@waca/core-client/js/core-client/utils/Deferred","../../../lib/@waca/core-client/js/core-client/ui/KeyCodes","../../../lib/@waca/core-client/js/core-client/ui/core/Events","../../../app/util/EventChainLocal"],(function(e,t,n,o,i,r,A,a,s,l,c){var d=e.extend({init:function(e){d.inherited("init",this,arguments),this._layoutEvents=new l,this._widgetReady=new a,this._widgetRenderComplete=new a,this.canvasNotifier=e.canvasNotifier,this.widgetModel=e.widgetModel,this.widgetRegistry=e.widgetRegistry,this.visPreferredSize=null,this.icons={},this._savedTransform=null,this.$widgetContentWrapper=this.$el.find(".widgetContentWrapper"),this._registerWidgetChromeEvents(),this._createHeader(),this._createAttachedView(),this._createFilterGroupOverlay(),this.isTouchDevice="ontouchstart"in document.documentElement,this.additionalWidgetData=e.additionalWidgetData,this.$el.attr("appcues-data-id","widget"),t(this.domNode).on("keydown.widgetKeydown",this.onKeyDown.bind(this))},renderContent:function(){var e=this;return!this._isRendered&&this.widgetModel&&(this._isRendered=!0,this.registerViewFeatures().then((function(){e.canvasNotifier&&e._establishCanvasConnection(e.additionalWidgetData),e.renderWidget()}))),this.layoutController.markViewAsReady(this),Promise.resolve()},renderWidget:function(){var e=this;return new Promise((function(t,n){if(e.layoutController.widgetLoader.isLoaded(e.id))e._widgetAlreadyLoadedCallback(),t();else{var o=e.additionalWidgetData&&e.additionalWidgetData.addPayloadData&&e.additionalWidgetData.addPayloadData.undoRedoTransactionId;e.layoutController.widgetLoader.loadWidget(e.id,e.widgetModel.toJSON(),e.domNode,e._prepareAsyncCallback((function(t){t&&t.widget&&(t.widget.onContainerReady&&t.widget.onContainerReady({model:e.widgetModel,widgetChromeEventRouter:e.widgetChromeEventRouter,isAuthoringMode:e.layoutController.isAuthoring,additionalWidgetData:e.additionalWidgetData,layoutAPI:e.getAPI()}),e._triggerChromeEvents(t.widget,e.widgetChromeEventRouter))})),e._prepareAsyncCallback((function(o){o.errorCode===(e.layoutController.widgetLoader&&e.layoutController.widgetLoader.ERROR.WIDGET_ALREADY_LOADED)?(e._widgetAlreadyLoadedCallback(),t()):o.exception?n(o.exception):n(new Error(o.errorCode))})),o).then((function(){t()}))}}))},_widgetAlreadyLoadedCallback:function(){var e=this.layoutController.widgetLoader.getWidget(this.id);e&&(e.onContainerReady&&e.onContainerReady({model:this.widgetModel,widgetChromeEventRouter:this.widgetChromeEventRouter,isAuthoringMode:this.layoutController.isAuthoring,layoutAPI:this.getAPI()}),this._triggerChromeEvents(e))},_triggerChromeEvents:function(e){this.widgetChromeEventRouter&&(this.widgetChromeEventRouter.trigger("widget:ready",{widget:e,widgetAPI:e.getAPI()}),this._triggerRenderComplete(e))},_triggerRenderComplete:function(e){e.whenRenderComplete?e.whenRenderComplete().then(this._prepareAsyncCallback(function(){this.widgetChromeEventRouter.trigger("widget:renderComplete",{widget:e}),this.eventRouter.trigger("widget:renderComplete",{widget:e})}.bind(this))):(this.widgetChromeEventRouter.trigger("widget:renderComplete",{widget:e}),this.eventRouter.trigger("widget:renderComplete",{widget:e}))},_prepareAsyncCallback:function(e){return function(){return this._destroyed?Promise.reject("The live widget object was destroyed"):e.apply(void 0,arguments)}.bind(this)},getAPI:function(){var e=d.inherited("getAPI",this,arguments);return this.widgetTitleView&&(e.updateTitle=this.widgetTitleView.updateTitle.bind(this.widgetTitleView),e.setTitleBadge=this.setTitleBadge.bind(this),e.onTitleBadgeClick=this.onTitleBadgeClick.bind(this),e.offTitleBadgeClick=this.offTitleBadgeClick.bind(this),e.offFocus=this.widgetTitleView.onChromeOffFocus.bind(this.widgetTitleView)),e},setTitleBadge:function(e,n){var o=this;if(this.$badgeContainer.empty(),e){var i=t("<div>",{tabindex:0,class:"titleBadge","aria-label":n,"appcues-data-id":"titleBadge"});i.text(e),this.$badgeContainer.append(i),i.on("clicktap keydown",(function(e){"keydown"===e.type&&13!==e.which||o._layoutEvents.trigger("titlebadge:click",{event:e})}))}},onTitleBadgeClick:function(e,t){this._layoutEvents.on("titlebadge:click",e,t)},offTitleBadgeClick:function(e,t){this._layoutEvents.off("titlebadge:click",e,t)},onFocusOut:function(){var e=!1,n=function(t){t.target!==this.domNode&&(e=!0)}.bind(this);t(this.domNode).on("focusin.widgetFocus",n),setTimeout(function(){e||this._exitContainer()}.bind(this),10)},onKeyDown:function(e){return e.keyCode===s.F10||e.ctrlKey&&e.keyCode===s.X?(this.onMaximize(),!1):e.keyCode===s.F12&&!e.shiftKey||e.ctrlKey&&e.keyCode===s.NUM1?(this.isEnterContainer=!0,this.widgetChromeEventRouter.trigger("widget:onEnterContainer"),t(this.domNode).on("focusout.widgetFocus",this.onFocusOut.bind(this)),e.stopPropagation(),e.preventDefault(),!1):e.keyCode===s.F12&&e.shiftKey||e.ctrlKey&&e.keyCode===s.NUM0?(this._exitContainer(),t(this.domNode).focus(),e.stopPropagation(),e.preventDefault(),!1):e.keyCode!==s.SPACE&&e.keyCode!==s.ENTER||!t.contains(this.domNode,e.target)?e.keyCode!==s.LEFT_ARROW&&e.keyCode!==s.RIGHT_ARROW&&e.keyCode!==s.UP_ARROW&&e.keyCode!==s.DOWN_ARROW||!t.contains(this.domNode,e.target)?void 0:(new c(e).setProperty("preventMoveAction",!0),!0):(new c(e).setProperty("preventWidgetSelection",!0),!0)},_exitContainer:function(){this.isEnterContainer&&(this.widgetChromeEventRouter.trigger("widget:onExitContainer"),this.isEnterContainer=!1,t(this.domNode).off("focusout"))},notifyWidget:function(e,t){this.widgetChromeEventRouter.trigger(e,t)},widgetReady:function(){return this._widgetReady.promise},whenRenderComplete:function(){return this._widgetRenderComplete.promise},_registerWidgetChromeEvents:function(){this.widgetChromeEventRouter_disposeEvents.push(this.widgetChromeEventRouter.on("widget:updateLayout",this.updateModel,this),this.widgetChromeEventRouter.on("layout:getPageFillColor",this.getPageFillColor,this),this.widgetChromeEventRouter.on("widget:setPreferredSize",this.setPreferredSize,this),this.widgetChromeEventRouter.on("widget:getSize",this.getSize,this),this.widgetChromeEventRouter.on("widget:showError",this.sizeToErrorContainer,this),this.widgetChromeEventRouter.on("widget:clearError",this.resizeToModel,this),this.widgetChromeEventRouter.on("widget:clearMoreDataIndicator",this.clearMoreDataIndicator,this),this.widgetChromeEventRouter.on("widget:updateDescription",this.updateDescription,this),this.widgetChromeEventRouter.on("widget:addIcon",this.addIcon,this),this.widgetChromeEventRouter.on("widget:onShowAttachedView",this.onShowAttachedView,this),this.widgetChromeEventRouter.on("widget:onHideAttachedView",this.onHideAttachedView,this),this.widgetChromeEventRouter.on("widget:setLayoutProperties",this.setLayoutProperties,this),this.widgetChromeEventRouter.on("title:resizeViz",this.onResize,this),this.widgetChromeEventRouter.on("title:resetTitle",this.recreateHeader,this),this.widgetChromeEventRouter.on("widget:ready",this.onWidgetReady,this),this.widgetChromeEventRouter.on("widget:renderComplete",this.onWidgetRenderComplete,this))},onWidgetReady:function(e){this.widget=e.widget,this.widgetAPI=e.widgetAPI,this._widgetReady.resolve(e.widgetAPI)},onWidgetRenderComplete:function(){this._widgetRenderComplete.resolve()},getPageFillColor:function(e){for(var t=this.model.getParent(),n=null;t&&!n;)t.fillColor&&"transparent"!==t.fillColor&&(n=t.fillColor),t=t.getParent();e.fillColor=n},sizeToErrorContainer:function(e){var t=this;n.isUndefined(this._errorStyle)&&(this._errorStyle={}),n.each(e,(function(e,n){t._errorStyle[n]=e})),n.isEmpty(this._errorStyle)?this.logger.warn("no error style to apply"):this.$el.css(this._errorStyle)},resizeToModel:function(){var e=this.model.style,t={};this._errorStyle&&(t=n.clone(this._errorStyle),n.each(t,(function(e,n){t[n]=""})),delete this._errorStyle),e&&(t.height=e.height,t.width=e.width,this.model.style.opacity&&(t.opacity=this.model.style.opacity)),n.isEmpty(t)||this.$el.css(t)},setPreferredSize:function(e){var t=e.preferredSize.height+"px",o=e.preferredSize.width+"px",i=this.visPreferredSize&&!n.isEqual(this.visPreferredSize,e.preferredSize),r=this.model.style;!!!(r&&r.height&&r.width)||i&&!this._isWidgetInDropZone()?e.options.undoRedoTransactionId?this._updateModel({undoRedoTransactionId:e.options.undoRedoTransactionId,transactionToken:e.options&&e.options.transactionToken,triggerResize:!1},this,{height:t,width:o}):this._updateModel({triggerResize:!1},null,{height:t,width:o}):this.$el.css({height:this.model.style.height,width:this.model.style.width}),this.visPreferredSize=e.preferredSize},getSize:function(e){var t,n,o=this.$el.find(".widgetContent"),i=this.model.style;this._getHiddenLayoutParents().length>0?(t=i.width,n=i.height):(t=o.innerWidth(),n=o.innerHeight()),e.deferred&&e.deferred.resolve({top:i.top||0,left:i.left||0,width:t,height:n})},_getHiddenLayoutParents:function(){return this.$el.parents().filter((function(){return"none"===t(this).css("display")}))},_isWidgetInDropZone:function(){for(var e=this.model,t=this.model.getParent(),n=!1;t&&"genericPage"!==t.type;)e=t,t=t.getParent();t&&e.relatedLayouts&&("templateDropZone"===t.findChildItem(t.items,e.relatedLayouts).type&&(n=!0));return n},updateModel:function(e){this.model.updateModel({updateArray:[{id:this.id,style:{height:t(this.domNode).outerHeight()+"px",width:t(this.domNode).outerWidth()+"px"}}]},this,e.payloadData)},_updateModel:function(e,t,n){if(n){var o={height:n.height,width:n.width};void 0!==n.opacity&&(o.opacity=n.opacity),this.model.updateModel({updateArray:[{id:this.model.id,style:o}]},t,e)}},_establishCanvasConnection:function(e){this.widgetOwnsTitle=!this.widgetRegistry||this.widgetRegistry.ownTitle,this.canvasNotifier.trigger("widget:addDone",{id:this.id,widgetChromeEventRouter:this.widgetChromeEventRouter,isAuthoringMode:this.isAuthoringMode,domNode:this.domNode,additionalWidgetData:e,layoutAPI:this.getAPI(),widget:this})},updateDescription:function(e){this._nWidgetDescription?this._nWidgetDescription.text(e.value):this.$el.attr("aria-label",e.value)},_getDescriptionDomNodeId:function(){return this.domNode.id+"Description"},recreateHeader:function(e){this._createHeader(e.widgetTitleView)},_createHeader:function(e){this.widgetRegistry?(this.createContentNode=this.widgetRegistry.createContentNode,this.supportsTitle=this.createContentNode&&!this.widgetRegistry.disableTitle,this.createDescriptionNode=this.createContentNode||!!this.widgetRegistry.createDescriptionNode):this.createContentNode=this.supportsTitle=this.createDescriptionNode=!0;var n=void 0;if(this.createDescriptionNode&&(this._nWidgetDescription=t("<div>",{id:this._getDescriptionDomNodeId(),class:"ariaLabelNode hidden"}),this.$el.append(this._nWidgetDescription),n=this._getDescriptionDomNodeId()),this.createContentNode){var i=t("<div>",{class:"widgetHeader"});if(this.supportsTitle){var r=this.dashboardApi.getAppConfig("interactions")||{},A=void 0===r.editTitle||!0===r.editTitle||"true"===r.editTitle;if(e)this.widgetTitleView=e;else{this.widgetTitleView=new o({id:this.domNode.id,header:i,canEditTitle:A,widgetModel:this.widgetModel,widgetChromeEventRouter:this.widgetChromeEventRouter,dashboardApi:this.dashboardApi});var a=!(!this.widgetModel||this.widgetModel.showTitle);this.widgetTitleView.render(a)}this.$el.addClass("titleSupported"),n+=" "+this.widgetTitleView.titleId,i.prepend(this.widgetTitleView.getStyleNode());var s=t("<div>",{class:"widgetIcons"});this.$badgeContainer=t("<div>",{class:"badgeContainer"}),i.append(this.$badgeContainer),i.append(s)}this.$widgetContentWrapper.prepend(i)}n&&this.$el.attr("aria-labelledby",n)},_createAttachedView:function(){var e=this.domNode.id+"_attachedView",n=t("<div>",{id:e,class:"attachedView"});this.$widgetContentWrapper.append(n),this.$attachedView=n},_createFilterGroupOverlay:function(){var e=this.domNode.id+"_eventGroupOverlay",n=t("<div>",{id:e,class:"eventGroupOverlay"}),o=t("<div>",{class:"eventGroupOverlayContent"});n.append(o),this.$widgetContentWrapper.append(n)},onShowAttachedView:function(e){this.$attachedView.html(e.$el).addClass("expanded")},onHideAttachedView:function(){this.$attachedView.removeClass("expanded").empty()},destroy:function(e){t(this.domNode).off("keydown.widgetKeydown"),t(this.domNode).off(".widgetFocus"),this._destroyAuthoringHelper(),this.nHandle=null,this.canvasNotifier&&this.canvasNotifier.trigger("widget:removeDone",n.extend(e||{},{id:this.model.id,widget:this})),this.widgetTitleView&&(this.widgetTitleView.remove(),this.widgetTitleView=null),this._destroyed=!0,d.inherited("destroy",this,arguments)},_triggerWidgetChromeEvent:function(e,t){this.widgetChromeEventRouter&&this.widgetChromeEventRouter.trigger(e,t)},onResize:function(){d.inherited("onResize",this,arguments),this._triggerWidgetChromeEvent("widget:onResize","object"===_typeof(arguments[0])?arguments[0]:{})},onSelect:function(){this._triggerWidgetChromeEvent("widgetchrome:selected")},onDeselect:function(){this._triggerWidgetChromeEvent("widgetchrome:deselected")},onShow:function(e){d.inherited("onShow",this,arguments),this._triggerWidgetChromeEvent("widget:onShow",e)},onHide:function(){d.inherited("onHide",this,arguments),this._triggerWidgetChromeEvent("widget:onHide")},onMaximize:function(){this._triggerWidgetChromeEvent("widget:onMaximize")},setLayoutProperties:function(e){this.$el.toggleClass("noRotate",!!e.noRotate),this.$el.toggleClass("mobilePannable",!!e.mobilePannable),this.$el.toggleClass("pannable",!!e.pannable),this.$el.toggleClass("maximizable",!!e.maximizable)},addIcon:function(e){this.icons[e.name]&&this.icons[e.name].widgetIcon.detach(),e.location?e.location.append(e.widgetIcon):this.$el.find(".widgetIcons").append(e.widgetIcon),this.icons[e.name]=e},getContextToolbarItems:function(){var e=[];if(this.widgetAPI&&!this.widgetAPI.getError()){var t=this.widgetAPI.getContextToolbarItems();e=e.concat(t)}return{items:e}},getProperties:function(){var e=this;return this.widgetReady().then((function(){return e.widgetAPI.getProperties()})).then((function(n){return e._getLayoutProperties().then((function(e){return t.merge(n,e)}))}))},_getLayoutProperties:function(){var e=this,t=this._getStyleProperties();return r.processProperties(t,this.model.style,this.dashboardApi).then((function(){return e.supportsTitle&&(t=e.widgetTitleView.getProperties(t)),t}))},_getLayoutOpacity:function(){return this.model.style.opacity||0===this.model.style.opacity?this.model.style.opacity:"1"},_getStyleProperties:function(){this._registerOnPropertyChangeStyle();var e=[];return e.push(this._getOpacityProperty()),e},_getOpacityProperty:function(){return{name:"opacity",label:A.get("propOpacity"),module:"../ui/UiSlider",sliderType:"percentage",description:A.get("propOpacityDescription"),connect:[!0,!1],defaultValue:100,range:{min:0,max:100},step:1,format:{decimals:0,postfix:"%"},tabName:A.get("tabName_general"),sectionName:A.get("sectionName_appearance"),noInputView:!0}},_registerOnPropertyChangeStyle:function(){this.model.style.onPropertyChange=function(e,o){var i=t.extend(!0,{},this.model.style);i[e]=o,this._updateModel({undoRedoTransactionId:n.uniqueId("changeLayoutStyle_"+e),triggerResize:!1},this,i)}.bind(this)},clearMoreDataIndicator:function(){var e=this.$el.find(".widgetHeader .dataWidgetHasMoreData");if(e&&e.length>0)e.remove();else{var t=this.$el.closest(".pageViewContent");t&&t.length>0&&(e=t.find(".dialogBlocker .dataWidgetHasMoreData"))&&e.length>0&&e.remove()}},getWidgetAPI:function(){return this.widgetAPI}});return d})),define("dashboard-core/js/dashboard/layout/views/LayoutApi",["../../../lib/@waca/core-client/js/core-client/ui/core/Class"],(function(e){var t=e.extend({model:null,controller:null,init:function(e){this.model=e.model,this.controller=e,this.layoutController=e.layoutController},getId:function(){return this.model.id},getChildren:function(){var e=this;return this.model.items.map((function(t){var n=t.id,o=e.layoutController.getView(n);if(o&&o.view&&o.view.getAPI)return o.view.getAPI()})).filter((function(e){return!!e}))},render:function(e){this.controller.render(e)},getSelfRatio:function(){return this.controller.getSelfRatio()},getParentLayout:function(){return this.controller.getParentLayout()},getWidgetAPI:function(){return this.controller.widgetAPI}});return t.API_METHODS=["getId","getChildren","render","getSelfRatio","getParentLayout","getWidgetAPI"],t})),define("dashboard-core/js/dashboard/glass/services/DashboardPinningService",["../../../lib/@waca/core-client/js/core-client/ui/core/Events","../../../app/nls/StringResources","underscore","../../../lib/@waca/core-client/js/core-client/i18n/Formatter","moment-timezone"],(function(e,t,n,o,i){return function(e){function r(){_classCallCheck(this,r);var t=_possibleConstructorReturn(this,e.call(this,arguments));return t.PIN_VERSION="3",t.PIN_URL="v1/users/~/pins",t._pinIdsToUpgradeInCM=[],t._timeframePinBuckets=null,t._timeframePinBucketNames=["all","today","yesterday","pastWeek","pastMonth","earlier"],t._pinIdMap={},t}return _inherits(r,e),r.prototype.initialize=function(e){var t=this,n=e.appController;return this._glassContext=n.glassContext,this._glassContext.getSvc(".UpgradeService").then((function(e){t._latestDashboardSpecVersion=e.getLatestDashboardSpecVersion();var n=t._glassContext.getCoreSvc(".UserProfile");t._timezone=n.preferences.timeZoneID||"America/New_York",t._today=i().tz(t._timezone).startOf("day"),t._yesterday=t._today.clone().subtract(1,"days"),t._pastWeek=t._today.clone().subtract(7,"days"),t._pastMonth=t._today.clone().subtract(31,"days")}))},r.prototype.getCachedPins=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all";return this._timeframePinBuckets[e]||[]},r.prototype.getPins=function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all";return this._timeframePinBuckets?Promise.resolve(this._timeframePinBuckets[n]):this._glassContext.getCoreSvc(".Ajax").ajax({url:this.PIN_URL,type:"GET",contentType:"application/json; charset=utf-8",dataType:"json"}).then((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e._timeframePinBuckets={all:[],today:[],yesterday:[],pastWeek:[],pastMonth:[],earlier:[]},e._upgradePinsLocally(t.data)})).then((function(t){var o=e._sortPins(t);return e._prepPinsForUI(o),e._cachePinsInAppropriateTimeFrameBuckets(o),e._slowlySaveUpgradedPinsInCM(),e._timeframePinBuckets[n]})).catch((function(n){e._glassContext.getCoreSvc(".Logger").error("Failed to get pins",n);var o=e._retrieveErrorMessage({result:n,defaultMessage:t.get("pinRetrieveError")});return e._glassContext.appController.showErrorMessage(o,t.get("pinErrorTitle")),[]}))},r.prototype.getPin=function(e){return this._pinIdMap[e]?Promise.resolve(this._pinIdMap[e]):this.getPins().then((function(t){return n.find(t,(function(t){return t.id===e}))}))},r.prototype.addPin=function(e){var n=this;e.version=this.PIN_VERSION;var o=JSON.stringify(e);return this._glassContext.getCoreSvc(".Ajax").ajax({type:"POST",url:this.PIN_URL,contentType:"application/json; charset=utf-8",dataType:"json",data:o}).then((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.data;return n._prepPinsForUI([t]),n._addPinToCache(t,["all","today","pastWeek","pastMonth"],!0),n.trigger("pin:created",t),t})).catch((function(e){var o=n._retrieveErrorMessage({result:e,defaultMessage:t.get("contentPinFailOld")}),i=new Error(o);throw n._glassContext.getCoreSvc(".Logger").error("addPin error",i),i}))},r.prototype.deletePin=function(e){var n=this;return new Promise((function(o,i){try{if(n._glassContext.getCoreSvc(".UserProfile").preferences.accessibilityFeatures)n._glassContext.appController.showMessage(t.get("deletePinConfirmationMessage"),t.get("deletePinConfirm"),"info",["ok","cancel"],void 0,(function(t){"ok"===t.btn&&(n._removePinFromCache(e),n.trigger("pin:fakeDeleted",e),n._completePinDelete(e)),o()}));else{var r=n._removePinFromCache(e);r.removedPin||n._glassContext.getCoreSvc(".Logger").error("Trying to remove a pin that is not in our array",e,n),n.trigger("pin:fakeDeleted",e);var A=!1;n._glassContext.appController.showToast(t.get("pinDeletedToast"),{type:"info",btnLabel:t.get("undo"),callback:function(){A=!0,n._addPinToCache(r.removedPin,r.timeframeBucketNames,!1,!0),n.trigger("pin:undoDeletion",e)},newestOnTop:!0,preventDuplicates:!1,timeOut:6e3,extendedTimeOut:1e3,onHidden:function(){A||n._completePinDelete(e),o()}})}}catch(e){i(e)}}))},r.prototype._completePinDelete=function(e){var n=this;return this._pinIdsToUpgradeInCM=this._pinIdsToUpgradeInCM.filter((function(t){return t!==e})),this._glassContext.getCoreSvc(".Ajax").ajax({type:"DELETE",url:this.PIN_URL+"/"+e,contentType:"application/json; charset=utf-8",dataType:"json"}).then((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n.trigger("pin:deleted",e),t})).catch((function(e){var o=n._retrieveErrorMessage({result:e,defaultMessage:t.get("pinDeleteErrorOld")}),i=new Error(o);throw n._glassContext.appController.showErrorMessage(o,t.get("pinErrorTitle")),n._glassContext.getCoreSvc(".Logger").error("deletePin error",i),i}))},r.prototype._slowlySaveUpgradedPinsInCM=function(){var e=this,t=this._pinIdsToUpgradeInCM.shift();return t?this.getPin(t).then((function(n){return e._glassContext.getCoreSvc(".Logger").info("Updating upgraded pin spec in CM",n),e._glassContext.getCoreSvc(".Ajax").ajax({type:"PUT",url:e.PIN_URL+"/"+t,contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify(n)}).then((function(){return e._slowlySaveUpgradedPinsInCM()})).catch((function(t){e._glassContext.getCoreSvc(".Logger").error("Pin upgrade failed to save in CM.",t)}))})):Promise.resolve()},r.prototype._removePinFromCache=function(e){var t=this;this._pinIdMap&&delete this._pinIdMap[e];var n=[],o=null;if(this._timeframePinBuckets){this._timeframePinBucketNames.forEach((function(i){t._timeframePinBuckets[i]=t._timeframePinBuckets[i].filter((function(t){return function(t,i){return t.id!==e||(o=t,n.push(i),!1)}(t,i)}))}))}return{removedPin:o,timeframeBucketNames:n}},r.prototype._addPinToCache=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._timeframePinBucketNames,n=this,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._timeframePinBuckets&&(this._pinIdMap[e.id]=e,t.forEach((function(t){o?n._timeframePinBuckets[t].unshift(e):n._timeframePinBuckets[t].push(e),i&&n._sortPins(n._timeframePinBuckets[t])})))},r.prototype._retrieveErrorMessage=function(e){var t=(e=e||{}).defaultMessage;try{t=JSON.parse(e.result.responseText).error}catch(e){}return t},r.prototype._prepPinsForUI=function(e){var t=this,n=this._getCurrentContentViewDashboardApi().getDashboardCoreSvc(".SmartNamingSvc");e.forEach((function(e){e.timestamp&&(e.pinAge=o.formatDateTime(e.timestamp,{type:"datetime",formatLength:"short",timezone:t._timezone})),e.displayName=n.getPinName(e),e.thumbUri||(e.defaultImage="wfg_pin")}))},r.prototype._cachePinsInAppropriateTimeFrameBuckets=function(e){var t=this;e.forEach((function(e){var n=i.tz(e.timestamp,t._timezone);t._timeframePinBuckets.all.push(e);var o=null;o=n.isSame(t._today,"day")?["today","pastWeek","pastMonth"]:n.isSame(t._yesterday,"day")?["yesterday","pastWeek","pastMonth"]:n.isAfter(t._pastWeek)?["pastWeek","pastMonth"]:n.isAfter(t._pastMonth)?["pastMonth"]:["earlier"],t._addPinToCache(e,o)}))},r.prototype._sortPins=function(e){return e.sort((function(e,t){var n=e.timestamp,o=t.timestamp;return n>o?-1:n<o?1:0}))},r.prototype._upgradePinsLocally=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n={ajaxSvc:this._glassContext.getCoreSvc(".Ajax"),services:this._getCurrentContentViewServices(),logger:this._glassContext.getCoreSvc(".Logger"),pinUpgrade:!0,glassContext:this._glassContext,dashboardApi:this._getCurrentContentViewDashboardApi(),showErrorToast:!1},o=[];return this._glassContext.getSvc(".UpgradeService").then((function(i){return t.forEach((function(t){t.content&&t.content.specVersion!==e._latestDashboardSpecVersion&&o.push(t)})),o.length>0&&console.log(o.length+" pins to upgrade."),new Promise((function(r){o.reduce((function(t,o){return t.then((function(){try{return e._upgradePinSpec(o,i,n).then((function(){e._pinIdsToUpgradeInCM.push(o.id)})).catch((function(t){e._glassContext.getCoreSvc(".Logger").error("Unable to upgrade pin:",o,"Failed with error: ",t)}))}catch(t){e._glassContext.getCoreSvc(".Logger").error("Unable to upgrade pin:",o,"Failed with error: ",t)}}))}),Promise.resolve([])).then((function(){r(t)}))}))}))},r.prototype._upgradePinSpec=function(e,t,o){var i=this,r={version:e.version?e.content.specVersion:6,layout:e.content.layout,widgets:this._getObjectFromArrayById(e.content.widgets)};e.content.datasetShapings?r.datasetShaping=this._getObjectFromArrayById(e.content.datasetShapings):e.content.datasetShaping&&(r.datasetShaping=this._getObjectFromArrayById(e.content.datasetShaping)),e.content.dataSources&&(r.dataSources=e.content.dataSources),e.content.episodes&&(r.timeline={episodes:this._getObjectFromArrayById(e.content.episodes)});var A=e.content.upgrades||[],a=r.version;return-1===A.indexOf(a)?(A.push(a),e.content.upgrades=A):this._glassContext.getCoreSvc(".Logger").warn('Pin spec with id "'+e.id+'" and board spec version "'+e.content.specVersion+'" being upgraded to an previously upgraded spec version: ',a),t.upgrade(r,null,o).then((function(t){var o={layout:t.layout,widgets:n.toArray(t.widgets),specVersion:t.version,upgrades:A};return t.dataSources&&(o.dataSources=t.dataSources),e.content.episodes&&(o.episodes=n.toArray(t.timeline.episodes)),t.datasetShaping&&(o.datasetShaping=n.toArray(t.datasetShaping)),e.content=o,e.version=i.PIN_VERSION,e})).catch((function(t){if(t.obj)return i._glassContext.getCoreSvc(".Logger").warn("Pin spec did not fully upgrade",t,e),t.obj;throw t}))},r.prototype._getObjectFromArrayById=function(e){return n.object(n.map(e,(function(e){return[e.id,e]})))},r.prototype._getCurrentContentViewDashboardApi=function(){try{return this._glassContext.appController.currentAppView.currentContentView.getDashboardApi()}catch(e){this._glassContext.getCoreSvc(".Logger").error("Trying to use the pinning service outside of a dashboard.",e)}},r.prototype._getCurrentContentViewServices=function(){try{return this._glassContext.appController.currentAppView.currentContentView.services}catch(e){this._glassContext.getCoreSvc(".Logger").error("Trying to use the pinning service outside of a dashboard.",e)}},r}(e)})),define("dashboard-core/js/dashboard/services/thumbnail/ThumbnailStore",["../../../lib/@waca/core-client/js/core-client/ui/core/Events"],(function(e){var t=e.extend({_items:null,init:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.inherited("init",this,[]),this._items=e},exists:function(e){return void 0!==this._items[e]},set:function(e,t){var n={data:t.data,cacheId:t.cacheId};return this._items[e]=n,this.trigger("thumbnailStore:set",{id:e,item:n}),this},setError:function(e,t){var n=t.message,o=void 0;return this.exists(e)?(o=this.getLocal(e)).error={message:n}:(o={error:{message:n}},this._items[e]=o),this.trigger("thumbnailStore:set",{id:e,item:o}),this},setWarning:function(e,t){var n=t.message,o=void 0;return this.exists(e)?(o=this.getLocal(e)).warning={message:n}:(o={warning:{message:n}},this._items[e]=o),this.trigger("thumbnailStore:set",{id:e,item:o}),this},getLocal:function(e){return this._items[e]},getAllLocal:function(){var e=this;return Object.keys(this._items).map((function(t){return{id:t,item:e._items[t]}}))},get:function(e,t){return this.exists(e)?Promise.resolve(this.getLocal(e)):this.getVisTypeDefault(t)},delete:function(e){return delete this._items[e],this.trigger("thumbnailStore:delete",{id:e}),this},getVisTypeDefault:function(){return Promise.resolve()}});return t})),function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("jquery"),require("underscore"),require("canvgModule"),require("baglass/core-client/js/core-client/utils/BrowserUtils"));else if("function"==typeof define&&define.amd)define("dashboard-core/js/lib/@waca/image-capture/dist/js/bundles/image-capture.min",["jquery","underscore","canvgModule","baglass/core-client/js/core-client/utils/BrowserUtils"],t);else{var n="object"==typeof exports?t(require("jquery"),require("underscore"),require("canvgModule"),require("baglass/core-client/js/core-client/utils/BrowserUtils")):t(e.jquery,e.underscore,e.canvgModule,e["baglass/core-client/js/core-client/utils/BrowserUtils"]);for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}("undefined"!=typeof self?self:this,(function(e,t,n,o){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/bundles",t(t.s=0)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),A=o(n(1)),a=o(n(2)),s=o(n(3)),l=o(n(4)),c=o(n(6)),d={"box-sizing":!0,border:!0,background:!0,color:!0,"clip-path":"none","fill-opacity":!0,fill:"rgb(0, 0, 0)","font-family":!0,"font-size":!0,"font-style":"normal",height:"auto",left:"auto","line-height":!0,opacity:!0,overflow:!0,position:!0,"shape-rendering":"auto","stroke-width":!0,stroke:!0,"text-align":!0,"text-anchor":"start","text-size-adjust":"100%",top:"auto","transform-origin":!0,"transform-style":!0,transform:"none","vertical-align":!0,visibility:"visible",width:"auto"},u={transparent:!0,"rgba(0, 0, 0, 0)":!0},h=/url\("?([^)"]+)"?\)/i,g=/(^http[s]?:\/\/)|(^\/\/)|(^data:image\/)|(^blob:)/i,f=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var n=t.UniqueId,o=t.elementMap,r=t.html2canvas,A=t.canvg,d=t.logging;this.isIE=c.default.isIE(),this.isSafari=c.default.isSafari(),this._uniqueId=n||a.default.uniqueId,this.elementMap=o||{},this.imgWithSVG=["snapshot","clsVcSlotImg"],this.html2canvas=r||l.default,this.canvg=A||s.default,this.logging=d||!1,this.glassLogger=t.glassLogger,this.proxy=t.proxy,window&&window.getComputedStyle?this._fComputeStyle=window.getComputedStyle.bind(window):this._fComputeStyle=function(e){return e.currentStyle||e.style},this.patchSVG=this.isIE?function(e){return(e=(e=(e=e.replace(/:?NS[0-9]+:?/gi,"")).replace(/xmlns="(?:http:\/\/www\.w3\.org\/2000\/svg)?"/gi,"")).replace(/xmlns(:xlink)?="(?:http:\/\/www\.w3\.org\/1999\/xlink)?"/gi,"")).replace(/<svg\s*/g,'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" ')}:this.isSafari?function(e){return e.replace(/ NS[0-9]+:href/gi," href")}:function(e){return e},this.serialize=this.isIE?function(e){return(new window.XMLSerializer).serializeToString(e)}:function(e){return e.outerHTML}}return r(e,[{key:"destroy",value:function(){}},{key:"generateImage",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(o,i){var r=null,A=e.ownerDocument,s=A.location,l=s.pathname.split("/");l[l.length-1]="";var c=a.default.extend({resolve:o,reject:i,node:e,attribute:t._uniqueId.get("data-generate-image-"),origin:s.origin||s.protocol+"//"+s.host,pathname:l.join("/"),waits:[]},n);e.setAttribute(c.attribute,"true"),t.isIE||A.querySelector("base")||((r=A.createElement("base")).href=t._makeAbsoluteUrl(c.origin,c.pathname,""),A.head.insertBefore(r,A.head.firstElementChild));var d={async:!0,onclone:t._html2canvas_onCloned.bind(t,c),ignoreElements:t._html2canvas_onIgnoreElements.bind(t,c),allowTaint:!1,scale:1,useCORS:!1,logging:t.logging,proxy:t.proxy,width:n.width,height:n.height,backgroundColor:null},u=function(t){return r&&r.remove(),e.removeAttribute(c.attribute),t};t._log("calling html2canvas..."),t.html2canvas(e,d).then(u,u).then(t._html2canvas_onRendered.bind(t,c)).catch(i)}))}},{key:"_processNodeClass",value:function(e,t,n){var o=(0,A.default)(n),i=this._createCanvas(o);o.children().detach(),o.append(i),this._svg2canvg(i,t)}},{key:"_processIMGWithSVG",value:function(e,t){var n=this,o=t.getAttribute("src");if(o){var i=this._makeAbsoluteUrl(e.origin,e.pathname,o);e.waits.push(A.default.ajax({url:i,type:"GET",dataType:"text"}).then((function(e){e=e.replace(/(\r\n|\n|\r|\t)/gm,"");var o=(0,A.default)(e);if(o.is("svg")){var i=(0,A.default)(t);o[0].setAttribute("height",t.offsetHeight+"px"),o[0].setAttribute("width",t.offsetWidth+"px");var r=n._svg2canvas(o[0],!0);(0,A.default)(r).attr("class",i.attr("class")).css("height","auto"),t.parentNode.replaceChild(r,t)}else n._log("warning: resource url is not an svg.")})).catch((function(e){n._log("warning: failed to retrieve resource from url "+i+".",e)})))}}},{key:"_processNodeIMG",value:function(e,t){var n=this;if(!this.imgWithSVG.some((function(e){return t.classList.contains(e)}))){var o=t.getAttribute("src");o&&!g.test(o)&&e.waits.push(new Promise((function(i){t.complete&&t.naturalWidth>0?i():(t.addEventListener("load",i),t.addEventListener("error",i),t.src=n._makeAbsoluteUrl(e.origin,e.pathname,o))})))}}},{key:"_processNodeSVG",value:function(e,t){this._replaceSvgWithBackground(e,t)||this._svg2canvas(t)}},{key:"_processNodeLINK",value:function(e,t){var n=this,o=t.getAttribute("href");o&&!g.test(o)&&e.waits.push(new Promise((function(i){t.sheet&&t.sheet.cssRules&&t.sheet.cssRules.length?i():(t.addEventListener("load",i),t.addEventListener("error",i),t.href=n._makeAbsoluteUrl(e.origin,e.pathname,o))})))}},{key:"_svg2canvas",value:function(e,t){var n=(0,A.default)(e);if((t||n.is(":visible"))&&!this._hasOnlyDefs(n)){var o=this._svg2text(e,t),i=this._createCanvas(n),r=n.attr("class");return r&&i.setAttribute("class",r),this._svg2canvg(i,o),e.parentNode.replaceChild(i,e),i}return null}},{key:"_applyStyles",value:function(e,t){var n=this;if(e.style.cssText=this._inlineStyles(e),this.isIE&&(e.style.strokeWidth="1px"),e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),t)return e;for(var o=e.getElementsByTagName("*"),i={},r=[],A=0,s=o.length;A<s;A++){var l=o[A];switch(l.style&&(l.style.cssText=this._inlineStyles(l)),l.tagName.toLowerCase()){case"clippath":"defs"!==l.parentNode.tagName.toLowerCase()&&r.push(l);break;case"use":for(var c=0,d=l.attributes.length;c<d;c++){var u=l.attributes[c],h=u.name,g=u.value;if("href"==h||h.match(/:href$/)){if("#"===g[0]&&!i[g]){var f=g.substr(1),p=e.ownerDocument.getElementById(f);if(p){if("symbol"!==p.tagName.toLowerCase()){var m=e.ownerDocument.createElement("symbol");p.removeAttribute("id"),p.parentNode.replaceChild(m,p),m.appendChild(p),m.setAttribute("overflow","visible"),m.setAttribute("id",f),p=m}i[g]=p}else this._log("Warning: did not found svg symbol with id",f)}break}}break;case"fegaussianblur":if(this.isIE){var B=l.getAttribute("stdDeviation");B&&parseFloat(B)>100&&l.setAttribute("stdDeviation",0)}}}if(!a.default.isEmpty(i)||r.length>0){var C=e.ownerDocument.createElement("defs"),v=[];Object.keys(i).forEach((function(e){var t=i[e].cloneNode(!0);C.appendChild(t),v.push(t)})),r.forEach((function(e){return C.appendChild(e)})),e.insertBefore(C,e.childNodes[0]),r.length>0?e.style.cssText=this._inlineStyles(e,["fill"]):v.forEach((function(e){return n._applyStyles(e)}))}return e}},{key:"_svg2text",value:function(e,t){return this.patchSVG(this.serialize(this._applyStyles(e,t)))}},{key:"_svg2canvg",value:function(e,t){try{this.canvg(e,t,{ignoreMouse:!0,ignoreAnimation:!0})}catch(e){this._log("canvg is throwing an error",e)}e.svg.stop()}},{key:"_inlineStyles",value:function(e,t){var n=[],o=this._fComputeStyle(e);t=t||[];for(var i=0,r=o.length;i<r;i++){var A=o[i];!d[A]||!0!==d[A]&&d[A]===o[A]||-1!==t.indexOf(A)||n.push(A+":"+o[A])}return n.join(";")}},{key:"_createCanvas",value:function(e){var t=e[0].ownerDocument.createElement("canvas");return t.width=e.width(),t.height=e.height(),t}},{key:"_replaceSvgWithBackground",value:function(e,t){if(t.style.backgroundImage){var n=t.style.backgroundImage.match(h);if(n&&2===n.length){var o=n[1],i=t.ownerDocument.createElement("div");return i.style.display="inline-block",i.style.width=t.style.width,i.style.height=t.style.height,i.className=t.className.baseValue?t.className.baseValue:t.className,this.isIE&&!g.test(o)&&(o=this._makeAbsoluteUrl(e.origin,e.pathname,o)),i.style.backgroundImage="url("+o+")",t.parentNode.replaceChild(i,t),!0}}return!1}},{key:"_hasOnlyDefs",value:function(e){var t=e.children();return 1===t.length&&"defs"===t[0].tagName}},{key:"_hasOnlySvgs",value:function(e){return(0,A.default)(e).children("svg").length>0}},{key:"_makeAbsoluteUrl",value:function(e,t,n){return"/"===n[0]?e+n:e+t+n}},{key:"_html2canvas_onCloned",value:function(e,t){var n=this;return new Promise((function(o,i){try{n._log("document was cloned, now processing the nodes");var r=t.querySelector("["+e.attribute+"]");if(e.onClone&&e.onClone(t,r),t.body.style.margin="0",t.body.style.padding="0",e.transparentBackground)r.style.backgroundColor="transparent";else for(var s=r;s&&u[window.getComputedStyle(s).getPropertyValue("background-color")];)s.style.backgroundColor="inherit",s=s.parentElement;t.body.clientWidth,t.body.clientHeight;var l=(0,A.default)(r),c=1;n._log(c+++": converts special images with SVG source"),a.default.each(n.imgWithSVG,(function(t){l.find("img."+t).get().forEach(n._processIMGWithSVG.bind(n,e))})),n._log(c+++": converts classes to svgs, if any."),a.default.each(a.default.keys(n.elementMap),(function(t){l.find("."+t).get().forEach(n._processNodeClass.bind(n,e,n.elementMap[t]))})),n._log(c+++": process svgs by changing them to canvas"),l.find("svg").get().forEach(n._processNodeSVG.bind(n,e)),n.isIE&&(n._log(c+++': process images by making their "src" attribute absolute'),l.find("img").get().forEach(n._processNodeIMG.bind(n,e)),n._log(c+++': process links by making their "href" attribute absolute'),(0,A.default)(t.head).find('link[rel="stylesheet"]').get().forEach(n._processNodeLINK.bind(n,e))),n._log(c+++": done processing nodes, waiting for "+e.waits.length+" promises to complete."),Promise.all(e.waits).then((function(){n._log("let html2canvas continue is processing."),o(r)}))}catch(e){i(e)}}))}},{key:"_html2canvas_onIgnoreElements",value:function(e,t){return this._isHiddenElement(e,t)||this._isExcludedElement(e,t)}},{key:"_isHiddenElement",value:function(e,t){return t.style&&("none"===t.style.display||"hidden"===t.style.visibility||"0"===t.style.opacity)&&!("svgIcons"===t.id||"infographicDef"===t.className||this._hasOnlySvgs(t))}},{key:"_isExcludedElement",value:function(e,t){return this._isExcludedLinkElement(e,t)||this._isExcludedIframeElement(e,t)}},{key:"_isExcludedLinkElement",value:function(e,t){return!0===e.excludeLinks&&t.tagName&&"LINK"===t.tagName.toUpperCase()}},{key:"_isExcludedIframeElement",value:function(e,t){try{return!0===e.excludeEmptyIframes&&t.tagName&&"IFRAME"===t.tagName.toUpperCase()&&t.contentWindow&&t.contentWindow.location&&"about:blank"===t.contentWindow.location.href}catch(e){return this._log(e),!1}}},{key:"_html2canvas_onRendered",value:function(e,t){try{if(this._log("_html2canvas_onRendered() called."),!t||"canvas"!==t.localName||"http://www.w3.org/1999/xhtml"!==t.namespaceURI)return void e.reject(t);var n=void 0,o=t.width,i=t.height;if(e.maxWidth&&e.maxWidth<o||e.maxHeight&&e.maxHeight<i){var r=1e3,A=1e3,a=document.createElement("canvas");e.maxWidth&&(r=e.maxWidth/o),e.maxHeight&&(A=e.maxHeight/i);var s=Math.min(r,A);a.width=t.width*s,a.height=t.height*s,a.getContext("2d").drawImage(t,0,0,o,i,0,0,a.width,a.height),n=e.binary?a:a.toDataURL()}else n=e.binary?t:t.toDataURL();e.resolve(n)}catch(t){e.reject(t)}}},{key:"_log",value:function(){var e;if(this.glassLogger)(e=this.glassLogger).info.apply(e,arguments);else if(this.logging){var t;(t=console).log.apply(t,arguments)}}}]),e}();t.default=f},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t,n){"use strict";(function(e){var n,o,i,r,A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};
  10. /*!
  11. * ba-html2canvas 1.0.0-alpha.12 <https://html2canvas.hertzen.com>
  12. * Copyright (c) 2020 Niklas von Hertzen <https://hertzen.com>
  13. * Released under MIT License
  14. */r=function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=27)}([function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],o=!0,i=!1,r=void 0;try{for(var A,a=e[Symbol.iterator]();!(o=(A=a.next()).done)&&(n.push(A.value),!t||n.length!==t);o=!0);}catch(e){i=!0,r=e}finally{try{!o&&a.return&&a.return()}finally{if(i)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=/^#([a-f0-9]{3})$/i,A=function(e){var t=e.match(r);return!!t&&[parseInt(t[1][0]+t[1][0],16),parseInt(t[1][1]+t[1][1],16),parseInt(t[1][2]+t[1][2],16),null]},a=/^#([a-f0-9]{6})$/i,s=function(e){var t=e.match(a);return!!t&&[parseInt(t[1].substring(0,2),16),parseInt(t[1].substring(2,4),16),parseInt(t[1].substring(4,6),16),null]},l=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/,c=function(e){var t=e.match(l);return!!t&&[Number(t[1]),Number(t[2]),Number(t[3]),null]},d=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d?\.?\d+)\s*\)$/,u=function(e){var t=e.match(d);return!!(t&&t.length>4)&&[Number(t[1]),Number(t[2]),Number(t[3]),Number(t[4])]},h=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=Array.isArray(t)?function(e){return[Math.min(e[0],255),Math.min(e[1],255),Math.min(e[2],255),e.length>3?e[3]:null]}(t):A(t)||c(t)||u(t)||function(e){return g[e.toLowerCase()]||!1}(t)||s(t)||[0,0,0,null],i=o(n,4),r=i[0],a=i[1],l=i[2],d=i[3];this.r=r,this.g=a,this.b=l,this.a=d}return i(e,[{key:"isTransparent",value:function(){return 0===this.a}},{key:"toString",value:function(){return null!==this.a&&1!==this.a?"rgba("+this.r+","+this.g+","+this.b+","+this.a+")":"rgb("+this.r+","+this.g+","+this.b+")"}}]),e}();t.default=h;var g={transparent:[0,0,0,0],aliceblue:[240,248,255,null],antiquewhite:[250,235,215,null],aqua:[0,255,255,null],aquamarine:[127,255,212,null],azure:[240,255,255,null],beige:[245,245,220,null],bisque:[255,228,196,null],black:[0,0,0,null],blanchedalmond:[255,235,205,null],blue:[0,0,255,null],blueviolet:[138,43,226,null],brown:[165,42,42,null],burlywood:[222,184,135,null],cadetblue:[95,158,160,null],chartreuse:[127,255,0,null],chocolate:[210,105,30,null],coral:[255,127,80,null],cornflowerblue:[100,149,237,null],cornsilk:[255,248,220,null],crimson:[220,20,60,null],cyan:[0,255,255,null],darkblue:[0,0,139,null],darkcyan:[0,139,139,null],darkgoldenrod:[184,134,11,null],darkgray:[169,169,169,null],darkgreen:[0,100,0,null],darkgrey:[169,169,169,null],darkkhaki:[189,183,107,null],darkmagenta:[139,0,139,null],darkolivegreen:[85,107,47,null],darkorange:[255,140,0,null],darkorchid:[153,50,204,null],darkred:[139,0,0,null],darksalmon:[233,150,122,null],darkseagreen:[143,188,143,null],darkslateblue:[72,61,139,null],darkslategray:[47,79,79,null],darkslategrey:[47,79,79,null],darkturquoise:[0,206,209,null],darkviolet:[148,0,211,null],deeppink:[255,20,147,null],deepskyblue:[0,191,255,null],dimgray:[105,105,105,null],dimgrey:[105,105,105,null],dodgerblue:[30,144,255,null],firebrick:[178,34,34,null],floralwhite:[255,250,240,null],forestgreen:[34,139,34,null],fuchsia:[255,0,255,null],gainsboro:[220,220,220,null],ghostwhite:[248,248,255,null],gold:[255,215,0,null],goldenrod:[218,165,32,null],gray:[128,128,128,null],green:[0,128,0,null],greenyellow:[173,255,47,null],grey:[128,128,128,null],honeydew:[240,255,240,null],hotpink:[255,105,180,null],indianred:[205,92,92,null],indigo:[75,0,130,null],ivory:[255,255,240,null],khaki:[240,230,140,null],lavender:[230,230,250,null],lavenderblush:[255,240,245,null],lawngreen:[124,252,0,null],lemonchiffon:[255,250,205,null],lightblue:[173,216,230,null],lightcoral:[240,128,128,null],lightcyan:[224,255,255,null],lightgoldenrodyellow:[250,250,210,null],lightgray:[211,211,211,null],lightgreen:[144,238,144,null],lightgrey:[211,211,211,null],lightpink:[255,182,193,null],lightsalmon:[255,160,122,null],lightseagreen:[32,178,170,null],lightskyblue:[135,206,250,null],lightslategray:[119,136,153,null],lightslategrey:[119,136,153,null],lightsteelblue:[176,196,222,null],lightyellow:[255,255,224,null],lime:[0,255,0,null],limegreen:[50,205,50,null],linen:[250,240,230,null],magenta:[255,0,255,null],maroon:[128,0,0,null],mediumaquamarine:[102,205,170,null],mediumblue:[0,0,205,null],mediumorchid:[186,85,211,null],mediumpurple:[147,112,219,null],mediumseagreen:[60,179,113,null],mediumslateblue:[123,104,238,null],mediumspringgreen:[0,250,154,null],mediumturquoise:[72,209,204,null],mediumvioletred:[199,21,133,null],midnightblue:[25,25,112,null],mintcream:[245,255,250,null],mistyrose:[255,228,225,null],moccasin:[255,228,181,null],navajowhite:[255,222,173,null],navy:[0,0,128,null],oldlace:[253,245,230,null],olive:[128,128,0,null],olivedrab:[107,142,35,null],orange:[255,165,0,null],orangered:[255,69,0,null],orchid:[218,112,214,null],palegoldenrod:[238,232,170,null],palegreen:[152,251,152,null],paleturquoise:[175,238,238,null],palevioletred:[219,112,147,null],papayawhip:[255,239,213,null],peachpuff:[255,218,185,null],peru:[205,133,63,null],pink:[255,192,203,null],plum:[221,160,221,null],powderblue:[176,224,230,null],purple:[128,0,128,null],rebeccapurple:[102,51,153,null],red:[255,0,0,null],rosybrown:[188,143,143,null],royalblue:[65,105,225,null],saddlebrown:[139,69,19,null],salmon:[250,128,114,null],sandybrown:[244,164,96,null],seagreen:[46,139,87,null],seashell:[255,245,238,null],sienna:[160,82,45,null],silver:[192,192,192,null],skyblue:[135,206,235,null],slateblue:[106,90,205,null],slategray:[112,128,144,null],slategrey:[112,128,144,null],snow:[255,250,250,null],springgreen:[0,255,127,null],steelblue:[70,130,180,null],tan:[210,180,140,null],teal:[0,128,128,null],thistle:[216,191,216,null],tomato:[255,99,71,null],turquoise:[64,224,208,null],violet:[238,130,238,null],wheat:[245,222,179,null],white:[255,255,255,null],whitesmoke:[245,245,245,null],yellow:[255,255,0,null],yellowgreen:[154,205,50,null]};t.TRANSPARENT=new h([0,0,0,0])},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=t.LENGTH_TYPE={PX:0,PERCENTAGE:1},r=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.type="%"===t.substr(t.length-1)?i.PERCENTAGE:i.PX;var n=parseFloat(t);isNaN(n)&&console.error('Invalid value given for Length: "'+t+'"'),this.value=isNaN(n)?0:n}return o(e,[{key:"isPercentage",value:function(){return this.type===i.PERCENTAGE}},{key:"getAbsoluteValue",value:function(e){return this.isPercentage()?e*(this.value/100):this.value}}],[{key:"create",value:function(t){return new e(t)}}]),e}();t.default=r,t.calculateLengthFromValueWithUnit=function(e,t,n){switch(n){case"px":case"%":return new r(t+n);case"em":case"rem":var o=new r(t);return o.value*="em"===n?parseFloat(e.style.font.fontSize):function e(t){var n=t.parent;return n?e(n):parseFloat(t.style.font.fontSize)}(e),o;default:return new r("0")}}},function(e,t,n){function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.parseBoundCurves=t.calculatePaddingBoxPath=t.calculateBorderBoxPath=t.parsePathForBorder=t.parseDocumentSize=t.calculateContentBox=t.calculatePaddingBox=t.parseBounds=t.Bounds=void 0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=o(n(7)),A=o(n(32)),a=t.Bounds=function(){function e(t,n,o,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.left=t,this.top=n,this.width=o,this.height=i}return i(e,null,[{key:"fromClientRect",value:function(t,n,o){return new e(t.left+n,t.top+o,t.width,t.height)}}]),e}(),s=(t.parseBounds=function(e,t,n){return a.fromClientRect(e.getBoundingClientRect(),t,n)},t.calculatePaddingBox=function(e,t){return new a(e.left+t[3].borderWidth,e.top+t[0].borderWidth,e.width-(t[1].borderWidth+t[3].borderWidth),e.height-(t[0].borderWidth+t[2].borderWidth))},t.calculateContentBox=function(e,t,n){var o=t[0].value,i=t[1].value,r=t[2].value,A=t[3].value;return new a(e.left+A+n[3].borderWidth,e.top+o+n[0].borderWidth,e.width-(n[1].borderWidth+n[3].borderWidth+A+i),e.height-(n[0].borderWidth+n[2].borderWidth+o+r))},t.parseDocumentSize=function(e){var t=e.body,n=e.documentElement;if(!t||!n)throw new Error("Unable to get document size");var o=Math.max(Math.max(t.scrollWidth,n.scrollWidth),Math.max(t.offsetWidth,n.offsetWidth),Math.max(t.clientWidth,n.clientWidth)),i=Math.max(Math.max(t.scrollHeight,n.scrollHeight),Math.max(t.offsetHeight,n.offsetHeight),Math.max(t.clientHeight,n.clientHeight));return new a(0,0,o,i)},t.parsePathForBorder=function(e,t){switch(t){case 0:return s(e.topLeftOuter,e.topLeftInner,e.topRightOuter,e.topRightInner);case 1:return s(e.topRightOuter,e.topRightInner,e.bottomRightOuter,e.bottomRightInner);case 2:return s(e.bottomRightOuter,e.bottomRightInner,e.bottomLeftOuter,e.bottomLeftInner);case 3:default:return s(e.bottomLeftOuter,e.bottomLeftInner,e.topLeftOuter,e.topLeftInner)}},function(e,t,n,o){var i=[];return e instanceof A.default?i.push(e.subdivide(.5,!1)):i.push(e),n instanceof A.default?i.push(n.subdivide(.5,!0)):i.push(n),o instanceof A.default?i.push(o.subdivide(.5,!0).reverse()):i.push(o),t instanceof A.default?i.push(t.subdivide(.5,!1).reverse()):i.push(t),i}),l=(t.calculateBorderBoxPath=function(e){return[e.topLeftOuter,e.topRightOuter,e.bottomRightOuter,e.bottomLeftOuter]},t.calculatePaddingBoxPath=function(e){return[e.topLeftInner,e.topRightInner,e.bottomRightInner,e.bottomLeftInner]},t.parseBoundCurves=function(e,t,n){var o=n[l.TOP_LEFT][0].getAbsoluteValue(e.width),i=n[l.TOP_LEFT][1].getAbsoluteValue(e.height),A=n[l.TOP_RIGHT][0].getAbsoluteValue(e.width),a=n[l.TOP_RIGHT][1].getAbsoluteValue(e.height),s=n[l.BOTTOM_RIGHT][0].getAbsoluteValue(e.width),d=n[l.BOTTOM_RIGHT][1].getAbsoluteValue(e.height),u=n[l.BOTTOM_LEFT][0].getAbsoluteValue(e.width),h=n[l.BOTTOM_LEFT][1].getAbsoluteValue(e.height),g=[];g.push((o+A)/e.width),g.push((u+s)/e.width),g.push((i+h)/e.height),g.push((a+d)/e.height);var f=Math.max.apply(Math,g);f>1&&(o/=f,i/=f,A/=f,a/=f,s/=f,d/=f,u/=f,h/=f);var p=e.width-A,m=e.height-d,B=e.width-s,C=e.height-h;return{topLeftOuter:o>0||i>0?c(e.left,e.top,o,i,l.TOP_LEFT):new r.default(e.left,e.top),topLeftInner:o>0||i>0?c(e.left+t[3].borderWidth,e.top+t[0].borderWidth,Math.max(0,o-t[3].borderWidth),Math.max(0,i-t[0].borderWidth),l.TOP_LEFT):new r.default(e.left+t[3].borderWidth,e.top+t[0].borderWidth),topRightOuter:A>0||a>0?c(e.left+p,e.top,A,a,l.TOP_RIGHT):new r.default(e.left+e.width,e.top),topRightInner:A>0||a>0?c(e.left+Math.min(p,e.width+t[3].borderWidth),e.top+t[0].borderWidth,p>e.width+t[3].borderWidth?0:A-t[3].borderWidth,a-t[0].borderWidth,l.TOP_RIGHT):new r.default(e.left+e.width-t[1].borderWidth,e.top+t[0].borderWidth),bottomRightOuter:s>0||d>0?c(e.left+B,e.top+m,s,d,l.BOTTOM_RIGHT):new r.default(e.left+e.width,e.top+e.height),bottomRightInner:s>0||d>0?c(e.left+Math.min(B,e.width-t[3].borderWidth),e.top+Math.min(m,e.height+t[0].borderWidth),Math.max(0,s-t[1].borderWidth),d-t[2].borderWidth,l.BOTTOM_RIGHT):new r.default(e.left+e.width-t[1].borderWidth,e.top+e.height-t[2].borderWidth),bottomLeftOuter:u>0||h>0?c(e.left,e.top+C,u,h,l.BOTTOM_LEFT):new r.default(e.left,e.top+e.height),bottomLeftInner:u>0||h>0?c(e.left+t[3].borderWidth,e.top+C,Math.max(0,u-t[3].borderWidth),h-t[2].borderWidth,l.BOTTOM_LEFT):new r.default(e.left+t[3].borderWidth,e.top+e.height-t[2].borderWidth)}},{TOP_LEFT:0,TOP_RIGHT:1,BOTTOM_RIGHT:2,BOTTOM_LEFT:3}),c=function(e,t,n,o,i){var a=(Math.sqrt(2)-1)/3*4,s=n*a,c=o*a,d=e+n,u=t+o;switch(i){case l.TOP_LEFT:return new A.default(new r.default(e,u),new r.default(e,u-c),new r.default(d-s,t),new r.default(d,t));case l.TOP_RIGHT:return new A.default(new r.default(e,t),new r.default(e+s,t),new r.default(d,u-c),new r.default(d,u));case l.BOTTOM_RIGHT:return new A.default(new r.default(d,t),new r.default(d,t+c),new r.default(e+s,u),new r.default(e,u));case l.BOTTOM_LEFT:default:return new A.default(new r.default(d,u),new r.default(d-s,u),new r.default(e,t+c),new r.default(e,t))}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.contains=function(e,t){return 0!=(e&t)},t.distance=function(e,t){return Math.sqrt(e*e+t*t)},t.copyCSSStyles=function(e,t){for(var n=e.length-1;n>=0;n--){var o=e.item(n);"content"!==o&&t.style.setProperty(o,e.getPropertyValue(o))}return t},t.SMALL_IMAGE="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"},function(e,t,n){function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.parseBackgroundImage=t.parseBackground=t.calculateBackgroundRepeatPath=t.calculateBackgroundPosition=t.calculateBackgroungPositioningArea=t.calculateBackgroungPaintingArea=t.calculateGradientBackgroundSize=t.calculateBackgroundSize=t.BACKGROUND_ORIGIN=t.BACKGROUND_CLIP=t.BACKGROUND_SIZE=t.BACKGROUND_REPEAT=void 0;var i=o(n(0)),r=o(n(1)),A=o(n(31)),a=o(n(7)),s=n(2),l=n(17),c=t.BACKGROUND_REPEAT={REPEAT:0,NO_REPEAT:1,REPEAT_X:2,REPEAT_Y:3},d=t.BACKGROUND_SIZE={AUTO:0,CONTAIN:1,COVER:2,LENGTH:3},u=t.BACKGROUND_CLIP={BORDER_BOX:0,PADDING_BOX:1,CONTENT_BOX:2},h=t.BACKGROUND_ORIGIN=u,g=function e(t){switch(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t){case"contain":this.size=d.CONTAIN;break;case"cover":this.size=d.COVER;break;case"auto":this.size=d.AUTO;break;default:this.value=new r.default(t)}},f=(t.calculateBackgroundSize=function(e,t,n){var o=0,i=0,r=e.size;if(r[0].size===d.CONTAIN||r[0].size===d.COVER){var a=n.width/n.height,s=t.width/t.height;return a<s!=(r[0].size===d.COVER)?new A.default(n.width,n.width/s):new A.default(n.height*s,n.height)}return r[0].value&&(o=r[0].value.getAbsoluteValue(n.width)),r[0].size===d.AUTO&&r[1].size===d.AUTO?i=t.height:r[1].size===d.AUTO?i=o/t.width*t.height:r[1].value&&(i=r[1].value.getAbsoluteValue(n.height)),r[0].size===d.AUTO&&(o=i/t.height*t.width),new A.default(o,i)},t.calculateGradientBackgroundSize=function(e,t){var n=e.size,o=n[0].value?n[0].value.getAbsoluteValue(t.width):t.width,i=n[1].value?n[1].value.getAbsoluteValue(t.height):n[0].value?o:t.height;return new A.default(o,i)},new g("auto")),p=(t.calculateBackgroungPaintingArea=function(e,t){switch(t){case u.BORDER_BOX:return(0,s.calculateBorderBoxPath)(e);case u.PADDING_BOX:default:return(0,s.calculatePaddingBoxPath)(e)}},t.calculateBackgroungPositioningArea=function(e,t,n,o){var i=(0,s.calculatePaddingBox)(t,o);switch(e){case h.BORDER_BOX:return t;case h.CONTENT_BOX:var r=n[l.PADDING_SIDES.LEFT].getAbsoluteValue(t.width),A=n[l.PADDING_SIDES.RIGHT].getAbsoluteValue(t.width),a=n[l.PADDING_SIDES.TOP].getAbsoluteValue(t.width),c=n[l.PADDING_SIDES.BOTTOM].getAbsoluteValue(t.width);return new s.Bounds(i.left+r,i.top+a,i.width-r-A,i.height-a-c);case h.PADDING_BOX:default:return i}},t.calculateBackgroundPosition=function(e,t,n){return new a.default(e[0].getAbsoluteValue(n.width-t.width),e[1].getAbsoluteValue(n.height-t.height))},t.calculateBackgroundRepeatPath=function(e,t,n,o,i){switch(e.repeat){case c.REPEAT_X:return[new a.default(Math.round(i.left),Math.round(o.top+t.y)),new a.default(Math.round(i.left+i.width),Math.round(o.top+t.y)),new a.default(Math.round(i.left+i.width),Math.round(n.height+o.top+t.y)),new a.default(Math.round(i.left),Math.round(n.height+o.top+t.y))];case c.REPEAT_Y:return[new a.default(Math.round(o.left+t.x),Math.round(i.top)),new a.default(Math.round(o.left+t.x+n.width),Math.round(i.top)),new a.default(Math.round(o.left+t.x+n.width),Math.round(i.height+i.top)),new a.default(Math.round(o.left+t.x),Math.round(i.height+i.top))];case c.NO_REPEAT:return[new a.default(Math.round(o.left+t.x),Math.round(o.top+t.y)),new a.default(Math.round(o.left+t.x+n.width),Math.round(o.top+t.y)),new a.default(Math.round(o.left+t.x+n.width),Math.round(o.top+t.y+n.height)),new a.default(Math.round(o.left+t.x),Math.round(o.top+t.y+n.height))];default:return[new a.default(Math.round(i.left),Math.round(i.top)),new a.default(Math.round(i.left+i.width),Math.round(i.top)),new a.default(Math.round(i.left+i.width),Math.round(i.height+i.top)),new a.default(Math.round(i.left),Math.round(i.height+i.top))]}},t.parseBackground=function(e,t){return{backgroundColor:new i.default(e.backgroundColor),backgroundImage:C(e,t),backgroundClip:p(e.backgroundClip),backgroundOrigin:m(e.backgroundOrigin)}},function(e){switch(e){case"padding-box":return u.PADDING_BOX;case"content-box":return u.CONTENT_BOX}return u.BORDER_BOX}),m=function(e){switch(e){case"padding-box":return h.PADDING_BOX;case"content-box":return h.CONTENT_BOX}return h.BORDER_BOX},B=function(e){switch(e.trim()){case"no-repeat":return c.NO_REPEAT;case"repeat-x":case"repeat no-repeat":return c.REPEAT_X;case"repeat-y":case"no-repeat repeat":return c.REPEAT_Y;case"repeat":return c.REPEAT}return console.error('Invalid background-repeat value "'+e+'"'),c.REPEAT},C=function(e,t){var n=b(e.backgroundImage).map((function(e){if("url"===e.method){var n=t.loadImage(e.args[0]);e.args=n?[n]:[]}return e})),o=e.backgroundPosition.split(","),i=e.backgroundRepeat.split(","),r=e.backgroundSize.split(",");return n.map((function(e,t){var n=(r[t]||"auto").trim().split(" ").map(v),A=(o[t]||"auto").trim().split(" ").map(w);return{source:e,repeat:B("string"==typeof i[t]?i[t]:i[0]),size:n.length<2?[n[0],f]:[n[0],n[1]],position:A.length<2?[A[0],A[0]]:[A[0],A[1]]}}))},v=function(e){return"auto"===e?f:new g(e)},w=function(e){switch(e){case"bottom":case"right":return new r.default("100%");case"left":case"top":return new r.default("0%");case"auto":return new r.default("0")}return new r.default(e)},b=t.parseBackgroundImage=function(e){var t=/^\s$/,n=[],o=[],i="",r=null,A="",a=0,s=0,l=function(){var e="";if(i){'"'===A.substr(0,1)&&(A=A.substr(1,A.length-2)),A&&o.push(A.trim());var t=i.indexOf("-",1)+1;"-"===i.substr(0,1)&&t>0&&(e=i.substr(0,t).toLowerCase(),i=i.substr(t)),"none"!==(i=i.toLowerCase())&&n.push({prefix:e,method:i,args:o})}o=[],i=A=""};return e.split("").forEach((function(e){if(0!==a||!t.test(e)){switch(e){case'"':r?r===e&&(r=null):r=e;break;case"(":if(r)break;if(0===a)return void(a=1);s++;break;case")":if(r)break;if(1===a){if(0===s)return a=0,void l();s--}break;case",":if(r)break;if(0===a)return void l();if(1===a&&0===s&&!i.match(/^url$/i))return o.push(A.trim()),void(A="")}0===a?i+=e:A+=e}})),l(),n}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.PATH={VECTOR:0,BEZIER_CURVE:1,CIRCLE:2}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function(e){return e&&e.__esModule?e:{default:e}}(n(0)),r=n(3),A=n(4),a=n(12),s=n(33),l=n(34),c=n(35),d=n(36),u=n(37),h=n(38),g=n(8),f=n(39),p=n(40),m=n(18),B=n(17),C=n(19),v=n(11),w=n(41),b=n(20),y=n(42),F=n(43),_=n(44),E=n(45),Q=n(2),U=n(21),S=n(14),T=["INPUT","TEXTAREA","SELECT"],I=function(){function e(t,n,o,r){var I=this;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.parent=n,this.tagName=t.tagName,this.index=r,this.childNodes=[],this.listItems=[],"number"==typeof t.start&&(this.listStart=t.start);var H=t.ownerDocument.defaultView,N=H.pageXOffset,L=H.pageYOffset,x=H.getComputedStyle(t,null),R=(0,l.parseDisplay)(x.display),M="radio"===t.type||"checkbox"===t.type,D=(0,C.parsePosition)(x.position);if(this.style={background:M?U.INPUT_BACKGROUND:(0,A.parseBackground)(x,o),border:M?U.INPUT_BORDERS:(0,a.parseBorder)(x),borderRadius:(t instanceof H.HTMLInputElement||t instanceof HTMLInputElement)&&M?(0,U.getInputBorderRadius)(t):(0,s.parseBorderRadius)(x),color:M?U.INPUT_COLOR:new i.default(x.color),display:R,float:(0,c.parseCSSFloat)(x.float),font:(0,d.parseFont)(x),letterSpacing:(0,u.parseLetterSpacing)(x.letterSpacing),listStyle:R===l.DISPLAY.LIST_ITEM?(0,g.parseListStyle)(x):null,lineBreak:(0,h.parseLineBreak)(x.lineBreak),margin:(0,f.parseMargin)(x),opacity:parseFloat(x.opacity),overflow:-1===T.indexOf(t.tagName)?(0,p.parseOverflow)(x.overflow):p.OVERFLOW.HIDDEN,overflowWrap:(0,m.parseOverflowWrap)(x.overflowWrap?x.overflowWrap:x.wordWrap),padding:(0,B.parsePadding)(x),position:D,textDecoration:(0,v.parseTextDecoration)(x),textShadow:(0,w.parseTextShadow)(x.textShadow),textTransform:(0,b.parseTextTransform)(x.textTransform),transform:(0,y.parseTransform)(x),visibility:(0,F.parseVisibility)(x.visibility),wordBreak:(0,_.parseWordBreak)(x.wordBreak),zIndex:(0,E.parseZIndex)(D!==C.POSITION.STATIC?x.zIndex:"auto")},this.isTransformed()&&(t.style.transform="matrix(1,0,0,1,0,0)"),R===l.DISPLAY.LIST_ITEM){var k=(0,S.getListOwner)(this);if(k){var O=k.listItems.length;k.listItems.push(this),this.listIndex=t.hasAttribute("value")&&"number"==typeof t.value?t.value:0===O?"number"==typeof k.listStart?k.listStart:1:k.listItems[O-1].listIndex+1}}"IMG"===t.tagName&&t.addEventListener("load",(function(){I.bounds=(0,Q.parseBounds)(t,N,L),I.curvedBounds=(0,Q.parseBoundCurves)(I.bounds,I.style.border,I.style.borderRadius)})),this.image=P(t,o),this.bounds=M?(0,U.reformatInputBounds)((0,Q.parseBounds)(t,N,L)):(0,Q.parseBounds)(t,N,L),this.curvedBounds=(0,Q.parseBoundCurves)(this.bounds,this.style.border,this.style.borderRadius),this.name=t.tagName.toLowerCase()+(t.id?"#"+t.id:"")+t.className.toString().split(" ").map((function(e){return e.length?"."+e:""})).join("")}return o(e,[{key:"getClipPaths",value:function(){var e=this.parent?this.parent.getClipPaths():[];return this.style.overflow!==p.OVERFLOW.VISIBLE?e.concat([(0,Q.calculatePaddingBoxPath)(this.curvedBounds)]):e}},{key:"isInFlow",value:function(){return this.isRootElement()&&!this.isFloating()&&!this.isAbsolutelyPositioned()}},{key:"isVisible",value:function(){return!(0,r.contains)(this.style.display,l.DISPLAY.NONE)&&this.style.opacity>0&&this.style.visibility===F.VISIBILITY.VISIBLE}},{key:"isAbsolutelyPositioned",value:function(){return this.style.position!==C.POSITION.STATIC&&this.style.position!==C.POSITION.RELATIVE}},{key:"isPositioned",value:function(){return this.style.position!==C.POSITION.STATIC}},{key:"isFloating",value:function(){return this.style.float!==c.FLOAT.NONE}},{key:"isRootElement",value:function(){return null===this.parent}},{key:"isTransformed",value:function(){return null!==this.style.transform}},{key:"isPositionedWithZIndex",value:function(){return this.isPositioned()&&!this.style.zIndex.auto}},{key:"isInlineLevel",value:function(){return(0,r.contains)(this.style.display,l.DISPLAY.INLINE)||(0,r.contains)(this.style.display,l.DISPLAY.INLINE_BLOCK)||(0,r.contains)(this.style.display,l.DISPLAY.INLINE_FLEX)||(0,r.contains)(this.style.display,l.DISPLAY.INLINE_GRID)||(0,r.contains)(this.style.display,l.DISPLAY.INLINE_LIST_ITEM)||(0,r.contains)(this.style.display,l.DISPLAY.INLINE_TABLE)}},{key:"isInlineBlockOrInlineTable",value:function(){return(0,r.contains)(this.style.display,l.DISPLAY.INLINE_BLOCK)||(0,r.contains)(this.style.display,l.DISPLAY.INLINE_TABLE)}}]),e}();t.default=I;var P=function(e,t){if(e instanceof e.ownerDocument.defaultView.SVGSVGElement||e instanceof SVGSVGElement){var n=new XMLSerializer;return t.loadImage("data:image/svg+xml,"+encodeURIComponent(n.serializeToString(e)))}switch(e.tagName){case"IMG":var o=e;return t.loadImage(o.currentSrc||o.src);case"CANVAS":var i=e;return t.loadCanvas(i);case"IFRAME":var r=e.getAttribute("data-html2canvas-internal-iframe-key");if(r)return r}return null}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=n(5);t.default=function e(t,n){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.type=o.PATH.VECTOR,this.x=t,this.y=n,isNaN(t)&&console.error("Invalid x value given for Vector"),isNaN(n)&&console.error("Invalid y value given for Vector")}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseListStyle=t.parseListStyleType=t.LIST_STYLE_TYPE=t.LIST_STYLE_POSITION=void 0;var o=n(4),i=t.LIST_STYLE_POSITION={INSIDE:0,OUTSIDE:1},r=t.LIST_STYLE_TYPE={NONE:-1,DISC:0,CIRCLE:1,SQUARE:2,DECIMAL:3,CJK_DECIMAL:4,DECIMAL_LEADING_ZERO:5,LOWER_ROMAN:6,UPPER_ROMAN:7,LOWER_GREEK:8,LOWER_ALPHA:9,UPPER_ALPHA:10,ARABIC_INDIC:11,ARMENIAN:12,BENGALI:13,CAMBODIAN:14,CJK_EARTHLY_BRANCH:15,CJK_HEAVENLY_STEM:16,CJK_IDEOGRAPHIC:17,DEVANAGARI:18,ETHIOPIC_NUMERIC:19,GEORGIAN:20,GUJARATI:21,GURMUKHI:22,HEBREW:22,HIRAGANA:23,HIRAGANA_IROHA:24,JAPANESE_FORMAL:25,JAPANESE_INFORMAL:26,KANNADA:27,KATAKANA:28,KATAKANA_IROHA:29,KHMER:30,KOREAN_HANGUL_FORMAL:31,KOREAN_HANJA_FORMAL:32,KOREAN_HANJA_INFORMAL:33,LAO:34,LOWER_ARMENIAN:35,MALAYALAM:36,MONGOLIAN:37,MYANMAR:38,ORIYA:39,PERSIAN:40,SIMP_CHINESE_FORMAL:41,SIMP_CHINESE_INFORMAL:42,TAMIL:43,TELUGU:44,THAI:45,TIBETAN:46,TRAD_CHINESE_FORMAL:47,TRAD_CHINESE_INFORMAL:48,UPPER_ARMENIAN:49,DISCLOSURE_OPEN:50,DISCLOSURE_CLOSED:51},A=t.parseListStyleType=function(e){switch(e){case"disc":return r.DISC;case"circle":return r.CIRCLE;case"square":return r.SQUARE;case"decimal":return r.DECIMAL;case"cjk-decimal":return r.CJK_DECIMAL;case"decimal-leading-zero":return r.DECIMAL_LEADING_ZERO;case"lower-roman":return r.LOWER_ROMAN;case"upper-roman":return r.UPPER_ROMAN;case"lower-greek":return r.LOWER_GREEK;case"lower-alpha":return r.LOWER_ALPHA;case"upper-alpha":return r.UPPER_ALPHA;case"arabic-indic":return r.ARABIC_INDIC;case"armenian":return r.ARMENIAN;case"bengali":return r.BENGALI;case"cambodian":return r.CAMBODIAN;case"cjk-earthly-branch":return r.CJK_EARTHLY_BRANCH;case"cjk-heavenly-stem":return r.CJK_HEAVENLY_STEM;case"cjk-ideographic":return r.CJK_IDEOGRAPHIC;case"devanagari":return r.DEVANAGARI;case"ethiopic-numeric":return r.ETHIOPIC_NUMERIC;case"georgian":return r.GEORGIAN;case"gujarati":return r.GUJARATI;case"gurmukhi":return r.GURMUKHI;case"hebrew":return r.HEBREW;case"hiragana":return r.HIRAGANA;case"hiragana-iroha":return r.HIRAGANA_IROHA;case"japanese-formal":return r.JAPANESE_FORMAL;case"japanese-informal":return r.JAPANESE_INFORMAL;case"kannada":return r.KANNADA;case"katakana":return r.KATAKANA;case"katakana-iroha":return r.KATAKANA_IROHA;case"khmer":return r.KHMER;case"korean-hangul-formal":return r.KOREAN_HANGUL_FORMAL;case"korean-hanja-formal":return r.KOREAN_HANJA_FORMAL;case"korean-hanja-informal":return r.KOREAN_HANJA_INFORMAL;case"lao":return r.LAO;case"lower-armenian":return r.LOWER_ARMENIAN;case"malayalam":return r.MALAYALAM;case"mongolian":return r.MONGOLIAN;case"myanmar":return r.MYANMAR;case"oriya":return r.ORIYA;case"persian":return r.PERSIAN;case"simp-chinese-formal":return r.SIMP_CHINESE_FORMAL;case"simp-chinese-informal":return r.SIMP_CHINESE_INFORMAL;case"tamil":return r.TAMIL;case"telugu":return r.TELUGU;case"thai":return r.THAI;case"tibetan":return r.TIBETAN;case"trad-chinese-formal":return r.TRAD_CHINESE_FORMAL;case"trad-chinese-informal":return r.TRAD_CHINESE_INFORMAL;case"upper-armenian":return r.UPPER_ARMENIAN;case"disclosure-open":return r.DISCLOSURE_OPEN;case"disclosure-closed":return r.DISCLOSURE_CLOSED;case"none":default:return r.NONE}},a=(t.parseListStyle=function(e){var t=(0,o.parseBackgroundImage)(e.getPropertyValue("list-style-image"));return{listStyleType:A(e.getPropertyValue("list-style-type")),listStyleImage:t.length?t[0]:null,listStylePosition:a(e.getPropertyValue("list-style-position"))}},function(e){switch(e){case"inside":return i.INSIDE;case"outside":default:return i.OUTSIDE}})},function(e,t,n){function o(e,t,n){return e.length>0?t+n.toUpperCase():e}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=n(20),A=n(22),a=function(){function e(t,n,o){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.text=t,this.parent=n,this.bounds=o}return i(e,null,[{key:"fromTextNode",value:function(t,n){var o=l(t.data,n.style.textTransform);return new e(o,n,(0,A.parseTextBounds)(o,n,t))}}]),e}();t.default=a;var s=/(^|\s|:|-|\(|\))([a-z])/g,l=function(e,t){switch(t){case r.TEXT_TRANSFORM.LOWERCASE:return e.toLowerCase();case r.TEXT_TRANSFORM.CAPITALIZE:return e.replace(s,o);case r.TEXT_TRANSFORM.UPPERCASE:return e.toUpperCase();default:return e}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=n(23),i=function(e){return 0===e[0]&&255===e[1]&&0===e[2]&&255===e[3]},r={get SUPPORT_RANGE_BOUNDS(){var e=function(e){if(e.createRange){var t=e.createRange();if(t.getBoundingClientRect){var n=e.createElement("boundtest");n.style.height="123px",n.style.display="block",e.body.appendChild(n),t.selectNode(n);var o=t.getBoundingClientRect(),i=Math.round(o.height);if(e.body.removeChild(n),123===i)return!0}}return!1}(document);return Object.defineProperty(r,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=function(e){var t=new Image,n=e.createElement("canvas"),o=n.getContext("2d");t.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{o.drawImage(t,0,0),n.toDataURL()}catch(e){return!1}return!0}(document);return Object.defineProperty(r,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_BASE64_DRAWING(){return function(e){var t=function(e,t){var n=new Image,o=e.createElement("canvas"),i=o.getContext("2d");return new Promise((function(e){n.src=t;var r=function(){try{i.drawImage(n,0,0),o.toDataURL()}catch(t){return e(!1)}return e(!0)};n.onload=r,n.onerror=function(){return e(!1)},!0===n.complete&&setTimeout((function(){r()}),500)}))}(document,e);return Object.defineProperty(r,"SUPPORT_BASE64_DRAWING",{value:function(){return t}}),t}},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e="function"==typeof Array.from&&"function"==typeof window.fetch?function(e){var t=e.createElement("canvas");t.width=100,t.height=100;var n=t.getContext("2d");n.fillStyle="rgb(0, 255, 0)",n.fillRect(0,0,100,100);var r=new Image,A=t.toDataURL();r.src=A;var a=(0,o.createForeignObjectSVG)(100,100,0,0,r);return n.fillStyle="red",n.fillRect(0,0,100,100),(0,o.loadSerializedSVG)(a).then((function(t){n.drawImage(t,0,0);var r=n.getImageData(0,0,100,100).data;n.fillStyle="red",n.fillRect(0,0,100,100);var a=e.createElement("div");return a.style.backgroundImage="url("+A+")",a.style.height="100px",i(r)?(0,o.loadSerializedSVG)((0,o.createForeignObjectSVG)(100,100,0,0,a)):Promise.reject(!1)})).then((function(e){return n.drawImage(e,0,0),i(n.getImageData(0,0,100,100).data)})).catch((function(e){return!1}))}(document):Promise.resolve(!1);return Object.defineProperty(r,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=void 0!==(new Image).crossOrigin;return Object.defineProperty(r,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(r,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(r,"SUPPORT_CORS_XHR",{value:e}),e}};t.default=r},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseTextDecoration=t.TEXT_DECORATION_LINE=t.TEXT_DECORATION=t.TEXT_DECORATION_STYLE=void 0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(0)),i=t.TEXT_DECORATION_STYLE={SOLID:0,DOUBLE:1,DOTTED:2,DASHED:3,WAVY:4},r=t.TEXT_DECORATION={NONE:null},A=t.TEXT_DECORATION_LINE={UNDERLINE:1,OVERLINE:2,LINE_THROUGH:3,BLINK:4},a=function(e){switch(e){case"underline":return A.UNDERLINE;case"overline":return A.OVERLINE;case"line-through":return A.LINE_THROUGH}return A.BLINK},s=function(e){switch(e){case"double":return i.DOUBLE;case"dotted":return i.DOTTED;case"dashed":return i.DASHED;case"wavy":return i.WAVY}return i.SOLID};t.parseTextDecoration=function(e){var t=function(e){return"none"===e?null:e.split(" ").map(a)}(e.textDecorationLine?e.textDecorationLine:e.textDecoration);return null===t?r.NONE:{textDecorationLine:t,textDecorationColor:e.textDecorationColor?new o.default(e.textDecorationColor):null,textDecorationStyle:s(e.textDecorationStyle)}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseBorder=t.BORDER_SIDES=t.BORDER_STYLE=void 0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(0)),i=t.BORDER_STYLE={NONE:0,SOLID:1},r=t.BORDER_SIDES={TOP:0,RIGHT:1,BOTTOM:2,LEFT:3},A=Object.keys(r).map((function(e){return e.toLowerCase()})),a=function(e){switch(e){case"none":return i.NONE}return i.SOLID};t.parseBorder=function(e){return A.map((function(t){var n=new o.default(e.getPropertyValue("border-"+t+"-color")),i=a(e.getPropertyValue("border-"+t+"-style")),r=parseFloat(e.getPropertyValue("border-"+t+"-width"));return{borderColor:n,borderStyle:i,borderWidth:isNaN(r)?0:r}}))}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});for(var o=(t.toCodePoints=function(e){for(var t=[],n=0,o=e.length;n<o;){var i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<o){var r=e.charCodeAt(n++);56320==(64512&r)?t.push(((1023&i)<<10)+(1023&r)+65536):(t.push(i),n--)}else t.push(i)}return t},t.fromCodePoint=function(){if(String.fromCodePoint)return String.fromCodePoint.apply(String,arguments);var e=arguments.length;if(!e)return"";for(var t=[],n=-1,o="";++n<e;){var i=arguments.length<=n?void 0:arguments[n];i<=65535?t.push(i):(i-=65536,t.push(55296+(i>>10),i%1024+56320)),(n+1===e||t.length>16384)&&(o+=String.fromCharCode.apply(String,t),t.length=0)}return o},"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),i="undefined"==typeof Uint8Array?[]:new Uint8Array(256),r=0;r<o.length;r++)i[o.charCodeAt(r)]=r;t.decode=function(e){var t=.75*e.length,n=e.length,o=void 0,r=0,A=void 0,a=void 0,s=void 0,l=void 0;"="===e[e.length-1]&&(t--,"="===e[e.length-2]&&t--);var c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(t):new Array(t),d=Array.isArray(c)?c:new Uint8Array(c);for(o=0;o<n;o+=4)A=i[e.charCodeAt(o)],a=i[e.charCodeAt(o+1)],s=i[e.charCodeAt(o+2)],l=i[e.charCodeAt(o+3)],d[r++]=A<<2|a>>4,d[r++]=(15&a)<<4|s>>2,d[r++]=(3&s)<<6|63&l;return c},t.polyUint16Array=function(e){for(var t=e.length,n=[],o=0;o<t;o+=2)n.push(e[o+1]<<8|e[o]);return n},t.polyUint32Array=function(e){for(var t=e.length,n=[],o=0;o<t;o+=4)n.push(e[o+3]<<24|e[o+2]<<16|e[o+1]<<8|e[o]);return n}},function(e,t,n){function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.createCounterText=t.inlineListItemElement=t.getListOwner=void 0;var i=n(3),r=o(n(6)),A=o(n(9)),a=n(8),s=n(24),l=["OL","UL","MENU"],c=(t.getListOwner=function(e){var t=e.parent;if(!t)return null;do{if(-1!==l.indexOf(t.tagName))return t;t=t.parent}while(t);return e.parent},t.inlineListItemElement=function(e,t,n){var o=t.style.listStyle;if(o){var s=e.ownerDocument.defaultView.getComputedStyle(e,null),l=e.ownerDocument.createElement("html2canvaswrapper");switch((0,i.copyCSSStyles)(s,l),l.style.position="absolute",l.style.bottom="auto",l.style.display="block",l.style.letterSpacing="normal",o.listStylePosition){case a.LIST_STYLE_POSITION.OUTSIDE:l.style.left="auto",l.style.right=e.ownerDocument.defaultView.innerWidth-t.bounds.left-t.style.margin[1].getAbsoluteValue(t.bounds.width)+7+"px",l.style.textAlign="right";break;case a.LIST_STYLE_POSITION.INSIDE:l.style.left=t.bounds.left-t.style.margin[3].getAbsoluteValue(t.bounds.width)+"px",l.style.right="auto",l.style.textAlign="left"}var c=void 0,d=t.style.margin[0].getAbsoluteValue(t.bounds.width),u=o.listStyleImage;if(u)if("url"===u.method){var h=e.ownerDocument.createElement("img");h.src=u.args[0],l.style.top=t.bounds.top-d+"px",l.style.width="auto",l.style.height="auto",l.appendChild(h)}else{var g=.5*parseFloat(t.style.font.fontSize);l.style.top=t.bounds.top-d+t.bounds.height-1.5*g+"px",l.style.width=g+"px",l.style.height=g+"px",l.style.backgroundImage=s.listStyleImage}else"number"==typeof t.listIndex&&(c=e.ownerDocument.createTextNode(C(t.listIndex,o.listStyleType,!0)),l.appendChild(c),l.style.top=t.bounds.top-d+"px");var f=e.ownerDocument.body;f.appendChild(l),c?(t.childNodes.push(A.default.fromTextNode(c,t)),f.removeChild(l)):t.childNodes.push(new r.default(l,t,n,0))}},{integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]}),d={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},u={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},h={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},g=function(e,t,n,o,i,r){return e<t||e>n?C(e,i,r.length>0):o.integers.reduce((function(t,n,i){for(;e>=n;)e-=n,t+=o.values[i];return t}),"")+r},f=function(e,t,n,o){var i="";do{n||e--,i=o(e)+i,e/=t}while(e*t>=t);return i},p=function(e,t,n,o,i){var r=n-t+1;return(e<0?"-":"")+(f(Math.abs(e),r,o,(function(e){return(0,s.fromCodePoint)(Math.floor(e%r)+t)}))+i)},m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:". ",o=t.length;return f(Math.abs(e),o,!1,(function(e){return t[Math.floor(e%o)]}))+n},B=function(e,t,n,o,r,A){if(e<-9999||e>9999)return C(e,a.LIST_STYLE_TYPE.CJK_DECIMAL,r.length>0);var s=Math.abs(e),l=r;if(0===s)return t[0]+l;for(var c=0;s>0&&c<=4;c++){var d=s%10;0===d&&(0,i.contains)(A,1)&&""!==l?l=t[d]+l:d>1||1===d&&0===c||1===d&&1===c&&(0,i.contains)(A,2)||1===d&&1===c&&(0,i.contains)(A,4)&&e>100||1===d&&c>1&&(0,i.contains)(A,8)?l=t[d]+(c>0?n[c-1]:"")+l:1===d&&c>0&&(l=n[c-1]+l),s=Math.floor(s/10)}return(e<0?o:"")+l},C=t.createCounterText=function(e,t,n){var o=n?". ":"",i=n?"、":"",r=n?", ":"";switch(t){case a.LIST_STYLE_TYPE.DISC:return"•";case a.LIST_STYLE_TYPE.CIRCLE:return"◦";case a.LIST_STYLE_TYPE.SQUARE:return"◾";case a.LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO:var A=p(e,48,57,!0,o);return A.length<4?"0"+A:A;case a.LIST_STYLE_TYPE.CJK_DECIMAL:return m(e,"〇一二三四五六七八九",i);case a.LIST_STYLE_TYPE.LOWER_ROMAN:return g(e,1,3999,c,a.LIST_STYLE_TYPE.DECIMAL,o).toLowerCase();case a.LIST_STYLE_TYPE.UPPER_ROMAN:return g(e,1,3999,c,a.LIST_STYLE_TYPE.DECIMAL,o);case a.LIST_STYLE_TYPE.LOWER_GREEK:return p(e,945,969,!1,o);case a.LIST_STYLE_TYPE.LOWER_ALPHA:return p(e,97,122,!1,o);case a.LIST_STYLE_TYPE.UPPER_ALPHA:return p(e,65,90,!1,o);case a.LIST_STYLE_TYPE.ARABIC_INDIC:return p(e,1632,1641,!0,o);case a.LIST_STYLE_TYPE.ARMENIAN:case a.LIST_STYLE_TYPE.UPPER_ARMENIAN:return g(e,1,9999,d,a.LIST_STYLE_TYPE.DECIMAL,o);case a.LIST_STYLE_TYPE.LOWER_ARMENIAN:return g(e,1,9999,d,a.LIST_STYLE_TYPE.DECIMAL,o).toLowerCase();case a.LIST_STYLE_TYPE.BENGALI:return p(e,2534,2543,!0,o);case a.LIST_STYLE_TYPE.CAMBODIAN:case a.LIST_STYLE_TYPE.KHMER:return p(e,6112,6121,!0,o);case a.LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH:return m(e,"子丑寅卯辰巳午未申酉戌亥",i);case a.LIST_STYLE_TYPE.CJK_HEAVENLY_STEM:return m(e,"甲乙丙丁戊己庚辛壬癸",i);case a.LIST_STYLE_TYPE.CJK_IDEOGRAPHIC:case a.LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL:return B(e,"零一二三四五六七八九","十百千萬","負",i,14);case a.LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL:return B(e,"零壹貳參肆伍陸柒捌玖","拾佰仟萬","負",i,15);case a.LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL:return B(e,"零一二三四五六七八九","十百千萬","负",i,14);case a.LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL:return B(e,"零壹贰叁肆伍陆柒捌玖","拾佰仟萬","负",i,15);case a.LIST_STYLE_TYPE.JAPANESE_INFORMAL:return B(e,"〇一二三四五六七八九","十百千万","マイナス",i,0);case a.LIST_STYLE_TYPE.JAPANESE_FORMAL:return B(e,"零壱弐参四伍六七八九","拾百千万","マイナス",i,7);case a.LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL:return B(e,"영일이삼사오육칠팔구","십백천만","마이너스",r,7);case a.LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL:return B(e,"零一二三四五六七八九","十百千萬","마이너스",r,0);case a.LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL:return B(e,"零壹貳參四五六七八九","拾百千","마이너스",r,7);case a.LIST_STYLE_TYPE.DEVANAGARI:return p(e,2406,2415,!0,o);case a.LIST_STYLE_TYPE.GEORGIAN:return g(e,1,19999,h,a.LIST_STYLE_TYPE.DECIMAL,o);case a.LIST_STYLE_TYPE.GUJARATI:return p(e,2790,2799,!0,o);case a.LIST_STYLE_TYPE.GURMUKHI:return p(e,2662,2671,!0,o);case a.LIST_STYLE_TYPE.HEBREW:return g(e,1,10999,u,a.LIST_STYLE_TYPE.DECIMAL,o);case a.LIST_STYLE_TYPE.HIRAGANA:return m(e,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case a.LIST_STYLE_TYPE.HIRAGANA_IROHA:return m(e,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case a.LIST_STYLE_TYPE.KANNADA:return p(e,3302,3311,!0,o);case a.LIST_STYLE_TYPE.KATAKANA:return m(e,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",i);case a.LIST_STYLE_TYPE.KATAKANA_IROHA:return m(e,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",i);case a.LIST_STYLE_TYPE.LAO:return p(e,3792,3801,!0,o);case a.LIST_STYLE_TYPE.MONGOLIAN:return p(e,6160,6169,!0,o);case a.LIST_STYLE_TYPE.MYANMAR:return p(e,4160,4169,!0,o);case a.LIST_STYLE_TYPE.ORIYA:return p(e,2918,2927,!0,o);case a.LIST_STYLE_TYPE.PERSIAN:return p(e,1776,1785,!0,o);case a.LIST_STYLE_TYPE.TAMIL:return p(e,3046,3055,!0,o);case a.LIST_STYLE_TYPE.TELUGU:return p(e,3174,3183,!0,o);case a.LIST_STYLE_TYPE.THAI:return p(e,3664,3673,!0,o);case a.LIST_STYLE_TYPE.TIBETAN:return p(e,3872,3881,!0,o);case a.LIST_STYLE_TYPE.DECIMAL:default:return p(e,48,57,!0,o)}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=n(5),r=n(11),A=function(e,t){var n=Math.max.apply(null,e.colorStops.map((function(e){return e.stop}))),o=1/Math.max(1,n);e.colorStops.forEach((function(e){t.addColorStop(o*e.stop,e.color.toString())}))},a=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.canvas=t||document.createElement("canvas")}return o(e,[{key:"render",value:function(e){this.ctx=this.canvas.getContext("2d"),this.options=e,this.canvas.width=Math.floor(e.width*e.scale),this.canvas.height=Math.floor(e.height*e.scale),this.canvas.style.width=e.width+"px",this.canvas.style.height=e.height+"px",this.ctx.scale(this.options.scale,this.options.scale),this.ctx.translate(-e.x,-e.y),this.ctx.textBaseline="bottom",e.logger.log("Canvas renderer initialized ("+e.width+"x"+e.height+" at "+e.x+","+e.y+") with scale "+this.options.scale)}},{key:"clip",value:function(e,t){var n=this;e.length&&(this.ctx.save(),e.forEach((function(e){n.path(e),n.ctx.clip()}))),t(),e.length&&this.ctx.restore()}},{key:"drawImage",value:function(e,t,n){this.ctx.drawImage(e,t.left,t.top,t.width,t.height,n.left,n.top,n.width,n.height)}},{key:"drawShape",value:function(e,t){this.path(e),this.ctx.fillStyle=t.toString(),this.ctx.fill()}},{key:"fill",value:function(e){this.ctx.fillStyle=e.toString(),this.ctx.fill()}},{key:"getTarget",value:function(){return this.canvas.getContext("2d").setTransform(1,0,0,1,0,0),Promise.resolve(this.canvas)}},{key:"path",value:function(e){var t=this;this.ctx.beginPath(),Array.isArray(e)?e.forEach((function(e,n){var o=e.type===i.PATH.VECTOR?e:e.start;0===n?t.ctx.moveTo(o.x,o.y):t.ctx.lineTo(o.x,o.y),e.type===i.PATH.BEZIER_CURVE&&t.ctx.bezierCurveTo(e.startControl.x,e.startControl.y,e.endControl.x,e.endControl.y,e.end.x,e.end.y)})):this.ctx.arc(e.x+e.radius,e.y+e.radius,e.radius,0,2*Math.PI,!0),this.ctx.closePath()}},{key:"rectangle",value:function(e,t,n,o,i){this.ctx.fillStyle=i.toString(),this.ctx.fillRect(e,t,n,o)}},{key:"renderLinearGradient",value:function(e,t){var n=this.ctx.createLinearGradient(e.left+t.direction.x1,e.top+t.direction.y1,e.left+t.direction.x0,e.top+t.direction.y0);A(t,n),this.ctx.fillStyle=n,this.ctx.fillRect(e.left,e.top,e.width,e.height)}},{key:"renderRadialGradient",value:function(e,t){var n=this,o=e.left+t.center.x,i=e.top+t.center.y,r=this.ctx.createRadialGradient(o,i,0,o,i,t.radius.x);if(r)if(A(t,r),this.ctx.fillStyle=r,t.radius.x!==t.radius.y){var a=e.left+.5*e.width,s=e.top+.5*e.height,l=t.radius.y/t.radius.x,c=1/l;this.transform(a,s,[1,0,0,l,0,0],(function(){return n.ctx.fillRect(e.left,c*(e.top-s)+s,e.width,e.height*c)}))}else this.ctx.fillRect(e.left,e.top,e.width,e.height)}},{key:"renderRepeat",value:function(e,t,n,o,i){this.path(e),this.ctx.fillStyle=this.ctx.createPattern(this.resizeImage(t,n),"repeat"),this.ctx.translate(o,i),this.ctx.fill(),this.ctx.translate(-o,-i)}},{key:"renderTextNode",value:function(e,t,n,o,i){var A=this;this.ctx.font=[n.fontStyle,n.fontVariant,n.fontWeight,n.fontSize,n.fontFamily].join(" "),e.forEach((function(e){if(A.ctx.fillStyle=t.toString(),i&&e.text.trim().length?i.slice(0).reverse().forEach((function(t){A.ctx.shadowColor=t.color.toString(),A.ctx.shadowOffsetX=t.offsetX*A.options.scale,A.ctx.shadowOffsetY=t.offsetY*A.options.scale,A.ctx.shadowBlur=t.blur,A.ctx.fillText(e.text,e.bounds.left,e.bounds.top+e.bounds.height)})):A.ctx.fillText(e.text,e.bounds.left,e.bounds.top+e.bounds.height),null!==o){var a=o.textDecorationColor||t;o.textDecorationLine.forEach((function(t){switch(t){case r.TEXT_DECORATION_LINE.UNDERLINE:var o=A.options.fontMetrics.getMetrics(n).baseline;A.rectangle(e.bounds.left,Math.round(e.bounds.top+o),e.bounds.width,1,a);break;case r.TEXT_DECORATION_LINE.OVERLINE:A.rectangle(e.bounds.left,Math.round(e.bounds.top),e.bounds.width,1,a);break;case r.TEXT_DECORATION_LINE.LINE_THROUGH:var i=A.options.fontMetrics.getMetrics(n).middle;A.rectangle(e.bounds.left,Math.ceil(e.bounds.top+i),e.bounds.width,1,a)}}))}}))}},{key:"resizeImage",value:function(e,t){if(e.width===t.width&&e.height===t.height)return e;var n=this.canvas.ownerDocument.createElement("canvas");return n.width=t.width,n.height=t.height,n.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),n}},{key:"setOpacity",value:function(e){this.ctx.globalAlpha=e}},{key:"transform",value:function(e,t,n,o){this.ctx.save(),this.ctx.translate(e,t),this.ctx.transform(n[0],n[1],n[2],n[3],n[4],n[5]),this.ctx.translate(-e,-t),o(),this.ctx.restore()}}]),e}();t.default=a},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function(){function e(t,n,o){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.enabled="undefined"!=typeof window&&t,this.start=o||Date.now(),this.id=n}return o(e,[{key:"child",value:function(t){return new e(this.enabled,t,this.start)}},{key:"log",value:function(){if(this.enabled&&window.console&&window.console.log){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];Function.prototype.bind.call(window.console.log,window.console).apply(window.console,[Date.now()-this.start+"ms",this.id?"html2canvas ("+this.id+"):":"html2canvas:"].concat([].slice.call(t,0)))}}},{key:"error",value:function(){if(this.enabled&&window.console&&window.console.error){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];Function.prototype.bind.call(window.console.error,window.console).apply(window.console,[Date.now()-this.start+"ms",this.id?"html2canvas ("+this.id+"):":"html2canvas:"].concat([].slice.call(t,0)))}}}]),e}();t.default=i},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parsePadding=t.PADDING_SIDES=void 0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(1)),i=(t.PADDING_SIDES={TOP:0,RIGHT:1,BOTTOM:2,LEFT:3},["top","right","bottom","left"]);t.parsePadding=function(e){return i.map((function(t){return new o.default(e.getPropertyValue("padding-"+t))}))}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=t.OVERFLOW_WRAP={NORMAL:0,BREAK_WORD:1};t.parseOverflowWrap=function(e){switch(e){case"break-word":return o.BREAK_WORD;case"normal":default:return o.NORMAL}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=t.POSITION={STATIC:0,RELATIVE:1,ABSOLUTE:2,FIXED:3,STICKY:4};t.parsePosition=function(e){switch(e){case"relative":return o.RELATIVE;case"absolute":return o.ABSOLUTE;case"fixed":return o.FIXED;case"sticky":return o.STICKY}return o.STATIC}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=t.TEXT_TRANSFORM={NONE:0,LOWERCASE:1,UPPERCASE:2,CAPITALIZE:3};t.parseTextTransform=function(e){switch(e){case"uppercase":return o.UPPERCASE;case"lowercase":return o.LOWERCASE;case"capitalize":return o.CAPITALIZE}return o.NONE}},function(e,t,n){function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.reformatInputBounds=t.inlineSelectElement=t.inlineTextAreaElement=t.inlineInputElement=t.getInputBorderRadius=t.INPUT_BACKGROUND=t.INPUT_BORDERS=t.INPUT_COLOR=void 0;var i=o(n(9)),r=n(4),A=n(12),a=o(n(50)),s=o(n(7)),l=o(n(0)),c=o(n(1)),d=(n(2),n(22),n(3)),u=(t.INPUT_COLOR=new l.default([42,42,42]),new l.default([165,165,165])),h=new l.default([222,222,222]),g={borderWidth:1,borderColor:u,borderStyle:A.BORDER_STYLE.SOLID},f=(t.INPUT_BORDERS=[g,g,g,g],t.INPUT_BACKGROUND={backgroundColor:h,backgroundImage:[],backgroundClip:r.BACKGROUND_CLIP.PADDING_BOX,backgroundOrigin:r.BACKGROUND_ORIGIN.PADDING_BOX},new c.default("50%")),p=[f,f],m=[p,p,p,p],B=new c.default("3px"),C=[B,B],v=[C,C,C,C],w=(t.getInputBorderRadius=function(e){return"radio"===e.type?m:v},t.inlineInputElement=function(e,t){if("radio"===e.type||"checkbox"===e.type){if(e.checked){var n=Math.min(t.bounds.width,t.bounds.height);t.childNodes.push("checkbox"===e.type?[new s.default(t.bounds.left+.39363*n,t.bounds.top+.79*n),new s.default(t.bounds.left+.16*n,t.bounds.top+.5549*n),new s.default(t.bounds.left+.27347*n,t.bounds.top+.44071*n),new s.default(t.bounds.left+.39694*n,t.bounds.top+.5649*n),new s.default(t.bounds.left+.72983*n,t.bounds.top+.23*n),new s.default(t.bounds.left+.84*n,t.bounds.top+.34085*n),new s.default(t.bounds.left+.39363*n,t.bounds.top+.79*n)]:new a.default(t.bounds.left+n/4,t.bounds.top+n/4,n/4))}}else w(b(e),e,t,!1)},t.inlineTextAreaElement=function(e,t){w(e.value,e,t,!0)},t.inlineSelectElement=function(e,t){var n=e.options[e.selectedIndex||0];w(n&&n.text||"",e,t,!1)},t.reformatInputBounds=function(e){return e.width>e.height?(e.left+=(e.width-e.height)/2,e.width=e.height):e.width<e.height&&(e.top+=(e.height-e.width)/2,e.height=e.width),e},function(e,t,n,o){var r=t.ownerDocument.body;if(e.length>0&&r){var A=t.ownerDocument.createElement("html2canvaswrapper");(0,d.copyCSSStyles)(t.ownerDocument.defaultView.getComputedStyle(t,null),A),A.style.position="absolute",A.style.left=n.bounds.left+"px",A.style.top=n.bounds.top+"px",o||(A.style.whiteSpace="nowrap");var a=t.ownerDocument.createTextNode(e);A.appendChild(a),r.appendChild(A),n.childNodes.push(i.default.fromTextNode(a,n)),r.removeChild(A)}}),b=function(e){var t="password"===e.type?new Array(e.value.length+1).join("•"):e.value;return 0===t.length?e.placeholder||"":t}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseTextBounds=t.TextBounds=void 0;var o=n(2),i=n(11),r=function(e){return e&&e.__esModule?e:{default:e}}(n(10)),A=n(24),a=t.TextBounds=function e(t,n){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.text=t,this.bounds=n},s=(t.parseTextBounds=function(e,t,n){for(var o=0!==t.style.letterSpacing?(0,A.toCodePoints)(e).map((function(e){return(0,A.fromCodePoint)(e)})):(0,A.breakWords)(e,t),c=o.length,d=n.parentNode?n.parentNode.ownerDocument.defaultView:null,u=d?d.pageXOffset:0,h=d?d.pageYOffset:0,g=[],f=0,p=0;p<c;p++){var m=o[p];if(t.style.textDecoration!==i.TEXT_DECORATION.NONE||m.trim().length>0)if(r.default.SUPPORT_RANGE_BOUNDS)g.push(new a(m,l(n,f,m.length,u,h)));else{var B=n.splitText(m.length);g.push(new a(m,s(n,u,h))),n=B}else r.default.SUPPORT_RANGE_BOUNDS||(n=n.splitText(m.length));f+=m.length}return g},function(e,t,n){var i=e.ownerDocument.createElement("html2canvaswrapper");i.appendChild(e.cloneNode(!0));var r=e.parentNode;if(r){r.replaceChild(i,e);var A=(0,o.parseBounds)(i,t,n);return i.firstChild&&r.replaceChild(i.firstChild,i),A}return new o.Bounds(0,0,0,0)}),l=function(e,t,n,i,r){var A=e.ownerDocument.createRange();return A.setStart(e,t),A.setEnd(e,t+n),o.Bounds.fromClientRect(A.getBoundingClientRect(),i,r)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.element=t}return o(e,[{key:"render",value:function(e){var t=this;this.options=e,this.canvas=document.createElement("canvas"),this.ctx=this.canvas.getContext("2d"),this.canvas.width=Math.floor(e.width)*e.scale,this.canvas.height=Math.floor(e.height)*e.scale,this.canvas.style.width=e.width+"px",this.canvas.style.height=e.height+"px",e.logger.log("ForeignObject renderer initialized ("+e.width+"x"+e.height+" at "+e.x+","+e.y+") with scale "+e.scale);var n=r(Math.max(e.windowWidth,e.width)*e.scale,Math.max(e.windowHeight,e.height)*e.scale,e.scrollX*e.scale,e.scrollY*e.scale,this.element);return A(n).then((function(n){return e.backgroundColor&&(t.ctx.fillStyle=e.backgroundColor.toString(),t.ctx.fillRect(0,0,e.width*e.scale,e.height*e.scale)),t.ctx.drawImage(n,-e.x*e.scale,-e.y*e.scale),t.canvas}))}}]),e}();t.default=i;var r=t.createForeignObjectSVG=function(e,t,n,o,i){var r="http://www.w3.org/2000/svg",A=document.createElementNS(r,"svg"),a=document.createElementNS(r,"foreignObject");return A.setAttributeNS(null,"width",e),A.setAttributeNS(null,"height",t),a.setAttributeNS(null,"width","100%"),a.setAttributeNS(null,"height","100%"),a.setAttributeNS(null,"x",n),a.setAttributeNS(null,"y",o),a.setAttributeNS(null,"externalResourcesRequired","true"),A.appendChild(a),a.appendChild(i),A},A=t.loadSerializedSVG=function(e){return new Promise((function(t,n){var o=new Image;o.onload=function(){return t(o)},o.onerror=n,o.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))}))}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.breakWords=t.fromCodePoint=t.toCodePoints=void 0;var o=n(46);Object.defineProperty(t,"toCodePoints",{enumerable:!0,get:function(){return o.toCodePoints}}),Object.defineProperty(t,"fromCodePoint",{enumerable:!0,get:function(){return o.fromCodePoint}});var i=n(18);t.breakWords=function(e,t){for(var n=(0,o.LineBreaker)(e,{lineBreak:t.style.lineBreak,wordBreak:t.style.overflowWrap===i.OVERFLOW_WRAP.BREAK_WORD?"break-word":t.style.wordBreak}),r=[],A=void 0;!(A=n.next()).done;)r.push(A.value.slice());return r}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.FontMetrics=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=n(3);t.FontMetrics=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this._data={},this._document=t}return o(e,[{key:"_parseMetrics",value:function(e){var t=this._document.createElement("div"),n=this._document.createElement("img"),o=this._document.createElement("span"),r=this._document.body;if(!r)throw new Error("No document found for font metrics");t.style.visibility="hidden",t.style.fontFamily=e.fontFamily,t.style.fontSize=e.fontSize,t.style.margin="0",t.style.padding="0",r.appendChild(t),n.src=i.SMALL_IMAGE,n.width=1,n.height=1,n.style.margin="0",n.style.padding="0",n.style.verticalAlign="baseline",o.style.fontFamily=e.fontFamily,o.style.fontSize=e.fontSize,o.style.margin="0",o.style.padding="0",o.appendChild(this._document.createTextNode("Hidden Text")),t.appendChild(o),t.appendChild(n);var A=n.offsetTop-o.offsetTop+2;t.removeChild(o),t.appendChild(this._document.createTextNode("Hidden Text")),t.style.lineHeight="normal",n.style.verticalAlign="super";var a=n.offsetTop-t.offsetTop+2;return r.removeChild(t),{baseline:A,middle:a}}},{key:"getMetrics",value:function(e){var t=e.fontFamily+" "+e.fontSize;return void 0===this._data[t]&&(this._data[t]=this._parseMetrics(e)),this._data[t]}}]),e}()},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.Proxy=void 0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(10));t.Proxy=function(e,t){if(!t.proxy)return Promise.reject("No proxy defined");var n=t.proxy;return new Promise((function(i,r){var A=o.default.SUPPORT_CORS_XHR&&o.default.SUPPORT_RESPONSE_TYPE?"blob":"text",a=o.default.SUPPORT_CORS_XHR?new XMLHttpRequest:new XDomainRequest;if(a.onload=function(){if(a instanceof XMLHttpRequest)if(200===a.status)if("text"===A)i(a.response);else{var t=new FileReader;t.addEventListener("load",(function(){return i(t.result)}),!1),t.addEventListener("error",(function(e){return r(e)}),!1),t.readAsDataURL(a.response)}else r("Failed to proxy resource "+e.substring(0,256)+" with status code "+a.status);else i(a.responseText)},a.onerror=r,a.open("GET",n+"?url="+encodeURIComponent(e)+"&responseType="+A),"text"!==A&&a instanceof XMLHttpRequest&&(a.responseType=A),t.imageTimeout){var s=t.imageTimeout;a.timeout=s,a.ontimeout=function(){return r("Timed out ("+s+"ms) proxying "+e.substring(0,256))}}a.send()}))}},function(e,t,n){function o(e){return e&&e.__esModule?e:{default:e}}var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=o(n(15)),A=o(n(16)),a=n(28),s=function(e,t){var n=t||{},o=new A.default("boolean"!=typeof n.logging||n.logging);o.log("html2canvas 1.0.0-alpha.12"),"function"==typeof n.onrendered&&o.error("onrendered option is deprecated, html2canvas returns a Promise with the canvas as the value");var s=e.ownerDocument;if(!s)return Promise.reject("Provided element is not within a Document");var l=s.defaultView,c={async:!0,allowTaint:!1,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,scale:l.devicePixelRatio||1,target:new r.default(n.canvas),useCORS:!1,windowWidth:l.innerWidth,windowHeight:l.innerHeight,scrollX:l.pageXOffset,scrollY:l.pageYOffset};return(0,a.renderElement)(e,i({},c,n),o).catch((function(e){throw o.error(e),e}))};s.CanvasRenderer=r.default,e.exports=s},function(e,t,n){function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.renderElement=void 0;var i=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],o=!0,i=!1,r=void 0;try{for(var A,a=e[Symbol.iterator]();!(o=(A=a.next()).done)&&(n.push(A.value),!t||n.length!==t);o=!0);}catch(e){i=!0,r=e}finally{try{!o&&a.return&&a.return()}finally{if(i)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=(o(n(16)),n(29)),A=o(n(51)),a=o(n(23)),s=o(n(10)),l=n(2),c=n(54),d=n(25),u=n(0),h=o(u);t.renderElement=function e(t,n,o){var g=t.ownerDocument,f=new l.Bounds(n.scrollX,n.scrollY,n.windowWidth,n.windowHeight),p=g.documentElement?new h.default(getComputedStyle(g.documentElement).backgroundColor):u.TRANSPARENT,m=g.body?new h.default(getComputedStyle(g.body).backgroundColor):u.TRANSPARENT,B=t===g.documentElement?p.isTransparent()?m.isTransparent()?n.backgroundColor?new h.default(n.backgroundColor):null:m:p:n.backgroundColor?new h.default(n.backgroundColor):null;return(n.foreignObjectRendering?s.default.SUPPORT_FOREIGNOBJECT_DRAWING:Promise.resolve(!1)).then((function(s){return s?function(e){return o.log("Document cloned, using foreignObject rendering"),e.inlineFonts(g).then((function(){return e.resourceLoader.ready()})).then((function(){var i=new a.default(e.documentElement),r=g.defaultView,A=r.pageXOffset,s=r.pageYOffset,c="HTML"===t.tagName||"BODY"===t.tagName?(0,l.parseDocumentSize)(g):(0,l.parseBounds)(t,A,s),d=c.width,u=c.height,h=c.left,f=c.top;return i.render({backgroundColor:B,logger:o,scale:n.scale,x:"number"==typeof n.x?n.x:h,y:"number"==typeof n.y?n.y:f,width:"number"==typeof n.width?n.width:Math.ceil(d),height:"number"==typeof n.height?n.height:Math.ceil(u),windowWidth:n.windowWidth,windowHeight:n.windowHeight,scrollX:n.scrollX,scrollY:n.scrollY})}))}(new c.DocumentCloner(t,n,o,!0,e)):(0,c.cloneWindow)(g,f,t,n,o,e).then((function(e){var t=i(e,3),a=t[0],s=t[1],c=t[2];o.log("Document cloned, using computed rendering");var h=(0,r.NodeParser)(s,c,o),f=s.ownerDocument;return B===h.container.style.background.backgroundColor&&(h.container.style.background.backgroundColor=u.TRANSPARENT),c.ready().then((function(e){var t=new d.FontMetrics(f);o.log("Starting renderer");var i=f.defaultView,r=i.pageXOffset,c=i.pageYOffset,u="HTML"===s.tagName||"BODY"===s.tagName?(0,l.parseDocumentSize)(g):(0,l.parseBounds)(s,r,c),p=u.width,m=u.height,C=u.left,v=u.top,w={backgroundColor:B,fontMetrics:t,imageStore:e,logger:o,scale:n.scale,x:"number"==typeof n.x?n.x:C,y:"number"==typeof n.y?n.y:v,width:"number"==typeof n.width?n.width:Math.ceil(p),height:"number"==typeof n.height?n.height:Math.ceil(m)};if(Array.isArray(n.target))return Promise.all(n.target.map((function(e){return new A.default(e,w).render(h)})));var b=new A.default(n.target,w).render(h);return!0===n.removeContainer&&(a.parentNode?a.parentNode.removeChild(a):o.log("Cannot detach cloned iframe as it is not in the DOM anymore")),b}))}))}))}},function(e,t,n){function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.NodeParser=void 0;var i=o(n(30)),r=o(n(6)),A=o(n(9)),a=n(21),s=n(14),l=n(8),c=(t.NodeParser=function(e,t,n){n.log("Starting node parsing");var o=0,A=new r.default(e,null,t,o++),a=new i.default(A,null,!0);return d(e,A,a,t,1),n.log("Finished parsing node tree"),a},["SCRIPT","HEAD","TITLE","OBJECT","BR","OPTION"]),d=function e(t,n,o,d,g){if(g>5e4)throw new Error("Recursion error while parsing node tree");for(var f,p=t.firstChild;p;p=f){f=p.nextSibling;var m=p.ownerDocument.defaultView;if(p instanceof m.Text||p instanceof Text||m.parent&&p instanceof m.parent.Text)p.data.trim().length>0&&n.childNodes.push(A.default.fromTextNode(p,n));else if(p instanceof m.HTMLElement||p instanceof HTMLElement||m.parent&&p instanceof m.parent.HTMLElement){if(-1===c.indexOf(p.nodeName)){var B=new r.default(p,n,d,g++);if(B.isVisible()){"INPUT"===p.tagName?(0,a.inlineInputElement)(p,B):"TEXTAREA"===p.tagName?(0,a.inlineTextAreaElement)(p,B):"SELECT"===p.tagName?(0,a.inlineSelectElement)(p,B):B.style.listStyle&&B.style.listStyle.listStyleType!==l.LIST_STYLE_TYPE.NONE&&(0,s.inlineListItemElement)(p,B,d);var C="TEXTAREA"!==p.tagName,v=u(B,p);if(v||h(B)){var w=v||B.isPositioned()?o.getRealParentStackingContext():o,b=new i.default(B,w,v);w.contexts.push(b),C&&e(p,B,b,d,g)}else o.children.push(B),C&&e(p,B,o,d,g)}}}else if(p instanceof m.SVGSVGElement||p instanceof SVGSVGElement||m.parent&&p instanceof m.parent.SVGSVGElement){var y=new r.default(p,n,d,g++),F=u(y,p);if(F||h(y)){var _=F||y.isPositioned()?o.getRealParentStackingContext():o,E=new i.default(y,_,F);_.contexts.push(E)}else o.children.push(y)}}},u=function(e,t){return e.isRootElement()||e.isPositionedWithZIndex()||e.style.opacity<1||e.isTransformed()||g(e,t)},h=function(e){return e.isPositioned()||e.isFloating()},g=function(e,t){return"BODY"===t.nodeName&&e.parent instanceof r.default&&e.parent.style.background.backgroundColor.isTransparent()}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=(function(e){e&&e.__esModule}(n(6)),n(19),function(){function e(t,n,o){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.container=t,this.parent=n,this.contexts=[],this.children=[],this.treatAsRealStackingContext=o}return o(e,[{key:"getOpacity",value:function(){return this.parent?this.container.style.opacity*this.parent.getOpacity():this.container.style.opacity}},{key:"getRealParentStackingContext",value:function(){return!this.parent||this.treatAsRealStackingContext?this:this.parent.getRealParentStackingContext()}}]),e}());t.default=i},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.width=t,this.height=n}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=n(5),r=function(e){return e&&e.__esModule?e:{default:e}}(n(7)),A=function(e,t,n){return new r.default(e.x+(t.x-e.x)*n,e.y+(t.y-e.y)*n)},a=function(){function e(t,n,o,r){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.type=i.PATH.BEZIER_CURVE,this.start=t,this.startControl=n,this.endControl=o,this.end=r}return o(e,[{key:"subdivide",value:function(t,n){var o=A(this.start,this.startControl,t),i=A(this.startControl,this.endControl,t),r=A(this.endControl,this.end,t),a=A(o,i,t),s=A(i,r,t),l=A(a,s,t);return n?new e(this.start,o,a,l):new e(l,s,r,this.end)}},{key:"reverse",value:function(){return new e(this.end,this.endControl,this.startControl,this.start)}}]),e}();t.default=a},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseBorderRadius=void 0;var o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],o=!0,i=!1,r=void 0;try{for(var A,a=e[Symbol.iterator]();!(o=(A=a.next()).done)&&(n.push(A.value),!t||n.length!==t);o=!0);}catch(e){i=!0,r=e}finally{try{!o&&a.return&&a.return()}finally{if(i)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(e){return e&&e.__esModule?e:{default:e}}(n(1)),r=["top-left","top-right","bottom-right","bottom-left"];t.parseBorderRadius=function(e){return r.map((function(t){var n=e.getPropertyValue("border-"+t+"-radius").split(" ").map(i.default.create),r=o(n,2),A=r[0],a=r[1];return void 0===a?[A,A]:[A,a]}))}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=t.DISPLAY={NONE:1,BLOCK:2,INLINE:4,RUN_IN:8,FLOW:16,FLOW_ROOT:32,TABLE:64,FLEX:128,GRID:256,RUBY:512,SUBGRID:1024,LIST_ITEM:2048,TABLE_ROW_GROUP:4096,TABLE_HEADER_GROUP:8192,TABLE_FOOTER_GROUP:16384,TABLE_ROW:32768,TABLE_CELL:65536,TABLE_COLUMN_GROUP:1<<17,TABLE_COLUMN:1<<18,TABLE_CAPTION:1<<19,RUBY_BASE:1<<20,RUBY_TEXT:1<<21,RUBY_BASE_CONTAINER:1<<22,RUBY_TEXT_CONTAINER:1<<23,CONTENTS:1<<24,INLINE_BLOCK:1<<25,INLINE_LIST_ITEM:1<<26,INLINE_TABLE:1<<27,INLINE_FLEX:1<<28,INLINE_GRID:1<<29},i=function(e,t){return e|function(e){switch(e){case"block":return o.BLOCK;case"inline":return o.INLINE;case"run-in":return o.RUN_IN;case"flow":return o.FLOW;case"flow-root":return o.FLOW_ROOT;case"table":return o.TABLE;case"flex":return o.FLEX;case"grid":return o.GRID;case"ruby":return o.RUBY;case"subgrid":return o.SUBGRID;case"list-item":return o.LIST_ITEM;case"table-row-group":return o.TABLE_ROW_GROUP;case"table-header-group":return o.TABLE_HEADER_GROUP;case"table-footer-group":return o.TABLE_FOOTER_GROUP;case"table-row":return o.TABLE_ROW;case"table-cell":return o.TABLE_CELL;case"table-column-group":return o.TABLE_COLUMN_GROUP;case"table-column":return o.TABLE_COLUMN;case"table-caption":return o.TABLE_CAPTION;case"ruby-base":return o.RUBY_BASE;case"ruby-text":return o.RUBY_TEXT;case"ruby-base-container":return o.RUBY_BASE_CONTAINER;case"ruby-text-container":return o.RUBY_TEXT_CONTAINER;case"contents":return o.CONTENTS;case"inline-block":return o.INLINE_BLOCK;case"inline-list-item":return o.INLINE_LIST_ITEM;case"inline-table":return o.INLINE_TABLE;case"inline-flex":return o.INLINE_FLEX;case"inline-grid":return o.INLINE_GRID}return o.NONE}(t)};t.parseDisplay=function(e){return e.split(" ").reduce(i,0)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=t.FLOAT={NONE:0,LEFT:1,RIGHT:2,INLINE_START:3,INLINE_END:4};t.parseCSSFloat=function(e){switch(e){case"left":return o.LEFT;case"right":return o.RIGHT;case"inline-start":return o.INLINE_START;case"inline-end":return o.INLINE_END}return o.NONE}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){switch(e){case"normal":return 400;case"bold":return 700}var t=parseInt(e,10);return isNaN(t)?400:t};t.parseFont=function(e){return{fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontVariant:e.fontVariant,fontWeight:o(e.fontWeight)}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseLetterSpacing=function(e){if("normal"===e)return 0;var t=parseFloat(e);return isNaN(t)?0:t}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=t.LINE_BREAK={NORMAL:"normal",STRICT:"strict"};t.parseLineBreak=function(e){switch(e){case"strict":return o.STRICT;case"normal":default:return o.NORMAL}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseMargin=void 0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(1)),i=["top","right","bottom","left"];t.parseMargin=function(e){return i.map((function(t){return new o.default(e.getPropertyValue("margin-"+t))}))}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=t.OVERFLOW={VISIBLE:0,HIDDEN:1,SCROLL:2,AUTO:3};t.parseOverflow=function(e){switch(e){case"hidden":return o.HIDDEN;case"scroll":return o.SCROLL;case"auto":return o.AUTO;case"visible":default:return o.VISIBLE}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseTextShadow=void 0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(0)),i=/^([+-]|\d|\.)$/i;t.parseTextShadow=function(e){if("none"===e||"string"!=typeof e)return null;for(var t="",n=!1,r=[],A=[],a=0,s=null,l=function(){t.length&&(n?r.push(parseFloat(t)):s=new o.default(t)),n=!1,t=""},c=function(){r.length&&null!==s&&A.push({color:s,offsetX:r[0]||0,offsetY:r[1]||0,blur:r[2]||0}),r.splice(0,r.length),s=null},d=0;d<e.length;d++){var u=e[d];switch(u){case"(":t+=u,a++;break;case")":t+=u,a--;break;case",":0===a?(l(),c()):t+=u;break;case" ":0===a?l():t+=u;break;default:0===t.length&&i.test(u)&&(n=!0),t+=u}}return l(),c(),0===A.length?null:A}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseTransform=void 0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(1)),i=function(e){return parseFloat(e.trim())},r=/(matrix|matrix3d)\((.+)\)/,A=(t.parseTransform=function(e){var t=a(e.transform||e.webkitTransform||e.mozTransform||e.msTransform||e.oTransform);return null===t?null:{transform:t,transformOrigin:A(e.transformOrigin||e.webkitTransformOrigin||e.mozTransformOrigin||e.msTransformOrigin||e.oTransformOrigin)}},function(e){if("string"!=typeof e){var t=new o.default("0");return[t,t]}var n=e.split(" ").map(o.default.create);return[n[0],n[1]]}),a=function(e){if("none"===e||"string"!=typeof e)return null;var t=e.match(r);if(t){if("matrix"===t[1]){var n=t[2].split(",").map(i);return[n[0],n[1],n[2],n[3],n[4],n[5]]}var o=t[2].split(",").map(i);return[o[0],o[1],o[4],o[5],o[12],o[13]]}return null}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=t.VISIBILITY={VISIBLE:0,HIDDEN:1,COLLAPSE:2};t.parseVisibility=function(e){switch(e){case"hidden":return o.HIDDEN;case"collapse":return o.COLLAPSE;case"visible":default:return o.VISIBLE}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=t.WORD_BREAK={NORMAL:"normal",BREAK_ALL:"break-all",KEEP_ALL:"keep-all"};t.parseWordBreak=function(e){switch(e){case"break-all":return o.BREAK_ALL;case"keep-all":return o.KEEP_ALL;case"normal":default:return o.NORMAL}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseZIndex=function(e){var t="auto"===e;return{auto:t,order:t?0:parseInt(e,10)}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=n(13);Object.defineProperty(t,"toCodePoints",{enumerable:!0,get:function(){return o.toCodePoints}}),Object.defineProperty(t,"fromCodePoint",{enumerable:!0,get:function(){return o.fromCodePoint}});var i=n(47);Object.defineProperty(t,"LineBreaker",{enumerable:!0,get:function(){return i.LineBreaker}})},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.LineBreaker=t.inlineBreakOpportunities=t.lineBreakAtIndex=t.codePointsToCharacterClasses=t.UnicodeTrie=t.BREAK_ALLOWED=t.BREAK_NOT_ALLOWED=t.BREAK_MANDATORY=t.classes=t.LETTER_NUMBER_MODIFIER=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],o=!0,i=!1,r=void 0;try{for(var A,a=e[Symbol.iterator]();!(o=(A=a.next()).done)&&(n.push(A.value),!t||n.length!==t);o=!0);}catch(e){i=!0,r=e}finally{try{!o&&a.return&&a.return()}finally{if(i)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=n(48),A=function(e){return e&&e.__esModule?e:{default:e}}(n(49)),a=n(13),s=t.LETTER_NUMBER_MODIFIER=50,l=(t.classes={BK:1,CR:2,LF:3,CM:4,NL:5,SG:6,WJ:7,ZW:8,GL:9,SP:10,ZWJ:11,B2:12,BA:13,BB:14,HY:15,CB:16,CL:17,CP:18,EX:19,IN:20,NS:21,OP:22,QU:23,IS:24,NU:25,PO:26,PR:27,SY:28,AI:29,AL:30,CJ:31,EB:32,EM:33,H2:34,H3:35,HL:36,ID:37,JL:38,JV:39,JT:40,RI:41,SA:42,XX:43},t.BREAK_MANDATORY="!"),c=t.BREAK_NOT_ALLOWED="×",d=t.BREAK_ALLOWED="÷",u=t.UnicodeTrie=(0,r.createTrieFromBase64)(A.default),h=[30,36],g=[1,2,3,5],f=[10,8],p=[27,26],m=g.concat(f),B=[38,39,40,34,35],C=[15,13],v=t.codePointsToCharacterClasses=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"strict",n=[],o=[],i=[];return e.forEach((function(e,r){var A=u.get(e);if(A>s?(i.push(!0),A-=s):i.push(!1),-1!==["normal","auto","loose"].indexOf(t)&&-1!==[8208,8211,12316,12448].indexOf(e))return o.push(r),n.push(16);if(4===A||11===A){if(0===r)return o.push(r),n.push(30);var a=n[r-1];return-1===m.indexOf(a)?(o.push(o[r-1]),n.push(a)):(o.push(r),n.push(30))}return o.push(r),31===A?n.push("strict"===t?21:37):42===A||29===A?n.push(30):43===A?e>=131072&&e<=196605||e>=196608&&e<=262141?n.push(37):n.push(30):void n.push(A)})),[o,n,i]},w=function(e,t,n,o){var i=o[n];if(Array.isArray(e)?-1!==e.indexOf(i):e===i)for(var r=n;r<=o.length;){var A=o[++r];if(A===t)return!0;if(10!==A)break}if(10===i)for(var a=n;a>0;){var s=o[--a];if(Array.isArray(e)?-1!==e.indexOf(s):e===s)for(var l=n;l<=o.length;){var c=o[++l];if(c===t)return!0;if(10!==c)break}if(10!==s)break}return!1},b=function(e,t){for(var n=e;n>=0;){var o=t[n];if(10!==o)return o;n--}return 0},y=function(e,t,n,o,i){if(0===n[o])return c;var r=o-1;if(Array.isArray(i)&&!0===i[r])return c;var A=r-1,a=r+1,s=t[r],m=A>=0?t[A]:0,v=t[a];if(2===s&&3===v)return c;if(-1!==g.indexOf(s))return l;if(-1!==g.indexOf(v))return c;if(-1!==f.indexOf(v))return c;if(8===b(r,t))return d;if(11===u.get(e[r])&&(37===v||32===v||33===v))return c;if(7===s||7===v)return c;if(9===s)return c;if(-1===[10,13,15].indexOf(s)&&9===v)return c;if(-1!==[17,18,19,24,28].indexOf(v))return c;if(22===b(r,t))return c;if(w(23,22,r,t))return c;if(w([17,18],21,r,t))return c;if(w(12,12,r,t))return c;if(10===s)return d;if(23===s||23===v)return c;if(16===v||16===s)return d;if(-1!==[13,15,21].indexOf(v)||14===s)return c;if(36===m&&-1!==C.indexOf(s))return c;if(28===s&&36===v)return c;if(20===v&&-1!==h.concat(20,19,25,37,32,33).indexOf(s))return c;if(-1!==h.indexOf(v)&&25===s||-1!==h.indexOf(s)&&25===v)return c;if(27===s&&-1!==[37,32,33].indexOf(v)||-1!==[37,32,33].indexOf(s)&&26===v)return c;if(-1!==h.indexOf(s)&&-1!==p.indexOf(v)||-1!==p.indexOf(s)&&-1!==h.indexOf(v))return c;if(-1!==[27,26].indexOf(s)&&(25===v||-1!==[22,15].indexOf(v)&&25===t[a+1])||-1!==[22,15].indexOf(s)&&25===v||25===s&&-1!==[25,28,24].indexOf(v))return c;if(-1!==[25,28,24,17,18].indexOf(v))for(var y=r;y>=0;){var F=t[y];if(25===F)return c;if(-1===[28,24].indexOf(F))break;y--}if(-1!==[27,26].indexOf(v))for(var _=-1!==[17,18].indexOf(s)?A:r;_>=0;){var E=t[_];if(25===E)return c;if(-1===[28,24].indexOf(E))break;_--}if(38===s&&-1!==[38,39,34,35].indexOf(v)||-1!==[39,34].indexOf(s)&&-1!==[39,40].indexOf(v)||-1!==[40,35].indexOf(s)&&40===v)return c;if(-1!==B.indexOf(s)&&-1!==[20,26].indexOf(v)||-1!==B.indexOf(v)&&27===s)return c;if(-1!==h.indexOf(s)&&-1!==h.indexOf(v))return c;if(24===s&&-1!==h.indexOf(v))return c;if(-1!==h.concat(25).indexOf(s)&&22===v||-1!==h.concat(25).indexOf(v)&&18===s)return c;if(41===s&&41===v){for(var Q=n[r],U=1;Q>0&&41===t[--Q];)U++;if(U%2!=0)return c}return 32===s&&33===v?c:d},F=(t.lineBreakAtIndex=function(e,t){if(0===t)return c;if(t>=e.length)return l;var n=v(e),o=i(n,2),r=o[0],A=o[1];return y(e,A,r,t)},function(e,t){t||(t={lineBreak:"normal",wordBreak:"normal"});var n=v(e,t.lineBreak),o=i(n,3),r=o[0],A=o[1],a=o[2];return"break-all"!==t.wordBreak&&"break-word"!==t.wordBreak||(A=A.map((function(e){return-1!==[25,30,42].indexOf(e)?37:e}))),[r,A,"keep-all"===t.wordBreak?a.map((function(t,n){return t&&e[n]>=19968&&e[n]<=40959})):null]}),_=(t.inlineBreakOpportunities=function(e,t){var n=(0,a.toCodePoints)(e),o=c,r=F(n,t),A=i(r,3),s=A[0],d=A[1],u=A[2];return n.forEach((function(e,t){o+=(0,a.fromCodePoint)(e)+(t>=n.length-1?l:y(n,d,s,t+1,u))})),o},function(){function e(t,n,o,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this._codePoints=t,this.required=n===l,this.start=o,this.end=i}return o(e,[{key:"slice",value:function(){return a.fromCodePoint.apply(void 0,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(this._codePoints.slice(this.start,this.end)))}}]),e}());t.LineBreaker=function(e,t){var n=(0,a.toCodePoints)(e),o=F(n,t),r=i(o,3),A=r[0],s=r[1],l=r[2],d=n.length,u=0,h=0;return{next:function(){if(h>=d)return{done:!0};for(var e=c;h<d&&(e=y(n,s,A,++h,l))===c;);if(e!==c||h===d){var t=new _(n,e,u,h);return u=h,{value:t,done:!1}}return{done:!0}}}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.Trie=t.createTrieFromBase64=t.UTRIE2_INDEX_2_MASK=t.UTRIE2_INDEX_2_BLOCK_LENGTH=t.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH=t.UTRIE2_INDEX_1_OFFSET=t.UTRIE2_UTF8_2B_INDEX_2_LENGTH=t.UTRIE2_UTF8_2B_INDEX_2_OFFSET=t.UTRIE2_INDEX_2_BMP_LENGTH=t.UTRIE2_LSCP_INDEX_2_LENGTH=t.UTRIE2_DATA_MASK=t.UTRIE2_DATA_BLOCK_LENGTH=t.UTRIE2_LSCP_INDEX_2_OFFSET=t.UTRIE2_SHIFT_1_2=t.UTRIE2_INDEX_SHIFT=t.UTRIE2_SHIFT_1=t.UTRIE2_SHIFT_2=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=n(13),r=t.UTRIE2_SHIFT_2=5,A=t.UTRIE2_SHIFT_1=11,a=t.UTRIE2_INDEX_SHIFT=2,s=t.UTRIE2_SHIFT_1_2=A-r,l=t.UTRIE2_LSCP_INDEX_2_OFFSET=65536>>r,c=t.UTRIE2_DATA_BLOCK_LENGTH=1<<r,d=t.UTRIE2_DATA_MASK=c-1,u=t.UTRIE2_LSCP_INDEX_2_LENGTH=1024>>r,h=t.UTRIE2_INDEX_2_BMP_LENGTH=l+u,g=t.UTRIE2_UTF8_2B_INDEX_2_OFFSET=h,f=t.UTRIE2_UTF8_2B_INDEX_2_LENGTH=32,p=t.UTRIE2_INDEX_1_OFFSET=g+f,m=t.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH=65536>>A,B=t.UTRIE2_INDEX_2_BLOCK_LENGTH=1<<s,C=t.UTRIE2_INDEX_2_MASK=B-1,v=(t.createTrieFromBase64=function(e){var t=(0,i.decode)(e),n=Array.isArray(t)?(0,i.polyUint32Array)(t):new Uint32Array(t),o=Array.isArray(t)?(0,i.polyUint16Array)(t):new Uint16Array(t),r=o.slice(12,n[4]/2),A=2===n[5]?o.slice((24+n[4])/2):n.slice(Math.ceil((24+n[4])/4));return new v(n[0],n[1],n[2],n[3],r,A)},t.Trie=function(){function e(t,n,o,i,r,A){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.initialValue=t,this.errorValue=n,this.highStart=o,this.highValueIndex=i,this.index=r,this.data=A}return o(e,[{key:"get",value:function(e){var t=void 0;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>r])<<a)+(e&d),this.data[t];if(e<=65535)return t=((t=this.index[l+(e-55296>>r)])<<a)+(e&d),this.data[t];if(e<this.highStart)return t=p-m+(e>>A),t=this.index[t],t+=e>>r&C,t=((t=this.index[t])<<a)+(e&d),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue}}]),e}())},function(e,t,n){e.exports="KwAAAAAAAAAACA4AIDoAAPAfAAACAAAAAAAIABAAGABAAEgAUABYAF4AZgBeAGYAYABoAHAAeABeAGYAfACEAIAAiACQAJgAoACoAK0AtQC9AMUAXgBmAF4AZgBeAGYAzQDVAF4AZgDRANkA3gDmAOwA9AD8AAQBDAEUARoBIgGAAIgAJwEvATcBPwFFAU0BTAFUAVwBZAFsAXMBewGDATAAiwGTAZsBogGkAawBtAG8AcIBygHSAdoB4AHoAfAB+AH+AQYCDgIWAv4BHgImAi4CNgI+AkUCTQJTAlsCYwJrAnECeQKBAk0CiQKRApkCoQKoArACuALAAsQCzAIwANQC3ALkAjAA7AL0AvwCAQMJAxADGAMwACADJgMuAzYDPgOAAEYDSgNSA1IDUgNaA1oDYANiA2IDgACAAGoDgAByA3YDfgOAAIQDgACKA5IDmgOAAIAAogOqA4AAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAK8DtwOAAIAAvwPHA88D1wPfAyAD5wPsA/QD/AOAAIAABAQMBBIEgAAWBB4EJgQuBDMEIAM7BEEEXgBJBCADUQRZBGEEaQQwADAAcQQ+AXkEgQSJBJEEgACYBIAAoASoBK8EtwQwAL8ExQSAAIAAgACAAIAAgACgAM0EXgBeAF4AXgBeAF4AXgBeANUEXgDZBOEEXgDpBPEE+QQBBQkFEQUZBSEFKQUxBTUFPQVFBUwFVAVcBV4AYwVeAGsFcwV7BYMFiwWSBV4AmgWgBacFXgBeAF4AXgBeAKsFXgCyBbEFugW7BcIFwgXIBcIFwgXQBdQF3AXkBesF8wX7BQMGCwYTBhsGIwYrBjMGOwZeAD8GRwZNBl4AVAZbBl4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAGMGXgBqBnEGXgBeAF4AXgBeAF4AXgBeAF4AXgB5BoAG4wSGBo4GkwaAAIADHgR5AF4AXgBeAJsGgABGA4AAowarBrMGswagALsGwwbLBjAA0wbaBtoG3QbaBtoG2gbaBtoG2gblBusG8wb7BgMHCwcTBxsHCwcjBysHMAc1BzUHOgdCB9oGSgdSB1oHYAfaBloHaAfaBlIH2gbaBtoG2gbaBtoG2gbaBjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHbQdeAF4ANQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQd1B30HNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B4MH2gaKB68EgACAAIAAgACAAIAAgACAAI8HlwdeAJ8HpweAAIAArwe3B14AXgC/B8UHygcwANAH2AfgB4AA6AfwBz4B+AcACFwBCAgPCBcIogEYAR8IJwiAAC8INwg/CCADRwhPCFcIXwhnCEoDGgSAAIAAgABvCHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIhAiLCI4IMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAANQc1BzUHNQc1BzUHNQc1BzUHNQc1B54INQc1B6II2gaqCLIIugiAAIAAvgjGCIAAgACAAIAAgACAAIAAgACAAIAAywiHAYAA0wiAANkI3QjlCO0I9Aj8CIAAgACAAAIJCgkSCRoJIgknCTYHLwk3CZYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiAAIAAAAFAAXgBeAGAAcABeAHwAQACQAKAArQC9AJ4AXgBeAE0A3gBRAN4A7AD8AMwBGgEAAKcBNwEFAUwBXAF4QkhCmEKnArcCgAHHAsABz4LAAcABwAHAAd+C6ABoAG+C/4LAAcABwAHAAc+DF4MAAcAB54M3gweDV4Nng3eDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEeDqABVg6WDqABoQ6gAaABoAHXDvcONw/3DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DncPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB7cPPwlGCU4JMACAAIAAgABWCV4JYQmAAGkJcAl4CXwJgAkwADAAMAAwAIgJgACLCZMJgACZCZ8JowmrCYAAswkwAF4AXgB8AIAAuwkABMMJyQmAAM4JgADVCTAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAqwYWBNkIMAAwADAAMADdCeAJ6AnuCR4E9gkwAP4JBQoNCjAAMACAABUK0wiAAB0KJAosCjQKgAAwADwKQwqAAEsKvQmdCVMKWwowADAAgACAALcEMACAAGMKgABrCjAAMAAwADAAMAAwADAAMAAwADAAMAAeBDAAMAAwADAAMAAwADAAMAAwADAAMAAwAIkEPQFzCnoKiQSCCooKkAqJBJgKoAqkCokEGAGsCrQKvArBCjAAMADJCtEKFQHZCuEK/gHpCvEKMAAwADAAMACAAIwE+QowAIAAPwEBCzAAMAAwADAAMACAAAkLEQswAIAAPwEZCyELgAAOCCkLMAAxCzkLMAAwADAAMAAwADAAXgBeAEELMAAwADAAMAAwADAAMAAwAEkLTQtVC4AAXAtkC4AAiQkwADAAMAAwADAAMAAwADAAbAtxC3kLgAuFC4sLMAAwAJMLlwufCzAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAApwswADAAMACAAIAAgACvC4AAgACAAIAAgACAALcLMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAvwuAAMcLgACAAIAAgACAAIAAyguAAIAAgACAAIAA0QswADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAANkLgACAAIAA4AswADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACJCR4E6AswADAAhwHwC4AA+AsADAgMEAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMACAAIAAGAwdDCUMMAAwAC0MNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQw1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHPQwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADUHNQc1BzUHNQc1BzUHNQc2BzAAMAA5DDUHNQc1BzUHNQc1BzUHNQc1BzUHNQdFDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAATQxSDFoMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAF4AXgBeAF4AXgBeAF4AYgxeAGoMXgBxDHkMfwxeAIUMXgBeAI0MMAAwADAAMAAwAF4AXgCVDJ0MMAAwADAAMABeAF4ApQxeAKsMswy7DF4Awgy9DMoMXgBeAF4AXgBeAF4AXgBeAF4AXgDRDNkMeQBqCeAM3Ax8AOYM7Az0DPgMXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgCgAAANoAAHDQ4NFg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAeDSYNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAC4NMABeAF4ANg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAD4NRg1ODVYNXg1mDTAAbQ0wADAAMAAwADAAMAAwADAA2gbaBtoG2gbaBtoG2gbaBnUNeg3CBYANwgWFDdoGjA3aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gaUDZwNpA2oDdoG2gawDbcNvw3HDdoG2gbPDdYN3A3fDeYN2gbsDfMN2gbaBvoN/g3aBgYODg7aBl4AXgBeABYOXgBeACUG2gYeDl4AJA5eACwO2w3aBtoGMQ45DtoG2gbaBtoGQQ7aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B1EO2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQdZDjUHNQc1BzUHNQc1B2EONQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHaA41BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B3AO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B2EO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBkkOeA6gAKAAoAAwADAAMAAwAKAAoACgAKAAoACgAKAAgA4wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAD//wQABAAEAAQABAAEAAQABAAEAA0AAwABAAEAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAKABMAFwAeABsAGgAeABcAFgASAB4AGwAYAA8AGAAcAEsASwBLAEsASwBLAEsASwBLAEsAGAAYAB4AHgAeABMAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAFgAbABIAHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYADQARAB4ABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkAFgAaABsAGwAbAB4AHQAdAB4ATwAXAB4ADQAeAB4AGgAbAE8ATwAOAFAAHQAdAB0ATwBPABcATwBPAE8AFgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwArAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAAQABAANAA0ASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAUAArACsAKwArACsAKwArACsABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAGgAaAFAAUABQAFAAUABMAB4AGwBQAB4AKwArACsABAAEAAQAKwBQAFAAUABQAFAAUAArACsAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUAArAFAAUAArACsABAArAAQABAAEAAQABAArACsAKwArAAQABAArACsABAAEAAQAKwArACsABAArACsAKwArACsAKwArAFAAUABQAFAAKwBQACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwAEAAQAUABQAFAABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQAKwArAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeABsAKwArACsAKwArACsAKwBQAAQABAAEAAQABAAEACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAKwArACsAKwArACsAKwArAAQABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwAEAFAAKwBQAFAAUABQAFAAUAArACsAKwBQAFAAUAArAFAAUABQAFAAKwArACsAUABQACsAUAArAFAAUAArACsAKwBQAFAAKwArACsAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQAKwArACsABAAEAAQAKwAEAAQABAAEACsAKwBQACsAKwArACsAKwArAAQAKwArACsAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAB4AHgAeAB4AHgAeABsAHgArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArAFAAUABQACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAB4AUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArACsAKwArACsAKwArAFAAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwArAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAKwBcAFwAKwBcACsAKwBcACsAKwArACsAKwArAFwAXABcAFwAKwBcAFwAXABcAFwAXABcACsAXABcAFwAKwBcACsAXAArACsAXABcACsAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgArACoAKgBcACsAKwBcAFwAXABcAFwAKwBcACsAKgAqACoAKgAqACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAFwAXABcAFwAUAAOAA4ADgAOAB4ADgAOAAkADgAOAA0ACQATABMAEwATABMACQAeABMAHgAeAB4ABAAEAB4AHgAeAB4AHgAeAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUAANAAQAHgAEAB4ABAAWABEAFgARAAQABABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAAQABAAEAAQABAANAAQABABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsADQANAB4AHgAeAB4AHgAeAAQAHgAeAB4AHgAeAB4AKwAeAB4ADgAOAA0ADgAeAB4AHgAeAB4ACQAJACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgAeAB4AHgBcAFwAXABcAFwAXAAqACoAKgAqAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAKgAqACoAKgAqACoAKgBcAFwAXAAqACoAKgAqAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAXAAqAEsASwBLAEsASwBLAEsASwBLAEsAKgAqACoAKgAqACoAUABQAFAAUABQAFAAKwBQACsAKwArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQACsAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwAEAAQABAAeAA0AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAEQArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAADQANAA0AUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAA0ADQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoADQANABUAXAANAB4ADQAbAFwAKgArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAB4AHgATABMADQANAA4AHgATABMAHgAEAAQABAAJACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAUABQAFAAUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwAeACsAKwArABMAEwBLAEsASwBLAEsASwBLAEsASwBLAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwBcAFwAXABcAFwAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcACsAKwArACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwAeAB4AXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsABABLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKgAqACoAKgAqACoAKgBcACoAKgAqACoAKgAqACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAUABQAFAAUABQAFAAUAArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4ADQANAA0ADQAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAHgAeAB4AHgBQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwANAA0ADQANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwBQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsABAAEAAQAHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAABABQAFAAUABQAAQABAAEAFAAUAAEAAQABAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAKwBQACsAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAKwArAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAKwAeAB4AHgAeAB4AHgAeAA4AHgArAA0ADQANAA0ADQANAA0ACQANAA0ADQAIAAQACwAEAAQADQAJAA0ADQAMAB0AHQAeABcAFwAWABcAFwAXABYAFwAdAB0AHgAeABQAFAAUAA0AAQABAAQABAAEAAQABAAJABoAGgAaABoAGgAaABoAGgAeABcAFwAdABUAFQAeAB4AHgAeAB4AHgAYABYAEQAVABUAFQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgANAB4ADQANAA0ADQAeAA0ADQANAAcAHgAeAB4AHgArAAQABAAEAAQABAAEAAQABAAEAAQAUABQACsAKwBPAFAAUABQAFAAUAAeAB4AHgAWABEATwBQAE8ATwBPAE8AUABQAFAAUABQAB4AHgAeABYAEQArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGgAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgBQABoAHgAdAB4AUAAeABoAHgAeAB4AHgAeAB4AHgAeAB4ATwAeAFAAGwAeAB4AUABQAFAAUABQAB4AHgAeAB0AHQAeAFAAHgBQAB4AUAAeAFAATwBQAFAAHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AUABQAFAAUABPAE8AUABQAFAAUABQAE8AUABQAE8AUABPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAE8ATwBPAE8ATwBPAE8ATwBPAE8AUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAATwAeAB4AKwArACsAKwAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB0AHQAeAB4AHgAdAB0AHgAeAB0AHgAeAB4AHQAeAB0AGwAbAB4AHQAeAB4AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB0AHgAdAB4AHQAdAB0AHQAdAB0AHgAdAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAdAB0AHQAdAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAlACUAHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB0AHQAeAB4AHgAeAB0AHQAdAB4AHgAdAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB0AHQAeAB4AHQAeAB4AHgAeAB0AHQAeAB4AHgAeACUAJQAdAB0AJQAeACUAJQAlACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHQAdAB0AHgAdACUAHQAdAB4AHQAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHQAdAB0AHQAlAB4AJQAlACUAHQAlACUAHQAdAB0AJQAlAB0AHQAlAB0AHQAlACUAJQAeAB0AHgAeAB4AHgAdAB0AJQAdAB0AHQAdAB0AHQAlACUAJQAlACUAHQAlACUAIAAlAB0AHQAlACUAJQAlACUAJQAlACUAHgAeAB4AJQAlACAAIAAgACAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeABcAFwAXABcAFwAXAB4AEwATACUAHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACUAJQBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwArACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAE8ATwBPAE8ATwBPAE8ATwAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeACsAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUAArACsAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQBQAFAAUABQACsAKwArACsAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAABAAEAAQAKwAEAAQAKwArACsAKwArAAQABAAEAAQAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsABAAEAAQAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsADQANAA0ADQANAA0ADQANAB4AKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAUABQAFAAUABQAA0ADQANAA0ADQANABQAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwANAA0ADQANAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAeAAQABAAEAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLACsADQArAB4AKwArAAQABAAEAAQAUABQAB4AUAArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwAEAAQABAAEAAQABAAEAAQABAAOAA0ADQATABMAHgAeAB4ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0AUABQAFAAUAAEAAQAKwArAAQADQANAB4AUAArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXABcAA0ADQANACoASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUAArACsAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANACsADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEcARwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwAeAAQABAANAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAEAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUAArACsAUAArACsAUABQACsAKwBQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAeAB4ADQANAA0ADQAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAArAAQABAArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAEAAQABAAEAAQABAAEACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAFgAWAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAKwBQACsAKwArACsAKwArAFAAKwArACsAKwBQACsAUAArAFAAKwBQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQACsAUAArAFAAKwBQACsAUABQACsAUAArACsAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAUABQAFAAUAArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUAArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAlACUAJQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeACUAJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeACUAJQAlACUAJQAeACUAJQAlACUAJQAgACAAIAAlACUAIAAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIQAhACEAIQAhACUAJQAgACAAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAIAAlACUAJQAlACAAJQAgACAAIAAgACAAIAAgACAAIAAlACUAJQAgACUAJQAlACUAIAAgACAAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeACUAHgAlAB4AJQAlACUAJQAlACAAJQAlACUAJQAeACUAHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAIAAgACAAIAAgAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFwAXABcAFQAVABUAHgAeAB4AHgAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAlACAAIAAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsA"},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=n(5);t.default=function e(t,n,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.type=o.PATH.CIRCLE,this.x=t,this.y=n,this.radius=i,isNaN(t)&&console.error("Invalid x value given for Circle"),isNaN(n)&&console.error("Invalid y value given for Circle"),isNaN(i)&&console.error("Invalid radius value given for Circle")}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],o=!0,i=!1,r=void 0;try{for(var A,a=e[Symbol.iterator]();!(o=(A=a.next()).done)&&(n.push(A.value),!t||n.length!==t);o=!0);}catch(e){i=!0,r=e}finally{try{!o&&a.return&&a.return()}finally{if(i)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=n(2),A=(n(25),n(52)),a=function(e){return e&&e.__esModule?e:{default:e}}(n(9)),s=n(4),l=n(12),c=function(){function e(t,n){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.target=t,this.options=n,t.render(n)}return i(e,[{key:"renderNode",value:function(e){e.isVisible()&&(this.renderNodeBackgroundAndBorders(e),this.renderNodeContent(e))}},{key:"renderNodeContent",value:function(e){var t=this,n=function(){if(e.childNodes.length&&e.childNodes.forEach((function(n){if(n instanceof a.default){var o=n.parent.style;t.target.renderTextNode(n.bounds,o.color,o.font,o.textDecoration,o.textShadow)}else t.target.drawShape(n,e.style.color)})),e.image){var n=t.options.imageStore.get(e.image);if(n){var o=(0,r.calculateContentBox)(e.bounds,e.style.padding,e.style.border),i="number"==typeof n.width&&n.width>0?n.width:o.width,A="number"==typeof n.height&&n.height>0?n.height:o.height;i>0&&A>0&&t.target.clip([(0,r.calculatePaddingBoxPath)(e.curvedBounds)],(function(){t.target.drawImage(n,new r.Bounds(0,0,i,A),o)}))}}},o=e.getClipPaths();o.length?this.target.clip(o,n):n()}},{key:"renderNodeBackgroundAndBorders",value:function(e){var t=this,n=!e.style.background.backgroundColor.isTransparent()||e.style.background.backgroundImage.length,o=e.style.border.some((function(e){return e.borderStyle!==l.BORDER_STYLE.NONE&&!e.borderColor.isTransparent()})),i=function(){var o=(0,s.calculateBackgroungPaintingArea)(e.curvedBounds,e.style.background.backgroundClip);n&&t.target.clip([o],(function(){e.style.background.backgroundColor.isTransparent()||t.target.fill(e.style.background.backgroundColor),t.renderBackgroundImage(e)})),e.style.border.forEach((function(n,o){n.borderStyle===l.BORDER_STYLE.NONE||n.borderColor.isTransparent()||t.renderBorder(n,o,e.curvedBounds)}))};if(n||o){var r=e.parent?e.parent.getClipPaths():[];r.length?this.target.clip(r,i):i()}}},{key:"renderBackgroundImage",value:function(e){var t=this;e.style.background.backgroundImage.slice(0).reverse().forEach((function(n){"url"===n.source.method&&n.source.args.length?t.renderBackgroundRepeat(e,n):/gradient/i.test(n.source.method)&&t.renderBackgroundGradient(e,n)}))}},{key:"renderBackgroundRepeat",value:function(e,t){var n=this.options.imageStore.get(t.source.args[0]);if(n){var o=(0,s.calculateBackgroungPositioningArea)(e.style.background.backgroundOrigin,e.bounds,e.style.padding,e.style.border),i=(0,s.calculateBackgroundSize)(t,n,o),r=(0,s.calculateBackgroundPosition)(t.position,i,o),A=(0,s.calculateBackgroundRepeatPath)(t,r,i,o,e.bounds),a=Math.round(o.left+r.x),l=Math.round(o.top+r.y);this.target.renderRepeat(A,n,i,a,l)}}},{key:"renderBackgroundGradient",value:function(e,t){var n=(0,s.calculateBackgroungPositioningArea)(e.style.background.backgroundOrigin,e.bounds,e.style.padding,e.style.border),o=(0,s.calculateGradientBackgroundSize)(t,n),i=(0,s.calculateBackgroundPosition)(t.position,o,n),a=new r.Bounds(Math.round(n.left+i.x),Math.round(n.top+i.y),o.width,o.height),l=(0,A.parseGradient)(e,t.source,a);if(l)switch(l.type){case A.GRADIENT_TYPE.LINEAR_GRADIENT:this.target.renderLinearGradient(a,l);break;case A.GRADIENT_TYPE.RADIAL_GRADIENT:this.target.renderRadialGradient(a,l)}}},{key:"renderBorder",value:function(e,t,n){this.target.drawShape((0,r.parsePathForBorder)(n,t),e.borderColor)}},{key:"renderStack",value:function(e){var t=this;if(e.container.isVisible()){var n=e.getOpacity();n!==this._opacity&&(this.target.setOpacity(e.getOpacity()),this._opacity=n);var o=e.container.style.transform;null!==o?this.target.transform(e.container.bounds.left+o.transformOrigin[0].value,e.container.bounds.top+o.transformOrigin[1].value,o.transform,(function(){return t.renderStackContent(e)})):this.renderStackContent(e)}}},{key:"renderStackContent",value:function(e){var t=u(e),n=o(t,5),i=n[0],r=n[1],A=n[2],a=n[3],s=n[4],l=d(e),c=o(l,2),g=c[0],f=c[1];this.renderNodeBackgroundAndBorders(e.container),i.sort(h).forEach(this.renderStack,this),this.renderNodeContent(e.container),f.forEach(this.renderNode,this),a.forEach(this.renderStack,this),s.forEach(this.renderStack,this),g.forEach(this.renderNode,this),r.forEach(this.renderStack,this),A.sort(h).forEach(this.renderStack,this)}},{key:"render",value:function(e){var t=this;return this.options.backgroundColor&&this.target.rectangle(this.options.x,this.options.y,this.options.width,this.options.height,this.options.backgroundColor),this.renderStack(e),this.target.getTarget().then((function(e){return t.options.logger.log("Render completed"),e}))}}]),e}();t.default=c;var d=function(e){for(var t=[],n=[],o=e.children.length,i=0;i<o;i++){var r=e.children[i];r.isInlineLevel()?t.push(r):n.push(r)}return[t,n]},u=function(e){for(var t=[],n=[],o=[],i=[],r=[],A=e.contexts.length,a=0;a<A;a++){var s=e.contexts[a];s.container.isPositioned()||s.container.style.opacity<1||s.container.isTransformed()?s.container.style.zIndex.order<0?t.push(s):s.container.style.zIndex.order>0?o.push(s):n.push(s):s.container.isFloating()?i.push(s):r.push(s)}return[t,n,o,i,r]},h=function(e,t){return e.container.style.zIndex.order>t.container.style.zIndex.order?1:e.container.style.zIndex.order<t.container.style.zIndex.order?-1:e.container.index>t.container.index?1:-1}},function(e,t,n){function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.transformWebkitRadialGradientArgs=t.parseGradient=t.RadialGradient=t.LinearGradient=t.RADIAL_GRADIENT_SHAPE=t.GRADIENT_TYPE=void 0;var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],o=!0,i=!1,r=void 0;try{for(var A,a=e[Symbol.iterator]();!(o=(A=a.next()).done)&&(n.push(A.value),!t||n.length!==t);o=!0);}catch(e){i=!0,r=e}finally{try{!o&&a.return&&a.return()}finally{if(i)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},A=(o(n(6)),n(53)),a=o(n(0)),s=n(1),l=o(s),c=n(3),d=/^(to )?(left|top|right|bottom)( (left|top|right|bottom))?$/i,u=/^([+-]?\d*\.?\d+)% ([+-]?\d*\.?\d+)%$/i,h=/(px)|%|( 0)$/i,g=/^(from|to|color-stop)\((?:([\d.]+)(%)?,\s*)?(.+?)\)$/i,f=/^\s*(circle|ellipse)?\s*((?:([\d.]+)(px|r?em|%)\s*(?:([\d.]+)(px|r?em|%))?)|closest-side|closest-corner|farthest-side|farthest-corner)?\s*(?:at\s*(?:(left|center|right)|([\d.]+)(px|r?em|%))\s+(?:(top|center|bottom)|([\d.]+)(px|r?em|%)))?(?:\s|$)/i,p=t.GRADIENT_TYPE={LINEAR_GRADIENT:0,RADIAL_GRADIENT:1},m=t.RADIAL_GRADIENT_SHAPE={CIRCLE:0,ELLIPSE:1},B={left:new l.default("0%"),top:new l.default("0%"),center:new l.default("50%"),right:new l.default("100%"),bottom:new l.default("100%")},C=t.LinearGradient=function e(t,n){i(this,e),this.type=p.LINEAR_GRADIENT,this.colorStops=t,this.direction=n},v=t.RadialGradient=function e(t,n,o,r){i(this,e),this.type=p.RADIAL_GRADIENT,this.colorStops=t,this.shape=n,this.center=o,this.radius=r},w=(t.parseGradient=function(e,t,n){var o=t.args,i=t.method,r=t.prefix;return"linear-gradient"===i?b(o,n,!!r):"gradient"===i&&"linear"===o[0]?b(["to bottom"].concat(I(o.slice(3))),n,!!r):"radial-gradient"===i?y(e,"-webkit-"===r?T(o):o,n):"gradient"===i&&"radial"===o[0]?y(e,I(T(o.slice(1))),n):void 0},function(e,t,n){for(var o=[],i=t;i<e.length;i++){var r=e[i],A=h.test(r),s=r.lastIndexOf(" "),c=new a.default(A?r.substring(0,s):r),d=A?new l.default(r.substring(s+1)):i===t?new l.default("0%"):i===e.length-1?new l.default("100%"):null;o.push({color:c,stop:d})}for(var u=o.map((function(e){var t=e.color,o=e.stop;return{color:t,stop:0===n?0:o?o.getAbsoluteValue(n)/n:null}})),g=u[0].stop,f=0;f<u.length;f++)if(null!==g){var p=u[f].stop;if(null===p){for(var m=f;null===u[m].stop;)m++;for(var B=m-f+1,C=(u[m].stop-g)/B;f<m;f++)g=u[f].stop=g+C}else g=p}return u}),b=function(e,t,n){var o=(0,A.parseAngle)(e[0]),i=d.test(e[0]),r=i||null!==o||u.test(e[0]),a=r?null!==o?F(n?o-.5*Math.PI:o,t):i?E(e[0],t):Q(e[0],t):F(Math.PI,t),s=r?1:0,l=Math.min((0,c.distance)(Math.abs(a.x0)+Math.abs(a.x1),Math.abs(a.y0)+Math.abs(a.y1)),2*t.width,2*t.height);return new C(w(e,s,l),a)},y=function(e,t,n){var o=t[0].match(f),i=o&&("circle"===o[1]||void 0!==o[3]&&void 0===o[5])?m.CIRCLE:m.ELLIPSE,r={},A={};o&&(void 0!==o[3]&&(r.x=(0,s.calculateLengthFromValueWithUnit)(e,o[3],o[4]).getAbsoluteValue(n.width)),void 0!==o[5]&&(r.y=(0,s.calculateLengthFromValueWithUnit)(e,o[5],o[6]).getAbsoluteValue(n.height)),o[7]?A.x=B[o[7].toLowerCase()]:void 0!==o[8]&&(A.x=(0,s.calculateLengthFromValueWithUnit)(e,o[8],o[9])),o[10]?A.y=B[o[10].toLowerCase()]:void 0!==o[11]&&(A.y=(0,s.calculateLengthFromValueWithUnit)(e,o[11],o[12])));var a={x:void 0===A.x?n.width/2:A.x.getAbsoluteValue(n.width),y:void 0===A.y?n.height/2:A.y.getAbsoluteValue(n.height)},l=S(o&&o[2]||"farthest-corner",i,a,r,n);return new v(w(t,o?1:0,Math.min(l.x,l.y)),i,a,l)},F=function(e,t){var n=t.width,o=t.height,i=.5*n,r=.5*o,A=(Math.abs(n*Math.sin(e))+Math.abs(o*Math.cos(e)))/2,a=i+Math.sin(e)*A,s=r-Math.cos(e)*A;return{x0:a,x1:n-a,y0:s,y1:o-s}},_=function(e){return Math.acos(e.width/2/((0,c.distance)(e.width,e.height)/2))},E=function(e,t){switch(e){case"bottom":case"to top":return F(0,t);case"left":case"to right":return F(Math.PI/2,t);case"right":case"to left":return F(3*Math.PI/2,t);case"top right":case"right top":case"to bottom left":case"to left bottom":return F(Math.PI+_(t),t);case"top left":case"left top":case"to bottom right":case"to right bottom":return F(Math.PI-_(t),t);case"bottom left":case"left bottom":case"to top right":case"to right top":return F(_(t),t);case"bottom right":case"right bottom":case"to top left":case"to left top":return F(2*Math.PI-_(t),t);case"top":case"to bottom":default:return F(Math.PI,t)}},Q=function(e,t){var n=e.split(" ").map(parseFloat),o=r(n,2),i=o[0],A=o[1],a=i/100*t.width/(A/100*t.height);return F(Math.atan(isNaN(a)?1:a)+Math.PI/2,t)},U=function(e,t,n,o){return[{x:0,y:0},{x:0,y:e.height},{x:e.width,y:0},{x:e.width,y:e.height}].reduce((function(e,i){var r=(0,c.distance)(t-i.x,n-i.y);return(o?r<e.optimumDistance:r>e.optimumDistance)?{optimumCorner:i,optimumDistance:r}:e}),{optimumDistance:o?1/0:-1/0,optimumCorner:null}).optimumCorner},S=function(e,t,n,o,i){var r=n.x,A=n.y,a=0,s=0;switch(e){case"closest-side":t===m.CIRCLE?a=s=Math.min(Math.abs(r),Math.abs(r-i.width),Math.abs(A),Math.abs(A-i.height)):t===m.ELLIPSE&&(a=Math.min(Math.abs(r),Math.abs(r-i.width)),s=Math.min(Math.abs(A),Math.abs(A-i.height)));break;case"closest-corner":if(t===m.CIRCLE)a=s=Math.min((0,c.distance)(r,A),(0,c.distance)(r,A-i.height),(0,c.distance)(r-i.width,A),(0,c.distance)(r-i.width,A-i.height));else if(t===m.ELLIPSE){var l=Math.min(Math.abs(A),Math.abs(A-i.height))/Math.min(Math.abs(r),Math.abs(r-i.width)),d=U(i,r,A,!0);s=l*(a=(0,c.distance)(d.x-r,(d.y-A)/l))}break;case"farthest-side":t===m.CIRCLE?a=s=Math.max(Math.abs(r),Math.abs(r-i.width),Math.abs(A),Math.abs(A-i.height)):t===m.ELLIPSE&&(a=Math.max(Math.abs(r),Math.abs(r-i.width)),s=Math.max(Math.abs(A),Math.abs(A-i.height)));break;case"farthest-corner":if(t===m.CIRCLE)a=s=Math.max((0,c.distance)(r,A),(0,c.distance)(r,A-i.height),(0,c.distance)(r-i.width,A),(0,c.distance)(r-i.width,A-i.height));else if(t===m.ELLIPSE){var u=Math.max(Math.abs(A),Math.abs(A-i.height))/Math.max(Math.abs(r),Math.abs(r-i.width)),h=U(i,r,A,!1);s=u*(a=(0,c.distance)(h.x-r,(h.y-A)/u))}break;default:a=o.x||0,s=void 0!==o.y?o.y:a}return{x:a,y:s}},T=t.transformWebkitRadialGradientArgs=function(e){var t="",n="",o="",i="",r=0,A=/^(left|center|right|\d+(?:px|r?em|%)?)(?:\s+(top|center|bottom|\d+(?:px|r?em|%)?))?$/i,a=/^\d+(px|r?em|%)?(?:\s+\d+(px|r?em|%)?)?$/i,s=e[r].match(A);s&&r++;var l=e[r].match(/^(circle|ellipse)?\s*(closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)?$/i);l&&(t=l[1]||"","contain"===(o=l[2]||"")?o="closest-side":"cover"===o&&(o="farthest-corner"),r++);var c=e[r].match(a);c&&r++;var d=e[r].match(A);d&&r++;var u=e[r].match(a);u&&r++;var h=d||s;h&&h[1]&&(i=h[1]+(/^\d+$/.test(h[1])?"px":""),h[2]&&(i+=" "+h[2]+(/^\d+$/.test(h[2])?"px":"")));var g=u||c;return g&&(n=g[0],g[1]||(n+="px")),!i||t||n||o||(n=i,i=""),i&&(i="at "+i),[[t,o,n,i].filter((function(e){return!!e})).join(" ")].concat(e.slice(r))},I=function(e){return e.map((function(e){return e.match(g)})).map((function(t,n){if(!t)return e[n];switch(t[1]){case"from":return t[4]+" 0%";case"to":return t[4]+" 100%";case"color-stop":return"%"===t[3]?t[4]+" "+t[2]:t[4]+" "+100*parseFloat(t[2])+"%"}}))}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=/([+-]?\d*\.?\d+)(deg|grad|rad|turn)/i;t.parseAngle=function(e){var t=e.match(o);if(t){var n=parseFloat(t[1]);switch(t[2].toLowerCase()){case"deg":return Math.PI*n/180;case"grad":return Math.PI/200*n;case"rad":return n;case"turn":return 2*Math.PI*n}}return null}},function(e,t,n){function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.cloneWindow=t.DocumentCloner=void 0;var i=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],o=!0,i=!1,r=void 0;try{for(var A,a=e[Symbol.iterator]();!(o=(A=a.next()).done)&&(n.push(A.value),!t||n.length!==t);o=!0);}catch(e){i=!0,r=e}finally{try{!o&&a.return&&a.return()}finally{if(i)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),A=n(2),a=n(26),s=o(n(55)),l=n(3),c=n(4),d=o(n(15)),u=n(56),h=t.DocumentCloner=function(){function e(t,n,o,i,r){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.referenceElement=t,this.scrolledElements=[],this.copyStyles=i,this.inlineImages=i,this.logger=o,this.options=n,this.renderer=r,this.resourceLoader=new s.default(n,o,window),this.pseudoContentData={counters:{},quoteDepth:0},this.documentElement=this.cloneNode(t.ownerDocument.documentElement)}return r(e,[{key:"inlineAllImages",value:function(e){var t=this;if(this.inlineImages&&e){var n=e.style;Promise.all((0,c.parseBackgroundImage)(n.backgroundImage).map((function(e){return"url"===e.method?t.resourceLoader.inlineImage(e.args[0]).then((function(e){return e&&"string"==typeof e.src?'url("'+e.src+'")':"none"})).catch((function(e){t.logger.log("Unable to load image",e)})):Promise.resolve(""+e.prefix+e.method+"("+e.args.join(",")+")")}))).then((function(e){e.length>1&&(n.backgroundColor=""),n.backgroundImage=e.join(",")})),e instanceof HTMLImageElement&&this.resourceLoader.inlineImage(e.src).then((function(t){if(t&&e instanceof HTMLImageElement&&e.parentNode){var n=e.parentNode,o=(0,l.copyCSSStyles)(e.style,t.cloneNode(!1));n.replaceChild(o,e)}})).catch((function(e){t.logger.log("Unable to load image",e)}))}}},{key:"inlineFonts",value:function(e){var t=this;return Promise.all(Array.from(e.styleSheets).map((function(n){return n.href?fetch(n.href).then((function(e){return e.text()})).then((function(e){return f(e,n.href)})).catch((function(e){return t.logger.log("Unable to load stylesheet",e),[]})):g(n,e)}))).then((function(e){return e.reduce((function(e,t){return e.concat(t)}),[])})).then((function(e){return Promise.all(e.map((function(e){return fetch(e.formats[0].src).then((function(e){return e.blob()})).then((function(e){return new Promise((function(t,n){var o=new FileReader;o.onerror=n,o.onload=function(){var e=o.result;t(e)},o.readAsDataURL(e)}))})).then((function(t){return e.fontFace.setProperty("src",'url("'+t+'")'),"@font-face {"+e.fontFace.cssText+" "}))})))})).then((function(n){var o=e.createElement("style");o.textContent=n.join("\n"),t.documentElement.appendChild(o)}))}},{key:"createElementClone",value:function(e){var t=this;if(this.copyStyles&&e instanceof HTMLCanvasElement){var n=e.ownerDocument.createElement("img");try{return n.src=e.toDataURL(),n}catch(e){this.logger.log("Unable to clone canvas contents, canvas is tainted")}}if(e instanceof HTMLIFrameElement){var o=e.cloneNode(!1),i=_();o.setAttribute("data-html2canvas-internal-iframe-key",i);var r=(0,A.parseBounds)(e,0,0),a=r.width,s=r.height;return this.resourceLoader.cache[i]=Q(e,this.options).then((function(e){return t.renderer(e,{async:t.options.async,allowTaint:t.options.allowTaint,backgroundColor:"#ffffff",canvas:null,imageTimeout:t.options.imageTimeout,logging:t.options.logging,proxy:t.options.proxy,removeContainer:t.options.removeContainer,scale:t.options.scale,foreignObjectRendering:t.options.foreignObjectRendering,useCORS:t.options.useCORS,target:new d.default,width:a,height:s,x:0,y:0,windowWidth:e.ownerDocument.defaultView.innerWidth,windowHeight:e.ownerDocument.defaultView.innerHeight,scrollX:e.ownerDocument.defaultView.pageXOffset,scrollY:e.ownerDocument.defaultView.pageYOffset},t.logger.child(i))})).then((function(t){return new Promise((function(n,i){var r=document.createElement("img");r.onload=function(){return n(t)},r.onerror=i,r.src=t.toDataURL(),o.parentNode&&o.parentNode.replaceChild((0,l.copyCSSStyles)(e.ownerDocument.defaultView.getComputedStyle(e),r),o)}))})),o}try{if(e instanceof HTMLStyleElement&&e.sheet&&e.sheet.cssRules){var c=[].slice.call(e.sheet.cssRules,0).reduce((function(e,t){return t&&"string"==typeof t.cssText?e+t.cssText:e}),""),u=e.cloneNode(!1);return u.textContent=c,u}}catch(e){if(this.logger.log("Unable to access cssRules property"),"SecurityError"!==e.name)throw this.logger.log(e),e}return e.cloneNode(!1)}},{key:"cloneNode",value:function(e){var t=e.nodeType===Node.TEXT_NODE?document.createTextNode(e.nodeValue):this.createElementClone(e),n=e.ownerDocument.defaultView,o=e instanceof n.HTMLElement?n.getComputedStyle(e):null,i=e instanceof n.HTMLElement?n.getComputedStyle(e,":before"):null,r=e instanceof n.HTMLElement?n.getComputedStyle(e,":after"):null;this.referenceElement===e&&t instanceof n.HTMLElement&&(this.clonedReferenceElement=t),t instanceof n.HTMLBodyElement&&b(t);for(var A=(0,u.parseCounterReset)(o,this.pseudoContentData),a=(0,u.resolvePseudoContent)(e,i,this.pseudoContentData),s=e.firstChild;s;s=s.nextSibling)s.nodeType===Node.ELEMENT_NODE&&("SCRIPT"===s.nodeName||s.hasAttribute("data-html2canvas-ignore")||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(s))||this.copyStyles&&"STYLE"===s.nodeName||t.appendChild(this.cloneNode(s));var c=(0,u.resolvePseudoContent)(e,r,this.pseudoContentData);if((0,u.popCounters)(A,this.pseudoContentData),e instanceof n.HTMLElement&&t instanceof n.HTMLElement)switch(i&&this.inlineAllImages(m(e,t,i,a,B)),r&&this.inlineAllImages(m(e,t,r,c,C)),!o||!this.copyStyles||e instanceof HTMLIFrameElement||(0,l.copyCSSStyles)(o,t),this.inlineAllImages(t),0===e.scrollTop&&0===e.scrollLeft||this.scrolledElements.push([t,e.scrollLeft,e.scrollTop]),e.nodeName){case"CANVAS":this.copyStyles||p(e,t);break;case"TEXTAREA":case"SELECT":t.value=e.value}return t}}]),e}(),g=function(e,t){return(e.cssRules?Array.from(e.cssRules):[]).filter((function(e){return e.type===CSSRule.FONT_FACE_RULE})).map((function(e){for(var n=(0,c.parseBackgroundImage)(e.style.getPropertyValue("src")),o=[],i=0;i<n.length;i++)if("url"===n[i].method&&n[i+1]&&"format"===n[i+1].method){var r=t.createElement("a");r.href=n[i].args[0],t.body&&t.body.appendChild(r);var A={src:r.href,format:n[i+1].args[0]};o.push(A)}return{formats:o.filter((function(e){return/^woff/i.test(e.format)})),fontFace:e.style}})).filter((function(e){return e.formats.length}))},f=function(e,t){var n=document.implementation.createHTMLDocument(""),o=document.createElement("base");o.href=t;var i=document.createElement("style");return i.textContent=e,n.head&&n.head.appendChild(o),n.body&&n.body.appendChild(i),i.sheet?g(i.sheet,n):[]},p=function(e,t){try{if(t){t.width=e.width,t.height=e.height;var n=e.getContext("2d"),o=t.getContext("2d");n?o.putImageData(n.getImageData(0,0,e.width,e.height),0,0):o.drawImage(e,0,0)}}catch(e){}},m=function(e,t,n,o,i){if(n&&n.content&&"none"!==n.content&&"-moz-alt-content"!==n.content&&"none"!==n.display){var r=t.ownerDocument.createElement("html2canvaspseudoelement");if((0,l.copyCSSStyles)(n,r),o)for(var A=o.length,a=0;a<A;a++){var s=o[a];switch(s.type){case u.PSEUDO_CONTENT_ITEM_TYPE.IMAGE:var d=t.ownerDocument.createElement("img");d.src=(0,c.parseBackgroundImage)("url("+s.value+")")[0].args[0],d.style.opacity="1",r.appendChild(d);break;case u.PSEUDO_CONTENT_ITEM_TYPE.TEXT:r.appendChild(t.ownerDocument.createTextNode(s.value))}}return r.className=v+" "+w,t.className+=i===B?" "+v:" "+w,i===B?t.insertBefore(r,t.firstChild):t.appendChild(r),r}},B=":before",C=":after",v="___html2canvas___pseudoelement_before",w="___html2canvas___pseudoelement_after",b=function(e){y(e,"."+v+B+'{\n content: "" !important;\n display: none !important;\n}\n .'+w+C+'{\n content: "" !important;\n display: none !important;\n}')},y=function(e,t){var n=e.ownerDocument.createElement("style");n.innerHTML=t,e.appendChild(n)},F=function(e){var t=i(e,3),n=t[0],o=t[1],r=t[2];n.scrollLeft=o,n.scrollTop=r},_=function(){return Math.ceil(Date.now()+1e7*Math.random()).toString(16)},E=/^data:text\/(.+);(base64)?,(.*)$/i,Q=function(e,t){try{return Promise.resolve(e.contentWindow.document.documentElement)}catch(n){return t.proxy?(0,a.Proxy)(e.src,t).then((function(e){var t=e.match(E);return t?"base64"===t[2]?window.atob(decodeURIComponent(t[3])):decodeURIComponent(t[3]):Promise.reject()})).then((function(t){return U(e.ownerDocument,(0,A.parseBounds)(e,0,0)).then((function(e){var n=e.contentWindow.document;n.open(),n.write(t);var o=S(e).then((function(){return n.documentElement}));return n.close(),o}))})):Promise.reject()}},U=function(e,t){var n=e.createElement("iframe");return n.className="html2canvas-container",n.style.visibility="hidden",n.style.position="fixed",n.style.left="-10000px",n.style.top="0px",n.style.border="0",n.width=t.width.toString(),n.height=t.height.toString(),n.scrolling="no",n.setAttribute("data-html2canvas-ignore","true"),e.body?(e.body.appendChild(n),Promise.resolve(n)):Promise.reject("Body element not found in Document that is getting rendered")},S=function(e){var t=e.contentWindow,n=t.document;return new Promise((function(o,i){t.onload=e.onload=n.onreadystatechange=function(){var t=setInterval((function(){n.body.childNodes.length>0&&"complete"===n.readyState&&(clearInterval(t),o(e))}),50)}}))},T=(t.cloneWindow=function(e,t,n,o,i,r){var A=new h(n,o,i,!1,r),a=e.defaultView.pageXOffset,s=e.defaultView.pageYOffset;return U(e,t).then((function(i){var r=i.contentWindow,l=r.document,c=S(i).then((function(){A.scrolledElements.forEach(F),r.scrollTo(t.left,t.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||r.scrollY===t.top&&r.scrollX===t.left||(l.documentElement.style.top=-t.top+"px",l.documentElement.style.left=-t.left+"px",l.documentElement.style.position="absolute");var a=Promise.resolve([i,A.clonedReferenceElement,A.resourceLoader]),s=o.onclone;return A.clonedReferenceElement instanceof r.HTMLElement||A.clonedReferenceElement instanceof e.defaultView.HTMLElement||A.clonedReferenceElement instanceof HTMLElement?"function"==typeof s?Promise.resolve().then((function(){return s(l)})).then((function(){return a})):a:Promise.reject("Error finding the "+n.nodeName+" in the cloned document")}));return l.open(),l.write(T(document.doctype)+"<html></html>"),function(e,t,n){!e.defaultView||t===e.defaultView.pageXOffset&&n===e.defaultView.pageYOffset||e.defaultView.scrollTo(t,n)}(n.ownerDocument,a,s),l.replaceChild(l.adoptNode(A.documentElement),l.documentElement),l.close(),c}))},function(e){var t="";return e&&(t+="<!DOCTYPE ",e.name&&(t+=e.name),e.internalSubset&&(t+=e.internalSubset),e.publicId&&(t+='"'+e.publicId+'"'),e.systemId&&(t+='"'+e.systemId+'"'),t+=">"),t})},function(e,t,n){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceStore=void 0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function(e){return e&&e.__esModule?e:{default:e}}(n(10)),A=n(26),a=function(){function e(t,n,i){o(this,e),this.options=t,this._window=i,this.origin=this.getOrigin(i.location.href),this.cache={},this.logger=n,this._index=0}return i(e,[{key:"loadImage",value:function(e){var t=this;if(this.hasResourceInCache(e))return e;if(g(e))return this.cache[e]=p(e,this.options.imageTimeout||0),e;if(!f(e)||r.default.SUPPORT_SVG_DRAWING){if(!0===this.options.allowTaint||u(e)||this.isSameOrigin(e))return this.addImage(e,e,!1);if(!this.isSameOrigin(e)){if("string"==typeof this.options.proxy)return this.cache[e]=(0,A.Proxy)(e,this.options).then((function(e){return p(e,t.options.imageTimeout||0)})),e;if(!0===this.options.useCORS&&r.default.SUPPORT_CORS_IMAGES)return this.addImage(e,e,!0)}}}},{key:"inlineImage",value:function(e){var t=this;return u(e)?p(e,this.options.imageTimeout||0):this.hasResourceInCache(e)?this.cache[e]:this.isSameOrigin(e)||"string"!=typeof this.options.proxy?this.xhrImage(e):this.cache[e]=(0,A.Proxy)(e,this.options).then((function(e){return p(e,t.options.imageTimeout||0)}))}},{key:"xhrImage",value:function(e){var t=this;return this.cache[e]=new Promise((function(n,o){var i=new XMLHttpRequest;if(i.onreadystatechange=function(){if(4===i.readyState)if(200!==i.status)o("Failed to fetch image "+e.substring(0,256)+" with status code "+i.status);else{var t=new FileReader;t.addEventListener("load",(function(){var e=t.result;n(e)}),!1),t.addEventListener("error",(function(e){return o(e)}),!1),t.readAsDataURL(i.response)}},i.responseType="blob",t.options.imageTimeout){var r=t.options.imageTimeout;i.timeout=r,i.ontimeout=function(){return o("Timed out ("+r+"ms) fetching "+e.substring(0,256))}}i.open("GET",e,!0),i.send()})).then((function(e){return p(e,t.options.imageTimeout||0)})),this.cache[e]}},{key:"loadCanvas",value:function(e){var t=String(this._index++);return this.cache[t]=Promise.resolve(e),t}},{key:"hasResourceInCache",value:function(e){return void 0!==this.cache[e]}},{key:"addImage",value:function(e,t,n){var o=this;this.logger.log("Added image "+e.substring(0,256));var i=function(e){return new Promise((function(i,r){var A=new Image;if(A.onload=function(){return i(A)},e&&!n||(A.crossOrigin="anonymous"),A.onerror=r,A.src=t,!0===A.complete&&setTimeout((function(){i(A)}),500),o.options.imageTimeout){var a=o.options.imageTimeout;setTimeout((function(){return r("Timed out ("+a+"ms) fetching "+t.substring(0,256))}),a)}}))};return this.cache[e]=h(t)&&!f(t)?r.default.SUPPORT_BASE64_DRAWING(t).then(i):i(!0),e}},{key:"isSameOrigin",value:function(e){return this.getOrigin(e)===this.origin}},{key:"getOrigin",value:function(e){var t=this._link||(this._link=this._window.document.createElement("a"));return t.href=e,t.href=t.href,t.protocol+t.hostname+t.port}},{key:"ready",value:function(){var e=this,t=Object.keys(this.cache),n=t.map((function(t){return e.cache[t].catch((function(t){return e.logger.log("Unable to load image",t),null}))}));return Promise.all(n).then((function(n){return e.logger.log("Finished loading "+n.length+" images",n),new s(t,n)}))}}]),e}();t.default=a;var s=t.ResourceStore=function(){function e(t,n){o(this,e),this._keys=t,this._resources=n}return i(e,[{key:"get",value:function(e){var t=this._keys.indexOf(e);return-1===t?null:this._resources[t]}}]),e}(),l=/^data:image\/svg\+xml/i,c=/^data:image\/.*;base64,/i,d=/^data:image\/.*/i,u=function(e){return d.test(e)},h=function(e){return c.test(e)},g=function(e){return"blob"===e.substr(0,4)},f=function(e){return"svg"===e.substr(-3).toLowerCase()||l.test(e)},p=function(e,t){return new Promise((function(n,o){var i=new Image;i.onload=function(){return n(i)},i.onerror=o,i.src=e,!0===i.complete&&setTimeout((function(){n(i)}),500),t&&setTimeout((function(){return o("Timed out ("+t+"ms) loading image")}),t)}))}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseContent=t.resolvePseudoContent=t.popCounters=t.parseCounterReset=t.TOKEN_TYPE=t.PSEUDO_CONTENT_ITEM_TYPE=void 0;var o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],o=!0,i=!1,r=void 0;try{for(var A,a=e[Symbol.iterator]();!(o=(A=a.next()).done)&&(n.push(A.value),!t||n.length!==t);o=!0);}catch(e){i=!0,r=e}finally{try{!o&&a.return&&a.return()}finally{if(i)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=n(14),r=n(8),A=t.PSEUDO_CONTENT_ITEM_TYPE={TEXT:0,IMAGE:1},a=t.TOKEN_TYPE={STRING:0,ATTRIBUTE:1,URL:2,COUNTER:3,COUNTERS:4,OPENQUOTE:5,CLOSEQUOTE:6},s=(t.parseCounterReset=function(e,t){if(!e||!e.counterReset||"none"===e.counterReset)return[];for(var n=[],i=e.counterReset.split(/\s*,\s*/),r=i.length,A=0;A<r;A++){var a=i[A].split(/\s+/),s=o(a,2),l=s[0],c=s[1];n.push(l);var d=t.counters[l];d||(d=t.counters[l]=[]),d.push(parseInt(c||0,10))}return n},t.popCounters=function(e,t){for(var n=e.length,o=0;o<n;o++)t.counters[e[o]].pop()},t.resolvePseudoContent=function(e,t,n){if(!t||!t.content||"none"===t.content||"-moz-alt-content"===t.content||"none"===t.display)return null;var i=s(t.content),r=i.length,l=[],u="",h=t.counterIncrement;if(h&&"none"!==h){var g=h.split(/\s+/),f=o(g,2),p=f[0],m=f[1],B=n.counters[p];B&&(B[B.length-1]+=void 0===m?1:parseInt(m,10))}for(var C=0;C<r;C++){var v=i[C];switch(v.type){case a.STRING:u+=v.value||"";break;case a.ATTRIBUTE:e instanceof HTMLElement&&v.value&&(u+=e.getAttribute(v.value)||"");break;case a.COUNTER:var w=n.counters[v.name||""];w&&(u+=d([w[w.length-1]],"",v.format));break;case a.COUNTERS:var b=n.counters[v.name||""];b&&(u+=d(b,v.glue,v.format));break;case a.OPENQUOTE:u+=c(t,!0,n.quoteDepth),n.quoteDepth++;break;case a.CLOSEQUOTE:n.quoteDepth--,u+=c(t,!1,n.quoteDepth);break;case a.URL:u&&(l.push({type:A.TEXT,value:u}),u=""),l.push({type:A.IMAGE,value:v.value||""})}}return u&&l.push({type:A.TEXT,value:u}),l},t.parseContent=function(e,t){if(t&&t[e])return t[e];for(var n=[],o=e.length,i=!1,r=!1,A=!1,s="",c="",d=[],u=0;u<o;u++){var h=e.charAt(u);switch(h){case"'":case'"':r?s+=h:(i=!i,A||i||(n.push({type:a.STRING,value:s}),s=""));break;case"\\":r?(s+=h,r=!1):r=!0;break;case"(":i?s+=h:(A=!0,c=s,s="",d=[]);break;case")":if(i)s+=h;else if(A){switch(s&&d.push(s),c){case"attr":d.length>0&&n.push({type:a.ATTRIBUTE,value:d[0]});break;case"counter":if(d.length>0){var g={type:a.COUNTER,name:d[0]};d.length>1&&(g.format=d[1]),n.push(g)}break;case"counters":if(d.length>0){var f={type:a.COUNTERS,name:d[0]};d.length>1&&(f.glue=d[1]),d.length>2&&(f.format=d[2]),n.push(f)}break;case"url":d.length>0&&n.push({type:a.URL,value:d[0]})}A=!1,s=""}break;case",":i?s+=h:A&&(d.push(s),s="");break;case" ":case"\t":i?s+=h:s&&(l(n,s),s="");break;default:s+=h}"\\"!==h&&(r=!1)}return s&&l(n,s),t&&(t[e]=n),n}),l=function(e,t){switch(t){case"open-quote":e.push({type:a.OPENQUOTE});break;case"close-quote":e.push({type:a.CLOSEQUOTE})}},c=function(e,t,n){var o=e.quotes?e.quotes.split(/\s+/):["'\"'","'\"'"],i=2*n;return i>=o.length&&(i=o.length-2),t||++i,o[i].replace(/^["']|["']$/g,"")},d=function(e,t,n){for(var o=e.length,A="",a=0;a<o;a++)a>0&&(A+=t||""),A+=(0,i.createCounterText)(e[a],(0,r.parseListStyleType)(n||"decimal"),!1);return A}}])},"object"===A(t)&&"object"===A(e)?e.exports=r():(o=[],void 0!==(i="function"==typeof(n=r)?n.apply(t,o):n)&&(e.exports=i))}).call(t,n(5)(e))},function(e,t,n){"use strict";e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){e.exports=o}])})),function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define("dashboard-core/js/lib/@waca/echo-cache/dist/js/bundles/echo-cache.min",[],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}("undefined"!=typeof self?self:this,(function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/bundles",n(n.s=0)}([function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.EchoCacheService=void 0;var o,i=n(1),r=(o=i)&&o.__esModule?o:{default:o};t.EchoCacheService=r.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(t){var n=t.logger,o=t.ajaxSvc;if(_classCallCheck(this,e),this.logger=n,!o)throw new Error("Invalid ajax service provided");this.ajaxSvc=o}return _createClass(e,[{key:"stash",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.cacheId,o=t.ttl,i=t.contentType,r=void 0===i?"text/plain":i,A="v1/echo",a=void 0;return n?(A=A+"/"+n,a="PUT"):a="POST",o&&(A=A+"?ttl="+o),this.ajaxSvc.ajax({type:a,url:A,contentType:r,data:e}).then((function(e){var t=e.jqXHR.getResponseHeader("location"),n=e.jqXHR.getResponseHeader("X-CA-Affinity");return{id:t.match(/\/bi\/v1\/echo\/(.*)/)[1],location:t,affinity:n}}))}},{key:"retrieve",value:function(e,t){if(!e)throw new Error("Invalid cacheId argument provided");var n={type:"GET",url:"v1/echo/"+e,contentType:"text/plain",headers:{}};return t&&(n.headers["X-CA-Affinity"]=t),this.ajaxSvc.ajax(n).then((function(e){return{text:e.jqXHR.responseText}}))}}]),e}();t.default=o}])})),define("dashboard-core/js/dashboard/services/thumbnail/ThumbnailService",["../../../lib/@waca/core-client/js/core-client/ui/core/Class","../../../app/nls/StringResources","./ThumbnailStore","../../../lib/@waca/core-client/js/core-client/utils/UniqueId","../../../lib/@waca/image-capture/dist/js/bundles/image-capture.min","../../../lib/@waca/echo-cache/dist/js/bundles/echo-cache.min","../../../lib/@waca/core-client/js/core-client/utils/ClassFactory","underscore","jquery"],(function(e,t,n,o,i,r,A,a,s){var l=["id","clip-path"],c=i.default,d=r.EchoCacheService,u=e.extend({_store:null,echoCacheService:null,init:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u.inherited("init",this,arguments),this._pendingRequests={fetch:{}},this.readyPromise=this.initialize(e)},_isValidPendingRequestType:function(e){return!!this._pendingRequests[e]},setPendingRequest:function(e,t){if(!e)throw new Error("Invalid options argument provided");var n=e.type,o=e.cacheId;if(!o)throw new Error("Invalid cacheId option provided");if(!this._isValidPendingRequestType(n))throw new Error("Invalid type: "+n);this._pendingRequests[n][o]=t},getPendingRequest:function(e){if(!e)throw new Error("Invalid options argument provided");var t=e.type,n=e.cacheId;if(!n)throw new Error("Invalid cacheId option provided");if(!this._isValidPendingRequestType(t))throw new Error("Invalid type: "+t);return this._pendingRequests[t][n]},initialize:function(e){var t=e.glassContext,o=e.store,i=void 0===o?{}:o,r=e.elementMap,A=e.echoCacheSvc;return this.glassContext=t,this._store=new n(i),this.echoCacheService=A||new d({logger:t.getCoreSvc(".Logger"),ajaxSvc:t.getCoreSvc(".Ajax")}),this._thumbnailGenerator=null,this._elements={map:{},paths:r},this.initializeThumbnailGenerator()},initializeThumbnailGenerator:function(){var e=this,t=void 0;if(this._elements.paths){var n=Object.keys(this._elements.paths);t=Promise.all(n.map((function(t){return"text!"+e._elements.paths[t]})).map((function(e){return A.loadModule(e)}))).then((function(t){t.forEach((function(t,o){var i=n[o];i&&(e._elements.map[i]=t)}))})).catch((function(t){e.glassContext.getCoreSvc(".Logger").error("ThumbnailService.readyPromise:error",t)}))}else t=Promise.resolve();return t.then((function(){e._thumbnailGenerator=new c({UniqueId:o,elementMap:e._elements.map})}))},destroy:function(){this._thumbnailGenerator&&this._thumbnailGenerator.destroy(),this._elements=null,this._store=null},sync:function(e,t){var n=this,o=void 0;if(t){var i=function(t,o){return n.update(t,o).then((function(e){var t=e.cacheId,o=e.affinity;return n.fetch(t,o)})).then((function(t){var o=t.data,i=t.cacheId;n._setCacheIdInWidgetAndStore(e,i,o)}),(function(){n._setCacheIdInWidgetAndStore(e,null,null)}))};o=this.fetch(e.thumbnailId,void 0,{silent:!0}).then((function(o){var r=o.data;if(n._needsUpdate(r,t))return i(e.thumbnailId,t);var A=n._store.getLocal(e.id);return n._needsUpdate(A,t)&&n._setCacheIdInWidgetAndStore(e,e.thumbnailId,t),{data:t}})).catch((function(){return i(e.thumbnailId,t)}))}else this._setCacheIdInWidgetAndStore(e,null);return o||Promise.resolve()},_setCacheIdInWidgetAndStore:function(e,t,n){var o=e.id;e.set({thumbnailId:t},{payloadData:{runtimeOnly:!0}}),t?this._store.set(o,{data:n,cacheId:t}):this._store.delete(o)},setError:function(e,t){this._store.setError(e,t)},setWarning:function(e,t){this._store.setWarning(e,t)},_needsUpdate:function(e,t){return this._stripUniqueAttributes(e)!==this._stripUniqueAttributes(t)||this._getImgSrc(e)!==this._getImgSrc(t)},_getImgSrc:function(e){var t=s(e).find("img");return t?t.attr("src"):null},_stripUniqueAttributes:function(e){var t=s(e);return l.forEach((function(e){t.find("["+e+"]").attr(e,"")})),t.html()},getStoreAPI:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{defaultFn:function(){}},t=e.defaultFn;return a.extend({},this._store,{getVisTypeDefault:t})},get:function(e,t,n){var o=this;n||(n=this._store);var i=e.id,r=void 0;if(n.exists(i))r=Promise.resolve(n.getLocal(i));else{var A=e.thumbnailId;r=A?this.fetch(A,void 0,{silent:!0}).then((function(e){var t=e.data,r=e.cacheId;return o._store.set(i,{data:t,cacheId:r}),n.getLocal(i)})).catch((function(){})):Promise.resolve()}return r.then((function(){return n.get(i,t)}))},fetch:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return Promise.reject(new Error("Invalid cacheId argument provided: "+e));var i=this.getPendingRequest({type:"fetch",cacheId:e});if(i){var r=!!i.then;return r?i:Promise.reject(i)}var A=this.echoCacheService.retrieve(e,t).then((function(t){n.setPendingRequest({type:"fetch",cacheId:e},void 0);var o=t.text;return n.glassContext.getCoreSvc(".Logger").debug("ThumbnailService.fetch:response",t),{cacheId:e,data:o}})).catch((function(t){var i=n._ajaxErrorHandler(t,"ThumbnailService.fetch:error",o);return n.setPendingRequest({type:"fetch",cacheId:e},i),Promise.reject(i)}));return this.setPendingRequest({type:"fetch",cacheId:e},A),A},update:function(e,t,n){var o=this;return this.echoCacheService.stash(t,{cacheId:e}).then((function(e){var t=e.id,n=e.location,i=e.affinity;return o.setPendingRequest({type:"fetch",cacheId:t},void 0),{cacheId:t,location:n,affinity:i}})).catch((function(e){return Promise.reject(o._ajaxErrorHandler(e,"ThumbnailService.update:error",n))}))},_ajaxErrorHandler:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ThumbnailService:error",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{silent:!1},i=o.silent,r=this._parseError(e,t.get("thumbnails_error_fetching")),A=new Error(r);return i||this.glassContext.getCoreSvc(".Logger").error(n,A),A},_parseError:function(e,t){var n=t;try{if(e.responseText)n=JSON.parse(e.responseText).error}catch(e){}return n},_prepareThumbnail:function(e){return JSON.stringify({data:e})},generateImage:function(e,t,n){return t=a.extend(t||{},{onClone:function(e,t){var n=s(t).find(".staticContent");n.length&&n.css({"background-color":"transparent"})},excludeEmptyIframes:!0,transparentBackground:!1}),this._thumbnailGenerator.generateImage(e,t,n)},generateMarkup:function(e,t,n){return this.generateImage(e,t,n).then((function(e){return'<div class="visThumbnail"><div class="visThumbnailImgContainer"><img src="'+e+'" /></div></div>'}))},delete:function(e){return this._store.delete(e)}});return u})),define("text!dashboard-core/js/common/templates/TranslationOverlayTemplate.html",[],(function(){return'<div class="translate-overlay">\n\t<span class="translate-text">\n\t\t{{= it.text}}\n\t</span>\n\t<button type="button" class="translate-button">{{= it.buttonText}}</button>\n</div>\n'})),define("dashboard-core/js/dashboard/services/TranslationService",["jquery","underscore","../../app/nls/StringResources","doT","text!../../common/templates/TranslationOverlayTemplate.html","../../app/ui/dialogs/ConfirmationDialog","../util/ButtonHideHelper","../../lib/@waca/core-client/js/core-client/utils/Utils"],(function(e,t,n,o,i,r,A,a){"use strict";return function(){function s(e){_classCallCheck(this,s),t.extend(this,e),this.blacklistCSVAttributes=["titleHtml"],this.propsStoredAsHTML=["content"],this.localizedItems={},this.dashboardApi.getFeature("Properties").registerProvider(this),this._icons=this.dashboardApi.getFeature("Icons"),this.registeredHandlers=[]}return s.prototype.registerView=function(e){this.localizedItems[e.model.id]=e,this.isInTranslationMode()&&this._startModelTranslationMode(e.model,e.view,this._getTranslationModeLocale())},s.prototype.deregisterView=function(e){this.isInTranslationMode()&&this._endModelTranslationMode(this.localizedItems[e].model,this.localizedItems[e].view,!0),delete this.localizedItems[e]},s.prototype.initialize=function(e){var t=this;return this.$el=e.view,this.boardModel=e.boardModel,this.defaultLocale=e.boardModel.properties.defaultLocale,e.boardModel.properties.on("change:translationModeLocale",this._onChangeTranslationMode,this),e.boardModel.properties.on("change:defaultLocale",this._onChangeDefaultLocale,this),e.boardModel.properties.on("change:switchLanguageInfo",this._onChangeToLocale,this),this._contentLocalesPromise=this.dashboardApi.getFeature("UserProfile").getAvailableContentLocales().then((function(e){t._contentLocales=e})),this._contentLocalesPromise},s.prototype.getLanguageRadioItems=function(){var e=[],n=this.getSelectedLanguages();return"Default"===this.getDefaultLanguage()&&(n=[]),t.each(this._contentLocales,(function(t,o){-1===n.indexOf(o)&&e.push({value:o,label:t})})),e},s.prototype.getContentLocales=function(){return this._contentLocales},s.prototype.getLanguageName=function(e){return this._contentLocales[e]},s.prototype._onChangeTranslationMode=function(){var e=this._getTranslationModeLocale();e?this._startTranslationMode(e):this._endTranslationMode()},s.prototype._getTranslationModeLocale=function(){return this.boardModel.properties.get("translationModeLocale")},s.prototype.isInTranslationMode=function(){return this.translationModeOn},s.prototype.startTranslationMode=function(e){this.boardModel.setTranslationLocale(e)},s.prototype.endTranslationMode=function(){this.boardModel.setTranslationLocale(null)},s.prototype._startTranslationMode=function(e){var t=o.template(i)({text:n.get("multilingualDashboardTranslationMode",{currentLanguage:this.getLanguageName(e)}),buttonText:n.get("multilingualDashboardTranslationDone")});for(var r in this.$el.append(t),this.$el.find(".translate-button").click(this.endTranslationMode.bind(this)),this.translationModeOn=!0,this.translationModeLanguage=e,this.eventRouter.trigger("properties:refreshPane"),A.changeMode(this.glassContext,"translation"),this.numTranslationsLeft=0,this.showingMissingTranslationCount=!1,this.localizedItems){var a=this.localizedItems[r],s=a.model,l=a.view;this._startModelTranslationMode(s,l,e)}},s.prototype._startModelTranslationMode=function(e,t,n){var o=this,i=e.getMultilingualAttributes(),r=[],A=this.localizedItems[e.id];A.enterTranslationMode&&A.enterTranslationMode(),i.forEach((function(t){var i=t.propertyName,A=t.propertyParentModel,a=t.multilingualProperty;if(a.startTranslation(n),o.dashboardApi&&A.multilingual){o.dashboardApi.getCanvas().getContent(e.id).on("change:property:"+t.propertyParentModel.name,o._onPropertyChange.bind(o,e.id,e,t.propertyParentModel.name))}else{var s=A.on("change:"+i,o._onPropertyChange.bind(o,e.id,A,i));o.registeredHandlers.push(s)}0!==Object.keys(a.translationTable).length&&(a.needsTranslation()?r.push(t):o._updateView(A,i,o.localizedItems[e.id]))})),r.length>0&&this._appendTranslationIcon(t,r)},s.prototype._onPropertyChange=function(e,t,n){var o=t.getMultilingualAttribute(n);if(o){var i=o.multilingualProperty,r=this.localizedItems[e].view;i.needsTranslation()?this._appendTranslationIcon(r,[o]):this._removeTranslationIcon(r,[o])}},s.prototype._endTranslationMode=function(){for(var e in this.$el.find("div.translate-overlay").remove(),this.translationModeOn=!1,this.showingMissingTranslationCount=!1,this.localizedItems){var t=this.localizedItems[e];this._endModelTranslationMode(t.model,t.view,!1)}this.eventRouter.trigger("properties:refreshPane",{focusSelector:".clickablelanguage_"+this.translationModeLanguage}),A.changeMode(this.glassContext,"authoring")},s.prototype._endModelTranslationMode=function(e,t,n){var o=this,i=this.localizedItems[e.id];i.leaveTranslationMode&&i.leaveTranslationMode(),this.registeredHandlers.forEach((function(e){e.remove()})),this.registeredHandlers=[];var r=e.getMultilingualAttributes();r.forEach((function(t){var i=t.propertyName,r=t.propertyParentModel;(t.multilingualProperty.stopTranslation(),n||o._updateView(r,i,o.localizedItems[e.id]),o.dashboardApi&&r.multilingual)&&o.dashboardApi.getCanvas().getContent(e.id).off("change:property:"+t.propertyParentModel.name,o._onPropertyChange.bind(o,e.id,e,t.propertyParentModel.name))})),this._removeTranslationIcon(t,r)},s.prototype._updateView=function(e,t,n){n.reRender?n.reRender():this._triggerTextUpdate(e,t)},s.prototype._triggerTextUpdate=function(e,t){var n={};n[t]=e.get(t),e.set(n,{payloadData:{forceEvent:!0,skipUndoRedo:!0},sender:"TranslationService"})},s.prototype._appendTranslationIcon=function(e,t){this.isInTranslationMode()&&(e.addTranslationIcon?this.numTranslationsLeft+=e.addTranslationIcon(t):(this.appendTranslationIcon(e.$el),this.numTranslationsLeft++),this._displayRemainingMessage())},s.prototype.appendTranslationIcon=function(t){if(this.isInTranslationMode()){var o=e('<div class="translateIcon"></div>');a.setIcon(o,this._icons.getIcon("warning").id,n.get("multilingualDashboardIconTranslatableArea")),t.append(o)}},s.prototype.updateRemainingCount=function(e){0!==e&&(this.showingMissingTranslationCount=!0),this.numTranslationsLeft+=e,this._displayRemainingMessage()},s.prototype._removeTranslationIcon=function(e,t){var n=e.$el;if(e.removeTranslationIcon){var o=e.removeTranslationIcon(t);o&&this.updateRemainingCount(-o)}else this.hasTranslationIcon(n)&&(this.updateRemainingCount(-1),this.removeTranslationIcon(n))},s.prototype.hasTranslationIcon=function(e){return e.find(".translateIcon").length>0},s.prototype.removeTranslationIcon=function(e){e.find(".translateIcon").remove()},s.prototype._displayRemainingMessage=function(){var e;this.numTranslationsLeft>=0&&this.showingMissingTranslationCount&&(e=1===this.numTranslationsLeft?n.get("multilingualDashboardRemainingString"):n.get("multilingualDashboardRemainingStrings",{numTranslationsLeft:this.numTranslationsLeft}),this.$el.find(".translate-text").text(e))},s.prototype.downloadTranslations=function(e){var t=this._getLocalizedStrings(e),n="OriginalStrings_"+e;this.dashboardApi.getFeature("CsvExport").export(n,[t])},s.prototype.removeTranslations=function(e){var o=this,i=this.getContentLocales()[e];new r("warning",n.get("multilingualDeleteTitle"),n.get("multilingualDeleteLanguageWarning",{language:i})).confirm((function(){var n=t.uniqueId("removeTranslations");for(var i in o.localizedItems){o.localizedItems[i].model.getMultilingualAttributes().forEach((function(t){var o=t.propertyName,i=t.propertyParentModel,r={};r[o]={value:null,locale:e},i.set(r,{sender:"TranslationService",payloadData:{undoRedoTransactionId:n}})})),o._onMultilingualPropertyChange(i)}o.eventRouter.trigger("properties:refreshPane",{focusSelector:".r_addLanguage-1"})}),(function(){}))},s.prototype.changeDefaultLanguage=function(e){this.boardModel.properties.set({defaultLocale:e})},s.prototype.processMultilingualProperty=function(e,t){if(t){e.editor.uiControl.appendTranslationIcon=function(e){t.needsTranslation()&&this.appendTranslationIcon(e)}.bind(this)}return e},s.prototype._onMultilingualPropertyChange=function(e){var t=this.localizedItems[e];t&&t.onMultilingualPropertyChange&&t.onMultilingualPropertyChange()},s.prototype._onChangeDefaultLocale=function(){var e=this,t=this.getDefaultLanguage();this.boardModel.setDefaultLocale(t);var n=function(n){e.localizedItems[n].model.getMultilingualAttributes().forEach((function(o){var i=o.propertyName,r=o.propertyParentModel;o.multilingualProperty.setDefaultLocale(t),e._updateView(r,i,e.localizedItems[n])})),e._onMultilingualPropertyChange(n)};for(var o in this.localizedItems)n(o);this.eventRouter.trigger("properties:refreshPane",{focusSelector:".clickablelanguage_"+t})},s.prototype._onChangeToLocale=function(){var e=this,t=this.boardModel.properties.get("switchLanguageInfo"),n=function(n){e.localizedItems[n].model.getMultilingualAttributes().forEach((function(o){var i=o.propertyName,r=o.propertyParentModel;o.multilingualProperty.switchLocale(t),e._updateView(r,i,e.localizedItems[n])})),e._onMultilingualPropertyChange(n)};for(var o in this.localizedItems)n(o);this.eventRouter.trigger("properties:refreshPane",{focusSelector:".clickablelanguage_"+t.to})},s.prototype.switchLanguage=function(e){e.from===this.getDefaultLanguage()?this.changeDefaultLanguage(e.to):(this.boardModel.properties.set({switchLanguageInfo:{from:e.to,to:e.from}},{silent:!0,payloadData:{skipUndoRedo:!0}}),this.boardModel.properties.set({switchLanguageInfo:e}))},s.prototype.getDefaultLanguage=function(){return this.boardModel.get("properties").get("defaultLocale")},s.prototype._getLocalizedStrings=function(t){var n=this,o=[];for(var i in this.localizedItems){this.localizedItems[i].model.getMultilingualAttributes().forEach((function(i){var r=i.propertyName,A=i.multilingualProperty;if(-1===n.blacklistCSVAttributes.indexOf(r)){var a=A.getValue(t);if(a){if(-1!==n.propsStoredAsHTML.indexOf(r)){var s=void 0;try{s=e(a)}catch(e){s=[]}finally{s.length&&(a=s.text())}}a=a.trim(),o.push(a)}}}))}return o},s.prototype._addTo=function(e,n){return t.union(e,Object.keys(n))},s.prototype.getSelectedLanguages=function(){var e=[];for(var n in this.localizedItems){this.localizedItems[n].model.getMultilingualAttributes().forEach((function(t){var n=t.multilingualProperty;e=e.concat(n.getLanguages())}))}return t.uniq(e)},s.prototype.destroy=function(){this.dashboardApi&&this.dashboardApi.getFeature("Properties").deregisterProvider(this),this.localizedItems=null,this._contentLocales=null},s.prototype.getPropertyLayoutList=function(){return[{id:"advanced",type:"Section",label:n.get("sectionName_advanced"),position:99},{id:"languages",type:"Section",label:n.get("multilingualDashboardsLabel"),collapsible:!1,style:"light"}]},s.prototype.getPropertyList=function(){var e=this.dashboardApi.getFeature("propertiesManager");return e?"Default"===this.getDefaultLanguage()?this.getContentLocales()?this._getLanguageSpecWhenNoLocaleSet(e):[]:this._getMultilingualProperties(e):[]},s.prototype._getLanguageSpecWhenNoLocaleSet=function(e){var t=this,o=this.getDefaultLanguage();return[{id:"language_"+o,editor:{sectionId:"general.advanced",position:3,uiControl:{type:"SingleLineLinks",items:[{align:"left",items:[{type:"text",id:"text"+o,value:n.get("multilingualDashboardsLabel")}]},{align:"right",items:[{type:"text",value:n.get("multilingualDashboardsSetDefault"),clickCallback:function(){t.launchLanguageSelectSlideout(o,!1,e)}}]}]}}}]},s.prototype._getMultilingualProperties=function(e){var t=this,o=this.getDefaultLanguage(),i=[].concat(this._createLanguageRow(o,!0));return this.getSelectedLanguages().sort((function(e,n){return t.getLanguageName(e)>t.getLanguageName(n)?1:-1})).forEach((function(e){e!==o&&"Default"!==e&&i.push(t._createLanguageRow(e,!1))})),i.push({id:"addLanguage",editor:{sectionId:"general.advanced.languages",uiControl:{type:"SingleLineLinks",isDisabled:this.translationModeOn,items:[{align:"right",items:[{type:"text",value:n.get("multilingualDashboardsAddLinkText"),clickCallback:function(){t.launchLanguageSelectSlideout(null,!0,e)}}]}]}}}),i},s.prototype._createLanguageRow=function(e,t){var o=this,i=this.getLanguageName(e);return{id:"language_"+e,editor:{sectionId:"general.advanced.languages",uiControl:{type:"SingleLineLinks",indent:2,disabled:this.translationModeOn,items:[{align:"left",items:[]},{align:"right",items:[{type:"text",id:"text"+e,value:t?n.get("multilingualDashboardsDefault",{defaultLanguage:i}):i},{type:"icon",svgIcon:"common-menuoverflow",iconTooltip:n.get("multilingualDashboardIconMore",{currentLanguage:i}),clickCallback:function(t){o.launchLanguageMenu(t,e)}}]}]}}}},s.prototype.launchLanguageSelectSlideout=function(e,t,o){var i=this;(o=o||this.dashboardApi.getFeature("propertiesManager")).addChild({overlay:!0,label:n.get("multilingualSelectLanguage"),content:{module:"dashboard-core/js/dashboard/contentpane/PropertyUIControlView",items:[{value:n.get("multilingualSelectLanguage"),centerLabel:!0,type:"Banner",backButton:!0,ariaLabel:n.get("multilingualSelectLanguage")},{type:"RadioButtonGroup",name:"language",separator:!0,ariaLabel:n.get("multilingualSelectLanguage"),value:e,selectOnNavigation:!1,items:this.getLanguageRadioItems(),onChange:function(n,r){o.closeChild(),"Default"===e?i.changeDefaultLanguage(r):t?i.startTranslationMode(r):i.switchLanguage({from:e,to:r})}}]}})},s.prototype.launchLanguageMenu=function(t,n){var o={};void 0===t.pageX||t.gesture&&(void 0===t.gesture.center||void 0===t.gesture.center.pageX)?o=e(t.target).offset():(o.left=t.pageX||t.gesture.center.pageX,o.top=t.pageY||t.gesture.center.pageY),this.glassContext.appController.showContextMenu({position:{pageX:o.left,pageY:o.top},menuId:"com.ibm.bi.dashboard.languageMenu",activeObject:{selectedLocale:n,translationService:this,layoutBaseView:this}})},s}()})),define("text!dashboard-core/js/dashboard/util/templates/DashboardColorSet.html",[],(function(){return"{{~ it.colors : color }}\n\t.fill-{{=color.name}} {\n\t\tbackground-color: {{=color.hexValue}} !important;\n\t}\n\t.border-{{=color.name}} {\n\t\tborder-color: {{=color.hexValue}} !important;\n\t}\n\n\t.fill-{{=color.name}} .widgetContent .fillColorBackground {\n\t\tbackground-color: {{=color.hexValue}} !important;\n\t}\n\n\t.fill-{{=color.name}} .fill-transparent.widget .widgetContent .userPrimaryFGPaletteColor *,\n\t.fill-{{=color.name}} .fill-transparent.widget .widgetContent .userPrimaryGridFGPaletteColor *:not(.edge):not(.summary):not(.implied_selection):not(.selected),\n\t.fill-{{=color.name}}.widget .widgetContent .userPrimaryFGPaletteColor *,\n\t.fill-{{=color.name}}.widget .widgetContent .userPrimaryGridFGPaletteColor *:not(.edge):not(.summary):not(.implied_selection):not(.selected) {\n\t\tcolor: {{=it.foregroundColors[color.name]}};\n\t}\n\n\t.fill-{{=color.name}} .fill-transparent.widget .widgetContent .kpi-widget-value .labeled-value-label, .fill-{{=color.name}}.widget .widgetContent .kpi-widget-value .labeled-value-label {\n\t\tcolor: {{=it.kpiLabelColors[color.name]}};\n\t}\n\n\t.fill-{{=color.name}} .fill-transparent.widget .widgetContent .kpi-widget-value .labeled-value-value, .fill-{{=color.name}}.widget .widgetContent .kpi-widget-value .labeled-value-value {\n\t\tcolor: {{=it.kpiValueColors[color.name]}};\n\t}\n\n\t.fill-{{=color.name}} .fill-transparent.widget .widgetContent .kpi-widget .kpi-widget-sparkline.defaultColors svg .line, .fill-{{=color.name}}.widget .widgetContent .kpi-widget .kpi-widget-sparkline.defaultColors svg .line {\n\t\tstroke: {{=it.kpiValueColors[color.name]}} !important;\n\t}\n\n\t.fill-{{=color.name}} .fill-transparent.widget .widgetContent .infographic-widget .infographic-content.colorFill svg, .fill-{{=color.name}}.widget .widgetContent .infographic-widget .infographic-content.colorFill svg {\n\t\tfill: {{=it.kpiValueColors[color.name]}};\n\t}\n\n\t.fill-{{=color.name}} .fill-transparent.widget .widgetContent .infographic-widget .infographic-content.colorStroke svg, .fill-{{=color.name}}.widget .widgetContent .infographic-widget .infographic-content.colorStroke svg {\n\t\tstroke: {{=it.kpiValueColors[color.name]}};\n\t}\n\n\t.fill-{{=color.name}}.widget .widgetContent .dataplayer-view.userPrimaryFGPaletteColor .sliderTickForHorizontal .tick{\n\t\tbackground-color: {{=it.dataPlayerColors[color.name]}};\n\t}\n\n\t.fill-{{=color.name}}.widget .widgetContent .dataplayer-view.userPrimaryFGPaletteColor .sliderLabel{\n\t\tcolor: {{=it.dataPlayerColors[color.name]}};\n\t}\n\n\t.fill-{{=color.name}}.widget .widgetContent .dataplayer-view.userPrimaryFGPaletteColor .sliderNode{\n\t\tfill: {{=it.dataPlayerColors[color.name]}};\n\t}\n\n\t.fill-{{=color.name}}.widget .widgetContent .dataplayer-view.userPrimaryFGPaletteColor .sliderBarHorizontal{\n\t\tbackground-color: {{=it.dataPlayerColors[color.name]}};\n\t}\n\n\t.fill-{{=color.name}}.widget .widgetContent .dataplayer-view.userPrimaryFGPaletteColor .playOrPause *{\n\t\tfill: {{=it.dataPlayerColors[color.name]}};\n\t}\n\n\t.fill-{{=color.name}} .relativeLayoutGrid{\n\t\tstroke: {{=it.gridColors[color.name]}} !important;\n\t}\n\n\t.fill-{{=color.name}} .absoluteLayoutGrid{\n\t\tbackground-image: repeating-linear-gradient(0deg, {{=it.gridColors[color.name]}}, {{=it.gridColors[color.name]}} 1px, transparent 1px, transparent 100%),repeating-linear-gradient(-90deg, {{=it.gridColors[color.name]}}, {{=it.gridColors[color.name]}} 1px, transparent 1px, transparent 100%) !important;\n\t}\n{{~}}\n"})),define("dashboard-core/js/dashboard/util/DashboardColorSet",["underscore","doT","text!./templates/DashboardColorSet.html","./ColorUtils"],(function(e,t,n,o){var i=function(){function t(){_classCallCheck(this,t)}return t.getColorStyles=function(n,i){return n.getForegroundCSSColors("ForegroundUserPaletteColor",i).then((function(r){var A=n.getColorSet(i),a=[],s=[],l=e.clone(r,!0),c=e.clone(r,!0);return l.color1="rgba(52, 51, 52, 1)",c.color1="rgba(89, 88, 89, 1)","#FFFFFF"===n.getValueForPropertyOfUIElement("board","backgroundColor")&&(l.transparent="rgba(52, 51, 52, 1)",c.transparent="rgba(89, 88, 89, 1)"),A.forEach((function(e){var t=e.hexValue;"transparent"===e.name&&(t=n.getValueForPropertyOfUIElement("board","backgroundColor")),a[e.name]=o.invertColor(t,120,100,!0),s[e.name]=o.invertColor(t,120,100,!1)})),t.dotTemplate({colors:A,foregroundColors:r,kpiValueColors:l,kpiLabelColors:c,gridColors:a,dataPlayerColors:s})}))},t}();return i.dotTemplate=t.template(n),i})),define("text!dashboard-core/js/dashboard/widgets/staticwidget/colorSets/templates/TextWidgetColorSet.html",[],(function(){return"{{~ it.colors : color }}\n\t.fill-{{=color.name}}.widget .infographicLegendText,\n\t.fill-{{=color.name}} .widget:not([class*=\"fill-color\"]) .infographicLegendText {\n\t\tcolor: {{=it.foregroundColors[color.name]}} !important;\n\t}\n\n\t.fill-{{=color.name}}.widget .infographicLegendShape,\n\t.fill-{{=color.name}} .widget:not([class*=\"fill-color\"]) .infographicLegendShape {\n\t\tfill: {{=it.foregroundColors[color.name]}};\n\t}\n\n\t.fill-{{=color.name}}.widget .infographicLegendLine,\n\t.fill-{{=color.name}} .widget:not([class*=\"fill-color\"]) .infographicLegendLine {\n\t\tstroke: {{=it.foregroundColors[color.name]}};\n\t}\n\n\t.note-editable .{{=color.name}} {\n\t\tcolor: {{=color.hexValue}} !important;\n\t}\n\n\t.fill-{{=color.name}}.widget .widgetTitle .responsiveColor,\n\t.fill-{{=color.name}} .widget:not([class*=\"fill-color\"]) .widgetTitle .responsiveColor {\n\t\tcolor: {{=it.foregroundTextWidgetColor1[color.name]}} !important;\n\t}\n\n\n\t{{~ ['titleColor', 'titleSmallColor', 'responsiveColor', 'titleText', 'titleSmallText', 'responsiveText'] : className }}\n\t\t.fill-{{=color.name}}.staticContent .{{=className}} {\n\t\t\tcolor: {{=it.foregroundTextWidgetColor1[color.name]}} {{? color.name !== 'transparent'}}!important{{?}};\n\t\t}\n\t\t.fill-{{=color.name}} .staticContent:not([class*=\"fill-color\"]) .{{=className}} {\n\t\t\tcolor: {{=it.foregroundTextWidgetColor1[color.name]}};\n\t\t}\n\t{{~}}\n\n\t{{~ ['subtitleColor', 'bodyColor', 'bodySmallColor'] : className }}\n\t\t.fill-{{=color.name}}.staticContent .{{=className}} {\n\t\t\tcolor: {{=it.foregroundTextWidgetColor2[color.name]}} !important;\t\t\t\n\t\t}\n\t\t.fill-{{=color.name}} .staticContent:not([class*=\"fill-color\"]) .{{=className}} {\n\t\t\tcolor: {{=it.foregroundTextWidgetColor2[color.name]}};\n\t\t}\n\t{{~}}\n\t\n\t{{~ ['captionColor', 'captionText'] : className }}\n\t\t.fill-{{=color.name}}.staticContent .{{=className}} {\n\t\t\tcolor: {{=it.foregroundTextWidgetColor3[color.name]}} !important;\t\t\t\n\t\t}\n\t\t.fill-{{=color.name}} .staticContent:not([class*=\"fill-color\"]) .{{=className}} {\n\t\t\tcolor: {{=it.foregroundTextWidgetColor3[color.name]}};\n\t\t}\n\t{{~}}\n\n\t{{~ ['quoteColor', 'quoteSmallColor', 'quoteText','quoteSmallText'] : className }}\n\t\t.fill-{{=color.name}}.staticContent .{{=className}} {\n\t\t\tcolor: {{=it.foregroundTextWidgetColor4[color.name]}} !important;\t\t\t\n\t\t}\n\t\t.fill-{{=color.name}} .staticContent:not([class*=\"fill-color\"]) .{{=className}} {\n\t\t\tcolor: {{=it.foregroundTextWidgetColor4[color.name]}};\n\t\t}\n\t{{~}}\n{{~}}"})),define("dashboard-core/js/dashboard/widgets/staticwidget/colorSets/TextWidgetColorSet",["doT","text!./templates/TextWidgetColorSet.html"],(function(e,t){var n=function(){function e(){_classCallCheck(this,e)}return e.getColorStyles=function(t,n){return Promise.all([t.getForegroundCSSColors("ForegroundUserPaletteColor",n),t.getForegroundCSSColors("TextWidgetColor1UserPaletteColor",n),t.getForegroundCSSColors("TextWidgetColor2UserPaletteColor",n),t.getForegroundCSSColors("TextWidgetColor3UserPaletteColor",n),t.getForegroundCSSColors("TextWidgetColor4UserPaletteColor",n)]).then((function(o){var i=o[0],r=o[1],A=o[2],a=o[3],s=o[4];return e.dotTemplate({colors:t.getColorSet(n),foregroundColors:i,foregroundTextWidgetColor1:r,foregroundTextWidgetColor2:A,foregroundTextWidgetColor3:a,foregroundTextWidgetColor4:s})}))},e}();return n.dotTemplate=e.template(t),n})),define("text!dashboard-core/js/dashboard/widgets/staticwidget/colorSets/templates/ShapeWidgetColorSet.html",[],(function(){return"{{~ it.colors : color }}\n\t.shapeWidget .fill-{{=color.name}} {\n\t\tfill: {{=color.hexValue}} !important;\n\t\tbackground-color: transparent !important;\n\t}\n\t.shapeWidget .border-{{=color.name}} {\n\t\tstroke: {{=color.hexValue}} !important;\n\t\tcolor: {{=color.hexValue}} !important;\n\t}\n{{~}}"})),define("dashboard-core/js/dashboard/widgets/staticwidget/colorSets/ShapeWidgetColorSet",["doT","text!./templates/ShapeWidgetColorSet.html"],(function(e,t){var n=function(){function e(){_classCallCheck(this,e)}return e.getColorStyles=function(t,n){return Promise.resolve(e.dotTemplate({colors:t.getColorSet(n)}))},e}();return n.dotTemplate=e.template(t),n})),define("text!dashboard-core/js/dashboard/layout/views/templates/TabColorSet.html",[],(function(){return"{{~ it.colors : color }}\n\n\t.fill-{{=color.name}}.pagetab .tabCntr .ba-common-tabList .addNewIcon {\n\t\tfill: {{=it.actionButtonColors[color.name]}};\n\t}\n\n\t.fill-{{=color.name}}.pagetab .tabCntr .ba-common-tabList .chevron-icon {\n\t\tfill: {{=it.actionButtonColors[color.name]}};\n\t}\n\n\t.fill-{{=color.name}}.pagetab .tabCntr .ba-common-tabList .addNewIcon:hover {\n\t\tfill: {{=it.plusHoverColors[color.name]}} !important;\n\t}\n\n\t.fill-{{=color.name}}.pagetab .tabCntr .ba-common-tabList {\n\t\tborder-color: {{=it.tabDividerColor[color.name]}} !important;\n\t}\n\n\t{{? color.name === 'transparent'}}\n\t\t.pagetab .tabCntr .ba-common-tabList .addNewIcon {\n\t\t\tfill: {{=it.actionButtonColors[color.name]}};\n\t\t}\n\n\t\t.pagetab .tabCntr .ba-common-tabList .chevron-icon {\n\t\t\tfill: {{=it.actionButtonColors[color.name]}};\n\t\t}\n\n\t\t.pagetab .tabCntr .ba-common-tabList .addNewIcon:hover {\n\t\t\tfill: {{=it.plusHoverColors[color.name]}} !important;\n\t\t}\n\n\t\t.pagetab .tabCntr .ba-common-tabList {\n\t\t\tborder-color: {{=it.tabDividerColor[color.name]}} !important;\n\t\t}\n\t{{?}}\n{{~}}\n"})),define("dashboard-core/js/dashboard/layout/views/TabColorSet",["doT","text!./templates/TabColorSet.html","../../util/ColorUtils"],(function(e,t,n){var o=function(){function e(){_classCallCheck(this,e)}return e.getColorStyles=function(t,o){return Promise.all([t.getForegroundCSSColors("TabActionButtonColor",o),t.getForegroundCSSColors("TabDividerColor",o),t.getForegroundCSSColors("TabPlusHoverColor",o)]).then((function(i){var r=i[0],A=i[1],a=i[2],s=t.getColorSet(o),l="userPaletteColor"===t.getColorSetId();return s.forEach((function(e){var o=e.hexValue;"transparent"===e.name&&(o=t.getValueForPropertyOfUIElement("board","backgroundColor")),l&&!t.isCustomColor(e.name)||(a[e.name]=n.invertColor(o,90,100,!0),A[e.name]=n.invertColor(o,40,100,!0))})),e.dotTemplate({colors:s,actionButtonColors:r,plusHoverColors:a,tabDividerColor:A})}))},e}();return o.dotTemplate=e.template(t),o})),define("dashboard-core/js/dashboard/data/ThemeDefinition",["../../lib/@waca/core-client/js/core-client/ui/core/Class","../../app/nls/StringResources","underscore"],(function(e,t,n){var o=["UserPaletteColor","ForegroundUserPaletteColor","SecondaryForegroundUserPaletteColor","TabTextColor","TabSelectedLineColor"];return e.extend({init:function(e){this.themeMapping={},this.variableMapping={},this.jsonDefinition=e,this._palettes={},this._cssColors={},this._mapVariables(),this._fillColor=null},getId:function(){return this.jsonDefinition.id},_mapVariables:function(){if(this.jsonDefinition&&this.jsonDefinition.variables){var e=this.jsonDefinition.variables;for(var t in e)e.hasOwnProperty(t)&&(this.variableMapping[t]=this._getMapOfVariables(e[t]))}},_getMapOfVariables:function(e){var t={};return n.each(e,function(e){t[e.id]=e}.bind(this)),t},getValueForVariable:function(e,t){if(this.variableMapping[e]){if(!t)return this.variableMapping[e];if(this.variableMapping[e][t])return this.variableMapping[e][t].value}},_getValueForProperty:function(e){if(e&&void 0!==e.value&&null!==e.value)return isNaN(e.value)&&"$"===e.value.substr(0,1)?this.getValueForVariable(e.type,e.value.substr(1)):e.value},getDefaultPaletteName:function(e){var t=n.keys(this.variableMapping[e]);if(t&&t.length>0)return t[0]},getColorValue:function(e){return e.pattern?e.pattern:e.fill?e.fill:e.backgroundColor?e.backgroundColor:e},getCSSColors:function(e){var t=this;if(!this._cssColors[e]){var n=this.getVariable(e);if(!n)return{};this._cssColors[e]={},n.forEach((function(n){t._cssColors[e][n.id]=t._convertToCssColor(n.value)}))}return this._cssColors[e]},_convertToCssColor:function(e){var t=null;if(this._isColorValue(e)){var n=e.r+","+e.g+","+e.b;t=void 0!==e.a?"rgba("+n+","+e.a+")":"rgb("+n+")"}return t||e},_isColorValue:function(e){return e&&void 0!==e.r&&void 0!==e.g&&void 0!==e.b},getVariable:function(e){return this.jsonDefinition&&this.jsonDefinition.variables?this.jsonDefinition.variables[e]:null},getPalette:function(e,t,n){if("userPaletteColor"===e){var o=this._getUserPaletteColor();return this._createCMPaletteResponse(o,n)}var i=this.getVariable("UserPaletteColor"===t?"ColorPalette":t);if(!i)return{};for(var r=0;r<i.length;r++){var A=i[r];if(A.id===e)return this._createCMPaletteResponse(A,n,r)}},_getUserPaletteColor:function(){var e=this.getVariable("UserPaletteColor"),n={id:"userPaletteColor",fillType:"simple",label:t.get("userPaletteColor_"+this.jsonDefinition.id),labelTranslated:!0,ids:[],labels:[],fills:[]};return e.forEach((function(e){var t=e.value,o=e.id,i=e.label;n.fills.push(t),o&&n.ids.push(o),i&&n.labels.push(i)})),n},getPalettes:function(e,t){var o=this,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this.getVariable(e);if(!r)return[];var A=r.filter((function(e){return i||n.find(e.fills,(function(e){return!e.pattern}))})).map((function(e,n){return o._createCMPaletteResponse(e,t,n)}));return A},_createCMPaletteResponse:function(e,o,i){if(!e)return{};var r=n.find(e.fills,(function(e){return e.pattern})),A=e.labelTranslated?e.label:t.get(e.label,{number:i+1}),a=n.extend(e,{label:A,labelTranslated:!0,fillType:r?"ImgPath":e.fillType});return r&&(a.path="dashboard-core/images/patterns/",a.fileType=".svg"),o?{system:!0,id:e.id,content:a}:a},getValueForPropertyOfUIElement:function(e,t){var n=this.getPropertyForUIElement(e,t);return this._getValueForProperty(n)},getPropertyForUIElement:function(e,t){if(this.jsonDefinition&&this.jsonDefinition.uiElements[e]){var o=this.jsonDefinition.uiElements[e];return n.find(o,function(e){var n=this.themeMapping[t]?this.themeMapping[t]:t;return e.id===n}.bind(this))}},updateThemeMapping:function(e){e&&n.each(e,function(e){var t=e.mapping,o=e.id;n.each(t,function(e){this.themeMapping[e]=o}.bind(this))}.bind(this))},getThemeMapping:function(){return this.themeMapping},setThemeMapping:function(e){this.themeMapping=e},getMappedId:function(e){return this.themeMapping[e]},getForegroundPropertiesForUIElement:function(e){var t=this.jsonDefinition.uiElements[e];return t?t.filter((function(e){return-1!==o.indexOf(e.type)})):[]},getForegroundColorPropertiesForUIElement:function(e,t){var n=this,o=[];return this.getForegroundPropertiesForUIElement(t).forEach((function(t){var i=n._getValueForProperty({type:t.type,value:"$"+e});i=t.alpha?n._convertToRGBA(i,t.alpha):i,o.push({id:t.id,value:i})})),o},_convertToRGBA:function(e,t){if(e){if("string"!=typeof e)return n.extend({a:t},n.omit(e,"a"));if("#"===e.charAt(0)&&7===e.length)return{a:t,r:parseInt(e.substring(1,3),16),g:parseInt(e.substring(3,5),16),b:parseInt(e.substring(5),16)}}return e}})})),define("dashboard-core/js/dashboard/loader/modules/LegacyBoardModule",["../../../lib/@waca/core-client/js/core-client/utils/ClassFactory"],(function(e){return function(){function t(n){_classCallCheck(this,t),n=n||{},this._loader=n.loader||e,this.logger=n.logger}return t.prototype.load=function(e){var t=this,n=e.path||e;return this._loader.loadModule(n).then((function(e){return{template:e.getTemplate,module:e}})).catch((function(e){throw t.logger.warn('[LegacyBoardModule]: attempted to load module "'+n+' and failed"',e),e}))},t}()})),define("text!dashboard-core/js/app/util/resources/bg_default_image.svg",[],(function(){return'<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><style>.foregroundFill{fill:#a7a9ac;fill-opacity:.33}</style><path class="foregroundFill" d="M0 0v32h32V0H0zm30.9 27.1H1.1V1.2h29.7v25.9z"/><path class="foregroundFill" d="M20.2 18.7l-9.6-9.6L2.7 16v9.1h27.4v-6.8L25.5 15z"/><circle fill="none" stroke-miterlimit="10" cx="25.5" cy="8" r="2.3" stroke="#a7a9ac" stroke-opacity=".33"/></svg>\n'})),define("text!dashboard-core/js/app/util/resources/bg_default_media.svg",[],(function(){return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="none" stroke-miterlimit="10" d="M.5.5h31v31H.5z" stroke="#a7a9ac" stroke-opacity=".33"/><path d="M10.6 9.6L21.8 16l-11.2 6.4zM2.4 2.4h5v3.7h-5zm7.4 0h5v3.7h-5zm7.4 0h5v3.7h-5zm7.5 0h5v3.7h-5zM2.4 25.9h5v3.7h-5zm7.4 0h5v3.7h-5zm7.4 0h5v3.7h-5zm7.5 0h5v3.7h-5z" fill="#a7a9ac" fill-opacity=".33"/></svg>\n'})),define("text!dashboard-core/js/app/util/resources/bg_default_webpage.svg",[],(function(){return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="none" stroke-miterlimit="10" stroke="#a7a9ac" stroke-opacity=".33" d="M.5.5h31v31H.5z"/><path d="M16 5.6c-5.8 0-10.5 4.7-10.5 10.5S10.2 26.6 16 26.6s10.5-4.7 10.5-10.5S21.8 5.6 16 5.6zm-2.7 2c-1.1 1.2-1.5 2.1-1.6 2.4-.8 0-1.6-.4-1.7-.5.7-.8 2.5-1.8 3.3-1.9zm-4 2.6c.3.2 1.1.5 1.9.6-1.2 2.3-1.1 4.9-1.1 4.9H7c0-2.4 1.2-4.3 2.3-5.5zM7 16.6h3s0 2.7 1.2 5.1c-.7.2-1.5.5-1.7.7C8.4 21.2 7 19.1 7 16.6zm3.2 6.4c.3-.2.7-.4 1.4-.5.3.8 1.2 2 1.2 2-.4-.1-1.9-.8-2.6-1.5zm5.3 2.1c-.2 0-.5 0-1-.1-.4-.4-1.3-1.5-1.9-2.6.6-.2 2-.4 2.9-.4v3.1zm0-4c-.9 0-2 0-3.3.4-1-2-1.1-3.8-1.1-4.9h4.4v4.5zm0-5.4h-4.4c0-1.1 0-2.7 1-4.7 1.4.3 2.5.3 3.4.3v4.4zm0-5.2c-.5 0-1.8 0-3-.3.5-1 2-2.9 2.6-2.9h.4v3.2zm9.3 5.3h-3s.1-2.5-1.1-4.9c.7-.1 1.6-.5 1.9-.6 1.1 1.1 2.2 3 2.2 5.5zm-2.9-6.3c-.1.1-.9.5-1.7.5-.2-.3-.6-1.2-1.6-2.4.7.2 2.6 1.1 3.3 1.9zm-5.5-2.3h.4c.6.1 2.2 1.9 2.6 2.9-1.2.3-2.5.3-3 .3V7.2zm0 4.2c.9 0 2.1 0 3.4-.3 1 2 1 3.6 1 4.7h-4.4v-4.4zm0 5.2h4.4c0 1.1-.2 2.9-1.1 4.9-1.4-.3-2.4-.4-3.3-.4v-4.5zm.9 8.3l-1 .1v-3c.9 0 2.3.2 2.9.4-.5 1-1.5 2.2-1.9 2.5zm1.7-.4s.9-1.2 1.2-2c.7.1 1.1.3 1.4.5-.6.7-2.1 1.4-2.6 1.5zm3.4-2.2c-.3-.2-1-.5-1.7-.7 1.2-2.3 1.2-5.1 1.2-5.1h3c-.1 2.6-1.4 4.7-2.5 5.8z" fill="#a7a9ac" fill-opacity=".33"/></svg>\n'})),define("text!dashboard-core/js/app/util/resources/bg_default_vizualization.svg",[],(function(){return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M0 14.8h8.6V32H0zm23.4 14.7H32V32h-8.6zm0-4.9H32v2.5h-8.6zm0-4.9H32v2.5h-8.6zm0-4.9H32v2.5h-8.6zm0-5H32v2.5h-8.6zm0-4.9H32v2.5h-8.6zm0-4.9H32v2.5h-8.6zM11 7.4V32h9.8V7.4H11zm7.4 22.1h-4.9V9.8h4.9v19.7z" fill="#a7a9ac" fill-opacity=".33"/></svg>\n'})),define("@dashboard-features/contentStoreReferences/js/ContentStoreReferencesAPI",[],(function(){return function(){function e(){_classCallCheck(this,e)}return e.prototype.getLatestAssetId=function(){},e.prototype.getContentStoreReferences=function(){},e.prototype.registerProvider=function(){},e}()})),define("@dashboard-features/contentStoreReferences/js/ContentStoreReferences",["@waca/dashboard-common/js/core/APIFactory","@waca/dashboard-core/js/dashboard/loader/DeploymentReferencesUtil","./ContentStoreReferencesAPI"],(function(e,t,n){return function(){function o(t){var i=t.features,r=t.spec;_classCallCheck(this,o),this._features=i,this._references=r||[],this._referenceProviders=[],this._api=e.createAPI(this,[n])}return o.prototype.getAPI=function(){return this._api},o.prototype.destroy=function(){delete this._references,delete this._referenceProviders,delete this._api,delete this._features},o.prototype.getContentStoreReferences=function(){var e=this._features.UserProfile.getContentLocale();return this._referenceProviders.map((function(e){return e.getContentStoreReferences()||[]})).reduce((function(e,t){return e.concat(t)}),[]).filter((function(e,t,n){return n.findIndex((function(t){return t.assetId===e.assetId}))===t})).map((function(t){var n;return{objects:[{type:t.type,searchPath:'storeID("'+t.assetId+'")'}],name:(n={},n[e]=t.assetId,n)}}))},o.prototype.getLatestAssetId=function(e){var n=t.findReference(e,this._references);return n&&n.id},o.prototype.registerProvider=function(e){this._referenceProviders.push(e)},o}()})),define("dashboard-core/js/features/dashboard/segment/api/SegmentAPI",[],(function(){return function(){function e(){_classCallCheck(this,e)}return e.prototype.track=function(){},e.prototype.getInfo=function(){},e.prototype.registerInfoCallback=function(){},e.prototype.unregisterInfoCallback=function(){},e}()})),define("dashboard-core/js/features/dashboard/segment/SegmentFeature",["./api/SegmentAPI","./api/impl/Segment","../../../lib/@waca/dashboard-common/dist/core/APIFactory"],(function(e,t,n){return function(){function o(e){_classCallCheck(this,o),this._options=e}return o.prototype.initialize=function(){return this._options.instrumentationSvc=this._options.dashboardApi.getGlassCoreSvc(".Instrumentation"),this._options.logger=this._options.dashboardApi.getGlassCoreSvc(".Logger"),this._options.instrumentationSvc.enabled?this._api=n.createAPI(new t(this._options),[e]):this._api=new e,Promise.resolve()},o.prototype.getAPI=function(){return this._api},o}()})),define("dashboard-core/js/features/dashboard/coachMark/api/CoachMarkAPI",[],(function(){return function(){function e(){_classCallCheck(this,e)}return e.prototype.addCoachMark=function(){},e}()})),define("dashboard-core/js/features/dashboard/coachMark/api/impl/CoachMark",["jquery","../../../../../lib/@waca/dashboard-common/dist/core/APIFactory","../CoachMarkAPI","../../../../../lib/@waca/baglass/js/baglass/utils/Utils"],(function(e,t,n,o){return function(){function i(){_classCallCheck(this,i)}return i.prototype.getAPI=function(){return t.createAPI(this,[n])},i.prototype.addCoachMark=function(t){var n=_extends({$el:e(t.domElement)},t);return o.addCoachmark(n)},i}()})),define("dashboard-core/js/features/dashboard/contentProvider/api/impl/BaseContentProvider",["../../../../../lib/@waca/dashboard-common/dist/core/APIFactory","../../../../../canvas/Content","../../../../../dashboard/layout/LayoutHelper","../../../../../dashboard/glass/util/InstrumentationUtil","../../../../../lib/@waca/dashboard-common/dist/api/ContentProviderAPI"],(function(e,t,n,o,i){return function(){function r(e){_classCallCheck(this,r),this.dashboardApi=e.features.API,e.features.ContentFactory.registerProvider(this)}return r.prototype.getAPI=function(){return e.createAPI(this,[i])},r.prototype.getTypeList=function(){var e=[null,void 0,""];return this._contentTypes||(this._contentTypes=this.dashboardApi.getFeature("ContentTypeRegistry")),this._contentTypes?this._contentTypes.getRegisteredTypes().concat(e):e},r.prototype.addModel=function(e,t,o){var i=t.canvas,r=t.boardModel,A=t.canvasContent,a={parentId:e.containerId,insertBefore:e.insertBefore,copyPaste:e.copyPaste,model:e.spec,modelIdsValid:!0===e.modelIdsValid,layoutProperties:{style:e.spec.style||{}}};e.properties&&["left","top","height","width"].forEach((function(t){void 0!==e.properties[t]&&(a.layoutProperties.style[t]=e.properties[t],delete e.properties[t])})),n.setPreferredAddOptions(a,r.layout,this.dashboardApi),a.parentId||A.getFeature("ContentViewDOM")||(a.parentId=A.getId());var s=i.isLayoutType(e.spec.type),l=this.dashboardApi.getFeature("ContentTypeRegistry"),c=!!l&&l.isTypeRegistered(e.spec.type),d=("widget"===e.spec.type?this._addContent.bind(this):!s&&(e.spec.widgets||e.spec.layout&&e.spec.layout.items)?this._addFragment.bind(this):s?this._addLayout.bind(this):c?this._addContent.bind(this):this._addWidget.bind(this))(a,r,{undoRedoTransactionId:o.transactionId,transactionToken:o,skipUndoRedo:!0});return Promise.resolve(d)},r.prototype.createContent=function(e){return new t(e)},r.prototype._addWidget=function(e,t,n){this._track(e);var o=t.addWidget(e,null,n),i=o&&o.value&&o.value.parameter;return i&&i.model&&i.model.id},r.prototype._addFragment=function(e,t,n){var o=t.addFragment(e,null,n),i=o&&o.value&&o.value.parameter;return i&&i.model&&i.model.layout&&i.model.layout.id},r.prototype._addContent=function(e,t,n){return this._track(e),t.addContent(e,null,n)},r.prototype._addLayout=function(e,t,n){return t.addLayouts({addLayoutArray:[e]},null,n).value.parameter.addLayoutArray[0].model.id},r.prototype._track=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model;t&&o.trackWidget("created",this.dashboardApi,{name:t.name,type:t.type,data:t.data})},r}()})),define("dashboard-core/js/canvas/PageContent",["./Content"],(function(e){return function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,e.apply(this,arguments))}return _inherits(t,e),t.prototype.getType=function(){return"page"},t.prototype.getChildren=function(){var e=this,t=this.layoutModel.items[0];return t.items?t.items.map((function(t){return e.getContent(t.id)})):[]},t.prototype.addContent=function(t){var n;return t.containerId===this.layoutModel.id&&(t.containerId=this.layoutModel.items[0].id),(n=e.prototype.addContent).call.apply(n,[this].concat(Array.prototype.slice.call(arguments)))},t.prototype.moveContent=function(t,n,o){return t=this.layoutModel.items[0].id,e.prototype.moveContent.call(this,t,n,o)},t}(e)})),define("dashboard-core/js/features/dashboard/contentProvider/api/impl/PageContentProvider",["../../../../../lib/@waca/dashboard-common/dist/core/APIFactory","../../../../../canvas/PageContent","../../../../../lib/@waca/dashboard-common/dist/api/ContentProviderAPI","./BaseContentProvider"],(function(e,t,n,o){return function(o){function i(e){return _classCallCheck(this,i),_possibleConstructorReturn(this,o.call(this,e))}return _inherits(i,o),i.prototype.getAPI=function(){return e.createAPI(this,[n])},i.prototype.getTypeList=function(){return["page","container"]},i.prototype.addModel=function(e,t){var n=this,i=arguments,r=t.canvasContent;return new Promise((function(t,A){try{var a=e.properties.templateName||"Template1";delete e.properties.templateName,require(["text!dashboard/layout/templates/"+a+".json"],(function(A){var a;e.spec=e.spec||JSON.parse(A),e.containerId=e.containerId||r.getId(),(a=o.prototype.addModel).call.apply(a,[n].concat(Array.prototype.slice.call(i))).then((function(e){t(e)}))}),A)}catch(e){A(e)}}))},i.prototype.createContent=function(e){return new t(e)},i}(o)})),define("dashboard-core/js/features/dashboard/customColor/api/CustomColorAPI",[],(function(){return function(){function e(){_classCallCheck(this,e)}return e.prototype.registerProvider=function(){},e.prototype.deregisterProvider=function(){},e.prototype.getUsedCustomColors=function(){},e}()})),define("dashboard-core/js/features/dashboard/customColor/CustomColor",["underscore","../../../lib/@waca/dashboard-common/dist/core/APIFactory","./api/CustomColorAPI"],(function(e,t,n){return function(){function o(){_classCallCheck(this,o),this._api=t.createAPI(this,[n]),this.providers=[]}return o.prototype.registerProvider=function(e){this.providers.push(e)},o.prototype.deregisterProvider=function(e){var t=this.providers.findIndex((function(t){return t===e}));-1!==t&&this.providers.splice(t,1)},o.prototype.getUsedCustomColors=function(){var t=[];return this.providers.forEach((function(e){if((!e.isEnabled||e.isEnabled())&&e.getCustomColorList){var n,o=e.getCustomColorList();(n=t).push.apply(n,o)}})),t=e.uniq(t)},o.prototype.getAPI=function(){return this._api},o}()})),define("dashboard-core/js/features/dashboard/theme/DashboardThemeAPI",[],(function(){return function(){function e(){_classCallCheck(this,e)}return e.prototype.getThemeDefinition=function(){},e}()})),define("dashboard-core/js/dashboard/data/ThemeDefinitionAPI",[],(function(){return function(){function e(){_classCallCheck(this,e)}return e.prototype.getCSSColors=function(){},e.prototype.getDefaultPaletteName=function(){},e.prototype.getId=function(){},e.prototype.getMappedId=function(){},e.prototype.getPalette=function(){},e.prototype.getPalettes=function(){},e.prototype.getPropertyForUIElement=function(){},e.prototype.getThemeMapping=function(){},e.prototype.getValueForPropertyOfUIElement=function(){},e.prototype.getValueForVariable=function(){},e.prototype.getForegroundColorPropertiesForUIElement=function(){},e.prototype.getForegroundPropertiesForUIElement=function(){},e.prototype.updateThemeMapping=function(){},e.prototype.setThemeMapping=function(){},e}()})),define("dashboard-core/js/features/dashboard/theme/ThemeProviderAPI",[],(function(){return function(){function e(){_classCallCheck(this,e)}return e.prototype.loadThemeDefinition=function(){},e}()})),define("dashboard-core/js/features/dashboard/theme/DashboardTheme",["../../../lib/@waca/dashboard-common/dist/core/APIFactory","./DashboardThemeAPI","../../../lib/@waca/core-client/js/core-client/utils/ClassFactory","../../../dashboard/data/ThemeDefinition","../../../dashboard/data/ThemeDefinitionAPI","./ThemeProviderAPI"],(function(e,t,n,o,i,r){return function(){function A(){_classCallCheck(this,A),this._themes={},this._getThemeDefinition=null,this._themeProvider=this,this._api=e.createAPI(this,[t])}return A.prototype.getAPI=function(){return this._api},A.prototype.initialize=function(t){var o=this;return this._logger=t.getCoreSvc(".Logger"),t.appController.findCollection("com.ibm.bi.dashboard.dashboardTheme.system").then((function(t){if(Array.isArray(t)&&t.length>0){var i=t[0].class;return n.loadModule(i).then((function(t){o._themeProvider=e.createAPI(new t,[r])})).catch((function(e){return o._logger.error(e)}))}}))},A.prototype.loadThemeDefinition=function(e){return n.loadModule("text!dashboard-core/js/lib/@waca/dashboard-common/dist/themes/"+e+".json").then(JSON.parse.bind(JSON))},A.prototype.getThemeDefinition=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"defaultTheme";return this._themes[t]?(this._themeDefinition=this._themes[t],Promise.resolve(this._themes[t])):this._themeProvider.loadThemeDefinition(t).catch(this._handleLoadingError.bind(this,t)).then(this._processThemeDefinition.bind(this,t)).then((function(n){return e._setThemeDefinition(t,n),e._themeDefinition}))},A.prototype._processThemeDefinition=function(e,t){return this._themeProvider!==this?this.loadThemeDefinition(e).then(this._mergeDeep.bind(this,t)):t},A.prototype._handleLoadingError=function(e,t){if(this._logger.error(t),this===this._themeProvider)throw t;return this.loadThemeDefinition(e)},A.prototype._isObject=function(e){return e&&"object"===(void 0===e?"undefined":_typeof(e))&&!Array.isArray(e)},A.prototype._mergeDeep=function(e,t){var n=this,o=Object.assign({},t);return this._isObject(t)&&this._isObject(e)&&Object.keys(e).forEach((function(i){var r,A;e[i]?t[i]?_typeof(e[i])!==_typeof(t[i])?n._logger.warn("Contributed theme attribute: "+i+" is not of the right type"):n._isObject(e[i])?o[i]=n._mergeDeep(e[i],t[i]):Object.assign(o,((r={})[i]=e[i],r)):Object.assign(o,((A={})[i]=e[i],A)):n._logger.info("No value corresponding to the key: "+i)})),o},A.prototype._setThemeDefinition=function(t,n){this._themes[t]=e.createAPI(new o(n),[i]),this._themeDefinition=this._themes[t]},A}()})),define("dashboard-core/js/features/dashboard/colors/api/ColorsAPI",[],(function(){return function(){function e(){_classCallCheck(this,e)}return e.prototype.initializeColorsFeature=function(){},e.prototype.initializeColorsFeatureForUpgrade=function(){},e.prototype.registerProvider=function(){},e.prototype.getTabColorHexValueFromModel=function(){},e.prototype.getColorSetId=function(){},e.prototype.getThemeDefinition=function(){},e.prototype.getDashboardColorSet=function(){},e.prototype.getCustomColorSet=function(){},e.prototype.getColorSet=function(){},e.prototype.getLayoutBackgroundColorHex=function(){},e.prototype.getDefaultPaletteName=function(){},e.prototype.getPropertyForUIElement=function(){},e.prototype.getValueForPropertyOfUIElement=function(){},e.prototype.getValueForVariable=function(){},e.prototype.updateThemeMapping=function(){},e.prototype.getMappedId=function(){},e.prototype.getForegroundCSSColors=function(){},e.prototype.getForegroundColorPropertiesForUIElement=function(){},e.prototype.getForegroundPropertiesForUIElement=function(){},e.prototype.isColorIdValidForDashboadColorSet=function(){},e.prototype.getHexColorFromDashboardColorSet=function(){},e.prototype.getHexColorFromPalette=function(){},e.prototype.getPalette=function(){},e.prototype.getPalettes=function(){},e.prototype.getPaletteColors=function(){},e.prototype.createColorDefinition=function(){},e.prototype.clearLocalPaletteCache=function(){},e.prototype.destroy=function(){},e.prototype.enableTheme=function(){},e.prototype.disableTheme=function(){},e.prototype.getHexColorFromClassName=function(){},e.prototype.isCustomColor=function(){},e.prototype.addCustomColor=function(){},e.prototype.getColorClassName=function(){},e.prototype.makeSureColorIsValidInModel=function(){},e.prototype.prepareForColorModelChange=function(){},e.prototype.on=function(){},e.prototype.off=function(){},e}()})),define("dashboard-core/js/features/dashboard/colors/api/ColorSetAPI",[],(function(){return function(){function e(){_classCallCheck(this,e)}return e.prototype.getColorStyles=function(){},e}()})),define("dashboard-core/js/features/dashboard/colors/api/impl/Colors",["../../../../../lib/@waca/dashboard-common/dist/core/APIFactory","../ColorsAPI","../ColorSetAPI","underscore","jquery","../../../../../app/nls/StringResources","../../../../../dashboard/util/ColorUtils","../../../../../lib/@waca/core-client/js/core-client/ui/core/Events"],(function(e,t,n,o,i,r,A,a){var s={ColorPalette:"simple",HeatPalette:"continuous",ConditionalPalette:"simple"},l=[{id:"transparent",hexValue:"transparent"},{id:"white",hexValue:"#FFFFFF"},{id:"black",hexValue:"#000000"}];return function(n){function a(e){_classCallCheck(this,a);var t=_possibleConstructorReturn(this,n.call(this));return t.dashboardApi=e.features.API,t.internalApi=e.features.internal,t._dashboardThemeFeature=e.features.DashboardTheme,t._paletteFeature=e.features.Palette,t._providers=[],t}return _inherits(a,n),a.prototype.initialize=function(){return this.initializeColorsFeature({boardModel:this.internalApi.getBoardModel()})},a.prototype.getAPI=function(){return this._colorsAPI||(this._colorsAPI=e.createAPI(this,[t])),this._colorsAPI},a.prototype.initializeColorsFeature=function(e){var t=this,n=e.boardModel,o=e.generateRuntimeStyles,i=void 0===o||o;return this._boardModel=n,this._dashboardPropertiesModel=this._boardModel.properties,this._customColorsModel=this._dashboardPropertiesModel.get("customColors"),this._generateRuntimeStyles=i,this._dashboardColorSetId=this._dashboardPropertiesModel.dashboardColorSet||"userPaletteColor",this._localPalettes=null,this._loadThemeDefinition(this._boardModel.theme).then((function(e){return t._themeDefinition=e,t._registerPaletteServiceEvents(),t.getPaletteColors({paletteId:t.getColorSetId(),addMissingBaseColors:!0}).then((function(e){return t._dashboardColorSet=e,t._registerModelEvents(),t._initCustomColors(!1).then((function(){return t.enableTheme()}))}))}))},a.prototype.initializeColorsFeatureForUpgrade=function(e){var t=this,n=e.themeName,o=e.generateRuntimeStyles,i=void 0===o||o;return this._generateRuntimeStyles=i,this._dashboardPropertiesModel={},this._loadThemeDefinition(n).then((function(e){t._themeDefinition=e}))},a.prototype.destroy=function(){this._unregisterModelEvents(),this._unregisterPaletteServiceEvents(),this.clearLocalPaletteCache()},a.prototype.registerProvider=function(e){this._providers.push(e)},a.prototype._registerPaletteServiceEvents=function(){this._paletteFeature.on("palette:updated",this._onPaletteUpdated,this),this._paletteFeature.on("palette:deleted",this._onPaletteDeleted,this)},a.prototype._unregisterPaletteServiceEvents=function(){this._paletteFeature.off("palette:updated",this._onPaletteUpdated,this),this._paletteFeature.off("palette:deleted",this._onPaletteDeleted,this)},a.prototype._registerModelEvents=function(){this._boardModel.on("change:theme",this._onChangeTheme,this),this._dashboardPropertiesModel.on("change:dashboardColorSet",this._onChangeDashboardColorSet,this),this._customColorsModel.on("changed:colors",this._initCustomColors,this),this._boardModel.layout&&this._boardModel.layout.on("change:tabTextColor",this._generateAllColorSetStyles,this),this._dashboardPropertiesModel.on("change:fredIsRed",this._onChangeFredIsRed,this)},a.prototype._unregisterModelEvents=function(){this._boardModel.off("change:theme",this._onChangeTheme,this),this._dashboardPropertiesModel.off("change:dashboardColorSet",this._onChangeDashboardColorSet,this),this._customColorsModel.off("changed:colors",this._initCustomColors,this),this._boardModel.layout&&this._boardModel.layout.off("change:tabTextColor",this._generateAllColorSetStyles,this),this._dashboardPropertiesModel.off("change:fredIsRed",this._onChangeFredIsRed,this)},a.prototype._onChangeFredIsRed=function(){this.trigger("fredIsRed:changed",{})},a.prototype.getColorSetId=function(){return this._dashboardPropertiesModel.dashboardColorSet||"userPaletteColor"},a.prototype.getThemeDefinition=function(){return this._themeDefinition},a.prototype.getDashboardColorSet=function(){return this._dashboardColorSet},a.prototype.getCustomColorSet=function(){return this._customColorSet},a.prototype.getTabColorHexValueFromModel=function(e){return this._boardModel.layout.get(e)?this.getHexColorFromDashboardColorSet(this._boardModel.layout.get(e)):null},a.prototype.getColorSet=function(e){return e===this.getColorSetId()?this.getDashboardColorSet():this._customColorPalette&&this._customColorPalette.id===e?this.getCustomColorSet():[]},a.prototype.getLayoutBackgroundColorHex=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transparent";return"transparent"===e?this.getValueForPropertyOfUIElement("board","backgroundColor"):this.getHexColorFromDashboardColorSet(e)},a.prototype.getDefaultPaletteName=function(e){return this._themeDefinition.getDefaultPaletteName(e)},a.prototype.getPropertyForUIElement=function(e,t){return this._themeDefinition.getPropertyForUIElement(e,t)},a.prototype.getValueForPropertyOfUIElement=function(e,t){return this._themeDefinition.getValueForPropertyOfUIElement(e,t)},a.prototype.getValueForVariable=function(e,t){return this._themeDefinition.getValueForVariable(e,t)},a.prototype.updateThemeMapping=function(e){this._themeDefinition.updateThemeMapping(e)},a.prototype.getMappedId=function(e){return this._themeDefinition.getMappedId(e)},a.prototype._onPaletteUpdated=function(e){var t="__CM__"+e.paletteId;t===this.getColorSetId()&&this._onChangeDashboardColorSet(),this.trigger("palette:updated",{paletteId:t}),this.dashboardApi.triggerDashboardEvent("properties:refreshPane")},a.prototype._onPaletteDeleted=function(e){var t="__CM__"+e.paletteId;t===this.getColorSetId()&&(this._dashboardPropertiesModel.set({dashboardColorSet:this.getDefaultPaletteName("ColorPalette")},{silent:!0,payloadData:{skipUndoRedo:!0}}),this._onChangeDashboardColorSet()),this.trigger("palette:deleted",{paletteId:t}),this.dashboardApi.triggerDashboardEvent("properties:refreshPane")},a.prototype._isDashboardColorSetFromThemes=function(){var e=this.getColorSetId();return!this._isExternalPalette(e)},a.prototype.getForegroundCSSColors=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getColorSetId();return"userPaletteColor"===t?Promise.resolve(this._themeDefinition.getCSSColors(e)):this.getPaletteColors({paletteId:t}).then((function(e){var t={};return e&&e.forEach((function(e){t[e.id]=A.invertColor(e.hexValue)})),t}))},a.prototype.getForegroundColorPropertiesForUIElement=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transparent",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"visualization";if("userPaletteColor"!==this.getColorSetId()||this.isCustomColor(e)){var n=this._themeDefinition.getForegroundPropertiesForUIElement(t),o=[],i=this.getHexColorFromDashboardColorSet(e);if("transparent"===i)return o;var r=A.invertColor(i);return n.forEach((function(e){o.push({id:e.id,value:r})})),o}return this._themeDefinition.getForegroundColorPropertiesForUIElement(e,t)},a.prototype.getForegroundPropertiesForUIElement=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"visualization";return this._themeDefinition.getForegroundPropertiesForUIElement(e)},a.prototype.isColorIdValidForDashboadColorSet=function(e){return!!o.find(this.getDashboardColorSet(),(function(t){return t.id===e}))},a.prototype.getHexColorFromDashboardColorSet=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transparent";if(0===e.indexOf("#"))return e;var t=this.isCustomColor(e)?this.getCustomColorSet():this.getDashboardColorSet(),n=o.find(t,(function(t){var n=t.id===e;return!n&&t.hexValue.toLowerCase&&(n=!!l.find((function(n){return n.id===e&&n.hexValue.toLowerCase()===t.hexValue.toLowerCase()}))),n}));return n?n.hexValue:e},a.prototype._getDefaultColorFromDashboardColorSet=function(){var e=this.getDashboardColorSet();return e[e.length-1]},a.prototype.getHexColorFromPalette=function(e){var t=e.paletteId,n=e.type,i=void 0===n?"ColorPalette":n,r=e.colorIndex,A=e.colorId,a=e.addMissingBaseColors,s=void 0===a||a,l=e.defaultIfNotFound,c=void 0===l||l;return this.getPaletteColors({paletteId:t,type:i,defaultIfNotFound:c,addMissingBaseColors:s}).then((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=null;return A?!(t=o.find(e,(function(e){return e.id===A})))&&c&&(t=e[0]):t=r?r>=e.length?e[0]:e[r]:e[0],t?t.hexValue:t}))},a.prototype.getPalette=function(e){var t=this,n=e.paletteId,o=e.type,i=e.defaultPaletteId,r=e.defaultIfNotFound,A=void 0===r||r,a=e.forProperties,s=void 0!==a&&a;if(!n)return A?Promise.resolve(this._getDefaultPalette(o,i,s)):Promise.reject("Trying to get a palette without an ID");if(this._isExternalPalette(n)){var l=n.split("__CM__")[1];return this._paletteFeature.getPalette(l).then((function(e){return t._updateCMIDs([e]),s?e:e.content})).catch((function(e){if(e&&404===e.code&&A)return t._getDefaultPalette(o,i,s);throw e}))}return Promise.resolve(this._themeDefinition.getPalette(n,o,s))},a.prototype._getDefaultPalette=function(e,t,n){if(t)return this._themeDefinition.getPalette(t,e,n);var o=this._themeDefinition.getDefaultPaletteName(e);return this._themeDefinition.getPalette(o,e,n)},a.prototype.getPalettes=function(e){var t=this,n=e.type,o=e.includeUserColorPalette,i=void 0!==o&&o,r=e.forProperties,A=void 0!==r&&r,a=e.includePatternPalettes,l=void 0===a||a,c=s[n];return this._paletteFeature.getPalettes(c).then((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t._updateCMIDs(e.my),t._updateCMIDs(e.public),A||(e.my.map((function(e){return e.content})),e.public.map((function(e){return e.content})));var o=[];return i&&o.push(t._themeDefinition.getPalette("userPaletteColor","userPaletteColor",A)),e.system=o.concat(t._themeDefinition.getPalettes(n,A,l)),t._getLocalPalettes(e,n,A).then((function(t){return e.local=t,e}))}))},a.prototype.getPaletteColors=function(e){var t=this,n=e.paletteId,o=e.type,i=void 0===o?"ColorPalette":o,r=e.addMissingBaseColors,A=void 0===r||r,a=e.defaultIfNotFound,s=void 0===a||a;if(!n)return Promise.resolve([]);if(this._isExternalPalette(n)){var l=n.split("__CM__")[1];return this._paletteFeature.getPalette(l).then((function(e){return t._generateArrayOfColorsFromPalette(e.content,A)})).catch((function(e){if(s){var n=t._themeDefinition.getDefaultPaletteName(i),o=t._themeDefinition.getPalette(n,i,!1);return t._generateArrayOfColorsFromPalette(o,A)}throw e}))}if(this._customColorPalette&&this._customColorPalette.id===n)return Promise.resolve(this.getCustomColorSet());var c=this._themeDefinition.getPalette(n,i,!1);return Promise.resolve(this._generateArrayOfColorsFromPalette(c,A))},a.prototype.clearLocalPaletteCache=function(){this._localPalettes=null},a.prototype._isExternalPalette=function(e){return 0===e.indexOf("__CM__")},a.prototype._getLocalPalettes=function(e,t,n){var o=this,i=s[t];if(this._localPalettes)return Promise.resolve(this._localPalettes[i]);var r=[],A=e.my||[],a=e.public||[],l=this._boardModel.getContentReferences()||[],c=function(e,t){return e.id===t};l.forEach((function(e){if("palette"===e.type){var t="__CM__"+e.value;A.some((function(e){return c(e,t)}))||a.some((function(e){return c(e,t)}))||r.push(t)}}));var d=[];return r.forEach((function(e){d.push(o.getPalette({paletteId:e,forProperties:n,defaultIfNotFound:!1}).catch((function(){return null})))})),Promise.all(d).then((function(e){return o._localPalettes={simple:[],continuous:[]},e.forEach((function(e){if(e){var t=e.fillType||e.content&&e.content.fillType;o._localPalettes[t]&&o._localPalettes[t].push(e)}})),o._localPalettes[i]}))},a.prototype._generateArrayOfColorsFromPalette=function(e,t){var n=this,o=[];return e.fills.forEach((function(t,i){var A=e.ids&&e.ids[i]?e.ids[i]:"color"+i,a=e.labels&&e.labels[i]?r.get(e.labels[i]):t;o.push(n.createColorDefinition(A,a,t))})),t&&(o=this._addMissingBaseColors(o)),o},a.prototype.createColorDefinition=function(e,t,n){return{id:e,name:e,type:"transparent"===e?"ColorCode":"Class",label:t,value:"transparent"===e?"transparent":"fill-"+e,hexValue:n}},a.prototype._addMissingBaseColors=function(e){var t=this,n=[];return l.forEach((function(i){o.find(e,(function(e){return e.hexValue.toLowerCase&&e.hexValue.toLowerCase()===i.hexValue.toLowerCase()}))||n.push(t.createColorDefinition(i.id,r.get(i.id),i.hexValue))})),n.concat(e)},a.prototype._updateCMIDs=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.forEach((function(e){e.id="__CM__"+e.id}))},a.prototype._getColorSetExtensions=function(){var e=this;return this._colorSetExtensions?(this.getColorSetExtensionsPromise=null,Promise.resolve(this._colorSetExtensions)):(this.getColorSetExtensionsPromise||(this.getColorSetExtensionsPromise=this.dashboardApi.getCollectionExtension("com.ibm.bi.dashboard.colorSetExtensions").then((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=[];return t.forEach((function(e){var t=e.name,o=e.module;t&&o&&n.push(o)})),new Promise((function(t,o){require(n,function(){this._colorSetExtensions=[];for(var e=0;e<arguments.length;e++)this._colorSetExtensions.push(arguments[e]);t(this._colorSetExtensions)}.bind(e),(function(e){o(e)}))}))}))),this.getColorSetExtensionsPromise)},a.prototype._generateColorSetStyles=function(e,t){var n=this;if(!this._generateRuntimeStyles)return Promise.resolve();var o=this._providers.map((function(t){try{return t.getColorStyles(e)}catch(e){return Promise.reject(e)}}));return this._getColorSetExtensions().then((function(i){return i.forEach((function(t){t.getColorStyles&&o.push(t.getColorStyles(n,e))})),Promise.all(o).then((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return n._createStyleNode(e.join(""),t),e}))}))},a.prototype._createStyleNode=function(e,t){this._removeDynamicStyles(t);var n=i('<style type="text/css" id="'+t+'"></style>');n.html(e),n.appendTo("head")},a.prototype._removeDynamicStyles=function(e){i("#"+e).remove()},a.prototype.enableTheme=function(){return this._isThemeEnabled=!0,this._themeDefinition?(i("body").addClass(this._themeDefinition.getId()),this._generateAllColorSetStyles()):Promise.resolve()},a.prototype.disableTheme=function(){this._isThemeEnabled&&(this._isThemeEnabled=!1,this._themeDefinition&&(i("body").removeClass(this._themeDefinition.getId()),i("#dashboardDynamicStyles").remove()),i("#dashboardCustomColors").remove())},a.prototype._loadThemeDefinition=function(e){return this._dashboardThemeFeature.getThemeDefinition(e)},a.prototype.getHexColorFromClassName=function(e){return this._customColorsModel.getHexColorFromClassName(e)},a.prototype.isCustomColor=function(e){return this._customColorsModel.isCustomColor(e)},a.prototype.addCustomColor=function(e){return this._customColorsModel.addCustomColor(e),this._customColorsModel.getColorClassName(e)},a.prototype.getColorClassName=function(e){return 0!==e.indexOf("#")?e:this.addCustomColor(e)},a.prototype._initCustomColors=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._customColorSet=[],this._customColorPalette=this._customColorsModel.getCustomPaletteDefinition(),this._customColorPalette&&this._customColorPalette.fills&&this._customColorPalette.fills.length>0?(this._customColorSet=this._generateArrayOfColorsFromPalette(this._customColorPalette,!1),e?this._generateColorSetStyles(this._customColorPalette.id,"dashboardCustomColors"):Promise.resolve()):Promise.resolve()},a.prototype._generateAllColorSetStyles=function(){return Promise.all([this._generateColorSetStyles(this.getColorSetId(),"dashboardDynamicStyles"),this._generateColorSetStyles(this._customColorPalette.id,"dashboardCustomColors")])},a.prototype._onChangeDashboardColorSet=function(){var e=this;return this.getPaletteColors({paletteId:this.getColorSetId(),addMissingBaseColors:!0}).then((function(t){return e._dashboardColorSet=t,e._generateAllColorSetStyles().then((function(){e.trigger("colorSet:changed",{}),e.dashboardApi.triggerDashboardEvent("properties:refreshPane")}))}))},a.prototype._onChangeTheme=function(e){var t=this;return this._loadThemeDefinition(this._boardModel.theme).then((function(n){t.disableTheme();var i=t._themeDefinition.getThemeMapping();t._themeDefinition=n,t._themeDefinition.setThemeMapping(i),t.enableTheme();return(t._isDashboardColorSetFromThemes()?t._onChangeDashboardColorSet():Promise.resolve()).then((function(){t.trigger("theme:changed",{value:e.value,payloadData:{undoRedoTransactionId:o.uniqueId("canvasThemeChanged")},prevValue:e.prevValue})}))}))},a.prototype.makeSureColorIsValidInModel=function(e){var t=e.model,n=e.propertyName,o=e.valuePrefix,i=e.offset,r=void 0===i?1:i,A=e.info;if(t&&n){var a=t.get(n);if(a&&!this.isCustomColor(a)){var s="original"+n,l=t.get(s),c=l||a,d=null,u=o?c.split(o)[1]:c;if(this.isColorIdValidForDashboadColorSet(u))c!==a&&((d={})[n]=c);else{var h=this.getDashboardColorSet(),g=r<h.length?h[h.length-r].id:h[h.length-1].id;(d={})[n]=o?o+g:g}if(d){l||(d[s]=a);var f=null;f=A&&A.transactionId?{undoRedoTransactionId:A.transactionId,transactionToken:A.transactionToken}:{skipUndoRedo:!0},t.set(d,{payloadData:f}),this.dashboardApi.triggerDashboardEvent("properties:refreshPane")}}}},a.prototype.prepareForColorModelChange=function(e,t){e["original"+t]=null},a}(a)})),define("dashboard-core/js/features/dashboard/fullScreen/FullScreenAPI",[],(function(){return function(){function e(){_classCallCheck(this,e)}return e.prototype.enter=function(){},e.prototype.exit=function(){},e.prototype.isFullScreen=function(){},e}()})),define("dashboard-core/js/features/dashboard/fullScreen/FullScreen",["./FullScreenAPI","jquery","../../../api/DashboardAPI","../../../app/nls/StringResources","../../../lib/@waca/dashboard-common/dist/core/APIFactory","../../../lib/@waca/dashboard-common/dist/api/ContentActionsProviderAPI"],(function(e,t,n,o,i,r){var A="webkitfullscreenchange mozfullscreenchange MSFullscreenChange fullscreenchange",a=function(){function a(e){var t=e.features;_classCallCheck(this,a),this._dashboard=t.API,this._dashboardState=t.DashboardState,this._contentActions=t.ContentActions,this._icons=t.Icons,this._logger=this._dashboard.getService(n.GLOBAL_SERVICES.LOGGER)}return a.prototype.initialize=function(){this._api=i.createAPI(this,[e,r]),this._contentActions.registerProvider("fullScreenAction",this._api),this._dashboardState.onChangeActive(this._onChangeDashboardState.bind(this)),this._dashboardState.onUiStateChange(this._onUiStateChange.bind(this)),this._isEventTriggeredInternally=!1,this._isFullScreen=!1,this._inProgress=!1},a.prototype.getAPI=function(){return this._api},a.prototype.destroy=function(){this._api=null,t(document).off(A)},a.prototype.enter=function(){this.isFullScreen()?this._logger.info(a.LOGGER_MESSAGE.ENTER):(this._onEnterFullScreen(),this._isFullScreenEnabled()&&(this._isEventTriggeredInternally=!0,document.body.requestFullscreen?document.body.requestFullscreen():document.body.webkitRequestFullscreen?document.body.webkitRequestFullscreen():document.body.mozRequestFullScreen?document.body.mozRequestFullScreen():!document.body.msRequestFullscreen||window.frameElement&&"IFRAME"===window.frameElement.nodeName||document.body.msRequestFullscreen()))},a.prototype.exit=function(){this.isFullScreen()?(this._onExitFullScreen(),this._isFullScreenEnabled()&&(this._isEventTriggeredInternally=!0,document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen())):this._logger.info(a.LOGGER_MESSAGE.EXIT)},a.prototype.isFullScreen=function(){return this._isFullScreen},a.prototype._onChangeDashboardState=function(e){e.info.value?t(document).on(A,this._onFullScreenChangeEvents.bind(this)):(this.exit(),t(document).off(A))},a.prototype._onFullScreenChangeEvents=function(){this._isEventTriggeredInternally?this._isEventTriggeredInternally=!1:this.isFullScreen()?(this._onExitFullScreen(),this._dashboardState.setFullScreen(!1)):this._onEnterFullScreen()},a.prototype._onEnterFullScreen=function(){this._activePaneColumn=t(".appview.paneColumn").not(".hidden"),this._activePaneColumn.find(".appbar").addClass("fullScreenNoGlass"),this._activePaneColumn.find(".navbar").addClass("fullScreenNoGlass"),this._activePaneColumn.find(".templateBox").addClass("fullScreen"),t("body").addClass("fullScreen"),document.body.style.cssText="height: 100% !important",t("body").append(t('<div class="dashboardAriaAlert fullScreenAlert" role="alert"></div>').text(o.get("ariaFullScreenMessage"))),!0===this._dashboardState.getUiState().authoring&&(this._wasAuthoring=!0,this._dashboardState.setAuthoring(!1)),this._isFullScreen=!0,this._dashboard.triggerDashboardEvent("enter:fullscreen")},a.prototype._onExitFullScreen=function(){this._activePaneColumn.find(".appbar").removeClass("fullScreenNoGlass"),this._activePaneColumn.find(".navbar").removeClass("fullScreenNoGlass"),this._activePaneColumn.find(".templateBox").removeClass("fullScreen"),t("body").removeClass("fullScreen"),document.body.style.cssText="",t("body").find(".fullScreenAlert").remove(),this._wasAuthoring&&(this._wasAuthoring=!1,this._dashboardState.setAuthoring(!0)),this._isFullScreen=!1,this._dashboard.triggerDashboardEvent("exit:fullscreen")},a.prototype._isFullScreenEnabled=function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)},a.prototype._onUiStateChange=function(e){var t=e.fullScreen;this._inProgress?this._logger.info(a.LOGGER_MESSAGE.IN_PROGRESS):(this._inProgress=!0,!0===t?this.enter():this.exit(),this._inProgress=!1)},a.prototype.getContentActionList=function(e){var t=this,n=this._dashboardState.getUiState();if(e.length>0)return[];var i=void 0,r=void 0;return n.fullScreen?(i=o.get("fullScreenClose"),r=this._icons.getIcon("minimize").id):(i=o.get("fullScreenEnter"),r=this._icons.getIcon("maximize").id),[{name:"FullScreen",type:"Button",label:i,icon:r,order:2,disabled:n.eventGroups,action:function(){n.fullScreen?t._dashboardState.setFullScreen(!1):t._dashboardState.setFullScreen(!0)}}]},a}();return a.LOGGER_MESSAGE={ENTER:"enter fullScreen - already in full screen",EXIT:"exit fullScreen - not in full screen",IN_PROGRESS:"change fullScreen state - already in progress"},a})),define("dashboard-core/js/features/dashboard/actions/resetDashboard/ResetDashboardAction",["../../../../lib/@waca/dashboard-common/dist/core/APIFactory","../../../../lib/@waca/dashboard-common/dist/api/ContentActionsProviderAPI","../../../../app/ui/dialogs/ConfirmationDialog"],(function(e,t,n){return function(){function o(e){var t=e.features;_classCallCheck(this,o),this._dashboard=t.API,this._dashboardState=t.DashboardState,this._contentActions=t.ContentActions,this._icons=t.Icons}return o.prototype.initialize=function(){this._api=e.createAPI(this,[t]),this._contentActions.registerProvider("ResetDashboard",this.getAPI())},o.prototype.getAPI=function(){return this._api},o.prototype._isItemVisible=function(){var e=!!this._dashboard.getCurrentContentView().getSavedInstance(),t=this._dashboardState.getUiState().dirty;return e&&t},o.prototype._resetDashboard=function(){var e=this._dashboard.getCurrentContentView(),t=e.getSavedInstance();e.clearTransientState();return e.reloadFromJSONSpec(JSON.parse(t),{isAuthoringMode:!1,clearDirtyFlag:!0})},o.prototype._onReset=function(){var e=this,t=this._dashboard.getCurrentContentView(),o=t.stringService,i=o.get("dashboardResetToast");new n("warning",o.get("dashboardResetTitle"),o.get("dashboardResetMessage")).confirm((function(){return e._resetDashboard().then((function(){return t.getDashboardApi().showToast(i,{type:"success",preventDuplicates:!0})}))}))},o.prototype.getContentActionList=function(e){var t=this,n=this._dashboard.getCurrentContentView().stringService,o=this._dashboardState.getUiState();return!1===o.authoring&&this._isItemVisible()&&o.dirty&&0===e.length?[{name:"ResetDashboard",type:"Button",label:n.get("dashboardResetTitle"),icon:this._icons.getIcon("restore").id,actions:{apply:function(){return t._onReset()}}}]:[]},o}()})),define("dashboard-core/js/features/dashboard/contentMenu/api/ContentMenuAPI",[],(function(){return function(){function e(){_classCallCheck(this,e)}return e.prototype.registerProvider=function(){},e.prototype.getContentMenuList=function(){},e}()})),define("dashboard-core/js/features/dashboard/contentMenu/ContentMenu",["../../../lib/@waca/dashboard-common/dist/core/APIFactory","./api/ContentMenuAPI"],(function(e,t){return function(){function n(){_classCallCheck(this,n),this.api=e.createAPI(this,[t]),this.providers={}}return n.prototype.registerProvider=function(e,t){this.providers[e]=t},n.prototype.getContentMenuList=function(e){var t=[];return Object.values(this.providers).forEach((function(n){if(n.getContentMenuList&&"function"==typeof n.getContentMenuList){var o=null;try{o=n.getContentMenuList(e)}catch(e){console.log(e)}o&&t.push.apply(t,o)}})),t},n.prototype.getAPI=function(){return this.api},n}()})),define("dashboard-core/js/features/content/toolbar/ToolbarAPI",[],(function(){return function(){function e(){_classCallCheck(this,e)}return e.prototype.refresh=function(){},e}()})),define("dashboard-core/js/features/content/toolbar/Toolbar",["underscore","./ToolbarAPI","../../../lib/@waca/dashboard-common/dist/core/APIFactory"],(function(e,t,n){return function(){function o(e){var t=e.dashboardAPI,n=e.content;_classCallCheck(this,o),this._toolbarDock=t.getFeature("ToolbarDock"),this._dashboardPreferences=t.getFeature("DashboardPreferences"),this._contentActions=t.getFeature("ContentActions"),this._transactionApi=t.getFeature("Transaction"),this._content=n,this.type=t.getType()}return o.prototype.initialize=function(){"EXPLORE"===this.type.toUpperCase()||(this._internalApi=n.createAPI(this,[t]),this._registerEvents())},o.prototype.getAPI=function(e){if("internal"===e)return this._internalApi},o.prototype._registerEvents=function(){for(var e in this._visEvents={"change:visualization:slots:dataitems:addMapping":this._refreshHandler,"change:visualization:slots:dataitems:removeMapping":this._refreshHandler},this._visEvents)this._content.on(e,this._visEvents[e],this)},o.prototype._deregisterEvents=function(){for(var e in this._visEvents)this._content.off(e,this._visEvents[e],this)},o.prototype.destroy=function(){this._deregisterEvents(),this._content=null},o.prototype._refreshHandler=function(e){var t=e&&e.transactionToken;return this._transactionApi.registerTransactionHandler(t||{},this,function(){this.refresh()}.bind(this),e)},o.prototype.refresh=function(){if(this._dashboardPreferences.getPreference("isToolbarDocked")){var t=[this._content.getId()];if(e.isEqual(t,this._toolbarDock.getOwnerIDs())){var n=this._contentActions.getContentActionList(t);this._toolbarDock.updateODTState(n,t)}}},o}()})),define("dashboard-core/js/features/content/widgetTitleTruncate/WidgetTitleTruncateAPI",[],(function(){return function(){function e(){_classCallCheck(this,e)}return e.prototype.getExtensionHooks=function(){},e.prototype.setUpdateModelContent=function(){},e.prototype.getState=function(){},e.prototype.setTitleHighlighter=function(){},e.prototype.highlightTitle=function(){},e}()})),define("dashboard-core/js/features/content/widgetTitleTruncate/impl/WidgetTitleTruncate",["../../../../lib/@waca/dashboard-common/dist/core/APIFactory","../WidgetTitleTruncateAPI"],(function(e,t){"use strict";var n={truncateTitle:!1};return function(){function o(e){_classCallCheck(this,o),this._content=e.content,this._internal=e.features&&e.features["Dashboard.internal"],this._dashboard=e.dashboardAPI,this._getProperty=this._getModelProp.bind(this),this._state={initialWidgetRenderDone:!1,truncateOn:!1}}return o.prototype._isSmartTitleFeatureEnabled=function(){return!!this._dashboard&&!this._dashboard.getGlassCoreSvc(".FeatureChecker").checkValue("dashboard","SmartTitle","disabled")},o.prototype.getExtensionHooks=function(){if(this._isSmartTitleFeatureEnabled())return{onInit:this._handleTitleTruncation.bind(this),onSetText:this._onSetText.bind(this),onEditStart:this._onEditStart.bind(this),onEditUpdate:this._onEditUpdate.bind(this),onEditEnd:this._onEditEnd.bind(this),isTextWrapOn:this._isTextWrapOn.bind(this),onTextWrapChanged:this._onTextWrapChanged.bind(this)}},o.prototype.setUpdateModelContent=function(e){this._updateModelContent=e},o.prototype.setTitleHighlighter=function(e){this.highlightTitle=e},o.prototype.highlightTitle=function(){this.highlightTitle&&this.highlightTitle()},o.prototype.getState=function(){return{truncateTitleOn:this._content.getPropertyValue("truncateTitle"),truncateTemporarilyOff:this._truncateTemporarilyOff}},o.prototype.getAPI=function(){return e.createAPI(this,[t])},o.prototype._showTitle=function(){return"noTitle"!==this._getProperty("titleMode")},o.prototype._isTextWrapOn=function(){return!!this._isSmartTitleFeatureEnabled()&&!0!==this._getProperty("truncateTitle")},o.prototype._onTextWrapChanged=function(e){this._setProperty("truncateTitle",!e)},o.prototype._handleTitleTruncation=function(e){var t=this;if(this._content){this._onWidgetRenderDone();var n=this._showTitle(),o=this._getProperty("truncateTitle");n&&o&&this._setTruncate(e,!0,!0),this._content.on("change:property:truncateTitle",(function(n){var o=t._showTitle();!0===n.info.value?o&&!t._isTruncateStateSet()&&t._setTruncate(e,!0):o&&t._isTruncateStateSet()&&t._setTruncate(e,!1)}))}},o.prototype._onWidgetRenderDone=function(){var e=this,t=this._content.getFeature("state");return this._state.initialWidgetRenderDone?Promise.resolve(!0):t.whenStatusChanges("rendered").then((function(){e._getProperty=e._getContentProperty.bind(e),e._state.initialWidgetRenderDone=!0}))},o.prototype._getContentProperty=function(e){return this._content.getPropertyValue(e)},o.prototype._getModelProp=function(e){var t=this._internal.getBoardModel(),o=this._content.getId(),i=t.getWidgetModel(o).get(e);return void 0!==i?i:n[e]},o.prototype._setProperty=function(e,t){var n=this;this._state.initialWidgetRenderDone?this._content.setPropertyValue(e,t):this._content.getFeature("state").whenStatusChanges("rendered").then((function(){n._content.setPropertyValue(e,t)}))},o.prototype._isTruncateStateSet=function(){return this._state.truncateOn},o.prototype._setTruncateState=function(e){this._state.truncateOn=e},o.prototype._setTruncate=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t?(this._setTruncateState(!0),e.setTruncateOn(),n&&this._setProperty("truncateTitle",!0)):!1===t&&(this._setTruncateState(!1),e.setTruncateOff(),this._updateModelContent&&this._updateModelContent({}))},o.prototype._onSetText=function(e){if(this._content){var t=this._showTitle(),n=this._getProperty("truncateTitle");t&&n&&this._setTruncate(e,!0,!0)}},o.prototype._onEditStart=function(e){this._disableTruncateOnManualEditStart(e)},o.prototype._onEditUpdate=function(e,t,n,o){e!==n&&this._disableSmartTitleOnManualEdit(o);var i=n+"</span>",r=t.replace("</i>","");-1===(r=(r=r.replace("</u>","")).replace("</b>","")).indexOf(i)&&this._disableSmartTitleOnManualEdit(o)},o.prototype._onEditEnd=function(e){this._restoreTruncateAfterManualEdit(e)},o.prototype._disableTruncateOnManualEditStart=function(e){if(this._content&&!this._truncateTemporarilyOff){var t=this._showTitle(),n=this._content.getPropertyValue("truncateTitle");t&&n&&(this._setTruncate(e,!1),this._truncateTemporarilyOff=!0)}},o.prototype._disableSmartTitleOnManualEdit=function(e){if(this._content){var t=this._content.getPropertyValue("titleMode");t&&"smartTitle"===t&&this._content.setPropertyValue("titleMode","customTitle",{undoRedoTransactionId:e})}},o.prototype._restoreTruncateAfterManualEdit=function(e){if(this._content&&this._truncateTemporarilyOff){var t=this._showTitle(),n=this._content.getPropertyValue("truncateTitle");t&&n&&(this._setTruncate(e,!0),this._truncateTemporarilyOff=!1)}},o}()})),define("dashboard-core/js/features/dashboard/rendererExtension/api/ReactRendererAPI",[],(function(){return function(){function e(){_classCallCheck(this,e)}return e.prototype.canRender=function(){},e.prototype.getComponentList=function(){},e.prototype.registerProvider=function(){},e.prototype.deregisterProvider=function(){},e}()})),define("dashboard-core/js/features/dashboard/rendererExtension/Renderer",["../../../lib/@waca/dashboard-common/dist/core/APIFactory","./api/ReactRendererAPI"],(function(e,t){return function(){function n(o){_classCallCheck(this,n),this._api=e.createAPI(this,[t]),this._providers=[],this._features=o.features}return n.prototype.registerProvider=function(e){-1===this._providers.indexOf(e)&&"function"==typeof e.getComponent&&this._providers.push(e)},n.prototype.deregisterProvider=function(e){var t=this._providers.indexOf(e);-1!==t&&this._providers.splice(t,1)},n.prototype.getAPI=function(){return this._api},n.prototype.canRender=function(){return this._providers.length>0},n.prototype.getComponentList=function(e){var t=[];if(this._providers.length>0)for(var n=0;n<this._providers.length;n++){var o=void 0;try{o=this._providers[n].getComponent(e)}catch(e){this._features.Logger.error("Renderer error ",e)}o&&t.push(o)}return t},n}()})),define("dashboard-core/js/consumeDashboardBundle",(function(){}));