diff --git a/DevApp.ViewModels/App.cs b/DevApp.ViewModels/App.cs index 55e275a1..38b33968 100644 --- a/DevApp.ViewModels/App.cs +++ b/DevApp.ViewModels/App.cs @@ -88,7 +88,7 @@ public App() new NavRoute("Overview", this.GetRoute(nameof(Route.Overview))), new NavRoute("Data Flow Pattern", this.GetRoute(nameof(Route.DataFlow))), new NavRoute("Reactive Programming", this.GetRoute(nameof(Route.Reactive))), - new NavRoute("Micro-Frontend", this.GetRoute(nameof(Route.MicroFrontend))), + //new NavRoute("Micro-Frontend", this.GetRoute(nameof(Route.MicroFrontend))), new NavRoute("Get Started", this.GetRoute(nameof(Route.GetStarted))), new NavGroup diff --git a/DevApp.ViewModels/Docs/FromScratchWebPack.md b/DevApp.ViewModels/Docs/FromScratchWebPack.md index 75524314..74725175 100644 --- a/DevApp.ViewModels/Docs/FromScratchWebPack.md +++ b/DevApp.ViewModels/Docs/FromScratchWebPack.md @@ -80,7 +80,7 @@ Add NPM configuration file _package.json_ with the following content: ] }, "dependencies": { - "dotnetify": "~3.4.0", + "dotnetify": "~3.5.0", "react": "~16.6.0", "react-dom": "~16.6.0" }, diff --git a/DevApp/dist/dist/dotnetify-ko.js b/DevApp/dist/dist/dotnetify-ko.js index c520ae99..050ff7eb 100644 --- a/DevApp/dist/dist/dotnetify-ko.js +++ b/DevApp/dist/dist/dotnetify-ko.js @@ -7,7 +7,7 @@ exports["dotnetify"] = factory(require("knockout"), require("jquery"), require("@aspnet/signalr")); else root["dotnetify"] = factory(root["ko"], root["jQuery"], root["signalR"]); -})(window, function(__WEBPACK_EXTERNAL_MODULE__1__, __WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__14__) { +})(window, function(__WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__3__, __WEBPACK_EXTERNAL_MODULE__15__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; @@ -91,7 +91,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 22); +/******/ return __webpack_require__(__webpack_require__.s = 23); /******/ }) /************************************************************************/ /******/ ([ @@ -122,18 +122,6 @@ module.exports = g; /***/ }), /* 1 */ -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE__1__; - -/***/ }), -/* 2 */ -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE__2__; - -/***/ }), -/* 3 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -252,9 +240,40 @@ var createEventEmitter = exports.createEventEmitter = function createEventEmitte }; }; +var fetch = exports.fetch = function fetch(iMethod, iUrl, iData, iOptions) { + return new Promise(function (resolve, reject) { + var request = new window.XMLHttpRequest(); + request.open(iMethod, iUrl, true); + if (typeof iOptions == 'function') iOptions(request); + + request.onload = function () { + if (request.status >= 200 && request.status < 400) { + var response = request.responseText; + resolve(response); + } else reject(request); + }; + request.onerror = function () { + reject(request); + }; + request.send(iData); + }); +}; + exports.default = new utils(); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0))) +/***/ }), +/* 2 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE__2__; + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE__3__; + /***/ }), /* 4 */ /***/ (function(module, exports) { @@ -311,17 +330,17 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol */ -var _dotnetify2 = __webpack_require__(21); +var _dotnetify2 = __webpack_require__(22); var _dotnetify3 = _interopRequireDefault(_dotnetify2); -var _jquery = __webpack_require__(2); +var _jquery = __webpack_require__(3); var _jquery2 = _interopRequireDefault(_jquery); __webpack_require__(12); -var _knockout = __webpack_require__(1); +var _knockout = __webpack_require__(2); var ko = _interopRequireWildcard(_knockout); @@ -1068,7 +1087,7 @@ var _createClass = function () { function defineProperties(target, props) { for */ -var _utils = __webpack_require__(3); +var _utils = __webpack_require__(1); var _utils2 = _interopRequireDefault(_utils); @@ -1582,11 +1601,11 @@ var _dotnetifyVmRouter = __webpack_require__(6); var _dotnetifyVmRouter2 = _interopRequireDefault(_dotnetifyVmRouter); -var _jquery = __webpack_require__(2); +var _jquery = __webpack_require__(3); var _jquery2 = _interopRequireDefault(_jquery); -var _utils = __webpack_require__(3); +var _utils = __webpack_require__(1); var _utils2 = _interopRequireDefault(_utils); @@ -2210,11 +2229,11 @@ var _dotnetifyKo3 = __webpack_require__(7); var _dotnetifyKo4 = _interopRequireDefault(_dotnetifyKo3); -var _jquery = __webpack_require__(2); +var _jquery = __webpack_require__(3); var _jquery2 = _interopRequireDefault(_jquery); -var _knockout = __webpack_require__(1); +var _knockout = __webpack_require__(2); var ko = _interopRequireWildcard(_knockout); @@ -2336,7 +2355,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol /// (c) 2013 Steven Sanderson, Roy Jacobs - http://knockoutjs.com/ /// License: MIT (http://www.opensource.org/licenses/mit-license.php) (function (d) { - "function" === "function" && "object" === ( false ? undefined : _typeof(exports)) && "object" === ( false ? undefined : _typeof(module)) ? d(__webpack_require__(1), exports) : true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1), exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (d), + "function" === "function" && "object" === ( false ? undefined : _typeof(exports)) && "object" === ( false ? undefined : _typeof(module)) ? d(__webpack_require__(2), exports) : true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(2), exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (d), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : undefined; @@ -2563,7 +2582,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */ (function (e) { - true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(2)], __WEBPACK_AMD_DEFINE_FACTORY__ = (e), + true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(3)], __WEBPACK_AMD_DEFINE_FACTORY__ = (e), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : undefined; @@ -2696,6 +2715,133 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ /* 13 */ /***/ (function(module, exports, __webpack_require__) { +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createWebApiHub = exports.dotNetifyHubWebApi = undefined; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* + Copyright 2019 Dicky Suryadi + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + +var _utils = __webpack_require__(1); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var dotNetifyHubWebApi = exports.dotNetifyHubWebApi = function () { + function dotNetifyHubWebApi(iBaseUrl, iOnRequest) { + _classCallCheck(this, dotNetifyHubWebApi); + + this.mode = 'webapi'; + this.debug = false; + this.isConnected = false; + this.isHubStarted = false; + this.responseEvent = (0, _utils.createEventEmitter)(); + this.reconnectedEvent = (0, _utils.createEventEmitter)(); + this.connectedEvent = (0, _utils.createEventEmitter)(); + this.connectionFailedEvent = (0, _utils.createEventEmitter)(); + this._vmArgs = {}; + + this.baseUrl = iBaseUrl || ''; + this.onRequest = iOnRequest; + } + + _createClass(dotNetifyHubWebApi, [{ + key: 'startHub', + value: function startHub() { + this.isConnected = true; + this.isHubStarted = true; + this.connectedEvent.emit(); + } + }, { + key: 'requestVM', + value: function requestVM(iVMId, iVMArgs) { + var _this = this; + + var vmArgs = iVMArgs || {}; + var vmArgQuery = vmArgs.$vmArg ? '?vmarg=' + JSON.stringify(vmArgs.$vmArg) : ''; + var headers = vmArgs.$headers || {}; + + this._vmArgs[iVMId] = vmArgs; + var url = this.baseUrl + ('/api/dotnetify/vm/' + iVMId + vmArgQuery); + + (0, _utils.fetch)('GET', url, null, function (request) { + Object.keys(headers).forEach(function (key) { + return request.setRequestHeader(key, headers[key]); + }); + if (typeof _this.onRequest == 'function') _this.onRequest(url, request); + }).then(function (response) { + _this.responseEvent.emit(iVMId, response); + }).catch(function (request) { + return console.error('[' + iVMId + '] Request failed', request); + }); + } + }, { + key: 'updateVM', + value: function updateVM(iVMId, iValue) { + var _this2 = this; + + var vmArgs = this._vmArgs[iVMId] || {}; + var vmArgQuery = vmArgs.$vmArg ? '?vmarg=' + JSON.stringify(vmArgs.$vmArg) : ''; + var headers = vmArgs.$headers || {}; + var payload = (typeof iValue === 'undefined' ? 'undefined' : _typeof(iValue)) == 'object' ? JSON.stringify(iValue) : iValue; + + var url = this.baseUrl + ('/api/dotnetify/vm/' + iVMId + vmArgQuery); + + (0, _utils.fetch)('POST', url, payload, function (request) { + request.setRequestHeader('Content-Type', 'application/json'); + Object.keys(headers).forEach(function (key) { + return request.setRequestHeader(key, headers[key]); + }); + if (typeof _this2.onRequest == 'function') _this2.onRequest(url, request, payload); + }).then(function (response) { + _this2.responseEvent.emit(iVMId, response); + }).catch(function (request) { + return console.error('[' + iVMId + '] Update failed', request); + }); + } + }, { + key: 'disposeVM', + value: function disposeVM(iVMId) { + delete this._vmArgs[iVMId]; + } + }], [{ + key: 'create', + value: function create(iBaseUrl, iOnRequest) { + return new dotNetifyHubWebApi(iBaseUrl, iOnRequest); + } + }]); + + return dotNetifyHubWebApi; +}(); + +var createWebApiHub = dotNetifyHubWebApi.create; + +exports.createWebApiHub = createWebApiHub; +exports.default = dotNetifyHubWebApi.create(); + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + "use strict"; /* WEBPACK VAR INJECTION */(function(global) { @@ -2707,7 +2853,6 @@ exports.hasLocalVM = exports.dotNetifyHubLocal = undefined; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /* - import { dotnetify } from 'dotnetify/dist/dotnetify-ko'; Copyright 2019 Dicky Suryadi Licensed under the Apache License, Version 2.0 (the "License"); @@ -2724,7 +2869,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol */ -var _utils = __webpack_require__(3); +var _utils = __webpack_require__(1); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -2819,13 +2964,13 @@ exports.hasLocalVM = hasLocalVM; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0))) /***/ }), -/* 14 */ +/* 15 */ /***/ (function(module, exports) { -module.exports = __WEBPACK_EXTERNAL_MODULE__14__; +module.exports = __WEBPACK_EXTERNAL_MODULE__15__; /***/ }), -/* 15 */ +/* 16 */ /***/ (function(module, exports) { /** @@ -2986,10 +3131,10 @@ function extend() { /***/ }), -/* 16 */ +/* 17 */ /***/ (function(module, exports, __webpack_require__) { -var jQuery = module.exports = __webpack_require__(15), +var jQuery = module.exports = __webpack_require__(16), core_rspace = /\s+/; /** * jQuery Callbacks @@ -3198,7 +3343,7 @@ jQuery.Callbacks = function( options ) { /***/ }), -/* 17 */ +/* 18 */ /***/ (function(module, exports, __webpack_require__) { @@ -3212,7 +3357,7 @@ jQuery.Callbacks = function( options ) { * Library version. */ -var jQuery = module.exports = __webpack_require__(16), +var jQuery = module.exports = __webpack_require__(17), core_slice = Array.prototype.slice; /** @@ -3367,14 +3512,14 @@ jQuery.extend({ /***/ }), -/* 18 */ +/* 19 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = __webpack_require__(17); +module.exports = __webpack_require__(18); /***/ }), -/* 19 */ +/* 20 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3400,7 +3545,7 @@ limitations under the License. var window = window || global || {}; -var jQueryDeferred = __webpack_require__(18); +var jQueryDeferred = __webpack_require__(19); var jQueryShim = jQueryDeferred.extend(function (selector) { if (selector === window || selector.document) return { 0: selector, @@ -3536,7 +3681,7 @@ if (( false ? undefined : _typeof(exports)) === 'object' && ( false ? undefined /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0), __webpack_require__(4)(module))) /***/ }), -/* 20 */ +/* 21 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3564,9 +3709,9 @@ var _createClass = function () { function defineProperties(target, props) { for */ -var _utils = __webpack_require__(3); +var _utils = __webpack_require__(1); -var _jqueryShim = __webpack_require__(19); +var _jqueryShim = __webpack_require__(20); var _jqueryShim2 = _interopRequireDefault(_jqueryShim); @@ -3574,7 +3719,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -var signalRNetCore = __webpack_require__(14); +var signalRNetCore = __webpack_require__(15); var $ = _jqueryShim2.default; var window = window || global || {}; @@ -3993,7 +4138,7 @@ exports.default = dotnetifyHubFactory.create(); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0))) /***/ }), -/* 21 */ +/* 22 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4021,14 +4166,18 @@ var _createClass = function () { function defineProperties(target, props) { for */ -var _dotnetifyHub = __webpack_require__(20); +var _dotnetifyHub = __webpack_require__(21); var _dotnetifyHub2 = _interopRequireDefault(_dotnetifyHub); -var _dotnetifyHubLocal = __webpack_require__(13); +var _dotnetifyHubLocal = __webpack_require__(14); var _dotnetifyHubLocal2 = _interopRequireDefault(_dotnetifyHubLocal); +var _dotnetifyHubWebapi = __webpack_require__(13); + +var _dotnetifyHubWebapi2 = _interopRequireDefault(_dotnetifyHubWebapi); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } @@ -4084,7 +4233,7 @@ var dotnetifyFactory = exports.dotnetifyFactory = function () { // Generic connect function for non-React app. connect: function connect(iVMId, iOptions) { - dotnetify.react.connect(iVMId, null, iOptions); + return dotnetify.react.connect(iVMId, {}, iOptions); }, @@ -4094,6 +4243,12 @@ var dotnetifyFactory = exports.dotnetifyFactory = function () { }, + // Creates a Web API hub client. + createWebApiHub: function createWebApiHub(baseUrl, onRequestHandler) { + return (0, _dotnetifyHubWebapi.createWebApiHub)(baseUrl, onRequestHandler); + }, + + // Configures hub connection to SignalR hub server. initHub: function initHub(hub, hubPath, hubServerUrl, hubLib) { var _this = this; @@ -4117,10 +4272,11 @@ var dotnetifyFactory = exports.dotnetifyFactory = function () { // Used by a view to select a hub, and provides the opportunity to override any connect info. selectHub: function selectHub(vmConnectArgs) { - vmConnectArgs = vmConnectArgs || { options: {} }; + vmConnectArgs = vmConnectArgs || {}; + vmConnectArgs.options = vmConnectArgs.options || {}; var override = typeof this.connectHandler == 'function' && this.connectHandler(vmConnectArgs) || {}; if (!override.hub) { - override.hub = (0, _dotnetifyHubLocal.hasLocalVM)(vmConnectArgs.vmId) ? _dotnetifyHubLocal2.default : this.initHub(); + override.hub = (0, _dotnetifyHubLocal.hasLocalVM)(vmConnectArgs.vmId) ? _dotnetifyHubLocal2.default : vmConnectArgs.options.webApi ? _dotnetifyHubWebapi2.default : this.initHub(); override.hub.debug = this.debug; } return Object.assign(vmConnectArgs, override); @@ -4184,7 +4340,7 @@ var dotnetifyFactory = exports.dotnetifyFactory = function () { exports.default = dotnetifyFactory.create(); /***/ }), -/* 22 */ +/* 23 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; diff --git a/DevApp/dist/dist/dotnetify-ko.js.map b/DevApp/dist/dist/dotnetify-ko.js.map index bacc3664..9bfd938c 100644 --- a/DevApp/dist/dist/dotnetify-ko.js.map +++ b/DevApp/dist/dist/dotnetify-ko.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://dotnetify/webpack/universalModuleDefinition","webpack://dotnetify/webpack/bootstrap","webpack://dotnetify/(webpack)/buildin/global.js","webpack://dotnetify/external {\"commonjs\":\"knockout\",\"commonjs2\":\"knockout\",\"amd\":\"knockout\",\"root\":\"ko\"}","webpack://dotnetify/external {\"commonjs\":\"jquery\",\"commonjs2\":\"jquery\",\"amd\":\"jquery\",\"root\":\"jQuery\"}","webpack://dotnetify/./src/dotnetify/libs/utils.js","webpack://dotnetify/(webpack)/buildin/module.js","webpack://dotnetify/./src/dotnetify/knockout/dotnetify-ko.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-vm-router.js","webpack://dotnetify/./src/dotnetify/knockout/dotnetify-ko.vm-router.js","webpack://dotnetify/./src/dotnetify/libs/path.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-router.js","webpack://dotnetify/./src/dotnetify/knockout/dotnetify-ko.router.js","webpack://dotnetify/./src/dotnetify/knockout/knockout.mapping-latest.js","webpack://dotnetify/./src/dotnetify/knockout/jquery-ui-widget.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-hub-local.js","webpack://dotnetify/external {\"commonjs\":\"@aspnet/signalr\",\"commonjs2\":\"@aspnet/signalr\",\"amd\":\"@aspnet/signalr\",\"root\":\"signalR\"}","webpack://dotnetify/./node_modules/jquery-deferred/lib/jquery-core.js","webpack://dotnetify/./node_modules/jquery-deferred/lib/jquery-callbacks.js","webpack://dotnetify/./node_modules/jquery-deferred/lib/jquery-deferred.js","webpack://dotnetify/./node_modules/jquery-deferred/index.js","webpack://dotnetify/./src/dotnetify/libs/jquery-shim.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-hub.js","webpack://dotnetify/./src/dotnetify/core/dotnetify.js","webpack://dotnetify/./src/dotnetify/knockout/index.js"],"names":["window","global","utils","iStr","indexOf","length","substr","iStr1","iStr2","toLowerCase","iValue","slice","iEvent","Event","dispatchEvent","event","document","createEvent","initEvent","iArray","iFilter","Array","isArray","filter","createEventEmitter","subscribers","emit","args","handled","forEach","subscriber","subscribe","includes","push","x","ko","mapping","require","dotnetify","_dotnetify","version","controller","_responseSubs","_connectedSubs","_responseVM","iVMId","iVMData","vmType","vmInstanceId","path","split","selector","i","element","checkServerSideException","data","UpdateVM","init","self","hub","selectHub","applyWidget","$","each","responseEvent","connectedEvent","setTimeout","offline","isConnected","isOffline","trigger","offlineTimeout","startHub","stateChanged","state","debug","console","log","destroy","iParent","elems","find","addBack","toArray","widget","elem","getViewModels","map","VM","iElement","plugins","_create","VMType","attr","VMId","instanceId","parents","_ListenToOfflineEvent","_RequestVM","_GetOfflineVM","error","_destroy","OfflineFn","off","pluginId","plugin","$destroy","apply","hasOwnProperty","e","stack","disposeVM","fromJS","JSON","parse","$vmId","$element","$dotnetify","$vmOffline","observable","IsOffline","_AddBuiltInFunctions","$init","applyBindings","$serverUpdate","_OnComponentReady","$ready","_SubscribeObservables","offlineCacheFn","vmUpdate","_PreProcess","debugFn","$preventBinding","fn","$addList","iList","iNewItem","newItem","key","match","arrayFirst","replace","$updateList","Object","keys","isObservable","prop","$removeList","iCriteria","remove","$on","iProperty","iCallback","iNewValue","$once","subscription","dispose","$loadView","iTargetSelector","iViewUrl","iJsModuleUrl","iVmArg","iCallbackFn","empty","load","isEmptyObject","stringify","getScript","$inject","iContext","iObject","idx","item","_Inject","jsModule","jsInstance","assign","prototype","cachedData","warn","one","bind","pureComputed","$subscribe","retry","checkComponentReadyFn","isReady","components","grep","childElementCount","_OnValueChanged","iVMPath","update","extend","updateVM","iVMUpdate","exec","list","Error","vmArg","parseJSON","requestVM","iParam","property","charAt","isNaN","index","bindingHandlers","vmItemKey","preprocess","value","valueAccessor","allBindings","viewModel","bindingContext","items","get","vmCommand","vm","$root","fnName","fnArg","matchFnNameArg","toString","trim","matchFnName","outerHTML","getFn","unwrap","newValueAccessor","$parent","click","vmOnce","vmOn","once","dotnetifyVMRouter","router","routes","iPath","$dispatch","State","RoutingState","Active","iArg","preventDefault","currentTarget","pathname","pushState","hasRoutingState","Root","_absRoot","absRoot","VMRoot","root","templates","Templates","initRoot","urlPattern","template","UrlPattern","Id","mapUrl","toUrl","mapTo","urlPath","param","iParams","routeTo","activeUrl","routeUrl","raiseRoutedEvent","iRoute","equal","Path","unmountView","getScripts","when","done","callbackFn","call","iHtmlElement","mountViewFunc","target","querySelector","firstChild","removeChild","appendChild","iTarget","iJSModuleUrl","Target","ViewUrl","JSModuleUrl","iTemplate","force","TemplateId","RedirectRoot","redirectRoot","redirectRootPath","urlRedirect","absRootPath","some","Url","$template","pathToRoute","url","iDisableEvent","isRedirect","viewModels","vmOther","$router","VMArg","onRouteEnter","getElementById","redirect","loadView","dispatchActiveRoutingState","onRouteExit","$route","redirectUrlPath","startsWith","routeElem","templateWrapper","routingStateWrapper","routingState","Origin","dotnetifyKoVMRouter","iVM","iDotNetifyRouter","vmElems","overrideUrl","defined","core","route","rescue","history","initial","title","supported","dispatch","fallback","location","hash","popState","initialPop","popped","href","URL","listen","onpopstate","parameterize","params","possible_routes","j","compare","result","undefined","partition","search","join","passed_route","previous_route","matched_route","current","previous","do_exit","run","documentMode","onhashchange","setInterval","action","do_enter","to","enter","fns","concat","exit","parts","options","re","text","halt_execution","dotnetifyRouter","iFn","iUrlPath","matched","iUrl","iState","iTitle","initRouting","vmData","vmRoute","d","exports","module","f","y","b","c","a","getType","l","n","t","g","E","z","L","ignore","h","include","copy","observe","mappedProperties","copiedProperties","arrayGetDistinctValues","F","k","unwrapObservable","isMapped","p","create","Function","G","dependentObservable","deferEvaluation","M","H","isWriteableObservable","read","arrayRemoveItem","arguments","write","computed","parent","skip","N","u","v","I","s","m","observableArray","mappedRemove","mappedRemoveAll","C","arrayIndexOf","mappedDestroy","mappedDestroyAll","mappedIndexOf","mappedCreate","sort","compareArrays","J","A","r","B","q","w","status","D","K","O","arrayChanged","arrayForEach","P","save","Q","R","arrayMap","T","S","pop","fromJSON","parseJson","updateFromJS","updateFromJSON","toJS","resetDefaultOptions","visitModel","toJSON","stringifyJson","defaultOptions","constructor","Date","visitedObjects","parentName","cleanData","_data","triggerHandler","o","Widget","expr","_createWidget","_proto","_childConstructors","isFunction","_super","_superApply","widgetEventPrefix","namespace","widgetName","widgetFullName","bridge","isPlainObject","jquery","pushStack","option","_init","defaultElement","disabled","uuid","eventNamespace","bindings","hoverable","focusable","_on","style","ownerDocument","defaultView","parentWindow","_getCreateOptions","_trigger","_getCreateEventData","noop","unbind","removeData","camelCase","removeAttr","removeClass","shift","_setOptions","_setOption","toggleClass","enable","disable","add","hasClass","guid","delegate","_off","undelegate","not","_delay","_hoverable","mouseenter","addClass","mouseleave","_focusable","focusin","focusout","type","originalEvent","isDefaultPrevented","show","hide","effect","duration","complete","delay","effects","easing","queue","normalize","hasLocalVM","vmId","onConnect","dotNetifyHubLocal","mode","isHubStarted","reconnectedEvent","connectionFailedEvent","iVMArgs","$pushUpdate","onDispatch","onDestroy","jQueryDeferred","jQueryShim","on","iHandler","addEventListener","removeEventListener","events","handlers","splice","iArgs","arg","handler","request","XMLHttpRequest","open","onload","response","responseText","innerHTML","send","abort","reason","support","cors","inArray","iItem","makeArray","merge","iArray1","iArray2","iObj","ajax","iOptions","onreadystatechange","readyState","_hasError","success","setRequestHeader","contentType","iSuccess","promise","Deferred","head","getElementsByTagName","script","createElement","src","resolve","jQuery","signalRNetCore","dotnetifyHubFactory","dotnetifyHub","reconnectDelay","reconnectRetry","_startInfo","server","request_VM","update_VM","dispose_VM","hubOptions","doneHandler","failHandler","forceRestart","_doneHandler","_failHandler","failHander","ex","start","fail","err","iHubPath","iServerUrl","signalR","HubConnection","defineProperty","_connection","connection","connectionState","hubPath","_reconnectCount","_startDoneHandler","_startFailHandler","_disconnectedHandler","_stateChangedHandler","iNewState","_onDisconnected","_changeState","stateText","_startConnection","iHubOptions","iTransportArray","transport","HubConnectionBuilder","withUrl","build","client","response_VM","onclose","then","catch","transportOptions","webSockets","serverSentEvents","longPolling","disconnected","reconnect","iStartHubFunc","invoke","makeProxyCallback","callback","registerHubProxies","instance","shouldSubscribe","memberKey","memberValue","subscriptionMethod","hubName","hubConnection","createHubProxies","proxies","starting","_registerSubscribedHubs","createHubProxy","useDefaultPath","set","val","dotNetifyHub","connected","deferred","source","message","newState","dotnetifyFactory","_vmAccessors","connectionStateHandler","connectHandler","hubServerUrl","connect","react","createHub","hubLib","initHub","handleConnectionStateChanged","vmConnectArgs","override","localHub","addVMAccessor","vmAccessor","iExceptionHandler","exception","name","ExceptionType","Message","reduce","prev","iException","iHub"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;AClFA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;;AAE5C;;;;;;;ACnBA,gD;;;;;;ACAA,gD;;;;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;AAeA,IAAMA,SAASA,UAAUC,MAAV,IAAoB,EAAnC;;IAEMC,K;;;;;;;;AACJ;yBACKC,I,EAAM;AACT,UAAI,OAAOA,IAAP,KAAgB,QAApB,EAA8B,OAAO,EAAP;;AAE9B,aAAOA,KAAKC,O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AArD,EAAiE;AAC/DpW,WAAGoW,SAAH,CAAajhB,KAAb;AACD;AACF;;;;;;kBAGY,IAAIygB,iBAAJ,E;QACNH,U,GAAAA,U;;;;;;;ACpFT,iD;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;AAGD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,UAAU,YAAY;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,UAAU,YAAY;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,QAAQ,YAAY;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;ACxJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,oCAAoC;AAC9C;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;AC3MA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA,MAAM;AACN,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;;AAEA;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":"dotnetify-ko.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"knockout\"), require(\"jquery\"), require(\"@aspnet/signalr\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"knockout\", \"jquery\", \"@aspnet/signalr\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"dotnetify\"] = factory(require(\"knockout\"), require(\"jquery\"), require(\"@aspnet/signalr\"));\n\telse\n\t\troot[\"dotnetify\"] = factory(root[\"ko\"], root[\"jQuery\"], root[\"signalR\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__1__, __WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__14__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 22);\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","module.exports = __WEBPACK_EXTERNAL_MODULE__1__;","module.exports = __WEBPACK_EXTERNAL_MODULE__2__;","/* \r\nCopyright 2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nconst window = window || global || {};\r\n\r\nclass utils {\r\n // Trim slashes from start and end of string.\r\n trim(iStr) {\r\n if (typeof iStr !== 'string') return '';\r\n\r\n while (iStr.indexOf('/', iStr.length - 1) >= 0) iStr = iStr.substr(0, iStr.length - 1);\r\n while (iStr.indexOf('/') == 0) iStr = iStr.substr(1, iStr.length - 1);\r\n return iStr;\r\n }\r\n\r\n // Match two strings case-insensitive.\r\n equal(iStr1, iStr2) {\r\n return iStr1 != null && iStr2 != null && iStr1.toLowerCase() == iStr2.toLowerCase();\r\n }\r\n\r\n // Whether the string starts or ends with a value.\r\n startsWith(iStr, iValue) {\r\n return iStr.toLowerCase().slice(0, iValue.length) == iValue.toLowerCase();\r\n }\r\n\r\n endsWith(iStr, iValue) {\r\n return iValue == '' || iStr.toLowerCase().slice(-iValue.length) == iValue.toLowerCase();\r\n }\r\n\r\n // Dispatch event with IE polyfill.\r\n dispatchEvent(iEvent) {\r\n if (typeof Event === 'function') window.dispatchEvent(new Event(iEvent));\r\n else {\r\n var event = document.createEvent('CustomEvent');\r\n event.initEvent(iEvent, true, true);\r\n window.dispatchEvent(event);\r\n }\r\n }\r\n\r\n grep(iArray, iFilter) {\r\n return Array.isArray(iArray) ? iArray.filter(iFilter) : [];\r\n }\r\n}\r\n\r\nexport const createEventEmitter = _ => {\r\n let subscribers = [];\r\n return {\r\n emit(...args) {\r\n let handled = false;\r\n subscribers.forEach(subscriber => {\r\n handled = subscriber(...args) || handled;\r\n });\r\n return handled;\r\n },\r\n\r\n subscribe(subscriber) {\r\n !subscribers.includes(subscriber) && subscribers.push(subscriber);\r\n return () => (subscribers = subscribers.filter(x => x !== subscriber));\r\n }\r\n };\r\n};\r\n\r\nexport default new utils();\r\n","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","/* \r\nCopyright 2015-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport _dotnetify from '../core/dotnetify';\r\nimport $ from 'jquery';\r\nimport './jquery-ui-widget';\r\nimport * as ko from 'knockout';\r\n\r\nko.mapping = require('./knockout.mapping-latest');\r\n\r\nconst window = window || global || {};\r\nlet dotnetify = window.dotnetify || _dotnetify;\r\n\r\ndotnetify.ko = {\r\n version: '2.0.0',\r\n controller: dotnetify,\r\n\r\n // Internal variables.\r\n _responseSubs: null,\r\n _connectedSubs: null,\r\n\r\n _responseVM: function(iVMId, iVMData) {\r\n // Construct a selector from iVMId to find the associated widget.\r\n // First parse the instance Id out of the string, if present.\r\n var vmType = iVMId;\r\n var vmInstanceId = null;\r\n if (vmType.indexOf('$') >= 0) {\r\n var path = iVMId.split('$');\r\n vmType = path[0];\r\n vmInstanceId = path[1];\r\n }\r\n\r\n var selector = \"[data-vm='\" + vmType + \"']\";\r\n\r\n // If present, add the master view models to the selector.\r\n var path = vmType.split('.');\r\n if (path.length > 1) {\r\n selector = '';\r\n let i = 0;\r\n for (i = 0; i < path.length - 1; i++) selector += \"[data-master-vm='\" + path[i] + \"'] \";\r\n selector += \"[data-vm='\" + path[i] + \"']\";\r\n }\r\n\r\n // If present, add the instance Id to the selector.\r\n if (vmInstanceId != null) selector += \"[data-vm-id='\" + vmInstanceId + \"']\";\r\n\r\n // Use the selector to locate the view model widget and pass the data.\r\n var element = $(selector);\r\n if (element.length > 0) {\r\n dotnetify.checkServerSideException(iVMId, iVMData);\r\n element.data('ko-dotnetify').UpdateVM(iVMData);\r\n return true;\r\n }\r\n return false;\r\n },\r\n\r\n init: function() {\r\n const self = dotnetify.ko;\r\n const hub = dotnetify.selectHub().hub;\r\n\r\n var applyWidget = function() {\r\n $.each($('[data-vm]'), function() {\r\n $(this).dotnetify();\r\n });\r\n };\r\n\r\n if (!self._responseSubs) self._responseSubs = hub.responseEvent.subscribe(self._responseVM);\r\n\r\n if (!self._connectedSubs)\r\n self._connectedSubs = hub.connectedEvent.subscribe(function() {\r\n applyWidget();\r\n });\r\n\r\n // If offline mode is enabled, apply the widget anyway when there's no connection.\r\n setTimeout(function() {\r\n if (dotnetify.offline && !hub.isConnected) {\r\n applyWidget();\r\n dotnetify.isOffline = true;\r\n $(document).trigger('offline', dotnetify.isOffline);\r\n }\r\n }, dotnetify.offlineTimeout);\r\n\r\n dotnetify.startHub(hub);\r\n\r\n // Use SignalR event to raise the offline event with true/false argument.\r\n hub.stateChanged(function(state) {\r\n if (dotnetify.debug) console.log('SignalR: ' + state);\r\n\r\n var isOffline = state != 'connected';\r\n if (dotnetify.isOffline != isOffline) {\r\n dotnetify.isOffline = isOffline;\r\n $(document).trigger('offline', dotnetify.isOffline);\r\n }\r\n });\r\n\r\n if (dotnetify.offline) applyWidget();\r\n },\r\n\r\n destroy: function(iParent) {\r\n const elems = iParent ? $(iParent).find('[data-vm]').addBack(iParent) : $('[data-vm]');\r\n elems.toArray().forEach(elem => {\r\n const widget = dotnetify.ko.widget(elem);\r\n if (widget) widget.destroy();\r\n });\r\n },\r\n\r\n // Get all view models.\r\n getViewModels: function() {\r\n const self = dotnetify.ko;\r\n const elems = $('[data-vm]').toArray();\r\n return elems\r\n .map(elem => {\r\n const widget = dotnetify.ko.widget(elem);\r\n return widget ? widget.VM : null;\r\n })\r\n .filter(x => x);\r\n },\r\n\r\n widget: function(iElement) {\r\n return $(iElement).data('ko-dotnetify');\r\n },\r\n\r\n plugins: {}\r\n};\r\n\r\n$(function() {\r\n dotnetify.ko.init();\r\n});\r\n\r\n$.widget('ko.dotnetify', {\r\n // Widget constructor.\r\n _create: function() {\r\n var self = this;\r\n\r\n self.VMType = self.element.attr('data-vm');\r\n self.VMId = self.VMType;\r\n\r\n // If an instance Id is specified, add it to VMId.\r\n var instanceId = self.element.attr('data-vm-id');\r\n if (instanceId != null) self.VMId += '$' + instanceId;\r\n\r\n // If inside master view scope, combine the names into VMId.\r\n $.each(self.element.parents('[data-master-vm]'), function() {\r\n self.VMId = $(this).attr('data-master-vm') + '.' + self.VMId;\r\n });\r\n\r\n // Handle offline mode.\r\n if (dotnetify.offline) self._ListenToOfflineEvent();\r\n\r\n // Request the server VM.\r\n if (self.VMId != null) {\r\n if (dotnetify.hub.isConnected) self._RequestVM();\r\n else if (dotnetify.offline) self._GetOfflineVM();\r\n }\r\n else console.error(\"ERROR: dotnetify - failed to find 'data-vm' attribute in the element where .dotnetify() was applied.\");\r\n },\r\n\r\n // Widget destructor.\r\n _destroy: function() {\r\n try {\r\n var self = this;\r\n\r\n // Stop listening to offline event.\r\n if (typeof self.OfflineFn === 'function') $(document).off('offline', self.OfflineFn);\r\n\r\n // Call any plugin's $destroy function if provided.\r\n $.each(dotnetify.plugins, function(pluginId, plugin) {\r\n if (typeof plugin['$destroy'] === 'function') plugin.$destroy.apply(self.VM);\r\n });\r\n\r\n // Call view model's $destroy function if provided.\r\n if (self.VM != null && self.VM.hasOwnProperty('$destroy')) self.VM.$destroy();\r\n } catch (e) {\r\n console.error(e.stack);\r\n }\r\n\r\n dotnetify.hub.disposeVM(self.VMId);\r\n },\r\n\r\n // Convert the server VM into knockout VM.\r\n UpdateVM: function(iVMData) {\r\n var self = this;\r\n try {\r\n // If no view model yet, create one from the server data.\r\n if (self.VM == null) {\r\n self.VM = ko.mapping.fromJS(JSON.parse(iVMData));\r\n\r\n // Set essential info to the view model.\r\n self.VM.$vmId = self.VMId;\r\n self.VM.$element = self.element;\r\n self.VM.$dotnetify = dotnetify.ko;\r\n\r\n // Add an observable to carry the offline state.\r\n if (dotnetify.offline) self.VM.$vmOffline = ko.observable(self.IsOffline);\r\n\r\n // Add built-in functions to the view model.\r\n this._AddBuiltInFunctions();\r\n\r\n // Call any plugin's $init function if provided to give a chance to do\r\n // things before initial binding is applied.\r\n $.each(dotnetify.ko.plugins, function(pluginId, plugin) {\r\n if (typeof plugin['$init'] === 'function') plugin.$init.apply(self.VM);\r\n });\r\n\r\n // Call view model's init function if provided.\r\n if (typeof self.VM['$init'] === 'function') self.VM.$init();\r\n\r\n // Apply knockout view model to the HTML element.\r\n try {\r\n ko.applyBindings(self.VM, self.element[0]);\r\n } catch (e) {\r\n console.error(e.stack);\r\n }\r\n\r\n // Enable server update so that every changed value goes to server.\r\n self.VM.$serverUpdate = true;\r\n\r\n // Raise the ready event after all knockout components are ready.\r\n self._OnComponentReady(function() {\r\n // Call any plugin's $ready function if provided to give a chance to do\r\n // things when the view model is ready.\r\n $.each(dotnetify.ko.plugins, function(pluginId, plugin) {\r\n if (typeof plugin['$ready'] === 'function') plugin.$ready.apply(self.VM);\r\n });\r\n\r\n // Subscribe to change events to allow sending updates back to server.\r\n self._SubscribeObservables(self.VM);\r\n\r\n // Call view model's $ready function if provided.\r\n if (typeof self.VM['$ready'] === 'function') self.VM.$ready();\r\n\r\n // Send 'ready' event after a new view model was received.\r\n self.element.trigger('ready', { VMId: self.VMId, VM: self.VM });\r\n });\r\n\r\n // Cache the VM data in case of offline mode.\r\n if (dotnetify.offline && dotnetify.hub.isConnected && typeof dotnetify.offlineCacheFn === 'function')\r\n dotnetify.offlineCacheFn(self.VMId + self.element.attr('data-vm-arg'), iVMData);\r\n }\r\n else {\r\n // Disable server update because we're going to update the value in the knockout VM\r\n // and that will trigger change event back to server if we don't stop it now.\r\n self.VM.$serverUpdate = false;\r\n\r\n var vmUpdate = JSON.parse(iVMData);\r\n self._PreProcess(vmUpdate);\r\n\r\n try {\r\n ko.mapping.fromJS(vmUpdate, self.VM);\r\n } catch (e) {\r\n console.error(e.stack);\r\n }\r\n\r\n // Don't forget to re-enable sending changed values to server.\r\n self.VM.$serverUpdate = true;\r\n\r\n // Subscribe to change events to allow sending updates back to server,\r\n // but do it after all the knockout components are ready.\r\n self._OnComponentReady(function() {\r\n self._SubscribeObservables(self.VM);\r\n });\r\n }\r\n } catch (e) {\r\n console.error(e.stack);\r\n }\r\n\r\n if (dotnetify.debug) {\r\n console.log('[' + self.VMId + '] received> ');\r\n console.log(JSON.parse(iVMData));\r\n\r\n if (dotnetify.debugFn != null) dotnetify.debugFn(self.VMId, 'received', JSON.parse(iVMData));\r\n }\r\n },\r\n\r\n // Adds built-in functions to the view model.\r\n _AddBuiltInFunctions: function() {\r\n var self = this;\r\n\r\n // Executes the given function in a scope where server update is temporarily disabled.\r\n self.VM.$preventBinding = function(fn) {\r\n self.VM.$serverUpdate = false;\r\n fn.apply(self.VM);\r\n self.VM.$serverUpdate = true;\r\n };\r\n\r\n // Adds a new item to an observable array.\r\n self.VM.$addList = function(iList, iNewItem) {\r\n const newItem = Array.isArray(iNewItem) ? iNewItem : ko.mapping.fromJS(iNewItem);\r\n\r\n // Check if the list already has an item with the same key. If so, replace it.\r\n var key = iList()['$vmKey'];\r\n if (key != null) {\r\n var match = ko.utils.arrayFirst(iList(), function(i) {\r\n return i[key]() == newItem[key]();\r\n });\r\n if (match != null) {\r\n iList.replace(match, newItem);\r\n return;\r\n }\r\n }\r\n iList.push(newItem);\r\n };\r\n\r\n // Updates existing item to an observable array.\r\n self.VM.$updateList = function(iList, iNewItem) {\r\n var newItem = ko.mapping.fromJS(iNewItem);\r\n\r\n // Check if the list already has an item with the same key. If so, update it.\r\n var key = iList()['$vmKey'];\r\n if (key != null) {\r\n if (!newItem.hasOwnProperty(key)) {\r\n console.error(\"ERROR: object requires property '\" + key + \"'\");\r\n return;\r\n }\r\n var match = ko.utils.arrayFirst(iList(), function(i) {\r\n return i[key]() == newItem[key]();\r\n });\r\n if (match != null) {\r\n Object.keys(newItem).forEach(prop => {\r\n if (ko.isObservable(newItem[prop])) match[prop](newItem[prop]());\r\n });\r\n\r\n return;\r\n }\r\n }\r\n iList.push(newItem);\r\n };\r\n\r\n // Removes an item from an observable array.\r\n // Unlike the push operation, the ko remove operation will cause the list to trigger\r\n // change event, therefore disable server update while we do this.\r\n self.VM.$removeList = function(iList, iCriteria) {\r\n self.VM.$preventBinding(function() {\r\n iList.remove(iCriteria);\r\n });\r\n };\r\n\r\n // Listens to a view model property change event.\r\n self.VM.$on = function(iProperty, iCallback) {\r\n iProperty.subscribe(function(iNewValue) {\r\n iCallback(iNewValue);\r\n });\r\n };\r\n\r\n // Listens to a view model property change event once.\r\n self.VM.$once = function(iProperty, iCallback) {\r\n var subscription = iProperty.subscribe(function(iNewValue) {\r\n subscription.dispose();\r\n iCallback(iNewValue);\r\n });\r\n };\r\n\r\n // Loads a view into a target element.\r\n // Method parameters: TargetSelector, ViewUrl, [iJsModuleUrl], [iVmArg], iCallbackFn\r\n self.VM.$loadView = function(iTargetSelector, iViewUrl, iJsModuleUrl, iVmArg, iCallbackFn) {\r\n if (typeof iJsModuleUrl === 'object' && iJsModuleUrl != null) {\r\n iCallbackFn = iVmArg;\r\n iVmArg = iJsModuleUrl;\r\n iJsModuleUrl = null;\r\n }\r\n else if (typeof iJsModuleUrl === 'function') {\r\n iCallbackFn = iJsModuleUrl;\r\n iJsModuleUrl = null;\r\n }\r\n else if (typeof iVmArg === 'function') {\r\n iCallbackFn = iVmArg;\r\n iVmArg = null;\r\n }\r\n\r\n // If no view URL is given, empty the target DOM element.\r\n if (iViewUrl == null || iViewUrl == '') {\r\n $(iTargetSelector).empty();\r\n return;\r\n }\r\n\r\n // Loads the view template to the target DOM element.\r\n $(iTargetSelector).load(iViewUrl, null, function() {\r\n // Adds view model arguments when provided.\r\n if (iVmArg != null && !$.isEmptyObject(iVmArg)) $(this).attr('data-vm-arg', JSON.stringify(iVmArg));\r\n\r\n // Call the callback function.\r\n if (typeof iCallbackFn === 'function') iCallbackFn.apply(this);\r\n\r\n // Load the Javascript module if specified.\r\n if (iJsModuleUrl != null) {\r\n $.getScript(iJsModuleUrl, function() {\r\n dotnetify.ko.init();\r\n });\r\n }\r\n else dotnetify.ko.init();\r\n });\r\n };\r\n\r\n // Injects a context with observables mapped from an object. Context can be an object or an observable array.\r\n self.VM.$inject = function(iContext, iObject) {\r\n if (ko.isObservable(iContext) && 'push' in iContext)\r\n $.each(iContext(), function(idx, item) {\r\n self._Inject(item, iObject);\r\n });\r\n else self._Inject(iContext, iObject);\r\n };\r\n\r\n // Map the module in global namespace whose name matches the view model type.\r\n var jsModule = window[self.VMType];\r\n if (jsModule != null) {\r\n // If the module is a Typescript class, instantiate it.\r\n if (typeof jsModule === 'function') {\r\n let jsInstance = new jsModule(self.VM);\r\n Object.assign(jsInstance, jsModule.prototype);\r\n self._Inject(self.VM, jsInstance);\r\n }\r\n else self._Inject(self.VM, jsModule);\r\n }\r\n\r\n // Add plugin functions.\r\n $.each(dotnetify.ko.plugins, function(pluginId, plugin) {\r\n if (plugin.hasOwnProperty('$inject')) plugin.$inject(self.VM);\r\n });\r\n },\r\n\r\n // Gets offline view model data from the local cache.\r\n _GetOfflineVM: function() {\r\n var self = this;\r\n\r\n if (typeof dotnetify.offlineCacheFn === 'function') {\r\n // SignalR connection isn't available; use cached VM data for offline mode.\r\n var cachedData = dotnetify.offlineCacheFn(self.VMId + self.element.attr('data-vm-arg'));\r\n if (cachedData == null) cachedData = dotnetify.offlineCacheFn(self.VMId);\r\n\r\n if (cachedData != null) {\r\n if (dotnetify.debug) console.warn('[' + self.VMId + '] using offline data');\r\n\r\n self.IsOffline = true;\r\n self.UpdateVM(cachedData);\r\n }\r\n }\r\n },\r\n\r\n // Initializes offline mode handling.\r\n _ListenToOfflineEvent: function() {\r\n var self = this;\r\n\r\n self.IsOffline = false;\r\n self.OfflineFn = function(event, isOffline) {\r\n if (self.VM != null && self.VM.hasOwnProperty('$vmOffline')) self.VM.$vmOffline(isOffline);\r\n\r\n self.IsOffline = isOffline;\r\n if (!isOffline) self._RequestVM();\r\n else if (self.VM == null) self._GetOfflineVM();\r\n\r\n $(document).one('offline', self.OfflineFn.bind(self));\r\n };\r\n\r\n $(document).one('offline', self.OfflineFn.bind(self));\r\n },\r\n\r\n // Inject the context with observables mapped from an object.\r\n // Properties that start with underscore are mapped to observables.\r\n // Functions that start with underscore are mapped to pure computed observables.\r\n _Inject: function(iContext, iObject) {\r\n Object.keys(iObject).forEach(prop => {\r\n // Skip if the context already has a property with the same name.\r\n if (iContext.hasOwnProperty(prop)) return;\r\n\r\n if (typeof iObject[prop] === 'function') {\r\n if (prop.indexOf('_') == 0) {\r\n iContext[prop] = ko.pureComputed(iObject[prop], iContext);\r\n }\r\n else iContext[prop] = iObject[prop];\r\n }\r\n else if (prop.indexOf('_') == 0) {\r\n iContext[prop] = ko.observable(iObject[prop]);\r\n\r\n // Prevent it from being subscribed so it won't get sent to server.\r\n iContext[prop].$subscribe = true;\r\n }\r\n else iContext[prop] = iObject[prop];\r\n });\r\n },\r\n\r\n // Calls the callback function only if all the knockout components are ready.\r\n // This is a workaround until knockout issue #1533 is closed.\r\n _OnComponentReady: function(iCallbackFn) {\r\n var self = this;\r\n var retry = 0;\r\n var checkComponentReadyFn = function() {\r\n var isReady = true;\r\n\r\n // Assume the knockout components are those with 'params' attribute,\r\n // and that it's ready if it has at least one child element.\r\n var components = self.element.find('[params]');\r\n if (components.length > 0)\r\n isReady =\r\n $.grep(components, function(i) {\r\n return i.childElementCount == 0;\r\n }).length == 0;\r\n\r\n if (isReady || retry++ > 3) iCallbackFn();\r\n else setTimeout(checkComponentReadyFn, 250);\r\n };\r\n\r\n checkComponentReadyFn();\r\n },\r\n\r\n // On value changed from a knockout VM's observable, update the server VM.\r\n _OnValueChanged: function(iVMPath, iNewValue) {\r\n var update = {};\r\n update[iVMPath] = iNewValue instanceof Object ? $.extend({}, iNewValue) : iNewValue;\r\n\r\n if (dotnetify.hub.isConnected) {\r\n try {\r\n dotnetify.hub.updateVM(this.VMId, update);\r\n\r\n if (dotnetify.debug) {\r\n console.log('[' + this.VMId + '] sent> ');\r\n console.log(update);\r\n\r\n if (dotnetify.debugFn != null) dotnetify.debugFn(this.VMId, 'sent', update);\r\n }\r\n } catch (e) {\r\n console.error(e);\r\n }\r\n }\r\n },\r\n\r\n // Preprocess view model update from the server before we map it to knockout view model.\r\n _PreProcess: function(iVMUpdate) {\r\n Object.keys(iVMUpdate).forEach(prop => {\r\n // Look for property that end with '_add'. Interpret the value as a list item to be added\r\n // to an existing list whose property name precedes that suffix.\r\n var match = /(.*)_add/.exec(prop);\r\n if (match != null) {\r\n var list = this.VM[match[1]];\r\n if (list != null) this.VM.$addList(list, iVMUpdate[prop]);\r\n else throw new Error('unable to resolve ' + prop);\r\n delete iVMUpdate[prop];\r\n return;\r\n }\r\n\r\n // Look for property that end with '_update'. Interpret the value as a list item to be updated\r\n // to an existing list whose property name precedes that suffix.\r\n var match = /(.*)_update/.exec(prop);\r\n if (match != null) {\r\n var list = this.VM[match[1]];\r\n if (list != null) this.VM.$updateList(list, iVMUpdate[prop]);\r\n else throw new Error('unable to resolve ' + prop);\r\n delete iVMUpdate[prop];\r\n return;\r\n }\r\n\r\n // Look for property that end with '_remove'. Interpret the value as a list item key to remove\r\n // from an existing list whose property name precedes that suffix.\r\n var match = /(.*)_remove/.exec(prop);\r\n if (match != null) {\r\n var list = this.VM[match[1]];\r\n if (list != null) {\r\n var key = list()['$vmKey'];\r\n if (key != null)\r\n this.VM.$removeList(this.VM[match[1]], function(i) {\r\n return i[key]() == iVMUpdate[prop];\r\n });\r\n else throw new Error('unable to resolve ' + prop + ' due to missing vmItemKey attribute');\r\n }\r\n else throw new Error('unable to resolve ' + prop);\r\n delete iVMUpdate[prop];\r\n return;\r\n }\r\n });\r\n },\r\n\r\n // Requests view model data from the server.\r\n _RequestVM: function() {\r\n var self = this;\r\n var vmArg = self.element.attr('data-vm-arg');\r\n vmArg = vmArg != null ? $.parseJSON(vmArg.replace(/'/g, '\"')) : null;\r\n\r\n if (dotnetify.hub.isConnected) {\r\n try {\r\n dotnetify.hub.requestVM(self.VMId, vmArg);\r\n } catch (e) {\r\n console.error(e);\r\n }\r\n }\r\n },\r\n\r\n // Subscribe to value change events raised by knockout VM's observables.\r\n _SubscribeObservables: function(iParam, iVMPath) {\r\n var self = this;\r\n\r\n if (iParam == null) return;\r\n else if (ko.isObservable(iParam)) {\r\n if ('$subscribe' in iParam === false) {\r\n iParam.subscribe(function(iNewValue) {\r\n // Handle value change event from observables.\r\n if (self.VM.$serverUpdate === true) self._OnValueChanged(iVMPath, iNewValue);\r\n });\r\n iParam['$subscribe'] = true;\r\n }\r\n this._SubscribeObservables(iParam(), iVMPath);\r\n }\r\n else if (typeof iParam == 'object') {\r\n // The property with $vmKey means it's an enumerable and the $vmKey indicates the key to identify\r\n // the item in that enumerable. When we send value update to the server, we'll use the property\r\n // path in this format: .$..\r\n // For example: ListContent.$3.FirstName.\r\n var key = '$vmKey' in iParam ? iParam['$vmKey'] : null;\r\n\r\n Object.keys(iParam).forEach(property => {\r\n if (property.charAt(0) == '$' || property.charAt(0) == '_') return;\r\n if (property.charAt(0) == property.charAt(0).toLowerCase()) return;\r\n if (!isNaN(property.charAt(0))) return;\r\n const path = key != null ? '$' + iParam[property][key]() : property;\r\n this._SubscribeObservables(iParam[property], iVMPath == null ? path : iVMPath + '.' + path);\r\n });\r\n }\r\n else if (iParam instanceof Array) {\r\n Object.keys(iParam).forEach(index => {\r\n path = '$' + index;\r\n this._SubscribeObservables(iParam[index], iVMPath == null ? path : iVMPath + '.' + path);\r\n });\r\n }\r\n }\r\n});\r\n\r\n// Custom knockout binding to indicate the item key of an items collection property.\r\nko.bindingHandlers.vmItemKey = {\r\n preprocess: function(value) {\r\n // Make sure the item key is enclosed with quotes.\r\n return value.charAt(0) != \"'\" ? \"'\" + value + \"'\" : value;\r\n },\r\n update: function(element, valueAccessor, allBindings, viewModel, bindingContext) {\r\n var value = valueAccessor();\r\n var items = allBindings.get('foreach');\r\n\r\n // Test whether the foreach value is object literal where items is set to 'data' property.\r\n if (!ko.isObservable(items) && items.hasOwnProperty('data')) items = items.data;\r\n\r\n // Store the item key in a special property '$vmKey' in the element's view model.\r\n if (ko.isObservable(items) && items() != null && value != null) items()['$vmKey'] = value;\r\n }\r\n};\r\n\r\n// Custom knockout binding to bind the specified function the click event of the element.\r\nko.bindingHandlers.vmCommand = {\r\n init: function(element, valueAccessor, allBindings, viewModel, bindingContext) {\r\n var vm = bindingContext.$root;\r\n var fnName = null;\r\n var fnArg = null;\r\n\r\n // Parse the value. It supports either a function name or an object literal { funcName: argument }\r\n // where argument can be either data or obsevables.\r\n var matchFnNameArg = /return\\s{(.*):(.*)}\\s/.exec(valueAccessor.toString());\r\n if (matchFnNameArg != null) {\r\n fnName = matchFnNameArg[1].trim();\r\n fnArg = matchFnNameArg[2].trim();\r\n }\r\n else {\r\n var matchFnName = /return\\s(.*)\\s/.exec(valueAccessor.toString());\r\n if (matchFnName != null) fnName = matchFnName[1].trim();\r\n }\r\n\r\n if (fnName == null) throw new Error('invalid vmCommand value at ' + element.outerHTML);\r\n\r\n // Support whether function is defined globally or inside a namespace that matches view model Id.\r\n var getFn = function() {\r\n return vm[fnName] != null ? vm[fnName] : valueAccessor();\r\n };\r\n\r\n // Trim the argument from enclosing quotes. If it's an observable name, replace it with the value.\r\n if (fnArg != null) {\r\n if (fnArg.charAt(0) == \"'\") fnArg = fnArg.replace(/(^'|'$)/g, '');\r\n else if (ko.isObservable(viewModel[fnArg])) fnArg = ko.unwrap(viewModel[fnArg]);\r\n else if (fnArg == '$data') fnArg = viewModel;\r\n }\r\n else fnArg = true;\r\n\r\n var newValueAccessor = function() {\r\n return function() {\r\n var fn = getFn();\r\n\r\n // If function is an observable, which means it's a server view model property, then set its value to\r\n // trigger the invocation of its setter property on the server side. If it's not an observable, then it must\r\n // be a client-side function, in which case just invoke it and pass all possible objects it may need.\r\n if (ko.isObservable(fn)) {\r\n // Reset the value locally first to ensure that setting the value will raise change events.\r\n vm.$preventBinding(function() {\r\n fn(fnArg === true ? false : null);\r\n });\r\n\r\n fn(fnArg);\r\n }\r\n else fn.apply(vm, [ viewModel, element, bindingContext.$parent ]);\r\n };\r\n };\r\n ko.bindingHandlers.click.init(element, newValueAccessor, allBindings, viewModel, bindingContext);\r\n }\r\n};\r\n\r\n// Custom knockout binding to call a function on initial property change event.\r\nko.bindingHandlers.vmOnce = {\r\n init: function(element, valueAccessor, allBindings, viewModel, bindingContext) {\r\n ko.bindingHandlers.vmOn.init(element, valueAccessor, allBindings, viewModel, bindingContext, true);\r\n }\r\n};\r\n\r\n// Custom knockout binding to call a function on a property change event.\r\nko.bindingHandlers.vmOn = {\r\n init: function(element, valueAccessor, allBindings, viewModel, bindingContext, once) {\r\n var vm = bindingContext.$root;\r\n var property = null;\r\n var fnName = null;\r\n var value = valueAccessor.toString();\r\n\r\n // Parse the value, which should be in object literal { property: fnName }.\r\n var match = /return\\s{(.*):(.*)}\\s/.exec(value);\r\n if (match != null) {\r\n property = match[1].trim();\r\n fnName = match[2].trim();\r\n }\r\n\r\n if (fnName == null) throw new Error('invalid vmOn function at ' + element.outerHTML);\r\n\r\n // Support whether function is defined globally or inside a namespace that matches view model Id.\r\n var getFn = function() {\r\n return vm[fnName] != null ? vm[fnName] : valueAccessor()[property];\r\n };\r\n\r\n // Make sure the property is an observable.\r\n if (property != null && !ko.isObservable(viewModel[property])) throw new Error('invalid vmOn data: ' + valueAccessor());\r\n\r\n // Call the function with the initial data.\r\n getFn().apply(vm, [ viewModel, element, bindingContext.$parent ]);\r\n\r\n // Call the function on every data update.\r\n if (once == null)\r\n viewModel[property].subscribe(function(iNewValue) {\r\n getFn().apply(vm, [ viewModel, element, bindingContext.$parent ]);\r\n });\r\n }\r\n};\r\n\r\nexport default dotnetify;\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport utils from '../libs/utils';\r\n\r\nexport default class dotnetifyVMRouter {\r\n routes = [];\r\n\r\n get RoutingState() {\r\n throw new Error('Not implemented');\r\n }\r\n get VMRoot() {\r\n throw new Error('Not implemented');\r\n }\r\n get VMArg() {\r\n throw new Error('Not implemented');\r\n }\r\n\r\n constructor(vm, router) {\r\n this.vm = vm;\r\n this.router = router;\r\n this.debug = vm.$dotnetify.controller.debug;\r\n }\r\n\r\n // Dispatch the active routing state to the server.\r\n dispatchActiveRoutingState(iPath) {\r\n this.vm.$dispatch({ 'RoutingState.Active': iPath });\r\n let { RoutingState } = this.vm.State();\r\n RoutingState = Object.assign(RoutingState || {}, { Active: iPath });\r\n this.vm.State({ RoutingState });\r\n }\r\n\r\n // Handles click event from anchor tags. Argument can be event object or path string.\r\n handleRoute(iArg) {\r\n let path = null;\r\n if (typeof iArg === 'object') {\r\n iArg.preventDefault();\r\n path = iArg.currentTarget.pathname;\r\n }\r\n else if (typeof iArg === 'string') path = iArg;\r\n\r\n if (path == null || path == '') throw new Error('$handleRoute requires path argument or event with pathname.');\r\n setTimeout(() => this.router.pushState({}, '', path));\r\n }\r\n\r\n // Build the absolute root path from the \"vmRoot\" property on React component.\r\n initRoot() {\r\n if (!this.hasRoutingState || this.RoutingState === null || this.RoutingState.Root === null) return;\r\n\r\n if (this._absRoot != this.RoutingState.Root) {\r\n var absRoot = utils.trim(this.VMRoot);\r\n if (absRoot != '') absRoot = '/' + absRoot;\r\n var root = utils.trim(this.RoutingState.Root);\r\n this._absRoot = root != '' ? absRoot + '/' + root : absRoot;\r\n this.RoutingState.Root = this._absRoot;\r\n }\r\n }\r\n\r\n // Initialize routing templates if the view model implements IRoutable.\r\n initRouting() {\r\n const vm = this.vm;\r\n if (!this.hasRoutingState) return;\r\n\r\n if (this.RoutingState === null) {\r\n console.error(\"router> the RoutingState prop of '\" + vm.$vmId + \"' was not initialized.\");\r\n return;\r\n }\r\n\r\n var templates = this.RoutingState.Templates;\r\n if (templates == null || templates.length == 0) return;\r\n\r\n // Initialize the router.\r\n if (!this.router.$init) {\r\n this.router.init();\r\n this.router.$init = true;\r\n }\r\n\r\n // Build the absolute root path.\r\n this.initRoot();\r\n\r\n templates.forEach(template => {\r\n // If url pattern isn't given, consider Id as the pattern.\r\n var urlPattern = template.UrlPattern != null ? template.UrlPattern : template.Id;\r\n urlPattern = urlPattern != '' ? urlPattern : '/';\r\n var mapUrl = this.toUrl(urlPattern);\r\n\r\n if (this.debug) console.log('router> map ' + mapUrl + ' to template id=' + template.Id);\r\n\r\n this.router.mapTo(mapUrl, iParams => {\r\n this.router.urlPath = '';\r\n\r\n // Construct the path from the template pattern and the params passed by PathJS.\r\n var path = urlPattern;\r\n for (var param in iParams) path = path.replace(':' + param, iParams[param]);\r\n path = path.replace(/\\(\\/:([^)]+)\\)/g, '').replace(/\\(|\\)/g, '');\r\n\r\n this.routeTo(path, template);\r\n });\r\n });\r\n\r\n // Route initial URL.\r\n var activeUrl = this.toUrl(this.RoutingState.Active);\r\n if (this.router.urlPath == '') this.router.urlPath = activeUrl;\r\n if (!this.routeUrl())\r\n // If routing ends incomplete, raise routed event anyway.\r\n this.raiseRoutedEvent(true);\r\n }\r\n\r\n // Whether a route is active.\r\n isActive(iRoute) {\r\n if (iRoute != null && iRoute.hasOwnProperty('Path')) {\r\n return utils.equal(iRoute.Path, this.RoutingState.Active);\r\n }\r\n return false;\r\n }\r\n\r\n // Loads an HTML view.\r\n loadHtmlView(iTargetSelector, iViewUrl, iJsModuleUrl, iCallbackFn) {\r\n const vm = this.vm;\r\n this.unmountView(iTargetSelector);\r\n\r\n // Load the HTML view.\r\n $(iTargetSelector).load(iViewUrl, null, function() {\r\n if (iJsModuleUrl != null) {\r\n const getScripts = iJsModuleUrl.split(',').map(i => $.getScript(i));\r\n $.when.apply($, getScripts).done(() => typeof callbackFn === 'function' && iCallbackFn.call(vm));\r\n }\r\n else if (typeof callbackFn === 'function') iCallbackFn.call(vm);\r\n });\r\n }\r\n\r\n loadHtmlElementView(iTargetSelector, iHtmlElement, iJsModuleUrl, iVmArg, iCallbackFn) {\r\n const vm = this.vm;\r\n const mountViewFunc = () => {\r\n this.unmountView(iTargetSelector);\r\n\r\n const target = document.querySelector(iTargetSelector);\r\n while (target.firstChild) target.removeChild(target.firstChild);\r\n target.appendChild(iHtmlElement);\r\n\r\n if (typeof callbackFn === 'function') iCallbackFn.call(vm);\r\n };\r\n\r\n if (iJsModuleUrl == null) mountViewFunc();\r\n else {\r\n // Load all javascripts first. Multiple files can be specified with comma delimiter.\r\n const getScripts = iJsModuleUrl.split(',').map(i => $.getScript(i));\r\n $.when.apply($, getScripts).done(mountViewFunc);\r\n }\r\n }\r\n\r\n // Loads a view into a target element.\r\n loadView(iTargetSelector, iViewUrl, iJsModuleUrl, iVmArg, iCallbackFn) {\r\n throw new Error('Not implemented');\r\n }\r\n\r\n // Routes to a path.\r\n manualRouteTo(iPath, iTarget, iViewUrl, iJSModuleUrl) {\r\n const vm = this.vm;\r\n var template = { Id: 'manual', Target: iTarget, ViewUrl: iViewUrl, JSModuleUrl: iJSModuleUrl };\r\n this.routeTo(iPath, template, true);\r\n }\r\n\r\n // Handles route enter event.\r\n onRouteEnter(iPath, iTemplate) {\r\n return true;\r\n }\r\n\r\n // Raise event indicating the routing process has ended.\r\n raiseRoutedEvent(force) {\r\n const vm = this.vm;\r\n if (this.router.urlPath == '' || force == true) {\r\n if (this.debug) console.log('router> routed');\r\n utils.dispatchEvent('dotnetify.routed');\r\n }\r\n }\r\n\r\n // Returns the URL for an anchor tag.\r\n route(iRoute, iTarget) {\r\n // No route to process. Return silently.\r\n if (iRoute == null) return;\r\n\r\n if (!iRoute.hasOwnProperty('Path') && !iRoute.hasOwnProperty('TemplateId')) throw new Error('Not a valid route');\r\n\r\n // Build the absolute root path.\r\n this.initRoot();\r\n\r\n // If the route path is not defined, use the URL pattern from the associated template.\r\n // This is so that we don't send the same data twice if both are equal.\r\n let path = iRoute.Path;\r\n let template = null;\r\n if (this.hasRoutingState && this.RoutingState.Templates != null && iRoute.TemplateId != null) {\r\n let match = this.RoutingState.Templates.filter(function(iTemplate) {\r\n return iTemplate.Id == iRoute.TemplateId;\r\n });\r\n if (match.length > 0) {\r\n template = match[0];\r\n\r\n if (typeof iTarget === 'string') template.Target = iTarget;\r\n\r\n if (path == null) {\r\n path = template.UrlPattern != null ? template.UrlPattern : template.Id;\r\n iRoute.Path = path;\r\n }\r\n }\r\n else if (iRoute.RedirectRoot == null) throw new Error(`vmRoute cannot find route template ${iRoute.TemplateId}`);\r\n }\r\n\r\n // If the path has a redirect root, the path doesn't belong to the current root and needs to be\r\n // redirected to a different one. Set the absolute path to the HREF attribute, and prevent the\r\n // default behavior of the anchor click event and instead do push to HTML5 history state, which\r\n // would attempt to resolve the path first before resorting to hard browser redirect.\r\n if (iRoute.RedirectRoot != null) {\r\n // Combine the redirect root with the view model's root.\r\n let redirectRoot = iRoute.RedirectRoot;\r\n if (redirectRoot.charAt(0) == '/') redirectRoot = redirectRoot.substr(0, redirectRoot.length - 1);\r\n let redirectRootPath = iRoute.RedirectRoot.split('/');\r\n\r\n let urlRedirect = '';\r\n let absRoot = this.VMRoot;\r\n if (absRoot != null) {\r\n let absRootPath = absRoot.split('/');\r\n for (let i = 0; i < absRootPath.length; i++) {\r\n if (absRootPath[i] != '' && absRootPath[i] == redirectRootPath[0]) break;\r\n urlRedirect += absRootPath[i] + '/';\r\n }\r\n }\r\n\r\n urlRedirect += redirectRoot + '/' + path;\r\n urlRedirect = urlRedirect.replace(/\\/\\/+/g, '/');\r\n if (!this.routes.some(x => x.Path === path)) this.routes.push({ Path: path, Url: urlRedirect });\r\n return urlRedirect;\r\n }\r\n\r\n // For quick lookup, save the mapping between the path to the route inside the view model.\r\n if (template == null) throw new Error('vmRoute cannot find any route template');\r\n\r\n iRoute.$template = template;\r\n this.pathToRoute = this.pathToRoute || {};\r\n this.pathToRoute[path] = iRoute;\r\n\r\n // Set the absolute path to the HREF attribute, and prevent the default behavior of\r\n // the anchor click event and instead do push to HTML5 history state.\r\n let url = this.toUrl(path);\r\n url = url.length > 0 ? url : '/';\r\n if (!this.routes.some(x => x.Path === path)) this.routes.push({ Path: path, Url: url });\r\n return url;\r\n }\r\n\r\n // Routes to a path.\r\n routeTo(iPath, iTemplate, iDisableEvent, iCallbackFn, isRedirect) {\r\n const vm = this.vm;\r\n const viewModels = vm.$dotnetify.getViewModels();\r\n\r\n if (this.debug) console.log(\"router> route '\" + iPath + \"' to template id=\" + iTemplate.Id);\r\n\r\n // We can determine whether the view has already been loaded by matching the 'RoutingState.Origin' argument\r\n // on the existing view model inside that target selector with the path.\r\n for (let i = 0; i < viewModels.length; i++) {\r\n var vmOther = viewModels[i];\r\n var vmArg = vmOther.$router.VMArg;\r\n if (vmArg != null) {\r\n if (typeof vmArg['RoutingState.Origin'] === 'string' && utils.equal(vmArg['RoutingState.Origin'], iPath)) return;\r\n }\r\n }\r\n\r\n // Support enter interception.\r\n if (iDisableEvent != true && vm.hasOwnProperty('onRouteEnter')) {\r\n if (this.onRouteEnter(iPath, iTemplate) == false || vm.onRouteEnter(iPath, iTemplate) == false) return;\r\n }\r\n\r\n // Check if the route has valid target.\r\n if (iTemplate.Target == null) {\r\n console.error(\"router> the Target for template '\" + iTemplate.Id + \"' was not set. Use vm.onRouteEnter() to set the target.\");\r\n return;\r\n }\r\n\r\n // If target DOM element isn't found, redirect URL to the path.\r\n if (document.getElementById(iTemplate.Target) == null) {\r\n if (isRedirect === true) {\r\n if (this.debug) console.log(\"router> target '\" + iTemplate.Target + \"' not found in DOM\");\r\n return;\r\n }\r\n else {\r\n if (this.debug) console.log(\"router> target '\" + iTemplate.Target + \"' not found in DOM, use redirect instead\");\r\n return this.router.redirect(this.toUrl(iPath), [ ...viewModels, ...vm.$dotnetify.controller.getViewModels() ]);\r\n }\r\n }\r\n\r\n // Load the view associated with the route asynchronously.\r\n this.loadView('#' + iTemplate.Target, iTemplate.ViewUrl, iTemplate.JSModuleUrl, { 'RoutingState.Origin': iPath }, () => {\r\n // If load is successful, update the active route.\r\n this.dispatchActiveRoutingState(iPath);\r\n\r\n // Support exit interception.\r\n if (iDisableEvent != true && vm.hasOwnProperty('onRouteExit')) vm.onRouteExit(iPath, iTemplate);\r\n\r\n if (typeof iCallbackFn === 'function') iCallbackFn.call(vm);\r\n });\r\n }\r\n\r\n routeToRoute(iRoute) {\r\n var path = this.vm.$route(iRoute);\r\n if (path == null || path == '') throw new Error('The route passed to $routeTo is invalid.');\r\n\r\n setTimeout(() => this.router.pushState({}, '', path));\r\n }\r\n\r\n // Routes the URL if the view model implements IRoutable.\r\n // Returns true if the view model handles the routing.\r\n routeUrl(redirectUrlPath) {\r\n if (!this.hasRoutingState) return false;\r\n\r\n const isRedirect = !!redirectUrlPath;\r\n let root = this.RoutingState.Root;\r\n if (root == null) return false;\r\n\r\n // Get the URL path to route.\r\n let urlPath = isRedirect ? redirectUrlPath : this.router.urlPath;\r\n\r\n if (this.debug) console.log('router> routing ' + urlPath);\r\n\r\n // If the URL path matches the root path of this view, use the template with a blank URL pattern if provided.\r\n if (utils.equal(urlPath, root) || utils.equal(urlPath, root + '/') || urlPath === '/') {\r\n let match = utils.grep(this.RoutingState.Templates, function(iTemplate) {\r\n return iTemplate.UrlPattern === '';\r\n });\r\n if (match.length > 0) {\r\n this.routeTo('', match[0], null, null, isRedirect);\r\n this.router.urlPath = '';\r\n this.raiseRoutedEvent();\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n // If the URL path starts with the root path of this view, look at the next path and try to match it with the\r\n // anchor tags in this view that are bound with the vmRoute binding type. If there is match, route to that path.\r\n root = root + '/';\r\n if (utils.startsWith(urlPath, root)) {\r\n let routeElem = null;\r\n let match = utils.grep(this.routes, function(elem) {\r\n return utils.startsWith(urlPath + '/', elem.Url + '/');\r\n });\r\n if (match.length > 0) {\r\n // If more than one match, find the best match.\r\n for (let i = 0; i < match.length; i++) if (routeElem == null || routeElem.Url.length < match[i].Url.length) routeElem = match[i];\r\n }\r\n\r\n if (routeElem != null) {\r\n let path = routeElem.Path;\r\n let template =\r\n this.hasOwnProperty('pathToRoute') && this.pathToRoute.hasOwnProperty(path) ? this.pathToRoute[path].$template : null;\r\n if (template != null) {\r\n // If the URL path is completely routed, clear it.\r\n if (utils.equal(this.router.urlPath, this.toUrl(path))) this.router.urlPath = '';\r\n\r\n // If route's not already active, route to it.\r\n if (!utils.equal(this.RoutingState.Active, path)) {\r\n this.routeTo(path, template, false, () => this.raiseRoutedEvent(), isRedirect);\r\n }\r\n else this.raiseRoutedEvent();\r\n return true;\r\n }\r\n }\r\n else if (this.router.match(urlPath)) {\r\n // If no vmRoute binding matches, try to match with any template's URL pattern.\r\n this.router.urlPath = '';\r\n this.raiseRoutedEvent();\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n // Builds an absolute URL from a path.\r\n toUrl(iPath) {\r\n let path = utils.trim(iPath);\r\n if (path.charAt(0) != '(' && path != '') path = '/' + path;\r\n return this.hasRoutingState ? this.RoutingState.Root + path : iPath;\r\n }\r\n\r\n // Unmount a view if there's one on the target selector.\r\n unmountView(iTargetSelector) {\r\n throw new Error('Not implemented');\r\n }\r\n}\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport dotnetifyVMRouter from '../core/dotnetify-vm-router';\r\nimport $ from 'jquery';\r\nimport utils from '../libs/utils';\r\n\r\nclass templateWrapper {\r\n constructor(template) {\r\n this.template = template;\r\n }\r\n get Id() {\r\n return this.template.Id();\r\n }\r\n get Root() {\r\n return this.template.Root();\r\n }\r\n get UrlPattern() {\r\n return this.template.UrlPattern();\r\n }\r\n get ViewUrl() {\r\n return this.template.ViewUrl();\r\n }\r\n set ViewUrl(value) {\r\n this.template.ViewUrl(value);\r\n }\r\n get JSModuleUrl() {\r\n return this.template.JSModuleUrl();\r\n }\r\n set JSModuleUrl(value) {\r\n this.template.JSModuleUrl(value);\r\n }\r\n get Target() {\r\n return this.template.Target();\r\n }\r\n set Target(value) {\r\n this.template.Target(value);\r\n }\r\n}\r\n\r\nclass routingStateWrapper {\r\n constructor(routingState) {\r\n this.routingState = routingState;\r\n }\r\n get Root() {\r\n return this.routingState.Root();\r\n }\r\n set Root(value) {\r\n this.routingState.Root(value);\r\n }\r\n get Templates() {\r\n const templates = typeof this.routingState.Templates == 'function' ? this.routingState.Templates() : null;\r\n return templates ? templates.map(template => new templateWrapper(template)) : null;\r\n }\r\n get Active() {\r\n return this.routingState.Active();\r\n }\r\n set Active(value) {\r\n this.routingState.Active(value);\r\n }\r\n get Origin() {\r\n return this.routingState.Origin();\r\n }\r\n set Origin(value) {\r\n this.routingState.Origin(value);\r\n }\r\n}\r\n\r\nexport default class dotnetifyKoVMRouter extends dotnetifyVMRouter {\r\n get hasRoutingState() {\r\n return this.vm.hasOwnProperty('RoutingState');\r\n }\r\n get RoutingState() {\r\n return new routingStateWrapper(this.vm.RoutingState);\r\n }\r\n get VMRoot() {\r\n return this.vm.$element.attr('data-vm-root');\r\n }\r\n get VMArg() {\r\n return this.vm.$element.attr('data-vm-arg');\r\n }\r\n\r\n constructor(iVM, iDotNetifyRouter) {\r\n super(iVM, iDotNetifyRouter);\r\n }\r\n\r\n // Dispatch the active routing state to the server.\r\n dispatchActiveRoutingState(iPath) {\r\n this.RoutingState.Active = iPath;\r\n }\r\n onRouteEnter(iPath, iTemplate) {\r\n if (!iTemplate.ViewUrl) iTemplate.ViewUrl = iTemplate.Id + '.html';\r\n return true;\r\n }\r\n\r\n // Loads a view into a target element.\r\n // Method parameters: TargetSelector, ViewUrl, iJsModuleUrl, iVmArg, iCallbackFn\r\n loadView(iTargetSelector, iViewUrl, iJsModuleUrl, iVmArg, iCallbackFn) {\r\n const vm = this.vm;\r\n\r\n // If no view URL is given, empty the target DOM element.\r\n if (iViewUrl == null || iViewUrl == '') {\r\n $(iTargetSelector).empty();\r\n return;\r\n }\r\n\r\n const callbackFn = () => {\r\n // If the view model supports routing, add the root path to the view, to be used\r\n // to build the absolute route path, and view model argument if provided.\r\n if (this.hasRoutingState && this.RoutingState.Root) {\r\n const vmElems = $(iTargetSelector).find('[data-vm]').toArray();\r\n vmElems.forEach(element => {\r\n var root = $(element).attr('data-vm-root');\r\n root = root != null ? '/' + utils.trim(vm.RoutingState.Root()) + '/' + utils.trim(root) : vm.RoutingState.Root();\r\n $(element).attr('data-vm-root', root);\r\n\r\n if (iVmArg != null && !$.isEmptyObject(iVmArg)) {\r\n // If there's already a data-vm-arg, combine the values.\r\n // Take care not to override server-side routing arguments.\r\n var vmArg = $(element).attr('data-vm-arg');\r\n vmArg = vmArg != null ? $.extend(iVmArg, $.parseJSON(vmArg.replace(/'/g, '\"'))) : iVmArg;\r\n\r\n $(element).attr('data-vm-arg', JSON.stringify(vmArg));\r\n }\r\n });\r\n }\r\n\r\n // Call the callback function.\r\n if (typeof iCallbackFn === 'function') iCallbackFn.apply(this);\r\n };\r\n\r\n // Provide the opportunity to override the URL.\r\n iViewUrl = this.router.overrideUrl(iViewUrl);\r\n\r\n vm.$loadView(iTargetSelector, iViewUrl, iJsModuleUrl, iVmArg, callbackFn);\r\n }\r\n\r\n // Routes to a path.\r\n manualRouteTo(iPath, iTarget, iViewUrl, iJSModuleUrl) {\r\n const template = {\r\n Target: () => iTarget,\r\n ViewUrl: () => iViewUrl,\r\n JSModuleUrl: () => iJSModuleUrl\r\n };\r\n this.$router.routeTo(iPath, template, true);\r\n }\r\n}\r\n","/*\r\nPathJS - Copyright (c) 2011 Mike Trpcic, released under the MIT license.\r\n */\r\nconst window = window || global || {};\r\n\r\nvar Path = {\r\n // Need this specific version, because latest version is causing issue.\r\n version: '0.8.5',\r\n map: function(path) {\r\n if (Path.routes.defined.hasOwnProperty(path)) {\r\n return Path.routes.defined[path];\r\n }\r\n else {\r\n return new Path.core.route(path);\r\n }\r\n },\r\n root: function(path) {\r\n Path.routes.root = path;\r\n },\r\n rescue: function(fn) {\r\n Path.routes.rescue = fn;\r\n },\r\n history: {\r\n initial: {}, // Empty container for \"Initial Popstate\" checking variables.\r\n pushState: function(state, title, path) {\r\n if (Path.history.supported) {\r\n if (Path.dispatch(path)) {\r\n history.pushState(state, title, path);\r\n }\r\n }\r\n else {\r\n if (Path.history.fallback) {\r\n window.location.hash = '#' + path;\r\n }\r\n }\r\n },\r\n popState: function(event) {\r\n var initialPop = !Path.history.initial.popped && location.href == Path.history.initial.URL;\r\n Path.history.initial.popped = true;\r\n if (initialPop) return;\r\n Path.dispatch(document.location.pathname === '/' ? '' : document.location.pathname);\r\n },\r\n listen: function(fallback) {\r\n Path.history.supported = !!(window.history && window.history.pushState);\r\n Path.history.fallback = fallback;\r\n\r\n if (Path.history.supported) {\r\n (Path.history.initial.popped = 'state' in window.history), (Path.history.initial.URL = location.href);\r\n window.onpopstate = Path.history.popState;\r\n }\r\n else {\r\n if (Path.history.fallback) {\r\n for (route in Path.routes.defined) {\r\n if (route.charAt(0) != '#') {\r\n Path.routes.defined['#' + route] = Path.routes.defined[route];\r\n Path.routes.defined['#' + route].path = '#' + route;\r\n }\r\n }\r\n Path.listen();\r\n }\r\n }\r\n }\r\n },\r\n match: function(path, parameterize) {\r\n var params = {},\r\n route = null,\r\n possible_routes,\r\n slice,\r\n i,\r\n j,\r\n compare,\r\n result;\r\n for (route in Path.routes.defined) {\r\n if (route !== null && route !== undefined) {\r\n route = Path.routes.defined[route];\r\n possible_routes = route.partition();\r\n for (j = 0; j < possible_routes.length; j++) {\r\n slice = possible_routes[j];\r\n compare = path;\r\n if (slice.search(/:/) > 0) {\r\n for (i = 0; i < slice.split('/').length; i++) {\r\n if (i < compare.split('/').length && slice.split('/')[i].charAt(0) === ':') {\r\n params[slice.split('/')[i].replace(/:/, '')] = compare.split('/')[i];\r\n result = compare.split('/');\r\n result[i] = slice.split('/')[i];\r\n compare = result.join('/');\r\n }\r\n }\r\n }\r\n if (slice === compare) {\r\n if (parameterize) {\r\n route.params = params;\r\n }\r\n return route;\r\n }\r\n }\r\n }\r\n }\r\n return null;\r\n },\r\n dispatch: function(passed_route) {\r\n var previous_route, matched_route;\r\n if (Path.routes.current !== passed_route) {\r\n Path.routes.previous = Path.routes.current;\r\n Path.routes.current = passed_route;\r\n matched_route = Path.match(passed_route, true);\r\n\r\n if (Path.routes.previous) {\r\n previous_route = Path.match(Path.routes.previous);\r\n if (previous_route !== null && previous_route.do_exit !== null) {\r\n previous_route.do_exit();\r\n }\r\n }\r\n\r\n if (matched_route !== null) {\r\n matched_route.run();\r\n return true;\r\n }\r\n else {\r\n if (Path.routes.rescue !== null) {\r\n Path.routes.rescue();\r\n }\r\n }\r\n }\r\n },\r\n listen: function() {\r\n var fn = function() {\r\n Path.dispatch(location.hash);\r\n };\r\n\r\n if (location.hash === '') {\r\n if (Path.routes.root !== null) {\r\n location.hash = Path.routes.root;\r\n }\r\n }\r\n\r\n // The 'document.documentMode' checks below ensure that PathJS fires the right events\r\n // even in IE \"Quirks Mode\".\r\n if ('onhashchange' in window && (!document.documentMode || document.documentMode >= 8)) {\r\n window.onhashchange = fn;\r\n }\r\n else {\r\n setInterval(fn, 50);\r\n }\r\n\r\n if (location.hash !== '') {\r\n Path.dispatch(location.hash);\r\n }\r\n },\r\n core: {\r\n route: function(path) {\r\n this.path = path;\r\n this.action = null;\r\n this.do_enter = [];\r\n this.do_exit = null;\r\n this.params = {};\r\n Path.routes.defined[path] = this;\r\n }\r\n },\r\n routes: {\r\n current: null,\r\n root: null,\r\n rescue: null,\r\n previous: null,\r\n defined: {}\r\n }\r\n};\r\n\r\nPath.core.route.prototype = {\r\n to: function(fn) {\r\n this.action = fn;\r\n return this;\r\n },\r\n enter: function(fns) {\r\n if (fns instanceof Array) {\r\n this.do_enter = this.do_enter.concat(fns);\r\n }\r\n else {\r\n this.do_enter.push(fns);\r\n }\r\n return this;\r\n },\r\n exit: function(fn) {\r\n this.do_exit = fn;\r\n return this;\r\n },\r\n partition: function() {\r\n var parts = [],\r\n options = [],\r\n re = /\\(([^}]+?)\\)/g,\r\n text,\r\n i;\r\n while ((text = re.exec(this.path))) {\r\n parts.push(text[1]);\r\n }\r\n options.push(this.path.split('(')[0]);\r\n for (i = 0; i < parts.length; i++) {\r\n options.push(options[options.length - 1] + parts[i]);\r\n }\r\n return options;\r\n },\r\n run: function() {\r\n var halt_execution = false,\r\n i,\r\n result,\r\n previous;\r\n\r\n if (Path.routes.defined[this.path].hasOwnProperty('do_enter')) {\r\n if (Path.routes.defined[this.path].do_enter.length > 0) {\r\n for (i = 0; i < Path.routes.defined[this.path].do_enter.length; i++) {\r\n result = Path.routes.defined[this.path].do_enter[i].apply(this, null);\r\n if (result === false) {\r\n halt_execution = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n if (!halt_execution) {\r\n Path.routes.defined[this.path].action();\r\n }\r\n }\r\n};\r\n\r\nexport default Path;\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport Path from '../libs/path';\r\n\r\nconst window = window || global || {};\r\n\r\nexport default class dotnetifyRouter {\r\n version = '2.0.1';\r\n\r\n // URL path that will be parsed when performing routing.\r\n urlPath = document.location.pathname;\r\n\r\n constructor(debug) {\r\n this.debug = debug;\r\n }\r\n\r\n // Initialize routing using PathJS.\r\n init() {\r\n if (typeof Path !== 'undefined') {\r\n Path.history.listen(true);\r\n Path.routes.rescue = function() {\r\n //window.location.replace(document.location.pathname);\r\n };\r\n }\r\n else throw new Error('Pathjs library is required for routing.');\r\n }\r\n\r\n // Map a route to an action.\r\n mapTo(iPath, iFn) {\r\n iPath = iPath.length > 0 ? iPath : '/';\r\n if (typeof Path !== 'undefined')\r\n Path.map(iPath).to(function() {\r\n iFn(this.params);\r\n });\r\n }\r\n\r\n // Match a URL path to a route and run the action.\r\n match(iUrlPath) {\r\n if (typeof Path !== 'undefined') {\r\n var matched = Path.match(iUrlPath, true);\r\n if (matched != null) {\r\n matched.run();\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n // Optional callback to override a URL before performing routing.\r\n overrideUrl(iUrl) {\r\n return iUrl;\r\n }\r\n\r\n // Push state to HTML history.\r\n pushState(iState, iTitle, iPath) {\r\n this.urlPath = '';\r\n if (typeof Path !== 'undefined') Path.history.pushState(iState, iTitle, iPath);\r\n }\r\n\r\n // Redirect to the a URL.\r\n redirect(iUrl, viewModels) {\r\n // Check first whether existing views can handle routing this URL.\r\n // Otherwise, do a hard browser redirect.\r\n this.urlPath = iUrl;\r\n for (let i = 0; i < viewModels.length; i++) {\r\n const vm = viewModels[i];\r\n if (vm.$router.routeUrl(iUrl)) {\r\n if (this.debug) console.log('router> redirected');\r\n return;\r\n }\r\n }\r\n window.location.replace(iUrl);\r\n }\r\n\r\n // Called by dotNetify when a view model is ready.\r\n $ready() {\r\n this.$router.initRouting();\r\n }\r\n\r\n // Called by dotNetify when a view model receives update.\r\n $update(vmData) {\r\n if (vmData && vmData.RoutingState) this.$router.initRouting();\r\n }\r\n}\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport dotnetify from './dotnetify-ko';\r\nimport dotnetifyRouter from '../core/dotnetify-router';\r\nimport dotnetifyKoVMRouter from './dotnetify-ko.vm-router';\r\nimport $ from 'jquery';\r\nimport * as ko from 'knockout';\r\n\r\n// Add plugin functions.\r\ndotnetify.ko.router = new dotnetifyRouter(dotnetify.debug);\r\n\r\n// Inject a view model with functions.\r\ndotnetify.ko.router.$inject = function(iVM) {\r\n const router = new dotnetifyKoVMRouter(iVM, dotnetify.ko.router);\r\n\r\n // Put functions inside $router namespace.\r\n iVM.$router = router;\r\n};\r\n\r\n// Custom knockout binding to do routing.\r\nko.bindingHandlers.vmRoute = {\r\n update: function(element, valueAccessor, allBindings, viewModel, bindingContext) {\r\n var vm = bindingContext.$root;\r\n var route = ko.unwrap(valueAccessor());\r\n\r\n if (!route.hasOwnProperty('Path') || !route.hasOwnProperty('TemplateId'))\r\n throw new Error('invalid vmRoute data at ' + element.outerHTML);\r\n\r\n // Build the absolute root path.\r\n vm.$router.initRoot();\r\n\r\n // If the route path is not defined, use the URL pattern from the associated template.\r\n // This is so that we don't send the same data twice if both are equal.\r\n let path = route.Path();\r\n var template = null;\r\n if (vm.hasOwnProperty('RoutingState') && typeof vm.RoutingState.Templates === 'function' && vm.RoutingState.Templates() != null) {\r\n var match = $.grep(vm.RoutingState.Templates(), function(iTemplate) {\r\n return iTemplate.Id() == route.TemplateId();\r\n });\r\n if (match.length > 0) {\r\n template = match[0];\r\n if (path == null) {\r\n path = template.UrlPattern();\r\n route.Path(path);\r\n }\r\n }\r\n else if (route.RedirectRoot() == null)\r\n throw new Error(\"vmRoute cannot find route template '\" + route.TemplateId() + \"' at \" + element.outerHTML);\r\n }\r\n\r\n // If the path has a redirect root, the path doesn't belong to the current root and needs to be\r\n // redirected to a different one. Set the absolute path to the HREF attribute, and prevent the\r\n // default behavior of the anchor click event and instead do push to HTML5 history state, which\r\n // would attempt to resolve the path first before resorting to hard browser redirect.\r\n if (route.RedirectRoot() != null) {\r\n // Combine the redirect root with the view model's root.\r\n var redirectRoot = route.RedirectRoot();\r\n if (redirectRoot.charAt(0) == '/') redirectRoot = redirectRoot.substr(0, redirectRoot.length - 1);\r\n var redirectRootPath = route.RedirectRoot().split('/');\r\n\r\n var url = '';\r\n var absRoot = vm.$element.attr('data-vm-root');\r\n if (absRoot != null) {\r\n var absRootPath = absRoot.split('/');\r\n for (i = 0; i < absRootPath.length; i++) {\r\n if (absRootPath[i] != '' && absRootPath[i] == redirectRootPath[0]) break;\r\n url += absRootPath[i] + '/';\r\n }\r\n }\r\n url += redirectRoot + '/' + path;\r\n\r\n $(element).attr('href', url).attr('data-vm-route', path).click(function(iEvent) {\r\n iEvent.preventDefault();\r\n dotnetify.ko.router.pushState({}, '', $(this).attr('href'));\r\n });\r\n return;\r\n }\r\n\r\n // For quick lookup, save the mapping between the path to the route inside the view model.\r\n if (template == null) throw new Error('vmRoute cannot find any route template at ' + element.outerHTML);\r\n\r\n route.$template = template;\r\n vm.$router.pathToRoute = vm.$router.pathToRoute || {};\r\n vm.$router.pathToRoute[path] = route;\r\n\r\n // Set the absolute path to the HREF attribute, and prevent the default behavior of\r\n // the anchor click event and instead do push to HTML5 history state.\r\n $(element).attr('href', vm.$router.toUrl(path)).attr('data-vm-route', path).click(function(iEvent) {\r\n iEvent.preventDefault();\r\n dotnetify.ko.router.pushState({}, '', $(this).attr('href'));\r\n });\r\n }\r\n};\r\n\r\n// Register the plugin to dotNetify.\r\ndotnetify.ko.plugins['router'] = dotnetify.ko.router;\r\n","/// Knockout Mapping plugin v2.4.0\r\n/// (c) 2013 Steven Sanderson, Roy Jacobs - http://knockoutjs.com/\r\n/// License: MIT (http://www.opensource.org/licenses/mit-license.php)\r\n(function(d){\"function\"===typeof require&&\"object\"===typeof exports&&\"object\"===typeof module?d(require(\"knockout\"),exports):\"function\"===typeof define&&define.amd?define([\"knockout\",\"exports\"],d):d(ko,ko.mapping={})})(function(d,f){function y(b,c){var a,e;for(e in c)if(c.hasOwnProperty(e)&&c[e])if(a=f.getType(b[e]),e&&b[e]&&\"array\"!==a&&\"string\"!==a)y(b[e],c[e]);else if(\"array\"===f.getType(b[e])&&\"array\"===f.getType(c[e])){a=b;for(var d=e,l=b[e],n=c[e],t={},g=l.length-1;0<=g;--g)t[l[g]]=l[g];for(g=\r\nn.length-1;0<=g;--g)t[n[g]]=n[g];l=[];n=void 0;for(n in t)l.push(t[n]);a[d]=l}else b[e]=c[e]}function E(b,c){var a={};y(a,b);y(a,c);return a}function z(b,c){for(var a=E({},b),d=L.length-1;0<=d;d--){var f=L[d];a[f]&&(a[\"\"]instanceof Object||(a[\"\"]={}),a[\"\"][f]=a[f],delete a[f])}c&&(a.ignore=h(c.ignore,a.ignore),a.include=h(c.include,a.include),a.copy=h(c.copy,a.copy),a.observe=h(c.observe,a.observe));a.ignore=h(a.ignore,j.ignore);a.include=h(a.include,j.include);a.copy=h(a.copy,j.copy);a.observe=h(a.observe,\r\nj.observe);a.mappedProperties=a.mappedProperties||{};a.copiedProperties=a.copiedProperties||{};return a}function h(b,c){\"array\"!==f.getType(b)&&(b=\"undefined\"===f.getType(b)?[]:[b]);\"array\"!==f.getType(c)&&(c=\"undefined\"===f.getType(c)?[]:[c]);return d.utils.arrayGetDistinctValues(b.concat(c))}function F(b,c,a,e,k,l,n){var t=\"array\"===f.getType(d.utils.unwrapObservable(c));l=l||\"\";if(f.isMapped(b)){var g=d.utils.unwrapObservable(b)[p];a=E(g,a)}var j=n||k,h=function(){return a[e]&&a[e].create instanceof\r\nFunction},x=function(b){var f=G,g=d.dependentObservable;d.dependentObservable=function(a,b,c){c=c||{};a&&\"object\"==typeof a&&(c=a);var e=c.deferEvaluation,M=!1;c.deferEvaluation=!0;a=new H(a,b,c);if(!e){var g=a,e=d.dependentObservable;d.dependentObservable=H;a=d.isWriteableObservable(g);d.dependentObservable=e;a=H({read:function(){M||(d.utils.arrayRemoveItem(f,g),M=!0);return g.apply(g,arguments)},write:a&&function(a){return g(a)},deferEvaluation:!0});f.push(a)}return a};d.dependentObservable.fn=\r\nH.fn;d.computed=d.dependentObservable;b=d.utils.unwrapObservable(k)instanceof Array?a[e].create({data:b||c,parent:j,skip:N}):a[e].create({data:b||c,parent:j});d.dependentObservable=g;d.computed=d.dependentObservable;return b},u=function(){return a[e]&&a[e].update instanceof Function},v=function(b,f){var g={data:f||c,parent:j,target:d.utils.unwrapObservable(b)};d.isWriteableObservable(b)&&(g.observable=b);return a[e].update(g)};if(n=I.get(c))return n;e=e||\"\";if(t){var t=[],s=!1,m=function(a){return a};\r\na[e]&&a[e].key&&(m=a[e].key,s=!0);d.isObservable(b)||(b=d.observableArray([]),b.mappedRemove=function(a){var c=\"function\"==typeof a?a:function(b){return b===m(a)};return b.remove(function(a){return c(m(a))})},b.mappedRemoveAll=function(a){var c=C(a,m);return b.remove(function(a){return-1!=d.utils.arrayIndexOf(c,m(a))})},b.mappedDestroy=function(a){var c=\"function\"==typeof a?a:function(b){return b===m(a)};return b.destroy(function(a){return c(m(a))})},b.mappedDestroyAll=function(a){var c=C(a,m);return b.destroy(function(a){return-1!=\r\nd.utils.arrayIndexOf(c,m(a))})},b.mappedIndexOf=function(a){var c=C(b(),m);a=m(a);return d.utils.arrayIndexOf(c,a)},b.mappedCreate=function(a){if(-1!==b.mappedIndexOf(a))throw Error(\"There already is an object with the key that you specified.\");var c=h()?x(a):a;u()&&(a=v(c,a),d.isWriteableObservable(c)?c(a):c=a);b.push(c);return c});n=C(d.utils.unwrapObservable(b),m).sort();g=C(c,m);s&&g.sort();s=d.utils.compareArrays(n,g);n={};var J,A=d.utils.unwrapObservable(c),y={},z=!0,g=0;for(J=A.length;go;o++)for(s in a[o])n=a[o][s],a[o].hasOwnProperty(s)&&void 0!==n&&(t[s]=e.isPlainObject(n)?e.isPlainObject(t[s])?e.widget.extend({},t[s],n):e.widget.extend({},n):n);return t},e.widget.bridge=function(t,s){var n=s.prototype.widgetFullName||t;e.fn[t]=function(a){var o=\"string\"==typeof a,r=i.call(arguments,1),h=this;return o?this.each(function(){var i,s=e.data(this,n);return\"instance\"===a?(h=s,!1):s?e.isFunction(s[a])&&\"_\"!==a.charAt(0)?(i=s[a].apply(s,r),i!==s&&void 0!==i?(h=i&&i.jquery?h.pushStack(i.get()):i,!1):void 0):e.error(\"no such method '\"+a+\"' for \"+t+\" widget instance\"):e.error(\"cannot call methods on \"+t+\" prior to initialization; \"+\"attempted to call method '\"+a+\"'\")}):(r.length&&(a=e.widget.extend.apply(null,[a].concat(r))),this.each(function(){var t=e.data(this,n);t?(t.option(a||{}),t._init&&t._init()):e.data(this,n,new s(a,this))})),h}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:\"widget\",widgetEventPrefix:\"\",defaultElement:\"
\",options:{disabled:!1,create:null},_createWidget:function(i,s){s=e(s||this.defaultElement||this)[0],this.element=e(s),this.uuid=t++,this.eventNamespace=\".\"+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),s!==this&&(e.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===s&&this.destroy()}}),this.document=e(s.style?s.ownerDocument:s.document||s),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),i),this._create(),this._trigger(\"create\",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr(\"aria-disabled\").removeClass(this.widgetFullName+\"-disabled \"+\"ui-state-disabled\"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass(\"ui-state-hover\"),this.focusable.removeClass(\"ui-state-focus\")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if(\"string\"==typeof t)if(o={},s=t.split(\".\"),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,\"disabled\"===e&&(this.widget().toggleClass(this.widgetFullName+\"-disabled\",!!t),t&&(this.hoverable.removeClass(\"ui-state-hover\"),this.focusable.removeClass(\"ui-state-focus\"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;\"boolean\"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass(\"ui-state-disabled\")?(\"string\"==typeof o?a[o]:o).apply(a,arguments):void 0}\"string\"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\\w:-]*)\\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(t,i){i=(i||\"\").split(\" \").join(this.eventNamespace+\" \")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return(\"string\"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass(\"ui-state-hover\")},mouseleave:function(t){e(t.currentTarget).removeClass(\"ui-state-hover\")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass(\"ui-state-focus\")},focusout:function(t){e(t.currentTarget).removeClass(\"ui-state-focus\")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:\"fadeIn\",hide:\"fadeOut\"},function(t,i){e.Widget.prototype[\"_\"+t]=function(s,n,a){\"string\"==typeof n&&(n={effect:n});var o,r=n?n===!0||\"number\"==typeof n?i:n.effect||i:t;n=n||{},\"number\"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget});","/* \r\nimport { dotnetify } from 'dotnetify/dist/dotnetify-ko';\r\nCopyright 2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport { createEventEmitter } from '../libs/utils';\r\n\r\nconst window = window || global || {};\r\n\r\nconst normalize = iVMId => iVMId && iVMId.replace(/\\./g, '_');\r\nconst hasLocalVM = iVMId => {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n return typeof vm == 'object' && typeof vm.onConnect == 'function';\r\n};\r\n\r\nexport class dotNetifyHubLocal {\r\n mode = 'local';\r\n debug = false;\r\n isConnected = false;\r\n isHubStarted = false;\r\n\r\n responseEvent = createEventEmitter();\r\n reconnectedEvent = createEventEmitter();\r\n connectedEvent = createEventEmitter();\r\n connectionFailedEvent = createEventEmitter();\r\n\r\n startHub() {\r\n this.isConnected = true;\r\n this.isHubStarted = true;\r\n this.connectedEvent.emit();\r\n }\r\n\r\n requestVM(iVMId, iVMArgs) {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n\r\n if (typeof vm === 'object' && typeof vm.onConnect == 'function') {\r\n if (this.debug) console.log(`[${iVMId}] *** local mode ***`);\r\n\r\n vm.$pushUpdate = update => {\r\n if (typeof update == 'object') update = JSON.stringify(update);\r\n setTimeout(() => this.responseEvent.emit(iVMId, update));\r\n };\r\n\r\n vm.$pushUpdate(vm.onConnect(iVMArgs) || {});\r\n }\r\n }\r\n\r\n updateVM(iVMId, iValue) {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n\r\n if (typeof vm === 'object' && typeof vm.onDispatch == 'function') {\r\n let state = vm.onDispatch(iValue);\r\n if (state) {\r\n if (typeof state == 'object') state = JSON.stringify(state);\r\n setTimeout(() => this.responseEvent.emit(iVMId, state));\r\n }\r\n }\r\n }\r\n\r\n disposeVM(iVMId) {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n\r\n if (typeof vm === 'object' && typeof vm.onDestroy == 'function') {\r\n vm.onDestroy(iVMId);\r\n }\r\n }\r\n}\r\n\r\nexport default new dotNetifyHubLocal();\r\nexport { hasLocalVM };\r\n","module.exports = __WEBPACK_EXTERNAL_MODULE__14__;","/**\n* jQuery core object.\n*\n* Worker with jQuery deferred\n*\n* Code from: https://github.com/jquery/jquery/blob/master/src/core.js\n*\n*/\n\nvar jQuery = module.exports = {\n\ttype: type\n\t, isArray: isArray\n\t, isFunction: isFunction\n\t, isPlainObject: isPlainObject\n\t, each: each\n\t, extend: extend\n\t, noop: function() {}\n};\n\nvar toString = Object.prototype.toString;\n\nvar class2type = {};\n// Populate the class2type map\n\"Boolean Number String Function Array Date RegExp Object\".split(\" \").forEach(function(name) {\n\tclass2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n});\n\n\nfunction type( obj ) {\n\treturn obj == null ?\n\t\tString( obj ) :\n\t\t\tclass2type[ toString.call(obj) ] || \"object\";\n}\n\nfunction isFunction( obj ) {\n\treturn jQuery.type(obj) === \"function\";\n}\n\nfunction isArray( obj ) {\n\treturn jQuery.type(obj) === \"array\";\n}\n\nfunction each( object, callback, args ) {\n\tvar name, i = 0,\n\tlength = object.length,\n\tisObj = length === undefined || isFunction( object );\n\n\tif ( args ) {\n\t\tif ( isObj ) {\n\t\t\tfor ( name in object ) {\n\t\t\t\tif ( callback.apply( object[ name ], args ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( ; i < length; ) {\n\t\t\t\tif ( callback.apply( object[ i++ ], args ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// A special, fast, case for the most common use of each\n\t} else {\n\t\tif ( isObj ) {\n\t\t\tfor ( name in object ) {\n\t\t\t\tif ( callback.call( object[ name ], name, object[ name ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( ; i < length; ) {\n\t\t\t\tif ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn object;\n}\n\nfunction isPlainObject( obj ) {\n\t// Must be an Object.\n\tif ( !obj || jQuery.type(obj) !== \"object\" ) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\nfunction extend() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\ttarget = arguments[0] || {},\n\ti = 1,\n\tlength = arguments.length,\n\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif ( typeof target === \"boolean\" ) {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\n\t// Handle case when target is a string or something (possible in deep copy)\n\tif ( typeof target !== \"object\" && !jQuery.isFunction(target) ) {\n\t\ttarget = {};\n\t}\n\n\t// extend jQuery itself if only one argument is passed\n\tif ( length === i ) {\n\t\ttarget = this;\n\t\t--i;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\t\t// Only deal with non-null/undefined values\n\t\tif ( (options = arguments[ i ]) != null ) {\n\t\t\t// Extend the base object\n\t\t\tfor ( name in options ) {\n\t\t\t\tsrc = target[ name ];\n\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif ( target === copy ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {\n\t\t\t\t\tif ( copyIsArray ) {\n\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\tclone = src && jQuery.isArray(src) ? src : [];\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclone = src && jQuery.isPlainObject(src) ? src : {};\n\t\t\t\t\t}\n\n\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\n\n","var jQuery = module.exports = require(\"./jquery-core.js\"),\n\tcore_rspace = /\\s+/;\n/**\n* jQuery Callbacks\n*\n* Code from: https://github.com/jquery/jquery/blob/master/src/callbacks.js\n*\n*/\n\n\n// String to Object options format cache\nvar optionsCache = {};\n\n// Convert String-formatted options into Object-formatted ones and store in cache\nfunction createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.split( core_rspace ), function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n\t// Convert options from String-formatted to Object-formatted if needed\n\t// (we check in cache first)\n\toptions = typeof options === \"string\" ?\n\t\t( optionsCache[ options ] || createOptions( options ) ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Last fire value (for non-forgettable lists)\n\t\tmemory,\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\t\t// Flag to know if list is currently firing\n\t\tfiring,\n\t\t// First callback to fire (used internally by add and fireWith)\n\t\tfiringStart,\n\t\t// End of the loop when firing\n\t\tfiringLength,\n\t\t// Index of currently firing callback (modified by remove if needed)\n\t\tfiringIndex,\n\t\t// Actual callback list\n\t\tlist = [],\n\t\t// Stack of fire calls for repeatable lists\n\t\tstack = !options.once && [],\n\t\t// Fire callbacks\n\t\tfire = function( data ) {\n\t\t\tmemory = options.memory && data;\n\t\t\tfired = true;\n\t\t\tfiringIndex = firingStart || 0;\n\t\t\tfiringStart = 0;\n\t\t\tfiringLength = list.length;\n\t\t\tfiring = true;\n\t\t\tfor ( ; list && firingIndex < firingLength; firingIndex++ ) {\n\t\t\t\tif ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {\n\t\t\t\t\tmemory = false; // To prevent further calls using add\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfiring = false;\n\t\t\tif ( list ) {\n\t\t\t\tif ( stack ) {\n\t\t\t\t\tif ( stack.length ) {\n\t\t\t\t\t\tfire( stack.shift() );\n\t\t\t\t\t}\n\t\t\t\t} else if ( memory ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t} else {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t// Actual Callbacks object\n\t\tself = {\n\t\t\t// Add a callback or a collection of callbacks to the list\n\t\t\tadd: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\t// First, we save the current length\n\t\t\t\t\tvar start = list.length;\n\t\t\t\t\t(function add( args ) {\n\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {\n\t\t\t\t\t\t\tvar type = jQuery.type( arg );\n\t\t\t\t\t\t\tif ( type === \"function\" ) {\n\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {\n\t\t\t\t\t\t\t\t\tlist.push( arg );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if ( arg && arg.length && type !== \"string\" ) {\n\t\t\t\t\t\t\t\t// Inspect recursively\n\t\t\t\t\t\t\t\tadd( arg );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t})( arguments );\n\t\t\t\t\t// Do we need to add the callbacks to the\n\t\t\t\t\t// current firing batch?\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tfiringLength = list.length;\n\t\t\t\t\t// With memory, if we're not firing then\n\t\t\t\t\t// we should call right away\n\t\t\t\t\t} else if ( memory ) {\n\t\t\t\t\t\tfiringStart = start;\n\t\t\t\t\t\tfire( memory );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\t\tvar index;\n\t\t\t\t\t\twhile( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\t\tlist.splice( index, 1 );\n\t\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\t\t\tif ( index <= firingLength ) {\n\t\t\t\t\t\t\t\t\tfiringLength--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\t\t\tfiringIndex--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Control if a given callback is in the list\n\t\t\thas: function( fn ) {\n\t\t\t\treturn jQuery.inArray( fn, list ) > -1;\n\t\t\t},\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tlist = [];\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Have the list do nothing anymore\n\t\t\tdisable: function() {\n\t\t\t\tlist = stack = memory = undefined;\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it disabled?\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\t\t\t// Lock the list in its current state\n\t\t\tlock: function() {\n\t\t\t\tstack = undefined;\n\t\t\t\tif ( !memory ) {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it locked?\n\t\t\tlocked: function() {\n\t\t\t\treturn !stack;\n\t\t\t},\n\t\t\t// Call all callbacks with the given context and arguments\n\t\t\tfireWith: function( context, args ) {\n\t\t\t\targs = args || [];\n\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\tif ( list && ( !fired || stack ) ) {\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tstack.push( args );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfire( args );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Call all the callbacks with the given arguments\n\t\t\tfire: function() {\n\t\t\t\tself.fireWith( this, arguments );\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// To know if the callbacks have already been called at least once\n\t\t\tfired: function() {\n\t\t\t\treturn !!fired;\n\t\t\t}\n\t\t};\n\n\treturn self;\n};\n\n","\n/*!\n* jquery-deferred\n* Copyright(c) 2011 Hidden \n* MIT Licensed\n*/\n\n/**\n* Library version.\n*/\n\nvar jQuery = module.exports = require(\"./jquery-callbacks.js\"),\n\tcore_slice = Array.prototype.slice;\n\n/**\n* jQuery deferred\n*\n* Code from: https://github.com/jquery/jquery/blob/master/src/deferred.js\n* Doc: http://api.jquery.com/category/deferred-object/\n*\n*/\n\njQuery.extend({\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\t\t\t\t// action, add listener, listener list, final state\n\t\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks(\"once memory\"), \"resolved\" ],\n\t\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks(\"once memory\"), \"rejected\" ],\n\t\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks(\"memory\") ]\n\t\t\t],\n\t\t\tstate = \"pending\",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\tthen: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\t\t\t\t\treturn jQuery.Deferred(function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\t\t\t\t\tvar action = tuple[ 0 ],\n\t\t\t\t\t\t\t\tfn = fns[ i ];\n\t\t\t\t\t\t\t// deferred[ done | fail | progress ] for forwarding actions to newDefer\n\t\t\t\t\t\t\tdeferred[ tuple[1] ]( jQuery.isFunction( fn ) ?\n\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\tvar returned = fn.apply( this, arguments );\n\t\t\t\t\t\t\t\t\tif ( returned && jQuery.isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject )\n\t\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tnewDefer[ action + \"With\" ]( this === deferred ? newDefer : this, [ returned ] );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} :\n\t\t\t\t\t\t\t\tnewDefer[ action ]\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tfns = null;\n\t\t\t\t\t}).promise();\n\t\t\t\t},\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Keep pipe for back-compat\n\t\tpromise.pipe = promise.then;\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 3 ];\n\n\t\t\t// promise[ done | fail | progress ] = list.add\n\t\t\tpromise[ tuple[1] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(function() {\n\t\t\t\t\t// state = [ resolved | rejected ]\n\t\t\t\t\tstate = stateString;\n\n\t\t\t\t// [ reject_list | resolve_list ].disable; progress_list.lock\n\t\t\t\t}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );\n\t\t\t}\n\n\t\t\t// deferred[ resolve | reject | notify ] = list.fire\n\t\t\tdeferred[ tuple[0] ] = list.fire;\n\t\t\tdeferred[ tuple[0] + \"With\" ] = list.fireWith;\n\t\t});\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( subordinate /* , ..., subordinateN */ ) {\n\t\tvar i = 0,\n\t\t\tresolveValues = core_slice.call( arguments ),\n\t\t\tlength = resolveValues.length,\n\n\t\t\t// the count of uncompleted subordinates\n\t\t\tremaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,\n\n\t\t\t// the master Deferred. If resolveValues consist of only a single Deferred, just use that.\n\t\t\tdeferred = remaining === 1 ? subordinate : jQuery.Deferred(),\n\n\t\t\t// Update function for both resolve and progress values\n\t\t\tupdateFunc = function( i, contexts, values ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tcontexts[ i ] = this;\n\t\t\t\t\tvalues[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;\n\t\t\t\t\tif( values === progressValues ) {\n\t\t\t\t\t\tdeferred.notifyWith( contexts, values );\n\t\t\t\t\t} else if ( !( --remaining ) ) {\n\t\t\t\t\t\tdeferred.resolveWith( contexts, values );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t},\n\n\t\t\tprogressValues, progressContexts, resolveContexts;\n\n\t\t// add listeners to Deferred subordinates; treat others as resolved\n\t\tif ( length > 1 ) {\n\t\t\tprogressValues = new Array( length );\n\t\t\tprogressContexts = new Array( length );\n\t\t\tresolveContexts = new Array( length );\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {\n\t\t\t\t\tresolveValues[ i ].promise()\n\t\t\t\t\t\t.done( updateFunc( i, resolveContexts, resolveValues ) )\n\t\t\t\t\t\t.fail( deferred.reject )\n\t\t\t\t\t\t.progress( updateFunc( i, progressContexts, progressValues ) );\n\t\t\t\t} else {\n\t\t\t\t\t--remaining;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// if we're not waiting on anything, resolve the master\n\t\tif ( !remaining ) {\n\t\t\tdeferred.resolveWith( resolveContexts, resolveValues );\n\t\t}\n\n\t\treturn deferred.promise();\n\t}\n});\n","\nmodule.exports = require('./lib/jquery-deferred');","/* \r\nCopyright 2017 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\n\r\nconst window = window || global || {};\r\n\r\nconst jQueryDeferred = require('jquery-deferred');\r\nconst jQueryShim = jQueryDeferred.extend(\r\n function(selector) {\r\n if (selector === window || selector.document)\r\n return {\r\n 0: selector,\r\n on: function(iEvent, iHandler) {\r\n window.addEventListener(iEvent, iHandler);\r\n },\r\n bind: function(iEvent, iHandler) {\r\n window.addEventListener(iEvent, iHandler, false);\r\n },\r\n unbind: function(iEvent, iHandler) {\r\n window.removeEventListener(iEvent, iHandler, false);\r\n }\r\n };\r\n\r\n if (typeof selector !== 'string') selector.events = selector.events || {};\r\n\r\n return {\r\n 0: selector,\r\n\r\n bind: function(iEvent, iHandler) {\r\n var event = selector.events[iEvent] || [];\r\n event.push(iHandler);\r\n selector.events[iEvent] = event;\r\n },\r\n\r\n unbind: function(iEvent, iHandler) {\r\n var handlers = selector.events[iEvent] || [];\r\n if (iHandler) {\r\n var idx = handlers.indexOf(iHandler);\r\n if (idx !== -1) handlers.splice(idx, 1);\r\n }\r\n else handlers = [];\r\n selector.events[iEvent] = handlers;\r\n },\r\n\r\n triggerHandler: function(iEvent, iArgs) {\r\n var handlers = selector.events[iEvent] || [];\r\n var args = [ { type: iEvent } ];\r\n if (Array.isArray(iArgs))\r\n iArgs.forEach(function(arg) {\r\n args.push(arg);\r\n });\r\n else if (iArgs) args.push(iArgs);\r\n handlers.forEach(function(handler) {\r\n handler.apply(this, args);\r\n });\r\n },\r\n\r\n load: function(iUrl, iArgs, iHandler) {\r\n var request = new window.XMLHttpRequest();\r\n request.open('GET', iUrl, true);\r\n request.onload = function() {\r\n if (request.status >= 200 && request.status < 400) {\r\n var response = request.responseText;\r\n document.querySelector(selector).innerHTML = response;\r\n iHandler.call(document.querySelector(selector));\r\n }\r\n };\r\n request.send();\r\n return {\r\n abort: function(reason) {\r\n return request.abort(reason);\r\n }\r\n };\r\n }\r\n };\r\n },\r\n jQueryDeferred,\r\n {\r\n support: { cors: true },\r\n\r\n trim: function(iStr) {\r\n return typeof iStr === 'string' ? iStr.trim() : iStr;\r\n },\r\n\r\n inArray: function(iArray, iItem) {\r\n return iArray.indexOf(iItem) !== -1;\r\n },\r\n\r\n makeArray: function makeArray(iArray) {\r\n return [].slice.call(iArray, 0);\r\n },\r\n\r\n merge: function(iArray1, iArray2) {\r\n Array.prototype.push.apply(iArray1, iArray2);\r\n return iArray1;\r\n },\r\n\r\n isEmptyObject: function(iObj) {\r\n return !iObj || Object.keys(iObj).length === 0;\r\n },\r\n\r\n ajax: function(iOptions) {\r\n var request = new window.XMLHttpRequest();\r\n request.onreadystatechange = function() {\r\n if (request.readyState !== 4) return;\r\n if (request.status === 200 && !request._hasError) {\r\n try {\r\n iOptions.success && iOptions.success(JSON.parse(request.responseText));\r\n } catch (error) {\r\n iOptions.success && iOptions.success(request.responseText);\r\n }\r\n }\r\n else iOptions.error && iOptions.error(request);\r\n };\r\n request.open(iOptions.type, iOptions.url);\r\n request.setRequestHeader('content-type', iOptions.contentType);\r\n request.send(iOptions.data.data && 'data=' + iOptions.data.data);\r\n return {\r\n abort: function(reason) {\r\n return request.abort(reason);\r\n }\r\n };\r\n },\r\n\r\n getScript: function(iUrl, iSuccess) {\r\n var done = false;\r\n var promise = jQueryDeferred.Deferred();\r\n var head = document.getElementsByTagName('head')[0];\r\n var script = document.createElement('script');\r\n script.src = iUrl;\r\n script.onload = script.onreadystatechange = function() {\r\n if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) {\r\n done = true;\r\n script.onload = script.onreadystatechange = null;\r\n head.removeChild(script);\r\n if (typeof iSuccess === 'function') iSuccess();\r\n promise.resolve();\r\n }\r\n };\r\n head.appendChild(script);\r\n return promise;\r\n }\r\n }\r\n);\r\n\r\nif (typeof window !== 'undefined') window.jQuery = window.jQuery || jQueryShim;\r\n\r\nif (typeof exports === 'object' && typeof module === 'object') module.exports = jQueryShim;\r\n","/* \r\nCopyright 2017-2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport { createEventEmitter } from '../libs/utils';\r\nimport jQueryShim from '../libs/jquery-shim';\r\nconst signalRNetCore = require('@aspnet/signalr');\r\nlet $ = jQueryShim;\r\n\r\nconst window = window || global || {};\r\n\r\nexport class dotnetifyHubFactory {\r\n static create() {\r\n let dotnetifyHub = {\r\n version: '2.0.0',\r\n type: null,\r\n\r\n reconnectDelay: [ 2, 5, 10 ],\r\n reconnectRetry: null,\r\n\r\n _startInfo: null,\r\n _init: false,\r\n\r\n // Hub server methods.\r\n requestVM: (iVMId, iOptions) => dotnetifyHub.server.request_VM(iVMId, iOptions),\r\n updateVM: (iVMId, iValue) => dotnetifyHub.server.update_VM(iVMId, iValue),\r\n disposeVM: iVMId => dotnetifyHub.server.dispose_VM(iVMId),\r\n\r\n // Connection events.\r\n responseEvent: createEventEmitter(),\r\n reconnectedEvent: createEventEmitter(),\r\n connectedEvent: createEventEmitter(),\r\n connectionFailedEvent: createEventEmitter(),\r\n\r\n get isHubStarted() {\r\n return !!this._startInfo;\r\n },\r\n\r\n // Starts connection with SignalR hub server.\r\n startHub(hubOptions, doneHandler, failHandler, forceRestart) {\r\n const _doneHandler = () => {\r\n if (typeof doneHandler == 'function') doneHandler();\r\n this.connectedEvent.emit();\r\n };\r\n const _failHandler = ex => {\r\n if (typeof failHander == 'function') failHandler();\r\n this.connectionFailedEvent.emit();\r\n throw ex;\r\n };\r\n\r\n if (this._startInfo === null || forceRestart) {\r\n try {\r\n this._startInfo = this.start(hubOptions).done(_doneHandler).fail(_failHandler);\r\n } catch (err) {\r\n this._startInfo = null;\r\n }\r\n }\r\n else {\r\n try {\r\n this._startInfo.done(_doneHandler);\r\n } catch (err) {\r\n this._startInfo = null;\r\n return this.startHub(hubOptions, doneHandler, failHandler, forceRestart);\r\n }\r\n }\r\n }\r\n };\r\n\r\n // Configures connection to SignalR hub server.\r\n dotnetifyHub.init = function(iHubPath, iServerUrl, signalR) {\r\n if (dotnetifyHub._init) return;\r\n\r\n dotnetifyHub._init = true;\r\n signalR = signalR || window.signalR || signalRNetCore;\r\n\r\n // SignalR .NET Core.\r\n if (signalR && signalR.HubConnection) {\r\n dotnetifyHub.type = 'netcore';\r\n\r\n Object.defineProperty(dotnetifyHub, 'isConnected', {\r\n get: function() {\r\n return dotnetifyHub._connection && dotnetifyHub._connection.connection.connectionState === 1;\r\n }\r\n });\r\n\r\n dotnetifyHub = $.extend(dotnetifyHub, {\r\n hubPath: iHubPath || '/dotnetify',\r\n url: iServerUrl,\r\n\r\n // Internal variables. Do not modify!\r\n _connection: null,\r\n _reconnectCount: 0,\r\n _startDoneHandler: null,\r\n _startFailHandler: null,\r\n _disconnectedHandler: function() {},\r\n _stateChangedHandler: function(iNewState) {},\r\n\r\n _onDisconnected: function() {\r\n dotnetifyHub._changeState(4);\r\n dotnetifyHub._disconnectedHandler();\r\n },\r\n\r\n _changeState: function(iNewState) {\r\n if (iNewState == 1) dotnetifyHub._reconnectCount = 0;\r\n\r\n let stateText = { 0: 'connecting', 1: 'connected', 2: 'reconnecting', 4: 'disconnected', 99: 'terminated' };\r\n dotnetifyHub._stateChangedHandler(stateText[iNewState]);\r\n },\r\n\r\n _startConnection: function(iHubOptions, iTransportArray) {\r\n let url = dotnetifyHub.url ? dotnetifyHub.url + dotnetifyHub.hubPath : dotnetifyHub.hubPath;\r\n let hubOptions = {};\r\n Object.keys(iHubOptions).forEach(function(key) {\r\n hubOptions[key] = iHubOptions[key];\r\n });\r\n hubOptions.transport = iTransportArray.shift();\r\n\r\n dotnetifyHub._connection = new signalR.HubConnectionBuilder().withUrl(url, hubOptions).build();\r\n dotnetifyHub._connection.on('response_vm', dotnetifyHub.client.response_VM);\r\n dotnetifyHub._connection.onclose(dotnetifyHub._onDisconnected);\r\n\r\n let promise = dotnetifyHub._connection\r\n .start()\r\n .then(function() {\r\n dotnetifyHub._changeState(1);\r\n })\r\n .catch(function() {\r\n // If failed to start, fallback to the next transport.\r\n if (iTransportArray.length > 0) dotnetifyHub._startConnection(iHubOptions, iTransportArray);\r\n else dotnetifyHub._onDisconnected();\r\n });\r\n\r\n if (typeof dotnetifyHub._startDoneHandler === 'function')\r\n promise.then(dotnetifyHub._startDoneHandler).catch(dotnetifyHub._startFailHandler || function() {});\r\n return promise;\r\n },\r\n\r\n start: function(iHubOptions) {\r\n dotnetifyHub._startDoneHandler = null;\r\n dotnetifyHub._startFailHandler = null;\r\n\r\n // Map the transport option.\r\n let transport = [ 0 ];\r\n let transportOptions = { webSockets: 0, serverSentEvents: 1, longPolling: 2 };\r\n if (iHubOptions && Array.isArray(iHubOptions.transport))\r\n transport = iHubOptions.transport.map(function(arg) {\r\n return transportOptions[arg];\r\n });\r\n\r\n let promise = dotnetifyHub._startConnection(iHubOptions, transport);\r\n return {\r\n done: function(iHandler) {\r\n dotnetifyHub._startDoneHandler = iHandler;\r\n promise.then(iHandler).catch(function(error) {\r\n throw error;\r\n });\r\n return this;\r\n },\r\n fail: function(iHandler) {\r\n dotnetifyHub._startFailHandler = iHandler;\r\n promise.catch(iHandler);\r\n return this;\r\n }\r\n };\r\n },\r\n\r\n disconnected: function(iHandler) {\r\n if (typeof iHandler === 'function') dotnetifyHub._disconnectedHandler = iHandler;\r\n },\r\n\r\n stateChanged: function(iHandler) {\r\n if (typeof iHandler === 'function') dotnetifyHub._stateChangedHandler = iHandler;\r\n },\r\n\r\n reconnect: function(iStartHubFunc) {\r\n if (typeof iStartHubFunc === 'function') {\r\n // Only attempt reconnect if the specified retry hasn't been exceeded.\r\n if (!dotnetifyHub.reconnectRetry || dotnetifyHub._reconnectCount < dotnetifyHub.reconnectRetry) {\r\n // Determine reconnect delay from the specified configuration array.\r\n let delay =\r\n dotnetifyHub._reconnectCount < dotnetifyHub.reconnectDelay.length\r\n ? dotnetifyHub.reconnectDelay[dotnetifyHub._reconnectCount]\r\n : dotnetifyHub.reconnectDelay[dotnetifyHub.reconnectDelay.length - 1];\r\n\r\n dotnetifyHub._reconnectCount++;\r\n\r\n setTimeout(function() {\r\n dotnetifyHub._changeState(2);\r\n iStartHubFunc();\r\n }, delay * 1000);\r\n }\r\n else dotnetifyHub._changeState(99);\r\n }\r\n },\r\n\r\n client: {},\r\n\r\n server: {\r\n dispose_VM: function(iVMId) {\r\n dotnetifyHub._connection.invoke('Dispose_VM', iVMId);\r\n },\r\n update_VM: function(iVMId, iValue) {\r\n dotnetifyHub._connection.invoke('Update_VM', iVMId, iValue);\r\n },\r\n request_VM: function(iVMId, iArgs) {\r\n dotnetifyHub._connection.invoke('Request_VM', iVMId, iArgs);\r\n }\r\n }\r\n });\r\n }\r\n else {\r\n // SignalR .NET FX.\r\n dotnetifyHub.type = 'netfx';\r\n\r\n if (window.jQuery) $ = window.jQuery;\r\n\r\n // SignalR hub auto-generated from /signalr/hubs.\r\n /// \r\n /// \r\n (function($, window, undefined) {\r\n /// \r\n 'use strict';\r\n\r\n if (typeof $.signalR !== 'function') {\r\n throw new Error('SignalR: SignalR is not loaded. Please ensure jquery.signalR-x.js is referenced before ~/signalr/js.');\r\n }\r\n\r\n var signalR = $.signalR;\r\n\r\n function makeProxyCallback(hub, callback) {\r\n return function() {\r\n // Call the client hub method\r\n callback.apply(hub, $.makeArray(arguments));\r\n };\r\n }\r\n\r\n function registerHubProxies(instance, shouldSubscribe) {\r\n var key, hub, memberKey, memberValue, subscriptionMethod;\r\n\r\n for (key in instance) {\r\n if (instance.hasOwnProperty(key)) {\r\n hub = instance[key];\r\n\r\n if (!hub.hubName) {\r\n // Not a client hub\r\n continue;\r\n }\r\n\r\n if (shouldSubscribe) {\r\n // We want to subscribe to the hub events\r\n subscriptionMethod = hub.on;\r\n }\r\n else {\r\n // We want to unsubscribe from the hub events\r\n subscriptionMethod = hub.off;\r\n }\r\n\r\n // Loop through all members on the hub and find client hub functions to subscribe/unsubscribe\r\n for (memberKey in hub.client) {\r\n if (hub.client.hasOwnProperty(memberKey)) {\r\n memberValue = hub.client[memberKey];\r\n\r\n if (!$.isFunction(memberValue)) {\r\n // Not a client hub function\r\n continue;\r\n }\r\n\r\n subscriptionMethod.call(hub, memberKey, makeProxyCallback(hub, memberValue));\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n $.hubConnection.prototype.createHubProxies = function() {\r\n var proxies = {};\r\n this.starting(function() {\r\n // Register the hub proxies as subscribed\r\n // (instance, shouldSubscribe)\r\n registerHubProxies(proxies, true);\r\n\r\n this._registerSubscribedHubs();\r\n }).disconnected(function() {\r\n // Unsubscribe all hub proxies when we \"disconnect\". This is to ensure that we do not re-add functional call backs.\r\n // (instance, shouldSubscribe)\r\n registerHubProxies(proxies, false);\r\n });\r\n\r\n proxies['dotNetifyHub'] = this.createHubProxy('dotNetifyHub');\r\n proxies['dotNetifyHub'].client = {};\r\n proxies['dotNetifyHub'].server = {\r\n dispose_VM: function(vmId) {\r\n return proxies['dotNetifyHub'].invoke.apply(proxies['dotNetifyHub'], $.merge([ 'Dispose_VM' ], $.makeArray(arguments)));\r\n },\r\n\r\n request_VM: function(vmId, vmArg) {\r\n return proxies['dotNetifyHub'].invoke.apply(proxies['dotNetifyHub'], $.merge([ 'Request_VM' ], $.makeArray(arguments)));\r\n },\r\n\r\n update_VM: function(vmId, vmData) {\r\n return proxies['dotNetifyHub'].invoke.apply(proxies['dotNetifyHub'], $.merge([ 'Update_VM' ], $.makeArray(arguments)));\r\n }\r\n };\r\n\r\n return proxies;\r\n };\r\n\r\n signalR.hub = $.hubConnection(dotnetifyHub.hubPath, { useDefaultPath: false });\r\n $.extend(signalR, signalR.hub.createHubProxies());\r\n })($, window);\r\n\r\n Object.defineProperty(dotnetifyHub, 'state', {\r\n get: function() {\r\n return $.connection.hub.state;\r\n },\r\n set: function(val) {\r\n $.connection.hub.state = val;\r\n }\r\n });\r\n\r\n Object.defineProperty(dotnetifyHub, 'client', {\r\n get: function() {\r\n return $.connection.dotNetifyHub.client;\r\n }\r\n });\r\n\r\n Object.defineProperty(dotnetifyHub, 'server', {\r\n get: function() {\r\n return $.connection.dotNetifyHub.server;\r\n }\r\n });\r\n\r\n Object.defineProperty(dotnetifyHub, 'isConnected', {\r\n get: function() {\r\n return $.connection.hub.state == $.signalR.connectionState.connected;\r\n }\r\n });\r\n\r\n dotnetifyHub = $.extend(dotnetifyHub, {\r\n hubPath: iHubPath || '/signalr',\r\n url: iServerUrl,\r\n\r\n _reconnectCount: 0,\r\n _stateChangedHandler: function(iNewState) {},\r\n\r\n start: function(iHubOptions) {\r\n if (dotnetifyHub.url) $.connection.hub.url = dotnetifyHub.url;\r\n\r\n let deferred;\r\n if (iHubOptions) deferred = $.connection.hub.start(iHubOptions);\r\n else deferred = $.connection.hub.start();\r\n deferred.fail(function(error) {\r\n if (error.source && error.source.message === 'Error parsing negotiate response.')\r\n console.warn('This client may be attempting to connect to an incompatible SignalR .NET Core server.');\r\n });\r\n return deferred;\r\n },\r\n\r\n disconnected: function(iHandler) {\r\n return $.connection.hub.disconnected(iHandler);\r\n },\r\n\r\n stateChanged: function(iHandler) {\r\n dotnetifyHub._stateChangedHandler = iHandler;\r\n return $.connection.hub.stateChanged(function(state) {\r\n if (state == 1) dotnetifyHub._reconnectCount = 0;\r\n\r\n let stateText = { 0: 'connecting', 1: 'connected', 2: 'reconnecting', 4: 'disconnected' };\r\n iHandler(stateText[state.newState]);\r\n });\r\n },\r\n\r\n reconnect: function(iStartHubFunc) {\r\n if (typeof iStartHubFunc === 'function') {\r\n // Only attempt reconnect if the specified retry hasn't been exceeded.\r\n if (!dotnetifyHub.reconnectRetry || dotnetifyHub._reconnectCount < dotnetifyHub.reconnectRetry) {\r\n // Determine reconnect delay from the specified configuration array.\r\n let delay =\r\n dotnetifyHub._reconnectCount < dotnetifyHub.reconnectDelay.length\r\n ? dotnetifyHub.reconnectDelay[dotnetifyHub._reconnectCount]\r\n : dotnetifyHub.reconnectDelay[dotnetifyHub.reconnectDelay.length - 1];\r\n\r\n dotnetifyHub._reconnectCount++;\r\n\r\n setTimeout(function() {\r\n dotnetifyHub._stateChangedHandler('reconnecting');\r\n iStartHubFunc();\r\n }, delay * 1000);\r\n }\r\n else dotnetifyHub._stateChangedHandler('terminated');\r\n }\r\n }\r\n });\r\n }\r\n\r\n // Setup SignalR server method handler.\r\n dotnetifyHub.client.response_VM = function(iVMId, iVMData) {\r\n // SignalR .NET Core is sending an array of arguments.\r\n if (Array.isArray(iVMId)) {\r\n iVMData = iVMId[1];\r\n iVMId = iVMId[0];\r\n }\r\n\r\n let handled = dotnetifyHub.responseEvent.emit(iVMId, iVMData);\r\n\r\n // If we get to this point, that means the server holds a view model instance\r\n // whose view no longer existed. So, tell the server to dispose the view model.\r\n if (!handled) dotnetifyHub.server.dispose_VM(iVMId);\r\n };\r\n\r\n // On disconnected, keep attempting to start the connection.\r\n dotnetifyHub.disconnected(function() {\r\n dotnetifyHub._startInfo = null;\r\n dotnetifyHub.reconnect(function() {\r\n dotnetifyHub.reconnectedEvent.emit();\r\n });\r\n });\r\n };\r\n\r\n return dotnetifyHub;\r\n }\r\n}\r\n\r\nexport default dotnetifyHubFactory.create();\r\n","/* \r\nCopyright 2017-2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport dotnetifyHub, { dotnetifyHubFactory } from './dotnetify-hub';\r\nimport localHub, { hasLocalVM } from './dotnetify-hub-local';\r\n\r\nexport class dotnetifyFactory {\r\n static create() {\r\n const dotnetify = {\r\n // SignalR hub options.\r\n hub: dotnetifyHub,\r\n hubOptions: { transport: [ 'webSockets', 'longPolling' ] },\r\n hubPath: null,\r\n\r\n // Debug mode.\r\n debug: false,\r\n debugFn: null,\r\n\r\n // Offline mode. (WIP)\r\n offline: false,\r\n isOffline: true,\r\n offlineTimeout: 5000,\r\n offlineCacheFn: null,\r\n\r\n // Internal variables.\r\n _vmAccessors: [],\r\n\r\n // Use this to get notified of connection state changed events.\r\n // (state, exception, hub) => void\r\n connectionStateHandler: null,\r\n\r\n // Use this intercept a view model prior to establishing connection,\r\n // with the option to provide any connect parameters.\r\n // ({vmId, options}) => {vmId, options, hub}\r\n connectHandler: null,\r\n\r\n // Support changing hub server URL after first init.\r\n get hubServerUrl() {\r\n return this.hub.url;\r\n },\r\n\r\n set hubServerUrl(url) {\r\n this.hub.url = url;\r\n if (this.debug) console.log('SignalR: connecting to ' + this.hubServerUrl);\r\n if (this.hub.isHubStarted) this.startHub(this.hub, true);\r\n },\r\n\r\n // Generic connect function for non-React app.\r\n connect(iVMId, iOptions) {\r\n dotnetify.react.connect(iVMId, null, iOptions);\r\n },\r\n\r\n // Creates a SignalR hub client.\r\n createHub(hubServerUrl, hubPath, hubLib) {\r\n return this.initHub(dotnetifyHubFactory.create(), hubPath, hubServerUrl, hubLib);\r\n },\r\n\r\n // Configures hub connection to SignalR hub server.\r\n initHub(hub, hubPath, hubServerUrl, hubLib) {\r\n hub = hub || this.hub;\r\n hubPath = hubPath || this.hubPath;\r\n hubServerUrl = hubServerUrl || this.hubServerUrl;\r\n hubLib = hubLib || this.hubLib;\r\n\r\n if (!hub.isHubStarted) {\r\n hub.init(hubPath, hubServerUrl, hubLib);\r\n\r\n // Use SignalR event to raise the connection state event.\r\n hub.stateChanged(state => this.handleConnectionStateChanged(state, null, hub));\r\n }\r\n return hub;\r\n },\r\n\r\n // Used by a view to select a hub, and provides the opportunity to override any connect info.\r\n selectHub(vmConnectArgs) {\r\n vmConnectArgs = vmConnectArgs || { options: {} };\r\n let override = (typeof this.connectHandler == 'function' && this.connectHandler(vmConnectArgs)) || {};\r\n if (!override.hub) {\r\n override.hub = hasLocalVM(vmConnectArgs.vmId) ? localHub : this.initHub();\r\n override.hub.debug = this.debug;\r\n }\r\n return Object.assign(vmConnectArgs, override);\r\n },\r\n\r\n // Starts hub connection to SignalR hub server.\r\n startHub(hub, forceRestart) {\r\n hub = hub || this.hub;\r\n\r\n const doneHandler = () => {};\r\n const failHandler = ex => this.handleConnectionStateChanged('error', ex, hub);\r\n hub.startHub(this.hubOptions, doneHandler, failHandler, forceRestart);\r\n },\r\n\r\n // Used by dotnetify-react and -vue to expose their view model accessors.\r\n addVMAccessor(vmAccessor) {\r\n !this._vmAccessors.includes(vmAccessor) && this._vmAccessors.push(vmAccessor);\r\n },\r\n\r\n checkServerSideException(iVMId, iVMData, iExceptionHandler) {\r\n const vmData = JSON.parse(iVMData);\r\n if (vmData && vmData.hasOwnProperty('ExceptionType') && vmData.hasOwnProperty('Message')) {\r\n const exception = { name: vmData.ExceptionType, message: vmData.Message };\r\n\r\n if (typeof iExceptionHandler === 'function') {\r\n return iExceptionHandler(exception);\r\n }\r\n else {\r\n console.error('[' + iVMId + '] ' + exception.name + ': ' + exception.message);\r\n throw exception;\r\n }\r\n }\r\n },\r\n\r\n // Get all view models.\r\n getViewModels() {\r\n return this._vmAccessors\r\n .reduce((prev, current) => [ ...prev, ...current() ], [])\r\n .filter((val, idx, self) => self.indexOf(val) === idx); // returns distinct items.\r\n },\r\n\r\n handleConnectionStateChanged(iState, iException, iHub) {\r\n if (this.debug) console.log('SignalR: ' + (iException ? iException.message : iState));\r\n if (typeof this.connectionStateHandler === 'function') this.connectionStateHandler(iState, iException, iHub);\r\n else if (iException) console.error(iException);\r\n }\r\n };\r\n\r\n return dotnetify;\r\n }\r\n}\r\n\r\nexport default dotnetifyFactory.create();\r\n","import dotnetify from './dotnetify-ko';\r\nimport './dotnetify-ko.router';\r\n\r\nmodule.exports = dotnetify;\r\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://dotnetify/webpack/universalModuleDefinition","webpack://dotnetify/webpack/bootstrap","webpack://dotnetify/(webpack)/buildin/global.js","webpack://dotnetify/./src/dotnetify/libs/utils.js","webpack://dotnetify/external {\"commonjs\":\"knockout\",\"commonjs2\":\"knockout\",\"amd\":\"knockout\",\"root\":\"ko\"}","webpack://dotnetify/external {\"commonjs\":\"jquery\",\"commonjs2\":\"jquery\",\"amd\":\"jquery\",\"root\":\"jQuery\"}","webpack://dotnetify/(webpack)/buildin/module.js","webpack://dotnetify/./src/dotnetify/knockout/dotnetify-ko.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-vm-router.js","webpack://dotnetify/./src/dotnetify/knockout/dotnetify-ko.vm-router.js","webpack://dotnetify/./src/dotnetify/libs/path.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-router.js","webpack://dotnetify/./src/dotnetify/knockout/dotnetify-ko.router.js","webpack://dotnetify/./src/dotnetify/knockout/knockout.mapping-latest.js","webpack://dotnetify/./src/dotnetify/knockout/jquery-ui-widget.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-hub-webapi.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-hub-local.js","webpack://dotnetify/external {\"commonjs\":\"@aspnet/signalr\",\"commonjs2\":\"@aspnet/signalr\",\"amd\":\"@aspnet/signalr\",\"root\":\"signalR\"}","webpack://dotnetify/./node_modules/jquery-deferred/lib/jquery-core.js","webpack://dotnetify/./node_modules/jquery-deferred/lib/jquery-callbacks.js","webpack://dotnetify/./node_modules/jquery-deferred/lib/jquery-deferred.js","webpack://dotnetify/./node_modules/jquery-deferred/index.js","webpack://dotnetify/./src/dotnetify/libs/jquery-shim.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-hub.js","webpack://dotnetify/./src/dotnetify/core/dotnetify.js","webpack://dotnetify/./src/dotnetify/knockout/index.js"],"names":["window","global","utils","iStr","indexOf","length","substr","iStr1","iStr2","toLowerCase","iValue","slice","iEvent","Event","dispatchEvent","event","document","createEvent","initEvent","iArray","iFilter","Array","isArray","filter","createEventEmitter","subscribers","emit","args","handled","forEach","subscriber","subscribe","includes","push","x","fetch","iMethod","iUrl","iData","iOptions","Promise","resolve","reject","request","XMLHttpRequest","open","onload","status","response","responseText","onerror","send","ko","mapping","require","dotnetify","_dotnetify","version","controller","_responseSubs","_connectedSubs","_responseVM","iVMId","iVMData","vmType","vmInstanceId","path","split","selector","i","element","checkServerSideException","data","UpdateVM","init","self","hub","selectHub","applyWidget","$","each","responseEvent","connectedEvent","setTimeout","offline","isConnected","isOffline","trigger","offlineTimeout","startHub","stateChanged","state","debug","console","log","destroy","iParent","elems","find","addBack","toArray","widget","elem","getViewModels","map","VM","iElement","plugins","_create","VMType","attr","VMId","instanceId","parents","_ListenToOfflineEvent","_RequestVM","_GetOfflineVM","error","_destroy","OfflineFn","off","pluginId","plugin","$destroy","apply","hasOwnProperty","e","stack","disposeVM","fromJS","JSON","parse","$vmId","$element","$dotnetify","$vmOffline","observable","IsOffline","_AddBuiltInFunctions","$init","applyBindings","$serverUpdate","_OnComponentReady","$ready","_SubscribeObservables","offlineCacheFn","vmUpdate","_PreProcess","debugFn","$preventBinding","fn","$addList","iList","iNewItem","newItem","key","match","arrayFirst","replace","$updateList","Object","keys","isObservable","prop","$removeList","iCriteria","remove","$on","iProperty","iCallback","iNewValue","$once","subscription","dispose","$loadView","iTargetSelector","iViewUrl","iJsModuleUrl","iVmArg","iCallbackFn","empty","load","isEmptyObject","stringify","getScript","$inject","iContext","iObject","idx","item","_Inject","jsModule","jsInstance","assign","prototype","cachedData","warn","one","bind","pureComputed","$subscribe","retry","checkComponentReadyFn","isReady","components","grep","childElementCount","_OnValueChanged","iVMPath","update","extend","updateVM","iVMUpdate","exec","list","Error","vmArg","parseJSON","requestVM","iParam","property","charAt","isNaN","index","bindingHandlers","vmItemKey","preprocess","value","valueAccessor","allBindings","viewModel","bindingContext","items","get","vmCommand","vm","$root","fnName","fnArg","matchFnNameArg","toString","trim","matchFnName","outerHTML","getFn","unwrap","newValueAccessor","$parent","click","vmOnce","vmOn","once","dotnetifyVMRouter","router","routes","iPath","$dispatch","State","RoutingState","Active","iArg","preventDefault","currentTarget","pathname","pushState","hasRoutingState","Root","_absRoot","absRoot","VMRoot","root","templates","Templates","initRoot","urlPattern","template","UrlPattern","Id","mapUrl","toUrl","mapTo","urlPath","param","iParams","routeTo","activeUrl","routeUrl","raiseRoutedEvent","iRoute","equal","Path","unmountView","getScripts","when","done","callbackFn","call","iHtmlElement","mountViewFunc","target","querySelector","firstChild","removeChild","appendChild","iTarget","iJSModuleUrl","Target","ViewUrl","JSModuleUrl","iTemplate","force","TemplateId","RedirectRoot","redirectRoot","redirectRootPath","urlRedirect","absRootPath","some","Url","$template","pathToRoute","url","iDisableEvent","isRedirect","viewModels","vmOther","$router","VMArg","onRouteEnter","getElementById","redirect","loadView","dispatchActiveRoutingState","onRouteExit","$route","redirectUrlPath","startsWith","routeElem","templateWrapper","routingStateWrapper","routingState","Origin","dotnetifyKoVMRouter","iVM","iDotNetifyRouter","vmElems","overrideUrl","defined","core","route","rescue","history","initial","title","supported","dispatch","fallback","location","hash","popState","initialPop","popped","href","URL","listen","onpopstate","parameterize","params","possible_routes","j","compare","result","undefined","partition","search","join","passed_route","previous_route","matched_route","current","previous","do_exit","run","documentMode","onhashchange","setInterval","action","do_enter","to","enter","fns","concat","exit","parts","options","re","text","halt_execution","dotnetifyRouter","iFn","iUrlPath","matched","iState","iTitle","initRouting","vmData","vmRoute","d","exports","module","f","y","b","c","a","getType","l","n","t","g","E","z","L","ignore","h","include","copy","observe","mappedProperties","copiedProperties","arrayGetDistinctValues","F","k","unwrapObservable","isMapped","p","create","Function","G","dependentObservable","deferEvaluation","M","H","isWriteableObservable","read","arrayRemoveItem","arguments","write","computed","parent","skip","N","u","v","I","s","m","observableArray","mappedRemove","mappedRemoveAll","C","arrayIndexOf","mappedDestroy","mappedDestroyAll","mappedIndexOf","mappedCreate","sort","compareArrays","J","A","r","B","q","w","D","K","O","arrayChanged","arrayForEach","P","save","Q","R","arrayMap","T","S","pop","fromJSON","parseJson","updateFromJS","updateFromJSON","toJS","resetDefaultOptions","visitModel","toJSON","stringifyJson","defaultOptions","constructor","Date","visitedObjects","parentName","cleanData","_data","triggerHandler","o","Widget","expr","_createWidget","_proto","_childConstructors","isFunction","_super","_superApply","widgetEventPrefix","namespace","widgetName","widgetFullName","bridge","isPlainObject","jquery","pushStack","option","_init","defaultElement","disabled","uuid","eventNamespace","bindings","hoverable","focusable","_on","style","ownerDocument","defaultView","parentWindow","_getCreateOptions","_trigger","_getCreateEventData","noop","unbind","removeData","camelCase","removeAttr","removeClass","shift","_setOptions","_setOption","toggleClass","enable","disable","add","hasClass","guid","delegate","_off","undelegate","not","_delay","_hoverable","mouseenter","addClass","mouseleave","_focusable","focusin","focusout","type","originalEvent","isDefaultPrevented","show","hide","effect","duration","complete","delay","effects","easing","queue","dotNetifyHubWebApi","iBaseUrl","iOnRequest","mode","isHubStarted","reconnectedEvent","connectionFailedEvent","_vmArgs","baseUrl","onRequest","iVMArgs","vmArgs","vmArgQuery","$vmArg","headers","$headers","setRequestHeader","then","catch","payload","createWebApiHub","normalize","hasLocalVM","vmId","onConnect","dotNetifyHubLocal","$pushUpdate","onDispatch","onDestroy","jQueryDeferred","jQueryShim","on","iHandler","addEventListener","removeEventListener","events","handlers","splice","iArgs","arg","handler","innerHTML","abort","reason","support","cors","inArray","iItem","makeArray","merge","iArray1","iArray2","iObj","ajax","onreadystatechange","readyState","_hasError","success","contentType","iSuccess","promise","Deferred","head","getElementsByTagName","script","createElement","src","jQuery","signalRNetCore","dotnetifyHubFactory","dotnetifyHub","reconnectDelay","reconnectRetry","_startInfo","server","request_VM","update_VM","dispose_VM","hubOptions","doneHandler","failHandler","forceRestart","_doneHandler","_failHandler","failHander","ex","start","fail","err","iHubPath","iServerUrl","signalR","HubConnection","defineProperty","_connection","connection","connectionState","hubPath","_reconnectCount","_startDoneHandler","_startFailHandler","_disconnectedHandler","_stateChangedHandler","iNewState","_onDisconnected","_changeState","stateText","_startConnection","iHubOptions","iTransportArray","transport","HubConnectionBuilder","withUrl","build","client","response_VM","onclose","transportOptions","webSockets","serverSentEvents","longPolling","disconnected","reconnect","iStartHubFunc","invoke","makeProxyCallback","callback","registerHubProxies","instance","shouldSubscribe","memberKey","memberValue","subscriptionMethod","hubName","hubConnection","createHubProxies","proxies","starting","_registerSubscribedHubs","createHubProxy","useDefaultPath","set","val","dotNetifyHub","connected","deferred","source","message","newState","dotnetifyFactory","_vmAccessors","connectionStateHandler","connectHandler","hubServerUrl","connect","react","createHub","hubLib","initHub","onRequestHandler","handleConnectionStateChanged","vmConnectArgs","override","localHub","webApi","webApiHub","addVMAccessor","vmAccessor","iExceptionHandler","exception","name","ExceptionType","Message","reduce","prev","iException","iHub"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA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AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;ACxJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,oCAAoC;AAC9C;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;AC3MA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA,MAAM;AACN,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,8CAA8C;AAC9C,KAAK;AACL;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,IAAI;;AAEJ;;AAEA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA,UAAU,YAAY;AACtB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;;;;;;;ACjKD,yC;;;;;;;;;;;ACDA;;;;;;;;;;;;;;;;AAgBA,IAAMvlB,SAASA,UAAUC,MAAV,IAAoB,EAAnC;;AAEA,IAAM6lB,iBAAiB,mBAAAxiB,CAAQ,EAAR,CAAvB;AACA,IAAMyiB,aAAaD,eAAe5Y,MAAf,CACjB,UAAS9I,QAAT,EAAmB;AACjB,MAAIA,aAAapE,MAAb,IAAuBoE,SAASpD,QAApC,EACE,OAAO;AACL,OAAGoD,QADE;A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pX,SAAjC;AAAA,WADH,EACiD,EADjD,EAEJpW,MAFI,CAEG,UAACwrB,GAAD,EAAMnhB,GAAN,EAAWjH,IAAX;AAAA,mBAAoBA,KAAKvE,OAAL,CAAa2sB,GAAb,MAAsBnhB,GAA1C;AAAA,WAFH,CAAP,CADc,CAG4C;AAC3D,SApHe;AAsHhBqiB,oCAtHgB,wCAsHa/U,MAtHb,EAsHqB8V,UAtHrB,EAsHiCC,IAtHjC,EAsHuC;AACrD,cAAI,KAAKrpB,KAAT,EAAgBC,QAAQC,GAAR,CAAY,eAAekpB,aAAaA,WAAW5B,OAAxB,GAAkClU,MAAjD,CAAZ;AAChB,cAAI,OAAO,KAAKsU,sBAAZ,KAAuC,UAA3C,EAAuD,KAAKA,sBAAL,CAA4BtU,MAA5B,EAAoC8V,UAApC,EAAgDC,IAAhD,EAAvD,KACK,IAAID,UAAJ,EAAgBnpB,QAAQwB,KAAR,CAAc2nB,UAAd;AACtB;AA1He,OAAlB;;AA6HA,aAAOzrB,SAAP;AACD;;;;;;kBAGY+pB,iBAAiBlS,MAAjB,E;;;;;;;;;ACtJf;;;;AACA;;;;AAEA3B,OAAOD,OAAP,GAAiBjW,qBAAjB,C","file":"dotnetify-ko.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"knockout\"), require(\"jquery\"), require(\"@aspnet/signalr\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"knockout\", \"jquery\", \"@aspnet/signalr\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"dotnetify\"] = factory(require(\"knockout\"), require(\"jquery\"), require(\"@aspnet/signalr\"));\n\telse\n\t\troot[\"dotnetify\"] = factory(root[\"ko\"], root[\"jQuery\"], root[\"signalR\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__3__, __WEBPACK_EXTERNAL_MODULE__15__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 23);\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","/* \r\nCopyright 2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nconst window = window || global || {};\r\n\r\nclass utils {\r\n // Trim slashes from start and end of string.\r\n trim(iStr) {\r\n if (typeof iStr !== 'string') return '';\r\n\r\n while (iStr.indexOf('/', iStr.length - 1) >= 0) iStr = iStr.substr(0, iStr.length - 1);\r\n while (iStr.indexOf('/') == 0) iStr = iStr.substr(1, iStr.length - 1);\r\n return iStr;\r\n }\r\n\r\n // Match two strings case-insensitive.\r\n equal(iStr1, iStr2) {\r\n return iStr1 != null && iStr2 != null && iStr1.toLowerCase() == iStr2.toLowerCase();\r\n }\r\n\r\n // Whether the string starts or ends with a value.\r\n startsWith(iStr, iValue) {\r\n return iStr.toLowerCase().slice(0, iValue.length) == iValue.toLowerCase();\r\n }\r\n\r\n endsWith(iStr, iValue) {\r\n return iValue == '' || iStr.toLowerCase().slice(-iValue.length) == iValue.toLowerCase();\r\n }\r\n\r\n // Dispatch event with IE polyfill.\r\n dispatchEvent(iEvent) {\r\n if (typeof Event === 'function') window.dispatchEvent(new Event(iEvent));\r\n else {\r\n var event = document.createEvent('CustomEvent');\r\n event.initEvent(iEvent, true, true);\r\n window.dispatchEvent(event);\r\n }\r\n }\r\n\r\n grep(iArray, iFilter) {\r\n return Array.isArray(iArray) ? iArray.filter(iFilter) : [];\r\n }\r\n}\r\n\r\nexport const createEventEmitter = _ => {\r\n let subscribers = [];\r\n return {\r\n emit(...args) {\r\n let handled = false;\r\n subscribers.forEach(subscriber => {\r\n handled = subscriber(...args) || handled;\r\n });\r\n return handled;\r\n },\r\n\r\n subscribe(subscriber) {\r\n !subscribers.includes(subscriber) && subscribers.push(subscriber);\r\n return () => (subscribers = subscribers.filter(x => x !== subscriber));\r\n }\r\n };\r\n};\r\n\r\nexport const fetch = (iMethod, iUrl, iData, iOptions) => {\r\n return new Promise((resolve, reject) => {\r\n let request = new window.XMLHttpRequest();\r\n request.open(iMethod, iUrl, true);\r\n if (typeof iOptions == 'function') iOptions(request);\r\n\r\n request.onload = function() {\r\n if (request.status >= 200 && request.status < 400) {\r\n var response = request.responseText;\r\n resolve(response);\r\n }\r\n else reject(request);\r\n };\r\n request.onerror = function() {\r\n reject(request);\r\n };\r\n request.send(iData);\r\n });\r\n};\r\n\r\nexport default new utils();\r\n","module.exports = __WEBPACK_EXTERNAL_MODULE__2__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3__;","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","/* \r\nCopyright 2015-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport _dotnetify from '../core/dotnetify';\r\nimport $ from 'jquery';\r\nimport './jquery-ui-widget';\r\nimport * as ko from 'knockout';\r\n\r\nko.mapping = require('./knockout.mapping-latest');\r\n\r\nconst window = window || global || {};\r\nlet dotnetify = window.dotnetify || _dotnetify;\r\n\r\ndotnetify.ko = {\r\n version: '2.0.0',\r\n controller: dotnetify,\r\n\r\n // Internal variables.\r\n _responseSubs: null,\r\n _connectedSubs: null,\r\n\r\n _responseVM: function(iVMId, iVMData) {\r\n // Construct a selector from iVMId to find the associated widget.\r\n // First parse the instance Id out of the string, if present.\r\n var vmType = iVMId;\r\n var vmInstanceId = null;\r\n if (vmType.indexOf('$') >= 0) {\r\n var path = iVMId.split('$');\r\n vmType = path[0];\r\n vmInstanceId = path[1];\r\n }\r\n\r\n var selector = \"[data-vm='\" + vmType + \"']\";\r\n\r\n // If present, add the master view models to the selector.\r\n var path = vmType.split('.');\r\n if (path.length > 1) {\r\n selector = '';\r\n let i = 0;\r\n for (i = 0; i < path.length - 1; i++) selector += \"[data-master-vm='\" + path[i] + \"'] \";\r\n selector += \"[data-vm='\" + path[i] + \"']\";\r\n }\r\n\r\n // If present, add the instance Id to the selector.\r\n if (vmInstanceId != null) selector += \"[data-vm-id='\" + vmInstanceId + \"']\";\r\n\r\n // Use the selector to locate the view model widget and pass the data.\r\n var element = $(selector);\r\n if (element.length > 0) {\r\n dotnetify.checkServerSideException(iVMId, iVMData);\r\n element.data('ko-dotnetify').UpdateVM(iVMData);\r\n return true;\r\n }\r\n return false;\r\n },\r\n\r\n init: function() {\r\n const self = dotnetify.ko;\r\n const hub = dotnetify.selectHub().hub;\r\n\r\n var applyWidget = function() {\r\n $.each($('[data-vm]'), function() {\r\n $(this).dotnetify();\r\n });\r\n };\r\n\r\n if (!self._responseSubs) self._responseSubs = hub.responseEvent.subscribe(self._responseVM);\r\n\r\n if (!self._connectedSubs)\r\n self._connectedSubs = hub.connectedEvent.subscribe(function() {\r\n applyWidget();\r\n });\r\n\r\n // If offline mode is enabled, apply the widget anyway when there's no connection.\r\n setTimeout(function() {\r\n if (dotnetify.offline && !hub.isConnected) {\r\n applyWidget();\r\n dotnetify.isOffline = true;\r\n $(document).trigger('offline', dotnetify.isOffline);\r\n }\r\n }, dotnetify.offlineTimeout);\r\n\r\n dotnetify.startHub(hub);\r\n\r\n // Use SignalR event to raise the offline event with true/false argument.\r\n hub.stateChanged(function(state) {\r\n if (dotnetify.debug) console.log('SignalR: ' + state);\r\n\r\n var isOffline = state != 'connected';\r\n if (dotnetify.isOffline != isOffline) {\r\n dotnetify.isOffline = isOffline;\r\n $(document).trigger('offline', dotnetify.isOffline);\r\n }\r\n });\r\n\r\n if (dotnetify.offline) applyWidget();\r\n },\r\n\r\n destroy: function(iParent) {\r\n const elems = iParent ? $(iParent).find('[data-vm]').addBack(iParent) : $('[data-vm]');\r\n elems.toArray().forEach(elem => {\r\n const widget = dotnetify.ko.widget(elem);\r\n if (widget) widget.destroy();\r\n });\r\n },\r\n\r\n // Get all view models.\r\n getViewModels: function() {\r\n const self = dotnetify.ko;\r\n const elems = $('[data-vm]').toArray();\r\n return elems\r\n .map(elem => {\r\n const widget = dotnetify.ko.widget(elem);\r\n return widget ? widget.VM : null;\r\n })\r\n .filter(x => x);\r\n },\r\n\r\n widget: function(iElement) {\r\n return $(iElement).data('ko-dotnetify');\r\n },\r\n\r\n plugins: {}\r\n};\r\n\r\n$(function() {\r\n dotnetify.ko.init();\r\n});\r\n\r\n$.widget('ko.dotnetify', {\r\n // Widget constructor.\r\n _create: function() {\r\n var self = this;\r\n\r\n self.VMType = self.element.attr('data-vm');\r\n self.VMId = self.VMType;\r\n\r\n // If an instance Id is specified, add it to VMId.\r\n var instanceId = self.element.attr('data-vm-id');\r\n if (instanceId != null) self.VMId += '$' + instanceId;\r\n\r\n // If inside master view scope, combine the names into VMId.\r\n $.each(self.element.parents('[data-master-vm]'), function() {\r\n self.VMId = $(this).attr('data-master-vm') + '.' + self.VMId;\r\n });\r\n\r\n // Handle offline mode.\r\n if (dotnetify.offline) self._ListenToOfflineEvent();\r\n\r\n // Request the server VM.\r\n if (self.VMId != null) {\r\n if (dotnetify.hub.isConnected) self._RequestVM();\r\n else if (dotnetify.offline) self._GetOfflineVM();\r\n }\r\n else console.error(\"ERROR: dotnetify - failed to find 'data-vm' attribute in the element where .dotnetify() was applied.\");\r\n },\r\n\r\n // Widget destructor.\r\n _destroy: function() {\r\n try {\r\n var self = this;\r\n\r\n // Stop listening to offline event.\r\n if (typeof self.OfflineFn === 'function') $(document).off('offline', self.OfflineFn);\r\n\r\n // Call any plugin's $destroy function if provided.\r\n $.each(dotnetify.plugins, function(pluginId, plugin) {\r\n if (typeof plugin['$destroy'] === 'function') plugin.$destroy.apply(self.VM);\r\n });\r\n\r\n // Call view model's $destroy function if provided.\r\n if (self.VM != null && self.VM.hasOwnProperty('$destroy')) self.VM.$destroy();\r\n } catch (e) {\r\n console.error(e.stack);\r\n }\r\n\r\n dotnetify.hub.disposeVM(self.VMId);\r\n },\r\n\r\n // Convert the server VM into knockout VM.\r\n UpdateVM: function(iVMData) {\r\n var self = this;\r\n try {\r\n // If no view model yet, create one from the server data.\r\n if (self.VM == null) {\r\n self.VM = ko.mapping.fromJS(JSON.parse(iVMData));\r\n\r\n // Set essential info to the view model.\r\n self.VM.$vmId = self.VMId;\r\n self.VM.$element = self.element;\r\n self.VM.$dotnetify = dotnetify.ko;\r\n\r\n // Add an observable to carry the offline state.\r\n if (dotnetify.offline) self.VM.$vmOffline = ko.observable(self.IsOffline);\r\n\r\n // Add built-in functions to the view model.\r\n this._AddBuiltInFunctions();\r\n\r\n // Call any plugin's $init function if provided to give a chance to do\r\n // things before initial binding is applied.\r\n $.each(dotnetify.ko.plugins, function(pluginId, plugin) {\r\n if (typeof plugin['$init'] === 'function') plugin.$init.apply(self.VM);\r\n });\r\n\r\n // Call view model's init function if provided.\r\n if (typeof self.VM['$init'] === 'function') self.VM.$init();\r\n\r\n // Apply knockout view model to the HTML element.\r\n try {\r\n ko.applyBindings(self.VM, self.element[0]);\r\n } catch (e) {\r\n console.error(e.stack);\r\n }\r\n\r\n // Enable server update so that every changed value goes to server.\r\n self.VM.$serverUpdate = true;\r\n\r\n // Raise the ready event after all knockout components are ready.\r\n self._OnComponentReady(function() {\r\n // Call any plugin's $ready function if provided to give a chance to do\r\n // things when the view model is ready.\r\n $.each(dotnetify.ko.plugins, function(pluginId, plugin) {\r\n if (typeof plugin['$ready'] === 'function') plugin.$ready.apply(self.VM);\r\n });\r\n\r\n // Subscribe to change events to allow sending updates back to server.\r\n self._SubscribeObservables(self.VM);\r\n\r\n // Call view model's $ready function if provided.\r\n if (typeof self.VM['$ready'] === 'function') self.VM.$ready();\r\n\r\n // Send 'ready' event after a new view model was received.\r\n self.element.trigger('ready', { VMId: self.VMId, VM: self.VM });\r\n });\r\n\r\n // Cache the VM data in case of offline mode.\r\n if (dotnetify.offline && dotnetify.hub.isConnected && typeof dotnetify.offlineCacheFn === 'function')\r\n dotnetify.offlineCacheFn(self.VMId + self.element.attr('data-vm-arg'), iVMData);\r\n }\r\n else {\r\n // Disable server update because we're going to update the value in the knockout VM\r\n // and that will trigger change event back to server if we don't stop it now.\r\n self.VM.$serverUpdate = false;\r\n\r\n var vmUpdate = JSON.parse(iVMData);\r\n self._PreProcess(vmUpdate);\r\n\r\n try {\r\n ko.mapping.fromJS(vmUpdate, self.VM);\r\n } catch (e) {\r\n console.error(e.stack);\r\n }\r\n\r\n // Don't forget to re-enable sending changed values to server.\r\n self.VM.$serverUpdate = true;\r\n\r\n // Subscribe to change events to allow sending updates back to server,\r\n // but do it after all the knockout components are ready.\r\n self._OnComponentReady(function() {\r\n self._SubscribeObservables(self.VM);\r\n });\r\n }\r\n } catch (e) {\r\n console.error(e.stack);\r\n }\r\n\r\n if (dotnetify.debug) {\r\n console.log('[' + self.VMId + '] received> ');\r\n console.log(JSON.parse(iVMData));\r\n\r\n if (dotnetify.debugFn != null) dotnetify.debugFn(self.VMId, 'received', JSON.parse(iVMData));\r\n }\r\n },\r\n\r\n // Adds built-in functions to the view model.\r\n _AddBuiltInFunctions: function() {\r\n var self = this;\r\n\r\n // Executes the given function in a scope where server update is temporarily disabled.\r\n self.VM.$preventBinding = function(fn) {\r\n self.VM.$serverUpdate = false;\r\n fn.apply(self.VM);\r\n self.VM.$serverUpdate = true;\r\n };\r\n\r\n // Adds a new item to an observable array.\r\n self.VM.$addList = function(iList, iNewItem) {\r\n const newItem = Array.isArray(iNewItem) ? iNewItem : ko.mapping.fromJS(iNewItem);\r\n\r\n // Check if the list already has an item with the same key. If so, replace it.\r\n var key = iList()['$vmKey'];\r\n if (key != null) {\r\n var match = ko.utils.arrayFirst(iList(), function(i) {\r\n return i[key]() == newItem[key]();\r\n });\r\n if (match != null) {\r\n iList.replace(match, newItem);\r\n return;\r\n }\r\n }\r\n iList.push(newItem);\r\n };\r\n\r\n // Updates existing item to an observable array.\r\n self.VM.$updateList = function(iList, iNewItem) {\r\n var newItem = ko.mapping.fromJS(iNewItem);\r\n\r\n // Check if the list already has an item with the same key. If so, update it.\r\n var key = iList()['$vmKey'];\r\n if (key != null) {\r\n if (!newItem.hasOwnProperty(key)) {\r\n console.error(\"ERROR: object requires property '\" + key + \"'\");\r\n return;\r\n }\r\n var match = ko.utils.arrayFirst(iList(), function(i) {\r\n return i[key]() == newItem[key]();\r\n });\r\n if (match != null) {\r\n Object.keys(newItem).forEach(prop => {\r\n if (ko.isObservable(newItem[prop])) match[prop](newItem[prop]());\r\n });\r\n\r\n return;\r\n }\r\n }\r\n iList.push(newItem);\r\n };\r\n\r\n // Removes an item from an observable array.\r\n // Unlike the push operation, the ko remove operation will cause the list to trigger\r\n // change event, therefore disable server update while we do this.\r\n self.VM.$removeList = function(iList, iCriteria) {\r\n self.VM.$preventBinding(function() {\r\n iList.remove(iCriteria);\r\n });\r\n };\r\n\r\n // Listens to a view model property change event.\r\n self.VM.$on = function(iProperty, iCallback) {\r\n iProperty.subscribe(function(iNewValue) {\r\n iCallback(iNewValue);\r\n });\r\n };\r\n\r\n // Listens to a view model property change event once.\r\n self.VM.$once = function(iProperty, iCallback) {\r\n var subscription = iProperty.subscribe(function(iNewValue) {\r\n subscription.dispose();\r\n iCallback(iNewValue);\r\n });\r\n };\r\n\r\n // Loads a view into a target element.\r\n // Method parameters: TargetSelector, ViewUrl, [iJsModuleUrl], [iVmArg], iCallbackFn\r\n self.VM.$loadView = function(iTargetSelector, iViewUrl, iJsModuleUrl, iVmArg, iCallbackFn) {\r\n if (typeof iJsModuleUrl === 'object' && iJsModuleUrl != null) {\r\n iCallbackFn = iVmArg;\r\n iVmArg = iJsModuleUrl;\r\n iJsModuleUrl = null;\r\n }\r\n else if (typeof iJsModuleUrl === 'function') {\r\n iCallbackFn = iJsModuleUrl;\r\n iJsModuleUrl = null;\r\n }\r\n else if (typeof iVmArg === 'function') {\r\n iCallbackFn = iVmArg;\r\n iVmArg = null;\r\n }\r\n\r\n // If no view URL is given, empty the target DOM element.\r\n if (iViewUrl == null || iViewUrl == '') {\r\n $(iTargetSelector).empty();\r\n return;\r\n }\r\n\r\n // Loads the view template to the target DOM element.\r\n $(iTargetSelector).load(iViewUrl, null, function() {\r\n // Adds view model arguments when provided.\r\n if (iVmArg != null && !$.isEmptyObject(iVmArg)) $(this).attr('data-vm-arg', JSON.stringify(iVmArg));\r\n\r\n // Call the callback function.\r\n if (typeof iCallbackFn === 'function') iCallbackFn.apply(this);\r\n\r\n // Load the Javascript module if specified.\r\n if (iJsModuleUrl != null) {\r\n $.getScript(iJsModuleUrl, function() {\r\n dotnetify.ko.init();\r\n });\r\n }\r\n else dotnetify.ko.init();\r\n });\r\n };\r\n\r\n // Injects a context with observables mapped from an object. Context can be an object or an observable array.\r\n self.VM.$inject = function(iContext, iObject) {\r\n if (ko.isObservable(iContext) && 'push' in iContext)\r\n $.each(iContext(), function(idx, item) {\r\n self._Inject(item, iObject);\r\n });\r\n else self._Inject(iContext, iObject);\r\n };\r\n\r\n // Map the module in global namespace whose name matches the view model type.\r\n var jsModule = window[self.VMType];\r\n if (jsModule != null) {\r\n // If the module is a Typescript class, instantiate it.\r\n if (typeof jsModule === 'function') {\r\n let jsInstance = new jsModule(self.VM);\r\n Object.assign(jsInstance, jsModule.prototype);\r\n self._Inject(self.VM, jsInstance);\r\n }\r\n else self._Inject(self.VM, jsModule);\r\n }\r\n\r\n // Add plugin functions.\r\n $.each(dotnetify.ko.plugins, function(pluginId, plugin) {\r\n if (plugin.hasOwnProperty('$inject')) plugin.$inject(self.VM);\r\n });\r\n },\r\n\r\n // Gets offline view model data from the local cache.\r\n _GetOfflineVM: function() {\r\n var self = this;\r\n\r\n if (typeof dotnetify.offlineCacheFn === 'function') {\r\n // SignalR connection isn't available; use cached VM data for offline mode.\r\n var cachedData = dotnetify.offlineCacheFn(self.VMId + self.element.attr('data-vm-arg'));\r\n if (cachedData == null) cachedData = dotnetify.offlineCacheFn(self.VMId);\r\n\r\n if (cachedData != null) {\r\n if (dotnetify.debug) console.warn('[' + self.VMId + '] using offline data');\r\n\r\n self.IsOffline = true;\r\n self.UpdateVM(cachedData);\r\n }\r\n }\r\n },\r\n\r\n // Initializes offline mode handling.\r\n _ListenToOfflineEvent: function() {\r\n var self = this;\r\n\r\n self.IsOffline = false;\r\n self.OfflineFn = function(event, isOffline) {\r\n if (self.VM != null && self.VM.hasOwnProperty('$vmOffline')) self.VM.$vmOffline(isOffline);\r\n\r\n self.IsOffline = isOffline;\r\n if (!isOffline) self._RequestVM();\r\n else if (self.VM == null) self._GetOfflineVM();\r\n\r\n $(document).one('offline', self.OfflineFn.bind(self));\r\n };\r\n\r\n $(document).one('offline', self.OfflineFn.bind(self));\r\n },\r\n\r\n // Inject the context with observables mapped from an object.\r\n // Properties that start with underscore are mapped to observables.\r\n // Functions that start with underscore are mapped to pure computed observables.\r\n _Inject: function(iContext, iObject) {\r\n Object.keys(iObject).forEach(prop => {\r\n // Skip if the context already has a property with the same name.\r\n if (iContext.hasOwnProperty(prop)) return;\r\n\r\n if (typeof iObject[prop] === 'function') {\r\n if (prop.indexOf('_') == 0) {\r\n iContext[prop] = ko.pureComputed(iObject[prop], iContext);\r\n }\r\n else iContext[prop] = iObject[prop];\r\n }\r\n else if (prop.indexOf('_') == 0) {\r\n iContext[prop] = ko.observable(iObject[prop]);\r\n\r\n // Prevent it from being subscribed so it won't get sent to server.\r\n iContext[prop].$subscribe = true;\r\n }\r\n else iContext[prop] = iObject[prop];\r\n });\r\n },\r\n\r\n // Calls the callback function only if all the knockout components are ready.\r\n // This is a workaround until knockout issue #1533 is closed.\r\n _OnComponentReady: function(iCallbackFn) {\r\n var self = this;\r\n var retry = 0;\r\n var checkComponentReadyFn = function() {\r\n var isReady = true;\r\n\r\n // Assume the knockout components are those with 'params' attribute,\r\n // and that it's ready if it has at least one child element.\r\n var components = self.element.find('[params]');\r\n if (components.length > 0)\r\n isReady =\r\n $.grep(components, function(i) {\r\n return i.childElementCount == 0;\r\n }).length == 0;\r\n\r\n if (isReady || retry++ > 3) iCallbackFn();\r\n else setTimeout(checkComponentReadyFn, 250);\r\n };\r\n\r\n checkComponentReadyFn();\r\n },\r\n\r\n // On value changed from a knockout VM's observable, update the server VM.\r\n _OnValueChanged: function(iVMPath, iNewValue) {\r\n var update = {};\r\n update[iVMPath] = iNewValue instanceof Object ? $.extend({}, iNewValue) : iNewValue;\r\n\r\n if (dotnetify.hub.isConnected) {\r\n try {\r\n dotnetify.hub.updateVM(this.VMId, update);\r\n\r\n if (dotnetify.debug) {\r\n console.log('[' + this.VMId + '] sent> ');\r\n console.log(update);\r\n\r\n if (dotnetify.debugFn != null) dotnetify.debugFn(this.VMId, 'sent', update);\r\n }\r\n } catch (e) {\r\n console.error(e);\r\n }\r\n }\r\n },\r\n\r\n // Preprocess view model update from the server before we map it to knockout view model.\r\n _PreProcess: function(iVMUpdate) {\r\n Object.keys(iVMUpdate).forEach(prop => {\r\n // Look for property that end with '_add'. Interpret the value as a list item to be added\r\n // to an existing list whose property name precedes that suffix.\r\n var match = /(.*)_add/.exec(prop);\r\n if (match != null) {\r\n var list = this.VM[match[1]];\r\n if (list != null) this.VM.$addList(list, iVMUpdate[prop]);\r\n else throw new Error('unable to resolve ' + prop);\r\n delete iVMUpdate[prop];\r\n return;\r\n }\r\n\r\n // Look for property that end with '_update'. Interpret the value as a list item to be updated\r\n // to an existing list whose property name precedes that suffix.\r\n var match = /(.*)_update/.exec(prop);\r\n if (match != null) {\r\n var list = this.VM[match[1]];\r\n if (list != null) this.VM.$updateList(list, iVMUpdate[prop]);\r\n else throw new Error('unable to resolve ' + prop);\r\n delete iVMUpdate[prop];\r\n return;\r\n }\r\n\r\n // Look for property that end with '_remove'. Interpret the value as a list item key to remove\r\n // from an existing list whose property name precedes that suffix.\r\n var match = /(.*)_remove/.exec(prop);\r\n if (match != null) {\r\n var list = this.VM[match[1]];\r\n if (list != null) {\r\n var key = list()['$vmKey'];\r\n if (key != null)\r\n this.VM.$removeList(this.VM[match[1]], function(i) {\r\n return i[key]() == iVMUpdate[prop];\r\n });\r\n else throw new Error('unable to resolve ' + prop + ' due to missing vmItemKey attribute');\r\n }\r\n else throw new Error('unable to resolve ' + prop);\r\n delete iVMUpdate[prop];\r\n return;\r\n }\r\n });\r\n },\r\n\r\n // Requests view model data from the server.\r\n _RequestVM: function() {\r\n var self = this;\r\n var vmArg = self.element.attr('data-vm-arg');\r\n vmArg = vmArg != null ? $.parseJSON(vmArg.replace(/'/g, '\"')) : null;\r\n\r\n if (dotnetify.hub.isConnected) {\r\n try {\r\n dotnetify.hub.requestVM(self.VMId, vmArg);\r\n } catch (e) {\r\n console.error(e);\r\n }\r\n }\r\n },\r\n\r\n // Subscribe to value change events raised by knockout VM's observables.\r\n _SubscribeObservables: function(iParam, iVMPath) {\r\n var self = this;\r\n\r\n if (iParam == null) return;\r\n else if (ko.isObservable(iParam)) {\r\n if ('$subscribe' in iParam === false) {\r\n iParam.subscribe(function(iNewValue) {\r\n // Handle value change event from observables.\r\n if (self.VM.$serverUpdate === true) self._OnValueChanged(iVMPath, iNewValue);\r\n });\r\n iParam['$subscribe'] = true;\r\n }\r\n this._SubscribeObservables(iParam(), iVMPath);\r\n }\r\n else if (typeof iParam == 'object') {\r\n // The property with $vmKey means it's an enumerable and the $vmKey indicates the key to identify\r\n // the item in that enumerable. When we send value update to the server, we'll use the property\r\n // path in this format: .$..\r\n // For example: ListContent.$3.FirstName.\r\n var key = '$vmKey' in iParam ? iParam['$vmKey'] : null;\r\n\r\n Object.keys(iParam).forEach(property => {\r\n if (property.charAt(0) == '$' || property.charAt(0) == '_') return;\r\n if (property.charAt(0) == property.charAt(0).toLowerCase()) return;\r\n if (!isNaN(property.charAt(0))) return;\r\n const path = key != null ? '$' + iParam[property][key]() : property;\r\n this._SubscribeObservables(iParam[property], iVMPath == null ? path : iVMPath + '.' + path);\r\n });\r\n }\r\n else if (iParam instanceof Array) {\r\n Object.keys(iParam).forEach(index => {\r\n path = '$' + index;\r\n this._SubscribeObservables(iParam[index], iVMPath == null ? path : iVMPath + '.' + path);\r\n });\r\n }\r\n }\r\n});\r\n\r\n// Custom knockout binding to indicate the item key of an items collection property.\r\nko.bindingHandlers.vmItemKey = {\r\n preprocess: function(value) {\r\n // Make sure the item key is enclosed with quotes.\r\n return value.charAt(0) != \"'\" ? \"'\" + value + \"'\" : value;\r\n },\r\n update: function(element, valueAccessor, allBindings, viewModel, bindingContext) {\r\n var value = valueAccessor();\r\n var items = allBindings.get('foreach');\r\n\r\n // Test whether the foreach value is object literal where items is set to 'data' property.\r\n if (!ko.isObservable(items) && items.hasOwnProperty('data')) items = items.data;\r\n\r\n // Store the item key in a special property '$vmKey' in the element's view model.\r\n if (ko.isObservable(items) && items() != null && value != null) items()['$vmKey'] = value;\r\n }\r\n};\r\n\r\n// Custom knockout binding to bind the specified function the click event of the element.\r\nko.bindingHandlers.vmCommand = {\r\n init: function(element, valueAccessor, allBindings, viewModel, bindingContext) {\r\n var vm = bindingContext.$root;\r\n var fnName = null;\r\n var fnArg = null;\r\n\r\n // Parse the value. It supports either a function name or an object literal { funcName: argument }\r\n // where argument can be either data or obsevables.\r\n var matchFnNameArg = /return\\s{(.*):(.*)}\\s/.exec(valueAccessor.toString());\r\n if (matchFnNameArg != null) {\r\n fnName = matchFnNameArg[1].trim();\r\n fnArg = matchFnNameArg[2].trim();\r\n }\r\n else {\r\n var matchFnName = /return\\s(.*)\\s/.exec(valueAccessor.toString());\r\n if (matchFnName != null) fnName = matchFnName[1].trim();\r\n }\r\n\r\n if (fnName == null) throw new Error('invalid vmCommand value at ' + element.outerHTML);\r\n\r\n // Support whether function is defined globally or inside a namespace that matches view model Id.\r\n var getFn = function() {\r\n return vm[fnName] != null ? vm[fnName] : valueAccessor();\r\n };\r\n\r\n // Trim the argument from enclosing quotes. If it's an observable name, replace it with the value.\r\n if (fnArg != null) {\r\n if (fnArg.charAt(0) == \"'\") fnArg = fnArg.replace(/(^'|'$)/g, '');\r\n else if (ko.isObservable(viewModel[fnArg])) fnArg = ko.unwrap(viewModel[fnArg]);\r\n else if (fnArg == '$data') fnArg = viewModel;\r\n }\r\n else fnArg = true;\r\n\r\n var newValueAccessor = function() {\r\n return function() {\r\n var fn = getFn();\r\n\r\n // If function is an observable, which means it's a server view model property, then set its value to\r\n // trigger the invocation of its setter property on the server side. If it's not an observable, then it must\r\n // be a client-side function, in which case just invoke it and pass all possible objects it may need.\r\n if (ko.isObservable(fn)) {\r\n // Reset the value locally first to ensure that setting the value will raise change events.\r\n vm.$preventBinding(function() {\r\n fn(fnArg === true ? false : null);\r\n });\r\n\r\n fn(fnArg);\r\n }\r\n else fn.apply(vm, [ viewModel, element, bindingContext.$parent ]);\r\n };\r\n };\r\n ko.bindingHandlers.click.init(element, newValueAccessor, allBindings, viewModel, bindingContext);\r\n }\r\n};\r\n\r\n// Custom knockout binding to call a function on initial property change event.\r\nko.bindingHandlers.vmOnce = {\r\n init: function(element, valueAccessor, allBindings, viewModel, bindingContext) {\r\n ko.bindingHandlers.vmOn.init(element, valueAccessor, allBindings, viewModel, bindingContext, true);\r\n }\r\n};\r\n\r\n// Custom knockout binding to call a function on a property change event.\r\nko.bindingHandlers.vmOn = {\r\n init: function(element, valueAccessor, allBindings, viewModel, bindingContext, once) {\r\n var vm = bindingContext.$root;\r\n var property = null;\r\n var fnName = null;\r\n var value = valueAccessor.toString();\r\n\r\n // Parse the value, which should be in object literal { property: fnName }.\r\n var match = /return\\s{(.*):(.*)}\\s/.exec(value);\r\n if (match != null) {\r\n property = match[1].trim();\r\n fnName = match[2].trim();\r\n }\r\n\r\n if (fnName == null) throw new Error('invalid vmOn function at ' + element.outerHTML);\r\n\r\n // Support whether function is defined globally or inside a namespace that matches view model Id.\r\n var getFn = function() {\r\n return vm[fnName] != null ? vm[fnName] : valueAccessor()[property];\r\n };\r\n\r\n // Make sure the property is an observable.\r\n if (property != null && !ko.isObservable(viewModel[property])) throw new Error('invalid vmOn data: ' + valueAccessor());\r\n\r\n // Call the function with the initial data.\r\n getFn().apply(vm, [ viewModel, element, bindingContext.$parent ]);\r\n\r\n // Call the function on every data update.\r\n if (once == null)\r\n viewModel[property].subscribe(function(iNewValue) {\r\n getFn().apply(vm, [ viewModel, element, bindingContext.$parent ]);\r\n });\r\n }\r\n};\r\n\r\nexport default dotnetify;\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport utils from '../libs/utils';\r\n\r\nexport default class dotnetifyVMRouter {\r\n routes = [];\r\n\r\n get RoutingState() {\r\n throw new Error('Not implemented');\r\n }\r\n get VMRoot() {\r\n throw new Error('Not implemented');\r\n }\r\n get VMArg() {\r\n throw new Error('Not implemented');\r\n }\r\n\r\n constructor(vm, router) {\r\n this.vm = vm;\r\n this.router = router;\r\n this.debug = vm.$dotnetify.controller.debug;\r\n }\r\n\r\n // Dispatch the active routing state to the server.\r\n dispatchActiveRoutingState(iPath) {\r\n this.vm.$dispatch({ 'RoutingState.Active': iPath });\r\n let { RoutingState } = this.vm.State();\r\n RoutingState = Object.assign(RoutingState || {}, { Active: iPath });\r\n this.vm.State({ RoutingState });\r\n }\r\n\r\n // Handles click event from anchor tags. Argument can be event object or path string.\r\n handleRoute(iArg) {\r\n let path = null;\r\n if (typeof iArg === 'object') {\r\n iArg.preventDefault();\r\n path = iArg.currentTarget.pathname;\r\n }\r\n else if (typeof iArg === 'string') path = iArg;\r\n\r\n if (path == null || path == '') throw new Error('$handleRoute requires path argument or event with pathname.');\r\n setTimeout(() => this.router.pushState({}, '', path));\r\n }\r\n\r\n // Build the absolute root path from the \"vmRoot\" property on React component.\r\n initRoot() {\r\n if (!this.hasRoutingState || this.RoutingState === null || this.RoutingState.Root === null) return;\r\n\r\n if (this._absRoot != this.RoutingState.Root) {\r\n var absRoot = utils.trim(this.VMRoot);\r\n if (absRoot != '') absRoot = '/' + absRoot;\r\n var root = utils.trim(this.RoutingState.Root);\r\n this._absRoot = root != '' ? absRoot + '/' + root : absRoot;\r\n this.RoutingState.Root = this._absRoot;\r\n }\r\n }\r\n\r\n // Initialize routing templates if the view model implements IRoutable.\r\n initRouting() {\r\n const vm = this.vm;\r\n if (!this.hasRoutingState) return;\r\n\r\n if (this.RoutingState === null) {\r\n console.error(\"router> the RoutingState prop of '\" + vm.$vmId + \"' was not initialized.\");\r\n return;\r\n }\r\n\r\n var templates = this.RoutingState.Templates;\r\n if (templates == null || templates.length == 0) return;\r\n\r\n // Initialize the router.\r\n if (!this.router.$init) {\r\n this.router.init();\r\n this.router.$init = true;\r\n }\r\n\r\n // Build the absolute root path.\r\n this.initRoot();\r\n\r\n templates.forEach(template => {\r\n // If url pattern isn't given, consider Id as the pattern.\r\n var urlPattern = template.UrlPattern != null ? template.UrlPattern : template.Id;\r\n urlPattern = urlPattern != '' ? urlPattern : '/';\r\n var mapUrl = this.toUrl(urlPattern);\r\n\r\n if (this.debug) console.log('router> map ' + mapUrl + ' to template id=' + template.Id);\r\n\r\n this.router.mapTo(mapUrl, iParams => {\r\n this.router.urlPath = '';\r\n\r\n // Construct the path from the template pattern and the params passed by PathJS.\r\n var path = urlPattern;\r\n for (var param in iParams) path = path.replace(':' + param, iParams[param]);\r\n path = path.replace(/\\(\\/:([^)]+)\\)/g, '').replace(/\\(|\\)/g, '');\r\n\r\n this.routeTo(path, template);\r\n });\r\n });\r\n\r\n // Route initial URL.\r\n var activeUrl = this.toUrl(this.RoutingState.Active);\r\n if (this.router.urlPath == '') this.router.urlPath = activeUrl;\r\n if (!this.routeUrl())\r\n // If routing ends incomplete, raise routed event anyway.\r\n this.raiseRoutedEvent(true);\r\n }\r\n\r\n // Whether a route is active.\r\n isActive(iRoute) {\r\n if (iRoute != null && iRoute.hasOwnProperty('Path')) {\r\n return utils.equal(iRoute.Path, this.RoutingState.Active);\r\n }\r\n return false;\r\n }\r\n\r\n // Loads an HTML view.\r\n loadHtmlView(iTargetSelector, iViewUrl, iJsModuleUrl, iCallbackFn) {\r\n const vm = this.vm;\r\n this.unmountView(iTargetSelector);\r\n\r\n // Load the HTML view.\r\n $(iTargetSelector).load(iViewUrl, null, function() {\r\n if (iJsModuleUrl != null) {\r\n const getScripts = iJsModuleUrl.split(',').map(i => $.getScript(i));\r\n $.when.apply($, getScripts).done(() => typeof callbackFn === 'function' && iCallbackFn.call(vm));\r\n }\r\n else if (typeof callbackFn === 'function') iCallbackFn.call(vm);\r\n });\r\n }\r\n\r\n loadHtmlElementView(iTargetSelector, iHtmlElement, iJsModuleUrl, iVmArg, iCallbackFn) {\r\n const vm = this.vm;\r\n const mountViewFunc = () => {\r\n this.unmountView(iTargetSelector);\r\n\r\n const target = document.querySelector(iTargetSelector);\r\n while (target.firstChild) target.removeChild(target.firstChild);\r\n target.appendChild(iHtmlElement);\r\n\r\n if (typeof callbackFn === 'function') iCallbackFn.call(vm);\r\n };\r\n\r\n if (iJsModuleUrl == null) mountViewFunc();\r\n else {\r\n // Load all javascripts first. Multiple files can be specified with comma delimiter.\r\n const getScripts = iJsModuleUrl.split(',').map(i => $.getScript(i));\r\n $.when.apply($, getScripts).done(mountViewFunc);\r\n }\r\n }\r\n\r\n // Loads a view into a target element.\r\n loadView(iTargetSelector, iViewUrl, iJsModuleUrl, iVmArg, iCallbackFn) {\r\n throw new Error('Not implemented');\r\n }\r\n\r\n // Routes to a path.\r\n manualRouteTo(iPath, iTarget, iViewUrl, iJSModuleUrl) {\r\n const vm = this.vm;\r\n var template = { Id: 'manual', Target: iTarget, ViewUrl: iViewUrl, JSModuleUrl: iJSModuleUrl };\r\n this.routeTo(iPath, template, true);\r\n }\r\n\r\n // Handles route enter event.\r\n onRouteEnter(iPath, iTemplate) {\r\n return true;\r\n }\r\n\r\n // Raise event indicating the routing process has ended.\r\n raiseRoutedEvent(force) {\r\n const vm = this.vm;\r\n if (this.router.urlPath == '' || force == true) {\r\n if (this.debug) console.log('router> routed');\r\n utils.dispatchEvent('dotnetify.routed');\r\n }\r\n }\r\n\r\n // Returns the URL for an anchor tag.\r\n route(iRoute, iTarget) {\r\n // No route to process. Return silently.\r\n if (iRoute == null) return;\r\n\r\n if (!iRoute.hasOwnProperty('Path') && !iRoute.hasOwnProperty('TemplateId')) throw new Error('Not a valid route');\r\n\r\n // Build the absolute root path.\r\n this.initRoot();\r\n\r\n // If the route path is not defined, use the URL pattern from the associated template.\r\n // This is so that we don't send the same data twice if both are equal.\r\n let path = iRoute.Path;\r\n let template = null;\r\n if (this.hasRoutingState && this.RoutingState.Templates != null && iRoute.TemplateId != null) {\r\n let match = this.RoutingState.Templates.filter(function(iTemplate) {\r\n return iTemplate.Id == iRoute.TemplateId;\r\n });\r\n if (match.length > 0) {\r\n template = match[0];\r\n\r\n if (typeof iTarget === 'string') template.Target = iTarget;\r\n\r\n if (path == null) {\r\n path = template.UrlPattern != null ? template.UrlPattern : template.Id;\r\n iRoute.Path = path;\r\n }\r\n }\r\n else if (iRoute.RedirectRoot == null) throw new Error(`vmRoute cannot find route template ${iRoute.TemplateId}`);\r\n }\r\n\r\n // If the path has a redirect root, the path doesn't belong to the current root and needs to be\r\n // redirected to a different one. Set the absolute path to the HREF attribute, and prevent the\r\n // default behavior of the anchor click event and instead do push to HTML5 history state, which\r\n // would attempt to resolve the path first before resorting to hard browser redirect.\r\n if (iRoute.RedirectRoot != null) {\r\n // Combine the redirect root with the view model's root.\r\n let redirectRoot = iRoute.RedirectRoot;\r\n if (redirectRoot.charAt(0) == '/') redirectRoot = redirectRoot.substr(0, redirectRoot.length - 1);\r\n let redirectRootPath = iRoute.RedirectRoot.split('/');\r\n\r\n let urlRedirect = '';\r\n let absRoot = this.VMRoot;\r\n if (absRoot != null) {\r\n let absRootPath = absRoot.split('/');\r\n for (let i = 0; i < absRootPath.length; i++) {\r\n if (absRootPath[i] != '' && absRootPath[i] == redirectRootPath[0]) break;\r\n urlRedirect += absRootPath[i] + '/';\r\n }\r\n }\r\n\r\n urlRedirect += redirectRoot + '/' + path;\r\n urlRedirect = urlRedirect.replace(/\\/\\/+/g, '/');\r\n if (!this.routes.some(x => x.Path === path)) this.routes.push({ Path: path, Url: urlRedirect });\r\n return urlRedirect;\r\n }\r\n\r\n // For quick lookup, save the mapping between the path to the route inside the view model.\r\n if (template == null) throw new Error('vmRoute cannot find any route template');\r\n\r\n iRoute.$template = template;\r\n this.pathToRoute = this.pathToRoute || {};\r\n this.pathToRoute[path] = iRoute;\r\n\r\n // Set the absolute path to the HREF attribute, and prevent the default behavior of\r\n // the anchor click event and instead do push to HTML5 history state.\r\n let url = this.toUrl(path);\r\n url = url.length > 0 ? url : '/';\r\n if (!this.routes.some(x => x.Path === path)) this.routes.push({ Path: path, Url: url });\r\n return url;\r\n }\r\n\r\n // Routes to a path.\r\n routeTo(iPath, iTemplate, iDisableEvent, iCallbackFn, isRedirect) {\r\n const vm = this.vm;\r\n const viewModels = vm.$dotnetify.getViewModels();\r\n\r\n if (this.debug) console.log(\"router> route '\" + iPath + \"' to template id=\" + iTemplate.Id);\r\n\r\n // We can determine whether the view has already been loaded by matching the 'RoutingState.Origin' argument\r\n // on the existing view model inside that target selector with the path.\r\n for (let i = 0; i < viewModels.length; i++) {\r\n var vmOther = viewModels[i];\r\n var vmArg = vmOther.$router.VMArg;\r\n if (vmArg != null) {\r\n if (typeof vmArg['RoutingState.Origin'] === 'string' && utils.equal(vmArg['RoutingState.Origin'], iPath)) return;\r\n }\r\n }\r\n\r\n // Support enter interception.\r\n if (iDisableEvent != true && vm.hasOwnProperty('onRouteEnter')) {\r\n if (this.onRouteEnter(iPath, iTemplate) == false || vm.onRouteEnter(iPath, iTemplate) == false) return;\r\n }\r\n\r\n // Check if the route has valid target.\r\n if (iTemplate.Target == null) {\r\n console.error(\"router> the Target for template '\" + iTemplate.Id + \"' was not set. Use vm.onRouteEnter() to set the target.\");\r\n return;\r\n }\r\n\r\n // If target DOM element isn't found, redirect URL to the path.\r\n if (document.getElementById(iTemplate.Target) == null) {\r\n if (isRedirect === true) {\r\n if (this.debug) console.log(\"router> target '\" + iTemplate.Target + \"' not found in DOM\");\r\n return;\r\n }\r\n else {\r\n if (this.debug) console.log(\"router> target '\" + iTemplate.Target + \"' not found in DOM, use redirect instead\");\r\n return this.router.redirect(this.toUrl(iPath), [ ...viewModels, ...vm.$dotnetify.controller.getViewModels() ]);\r\n }\r\n }\r\n\r\n // Load the view associated with the route asynchronously.\r\n this.loadView('#' + iTemplate.Target, iTemplate.ViewUrl, iTemplate.JSModuleUrl, { 'RoutingState.Origin': iPath }, () => {\r\n // If load is successful, update the active route.\r\n this.dispatchActiveRoutingState(iPath);\r\n\r\n // Support exit interception.\r\n if (iDisableEvent != true && vm.hasOwnProperty('onRouteExit')) vm.onRouteExit(iPath, iTemplate);\r\n\r\n if (typeof iCallbackFn === 'function') iCallbackFn.call(vm);\r\n });\r\n }\r\n\r\n routeToRoute(iRoute) {\r\n var path = this.vm.$route(iRoute);\r\n if (path == null || path == '') throw new Error('The route passed to $routeTo is invalid.');\r\n\r\n setTimeout(() => this.router.pushState({}, '', path));\r\n }\r\n\r\n // Routes the URL if the view model implements IRoutable.\r\n // Returns true if the view model handles the routing.\r\n routeUrl(redirectUrlPath) {\r\n if (!this.hasRoutingState) return false;\r\n\r\n const isRedirect = !!redirectUrlPath;\r\n let root = this.RoutingState.Root;\r\n if (root == null) return false;\r\n\r\n // Get the URL path to route.\r\n let urlPath = isRedirect ? redirectUrlPath : this.router.urlPath;\r\n\r\n if (this.debug) console.log('router> routing ' + urlPath);\r\n\r\n // If the URL path matches the root path of this view, use the template with a blank URL pattern if provided.\r\n if (utils.equal(urlPath, root) || utils.equal(urlPath, root + '/') || urlPath === '/') {\r\n let match = utils.grep(this.RoutingState.Templates, function(iTemplate) {\r\n return iTemplate.UrlPattern === '';\r\n });\r\n if (match.length > 0) {\r\n this.routeTo('', match[0], null, null, isRedirect);\r\n this.router.urlPath = '';\r\n this.raiseRoutedEvent();\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n // If the URL path starts with the root path of this view, look at the next path and try to match it with the\r\n // anchor tags in this view that are bound with the vmRoute binding type. If there is match, route to that path.\r\n root = root + '/';\r\n if (utils.startsWith(urlPath, root)) {\r\n let routeElem = null;\r\n let match = utils.grep(this.routes, function(elem) {\r\n return utils.startsWith(urlPath + '/', elem.Url + '/');\r\n });\r\n if (match.length > 0) {\r\n // If more than one match, find the best match.\r\n for (let i = 0; i < match.length; i++) if (routeElem == null || routeElem.Url.length < match[i].Url.length) routeElem = match[i];\r\n }\r\n\r\n if (routeElem != null) {\r\n let path = routeElem.Path;\r\n let template =\r\n this.hasOwnProperty('pathToRoute') && this.pathToRoute.hasOwnProperty(path) ? this.pathToRoute[path].$template : null;\r\n if (template != null) {\r\n // If the URL path is completely routed, clear it.\r\n if (utils.equal(this.router.urlPath, this.toUrl(path))) this.router.urlPath = '';\r\n\r\n // If route's not already active, route to it.\r\n if (!utils.equal(this.RoutingState.Active, path)) {\r\n this.routeTo(path, template, false, () => this.raiseRoutedEvent(), isRedirect);\r\n }\r\n else this.raiseRoutedEvent();\r\n return true;\r\n }\r\n }\r\n else if (this.router.match(urlPath)) {\r\n // If no vmRoute binding matches, try to match with any template's URL pattern.\r\n this.router.urlPath = '';\r\n this.raiseRoutedEvent();\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n // Builds an absolute URL from a path.\r\n toUrl(iPath) {\r\n let path = utils.trim(iPath);\r\n if (path.charAt(0) != '(' && path != '') path = '/' + path;\r\n return this.hasRoutingState ? this.RoutingState.Root + path : iPath;\r\n }\r\n\r\n // Unmount a view if there's one on the target selector.\r\n unmountView(iTargetSelector) {\r\n throw new Error('Not implemented');\r\n }\r\n}\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport dotnetifyVMRouter from '../core/dotnetify-vm-router';\r\nimport $ from 'jquery';\r\nimport utils from '../libs/utils';\r\n\r\nclass templateWrapper {\r\n constructor(template) {\r\n this.template = template;\r\n }\r\n get Id() {\r\n return this.template.Id();\r\n }\r\n get Root() {\r\n return this.template.Root();\r\n }\r\n get UrlPattern() {\r\n return this.template.UrlPattern();\r\n }\r\n get ViewUrl() {\r\n return this.template.ViewUrl();\r\n }\r\n set ViewUrl(value) {\r\n this.template.ViewUrl(value);\r\n }\r\n get JSModuleUrl() {\r\n return this.template.JSModuleUrl();\r\n }\r\n set JSModuleUrl(value) {\r\n this.template.JSModuleUrl(value);\r\n }\r\n get Target() {\r\n return this.template.Target();\r\n }\r\n set Target(value) {\r\n this.template.Target(value);\r\n }\r\n}\r\n\r\nclass routingStateWrapper {\r\n constructor(routingState) {\r\n this.routingState = routingState;\r\n }\r\n get Root() {\r\n return this.routingState.Root();\r\n }\r\n set Root(value) {\r\n this.routingState.Root(value);\r\n }\r\n get Templates() {\r\n const templates = typeof this.routingState.Templates == 'function' ? this.routingState.Templates() : null;\r\n return templates ? templates.map(template => new templateWrapper(template)) : null;\r\n }\r\n get Active() {\r\n return this.routingState.Active();\r\n }\r\n set Active(value) {\r\n this.routingState.Active(value);\r\n }\r\n get Origin() {\r\n return this.routingState.Origin();\r\n }\r\n set Origin(value) {\r\n this.routingState.Origin(value);\r\n }\r\n}\r\n\r\nexport default class dotnetifyKoVMRouter extends dotnetifyVMRouter {\r\n get hasRoutingState() {\r\n return this.vm.hasOwnProperty('RoutingState');\r\n }\r\n get RoutingState() {\r\n return new routingStateWrapper(this.vm.RoutingState);\r\n }\r\n get VMRoot() {\r\n return this.vm.$element.attr('data-vm-root');\r\n }\r\n get VMArg() {\r\n return this.vm.$element.attr('data-vm-arg');\r\n }\r\n\r\n constructor(iVM, iDotNetifyRouter) {\r\n super(iVM, iDotNetifyRouter);\r\n }\r\n\r\n // Dispatch the active routing state to the server.\r\n dispatchActiveRoutingState(iPath) {\r\n this.RoutingState.Active = iPath;\r\n }\r\n onRouteEnter(iPath, iTemplate) {\r\n if (!iTemplate.ViewUrl) iTemplate.ViewUrl = iTemplate.Id + '.html';\r\n return true;\r\n }\r\n\r\n // Loads a view into a target element.\r\n // Method parameters: TargetSelector, ViewUrl, iJsModuleUrl, iVmArg, iCallbackFn\r\n loadView(iTargetSelector, iViewUrl, iJsModuleUrl, iVmArg, iCallbackFn) {\r\n const vm = this.vm;\r\n\r\n // If no view URL is given, empty the target DOM element.\r\n if (iViewUrl == null || iViewUrl == '') {\r\n $(iTargetSelector).empty();\r\n return;\r\n }\r\n\r\n const callbackFn = () => {\r\n // If the view model supports routing, add the root path to the view, to be used\r\n // to build the absolute route path, and view model argument if provided.\r\n if (this.hasRoutingState && this.RoutingState.Root) {\r\n const vmElems = $(iTargetSelector).find('[data-vm]').toArray();\r\n vmElems.forEach(element => {\r\n var root = $(element).attr('data-vm-root');\r\n root = root != null ? '/' + utils.trim(vm.RoutingState.Root()) + '/' + utils.trim(root) : vm.RoutingState.Root();\r\n $(element).attr('data-vm-root', root);\r\n\r\n if (iVmArg != null && !$.isEmptyObject(iVmArg)) {\r\n // If there's already a data-vm-arg, combine the values.\r\n // Take care not to override server-side routing arguments.\r\n var vmArg = $(element).attr('data-vm-arg');\r\n vmArg = vmArg != null ? $.extend(iVmArg, $.parseJSON(vmArg.replace(/'/g, '\"'))) : iVmArg;\r\n\r\n $(element).attr('data-vm-arg', JSON.stringify(vmArg));\r\n }\r\n });\r\n }\r\n\r\n // Call the callback function.\r\n if (typeof iCallbackFn === 'function') iCallbackFn.apply(this);\r\n };\r\n\r\n // Provide the opportunity to override the URL.\r\n iViewUrl = this.router.overrideUrl(iViewUrl);\r\n\r\n vm.$loadView(iTargetSelector, iViewUrl, iJsModuleUrl, iVmArg, callbackFn);\r\n }\r\n\r\n // Routes to a path.\r\n manualRouteTo(iPath, iTarget, iViewUrl, iJSModuleUrl) {\r\n const template = {\r\n Target: () => iTarget,\r\n ViewUrl: () => iViewUrl,\r\n JSModuleUrl: () => iJSModuleUrl\r\n };\r\n this.$router.routeTo(iPath, template, true);\r\n }\r\n}\r\n","/*\r\nPathJS - Copyright (c) 2011 Mike Trpcic, released under the MIT license.\r\n */\r\nconst window = window || global || {};\r\n\r\nvar Path = {\r\n // Need this specific version, because latest version is causing issue.\r\n version: '0.8.5',\r\n map: function(path) {\r\n if (Path.routes.defined.hasOwnProperty(path)) {\r\n return Path.routes.defined[path];\r\n }\r\n else {\r\n return new Path.core.route(path);\r\n }\r\n },\r\n root: function(path) {\r\n Path.routes.root = path;\r\n },\r\n rescue: function(fn) {\r\n Path.routes.rescue = fn;\r\n },\r\n history: {\r\n initial: {}, // Empty container for \"Initial Popstate\" checking variables.\r\n pushState: function(state, title, path) {\r\n if (Path.history.supported) {\r\n if (Path.dispatch(path)) {\r\n history.pushState(state, title, path);\r\n }\r\n }\r\n else {\r\n if (Path.history.fallback) {\r\n window.location.hash = '#' + path;\r\n }\r\n }\r\n },\r\n popState: function(event) {\r\n var initialPop = !Path.history.initial.popped && location.href == Path.history.initial.URL;\r\n Path.history.initial.popped = true;\r\n if (initialPop) return;\r\n Path.dispatch(document.location.pathname === '/' ? '' : document.location.pathname);\r\n },\r\n listen: function(fallback) {\r\n Path.history.supported = !!(window.history && window.history.pushState);\r\n Path.history.fallback = fallback;\r\n\r\n if (Path.history.supported) {\r\n (Path.history.initial.popped = 'state' in window.history), (Path.history.initial.URL = location.href);\r\n window.onpopstate = Path.history.popState;\r\n }\r\n else {\r\n if (Path.history.fallback) {\r\n for (route in Path.routes.defined) {\r\n if (route.charAt(0) != '#') {\r\n Path.routes.defined['#' + route] = Path.routes.defined[route];\r\n Path.routes.defined['#' + route].path = '#' + route;\r\n }\r\n }\r\n Path.listen();\r\n }\r\n }\r\n }\r\n },\r\n match: function(path, parameterize) {\r\n var params = {},\r\n route = null,\r\n possible_routes,\r\n slice,\r\n i,\r\n j,\r\n compare,\r\n result;\r\n for (route in Path.routes.defined) {\r\n if (route !== null && route !== undefined) {\r\n route = Path.routes.defined[route];\r\n possible_routes = route.partition();\r\n for (j = 0; j < possible_routes.length; j++) {\r\n slice = possible_routes[j];\r\n compare = path;\r\n if (slice.search(/:/) > 0) {\r\n for (i = 0; i < slice.split('/').length; i++) {\r\n if (i < compare.split('/').length && slice.split('/')[i].charAt(0) === ':') {\r\n params[slice.split('/')[i].replace(/:/, '')] = compare.split('/')[i];\r\n result = compare.split('/');\r\n result[i] = slice.split('/')[i];\r\n compare = result.join('/');\r\n }\r\n }\r\n }\r\n if (slice === compare) {\r\n if (parameterize) {\r\n route.params = params;\r\n }\r\n return route;\r\n }\r\n }\r\n }\r\n }\r\n return null;\r\n },\r\n dispatch: function(passed_route) {\r\n var previous_route, matched_route;\r\n if (Path.routes.current !== passed_route) {\r\n Path.routes.previous = Path.routes.current;\r\n Path.routes.current = passed_route;\r\n matched_route = Path.match(passed_route, true);\r\n\r\n if (Path.routes.previous) {\r\n previous_route = Path.match(Path.routes.previous);\r\n if (previous_route !== null && previous_route.do_exit !== null) {\r\n previous_route.do_exit();\r\n }\r\n }\r\n\r\n if (matched_route !== null) {\r\n matched_route.run();\r\n return true;\r\n }\r\n else {\r\n if (Path.routes.rescue !== null) {\r\n Path.routes.rescue();\r\n }\r\n }\r\n }\r\n },\r\n listen: function() {\r\n var fn = function() {\r\n Path.dispatch(location.hash);\r\n };\r\n\r\n if (location.hash === '') {\r\n if (Path.routes.root !== null) {\r\n location.hash = Path.routes.root;\r\n }\r\n }\r\n\r\n // The 'document.documentMode' checks below ensure that PathJS fires the right events\r\n // even in IE \"Quirks Mode\".\r\n if ('onhashchange' in window && (!document.documentMode || document.documentMode >= 8)) {\r\n window.onhashchange = fn;\r\n }\r\n else {\r\n setInterval(fn, 50);\r\n }\r\n\r\n if (location.hash !== '') {\r\n Path.dispatch(location.hash);\r\n }\r\n },\r\n core: {\r\n route: function(path) {\r\n this.path = path;\r\n this.action = null;\r\n this.do_enter = [];\r\n this.do_exit = null;\r\n this.params = {};\r\n Path.routes.defined[path] = this;\r\n }\r\n },\r\n routes: {\r\n current: null,\r\n root: null,\r\n rescue: null,\r\n previous: null,\r\n defined: {}\r\n }\r\n};\r\n\r\nPath.core.route.prototype = {\r\n to: function(fn) {\r\n this.action = fn;\r\n return this;\r\n },\r\n enter: function(fns) {\r\n if (fns instanceof Array) {\r\n this.do_enter = this.do_enter.concat(fns);\r\n }\r\n else {\r\n this.do_enter.push(fns);\r\n }\r\n return this;\r\n },\r\n exit: function(fn) {\r\n this.do_exit = fn;\r\n return this;\r\n },\r\n partition: function() {\r\n var parts = [],\r\n options = [],\r\n re = /\\(([^}]+?)\\)/g,\r\n text,\r\n i;\r\n while ((text = re.exec(this.path))) {\r\n parts.push(text[1]);\r\n }\r\n options.push(this.path.split('(')[0]);\r\n for (i = 0; i < parts.length; i++) {\r\n options.push(options[options.length - 1] + parts[i]);\r\n }\r\n return options;\r\n },\r\n run: function() {\r\n var halt_execution = false,\r\n i,\r\n result,\r\n previous;\r\n\r\n if (Path.routes.defined[this.path].hasOwnProperty('do_enter')) {\r\n if (Path.routes.defined[this.path].do_enter.length > 0) {\r\n for (i = 0; i < Path.routes.defined[this.path].do_enter.length; i++) {\r\n result = Path.routes.defined[this.path].do_enter[i].apply(this, null);\r\n if (result === false) {\r\n halt_execution = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n if (!halt_execution) {\r\n Path.routes.defined[this.path].action();\r\n }\r\n }\r\n};\r\n\r\nexport default Path;\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport Path from '../libs/path';\r\n\r\nconst window = window || global || {};\r\n\r\nexport default class dotnetifyRouter {\r\n version = '2.0.1';\r\n\r\n // URL path that will be parsed when performing routing.\r\n urlPath = document.location.pathname;\r\n\r\n constructor(debug) {\r\n this.debug = debug;\r\n }\r\n\r\n // Initialize routing using PathJS.\r\n init() {\r\n if (typeof Path !== 'undefined') {\r\n Path.history.listen(true);\r\n Path.routes.rescue = function() {\r\n //window.location.replace(document.location.pathname);\r\n };\r\n }\r\n else throw new Error('Pathjs library is required for routing.');\r\n }\r\n\r\n // Map a route to an action.\r\n mapTo(iPath, iFn) {\r\n iPath = iPath.length > 0 ? iPath : '/';\r\n if (typeof Path !== 'undefined')\r\n Path.map(iPath).to(function() {\r\n iFn(this.params);\r\n });\r\n }\r\n\r\n // Match a URL path to a route and run the action.\r\n match(iUrlPath) {\r\n if (typeof Path !== 'undefined') {\r\n var matched = Path.match(iUrlPath, true);\r\n if (matched != null) {\r\n matched.run();\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n // Optional callback to override a URL before performing routing.\r\n overrideUrl(iUrl) {\r\n return iUrl;\r\n }\r\n\r\n // Push state to HTML history.\r\n pushState(iState, iTitle, iPath) {\r\n this.urlPath = '';\r\n if (typeof Path !== 'undefined') Path.history.pushState(iState, iTitle, iPath);\r\n }\r\n\r\n // Redirect to the a URL.\r\n redirect(iUrl, viewModels) {\r\n // Check first whether existing views can handle routing this URL.\r\n // Otherwise, do a hard browser redirect.\r\n this.urlPath = iUrl;\r\n for (let i = 0; i < viewModels.length; i++) {\r\n const vm = viewModels[i];\r\n if (vm.$router.routeUrl(iUrl)) {\r\n if (this.debug) console.log('router> redirected');\r\n return;\r\n }\r\n }\r\n window.location.replace(iUrl);\r\n }\r\n\r\n // Called by dotNetify when a view model is ready.\r\n $ready() {\r\n this.$router.initRouting();\r\n }\r\n\r\n // Called by dotNetify when a view model receives update.\r\n $update(vmData) {\r\n if (vmData && vmData.RoutingState) this.$router.initRouting();\r\n }\r\n}\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport dotnetify from './dotnetify-ko';\r\nimport dotnetifyRouter from '../core/dotnetify-router';\r\nimport dotnetifyKoVMRouter from './dotnetify-ko.vm-router';\r\nimport $ from 'jquery';\r\nimport * as ko from 'knockout';\r\n\r\n// Add plugin functions.\r\ndotnetify.ko.router = new dotnetifyRouter(dotnetify.debug);\r\n\r\n// Inject a view model with functions.\r\ndotnetify.ko.router.$inject = function(iVM) {\r\n const router = new dotnetifyKoVMRouter(iVM, dotnetify.ko.router);\r\n\r\n // Put functions inside $router namespace.\r\n iVM.$router = router;\r\n};\r\n\r\n// Custom knockout binding to do routing.\r\nko.bindingHandlers.vmRoute = {\r\n update: function(element, valueAccessor, allBindings, viewModel, bindingContext) {\r\n var vm = bindingContext.$root;\r\n var route = ko.unwrap(valueAccessor());\r\n\r\n if (!route.hasOwnProperty('Path') || !route.hasOwnProperty('TemplateId'))\r\n throw new Error('invalid vmRoute data at ' + element.outerHTML);\r\n\r\n // Build the absolute root path.\r\n vm.$router.initRoot();\r\n\r\n // If the route path is not defined, use the URL pattern from the associated template.\r\n // This is so that we don't send the same data twice if both are equal.\r\n let path = route.Path();\r\n var template = null;\r\n if (vm.hasOwnProperty('RoutingState') && typeof vm.RoutingState.Templates === 'function' && vm.RoutingState.Templates() != null) {\r\n var match = $.grep(vm.RoutingState.Templates(), function(iTemplate) {\r\n return iTemplate.Id() == route.TemplateId();\r\n });\r\n if (match.length > 0) {\r\n template = match[0];\r\n if (path == null) {\r\n path = template.UrlPattern();\r\n route.Path(path);\r\n }\r\n }\r\n else if (route.RedirectRoot() == null)\r\n throw new Error(\"vmRoute cannot find route template '\" + route.TemplateId() + \"' at \" + element.outerHTML);\r\n }\r\n\r\n // If the path has a redirect root, the path doesn't belong to the current root and needs to be\r\n // redirected to a different one. Set the absolute path to the HREF attribute, and prevent the\r\n // default behavior of the anchor click event and instead do push to HTML5 history state, which\r\n // would attempt to resolve the path first before resorting to hard browser redirect.\r\n if (route.RedirectRoot() != null) {\r\n // Combine the redirect root with the view model's root.\r\n var redirectRoot = route.RedirectRoot();\r\n if (redirectRoot.charAt(0) == '/') redirectRoot = redirectRoot.substr(0, redirectRoot.length - 1);\r\n var redirectRootPath = route.RedirectRoot().split('/');\r\n\r\n var url = '';\r\n var absRoot = vm.$element.attr('data-vm-root');\r\n if (absRoot != null) {\r\n var absRootPath = absRoot.split('/');\r\n for (i = 0; i < absRootPath.length; i++) {\r\n if (absRootPath[i] != '' && absRootPath[i] == redirectRootPath[0]) break;\r\n url += absRootPath[i] + '/';\r\n }\r\n }\r\n url += redirectRoot + '/' + path;\r\n\r\n $(element).attr('href', url).attr('data-vm-route', path).click(function(iEvent) {\r\n iEvent.preventDefault();\r\n dotnetify.ko.router.pushState({}, '', $(this).attr('href'));\r\n });\r\n return;\r\n }\r\n\r\n // For quick lookup, save the mapping between the path to the route inside the view model.\r\n if (template == null) throw new Error('vmRoute cannot find any route template at ' + element.outerHTML);\r\n\r\n route.$template = template;\r\n vm.$router.pathToRoute = vm.$router.pathToRoute || {};\r\n vm.$router.pathToRoute[path] = route;\r\n\r\n // Set the absolute path to the HREF attribute, and prevent the default behavior of\r\n // the anchor click event and instead do push to HTML5 history state.\r\n $(element).attr('href', vm.$router.toUrl(path)).attr('data-vm-route', path).click(function(iEvent) {\r\n iEvent.preventDefault();\r\n dotnetify.ko.router.pushState({}, '', $(this).attr('href'));\r\n });\r\n }\r\n};\r\n\r\n// Register the plugin to dotNetify.\r\ndotnetify.ko.plugins['router'] = dotnetify.ko.router;\r\n","/// Knockout Mapping plugin v2.4.0\r\n/// (c) 2013 Steven Sanderson, Roy Jacobs - http://knockoutjs.com/\r\n/// License: MIT (http://www.opensource.org/licenses/mit-license.php)\r\n(function(d){\"function\"===typeof require&&\"object\"===typeof exports&&\"object\"===typeof module?d(require(\"knockout\"),exports):\"function\"===typeof define&&define.amd?define([\"knockout\",\"exports\"],d):d(ko,ko.mapping={})})(function(d,f){function y(b,c){var a,e;for(e in c)if(c.hasOwnProperty(e)&&c[e])if(a=f.getType(b[e]),e&&b[e]&&\"array\"!==a&&\"string\"!==a)y(b[e],c[e]);else if(\"array\"===f.getType(b[e])&&\"array\"===f.getType(c[e])){a=b;for(var d=e,l=b[e],n=c[e],t={},g=l.length-1;0<=g;--g)t[l[g]]=l[g];for(g=\r\nn.length-1;0<=g;--g)t[n[g]]=n[g];l=[];n=void 0;for(n in t)l.push(t[n]);a[d]=l}else b[e]=c[e]}function E(b,c){var a={};y(a,b);y(a,c);return a}function z(b,c){for(var a=E({},b),d=L.length-1;0<=d;d--){var f=L[d];a[f]&&(a[\"\"]instanceof Object||(a[\"\"]={}),a[\"\"][f]=a[f],delete a[f])}c&&(a.ignore=h(c.ignore,a.ignore),a.include=h(c.include,a.include),a.copy=h(c.copy,a.copy),a.observe=h(c.observe,a.observe));a.ignore=h(a.ignore,j.ignore);a.include=h(a.include,j.include);a.copy=h(a.copy,j.copy);a.observe=h(a.observe,\r\nj.observe);a.mappedProperties=a.mappedProperties||{};a.copiedProperties=a.copiedProperties||{};return a}function h(b,c){\"array\"!==f.getType(b)&&(b=\"undefined\"===f.getType(b)?[]:[b]);\"array\"!==f.getType(c)&&(c=\"undefined\"===f.getType(c)?[]:[c]);return d.utils.arrayGetDistinctValues(b.concat(c))}function F(b,c,a,e,k,l,n){var t=\"array\"===f.getType(d.utils.unwrapObservable(c));l=l||\"\";if(f.isMapped(b)){var g=d.utils.unwrapObservable(b)[p];a=E(g,a)}var j=n||k,h=function(){return a[e]&&a[e].create instanceof\r\nFunction},x=function(b){var f=G,g=d.dependentObservable;d.dependentObservable=function(a,b,c){c=c||{};a&&\"object\"==typeof a&&(c=a);var e=c.deferEvaluation,M=!1;c.deferEvaluation=!0;a=new H(a,b,c);if(!e){var g=a,e=d.dependentObservable;d.dependentObservable=H;a=d.isWriteableObservable(g);d.dependentObservable=e;a=H({read:function(){M||(d.utils.arrayRemoveItem(f,g),M=!0);return g.apply(g,arguments)},write:a&&function(a){return g(a)},deferEvaluation:!0});f.push(a)}return a};d.dependentObservable.fn=\r\nH.fn;d.computed=d.dependentObservable;b=d.utils.unwrapObservable(k)instanceof Array?a[e].create({data:b||c,parent:j,skip:N}):a[e].create({data:b||c,parent:j});d.dependentObservable=g;d.computed=d.dependentObservable;return b},u=function(){return a[e]&&a[e].update instanceof Function},v=function(b,f){var g={data:f||c,parent:j,target:d.utils.unwrapObservable(b)};d.isWriteableObservable(b)&&(g.observable=b);return a[e].update(g)};if(n=I.get(c))return n;e=e||\"\";if(t){var t=[],s=!1,m=function(a){return a};\r\na[e]&&a[e].key&&(m=a[e].key,s=!0);d.isObservable(b)||(b=d.observableArray([]),b.mappedRemove=function(a){var c=\"function\"==typeof a?a:function(b){return b===m(a)};return b.remove(function(a){return c(m(a))})},b.mappedRemoveAll=function(a){var c=C(a,m);return b.remove(function(a){return-1!=d.utils.arrayIndexOf(c,m(a))})},b.mappedDestroy=function(a){var c=\"function\"==typeof a?a:function(b){return b===m(a)};return b.destroy(function(a){return c(m(a))})},b.mappedDestroyAll=function(a){var c=C(a,m);return b.destroy(function(a){return-1!=\r\nd.utils.arrayIndexOf(c,m(a))})},b.mappedIndexOf=function(a){var c=C(b(),m);a=m(a);return d.utils.arrayIndexOf(c,a)},b.mappedCreate=function(a){if(-1!==b.mappedIndexOf(a))throw Error(\"There already is an object with the key that you specified.\");var c=h()?x(a):a;u()&&(a=v(c,a),d.isWriteableObservable(c)?c(a):c=a);b.push(c);return c});n=C(d.utils.unwrapObservable(b),m).sort();g=C(c,m);s&&g.sort();s=d.utils.compareArrays(n,g);n={};var J,A=d.utils.unwrapObservable(c),y={},z=!0,g=0;for(J=A.length;go;o++)for(s in a[o])n=a[o][s],a[o].hasOwnProperty(s)&&void 0!==n&&(t[s]=e.isPlainObject(n)?e.isPlainObject(t[s])?e.widget.extend({},t[s],n):e.widget.extend({},n):n);return t},e.widget.bridge=function(t,s){var n=s.prototype.widgetFullName||t;e.fn[t]=function(a){var o=\"string\"==typeof a,r=i.call(arguments,1),h=this;return o?this.each(function(){var i,s=e.data(this,n);return\"instance\"===a?(h=s,!1):s?e.isFunction(s[a])&&\"_\"!==a.charAt(0)?(i=s[a].apply(s,r),i!==s&&void 0!==i?(h=i&&i.jquery?h.pushStack(i.get()):i,!1):void 0):e.error(\"no such method '\"+a+\"' for \"+t+\" widget instance\"):e.error(\"cannot call methods on \"+t+\" prior to initialization; \"+\"attempted to call method '\"+a+\"'\")}):(r.length&&(a=e.widget.extend.apply(null,[a].concat(r))),this.each(function(){var t=e.data(this,n);t?(t.option(a||{}),t._init&&t._init()):e.data(this,n,new s(a,this))})),h}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:\"widget\",widgetEventPrefix:\"\",defaultElement:\"
\",options:{disabled:!1,create:null},_createWidget:function(i,s){s=e(s||this.defaultElement||this)[0],this.element=e(s),this.uuid=t++,this.eventNamespace=\".\"+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),s!==this&&(e.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===s&&this.destroy()}}),this.document=e(s.style?s.ownerDocument:s.document||s),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),i),this._create(),this._trigger(\"create\",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr(\"aria-disabled\").removeClass(this.widgetFullName+\"-disabled \"+\"ui-state-disabled\"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass(\"ui-state-hover\"),this.focusable.removeClass(\"ui-state-focus\")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if(\"string\"==typeof t)if(o={},s=t.split(\".\"),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,\"disabled\"===e&&(this.widget().toggleClass(this.widgetFullName+\"-disabled\",!!t),t&&(this.hoverable.removeClass(\"ui-state-hover\"),this.focusable.removeClass(\"ui-state-focus\"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;\"boolean\"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass(\"ui-state-disabled\")?(\"string\"==typeof o?a[o]:o).apply(a,arguments):void 0}\"string\"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\\w:-]*)\\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(t,i){i=(i||\"\").split(\" \").join(this.eventNamespace+\" \")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return(\"string\"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass(\"ui-state-hover\")},mouseleave:function(t){e(t.currentTarget).removeClass(\"ui-state-hover\")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass(\"ui-state-focus\")},focusout:function(t){e(t.currentTarget).removeClass(\"ui-state-focus\")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:\"fadeIn\",hide:\"fadeOut\"},function(t,i){e.Widget.prototype[\"_\"+t]=function(s,n,a){\"string\"==typeof n&&(n={effect:n});var o,r=n?n===!0||\"number\"==typeof n?i:n.effect||i:t;n=n||{},\"number\"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget});","/* \r\nCopyright 2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport { createEventEmitter, fetch } from '../libs/utils';\r\n\r\nexport class dotNetifyHubWebApi {\r\n mode = 'webapi';\r\n debug = false;\r\n isConnected = false;\r\n isHubStarted = false;\r\n\r\n responseEvent = createEventEmitter();\r\n reconnectedEvent = createEventEmitter();\r\n connectedEvent = createEventEmitter();\r\n connectionFailedEvent = createEventEmitter();\r\n\r\n _vmArgs = {};\r\n\r\n constructor(iBaseUrl, iOnRequest) {\r\n this.baseUrl = iBaseUrl || '';\r\n this.onRequest = iOnRequest;\r\n }\r\n\r\n static create(iBaseUrl, iOnRequest) {\r\n return new dotNetifyHubWebApi(iBaseUrl, iOnRequest);\r\n }\r\n\r\n startHub() {\r\n this.isConnected = true;\r\n this.isHubStarted = true;\r\n this.connectedEvent.emit();\r\n }\r\n\r\n requestVM(iVMId, iVMArgs) {\r\n const vmArgs = iVMArgs || {};\r\n const vmArgQuery = vmArgs.$vmArg ? '?vmarg=' + JSON.stringify(vmArgs.$vmArg) : '';\r\n const headers = vmArgs.$headers || {};\r\n\r\n this._vmArgs[iVMId] = vmArgs;\r\n const url = this.baseUrl + `/api/dotnetify/vm/${iVMId}${vmArgQuery}`;\r\n\r\n fetch('GET', url, null, request => {\r\n Object.keys(headers).forEach(key => request.setRequestHeader(key, headers[key]));\r\n if (typeof this.onRequest == 'function') this.onRequest(url, request);\r\n })\r\n .then(response => {\r\n this.responseEvent.emit(iVMId, response);\r\n })\r\n .catch(request => console.error(`[${iVMId}] Request failed`, request));\r\n }\r\n\r\n updateVM(iVMId, iValue) {\r\n const vmArgs = this._vmArgs[iVMId] || {};\r\n const vmArgQuery = vmArgs.$vmArg ? '?vmarg=' + JSON.stringify(vmArgs.$vmArg) : '';\r\n const headers = vmArgs.$headers || {};\r\n const payload = typeof iValue == 'object' ? JSON.stringify(iValue) : iValue;\r\n\r\n const url = this.baseUrl + `/api/dotnetify/vm/${iVMId}${vmArgQuery}`;\r\n\r\n fetch('POST', url, payload, request => {\r\n request.setRequestHeader('Content-Type', 'application/json');\r\n Object.keys(headers).forEach(key => request.setRequestHeader(key, headers[key]));\r\n if (typeof this.onRequest == 'function') this.onRequest(url, request, payload);\r\n })\r\n .then(response => {\r\n this.responseEvent.emit(iVMId, response);\r\n })\r\n .catch(request => console.error(`[${iVMId}] Update failed`, request));\r\n }\r\n\r\n disposeVM(iVMId) {\r\n delete this._vmArgs[iVMId];\r\n }\r\n}\r\n\r\nconst createWebApiHub = dotNetifyHubWebApi.create;\r\n\r\nexport { createWebApiHub };\r\nexport default dotNetifyHubWebApi.create();\r\n","/* \r\nCopyright 2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport { createEventEmitter } from '../libs/utils';\r\n\r\nconst window = window || global || {};\r\n\r\nconst normalize = iVMId => iVMId && iVMId.replace(/\\./g, '_');\r\nconst hasLocalVM = iVMId => {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n return typeof vm == 'object' && typeof vm.onConnect == 'function';\r\n};\r\n\r\nexport class dotNetifyHubLocal {\r\n mode = 'local';\r\n debug = false;\r\n isConnected = false;\r\n isHubStarted = false;\r\n\r\n responseEvent = createEventEmitter();\r\n reconnectedEvent = createEventEmitter();\r\n connectedEvent = createEventEmitter();\r\n connectionFailedEvent = createEventEmitter();\r\n\r\n startHub() {\r\n this.isConnected = true;\r\n this.isHubStarted = true;\r\n this.connectedEvent.emit();\r\n }\r\n\r\n requestVM(iVMId, iVMArgs) {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n\r\n if (typeof vm === 'object' && typeof vm.onConnect == 'function') {\r\n if (this.debug) console.log(`[${iVMId}] *** local mode ***`);\r\n\r\n vm.$pushUpdate = update => {\r\n if (typeof update == 'object') update = JSON.stringify(update);\r\n setTimeout(() => this.responseEvent.emit(iVMId, update));\r\n };\r\n\r\n vm.$pushUpdate(vm.onConnect(iVMArgs) || {});\r\n }\r\n }\r\n\r\n updateVM(iVMId, iValue) {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n\r\n if (typeof vm === 'object' && typeof vm.onDispatch == 'function') {\r\n let state = vm.onDispatch(iValue);\r\n if (state) {\r\n if (typeof state == 'object') state = JSON.stringify(state);\r\n setTimeout(() => this.responseEvent.emit(iVMId, state));\r\n }\r\n }\r\n }\r\n\r\n disposeVM(iVMId) {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n\r\n if (typeof vm === 'object' && typeof vm.onDestroy == 'function') {\r\n vm.onDestroy(iVMId);\r\n }\r\n }\r\n}\r\n\r\nexport default new dotNetifyHubLocal();\r\nexport { hasLocalVM };\r\n","module.exports = __WEBPACK_EXTERNAL_MODULE__15__;","/**\n* jQuery core object.\n*\n* Worker with jQuery deferred\n*\n* Code from: https://github.com/jquery/jquery/blob/master/src/core.js\n*\n*/\n\nvar jQuery = module.exports = {\n\ttype: type\n\t, isArray: isArray\n\t, isFunction: isFunction\n\t, isPlainObject: isPlainObject\n\t, each: each\n\t, extend: extend\n\t, noop: function() {}\n};\n\nvar toString = Object.prototype.toString;\n\nvar class2type = {};\n// Populate the class2type map\n\"Boolean Number String Function Array Date RegExp Object\".split(\" \").forEach(function(name) {\n\tclass2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n});\n\n\nfunction type( obj ) {\n\treturn obj == null ?\n\t\tString( obj ) :\n\t\t\tclass2type[ toString.call(obj) ] || \"object\";\n}\n\nfunction isFunction( obj ) {\n\treturn jQuery.type(obj) === \"function\";\n}\n\nfunction isArray( obj ) {\n\treturn jQuery.type(obj) === \"array\";\n}\n\nfunction each( object, callback, args ) {\n\tvar name, i = 0,\n\tlength = object.length,\n\tisObj = length === undefined || isFunction( object );\n\n\tif ( args ) {\n\t\tif ( isObj ) {\n\t\t\tfor ( name in object ) {\n\t\t\t\tif ( callback.apply( object[ name ], args ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( ; i < length; ) {\n\t\t\t\tif ( callback.apply( object[ i++ ], args ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// A special, fast, case for the most common use of each\n\t} else {\n\t\tif ( isObj ) {\n\t\t\tfor ( name in object ) {\n\t\t\t\tif ( callback.call( object[ name ], name, object[ name ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( ; i < length; ) {\n\t\t\t\tif ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn object;\n}\n\nfunction isPlainObject( obj ) {\n\t// Must be an Object.\n\tif ( !obj || jQuery.type(obj) !== \"object\" ) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\nfunction extend() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\ttarget = arguments[0] || {},\n\ti = 1,\n\tlength = arguments.length,\n\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif ( typeof target === \"boolean\" ) {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\n\t// Handle case when target is a string or something (possible in deep copy)\n\tif ( typeof target !== \"object\" && !jQuery.isFunction(target) ) {\n\t\ttarget = {};\n\t}\n\n\t// extend jQuery itself if only one argument is passed\n\tif ( length === i ) {\n\t\ttarget = this;\n\t\t--i;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\t\t// Only deal with non-null/undefined values\n\t\tif ( (options = arguments[ i ]) != null ) {\n\t\t\t// Extend the base object\n\t\t\tfor ( name in options ) {\n\t\t\t\tsrc = target[ name ];\n\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif ( target === copy ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {\n\t\t\t\t\tif ( copyIsArray ) {\n\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\tclone = src && jQuery.isArray(src) ? src : [];\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclone = src && jQuery.isPlainObject(src) ? src : {};\n\t\t\t\t\t}\n\n\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\n\n","var jQuery = module.exports = require(\"./jquery-core.js\"),\n\tcore_rspace = /\\s+/;\n/**\n* jQuery Callbacks\n*\n* Code from: https://github.com/jquery/jquery/blob/master/src/callbacks.js\n*\n*/\n\n\n// String to Object options format cache\nvar optionsCache = {};\n\n// Convert String-formatted options into Object-formatted ones and store in cache\nfunction createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.split( core_rspace ), function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n\t// Convert options from String-formatted to Object-formatted if needed\n\t// (we check in cache first)\n\toptions = typeof options === \"string\" ?\n\t\t( optionsCache[ options ] || createOptions( options ) ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Last fire value (for non-forgettable lists)\n\t\tmemory,\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\t\t// Flag to know if list is currently firing\n\t\tfiring,\n\t\t// First callback to fire (used internally by add and fireWith)\n\t\tfiringStart,\n\t\t// End of the loop when firing\n\t\tfiringLength,\n\t\t// Index of currently firing callback (modified by remove if needed)\n\t\tfiringIndex,\n\t\t// Actual callback list\n\t\tlist = [],\n\t\t// Stack of fire calls for repeatable lists\n\t\tstack = !options.once && [],\n\t\t// Fire callbacks\n\t\tfire = function( data ) {\n\t\t\tmemory = options.memory && data;\n\t\t\tfired = true;\n\t\t\tfiringIndex = firingStart || 0;\n\t\t\tfiringStart = 0;\n\t\t\tfiringLength = list.length;\n\t\t\tfiring = true;\n\t\t\tfor ( ; list && firingIndex < firingLength; firingIndex++ ) {\n\t\t\t\tif ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {\n\t\t\t\t\tmemory = false; // To prevent further calls using add\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfiring = false;\n\t\t\tif ( list ) {\n\t\t\t\tif ( stack ) {\n\t\t\t\t\tif ( stack.length ) {\n\t\t\t\t\t\tfire( stack.shift() );\n\t\t\t\t\t}\n\t\t\t\t} else if ( memory ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t} else {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t// Actual Callbacks object\n\t\tself = {\n\t\t\t// Add a callback or a collection of callbacks to the list\n\t\t\tadd: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\t// First, we save the current length\n\t\t\t\t\tvar start = list.length;\n\t\t\t\t\t(function add( args ) {\n\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {\n\t\t\t\t\t\t\tvar type = jQuery.type( arg );\n\t\t\t\t\t\t\tif ( type === \"function\" ) {\n\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {\n\t\t\t\t\t\t\t\t\tlist.push( arg );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if ( arg && arg.length && type !== \"string\" ) {\n\t\t\t\t\t\t\t\t// Inspect recursively\n\t\t\t\t\t\t\t\tadd( arg );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t})( arguments );\n\t\t\t\t\t// Do we need to add the callbacks to the\n\t\t\t\t\t// current firing batch?\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tfiringLength = list.length;\n\t\t\t\t\t// With memory, if we're not firing then\n\t\t\t\t\t// we should call right away\n\t\t\t\t\t} else if ( memory ) {\n\t\t\t\t\t\tfiringStart = start;\n\t\t\t\t\t\tfire( memory );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\t\tvar index;\n\t\t\t\t\t\twhile( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\t\tlist.splice( index, 1 );\n\t\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\t\t\tif ( index <= firingLength ) {\n\t\t\t\t\t\t\t\t\tfiringLength--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\t\t\tfiringIndex--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Control if a given callback is in the list\n\t\t\thas: function( fn ) {\n\t\t\t\treturn jQuery.inArray( fn, list ) > -1;\n\t\t\t},\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tlist = [];\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Have the list do nothing anymore\n\t\t\tdisable: function() {\n\t\t\t\tlist = stack = memory = undefined;\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it disabled?\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\t\t\t// Lock the list in its current state\n\t\t\tlock: function() {\n\t\t\t\tstack = undefined;\n\t\t\t\tif ( !memory ) {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it locked?\n\t\t\tlocked: function() {\n\t\t\t\treturn !stack;\n\t\t\t},\n\t\t\t// Call all callbacks with the given context and arguments\n\t\t\tfireWith: function( context, args ) {\n\t\t\t\targs = args || [];\n\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\tif ( list && ( !fired || stack ) ) {\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tstack.push( args );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfire( args );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Call all the callbacks with the given arguments\n\t\t\tfire: function() {\n\t\t\t\tself.fireWith( this, arguments );\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// To know if the callbacks have already been called at least once\n\t\t\tfired: function() {\n\t\t\t\treturn !!fired;\n\t\t\t}\n\t\t};\n\n\treturn self;\n};\n\n","\n/*!\n* jquery-deferred\n* Copyright(c) 2011 Hidden \n* MIT Licensed\n*/\n\n/**\n* Library version.\n*/\n\nvar jQuery = module.exports = require(\"./jquery-callbacks.js\"),\n\tcore_slice = Array.prototype.slice;\n\n/**\n* jQuery deferred\n*\n* Code from: https://github.com/jquery/jquery/blob/master/src/deferred.js\n* Doc: http://api.jquery.com/category/deferred-object/\n*\n*/\n\njQuery.extend({\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\t\t\t\t// action, add listener, listener list, final state\n\t\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks(\"once memory\"), \"resolved\" ],\n\t\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks(\"once memory\"), \"rejected\" ],\n\t\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks(\"memory\") ]\n\t\t\t],\n\t\t\tstate = \"pending\",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\tthen: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\t\t\t\t\treturn jQuery.Deferred(function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\t\t\t\t\tvar action = tuple[ 0 ],\n\t\t\t\t\t\t\t\tfn = fns[ i ];\n\t\t\t\t\t\t\t// deferred[ done | fail | progress ] for forwarding actions to newDefer\n\t\t\t\t\t\t\tdeferred[ tuple[1] ]( jQuery.isFunction( fn ) ?\n\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\tvar returned = fn.apply( this, arguments );\n\t\t\t\t\t\t\t\t\tif ( returned && jQuery.isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject )\n\t\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tnewDefer[ action + \"With\" ]( this === deferred ? newDefer : this, [ returned ] );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} :\n\t\t\t\t\t\t\t\tnewDefer[ action ]\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tfns = null;\n\t\t\t\t\t}).promise();\n\t\t\t\t},\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Keep pipe for back-compat\n\t\tpromise.pipe = promise.then;\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 3 ];\n\n\t\t\t// promise[ done | fail | progress ] = list.add\n\t\t\tpromise[ tuple[1] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(function() {\n\t\t\t\t\t// state = [ resolved | rejected ]\n\t\t\t\t\tstate = stateString;\n\n\t\t\t\t// [ reject_list | resolve_list ].disable; progress_list.lock\n\t\t\t\t}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );\n\t\t\t}\n\n\t\t\t// deferred[ resolve | reject | notify ] = list.fire\n\t\t\tdeferred[ tuple[0] ] = list.fire;\n\t\t\tdeferred[ tuple[0] + \"With\" ] = list.fireWith;\n\t\t});\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( subordinate /* , ..., subordinateN */ ) {\n\t\tvar i = 0,\n\t\t\tresolveValues = core_slice.call( arguments ),\n\t\t\tlength = resolveValues.length,\n\n\t\t\t// the count of uncompleted subordinates\n\t\t\tremaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,\n\n\t\t\t// the master Deferred. If resolveValues consist of only a single Deferred, just use that.\n\t\t\tdeferred = remaining === 1 ? subordinate : jQuery.Deferred(),\n\n\t\t\t// Update function for both resolve and progress values\n\t\t\tupdateFunc = function( i, contexts, values ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tcontexts[ i ] = this;\n\t\t\t\t\tvalues[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;\n\t\t\t\t\tif( values === progressValues ) {\n\t\t\t\t\t\tdeferred.notifyWith( contexts, values );\n\t\t\t\t\t} else if ( !( --remaining ) ) {\n\t\t\t\t\t\tdeferred.resolveWith( contexts, values );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t},\n\n\t\t\tprogressValues, progressContexts, resolveContexts;\n\n\t\t// add listeners to Deferred subordinates; treat others as resolved\n\t\tif ( length > 1 ) {\n\t\t\tprogressValues = new Array( length );\n\t\t\tprogressContexts = new Array( length );\n\t\t\tresolveContexts = new Array( length );\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {\n\t\t\t\t\tresolveValues[ i ].promise()\n\t\t\t\t\t\t.done( updateFunc( i, resolveContexts, resolveValues ) )\n\t\t\t\t\t\t.fail( deferred.reject )\n\t\t\t\t\t\t.progress( updateFunc( i, progressContexts, progressValues ) );\n\t\t\t\t} else {\n\t\t\t\t\t--remaining;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// if we're not waiting on anything, resolve the master\n\t\tif ( !remaining ) {\n\t\t\tdeferred.resolveWith( resolveContexts, resolveValues );\n\t\t}\n\n\t\treturn deferred.promise();\n\t}\n});\n","\nmodule.exports = require('./lib/jquery-deferred');","/* \r\nCopyright 2017 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\n\r\nconst window = window || global || {};\r\n\r\nconst jQueryDeferred = require('jquery-deferred');\r\nconst jQueryShim = jQueryDeferred.extend(\r\n function(selector) {\r\n if (selector === window || selector.document)\r\n return {\r\n 0: selector,\r\n on: function(iEvent, iHandler) {\r\n window.addEventListener(iEvent, iHandler);\r\n },\r\n bind: function(iEvent, iHandler) {\r\n window.addEventListener(iEvent, iHandler, false);\r\n },\r\n unbind: function(iEvent, iHandler) {\r\n window.removeEventListener(iEvent, iHandler, false);\r\n }\r\n };\r\n\r\n if (typeof selector !== 'string') selector.events = selector.events || {};\r\n\r\n return {\r\n 0: selector,\r\n\r\n bind: function(iEvent, iHandler) {\r\n var event = selector.events[iEvent] || [];\r\n event.push(iHandler);\r\n selector.events[iEvent] = event;\r\n },\r\n\r\n unbind: function(iEvent, iHandler) {\r\n var handlers = selector.events[iEvent] || [];\r\n if (iHandler) {\r\n var idx = handlers.indexOf(iHandler);\r\n if (idx !== -1) handlers.splice(idx, 1);\r\n }\r\n else handlers = [];\r\n selector.events[iEvent] = handlers;\r\n },\r\n\r\n triggerHandler: function(iEvent, iArgs) {\r\n var handlers = selector.events[iEvent] || [];\r\n var args = [ { type: iEvent } ];\r\n if (Array.isArray(iArgs))\r\n iArgs.forEach(function(arg) {\r\n args.push(arg);\r\n });\r\n else if (iArgs) args.push(iArgs);\r\n handlers.forEach(function(handler) {\r\n handler.apply(this, args);\r\n });\r\n },\r\n\r\n load: function(iUrl, iArgs, iHandler) {\r\n var request = new window.XMLHttpRequest();\r\n request.open('GET', iUrl, true);\r\n request.onload = function() {\r\n if (request.status >= 200 && request.status < 400) {\r\n var response = request.responseText;\r\n document.querySelector(selector).innerHTML = response;\r\n iHandler.call(document.querySelector(selector));\r\n }\r\n };\r\n request.send();\r\n return {\r\n abort: function(reason) {\r\n return request.abort(reason);\r\n }\r\n };\r\n }\r\n };\r\n },\r\n jQueryDeferred,\r\n {\r\n support: { cors: true },\r\n\r\n trim: function(iStr) {\r\n return typeof iStr === 'string' ? iStr.trim() : iStr;\r\n },\r\n\r\n inArray: function(iArray, iItem) {\r\n return iArray.indexOf(iItem) !== -1;\r\n },\r\n\r\n makeArray: function makeArray(iArray) {\r\n return [].slice.call(iArray, 0);\r\n },\r\n\r\n merge: function(iArray1, iArray2) {\r\n Array.prototype.push.apply(iArray1, iArray2);\r\n return iArray1;\r\n },\r\n\r\n isEmptyObject: function(iObj) {\r\n return !iObj || Object.keys(iObj).length === 0;\r\n },\r\n\r\n ajax: function(iOptions) {\r\n var request = new window.XMLHttpRequest();\r\n request.onreadystatechange = function() {\r\n if (request.readyState !== 4) return;\r\n if (request.status === 200 && !request._hasError) {\r\n try {\r\n iOptions.success && iOptions.success(JSON.parse(request.responseText));\r\n } catch (error) {\r\n iOptions.success && iOptions.success(request.responseText);\r\n }\r\n }\r\n else iOptions.error && iOptions.error(request);\r\n };\r\n request.open(iOptions.type, iOptions.url);\r\n request.setRequestHeader('content-type', iOptions.contentType);\r\n request.send(iOptions.data.data && 'data=' + iOptions.data.data);\r\n return {\r\n abort: function(reason) {\r\n return request.abort(reason);\r\n }\r\n };\r\n },\r\n\r\n getScript: function(iUrl, iSuccess) {\r\n var done = false;\r\n var promise = jQueryDeferred.Deferred();\r\n var head = document.getElementsByTagName('head')[0];\r\n var script = document.createElement('script');\r\n script.src = iUrl;\r\n script.onload = script.onreadystatechange = function() {\r\n if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) {\r\n done = true;\r\n script.onload = script.onreadystatechange = null;\r\n head.removeChild(script);\r\n if (typeof iSuccess === 'function') iSuccess();\r\n promise.resolve();\r\n }\r\n };\r\n head.appendChild(script);\r\n return promise;\r\n }\r\n }\r\n);\r\n\r\nif (typeof window !== 'undefined') window.jQuery = window.jQuery || jQueryShim;\r\n\r\nif (typeof exports === 'object' && typeof module === 'object') module.exports = jQueryShim;\r\n","/* \r\nCopyright 2017-2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport { createEventEmitter } from '../libs/utils';\r\nimport jQueryShim from '../libs/jquery-shim';\r\nconst signalRNetCore = require('@aspnet/signalr');\r\nlet $ = jQueryShim;\r\n\r\nconst window = window || global || {};\r\n\r\nexport class dotnetifyHubFactory {\r\n static create() {\r\n let dotnetifyHub = {\r\n version: '2.0.0',\r\n type: null,\r\n\r\n reconnectDelay: [ 2, 5, 10 ],\r\n reconnectRetry: null,\r\n\r\n _startInfo: null,\r\n _init: false,\r\n\r\n // Hub server methods.\r\n requestVM: (iVMId, iOptions) => dotnetifyHub.server.request_VM(iVMId, iOptions),\r\n updateVM: (iVMId, iValue) => dotnetifyHub.server.update_VM(iVMId, iValue),\r\n disposeVM: iVMId => dotnetifyHub.server.dispose_VM(iVMId),\r\n\r\n // Connection events.\r\n responseEvent: createEventEmitter(),\r\n reconnectedEvent: createEventEmitter(),\r\n connectedEvent: createEventEmitter(),\r\n connectionFailedEvent: createEventEmitter(),\r\n\r\n get isHubStarted() {\r\n return !!this._startInfo;\r\n },\r\n\r\n // Starts connection with SignalR hub server.\r\n startHub(hubOptions, doneHandler, failHandler, forceRestart) {\r\n const _doneHandler = () => {\r\n if (typeof doneHandler == 'function') doneHandler();\r\n this.connectedEvent.emit();\r\n };\r\n const _failHandler = ex => {\r\n if (typeof failHander == 'function') failHandler();\r\n this.connectionFailedEvent.emit();\r\n throw ex;\r\n };\r\n\r\n if (this._startInfo === null || forceRestart) {\r\n try {\r\n this._startInfo = this.start(hubOptions).done(_doneHandler).fail(_failHandler);\r\n } catch (err) {\r\n this._startInfo = null;\r\n }\r\n }\r\n else {\r\n try {\r\n this._startInfo.done(_doneHandler);\r\n } catch (err) {\r\n this._startInfo = null;\r\n return this.startHub(hubOptions, doneHandler, failHandler, forceRestart);\r\n }\r\n }\r\n }\r\n };\r\n\r\n // Configures connection to SignalR hub server.\r\n dotnetifyHub.init = function(iHubPath, iServerUrl, signalR) {\r\n if (dotnetifyHub._init) return;\r\n\r\n dotnetifyHub._init = true;\r\n signalR = signalR || window.signalR || signalRNetCore;\r\n\r\n // SignalR .NET Core.\r\n if (signalR && signalR.HubConnection) {\r\n dotnetifyHub.type = 'netcore';\r\n\r\n Object.defineProperty(dotnetifyHub, 'isConnected', {\r\n get: function() {\r\n return dotnetifyHub._connection && dotnetifyHub._connection.connection.connectionState === 1;\r\n }\r\n });\r\n\r\n dotnetifyHub = $.extend(dotnetifyHub, {\r\n hubPath: iHubPath || '/dotnetify',\r\n url: iServerUrl,\r\n\r\n // Internal variables. Do not modify!\r\n _connection: null,\r\n _reconnectCount: 0,\r\n _startDoneHandler: null,\r\n _startFailHandler: null,\r\n _disconnectedHandler: function() {},\r\n _stateChangedHandler: function(iNewState) {},\r\n\r\n _onDisconnected: function() {\r\n dotnetifyHub._changeState(4);\r\n dotnetifyHub._disconnectedHandler();\r\n },\r\n\r\n _changeState: function(iNewState) {\r\n if (iNewState == 1) dotnetifyHub._reconnectCount = 0;\r\n\r\n let stateText = { 0: 'connecting', 1: 'connected', 2: 'reconnecting', 4: 'disconnected', 99: 'terminated' };\r\n dotnetifyHub._stateChangedHandler(stateText[iNewState]);\r\n },\r\n\r\n _startConnection: function(iHubOptions, iTransportArray) {\r\n let url = dotnetifyHub.url ? dotnetifyHub.url + dotnetifyHub.hubPath : dotnetifyHub.hubPath;\r\n let hubOptions = {};\r\n Object.keys(iHubOptions).forEach(function(key) {\r\n hubOptions[key] = iHubOptions[key];\r\n });\r\n hubOptions.transport = iTransportArray.shift();\r\n\r\n dotnetifyHub._connection = new signalR.HubConnectionBuilder().withUrl(url, hubOptions).build();\r\n dotnetifyHub._connection.on('response_vm', dotnetifyHub.client.response_VM);\r\n dotnetifyHub._connection.onclose(dotnetifyHub._onDisconnected);\r\n\r\n let promise = dotnetifyHub._connection\r\n .start()\r\n .then(function() {\r\n dotnetifyHub._changeState(1);\r\n })\r\n .catch(function() {\r\n // If failed to start, fallback to the next transport.\r\n if (iTransportArray.length > 0) dotnetifyHub._startConnection(iHubOptions, iTransportArray);\r\n else dotnetifyHub._onDisconnected();\r\n });\r\n\r\n if (typeof dotnetifyHub._startDoneHandler === 'function')\r\n promise.then(dotnetifyHub._startDoneHandler).catch(dotnetifyHub._startFailHandler || function() {});\r\n return promise;\r\n },\r\n\r\n start: function(iHubOptions) {\r\n dotnetifyHub._startDoneHandler = null;\r\n dotnetifyHub._startFailHandler = null;\r\n\r\n // Map the transport option.\r\n let transport = [ 0 ];\r\n let transportOptions = { webSockets: 0, serverSentEvents: 1, longPolling: 2 };\r\n if (iHubOptions && Array.isArray(iHubOptions.transport))\r\n transport = iHubOptions.transport.map(function(arg) {\r\n return transportOptions[arg];\r\n });\r\n\r\n let promise = dotnetifyHub._startConnection(iHubOptions, transport);\r\n return {\r\n done: function(iHandler) {\r\n dotnetifyHub._startDoneHandler = iHandler;\r\n promise.then(iHandler).catch(function(error) {\r\n throw error;\r\n });\r\n return this;\r\n },\r\n fail: function(iHandler) {\r\n dotnetifyHub._startFailHandler = iHandler;\r\n promise.catch(iHandler);\r\n return this;\r\n }\r\n };\r\n },\r\n\r\n disconnected: function(iHandler) {\r\n if (typeof iHandler === 'function') dotnetifyHub._disconnectedHandler = iHandler;\r\n },\r\n\r\n stateChanged: function(iHandler) {\r\n if (typeof iHandler === 'function') dotnetifyHub._stateChangedHandler = iHandler;\r\n },\r\n\r\n reconnect: function(iStartHubFunc) {\r\n if (typeof iStartHubFunc === 'function') {\r\n // Only attempt reconnect if the specified retry hasn't been exceeded.\r\n if (!dotnetifyHub.reconnectRetry || dotnetifyHub._reconnectCount < dotnetifyHub.reconnectRetry) {\r\n // Determine reconnect delay from the specified configuration array.\r\n let delay =\r\n dotnetifyHub._reconnectCount < dotnetifyHub.reconnectDelay.length\r\n ? dotnetifyHub.reconnectDelay[dotnetifyHub._reconnectCount]\r\n : dotnetifyHub.reconnectDelay[dotnetifyHub.reconnectDelay.length - 1];\r\n\r\n dotnetifyHub._reconnectCount++;\r\n\r\n setTimeout(function() {\r\n dotnetifyHub._changeState(2);\r\n iStartHubFunc();\r\n }, delay * 1000);\r\n }\r\n else dotnetifyHub._changeState(99);\r\n }\r\n },\r\n\r\n client: {},\r\n\r\n server: {\r\n dispose_VM: function(iVMId) {\r\n dotnetifyHub._connection.invoke('Dispose_VM', iVMId);\r\n },\r\n update_VM: function(iVMId, iValue) {\r\n dotnetifyHub._connection.invoke('Update_VM', iVMId, iValue);\r\n },\r\n request_VM: function(iVMId, iArgs) {\r\n dotnetifyHub._connection.invoke('Request_VM', iVMId, iArgs);\r\n }\r\n }\r\n });\r\n }\r\n else {\r\n // SignalR .NET FX.\r\n dotnetifyHub.type = 'netfx';\r\n\r\n if (window.jQuery) $ = window.jQuery;\r\n\r\n // SignalR hub auto-generated from /signalr/hubs.\r\n /// \r\n /// \r\n (function($, window, undefined) {\r\n /// \r\n 'use strict';\r\n\r\n if (typeof $.signalR !== 'function') {\r\n throw new Error('SignalR: SignalR is not loaded. Please ensure jquery.signalR-x.js is referenced before ~/signalr/js.');\r\n }\r\n\r\n var signalR = $.signalR;\r\n\r\n function makeProxyCallback(hub, callback) {\r\n return function() {\r\n // Call the client hub method\r\n callback.apply(hub, $.makeArray(arguments));\r\n };\r\n }\r\n\r\n function registerHubProxies(instance, shouldSubscribe) {\r\n var key, hub, memberKey, memberValue, subscriptionMethod;\r\n\r\n for (key in instance) {\r\n if (instance.hasOwnProperty(key)) {\r\n hub = instance[key];\r\n\r\n if (!hub.hubName) {\r\n // Not a client hub\r\n continue;\r\n }\r\n\r\n if (shouldSubscribe) {\r\n // We want to subscribe to the hub events\r\n subscriptionMethod = hub.on;\r\n }\r\n else {\r\n // We want to unsubscribe from the hub events\r\n subscriptionMethod = hub.off;\r\n }\r\n\r\n // Loop through all members on the hub and find client hub functions to subscribe/unsubscribe\r\n for (memberKey in hub.client) {\r\n if (hub.client.hasOwnProperty(memberKey)) {\r\n memberValue = hub.client[memberKey];\r\n\r\n if (!$.isFunction(memberValue)) {\r\n // Not a client hub function\r\n continue;\r\n }\r\n\r\n subscriptionMethod.call(hub, memberKey, makeProxyCallback(hub, memberValue));\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n $.hubConnection.prototype.createHubProxies = function() {\r\n var proxies = {};\r\n this.starting(function() {\r\n // Register the hub proxies as subscribed\r\n // (instance, shouldSubscribe)\r\n registerHubProxies(proxies, true);\r\n\r\n this._registerSubscribedHubs();\r\n }).disconnected(function() {\r\n // Unsubscribe all hub proxies when we \"disconnect\". This is to ensure that we do not re-add functional call backs.\r\n // (instance, shouldSubscribe)\r\n registerHubProxies(proxies, false);\r\n });\r\n\r\n proxies['dotNetifyHub'] = this.createHubProxy('dotNetifyHub');\r\n proxies['dotNetifyHub'].client = {};\r\n proxies['dotNetifyHub'].server = {\r\n dispose_VM: function(vmId) {\r\n return proxies['dotNetifyHub'].invoke.apply(proxies['dotNetifyHub'], $.merge([ 'Dispose_VM' ], $.makeArray(arguments)));\r\n },\r\n\r\n request_VM: function(vmId, vmArg) {\r\n return proxies['dotNetifyHub'].invoke.apply(proxies['dotNetifyHub'], $.merge([ 'Request_VM' ], $.makeArray(arguments)));\r\n },\r\n\r\n update_VM: function(vmId, vmData) {\r\n return proxies['dotNetifyHub'].invoke.apply(proxies['dotNetifyHub'], $.merge([ 'Update_VM' ], $.makeArray(arguments)));\r\n }\r\n };\r\n\r\n return proxies;\r\n };\r\n\r\n signalR.hub = $.hubConnection(dotnetifyHub.hubPath, { useDefaultPath: false });\r\n $.extend(signalR, signalR.hub.createHubProxies());\r\n })($, window);\r\n\r\n Object.defineProperty(dotnetifyHub, 'state', {\r\n get: function() {\r\n return $.connection.hub.state;\r\n },\r\n set: function(val) {\r\n $.connection.hub.state = val;\r\n }\r\n });\r\n\r\n Object.defineProperty(dotnetifyHub, 'client', {\r\n get: function() {\r\n return $.connection.dotNetifyHub.client;\r\n }\r\n });\r\n\r\n Object.defineProperty(dotnetifyHub, 'server', {\r\n get: function() {\r\n return $.connection.dotNetifyHub.server;\r\n }\r\n });\r\n\r\n Object.defineProperty(dotnetifyHub, 'isConnected', {\r\n get: function() {\r\n return $.connection.hub.state == $.signalR.connectionState.connected;\r\n }\r\n });\r\n\r\n dotnetifyHub = $.extend(dotnetifyHub, {\r\n hubPath: iHubPath || '/signalr',\r\n url: iServerUrl,\r\n\r\n _reconnectCount: 0,\r\n _stateChangedHandler: function(iNewState) {},\r\n\r\n start: function(iHubOptions) {\r\n if (dotnetifyHub.url) $.connection.hub.url = dotnetifyHub.url;\r\n\r\n let deferred;\r\n if (iHubOptions) deferred = $.connection.hub.start(iHubOptions);\r\n else deferred = $.connection.hub.start();\r\n deferred.fail(function(error) {\r\n if (error.source && error.source.message === 'Error parsing negotiate response.')\r\n console.warn('This client may be attempting to connect to an incompatible SignalR .NET Core server.');\r\n });\r\n return deferred;\r\n },\r\n\r\n disconnected: function(iHandler) {\r\n return $.connection.hub.disconnected(iHandler);\r\n },\r\n\r\n stateChanged: function(iHandler) {\r\n dotnetifyHub._stateChangedHandler = iHandler;\r\n return $.connection.hub.stateChanged(function(state) {\r\n if (state == 1) dotnetifyHub._reconnectCount = 0;\r\n\r\n let stateText = { 0: 'connecting', 1: 'connected', 2: 'reconnecting', 4: 'disconnected' };\r\n iHandler(stateText[state.newState]);\r\n });\r\n },\r\n\r\n reconnect: function(iStartHubFunc) {\r\n if (typeof iStartHubFunc === 'function') {\r\n // Only attempt reconnect if the specified retry hasn't been exceeded.\r\n if (!dotnetifyHub.reconnectRetry || dotnetifyHub._reconnectCount < dotnetifyHub.reconnectRetry) {\r\n // Determine reconnect delay from the specified configuration array.\r\n let delay =\r\n dotnetifyHub._reconnectCount < dotnetifyHub.reconnectDelay.length\r\n ? dotnetifyHub.reconnectDelay[dotnetifyHub._reconnectCount]\r\n : dotnetifyHub.reconnectDelay[dotnetifyHub.reconnectDelay.length - 1];\r\n\r\n dotnetifyHub._reconnectCount++;\r\n\r\n setTimeout(function() {\r\n dotnetifyHub._stateChangedHandler('reconnecting');\r\n iStartHubFunc();\r\n }, delay * 1000);\r\n }\r\n else dotnetifyHub._stateChangedHandler('terminated');\r\n }\r\n }\r\n });\r\n }\r\n\r\n // Setup SignalR server method handler.\r\n dotnetifyHub.client.response_VM = function(iVMId, iVMData) {\r\n // SignalR .NET Core is sending an array of arguments.\r\n if (Array.isArray(iVMId)) {\r\n iVMData = iVMId[1];\r\n iVMId = iVMId[0];\r\n }\r\n\r\n let handled = dotnetifyHub.responseEvent.emit(iVMId, iVMData);\r\n\r\n // If we get to this point, that means the server holds a view model instance\r\n // whose view no longer existed. So, tell the server to dispose the view model.\r\n if (!handled) dotnetifyHub.server.dispose_VM(iVMId);\r\n };\r\n\r\n // On disconnected, keep attempting to start the connection.\r\n dotnetifyHub.disconnected(function() {\r\n dotnetifyHub._startInfo = null;\r\n dotnetifyHub.reconnect(function() {\r\n dotnetifyHub.reconnectedEvent.emit();\r\n });\r\n });\r\n };\r\n\r\n return dotnetifyHub;\r\n }\r\n}\r\n\r\nexport default dotnetifyHubFactory.create();\r\n","/* \r\nCopyright 2017-2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport dotnetifyHub, { dotnetifyHubFactory } from './dotnetify-hub';\r\nimport localHub, { hasLocalVM } from './dotnetify-hub-local';\r\nimport webApiHub, { createWebApiHub } from './dotnetify-hub-webapi';\r\n\r\nexport class dotnetifyFactory {\r\n static create() {\r\n const dotnetify = {\r\n // SignalR hub options.\r\n hub: dotnetifyHub,\r\n hubOptions: { transport: [ 'webSockets', 'longPolling' ] },\r\n hubPath: null,\r\n\r\n // Debug mode.\r\n debug: false,\r\n debugFn: null,\r\n\r\n // Offline mode. (WIP)\r\n offline: false,\r\n isOffline: true,\r\n offlineTimeout: 5000,\r\n offlineCacheFn: null,\r\n\r\n // Internal variables.\r\n _vmAccessors: [],\r\n\r\n // Use this to get notified of connection state changed events.\r\n // (state, exception, hub) => void\r\n connectionStateHandler: null,\r\n\r\n // Use this intercept a view model prior to establishing connection,\r\n // with the option to provide any connect parameters.\r\n // ({vmId, options}) => {vmId, options, hub}\r\n connectHandler: null,\r\n\r\n // Support changing hub server URL after first init.\r\n get hubServerUrl() {\r\n return this.hub.url;\r\n },\r\n\r\n set hubServerUrl(url) {\r\n this.hub.url = url;\r\n if (this.debug) console.log('SignalR: connecting to ' + this.hubServerUrl);\r\n if (this.hub.isHubStarted) this.startHub(this.hub, true);\r\n },\r\n\r\n // Generic connect function for non-React app.\r\n connect(iVMId, iOptions) {\r\n return dotnetify.react.connect(iVMId, {}, iOptions);\r\n },\r\n\r\n // Creates a SignalR hub client.\r\n createHub(hubServerUrl, hubPath, hubLib) {\r\n return this.initHub(dotnetifyHubFactory.create(), hubPath, hubServerUrl, hubLib);\r\n },\r\n\r\n // Creates a Web API hub client.\r\n createWebApiHub(baseUrl, onRequestHandler) {\r\n return createWebApiHub(baseUrl, onRequestHandler);\r\n },\r\n\r\n // Configures hub connection to SignalR hub server.\r\n initHub(hub, hubPath, hubServerUrl, hubLib) {\r\n hub = hub || this.hub;\r\n hubPath = hubPath || this.hubPath;\r\n hubServerUrl = hubServerUrl || this.hubServerUrl;\r\n hubLib = hubLib || this.hubLib;\r\n\r\n if (!hub.isHubStarted) {\r\n hub.init(hubPath, hubServerUrl, hubLib);\r\n\r\n // Use SignalR event to raise the connection state event.\r\n hub.stateChanged(state => this.handleConnectionStateChanged(state, null, hub));\r\n }\r\n return hub;\r\n },\r\n\r\n // Used by a view to select a hub, and provides the opportunity to override any connect info.\r\n selectHub(vmConnectArgs) {\r\n vmConnectArgs = vmConnectArgs || {};\r\n vmConnectArgs.options = vmConnectArgs.options || {};\r\n let override = (typeof this.connectHandler == 'function' && this.connectHandler(vmConnectArgs)) || {};\r\n if (!override.hub) {\r\n override.hub = hasLocalVM(vmConnectArgs.vmId) ? localHub : vmConnectArgs.options.webApi ? webApiHub : this.initHub();\r\n override.hub.debug = this.debug;\r\n }\r\n return Object.assign(vmConnectArgs, override);\r\n },\r\n\r\n // Starts hub connection to SignalR hub server.\r\n startHub(hub, forceRestart) {\r\n hub = hub || this.hub;\r\n\r\n const doneHandler = () => {};\r\n const failHandler = ex => this.handleConnectionStateChanged('error', ex, hub);\r\n hub.startHub(this.hubOptions, doneHandler, failHandler, forceRestart);\r\n },\r\n\r\n // Used by dotnetify-react and -vue to expose their view model accessors.\r\n addVMAccessor(vmAccessor) {\r\n !this._vmAccessors.includes(vmAccessor) && this._vmAccessors.push(vmAccessor);\r\n },\r\n\r\n checkServerSideException(iVMId, iVMData, iExceptionHandler) {\r\n const vmData = JSON.parse(iVMData);\r\n if (vmData && vmData.hasOwnProperty('ExceptionType') && vmData.hasOwnProperty('Message')) {\r\n const exception = { name: vmData.ExceptionType, message: vmData.Message };\r\n\r\n if (typeof iExceptionHandler === 'function') {\r\n return iExceptionHandler(exception);\r\n }\r\n else {\r\n console.error('[' + iVMId + '] ' + exception.name + ': ' + exception.message);\r\n throw exception;\r\n }\r\n }\r\n },\r\n\r\n // Get all view models.\r\n getViewModels() {\r\n return this._vmAccessors\r\n .reduce((prev, current) => [ ...prev, ...current() ], [])\r\n .filter((val, idx, self) => self.indexOf(val) === idx); // returns distinct items.\r\n },\r\n\r\n handleConnectionStateChanged(iState, iException, iHub) {\r\n if (this.debug) console.log('SignalR: ' + (iException ? iException.message : iState));\r\n if (typeof this.connectionStateHandler === 'function') this.connectionStateHandler(iState, iException, iHub);\r\n else if (iException) console.error(iException);\r\n }\r\n };\r\n\r\n return dotnetify;\r\n }\r\n}\r\n\r\nexport default dotnetifyFactory.create();\r\n","import dotnetify from './dotnetify-ko';\r\nimport './dotnetify-ko.router';\r\n\r\nmodule.exports = dotnetify;\r\n"],"sourceRoot":""} \ No newline at end of file diff --git a/DevApp/dist/dist/dotnetify-ko.min.js b/DevApp/dist/dist/dotnetify-ko.min.js index b1d2e8ce..eff49a05 100644 --- a/DevApp/dist/dist/dotnetify-ko.min.js +++ b/DevApp/dist/dist/dotnetify-ko.min.js @@ -1,11 +1,11 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("knockout"),require("jquery"),require("@aspnet/signalr")):"function"==typeof define&&define.amd?define(["knockout","jquery","@aspnet/signalr"],e):"object"==typeof exports?exports.dotnetify=e(require("knockout"),require("jquery"),require("@aspnet/signalr")):t.dotnetify=e(t.ko,t.jQuery,t.signalR)}(window,function(t,e,n){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=22)}([function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var n=0;n=0;)t=t.substr(0,t.length-1);for(;0==t.indexOf("/");)t=t.substr(1,t.length-1);return t}},{key:"equal",value:function(t,e){return null!=t&&null!=e&&t.toLowerCase()==e.toLowerCase()}},{key:"startsWith",value:function(t,e){return t.toLowerCase().slice(0,e.length)==e.toLowerCase()}},{key:"endsWith",value:function(t,e){return""==e||t.toLowerCase().slice(-e.length)==e.toLowerCase()}},{key:"dispatchEvent",value:function(t){if("function"==typeof Event)r.dispatchEvent(new Event(t));else{var e=document.createEvent("CustomEvent");e.initEvent(t,!0,!0),r.dispatchEvent(e)}}},{key:"grep",value:function(t,e){return Array.isArray(t)?t.filter(e):[]}}]),t}();e.createEventEmitter=function(t){var e=[];return{emit:function(){for(var t=arguments.length,n=Array(t),r=0;r=0&&(n=(o=t.split("$"))[0],r=o[1]);var o,u="[data-vm='"+n+"']";if((o=n.split(".")).length>1){u="";var a=0;for(a=0;a0&&(l.checkServerSideException(t,e),s.data("ko-dotnetify").UpdateVM(e),!0)},init:function(){var t=l.ko,e=l.selectHub().hub,n=function(){i.default.each((0,i.default)("[data-vm]"),function(){(0,i.default)(this).dotnetify()})};t._responseSubs||(t._responseSubs=e.responseEvent.subscribe(t._responseVM)),t._connectedSubs||(t._connectedSubs=e.connectedEvent.subscribe(function(){n()})),setTimeout(function(){l.offline&&!e.isConnected&&(n(),l.isOffline=!0,(0,i.default)(document).trigger("offline",l.isOffline))},l.offlineTimeout),l.startHub(e),e.stateChanged(function(t){l.debug&&console.log("SignalR: "+t);var e="connected"!=t;l.isOffline!=e&&(l.isOffline=e,(0,i.default)(document).trigger("offline",l.isOffline))}),l.offline&&n()},destroy:function(t){(t?(0,i.default)(t).find("[data-vm]").addBack(t):(0,i.default)("[data-vm]")).toArray().forEach(function(t){var e=l.ko.widget(t);e&&e.destroy()})},getViewModels:function(){l.ko;return(0,i.default)("[data-vm]").toArray().map(function(t){var e=l.ko.widget(t);return e?e.VM:null}).filter(function(t){return t})},widget:function(t){return(0,i.default)(t).data("ko-dotnetify")},plugins:{}},(0,i.default)(function(){l.ko.init()}),i.default.widget("ko.dotnetify",{_create:function(){var t=this;t.VMType=t.element.attr("data-vm"),t.VMId=t.VMType;var e=t.element.attr("data-vm-id");null!=e&&(t.VMId+="$"+e),i.default.each(t.element.parents("[data-master-vm]"),function(){t.VMId=(0,i.default)(this).attr("data-master-vm")+"."+t.VMId}),l.offline&&t._ListenToOfflineEvent(),null!=t.VMId?l.hub.isConnected?t._RequestVM():l.offline&&t._GetOfflineVM():console.error("ERROR: dotnetify - failed to find 'data-vm' attribute in the element where .dotnetify() was applied.")},_destroy:function(){try{var t=this;"function"==typeof t.OfflineFn&&(0,i.default)(document).off("offline",t.OfflineFn),i.default.each(l.plugins,function(e,n){"function"==typeof n.$destroy&&n.$destroy.apply(t.VM)}),null!=t.VM&&t.VM.hasOwnProperty("$destroy")&&t.VM.$destroy()}catch(t){console.error(t.stack)}l.hub.disposeVM(t.VMId)},UpdateVM:function(t){var e=this;try{if(null==e.VM){e.VM=u.mapping.fromJS(JSON.parse(t)),e.VM.$vmId=e.VMId,e.VM.$element=e.element,e.VM.$dotnetify=l.ko,l.offline&&(e.VM.$vmOffline=u.observable(e.IsOffline)),this._AddBuiltInFunctions(),i.default.each(l.ko.plugins,function(t,n){"function"==typeof n.$init&&n.$init.apply(e.VM)}),"function"==typeof e.VM.$init&&e.VM.$init();try{u.applyBindings(e.VM,e.element[0])}catch(t){console.error(t.stack)}e.VM.$serverUpdate=!0,e._OnComponentReady(function(){i.default.each(l.ko.plugins,function(t,n){"function"==typeof n.$ready&&n.$ready.apply(e.VM)}),e._SubscribeObservables(e.VM),"function"==typeof e.VM.$ready&&e.VM.$ready(),e.element.trigger("ready",{VMId:e.VMId,VM:e.VM})}),l.offline&&l.hub.isConnected&&"function"==typeof l.offlineCacheFn&&l.offlineCacheFn(e.VMId+e.element.attr("data-vm-arg"),t)}else{e.VM.$serverUpdate=!1;var n=JSON.parse(t);e._PreProcess(n);try{u.mapping.fromJS(n,e.VM)}catch(t){console.error(t.stack)}e.VM.$serverUpdate=!0,e._OnComponentReady(function(){e._SubscribeObservables(e.VM)})}}catch(t){console.error(t.stack)}l.debug&&(console.log("["+e.VMId+"] received> "),console.log(JSON.parse(t)),null!=l.debugFn&&l.debugFn(e.VMId,"received",JSON.parse(t)))},_AddBuiltInFunctions:function(){var t=this;t.VM.$preventBinding=function(e){t.VM.$serverUpdate=!1,e.apply(t.VM),t.VM.$serverUpdate=!0},t.VM.$addList=function(t,e){var n=Array.isArray(e)?e:u.mapping.fromJS(e),r=t().$vmKey;if(null!=r){var o=u.utils.arrayFirst(t(),function(t){return t[r]()==n[r]()});if(null!=o)return void t.replace(o,n)}t.push(n)},t.VM.$updateList=function(t,e){var n=u.mapping.fromJS(e),r=t().$vmKey;if(null!=r){if(!n.hasOwnProperty(r))return void console.error("ERROR: object requires property '"+r+"'");var o=u.utils.arrayFirst(t(),function(t){return t[r]()==n[r]()});if(null!=o)return void Object.keys(n).forEach(function(t){u.isObservable(n[t])&&o[t](n[t]())})}t.push(n)},t.VM.$removeList=function(e,n){t.VM.$preventBinding(function(){e.remove(n)})},t.VM.$on=function(t,e){t.subscribe(function(t){e(t)})},t.VM.$once=function(t,e){var n=t.subscribe(function(t){n.dispose(),e(t)})},t.VM.$loadView=function(t,e,n,o,u){"object"===(void 0===n?"undefined":r(n))&&null!=n?(u=o,o=n,n=null):"function"==typeof n?(u=n,n=null):"function"==typeof o&&(u=o,o=null),null!=e&&""!=e?(0,i.default)(t).load(e,null,function(){null==o||i.default.isEmptyObject(o)||(0,i.default)(this).attr("data-vm-arg",JSON.stringify(o)),"function"==typeof u&&u.apply(this),null!=n?i.default.getScript(n,function(){l.ko.init()}):l.ko.init()}):(0,i.default)(t).empty()},t.VM.$inject=function(e,n){u.isObservable(e)&&"push"in e?i.default.each(e(),function(e,r){t._Inject(r,n)}):t._Inject(e,n)};var e=s[t.VMType];if(null!=e)if("function"==typeof e){var n=new e(t.VM);Object.assign(n,e.prototype),t._Inject(t.VM,n)}else t._Inject(t.VM,e);i.default.each(l.ko.plugins,function(e,n){n.hasOwnProperty("$inject")&&n.$inject(t.VM)})},_GetOfflineVM:function(){if("function"==typeof l.offlineCacheFn){var t=l.offlineCacheFn(this.VMId+this.element.attr("data-vm-arg"));null==t&&(t=l.offlineCacheFn(this.VMId)),null!=t&&(l.debug&&console.warn("["+this.VMId+"] using offline data"),this.IsOffline=!0,this.UpdateVM(t))}},_ListenToOfflineEvent:function(){var t=this;t.IsOffline=!1,t.OfflineFn=function(e,n){null!=t.VM&&t.VM.hasOwnProperty("$vmOffline")&&t.VM.$vmOffline(n),t.IsOffline=n,n?null==t.VM&&t._GetOfflineVM():t._RequestVM(),(0,i.default)(document).one("offline",t.OfflineFn.bind(t))},(0,i.default)(document).one("offline",t.OfflineFn.bind(t))},_Inject:function(t,e){Object.keys(e).forEach(function(n){t.hasOwnProperty(n)||("function"==typeof e[n]?0==n.indexOf("_")?t[n]=u.pureComputed(e[n],t):t[n]=e[n]:0==n.indexOf("_")?(t[n]=u.observable(e[n]),t[n].$subscribe=!0):t[n]=e[n])})},_OnComponentReady:function(t){var e=this,n=0;!function r(){var o=!0,u=e.element.find("[params]");u.length>0&&(o=0==i.default.grep(u,function(t){return 0==t.childElementCount}).length),o||n++>3?t():setTimeout(r,250)}()},_OnValueChanged:function(t,e){var n={};if(n[t]=e instanceof Object?i.default.extend({},e):e,l.hub.isConnected)try{l.hub.updateVM(this.VMId,n),l.debug&&(console.log("["+this.VMId+"] sent> "),console.log(n),null!=l.debugFn&&l.debugFn(this.VMId,"sent",n))}catch(t){console.error(t)}},_PreProcess:function(t){var e=this;Object.keys(t).forEach(function(n){var r;if(null!=(r=/(.*)_add/.exec(n))){if(null==(o=e.VM[r[1]]))throw new Error("unable to resolve "+n);return e.VM.$addList(o,t[n]),void delete t[n]}if(null!=(r=/(.*)_update/.exec(n))){if(null==(o=e.VM[r[1]]))throw new Error("unable to resolve "+n);return e.VM.$updateList(o,t[n]),void delete t[n]}if(null!=(r=/(.*)_remove/.exec(n))){var o;if(null==(o=e.VM[r[1]]))throw new Error("unable to resolve "+n);var i=o().$vmKey;if(null==i)throw new Error("unable to resolve "+n+" due to missing vmItemKey attribute");return e.VM.$removeList(e.VM[r[1]],function(e){return e[i]()==t[n]}),void delete t[n]}})},_RequestVM:function(){var t=this.element.attr("data-vm-arg");if(t=null!=t?i.default.parseJSON(t.replace(/'/g,'"')):null,l.hub.isConnected)try{l.hub.requestVM(this.VMId,t)}catch(t){console.error(t)}},_SubscribeObservables:function(t,e){var n=this,o=this;if(null!=t)if(u.isObservable(t))"$subscribe"in t==!1&&(t.subscribe(function(t){!0===o.VM.$serverUpdate&&o._OnValueChanged(e,t)}),t.$subscribe=!0),this._SubscribeObservables(t(),e);else if("object"==(void 0===t?"undefined":r(t))){var i="$vmKey"in t?t.$vmKey:null;Object.keys(t).forEach(function(r){if("$"!=r.charAt(0)&&"_"!=r.charAt(0)&&r.charAt(0)!=r.charAt(0).toLowerCase()&&isNaN(r.charAt(0))){var o=null!=i?"$"+t[r][i]():r;n._SubscribeObservables(t[r],null==e?o:e+"."+o)}})}else t instanceof Array&&Object.keys(t).forEach(function(r){path="$"+r,n._SubscribeObservables(t[r],null==e?path:e+"."+path)})}}),u.bindingHandlers.vmItemKey={preprocess:function(t){return"'"!=t.charAt(0)?"'"+t+"'":t},update:function(t,e,n,r,o){var i=e(),a=n.get("foreach");!u.isObservable(a)&&a.hasOwnProperty("data")&&(a=a.data),u.isObservable(a)&&null!=a()&&null!=i&&(a().$vmKey=i)}},u.bindingHandlers.vmCommand={init:function(t,e,n,r,o){var i=o.$root,a=null,s=null,l=/return\s{(.*):(.*)}\s/.exec(e.toString());if(null!=l)a=l[1].trim(),s=l[2].trim();else{var c=/return\s(.*)\s/.exec(e.toString());null!=c&&(a=c[1].trim())}if(null==a)throw new Error("invalid vmCommand value at "+t.outerHTML);null!=s?"'"==s.charAt(0)?s=s.replace(/(^'|'$)/g,""):u.isObservable(r[s])?s=u.unwrap(r[s]):"$data"==s&&(s=r):s=!0;u.bindingHandlers.click.init(t,function(){return function(){var n=null!=i[a]?i[a]:e();u.isObservable(n)?(i.$preventBinding(function(){n(!0!==s&&null)}),n(s)):n.apply(i,[r,t,o.$parent])}},n,r,o)}},u.bindingHandlers.vmOnce={init:function(t,e,n,r,o){u.bindingHandlers.vmOn.init(t,e,n,r,o,!0)}},u.bindingHandlers.vmOn={init:function(t,e,n,r,o,i){var a=o.$root,s=null,l=null,c=e.toString(),f=/return\s{(.*):(.*)}\s/.exec(c);if(null!=f&&(s=f[1].trim(),l=f[2].trim()),null==l)throw new Error("invalid vmOn function at "+t.outerHTML);var d=function(){return null!=a[l]?a[l]:e()[s]};if(null!=s&&!u.isObservable(r[s]))throw new Error("invalid vmOn data: "+e());d().apply(a,[r,t,o.$parent]),null==i&&r[s].subscribe(function(e){d().apply(a,[r,t,o.$parent])})}},e.default=l}).call(this,n(0))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n map "+r+" to template id="+e.Id),t.router.mapTo(r,function(r){t.router.urlPath="";var o=n;for(var i in r)o=o.replace(":"+i,r[i]);o=o.replace(/\(\/:([^)]+)\)/g,"").replace(/\(|\)/g,""),t.routeTo(o,e)})});var r=this.toUrl(this.RoutingState.Active);""==this.router.urlPath&&(this.router.urlPath=r),this.routeUrl()||this.raiseRoutedEvent(!0)}}else console.error("router> the RoutingState prop of '"+e.$vmId+"' was not initialized.")}},{key:"isActive",value:function(t){return!(null==t||!t.hasOwnProperty("Path"))&&i.default.equal(t.Path,this.RoutingState.Active)}},{key:"loadHtmlView",value:function(t,e,n,r){var o=this.vm;this.unmountView(t),$(t).load(e,null,function(){if(null!=n){var t=n.split(",").map(function(t){return $.getScript(t)});$.when.apply($,t).done(function(){return"function"==typeof callbackFn&&r.call(o)})}else"function"==typeof callbackFn&&r.call(o)})}},{key:"loadHtmlElementView",value:function(t,e,n,r,o){var i=this,u=this.vm,a=function(){i.unmountView(t);for(var n=document.querySelector(t);n.firstChild;)n.removeChild(n.firstChild);n.appendChild(e),"function"==typeof callbackFn&&o.call(u)};if(null==n)a();else{var s=n.split(",").map(function(t){return $.getScript(t)});$.when.apply($,s).done(a)}}},{key:"loadView",value:function(t,e,n,r,o){throw new Error("Not implemented")}},{key:"manualRouteTo",value:function(t,e,n,r){this.vm;var o={Id:"manual",Target:e,ViewUrl:n,JSModuleUrl:r};this.routeTo(t,o,!0)}},{key:"onRouteEnter",value:function(t,e){return!0}},{key:"raiseRoutedEvent",value:function(t){this.vm;""!=this.router.urlPath&&1!=t||(this.debug&&console.log("router> routed"),i.default.dispatchEvent("dotnetify.routed"))}},{key:"route",value:function(t,e){if(null!=t){if(!t.hasOwnProperty("Path")&&!t.hasOwnProperty("TemplateId"))throw new Error("Not a valid route");this.initRoot();var n=t.Path,r=null;if(this.hasRoutingState&&null!=this.RoutingState.Templates&&null!=t.TemplateId){var o=this.RoutingState.Templates.filter(function(e){return e.Id==t.TemplateId});if(o.length>0)r=o[0],"string"==typeof e&&(r.Target=e),null==n&&(n=null!=r.UrlPattern?r.UrlPattern:r.Id,t.Path=n);else if(null==t.RedirectRoot)throw new Error("vmRoute cannot find route template "+t.TemplateId)}if(null!=t.RedirectRoot){var i=t.RedirectRoot;"/"==i.charAt(0)&&(i=i.substr(0,i.length-1));var u=t.RedirectRoot.split("/"),a="",s=this.VMRoot;if(null!=s)for(var l=s.split("/"),c=0;c0?f:"/",this.routes.some(function(t){return t.Path===n})||this.routes.push({Path:n,Url:f}),f}}},{key:"routeTo",value:function(t,e,n,r,o){var a=this,s=this.vm,l=s.$dotnetify.getViewModels();this.debug&&console.log("router> route '"+t+"' to template id="+e.Id);for(var c=0;c target '"+e.Target+"' not found in DOM")):(this.debug&&console.log("router> target '"+e.Target+"' not found in DOM, use redirect instead"),this.router.redirect(this.toUrl(t),[].concat(u(l),u(s.$dotnetify.controller.getViewModels())))):void this.loadView("#"+e.Target,e.ViewUrl,e.JSModuleUrl,{"RoutingState.Origin":t},function(){a.dispatchActiveRoutingState(t),1!=n&&s.hasOwnProperty("onRouteExit")&&s.onRouteExit(t,e),"function"==typeof r&&r.call(s)});console.error("router> the Target for template '"+e.Id+"' was not set. Use vm.onRouteEnter() to set the target.")}}},{key:"routeToRoute",value:function(t){var e=this,n=this.vm.$route(t);if(null==n||""==n)throw new Error("The route passed to $routeTo is invalid.");setTimeout(function(){return e.router.pushState({},"",n)})}},{key:"routeUrl",value:function(t){var e=this;if(!this.hasRoutingState)return!1;var n=!!t,r=this.RoutingState.Root;if(null==r)return!1;var o=n?t:this.router.urlPath;if(this.debug&&console.log("router> routing "+o),i.default.equal(o,r)||i.default.equal(o,r+"/")||"/"===o){var u=i.default.grep(this.RoutingState.Templates,function(t){return""===t.UrlPattern});return u.length>0&&(this.routeTo("",u[0],null,null,n),this.router.urlPath="",this.raiseRoutedEvent(),!0)}if(r+="/",i.default.startsWith(o,r)){var a=null,s=i.default.grep(this.routes,function(t){return i.default.startsWith(o+"/",t.Url+"/")});if(s.length>0)for(var l=0;l0)for(i=0;i=8)?n.onhashchange=t:setInterval(t,50),""!==location.hash&&r.dispatch(location.hash)},core:{route:function(t){this.path=t,this.action=null,this.do_enter=[],this.do_exit=null,this.params={},r.routes.defined[t]=this}},routes:{current:null,root:null,rescue:null,previous:null,defined:{}}};r.core.route.prototype={to:function(t){return this.action=t,this},enter:function(t){return t instanceof Array?this.do_enter=this.do_enter.concat(t):this.do_enter.push(t),this},exit:function(t){return this.do_exit=t,this},partition:function(){for(var t,e,n=[],r=[],o=/\(([^}]+?)\)/g;t=o.exec(this.path);)n.push(t[1]);for(r.push(this.path.split("(")[0]),e=0;e0)for(t=0;t0?t:"/",void 0!==o.default&&o.default.map(t).to(function(){e(this.params)})}},{key:"match",value:function(t){if(void 0!==o.default){var e=o.default.match(t,!0);if(null!=e)return e.run(),!0}return!1}},{key:"overrideUrl",value:function(t){return t}},{key:"pushState",value:function(t,e,n){this.urlPath="",void 0!==o.default&&o.default.history.pushState(t,e,n)}},{key:"redirect",value:function(t,e){this.urlPath=t;for(var n=0;n redirected"))}i.location.replace(t)}},{key:"$ready",value:function(){this.$router.initRouting()}},{key:"$update",value:function(t){t&&t.RoutingState&&this.$router.initRouting()}}]),t}();e.default=u}).call(this,n(0))},function(t,e,n){"use strict";var r=l(n(5)),o=l(n(9)),u=l(n(7)),a=l(n(2)),s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(1));function l(t){return t&&t.__esModule?t:{default:t}}r.default.ko.router=new o.default(r.default.debug),r.default.ko.router.$inject=function(t){var e=new u.default(t,r.default.ko.router);t.$router=e},s.bindingHandlers.vmRoute={update:function(t,e,n,o,u){var l=u.$root,c=s.unwrap(e());if(!c.hasOwnProperty("Path")||!c.hasOwnProperty("TemplateId"))throw new Error("invalid vmRoute data at "+t.outerHTML);l.$router.initRoot();var f=c.Path(),d=null;if(l.hasOwnProperty("RoutingState")&&"function"==typeof l.RoutingState.Templates&&null!=l.RoutingState.Templates()){var h=a.default.grep(l.RoutingState.Templates(),function(t){return t.Id()==c.TemplateId()});if(h.length>0)d=h[0],null==f&&(f=d.UrlPattern(),c.Path(f));else if(null==c.RedirectRoot())throw new Error("vmRoute cannot find route template '"+c.TemplateId()+"' at "+t.outerHTML)}if(null!=c.RedirectRoot()){var p=c.RedirectRoot();"/"==p.charAt(0)&&(p=p.substr(0,p.length-1));var v=c.RedirectRoot().split("/"),y="",b=l.$element.attr("data-vm-root");if(null!=b){var g=b.split("/");for(i=0;i=0;)t=t.substr(0,t.length-1);for(;0==t.indexOf("/");)t=t.substr(1,t.length-1);return t}},{key:"equal",value:function(t,e){return null!=t&&null!=e&&t.toLowerCase()==e.toLowerCase()}},{key:"startsWith",value:function(t,e){return t.toLowerCase().slice(0,e.length)==e.toLowerCase()}},{key:"endsWith",value:function(t,e){return""==e||t.toLowerCase().slice(-e.length)==e.toLowerCase()}},{key:"dispatchEvent",value:function(t){if("function"==typeof Event)r.dispatchEvent(new Event(t));else{var e=document.createEvent("CustomEvent");e.initEvent(t,!0,!0),r.dispatchEvent(e)}}},{key:"grep",value:function(t,e){return Array.isArray(t)?t.filter(e):[]}}]),t}();e.createEventEmitter=function(t){var e=[];return{emit:function(){for(var t=arguments.length,n=Array(t),r=0;r=200&&a.status<400){var t=a.responseText;i(t)}else u(a)},a.onerror=function(){u(a)},a.send(n)})};e.default=new o}).call(this,n(0))},function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=a(n(22)),i=a(n(3));n(12);var u=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(2));function a(t){return t&&t.__esModule?t:{default:t}}u.mapping=n(11);var s=s||t||{},c=s.dotnetify||o.default;c.ko={version:"2.0.0",controller:c,_responseSubs:null,_connectedSubs:null,_responseVM:function(t,e){var n=t,r=null;n.indexOf("$")>=0&&(n=(o=t.split("$"))[0],r=o[1]);var o,u="[data-vm='"+n+"']";if((o=n.split(".")).length>1){u="";var a=0;for(a=0;a0&&(c.checkServerSideException(t,e),s.data("ko-dotnetify").UpdateVM(e),!0)},init:function(){var t=c.ko,e=c.selectHub().hub,n=function(){i.default.each((0,i.default)("[data-vm]"),function(){(0,i.default)(this).dotnetify()})};t._responseSubs||(t._responseSubs=e.responseEvent.subscribe(t._responseVM)),t._connectedSubs||(t._connectedSubs=e.connectedEvent.subscribe(function(){n()})),setTimeout(function(){c.offline&&!e.isConnected&&(n(),c.isOffline=!0,(0,i.default)(document).trigger("offline",c.isOffline))},c.offlineTimeout),c.startHub(e),e.stateChanged(function(t){c.debug&&console.log("SignalR: "+t);var e="connected"!=t;c.isOffline!=e&&(c.isOffline=e,(0,i.default)(document).trigger("offline",c.isOffline))}),c.offline&&n()},destroy:function(t){(t?(0,i.default)(t).find("[data-vm]").addBack(t):(0,i.default)("[data-vm]")).toArray().forEach(function(t){var e=c.ko.widget(t);e&&e.destroy()})},getViewModels:function(){c.ko;return(0,i.default)("[data-vm]").toArray().map(function(t){var e=c.ko.widget(t);return e?e.VM:null}).filter(function(t){return t})},widget:function(t){return(0,i.default)(t).data("ko-dotnetify")},plugins:{}},(0,i.default)(function(){c.ko.init()}),i.default.widget("ko.dotnetify",{_create:function(){var t=this;t.VMType=t.element.attr("data-vm"),t.VMId=t.VMType;var e=t.element.attr("data-vm-id");null!=e&&(t.VMId+="$"+e),i.default.each(t.element.parents("[data-master-vm]"),function(){t.VMId=(0,i.default)(this).attr("data-master-vm")+"."+t.VMId}),c.offline&&t._ListenToOfflineEvent(),null!=t.VMId?c.hub.isConnected?t._RequestVM():c.offline&&t._GetOfflineVM():console.error("ERROR: dotnetify - failed to find 'data-vm' attribute in the element where .dotnetify() was applied.")},_destroy:function(){try{var t=this;"function"==typeof t.OfflineFn&&(0,i.default)(document).off("offline",t.OfflineFn),i.default.each(c.plugins,function(e,n){"function"==typeof n.$destroy&&n.$destroy.apply(t.VM)}),null!=t.VM&&t.VM.hasOwnProperty("$destroy")&&t.VM.$destroy()}catch(t){console.error(t.stack)}c.hub.disposeVM(t.VMId)},UpdateVM:function(t){var e=this;try{if(null==e.VM){e.VM=u.mapping.fromJS(JSON.parse(t)),e.VM.$vmId=e.VMId,e.VM.$element=e.element,e.VM.$dotnetify=c.ko,c.offline&&(e.VM.$vmOffline=u.observable(e.IsOffline)),this._AddBuiltInFunctions(),i.default.each(c.ko.plugins,function(t,n){"function"==typeof n.$init&&n.$init.apply(e.VM)}),"function"==typeof e.VM.$init&&e.VM.$init();try{u.applyBindings(e.VM,e.element[0])}catch(t){console.error(t.stack)}e.VM.$serverUpdate=!0,e._OnComponentReady(function(){i.default.each(c.ko.plugins,function(t,n){"function"==typeof n.$ready&&n.$ready.apply(e.VM)}),e._SubscribeObservables(e.VM),"function"==typeof e.VM.$ready&&e.VM.$ready(),e.element.trigger("ready",{VMId:e.VMId,VM:e.VM})}),c.offline&&c.hub.isConnected&&"function"==typeof c.offlineCacheFn&&c.offlineCacheFn(e.VMId+e.element.attr("data-vm-arg"),t)}else{e.VM.$serverUpdate=!1;var n=JSON.parse(t);e._PreProcess(n);try{u.mapping.fromJS(n,e.VM)}catch(t){console.error(t.stack)}e.VM.$serverUpdate=!0,e._OnComponentReady(function(){e._SubscribeObservables(e.VM)})}}catch(t){console.error(t.stack)}c.debug&&(console.log("["+e.VMId+"] received> "),console.log(JSON.parse(t)),null!=c.debugFn&&c.debugFn(e.VMId,"received",JSON.parse(t)))},_AddBuiltInFunctions:function(){var t=this;t.VM.$preventBinding=function(e){t.VM.$serverUpdate=!1,e.apply(t.VM),t.VM.$serverUpdate=!0},t.VM.$addList=function(t,e){var n=Array.isArray(e)?e:u.mapping.fromJS(e),r=t().$vmKey;if(null!=r){var o=u.utils.arrayFirst(t(),function(t){return t[r]()==n[r]()});if(null!=o)return void t.replace(o,n)}t.push(n)},t.VM.$updateList=function(t,e){var n=u.mapping.fromJS(e),r=t().$vmKey;if(null!=r){if(!n.hasOwnProperty(r))return void console.error("ERROR: object requires property '"+r+"'");var o=u.utils.arrayFirst(t(),function(t){return t[r]()==n[r]()});if(null!=o)return void Object.keys(n).forEach(function(t){u.isObservable(n[t])&&o[t](n[t]())})}t.push(n)},t.VM.$removeList=function(e,n){t.VM.$preventBinding(function(){e.remove(n)})},t.VM.$on=function(t,e){t.subscribe(function(t){e(t)})},t.VM.$once=function(t,e){var n=t.subscribe(function(t){n.dispose(),e(t)})},t.VM.$loadView=function(t,e,n,o,u){"object"===(void 0===n?"undefined":r(n))&&null!=n?(u=o,o=n,n=null):"function"==typeof n?(u=n,n=null):"function"==typeof o&&(u=o,o=null),null!=e&&""!=e?(0,i.default)(t).load(e,null,function(){null==o||i.default.isEmptyObject(o)||(0,i.default)(this).attr("data-vm-arg",JSON.stringify(o)),"function"==typeof u&&u.apply(this),null!=n?i.default.getScript(n,function(){c.ko.init()}):c.ko.init()}):(0,i.default)(t).empty()},t.VM.$inject=function(e,n){u.isObservable(e)&&"push"in e?i.default.each(e(),function(e,r){t._Inject(r,n)}):t._Inject(e,n)};var e=s[t.VMType];if(null!=e)if("function"==typeof e){var n=new e(t.VM);Object.assign(n,e.prototype),t._Inject(t.VM,n)}else t._Inject(t.VM,e);i.default.each(c.ko.plugins,function(e,n){n.hasOwnProperty("$inject")&&n.$inject(t.VM)})},_GetOfflineVM:function(){if("function"==typeof c.offlineCacheFn){var t=c.offlineCacheFn(this.VMId+this.element.attr("data-vm-arg"));null==t&&(t=c.offlineCacheFn(this.VMId)),null!=t&&(c.debug&&console.warn("["+this.VMId+"] using offline data"),this.IsOffline=!0,this.UpdateVM(t))}},_ListenToOfflineEvent:function(){var t=this;t.IsOffline=!1,t.OfflineFn=function(e,n){null!=t.VM&&t.VM.hasOwnProperty("$vmOffline")&&t.VM.$vmOffline(n),t.IsOffline=n,n?null==t.VM&&t._GetOfflineVM():t._RequestVM(),(0,i.default)(document).one("offline",t.OfflineFn.bind(t))},(0,i.default)(document).one("offline",t.OfflineFn.bind(t))},_Inject:function(t,e){Object.keys(e).forEach(function(n){t.hasOwnProperty(n)||("function"==typeof e[n]?0==n.indexOf("_")?t[n]=u.pureComputed(e[n],t):t[n]=e[n]:0==n.indexOf("_")?(t[n]=u.observable(e[n]),t[n].$subscribe=!0):t[n]=e[n])})},_OnComponentReady:function(t){var e=this,n=0;!function r(){var o=!0,u=e.element.find("[params]");u.length>0&&(o=0==i.default.grep(u,function(t){return 0==t.childElementCount}).length),o||n++>3?t():setTimeout(r,250)}()},_OnValueChanged:function(t,e){var n={};if(n[t]=e instanceof Object?i.default.extend({},e):e,c.hub.isConnected)try{c.hub.updateVM(this.VMId,n),c.debug&&(console.log("["+this.VMId+"] sent> "),console.log(n),null!=c.debugFn&&c.debugFn(this.VMId,"sent",n))}catch(t){console.error(t)}},_PreProcess:function(t){var e=this;Object.keys(t).forEach(function(n){var r;if(null!=(r=/(.*)_add/.exec(n))){if(null==(o=e.VM[r[1]]))throw new Error("unable to resolve "+n);return e.VM.$addList(o,t[n]),void delete t[n]}if(null!=(r=/(.*)_update/.exec(n))){if(null==(o=e.VM[r[1]]))throw new Error("unable to resolve "+n);return e.VM.$updateList(o,t[n]),void delete t[n]}if(null!=(r=/(.*)_remove/.exec(n))){var o;if(null==(o=e.VM[r[1]]))throw new Error("unable to resolve "+n);var i=o().$vmKey;if(null==i)throw new Error("unable to resolve "+n+" due to missing vmItemKey attribute");return e.VM.$removeList(e.VM[r[1]],function(e){return e[i]()==t[n]}),void delete t[n]}})},_RequestVM:function(){var t=this.element.attr("data-vm-arg");if(t=null!=t?i.default.parseJSON(t.replace(/'/g,'"')):null,c.hub.isConnected)try{c.hub.requestVM(this.VMId,t)}catch(t){console.error(t)}},_SubscribeObservables:function(t,e){var n=this,o=this;if(null!=t)if(u.isObservable(t))"$subscribe"in t==!1&&(t.subscribe(function(t){!0===o.VM.$serverUpdate&&o._OnValueChanged(e,t)}),t.$subscribe=!0),this._SubscribeObservables(t(),e);else if("object"==(void 0===t?"undefined":r(t))){var i="$vmKey"in t?t.$vmKey:null;Object.keys(t).forEach(function(r){if("$"!=r.charAt(0)&&"_"!=r.charAt(0)&&r.charAt(0)!=r.charAt(0).toLowerCase()&&isNaN(r.charAt(0))){var o=null!=i?"$"+t[r][i]():r;n._SubscribeObservables(t[r],null==e?o:e+"."+o)}})}else t instanceof Array&&Object.keys(t).forEach(function(r){path="$"+r,n._SubscribeObservables(t[r],null==e?path:e+"."+path)})}}),u.bindingHandlers.vmItemKey={preprocess:function(t){return"'"!=t.charAt(0)?"'"+t+"'":t},update:function(t,e,n,r,o){var i=e(),a=n.get("foreach");!u.isObservable(a)&&a.hasOwnProperty("data")&&(a=a.data),u.isObservable(a)&&null!=a()&&null!=i&&(a().$vmKey=i)}},u.bindingHandlers.vmCommand={init:function(t,e,n,r,o){var i=o.$root,a=null,s=null,c=/return\s{(.*):(.*)}\s/.exec(e.toString());if(null!=c)a=c[1].trim(),s=c[2].trim();else{var l=/return\s(.*)\s/.exec(e.toString());null!=l&&(a=l[1].trim())}if(null==a)throw new Error("invalid vmCommand value at "+t.outerHTML);null!=s?"'"==s.charAt(0)?s=s.replace(/(^'|'$)/g,""):u.isObservable(r[s])?s=u.unwrap(r[s]):"$data"==s&&(s=r):s=!0;u.bindingHandlers.click.init(t,function(){return function(){var n=null!=i[a]?i[a]:e();u.isObservable(n)?(i.$preventBinding(function(){n(!0!==s&&null)}),n(s)):n.apply(i,[r,t,o.$parent])}},n,r,o)}},u.bindingHandlers.vmOnce={init:function(t,e,n,r,o){u.bindingHandlers.vmOn.init(t,e,n,r,o,!0)}},u.bindingHandlers.vmOn={init:function(t,e,n,r,o,i){var a=o.$root,s=null,c=null,l=e.toString(),f=/return\s{(.*):(.*)}\s/.exec(l);if(null!=f&&(s=f[1].trim(),c=f[2].trim()),null==c)throw new Error("invalid vmOn function at "+t.outerHTML);var d=function(){return null!=a[c]?a[c]:e()[s]};if(null!=s&&!u.isObservable(r[s]))throw new Error("invalid vmOn data: "+e());d().apply(a,[r,t,o.$parent]),null==i&&r[s].subscribe(function(e){d().apply(a,[r,t,o.$parent])})}},e.default=c}).call(this,n(0))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n map "+r+" to template id="+e.Id),t.router.mapTo(r,function(r){t.router.urlPath="";var o=n;for(var i in r)o=o.replace(":"+i,r[i]);o=o.replace(/\(\/:([^)]+)\)/g,"").replace(/\(|\)/g,""),t.routeTo(o,e)})});var r=this.toUrl(this.RoutingState.Active);""==this.router.urlPath&&(this.router.urlPath=r),this.routeUrl()||this.raiseRoutedEvent(!0)}}else console.error("router> the RoutingState prop of '"+e.$vmId+"' was not initialized.")}},{key:"isActive",value:function(t){return!(null==t||!t.hasOwnProperty("Path"))&&i.default.equal(t.Path,this.RoutingState.Active)}},{key:"loadHtmlView",value:function(t,e,n,r){var o=this.vm;this.unmountView(t),$(t).load(e,null,function(){if(null!=n){var t=n.split(",").map(function(t){return $.getScript(t)});$.when.apply($,t).done(function(){return"function"==typeof callbackFn&&r.call(o)})}else"function"==typeof callbackFn&&r.call(o)})}},{key:"loadHtmlElementView",value:function(t,e,n,r,o){var i=this,u=this.vm,a=function(){i.unmountView(t);for(var n=document.querySelector(t);n.firstChild;)n.removeChild(n.firstChild);n.appendChild(e),"function"==typeof callbackFn&&o.call(u)};if(null==n)a();else{var s=n.split(",").map(function(t){return $.getScript(t)});$.when.apply($,s).done(a)}}},{key:"loadView",value:function(t,e,n,r,o){throw new Error("Not implemented")}},{key:"manualRouteTo",value:function(t,e,n,r){this.vm;var o={Id:"manual",Target:e,ViewUrl:n,JSModuleUrl:r};this.routeTo(t,o,!0)}},{key:"onRouteEnter",value:function(t,e){return!0}},{key:"raiseRoutedEvent",value:function(t){this.vm;""!=this.router.urlPath&&1!=t||(this.debug&&console.log("router> routed"),i.default.dispatchEvent("dotnetify.routed"))}},{key:"route",value:function(t,e){if(null!=t){if(!t.hasOwnProperty("Path")&&!t.hasOwnProperty("TemplateId"))throw new Error("Not a valid route");this.initRoot();var n=t.Path,r=null;if(this.hasRoutingState&&null!=this.RoutingState.Templates&&null!=t.TemplateId){var o=this.RoutingState.Templates.filter(function(e){return e.Id==t.TemplateId});if(o.length>0)r=o[0],"string"==typeof e&&(r.Target=e),null==n&&(n=null!=r.UrlPattern?r.UrlPattern:r.Id,t.Path=n);else if(null==t.RedirectRoot)throw new Error("vmRoute cannot find route template "+t.TemplateId)}if(null!=t.RedirectRoot){var i=t.RedirectRoot;"/"==i.charAt(0)&&(i=i.substr(0,i.length-1));var u=t.RedirectRoot.split("/"),a="",s=this.VMRoot;if(null!=s)for(var c=s.split("/"),l=0;l0?f:"/",this.routes.some(function(t){return t.Path===n})||this.routes.push({Path:n,Url:f}),f}}},{key:"routeTo",value:function(t,e,n,r,o){var a=this,s=this.vm,c=s.$dotnetify.getViewModels();this.debug&&console.log("router> route '"+t+"' to template id="+e.Id);for(var l=0;l target '"+e.Target+"' not found in DOM")):(this.debug&&console.log("router> target '"+e.Target+"' not found in DOM, use redirect instead"),this.router.redirect(this.toUrl(t),[].concat(u(c),u(s.$dotnetify.controller.getViewModels())))):void this.loadView("#"+e.Target,e.ViewUrl,e.JSModuleUrl,{"RoutingState.Origin":t},function(){a.dispatchActiveRoutingState(t),1!=n&&s.hasOwnProperty("onRouteExit")&&s.onRouteExit(t,e),"function"==typeof r&&r.call(s)});console.error("router> the Target for template '"+e.Id+"' was not set. Use vm.onRouteEnter() to set the target.")}}},{key:"routeToRoute",value:function(t){var e=this,n=this.vm.$route(t);if(null==n||""==n)throw new Error("The route passed to $routeTo is invalid.");setTimeout(function(){return e.router.pushState({},"",n)})}},{key:"routeUrl",value:function(t){var e=this;if(!this.hasRoutingState)return!1;var n=!!t,r=this.RoutingState.Root;if(null==r)return!1;var o=n?t:this.router.urlPath;if(this.debug&&console.log("router> routing "+o),i.default.equal(o,r)||i.default.equal(o,r+"/")||"/"===o){var u=i.default.grep(this.RoutingState.Templates,function(t){return""===t.UrlPattern});return u.length>0&&(this.routeTo("",u[0],null,null,n),this.router.urlPath="",this.raiseRoutedEvent(),!0)}if(r+="/",i.default.startsWith(o,r)){var a=null,s=i.default.grep(this.routes,function(t){return i.default.startsWith(o+"/",t.Url+"/")});if(s.length>0)for(var c=0;c0)for(i=0;i=8)?n.onhashchange=t:setInterval(t,50),""!==location.hash&&r.dispatch(location.hash)},core:{route:function(t){this.path=t,this.action=null,this.do_enter=[],this.do_exit=null,this.params={},r.routes.defined[t]=this}},routes:{current:null,root:null,rescue:null,previous:null,defined:{}}};r.core.route.prototype={to:function(t){return this.action=t,this},enter:function(t){return t instanceof Array?this.do_enter=this.do_enter.concat(t):this.do_enter.push(t),this},exit:function(t){return this.do_exit=t,this},partition:function(){for(var t,e,n=[],r=[],o=/\(([^}]+?)\)/g;t=o.exec(this.path);)n.push(t[1]);for(r.push(this.path.split("(")[0]),e=0;e0)for(t=0;t0?t:"/",void 0!==o.default&&o.default.map(t).to(function(){e(this.params)})}},{key:"match",value:function(t){if(void 0!==o.default){var e=o.default.match(t,!0);if(null!=e)return e.run(),!0}return!1}},{key:"overrideUrl",value:function(t){return t}},{key:"pushState",value:function(t,e,n){this.urlPath="",void 0!==o.default&&o.default.history.pushState(t,e,n)}},{key:"redirect",value:function(t,e){this.urlPath=t;for(var n=0;n redirected"))}i.location.replace(t)}},{key:"$ready",value:function(){this.$router.initRouting()}},{key:"$update",value:function(t){t&&t.RoutingState&&this.$router.initRouting()}}]),t}();e.default=u}).call(this,n(0))},function(t,e,n){"use strict";var r=c(n(5)),o=c(n(9)),u=c(n(7)),a=c(n(3)),s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(2));function c(t){return t&&t.__esModule?t:{default:t}}r.default.ko.router=new o.default(r.default.debug),r.default.ko.router.$inject=function(t){var e=new u.default(t,r.default.ko.router);t.$router=e},s.bindingHandlers.vmRoute={update:function(t,e,n,o,u){var c=u.$root,l=s.unwrap(e());if(!l.hasOwnProperty("Path")||!l.hasOwnProperty("TemplateId"))throw new Error("invalid vmRoute data at "+t.outerHTML);c.$router.initRoot();var f=l.Path(),d=null;if(c.hasOwnProperty("RoutingState")&&"function"==typeof c.RoutingState.Templates&&null!=c.RoutingState.Templates()){var h=a.default.grep(c.RoutingState.Templates(),function(t){return t.Id()==l.TemplateId()});if(h.length>0)d=h[0],null==f&&(f=d.UrlPattern(),l.Path(f));else if(null==l.RedirectRoot())throw new Error("vmRoute cannot find route template '"+l.TemplateId()+"' at "+t.outerHTML)}if(null!=l.RedirectRoot()){var p=l.RedirectRoot();"/"==p.charAt(0)&&(p=p.substr(0,p.length-1));var v=l.RedirectRoot().split("/"),y="",b=c.$element.attr("data-vm-root");if(null!=b){var g=b.split("/");for(i=0;iu;u++)for(r in i[u])o=i[u][r],i[u].hasOwnProperty(r)&&void 0!==o&&(e[r]=t.isPlainObject(o)?t.isPlainObject(e[r])?t.widget.extend({},e[r],o):t.widget.extend({},o):o);return e},t.widget.bridge=function(e,r){var o=r.prototype.widgetFullName||e;t.fn[e]=function(i){var u="string"==typeof i,a=n.call(arguments,1),s=this;return u?this.each(function(){var n,r=t.data(this,o);return"instance"===i?(s=r,!1):r?t.isFunction(r[i])&&"_"!==i.charAt(0)?(n=r[i].apply(r,a))!==r&&void 0!==n?(s=n&&n.jquery?s.pushStack(n.get()):n,!1):void 0:t.error("no such method '"+i+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; attempted to call method '"+i+"'")}):(a.length&&(i=t.widget.extend.apply(null,[i].concat(a))),this.each(function(){var e=t.data(this,o);e?(e.option(i||{}),e._init&&e._init()):t.data(this,o,new r(i,this))})),s}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{disabled:!1,create:null},_createWidget:function(n,r){r=t(r||this.defaultElement||this)[0],this.element=t(r),this.uuid=e++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),r!==this&&(t.data(r,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===r&&this.destroy()}}),this.document=t(r.style?r.ownerDocument:r.document||r),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),n),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(e,n){var r,o,i,u=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(u={},r=e.split("."),e=r.shift(),r.length){for(o=u[e]=t.widget.extend({},this.options[e]),i=0;r.length-1>i;i++)o[r[i]]=o[r[i]]||{},o=o[r[i]];if(e=r.pop(),1===arguments.length)return void 0===o[e]?null:o[e];o[e]=n}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];u[e]=n}return this._setOptions(u),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!e),e&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(e,n,r){var o,i=this;"boolean"!=typeof e&&(r=n,n=e,e=!1),r?(n=o=t(n),this.bindings=this.bindings.add(n)):(r=n,n=this.element,o=this.widget()),t.each(r,function(r,u){function a(){return e||!0!==i.options.disabled&&!t(this).hasClass("ui-state-disabled")?("string"==typeof u?i[u]:u).apply(i,arguments):void 0}"string"!=typeof u&&(a.guid=u.guid=u.guid||a.guid||t.guid++);var s=r.match(/^([\w:-]*)\s*(.*)$/),l=s[1]+i.eventNamespace,c=s[2];c?o.delegate(c,l,a):n.bind(l,a)})},_off:function(e,n){n=(n||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(n).undelegate(n),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){var n=this;return setTimeout(function(){return("string"==typeof t?n[t]:t).apply(n,arguments)},e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,n,r){var o,i,u=this.options[e];if(r=r||{},(n=t.Event(n)).type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),n.target=this.element[0],i=n.originalEvent)for(o in i)o in n||(n[o]=i[o]);return this.element.trigger(n,r),!(t.isFunction(u)&&!1===u.apply(this.element[0],[n].concat(r))||n.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,n){t.Widget.prototype["_"+e]=function(r,o,i){"string"==typeof o&&(o={effect:o});var u,a=o?!0===o||"number"==typeof o?n:o.effect||n:e;"number"==typeof(o=o||{})&&(o={duration:o}),u=!t.isEmptyObject(o),o.complete=i,o.delay&&r.delay(o.delay),u&&t.effects&&t.effects.effect[a]?r[e](o):a!==e&&r[a]?r[a](o.duration,o.easing,i):r.queue(function(n){t(this)[e](),i&&i.call(r[0]),n()})}}),t.widget})?r.apply(e,o):r)||(t.exports=i)},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.hasLocalVM=e.dotNetifyHubLocal=void 0;var r=function(){function t(t,e){for(var n=0;n-1;)c.splice(n,1),u&&(n<=s&&s--,n<=l&&l--)}),this},has:function(t){return r.inArray(t,c)>-1},empty:function(){return c=[],this},disable:function(){return c=f=e=void 0,this},disabled:function(){return!c},lock:function(){return f=void 0,e||h.disable(),this},locked:function(){return!f},fireWith:function(t,e){return e=[t,(e=e||[]).slice?e.slice():e],!c||n&&!f||(u?f.push(e):d(e)),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!n}};return h}},function(t,e,n){ +* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */o=[n(3)],void 0===(i="function"==typeof(r=function(t){var e=0,n=Array.prototype.slice;t.cleanData=function(e){return function(n){var r,o,i;for(i=0;null!=(o=n[i]);i++)try{(r=t._data(o,"events"))&&r.remove&&t(o).triggerHandler("remove")}catch(t){}e(n)}}(t.cleanData),t.widget=function(e,n,r){var o,i,u,a,s={},c=e.split(".")[0];return e=e.split(".")[1],o=c+"-"+e,r||(r=n,n=t.Widget),t.expr[":"][o.toLowerCase()]=function(e){return!!t.data(e,o)},t[c]=t[c]||{},i=t[c][e],u=t[c][e]=function(t,e){return this._createWidget?void(arguments.length&&this._createWidget(t,e)):new u(t,e)},t.extend(u,i,{version:r.version,_proto:t.extend({},r),_childConstructors:[]}),(a=new n).options=t.widget.extend({},a.options),t.each(r,function(e,r){return t.isFunction(r)?void(s[e]=function(){var t=function(){return n.prototype[e].apply(this,arguments)},o=function(t){return n.prototype[e].apply(this,t)};return function(){var e,n=this._super,i=this._superApply;return this._super=t,this._superApply=o,e=r.apply(this,arguments),this._super=n,this._superApply=i,e}}()):void(s[e]=r)}),u.prototype=t.widget.extend(a,{widgetEventPrefix:i&&a.widgetEventPrefix||e},s,{constructor:u,namespace:c,widgetName:e,widgetFullName:o}),i?(t.each(i._childConstructors,function(e,n){var r=n.prototype;t.widget(r.namespace+"."+r.widgetName,u,n._proto)}),delete i._childConstructors):n._childConstructors.push(u),t.widget.bridge(e,u),u},t.widget.extend=function(e){for(var r,o,i=n.call(arguments,1),u=0,a=i.length;a>u;u++)for(r in i[u])o=i[u][r],i[u].hasOwnProperty(r)&&void 0!==o&&(e[r]=t.isPlainObject(o)?t.isPlainObject(e[r])?t.widget.extend({},e[r],o):t.widget.extend({},o):o);return e},t.widget.bridge=function(e,r){var o=r.prototype.widgetFullName||e;t.fn[e]=function(i){var u="string"==typeof i,a=n.call(arguments,1),s=this;return u?this.each(function(){var n,r=t.data(this,o);return"instance"===i?(s=r,!1):r?t.isFunction(r[i])&&"_"!==i.charAt(0)?(n=r[i].apply(r,a))!==r&&void 0!==n?(s=n&&n.jquery?s.pushStack(n.get()):n,!1):void 0:t.error("no such method '"+i+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; attempted to call method '"+i+"'")}):(a.length&&(i=t.widget.extend.apply(null,[i].concat(a))),this.each(function(){var e=t.data(this,o);e?(e.option(i||{}),e._init&&e._init()):t.data(this,o,new r(i,this))})),s}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{disabled:!1,create:null},_createWidget:function(n,r){r=t(r||this.defaultElement||this)[0],this.element=t(r),this.uuid=e++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),r!==this&&(t.data(r,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===r&&this.destroy()}}),this.document=t(r.style?r.ownerDocument:r.document||r),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),n),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(e,n){var r,o,i,u=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(u={},r=e.split("."),e=r.shift(),r.length){for(o=u[e]=t.widget.extend({},this.options[e]),i=0;r.length-1>i;i++)o[r[i]]=o[r[i]]||{},o=o[r[i]];if(e=r.pop(),1===arguments.length)return void 0===o[e]?null:o[e];o[e]=n}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];u[e]=n}return this._setOptions(u),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!e),e&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(e,n,r){var o,i=this;"boolean"!=typeof e&&(r=n,n=e,e=!1),r?(n=o=t(n),this.bindings=this.bindings.add(n)):(r=n,n=this.element,o=this.widget()),t.each(r,function(r,u){function a(){return e||!0!==i.options.disabled&&!t(this).hasClass("ui-state-disabled")?("string"==typeof u?i[u]:u).apply(i,arguments):void 0}"string"!=typeof u&&(a.guid=u.guid=u.guid||a.guid||t.guid++);var s=r.match(/^([\w:-]*)\s*(.*)$/),c=s[1]+i.eventNamespace,l=s[2];l?o.delegate(l,c,a):n.bind(c,a)})},_off:function(e,n){n=(n||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(n).undelegate(n),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){var n=this;return setTimeout(function(){return("string"==typeof t?n[t]:t).apply(n,arguments)},e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,n,r){var o,i,u=this.options[e];if(r=r||{},(n=t.Event(n)).type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),n.target=this.element[0],i=n.originalEvent)for(o in i)o in n||(n[o]=i[o]);return this.element.trigger(n,r),!(t.isFunction(u)&&!1===u.apply(this.element[0],[n].concat(r))||n.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,n){t.Widget.prototype["_"+e]=function(r,o,i){"string"==typeof o&&(o={effect:o});var u,a=o?!0===o||"number"==typeof o?n:o.effect||n:e;"number"==typeof(o=o||{})&&(o={duration:o}),u=!t.isEmptyObject(o),o.complete=i,o.delay&&r.delay(o.delay),u&&t.effects&&t.effects.effect[a]?r[e](o):a!==e&&r[a]?r[a](o.duration,o.easing,i):r.queue(function(n){t(this)[e](),i&&i.call(r[0]),n()})}}),t.widget})?r.apply(e,o):r)||(t.exports=i)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createWebApiHub=e.dotNetifyHubWebApi=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n-1;)l.splice(n,1),u&&(n<=s&&s--,n<=c&&c--)}),this},has:function(t){return r.inArray(t,l)>-1},empty:function(){return l=[],this},disable:function(){return l=f=e=void 0,this},disabled:function(){return!l},lock:function(){return f=void 0,e||h.disable(),this},locked:function(){return!f},fireWith:function(t,e){return e=[t,(e=e||[]).slice?e.slice():e],!l||n&&!f||(u?f.push(e):d(e)),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!n}};return h}},function(t,e,n){ /*! * jquery-deferred * Copyright(c) 2011 Hidden * MIT Licensed */ -var r=t.exports=n(16),o=Array.prototype.slice;r.extend({Deferred:function(t){var e=[["resolve","done",r.Callbacks("once memory"),"resolved"],["reject","fail",r.Callbacks("once memory"),"rejected"],["notify","progress",r.Callbacks("memory")]],n="pending",o={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var t=arguments;return r.Deferred(function(n){r.each(e,function(e,o){var u=o[0],a=t[e];i[o[1]](r.isFunction(a)?function(){var t=a.apply(this,arguments);t&&r.isFunction(t.promise)?t.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[u+"With"](this===i?n:this,[t])}:n[u])}),t=null}).promise()},promise:function(t){return null!=t?r.extend(t,o):o}},i={};return o.pipe=o.then,r.each(e,function(t,r){var u=r[2],a=r[3];o[r[1]]=u.add,a&&u.add(function(){n=a},e[1^t][2].disable,e[2][2].lock),i[r[0]]=u.fire,i[r[0]+"With"]=u.fireWith}),o.promise(i),t&&t.call(i,i),i},when:function(t){var e,n,i,u=0,a=o.call(arguments),s=a.length,l=1!==s||t&&r.isFunction(t.promise)?s:0,c=1===l?t:r.Deferred(),f=function(t,n,r){return function(i){n[t]=this,r[t]=arguments.length>1?o.call(arguments):i,r===e?c.notifyWith(n,r):--l||c.resolveWith(n,r)}};if(s>1)for(e=new Array(s),n=new Array(s),i=new Array(s);u=200&&o.status<400){var e=o.responseText;document.querySelector(t).innerHTML=e,r.call(document.querySelector(t))}},o.send(),{abort:function(t){return o.abort(t)}}}})},u,{support:{cors:!0},trim:function(t){return"string"==typeof t?t.trim():t},inArray:function(t,e){return-1!==t.indexOf(e)},makeArray:function(t){return[].slice.call(t,0)},merge:function(t,e){return Array.prototype.push.apply(t,e),t},isEmptyObject:function(t){return!t||0===Object.keys(t).length},ajax:function(t){var e=new i.XMLHttpRequest;return e.onreadystatechange=function(){if(4===e.readyState)if(200!==e.status||e._hasError)t.error&&t.error(e);else try{t.success&&t.success(JSON.parse(e.responseText))}catch(n){t.success&&t.success(e.responseText)}},e.open(t.type,t.url),e.setRequestHeader("content-type",t.contentType),e.send(t.data.data&&"data="+t.data.data),{abort:function(t){return e.abort(t)}}},getScript:function(t,e){var n=!1,r=u.Deferred(),o=document.getElementsByTagName("head")[0],i=document.createElement("script");return i.src=t,i.onload=i.onreadystatechange=function(){n||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(n=!0,i.onload=i.onreadystatechange=null,o.removeChild(i),"function"==typeof e&&e(),r.resolve())},o.appendChild(i),r}});void 0!==i&&(i.jQuery=i.jQuery||a),"object"===o(e)&&"object"===o(r)&&(r.exports=a)}).call(this,n(0),n(4)(t))},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.dotnetifyHubFactory=void 0;var r=function(){function t(t,e){for(var n=0;n0?t._startConnection(e,n):t._onDisconnected()});return"function"==typeof t._startDoneHandler&&u.then(t._startDoneHandler).catch(t._startFailHandler||function(){}),u},start:function(e){t._startDoneHandler=null,t._startFailHandler=null;var n=[0],r={webSockets:0,serverSentEvents:1,longPolling:2};e&&Array.isArray(e.transport)&&(n=e.transport.map(function(t){return r[t]}));var o=t._startConnection(e,n);return{done:function(e){return t._startDoneHandler=e,o.then(e).catch(function(t){throw t}),this},fail:function(e){return t._startFailHandler=e,o.catch(e),this}}},disconnected:function(e){"function"==typeof e&&(t._disconnectedHandler=e)},stateChanged:function(e){"function"==typeof e&&(t._stateChangedHandler=e)},reconnect:function(e){if("function"==typeof e)if(!t.reconnectRetry||t._reconnectCount1?o.call(arguments):i,r===e?l.notifyWith(n,r):--c||l.resolveWith(n,r)}};if(s>1)for(e=new Array(s),n=new Array(s),i=new Array(s);u=200&&o.status<400){var e=o.responseText;document.querySelector(t).innerHTML=e,r.call(document.querySelector(t))}},o.send(),{abort:function(t){return o.abort(t)}}}})},u,{support:{cors:!0},trim:function(t){return"string"==typeof t?t.trim():t},inArray:function(t,e){return-1!==t.indexOf(e)},makeArray:function(t){return[].slice.call(t,0)},merge:function(t,e){return Array.prototype.push.apply(t,e),t},isEmptyObject:function(t){return!t||0===Object.keys(t).length},ajax:function(t){var e=new i.XMLHttpRequest;return e.onreadystatechange=function(){if(4===e.readyState)if(200!==e.status||e._hasError)t.error&&t.error(e);else try{t.success&&t.success(JSON.parse(e.responseText))}catch(n){t.success&&t.success(e.responseText)}},e.open(t.type,t.url),e.setRequestHeader("content-type",t.contentType),e.send(t.data.data&&"data="+t.data.data),{abort:function(t){return e.abort(t)}}},getScript:function(t,e){var n=!1,r=u.Deferred(),o=document.getElementsByTagName("head")[0],i=document.createElement("script");return i.src=t,i.onload=i.onreadystatechange=function(){n||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(n=!0,i.onload=i.onreadystatechange=null,o.removeChild(i),"function"==typeof e&&e(),r.resolve())},o.appendChild(i),r}});void 0!==i&&(i.jQuery=i.jQuery||a),"object"===o(e)&&"object"===o(r)&&(r.exports=a)}).call(this,n(0),n(4)(t))},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.dotnetifyHubFactory=void 0;var r=function(){function t(t,e){for(var n=0;n0?t._startConnection(e,n):t._onDisconnected()});return"function"==typeof t._startDoneHandler&&u.then(t._startDoneHandler).catch(t._startFailHandler||function(){}),u},start:function(e){t._startDoneHandler=null,t._startFailHandler=null;var n=[0],r={webSockets:0,serverSentEvents:1,longPolling:2};e&&Array.isArray(e.transport)&&(n=e.transport.map(function(t){return r[t]}));var o=t._startConnection(e,n);return{done:function(e){return t._startDoneHandler=e,o.then(e).catch(function(t){throw t}),this},fail:function(e){return t._startFailHandler=e,o.catch(e),this}}},disconnected:function(e){"function"==typeof e&&(t._disconnectedHandler=e)},stateChanged:function(e){"function"==typeof e&&(t._stateChangedHandler=e)},reconnect:function(e){if("function"==typeof e)if(!t.reconnectRetry||t._reconnectCount= 0) { + iStr = iStr.substr(0, iStr.length - 1); + }while (iStr.indexOf('/') == 0) { + iStr = iStr.substr(1, iStr.length - 1); + }return iStr; + } + + // Match two strings case-insensitive. + + }, { + key: 'equal', + value: function equal(iStr1, iStr2) { + return iStr1 != null && iStr2 != null && iStr1.toLowerCase() == iStr2.toLowerCase(); + } + + // Whether the string starts or ends with a value. + + }, { + key: 'startsWith', + value: function startsWith(iStr, iValue) { + return iStr.toLowerCase().slice(0, iValue.length) == iValue.toLowerCase(); + } + }, { + key: 'endsWith', + value: function endsWith(iStr, iValue) { + return iValue == '' || iStr.toLowerCase().slice(-iValue.length) == iValue.toLowerCase(); + } + + // Dispatch event with IE polyfill. + + }, { + key: 'dispatchEvent', + value: function dispatchEvent(iEvent) { + if (typeof Event === 'function') window.dispatchEvent(new Event(iEvent));else { + var event = document.createEvent('CustomEvent'); + event.initEvent(iEvent, true, true); + window.dispatchEvent(event); + } + } + }, { + key: 'grep', + value: function grep(iArray, iFilter) { + return Array.isArray(iArray) ? iArray.filter(iFilter) : []; + } + }]); + + return utils; +}(); + +var createEventEmitter = exports.createEventEmitter = function createEventEmitter(_) { + var subscribers = []; + return { + emit: function emit() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var handled = false; + subscribers.forEach(function (subscriber) { + handled = subscriber.apply(undefined, _toConsumableArray(args)) || handled; + }); + return handled; + }, + subscribe: function subscribe(subscriber) { + !subscribers.includes(subscriber) && subscribers.push(subscriber); + return function () { + return subscribers = subscribers.filter(function (x) { + return x !== subscriber; + }); + }; + } + }; +}; + +var fetch = exports.fetch = function fetch(iMethod, iUrl, iData, iOptions) { + return new Promise(function (resolve, reject) { + var request = new window.XMLHttpRequest(); + request.open(iMethod, iUrl, true); + if (typeof iOptions == 'function') iOptions(request); + + request.onload = function () { + if (request.status >= 200 && request.status < 400) { + var response = request.responseText; + resolve(response); + } else reject(request); + }; + request.onerror = function () { + reject(request); + }; + request.send(iData); + }); +}; + +exports.default = new utils(); +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0))) + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + "use strict"; /* WEBPACK VAR INJECTION */(function(global, module) { @@ -295,7 +437,7 @@ limitations under the License. var window = window || global || {}; -var jQueryDeferred = __webpack_require__(11); +var jQueryDeferred = __webpack_require__(12); var jQueryShim = jQueryDeferred.extend(function (selector) { if (selector === window || selector.document) return { 0: selector, @@ -428,130 +570,7 @@ var jQueryShim = jQueryDeferred.extend(function (selector) { if (typeof window !== 'undefined') window.jQuery = window.jQuery || jQueryShim; if (( false ? undefined : _typeof(exports)) === 'object' && ( false ? undefined : _typeof(module)) === 'object') module.exports = jQueryShim; -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0), __webpack_require__(12)(module))) - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(global) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/* -Copyright 2018 Dicky Suryadi - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - */ -var window = window || global || {}; - -var utils = function () { - function utils() { - _classCallCheck(this, utils); - } - - _createClass(utils, [{ - key: 'trim', - - // Trim slashes from start and end of string. - value: function trim(iStr) { - if (typeof iStr !== 'string') return ''; - - while (iStr.indexOf('/', iStr.length - 1) >= 0) { - iStr = iStr.substr(0, iStr.length - 1); - }while (iStr.indexOf('/') == 0) { - iStr = iStr.substr(1, iStr.length - 1); - }return iStr; - } - - // Match two strings case-insensitive. - - }, { - key: 'equal', - value: function equal(iStr1, iStr2) { - return iStr1 != null && iStr2 != null && iStr1.toLowerCase() == iStr2.toLowerCase(); - } - - // Whether the string starts or ends with a value. - - }, { - key: 'startsWith', - value: function startsWith(iStr, iValue) { - return iStr.toLowerCase().slice(0, iValue.length) == iValue.toLowerCase(); - } - }, { - key: 'endsWith', - value: function endsWith(iStr, iValue) { - return iValue == '' || iStr.toLowerCase().slice(-iValue.length) == iValue.toLowerCase(); - } - - // Dispatch event with IE polyfill. - - }, { - key: 'dispatchEvent', - value: function dispatchEvent(iEvent) { - if (typeof Event === 'function') window.dispatchEvent(new Event(iEvent));else { - var event = document.createEvent('CustomEvent'); - event.initEvent(iEvent, true, true); - window.dispatchEvent(event); - } - } - }, { - key: 'grep', - value: function grep(iArray, iFilter) { - return Array.isArray(iArray) ? iArray.filter(iFilter) : []; - } - }]); - - return utils; -}(); - -var createEventEmitter = exports.createEventEmitter = function createEventEmitter(_) { - var subscribers = []; - return { - emit: function emit() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - var handled = false; - subscribers.forEach(function (subscriber) { - handled = subscriber.apply(undefined, _toConsumableArray(args)) || handled; - }); - return handled; - }, - subscribe: function subscribe(subscriber) { - !subscribers.includes(subscriber) && subscribers.push(subscriber); - return function () { - return subscribers = subscribers.filter(function (x) { - return x !== subscriber; - }); - }; - } - }; -}; - -exports.default = new utils(); -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0), __webpack_require__(13)(module))) /***/ }), /* 4 */ @@ -589,7 +608,7 @@ var _createClass = function () { function defineProperties(target, props) { for */ -var _jqueryShim = __webpack_require__(2); +var _jqueryShim = __webpack_require__(3); var _jqueryShim2 = _interopRequireDefault(_jqueryShim); @@ -952,6 +971,133 @@ exports.default = dotnetifyVM; /* 6 */ /***/ (function(module, exports, __webpack_require__) { +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createWebApiHub = exports.dotNetifyHubWebApi = undefined; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* + Copyright 2019 Dicky Suryadi + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + +var _utils = __webpack_require__(2); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var dotNetifyHubWebApi = exports.dotNetifyHubWebApi = function () { + function dotNetifyHubWebApi(iBaseUrl, iOnRequest) { + _classCallCheck(this, dotNetifyHubWebApi); + + this.mode = 'webapi'; + this.debug = false; + this.isConnected = false; + this.isHubStarted = false; + this.responseEvent = (0, _utils.createEventEmitter)(); + this.reconnectedEvent = (0, _utils.createEventEmitter)(); + this.connectedEvent = (0, _utils.createEventEmitter)(); + this.connectionFailedEvent = (0, _utils.createEventEmitter)(); + this._vmArgs = {}; + + this.baseUrl = iBaseUrl || ''; + this.onRequest = iOnRequest; + } + + _createClass(dotNetifyHubWebApi, [{ + key: 'startHub', + value: function startHub() { + this.isConnected = true; + this.isHubStarted = true; + this.connectedEvent.emit(); + } + }, { + key: 'requestVM', + value: function requestVM(iVMId, iVMArgs) { + var _this = this; + + var vmArgs = iVMArgs || {}; + var vmArgQuery = vmArgs.$vmArg ? '?vmarg=' + JSON.stringify(vmArgs.$vmArg) : ''; + var headers = vmArgs.$headers || {}; + + this._vmArgs[iVMId] = vmArgs; + var url = this.baseUrl + ('/api/dotnetify/vm/' + iVMId + vmArgQuery); + + (0, _utils.fetch)('GET', url, null, function (request) { + Object.keys(headers).forEach(function (key) { + return request.setRequestHeader(key, headers[key]); + }); + if (typeof _this.onRequest == 'function') _this.onRequest(url, request); + }).then(function (response) { + _this.responseEvent.emit(iVMId, response); + }).catch(function (request) { + return console.error('[' + iVMId + '] Request failed', request); + }); + } + }, { + key: 'updateVM', + value: function updateVM(iVMId, iValue) { + var _this2 = this; + + var vmArgs = this._vmArgs[iVMId] || {}; + var vmArgQuery = vmArgs.$vmArg ? '?vmarg=' + JSON.stringify(vmArgs.$vmArg) : ''; + var headers = vmArgs.$headers || {}; + var payload = (typeof iValue === 'undefined' ? 'undefined' : _typeof(iValue)) == 'object' ? JSON.stringify(iValue) : iValue; + + var url = this.baseUrl + ('/api/dotnetify/vm/' + iVMId + vmArgQuery); + + (0, _utils.fetch)('POST', url, payload, function (request) { + request.setRequestHeader('Content-Type', 'application/json'); + Object.keys(headers).forEach(function (key) { + return request.setRequestHeader(key, headers[key]); + }); + if (typeof _this2.onRequest == 'function') _this2.onRequest(url, request, payload); + }).then(function (response) { + _this2.responseEvent.emit(iVMId, response); + }).catch(function (request) { + return console.error('[' + iVMId + '] Update failed', request); + }); + } + }, { + key: 'disposeVM', + value: function disposeVM(iVMId) { + delete this._vmArgs[iVMId]; + } + }], [{ + key: 'create', + value: function create(iBaseUrl, iOnRequest) { + return new dotNetifyHubWebApi(iBaseUrl, iOnRequest); + } + }]); + + return dotNetifyHubWebApi; +}(); + +var createWebApiHub = dotNetifyHubWebApi.create; + +exports.createWebApiHub = createWebApiHub; +exports.default = dotNetifyHubWebApi.create(); + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + "use strict"; /* WEBPACK VAR INJECTION */(function(global) { @@ -963,7 +1109,6 @@ exports.hasLocalVM = exports.dotNetifyHubLocal = undefined; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /* - import { dotnetify } from 'dotnetify/dist/dotnetify-ko'; Copyright 2019 Dicky Suryadi Licensed under the Apache License, Version 2.0 (the "License"); @@ -980,7 +1125,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol */ -var _utils = __webpack_require__(3); +var _utils = __webpack_require__(2); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -1075,13 +1220,13 @@ exports.hasLocalVM = hasLocalVM; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0))) /***/ }), -/* 7 */ +/* 8 */ /***/ (function(module, exports) { -module.exports = __WEBPACK_EXTERNAL_MODULE__7__; +module.exports = __WEBPACK_EXTERNAL_MODULE__8__; /***/ }), -/* 8 */ +/* 9 */ /***/ (function(module, exports) { /** @@ -1242,10 +1387,10 @@ function extend() { /***/ }), -/* 9 */ +/* 10 */ /***/ (function(module, exports, __webpack_require__) { -var jQuery = module.exports = __webpack_require__(8), +var jQuery = module.exports = __webpack_require__(9), core_rspace = /\s+/; /** * jQuery Callbacks @@ -1454,7 +1599,7 @@ jQuery.Callbacks = function( options ) { /***/ }), -/* 10 */ +/* 11 */ /***/ (function(module, exports, __webpack_require__) { @@ -1468,7 +1613,7 @@ jQuery.Callbacks = function( options ) { * Library version. */ -var jQuery = module.exports = __webpack_require__(9), +var jQuery = module.exports = __webpack_require__(10), core_slice = Array.prototype.slice; /** @@ -1623,14 +1768,14 @@ jQuery.extend({ /***/ }), -/* 11 */ +/* 12 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = __webpack_require__(10); +module.exports = __webpack_require__(11); /***/ }), -/* 12 */ +/* 13 */ /***/ (function(module, exports) { module.exports = function(module) { @@ -1658,7 +1803,7 @@ module.exports = function(module) { /***/ }), -/* 13 */ +/* 14 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1686,9 +1831,9 @@ var _createClass = function () { function defineProperties(target, props) { for */ -var _utils = __webpack_require__(3); +var _utils = __webpack_require__(2); -var _jqueryShim = __webpack_require__(2); +var _jqueryShim = __webpack_require__(3); var _jqueryShim2 = _interopRequireDefault(_jqueryShim); @@ -1696,7 +1841,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -var signalRNetCore = __webpack_require__(7); +var signalRNetCore = __webpack_require__(8); var $ = _jqueryShim2.default; var window = window || global || {}; @@ -2115,7 +2260,7 @@ exports.default = dotnetifyHubFactory.create(); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0))) /***/ }), -/* 14 */ +/* 15 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2143,14 +2288,18 @@ var _createClass = function () { function defineProperties(target, props) { for */ -var _dotnetifyHub = __webpack_require__(13); +var _dotnetifyHub = __webpack_require__(14); var _dotnetifyHub2 = _interopRequireDefault(_dotnetifyHub); -var _dotnetifyHubLocal = __webpack_require__(6); +var _dotnetifyHubLocal = __webpack_require__(7); var _dotnetifyHubLocal2 = _interopRequireDefault(_dotnetifyHubLocal); +var _dotnetifyHubWebapi = __webpack_require__(6); + +var _dotnetifyHubWebapi2 = _interopRequireDefault(_dotnetifyHubWebapi); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } @@ -2206,7 +2355,7 @@ var dotnetifyFactory = exports.dotnetifyFactory = function () { // Generic connect function for non-React app. connect: function connect(iVMId, iOptions) { - dotnetify.react.connect(iVMId, null, iOptions); + return dotnetify.react.connect(iVMId, {}, iOptions); }, @@ -2216,6 +2365,12 @@ var dotnetifyFactory = exports.dotnetifyFactory = function () { }, + // Creates a Web API hub client. + createWebApiHub: function createWebApiHub(baseUrl, onRequestHandler) { + return (0, _dotnetifyHubWebapi.createWebApiHub)(baseUrl, onRequestHandler); + }, + + // Configures hub connection to SignalR hub server. initHub: function initHub(hub, hubPath, hubServerUrl, hubLib) { var _this = this; @@ -2239,10 +2394,11 @@ var dotnetifyFactory = exports.dotnetifyFactory = function () { // Used by a view to select a hub, and provides the opportunity to override any connect info. selectHub: function selectHub(vmConnectArgs) { - vmConnectArgs = vmConnectArgs || { options: {} }; + vmConnectArgs = vmConnectArgs || {}; + vmConnectArgs.options = vmConnectArgs.options || {}; var override = typeof this.connectHandler == 'function' && this.connectHandler(vmConnectArgs) || {}; if (!override.hub) { - override.hub = (0, _dotnetifyHubLocal.hasLocalVM)(vmConnectArgs.vmId) ? _dotnetifyHubLocal2.default : this.initHub(); + override.hub = (0, _dotnetifyHubLocal.hasLocalVM)(vmConnectArgs.vmId) ? _dotnetifyHubLocal2.default : vmConnectArgs.options.webApi ? _dotnetifyHubWebapi2.default : this.initHub(); override.hub.debug = this.debug; } return Object.assign(vmConnectArgs, override); @@ -2306,7 +2462,79 @@ var dotnetifyFactory = exports.dotnetifyFactory = function () { exports.default = dotnetifyFactory.create(); /***/ }), -/* 15 */ +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); /* + Copyright 2019 Dicky Suryadi + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +exports.default = useConnect; + +var _react = __webpack_require__(4); + +var _dotnetifyReact = __webpack_require__(1); + +var _dotnetifyReact2 = _interopRequireDefault(_dotnetifyReact); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function useConnect(vmId, component, options) { + var state = component.state, + props = component.props; + + if (state == null) state = component || {}; + + if (_react.useState == null || _react.useEffect == null) throw 'Error: using React hooks requires at least v16.8.'; + + var _useState = (0, _react.useState)(state), + _useState2 = _slicedToArray(_useState, 2), + _state = _useState2[0], + _setState = _useState2[1]; + + var vm = (0, _react.useRef)(); + var vmData = (0, _react.useRef)(_state); + + (0, _react.useEffect)(function () { + vm.current = _dotnetifyReact2.default.react.connect(vmId, { + props: props, + get state() { + return vmData.current; + }, + setState: function setState(newState) { + vmData.current = newState; + _setState(vmData.current); + } + }, options); + return function () { + return vm.current.$destroy(); + }; + }, []); + + return { vm: vm.current, state: _state }; +} + +/***/ }), +/* 17 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2404,7 +2632,7 @@ _dotnetifyReact2.default.react.router.RouteTarget = RouteTarget; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0))) /***/ }), -/* 16 */ +/* 18 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2491,7 +2719,7 @@ exports.default = RouteLink; _dotnetifyReact2.default.react.router.RouteLink = RouteLink; /***/ }), -/* 17 */ +/* 19 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2510,7 +2738,7 @@ module.exports = ReactPropTypesSecret; /***/ }), -/* 18 */ +/* 20 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2523,7 +2751,7 @@ module.exports = ReactPropTypesSecret; -var ReactPropTypesSecret = __webpack_require__(17); +var ReactPropTypesSecret = __webpack_require__(19); function emptyFunction() {} @@ -2576,7 +2804,7 @@ module.exports = function() { /***/ }), -/* 19 */ +/* 21 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -2589,12 +2817,12 @@ module.exports = function() { if (false) { var throwOnDirectAccess, isValidElement, REACT_ELEMENT_TYPE; } else { // By explicitly using `prop-types` you are opting into new production behavior. // http://fb.me/prop-types-in-prod - module.exports = __webpack_require__(18)(); + module.exports = __webpack_require__(20)(); } /***/ }), -/* 20 */ +/* 22 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2604,13 +2832,15 @@ Object.defineProperty(exports, "__esModule", { value: true }); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _react = __webpack_require__(4); var _react2 = _interopRequireDefault(_react); -var _propTypes = __webpack_require__(19); +var _propTypes = __webpack_require__(21); var _propTypes2 = _interopRequireDefault(_propTypes); @@ -2664,6 +2894,12 @@ var Scope = function (_React$Component) { var scope = this.context.scoped ? this.context.scoped(this.props.vm) : this.props.vm; return scope ? scope + '.' + vmId : vmId; } + }, { + key: 'scopedOptions', + value: function scopedOptions(options) { + var scopedOptions = this.context.scoped ? this.context.scopedOptions(this.props.options) : this.props.options; + return scopedOptions ? _extends({}, scopedOptions, options) : options; + } }, { key: 'getChildContext', value: function getChildContext() { @@ -2673,9 +2909,13 @@ var Scope = function (_React$Component) { scoped: function scoped(vmId) { return _this.scoped(vmId); }, + scopedOptions: function scopedOptions(options) { + return _this.scopedOptions(options); + }, connect: function connect(vmId, component, options) { component.vmId = _this.scoped(vmId); - component.vm = _dotnetifyReact2.default.react.connect(component.vmId, component, options); + component.options = _this.scopedOptions(options); + component.vm = _dotnetifyReact2.default.react.connect(component.vmId, component, component.options); component.dispatch = function (state) { return component.vm.$dispatch(state); }; @@ -2699,11 +2939,18 @@ var Scope = function (_React$Component) { }(_react2.default.Component); Scope.displayName = 'Scope'; -Scope.version = '1.2.0'; -Scope.propTypes = { vm: _propTypes2.default.string }; -Scope.contextTypes = { scoped: _propTypes2.default.func }; +Scope.version = '1.3.0'; +Scope.propTypes = { + vm: _propTypes2.default.string, + options: _propTypes2.default.object +}; +Scope.contextTypes = { + scoped: _propTypes2.default.func, + scopedOptions: _propTypes2.default.func +}; Scope.childContextTypes = { scoped: _propTypes2.default.func.isRequired, + scopedOptions: _propTypes2.default.func.isRequired, connect: _propTypes2.default.func.isRequired }; exports.default = Scope; @@ -2713,7 +2960,7 @@ _dotnetifyReact2.default.react.Scope = Scope; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0))) /***/ }), -/* 21 */ +/* 23 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2727,7 +2974,7 @@ var _dotnetifyVm = __webpack_require__(5); var _dotnetifyVm2 = _interopRequireDefault(_dotnetifyVm); -var _jqueryShim = __webpack_require__(2); +var _jqueryShim = __webpack_require__(3); var _jqueryShim2 = _interopRequireDefault(_jqueryShim); @@ -2818,7 +3065,7 @@ _dotnetifyReact2.default.react.router.ssr = function (iPath, iInitialStates, iOv /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0))) /***/ }), -/* 22 */ +/* 24 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2847,7 +3094,7 @@ var _createClass = function () { function defineProperties(target, props) { for */ -var _utils = __webpack_require__(3); +var _utils = __webpack_require__(2); var _utils2 = _interopRequireDefault(_utils); @@ -3330,13 +3577,13 @@ var dotnetifyVMRouter = function () { exports.default = dotnetifyVMRouter; /***/ }), -/* 23 */ +/* 25 */ /***/ (function(module, exports) { -module.exports = __WEBPACK_EXTERNAL_MODULE__23__; +module.exports = __WEBPACK_EXTERNAL_MODULE__25__; /***/ }), -/* 24 */ +/* 26 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3354,19 +3601,19 @@ var _react = __webpack_require__(4); var _react2 = _interopRequireDefault(_react); -var _reactDom = __webpack_require__(23); +var _reactDom = __webpack_require__(25); var _reactDom2 = _interopRequireDefault(_reactDom); -var _dotnetifyVmRouter = __webpack_require__(22); +var _dotnetifyVmRouter = __webpack_require__(24); var _dotnetifyVmRouter2 = _interopRequireDefault(_dotnetifyVmRouter); -var _jqueryShim = __webpack_require__(2); +var _jqueryShim = __webpack_require__(3); var _jqueryShim2 = _interopRequireDefault(_jqueryShim); -var _utils = __webpack_require__(3); +var _utils = __webpack_require__(2); var _utils2 = _interopRequireDefault(_utils); @@ -3527,7 +3774,7 @@ exports.default = dotnetifyReactVMRouter; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0))) /***/ }), -/* 25 */ +/* 27 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3758,7 +4005,7 @@ exports.default = Path; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0))) /***/ }), -/* 26 */ +/* 28 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3785,7 +4032,7 @@ var _createClass = function () { function defineProperties(target, props) { for */ -var _path = __webpack_require__(25); +var _path = __webpack_require__(27); var _path2 = _interopRequireDefault(_path); @@ -3907,7 +4154,7 @@ exports.default = dotnetifyRouter; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0))) /***/ }), -/* 27 */ +/* 29 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3917,11 +4164,11 @@ var _dotnetifyReact = __webpack_require__(1); var _dotnetifyReact2 = _interopRequireDefault(_dotnetifyReact); -var _dotnetifyRouter = __webpack_require__(26); +var _dotnetifyRouter = __webpack_require__(28); var _dotnetifyRouter2 = _interopRequireDefault(_dotnetifyRouter); -var _dotnetifyReact3 = __webpack_require__(24); +var _dotnetifyReact3 = __webpack_require__(26); var _dotnetifyReact4 = _interopRequireDefault(_dotnetifyReact3); @@ -3977,7 +4224,7 @@ _dotnetifyReact2.default.react.router.$mount = function (iTargetSelector, iCompo _dotnetifyReact2.default.react.plugins['router'] = _dotnetifyReact2.default.react.router; /***/ }), -/* 28 */ +/* 30 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3987,25 +4234,29 @@ var _dotnetifyReact = __webpack_require__(1); var _dotnetifyReact2 = _interopRequireDefault(_dotnetifyReact); -__webpack_require__(27); +__webpack_require__(29); -__webpack_require__(21); +__webpack_require__(23); -var _Scope = __webpack_require__(20); +var _Scope = __webpack_require__(22); var _Scope2 = _interopRequireDefault(_Scope); -var _RouteLink = __webpack_require__(16); +var _RouteLink = __webpack_require__(18); var _RouteLink2 = _interopRequireDefault(_RouteLink); -var _RouteTarget = __webpack_require__(15); +var _RouteTarget = __webpack_require__(17); var _RouteTarget2 = _interopRequireDefault(_RouteTarget); +var _useConnect = __webpack_require__(16); + +var _useConnect2 = _interopRequireDefault(_useConnect); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -module.exports = Object.assign(_dotnetifyReact2.default, { Scope: _Scope2.default, RouteLink: _RouteLink2.default, RouteTarget: _RouteTarget2.default }); +module.exports = Object.assign(_dotnetifyReact2.default, { Scope: _Scope2.default, RouteLink: _RouteLink2.default, RouteTarget: _RouteTarget2.default, useConnect: _useConnect2.default }); /***/ }) /******/ ]); diff --git a/DevApp/dist/dist/dotnetify-react.js.map b/DevApp/dist/dist/dotnetify-react.js.map index 2f30678f..82e0fc59 100644 --- a/DevApp/dist/dist/dotnetify-react.js.map +++ b/DevApp/dist/dist/dotnetify-react.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://dotnetify/webpack/universalModuleDefinition","webpack://dotnetify/webpack/bootstrap","webpack://dotnetify/(webpack)/buildin/global.js","webpack://dotnetify/./src/dotnetify/react/dotnetify-react.js","webpack://dotnetify/./src/dotnetify/libs/jquery-shim.js","webpack://dotnetify/./src/dotnetify/libs/utils.js","webpack://dotnetify/external {\"commonjs\":\"react\",\"commonjs2\":\"react\",\"amd\":\"react\",\"root\":\"React\"}","webpack://dotnetify/./src/dotnetify/core/dotnetify-vm.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-hub-local.js","webpack://dotnetify/external {\"commonjs\":\"@aspnet/signalr\",\"commonjs2\":\"@aspnet/signalr\",\"amd\":\"@aspnet/signalr\",\"root\":\"signalR\"}","webpack://dotnetify/./node_modules/jquery-deferred/lib/jquery-core.js","webpack://dotnetify/./node_modules/jquery-deferred/lib/jquery-callbacks.js","webpack://dotnetify/./node_modules/jquery-deferred/lib/jquery-deferred.js","webpack://dotnetify/./node_modules/jquery-deferred/index.js","webpack://dotnetify/(webpack)/buildin/module.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-hub.js","webpack://dotnetify/./src/dotnetify/core/dotnetify.js","webpack://dotnetify/./src/dotnetify/react/RouteTarget.js","webpack://dotnetify/./src/dotnetify/react/RouteLink.js","webpack://dotnetify/./node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack://dotnetify/./node_modules/prop-types/factoryWithThrowingShims.js","webpack://dotnetify/./node_modules/prop-types/index.js","webpack://dotnetify/./src/dotnetify/react/Scope.js","webpack://dotnetify/./src/dotnetify/react/ssr.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-vm-router.js","webpack://dotnetify/external {\"commonjs\":\"react-dom\",\"commonjs2\":\"react-dom\",\"amd\":\"react-dom\",\"root\":\"ReactDOM\"}","webpack://dotnetify/./src/dotnetify/react/dotnetify-react.vm-router.js","webpack://dotnetify/./src/dotnetify/libs/path.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-router.js","webpack://dotnetify/./src/dotnetify/react/dotnetify-react.router.js","webpack://dotnetify/./src/dotnetify/react/index.js"],"names":["window","global","dotnetify","_dotnetify","react","version","viewModels","plugins","controller","_hubs","init","iHub","self","hubInitialized","some","hub","start","isHubStarted","Object","keys","filter","vmId","$hub","forEach","$requested","startHub","responseEvent","subscribe","iVMId","iVMData","_responseVM","connectedEvent","$request","reconnectedEvent","mode","push","connect","iReact","iOptions","arguments","length","Error","vmArg","ssr","ssrConnect","hasOwnProperty","console","error","$destroy","setTimeout","component","props","state","setState","connectInfo","selectHub","options","dotnetifyVM","getViewModels","map","vm","checkServerSideException","$exceptionHandler","$update","addVMAccessor","jQueryDeferred","require","jQueryShim","extend","selector","document","on","iEvent","iHandler","addEventListener","bind","unbind","removeEventListener","events","event","handlers","idx","indexOf","splice","triggerHandler","iArgs","args","type","Array","isArray","arg","handler","apply","load","iUrl","request","XMLHttpRequest","open","onload","status","response","responseText","querySelector","innerHTML","call","send","abort","reason","support","cors","trim","iStr","inArray","iArray","iItem","makeArray","slice","merge","iArray1","iArray2","prototype","isEmptyObject","iObj","ajax","onreadystatechange","readyState","_hasError","success","JSON","parse","url","setRequestHeader","contentType","data","getScript","iSuccess","done","promise","Deferred","head","getElementsByTagName","script","createElement","src","removeChild","resolve","appendChild","jQuery","exports","module","utils","substr","iStr1","iStr2","toLowerCase","iValue","Event","dispatchEvent","createEvent","initEvent","iFilter","createEventEmitter","subscribers","emit","handled","subscriber","includes","x","iComponent","iDotNetify","$vmId","$component","$options","$vmArg","$headers","$loaded","$itemKey","$dotnetify","getState","State","Props","prop","$","$getPlugins","plugin","$inject","isConnected","disposeVM","ex","handleConnectionStateChanged","updateVM","debug","log","debugFn","key","listName","item","$dispatch","$updateList","id","iVMUpdate","match","exec","$addList","$removeList","i","itemKey","$setItemKey","requestVM","vmData","$preProcess","$onLoad","$onUpdate","$ready","iItemKey","assign","iListName","iNewItem","items","normalize","replace","hasLocalVM","onConnect","dotNetifyHubLocal","connectionFailedEvent","iVMArgs","$pushUpdate","update","stringify","onDispatch","onDestroy","signalRNetCore","dotnetifyHubFactory","dotnetifyHub","reconnectDelay","reconnectRetry","_startInfo","_init","server","request_VM","update_VM","dispose_VM","hubOptions","doneHandler","failHandler","forceRestart","_doneHandler","_failHandler","failHander","fail","err","iHubPath","iServerUrl","signalR","HubConnection","defineProperty","get","_connection","connection","connectionState","hubPath","_reconnectCount","_startDoneHandler","_startFailHandler","_disconnectedHandler","_stateChangedHandler","iNewState","_onDisconnected","_changeState","stateText","_startConnection","iHubOptions","iTransportArray","transport","shift","HubConnectionBuilder","withUrl","build","client","response_VM","onclose","then","catch","transportOptions","webSockets","serverSentEvents","longPolling","disconnected","stateChanged","reconnect","iStartHubFunc","delay","invoke","undefined","makeProxyCallback","callback","registerHubProxies","instance","shouldSubscribe","memberKey","memberValue","subscriptionMethod","hubName","off","isFunction","hubConnection","createHubProxies","proxies","starting","_registerSubscribedHubs","createHubProxy","useDefaultPath","set","val","dotNetifyHub","connected","deferred","source","message","warn","newState","create","dotnetifyFactory","offline","isOffline","offlineTimeout","offlineCacheFn","_vmAccessors","connectionStateHandler","connectHandler","hubServerUrl","createHub","hubLib","initHub","vmConnectArgs","override","localHub","vmAccessor","iExceptionHandler","exception","name","ExceptionType","Message","reduce","prev","current","iState","iException","RouteTarget","elem","getElementById","initialHtml","__html","el","React","Component","router","RouteLink","handleClick","preventDefault","route","onClick","$handleRoute","style","className","$route","children","Scope","scope","context","scoped","_this","dispatch","dispatchState","vmStates","displayName","propTypes","PropTypes","string","contextTypes","func","childContextTypes","isRequired","iVMArg","vmState","ssrState","fetched","iPath","iInitialStates","iOverrideRouteFn","iCallbackFn","iTimeout","urlPath","overrideUrl","text","insertBefore","firstChild","routed","fallback","clearTimeout","dotnetifyVMRouter","routes","RoutingState","Active","iArg","path","currentTarget","pathname","pushState","hasRoutingState","Root","_absRoot","absRoot","VMRoot","root","templates","Templates","$init","initRoot","urlPattern","template","UrlPattern","Id","mapUrl","toUrl","mapTo","param","iParams","routeTo","activeUrl","routeUrl","raiseRoutedEvent","iRoute","equal","Path","iTargetSelector","iViewUrl","iJsModuleUrl","unmountView","getScripts","split","when","callbackFn","iHtmlElement","iVmArg","mountViewFunc","target","iTarget","iJSModuleUrl","Target","ViewUrl","JSModuleUrl","iTemplate","force","TemplateId","RedirectRoot","redirectRoot","charAt","redirectRootPath","urlRedirect","absRootPath","Url","$template","pathToRoute","iDisableEvent","isRedirect","vmOther","$router","VMArg","onRouteEnter","redirect","loadView","dispatchActiveRoutingState","onRouteExit","redirectUrlPath","grep","startsWith","routeElem","dotnetifyReactVMRouter","iVM","iDotNetifyRouter","reactProps","vmRoot","endsWith","loadHtmlView","HTMLElement","loadHtmlElementView","loadReactView","iReactProps","Promise","reject","reactElement","ReactDOM","render","e","unmountComponentAtNode","defined","core","rescue","fn","history","initial","title","supported","location","hash","popState","initialPop","popped","href","URL","listen","onpopstate","parameterize","params","possible_routes","j","compare","result","partition","search","join","passed_route","previous_route","matched_route","previous","do_exit","run","documentMode","onhashchange","setInterval","action","do_enter","to","enter","fns","concat","exit","parts","re","halt_execution","dotnetifyRouter","iFn","iUrlPath","matched","iTitle","initRouting","handleRoute","$routeTo","routeToRoute","$mount","iProps"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;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ACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,QAAQ,YAAY;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;ACxJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,oCAAoC;AAC9C;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;AC3MA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA,MAAM;AACN,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,8CAA8C;AAC9C,KAAK;AACL;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,IAAI;;AAEJ;;AAEA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA,UAAU,YAAY;AACtB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;;;;;;;ACjKD,yC;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;;;;;;;;;;;;;;qjBCrBA;;;;;;;;;;;;;;;;;AAeA;;AACA;;;;;;;;AACA,IAAMU,iB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MAApB,CAAV;AAAA,GAAf;AACD,CAdD;;AAgBA;AACA9a,yBAAUE,KAAV,CAAgBgW,MAAhB,CAAuBkM,MAAvB,GAAgC,UAASnH,eAAT,EAA0B3Q,UAA1B,EAAsC+X,MAAtC,EAA8CjK,WAA9C,EAA2D;AACzF,SAAOwF,yBAAuBtW,SAAvB,CAAiC+W,aAAjC,CAA+CpD,eAA/C,EAAgE3Q,UAAhE,EAA4E,IAA5E,EAAkF+X,MAAlF,EAA0FjK,WAA1F,CAAP;AACD,CAFD;;AAIA;AACApY,yBAAUE,KAAV,CAAgBG,OAAhB,CAAwB,QAAxB,IAAoCL,yBAAUE,KAAV,CAAgBgW,MAApD,C;;;;;;;;;AC7CA;;;;AACA;;AACA;;AACA;;;;AACA;;;;AACA;;;;;;AAEA/M,OAAOD,OAAP,GAAiBlI,OAAOqM,MAAP,CAAcrN,wBAAd,EAAyB,EAAE6W,sBAAF,EAASV,8BAAT,EAAoBT,kCAApB,EAAzB,CAAjB,C","file":"dotnetify-react.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"@aspnet/signalr\"), require(\"react-dom\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\", \"@aspnet/signalr\", \"react-dom\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"dotnetify\"] = factory(require(\"react\"), require(\"@aspnet/signalr\"), require(\"react-dom\"));\n\telse\n\t\troot[\"dotnetify\"] = factory(root[\"React\"], root[\"signalR\"], root[\"ReactDOM\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__4__, __WEBPACK_EXTERNAL_MODULE__7__, __WEBPACK_EXTERNAL_MODULE__23__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 28);\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport _dotnetify from '../core/dotnetify';\r\nimport dotnetifyVM from '../core/dotnetify-vm';\r\n\r\nconst window = window || global || {};\r\nlet dotnetify = window.dotnetify || _dotnetify;\r\n\r\ndotnetify.react = {\r\n version: '3.0.0',\r\n viewModels: {},\r\n plugins: {},\r\n controller: dotnetify,\r\n\r\n // Internal variables.\r\n _hubs: [],\r\n\r\n // Initializes connection to SignalR server hub.\r\n init: function(iHub) {\r\n const self = dotnetify.react;\r\n const hubInitialized = self._hubs.some(hub => hub === iHub);\r\n\r\n const start = function() {\r\n if (!iHub.isHubStarted)\r\n Object.keys(self.viewModels)\r\n .filter(vmId => self.viewModels[vmId].$hub === iHub)\r\n .forEach(vmId => (self.viewModels[vmId].$requested = false));\r\n\r\n dotnetify.startHub(iHub);\r\n };\r\n\r\n if (!hubInitialized) {\r\n iHub.responseEvent.subscribe((iVMId, iVMData) => self._responseVM(iVMId, iVMData));\r\n iHub.connectedEvent.subscribe(() =>\r\n Object.keys(self.viewModels)\r\n .filter(vmId => self.viewModels[vmId].$hub === iHub && !self.viewModels[vmId].$requested)\r\n .forEach(vmId => self.viewModels[vmId].$request())\r\n );\r\n iHub.reconnectedEvent.subscribe(start);\r\n\r\n if (iHub.mode !== 'local') self._hubs.push(iHub);\r\n }\r\n\r\n start();\r\n },\r\n\r\n // Connects to a server view model.\r\n connect: function(iVMId, iReact, iOptions) {\r\n if (arguments.length < 2) throw new Error('[dotNetify] Missing arguments. Usage: connect(vmId, component) ');\r\n\r\n const vmArg = iOptions && iOptions['vmArg'];\r\n\r\n if (dotnetify.ssr && dotnetify.react.ssrConnect) {\r\n return dotnetify.react.ssrConnect(iVMId, iReact, vmArg);\r\n }\r\n\r\n const self = dotnetify.react;\r\n if (self.viewModels.hasOwnProperty(iVMId)) {\r\n console.error(\r\n `Component is attempting to connect to an already active '${iVMId}'. ` +\r\n ` If it's from a dismounted component, you must add vm.$destroy to componentWillUnmount().`\r\n );\r\n self.viewModels[iVMId].$destroy();\r\n return setTimeout(() => self.connect(iVMId, iReact, iOptions));\r\n }\r\n\r\n const component = {\r\n get props() {\r\n return iReact.props;\r\n },\r\n get state() {\r\n return iReact.state;\r\n },\r\n setState(state) {\r\n iReact.setState(state);\r\n }\r\n };\r\n\r\n const connectInfo = dotnetify.selectHub({ vmId: iVMId, options: iOptions, hub: null });\r\n self.viewModels[iVMId] = new dotnetifyVM(connectInfo.vmId, component, connectInfo.options, self, connectInfo.hub);\r\n if (connectInfo.hub) self.init(connectInfo.hub);\r\n\r\n return self.viewModels[iVMId];\r\n },\r\n\r\n // Get all view models.\r\n getViewModels: function() {\r\n const self = dotnetify.react;\r\n return Object.keys(self.viewModels).map(vmId => self.viewModels[vmId]);\r\n },\r\n\r\n _responseVM: function(iVMId, iVMData) {\r\n const self = dotnetify.react;\r\n\r\n if (self.viewModels.hasOwnProperty(iVMId)) {\r\n const vm = self.viewModels[iVMId];\r\n dotnetify.checkServerSideException(iVMId, iVMData, vm.$exceptionHandler);\r\n vm.$update(iVMData);\r\n return true;\r\n }\r\n return false;\r\n }\r\n};\r\n\r\ndotnetify.addVMAccessor(dotnetify.react.getViewModels);\r\n\r\nexport default dotnetify;\r\n","/* \r\nCopyright 2017 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\n\r\nconst window = window || global || {};\r\n\r\nconst jQueryDeferred = require('jquery-deferred');\r\nconst jQueryShim = jQueryDeferred.extend(\r\n function(selector) {\r\n if (selector === window || selector.document)\r\n return {\r\n 0: selector,\r\n on: function(iEvent, iHandler) {\r\n window.addEventListener(iEvent, iHandler);\r\n },\r\n bind: function(iEvent, iHandler) {\r\n window.addEventListener(iEvent, iHandler, false);\r\n },\r\n unbind: function(iEvent, iHandler) {\r\n window.removeEventListener(iEvent, iHandler, false);\r\n }\r\n };\r\n\r\n if (typeof selector !== 'string') selector.events = selector.events || {};\r\n\r\n return {\r\n 0: selector,\r\n\r\n bind: function(iEvent, iHandler) {\r\n var event = selector.events[iEvent] || [];\r\n event.push(iHandler);\r\n selector.events[iEvent] = event;\r\n },\r\n\r\n unbind: function(iEvent, iHandler) {\r\n var handlers = selector.events[iEvent] || [];\r\n if (iHandler) {\r\n var idx = handlers.indexOf(iHandler);\r\n if (idx !== -1) handlers.splice(idx, 1);\r\n }\r\n else handlers = [];\r\n selector.events[iEvent] = handlers;\r\n },\r\n\r\n triggerHandler: function(iEvent, iArgs) {\r\n var handlers = selector.events[iEvent] || [];\r\n var args = [ { type: iEvent } ];\r\n if (Array.isArray(iArgs))\r\n iArgs.forEach(function(arg) {\r\n args.push(arg);\r\n });\r\n else if (iArgs) args.push(iArgs);\r\n handlers.forEach(function(handler) {\r\n handler.apply(this, args);\r\n });\r\n },\r\n\r\n load: function(iUrl, iArgs, iHandler) {\r\n var request = new window.XMLHttpRequest();\r\n request.open('GET', iUrl, true);\r\n request.onload = function() {\r\n if (request.status >= 200 && request.status < 400) {\r\n var response = request.responseText;\r\n document.querySelector(selector).innerHTML = response;\r\n iHandler.call(document.querySelector(selector));\r\n }\r\n };\r\n request.send();\r\n return {\r\n abort: function(reason) {\r\n return request.abort(reason);\r\n }\r\n };\r\n }\r\n };\r\n },\r\n jQueryDeferred,\r\n {\r\n support: { cors: true },\r\n\r\n trim: function(iStr) {\r\n return typeof iStr === 'string' ? iStr.trim() : iStr;\r\n },\r\n\r\n inArray: function(iArray, iItem) {\r\n return iArray.indexOf(iItem) !== -1;\r\n },\r\n\r\n makeArray: function makeArray(iArray) {\r\n return [].slice.call(iArray, 0);\r\n },\r\n\r\n merge: function(iArray1, iArray2) {\r\n Array.prototype.push.apply(iArray1, iArray2);\r\n return iArray1;\r\n },\r\n\r\n isEmptyObject: function(iObj) {\r\n return !iObj || Object.keys(iObj).length === 0;\r\n },\r\n\r\n ajax: function(iOptions) {\r\n var request = new window.XMLHttpRequest();\r\n request.onreadystatechange = function() {\r\n if (request.readyState !== 4) return;\r\n if (request.status === 200 && !request._hasError) {\r\n try {\r\n iOptions.success && iOptions.success(JSON.parse(request.responseText));\r\n } catch (error) {\r\n iOptions.success && iOptions.success(request.responseText);\r\n }\r\n }\r\n else iOptions.error && iOptions.error(request);\r\n };\r\n request.open(iOptions.type, iOptions.url);\r\n request.setRequestHeader('content-type', iOptions.contentType);\r\n request.send(iOptions.data.data && 'data=' + iOptions.data.data);\r\n return {\r\n abort: function(reason) {\r\n return request.abort(reason);\r\n }\r\n };\r\n },\r\n\r\n getScript: function(iUrl, iSuccess) {\r\n var done = false;\r\n var promise = jQueryDeferred.Deferred();\r\n var head = document.getElementsByTagName('head')[0];\r\n var script = document.createElement('script');\r\n script.src = iUrl;\r\n script.onload = script.onreadystatechange = function() {\r\n if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) {\r\n done = true;\r\n script.onload = script.onreadystatechange = null;\r\n head.removeChild(script);\r\n if (typeof iSuccess === 'function') iSuccess();\r\n promise.resolve();\r\n }\r\n };\r\n head.appendChild(script);\r\n return promise;\r\n }\r\n }\r\n);\r\n\r\nif (typeof window !== 'undefined') window.jQuery = window.jQuery || jQueryShim;\r\n\r\nif (typeof exports === 'object' && typeof module === 'object') module.exports = jQueryShim;\r\n","/* \r\nCopyright 2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nconst window = window || global || {};\r\n\r\nclass utils {\r\n // Trim slashes from start and end of string.\r\n trim(iStr) {\r\n if (typeof iStr !== 'string') return '';\r\n\r\n while (iStr.indexOf('/', iStr.length - 1) >= 0) iStr = iStr.substr(0, iStr.length - 1);\r\n while (iStr.indexOf('/') == 0) iStr = iStr.substr(1, iStr.length - 1);\r\n return iStr;\r\n }\r\n\r\n // Match two strings case-insensitive.\r\n equal(iStr1, iStr2) {\r\n return iStr1 != null && iStr2 != null && iStr1.toLowerCase() == iStr2.toLowerCase();\r\n }\r\n\r\n // Whether the string starts or ends with a value.\r\n startsWith(iStr, iValue) {\r\n return iStr.toLowerCase().slice(0, iValue.length) == iValue.toLowerCase();\r\n }\r\n\r\n endsWith(iStr, iValue) {\r\n return iValue == '' || iStr.toLowerCase().slice(-iValue.length) == iValue.toLowerCase();\r\n }\r\n\r\n // Dispatch event with IE polyfill.\r\n dispatchEvent(iEvent) {\r\n if (typeof Event === 'function') window.dispatchEvent(new Event(iEvent));\r\n else {\r\n var event = document.createEvent('CustomEvent');\r\n event.initEvent(iEvent, true, true);\r\n window.dispatchEvent(event);\r\n }\r\n }\r\n\r\n grep(iArray, iFilter) {\r\n return Array.isArray(iArray) ? iArray.filter(iFilter) : [];\r\n }\r\n}\r\n\r\nexport const createEventEmitter = _ => {\r\n let subscribers = [];\r\n return {\r\n emit(...args) {\r\n let handled = false;\r\n subscribers.forEach(subscriber => {\r\n handled = subscriber(...args) || handled;\r\n });\r\n return handled;\r\n },\r\n\r\n subscribe(subscriber) {\r\n !subscribers.includes(subscriber) && subscribers.push(subscriber);\r\n return () => (subscribers = subscribers.filter(x => x !== subscriber));\r\n }\r\n };\r\n};\r\n\r\nexport default new utils();\r\n","module.exports = __WEBPACK_EXTERNAL_MODULE__4__;","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport $ from '../libs/jquery-shim';\r\n\r\nconst window = window || global || {};\r\n\r\n// Client-side view model that acts as a proxy of the server view model.\r\nexport default class dotnetifyVM {\r\n // iVMId - identifies the view model.\r\n // iComponent - component object.\r\n // iOptions - Optional configuration options:\r\n // getState: state accessor.\r\n // setState: state mutator.\r\n // vmArg: view model arguments.\r\n // headers: request headers, for things like authentication token.\r\n // exceptionHandler: called when receiving server-side exception.\r\n // iDotNetify - framework-specific dotNetify library.\r\n // iHub - hub connection.\r\n constructor(iVMId, iComponent, iOptions, iDotNetify, iHub) {\r\n this.$vmId = iVMId;\r\n this.$component = iComponent;\r\n this.$options = iOptions || {};\r\n this.$vmArg = iOptions && iOptions['vmArg'];\r\n this.$headers = iOptions && iOptions['headers'];\r\n this.$exceptionHandler = iOptions && iOptions['exceptionHandler'];\r\n this.$requested = false;\r\n this.$loaded = false;\r\n this.$itemKey = {};\r\n this.$dotnetify = iDotNetify;\r\n this.$hub = iHub;\r\n\r\n let getState = iOptions && iOptions['getState'];\r\n let setState = iOptions && iOptions['setState'];\r\n getState = typeof getState === 'function' ? getState : () => iComponent.state;\r\n setState = typeof setState === 'function' ? setState : state => iComponent.setState(state);\r\n\r\n this.State = state => (typeof state === 'undefined' ? getState() : setState(state));\r\n this.Props = prop => this.$component.props && this.$component.props[prop];\r\n\r\n const vmArg = this.Props('vmArg');\r\n if (vmArg) this.$vmArg = $.extend(this.$vmArg, vmArg);\r\n\r\n // Inject plugin functions into this view model.\r\n this.$getPlugins().map(plugin => (typeof plugin['$inject'] == 'function' ? plugin.$inject(this) : null));\r\n }\r\n\r\n // Disposes the view model, both here and on the server.\r\n $destroy() {\r\n // Call any plugin's $destroy function if provided.\r\n this.$getPlugins().map(plugin => (typeof plugin['$destroy'] == 'function' ? plugin.$destroy.apply(this) : null));\r\n\r\n if (this.$hub.isConnected) {\r\n try {\r\n this.$hub.disposeVM(this.$vmId);\r\n } catch (ex) {\r\n this.$dotnetify.controller.handleConnectionStateChanged('error', ex, this.$hub);\r\n }\r\n }\r\n\r\n delete this.$dotnetify.viewModels[this.$vmId];\r\n }\r\n\r\n // Dispatches a value to the server view model.\r\n // iValue - Value to dispatch.\r\n $dispatch(iValue) {\r\n if (this.$hub.isConnected) {\r\n const controller = this.$dotnetify.controller;\r\n try {\r\n this.$hub.updateVM(this.$vmId, iValue);\r\n\r\n if (controller.debug) {\r\n console.log('[' + this.$vmId + '] sent> ');\r\n console.log(iValue);\r\n\r\n controller.debugFn && controller.debugFn(this.$vmId, 'sent', iValue);\r\n }\r\n } catch (ex) {\r\n controller.handleConnectionStateChanged('error', ex, this.$hub);\r\n }\r\n }\r\n }\r\n\r\n // Dispatches a state value to the server view model.\r\n // iValue - State value to dispatch.\r\n $dispatchListState(iValue) {\r\n for (var listName in iValue) {\r\n const key = this.$itemKey[listName];\r\n if (!key) {\r\n console.error(`[${this.$vmId}] missing item key for '${listName}'; add ${listName}_itemKey property to the view model.`);\r\n return;\r\n }\r\n var item = iValue[listName];\r\n if (!item[key]) {\r\n console.error(`[${this.$vmId}] couldn't dispatch data from '${listName}' due to missing property '${key}'.`);\r\n console.error(item);\r\n return;\r\n }\r\n\r\n Object.keys(item).forEach(prop => {\r\n if (prop != key) {\r\n let state = {};\r\n state[listName + '.$' + item[key] + '.' + prop] = item[prop];\r\n this.$dispatch(state);\r\n }\r\n });\r\n this.$updateList(listName, item);\r\n }\r\n }\r\n\r\n $getPlugins() {\r\n return Object.keys(this.$dotnetify.plugins).map(id => this.$dotnetify.plugins[id]);\r\n }\r\n\r\n // Preprocess view model update from the server before we set the state.\r\n $preProcess(iVMUpdate) {\r\n const vm = this;\r\n\r\n for (var prop in iVMUpdate) {\r\n // Look for property that end with '_add'. Interpret the value as a list item to be added\r\n // to an existing list whose property name precedes that suffix.\r\n var match = /(.*)_add/.exec(prop);\r\n if (match != null) {\r\n var listName = match[1];\r\n if (Array.isArray(this.State()[listName])) vm.$addList(listName, iVMUpdate[prop]);\r\n else console.error('unable to resolve ' + prop);\r\n delete iVMUpdate[prop];\r\n continue;\r\n }\r\n\r\n // Look for property that end with '_update'. Interpret the value as a list item to be updated\r\n // to an existing list whose property name precedes that suffix.\r\n var match = /(.*)_update/.exec(prop);\r\n if (match != null) {\r\n var listName = match[1];\r\n if (Array.isArray(this.State()[listName])) vm.$updateList(listName, iVMUpdate[prop]);\r\n else console.error('[' + this.$vmId + \"] '\" + listName + \"' is not found or not an array.\");\r\n delete iVMUpdate[prop];\r\n continue;\r\n }\r\n\r\n // Look for property that end with '_remove'. Interpret the value as a list item key to remove\r\n // from an existing list whose property name precedes that suffix.\r\n var match = /(.*)_remove/.exec(prop);\r\n if (match != null) {\r\n var listName = match[1];\r\n if (Array.isArray(this.State()[listName])) {\r\n var key = this.$itemKey[listName];\r\n if (key != null)\r\n vm.$removeList(listName, function(i) {\r\n return i[key] == iVMUpdate[prop];\r\n });\r\n else console.error(`[${this.$vmId}] missing item key for '${listName}'; add ${listName}_itemKey property to the view model.`);\r\n }\r\n else console.error(`[${this.$vmId}] '${listName}' is not found or not an array.`);\r\n delete iVMUpdate[prop];\r\n continue;\r\n }\r\n\r\n // Look for property that end with '_itemKey'. Interpret the value as the property name that will\r\n // uniquely identify items in the list.\r\n var match = /(.*)_itemKey/.exec(prop);\r\n if (match != null) {\r\n var listName = match[1];\r\n var itemKey = {};\r\n itemKey[listName] = iVMUpdate[prop];\r\n vm.$setItemKey(itemKey);\r\n delete iVMUpdate[prop];\r\n continue;\r\n }\r\n }\r\n }\r\n\r\n // Requests state from the server view model.\r\n $request() {\r\n if (this.$hub.isConnected) this.$hub.requestVM(this.$vmId, { $vmArg: this.$vmArg, $headers: this.$headers });\r\n this.$requested = true;\r\n }\r\n\r\n // Updates state from the server view model to the view.\r\n // iVMData - Serialized state from the server.\r\n $update(iVMData) {\r\n const controller = this.$dotnetify.controller;\r\n if (controller.debug) {\r\n console.log('[' + this.$vmId + '] received> ');\r\n console.log(JSON.parse(iVMData));\r\n\r\n controller.debugFn && controller.debugFn(this.$vmId, 'received', JSON.parse(iVMData));\r\n }\r\n let vmData = JSON.parse(iVMData);\r\n this.$preProcess(vmData);\r\n\r\n let state = this.State();\r\n state = $.extend({}, state, vmData);\r\n this.State(state);\r\n\r\n if (!this.$loaded) this.$onLoad();\r\n else this.$onUpdate(vmData);\r\n }\r\n\r\n // Handles initial view model load event.\r\n $onLoad() {\r\n this.$getPlugins().map(plugin => (typeof plugin['$ready'] == 'function' ? plugin.$ready.apply(this) : null));\r\n this.$loaded = true;\r\n }\r\n\r\n // Handles view model update event.\r\n $onUpdate(vmData) {\r\n this.$getPlugins().map(plugin => (typeof plugin['$update'] == 'function' ? plugin.$update.apply(this, [ vmData ]) : null));\r\n }\r\n\r\n // *** CRUD Functions ***\r\n\r\n // Sets items key to identify individual items in a list.\r\n // Accepts object literal: { \"\": \"\", ... }\r\n $setItemKey(iItemKey) {\r\n Object.assign(this.$itemKey, iItemKey);\r\n }\r\n\r\n //// Adds a new item to a state array.\r\n $addList(iListName, iNewItem) {\r\n // Check if the list already has an item with the same key. If so, replace it.\r\n var key = this.$itemKey[iListName];\r\n if (key != null) {\r\n if (!iNewItem.hasOwnProperty(key)) {\r\n console.error(`[${this.$vmId}] couldn't add item to '${iListName}' due to missing property '${key}'.`);\r\n return;\r\n }\r\n var match = this.State()[iListName].filter(function(i) {\r\n return i[key] == iNewItem[key];\r\n });\r\n if (match.length > 0) {\r\n console.error(`[${this.$vmId}] couldn't add item to '${iListName}' because the key already exists.`);\r\n return;\r\n }\r\n }\r\n\r\n let items = this.State()[iListName];\r\n items.push(iNewItem);\r\n\r\n let state = {};\r\n state[iListName] = items;\r\n this.State(state);\r\n }\r\n\r\n // Removes an item from a state array.\r\n $removeList(iListName, iFilter) {\r\n let state = {};\r\n state[iListName] = this.State()[iListName].filter(i => !iFilter(i));\r\n this.State(state);\r\n }\r\n\r\n //// Updates existing item to an observable array.\r\n $updateList(iListName, iNewItem) {\r\n // Check if the list already has an item with the same key. If so, update it.\r\n let key = this.$itemKey[iListName];\r\n if (key != null) {\r\n if (!iNewItem.hasOwnProperty(key)) {\r\n console.error(`[${this.$vmId}] couldn't update item to '${iListName}' due to missing property '${key}'.`);\r\n return;\r\n }\r\n var state = {};\r\n state[iListName] = this.State()[iListName].map(function(i) {\r\n return i[key] == iNewItem[key] ? $.extend(i, iNewItem) : i;\r\n });\r\n this.State(state);\r\n }\r\n else console.error(`[${this.$vmId}] missing item key for '${iListName}'; add '${iListName}_itemKey' property to the view model.`);\r\n }\r\n}\r\n","/* \r\nimport { dotnetify } from 'dotnetify/dist/dotnetify-ko';\r\nCopyright 2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport { createEventEmitter } from '../libs/utils';\r\n\r\nconst window = window || global || {};\r\n\r\nconst normalize = iVMId => iVMId && iVMId.replace(/\\./g, '_');\r\nconst hasLocalVM = iVMId => {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n return typeof vm == 'object' && typeof vm.onConnect == 'function';\r\n};\r\n\r\nexport class dotNetifyHubLocal {\r\n mode = 'local';\r\n debug = false;\r\n isConnected = false;\r\n isHubStarted = false;\r\n\r\n responseEvent = createEventEmitter();\r\n reconnectedEvent = createEventEmitter();\r\n connectedEvent = createEventEmitter();\r\n connectionFailedEvent = createEventEmitter();\r\n\r\n startHub() {\r\n this.isConnected = true;\r\n this.isHubStarted = true;\r\n this.connectedEvent.emit();\r\n }\r\n\r\n requestVM(iVMId, iVMArgs) {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n\r\n if (typeof vm === 'object' && typeof vm.onConnect == 'function') {\r\n if (this.debug) console.log(`[${iVMId}] *** local mode ***`);\r\n\r\n vm.$pushUpdate = update => {\r\n if (typeof update == 'object') update = JSON.stringify(update);\r\n setTimeout(() => this.responseEvent.emit(iVMId, update));\r\n };\r\n\r\n vm.$pushUpdate(vm.onConnect(iVMArgs) || {});\r\n }\r\n }\r\n\r\n updateVM(iVMId, iValue) {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n\r\n if (typeof vm === 'object' && typeof vm.onDispatch == 'function') {\r\n let state = vm.onDispatch(iValue);\r\n if (state) {\r\n if (typeof state == 'object') state = JSON.stringify(state);\r\n setTimeout(() => this.responseEvent.emit(iVMId, state));\r\n }\r\n }\r\n }\r\n\r\n disposeVM(iVMId) {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n\r\n if (typeof vm === 'object' && typeof vm.onDestroy == 'function') {\r\n vm.onDestroy(iVMId);\r\n }\r\n }\r\n}\r\n\r\nexport default new dotNetifyHubLocal();\r\nexport { hasLocalVM };\r\n","module.exports = __WEBPACK_EXTERNAL_MODULE__7__;","/**\n* jQuery core object.\n*\n* Worker with jQuery deferred\n*\n* Code from: https://github.com/jquery/jquery/blob/master/src/core.js\n*\n*/\n\nvar jQuery = module.exports = {\n\ttype: type\n\t, isArray: isArray\n\t, isFunction: isFunction\n\t, isPlainObject: isPlainObject\n\t, each: each\n\t, extend: extend\n\t, noop: function() {}\n};\n\nvar toString = Object.prototype.toString;\n\nvar class2type = {};\n// Populate the class2type map\n\"Boolean Number String Function Array Date RegExp Object\".split(\" \").forEach(function(name) {\n\tclass2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n});\n\n\nfunction type( obj ) {\n\treturn obj == null ?\n\t\tString( obj ) :\n\t\t\tclass2type[ toString.call(obj) ] || \"object\";\n}\n\nfunction isFunction( obj ) {\n\treturn jQuery.type(obj) === \"function\";\n}\n\nfunction isArray( obj ) {\n\treturn jQuery.type(obj) === \"array\";\n}\n\nfunction each( object, callback, args ) {\n\tvar name, i = 0,\n\tlength = object.length,\n\tisObj = length === undefined || isFunction( object );\n\n\tif ( args ) {\n\t\tif ( isObj ) {\n\t\t\tfor ( name in object ) {\n\t\t\t\tif ( callback.apply( object[ name ], args ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( ; i < length; ) {\n\t\t\t\tif ( callback.apply( object[ i++ ], args ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// A special, fast, case for the most common use of each\n\t} else {\n\t\tif ( isObj ) {\n\t\t\tfor ( name in object ) {\n\t\t\t\tif ( callback.call( object[ name ], name, object[ name ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( ; i < length; ) {\n\t\t\t\tif ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn object;\n}\n\nfunction isPlainObject( obj ) {\n\t// Must be an Object.\n\tif ( !obj || jQuery.type(obj) !== \"object\" ) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\nfunction extend() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\ttarget = arguments[0] || {},\n\ti = 1,\n\tlength = arguments.length,\n\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif ( typeof target === \"boolean\" ) {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\n\t// Handle case when target is a string or something (possible in deep copy)\n\tif ( typeof target !== \"object\" && !jQuery.isFunction(target) ) {\n\t\ttarget = {};\n\t}\n\n\t// extend jQuery itself if only one argument is passed\n\tif ( length === i ) {\n\t\ttarget = this;\n\t\t--i;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\t\t// Only deal with non-null/undefined values\n\t\tif ( (options = arguments[ i ]) != null ) {\n\t\t\t// Extend the base object\n\t\t\tfor ( name in options ) {\n\t\t\t\tsrc = target[ name ];\n\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif ( target === copy ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {\n\t\t\t\t\tif ( copyIsArray ) {\n\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\tclone = src && jQuery.isArray(src) ? src : [];\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclone = src && jQuery.isPlainObject(src) ? src : {};\n\t\t\t\t\t}\n\n\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\n\n","var jQuery = module.exports = require(\"./jquery-core.js\"),\n\tcore_rspace = /\\s+/;\n/**\n* jQuery Callbacks\n*\n* Code from: https://github.com/jquery/jquery/blob/master/src/callbacks.js\n*\n*/\n\n\n// String to Object options format cache\nvar optionsCache = {};\n\n// Convert String-formatted options into Object-formatted ones and store in cache\nfunction createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.split( core_rspace ), function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n\t// Convert options from String-formatted to Object-formatted if needed\n\t// (we check in cache first)\n\toptions = typeof options === \"string\" ?\n\t\t( optionsCache[ options ] || createOptions( options ) ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Last fire value (for non-forgettable lists)\n\t\tmemory,\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\t\t// Flag to know if list is currently firing\n\t\tfiring,\n\t\t// First callback to fire (used internally by add and fireWith)\n\t\tfiringStart,\n\t\t// End of the loop when firing\n\t\tfiringLength,\n\t\t// Index of currently firing callback (modified by remove if needed)\n\t\tfiringIndex,\n\t\t// Actual callback list\n\t\tlist = [],\n\t\t// Stack of fire calls for repeatable lists\n\t\tstack = !options.once && [],\n\t\t// Fire callbacks\n\t\tfire = function( data ) {\n\t\t\tmemory = options.memory && data;\n\t\t\tfired = true;\n\t\t\tfiringIndex = firingStart || 0;\n\t\t\tfiringStart = 0;\n\t\t\tfiringLength = list.length;\n\t\t\tfiring = true;\n\t\t\tfor ( ; list && firingIndex < firingLength; firingIndex++ ) {\n\t\t\t\tif ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {\n\t\t\t\t\tmemory = false; // To prevent further calls using add\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfiring = false;\n\t\t\tif ( list ) {\n\t\t\t\tif ( stack ) {\n\t\t\t\t\tif ( stack.length ) {\n\t\t\t\t\t\tfire( stack.shift() );\n\t\t\t\t\t}\n\t\t\t\t} else if ( memory ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t} else {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t// Actual Callbacks object\n\t\tself = {\n\t\t\t// Add a callback or a collection of callbacks to the list\n\t\t\tadd: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\t// First, we save the current length\n\t\t\t\t\tvar start = list.length;\n\t\t\t\t\t(function add( args ) {\n\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {\n\t\t\t\t\t\t\tvar type = jQuery.type( arg );\n\t\t\t\t\t\t\tif ( type === \"function\" ) {\n\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {\n\t\t\t\t\t\t\t\t\tlist.push( arg );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if ( arg && arg.length && type !== \"string\" ) {\n\t\t\t\t\t\t\t\t// Inspect recursively\n\t\t\t\t\t\t\t\tadd( arg );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t})( arguments );\n\t\t\t\t\t// Do we need to add the callbacks to the\n\t\t\t\t\t// current firing batch?\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tfiringLength = list.length;\n\t\t\t\t\t// With memory, if we're not firing then\n\t\t\t\t\t// we should call right away\n\t\t\t\t\t} else if ( memory ) {\n\t\t\t\t\t\tfiringStart = start;\n\t\t\t\t\t\tfire( memory );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\t\tvar index;\n\t\t\t\t\t\twhile( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\t\tlist.splice( index, 1 );\n\t\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\t\t\tif ( index <= firingLength ) {\n\t\t\t\t\t\t\t\t\tfiringLength--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\t\t\tfiringIndex--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Control if a given callback is in the list\n\t\t\thas: function( fn ) {\n\t\t\t\treturn jQuery.inArray( fn, list ) > -1;\n\t\t\t},\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tlist = [];\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Have the list do nothing anymore\n\t\t\tdisable: function() {\n\t\t\t\tlist = stack = memory = undefined;\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it disabled?\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\t\t\t// Lock the list in its current state\n\t\t\tlock: function() {\n\t\t\t\tstack = undefined;\n\t\t\t\tif ( !memory ) {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it locked?\n\t\t\tlocked: function() {\n\t\t\t\treturn !stack;\n\t\t\t},\n\t\t\t// Call all callbacks with the given context and arguments\n\t\t\tfireWith: function( context, args ) {\n\t\t\t\targs = args || [];\n\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\tif ( list && ( !fired || stack ) ) {\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tstack.push( args );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfire( args );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Call all the callbacks with the given arguments\n\t\t\tfire: function() {\n\t\t\t\tself.fireWith( this, arguments );\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// To know if the callbacks have already been called at least once\n\t\t\tfired: function() {\n\t\t\t\treturn !!fired;\n\t\t\t}\n\t\t};\n\n\treturn self;\n};\n\n","\n/*!\n* jquery-deferred\n* Copyright(c) 2011 Hidden \n* MIT Licensed\n*/\n\n/**\n* Library version.\n*/\n\nvar jQuery = module.exports = require(\"./jquery-callbacks.js\"),\n\tcore_slice = Array.prototype.slice;\n\n/**\n* jQuery deferred\n*\n* Code from: https://github.com/jquery/jquery/blob/master/src/deferred.js\n* Doc: http://api.jquery.com/category/deferred-object/\n*\n*/\n\njQuery.extend({\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\t\t\t\t// action, add listener, listener list, final state\n\t\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks(\"once memory\"), \"resolved\" ],\n\t\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks(\"once memory\"), \"rejected\" ],\n\t\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks(\"memory\") ]\n\t\t\t],\n\t\t\tstate = \"pending\",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\tthen: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\t\t\t\t\treturn jQuery.Deferred(function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\t\t\t\t\tvar action = tuple[ 0 ],\n\t\t\t\t\t\t\t\tfn = fns[ i ];\n\t\t\t\t\t\t\t// deferred[ done | fail | progress ] for forwarding actions to newDefer\n\t\t\t\t\t\t\tdeferred[ tuple[1] ]( jQuery.isFunction( fn ) ?\n\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\tvar returned = fn.apply( this, arguments );\n\t\t\t\t\t\t\t\t\tif ( returned && jQuery.isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject )\n\t\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tnewDefer[ action + \"With\" ]( this === deferred ? newDefer : this, [ returned ] );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} :\n\t\t\t\t\t\t\t\tnewDefer[ action ]\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tfns = null;\n\t\t\t\t\t}).promise();\n\t\t\t\t},\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Keep pipe for back-compat\n\t\tpromise.pipe = promise.then;\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 3 ];\n\n\t\t\t// promise[ done | fail | progress ] = list.add\n\t\t\tpromise[ tuple[1] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(function() {\n\t\t\t\t\t// state = [ resolved | rejected ]\n\t\t\t\t\tstate = stateString;\n\n\t\t\t\t// [ reject_list | resolve_list ].disable; progress_list.lock\n\t\t\t\t}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );\n\t\t\t}\n\n\t\t\t// deferred[ resolve | reject | notify ] = list.fire\n\t\t\tdeferred[ tuple[0] ] = list.fire;\n\t\t\tdeferred[ tuple[0] + \"With\" ] = list.fireWith;\n\t\t});\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( subordinate /* , ..., subordinateN */ ) {\n\t\tvar i = 0,\n\t\t\tresolveValues = core_slice.call( arguments ),\n\t\t\tlength = resolveValues.length,\n\n\t\t\t// the count of uncompleted subordinates\n\t\t\tremaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,\n\n\t\t\t// the master Deferred. If resolveValues consist of only a single Deferred, just use that.\n\t\t\tdeferred = remaining === 1 ? subordinate : jQuery.Deferred(),\n\n\t\t\t// Update function for both resolve and progress values\n\t\t\tupdateFunc = function( i, contexts, values ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tcontexts[ i ] = this;\n\t\t\t\t\tvalues[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;\n\t\t\t\t\tif( values === progressValues ) {\n\t\t\t\t\t\tdeferred.notifyWith( contexts, values );\n\t\t\t\t\t} else if ( !( --remaining ) ) {\n\t\t\t\t\t\tdeferred.resolveWith( contexts, values );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t},\n\n\t\t\tprogressValues, progressContexts, resolveContexts;\n\n\t\t// add listeners to Deferred subordinates; treat others as resolved\n\t\tif ( length > 1 ) {\n\t\t\tprogressValues = new Array( length );\n\t\t\tprogressContexts = new Array( length );\n\t\t\tresolveContexts = new Array( length );\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {\n\t\t\t\t\tresolveValues[ i ].promise()\n\t\t\t\t\t\t.done( updateFunc( i, resolveContexts, resolveValues ) )\n\t\t\t\t\t\t.fail( deferred.reject )\n\t\t\t\t\t\t.progress( updateFunc( i, progressContexts, progressValues ) );\n\t\t\t\t} else {\n\t\t\t\t\t--remaining;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// if we're not waiting on anything, resolve the master\n\t\tif ( !remaining ) {\n\t\t\tdeferred.resolveWith( resolveContexts, resolveValues );\n\t\t}\n\n\t\treturn deferred.promise();\n\t}\n});\n","\nmodule.exports = require('./lib/jquery-deferred');","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","/* \r\nCopyright 2017-2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport { createEventEmitter } from '../libs/utils';\r\nimport jQueryShim from '../libs/jquery-shim';\r\nconst signalRNetCore = require('@aspnet/signalr');\r\nlet $ = jQueryShim;\r\n\r\nconst window = window || global || {};\r\n\r\nexport class dotnetifyHubFactory {\r\n static create() {\r\n let dotnetifyHub = {\r\n version: '2.0.0',\r\n type: null,\r\n\r\n reconnectDelay: [ 2, 5, 10 ],\r\n reconnectRetry: null,\r\n\r\n _startInfo: null,\r\n _init: false,\r\n\r\n // Hub server methods.\r\n requestVM: (iVMId, iOptions) => dotnetifyHub.server.request_VM(iVMId, iOptions),\r\n updateVM: (iVMId, iValue) => dotnetifyHub.server.update_VM(iVMId, iValue),\r\n disposeVM: iVMId => dotnetifyHub.server.dispose_VM(iVMId),\r\n\r\n // Connection events.\r\n responseEvent: createEventEmitter(),\r\n reconnectedEvent: createEventEmitter(),\r\n connectedEvent: createEventEmitter(),\r\n connectionFailedEvent: createEventEmitter(),\r\n\r\n get isHubStarted() {\r\n return !!this._startInfo;\r\n },\r\n\r\n // Starts connection with SignalR hub server.\r\n startHub(hubOptions, doneHandler, failHandler, forceRestart) {\r\n const _doneHandler = () => {\r\n if (typeof doneHandler == 'function') doneHandler();\r\n this.connectedEvent.emit();\r\n };\r\n const _failHandler = ex => {\r\n if (typeof failHander == 'function') failHandler();\r\n this.connectionFailedEvent.emit();\r\n throw ex;\r\n };\r\n\r\n if (this._startInfo === null || forceRestart) {\r\n try {\r\n this._startInfo = this.start(hubOptions).done(_doneHandler).fail(_failHandler);\r\n } catch (err) {\r\n this._startInfo = null;\r\n }\r\n }\r\n else {\r\n try {\r\n this._startInfo.done(_doneHandler);\r\n } catch (err) {\r\n this._startInfo = null;\r\n return this.startHub(hubOptions, doneHandler, failHandler, forceRestart);\r\n }\r\n }\r\n }\r\n };\r\n\r\n // Configures connection to SignalR hub server.\r\n dotnetifyHub.init = function(iHubPath, iServerUrl, signalR) {\r\n if (dotnetifyHub._init) return;\r\n\r\n dotnetifyHub._init = true;\r\n signalR = signalR || window.signalR || signalRNetCore;\r\n\r\n // SignalR .NET Core.\r\n if (signalR && signalR.HubConnection) {\r\n dotnetifyHub.type = 'netcore';\r\n\r\n Object.defineProperty(dotnetifyHub, 'isConnected', {\r\n get: function() {\r\n return dotnetifyHub._connection && dotnetifyHub._connection.connection.connectionState === 1;\r\n }\r\n });\r\n\r\n dotnetifyHub = $.extend(dotnetifyHub, {\r\n hubPath: iHubPath || '/dotnetify',\r\n url: iServerUrl,\r\n\r\n // Internal variables. Do not modify!\r\n _connection: null,\r\n _reconnectCount: 0,\r\n _startDoneHandler: null,\r\n _startFailHandler: null,\r\n _disconnectedHandler: function() {},\r\n _stateChangedHandler: function(iNewState) {},\r\n\r\n _onDisconnected: function() {\r\n dotnetifyHub._changeState(4);\r\n dotnetifyHub._disconnectedHandler();\r\n },\r\n\r\n _changeState: function(iNewState) {\r\n if (iNewState == 1) dotnetifyHub._reconnectCount = 0;\r\n\r\n let stateText = { 0: 'connecting', 1: 'connected', 2: 'reconnecting', 4: 'disconnected', 99: 'terminated' };\r\n dotnetifyHub._stateChangedHandler(stateText[iNewState]);\r\n },\r\n\r\n _startConnection: function(iHubOptions, iTransportArray) {\r\n let url = dotnetifyHub.url ? dotnetifyHub.url + dotnetifyHub.hubPath : dotnetifyHub.hubPath;\r\n let hubOptions = {};\r\n Object.keys(iHubOptions).forEach(function(key) {\r\n hubOptions[key] = iHubOptions[key];\r\n });\r\n hubOptions.transport = iTransportArray.shift();\r\n\r\n dotnetifyHub._connection = new signalR.HubConnectionBuilder().withUrl(url, hubOptions).build();\r\n dotnetifyHub._connection.on('response_vm', dotnetifyHub.client.response_VM);\r\n dotnetifyHub._connection.onclose(dotnetifyHub._onDisconnected);\r\n\r\n let promise = dotnetifyHub._connection\r\n .start()\r\n .then(function() {\r\n dotnetifyHub._changeState(1);\r\n })\r\n .catch(function() {\r\n // If failed to start, fallback to the next transport.\r\n if (iTransportArray.length > 0) dotnetifyHub._startConnection(iHubOptions, iTransportArray);\r\n else dotnetifyHub._onDisconnected();\r\n });\r\n\r\n if (typeof dotnetifyHub._startDoneHandler === 'function')\r\n promise.then(dotnetifyHub._startDoneHandler).catch(dotnetifyHub._startFailHandler || function() {});\r\n return promise;\r\n },\r\n\r\n start: function(iHubOptions) {\r\n dotnetifyHub._startDoneHandler = null;\r\n dotnetifyHub._startFailHandler = null;\r\n\r\n // Map the transport option.\r\n let transport = [ 0 ];\r\n let transportOptions = { webSockets: 0, serverSentEvents: 1, longPolling: 2 };\r\n if (iHubOptions && Array.isArray(iHubOptions.transport))\r\n transport = iHubOptions.transport.map(function(arg) {\r\n return transportOptions[arg];\r\n });\r\n\r\n let promise = dotnetifyHub._startConnection(iHubOptions, transport);\r\n return {\r\n done: function(iHandler) {\r\n dotnetifyHub._startDoneHandler = iHandler;\r\n promise.then(iHandler).catch(function(error) {\r\n throw error;\r\n });\r\n return this;\r\n },\r\n fail: function(iHandler) {\r\n dotnetifyHub._startFailHandler = iHandler;\r\n promise.catch(iHandler);\r\n return this;\r\n }\r\n };\r\n },\r\n\r\n disconnected: function(iHandler) {\r\n if (typeof iHandler === 'function') dotnetifyHub._disconnectedHandler = iHandler;\r\n },\r\n\r\n stateChanged: function(iHandler) {\r\n if (typeof iHandler === 'function') dotnetifyHub._stateChangedHandler = iHandler;\r\n },\r\n\r\n reconnect: function(iStartHubFunc) {\r\n if (typeof iStartHubFunc === 'function') {\r\n // Only attempt reconnect if the specified retry hasn't been exceeded.\r\n if (!dotnetifyHub.reconnectRetry || dotnetifyHub._reconnectCount < dotnetifyHub.reconnectRetry) {\r\n // Determine reconnect delay from the specified configuration array.\r\n let delay =\r\n dotnetifyHub._reconnectCount < dotnetifyHub.reconnectDelay.length\r\n ? dotnetifyHub.reconnectDelay[dotnetifyHub._reconnectCount]\r\n : dotnetifyHub.reconnectDelay[dotnetifyHub.reconnectDelay.length - 1];\r\n\r\n dotnetifyHub._reconnectCount++;\r\n\r\n setTimeout(function() {\r\n dotnetifyHub._changeState(2);\r\n iStartHubFunc();\r\n }, delay * 1000);\r\n }\r\n else dotnetifyHub._changeState(99);\r\n }\r\n },\r\n\r\n client: {},\r\n\r\n server: {\r\n dispose_VM: function(iVMId) {\r\n dotnetifyHub._connection.invoke('Dispose_VM', iVMId);\r\n },\r\n update_VM: function(iVMId, iValue) {\r\n dotnetifyHub._connection.invoke('Update_VM', iVMId, iValue);\r\n },\r\n request_VM: function(iVMId, iArgs) {\r\n dotnetifyHub._connection.invoke('Request_VM', iVMId, iArgs);\r\n }\r\n }\r\n });\r\n }\r\n else {\r\n // SignalR .NET FX.\r\n dotnetifyHub.type = 'netfx';\r\n\r\n if (window.jQuery) $ = window.jQuery;\r\n\r\n // SignalR hub auto-generated from /signalr/hubs.\r\n /// \r\n /// \r\n (function($, window, undefined) {\r\n /// \r\n 'use strict';\r\n\r\n if (typeof $.signalR !== 'function') {\r\n throw new Error('SignalR: SignalR is not loaded. Please ensure jquery.signalR-x.js is referenced before ~/signalr/js.');\r\n }\r\n\r\n var signalR = $.signalR;\r\n\r\n function makeProxyCallback(hub, callback) {\r\n return function() {\r\n // Call the client hub method\r\n callback.apply(hub, $.makeArray(arguments));\r\n };\r\n }\r\n\r\n function registerHubProxies(instance, shouldSubscribe) {\r\n var key, hub, memberKey, memberValue, subscriptionMethod;\r\n\r\n for (key in instance) {\r\n if (instance.hasOwnProperty(key)) {\r\n hub = instance[key];\r\n\r\n if (!hub.hubName) {\r\n // Not a client hub\r\n continue;\r\n }\r\n\r\n if (shouldSubscribe) {\r\n // We want to subscribe to the hub events\r\n subscriptionMethod = hub.on;\r\n }\r\n else {\r\n // We want to unsubscribe from the hub events\r\n subscriptionMethod = hub.off;\r\n }\r\n\r\n // Loop through all members on the hub and find client hub functions to subscribe/unsubscribe\r\n for (memberKey in hub.client) {\r\n if (hub.client.hasOwnProperty(memberKey)) {\r\n memberValue = hub.client[memberKey];\r\n\r\n if (!$.isFunction(memberValue)) {\r\n // Not a client hub function\r\n continue;\r\n }\r\n\r\n subscriptionMethod.call(hub, memberKey, makeProxyCallback(hub, memberValue));\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n $.hubConnection.prototype.createHubProxies = function() {\r\n var proxies = {};\r\n this.starting(function() {\r\n // Register the hub proxies as subscribed\r\n // (instance, shouldSubscribe)\r\n registerHubProxies(proxies, true);\r\n\r\n this._registerSubscribedHubs();\r\n }).disconnected(function() {\r\n // Unsubscribe all hub proxies when we \"disconnect\". This is to ensure that we do not re-add functional call backs.\r\n // (instance, shouldSubscribe)\r\n registerHubProxies(proxies, false);\r\n });\r\n\r\n proxies['dotNetifyHub'] = this.createHubProxy('dotNetifyHub');\r\n proxies['dotNetifyHub'].client = {};\r\n proxies['dotNetifyHub'].server = {\r\n dispose_VM: function(vmId) {\r\n return proxies['dotNetifyHub'].invoke.apply(proxies['dotNetifyHub'], $.merge([ 'Dispose_VM' ], $.makeArray(arguments)));\r\n },\r\n\r\n request_VM: function(vmId, vmArg) {\r\n return proxies['dotNetifyHub'].invoke.apply(proxies['dotNetifyHub'], $.merge([ 'Request_VM' ], $.makeArray(arguments)));\r\n },\r\n\r\n update_VM: function(vmId, vmData) {\r\n return proxies['dotNetifyHub'].invoke.apply(proxies['dotNetifyHub'], $.merge([ 'Update_VM' ], $.makeArray(arguments)));\r\n }\r\n };\r\n\r\n return proxies;\r\n };\r\n\r\n signalR.hub = $.hubConnection(dotnetifyHub.hubPath, { useDefaultPath: false });\r\n $.extend(signalR, signalR.hub.createHubProxies());\r\n })($, window);\r\n\r\n Object.defineProperty(dotnetifyHub, 'state', {\r\n get: function() {\r\n return $.connection.hub.state;\r\n },\r\n set: function(val) {\r\n $.connection.hub.state = val;\r\n }\r\n });\r\n\r\n Object.defineProperty(dotnetifyHub, 'client', {\r\n get: function() {\r\n return $.connection.dotNetifyHub.client;\r\n }\r\n });\r\n\r\n Object.defineProperty(dotnetifyHub, 'server', {\r\n get: function() {\r\n return $.connection.dotNetifyHub.server;\r\n }\r\n });\r\n\r\n Object.defineProperty(dotnetifyHub, 'isConnected', {\r\n get: function() {\r\n return $.connection.hub.state == $.signalR.connectionState.connected;\r\n }\r\n });\r\n\r\n dotnetifyHub = $.extend(dotnetifyHub, {\r\n hubPath: iHubPath || '/signalr',\r\n url: iServerUrl,\r\n\r\n _reconnectCount: 0,\r\n _stateChangedHandler: function(iNewState) {},\r\n\r\n start: function(iHubOptions) {\r\n if (dotnetifyHub.url) $.connection.hub.url = dotnetifyHub.url;\r\n\r\n let deferred;\r\n if (iHubOptions) deferred = $.connection.hub.start(iHubOptions);\r\n else deferred = $.connection.hub.start();\r\n deferred.fail(function(error) {\r\n if (error.source && error.source.message === 'Error parsing negotiate response.')\r\n console.warn('This client may be attempting to connect to an incompatible SignalR .NET Core server.');\r\n });\r\n return deferred;\r\n },\r\n\r\n disconnected: function(iHandler) {\r\n return $.connection.hub.disconnected(iHandler);\r\n },\r\n\r\n stateChanged: function(iHandler) {\r\n dotnetifyHub._stateChangedHandler = iHandler;\r\n return $.connection.hub.stateChanged(function(state) {\r\n if (state == 1) dotnetifyHub._reconnectCount = 0;\r\n\r\n let stateText = { 0: 'connecting', 1: 'connected', 2: 'reconnecting', 4: 'disconnected' };\r\n iHandler(stateText[state.newState]);\r\n });\r\n },\r\n\r\n reconnect: function(iStartHubFunc) {\r\n if (typeof iStartHubFunc === 'function') {\r\n // Only attempt reconnect if the specified retry hasn't been exceeded.\r\n if (!dotnetifyHub.reconnectRetry || dotnetifyHub._reconnectCount < dotnetifyHub.reconnectRetry) {\r\n // Determine reconnect delay from the specified configuration array.\r\n let delay =\r\n dotnetifyHub._reconnectCount < dotnetifyHub.reconnectDelay.length\r\n ? dotnetifyHub.reconnectDelay[dotnetifyHub._reconnectCount]\r\n : dotnetifyHub.reconnectDelay[dotnetifyHub.reconnectDelay.length - 1];\r\n\r\n dotnetifyHub._reconnectCount++;\r\n\r\n setTimeout(function() {\r\n dotnetifyHub._stateChangedHandler('reconnecting');\r\n iStartHubFunc();\r\n }, delay * 1000);\r\n }\r\n else dotnetifyHub._stateChangedHandler('terminated');\r\n }\r\n }\r\n });\r\n }\r\n\r\n // Setup SignalR server method handler.\r\n dotnetifyHub.client.response_VM = function(iVMId, iVMData) {\r\n // SignalR .NET Core is sending an array of arguments.\r\n if (Array.isArray(iVMId)) {\r\n iVMData = iVMId[1];\r\n iVMId = iVMId[0];\r\n }\r\n\r\n let handled = dotnetifyHub.responseEvent.emit(iVMId, iVMData);\r\n\r\n // If we get to this point, that means the server holds a view model instance\r\n // whose view no longer existed. So, tell the server to dispose the view model.\r\n if (!handled) dotnetifyHub.server.dispose_VM(iVMId);\r\n };\r\n\r\n // On disconnected, keep attempting to start the connection.\r\n dotnetifyHub.disconnected(function() {\r\n dotnetifyHub._startInfo = null;\r\n dotnetifyHub.reconnect(function() {\r\n dotnetifyHub.reconnectedEvent.emit();\r\n });\r\n });\r\n };\r\n\r\n return dotnetifyHub;\r\n }\r\n}\r\n\r\nexport default dotnetifyHubFactory.create();\r\n","/* \r\nCopyright 2017-2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport dotnetifyHub, { dotnetifyHubFactory } from './dotnetify-hub';\r\nimport localHub, { hasLocalVM } from './dotnetify-hub-local';\r\n\r\nexport class dotnetifyFactory {\r\n static create() {\r\n const dotnetify = {\r\n // SignalR hub options.\r\n hub: dotnetifyHub,\r\n hubOptions: { transport: [ 'webSockets', 'longPolling' ] },\r\n hubPath: null,\r\n\r\n // Debug mode.\r\n debug: false,\r\n debugFn: null,\r\n\r\n // Offline mode. (WIP)\r\n offline: false,\r\n isOffline: true,\r\n offlineTimeout: 5000,\r\n offlineCacheFn: null,\r\n\r\n // Internal variables.\r\n _vmAccessors: [],\r\n\r\n // Use this to get notified of connection state changed events.\r\n // (state, exception, hub) => void\r\n connectionStateHandler: null,\r\n\r\n // Use this intercept a view model prior to establishing connection,\r\n // with the option to provide any connect parameters.\r\n // ({vmId, options}) => {vmId, options, hub}\r\n connectHandler: null,\r\n\r\n // Support changing hub server URL after first init.\r\n get hubServerUrl() {\r\n return this.hub.url;\r\n },\r\n\r\n set hubServerUrl(url) {\r\n this.hub.url = url;\r\n if (this.debug) console.log('SignalR: connecting to ' + this.hubServerUrl);\r\n if (this.hub.isHubStarted) this.startHub(this.hub, true);\r\n },\r\n\r\n // Generic connect function for non-React app.\r\n connect(iVMId, iOptions) {\r\n dotnetify.react.connect(iVMId, null, iOptions);\r\n },\r\n\r\n // Creates a SignalR hub client.\r\n createHub(hubServerUrl, hubPath, hubLib) {\r\n return this.initHub(dotnetifyHubFactory.create(), hubPath, hubServerUrl, hubLib);\r\n },\r\n\r\n // Configures hub connection to SignalR hub server.\r\n initHub(hub, hubPath, hubServerUrl, hubLib) {\r\n hub = hub || this.hub;\r\n hubPath = hubPath || this.hubPath;\r\n hubServerUrl = hubServerUrl || this.hubServerUrl;\r\n hubLib = hubLib || this.hubLib;\r\n\r\n if (!hub.isHubStarted) {\r\n hub.init(hubPath, hubServerUrl, hubLib);\r\n\r\n // Use SignalR event to raise the connection state event.\r\n hub.stateChanged(state => this.handleConnectionStateChanged(state, null, hub));\r\n }\r\n return hub;\r\n },\r\n\r\n // Used by a view to select a hub, and provides the opportunity to override any connect info.\r\n selectHub(vmConnectArgs) {\r\n vmConnectArgs = vmConnectArgs || { options: {} };\r\n let override = (typeof this.connectHandler == 'function' && this.connectHandler(vmConnectArgs)) || {};\r\n if (!override.hub) {\r\n override.hub = hasLocalVM(vmConnectArgs.vmId) ? localHub : this.initHub();\r\n override.hub.debug = this.debug;\r\n }\r\n return Object.assign(vmConnectArgs, override);\r\n },\r\n\r\n // Starts hub connection to SignalR hub server.\r\n startHub(hub, forceRestart) {\r\n hub = hub || this.hub;\r\n\r\n const doneHandler = () => {};\r\n const failHandler = ex => this.handleConnectionStateChanged('error', ex, hub);\r\n hub.startHub(this.hubOptions, doneHandler, failHandler, forceRestart);\r\n },\r\n\r\n // Used by dotnetify-react and -vue to expose their view model accessors.\r\n addVMAccessor(vmAccessor) {\r\n !this._vmAccessors.includes(vmAccessor) && this._vmAccessors.push(vmAccessor);\r\n },\r\n\r\n checkServerSideException(iVMId, iVMData, iExceptionHandler) {\r\n const vmData = JSON.parse(iVMData);\r\n if (vmData && vmData.hasOwnProperty('ExceptionType') && vmData.hasOwnProperty('Message')) {\r\n const exception = { name: vmData.ExceptionType, message: vmData.Message };\r\n\r\n if (typeof iExceptionHandler === 'function') {\r\n return iExceptionHandler(exception);\r\n }\r\n else {\r\n console.error('[' + iVMId + '] ' + exception.name + ': ' + exception.message);\r\n throw exception;\r\n }\r\n }\r\n },\r\n\r\n // Get all view models.\r\n getViewModels() {\r\n return this._vmAccessors\r\n .reduce((prev, current) => [ ...prev, ...current() ], [])\r\n .filter((val, idx, self) => self.indexOf(val) === idx); // returns distinct items.\r\n },\r\n\r\n handleConnectionStateChanged(iState, iException, iHub) {\r\n if (this.debug) console.log('SignalR: ' + (iException ? iException.message : iState));\r\n if (typeof this.connectionStateHandler === 'function') this.connectionStateHandler(iState, iException, iHub);\r\n else if (iException) console.error(iException);\r\n }\r\n };\r\n\r\n return dotnetify;\r\n }\r\n}\r\n\r\nexport default dotnetifyFactory.create();\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\n\r\nimport React from 'react';\r\nimport dotnetify from './dotnetify-react';\r\n\r\nconst window = window || global || {};\r\n\r\n// is a helper component to provide DOM target for routes, and is essential for server-side rendering.\r\nexport default class RouteTarget extends React.Component {\r\n componentWillMount() {\r\n var elem = document.getElementById(this.props.id);\r\n if (elem != null && window.ssr && !window.ssr[this.props.id]) {\r\n window.ssr[this.props.id] = true;\r\n this.initialHtml = { __html: elem.innerHTML };\r\n }\r\n else this.initialHtml = { __html: '' };\r\n }\r\n\r\n getDOMNode() {\r\n return this.elem;\r\n }\r\n\r\n render() {\r\n const { id, ...props } = this.props;\r\n return
(this.elem = el)} {...this.props} dangerouslySetInnerHTML={this.initialHtml} />;\r\n }\r\n}\r\n\r\ndotnetify.react.router.RouteTarget = RouteTarget;\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\n\r\nimport React from 'react';\r\nimport dotnetify from './dotnetify-react';\r\n\r\n// is a helper component to set anchor tags for routes.\r\nexport default class RouteLink extends React.Component {\r\n render() {\r\n const props = this.props;\r\n if (props.vm == null) console.error(\"RouteLink requires 'vm' property.\");\r\n\r\n const handleClick = event => {\r\n event.preventDefault();\r\n if (props.route == null) {\r\n console.error(\"RouteLink requires 'route' property.\");\r\n return;\r\n }\r\n if (typeof props.onClick === 'function' && props.onClick(event) === false) return;\r\n return props.vm.$handleRoute(event);\r\n };\r\n\r\n return (\r\n \r\n );\r\n }\r\n}\r\n\r\ndotnetify.react.router.RouteLink = RouteLink;\r\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim\n };\n\n ReactPropTypes.checkPropTypes = emptyFunction;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n Symbol.for &&\n Symbol.for('react.element')) ||\n 0xeac7;\n\n var isValidElement = function(object) {\n return typeof object === 'object' &&\n object !== null &&\n object.$$typeof === REACT_ELEMENT_TYPE;\n };\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\n\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport dotnetify from './dotnetify-react';\r\n\r\nconst window = window || global || {};\r\n\r\n// The component uses React's 'context' to pass down the component hierarchy the name of the back-end view model\r\n// of the parent component, so that when the child component connects to its back-end view model, the child view model\r\n// instance is created within the scope of the parent view model.\r\n//\r\n// The component also provides the 'connect' function for a component to connect to the back-end view model and\r\n// injects properties and dispatch functions into the component.\r\nexport default class Scope extends React.Component {\r\n static displayName = 'Scope';\r\n static version = '1.2.0';\r\n\r\n static propTypes = { vm: PropTypes.string };\r\n static contextTypes = { scoped: PropTypes.func };\r\n static childContextTypes = {\r\n scoped: PropTypes.func.isRequired,\r\n connect: PropTypes.func.isRequired\r\n };\r\n\r\n scoped(vmId) {\r\n var scope = this.context.scoped ? this.context.scoped(this.props.vm) : this.props.vm;\r\n return scope ? scope + '.' + vmId : vmId;\r\n }\r\n\r\n getChildContext() {\r\n const _this = this;\r\n\r\n return {\r\n scoped: vmId => _this.scoped(vmId),\r\n connect: (vmId, component, options) => {\r\n component.vmId = _this.scoped(vmId);\r\n component.vm = dotnetify.react.connect(component.vmId, component, options);\r\n component.dispatch = state => component.vm.$dispatch(state);\r\n\r\n component.dispatchState = state => {\r\n component.vm.State(state);\r\n component.vm.$dispatch(state);\r\n };\r\n return window.vmStates ? window.vmStates[component.vmId] : null;\r\n }\r\n };\r\n }\r\n render() {\r\n return this.props.children;\r\n }\r\n}\r\n\r\ndotnetify.react.Scope = Scope;\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport dotnetify from './dotnetify-react';\r\nimport dotnetifyVM from '../core/dotnetify-vm';\r\nimport $ from '../libs/jquery-shim';\r\n\r\nconst window = window || global || {};\r\n\r\n// Used by server-side rendering in lieu of connect method.\r\ndotnetify.react.ssrConnect = function(iVMId, iReact, iVMArg) {\r\n if (window.ssr == null || !window.ssr.hasOwnProperty(iVMId))\r\n console.error(\"Server-side rendering requires initial state in 'window.ssr.\" + iVMId + \"'.\");\r\n\r\n var self = dotnetify.react;\r\n var vmState = window.ssr[iVMId];\r\n var getState = function() {\r\n return vmState;\r\n };\r\n var setState = function(state) {\r\n vmState = $.extend(vmState, state);\r\n };\r\n var options = {\r\n getState: getState,\r\n setState: setState,\r\n vmArg: iVMArg\r\n };\r\n var vm = (self.viewModels[iVMId] = new dotnetifyVM(iVMId, iReact, options, self));\r\n\r\n // Need to be asynch to allow initial state to be processed.\r\n setTimeout(function() {\r\n vm.$update(JSON.stringify(window.ssr[iVMId]));\r\n }, 100);\r\n return vm;\r\n};\r\n\r\n// Used by client-side React component to get server-side rendered initial state.\r\ndotnetify.react.router.ssrState = function(iVMId) {\r\n if (window.ssr && window.ssr[iVMId] && !window.ssr[iVMId].fetched) {\r\n window.ssr[iVMId].fetched = true;\r\n return window.ssr[iVMId];\r\n }\r\n};\r\n\r\n// Called from server to configure server-side rendering.\r\n// iPath - initial URL path.\r\n// iInitialStates - serialized object literal '{ \"vmName\": {initialState}, ...}'.\r\n// iOverrideRouteFn - function to override routing URLs before the router loads them.\r\n// iCallbackFn - callback after the path is fully routed.\r\n// iTimeout - timeout in milliseconds.\r\ndotnetify.react.router.ssr = function(iPath, iInitialStates, iOverrideRouteFn, iCallbackFn, iTimeout) {\r\n dotnetify.ssr = true;\r\n dotnetify.react.router.urlPath = iPath;\r\n dotnetify.react.router.overrideUrl = iOverrideRouteFn;\r\n\r\n // Insert initial states in the head tag.\r\n var script = document.createElement('script');\r\n script.type = 'text/javascript';\r\n script.text = 'window.ssr=' + iInitialStates + ';';\r\n var head = document.getElementsByTagName('head')[0];\r\n if (head) head.insertBefore(script, head.firstChild);\r\n else console.error('router> document head tag is required for server-side render.');\r\n\r\n var routed = false;\r\n var fallback = iTimeout\r\n ? setTimeout(function() {\r\n if (!routed) iCallbackFn();\r\n }, iTimeout)\r\n : 0;\r\n window.addEventListener('dotnetify.routed', function() {\r\n routed = true;\r\n if (fallback != 0) clearTimeout(fallback);\r\n iCallbackFn();\r\n });\r\n\r\n // Add initial states into the window scope for the server-renderd components.\r\n window.ssr = JSON.parse(iInitialStates);\r\n};\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport utils from '../libs/utils';\r\n\r\nexport default class dotnetifyVMRouter {\r\n routes = [];\r\n\r\n get RoutingState() {\r\n throw new Error('Not implemented');\r\n }\r\n get VMRoot() {\r\n throw new Error('Not implemented');\r\n }\r\n get VMArg() {\r\n throw new Error('Not implemented');\r\n }\r\n\r\n constructor(vm, router) {\r\n this.vm = vm;\r\n this.router = router;\r\n this.debug = vm.$dotnetify.controller.debug;\r\n }\r\n\r\n // Dispatch the active routing state to the server.\r\n dispatchActiveRoutingState(iPath) {\r\n this.vm.$dispatch({ 'RoutingState.Active': iPath });\r\n let { RoutingState } = this.vm.State();\r\n RoutingState = Object.assign(RoutingState || {}, { Active: iPath });\r\n this.vm.State({ RoutingState });\r\n }\r\n\r\n // Handles click event from anchor tags. Argument can be event object or path string.\r\n handleRoute(iArg) {\r\n let path = null;\r\n if (typeof iArg === 'object') {\r\n iArg.preventDefault();\r\n path = iArg.currentTarget.pathname;\r\n }\r\n else if (typeof iArg === 'string') path = iArg;\r\n\r\n if (path == null || path == '') throw new Error('$handleRoute requires path argument or event with pathname.');\r\n setTimeout(() => this.router.pushState({}, '', path));\r\n }\r\n\r\n // Build the absolute root path from the \"vmRoot\" property on React component.\r\n initRoot() {\r\n if (!this.hasRoutingState || this.RoutingState === null || this.RoutingState.Root === null) return;\r\n\r\n if (this._absRoot != this.RoutingState.Root) {\r\n var absRoot = utils.trim(this.VMRoot);\r\n if (absRoot != '') absRoot = '/' + absRoot;\r\n var root = utils.trim(this.RoutingState.Root);\r\n this._absRoot = root != '' ? absRoot + '/' + root : absRoot;\r\n this.RoutingState.Root = this._absRoot;\r\n }\r\n }\r\n\r\n // Initialize routing templates if the view model implements IRoutable.\r\n initRouting() {\r\n const vm = this.vm;\r\n if (!this.hasRoutingState) return;\r\n\r\n if (this.RoutingState === null) {\r\n console.error(\"router> the RoutingState prop of '\" + vm.$vmId + \"' was not initialized.\");\r\n return;\r\n }\r\n\r\n var templates = this.RoutingState.Templates;\r\n if (templates == null || templates.length == 0) return;\r\n\r\n // Initialize the router.\r\n if (!this.router.$init) {\r\n this.router.init();\r\n this.router.$init = true;\r\n }\r\n\r\n // Build the absolute root path.\r\n this.initRoot();\r\n\r\n templates.forEach(template => {\r\n // If url pattern isn't given, consider Id as the pattern.\r\n var urlPattern = template.UrlPattern != null ? template.UrlPattern : template.Id;\r\n urlPattern = urlPattern != '' ? urlPattern : '/';\r\n var mapUrl = this.toUrl(urlPattern);\r\n\r\n if (this.debug) console.log('router> map ' + mapUrl + ' to template id=' + template.Id);\r\n\r\n this.router.mapTo(mapUrl, iParams => {\r\n this.router.urlPath = '';\r\n\r\n // Construct the path from the template pattern and the params passed by PathJS.\r\n var path = urlPattern;\r\n for (var param in iParams) path = path.replace(':' + param, iParams[param]);\r\n path = path.replace(/\\(\\/:([^)]+)\\)/g, '').replace(/\\(|\\)/g, '');\r\n\r\n this.routeTo(path, template);\r\n });\r\n });\r\n\r\n // Route initial URL.\r\n var activeUrl = this.toUrl(this.RoutingState.Active);\r\n if (this.router.urlPath == '') this.router.urlPath = activeUrl;\r\n if (!this.routeUrl())\r\n // If routing ends incomplete, raise routed event anyway.\r\n this.raiseRoutedEvent(true);\r\n }\r\n\r\n // Whether a route is active.\r\n isActive(iRoute) {\r\n if (iRoute != null && iRoute.hasOwnProperty('Path')) {\r\n return utils.equal(iRoute.Path, this.RoutingState.Active);\r\n }\r\n return false;\r\n }\r\n\r\n // Loads an HTML view.\r\n loadHtmlView(iTargetSelector, iViewUrl, iJsModuleUrl, iCallbackFn) {\r\n const vm = this.vm;\r\n this.unmountView(iTargetSelector);\r\n\r\n // Load the HTML view.\r\n $(iTargetSelector).load(iViewUrl, null, function() {\r\n if (iJsModuleUrl != null) {\r\n const getScripts = iJsModuleUrl.split(',').map(i => $.getScript(i));\r\n $.when.apply($, getScripts).done(() => typeof callbackFn === 'function' && iCallbackFn.call(vm));\r\n }\r\n else if (typeof callbackFn === 'function') iCallbackFn.call(vm);\r\n });\r\n }\r\n\r\n loadHtmlElementView(iTargetSelector, iHtmlElement, iJsModuleUrl, iVmArg, iCallbackFn) {\r\n const vm = this.vm;\r\n const mountViewFunc = () => {\r\n this.unmountView(iTargetSelector);\r\n\r\n const target = document.querySelector(iTargetSelector);\r\n while (target.firstChild) target.removeChild(target.firstChild);\r\n target.appendChild(iHtmlElement);\r\n\r\n if (typeof callbackFn === 'function') iCallbackFn.call(vm);\r\n };\r\n\r\n if (iJsModuleUrl == null) mountViewFunc();\r\n else {\r\n // Load all javascripts first. Multiple files can be specified with comma delimiter.\r\n const getScripts = iJsModuleUrl.split(',').map(i => $.getScript(i));\r\n $.when.apply($, getScripts).done(mountViewFunc);\r\n }\r\n }\r\n\r\n // Loads a view into a target element.\r\n loadView(iTargetSelector, iViewUrl, iJsModuleUrl, iVmArg, iCallbackFn) {\r\n throw new Error('Not implemented');\r\n }\r\n\r\n // Routes to a path.\r\n manualRouteTo(iPath, iTarget, iViewUrl, iJSModuleUrl) {\r\n const vm = this.vm;\r\n var template = { Id: 'manual', Target: iTarget, ViewUrl: iViewUrl, JSModuleUrl: iJSModuleUrl };\r\n this.routeTo(iPath, template, true);\r\n }\r\n\r\n // Handles route enter event.\r\n onRouteEnter(iPath, iTemplate) {\r\n return true;\r\n }\r\n\r\n // Raise event indicating the routing process has ended.\r\n raiseRoutedEvent(force) {\r\n const vm = this.vm;\r\n if (this.router.urlPath == '' || force == true) {\r\n if (this.debug) console.log('router> routed');\r\n utils.dispatchEvent('dotnetify.routed');\r\n }\r\n }\r\n\r\n // Returns the URL for an anchor tag.\r\n route(iRoute, iTarget) {\r\n // No route to process. Return silently.\r\n if (iRoute == null) return;\r\n\r\n if (!iRoute.hasOwnProperty('Path') && !iRoute.hasOwnProperty('TemplateId')) throw new Error('Not a valid route');\r\n\r\n // Build the absolute root path.\r\n this.initRoot();\r\n\r\n // If the route path is not defined, use the URL pattern from the associated template.\r\n // This is so that we don't send the same data twice if both are equal.\r\n let path = iRoute.Path;\r\n let template = null;\r\n if (this.hasRoutingState && this.RoutingState.Templates != null && iRoute.TemplateId != null) {\r\n let match = this.RoutingState.Templates.filter(function(iTemplate) {\r\n return iTemplate.Id == iRoute.TemplateId;\r\n });\r\n if (match.length > 0) {\r\n template = match[0];\r\n\r\n if (typeof iTarget === 'string') template.Target = iTarget;\r\n\r\n if (path == null) {\r\n path = template.UrlPattern != null ? template.UrlPattern : template.Id;\r\n iRoute.Path = path;\r\n }\r\n }\r\n else if (iRoute.RedirectRoot == null) throw new Error(`vmRoute cannot find route template ${iRoute.TemplateId}`);\r\n }\r\n\r\n // If the path has a redirect root, the path doesn't belong to the current root and needs to be\r\n // redirected to a different one. Set the absolute path to the HREF attribute, and prevent the\r\n // default behavior of the anchor click event and instead do push to HTML5 history state, which\r\n // would attempt to resolve the path first before resorting to hard browser redirect.\r\n if (iRoute.RedirectRoot != null) {\r\n // Combine the redirect root with the view model's root.\r\n let redirectRoot = iRoute.RedirectRoot;\r\n if (redirectRoot.charAt(0) == '/') redirectRoot = redirectRoot.substr(0, redirectRoot.length - 1);\r\n let redirectRootPath = iRoute.RedirectRoot.split('/');\r\n\r\n let urlRedirect = '';\r\n let absRoot = this.VMRoot;\r\n if (absRoot != null) {\r\n let absRootPath = absRoot.split('/');\r\n for (let i = 0; i < absRootPath.length; i++) {\r\n if (absRootPath[i] != '' && absRootPath[i] == redirectRootPath[0]) break;\r\n urlRedirect += absRootPath[i] + '/';\r\n }\r\n }\r\n\r\n urlRedirect += redirectRoot + '/' + path;\r\n urlRedirect = urlRedirect.replace(/\\/\\/+/g, '/');\r\n if (!this.routes.some(x => x.Path === path)) this.routes.push({ Path: path, Url: urlRedirect });\r\n return urlRedirect;\r\n }\r\n\r\n // For quick lookup, save the mapping between the path to the route inside the view model.\r\n if (template == null) throw new Error('vmRoute cannot find any route template');\r\n\r\n iRoute.$template = template;\r\n this.pathToRoute = this.pathToRoute || {};\r\n this.pathToRoute[path] = iRoute;\r\n\r\n // Set the absolute path to the HREF attribute, and prevent the default behavior of\r\n // the anchor click event and instead do push to HTML5 history state.\r\n let url = this.toUrl(path);\r\n url = url.length > 0 ? url : '/';\r\n if (!this.routes.some(x => x.Path === path)) this.routes.push({ Path: path, Url: url });\r\n return url;\r\n }\r\n\r\n // Routes to a path.\r\n routeTo(iPath, iTemplate, iDisableEvent, iCallbackFn, isRedirect) {\r\n const vm = this.vm;\r\n const viewModels = vm.$dotnetify.getViewModels();\r\n\r\n if (this.debug) console.log(\"router> route '\" + iPath + \"' to template id=\" + iTemplate.Id);\r\n\r\n // We can determine whether the view has already been loaded by matching the 'RoutingState.Origin' argument\r\n // on the existing view model inside that target selector with the path.\r\n for (let i = 0; i < viewModels.length; i++) {\r\n var vmOther = viewModels[i];\r\n var vmArg = vmOther.$router.VMArg;\r\n if (vmArg != null) {\r\n if (typeof vmArg['RoutingState.Origin'] === 'string' && utils.equal(vmArg['RoutingState.Origin'], iPath)) return;\r\n }\r\n }\r\n\r\n // Support enter interception.\r\n if (iDisableEvent != true && vm.hasOwnProperty('onRouteEnter')) {\r\n if (this.onRouteEnter(iPath, iTemplate) == false || vm.onRouteEnter(iPath, iTemplate) == false) return;\r\n }\r\n\r\n // Check if the route has valid target.\r\n if (iTemplate.Target == null) {\r\n console.error(\"router> the Target for template '\" + iTemplate.Id + \"' was not set. Use vm.onRouteEnter() to set the target.\");\r\n return;\r\n }\r\n\r\n // If target DOM element isn't found, redirect URL to the path.\r\n if (document.getElementById(iTemplate.Target) == null) {\r\n if (isRedirect === true) {\r\n if (this.debug) console.log(\"router> target '\" + iTemplate.Target + \"' not found in DOM\");\r\n return;\r\n }\r\n else {\r\n if (this.debug) console.log(\"router> target '\" + iTemplate.Target + \"' not found in DOM, use redirect instead\");\r\n return this.router.redirect(this.toUrl(iPath), [ ...viewModels, ...vm.$dotnetify.controller.getViewModels() ]);\r\n }\r\n }\r\n\r\n // Load the view associated with the route asynchronously.\r\n this.loadView('#' + iTemplate.Target, iTemplate.ViewUrl, iTemplate.JSModuleUrl, { 'RoutingState.Origin': iPath }, () => {\r\n // If load is successful, update the active route.\r\n this.dispatchActiveRoutingState(iPath);\r\n\r\n // Support exit interception.\r\n if (iDisableEvent != true && vm.hasOwnProperty('onRouteExit')) vm.onRouteExit(iPath, iTemplate);\r\n\r\n if (typeof iCallbackFn === 'function') iCallbackFn.call(vm);\r\n });\r\n }\r\n\r\n routeToRoute(iRoute) {\r\n var path = this.vm.$route(iRoute);\r\n if (path == null || path == '') throw new Error('The route passed to $routeTo is invalid.');\r\n\r\n setTimeout(() => this.router.pushState({}, '', path));\r\n }\r\n\r\n // Routes the URL if the view model implements IRoutable.\r\n // Returns true if the view model handles the routing.\r\n routeUrl(redirectUrlPath) {\r\n if (!this.hasRoutingState) return false;\r\n\r\n const isRedirect = !!redirectUrlPath;\r\n let root = this.RoutingState.Root;\r\n if (root == null) return false;\r\n\r\n // Get the URL path to route.\r\n let urlPath = isRedirect ? redirectUrlPath : this.router.urlPath;\r\n\r\n if (this.debug) console.log('router> routing ' + urlPath);\r\n\r\n // If the URL path matches the root path of this view, use the template with a blank URL pattern if provided.\r\n if (utils.equal(urlPath, root) || utils.equal(urlPath, root + '/') || urlPath === '/') {\r\n let match = utils.grep(this.RoutingState.Templates, function(iTemplate) {\r\n return iTemplate.UrlPattern === '';\r\n });\r\n if (match.length > 0) {\r\n this.routeTo('', match[0], null, null, isRedirect);\r\n this.router.urlPath = '';\r\n this.raiseRoutedEvent();\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n // If the URL path starts with the root path of this view, look at the next path and try to match it with the\r\n // anchor tags in this view that are bound with the vmRoute binding type. If there is match, route to that path.\r\n root = root + '/';\r\n if (utils.startsWith(urlPath, root)) {\r\n let routeElem = null;\r\n let match = utils.grep(this.routes, function(elem) {\r\n return utils.startsWith(urlPath + '/', elem.Url + '/');\r\n });\r\n if (match.length > 0) {\r\n // If more than one match, find the best match.\r\n for (let i = 0; i < match.length; i++) if (routeElem == null || routeElem.Url.length < match[i].Url.length) routeElem = match[i];\r\n }\r\n\r\n if (routeElem != null) {\r\n let path = routeElem.Path;\r\n let template =\r\n this.hasOwnProperty('pathToRoute') && this.pathToRoute.hasOwnProperty(path) ? this.pathToRoute[path].$template : null;\r\n if (template != null) {\r\n // If the URL path is completely routed, clear it.\r\n if (utils.equal(this.router.urlPath, this.toUrl(path))) this.router.urlPath = '';\r\n\r\n // If route's not already active, route to it.\r\n if (!utils.equal(this.RoutingState.Active, path)) {\r\n this.routeTo(path, template, false, () => this.raiseRoutedEvent(), isRedirect);\r\n }\r\n else this.raiseRoutedEvent();\r\n return true;\r\n }\r\n }\r\n else if (this.router.match(urlPath)) {\r\n // If no vmRoute binding matches, try to match with any template's URL pattern.\r\n this.router.urlPath = '';\r\n this.raiseRoutedEvent();\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n // Builds an absolute URL from a path.\r\n toUrl(iPath) {\r\n let path = utils.trim(iPath);\r\n if (path.charAt(0) != '(' && path != '') path = '/' + path;\r\n return this.hasRoutingState ? this.RoutingState.Root + path : iPath;\r\n }\r\n\r\n // Unmount a view if there's one on the target selector.\r\n unmountView(iTargetSelector) {\r\n throw new Error('Not implemented');\r\n }\r\n}\r\n","module.exports = __WEBPACK_EXTERNAL_MODULE__23__;","/* \r\nCopyright 2017-2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport dotnetifyVMRouter from '../core/dotnetify-vm-router';\r\nimport $ from '../libs/jquery-shim';\r\nimport utils from '../libs/utils';\r\n\r\nconst window = window || global || {};\r\n\r\nexport default class dotnetifyReactVMRouter extends dotnetifyVMRouter {\r\n get hasRoutingState() {\r\n const state = this.vm.State();\r\n return state && state.hasOwnProperty('RoutingState');\r\n }\r\n get RoutingState() {\r\n return this.vm.State().RoutingState;\r\n }\r\n get VMRoot() {\r\n return this.vm.Props('vmRoot');\r\n }\r\n get VMArg() {\r\n return this.vm.Props('vmArg');\r\n }\r\n\r\n constructor(iVM, iDotNetifyRouter) {\r\n super(iVM, iDotNetifyRouter);\r\n }\r\n\r\n onRouteEnter(iPath, iTemplate) {\r\n if (!iTemplate.ViewUrl) iTemplate.ViewUrl = iTemplate.Id;\r\n return true;\r\n }\r\n\r\n // Loads a view into a target element.\r\n loadView(iTargetSelector, iViewUrl, iJsModuleUrl, iVmArg, iCallbackFn) {\r\n const vm = this.vm;\r\n let reactProps;\r\n\r\n // If the view model supports routing, add the root path to the view, to be used\r\n // to build the absolute route path, and view model argument if provided.\r\n if (this.hasRoutingState) {\r\n if (this.RoutingState === null) {\r\n console.error(\"router> the RoutingState prop of '\" + vm.$vmId + \"' was not initialized.\");\r\n return;\r\n }\r\n\r\n let root = this.VMRoot;\r\n root = root != null ? '/' + utils.trim(this.RoutingState.Root) + '/' + utils.trim(root) : this.RoutingState.Root;\r\n reactProps = { vmRoot: root, vmArg: iVmArg };\r\n }\r\n\r\n // Provide the opportunity to override the URL.\r\n iViewUrl = this.router.overrideUrl(iViewUrl, iTargetSelector);\r\n iJsModuleUrl = this.router.overrideUrl(iJsModuleUrl, iTargetSelector);\r\n\r\n if (utils.endsWith(iViewUrl, 'html')) this.loadHtmlView(iTargetSelector, iViewUrl, iJsModuleUrl, iCallbackFn);\r\n else {\r\n let component = iViewUrl;\r\n if (typeof iViewUrl === 'string' && window.hasOwnProperty(iViewUrl)) component = window[iViewUrl];\r\n\r\n if (component instanceof HTMLElement) this.loadHtmlElementView(iTargetSelector, component, iJsModuleUrl, reactProps, iCallbackFn);\r\n else this.loadReactView(iTargetSelector, component, iJsModuleUrl, reactProps, iCallbackFn);\r\n }\r\n }\r\n\r\n // Loads a React view.\r\n loadReactView(iTargetSelector, iComponent, iJsModuleUrl, iReactProps, iCallbackFn) {\r\n return new Promise((resolve, reject) => {\r\n const vm = this.vm;\r\n const vmId = this.vm ? this.vm.$vmId : '';\r\n\r\n const mountViewFunc = () => {\r\n if (typeof iComponent !== 'function' && (typeof iComponent !== 'object' || iComponent.name == null)) {\r\n console.error(`[${vmId}] failed to load view '${iComponent}' because it's not a valid React element.`);\r\n reject();\r\n return;\r\n }\r\n\r\n this.unmountView(iTargetSelector);\r\n\r\n try {\r\n var reactElement = React.createElement(iComponent, iReactProps);\r\n ReactDOM.render(reactElement, document.querySelector(iTargetSelector));\r\n } catch (e) {\r\n console.error(e);\r\n }\r\n if (typeof callbackFn === 'function') iCallbackFn.call(vm, reactElement);\r\n resolve(reactElement);\r\n };\r\n\r\n if (iJsModuleUrl == null || dotnetify.ssr === true) mountViewFunc();\r\n else {\r\n // Load all javascripts first. Multiple files can be specified with comma delimiter.\r\n var getScripts = iJsModuleUrl.split(',').map(i => $.getScript(i));\r\n $.when.apply($, getScripts).done(mountViewFunc);\r\n }\r\n });\r\n }\r\n\r\n // Unmount a React view if there's one on the target selector.\r\n unmountView(iTargetSelector) {\r\n try {\r\n ReactDOM.unmountComponentAtNode(document.querySelector(iTargetSelector));\r\n } catch (e) {\r\n console.warn(e);\r\n }\r\n }\r\n}\r\n","/*\r\nPathJS - Copyright (c) 2011 Mike Trpcic, released under the MIT license.\r\n */\r\nconst window = window || global || {};\r\n\r\nvar Path = {\r\n // Need this specific version, because latest version is causing issue.\r\n version: '0.8.5',\r\n map: function(path) {\r\n if (Path.routes.defined.hasOwnProperty(path)) {\r\n return Path.routes.defined[path];\r\n }\r\n else {\r\n return new Path.core.route(path);\r\n }\r\n },\r\n root: function(path) {\r\n Path.routes.root = path;\r\n },\r\n rescue: function(fn) {\r\n Path.routes.rescue = fn;\r\n },\r\n history: {\r\n initial: {}, // Empty container for \"Initial Popstate\" checking variables.\r\n pushState: function(state, title, path) {\r\n if (Path.history.supported) {\r\n if (Path.dispatch(path)) {\r\n history.pushState(state, title, path);\r\n }\r\n }\r\n else {\r\n if (Path.history.fallback) {\r\n window.location.hash = '#' + path;\r\n }\r\n }\r\n },\r\n popState: function(event) {\r\n var initialPop = !Path.history.initial.popped && location.href == Path.history.initial.URL;\r\n Path.history.initial.popped = true;\r\n if (initialPop) return;\r\n Path.dispatch(document.location.pathname === '/' ? '' : document.location.pathname);\r\n },\r\n listen: function(fallback) {\r\n Path.history.supported = !!(window.history && window.history.pushState);\r\n Path.history.fallback = fallback;\r\n\r\n if (Path.history.supported) {\r\n (Path.history.initial.popped = 'state' in window.history), (Path.history.initial.URL = location.href);\r\n window.onpopstate = Path.history.popState;\r\n }\r\n else {\r\n if (Path.history.fallback) {\r\n for (route in Path.routes.defined) {\r\n if (route.charAt(0) != '#') {\r\n Path.routes.defined['#' + route] = Path.routes.defined[route];\r\n Path.routes.defined['#' + route].path = '#' + route;\r\n }\r\n }\r\n Path.listen();\r\n }\r\n }\r\n }\r\n },\r\n match: function(path, parameterize) {\r\n var params = {},\r\n route = null,\r\n possible_routes,\r\n slice,\r\n i,\r\n j,\r\n compare,\r\n result;\r\n for (route in Path.routes.defined) {\r\n if (route !== null && route !== undefined) {\r\n route = Path.routes.defined[route];\r\n possible_routes = route.partition();\r\n for (j = 0; j < possible_routes.length; j++) {\r\n slice = possible_routes[j];\r\n compare = path;\r\n if (slice.search(/:/) > 0) {\r\n for (i = 0; i < slice.split('/').length; i++) {\r\n if (i < compare.split('/').length && slice.split('/')[i].charAt(0) === ':') {\r\n params[slice.split('/')[i].replace(/:/, '')] = compare.split('/')[i];\r\n result = compare.split('/');\r\n result[i] = slice.split('/')[i];\r\n compare = result.join('/');\r\n }\r\n }\r\n }\r\n if (slice === compare) {\r\n if (parameterize) {\r\n route.params = params;\r\n }\r\n return route;\r\n }\r\n }\r\n }\r\n }\r\n return null;\r\n },\r\n dispatch: function(passed_route) {\r\n var previous_route, matched_route;\r\n if (Path.routes.current !== passed_route) {\r\n Path.routes.previous = Path.routes.current;\r\n Path.routes.current = passed_route;\r\n matched_route = Path.match(passed_route, true);\r\n\r\n if (Path.routes.previous) {\r\n previous_route = Path.match(Path.routes.previous);\r\n if (previous_route !== null && previous_route.do_exit !== null) {\r\n previous_route.do_exit();\r\n }\r\n }\r\n\r\n if (matched_route !== null) {\r\n matched_route.run();\r\n return true;\r\n }\r\n else {\r\n if (Path.routes.rescue !== null) {\r\n Path.routes.rescue();\r\n }\r\n }\r\n }\r\n },\r\n listen: function() {\r\n var fn = function() {\r\n Path.dispatch(location.hash);\r\n };\r\n\r\n if (location.hash === '') {\r\n if (Path.routes.root !== null) {\r\n location.hash = Path.routes.root;\r\n }\r\n }\r\n\r\n // The 'document.documentMode' checks below ensure that PathJS fires the right events\r\n // even in IE \"Quirks Mode\".\r\n if ('onhashchange' in window && (!document.documentMode || document.documentMode >= 8)) {\r\n window.onhashchange = fn;\r\n }\r\n else {\r\n setInterval(fn, 50);\r\n }\r\n\r\n if (location.hash !== '') {\r\n Path.dispatch(location.hash);\r\n }\r\n },\r\n core: {\r\n route: function(path) {\r\n this.path = path;\r\n this.action = null;\r\n this.do_enter = [];\r\n this.do_exit = null;\r\n this.params = {};\r\n Path.routes.defined[path] = this;\r\n }\r\n },\r\n routes: {\r\n current: null,\r\n root: null,\r\n rescue: null,\r\n previous: null,\r\n defined: {}\r\n }\r\n};\r\n\r\nPath.core.route.prototype = {\r\n to: function(fn) {\r\n this.action = fn;\r\n return this;\r\n },\r\n enter: function(fns) {\r\n if (fns instanceof Array) {\r\n this.do_enter = this.do_enter.concat(fns);\r\n }\r\n else {\r\n this.do_enter.push(fns);\r\n }\r\n return this;\r\n },\r\n exit: function(fn) {\r\n this.do_exit = fn;\r\n return this;\r\n },\r\n partition: function() {\r\n var parts = [],\r\n options = [],\r\n re = /\\(([^}]+?)\\)/g,\r\n text,\r\n i;\r\n while ((text = re.exec(this.path))) {\r\n parts.push(text[1]);\r\n }\r\n options.push(this.path.split('(')[0]);\r\n for (i = 0; i < parts.length; i++) {\r\n options.push(options[options.length - 1] + parts[i]);\r\n }\r\n return options;\r\n },\r\n run: function() {\r\n var halt_execution = false,\r\n i,\r\n result,\r\n previous;\r\n\r\n if (Path.routes.defined[this.path].hasOwnProperty('do_enter')) {\r\n if (Path.routes.defined[this.path].do_enter.length > 0) {\r\n for (i = 0; i < Path.routes.defined[this.path].do_enter.length; i++) {\r\n result = Path.routes.defined[this.path].do_enter[i].apply(this, null);\r\n if (result === false) {\r\n halt_execution = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n if (!halt_execution) {\r\n Path.routes.defined[this.path].action();\r\n }\r\n }\r\n};\r\n\r\nexport default Path;\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport Path from '../libs/path';\r\n\r\nconst window = window || global || {};\r\n\r\nexport default class dotnetifyRouter {\r\n version = '2.0.1';\r\n\r\n // URL path that will be parsed when performing routing.\r\n urlPath = document.location.pathname;\r\n\r\n constructor(debug) {\r\n this.debug = debug;\r\n }\r\n\r\n // Initialize routing using PathJS.\r\n init() {\r\n if (typeof Path !== 'undefined') {\r\n Path.history.listen(true);\r\n Path.routes.rescue = function() {\r\n //window.location.replace(document.location.pathname);\r\n };\r\n }\r\n else throw new Error('Pathjs library is required for routing.');\r\n }\r\n\r\n // Map a route to an action.\r\n mapTo(iPath, iFn) {\r\n iPath = iPath.length > 0 ? iPath : '/';\r\n if (typeof Path !== 'undefined')\r\n Path.map(iPath).to(function() {\r\n iFn(this.params);\r\n });\r\n }\r\n\r\n // Match a URL path to a route and run the action.\r\n match(iUrlPath) {\r\n if (typeof Path !== 'undefined') {\r\n var matched = Path.match(iUrlPath, true);\r\n if (matched != null) {\r\n matched.run();\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n // Optional callback to override a URL before performing routing.\r\n overrideUrl(iUrl) {\r\n return iUrl;\r\n }\r\n\r\n // Push state to HTML history.\r\n pushState(iState, iTitle, iPath) {\r\n this.urlPath = '';\r\n if (typeof Path !== 'undefined') Path.history.pushState(iState, iTitle, iPath);\r\n }\r\n\r\n // Redirect to the a URL.\r\n redirect(iUrl, viewModels) {\r\n // Check first whether existing views can handle routing this URL.\r\n // Otherwise, do a hard browser redirect.\r\n this.urlPath = iUrl;\r\n for (let i = 0; i < viewModels.length; i++) {\r\n const vm = viewModels[i];\r\n if (vm.$router.routeUrl(iUrl)) {\r\n if (this.debug) console.log('router> redirected');\r\n return;\r\n }\r\n }\r\n window.location.replace(iUrl);\r\n }\r\n\r\n // Called by dotNetify when a view model is ready.\r\n $ready() {\r\n this.$router.initRouting();\r\n }\r\n\r\n // Called by dotNetify when a view model receives update.\r\n $update(vmData) {\r\n if (vmData && vmData.RoutingState) this.$router.initRouting();\r\n }\r\n}\r\n","/* \r\nCopyright 2017 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport dotnetify from './dotnetify-react';\r\nimport dotnetifyRouter from '../core/dotnetify-router';\r\nimport dotnetifyReactVMRouter from './dotnetify-react.vm-router';\r\n\r\n// Add plugin functions.\r\ndotnetify.react.router = new dotnetifyRouter(dotnetify.debug);\r\n\r\n// Inject a view model with functions.\r\ndotnetify.react.router.$inject = function(iVM) {\r\n const router = new dotnetifyReactVMRouter(iVM, dotnetify.react.router);\r\n\r\n // Put functions inside $router namespace.\r\n iVM.$router = router;\r\n\r\n // Handles click event from anchor tags. Argument can be event object or path string.\r\n iVM.$handleRoute = iArg => router.handleRoute(iArg);\r\n\r\n // Returns the URL for an anchor tag.\r\n iVM.$route = (iRoute, iTarget) => router.route(iRoute, iTarget);\r\n\r\n // Executes the given route.\r\n iVM.$routeTo = iRoute => router.routeToRoute(iRoute);\r\n};\r\n\r\n// Provide function to load a view.\r\ndotnetify.react.router.$mount = function(iTargetSelector, iComponent, iProps, iCallbackFn) {\r\n return dotnetifyReactVMRouter.prototype.loadReactView(iTargetSelector, iComponent, null, iProps, iCallbackFn);\r\n};\r\n\r\n// Register the plugin to dotNetify.\r\ndotnetify.react.plugins['router'] = dotnetify.react.router;\r\n","import dotnetify from './dotnetify-react';\r\nimport './dotnetify-react.router';\r\nimport './ssr';\r\nimport Scope from './Scope';\r\nimport RouteLink from './RouteLink';\r\nimport RouteTarget from './RouteTarget';\r\n\r\nmodule.exports = Object.assign(dotnetify, { Scope, RouteLink, RouteTarget });\r\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://dotnetify/webpack/universalModuleDefinition","webpack://dotnetify/webpack/bootstrap","webpack://dotnetify/(webpack)/buildin/global.js","webpack://dotnetify/./src/dotnetify/react/dotnetify-react.js","webpack://dotnetify/./src/dotnetify/libs/utils.js","webpack://dotnetify/./src/dotnetify/libs/jquery-shim.js","webpack://dotnetify/external {\"commonjs\":\"react\",\"commonjs2\":\"react\",\"amd\":\"react\",\"root\":\"React\"}","webpack://dotnetify/./src/dotnetify/core/dotnetify-vm.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-hub-webapi.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-hub-local.js","webpack://dotnetify/external {\"commonjs\":\"@aspnet/signalr\",\"commonjs2\":\"@aspnet/signalr\",\"amd\":\"@aspnet/signalr\",\"root\":\"signalR\"}","webpack://dotnetify/./node_modules/jquery-deferred/lib/jquery-core.js","webpack://dotnetify/./node_modules/jquery-deferred/lib/jquery-callbacks.js","webpack://dotnetify/./node_modules/jquery-deferred/lib/jquery-deferred.js","webpack://dotnetify/./node_modules/jquery-deferred/index.js","webpack://dotnetify/(webpack)/buildin/module.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-hub.js","webpack://dotnetify/./src/dotnetify/core/dotnetify.js","webpack://dotnetify/./src/dotnetify/react/useConnect.js","webpack://dotnetify/./src/dotnetify/react/RouteTarget.js","webpack://dotnetify/./src/dotnetify/react/RouteLink.js","webpack://dotnetify/./node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack://dotnetify/./node_modules/prop-types/factoryWithThrowingShims.js","webpack://dotnetify/./node_modules/prop-types/index.js","webpack://dotnetify/./src/dotnetify/react/Scope.js","webpack://dotnetify/./src/dotnetify/react/ssr.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-vm-router.js","webpack://dotnetify/external {\"commonjs\":\"react-dom\",\"commonjs2\":\"react-dom\",\"amd\":\"react-dom\",\"root\":\"ReactDOM\"}","webpack://dotnetify/./src/dotnetify/react/dotnetify-react.vm-router.js","webpack://dotnetify/./src/dotnetify/libs/path.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-router.js","webpack://dotnetify/./src/dotnetify/react/dotnetify-react.router.js","webpack://dotnetify/./src/dotnetify/react/index.js"],"names":["window","global","dotnetify","_dotnetify","react","version","viewModels","plugins","controller","_hubs","init","iHub","self","hubInitialized","some","hub","start","isHubStarted","Object","keys","filter","vmId","$hub","forEach","$requested","startHub","responseEvent","subscribe","iVMId","iVMData","_responseVM","connectedEvent","$request","reconnectedEvent","mode","push","connect","iReact","iOptions","arguments","length","Error","vmArg","ssr","ssrConnect","hasOwnProperty","console","error","$destroy","setTimeout","component","props","state","setState","connectInfo","selectHub","options","dotnetifyVM","getViewModels","map","vm","checkServerSideException","$exceptionHandler","$update","addVMAccessor","utils","iStr","indexOf","substr","iStr1","iStr2","toLowerCase","iValue","slice","iEvent","Event","dispatchEvent","event","document","createEvent","initEvent","iArray","iFilter","Array","isArray","createEventEmitter","subscribers","emit","args","handled","subscriber","includes","x","fetch","iMethod","iUrl","iData","Promise","resolve","reject","request","XMLHttpRequest","open","onload","status","response","responseText","onerror","send","jQueryDeferred","require","jQueryShim","extend","selector","on","iHandler","addEventListener","bind","unbind","removeEventListener","events","handlers","idx","splice","triggerHandler","iArgs","type","arg","handler","apply","load","querySelector","innerHTML","call","abort","reason","support","cors","trim","inArray","iItem","makeArray","merge","iArray1","iArray2","prototype","isEmptyObject","iObj","ajax","onreadystatechange","readyState","_hasError","success","JSON","parse","url","setRequestHeader","contentType","data","getScript","iSuccess","done","promise","Deferred","head","getElementsByTagName","script","createElement","src","removeChild","appendChild","jQuery","exports","module","iComponent","iDotNetify","$vmId","$component","$options","$vmArg","$headers","$loaded","$itemKey","$dotnetify","getState","State","Props","prop","$","$getPlugins","plugin","$inject","isConnected","disposeVM","ex","handleConnectionStateChanged","updateVM","debug","log","debugFn","key","listName","item","$dispatch","$updateList","id","iVMUpdate","match","exec","$addList","$removeList","i","itemKey","$setItemKey","requestVM","vmData","$preProcess","$onLoad","$onUpdate","$ready","iItemKey","assign","iListName","iNewItem","items","dotNetifyHubWebApi","iBaseUrl","iOnRequest","connectionFailedEvent","_vmArgs","baseUrl","onRequest","iVMArgs","vmArgs","vmArgQuery","stringify","headers","then","catch","payload","createWebApiHub","create","normalize","replace","hasLocalVM","onConnect","dotNetifyHubLocal","$pushUpdate","update","onDispatch","onDestroy","signalRNetCore","dotnetifyHubFactory","dotnetifyHub","reconnectDelay","reconnectRetry","_startInfo","_init","server","request_VM","update_VM","dispose_VM","hubOptions","doneHandler","failHandler","forceRestart","_doneHandler","_failHandler","failHander","fail","err","iHubPath","iServerUrl","signalR","HubConnection","defineProperty","get","_connection","connection","connectionState","hubPath","_reconnectCount","_startDoneHandler","_startFailHandler","_disconnectedHandler","_stateChangedHandler","iNewState","_onDisconnected","_changeState","stateText","_startConnection","iHubOptions","iTransportArray","transport","shift","HubConnectionBuilder","withUrl","build","client","response_VM","onclose","transportOptions","webSockets","serverSentEvents","longPolling","disconnected","stateChanged","reconnect","iStartHubFunc","delay","invoke","undefined","makeProxyCallback","callback","registerHubProxies","instance","shouldSubscribe","memberKey","memberValue","subscriptionMethod","hubName","off","isFunction","hubConnection","createHubProxies","proxies","starting","_registerSubscribedHubs","createHubProxy","useDefaultPath","set","val","dotNetifyHub","connected","deferred","source","message","warn","newState","dotnetifyFactory","offline","isOffline","offlineTimeout","offlineCacheFn","_vmAccessors","connectionStateHandler","connectHandler","hubServerUrl","createHub","hubLib","initHub","onRequestHandler","vmConnectArgs","override","localHub","webApi","webApiHub","vmAccessor","iExceptionHandler","exception","name","ExceptionType","Message","reduce","prev","current","iState","iException","useConnect","useState","useEffect","_state","RouteTarget","elem","getElementById","initialHtml","__html","el","React","Component","router","RouteLink","handleClick","preventDefault","route","onClick","$handleRoute","style","className","$route","children","Scope","scope","context","scoped","scopedOptions","_this","dispatch","dispatchState","vmStates","displayName","propTypes","PropTypes","string","object","contextTypes","func","childContextTypes","isRequired","iVMArg","vmState","ssrState","fetched","iPath","iInitialStates","iOverrideRouteFn","iCallbackFn","iTimeout","urlPath","overrideUrl","text","insertBefore","firstChild","routed","fallback","clearTimeout","dotnetifyVMRouter","routes","RoutingState","Active","iArg","path","currentTarget","pathname","pushState","hasRoutingState","Root","_absRoot","absRoot","VMRoot","root","templates","Templates","$init","initRoot","urlPattern","template","UrlPattern","Id","mapUrl","toUrl","mapTo","param","iParams","routeTo","activeUrl","routeUrl","raiseRoutedEvent","iRoute","equal","Path","iTargetSelector","iViewUrl","iJsModuleUrl","unmountView","getScripts","split","when","callbackFn","iHtmlElement","iVmArg","mountViewFunc","target","iTarget","iJSModuleUrl","Target","ViewUrl","JSModuleUrl","iTemplate","force","TemplateId","RedirectRoot","redirectRoot","charAt","redirectRootPath","urlRedirect","absRootPath","Url","$template","pathToRoute","iDisableEvent","isRedirect","vmOther","$router","VMArg","onRouteEnter","redirect","loadView","dispatchActiveRoutingState","onRouteExit","redirectUrlPath","grep","startsWith","routeElem","dotnetifyReactVMRouter","iVM","iDotNetifyRouter","reactProps","vmRoot","endsWith","loadHtmlView","HTMLElement","loadHtmlElementView","loadReactView","iReactProps","reactElement","ReactDOM","render","e","unmountComponentAtNode","defined","core","rescue","fn","history","initial","title","supported","location","hash","popState","initialPop","popped","href","URL","listen","onpopstate","parameterize","params","possible_routes","j","compare","result","partition","search","join","passed_route","previous_route","matched_route","previous","do_exit","run","documentMode","onhashchange","setInterval","action","do_enter","to","enter","fns","concat","exit","parts","re","halt_execution","dotnetifyRouter","iFn","iUrlPath","matched","iTitle","initRouting","handleRoute","$routeTo","routeToRoute","$mount","iProps"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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AQqG,KAAKkF,SAAL,CAAevL,KAAf,CAAR;AAC9BH,qBAAW;AAAA,mBAAM,OAAKvB,aAAL,CAAmB6D,IAAnB,CAAwB3D,KAAxB,EAA+BwB,KAA/B,CAAN;AAAA,WAAX;AACD;AACF;AACF;;;8BAESxB,K,EAAO;AACf,UAAMP,OAAO6N,UAAUtN,KAAV,CAAb;AACA,UAAMgC,KAAK5D,OAAOqB,IAAP,CAAX;;AAEA,UAAI,QAAOuC,EAAP,yCAAOA,EAAP,OAAc,QAAd,IAA0B,OAAOA,GAAG8L,SAAV,IAAuB,UAArD,EAAiE;AAC/D9L,WAAG8L,SAAH,CAAa9N,KAAb;AACD;AACF;;;;;;kBAGY,IAAI0N,iBAAJ,E;QACNF,U,GAAAA,U;;;;;;;ACnFT,gD;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;AAGD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,UAAU,YAAY;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,UAAU,YAAY;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,QAAQ,YAAY;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;ACxJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,oCAAoC;AAC9C;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;AC3MA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA,MAAM;AACN,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,8CAA8C;AAC9C,KAAK;AACL;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,IAAI;;AAEJ;;AAEA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA,UAAU,YAAY;AACtB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;;;;;;;ACjKD,yC;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;;;;;;;;;;;;;;qjBCrBA;;;;;;;;;;;;;;;;;AAeA;;AACA;;;;;;;;AACA,IAAMO,iBAAiB,mBAAA7I,CAAQ,CAAR,CAAvB;AACA,IAAI8E,IAAI7E,oBAAR;;AAEA,IAAM/G,SAASA,UAAUC,MAAV,IAAoB,EAAnC;;IAEa2P,mB,WAAAA,mB;;;;;;;6BACK;AACd,UAAIC,eAAe;AACjBxP,iBAAS,OADQ;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vf,yBAAUE,KAAV,CAAgBwX,MAAhD,CAAf;;AAEA;AACA6H,MAAIZ,OAAJ,GAAcjH,MAAd;;AAEA;AACA6H,MAAIvH,YAAJ,GAAmB;AAAA,WAAQN,OAAO+L,WAAP,CAAmB7I,IAAnB,CAAR;AAAA,GAAnB;;AAEA;AACA2E,MAAIpH,MAAJ,GAAa,UAACqE,MAAD,EAASe,OAAT;AAAA,WAAqB7F,OAAOI,KAAP,CAAa0E,MAAb,EAAqBe,OAArB,CAArB;AAAA,GAAb;;AAEA;AACAgC,MAAImE,QAAJ,GAAe;AAAA,WAAUhM,OAAOiM,YAAP,CAAoBnH,MAApB,CAAV;AAAA,GAAf;AACD,CAdD;;AAgBA;AACAxc,yBAAUE,KAAV,CAAgBwX,MAAhB,CAAuBkM,MAAvB,GAAgC,UAASjH,eAAT,EAA0B/R,UAA1B,EAAsCiZ,MAAtC,EAA8C/J,WAA9C,EAA2D;AACzF,SAAOwF,yBAAuBvW,SAAvB,CAAiCgX,aAAjC,CAA+CpD,eAA/C,EAAgE/R,UAAhE,EAA4E,IAA5E,EAAkFiZ,MAAlF,EAA0F/J,WAA1F,CAAP;AACD,CAFD;;AAIA;AACA9Z,yBAAUE,KAAV,CAAgBG,OAAhB,CAAwB,QAAxB,IAAoCL,yBAAUE,KAAV,CAAgBwX,MAApD,C;;;;;;;;;AC7CA;;;;AACA;;AACA;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;AAEA/M,OAAOD,OAAP,GAAiB1J,OAAO2M,MAAP,CAAc3N,wBAAd,EAAyB,EAAEqY,sBAAF,EAASV,8BAAT,EAAoBT,kCAApB,EAAiCJ,gCAAjC,EAAzB,CAAjB,C","file":"dotnetify-react.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"@aspnet/signalr\"), require(\"react-dom\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\", \"@aspnet/signalr\", \"react-dom\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"dotnetify\"] = factory(require(\"react\"), require(\"@aspnet/signalr\"), require(\"react-dom\"));\n\telse\n\t\troot[\"dotnetify\"] = factory(root[\"React\"], root[\"signalR\"], root[\"ReactDOM\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__4__, __WEBPACK_EXTERNAL_MODULE__8__, __WEBPACK_EXTERNAL_MODULE__25__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 30);\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport _dotnetify from '../core/dotnetify';\r\nimport dotnetifyVM from '../core/dotnetify-vm';\r\n\r\nconst window = window || global || {};\r\nlet dotnetify = window.dotnetify || _dotnetify;\r\n\r\ndotnetify.react = {\r\n version: '3.0.0',\r\n viewModels: {},\r\n plugins: {},\r\n controller: dotnetify,\r\n\r\n // Internal variables.\r\n _hubs: [],\r\n\r\n // Initializes connection to SignalR server hub.\r\n init: function(iHub) {\r\n const self = dotnetify.react;\r\n const hubInitialized = self._hubs.some(hub => hub === iHub);\r\n\r\n const start = function() {\r\n if (!iHub.isHubStarted)\r\n Object.keys(self.viewModels)\r\n .filter(vmId => self.viewModels[vmId].$hub === iHub)\r\n .forEach(vmId => (self.viewModels[vmId].$requested = false));\r\n\r\n dotnetify.startHub(iHub);\r\n };\r\n\r\n if (!hubInitialized) {\r\n iHub.responseEvent.subscribe((iVMId, iVMData) => self._responseVM(iVMId, iVMData));\r\n iHub.connectedEvent.subscribe(() =>\r\n Object.keys(self.viewModels)\r\n .filter(vmId => self.viewModels[vmId].$hub === iHub && !self.viewModels[vmId].$requested)\r\n .forEach(vmId => self.viewModels[vmId].$request())\r\n );\r\n iHub.reconnectedEvent.subscribe(start);\r\n\r\n if (iHub.mode !== 'local') self._hubs.push(iHub);\r\n }\r\n\r\n start();\r\n },\r\n\r\n // Connects to a server view model.\r\n connect: function(iVMId, iReact, iOptions) {\r\n if (arguments.length < 2) throw new Error('[dotNetify] Missing arguments. Usage: connect(vmId, component) ');\r\n\r\n const vmArg = iOptions && iOptions['vmArg'];\r\n\r\n if (dotnetify.ssr && dotnetify.react.ssrConnect) {\r\n return dotnetify.react.ssrConnect(iVMId, iReact, vmArg);\r\n }\r\n\r\n const self = dotnetify.react;\r\n if (self.viewModels.hasOwnProperty(iVMId)) {\r\n console.error(\r\n `Component is attempting to connect to an already active '${iVMId}'. ` +\r\n ` If it's from a dismounted component, you must add vm.$destroy to componentWillUnmount().`\r\n );\r\n self.viewModels[iVMId].$destroy();\r\n return setTimeout(() => self.connect(iVMId, iReact, iOptions));\r\n }\r\n\r\n const component = {\r\n get props() {\r\n return iReact.props;\r\n },\r\n get state() {\r\n return iReact.state;\r\n },\r\n setState(state) {\r\n iReact.setState(state);\r\n }\r\n };\r\n\r\n const connectInfo = dotnetify.selectHub({ vmId: iVMId, options: iOptions, hub: null });\r\n self.viewModels[iVMId] = new dotnetifyVM(connectInfo.vmId, component, connectInfo.options, self, connectInfo.hub);\r\n if (connectInfo.hub) self.init(connectInfo.hub);\r\n\r\n return self.viewModels[iVMId];\r\n },\r\n\r\n // Get all view models.\r\n getViewModels: function() {\r\n const self = dotnetify.react;\r\n return Object.keys(self.viewModels).map(vmId => self.viewModels[vmId]);\r\n },\r\n\r\n _responseVM: function(iVMId, iVMData) {\r\n const self = dotnetify.react;\r\n\r\n if (self.viewModels.hasOwnProperty(iVMId)) {\r\n const vm = self.viewModels[iVMId];\r\n dotnetify.checkServerSideException(iVMId, iVMData, vm.$exceptionHandler);\r\n vm.$update(iVMData);\r\n return true;\r\n }\r\n return false;\r\n }\r\n};\r\n\r\ndotnetify.addVMAccessor(dotnetify.react.getViewModels);\r\n\r\nexport default dotnetify;\r\n","/* \r\nCopyright 2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nconst window = window || global || {};\r\n\r\nclass utils {\r\n // Trim slashes from start and end of string.\r\n trim(iStr) {\r\n if (typeof iStr !== 'string') return '';\r\n\r\n while (iStr.indexOf('/', iStr.length - 1) >= 0) iStr = iStr.substr(0, iStr.length - 1);\r\n while (iStr.indexOf('/') == 0) iStr = iStr.substr(1, iStr.length - 1);\r\n return iStr;\r\n }\r\n\r\n // Match two strings case-insensitive.\r\n equal(iStr1, iStr2) {\r\n return iStr1 != null && iStr2 != null && iStr1.toLowerCase() == iStr2.toLowerCase();\r\n }\r\n\r\n // Whether the string starts or ends with a value.\r\n startsWith(iStr, iValue) {\r\n return iStr.toLowerCase().slice(0, iValue.length) == iValue.toLowerCase();\r\n }\r\n\r\n endsWith(iStr, iValue) {\r\n return iValue == '' || iStr.toLowerCase().slice(-iValue.length) == iValue.toLowerCase();\r\n }\r\n\r\n // Dispatch event with IE polyfill.\r\n dispatchEvent(iEvent) {\r\n if (typeof Event === 'function') window.dispatchEvent(new Event(iEvent));\r\n else {\r\n var event = document.createEvent('CustomEvent');\r\n event.initEvent(iEvent, true, true);\r\n window.dispatchEvent(event);\r\n }\r\n }\r\n\r\n grep(iArray, iFilter) {\r\n return Array.isArray(iArray) ? iArray.filter(iFilter) : [];\r\n }\r\n}\r\n\r\nexport const createEventEmitter = _ => {\r\n let subscribers = [];\r\n return {\r\n emit(...args) {\r\n let handled = false;\r\n subscribers.forEach(subscriber => {\r\n handled = subscriber(...args) || handled;\r\n });\r\n return handled;\r\n },\r\n\r\n subscribe(subscriber) {\r\n !subscribers.includes(subscriber) && subscribers.push(subscriber);\r\n return () => (subscribers = subscribers.filter(x => x !== subscriber));\r\n }\r\n };\r\n};\r\n\r\nexport const fetch = (iMethod, iUrl, iData, iOptions) => {\r\n return new Promise((resolve, reject) => {\r\n let request = new window.XMLHttpRequest();\r\n request.open(iMethod, iUrl, true);\r\n if (typeof iOptions == 'function') iOptions(request);\r\n\r\n request.onload = function() {\r\n if (request.status >= 200 && request.status < 400) {\r\n var response = request.responseText;\r\n resolve(response);\r\n }\r\n else reject(request);\r\n };\r\n request.onerror = function() {\r\n reject(request);\r\n };\r\n request.send(iData);\r\n });\r\n};\r\n\r\nexport default new utils();\r\n","/* \r\nCopyright 2017 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\n\r\nconst window = window || global || {};\r\n\r\nconst jQueryDeferred = require('jquery-deferred');\r\nconst jQueryShim = jQueryDeferred.extend(\r\n function(selector) {\r\n if (selector === window || selector.document)\r\n return {\r\n 0: selector,\r\n on: function(iEvent, iHandler) {\r\n window.addEventListener(iEvent, iHandler);\r\n },\r\n bind: function(iEvent, iHandler) {\r\n window.addEventListener(iEvent, iHandler, false);\r\n },\r\n unbind: function(iEvent, iHandler) {\r\n window.removeEventListener(iEvent, iHandler, false);\r\n }\r\n };\r\n\r\n if (typeof selector !== 'string') selector.events = selector.events || {};\r\n\r\n return {\r\n 0: selector,\r\n\r\n bind: function(iEvent, iHandler) {\r\n var event = selector.events[iEvent] || [];\r\n event.push(iHandler);\r\n selector.events[iEvent] = event;\r\n },\r\n\r\n unbind: function(iEvent, iHandler) {\r\n var handlers = selector.events[iEvent] || [];\r\n if (iHandler) {\r\n var idx = handlers.indexOf(iHandler);\r\n if (idx !== -1) handlers.splice(idx, 1);\r\n }\r\n else handlers = [];\r\n selector.events[iEvent] = handlers;\r\n },\r\n\r\n triggerHandler: function(iEvent, iArgs) {\r\n var handlers = selector.events[iEvent] || [];\r\n var args = [ { type: iEvent } ];\r\n if (Array.isArray(iArgs))\r\n iArgs.forEach(function(arg) {\r\n args.push(arg);\r\n });\r\n else if (iArgs) args.push(iArgs);\r\n handlers.forEach(function(handler) {\r\n handler.apply(this, args);\r\n });\r\n },\r\n\r\n load: function(iUrl, iArgs, iHandler) {\r\n var request = new window.XMLHttpRequest();\r\n request.open('GET', iUrl, true);\r\n request.onload = function() {\r\n if (request.status >= 200 && request.status < 400) {\r\n var response = request.responseText;\r\n document.querySelector(selector).innerHTML = response;\r\n iHandler.call(document.querySelector(selector));\r\n }\r\n };\r\n request.send();\r\n return {\r\n abort: function(reason) {\r\n return request.abort(reason);\r\n }\r\n };\r\n }\r\n };\r\n },\r\n jQueryDeferred,\r\n {\r\n support: { cors: true },\r\n\r\n trim: function(iStr) {\r\n return typeof iStr === 'string' ? iStr.trim() : iStr;\r\n },\r\n\r\n inArray: function(iArray, iItem) {\r\n return iArray.indexOf(iItem) !== -1;\r\n },\r\n\r\n makeArray: function makeArray(iArray) {\r\n return [].slice.call(iArray, 0);\r\n },\r\n\r\n merge: function(iArray1, iArray2) {\r\n Array.prototype.push.apply(iArray1, iArray2);\r\n return iArray1;\r\n },\r\n\r\n isEmptyObject: function(iObj) {\r\n return !iObj || Object.keys(iObj).length === 0;\r\n },\r\n\r\n ajax: function(iOptions) {\r\n var request = new window.XMLHttpRequest();\r\n request.onreadystatechange = function() {\r\n if (request.readyState !== 4) return;\r\n if (request.status === 200 && !request._hasError) {\r\n try {\r\n iOptions.success && iOptions.success(JSON.parse(request.responseText));\r\n } catch (error) {\r\n iOptions.success && iOptions.success(request.responseText);\r\n }\r\n }\r\n else iOptions.error && iOptions.error(request);\r\n };\r\n request.open(iOptions.type, iOptions.url);\r\n request.setRequestHeader('content-type', iOptions.contentType);\r\n request.send(iOptions.data.data && 'data=' + iOptions.data.data);\r\n return {\r\n abort: function(reason) {\r\n return request.abort(reason);\r\n }\r\n };\r\n },\r\n\r\n getScript: function(iUrl, iSuccess) {\r\n var done = false;\r\n var promise = jQueryDeferred.Deferred();\r\n var head = document.getElementsByTagName('head')[0];\r\n var script = document.createElement('script');\r\n script.src = iUrl;\r\n script.onload = script.onreadystatechange = function() {\r\n if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) {\r\n done = true;\r\n script.onload = script.onreadystatechange = null;\r\n head.removeChild(script);\r\n if (typeof iSuccess === 'function') iSuccess();\r\n promise.resolve();\r\n }\r\n };\r\n head.appendChild(script);\r\n return promise;\r\n }\r\n }\r\n);\r\n\r\nif (typeof window !== 'undefined') window.jQuery = window.jQuery || jQueryShim;\r\n\r\nif (typeof exports === 'object' && typeof module === 'object') module.exports = jQueryShim;\r\n","module.exports = __WEBPACK_EXTERNAL_MODULE__4__;","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport $ from '../libs/jquery-shim';\r\n\r\nconst window = window || global || {};\r\n\r\n// Client-side view model that acts as a proxy of the server view model.\r\nexport default class dotnetifyVM {\r\n // iVMId - identifies the view model.\r\n // iComponent - component object.\r\n // iOptions - Optional configuration options:\r\n // getState: state accessor.\r\n // setState: state mutator.\r\n // vmArg: view model arguments.\r\n // headers: request headers, for things like authentication token.\r\n // exceptionHandler: called when receiving server-side exception.\r\n // iDotNetify - framework-specific dotNetify library.\r\n // iHub - hub connection.\r\n constructor(iVMId, iComponent, iOptions, iDotNetify, iHub) {\r\n this.$vmId = iVMId;\r\n this.$component = iComponent;\r\n this.$options = iOptions || {};\r\n this.$vmArg = iOptions && iOptions['vmArg'];\r\n this.$headers = iOptions && iOptions['headers'];\r\n this.$exceptionHandler = iOptions && iOptions['exceptionHandler'];\r\n this.$requested = false;\r\n this.$loaded = false;\r\n this.$itemKey = {};\r\n this.$dotnetify = iDotNetify;\r\n this.$hub = iHub;\r\n\r\n let getState = iOptions && iOptions['getState'];\r\n let setState = iOptions && iOptions['setState'];\r\n getState = typeof getState === 'function' ? getState : () => iComponent.state;\r\n setState = typeof setState === 'function' ? setState : state => iComponent.setState(state);\r\n\r\n this.State = state => (typeof state === 'undefined' ? getState() : setState(state));\r\n this.Props = prop => this.$component.props && this.$component.props[prop];\r\n\r\n const vmArg = this.Props('vmArg');\r\n if (vmArg) this.$vmArg = $.extend(this.$vmArg, vmArg);\r\n\r\n // Inject plugin functions into this view model.\r\n this.$getPlugins().map(plugin => (typeof plugin['$inject'] == 'function' ? plugin.$inject(this) : null));\r\n }\r\n\r\n // Disposes the view model, both here and on the server.\r\n $destroy() {\r\n // Call any plugin's $destroy function if provided.\r\n this.$getPlugins().map(plugin => (typeof plugin['$destroy'] == 'function' ? plugin.$destroy.apply(this) : null));\r\n\r\n if (this.$hub.isConnected) {\r\n try {\r\n this.$hub.disposeVM(this.$vmId);\r\n } catch (ex) {\r\n this.$dotnetify.controller.handleConnectionStateChanged('error', ex, this.$hub);\r\n }\r\n }\r\n\r\n delete this.$dotnetify.viewModels[this.$vmId];\r\n }\r\n\r\n // Dispatches a value to the server view model.\r\n // iValue - Value to dispatch.\r\n $dispatch(iValue) {\r\n if (this.$hub.isConnected) {\r\n const controller = this.$dotnetify.controller;\r\n try {\r\n this.$hub.updateVM(this.$vmId, iValue);\r\n\r\n if (controller.debug) {\r\n console.log('[' + this.$vmId + '] sent> ');\r\n console.log(iValue);\r\n\r\n controller.debugFn && controller.debugFn(this.$vmId, 'sent', iValue);\r\n }\r\n } catch (ex) {\r\n controller.handleConnectionStateChanged('error', ex, this.$hub);\r\n }\r\n }\r\n }\r\n\r\n // Dispatches a state value to the server view model.\r\n // iValue - State value to dispatch.\r\n $dispatchListState(iValue) {\r\n for (var listName in iValue) {\r\n const key = this.$itemKey[listName];\r\n if (!key) {\r\n console.error(`[${this.$vmId}] missing item key for '${listName}'; add ${listName}_itemKey property to the view model.`);\r\n return;\r\n }\r\n var item = iValue[listName];\r\n if (!item[key]) {\r\n console.error(`[${this.$vmId}] couldn't dispatch data from '${listName}' due to missing property '${key}'.`);\r\n console.error(item);\r\n return;\r\n }\r\n\r\n Object.keys(item).forEach(prop => {\r\n if (prop != key) {\r\n let state = {};\r\n state[listName + '.$' + item[key] + '.' + prop] = item[prop];\r\n this.$dispatch(state);\r\n }\r\n });\r\n this.$updateList(listName, item);\r\n }\r\n }\r\n\r\n $getPlugins() {\r\n return Object.keys(this.$dotnetify.plugins).map(id => this.$dotnetify.plugins[id]);\r\n }\r\n\r\n // Preprocess view model update from the server before we set the state.\r\n $preProcess(iVMUpdate) {\r\n const vm = this;\r\n\r\n for (var prop in iVMUpdate) {\r\n // Look for property that end with '_add'. Interpret the value as a list item to be added\r\n // to an existing list whose property name precedes that suffix.\r\n var match = /(.*)_add/.exec(prop);\r\n if (match != null) {\r\n var listName = match[1];\r\n if (Array.isArray(this.State()[listName])) vm.$addList(listName, iVMUpdate[prop]);\r\n else console.error('unable to resolve ' + prop);\r\n delete iVMUpdate[prop];\r\n continue;\r\n }\r\n\r\n // Look for property that end with '_update'. Interpret the value as a list item to be updated\r\n // to an existing list whose property name precedes that suffix.\r\n var match = /(.*)_update/.exec(prop);\r\n if (match != null) {\r\n var listName = match[1];\r\n if (Array.isArray(this.State()[listName])) vm.$updateList(listName, iVMUpdate[prop]);\r\n else console.error('[' + this.$vmId + \"] '\" + listName + \"' is not found or not an array.\");\r\n delete iVMUpdate[prop];\r\n continue;\r\n }\r\n\r\n // Look for property that end with '_remove'. Interpret the value as a list item key to remove\r\n // from an existing list whose property name precedes that suffix.\r\n var match = /(.*)_remove/.exec(prop);\r\n if (match != null) {\r\n var listName = match[1];\r\n if (Array.isArray(this.State()[listName])) {\r\n var key = this.$itemKey[listName];\r\n if (key != null)\r\n vm.$removeList(listName, function(i) {\r\n return i[key] == iVMUpdate[prop];\r\n });\r\n else console.error(`[${this.$vmId}] missing item key for '${listName}'; add ${listName}_itemKey property to the view model.`);\r\n }\r\n else console.error(`[${this.$vmId}] '${listName}' is not found or not an array.`);\r\n delete iVMUpdate[prop];\r\n continue;\r\n }\r\n\r\n // Look for property that end with '_itemKey'. Interpret the value as the property name that will\r\n // uniquely identify items in the list.\r\n var match = /(.*)_itemKey/.exec(prop);\r\n if (match != null) {\r\n var listName = match[1];\r\n var itemKey = {};\r\n itemKey[listName] = iVMUpdate[prop];\r\n vm.$setItemKey(itemKey);\r\n delete iVMUpdate[prop];\r\n continue;\r\n }\r\n }\r\n }\r\n\r\n // Requests state from the server view model.\r\n $request() {\r\n if (this.$hub.isConnected) this.$hub.requestVM(this.$vmId, { $vmArg: this.$vmArg, $headers: this.$headers });\r\n this.$requested = true;\r\n }\r\n\r\n // Updates state from the server view model to the view.\r\n // iVMData - Serialized state from the server.\r\n $update(iVMData) {\r\n const controller = this.$dotnetify.controller;\r\n if (controller.debug) {\r\n console.log('[' + this.$vmId + '] received> ');\r\n console.log(JSON.parse(iVMData));\r\n\r\n controller.debugFn && controller.debugFn(this.$vmId, 'received', JSON.parse(iVMData));\r\n }\r\n let vmData = JSON.parse(iVMData);\r\n this.$preProcess(vmData);\r\n\r\n let state = this.State();\r\n state = $.extend({}, state, vmData);\r\n this.State(state);\r\n\r\n if (!this.$loaded) this.$onLoad();\r\n else this.$onUpdate(vmData);\r\n }\r\n\r\n // Handles initial view model load event.\r\n $onLoad() {\r\n this.$getPlugins().map(plugin => (typeof plugin['$ready'] == 'function' ? plugin.$ready.apply(this) : null));\r\n this.$loaded = true;\r\n }\r\n\r\n // Handles view model update event.\r\n $onUpdate(vmData) {\r\n this.$getPlugins().map(plugin => (typeof plugin['$update'] == 'function' ? plugin.$update.apply(this, [ vmData ]) : null));\r\n }\r\n\r\n // *** CRUD Functions ***\r\n\r\n // Sets items key to identify individual items in a list.\r\n // Accepts object literal: { \"\": \"\", ... }\r\n $setItemKey(iItemKey) {\r\n Object.assign(this.$itemKey, iItemKey);\r\n }\r\n\r\n //// Adds a new item to a state array.\r\n $addList(iListName, iNewItem) {\r\n // Check if the list already has an item with the same key. If so, replace it.\r\n var key = this.$itemKey[iListName];\r\n if (key != null) {\r\n if (!iNewItem.hasOwnProperty(key)) {\r\n console.error(`[${this.$vmId}] couldn't add item to '${iListName}' due to missing property '${key}'.`);\r\n return;\r\n }\r\n var match = this.State()[iListName].filter(function(i) {\r\n return i[key] == iNewItem[key];\r\n });\r\n if (match.length > 0) {\r\n console.error(`[${this.$vmId}] couldn't add item to '${iListName}' because the key already exists.`);\r\n return;\r\n }\r\n }\r\n\r\n let items = this.State()[iListName];\r\n items.push(iNewItem);\r\n\r\n let state = {};\r\n state[iListName] = items;\r\n this.State(state);\r\n }\r\n\r\n // Removes an item from a state array.\r\n $removeList(iListName, iFilter) {\r\n let state = {};\r\n state[iListName] = this.State()[iListName].filter(i => !iFilter(i));\r\n this.State(state);\r\n }\r\n\r\n //// Updates existing item to an observable array.\r\n $updateList(iListName, iNewItem) {\r\n // Check if the list already has an item with the same key. If so, update it.\r\n let key = this.$itemKey[iListName];\r\n if (key != null) {\r\n if (!iNewItem.hasOwnProperty(key)) {\r\n console.error(`[${this.$vmId}] couldn't update item to '${iListName}' due to missing property '${key}'.`);\r\n return;\r\n }\r\n var state = {};\r\n state[iListName] = this.State()[iListName].map(function(i) {\r\n return i[key] == iNewItem[key] ? $.extend(i, iNewItem) : i;\r\n });\r\n this.State(state);\r\n }\r\n else console.error(`[${this.$vmId}] missing item key for '${iListName}'; add '${iListName}_itemKey' property to the view model.`);\r\n }\r\n}\r\n","/* \r\nCopyright 2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport { createEventEmitter, fetch } from '../libs/utils';\r\n\r\nexport class dotNetifyHubWebApi {\r\n mode = 'webapi';\r\n debug = false;\r\n isConnected = false;\r\n isHubStarted = false;\r\n\r\n responseEvent = createEventEmitter();\r\n reconnectedEvent = createEventEmitter();\r\n connectedEvent = createEventEmitter();\r\n connectionFailedEvent = createEventEmitter();\r\n\r\n _vmArgs = {};\r\n\r\n constructor(iBaseUrl, iOnRequest) {\r\n this.baseUrl = iBaseUrl || '';\r\n this.onRequest = iOnRequest;\r\n }\r\n\r\n static create(iBaseUrl, iOnRequest) {\r\n return new dotNetifyHubWebApi(iBaseUrl, iOnRequest);\r\n }\r\n\r\n startHub() {\r\n this.isConnected = true;\r\n this.isHubStarted = true;\r\n this.connectedEvent.emit();\r\n }\r\n\r\n requestVM(iVMId, iVMArgs) {\r\n const vmArgs = iVMArgs || {};\r\n const vmArgQuery = vmArgs.$vmArg ? '?vmarg=' + JSON.stringify(vmArgs.$vmArg) : '';\r\n const headers = vmArgs.$headers || {};\r\n\r\n this._vmArgs[iVMId] = vmArgs;\r\n const url = this.baseUrl + `/api/dotnetify/vm/${iVMId}${vmArgQuery}`;\r\n\r\n fetch('GET', url, null, request => {\r\n Object.keys(headers).forEach(key => request.setRequestHeader(key, headers[key]));\r\n if (typeof this.onRequest == 'function') this.onRequest(url, request);\r\n })\r\n .then(response => {\r\n this.responseEvent.emit(iVMId, response);\r\n })\r\n .catch(request => console.error(`[${iVMId}] Request failed`, request));\r\n }\r\n\r\n updateVM(iVMId, iValue) {\r\n const vmArgs = this._vmArgs[iVMId] || {};\r\n const vmArgQuery = vmArgs.$vmArg ? '?vmarg=' + JSON.stringify(vmArgs.$vmArg) : '';\r\n const headers = vmArgs.$headers || {};\r\n const payload = typeof iValue == 'object' ? JSON.stringify(iValue) : iValue;\r\n\r\n const url = this.baseUrl + `/api/dotnetify/vm/${iVMId}${vmArgQuery}`;\r\n\r\n fetch('POST', url, payload, request => {\r\n request.setRequestHeader('Content-Type', 'application/json');\r\n Object.keys(headers).forEach(key => request.setRequestHeader(key, headers[key]));\r\n if (typeof this.onRequest == 'function') this.onRequest(url, request, payload);\r\n })\r\n .then(response => {\r\n this.responseEvent.emit(iVMId, response);\r\n })\r\n .catch(request => console.error(`[${iVMId}] Update failed`, request));\r\n }\r\n\r\n disposeVM(iVMId) {\r\n delete this._vmArgs[iVMId];\r\n }\r\n}\r\n\r\nconst createWebApiHub = dotNetifyHubWebApi.create;\r\n\r\nexport { createWebApiHub };\r\nexport default dotNetifyHubWebApi.create();\r\n","/* \r\nCopyright 2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport { createEventEmitter } from '../libs/utils';\r\n\r\nconst window = window || global || {};\r\n\r\nconst normalize = iVMId => iVMId && iVMId.replace(/\\./g, '_');\r\nconst hasLocalVM = iVMId => {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n return typeof vm == 'object' && typeof vm.onConnect == 'function';\r\n};\r\n\r\nexport class dotNetifyHubLocal {\r\n mode = 'local';\r\n debug = false;\r\n isConnected = false;\r\n isHubStarted = false;\r\n\r\n responseEvent = createEventEmitter();\r\n reconnectedEvent = createEventEmitter();\r\n connectedEvent = createEventEmitter();\r\n connectionFailedEvent = createEventEmitter();\r\n\r\n startHub() {\r\n this.isConnected = true;\r\n this.isHubStarted = true;\r\n this.connectedEvent.emit();\r\n }\r\n\r\n requestVM(iVMId, iVMArgs) {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n\r\n if (typeof vm === 'object' && typeof vm.onConnect == 'function') {\r\n if (this.debug) console.log(`[${iVMId}] *** local mode ***`);\r\n\r\n vm.$pushUpdate = update => {\r\n if (typeof update == 'object') update = JSON.stringify(update);\r\n setTimeout(() => this.responseEvent.emit(iVMId, update));\r\n };\r\n\r\n vm.$pushUpdate(vm.onConnect(iVMArgs) || {});\r\n }\r\n }\r\n\r\n updateVM(iVMId, iValue) {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n\r\n if (typeof vm === 'object' && typeof vm.onDispatch == 'function') {\r\n let state = vm.onDispatch(iValue);\r\n if (state) {\r\n if (typeof state == 'object') state = JSON.stringify(state);\r\n setTimeout(() => this.responseEvent.emit(iVMId, state));\r\n }\r\n }\r\n }\r\n\r\n disposeVM(iVMId) {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n\r\n if (typeof vm === 'object' && typeof vm.onDestroy == 'function') {\r\n vm.onDestroy(iVMId);\r\n }\r\n }\r\n}\r\n\r\nexport default new dotNetifyHubLocal();\r\nexport { hasLocalVM };\r\n","module.exports = __WEBPACK_EXTERNAL_MODULE__8__;","/**\n* jQuery core object.\n*\n* Worker with jQuery deferred\n*\n* Code from: https://github.com/jquery/jquery/blob/master/src/core.js\n*\n*/\n\nvar jQuery = module.exports = {\n\ttype: type\n\t, isArray: isArray\n\t, isFunction: isFunction\n\t, isPlainObject: isPlainObject\n\t, each: each\n\t, extend: extend\n\t, noop: function() {}\n};\n\nvar toString = Object.prototype.toString;\n\nvar class2type = {};\n// Populate the class2type map\n\"Boolean Number String Function Array Date RegExp Object\".split(\" \").forEach(function(name) {\n\tclass2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n});\n\n\nfunction type( obj ) {\n\treturn obj == null ?\n\t\tString( obj ) :\n\t\t\tclass2type[ toString.call(obj) ] || \"object\";\n}\n\nfunction isFunction( obj ) {\n\treturn jQuery.type(obj) === \"function\";\n}\n\nfunction isArray( obj ) {\n\treturn jQuery.type(obj) === \"array\";\n}\n\nfunction each( object, callback, args ) {\n\tvar name, i = 0,\n\tlength = object.length,\n\tisObj = length === undefined || isFunction( object );\n\n\tif ( args ) {\n\t\tif ( isObj ) {\n\t\t\tfor ( name in object ) {\n\t\t\t\tif ( callback.apply( object[ name ], args ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( ; i < length; ) {\n\t\t\t\tif ( callback.apply( object[ i++ ], args ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// A special, fast, case for the most common use of each\n\t} else {\n\t\tif ( isObj ) {\n\t\t\tfor ( name in object ) {\n\t\t\t\tif ( callback.call( object[ name ], name, object[ name ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( ; i < length; ) {\n\t\t\t\tif ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn object;\n}\n\nfunction isPlainObject( obj ) {\n\t// Must be an Object.\n\tif ( !obj || jQuery.type(obj) !== \"object\" ) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\nfunction extend() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\ttarget = arguments[0] || {},\n\ti = 1,\n\tlength = arguments.length,\n\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif ( typeof target === \"boolean\" ) {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\n\t// Handle case when target is a string or something (possible in deep copy)\n\tif ( typeof target !== \"object\" && !jQuery.isFunction(target) ) {\n\t\ttarget = {};\n\t}\n\n\t// extend jQuery itself if only one argument is passed\n\tif ( length === i ) {\n\t\ttarget = this;\n\t\t--i;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\t\t// Only deal with non-null/undefined values\n\t\tif ( (options = arguments[ i ]) != null ) {\n\t\t\t// Extend the base object\n\t\t\tfor ( name in options ) {\n\t\t\t\tsrc = target[ name ];\n\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif ( target === copy ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {\n\t\t\t\t\tif ( copyIsArray ) {\n\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\tclone = src && jQuery.isArray(src) ? src : [];\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclone = src && jQuery.isPlainObject(src) ? src : {};\n\t\t\t\t\t}\n\n\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\n\n","var jQuery = module.exports = require(\"./jquery-core.js\"),\n\tcore_rspace = /\\s+/;\n/**\n* jQuery Callbacks\n*\n* Code from: https://github.com/jquery/jquery/blob/master/src/callbacks.js\n*\n*/\n\n\n// String to Object options format cache\nvar optionsCache = {};\n\n// Convert String-formatted options into Object-formatted ones and store in cache\nfunction createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.split( core_rspace ), function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n\t// Convert options from String-formatted to Object-formatted if needed\n\t// (we check in cache first)\n\toptions = typeof options === \"string\" ?\n\t\t( optionsCache[ options ] || createOptions( options ) ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Last fire value (for non-forgettable lists)\n\t\tmemory,\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\t\t// Flag to know if list is currently firing\n\t\tfiring,\n\t\t// First callback to fire (used internally by add and fireWith)\n\t\tfiringStart,\n\t\t// End of the loop when firing\n\t\tfiringLength,\n\t\t// Index of currently firing callback (modified by remove if needed)\n\t\tfiringIndex,\n\t\t// Actual callback list\n\t\tlist = [],\n\t\t// Stack of fire calls for repeatable lists\n\t\tstack = !options.once && [],\n\t\t// Fire callbacks\n\t\tfire = function( data ) {\n\t\t\tmemory = options.memory && data;\n\t\t\tfired = true;\n\t\t\tfiringIndex = firingStart || 0;\n\t\t\tfiringStart = 0;\n\t\t\tfiringLength = list.length;\n\t\t\tfiring = true;\n\t\t\tfor ( ; list && firingIndex < firingLength; firingIndex++ ) {\n\t\t\t\tif ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {\n\t\t\t\t\tmemory = false; // To prevent further calls using add\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfiring = false;\n\t\t\tif ( list ) {\n\t\t\t\tif ( stack ) {\n\t\t\t\t\tif ( stack.length ) {\n\t\t\t\t\t\tfire( stack.shift() );\n\t\t\t\t\t}\n\t\t\t\t} else if ( memory ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t} else {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t// Actual Callbacks object\n\t\tself = {\n\t\t\t// Add a callback or a collection of callbacks to the list\n\t\t\tadd: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\t// First, we save the current length\n\t\t\t\t\tvar start = list.length;\n\t\t\t\t\t(function add( args ) {\n\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {\n\t\t\t\t\t\t\tvar type = jQuery.type( arg );\n\t\t\t\t\t\t\tif ( type === \"function\" ) {\n\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {\n\t\t\t\t\t\t\t\t\tlist.push( arg );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if ( arg && arg.length && type !== \"string\" ) {\n\t\t\t\t\t\t\t\t// Inspect recursively\n\t\t\t\t\t\t\t\tadd( arg );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t})( arguments );\n\t\t\t\t\t// Do we need to add the callbacks to the\n\t\t\t\t\t// current firing batch?\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tfiringLength = list.length;\n\t\t\t\t\t// With memory, if we're not firing then\n\t\t\t\t\t// we should call right away\n\t\t\t\t\t} else if ( memory ) {\n\t\t\t\t\t\tfiringStart = start;\n\t\t\t\t\t\tfire( memory );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\t\tvar index;\n\t\t\t\t\t\twhile( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\t\tlist.splice( index, 1 );\n\t\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\t\t\tif ( index <= firingLength ) {\n\t\t\t\t\t\t\t\t\tfiringLength--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\t\t\tfiringIndex--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Control if a given callback is in the list\n\t\t\thas: function( fn ) {\n\t\t\t\treturn jQuery.inArray( fn, list ) > -1;\n\t\t\t},\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tlist = [];\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Have the list do nothing anymore\n\t\t\tdisable: function() {\n\t\t\t\tlist = stack = memory = undefined;\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it disabled?\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\t\t\t// Lock the list in its current state\n\t\t\tlock: function() {\n\t\t\t\tstack = undefined;\n\t\t\t\tif ( !memory ) {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it locked?\n\t\t\tlocked: function() {\n\t\t\t\treturn !stack;\n\t\t\t},\n\t\t\t// Call all callbacks with the given context and arguments\n\t\t\tfireWith: function( context, args ) {\n\t\t\t\targs = args || [];\n\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\tif ( list && ( !fired || stack ) ) {\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tstack.push( args );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfire( args );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Call all the callbacks with the given arguments\n\t\t\tfire: function() {\n\t\t\t\tself.fireWith( this, arguments );\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// To know if the callbacks have already been called at least once\n\t\t\tfired: function() {\n\t\t\t\treturn !!fired;\n\t\t\t}\n\t\t};\n\n\treturn self;\n};\n\n","\n/*!\n* jquery-deferred\n* Copyright(c) 2011 Hidden \n* MIT Licensed\n*/\n\n/**\n* Library version.\n*/\n\nvar jQuery = module.exports = require(\"./jquery-callbacks.js\"),\n\tcore_slice = Array.prototype.slice;\n\n/**\n* jQuery deferred\n*\n* Code from: https://github.com/jquery/jquery/blob/master/src/deferred.js\n* Doc: http://api.jquery.com/category/deferred-object/\n*\n*/\n\njQuery.extend({\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\t\t\t\t// action, add listener, listener list, final state\n\t\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks(\"once memory\"), \"resolved\" ],\n\t\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks(\"once memory\"), \"rejected\" ],\n\t\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks(\"memory\") ]\n\t\t\t],\n\t\t\tstate = \"pending\",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\tthen: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\t\t\t\t\treturn jQuery.Deferred(function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\t\t\t\t\tvar action = tuple[ 0 ],\n\t\t\t\t\t\t\t\tfn = fns[ i ];\n\t\t\t\t\t\t\t// deferred[ done | fail | progress ] for forwarding actions to newDefer\n\t\t\t\t\t\t\tdeferred[ tuple[1] ]( jQuery.isFunction( fn ) ?\n\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\tvar returned = fn.apply( this, arguments );\n\t\t\t\t\t\t\t\t\tif ( returned && jQuery.isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject )\n\t\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tnewDefer[ action + \"With\" ]( this === deferred ? newDefer : this, [ returned ] );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} :\n\t\t\t\t\t\t\t\tnewDefer[ action ]\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tfns = null;\n\t\t\t\t\t}).promise();\n\t\t\t\t},\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Keep pipe for back-compat\n\t\tpromise.pipe = promise.then;\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 3 ];\n\n\t\t\t// promise[ done | fail | progress ] = list.add\n\t\t\tpromise[ tuple[1] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(function() {\n\t\t\t\t\t// state = [ resolved | rejected ]\n\t\t\t\t\tstate = stateString;\n\n\t\t\t\t// [ reject_list | resolve_list ].disable; progress_list.lock\n\t\t\t\t}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );\n\t\t\t}\n\n\t\t\t// deferred[ resolve | reject | notify ] = list.fire\n\t\t\tdeferred[ tuple[0] ] = list.fire;\n\t\t\tdeferred[ tuple[0] + \"With\" ] = list.fireWith;\n\t\t});\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( subordinate /* , ..., subordinateN */ ) {\n\t\tvar i = 0,\n\t\t\tresolveValues = core_slice.call( arguments ),\n\t\t\tlength = resolveValues.length,\n\n\t\t\t// the count of uncompleted subordinates\n\t\t\tremaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,\n\n\t\t\t// the master Deferred. If resolveValues consist of only a single Deferred, just use that.\n\t\t\tdeferred = remaining === 1 ? subordinate : jQuery.Deferred(),\n\n\t\t\t// Update function for both resolve and progress values\n\t\t\tupdateFunc = function( i, contexts, values ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tcontexts[ i ] = this;\n\t\t\t\t\tvalues[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;\n\t\t\t\t\tif( values === progressValues ) {\n\t\t\t\t\t\tdeferred.notifyWith( contexts, values );\n\t\t\t\t\t} else if ( !( --remaining ) ) {\n\t\t\t\t\t\tdeferred.resolveWith( contexts, values );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t},\n\n\t\t\tprogressValues, progressContexts, resolveContexts;\n\n\t\t// add listeners to Deferred subordinates; treat others as resolved\n\t\tif ( length > 1 ) {\n\t\t\tprogressValues = new Array( length );\n\t\t\tprogressContexts = new Array( length );\n\t\t\tresolveContexts = new Array( length );\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {\n\t\t\t\t\tresolveValues[ i ].promise()\n\t\t\t\t\t\t.done( updateFunc( i, resolveContexts, resolveValues ) )\n\t\t\t\t\t\t.fail( deferred.reject )\n\t\t\t\t\t\t.progress( updateFunc( i, progressContexts, progressValues ) );\n\t\t\t\t} else {\n\t\t\t\t\t--remaining;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// if we're not waiting on anything, resolve the master\n\t\tif ( !remaining ) {\n\t\t\tdeferred.resolveWith( resolveContexts, resolveValues );\n\t\t}\n\n\t\treturn deferred.promise();\n\t}\n});\n","\nmodule.exports = require('./lib/jquery-deferred');","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","/* \r\nCopyright 2017-2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport { createEventEmitter } from '../libs/utils';\r\nimport jQueryShim from '../libs/jquery-shim';\r\nconst signalRNetCore = require('@aspnet/signalr');\r\nlet $ = jQueryShim;\r\n\r\nconst window = window || global || {};\r\n\r\nexport class dotnetifyHubFactory {\r\n static create() {\r\n let dotnetifyHub = {\r\n version: '2.0.0',\r\n type: null,\r\n\r\n reconnectDelay: [ 2, 5, 10 ],\r\n reconnectRetry: null,\r\n\r\n _startInfo: null,\r\n _init: false,\r\n\r\n // Hub server methods.\r\n requestVM: (iVMId, iOptions) => dotnetifyHub.server.request_VM(iVMId, iOptions),\r\n updateVM: (iVMId, iValue) => dotnetifyHub.server.update_VM(iVMId, iValue),\r\n disposeVM: iVMId => dotnetifyHub.server.dispose_VM(iVMId),\r\n\r\n // Connection events.\r\n responseEvent: createEventEmitter(),\r\n reconnectedEvent: createEventEmitter(),\r\n connectedEvent: createEventEmitter(),\r\n connectionFailedEvent: createEventEmitter(),\r\n\r\n get isHubStarted() {\r\n return !!this._startInfo;\r\n },\r\n\r\n // Starts connection with SignalR hub server.\r\n startHub(hubOptions, doneHandler, failHandler, forceRestart) {\r\n const _doneHandler = () => {\r\n if (typeof doneHandler == 'function') doneHandler();\r\n this.connectedEvent.emit();\r\n };\r\n const _failHandler = ex => {\r\n if (typeof failHander == 'function') failHandler();\r\n this.connectionFailedEvent.emit();\r\n throw ex;\r\n };\r\n\r\n if (this._startInfo === null || forceRestart) {\r\n try {\r\n this._startInfo = this.start(hubOptions).done(_doneHandler).fail(_failHandler);\r\n } catch (err) {\r\n this._startInfo = null;\r\n }\r\n }\r\n else {\r\n try {\r\n this._startInfo.done(_doneHandler);\r\n } catch (err) {\r\n this._startInfo = null;\r\n return this.startHub(hubOptions, doneHandler, failHandler, forceRestart);\r\n }\r\n }\r\n }\r\n };\r\n\r\n // Configures connection to SignalR hub server.\r\n dotnetifyHub.init = function(iHubPath, iServerUrl, signalR) {\r\n if (dotnetifyHub._init) return;\r\n\r\n dotnetifyHub._init = true;\r\n signalR = signalR || window.signalR || signalRNetCore;\r\n\r\n // SignalR .NET Core.\r\n if (signalR && signalR.HubConnection) {\r\n dotnetifyHub.type = 'netcore';\r\n\r\n Object.defineProperty(dotnetifyHub, 'isConnected', {\r\n get: function() {\r\n return dotnetifyHub._connection && dotnetifyHub._connection.connection.connectionState === 1;\r\n }\r\n });\r\n\r\n dotnetifyHub = $.extend(dotnetifyHub, {\r\n hubPath: iHubPath || '/dotnetify',\r\n url: iServerUrl,\r\n\r\n // Internal variables. Do not modify!\r\n _connection: null,\r\n _reconnectCount: 0,\r\n _startDoneHandler: null,\r\n _startFailHandler: null,\r\n _disconnectedHandler: function() {},\r\n _stateChangedHandler: function(iNewState) {},\r\n\r\n _onDisconnected: function() {\r\n dotnetifyHub._changeState(4);\r\n dotnetifyHub._disconnectedHandler();\r\n },\r\n\r\n _changeState: function(iNewState) {\r\n if (iNewState == 1) dotnetifyHub._reconnectCount = 0;\r\n\r\n let stateText = { 0: 'connecting', 1: 'connected', 2: 'reconnecting', 4: 'disconnected', 99: 'terminated' };\r\n dotnetifyHub._stateChangedHandler(stateText[iNewState]);\r\n },\r\n\r\n _startConnection: function(iHubOptions, iTransportArray) {\r\n let url = dotnetifyHub.url ? dotnetifyHub.url + dotnetifyHub.hubPath : dotnetifyHub.hubPath;\r\n let hubOptions = {};\r\n Object.keys(iHubOptions).forEach(function(key) {\r\n hubOptions[key] = iHubOptions[key];\r\n });\r\n hubOptions.transport = iTransportArray.shift();\r\n\r\n dotnetifyHub._connection = new signalR.HubConnectionBuilder().withUrl(url, hubOptions).build();\r\n dotnetifyHub._connection.on('response_vm', dotnetifyHub.client.response_VM);\r\n dotnetifyHub._connection.onclose(dotnetifyHub._onDisconnected);\r\n\r\n let promise = dotnetifyHub._connection\r\n .start()\r\n .then(function() {\r\n dotnetifyHub._changeState(1);\r\n })\r\n .catch(function() {\r\n // If failed to start, fallback to the next transport.\r\n if (iTransportArray.length > 0) dotnetifyHub._startConnection(iHubOptions, iTransportArray);\r\n else dotnetifyHub._onDisconnected();\r\n });\r\n\r\n if (typeof dotnetifyHub._startDoneHandler === 'function')\r\n promise.then(dotnetifyHub._startDoneHandler).catch(dotnetifyHub._startFailHandler || function() {});\r\n return promise;\r\n },\r\n\r\n start: function(iHubOptions) {\r\n dotnetifyHub._startDoneHandler = null;\r\n dotnetifyHub._startFailHandler = null;\r\n\r\n // Map the transport option.\r\n let transport = [ 0 ];\r\n let transportOptions = { webSockets: 0, serverSentEvents: 1, longPolling: 2 };\r\n if (iHubOptions && Array.isArray(iHubOptions.transport))\r\n transport = iHubOptions.transport.map(function(arg) {\r\n return transportOptions[arg];\r\n });\r\n\r\n let promise = dotnetifyHub._startConnection(iHubOptions, transport);\r\n return {\r\n done: function(iHandler) {\r\n dotnetifyHub._startDoneHandler = iHandler;\r\n promise.then(iHandler).catch(function(error) {\r\n throw error;\r\n });\r\n return this;\r\n },\r\n fail: function(iHandler) {\r\n dotnetifyHub._startFailHandler = iHandler;\r\n promise.catch(iHandler);\r\n return this;\r\n }\r\n };\r\n },\r\n\r\n disconnected: function(iHandler) {\r\n if (typeof iHandler === 'function') dotnetifyHub._disconnectedHandler = iHandler;\r\n },\r\n\r\n stateChanged: function(iHandler) {\r\n if (typeof iHandler === 'function') dotnetifyHub._stateChangedHandler = iHandler;\r\n },\r\n\r\n reconnect: function(iStartHubFunc) {\r\n if (typeof iStartHubFunc === 'function') {\r\n // Only attempt reconnect if the specified retry hasn't been exceeded.\r\n if (!dotnetifyHub.reconnectRetry || dotnetifyHub._reconnectCount < dotnetifyHub.reconnectRetry) {\r\n // Determine reconnect delay from the specified configuration array.\r\n let delay =\r\n dotnetifyHub._reconnectCount < dotnetifyHub.reconnectDelay.length\r\n ? dotnetifyHub.reconnectDelay[dotnetifyHub._reconnectCount]\r\n : dotnetifyHub.reconnectDelay[dotnetifyHub.reconnectDelay.length - 1];\r\n\r\n dotnetifyHub._reconnectCount++;\r\n\r\n setTimeout(function() {\r\n dotnetifyHub._changeState(2);\r\n iStartHubFunc();\r\n }, delay * 1000);\r\n }\r\n else dotnetifyHub._changeState(99);\r\n }\r\n },\r\n\r\n client: {},\r\n\r\n server: {\r\n dispose_VM: function(iVMId) {\r\n dotnetifyHub._connection.invoke('Dispose_VM', iVMId);\r\n },\r\n update_VM: function(iVMId, iValue) {\r\n dotnetifyHub._connection.invoke('Update_VM', iVMId, iValue);\r\n },\r\n request_VM: function(iVMId, iArgs) {\r\n dotnetifyHub._connection.invoke('Request_VM', iVMId, iArgs);\r\n }\r\n }\r\n });\r\n }\r\n else {\r\n // SignalR .NET FX.\r\n dotnetifyHub.type = 'netfx';\r\n\r\n if (window.jQuery) $ = window.jQuery;\r\n\r\n // SignalR hub auto-generated from /signalr/hubs.\r\n /// \r\n /// \r\n (function($, window, undefined) {\r\n /// \r\n 'use strict';\r\n\r\n if (typeof $.signalR !== 'function') {\r\n throw new Error('SignalR: SignalR is not loaded. Please ensure jquery.signalR-x.js is referenced before ~/signalr/js.');\r\n }\r\n\r\n var signalR = $.signalR;\r\n\r\n function makeProxyCallback(hub, callback) {\r\n return function() {\r\n // Call the client hub method\r\n callback.apply(hub, $.makeArray(arguments));\r\n };\r\n }\r\n\r\n function registerHubProxies(instance, shouldSubscribe) {\r\n var key, hub, memberKey, memberValue, subscriptionMethod;\r\n\r\n for (key in instance) {\r\n if (instance.hasOwnProperty(key)) {\r\n hub = instance[key];\r\n\r\n if (!hub.hubName) {\r\n // Not a client hub\r\n continue;\r\n }\r\n\r\n if (shouldSubscribe) {\r\n // We want to subscribe to the hub events\r\n subscriptionMethod = hub.on;\r\n }\r\n else {\r\n // We want to unsubscribe from the hub events\r\n subscriptionMethod = hub.off;\r\n }\r\n\r\n // Loop through all members on the hub and find client hub functions to subscribe/unsubscribe\r\n for (memberKey in hub.client) {\r\n if (hub.client.hasOwnProperty(memberKey)) {\r\n memberValue = hub.client[memberKey];\r\n\r\n if (!$.isFunction(memberValue)) {\r\n // Not a client hub function\r\n continue;\r\n }\r\n\r\n subscriptionMethod.call(hub, memberKey, makeProxyCallback(hub, memberValue));\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n $.hubConnection.prototype.createHubProxies = function() {\r\n var proxies = {};\r\n this.starting(function() {\r\n // Register the hub proxies as subscribed\r\n // (instance, shouldSubscribe)\r\n registerHubProxies(proxies, true);\r\n\r\n this._registerSubscribedHubs();\r\n }).disconnected(function() {\r\n // Unsubscribe all hub proxies when we \"disconnect\". This is to ensure that we do not re-add functional call backs.\r\n // (instance, shouldSubscribe)\r\n registerHubProxies(proxies, false);\r\n });\r\n\r\n proxies['dotNetifyHub'] = this.createHubProxy('dotNetifyHub');\r\n proxies['dotNetifyHub'].client = {};\r\n proxies['dotNetifyHub'].server = {\r\n dispose_VM: function(vmId) {\r\n return proxies['dotNetifyHub'].invoke.apply(proxies['dotNetifyHub'], $.merge([ 'Dispose_VM' ], $.makeArray(arguments)));\r\n },\r\n\r\n request_VM: function(vmId, vmArg) {\r\n return proxies['dotNetifyHub'].invoke.apply(proxies['dotNetifyHub'], $.merge([ 'Request_VM' ], $.makeArray(arguments)));\r\n },\r\n\r\n update_VM: function(vmId, vmData) {\r\n return proxies['dotNetifyHub'].invoke.apply(proxies['dotNetifyHub'], $.merge([ 'Update_VM' ], $.makeArray(arguments)));\r\n }\r\n };\r\n\r\n return proxies;\r\n };\r\n\r\n signalR.hub = $.hubConnection(dotnetifyHub.hubPath, { useDefaultPath: false });\r\n $.extend(signalR, signalR.hub.createHubProxies());\r\n })($, window);\r\n\r\n Object.defineProperty(dotnetifyHub, 'state', {\r\n get: function() {\r\n return $.connection.hub.state;\r\n },\r\n set: function(val) {\r\n $.connection.hub.state = val;\r\n }\r\n });\r\n\r\n Object.defineProperty(dotnetifyHub, 'client', {\r\n get: function() {\r\n return $.connection.dotNetifyHub.client;\r\n }\r\n });\r\n\r\n Object.defineProperty(dotnetifyHub, 'server', {\r\n get: function() {\r\n return $.connection.dotNetifyHub.server;\r\n }\r\n });\r\n\r\n Object.defineProperty(dotnetifyHub, 'isConnected', {\r\n get: function() {\r\n return $.connection.hub.state == $.signalR.connectionState.connected;\r\n }\r\n });\r\n\r\n dotnetifyHub = $.extend(dotnetifyHub, {\r\n hubPath: iHubPath || '/signalr',\r\n url: iServerUrl,\r\n\r\n _reconnectCount: 0,\r\n _stateChangedHandler: function(iNewState) {},\r\n\r\n start: function(iHubOptions) {\r\n if (dotnetifyHub.url) $.connection.hub.url = dotnetifyHub.url;\r\n\r\n let deferred;\r\n if (iHubOptions) deferred = $.connection.hub.start(iHubOptions);\r\n else deferred = $.connection.hub.start();\r\n deferred.fail(function(error) {\r\n if (error.source && error.source.message === 'Error parsing negotiate response.')\r\n console.warn('This client may be attempting to connect to an incompatible SignalR .NET Core server.');\r\n });\r\n return deferred;\r\n },\r\n\r\n disconnected: function(iHandler) {\r\n return $.connection.hub.disconnected(iHandler);\r\n },\r\n\r\n stateChanged: function(iHandler) {\r\n dotnetifyHub._stateChangedHandler = iHandler;\r\n return $.connection.hub.stateChanged(function(state) {\r\n if (state == 1) dotnetifyHub._reconnectCount = 0;\r\n\r\n let stateText = { 0: 'connecting', 1: 'connected', 2: 'reconnecting', 4: 'disconnected' };\r\n iHandler(stateText[state.newState]);\r\n });\r\n },\r\n\r\n reconnect: function(iStartHubFunc) {\r\n if (typeof iStartHubFunc === 'function') {\r\n // Only attempt reconnect if the specified retry hasn't been exceeded.\r\n if (!dotnetifyHub.reconnectRetry || dotnetifyHub._reconnectCount < dotnetifyHub.reconnectRetry) {\r\n // Determine reconnect delay from the specified configuration array.\r\n let delay =\r\n dotnetifyHub._reconnectCount < dotnetifyHub.reconnectDelay.length\r\n ? dotnetifyHub.reconnectDelay[dotnetifyHub._reconnectCount]\r\n : dotnetifyHub.reconnectDelay[dotnetifyHub.reconnectDelay.length - 1];\r\n\r\n dotnetifyHub._reconnectCount++;\r\n\r\n setTimeout(function() {\r\n dotnetifyHub._stateChangedHandler('reconnecting');\r\n iStartHubFunc();\r\n }, delay * 1000);\r\n }\r\n else dotnetifyHub._stateChangedHandler('terminated');\r\n }\r\n }\r\n });\r\n }\r\n\r\n // Setup SignalR server method handler.\r\n dotnetifyHub.client.response_VM = function(iVMId, iVMData) {\r\n // SignalR .NET Core is sending an array of arguments.\r\n if (Array.isArray(iVMId)) {\r\n iVMData = iVMId[1];\r\n iVMId = iVMId[0];\r\n }\r\n\r\n let handled = dotnetifyHub.responseEvent.emit(iVMId, iVMData);\r\n\r\n // If we get to this point, that means the server holds a view model instance\r\n // whose view no longer existed. So, tell the server to dispose the view model.\r\n if (!handled) dotnetifyHub.server.dispose_VM(iVMId);\r\n };\r\n\r\n // On disconnected, keep attempting to start the connection.\r\n dotnetifyHub.disconnected(function() {\r\n dotnetifyHub._startInfo = null;\r\n dotnetifyHub.reconnect(function() {\r\n dotnetifyHub.reconnectedEvent.emit();\r\n });\r\n });\r\n };\r\n\r\n return dotnetifyHub;\r\n }\r\n}\r\n\r\nexport default dotnetifyHubFactory.create();\r\n","/* \r\nCopyright 2017-2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport dotnetifyHub, { dotnetifyHubFactory } from './dotnetify-hub';\r\nimport localHub, { hasLocalVM } from './dotnetify-hub-local';\r\nimport webApiHub, { createWebApiHub } from './dotnetify-hub-webapi';\r\n\r\nexport class dotnetifyFactory {\r\n static create() {\r\n const dotnetify = {\r\n // SignalR hub options.\r\n hub: dotnetifyHub,\r\n hubOptions: { transport: [ 'webSockets', 'longPolling' ] },\r\n hubPath: null,\r\n\r\n // Debug mode.\r\n debug: false,\r\n debugFn: null,\r\n\r\n // Offline mode. (WIP)\r\n offline: false,\r\n isOffline: true,\r\n offlineTimeout: 5000,\r\n offlineCacheFn: null,\r\n\r\n // Internal variables.\r\n _vmAccessors: [],\r\n\r\n // Use this to get notified of connection state changed events.\r\n // (state, exception, hub) => void\r\n connectionStateHandler: null,\r\n\r\n // Use this intercept a view model prior to establishing connection,\r\n // with the option to provide any connect parameters.\r\n // ({vmId, options}) => {vmId, options, hub}\r\n connectHandler: null,\r\n\r\n // Support changing hub server URL after first init.\r\n get hubServerUrl() {\r\n return this.hub.url;\r\n },\r\n\r\n set hubServerUrl(url) {\r\n this.hub.url = url;\r\n if (this.debug) console.log('SignalR: connecting to ' + this.hubServerUrl);\r\n if (this.hub.isHubStarted) this.startHub(this.hub, true);\r\n },\r\n\r\n // Generic connect function for non-React app.\r\n connect(iVMId, iOptions) {\r\n return dotnetify.react.connect(iVMId, {}, iOptions);\r\n },\r\n\r\n // Creates a SignalR hub client.\r\n createHub(hubServerUrl, hubPath, hubLib) {\r\n return this.initHub(dotnetifyHubFactory.create(), hubPath, hubServerUrl, hubLib);\r\n },\r\n\r\n // Creates a Web API hub client.\r\n createWebApiHub(baseUrl, onRequestHandler) {\r\n return createWebApiHub(baseUrl, onRequestHandler);\r\n },\r\n\r\n // Configures hub connection to SignalR hub server.\r\n initHub(hub, hubPath, hubServerUrl, hubLib) {\r\n hub = hub || this.hub;\r\n hubPath = hubPath || this.hubPath;\r\n hubServerUrl = hubServerUrl || this.hubServerUrl;\r\n hubLib = hubLib || this.hubLib;\r\n\r\n if (!hub.isHubStarted) {\r\n hub.init(hubPath, hubServerUrl, hubLib);\r\n\r\n // Use SignalR event to raise the connection state event.\r\n hub.stateChanged(state => this.handleConnectionStateChanged(state, null, hub));\r\n }\r\n return hub;\r\n },\r\n\r\n // Used by a view to select a hub, and provides the opportunity to override any connect info.\r\n selectHub(vmConnectArgs) {\r\n vmConnectArgs = vmConnectArgs || {};\r\n vmConnectArgs.options = vmConnectArgs.options || {};\r\n let override = (typeof this.connectHandler == 'function' && this.connectHandler(vmConnectArgs)) || {};\r\n if (!override.hub) {\r\n override.hub = hasLocalVM(vmConnectArgs.vmId) ? localHub : vmConnectArgs.options.webApi ? webApiHub : this.initHub();\r\n override.hub.debug = this.debug;\r\n }\r\n return Object.assign(vmConnectArgs, override);\r\n },\r\n\r\n // Starts hub connection to SignalR hub server.\r\n startHub(hub, forceRestart) {\r\n hub = hub || this.hub;\r\n\r\n const doneHandler = () => {};\r\n const failHandler = ex => this.handleConnectionStateChanged('error', ex, hub);\r\n hub.startHub(this.hubOptions, doneHandler, failHandler, forceRestart);\r\n },\r\n\r\n // Used by dotnetify-react and -vue to expose their view model accessors.\r\n addVMAccessor(vmAccessor) {\r\n !this._vmAccessors.includes(vmAccessor) && this._vmAccessors.push(vmAccessor);\r\n },\r\n\r\n checkServerSideException(iVMId, iVMData, iExceptionHandler) {\r\n const vmData = JSON.parse(iVMData);\r\n if (vmData && vmData.hasOwnProperty('ExceptionType') && vmData.hasOwnProperty('Message')) {\r\n const exception = { name: vmData.ExceptionType, message: vmData.Message };\r\n\r\n if (typeof iExceptionHandler === 'function') {\r\n return iExceptionHandler(exception);\r\n }\r\n else {\r\n console.error('[' + iVMId + '] ' + exception.name + ': ' + exception.message);\r\n throw exception;\r\n }\r\n }\r\n },\r\n\r\n // Get all view models.\r\n getViewModels() {\r\n return this._vmAccessors\r\n .reduce((prev, current) => [ ...prev, ...current() ], [])\r\n .filter((val, idx, self) => self.indexOf(val) === idx); // returns distinct items.\r\n },\r\n\r\n handleConnectionStateChanged(iState, iException, iHub) {\r\n if (this.debug) console.log('SignalR: ' + (iException ? iException.message : iState));\r\n if (typeof this.connectionStateHandler === 'function') this.connectionStateHandler(iState, iException, iHub);\r\n else if (iException) console.error(iException);\r\n }\r\n };\r\n\r\n return dotnetify;\r\n }\r\n}\r\n\r\nexport default dotnetifyFactory.create();\r\n","/* \r\nCopyright 2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\n\r\nimport { useState, useEffect, useRef } from 'react';\r\nimport dotnetify from './dotnetify-react';\r\n\r\nexport default function useConnect(vmId, component, options) {\r\n let { state, props } = component;\r\n if (state == null) state = component || {};\r\n\r\n if (useState == null || useEffect == null) throw 'Error: using React hooks requires at least v16.8.';\r\n\r\n const [ _state, setState ] = useState(state);\r\n const vm = useRef();\r\n const vmData = useRef(_state);\r\n\r\n useEffect(() => {\r\n vm.current = dotnetify.react.connect(\r\n vmId,\r\n {\r\n props: props,\r\n get state() {\r\n return vmData.current;\r\n },\r\n setState: newState => {\r\n vmData.current = newState;\r\n setState(vmData.current);\r\n }\r\n },\r\n options\r\n );\r\n return () => vm.current.$destroy();\r\n }, []);\r\n\r\n return { vm: vm.current, state: _state };\r\n}\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\n\r\nimport React from 'react';\r\nimport dotnetify from './dotnetify-react';\r\n\r\nconst window = window || global || {};\r\n\r\n// is a helper component to provide DOM target for routes, and is essential for server-side rendering.\r\nexport default class RouteTarget extends React.Component {\r\n componentWillMount() {\r\n var elem = document.getElementById(this.props.id);\r\n if (elem != null && window.ssr && !window.ssr[this.props.id]) {\r\n window.ssr[this.props.id] = true;\r\n this.initialHtml = { __html: elem.innerHTML };\r\n }\r\n else this.initialHtml = { __html: '' };\r\n }\r\n\r\n getDOMNode() {\r\n return this.elem;\r\n }\r\n\r\n render() {\r\n const { id, ...props } = this.props;\r\n return
(this.elem = el)} {...this.props} dangerouslySetInnerHTML={this.initialHtml} />;\r\n }\r\n}\r\n\r\ndotnetify.react.router.RouteTarget = RouteTarget;\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\n\r\nimport React from 'react';\r\nimport dotnetify from './dotnetify-react';\r\n\r\n// is a helper component to set anchor tags for routes.\r\nexport default class RouteLink extends React.Component {\r\n render() {\r\n const props = this.props;\r\n if (props.vm == null) console.error(\"RouteLink requires 'vm' property.\");\r\n\r\n const handleClick = event => {\r\n event.preventDefault();\r\n if (props.route == null) {\r\n console.error(\"RouteLink requires 'route' property.\");\r\n return;\r\n }\r\n if (typeof props.onClick === 'function' && props.onClick(event) === false) return;\r\n return props.vm.$handleRoute(event);\r\n };\r\n\r\n return (\r\n \r\n );\r\n }\r\n}\r\n\r\ndotnetify.react.router.RouteLink = RouteLink;\r\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim\n };\n\n ReactPropTypes.checkPropTypes = emptyFunction;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n Symbol.for &&\n Symbol.for('react.element')) ||\n 0xeac7;\n\n var isValidElement = function(object) {\n return typeof object === 'object' &&\n object !== null &&\n object.$$typeof === REACT_ELEMENT_TYPE;\n };\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\n\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport dotnetify from './dotnetify-react';\r\n\r\nconst window = window || global || {};\r\n\r\n// The component uses React's 'context' to pass down the component hierarchy the name of the back-end view model\r\n// of the parent component, so that when the child component connects to its back-end view model, the child view model\r\n// instance is created within the scope of the parent view model.\r\n//\r\n// The component also provides the 'connect' function for a component to connect to the back-end view model and\r\n// injects properties and dispatch functions into the component.\r\nexport default class Scope extends React.Component {\r\n static displayName = 'Scope';\r\n static version = '1.3.0';\r\n\r\n static propTypes = {\r\n vm: PropTypes.string,\r\n options: PropTypes.object\r\n };\r\n static contextTypes = {\r\n scoped: PropTypes.func,\r\n scopedOptions: PropTypes.func\r\n };\r\n static childContextTypes = {\r\n scoped: PropTypes.func.isRequired,\r\n scopedOptions: PropTypes.func.isRequired,\r\n connect: PropTypes.func.isRequired\r\n };\r\n\r\n scoped(vmId) {\r\n let scope = this.context.scoped ? this.context.scoped(this.props.vm) : this.props.vm;\r\n return scope ? scope + '.' + vmId : vmId;\r\n }\r\n\r\n scopedOptions(options) {\r\n let scopedOptions = this.context.scoped ? this.context.scopedOptions(this.props.options) : this.props.options;\r\n return scopedOptions ? { ...scopedOptions, ...options } : options;\r\n }\r\n\r\n getChildContext() {\r\n const _this = this;\r\n\r\n return {\r\n scoped: vmId => _this.scoped(vmId),\r\n scopedOptions: options => _this.scopedOptions(options),\r\n connect: (vmId, component, options) => {\r\n component.vmId = _this.scoped(vmId);\r\n component.options = _this.scopedOptions(options);\r\n component.vm = dotnetify.react.connect(component.vmId, component, component.options);\r\n component.dispatch = state => component.vm.$dispatch(state);\r\n\r\n component.dispatchState = state => {\r\n component.vm.State(state);\r\n component.vm.$dispatch(state);\r\n };\r\n return window.vmStates ? window.vmStates[component.vmId] : null;\r\n }\r\n };\r\n }\r\n render() {\r\n return this.props.children;\r\n }\r\n}\r\n\r\ndotnetify.react.Scope = Scope;\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport dotnetify from './dotnetify-react';\r\nimport dotnetifyVM from '../core/dotnetify-vm';\r\nimport $ from '../libs/jquery-shim';\r\n\r\nconst window = window || global || {};\r\n\r\n// Used by server-side rendering in lieu of connect method.\r\ndotnetify.react.ssrConnect = function(iVMId, iReact, iVMArg) {\r\n if (window.ssr == null || !window.ssr.hasOwnProperty(iVMId))\r\n console.error(\"Server-side rendering requires initial state in 'window.ssr.\" + iVMId + \"'.\");\r\n\r\n var self = dotnetify.react;\r\n var vmState = window.ssr[iVMId];\r\n var getState = function() {\r\n return vmState;\r\n };\r\n var setState = function(state) {\r\n vmState = $.extend(vmState, state);\r\n };\r\n var options = {\r\n getState: getState,\r\n setState: setState,\r\n vmArg: iVMArg\r\n };\r\n var vm = (self.viewModels[iVMId] = new dotnetifyVM(iVMId, iReact, options, self));\r\n\r\n // Need to be asynch to allow initial state to be processed.\r\n setTimeout(function() {\r\n vm.$update(JSON.stringify(window.ssr[iVMId]));\r\n }, 100);\r\n return vm;\r\n};\r\n\r\n// Used by client-side React component to get server-side rendered initial state.\r\ndotnetify.react.router.ssrState = function(iVMId) {\r\n if (window.ssr && window.ssr[iVMId] && !window.ssr[iVMId].fetched) {\r\n window.ssr[iVMId].fetched = true;\r\n return window.ssr[iVMId];\r\n }\r\n};\r\n\r\n// Called from server to configure server-side rendering.\r\n// iPath - initial URL path.\r\n// iInitialStates - serialized object literal '{ \"vmName\": {initialState}, ...}'.\r\n// iOverrideRouteFn - function to override routing URLs before the router loads them.\r\n// iCallbackFn - callback after the path is fully routed.\r\n// iTimeout - timeout in milliseconds.\r\ndotnetify.react.router.ssr = function(iPath, iInitialStates, iOverrideRouteFn, iCallbackFn, iTimeout) {\r\n dotnetify.ssr = true;\r\n dotnetify.react.router.urlPath = iPath;\r\n dotnetify.react.router.overrideUrl = iOverrideRouteFn;\r\n\r\n // Insert initial states in the head tag.\r\n var script = document.createElement('script');\r\n script.type = 'text/javascript';\r\n script.text = 'window.ssr=' + iInitialStates + ';';\r\n var head = document.getElementsByTagName('head')[0];\r\n if (head) head.insertBefore(script, head.firstChild);\r\n else console.error('router> document head tag is required for server-side render.');\r\n\r\n var routed = false;\r\n var fallback = iTimeout\r\n ? setTimeout(function() {\r\n if (!routed) iCallbackFn();\r\n }, iTimeout)\r\n : 0;\r\n window.addEventListener('dotnetify.routed', function() {\r\n routed = true;\r\n if (fallback != 0) clearTimeout(fallback);\r\n iCallbackFn();\r\n });\r\n\r\n // Add initial states into the window scope for the server-renderd components.\r\n window.ssr = JSON.parse(iInitialStates);\r\n};\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport utils from '../libs/utils';\r\n\r\nexport default class dotnetifyVMRouter {\r\n routes = [];\r\n\r\n get RoutingState() {\r\n throw new Error('Not implemented');\r\n }\r\n get VMRoot() {\r\n throw new Error('Not implemented');\r\n }\r\n get VMArg() {\r\n throw new Error('Not implemented');\r\n }\r\n\r\n constructor(vm, router) {\r\n this.vm = vm;\r\n this.router = router;\r\n this.debug = vm.$dotnetify.controller.debug;\r\n }\r\n\r\n // Dispatch the active routing state to the server.\r\n dispatchActiveRoutingState(iPath) {\r\n this.vm.$dispatch({ 'RoutingState.Active': iPath });\r\n let { RoutingState } = this.vm.State();\r\n RoutingState = Object.assign(RoutingState || {}, { Active: iPath });\r\n this.vm.State({ RoutingState });\r\n }\r\n\r\n // Handles click event from anchor tags. Argument can be event object or path string.\r\n handleRoute(iArg) {\r\n let path = null;\r\n if (typeof iArg === 'object') {\r\n iArg.preventDefault();\r\n path = iArg.currentTarget.pathname;\r\n }\r\n else if (typeof iArg === 'string') path = iArg;\r\n\r\n if (path == null || path == '') throw new Error('$handleRoute requires path argument or event with pathname.');\r\n setTimeout(() => this.router.pushState({}, '', path));\r\n }\r\n\r\n // Build the absolute root path from the \"vmRoot\" property on React component.\r\n initRoot() {\r\n if (!this.hasRoutingState || this.RoutingState === null || this.RoutingState.Root === null) return;\r\n\r\n if (this._absRoot != this.RoutingState.Root) {\r\n var absRoot = utils.trim(this.VMRoot);\r\n if (absRoot != '') absRoot = '/' + absRoot;\r\n var root = utils.trim(this.RoutingState.Root);\r\n this._absRoot = root != '' ? absRoot + '/' + root : absRoot;\r\n this.RoutingState.Root = this._absRoot;\r\n }\r\n }\r\n\r\n // Initialize routing templates if the view model implements IRoutable.\r\n initRouting() {\r\n const vm = this.vm;\r\n if (!this.hasRoutingState) return;\r\n\r\n if (this.RoutingState === null) {\r\n console.error(\"router> the RoutingState prop of '\" + vm.$vmId + \"' was not initialized.\");\r\n return;\r\n }\r\n\r\n var templates = this.RoutingState.Templates;\r\n if (templates == null || templates.length == 0) return;\r\n\r\n // Initialize the router.\r\n if (!this.router.$init) {\r\n this.router.init();\r\n this.router.$init = true;\r\n }\r\n\r\n // Build the absolute root path.\r\n this.initRoot();\r\n\r\n templates.forEach(template => {\r\n // If url pattern isn't given, consider Id as the pattern.\r\n var urlPattern = template.UrlPattern != null ? template.UrlPattern : template.Id;\r\n urlPattern = urlPattern != '' ? urlPattern : '/';\r\n var mapUrl = this.toUrl(urlPattern);\r\n\r\n if (this.debug) console.log('router> map ' + mapUrl + ' to template id=' + template.Id);\r\n\r\n this.router.mapTo(mapUrl, iParams => {\r\n this.router.urlPath = '';\r\n\r\n // Construct the path from the template pattern and the params passed by PathJS.\r\n var path = urlPattern;\r\n for (var param in iParams) path = path.replace(':' + param, iParams[param]);\r\n path = path.replace(/\\(\\/:([^)]+)\\)/g, '').replace(/\\(|\\)/g, '');\r\n\r\n this.routeTo(path, template);\r\n });\r\n });\r\n\r\n // Route initial URL.\r\n var activeUrl = this.toUrl(this.RoutingState.Active);\r\n if (this.router.urlPath == '') this.router.urlPath = activeUrl;\r\n if (!this.routeUrl())\r\n // If routing ends incomplete, raise routed event anyway.\r\n this.raiseRoutedEvent(true);\r\n }\r\n\r\n // Whether a route is active.\r\n isActive(iRoute) {\r\n if (iRoute != null && iRoute.hasOwnProperty('Path')) {\r\n return utils.equal(iRoute.Path, this.RoutingState.Active);\r\n }\r\n return false;\r\n }\r\n\r\n // Loads an HTML view.\r\n loadHtmlView(iTargetSelector, iViewUrl, iJsModuleUrl, iCallbackFn) {\r\n const vm = this.vm;\r\n this.unmountView(iTargetSelector);\r\n\r\n // Load the HTML view.\r\n $(iTargetSelector).load(iViewUrl, null, function() {\r\n if (iJsModuleUrl != null) {\r\n const getScripts = iJsModuleUrl.split(',').map(i => $.getScript(i));\r\n $.when.apply($, getScripts).done(() => typeof callbackFn === 'function' && iCallbackFn.call(vm));\r\n }\r\n else if (typeof callbackFn === 'function') iCallbackFn.call(vm);\r\n });\r\n }\r\n\r\n loadHtmlElementView(iTargetSelector, iHtmlElement, iJsModuleUrl, iVmArg, iCallbackFn) {\r\n const vm = this.vm;\r\n const mountViewFunc = () => {\r\n this.unmountView(iTargetSelector);\r\n\r\n const target = document.querySelector(iTargetSelector);\r\n while (target.firstChild) target.removeChild(target.firstChild);\r\n target.appendChild(iHtmlElement);\r\n\r\n if (typeof callbackFn === 'function') iCallbackFn.call(vm);\r\n };\r\n\r\n if (iJsModuleUrl == null) mountViewFunc();\r\n else {\r\n // Load all javascripts first. Multiple files can be specified with comma delimiter.\r\n const getScripts = iJsModuleUrl.split(',').map(i => $.getScript(i));\r\n $.when.apply($, getScripts).done(mountViewFunc);\r\n }\r\n }\r\n\r\n // Loads a view into a target element.\r\n loadView(iTargetSelector, iViewUrl, iJsModuleUrl, iVmArg, iCallbackFn) {\r\n throw new Error('Not implemented');\r\n }\r\n\r\n // Routes to a path.\r\n manualRouteTo(iPath, iTarget, iViewUrl, iJSModuleUrl) {\r\n const vm = this.vm;\r\n var template = { Id: 'manual', Target: iTarget, ViewUrl: iViewUrl, JSModuleUrl: iJSModuleUrl };\r\n this.routeTo(iPath, template, true);\r\n }\r\n\r\n // Handles route enter event.\r\n onRouteEnter(iPath, iTemplate) {\r\n return true;\r\n }\r\n\r\n // Raise event indicating the routing process has ended.\r\n raiseRoutedEvent(force) {\r\n const vm = this.vm;\r\n if (this.router.urlPath == '' || force == true) {\r\n if (this.debug) console.log('router> routed');\r\n utils.dispatchEvent('dotnetify.routed');\r\n }\r\n }\r\n\r\n // Returns the URL for an anchor tag.\r\n route(iRoute, iTarget) {\r\n // No route to process. Return silently.\r\n if (iRoute == null) return;\r\n\r\n if (!iRoute.hasOwnProperty('Path') && !iRoute.hasOwnProperty('TemplateId')) throw new Error('Not a valid route');\r\n\r\n // Build the absolute root path.\r\n this.initRoot();\r\n\r\n // If the route path is not defined, use the URL pattern from the associated template.\r\n // This is so that we don't send the same data twice if both are equal.\r\n let path = iRoute.Path;\r\n let template = null;\r\n if (this.hasRoutingState && this.RoutingState.Templates != null && iRoute.TemplateId != null) {\r\n let match = this.RoutingState.Templates.filter(function(iTemplate) {\r\n return iTemplate.Id == iRoute.TemplateId;\r\n });\r\n if (match.length > 0) {\r\n template = match[0];\r\n\r\n if (typeof iTarget === 'string') template.Target = iTarget;\r\n\r\n if (path == null) {\r\n path = template.UrlPattern != null ? template.UrlPattern : template.Id;\r\n iRoute.Path = path;\r\n }\r\n }\r\n else if (iRoute.RedirectRoot == null) throw new Error(`vmRoute cannot find route template ${iRoute.TemplateId}`);\r\n }\r\n\r\n // If the path has a redirect root, the path doesn't belong to the current root and needs to be\r\n // redirected to a different one. Set the absolute path to the HREF attribute, and prevent the\r\n // default behavior of the anchor click event and instead do push to HTML5 history state, which\r\n // would attempt to resolve the path first before resorting to hard browser redirect.\r\n if (iRoute.RedirectRoot != null) {\r\n // Combine the redirect root with the view model's root.\r\n let redirectRoot = iRoute.RedirectRoot;\r\n if (redirectRoot.charAt(0) == '/') redirectRoot = redirectRoot.substr(0, redirectRoot.length - 1);\r\n let redirectRootPath = iRoute.RedirectRoot.split('/');\r\n\r\n let urlRedirect = '';\r\n let absRoot = this.VMRoot;\r\n if (absRoot != null) {\r\n let absRootPath = absRoot.split('/');\r\n for (let i = 0; i < absRootPath.length; i++) {\r\n if (absRootPath[i] != '' && absRootPath[i] == redirectRootPath[0]) break;\r\n urlRedirect += absRootPath[i] + '/';\r\n }\r\n }\r\n\r\n urlRedirect += redirectRoot + '/' + path;\r\n urlRedirect = urlRedirect.replace(/\\/\\/+/g, '/');\r\n if (!this.routes.some(x => x.Path === path)) this.routes.push({ Path: path, Url: urlRedirect });\r\n return urlRedirect;\r\n }\r\n\r\n // For quick lookup, save the mapping between the path to the route inside the view model.\r\n if (template == null) throw new Error('vmRoute cannot find any route template');\r\n\r\n iRoute.$template = template;\r\n this.pathToRoute = this.pathToRoute || {};\r\n this.pathToRoute[path] = iRoute;\r\n\r\n // Set the absolute path to the HREF attribute, and prevent the default behavior of\r\n // the anchor click event and instead do push to HTML5 history state.\r\n let url = this.toUrl(path);\r\n url = url.length > 0 ? url : '/';\r\n if (!this.routes.some(x => x.Path === path)) this.routes.push({ Path: path, Url: url });\r\n return url;\r\n }\r\n\r\n // Routes to a path.\r\n routeTo(iPath, iTemplate, iDisableEvent, iCallbackFn, isRedirect) {\r\n const vm = this.vm;\r\n const viewModels = vm.$dotnetify.getViewModels();\r\n\r\n if (this.debug) console.log(\"router> route '\" + iPath + \"' to template id=\" + iTemplate.Id);\r\n\r\n // We can determine whether the view has already been loaded by matching the 'RoutingState.Origin' argument\r\n // on the existing view model inside that target selector with the path.\r\n for (let i = 0; i < viewModels.length; i++) {\r\n var vmOther = viewModels[i];\r\n var vmArg = vmOther.$router.VMArg;\r\n if (vmArg != null) {\r\n if (typeof vmArg['RoutingState.Origin'] === 'string' && utils.equal(vmArg['RoutingState.Origin'], iPath)) return;\r\n }\r\n }\r\n\r\n // Support enter interception.\r\n if (iDisableEvent != true && vm.hasOwnProperty('onRouteEnter')) {\r\n if (this.onRouteEnter(iPath, iTemplate) == false || vm.onRouteEnter(iPath, iTemplate) == false) return;\r\n }\r\n\r\n // Check if the route has valid target.\r\n if (iTemplate.Target == null) {\r\n console.error(\"router> the Target for template '\" + iTemplate.Id + \"' was not set. Use vm.onRouteEnter() to set the target.\");\r\n return;\r\n }\r\n\r\n // If target DOM element isn't found, redirect URL to the path.\r\n if (document.getElementById(iTemplate.Target) == null) {\r\n if (isRedirect === true) {\r\n if (this.debug) console.log(\"router> target '\" + iTemplate.Target + \"' not found in DOM\");\r\n return;\r\n }\r\n else {\r\n if (this.debug) console.log(\"router> target '\" + iTemplate.Target + \"' not found in DOM, use redirect instead\");\r\n return this.router.redirect(this.toUrl(iPath), [ ...viewModels, ...vm.$dotnetify.controller.getViewModels() ]);\r\n }\r\n }\r\n\r\n // Load the view associated with the route asynchronously.\r\n this.loadView('#' + iTemplate.Target, iTemplate.ViewUrl, iTemplate.JSModuleUrl, { 'RoutingState.Origin': iPath }, () => {\r\n // If load is successful, update the active route.\r\n this.dispatchActiveRoutingState(iPath);\r\n\r\n // Support exit interception.\r\n if (iDisableEvent != true && vm.hasOwnProperty('onRouteExit')) vm.onRouteExit(iPath, iTemplate);\r\n\r\n if (typeof iCallbackFn === 'function') iCallbackFn.call(vm);\r\n });\r\n }\r\n\r\n routeToRoute(iRoute) {\r\n var path = this.vm.$route(iRoute);\r\n if (path == null || path == '') throw new Error('The route passed to $routeTo is invalid.');\r\n\r\n setTimeout(() => this.router.pushState({}, '', path));\r\n }\r\n\r\n // Routes the URL if the view model implements IRoutable.\r\n // Returns true if the view model handles the routing.\r\n routeUrl(redirectUrlPath) {\r\n if (!this.hasRoutingState) return false;\r\n\r\n const isRedirect = !!redirectUrlPath;\r\n let root = this.RoutingState.Root;\r\n if (root == null) return false;\r\n\r\n // Get the URL path to route.\r\n let urlPath = isRedirect ? redirectUrlPath : this.router.urlPath;\r\n\r\n if (this.debug) console.log('router> routing ' + urlPath);\r\n\r\n // If the URL path matches the root path of this view, use the template with a blank URL pattern if provided.\r\n if (utils.equal(urlPath, root) || utils.equal(urlPath, root + '/') || urlPath === '/') {\r\n let match = utils.grep(this.RoutingState.Templates, function(iTemplate) {\r\n return iTemplate.UrlPattern === '';\r\n });\r\n if (match.length > 0) {\r\n this.routeTo('', match[0], null, null, isRedirect);\r\n this.router.urlPath = '';\r\n this.raiseRoutedEvent();\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n // If the URL path starts with the root path of this view, look at the next path and try to match it with the\r\n // anchor tags in this view that are bound with the vmRoute binding type. If there is match, route to that path.\r\n root = root + '/';\r\n if (utils.startsWith(urlPath, root)) {\r\n let routeElem = null;\r\n let match = utils.grep(this.routes, function(elem) {\r\n return utils.startsWith(urlPath + '/', elem.Url + '/');\r\n });\r\n if (match.length > 0) {\r\n // If more than one match, find the best match.\r\n for (let i = 0; i < match.length; i++) if (routeElem == null || routeElem.Url.length < match[i].Url.length) routeElem = match[i];\r\n }\r\n\r\n if (routeElem != null) {\r\n let path = routeElem.Path;\r\n let template =\r\n this.hasOwnProperty('pathToRoute') && this.pathToRoute.hasOwnProperty(path) ? this.pathToRoute[path].$template : null;\r\n if (template != null) {\r\n // If the URL path is completely routed, clear it.\r\n if (utils.equal(this.router.urlPath, this.toUrl(path))) this.router.urlPath = '';\r\n\r\n // If route's not already active, route to it.\r\n if (!utils.equal(this.RoutingState.Active, path)) {\r\n this.routeTo(path, template, false, () => this.raiseRoutedEvent(), isRedirect);\r\n }\r\n else this.raiseRoutedEvent();\r\n return true;\r\n }\r\n }\r\n else if (this.router.match(urlPath)) {\r\n // If no vmRoute binding matches, try to match with any template's URL pattern.\r\n this.router.urlPath = '';\r\n this.raiseRoutedEvent();\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n // Builds an absolute URL from a path.\r\n toUrl(iPath) {\r\n let path = utils.trim(iPath);\r\n if (path.charAt(0) != '(' && path != '') path = '/' + path;\r\n return this.hasRoutingState ? this.RoutingState.Root + path : iPath;\r\n }\r\n\r\n // Unmount a view if there's one on the target selector.\r\n unmountView(iTargetSelector) {\r\n throw new Error('Not implemented');\r\n }\r\n}\r\n","module.exports = __WEBPACK_EXTERNAL_MODULE__25__;","/* \r\nCopyright 2017-2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport dotnetifyVMRouter from '../core/dotnetify-vm-router';\r\nimport $ from '../libs/jquery-shim';\r\nimport utils from '../libs/utils';\r\n\r\nconst window = window || global || {};\r\n\r\nexport default class dotnetifyReactVMRouter extends dotnetifyVMRouter {\r\n get hasRoutingState() {\r\n const state = this.vm.State();\r\n return state && state.hasOwnProperty('RoutingState');\r\n }\r\n get RoutingState() {\r\n return this.vm.State().RoutingState;\r\n }\r\n get VMRoot() {\r\n return this.vm.Props('vmRoot');\r\n }\r\n get VMArg() {\r\n return this.vm.Props('vmArg');\r\n }\r\n\r\n constructor(iVM, iDotNetifyRouter) {\r\n super(iVM, iDotNetifyRouter);\r\n }\r\n\r\n onRouteEnter(iPath, iTemplate) {\r\n if (!iTemplate.ViewUrl) iTemplate.ViewUrl = iTemplate.Id;\r\n return true;\r\n }\r\n\r\n // Loads a view into a target element.\r\n loadView(iTargetSelector, iViewUrl, iJsModuleUrl, iVmArg, iCallbackFn) {\r\n const vm = this.vm;\r\n let reactProps;\r\n\r\n // If the view model supports routing, add the root path to the view, to be used\r\n // to build the absolute route path, and view model argument if provided.\r\n if (this.hasRoutingState) {\r\n if (this.RoutingState === null) {\r\n console.error(\"router> the RoutingState prop of '\" + vm.$vmId + \"' was not initialized.\");\r\n return;\r\n }\r\n\r\n let root = this.VMRoot;\r\n root = root != null ? '/' + utils.trim(this.RoutingState.Root) + '/' + utils.trim(root) : this.RoutingState.Root;\r\n reactProps = { vmRoot: root, vmArg: iVmArg };\r\n }\r\n\r\n // Provide the opportunity to override the URL.\r\n iViewUrl = this.router.overrideUrl(iViewUrl, iTargetSelector);\r\n iJsModuleUrl = this.router.overrideUrl(iJsModuleUrl, iTargetSelector);\r\n\r\n if (utils.endsWith(iViewUrl, 'html')) this.loadHtmlView(iTargetSelector, iViewUrl, iJsModuleUrl, iCallbackFn);\r\n else {\r\n let component = iViewUrl;\r\n if (typeof iViewUrl === 'string' && window.hasOwnProperty(iViewUrl)) component = window[iViewUrl];\r\n\r\n if (component instanceof HTMLElement) this.loadHtmlElementView(iTargetSelector, component, iJsModuleUrl, reactProps, iCallbackFn);\r\n else this.loadReactView(iTargetSelector, component, iJsModuleUrl, reactProps, iCallbackFn);\r\n }\r\n }\r\n\r\n // Loads a React view.\r\n loadReactView(iTargetSelector, iComponent, iJsModuleUrl, iReactProps, iCallbackFn) {\r\n return new Promise((resolve, reject) => {\r\n const vm = this.vm;\r\n const vmId = this.vm ? this.vm.$vmId : '';\r\n\r\n const mountViewFunc = () => {\r\n if (typeof iComponent !== 'function' && (typeof iComponent !== 'object' || iComponent.name == null)) {\r\n console.error(`[${vmId}] failed to load view '${iComponent}' because it's not a valid React element.`);\r\n reject();\r\n return;\r\n }\r\n\r\n this.unmountView(iTargetSelector);\r\n\r\n try {\r\n var reactElement = React.createElement(iComponent, iReactProps);\r\n ReactDOM.render(reactElement, document.querySelector(iTargetSelector));\r\n } catch (e) {\r\n console.error(e);\r\n }\r\n if (typeof callbackFn === 'function') iCallbackFn.call(vm, reactElement);\r\n resolve(reactElement);\r\n };\r\n\r\n if (iJsModuleUrl == null || dotnetify.ssr === true) mountViewFunc();\r\n else {\r\n // Load all javascripts first. Multiple files can be specified with comma delimiter.\r\n var getScripts = iJsModuleUrl.split(',').map(i => $.getScript(i));\r\n $.when.apply($, getScripts).done(mountViewFunc);\r\n }\r\n });\r\n }\r\n\r\n // Unmount a React view if there's one on the target selector.\r\n unmountView(iTargetSelector) {\r\n try {\r\n ReactDOM.unmountComponentAtNode(document.querySelector(iTargetSelector));\r\n } catch (e) {\r\n console.warn(e);\r\n }\r\n }\r\n}\r\n","/*\r\nPathJS - Copyright (c) 2011 Mike Trpcic, released under the MIT license.\r\n */\r\nconst window = window || global || {};\r\n\r\nvar Path = {\r\n // Need this specific version, because latest version is causing issue.\r\n version: '0.8.5',\r\n map: function(path) {\r\n if (Path.routes.defined.hasOwnProperty(path)) {\r\n return Path.routes.defined[path];\r\n }\r\n else {\r\n return new Path.core.route(path);\r\n }\r\n },\r\n root: function(path) {\r\n Path.routes.root = path;\r\n },\r\n rescue: function(fn) {\r\n Path.routes.rescue = fn;\r\n },\r\n history: {\r\n initial: {}, // Empty container for \"Initial Popstate\" checking variables.\r\n pushState: function(state, title, path) {\r\n if (Path.history.supported) {\r\n if (Path.dispatch(path)) {\r\n history.pushState(state, title, path);\r\n }\r\n }\r\n else {\r\n if (Path.history.fallback) {\r\n window.location.hash = '#' + path;\r\n }\r\n }\r\n },\r\n popState: function(event) {\r\n var initialPop = !Path.history.initial.popped && location.href == Path.history.initial.URL;\r\n Path.history.initial.popped = true;\r\n if (initialPop) return;\r\n Path.dispatch(document.location.pathname === '/' ? '' : document.location.pathname);\r\n },\r\n listen: function(fallback) {\r\n Path.history.supported = !!(window.history && window.history.pushState);\r\n Path.history.fallback = fallback;\r\n\r\n if (Path.history.supported) {\r\n (Path.history.initial.popped = 'state' in window.history), (Path.history.initial.URL = location.href);\r\n window.onpopstate = Path.history.popState;\r\n }\r\n else {\r\n if (Path.history.fallback) {\r\n for (route in Path.routes.defined) {\r\n if (route.charAt(0) != '#') {\r\n Path.routes.defined['#' + route] = Path.routes.defined[route];\r\n Path.routes.defined['#' + route].path = '#' + route;\r\n }\r\n }\r\n Path.listen();\r\n }\r\n }\r\n }\r\n },\r\n match: function(path, parameterize) {\r\n var params = {},\r\n route = null,\r\n possible_routes,\r\n slice,\r\n i,\r\n j,\r\n compare,\r\n result;\r\n for (route in Path.routes.defined) {\r\n if (route !== null && route !== undefined) {\r\n route = Path.routes.defined[route];\r\n possible_routes = route.partition();\r\n for (j = 0; j < possible_routes.length; j++) {\r\n slice = possible_routes[j];\r\n compare = path;\r\n if (slice.search(/:/) > 0) {\r\n for (i = 0; i < slice.split('/').length; i++) {\r\n if (i < compare.split('/').length && slice.split('/')[i].charAt(0) === ':') {\r\n params[slice.split('/')[i].replace(/:/, '')] = compare.split('/')[i];\r\n result = compare.split('/');\r\n result[i] = slice.split('/')[i];\r\n compare = result.join('/');\r\n }\r\n }\r\n }\r\n if (slice === compare) {\r\n if (parameterize) {\r\n route.params = params;\r\n }\r\n return route;\r\n }\r\n }\r\n }\r\n }\r\n return null;\r\n },\r\n dispatch: function(passed_route) {\r\n var previous_route, matched_route;\r\n if (Path.routes.current !== passed_route) {\r\n Path.routes.previous = Path.routes.current;\r\n Path.routes.current = passed_route;\r\n matched_route = Path.match(passed_route, true);\r\n\r\n if (Path.routes.previous) {\r\n previous_route = Path.match(Path.routes.previous);\r\n if (previous_route !== null && previous_route.do_exit !== null) {\r\n previous_route.do_exit();\r\n }\r\n }\r\n\r\n if (matched_route !== null) {\r\n matched_route.run();\r\n return true;\r\n }\r\n else {\r\n if (Path.routes.rescue !== null) {\r\n Path.routes.rescue();\r\n }\r\n }\r\n }\r\n },\r\n listen: function() {\r\n var fn = function() {\r\n Path.dispatch(location.hash);\r\n };\r\n\r\n if (location.hash === '') {\r\n if (Path.routes.root !== null) {\r\n location.hash = Path.routes.root;\r\n }\r\n }\r\n\r\n // The 'document.documentMode' checks below ensure that PathJS fires the right events\r\n // even in IE \"Quirks Mode\".\r\n if ('onhashchange' in window && (!document.documentMode || document.documentMode >= 8)) {\r\n window.onhashchange = fn;\r\n }\r\n else {\r\n setInterval(fn, 50);\r\n }\r\n\r\n if (location.hash !== '') {\r\n Path.dispatch(location.hash);\r\n }\r\n },\r\n core: {\r\n route: function(path) {\r\n this.path = path;\r\n this.action = null;\r\n this.do_enter = [];\r\n this.do_exit = null;\r\n this.params = {};\r\n Path.routes.defined[path] = this;\r\n }\r\n },\r\n routes: {\r\n current: null,\r\n root: null,\r\n rescue: null,\r\n previous: null,\r\n defined: {}\r\n }\r\n};\r\n\r\nPath.core.route.prototype = {\r\n to: function(fn) {\r\n this.action = fn;\r\n return this;\r\n },\r\n enter: function(fns) {\r\n if (fns instanceof Array) {\r\n this.do_enter = this.do_enter.concat(fns);\r\n }\r\n else {\r\n this.do_enter.push(fns);\r\n }\r\n return this;\r\n },\r\n exit: function(fn) {\r\n this.do_exit = fn;\r\n return this;\r\n },\r\n partition: function() {\r\n var parts = [],\r\n options = [],\r\n re = /\\(([^}]+?)\\)/g,\r\n text,\r\n i;\r\n while ((text = re.exec(this.path))) {\r\n parts.push(text[1]);\r\n }\r\n options.push(this.path.split('(')[0]);\r\n for (i = 0; i < parts.length; i++) {\r\n options.push(options[options.length - 1] + parts[i]);\r\n }\r\n return options;\r\n },\r\n run: function() {\r\n var halt_execution = false,\r\n i,\r\n result,\r\n previous;\r\n\r\n if (Path.routes.defined[this.path].hasOwnProperty('do_enter')) {\r\n if (Path.routes.defined[this.path].do_enter.length > 0) {\r\n for (i = 0; i < Path.routes.defined[this.path].do_enter.length; i++) {\r\n result = Path.routes.defined[this.path].do_enter[i].apply(this, null);\r\n if (result === false) {\r\n halt_execution = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n if (!halt_execution) {\r\n Path.routes.defined[this.path].action();\r\n }\r\n }\r\n};\r\n\r\nexport default Path;\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport Path from '../libs/path';\r\n\r\nconst window = window || global || {};\r\n\r\nexport default class dotnetifyRouter {\r\n version = '2.0.1';\r\n\r\n // URL path that will be parsed when performing routing.\r\n urlPath = document.location.pathname;\r\n\r\n constructor(debug) {\r\n this.debug = debug;\r\n }\r\n\r\n // Initialize routing using PathJS.\r\n init() {\r\n if (typeof Path !== 'undefined') {\r\n Path.history.listen(true);\r\n Path.routes.rescue = function() {\r\n //window.location.replace(document.location.pathname);\r\n };\r\n }\r\n else throw new Error('Pathjs library is required for routing.');\r\n }\r\n\r\n // Map a route to an action.\r\n mapTo(iPath, iFn) {\r\n iPath = iPath.length > 0 ? iPath : '/';\r\n if (typeof Path !== 'undefined')\r\n Path.map(iPath).to(function() {\r\n iFn(this.params);\r\n });\r\n }\r\n\r\n // Match a URL path to a route and run the action.\r\n match(iUrlPath) {\r\n if (typeof Path !== 'undefined') {\r\n var matched = Path.match(iUrlPath, true);\r\n if (matched != null) {\r\n matched.run();\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n // Optional callback to override a URL before performing routing.\r\n overrideUrl(iUrl) {\r\n return iUrl;\r\n }\r\n\r\n // Push state to HTML history.\r\n pushState(iState, iTitle, iPath) {\r\n this.urlPath = '';\r\n if (typeof Path !== 'undefined') Path.history.pushState(iState, iTitle, iPath);\r\n }\r\n\r\n // Redirect to the a URL.\r\n redirect(iUrl, viewModels) {\r\n // Check first whether existing views can handle routing this URL.\r\n // Otherwise, do a hard browser redirect.\r\n this.urlPath = iUrl;\r\n for (let i = 0; i < viewModels.length; i++) {\r\n const vm = viewModels[i];\r\n if (vm.$router.routeUrl(iUrl)) {\r\n if (this.debug) console.log('router> redirected');\r\n return;\r\n }\r\n }\r\n window.location.replace(iUrl);\r\n }\r\n\r\n // Called by dotNetify when a view model is ready.\r\n $ready() {\r\n this.$router.initRouting();\r\n }\r\n\r\n // Called by dotNetify when a view model receives update.\r\n $update(vmData) {\r\n if (vmData && vmData.RoutingState) this.$router.initRouting();\r\n }\r\n}\r\n","/* \r\nCopyright 2017 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport dotnetify from './dotnetify-react';\r\nimport dotnetifyRouter from '../core/dotnetify-router';\r\nimport dotnetifyReactVMRouter from './dotnetify-react.vm-router';\r\n\r\n// Add plugin functions.\r\ndotnetify.react.router = new dotnetifyRouter(dotnetify.debug);\r\n\r\n// Inject a view model with functions.\r\ndotnetify.react.router.$inject = function(iVM) {\r\n const router = new dotnetifyReactVMRouter(iVM, dotnetify.react.router);\r\n\r\n // Put functions inside $router namespace.\r\n iVM.$router = router;\r\n\r\n // Handles click event from anchor tags. Argument can be event object or path string.\r\n iVM.$handleRoute = iArg => router.handleRoute(iArg);\r\n\r\n // Returns the URL for an anchor tag.\r\n iVM.$route = (iRoute, iTarget) => router.route(iRoute, iTarget);\r\n\r\n // Executes the given route.\r\n iVM.$routeTo = iRoute => router.routeToRoute(iRoute);\r\n};\r\n\r\n// Provide function to load a view.\r\ndotnetify.react.router.$mount = function(iTargetSelector, iComponent, iProps, iCallbackFn) {\r\n return dotnetifyReactVMRouter.prototype.loadReactView(iTargetSelector, iComponent, null, iProps, iCallbackFn);\r\n};\r\n\r\n// Register the plugin to dotNetify.\r\ndotnetify.react.plugins['router'] = dotnetify.react.router;\r\n","import dotnetify from './dotnetify-react';\r\nimport './dotnetify-react.router';\r\nimport './ssr';\r\nimport Scope from './Scope';\r\nimport RouteLink from './RouteLink';\r\nimport RouteTarget from './RouteTarget';\r\nimport useConnect from './useConnect';\r\n\r\nmodule.exports = Object.assign(dotnetify, { Scope, RouteLink, RouteTarget, useConnect });\r\n"],"sourceRoot":""} \ No newline at end of file diff --git a/DevApp/dist/dist/dotnetify-react.min.js b/DevApp/dist/dist/dotnetify-react.min.js index e334ac41..c0d309d8 100644 --- a/DevApp/dist/dist/dotnetify-react.min.js +++ b/DevApp/dist/dist/dotnetify-react.min.js @@ -1,7 +1,7 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("@aspnet/signalr"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","@aspnet/signalr","react-dom"],e):"object"==typeof exports?exports.dotnetify=e(require("react"),require("@aspnet/signalr"),require("react-dom")):t.dotnetify=e(t.React,t.signalR,t.ReactDOM)}(window,function(t,e,n){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=28)}([function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(14)),o=i(n(5));function i(t){return t&&t.__esModule?t:{default:t}}var u=u||t||{},a=u.dotnetify||r.default;a.react={version:"3.0.0",viewModels:{},plugins:{},controller:a,_hubs:[],init:function(t){var e=a.react,n=function(){t.isHubStarted||Object.keys(e.viewModels).filter(function(n){return e.viewModels[n].$hub===t}).forEach(function(t){return e.viewModels[t].$requested=!1}),a.startHub(t)};e._hubs.some(function(e){return e===t})||(t.responseEvent.subscribe(function(t,n){return e._responseVM(t,n)}),t.connectedEvent.subscribe(function(){return Object.keys(e.viewModels).filter(function(n){return e.viewModels[n].$hub===t&&!e.viewModels[n].$requested}).forEach(function(t){return e.viewModels[t].$request()})}),t.reconnectedEvent.subscribe(n),"local"!==t.mode&&e._hubs.push(t)),n()},connect:function(t,e,n){if(arguments.length<2)throw new Error("[dotNetify] Missing arguments. Usage: connect(vmId, component) ");var r=n&&n.vmArg;if(a.ssr&&a.react.ssrConnect)return a.react.ssrConnect(t,e,r);var i=a.react;if(i.viewModels.hasOwnProperty(t))return console.error("Component is attempting to connect to an already active '"+t+"'. If it's from a dismounted component, you must add vm.$destroy to componentWillUnmount()."),i.viewModels[t].$destroy(),setTimeout(function(){return i.connect(t,e,n)});var u={get props(){return e.props},get state(){return e.state},setState:function(t){e.setState(t)}},c=a.selectHub({vmId:t,options:n,hub:null});return i.viewModels[t]=new o.default(c.vmId,u,c.options,i,c.hub),c.hub&&i.init(c.hub),i.viewModels[t]},getViewModels:function(){var t=a.react;return Object.keys(t.viewModels).map(function(e){return t.viewModels[e]})},_responseVM:function(t,e){var n=a.react;if(n.viewModels.hasOwnProperty(t)){var r=n.viewModels[t];return a.checkServerSideException(t,e,r.$exceptionHandler),r.$update(e),!0}return!1}},a.addVMAccessor(a.react.getViewModels),e.default=a}).call(this,n(0))},function(t,e,n){"use strict";(function(t,r){var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=i||t||{},u=n(11),a=u.extend(function(t){return t===i||t.document?{0:t,on:function(t,e){i.addEventListener(t,e)},bind:function(t,e){i.addEventListener(t,e,!1)},unbind:function(t,e){i.removeEventListener(t,e,!1)}}:("string"!=typeof t&&(t.events=t.events||{}),{0:t,bind:function(e,n){var r=t.events[e]||[];r.push(n),t.events[e]=r},unbind:function(e,n){var r=t.events[e]||[];if(n){var o=r.indexOf(n);-1!==o&&r.splice(o,1)}else r=[];t.events[e]=r},triggerHandler:function(e,n){var r=t.events[e]||[],o=[{type:e}];Array.isArray(n)?n.forEach(function(t){o.push(t)}):n&&o.push(n),r.forEach(function(t){t.apply(this,o)})},load:function(e,n,r){var o=new i.XMLHttpRequest;return o.open("GET",e,!0),o.onload=function(){if(o.status>=200&&o.status<400){var e=o.responseText;document.querySelector(t).innerHTML=e,r.call(document.querySelector(t))}},o.send(),{abort:function(t){return o.abort(t)}}}})},u,{support:{cors:!0},trim:function(t){return"string"==typeof t?t.trim():t},inArray:function(t,e){return-1!==t.indexOf(e)},makeArray:function(t){return[].slice.call(t,0)},merge:function(t,e){return Array.prototype.push.apply(t,e),t},isEmptyObject:function(t){return!t||0===Object.keys(t).length},ajax:function(t){var e=new i.XMLHttpRequest;return e.onreadystatechange=function(){if(4===e.readyState)if(200!==e.status||e._hasError)t.error&&t.error(e);else try{t.success&&t.success(JSON.parse(e.responseText))}catch(n){t.success&&t.success(e.responseText)}},e.open(t.type,t.url),e.setRequestHeader("content-type",t.contentType),e.send(t.data.data&&"data="+t.data.data),{abort:function(t){return e.abort(t)}}},getScript:function(t,e){var n=!1,r=u.Deferred(),o=document.getElementsByTagName("head")[0],i=document.createElement("script");return i.src=t,i.onload=i.onreadystatechange=function(){n||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(n=!0,i.onload=i.onreadystatechange=null,o.removeChild(i),"function"==typeof e&&e(),r.resolve())},o.appendChild(i),r}});void 0!==i&&(i.jQuery=i.jQuery||a),"object"===o(e)&&"object"===o(r)&&(r.exports=a)}).call(this,n(0),n(12)(t))},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var n=0;n=0;)t=t.substr(0,t.length-1);for(;0==t.indexOf("/");)t=t.substr(1,t.length-1);return t}},{key:"equal",value:function(t,e){return null!=t&&null!=e&&t.toLowerCase()==e.toLowerCase()}},{key:"startsWith",value:function(t,e){return t.toLowerCase().slice(0,e.length)==e.toLowerCase()}},{key:"endsWith",value:function(t,e){return""==e||t.toLowerCase().slice(-e.length)==e.toLowerCase()}},{key:"dispatchEvent",value:function(t){if("function"==typeof Event)r.dispatchEvent(new Event(t));else{var e=document.createEvent("CustomEvent");e.initEvent(t,!0,!0),r.dispatchEvent(e)}}},{key:"grep",value:function(t,e){return Array.isArray(t)?t.filter(e):[]}}]),t}();e.createEventEmitter=function(t){var e=[];return{emit:function(){for(var t=arguments.length,n=Array(t),r=0;r "),console.log(t),e.debugFn&&e.debugFn(this.$vmId,"sent",t))}catch(t){e.handleConnectionStateChanged("error",t,this.$hub)}}}},{key:"$dispatchListState",value:function(t){var e=this,n=function(){var n=e.$itemKey[o];return n?(i=t[o])[n]?(Object.keys(i).forEach(function(t){if(t!=n){var r={};r[o+".$"+i[n]+"."+t]=i[t],e.$dispatch(r)}}),void e.$updateList(o,i)):(console.error("["+e.$vmId+"] couldn't dispatch data from '"+o+"' due to missing property '"+n+"'."),console.error(i),{v:void 0}):(console.error("["+e.$vmId+"] missing item key for '"+o+"'; add "+o+"_itemKey property to the view model."),{v:void 0})};for(var o in t){var i,u=n();if("object"===(void 0===u?"undefined":r(u)))return u.v}}},{key:"$getPlugins",value:function(){var t=this;return Object.keys(this.$dotnetify.plugins).map(function(e){return t.$dotnetify.plugins[e]})}},{key:"$preProcess",value:function(t){for(var e in t){if(null==(n=/(.*)_add/.exec(e))){if(null==(n=/(.*)_update/.exec(e))){if(null==(n=/(.*)_remove/.exec(e))){var n;if(null==(n=/(.*)_itemKey/.exec(e)));else{var r={};r[i=n[1]]=t[e],this.$setItemKey(r),delete t[e]}}else{i=n[1];if(Array.isArray(this.State()[i])){var o=this.$itemKey[i];null!=o?this.$removeList(i,function(n){return n[o]==t[e]}):console.error("["+this.$vmId+"] missing item key for '"+i+"'; add "+i+"_itemKey property to the view model.")}else console.error("["+this.$vmId+"] '"+i+"' is not found or not an array.");delete t[e]}}else{var i=n[1];Array.isArray(this.State()[i])?this.$updateList(i,t[e]):console.error("["+this.$vmId+"] '"+i+"' is not found or not an array."),delete t[e]}}else{var i=n[1];Array.isArray(this.State()[i])?this.$addList(i,t[e]):console.error("unable to resolve "+e),delete t[e]}}}},{key:"$request",value:function(){this.$hub.isConnected&&this.$hub.requestVM(this.$vmId,{$vmArg:this.$vmArg,$headers:this.$headers}),this.$requested=!0}},{key:"$update",value:function(t){var e=this.$dotnetify.controller;e.debug&&(console.log("["+this.$vmId+"] received> "),console.log(JSON.parse(t)),e.debugFn&&e.debugFn(this.$vmId,"received",JSON.parse(t)));var n=JSON.parse(t);this.$preProcess(n);var r=this.State();r=i.default.extend({},r,n),this.State(r),this.$loaded?this.$onUpdate(n):this.$onLoad()}},{key:"$onLoad",value:function(){var t=this;this.$getPlugins().map(function(e){return"function"==typeof e.$ready?e.$ready.apply(t):null}),this.$loaded=!0}},{key:"$onUpdate",value:function(t){var e=this;this.$getPlugins().map(function(n){return"function"==typeof n.$update?n.$update.apply(e,[t]):null})}},{key:"$setItemKey",value:function(t){Object.assign(this.$itemKey,t)}},{key:"$addList",value:function(t,e){var n=this.$itemKey[t];if(null!=n){if(!e.hasOwnProperty(n))return void console.error("["+this.$vmId+"] couldn't add item to '"+t+"' due to missing property '"+n+"'.");if(this.State()[t].filter(function(t){return t[n]==e[n]}).length>0)return void console.error("["+this.$vmId+"] couldn't add item to '"+t+"' because the key already exists.")}var r=this.State()[t];r.push(e);var o={};o[t]=r,this.State(o)}},{key:"$removeList",value:function(t,e){var n={};n[t]=this.State()[t].filter(function(t){return!e(t)}),this.State(n)}},{key:"$updateList",value:function(t,e){var n=this.$itemKey[t];if(null!=n){if(!e.hasOwnProperty(n))return void console.error("["+this.$vmId+"] couldn't update item to '"+t+"' due to missing property '"+n+"'.");var r={};r[t]=this.State()[t].map(function(t){return t[n]==e[n]?i.default.extend(t,e):t}),this.State(r)}else console.error("["+this.$vmId+"] missing item key for '"+t+"'; add '"+t+"_itemKey' property to the view model.")}}]),t}();e.default=u}).call(this,n(0))},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.hasLocalVM=e.dotNetifyHubLocal=void 0;var r=function(){function t(t,e){for(var n=0;n-1;)l.splice(n,1),u&&(n<=c&&c--,n<=s&&s--)}),this},has:function(t){return r.inArray(t,l)>-1},empty:function(){return l=[],this},disable:function(){return l=f=e=void 0,this},disabled:function(){return!l},lock:function(){return f=void 0,e||h.disable(),this},locked:function(){return!f},fireWith:function(t,e){return e=[t,(e=e||[]).slice?e.slice():e],!l||n&&!f||(u?f.push(e):d(e)),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!n}};return h}},function(t,e,n){ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("@aspnet/signalr"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","@aspnet/signalr","react-dom"],e):"object"==typeof exports?exports.dotnetify=e(require("react"),require("@aspnet/signalr"),require("react-dom")):t.dotnetify=e(t.React,t.signalR,t.ReactDOM)}(window,function(t,e,n){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=30)}([function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(15)),o=i(n(5));function i(t){return t&&t.__esModule?t:{default:t}}var u=u||t||{},a=u.dotnetify||r.default;a.react={version:"3.0.0",viewModels:{},plugins:{},controller:a,_hubs:[],init:function(t){var e=a.react,n=function(){t.isHubStarted||Object.keys(e.viewModels).filter(function(n){return e.viewModels[n].$hub===t}).forEach(function(t){return e.viewModels[t].$requested=!1}),a.startHub(t)};e._hubs.some(function(e){return e===t})||(t.responseEvent.subscribe(function(t,n){return e._responseVM(t,n)}),t.connectedEvent.subscribe(function(){return Object.keys(e.viewModels).filter(function(n){return e.viewModels[n].$hub===t&&!e.viewModels[n].$requested}).forEach(function(t){return e.viewModels[t].$request()})}),t.reconnectedEvent.subscribe(n),"local"!==t.mode&&e._hubs.push(t)),n()},connect:function(t,e,n){if(arguments.length<2)throw new Error("[dotNetify] Missing arguments. Usage: connect(vmId, component) ");var r=n&&n.vmArg;if(a.ssr&&a.react.ssrConnect)return a.react.ssrConnect(t,e,r);var i=a.react;if(i.viewModels.hasOwnProperty(t))return console.error("Component is attempting to connect to an already active '"+t+"'. If it's from a dismounted component, you must add vm.$destroy to componentWillUnmount()."),i.viewModels[t].$destroy(),setTimeout(function(){return i.connect(t,e,n)});var u={get props(){return e.props},get state(){return e.state},setState:function(t){e.setState(t)}},s=a.selectHub({vmId:t,options:n,hub:null});return i.viewModels[t]=new o.default(s.vmId,u,s.options,i,s.hub),s.hub&&i.init(s.hub),i.viewModels[t]},getViewModels:function(){var t=a.react;return Object.keys(t.viewModels).map(function(e){return t.viewModels[e]})},_responseVM:function(t,e){var n=a.react;if(n.viewModels.hasOwnProperty(t)){var r=n.viewModels[t];return a.checkServerSideException(t,e,r.$exceptionHandler),r.$update(e),!0}return!1}},a.addVMAccessor(a.react.getViewModels),e.default=a}).call(this,n(0))},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var n=0;n=0;)t=t.substr(0,t.length-1);for(;0==t.indexOf("/");)t=t.substr(1,t.length-1);return t}},{key:"equal",value:function(t,e){return null!=t&&null!=e&&t.toLowerCase()==e.toLowerCase()}},{key:"startsWith",value:function(t,e){return t.toLowerCase().slice(0,e.length)==e.toLowerCase()}},{key:"endsWith",value:function(t,e){return""==e||t.toLowerCase().slice(-e.length)==e.toLowerCase()}},{key:"dispatchEvent",value:function(t){if("function"==typeof Event)r.dispatchEvent(new Event(t));else{var e=document.createEvent("CustomEvent");e.initEvent(t,!0,!0),r.dispatchEvent(e)}}},{key:"grep",value:function(t,e){return Array.isArray(t)?t.filter(e):[]}}]),t}();e.createEventEmitter=function(t){var e=[];return{emit:function(){for(var t=arguments.length,n=Array(t),r=0;r=200&&a.status<400){var t=a.responseText;i(t)}else u(a)},a.onerror=function(){u(a)},a.send(n)})};e.default=new o}).call(this,n(0))},function(t,e,n){"use strict";(function(t,r){var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=i||t||{},u=n(12),a=u.extend(function(t){return t===i||t.document?{0:t,on:function(t,e){i.addEventListener(t,e)},bind:function(t,e){i.addEventListener(t,e,!1)},unbind:function(t,e){i.removeEventListener(t,e,!1)}}:("string"!=typeof t&&(t.events=t.events||{}),{0:t,bind:function(e,n){var r=t.events[e]||[];r.push(n),t.events[e]=r},unbind:function(e,n){var r=t.events[e]||[];if(n){var o=r.indexOf(n);-1!==o&&r.splice(o,1)}else r=[];t.events[e]=r},triggerHandler:function(e,n){var r=t.events[e]||[],o=[{type:e}];Array.isArray(n)?n.forEach(function(t){o.push(t)}):n&&o.push(n),r.forEach(function(t){t.apply(this,o)})},load:function(e,n,r){var o=new i.XMLHttpRequest;return o.open("GET",e,!0),o.onload=function(){if(o.status>=200&&o.status<400){var e=o.responseText;document.querySelector(t).innerHTML=e,r.call(document.querySelector(t))}},o.send(),{abort:function(t){return o.abort(t)}}}})},u,{support:{cors:!0},trim:function(t){return"string"==typeof t?t.trim():t},inArray:function(t,e){return-1!==t.indexOf(e)},makeArray:function(t){return[].slice.call(t,0)},merge:function(t,e){return Array.prototype.push.apply(t,e),t},isEmptyObject:function(t){return!t||0===Object.keys(t).length},ajax:function(t){var e=new i.XMLHttpRequest;return e.onreadystatechange=function(){if(4===e.readyState)if(200!==e.status||e._hasError)t.error&&t.error(e);else try{t.success&&t.success(JSON.parse(e.responseText))}catch(n){t.success&&t.success(e.responseText)}},e.open(t.type,t.url),e.setRequestHeader("content-type",t.contentType),e.send(t.data.data&&"data="+t.data.data),{abort:function(t){return e.abort(t)}}},getScript:function(t,e){var n=!1,r=u.Deferred(),o=document.getElementsByTagName("head")[0],i=document.createElement("script");return i.src=t,i.onload=i.onreadystatechange=function(){n||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(n=!0,i.onload=i.onreadystatechange=null,o.removeChild(i),"function"==typeof e&&e(),r.resolve())},o.appendChild(i),r}});void 0!==i&&(i.jQuery=i.jQuery||a),"object"===o(e)&&"object"===o(r)&&(r.exports=a)}).call(this,n(0),n(13)(t))},function(e,n){e.exports=t},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n "),console.log(t),e.debugFn&&e.debugFn(this.$vmId,"sent",t))}catch(t){e.handleConnectionStateChanged("error",t,this.$hub)}}}},{key:"$dispatchListState",value:function(t){var e=this,n=function(){var n=e.$itemKey[o];return n?(i=t[o])[n]?(Object.keys(i).forEach(function(t){if(t!=n){var r={};r[o+".$"+i[n]+"."+t]=i[t],e.$dispatch(r)}}),void e.$updateList(o,i)):(console.error("["+e.$vmId+"] couldn't dispatch data from '"+o+"' due to missing property '"+n+"'."),console.error(i),{v:void 0}):(console.error("["+e.$vmId+"] missing item key for '"+o+"'; add "+o+"_itemKey property to the view model."),{v:void 0})};for(var o in t){var i,u=n();if("object"===(void 0===u?"undefined":r(u)))return u.v}}},{key:"$getPlugins",value:function(){var t=this;return Object.keys(this.$dotnetify.plugins).map(function(e){return t.$dotnetify.plugins[e]})}},{key:"$preProcess",value:function(t){for(var e in t){if(null==(n=/(.*)_add/.exec(e))){if(null==(n=/(.*)_update/.exec(e))){if(null==(n=/(.*)_remove/.exec(e))){var n;if(null==(n=/(.*)_itemKey/.exec(e)));else{var r={};r[i=n[1]]=t[e],this.$setItemKey(r),delete t[e]}}else{i=n[1];if(Array.isArray(this.State()[i])){var o=this.$itemKey[i];null!=o?this.$removeList(i,function(n){return n[o]==t[e]}):console.error("["+this.$vmId+"] missing item key for '"+i+"'; add "+i+"_itemKey property to the view model.")}else console.error("["+this.$vmId+"] '"+i+"' is not found or not an array.");delete t[e]}}else{var i=n[1];Array.isArray(this.State()[i])?this.$updateList(i,t[e]):console.error("["+this.$vmId+"] '"+i+"' is not found or not an array."),delete t[e]}}else{var i=n[1];Array.isArray(this.State()[i])?this.$addList(i,t[e]):console.error("unable to resolve "+e),delete t[e]}}}},{key:"$request",value:function(){this.$hub.isConnected&&this.$hub.requestVM(this.$vmId,{$vmArg:this.$vmArg,$headers:this.$headers}),this.$requested=!0}},{key:"$update",value:function(t){var e=this.$dotnetify.controller;e.debug&&(console.log("["+this.$vmId+"] received> "),console.log(JSON.parse(t)),e.debugFn&&e.debugFn(this.$vmId,"received",JSON.parse(t)));var n=JSON.parse(t);this.$preProcess(n);var r=this.State();r=i.default.extend({},r,n),this.State(r),this.$loaded?this.$onUpdate(n):this.$onLoad()}},{key:"$onLoad",value:function(){var t=this;this.$getPlugins().map(function(e){return"function"==typeof e.$ready?e.$ready.apply(t):null}),this.$loaded=!0}},{key:"$onUpdate",value:function(t){var e=this;this.$getPlugins().map(function(n){return"function"==typeof n.$update?n.$update.apply(e,[t]):null})}},{key:"$setItemKey",value:function(t){Object.assign(this.$itemKey,t)}},{key:"$addList",value:function(t,e){var n=this.$itemKey[t];if(null!=n){if(!e.hasOwnProperty(n))return void console.error("["+this.$vmId+"] couldn't add item to '"+t+"' due to missing property '"+n+"'.");if(this.State()[t].filter(function(t){return t[n]==e[n]}).length>0)return void console.error("["+this.$vmId+"] couldn't add item to '"+t+"' because the key already exists.")}var r=this.State()[t];r.push(e);var o={};o[t]=r,this.State(o)}},{key:"$removeList",value:function(t,e){var n={};n[t]=this.State()[t].filter(function(t){return!e(t)}),this.State(n)}},{key:"$updateList",value:function(t,e){var n=this.$itemKey[t];if(null!=n){if(!e.hasOwnProperty(n))return void console.error("["+this.$vmId+"] couldn't update item to '"+t+"' due to missing property '"+n+"'.");var r={};r[t]=this.State()[t].map(function(t){return t[n]==e[n]?i.default.extend(t,e):t}),this.State(r)}else console.error("["+this.$vmId+"] missing item key for '"+t+"'; add '"+t+"_itemKey' property to the view model.")}}]),t}();e.default=u}).call(this,n(0))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createWebApiHub=e.dotNetifyHubWebApi=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n-1;)l.splice(n,1),u&&(n<=s&&s--,n<=c&&c--)}),this},has:function(t){return r.inArray(t,l)>-1},empty:function(){return l=[],this},disable:function(){return l=f=e=void 0,this},disabled:function(){return!l},lock:function(){return f=void 0,e||h.disable(),this},locked:function(){return!f},fireWith:function(t,e){return e=[t,(e=e||[]).slice?e.slice():e],!l||n&&!f||(u?f.push(e):d(e)),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!n}};return h}},function(t,e,n){ /*! * jquery-deferred * Copyright(c) 2011 Hidden * MIT Licensed */ -var r=t.exports=n(9),o=Array.prototype.slice;r.extend({Deferred:function(t){var e=[["resolve","done",r.Callbacks("once memory"),"resolved"],["reject","fail",r.Callbacks("once memory"),"rejected"],["notify","progress",r.Callbacks("memory")]],n="pending",o={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var t=arguments;return r.Deferred(function(n){r.each(e,function(e,o){var u=o[0],a=t[e];i[o[1]](r.isFunction(a)?function(){var t=a.apply(this,arguments);t&&r.isFunction(t.promise)?t.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[u+"With"](this===i?n:this,[t])}:n[u])}),t=null}).promise()},promise:function(t){return null!=t?r.extend(t,o):o}},i={};return o.pipe=o.then,r.each(e,function(t,r){var u=r[2],a=r[3];o[r[1]]=u.add,a&&u.add(function(){n=a},e[1^t][2].disable,e[2][2].lock),i[r[0]]=u.fire,i[r[0]+"With"]=u.fireWith}),o.promise(i),t&&t.call(i,i),i},when:function(t){var e,n,i,u=0,a=o.call(arguments),c=a.length,s=1!==c||t&&r.isFunction(t.promise)?c:0,l=1===s?t:r.Deferred(),f=function(t,n,r){return function(i){n[t]=this,r[t]=arguments.length>1?o.call(arguments):i,r===e?l.notifyWith(n,r):--s||l.resolveWith(n,r)}};if(c>1)for(e=new Array(c),n=new Array(c),i=new Array(c);u0?t._startConnection(e,n):t._onDisconnected()});return"function"==typeof t._startDoneHandler&&u.then(t._startDoneHandler).catch(t._startFailHandler||function(){}),u},start:function(e){t._startDoneHandler=null,t._startFailHandler=null;var n=[0],r={webSockets:0,serverSentEvents:1,longPolling:2};e&&Array.isArray(e.transport)&&(n=e.transport.map(function(t){return r[t]}));var o=t._startConnection(e,n);return{done:function(e){return t._startDoneHandler=e,o.then(e).catch(function(t){throw t}),this},fail:function(e){return t._startFailHandler=e,o.catch(e),this}}},disconnected:function(e){"function"==typeof e&&(t._disconnectedHandler=e)},stateChanged:function(e){"function"==typeof e&&(t._stateChangedHandler=e)},reconnect:function(e){if("function"==typeof e)if(!t.reconnectRetry||t._reconnectCount=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}(e,["id"]);return i.default.createElement("div",r({id:n,ref:function(e){return t.elem=e}},this.props,{dangerouslySetInnerHTML:this.initialHtml}))}}]),e}();e.default=s,u.default.react.router.RouteTarget=s}).call(this,n(0))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n document head tag is required for server-side render.");var s=!1,l=i?setTimeout(function(){s||o()},i):0;u.addEventListener("dotnetify.routed",function(){s=!0,0!=l&&clearTimeout(l),o()}),u.ssr=JSON.parse(n)}}).call(this,n(0))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n map "+r+" to template id="+e.Id),t.router.mapTo(r,function(r){t.router.urlPath="";var o=n;for(var i in r)o=o.replace(":"+i,r[i]);o=o.replace(/\(\/:([^)]+)\)/g,"").replace(/\(|\)/g,""),t.routeTo(o,e)})});var r=this.toUrl(this.RoutingState.Active);""==this.router.urlPath&&(this.router.urlPath=r),this.routeUrl()||this.raiseRoutedEvent(!0)}}else console.error("router> the RoutingState prop of '"+e.$vmId+"' was not initialized.")}},{key:"isActive",value:function(t){return!(null==t||!t.hasOwnProperty("Path"))&&i.default.equal(t.Path,this.RoutingState.Active)}},{key:"loadHtmlView",value:function(t,e,n,r){var o=this.vm;this.unmountView(t),$(t).load(e,null,function(){if(null!=n){var t=n.split(",").map(function(t){return $.getScript(t)});$.when.apply($,t).done(function(){return"function"==typeof callbackFn&&r.call(o)})}else"function"==typeof callbackFn&&r.call(o)})}},{key:"loadHtmlElementView",value:function(t,e,n,r,o){var i=this,u=this.vm,a=function(){i.unmountView(t);for(var n=document.querySelector(t);n.firstChild;)n.removeChild(n.firstChild);n.appendChild(e),"function"==typeof callbackFn&&o.call(u)};if(null==n)a();else{var c=n.split(",").map(function(t){return $.getScript(t)});$.when.apply($,c).done(a)}}},{key:"loadView",value:function(t,e,n,r,o){throw new Error("Not implemented")}},{key:"manualRouteTo",value:function(t,e,n,r){this.vm;var o={Id:"manual",Target:e,ViewUrl:n,JSModuleUrl:r};this.routeTo(t,o,!0)}},{key:"onRouteEnter",value:function(t,e){return!0}},{key:"raiseRoutedEvent",value:function(t){this.vm;""!=this.router.urlPath&&1!=t||(this.debug&&console.log("router> routed"),i.default.dispatchEvent("dotnetify.routed"))}},{key:"route",value:function(t,e){if(null!=t){if(!t.hasOwnProperty("Path")&&!t.hasOwnProperty("TemplateId"))throw new Error("Not a valid route");this.initRoot();var n=t.Path,r=null;if(this.hasRoutingState&&null!=this.RoutingState.Templates&&null!=t.TemplateId){var o=this.RoutingState.Templates.filter(function(e){return e.Id==t.TemplateId});if(o.length>0)r=o[0],"string"==typeof e&&(r.Target=e),null==n&&(n=null!=r.UrlPattern?r.UrlPattern:r.Id,t.Path=n);else if(null==t.RedirectRoot)throw new Error("vmRoute cannot find route template "+t.TemplateId)}if(null!=t.RedirectRoot){var i=t.RedirectRoot;"/"==i.charAt(0)&&(i=i.substr(0,i.length-1));var u=t.RedirectRoot.split("/"),a="",c=this.VMRoot;if(null!=c)for(var s=c.split("/"),l=0;l0?f:"/",this.routes.some(function(t){return t.Path===n})||this.routes.push({Path:n,Url:f}),f}}},{key:"routeTo",value:function(t,e,n,r,o){var a=this,c=this.vm,s=c.$dotnetify.getViewModels();this.debug&&console.log("router> route '"+t+"' to template id="+e.Id);for(var l=0;l target '"+e.Target+"' not found in DOM")):(this.debug&&console.log("router> target '"+e.Target+"' not found in DOM, use redirect instead"),this.router.redirect(this.toUrl(t),[].concat(u(s),u(c.$dotnetify.controller.getViewModels())))):void this.loadView("#"+e.Target,e.ViewUrl,e.JSModuleUrl,{"RoutingState.Origin":t},function(){a.dispatchActiveRoutingState(t),1!=n&&c.hasOwnProperty("onRouteExit")&&c.onRouteExit(t,e),"function"==typeof r&&r.call(c)});console.error("router> the Target for template '"+e.Id+"' was not set. Use vm.onRouteEnter() to set the target.")}}},{key:"routeToRoute",value:function(t){var e=this,n=this.vm.$route(t);if(null==n||""==n)throw new Error("The route passed to $routeTo is invalid.");setTimeout(function(){return e.router.pushState({},"",n)})}},{key:"routeUrl",value:function(t){var e=this;if(!this.hasRoutingState)return!1;var n=!!t,r=this.RoutingState.Root;if(null==r)return!1;var o=n?t:this.router.urlPath;if(this.debug&&console.log("router> routing "+o),i.default.equal(o,r)||i.default.equal(o,r+"/")||"/"===o){var u=i.default.grep(this.RoutingState.Templates,function(t){return""===t.UrlPattern});return u.length>0&&(this.routeTo("",u[0],null,null,n),this.router.urlPath="",this.raiseRoutedEvent(),!0)}if(r+="/",i.default.startsWith(o,r)){var a=null,c=i.default.grep(this.routes,function(t){return i.default.startsWith(o+"/",t.Url+"/")});if(c.length>0)for(var s=0;s the RoutingState prop of '"+i.$vmId+"' was not initialized.");var a=this.VMRoot;u={vmRoot:a=null!=a?"/"+s.default.trim(this.RoutingState.Root)+"/"+s.default.trim(a):this.RoutingState.Root,vmArg:r}}if(e=this.router.overrideUrl(e,t),n=this.router.overrideUrl(n,t),s.default.endsWith(e,"html"))this.loadHtmlView(t,e,n,o);else{var c=e;"string"==typeof e&&f.hasOwnProperty(e)&&(c=f[e]),c instanceof HTMLElement?this.loadHtmlElementView(t,c,n,u,o):this.loadReactView(t,c,n,u,o)}}},{key:"loadReactView",value:function(t,e,n,o,a){var s=this;return new Promise(function(l,f){var d=s.vm,h=s.vm?s.vm.$vmId:"",p=function(){if("function"!=typeof e&&("object"!==(void 0===e?"undefined":r(e))||null==e.name))return console.error("["+h+"] failed to load view '"+e+"' because it's not a valid React element."),void f();s.unmountView(t);try{var n=i.default.createElement(e,o);u.default.render(n,document.querySelector(t))}catch(t){console.error(t)}"function"==typeof callbackFn&&a.call(d,n),l(n)};if(null==n||!0===dotnetify.ssr)p();else{var y=n.split(",").map(function(t){return c.default.getScript(t)});c.default.when.apply(c.default,y).done(p)}})}},{key:"unmountView",value:function(t){try{u.default.unmountComponentAtNode(document.querySelector(t))}catch(t){console.warn(t)}}}]),e}();e.default=d}).call(this,n(0))},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var n=n||t||{},r={version:"0.8.5",map:function(t){return r.routes.defined.hasOwnProperty(t)?r.routes.defined[t]:new r.core.route(t)},root:function(t){r.routes.root=t},rescue:function(t){r.routes.rescue=t},history:{initial:{},pushState:function(t,e,o){r.history.supported?r.dispatch(o)&&history.pushState(t,e,o):r.history.fallback&&(n.location.hash="#"+o)},popState:function(t){var e=!r.history.initial.popped&&location.href==r.history.initial.URL;r.history.initial.popped=!0,e||r.dispatch("/"===document.location.pathname?"":document.location.pathname)},listen:function(t){if(r.history.supported=!(!n.history||!n.history.pushState),r.history.fallback=t,r.history.supported)r.history.initial.popped="state"in n.history,r.history.initial.URL=location.href,n.onpopstate=r.history.popState;else if(r.history.fallback){for(route in r.routes.defined)"#"!=route.charAt(0)&&(r.routes.defined["#"+route]=r.routes.defined[route],r.routes.defined["#"+route].path="#"+route);r.listen()}}},match:function(t,e){var n,o,i,u,a,c,s={},l=null;for(l in r.routes.defined)if(null!==l&&void 0!==l)for(n=(l=r.routes.defined[l]).partition(),u=0;u0)for(i=0;i=8)?n.onhashchange=t:setInterval(t,50),""!==location.hash&&r.dispatch(location.hash)},core:{route:function(t){this.path=t,this.action=null,this.do_enter=[],this.do_exit=null,this.params={},r.routes.defined[t]=this}},routes:{current:null,root:null,rescue:null,previous:null,defined:{}}};r.core.route.prototype={to:function(t){return this.action=t,this},enter:function(t){return t instanceof Array?this.do_enter=this.do_enter.concat(t):this.do_enter.push(t),this},exit:function(t){return this.do_exit=t,this},partition:function(){for(var t,e,n=[],r=[],o=/\(([^}]+?)\)/g;t=o.exec(this.path);)n.push(t[1]);for(r.push(this.path.split("(")[0]),e=0;e0)for(t=0;t0?t:"/",void 0!==o.default&&o.default.map(t).to(function(){e(this.params)})}},{key:"match",value:function(t){if(void 0!==o.default){var e=o.default.match(t,!0);if(null!=e)return e.run(),!0}return!1}},{key:"overrideUrl",value:function(t){return t}},{key:"pushState",value:function(t,e,n){this.urlPath="",void 0!==o.default&&o.default.history.pushState(t,e,n)}},{key:"redirect",value:function(t,e){this.urlPath=t;for(var n=0;n redirected"))}i.location.replace(t)}},{key:"$ready",value:function(){this.$router.initRouting()}},{key:"$update",value:function(t){t&&t.RoutingState&&this.$router.initRouting()}}]),t}();e.default=u}).call(this,n(0))},function(t,e,n){"use strict";var r=u(n(1)),o=u(n(26)),i=u(n(24));function u(t){return t&&t.__esModule?t:{default:t}}r.default.react.router=new o.default(r.default.debug),r.default.react.router.$inject=function(t){var e=new i.default(t,r.default.react.router);t.$router=e,t.$handleRoute=function(t){return e.handleRoute(t)},t.$route=function(t,n){return e.route(t,n)},t.$routeTo=function(t){return e.routeToRoute(t)}},r.default.react.router.$mount=function(t,e,n,r){return i.default.prototype.loadReactView(t,e,null,n,r)},r.default.react.plugins.router=r.default.react.router},function(t,e,n){"use strict";var r=a(n(1));n(27),n(21);var o=a(n(20)),i=a(n(16)),u=a(n(15));function a(t){return t&&t.__esModule?t:{default:t}}t.exports=Object.assign(r.default,{Scope:o.default,RouteLink:i.default,RouteTarget:u.default})}])}); \ No newline at end of file +var r=t.exports=n(10),o=Array.prototype.slice;r.extend({Deferred:function(t){var e=[["resolve","done",r.Callbacks("once memory"),"resolved"],["reject","fail",r.Callbacks("once memory"),"rejected"],["notify","progress",r.Callbacks("memory")]],n="pending",o={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var t=arguments;return r.Deferred(function(n){r.each(e,function(e,o){var u=o[0],a=t[e];i[o[1]](r.isFunction(a)?function(){var t=a.apply(this,arguments);t&&r.isFunction(t.promise)?t.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[u+"With"](this===i?n:this,[t])}:n[u])}),t=null}).promise()},promise:function(t){return null!=t?r.extend(t,o):o}},i={};return o.pipe=o.then,r.each(e,function(t,r){var u=r[2],a=r[3];o[r[1]]=u.add,a&&u.add(function(){n=a},e[1^t][2].disable,e[2][2].lock),i[r[0]]=u.fire,i[r[0]+"With"]=u.fireWith}),o.promise(i),t&&t.call(i,i),i},when:function(t){var e,n,i,u=0,a=o.call(arguments),s=a.length,c=1!==s||t&&r.isFunction(t.promise)?s:0,l=1===c?t:r.Deferred(),f=function(t,n,r){return function(i){n[t]=this,r[t]=arguments.length>1?o.call(arguments):i,r===e?l.notifyWith(n,r):--c||l.resolveWith(n,r)}};if(s>1)for(e=new Array(s),n=new Array(s),i=new Array(s);u0?t._startConnection(e,n):t._onDisconnected()});return"function"==typeof t._startDoneHandler&&u.then(t._startDoneHandler).catch(t._startFailHandler||function(){}),u},start:function(e){t._startDoneHandler=null,t._startFailHandler=null;var n=[0],r={webSockets:0,serverSentEvents:1,longPolling:2};e&&Array.isArray(e.transport)&&(n=e.transport.map(function(t){return r[t]}));var o=t._startConnection(e,n);return{done:function(e){return t._startDoneHandler=e,o.then(e).catch(function(t){throw t}),this},fail:function(e){return t._startFailHandler=e,o.catch(e),this}}},disconnected:function(e){"function"==typeof e&&(t._disconnectedHandler=e)},stateChanged:function(e){"function"==typeof e&&(t._stateChangedHandler=e)},reconnect:function(e){if("function"==typeof e)if(!t.reconnectRetry||t._reconnectCount=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}(e,["id"]);return i.default.createElement("div",r({id:n,ref:function(e){return t.elem=e}},this.props,{dangerouslySetInnerHTML:this.initialHtml}))}}]),e}();e.default=c,u.default.react.router.RouteTarget=c}).call(this,n(0))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n document head tag is required for server-side render.");var c=!1,l=i?setTimeout(function(){c||o()},i):0;u.addEventListener("dotnetify.routed",function(){c=!0,0!=l&&clearTimeout(l),o()}),u.ssr=JSON.parse(n)}}).call(this,n(0))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n map "+r+" to template id="+e.Id),t.router.mapTo(r,function(r){t.router.urlPath="";var o=n;for(var i in r)o=o.replace(":"+i,r[i]);o=o.replace(/\(\/:([^)]+)\)/g,"").replace(/\(|\)/g,""),t.routeTo(o,e)})});var r=this.toUrl(this.RoutingState.Active);""==this.router.urlPath&&(this.router.urlPath=r),this.routeUrl()||this.raiseRoutedEvent(!0)}}else console.error("router> the RoutingState prop of '"+e.$vmId+"' was not initialized.")}},{key:"isActive",value:function(t){return!(null==t||!t.hasOwnProperty("Path"))&&i.default.equal(t.Path,this.RoutingState.Active)}},{key:"loadHtmlView",value:function(t,e,n,r){var o=this.vm;this.unmountView(t),$(t).load(e,null,function(){if(null!=n){var t=n.split(",").map(function(t){return $.getScript(t)});$.when.apply($,t).done(function(){return"function"==typeof callbackFn&&r.call(o)})}else"function"==typeof callbackFn&&r.call(o)})}},{key:"loadHtmlElementView",value:function(t,e,n,r,o){var i=this,u=this.vm,a=function(){i.unmountView(t);for(var n=document.querySelector(t);n.firstChild;)n.removeChild(n.firstChild);n.appendChild(e),"function"==typeof callbackFn&&o.call(u)};if(null==n)a();else{var s=n.split(",").map(function(t){return $.getScript(t)});$.when.apply($,s).done(a)}}},{key:"loadView",value:function(t,e,n,r,o){throw new Error("Not implemented")}},{key:"manualRouteTo",value:function(t,e,n,r){this.vm;var o={Id:"manual",Target:e,ViewUrl:n,JSModuleUrl:r};this.routeTo(t,o,!0)}},{key:"onRouteEnter",value:function(t,e){return!0}},{key:"raiseRoutedEvent",value:function(t){this.vm;""!=this.router.urlPath&&1!=t||(this.debug&&console.log("router> routed"),i.default.dispatchEvent("dotnetify.routed"))}},{key:"route",value:function(t,e){if(null!=t){if(!t.hasOwnProperty("Path")&&!t.hasOwnProperty("TemplateId"))throw new Error("Not a valid route");this.initRoot();var n=t.Path,r=null;if(this.hasRoutingState&&null!=this.RoutingState.Templates&&null!=t.TemplateId){var o=this.RoutingState.Templates.filter(function(e){return e.Id==t.TemplateId});if(o.length>0)r=o[0],"string"==typeof e&&(r.Target=e),null==n&&(n=null!=r.UrlPattern?r.UrlPattern:r.Id,t.Path=n);else if(null==t.RedirectRoot)throw new Error("vmRoute cannot find route template "+t.TemplateId)}if(null!=t.RedirectRoot){var i=t.RedirectRoot;"/"==i.charAt(0)&&(i=i.substr(0,i.length-1));var u=t.RedirectRoot.split("/"),a="",s=this.VMRoot;if(null!=s)for(var c=s.split("/"),l=0;l0?f:"/",this.routes.some(function(t){return t.Path===n})||this.routes.push({Path:n,Url:f}),f}}},{key:"routeTo",value:function(t,e,n,r,o){var a=this,s=this.vm,c=s.$dotnetify.getViewModels();this.debug&&console.log("router> route '"+t+"' to template id="+e.Id);for(var l=0;l target '"+e.Target+"' not found in DOM")):(this.debug&&console.log("router> target '"+e.Target+"' not found in DOM, use redirect instead"),this.router.redirect(this.toUrl(t),[].concat(u(c),u(s.$dotnetify.controller.getViewModels())))):void this.loadView("#"+e.Target,e.ViewUrl,e.JSModuleUrl,{"RoutingState.Origin":t},function(){a.dispatchActiveRoutingState(t),1!=n&&s.hasOwnProperty("onRouteExit")&&s.onRouteExit(t,e),"function"==typeof r&&r.call(s)});console.error("router> the Target for template '"+e.Id+"' was not set. Use vm.onRouteEnter() to set the target.")}}},{key:"routeToRoute",value:function(t){var e=this,n=this.vm.$route(t);if(null==n||""==n)throw new Error("The route passed to $routeTo is invalid.");setTimeout(function(){return e.router.pushState({},"",n)})}},{key:"routeUrl",value:function(t){var e=this;if(!this.hasRoutingState)return!1;var n=!!t,r=this.RoutingState.Root;if(null==r)return!1;var o=n?t:this.router.urlPath;if(this.debug&&console.log("router> routing "+o),i.default.equal(o,r)||i.default.equal(o,r+"/")||"/"===o){var u=i.default.grep(this.RoutingState.Templates,function(t){return""===t.UrlPattern});return u.length>0&&(this.routeTo("",u[0],null,null,n),this.router.urlPath="",this.raiseRoutedEvent(),!0)}if(r+="/",i.default.startsWith(o,r)){var a=null,s=i.default.grep(this.routes,function(t){return i.default.startsWith(o+"/",t.Url+"/")});if(s.length>0)for(var c=0;c the RoutingState prop of '"+i.$vmId+"' was not initialized.");var a=this.VMRoot;u={vmRoot:a=null!=a?"/"+c.default.trim(this.RoutingState.Root)+"/"+c.default.trim(a):this.RoutingState.Root,vmArg:r}}if(e=this.router.overrideUrl(e,t),n=this.router.overrideUrl(n,t),c.default.endsWith(e,"html"))this.loadHtmlView(t,e,n,o);else{var s=e;"string"==typeof e&&f.hasOwnProperty(e)&&(s=f[e]),s instanceof HTMLElement?this.loadHtmlElementView(t,s,n,u,o):this.loadReactView(t,s,n,u,o)}}},{key:"loadReactView",value:function(t,e,n,o,a){var c=this;return new Promise(function(l,f){var d=c.vm,h=c.vm?c.vm.$vmId:"",p=function(){if("function"!=typeof e&&("object"!==(void 0===e?"undefined":r(e))||null==e.name))return console.error("["+h+"] failed to load view '"+e+"' because it's not a valid React element."),void f();c.unmountView(t);try{var n=i.default.createElement(e,o);u.default.render(n,document.querySelector(t))}catch(t){console.error(t)}"function"==typeof callbackFn&&a.call(d,n),l(n)};if(null==n||!0===dotnetify.ssr)p();else{var y=n.split(",").map(function(t){return s.default.getScript(t)});s.default.when.apply(s.default,y).done(p)}})}},{key:"unmountView",value:function(t){try{u.default.unmountComponentAtNode(document.querySelector(t))}catch(t){console.warn(t)}}}]),e}();e.default=d}).call(this,n(0))},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var n=n||t||{},r={version:"0.8.5",map:function(t){return r.routes.defined.hasOwnProperty(t)?r.routes.defined[t]:new r.core.route(t)},root:function(t){r.routes.root=t},rescue:function(t){r.routes.rescue=t},history:{initial:{},pushState:function(t,e,o){r.history.supported?r.dispatch(o)&&history.pushState(t,e,o):r.history.fallback&&(n.location.hash="#"+o)},popState:function(t){var e=!r.history.initial.popped&&location.href==r.history.initial.URL;r.history.initial.popped=!0,e||r.dispatch("/"===document.location.pathname?"":document.location.pathname)},listen:function(t){if(r.history.supported=!(!n.history||!n.history.pushState),r.history.fallback=t,r.history.supported)r.history.initial.popped="state"in n.history,r.history.initial.URL=location.href,n.onpopstate=r.history.popState;else if(r.history.fallback){for(route in r.routes.defined)"#"!=route.charAt(0)&&(r.routes.defined["#"+route]=r.routes.defined[route],r.routes.defined["#"+route].path="#"+route);r.listen()}}},match:function(t,e){var n,o,i,u,a,s,c={},l=null;for(l in r.routes.defined)if(null!==l&&void 0!==l)for(n=(l=r.routes.defined[l]).partition(),u=0;u0)for(i=0;i=8)?n.onhashchange=t:setInterval(t,50),""!==location.hash&&r.dispatch(location.hash)},core:{route:function(t){this.path=t,this.action=null,this.do_enter=[],this.do_exit=null,this.params={},r.routes.defined[t]=this}},routes:{current:null,root:null,rescue:null,previous:null,defined:{}}};r.core.route.prototype={to:function(t){return this.action=t,this},enter:function(t){return t instanceof Array?this.do_enter=this.do_enter.concat(t):this.do_enter.push(t),this},exit:function(t){return this.do_exit=t,this},partition:function(){for(var t,e,n=[],r=[],o=/\(([^}]+?)\)/g;t=o.exec(this.path);)n.push(t[1]);for(r.push(this.path.split("(")[0]),e=0;e0)for(t=0;t0?t:"/",void 0!==o.default&&o.default.map(t).to(function(){e(this.params)})}},{key:"match",value:function(t){if(void 0!==o.default){var e=o.default.match(t,!0);if(null!=e)return e.run(),!0}return!1}},{key:"overrideUrl",value:function(t){return t}},{key:"pushState",value:function(t,e,n){this.urlPath="",void 0!==o.default&&o.default.history.pushState(t,e,n)}},{key:"redirect",value:function(t,e){this.urlPath=t;for(var n=0;n redirected"))}i.location.replace(t)}},{key:"$ready",value:function(){this.$router.initRouting()}},{key:"$update",value:function(t){t&&t.RoutingState&&this.$router.initRouting()}}]),t}();e.default=u}).call(this,n(0))},function(t,e,n){"use strict";var r=u(n(1)),o=u(n(28)),i=u(n(26));function u(t){return t&&t.__esModule?t:{default:t}}r.default.react.router=new o.default(r.default.debug),r.default.react.router.$inject=function(t){var e=new i.default(t,r.default.react.router);t.$router=e,t.$handleRoute=function(t){return e.handleRoute(t)},t.$route=function(t,n){return e.route(t,n)},t.$routeTo=function(t){return e.routeToRoute(t)}},r.default.react.router.$mount=function(t,e,n,r){return i.default.prototype.loadReactView(t,e,null,n,r)},r.default.react.plugins.router=r.default.react.router},function(t,e,n){"use strict";var r=s(n(1));n(29),n(23);var o=s(n(22)),i=s(n(18)),u=s(n(17)),a=s(n(16));function s(t){return t&&t.__esModule?t:{default:t}}t.exports=Object.assign(r.default,{Scope:o.default,RouteLink:i.default,RouteTarget:u.default,useConnect:a.default})}])}); \ No newline at end of file diff --git a/DevApp/dist/dist/dotnetify-vue.js b/DevApp/dist/dist/dotnetify-vue.js index 852801ec..0d523de4 100644 --- a/DevApp/dist/dist/dotnetify-vue.js +++ b/DevApp/dist/dist/dotnetify-vue.js @@ -7,7 +7,7 @@ exports["dotnetify"] = factory(require("vue"), require("@aspnet/signalr")); else root["dotnetify"] = factory(root["Vue"], root["signalR"]); -})(window, function(__WEBPACK_EXTERNAL_MODULE__4__, __WEBPACK_EXTERNAL_MODULE__14__) { +})(window, function(__WEBPACK_EXTERNAL_MODULE__4__, __WEBPACK_EXTERNAL_MODULE__15__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; @@ -91,7 +91,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 22); +/******/ return __webpack_require__(__webpack_require__.s = 23); /******/ }) /************************************************************************/ /******/ ([ @@ -240,6 +240,25 @@ var createEventEmitter = exports.createEventEmitter = function createEventEmitte }; }; +var fetch = exports.fetch = function fetch(iMethod, iUrl, iData, iOptions) { + return new Promise(function (resolve, reject) { + var request = new window.XMLHttpRequest(); + request.open(iMethod, iUrl, true); + if (typeof iOptions == 'function') iOptions(request); + + request.onload = function () { + if (request.status >= 200 && request.status < 400) { + var response = request.responseText; + resolve(response); + } else reject(request); + }; + request.onerror = function () { + reject(request); + }; + request.send(iData); + }); +}; + exports.default = new utils(); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0))) @@ -270,7 +289,7 @@ limitations under the License. var window = window || global || {}; -var jQueryDeferred = __webpack_require__(18); +var jQueryDeferred = __webpack_require__(19); var jQueryShim = jQueryDeferred.extend(function (selector) { if (selector === window || selector.document) return { 0: selector, @@ -403,7 +422,7 @@ var jQueryShim = jQueryDeferred.extend(function (selector) { if (typeof window !== 'undefined') window.jQuery = window.jQuery || jQueryShim; if (( false ? undefined : _typeof(exports)) === 'object' && ( false ? undefined : _typeof(module)) === 'object') module.exports = jQueryShim; -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0), __webpack_require__(19)(module))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0), __webpack_require__(20)(module))) /***/ }), /* 3 */ @@ -433,7 +452,7 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument */ -var _dotnetify2 = __webpack_require__(21); +var _dotnetify2 = __webpack_require__(22); var _dotnetify3 = _interopRequireDefault(_dotnetify2); @@ -2312,6 +2331,133 @@ exports.default = dotnetifyVM; /* 13 */ /***/ (function(module, exports, __webpack_require__) { +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createWebApiHub = exports.dotNetifyHubWebApi = undefined; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* + Copyright 2019 Dicky Suryadi + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + +var _utils = __webpack_require__(1); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var dotNetifyHubWebApi = exports.dotNetifyHubWebApi = function () { + function dotNetifyHubWebApi(iBaseUrl, iOnRequest) { + _classCallCheck(this, dotNetifyHubWebApi); + + this.mode = 'webapi'; + this.debug = false; + this.isConnected = false; + this.isHubStarted = false; + this.responseEvent = (0, _utils.createEventEmitter)(); + this.reconnectedEvent = (0, _utils.createEventEmitter)(); + this.connectedEvent = (0, _utils.createEventEmitter)(); + this.connectionFailedEvent = (0, _utils.createEventEmitter)(); + this._vmArgs = {}; + + this.baseUrl = iBaseUrl || ''; + this.onRequest = iOnRequest; + } + + _createClass(dotNetifyHubWebApi, [{ + key: 'startHub', + value: function startHub() { + this.isConnected = true; + this.isHubStarted = true; + this.connectedEvent.emit(); + } + }, { + key: 'requestVM', + value: function requestVM(iVMId, iVMArgs) { + var _this = this; + + var vmArgs = iVMArgs || {}; + var vmArgQuery = vmArgs.$vmArg ? '?vmarg=' + JSON.stringify(vmArgs.$vmArg) : ''; + var headers = vmArgs.$headers || {}; + + this._vmArgs[iVMId] = vmArgs; + var url = this.baseUrl + ('/api/dotnetify/vm/' + iVMId + vmArgQuery); + + (0, _utils.fetch)('GET', url, null, function (request) { + Object.keys(headers).forEach(function (key) { + return request.setRequestHeader(key, headers[key]); + }); + if (typeof _this.onRequest == 'function') _this.onRequest(url, request); + }).then(function (response) { + _this.responseEvent.emit(iVMId, response); + }).catch(function (request) { + return console.error('[' + iVMId + '] Request failed', request); + }); + } + }, { + key: 'updateVM', + value: function updateVM(iVMId, iValue) { + var _this2 = this; + + var vmArgs = this._vmArgs[iVMId] || {}; + var vmArgQuery = vmArgs.$vmArg ? '?vmarg=' + JSON.stringify(vmArgs.$vmArg) : ''; + var headers = vmArgs.$headers || {}; + var payload = (typeof iValue === 'undefined' ? 'undefined' : _typeof(iValue)) == 'object' ? JSON.stringify(iValue) : iValue; + + var url = this.baseUrl + ('/api/dotnetify/vm/' + iVMId + vmArgQuery); + + (0, _utils.fetch)('POST', url, payload, function (request) { + request.setRequestHeader('Content-Type', 'application/json'); + Object.keys(headers).forEach(function (key) { + return request.setRequestHeader(key, headers[key]); + }); + if (typeof _this2.onRequest == 'function') _this2.onRequest(url, request, payload); + }).then(function (response) { + _this2.responseEvent.emit(iVMId, response); + }).catch(function (request) { + return console.error('[' + iVMId + '] Update failed', request); + }); + } + }, { + key: 'disposeVM', + value: function disposeVM(iVMId) { + delete this._vmArgs[iVMId]; + } + }], [{ + key: 'create', + value: function create(iBaseUrl, iOnRequest) { + return new dotNetifyHubWebApi(iBaseUrl, iOnRequest); + } + }]); + + return dotNetifyHubWebApi; +}(); + +var createWebApiHub = dotNetifyHubWebApi.create; + +exports.createWebApiHub = createWebApiHub; +exports.default = dotNetifyHubWebApi.create(); + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + "use strict"; /* WEBPACK VAR INJECTION */(function(global) { @@ -2323,7 +2469,6 @@ exports.hasLocalVM = exports.dotNetifyHubLocal = undefined; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /* - import { dotnetify } from 'dotnetify/dist/dotnetify-ko'; Copyright 2019 Dicky Suryadi Licensed under the Apache License, Version 2.0 (the "License"); @@ -2435,13 +2580,13 @@ exports.hasLocalVM = hasLocalVM; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0))) /***/ }), -/* 14 */ +/* 15 */ /***/ (function(module, exports) { -module.exports = __WEBPACK_EXTERNAL_MODULE__14__; +module.exports = __WEBPACK_EXTERNAL_MODULE__15__; /***/ }), -/* 15 */ +/* 16 */ /***/ (function(module, exports) { /** @@ -2602,10 +2747,10 @@ function extend() { /***/ }), -/* 16 */ +/* 17 */ /***/ (function(module, exports, __webpack_require__) { -var jQuery = module.exports = __webpack_require__(15), +var jQuery = module.exports = __webpack_require__(16), core_rspace = /\s+/; /** * jQuery Callbacks @@ -2814,7 +2959,7 @@ jQuery.Callbacks = function( options ) { /***/ }), -/* 17 */ +/* 18 */ /***/ (function(module, exports, __webpack_require__) { @@ -2828,7 +2973,7 @@ jQuery.Callbacks = function( options ) { * Library version. */ -var jQuery = module.exports = __webpack_require__(16), +var jQuery = module.exports = __webpack_require__(17), core_slice = Array.prototype.slice; /** @@ -2983,14 +3128,14 @@ jQuery.extend({ /***/ }), -/* 18 */ +/* 19 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = __webpack_require__(17); +module.exports = __webpack_require__(18); /***/ }), -/* 19 */ +/* 20 */ /***/ (function(module, exports) { module.exports = function(module) { @@ -3018,7 +3163,7 @@ module.exports = function(module) { /***/ }), -/* 20 */ +/* 21 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3056,7 +3201,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -var signalRNetCore = __webpack_require__(14); +var signalRNetCore = __webpack_require__(15); var $ = _jqueryShim2.default; var window = window || global || {}; @@ -3475,7 +3620,7 @@ exports.default = dotnetifyHubFactory.create(); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0))) /***/ }), -/* 21 */ +/* 22 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3503,14 +3648,18 @@ var _createClass = function () { function defineProperties(target, props) { for */ -var _dotnetifyHub = __webpack_require__(20); +var _dotnetifyHub = __webpack_require__(21); var _dotnetifyHub2 = _interopRequireDefault(_dotnetifyHub); -var _dotnetifyHubLocal = __webpack_require__(13); +var _dotnetifyHubLocal = __webpack_require__(14); var _dotnetifyHubLocal2 = _interopRequireDefault(_dotnetifyHubLocal); +var _dotnetifyHubWebapi = __webpack_require__(13); + +var _dotnetifyHubWebapi2 = _interopRequireDefault(_dotnetifyHubWebapi); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } @@ -3566,7 +3715,7 @@ var dotnetifyFactory = exports.dotnetifyFactory = function () { // Generic connect function for non-React app. connect: function connect(iVMId, iOptions) { - dotnetify.react.connect(iVMId, null, iOptions); + return dotnetify.react.connect(iVMId, {}, iOptions); }, @@ -3576,6 +3725,12 @@ var dotnetifyFactory = exports.dotnetifyFactory = function () { }, + // Creates a Web API hub client. + createWebApiHub: function createWebApiHub(baseUrl, onRequestHandler) { + return (0, _dotnetifyHubWebapi.createWebApiHub)(baseUrl, onRequestHandler); + }, + + // Configures hub connection to SignalR hub server. initHub: function initHub(hub, hubPath, hubServerUrl, hubLib) { var _this = this; @@ -3599,10 +3754,11 @@ var dotnetifyFactory = exports.dotnetifyFactory = function () { // Used by a view to select a hub, and provides the opportunity to override any connect info. selectHub: function selectHub(vmConnectArgs) { - vmConnectArgs = vmConnectArgs || { options: {} }; + vmConnectArgs = vmConnectArgs || {}; + vmConnectArgs.options = vmConnectArgs.options || {}; var override = typeof this.connectHandler == 'function' && this.connectHandler(vmConnectArgs) || {}; if (!override.hub) { - override.hub = (0, _dotnetifyHubLocal.hasLocalVM)(vmConnectArgs.vmId) ? _dotnetifyHubLocal2.default : this.initHub(); + override.hub = (0, _dotnetifyHubLocal.hasLocalVM)(vmConnectArgs.vmId) ? _dotnetifyHubLocal2.default : vmConnectArgs.options.webApi ? _dotnetifyHubWebapi2.default : this.initHub(); override.hub.debug = this.debug; } return Object.assign(vmConnectArgs, override); @@ -3666,7 +3822,7 @@ var dotnetifyFactory = exports.dotnetifyFactory = function () { exports.default = dotnetifyFactory.create(); /***/ }), -/* 22 */ +/* 23 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; diff --git a/DevApp/dist/dist/dotnetify-vue.js.map b/DevApp/dist/dist/dotnetify-vue.js.map index f5ab902e..f4fe8fc4 100644 --- a/DevApp/dist/dist/dotnetify-vue.js.map +++ b/DevApp/dist/dist/dotnetify-vue.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://dotnetify/webpack/universalModuleDefinition","webpack://dotnetify/webpack/bootstrap","webpack://dotnetify/(webpack)/buildin/global.js","webpack://dotnetify/./src/dotnetify/libs/utils.js","webpack://dotnetify/./src/dotnetify/libs/jquery-shim.js","webpack://dotnetify/./src/dotnetify/vue/dotnetify-vue.js","webpack://dotnetify/external {\"commonjs\":\"vue\",\"commonjs2\":\"vue\",\"amd\":\"vue\",\"root\":\"Vue\"}","webpack://dotnetify/./src/dotnetify/vue/directives.js","webpack://dotnetify/./src/dotnetify/vue/Scope.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-vm-router.js","webpack://dotnetify/./src/dotnetify/vue/dotnetify-vue.vm-router.js","webpack://dotnetify/./src/dotnetify/libs/path.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-router.js","webpack://dotnetify/./src/dotnetify/vue/dotnetify-vue.router.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-vm.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-hub-local.js","webpack://dotnetify/external {\"commonjs\":\"@aspnet/signalr\",\"commonjs2\":\"@aspnet/signalr\",\"amd\":\"@aspnet/signalr\",\"root\":\"signalR\"}","webpack://dotnetify/./node_modules/jquery-deferred/lib/jquery-core.js","webpack://dotnetify/./node_modules/jquery-deferred/lib/jquery-callbacks.js","webpack://dotnetify/./node_modules/jquery-deferred/lib/jquery-deferred.js","webpack://dotnetify/./node_modules/jquery-deferred/index.js","webpack://dotnetify/(webpack)/buildin/module.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-hub.js","webpack://dotnetify/./src/dotnetify/core/dotnetify.js","webpack://dotnetify/./src/dotnetify/vue/index.js"],"names":["window","global","utils","iStr","indexOf","length","substr","iStr1","iStr2","toLowerCase","iValue","slice","iEvent","Event","dispatchEvent","event","document","createEvent","initEvent","iArray","iFilter","Array","isArray","filter","createEventEmitter","subscribers","emit","args","handled","forEach","subscriber","subscribe","includes","push","x","jQueryDeferred","require","jQueryShim","extend","selector","on","iHandler","addEventListener","bind","unbind","removeEventListener","events","handlers","idx","splice","triggerHandler","iArgs","type","arg","handler","apply","load","iUrl","request","XMLHttpRequest","open","onload","status","response","responseText","querySelector","innerHTML","call","send","abort","reason","support","cors","trim","inArray","iItem","makeArray","merge","iArray1","iArray2","prototype","isEmptyObject","iObj","Object","keys","ajax","iOptions","onreadystatechange","readyState","_hasError","success","JSON","parse","error","url","setRequestHeader","contentType","data","getScript","iSuccess","done","promise","Deferred","head","getElementsByTagName","script","createElement","src","removeChild","resolve","appendChild","jQuery","exports","module","dotnetify","_dotnetify","vue","version","viewModels","plugins","controller","_hubs","init","iHub","self","hubInitialized","some","hub","start","isHubStarted","vmId","$hub","$requested","startHub","responseEvent","iVMId","iVMData","_responseVM","connectedEvent","$request","reconnectedEvent","connect","iVue","arguments","Error","hasOwnProperty","console","$destroy","setTimeout","component","props","$props","state","vm","$useState","$data","setState","value","key","$set","connectInfo","selectHub","options","dotnetifyVM","useState","watch","_addWatchers","iComponentOrName","obj","created","destroyed","name","getViewModels","map","iWatchlist","iVM","callback","newValue","$serverUpdate","$dispatch","prop","$watch","checkServerSideException","$exceptionHandler","$update","addVMAccessor","Vue","directive","el","binding","vnode","match","exec","expression","propName","methodName","context","route","href","$route","e","preventDefault","$handleRoute","componentUpdated","String","tag","inject","scoped","default","provide","_this","getScope","render","$slots","methods","scope","dotnetifyVMRouter","router","routes","debug","$dotnetify","iPath","State","RoutingState","assign","Active","iArg","path","currentTarget","pathname","pushState","hasRoutingState","Root","_absRoot","absRoot","VMRoot","root","$vmId","templates","Templates","$init","initRoot","urlPattern","template","UrlPattern","Id","mapUrl","toUrl","log","mapTo","urlPath","param","iParams","replace","routeTo","activeUrl","routeUrl","raiseRoutedEvent","iRoute","equal","Path","iTargetSelector","iViewUrl","iJsModuleUrl","iCallbackFn","unmountView","$","getScripts","split","i","when","callbackFn","iHtmlElement","iVmArg","mountViewFunc","target","firstChild","iTarget","iJSModuleUrl","Target","ViewUrl","JSModuleUrl","iTemplate","force","TemplateId","RedirectRoot","redirectRoot","charAt","redirectRootPath","urlRedirect","absRootPath","Url","$template","pathToRoute","iDisableEvent","isRedirect","vmOther","vmArg","$router","VMArg","onRouteEnter","getElementById","redirect","loadView","dispatchActiveRoutingState","onRouteExit","redirectUrlPath","grep","startsWith","routeElem","elem","dotnetifyVueVMRouter","Props","iDotNetifyRouter","componentProps","vmRoot","overrideUrl","endsWith","loadHtmlView","HTMLElement","loadHtmlElementView","loadVueView","iComponent","iProps","Promise","reject","createViewFunc","vueClass","vueComponentType","vueComponent","propsData","$mount","mountedComponents","unmount","defined","core","rescue","fn","history","initial","title","supported","dispatch","fallback","location","hash","popState","initialPop","popped","URL","listen","onpopstate","parameterize","params","possible_routes","j","compare","result","undefined","partition","search","join","passed_route","previous_route","matched_route","current","previous","do_exit","run","documentMode","onhashchange","setInterval","action","do_enter","to","enter","fns","concat","exit","parts","re","text","halt_execution","dotnetifyRouter","iFn","iUrlPath","matched","iState","iTitle","initRouting","vmData","$inject","handleRoute","$routeTo","routeToRoute","iDotNetify","$component","$options","$vmArg","$headers","$loaded","$itemKey","getState","$getPlugins","plugin","isConnected","disposeVM","ex","handleConnectionStateChanged","updateVM","debugFn","listName","item","$updateList","id","iVMUpdate","$addList","$removeList","itemKey","$setItemKey","requestVM","$preProcess","$onLoad","$onUpdate","$ready","iItemKey","iListName","iNewItem","items","normalize","hasLocalVM","onConnect","dotNetifyHubLocal","mode","connectionFailedEvent","iVMArgs","$pushUpdate","update","stringify","onDispatch","onDestroy","signalRNetCore","dotnetifyHubFactory","dotnetifyHub","reconnectDelay","reconnectRetry","_startInfo","_init","server","request_VM","update_VM","dispose_VM","hubOptions","doneHandler","failHandler","forceRestart","_doneHandler","_failHandler","failHander","fail","err","iHubPath","iServerUrl","signalR","HubConnection","defineProperty","get","_connection","connection","connectionState","hubPath","_reconnectCount","_startDoneHandler","_startFailHandler","_disconnectedHandler","_stateChangedHandler","iNewState","_onDisconnected","_changeState","stateText","_startConnection","iHubOptions","iTransportArray","transport","shift","HubConnectionBuilder","withUrl","build","client","response_VM","onclose","then","catch","transportOptions","webSockets","serverSentEvents","longPolling","disconnected","stateChanged","reconnect","iStartHubFunc","delay","invoke","makeProxyCallback","registerHubProxies","instance","shouldSubscribe","memberKey","memberValue","subscriptionMethod","hubName","off","isFunction","hubConnection","createHubProxies","proxies","starting","_registerSubscribedHubs","createHubProxy","useDefaultPath","set","val","dotNetifyHub","connected","deferred","source","message","warn","newState","create","dotnetifyFactory","offline","isOffline","offlineTimeout","offlineCacheFn","_vmAccessors","connectionStateHandler","connectHandler","hubServerUrl","react","createHub","hubLib","initHub","vmConnectArgs","override","localHub","vmAccessor","iExceptionHandler","exception","ExceptionType","Message","reduce","prev","iException","Scope"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;AClFA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;;AAE5C;;;;;;;;;;;;;;;;;;;;ACnBA;;;;;;;;;;;;;;;AAeA,IAAMA,SAASA,UAAUC,MAAV,IAAoB,EAAnC;;IAEMC,K;;;;;;;;AACJ;yBACKC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6G,KAAxB,EAA+BiB,KAA/B,CAAN;AAAA,WAAX;AACD;AACF;AACF;;;8BAESjB,K,EAAO;AACf,UAAML,OAAO2S,UAAUtS,KAAV,CAAb;AACA,UAAMkB,KAAKzJ,OAAOkI,IAAP,CAAX;;AAEA,UAAI,QAAOuB,EAAP,yCAAOA,EAAP,OAAc,QAAd,IAA0B,OAAOA,GAAG+R,SAAV,IAAuB,UAArD,EAAiE;AAC/D/R,WAAG+R,SAAH,CAAajT,KAAb;AACD;AACF;;;;;;kBAGY,IAAIyS,iBAAJ,E;QACNF,U,GAAAA,U;;;;;;;ACpFT,iD;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;AAGD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,UAAU,YAAY;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,UAAU,YAAY;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,QAAQ,YAAY;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;ACxJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,oCAAoC;AAC9C;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;AC3MA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA,MAAM;AACN,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,8CAA8C;AAC9C,KAAK;AACL;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,IAAI;;AAEJ;;AAEA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA,UAAU,YAAY;AACtB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;;;;;;;ACjKD,yC;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;;;;;;;;;;;;;;qjBCrBA;;;;;;;;;;;;;;;;;AAeA;;AACA;;;;;;;;AACA,IAAMW,iBAAiB,mBAAArZ,CAAQ,EAAR,CAAvB;AACA,IAAIsO,IAAIrO,oBAAR;;AAEA,IAAMrC,SAASA,UAAUC,MAAV,IAAoB,EAAnC;;IAEayb,mB,WAAAA,mB;;;;;;;6BACK;AACd,UAAIC,eAAe;AACjBtU,iBAAS,OADQ;AAEjBjE,cAAM,IAFW;;AAIjBwY,wBAAgB,CAAE,CAAF,EAAK,CAAL,EAAQ,EAAR,CAJC;AAKjBC,wBAAgB,IALC;;A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IAA/B,GAAsC,IAAtC,GAA6CyX,UAAUtB,OAArE;AACA,oBAAMsB,SAAN;AACD;AACF;AACF,SAvGe;;;AAyGhB;AACAxX,qBA1GgB,2BA0GA;AACd,iBAAO,KAAK2W,YAAL,CACJgB,MADI,CACG,UAACC,IAAD,EAAO3L,OAAP;AAAA,gDAAwB2L,IAAxB,sBAAiC3L,SAAjC;AAAA,WADH,EACiD,EADjD,EAEJtV,MAFI,CAEG,UAACkf,GAAD,EAAMzd,GAAN,EAAW4E,IAAX;AAAA,mBAAoBA,KAAKxH,OAAL,CAAaqgB,GAAb,MAAsBzd,GAA1C;AAAA,WAFH,CAAP,CADc,CAG4C;AAC3D,SA9Ge;AAgHhBwW,oCAhHgB,wCAgHarB,MAhHb,EAgHqBsK,UAhHrB,EAgHiC9a,IAhHjC,EAgHuC;AACrD,cAAI,KAAKgG,KAAT,EAAgBzE,QAAQsG,GAAR,CAAY,eAAeiT,aAAaA,WAAW3B,OAAxB,GAAkC3I,MAAjD,CAAZ;AAChB,cAAI,OAAO,KAAKqJ,sBAAZ,KAAuC,UAA3C,EAAuD,KAAKA,sBAAL,CAA4BrJ,MAA5B,EAAoCsK,UAApC,EAAgD9a,IAAhD,EAAvD,KACK,IAAI8a,UAAJ,EAAgBvZ,QAAQrD,KAAR,CAAc4c,UAAd;AACtB;AApHe,OAAlB;;AAuHA,aAAOvb,SAAP;AACD;;;;;;kBAGYga,iBAAiBD,MAAjB,E;;;;;;;;;AC/If;;;;AACA;;AACA;;;;AACA;;;;AAEA/Z,uBAAUE,GAAV,CAAcsb,KAAd,GAAsBA,eAAtB;AACAzb,OAAOD,OAAP,GAAiB7B,OAAO6I,MAAP,CAAc9G,sBAAd,EAAyB,EAAEwb,sBAAF,EAAzB,CAAjB,C","file":"dotnetify-vue.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"vue\"), require(\"@aspnet/signalr\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"vue\", \"@aspnet/signalr\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"dotnetify\"] = factory(require(\"vue\"), require(\"@aspnet/signalr\"));\n\telse\n\t\troot[\"dotnetify\"] = factory(root[\"Vue\"], root[\"signalR\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__4__, __WEBPACK_EXTERNAL_MODULE__14__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 22);\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","/* \r\nCopyright 2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nconst window = window || global || {};\r\n\r\nclass utils {\r\n // Trim slashes from start and end of string.\r\n trim(iStr) {\r\n if (typeof iStr !== 'string') return '';\r\n\r\n while (iStr.indexOf('/', iStr.length - 1) >= 0) iStr = iStr.substr(0, iStr.length - 1);\r\n while (iStr.indexOf('/') == 0) iStr = iStr.substr(1, iStr.length - 1);\r\n return iStr;\r\n }\r\n\r\n // Match two strings case-insensitive.\r\n equal(iStr1, iStr2) {\r\n return iStr1 != null && iStr2 != null && iStr1.toLowerCase() == iStr2.toLowerCase();\r\n }\r\n\r\n // Whether the string starts or ends with a value.\r\n startsWith(iStr, iValue) {\r\n return iStr.toLowerCase().slice(0, iValue.length) == iValue.toLowerCase();\r\n }\r\n\r\n endsWith(iStr, iValue) {\r\n return iValue == '' || iStr.toLowerCase().slice(-iValue.length) == iValue.toLowerCase();\r\n }\r\n\r\n // Dispatch event with IE polyfill.\r\n dispatchEvent(iEvent) {\r\n if (typeof Event === 'function') window.dispatchEvent(new Event(iEvent));\r\n else {\r\n var event = document.createEvent('CustomEvent');\r\n event.initEvent(iEvent, true, true);\r\n window.dispatchEvent(event);\r\n }\r\n }\r\n\r\n grep(iArray, iFilter) {\r\n return Array.isArray(iArray) ? iArray.filter(iFilter) : [];\r\n }\r\n}\r\n\r\nexport const createEventEmitter = _ => {\r\n let subscribers = [];\r\n return {\r\n emit(...args) {\r\n let handled = false;\r\n subscribers.forEach(subscriber => {\r\n handled = subscriber(...args) || handled;\r\n });\r\n return handled;\r\n },\r\n\r\n subscribe(subscriber) {\r\n !subscribers.includes(subscriber) && subscribers.push(subscriber);\r\n return () => (subscribers = subscribers.filter(x => x !== subscriber));\r\n }\r\n };\r\n};\r\n\r\nexport default new utils();\r\n","/* \r\nCopyright 2017 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\n\r\nconst window = window || global || {};\r\n\r\nconst jQueryDeferred = require('jquery-deferred');\r\nconst jQueryShim = jQueryDeferred.extend(\r\n function(selector) {\r\n if (selector === window || selector.document)\r\n return {\r\n 0: selector,\r\n on: function(iEvent, iHandler) {\r\n window.addEventListener(iEvent, iHandler);\r\n },\r\n bind: function(iEvent, iHandler) {\r\n window.addEventListener(iEvent, iHandler, false);\r\n },\r\n unbind: function(iEvent, iHandler) {\r\n window.removeEventListener(iEvent, iHandler, false);\r\n }\r\n };\r\n\r\n if (typeof selector !== 'string') selector.events = selector.events || {};\r\n\r\n return {\r\n 0: selector,\r\n\r\n bind: function(iEvent, iHandler) {\r\n var event = selector.events[iEvent] || [];\r\n event.push(iHandler);\r\n selector.events[iEvent] = event;\r\n },\r\n\r\n unbind: function(iEvent, iHandler) {\r\n var handlers = selector.events[iEvent] || [];\r\n if (iHandler) {\r\n var idx = handlers.indexOf(iHandler);\r\n if (idx !== -1) handlers.splice(idx, 1);\r\n }\r\n else handlers = [];\r\n selector.events[iEvent] = handlers;\r\n },\r\n\r\n triggerHandler: function(iEvent, iArgs) {\r\n var handlers = selector.events[iEvent] || [];\r\n var args = [ { type: iEvent } ];\r\n if (Array.isArray(iArgs))\r\n iArgs.forEach(function(arg) {\r\n args.push(arg);\r\n });\r\n else if (iArgs) args.push(iArgs);\r\n handlers.forEach(function(handler) {\r\n handler.apply(this, args);\r\n });\r\n },\r\n\r\n load: function(iUrl, iArgs, iHandler) {\r\n var request = new window.XMLHttpRequest();\r\n request.open('GET', iUrl, true);\r\n request.onload = function() {\r\n if (request.status >= 200 && request.status < 400) {\r\n var response = request.responseText;\r\n document.querySelector(selector).innerHTML = response;\r\n iHandler.call(document.querySelector(selector));\r\n }\r\n };\r\n request.send();\r\n return {\r\n abort: function(reason) {\r\n return request.abort(reason);\r\n }\r\n };\r\n }\r\n };\r\n },\r\n jQueryDeferred,\r\n {\r\n support: { cors: true },\r\n\r\n trim: function(iStr) {\r\n return typeof iStr === 'string' ? iStr.trim() : iStr;\r\n },\r\n\r\n inArray: function(iArray, iItem) {\r\n return iArray.indexOf(iItem) !== -1;\r\n },\r\n\r\n makeArray: function makeArray(iArray) {\r\n return [].slice.call(iArray, 0);\r\n },\r\n\r\n merge: function(iArray1, iArray2) {\r\n Array.prototype.push.apply(iArray1, iArray2);\r\n return iArray1;\r\n },\r\n\r\n isEmptyObject: function(iObj) {\r\n return !iObj || Object.keys(iObj).length === 0;\r\n },\r\n\r\n ajax: function(iOptions) {\r\n var request = new window.XMLHttpRequest();\r\n request.onreadystatechange = function() {\r\n if (request.readyState !== 4) return;\r\n if (request.status === 200 && !request._hasError) {\r\n try {\r\n iOptions.success && iOptions.success(JSON.parse(request.responseText));\r\n } catch (error) {\r\n iOptions.success && iOptions.success(request.responseText);\r\n }\r\n }\r\n else iOptions.error && iOptions.error(request);\r\n };\r\n request.open(iOptions.type, iOptions.url);\r\n request.setRequestHeader('content-type', iOptions.contentType);\r\n request.send(iOptions.data.data && 'data=' + iOptions.data.data);\r\n return {\r\n abort: function(reason) {\r\n return request.abort(reason);\r\n }\r\n };\r\n },\r\n\r\n getScript: function(iUrl, iSuccess) {\r\n var done = false;\r\n var promise = jQueryDeferred.Deferred();\r\n var head = document.getElementsByTagName('head')[0];\r\n var script = document.createElement('script');\r\n script.src = iUrl;\r\n script.onload = script.onreadystatechange = function() {\r\n if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) {\r\n done = true;\r\n script.onload = script.onreadystatechange = null;\r\n head.removeChild(script);\r\n if (typeof iSuccess === 'function') iSuccess();\r\n promise.resolve();\r\n }\r\n };\r\n head.appendChild(script);\r\n return promise;\r\n }\r\n }\r\n);\r\n\r\nif (typeof window !== 'undefined') window.jQuery = window.jQuery || jQueryShim;\r\n\r\nif (typeof exports === 'object' && typeof module === 'object') module.exports = jQueryShim;\r\n","/* \r\nCopyright 2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport _dotnetify from '../core/dotnetify';\r\nimport dotnetifyVM from '../core/dotnetify-vm';\r\n\r\nconst window = window || global || {};\r\nlet dotnetify = window.dotnetify || _dotnetify;\r\n\r\ndotnetify.vue = {\r\n version: '2.0.0',\r\n viewModels: {},\r\n plugins: {},\r\n controller: dotnetify,\r\n\r\n // Internal variables.\r\n _hubs: [],\r\n\r\n // Initializes connection to SignalR server hub.\r\n init: function(iHub) {\r\n const self = dotnetify.vue;\r\n const hubInitialized = self._hubs.some(hub => hub === iHub);\r\n\r\n const start = function() {\r\n if (!iHub.isHubStarted)\r\n Object.keys(self.viewModels)\r\n .filter(vmId => self.viewModels[vmId].$hub === iHub)\r\n .forEach(vmId => (self.viewModels[vmId].$requested = false));\r\n\r\n dotnetify.startHub(iHub);\r\n };\r\n\r\n if (!hubInitialized) {\r\n iHub.responseEvent.subscribe((iVMId, iVMData) => self._responseVM(iVMId, iVMData));\r\n iHub.connectedEvent.subscribe(() =>\r\n Object.keys(self.viewModels)\r\n .filter(vmId => self.viewModels[vmId].$hub === iHub && !self.viewModels[vmId].$requested)\r\n .forEach(vmId => self.viewModels[vmId].$request())\r\n );\r\n iHub.reconnectedEvent.subscribe(start);\r\n self._hubs.push(iHub);\r\n }\r\n\r\n start();\r\n },\r\n\r\n // Connects to a server view model.\r\n connect: function(iVMId, iVue, iOptions) {\r\n if (arguments.length < 2) throw new Error('[dotNetify] Missing arguments. Usage: connect(vmId, component) ');\r\n\r\n const self = dotnetify.vue;\r\n if (self.viewModels.hasOwnProperty(iVMId)) {\r\n console.error(\r\n `Component is attempting to connect to an already active '${iVMId}'. ` +\r\n ` If it's from a dismounted component, you must call vm.$destroy in destroyed().`\r\n );\r\n self.viewModels[iVMId].$destroy();\r\n return setTimeout(() => self.connect(iVMId, iVue, iOptions));\r\n }\r\n\r\n const component = {\r\n get props() {\r\n return iVue.$props;\r\n },\r\n get state() {\r\n const vm = self.viewModels[iVMId];\r\n return vm && vm.$useState ? { ...iVue.$data, ...iVue.state } : iVue.$data;\r\n },\r\n setState(state) {\r\n Object.keys(state).forEach(key => {\r\n const value = state[key];\r\n\r\n // If 'useState' option is enabled, store server state in the Vue instance's 'state' property.\r\n const vm = self.viewModels[iVMId];\r\n if (vm && vm.$useState) {\r\n if (iVue.state.hasOwnProperty(key)) iVue.state[key] = value;\r\n else if (value) iVue.$set(iVue.state, key, value);\r\n }\r\n else {\r\n if (iVue.hasOwnProperty(key)) iVue[key] = value;\r\n else if (value) console.error(`'${key}' is received, but the Vue instance doesn't declare the property.`);\r\n }\r\n });\r\n }\r\n };\r\n\r\n const connectInfo = dotnetify.selectHub({ vmId: iVMId, options: iOptions, hub: null });\r\n self.viewModels[iVMId] = new dotnetifyVM(connectInfo.vmId, component, connectInfo.options, self, connectInfo.hub);\r\n if (connectInfo.hub) self.init(connectInfo.hub);\r\n\r\n if (iOptions) {\r\n const vm = self.viewModels[iVMId];\r\n\r\n // If 'useState' is true, server state will be placed in the Vue component's 'state' data property.\r\n // Otherwise, they will be placed in the root data property.\r\n if (iOptions.useState) {\r\n if (iVue.hasOwnProperty('state')) vm.$useState = true;\r\n else console.error(`Option 'useState' requires the 'state' data property on the Vue instance.`);\r\n }\r\n\r\n // 'watch' array specifies properties to dispatch to server when the values change.\r\n if (Array.isArray(iOptions.watch)) self._addWatchers(iOptions.watch, vm, iVue);\r\n }\r\n\r\n return self.viewModels[iVMId];\r\n },\r\n\r\n // Creates a Vue component with pre-configured connection to a server view model.\r\n component: function(iComponentOrName, iVMId, iOptions) {\r\n const obj = {\r\n created() {\r\n this.vm = dotnetify.vue.connect(iVMId, this, { ...iOptions, useState: true });\r\n },\r\n destroyed() {\r\n this.vm.$destroy();\r\n },\r\n data() {\r\n return { state: {} };\r\n }\r\n };\r\n\r\n if (typeof iComponentOrName == 'string') return { name: iComponentOrName, ...obj };\r\n else return { ...obj, ...iComponentOrName };\r\n },\r\n\r\n // Gets all view models.\r\n getViewModels: function() {\r\n const self = dotnetify.vue;\r\n return Object.keys(self.viewModels).map(vmId => self.viewModels[vmId]);\r\n },\r\n\r\n _addWatchers(iWatchlist, iVM, iVue) {\r\n const callback = prop =>\r\n function(newValue) {\r\n iVM.$serverUpdate !== false && iVM.$dispatch({ [prop]: newValue });\r\n }.bind(iVM);\r\n\r\n iWatchlist.forEach(prop => iVue.$watch(iVM.$useState ? `state.${prop}` : prop, callback(prop)));\r\n },\r\n\r\n _responseVM: function(iVMId, iVMData) {\r\n const self = dotnetify.vue;\r\n\r\n if (self.viewModels.hasOwnProperty(iVMId)) {\r\n const vm = self.viewModels[iVMId];\r\n dotnetify.checkServerSideException(iVMId, iVMData, vm.$exceptionHandler);\r\n\r\n // Disable server update while updating Vue so the change event won't cause rebound.\r\n vm.$serverUpdate = false;\r\n vm.$update(iVMData);\r\n setTimeout(() => (vm.$serverUpdate = true));\r\n return true;\r\n }\r\n return false;\r\n }\r\n};\r\n\r\ndotnetify.addVMAccessor(dotnetify.vue.getViewModels);\r\n\r\nexport default dotnetify;\r\n","module.exports = __WEBPACK_EXTERNAL_MODULE__4__;","/* \r\nCopyright 2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport Vue from 'vue';\r\n\r\n// Call a method when a property value changes.\r\nVue.directive('vmOn', {\r\n bind: function(el, binding, vnode) {\r\n // Parse the value, which should be in object literal { property: fnName }.\r\n const match = /{(.*):(.*)}/.exec(binding.expression);\r\n if (match != null) {\r\n const propName = match[1].trim();\r\n const methodName = match[2].trim();\r\n const vue = vnode.context;\r\n\r\n if (!vue.hasOwnProperty(propName)) throw new Error(`v-vmOn property '${propName}' is not defined`);\r\n\r\n if (!vue.hasOwnProperty(methodName) && typeof vue[methodName] == 'function')\r\n throw new Error(`v-vmOn method '${propName}' is not defined or not a function`);\r\n\r\n vue.$watch(propName, () => vue[methodName](el));\r\n }\r\n }\r\n});\r\n\r\n// Route link directive for anchor tags.\r\nVue.directive('vmRoute', {\r\n bind: function(el, binding, vnode) {\r\n const vue = vnode.context;\r\n const route = binding.value;\r\n el.href = route && vue.vm ? vue.vm.$route(route) : '';\r\n el.addEventListener('click', function(e) {\r\n e.preventDefault();\r\n vue.vm.$handleRoute(e);\r\n });\r\n },\r\n componentUpdated: function(el, binding, vnode) {\r\n const vue = vnode.context;\r\n const route = binding.value;\r\n if (route && vue.vm) el.href = vue.vm.$route(route);\r\n }\r\n});\r\n","/* \r\nCopyright 2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport dotnetify from './dotnetify-vue';\r\n\r\nexport default {\r\n name: 'Scope',\r\n props: {\r\n vm: String,\r\n tag: String\r\n },\r\n inject: { scoped: { name: 'scoped', default: null } },\r\n provide: function() {\r\n const _this = this;\r\n return {\r\n scoped: vmId => _this.getScope(vmId),\r\n connect: (vmId, component, options) => {\r\n vmId = _this.getScope(vmId);\r\n return dotnetify.vue.connect(vmId, component, options);\r\n }\r\n };\r\n },\r\n render: function(createElement) {\r\n return createElement(this.tag || 'div', null, this.$slots.default);\r\n },\r\n methods: {\r\n getScope: function(vmId) {\r\n let scope = this.scoped ? this.scoped(this.vm) : this.vm;\r\n return scope ? scope + '.' + vmId : vmId;\r\n }\r\n }\r\n};\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport utils from '../libs/utils';\r\n\r\nexport default class dotnetifyVMRouter {\r\n routes = [];\r\n\r\n get RoutingState() {\r\n throw new Error('Not implemented');\r\n }\r\n get VMRoot() {\r\n throw new Error('Not implemented');\r\n }\r\n get VMArg() {\r\n throw new Error('Not implemented');\r\n }\r\n\r\n constructor(vm, router) {\r\n this.vm = vm;\r\n this.router = router;\r\n this.debug = vm.$dotnetify.controller.debug;\r\n }\r\n\r\n // Dispatch the active routing state to the server.\r\n dispatchActiveRoutingState(iPath) {\r\n this.vm.$dispatch({ 'RoutingState.Active': iPath });\r\n let { RoutingState } = this.vm.State();\r\n RoutingState = Object.assign(RoutingState || {}, { Active: iPath });\r\n this.vm.State({ RoutingState });\r\n }\r\n\r\n // Handles click event from anchor tags. Argument can be event object or path string.\r\n handleRoute(iArg) {\r\n let path = null;\r\n if (typeof iArg === 'object') {\r\n iArg.preventDefault();\r\n path = iArg.currentTarget.pathname;\r\n }\r\n else if (typeof iArg === 'string') path = iArg;\r\n\r\n if (path == null || path == '') throw new Error('$handleRoute requires path argument or event with pathname.');\r\n setTimeout(() => this.router.pushState({}, '', path));\r\n }\r\n\r\n // Build the absolute root path from the \"vmRoot\" property on React component.\r\n initRoot() {\r\n if (!this.hasRoutingState || this.RoutingState === null || this.RoutingState.Root === null) return;\r\n\r\n if (this._absRoot != this.RoutingState.Root) {\r\n var absRoot = utils.trim(this.VMRoot);\r\n if (absRoot != '') absRoot = '/' + absRoot;\r\n var root = utils.trim(this.RoutingState.Root);\r\n this._absRoot = root != '' ? absRoot + '/' + root : absRoot;\r\n this.RoutingState.Root = this._absRoot;\r\n }\r\n }\r\n\r\n // Initialize routing templates if the view model implements IRoutable.\r\n initRouting() {\r\n const vm = this.vm;\r\n if (!this.hasRoutingState) return;\r\n\r\n if (this.RoutingState === null) {\r\n console.error(\"router> the RoutingState prop of '\" + vm.$vmId + \"' was not initialized.\");\r\n return;\r\n }\r\n\r\n var templates = this.RoutingState.Templates;\r\n if (templates == null || templates.length == 0) return;\r\n\r\n // Initialize the router.\r\n if (!this.router.$init) {\r\n this.router.init();\r\n this.router.$init = true;\r\n }\r\n\r\n // Build the absolute root path.\r\n this.initRoot();\r\n\r\n templates.forEach(template => {\r\n // If url pattern isn't given, consider Id as the pattern.\r\n var urlPattern = template.UrlPattern != null ? template.UrlPattern : template.Id;\r\n urlPattern = urlPattern != '' ? urlPattern : '/';\r\n var mapUrl = this.toUrl(urlPattern);\r\n\r\n if (this.debug) console.log('router> map ' + mapUrl + ' to template id=' + template.Id);\r\n\r\n this.router.mapTo(mapUrl, iParams => {\r\n this.router.urlPath = '';\r\n\r\n // Construct the path from the template pattern and the params passed by PathJS.\r\n var path = urlPattern;\r\n for (var param in iParams) path = path.replace(':' + param, iParams[param]);\r\n path = path.replace(/\\(\\/:([^)]+)\\)/g, '').replace(/\\(|\\)/g, '');\r\n\r\n this.routeTo(path, template);\r\n });\r\n });\r\n\r\n // Route initial URL.\r\n var activeUrl = this.toUrl(this.RoutingState.Active);\r\n if (this.router.urlPath == '') this.router.urlPath = activeUrl;\r\n if (!this.routeUrl())\r\n // If routing ends incomplete, raise routed event anyway.\r\n this.raiseRoutedEvent(true);\r\n }\r\n\r\n // Whether a route is active.\r\n isActive(iRoute) {\r\n if (iRoute != null && iRoute.hasOwnProperty('Path')) {\r\n return utils.equal(iRoute.Path, this.RoutingState.Active);\r\n }\r\n return false;\r\n }\r\n\r\n // Loads an HTML view.\r\n loadHtmlView(iTargetSelector, iViewUrl, iJsModuleUrl, iCallbackFn) {\r\n const vm = this.vm;\r\n this.unmountView(iTargetSelector);\r\n\r\n // Load the HTML view.\r\n $(iTargetSelector).load(iViewUrl, null, function() {\r\n if (iJsModuleUrl != null) {\r\n const getScripts = iJsModuleUrl.split(',').map(i => $.getScript(i));\r\n $.when.apply($, getScripts).done(() => typeof callbackFn === 'function' && iCallbackFn.call(vm));\r\n }\r\n else if (typeof callbackFn === 'function') iCallbackFn.call(vm);\r\n });\r\n }\r\n\r\n loadHtmlElementView(iTargetSelector, iHtmlElement, iJsModuleUrl, iVmArg, iCallbackFn) {\r\n const vm = this.vm;\r\n const mountViewFunc = () => {\r\n this.unmountView(iTargetSelector);\r\n\r\n const target = document.querySelector(iTargetSelector);\r\n while (target.firstChild) target.removeChild(target.firstChild);\r\n target.appendChild(iHtmlElement);\r\n\r\n if (typeof callbackFn === 'function') iCallbackFn.call(vm);\r\n };\r\n\r\n if (iJsModuleUrl == null) mountViewFunc();\r\n else {\r\n // Load all javascripts first. Multiple files can be specified with comma delimiter.\r\n const getScripts = iJsModuleUrl.split(',').map(i => $.getScript(i));\r\n $.when.apply($, getScripts).done(mountViewFunc);\r\n }\r\n }\r\n\r\n // Loads a view into a target element.\r\n loadView(iTargetSelector, iViewUrl, iJsModuleUrl, iVmArg, iCallbackFn) {\r\n throw new Error('Not implemented');\r\n }\r\n\r\n // Routes to a path.\r\n manualRouteTo(iPath, iTarget, iViewUrl, iJSModuleUrl) {\r\n const vm = this.vm;\r\n var template = { Id: 'manual', Target: iTarget, ViewUrl: iViewUrl, JSModuleUrl: iJSModuleUrl };\r\n this.routeTo(iPath, template, true);\r\n }\r\n\r\n // Handles route enter event.\r\n onRouteEnter(iPath, iTemplate) {\r\n return true;\r\n }\r\n\r\n // Raise event indicating the routing process has ended.\r\n raiseRoutedEvent(force) {\r\n const vm = this.vm;\r\n if (this.router.urlPath == '' || force == true) {\r\n if (this.debug) console.log('router> routed');\r\n utils.dispatchEvent('dotnetify.routed');\r\n }\r\n }\r\n\r\n // Returns the URL for an anchor tag.\r\n route(iRoute, iTarget) {\r\n // No route to process. Return silently.\r\n if (iRoute == null) return;\r\n\r\n if (!iRoute.hasOwnProperty('Path') && !iRoute.hasOwnProperty('TemplateId')) throw new Error('Not a valid route');\r\n\r\n // Build the absolute root path.\r\n this.initRoot();\r\n\r\n // If the route path is not defined, use the URL pattern from the associated template.\r\n // This is so that we don't send the same data twice if both are equal.\r\n let path = iRoute.Path;\r\n let template = null;\r\n if (this.hasRoutingState && this.RoutingState.Templates != null && iRoute.TemplateId != null) {\r\n let match = this.RoutingState.Templates.filter(function(iTemplate) {\r\n return iTemplate.Id == iRoute.TemplateId;\r\n });\r\n if (match.length > 0) {\r\n template = match[0];\r\n\r\n if (typeof iTarget === 'string') template.Target = iTarget;\r\n\r\n if (path == null) {\r\n path = template.UrlPattern != null ? template.UrlPattern : template.Id;\r\n iRoute.Path = path;\r\n }\r\n }\r\n else if (iRoute.RedirectRoot == null) throw new Error(`vmRoute cannot find route template ${iRoute.TemplateId}`);\r\n }\r\n\r\n // If the path has a redirect root, the path doesn't belong to the current root and needs to be\r\n // redirected to a different one. Set the absolute path to the HREF attribute, and prevent the\r\n // default behavior of the anchor click event and instead do push to HTML5 history state, which\r\n // would attempt to resolve the path first before resorting to hard browser redirect.\r\n if (iRoute.RedirectRoot != null) {\r\n // Combine the redirect root with the view model's root.\r\n let redirectRoot = iRoute.RedirectRoot;\r\n if (redirectRoot.charAt(0) == '/') redirectRoot = redirectRoot.substr(0, redirectRoot.length - 1);\r\n let redirectRootPath = iRoute.RedirectRoot.split('/');\r\n\r\n let urlRedirect = '';\r\n let absRoot = this.VMRoot;\r\n if (absRoot != null) {\r\n let absRootPath = absRoot.split('/');\r\n for (let i = 0; i < absRootPath.length; i++) {\r\n if (absRootPath[i] != '' && absRootPath[i] == redirectRootPath[0]) break;\r\n urlRedirect += absRootPath[i] + '/';\r\n }\r\n }\r\n\r\n urlRedirect += redirectRoot + '/' + path;\r\n urlRedirect = urlRedirect.replace(/\\/\\/+/g, '/');\r\n if (!this.routes.some(x => x.Path === path)) this.routes.push({ Path: path, Url: urlRedirect });\r\n return urlRedirect;\r\n }\r\n\r\n // For quick lookup, save the mapping between the path to the route inside the view model.\r\n if (template == null) throw new Error('vmRoute cannot find any route template');\r\n\r\n iRoute.$template = template;\r\n this.pathToRoute = this.pathToRoute || {};\r\n this.pathToRoute[path] = iRoute;\r\n\r\n // Set the absolute path to the HREF attribute, and prevent the default behavior of\r\n // the anchor click event and instead do push to HTML5 history state.\r\n let url = this.toUrl(path);\r\n url = url.length > 0 ? url : '/';\r\n if (!this.routes.some(x => x.Path === path)) this.routes.push({ Path: path, Url: url });\r\n return url;\r\n }\r\n\r\n // Routes to a path.\r\n routeTo(iPath, iTemplate, iDisableEvent, iCallbackFn, isRedirect) {\r\n const vm = this.vm;\r\n const viewModels = vm.$dotnetify.getViewModels();\r\n\r\n if (this.debug) console.log(\"router> route '\" + iPath + \"' to template id=\" + iTemplate.Id);\r\n\r\n // We can determine whether the view has already been loaded by matching the 'RoutingState.Origin' argument\r\n // on the existing view model inside that target selector with the path.\r\n for (let i = 0; i < viewModels.length; i++) {\r\n var vmOther = viewModels[i];\r\n var vmArg = vmOther.$router.VMArg;\r\n if (vmArg != null) {\r\n if (typeof vmArg['RoutingState.Origin'] === 'string' && utils.equal(vmArg['RoutingState.Origin'], iPath)) return;\r\n }\r\n }\r\n\r\n // Support enter interception.\r\n if (iDisableEvent != true && vm.hasOwnProperty('onRouteEnter')) {\r\n if (this.onRouteEnter(iPath, iTemplate) == false || vm.onRouteEnter(iPath, iTemplate) == false) return;\r\n }\r\n\r\n // Check if the route has valid target.\r\n if (iTemplate.Target == null) {\r\n console.error(\"router> the Target for template '\" + iTemplate.Id + \"' was not set. Use vm.onRouteEnter() to set the target.\");\r\n return;\r\n }\r\n\r\n // If target DOM element isn't found, redirect URL to the path.\r\n if (document.getElementById(iTemplate.Target) == null) {\r\n if (isRedirect === true) {\r\n if (this.debug) console.log(\"router> target '\" + iTemplate.Target + \"' not found in DOM\");\r\n return;\r\n }\r\n else {\r\n if (this.debug) console.log(\"router> target '\" + iTemplate.Target + \"' not found in DOM, use redirect instead\");\r\n return this.router.redirect(this.toUrl(iPath), [ ...viewModels, ...vm.$dotnetify.controller.getViewModels() ]);\r\n }\r\n }\r\n\r\n // Load the view associated with the route asynchronously.\r\n this.loadView('#' + iTemplate.Target, iTemplate.ViewUrl, iTemplate.JSModuleUrl, { 'RoutingState.Origin': iPath }, () => {\r\n // If load is successful, update the active route.\r\n this.dispatchActiveRoutingState(iPath);\r\n\r\n // Support exit interception.\r\n if (iDisableEvent != true && vm.hasOwnProperty('onRouteExit')) vm.onRouteExit(iPath, iTemplate);\r\n\r\n if (typeof iCallbackFn === 'function') iCallbackFn.call(vm);\r\n });\r\n }\r\n\r\n routeToRoute(iRoute) {\r\n var path = this.vm.$route(iRoute);\r\n if (path == null || path == '') throw new Error('The route passed to $routeTo is invalid.');\r\n\r\n setTimeout(() => this.router.pushState({}, '', path));\r\n }\r\n\r\n // Routes the URL if the view model implements IRoutable.\r\n // Returns true if the view model handles the routing.\r\n routeUrl(redirectUrlPath) {\r\n if (!this.hasRoutingState) return false;\r\n\r\n const isRedirect = !!redirectUrlPath;\r\n let root = this.RoutingState.Root;\r\n if (root == null) return false;\r\n\r\n // Get the URL path to route.\r\n let urlPath = isRedirect ? redirectUrlPath : this.router.urlPath;\r\n\r\n if (this.debug) console.log('router> routing ' + urlPath);\r\n\r\n // If the URL path matches the root path of this view, use the template with a blank URL pattern if provided.\r\n if (utils.equal(urlPath, root) || utils.equal(urlPath, root + '/') || urlPath === '/') {\r\n let match = utils.grep(this.RoutingState.Templates, function(iTemplate) {\r\n return iTemplate.UrlPattern === '';\r\n });\r\n if (match.length > 0) {\r\n this.routeTo('', match[0], null, null, isRedirect);\r\n this.router.urlPath = '';\r\n this.raiseRoutedEvent();\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n // If the URL path starts with the root path of this view, look at the next path and try to match it with the\r\n // anchor tags in this view that are bound with the vmRoute binding type. If there is match, route to that path.\r\n root = root + '/';\r\n if (utils.startsWith(urlPath, root)) {\r\n let routeElem = null;\r\n let match = utils.grep(this.routes, function(elem) {\r\n return utils.startsWith(urlPath + '/', elem.Url + '/');\r\n });\r\n if (match.length > 0) {\r\n // If more than one match, find the best match.\r\n for (let i = 0; i < match.length; i++) if (routeElem == null || routeElem.Url.length < match[i].Url.length) routeElem = match[i];\r\n }\r\n\r\n if (routeElem != null) {\r\n let path = routeElem.Path;\r\n let template =\r\n this.hasOwnProperty('pathToRoute') && this.pathToRoute.hasOwnProperty(path) ? this.pathToRoute[path].$template : null;\r\n if (template != null) {\r\n // If the URL path is completely routed, clear it.\r\n if (utils.equal(this.router.urlPath, this.toUrl(path))) this.router.urlPath = '';\r\n\r\n // If route's not already active, route to it.\r\n if (!utils.equal(this.RoutingState.Active, path)) {\r\n this.routeTo(path, template, false, () => this.raiseRoutedEvent(), isRedirect);\r\n }\r\n else this.raiseRoutedEvent();\r\n return true;\r\n }\r\n }\r\n else if (this.router.match(urlPath)) {\r\n // If no vmRoute binding matches, try to match with any template's URL pattern.\r\n this.router.urlPath = '';\r\n this.raiseRoutedEvent();\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n // Builds an absolute URL from a path.\r\n toUrl(iPath) {\r\n let path = utils.trim(iPath);\r\n if (path.charAt(0) != '(' && path != '') path = '/' + path;\r\n return this.hasRoutingState ? this.RoutingState.Root + path : iPath;\r\n }\r\n\r\n // Unmount a view if there's one on the target selector.\r\n unmountView(iTargetSelector) {\r\n throw new Error('Not implemented');\r\n }\r\n}\r\n","/* \r\nCopyright 2018-2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport Vue from 'vue';\r\nimport dotnetifyVMRouter from '../core/dotnetify-vm-router';\r\nimport $ from '../libs/jquery-shim';\r\nimport utils from '../libs/utils';\r\n\r\nconst window = window || global || {};\r\n\r\nexport default class dotnetifyVueVMRouter extends dotnetifyVMRouter {\r\n get hasRoutingState() {\r\n const state = this.vm.State();\r\n return state && state.hasOwnProperty('RoutingState');\r\n }\r\n get RoutingState() {\r\n return this.vm.State().RoutingState;\r\n }\r\n get VMRoot() {\r\n return this.vm.Props('vmRoot');\r\n }\r\n get VMArg() {\r\n return this.vm.Props('vmArg');\r\n }\r\n\r\n constructor(iVM, iDotNetifyRouter) {\r\n super(iVM, iDotNetifyRouter);\r\n }\r\n\r\n onRouteEnter(iPath, iTemplate) {\r\n if (!iTemplate.ViewUrl) iTemplate.ViewUrl = iTemplate.Id;\r\n return true;\r\n }\r\n\r\n // Loads a view into a target element.\r\n loadView(iTargetSelector, iViewUrl, iJsModuleUrl, iVmArg, iCallbackFn) {\r\n const vm = this.vm;\r\n let componentProps;\r\n\r\n // If the view model supports routing, add the root path to the view, to be used\r\n // to build the absolute route path, and view model argument if provided.\r\n if (this.hasRoutingState) {\r\n if (this.RoutingState === null) {\r\n console.error(\"router> the RoutingState prop of '\" + vm.$vmId + \"' was not initialized.\");\r\n return;\r\n }\r\n\r\n let root = this.VMRoot;\r\n root = root != null ? '/' + utils.trim(this.RoutingState.Root) + '/' + utils.trim(root) : this.RoutingState.Root;\r\n componentProps = { vmRoot: root, vmArg: iVmArg };\r\n }\r\n\r\n // Provide the opportunity to override the URL.\r\n iViewUrl = this.router.overrideUrl(iViewUrl, iTargetSelector);\r\n iJsModuleUrl = this.router.overrideUrl(iJsModuleUrl, iTargetSelector);\r\n\r\n if (utils.endsWith(iViewUrl, 'html')) this.loadHtmlView(iTargetSelector, iViewUrl, iJsModuleUrl, iCallbackFn);\r\n else {\r\n let component = iViewUrl;\r\n if (typeof iViewUrl === 'string' && window.hasOwnProperty(iViewUrl)) component = Object.assign({}, window[iViewUrl]);\r\n\r\n if (component instanceof HTMLElement) this.loadHtmlElementView(iTargetSelector, component, iJsModuleUrl, componentProps, iCallbackFn);\r\n else this.loadVueView(iTargetSelector, component, iJsModuleUrl, componentProps, iCallbackFn);\r\n }\r\n }\r\n\r\n // Loads a Vue view.\r\n loadVueView(iTargetSelector, iComponent, iJsModuleUrl, iProps, callbackFn) {\r\n return new Promise((resolve, reject) => {\r\n const vm = this.vm;\r\n const vmId = this.vm ? this.vm.$vmId : '';\r\n const createViewFunc = () => {\r\n // Resolve the vue class from the argument, which can be the object itself, or a global window variable name.\r\n let vueClass = iComponent;\r\n if (typeof iComponent !== 'object' || (typeof iComponent.render !== 'function' && !iComponent.template)) {\r\n console.error(`[${vmId}] failed to load view '${iComponent}' because it's not a Vue element.`);\r\n reject();\r\n return;\r\n }\r\n\r\n // Unmount any existing Vue component on the target selector.\r\n this.unmountView(iTargetSelector);\r\n\r\n // Declare 'RoutingState' property in the component.\r\n let data = typeof vueClass.data == 'function' ? vueClass.data() : vueClass.data || {};\r\n if (!data.hasOwnProperty('RoutingState')) {\r\n data.RoutingState = {};\r\n vueClass.data = function() {\r\n return data;\r\n };\r\n }\r\n\r\n // Add any undeclared property to the vue class.\r\n if (iProps) {\r\n vueClass.props = vueClass.props || {};\r\n for (const prop in iProps) if (!vueClass.props.hasOwnProperty(prop)) vueClass.props[prop] = { type: null };\r\n }\r\n\r\n const vueComponentType = Vue.extend(vueClass);\r\n const vueComponent = new vueComponentType({ propsData: { ...iProps } });\r\n\r\n document.querySelector(iTargetSelector).innerHTML = '
';\r\n vueComponent.$mount(iTargetSelector + ' > div');\r\n this.mountedComponents[iTargetSelector] = () => vueComponent.$destroy();\r\n\r\n if (typeof callbackFn === 'function') callbackFn.call(vm, vueComponent);\r\n resolve(vueComponent);\r\n };\r\n\r\n if (iJsModuleUrl == null) createViewFunc();\r\n else {\r\n // Load all javascripts first. Multiple files can be specified with comma delimiter.\r\n const getScripts = iJsModuleUrl.split(',').map(i => $.getScript(i));\r\n $.when.apply($, getScripts).done(createViewFunc);\r\n }\r\n });\r\n }\r\n\r\n // Unmount a Vue view if there's one on the target selector.\r\n unmountView(iTargetSelector) {\r\n if (!this.mountedComponents) this.mountedComponents = {};\r\n\r\n const unmount = this.mountedComponents[iTargetSelector];\r\n if (typeof unmount == 'function') {\r\n unmount();\r\n delete this.mountedComponents[iTargetSelector];\r\n }\r\n }\r\n}\r\n","/*\r\nPathJS - Copyright (c) 2011 Mike Trpcic, released under the MIT license.\r\n */\r\nconst window = window || global || {};\r\n\r\nvar Path = {\r\n // Need this specific version, because latest version is causing issue.\r\n version: '0.8.5',\r\n map: function(path) {\r\n if (Path.routes.defined.hasOwnProperty(path)) {\r\n return Path.routes.defined[path];\r\n }\r\n else {\r\n return new Path.core.route(path);\r\n }\r\n },\r\n root: function(path) {\r\n Path.routes.root = path;\r\n },\r\n rescue: function(fn) {\r\n Path.routes.rescue = fn;\r\n },\r\n history: {\r\n initial: {}, // Empty container for \"Initial Popstate\" checking variables.\r\n pushState: function(state, title, path) {\r\n if (Path.history.supported) {\r\n if (Path.dispatch(path)) {\r\n history.pushState(state, title, path);\r\n }\r\n }\r\n else {\r\n if (Path.history.fallback) {\r\n window.location.hash = '#' + path;\r\n }\r\n }\r\n },\r\n popState: function(event) {\r\n var initialPop = !Path.history.initial.popped && location.href == Path.history.initial.URL;\r\n Path.history.initial.popped = true;\r\n if (initialPop) return;\r\n Path.dispatch(document.location.pathname === '/' ? '' : document.location.pathname);\r\n },\r\n listen: function(fallback) {\r\n Path.history.supported = !!(window.history && window.history.pushState);\r\n Path.history.fallback = fallback;\r\n\r\n if (Path.history.supported) {\r\n (Path.history.initial.popped = 'state' in window.history), (Path.history.initial.URL = location.href);\r\n window.onpopstate = Path.history.popState;\r\n }\r\n else {\r\n if (Path.history.fallback) {\r\n for (route in Path.routes.defined) {\r\n if (route.charAt(0) != '#') {\r\n Path.routes.defined['#' + route] = Path.routes.defined[route];\r\n Path.routes.defined['#' + route].path = '#' + route;\r\n }\r\n }\r\n Path.listen();\r\n }\r\n }\r\n }\r\n },\r\n match: function(path, parameterize) {\r\n var params = {},\r\n route = null,\r\n possible_routes,\r\n slice,\r\n i,\r\n j,\r\n compare,\r\n result;\r\n for (route in Path.routes.defined) {\r\n if (route !== null && route !== undefined) {\r\n route = Path.routes.defined[route];\r\n possible_routes = route.partition();\r\n for (j = 0; j < possible_routes.length; j++) {\r\n slice = possible_routes[j];\r\n compare = path;\r\n if (slice.search(/:/) > 0) {\r\n for (i = 0; i < slice.split('/').length; i++) {\r\n if (i < compare.split('/').length && slice.split('/')[i].charAt(0) === ':') {\r\n params[slice.split('/')[i].replace(/:/, '')] = compare.split('/')[i];\r\n result = compare.split('/');\r\n result[i] = slice.split('/')[i];\r\n compare = result.join('/');\r\n }\r\n }\r\n }\r\n if (slice === compare) {\r\n if (parameterize) {\r\n route.params = params;\r\n }\r\n return route;\r\n }\r\n }\r\n }\r\n }\r\n return null;\r\n },\r\n dispatch: function(passed_route) {\r\n var previous_route, matched_route;\r\n if (Path.routes.current !== passed_route) {\r\n Path.routes.previous = Path.routes.current;\r\n Path.routes.current = passed_route;\r\n matched_route = Path.match(passed_route, true);\r\n\r\n if (Path.routes.previous) {\r\n previous_route = Path.match(Path.routes.previous);\r\n if (previous_route !== null && previous_route.do_exit !== null) {\r\n previous_route.do_exit();\r\n }\r\n }\r\n\r\n if (matched_route !== null) {\r\n matched_route.run();\r\n return true;\r\n }\r\n else {\r\n if (Path.routes.rescue !== null) {\r\n Path.routes.rescue();\r\n }\r\n }\r\n }\r\n },\r\n listen: function() {\r\n var fn = function() {\r\n Path.dispatch(location.hash);\r\n };\r\n\r\n if (location.hash === '') {\r\n if (Path.routes.root !== null) {\r\n location.hash = Path.routes.root;\r\n }\r\n }\r\n\r\n // The 'document.documentMode' checks below ensure that PathJS fires the right events\r\n // even in IE \"Quirks Mode\".\r\n if ('onhashchange' in window && (!document.documentMode || document.documentMode >= 8)) {\r\n window.onhashchange = fn;\r\n }\r\n else {\r\n setInterval(fn, 50);\r\n }\r\n\r\n if (location.hash !== '') {\r\n Path.dispatch(location.hash);\r\n }\r\n },\r\n core: {\r\n route: function(path) {\r\n this.path = path;\r\n this.action = null;\r\n this.do_enter = [];\r\n this.do_exit = null;\r\n this.params = {};\r\n Path.routes.defined[path] = this;\r\n }\r\n },\r\n routes: {\r\n current: null,\r\n root: null,\r\n rescue: null,\r\n previous: null,\r\n defined: {}\r\n }\r\n};\r\n\r\nPath.core.route.prototype = {\r\n to: function(fn) {\r\n this.action = fn;\r\n return this;\r\n },\r\n enter: function(fns) {\r\n if (fns instanceof Array) {\r\n this.do_enter = this.do_enter.concat(fns);\r\n }\r\n else {\r\n this.do_enter.push(fns);\r\n }\r\n return this;\r\n },\r\n exit: function(fn) {\r\n this.do_exit = fn;\r\n return this;\r\n },\r\n partition: function() {\r\n var parts = [],\r\n options = [],\r\n re = /\\(([^}]+?)\\)/g,\r\n text,\r\n i;\r\n while ((text = re.exec(this.path))) {\r\n parts.push(text[1]);\r\n }\r\n options.push(this.path.split('(')[0]);\r\n for (i = 0; i < parts.length; i++) {\r\n options.push(options[options.length - 1] + parts[i]);\r\n }\r\n return options;\r\n },\r\n run: function() {\r\n var halt_execution = false,\r\n i,\r\n result,\r\n previous;\r\n\r\n if (Path.routes.defined[this.path].hasOwnProperty('do_enter')) {\r\n if (Path.routes.defined[this.path].do_enter.length > 0) {\r\n for (i = 0; i < Path.routes.defined[this.path].do_enter.length; i++) {\r\n result = Path.routes.defined[this.path].do_enter[i].apply(this, null);\r\n if (result === false) {\r\n halt_execution = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n if (!halt_execution) {\r\n Path.routes.defined[this.path].action();\r\n }\r\n }\r\n};\r\n\r\nexport default Path;\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport Path from '../libs/path';\r\n\r\nconst window = window || global || {};\r\n\r\nexport default class dotnetifyRouter {\r\n version = '2.0.1';\r\n\r\n // URL path that will be parsed when performing routing.\r\n urlPath = document.location.pathname;\r\n\r\n constructor(debug) {\r\n this.debug = debug;\r\n }\r\n\r\n // Initialize routing using PathJS.\r\n init() {\r\n if (typeof Path !== 'undefined') {\r\n Path.history.listen(true);\r\n Path.routes.rescue = function() {\r\n //window.location.replace(document.location.pathname);\r\n };\r\n }\r\n else throw new Error('Pathjs library is required for routing.');\r\n }\r\n\r\n // Map a route to an action.\r\n mapTo(iPath, iFn) {\r\n iPath = iPath.length > 0 ? iPath : '/';\r\n if (typeof Path !== 'undefined')\r\n Path.map(iPath).to(function() {\r\n iFn(this.params);\r\n });\r\n }\r\n\r\n // Match a URL path to a route and run the action.\r\n match(iUrlPath) {\r\n if (typeof Path !== 'undefined') {\r\n var matched = Path.match(iUrlPath, true);\r\n if (matched != null) {\r\n matched.run();\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n // Optional callback to override a URL before performing routing.\r\n overrideUrl(iUrl) {\r\n return iUrl;\r\n }\r\n\r\n // Push state to HTML history.\r\n pushState(iState, iTitle, iPath) {\r\n this.urlPath = '';\r\n if (typeof Path !== 'undefined') Path.history.pushState(iState, iTitle, iPath);\r\n }\r\n\r\n // Redirect to the a URL.\r\n redirect(iUrl, viewModels) {\r\n // Check first whether existing views can handle routing this URL.\r\n // Otherwise, do a hard browser redirect.\r\n this.urlPath = iUrl;\r\n for (let i = 0; i < viewModels.length; i++) {\r\n const vm = viewModels[i];\r\n if (vm.$router.routeUrl(iUrl)) {\r\n if (this.debug) console.log('router> redirected');\r\n return;\r\n }\r\n }\r\n window.location.replace(iUrl);\r\n }\r\n\r\n // Called by dotNetify when a view model is ready.\r\n $ready() {\r\n this.$router.initRouting();\r\n }\r\n\r\n // Called by dotNetify when a view model receives update.\r\n $update(vmData) {\r\n if (vmData && vmData.RoutingState) this.$router.initRouting();\r\n }\r\n}\r\n","/* \r\nCopyright 2018-2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport dotnetify from './dotnetify-vue';\r\nimport dotnetifyRouter from '../core/dotnetify-router';\r\nimport dotnetifyVueVMRouter from './dotnetify-vue.vm-router';\r\n\r\n// Add plugin functions.\r\ndotnetify.vue.router = new dotnetifyRouter(dotnetify.debug);\r\n\r\n// Inject a view model with functions.\r\ndotnetify.vue.router.$inject = function(iVM) {\r\n const router = new dotnetifyVueVMRouter(iVM, dotnetify.vue.router);\r\n\r\n // Put functions inside $router namespace.\r\n iVM.$router = router;\r\n\r\n // Returns the URL for an anchor tag.\r\n iVM.$route = (iRoute, iTarget) => router.route(iRoute, iTarget);\r\n\r\n // Handles click event from anchor tags.\r\n iVM.$handleRoute = iEvent => router.handleRoute(iEvent);\r\n\r\n // Executes the given route.\r\n iVM.$routeTo = iRoute => router.routeToRoute(iRoute);\r\n};\r\n\r\n// Provide function to load a view.\r\ndotnetify.vue.router.$mount = function(iTargetSelector, iComponent, iProps, iCallbackFn) {\r\n return dotnetifyVueVMRouter.prototype.loadVueView(iTargetSelector, iComponent, null, iProps, iCallbackFn);\r\n};\r\n\r\n// Register the plugin to dotNetify.\r\ndotnetify.vue.plugins['router'] = dotnetify.vue.router;\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport $ from '../libs/jquery-shim';\r\n\r\nconst window = window || global || {};\r\n\r\n// Client-side view model that acts as a proxy of the server view model.\r\nexport default class dotnetifyVM {\r\n // iVMId - identifies the view model.\r\n // iComponent - component object.\r\n // iOptions - Optional configuration options:\r\n // getState: state accessor.\r\n // setState: state mutator.\r\n // vmArg: view model arguments.\r\n // headers: request headers, for things like authentication token.\r\n // exceptionHandler: called when receiving server-side exception.\r\n // iDotNetify - framework-specific dotNetify library.\r\n // iHub - hub connection.\r\n constructor(iVMId, iComponent, iOptions, iDotNetify, iHub) {\r\n this.$vmId = iVMId;\r\n this.$component = iComponent;\r\n this.$options = iOptions || {};\r\n this.$vmArg = iOptions && iOptions['vmArg'];\r\n this.$headers = iOptions && iOptions['headers'];\r\n this.$exceptionHandler = iOptions && iOptions['exceptionHandler'];\r\n this.$requested = false;\r\n this.$loaded = false;\r\n this.$itemKey = {};\r\n this.$dotnetify = iDotNetify;\r\n this.$hub = iHub;\r\n\r\n let getState = iOptions && iOptions['getState'];\r\n let setState = iOptions && iOptions['setState'];\r\n getState = typeof getState === 'function' ? getState : () => iComponent.state;\r\n setState = typeof setState === 'function' ? setState : state => iComponent.setState(state);\r\n\r\n this.State = state => (typeof state === 'undefined' ? getState() : setState(state));\r\n this.Props = prop => this.$component.props && this.$component.props[prop];\r\n\r\n const vmArg = this.Props('vmArg');\r\n if (vmArg) this.$vmArg = $.extend(this.$vmArg, vmArg);\r\n\r\n // Inject plugin functions into this view model.\r\n this.$getPlugins().map(plugin => (typeof plugin['$inject'] == 'function' ? plugin.$inject(this) : null));\r\n }\r\n\r\n // Disposes the view model, both here and on the server.\r\n $destroy() {\r\n // Call any plugin's $destroy function if provided.\r\n this.$getPlugins().map(plugin => (typeof plugin['$destroy'] == 'function' ? plugin.$destroy.apply(this) : null));\r\n\r\n if (this.$hub.isConnected) {\r\n try {\r\n this.$hub.disposeVM(this.$vmId);\r\n } catch (ex) {\r\n this.$dotnetify.controller.handleConnectionStateChanged('error', ex, this.$hub);\r\n }\r\n }\r\n\r\n delete this.$dotnetify.viewModels[this.$vmId];\r\n }\r\n\r\n // Dispatches a value to the server view model.\r\n // iValue - Value to dispatch.\r\n $dispatch(iValue) {\r\n if (this.$hub.isConnected) {\r\n const controller = this.$dotnetify.controller;\r\n try {\r\n this.$hub.updateVM(this.$vmId, iValue);\r\n\r\n if (controller.debug) {\r\n console.log('[' + this.$vmId + '] sent> ');\r\n console.log(iValue);\r\n\r\n controller.debugFn && controller.debugFn(this.$vmId, 'sent', iValue);\r\n }\r\n } catch (ex) {\r\n controller.handleConnectionStateChanged('error', ex, this.$hub);\r\n }\r\n }\r\n }\r\n\r\n // Dispatches a state value to the server view model.\r\n // iValue - State value to dispatch.\r\n $dispatchListState(iValue) {\r\n for (var listName in iValue) {\r\n const key = this.$itemKey[listName];\r\n if (!key) {\r\n console.error(`[${this.$vmId}] missing item key for '${listName}'; add ${listName}_itemKey property to the view model.`);\r\n return;\r\n }\r\n var item = iValue[listName];\r\n if (!item[key]) {\r\n console.error(`[${this.$vmId}] couldn't dispatch data from '${listName}' due to missing property '${key}'.`);\r\n console.error(item);\r\n return;\r\n }\r\n\r\n Object.keys(item).forEach(prop => {\r\n if (prop != key) {\r\n let state = {};\r\n state[listName + '.$' + item[key] + '.' + prop] = item[prop];\r\n this.$dispatch(state);\r\n }\r\n });\r\n this.$updateList(listName, item);\r\n }\r\n }\r\n\r\n $getPlugins() {\r\n return Object.keys(this.$dotnetify.plugins).map(id => this.$dotnetify.plugins[id]);\r\n }\r\n\r\n // Preprocess view model update from the server before we set the state.\r\n $preProcess(iVMUpdate) {\r\n const vm = this;\r\n\r\n for (var prop in iVMUpdate) {\r\n // Look for property that end with '_add'. Interpret the value as a list item to be added\r\n // to an existing list whose property name precedes that suffix.\r\n var match = /(.*)_add/.exec(prop);\r\n if (match != null) {\r\n var listName = match[1];\r\n if (Array.isArray(this.State()[listName])) vm.$addList(listName, iVMUpdate[prop]);\r\n else console.error('unable to resolve ' + prop);\r\n delete iVMUpdate[prop];\r\n continue;\r\n }\r\n\r\n // Look for property that end with '_update'. Interpret the value as a list item to be updated\r\n // to an existing list whose property name precedes that suffix.\r\n var match = /(.*)_update/.exec(prop);\r\n if (match != null) {\r\n var listName = match[1];\r\n if (Array.isArray(this.State()[listName])) vm.$updateList(listName, iVMUpdate[prop]);\r\n else console.error('[' + this.$vmId + \"] '\" + listName + \"' is not found or not an array.\");\r\n delete iVMUpdate[prop];\r\n continue;\r\n }\r\n\r\n // Look for property that end with '_remove'. Interpret the value as a list item key to remove\r\n // from an existing list whose property name precedes that suffix.\r\n var match = /(.*)_remove/.exec(prop);\r\n if (match != null) {\r\n var listName = match[1];\r\n if (Array.isArray(this.State()[listName])) {\r\n var key = this.$itemKey[listName];\r\n if (key != null)\r\n vm.$removeList(listName, function(i) {\r\n return i[key] == iVMUpdate[prop];\r\n });\r\n else console.error(`[${this.$vmId}] missing item key for '${listName}'; add ${listName}_itemKey property to the view model.`);\r\n }\r\n else console.error(`[${this.$vmId}] '${listName}' is not found or not an array.`);\r\n delete iVMUpdate[prop];\r\n continue;\r\n }\r\n\r\n // Look for property that end with '_itemKey'. Interpret the value as the property name that will\r\n // uniquely identify items in the list.\r\n var match = /(.*)_itemKey/.exec(prop);\r\n if (match != null) {\r\n var listName = match[1];\r\n var itemKey = {};\r\n itemKey[listName] = iVMUpdate[prop];\r\n vm.$setItemKey(itemKey);\r\n delete iVMUpdate[prop];\r\n continue;\r\n }\r\n }\r\n }\r\n\r\n // Requests state from the server view model.\r\n $request() {\r\n if (this.$hub.isConnected) this.$hub.requestVM(this.$vmId, { $vmArg: this.$vmArg, $headers: this.$headers });\r\n this.$requested = true;\r\n }\r\n\r\n // Updates state from the server view model to the view.\r\n // iVMData - Serialized state from the server.\r\n $update(iVMData) {\r\n const controller = this.$dotnetify.controller;\r\n if (controller.debug) {\r\n console.log('[' + this.$vmId + '] received> ');\r\n console.log(JSON.parse(iVMData));\r\n\r\n controller.debugFn && controller.debugFn(this.$vmId, 'received', JSON.parse(iVMData));\r\n }\r\n let vmData = JSON.parse(iVMData);\r\n this.$preProcess(vmData);\r\n\r\n let state = this.State();\r\n state = $.extend({}, state, vmData);\r\n this.State(state);\r\n\r\n if (!this.$loaded) this.$onLoad();\r\n else this.$onUpdate(vmData);\r\n }\r\n\r\n // Handles initial view model load event.\r\n $onLoad() {\r\n this.$getPlugins().map(plugin => (typeof plugin['$ready'] == 'function' ? plugin.$ready.apply(this) : null));\r\n this.$loaded = true;\r\n }\r\n\r\n // Handles view model update event.\r\n $onUpdate(vmData) {\r\n this.$getPlugins().map(plugin => (typeof plugin['$update'] == 'function' ? plugin.$update.apply(this, [ vmData ]) : null));\r\n }\r\n\r\n // *** CRUD Functions ***\r\n\r\n // Sets items key to identify individual items in a list.\r\n // Accepts object literal: { \"\": \"\", ... }\r\n $setItemKey(iItemKey) {\r\n Object.assign(this.$itemKey, iItemKey);\r\n }\r\n\r\n //// Adds a new item to a state array.\r\n $addList(iListName, iNewItem) {\r\n // Check if the list already has an item with the same key. If so, replace it.\r\n var key = this.$itemKey[iListName];\r\n if (key != null) {\r\n if (!iNewItem.hasOwnProperty(key)) {\r\n console.error(`[${this.$vmId}] couldn't add item to '${iListName}' due to missing property '${key}'.`);\r\n return;\r\n }\r\n var match = this.State()[iListName].filter(function(i) {\r\n return i[key] == iNewItem[key];\r\n });\r\n if (match.length > 0) {\r\n console.error(`[${this.$vmId}] couldn't add item to '${iListName}' because the key already exists.`);\r\n return;\r\n }\r\n }\r\n\r\n let items = this.State()[iListName];\r\n items.push(iNewItem);\r\n\r\n let state = {};\r\n state[iListName] = items;\r\n this.State(state);\r\n }\r\n\r\n // Removes an item from a state array.\r\n $removeList(iListName, iFilter) {\r\n let state = {};\r\n state[iListName] = this.State()[iListName].filter(i => !iFilter(i));\r\n this.State(state);\r\n }\r\n\r\n //// Updates existing item to an observable array.\r\n $updateList(iListName, iNewItem) {\r\n // Check if the list already has an item with the same key. If so, update it.\r\n let key = this.$itemKey[iListName];\r\n if (key != null) {\r\n if (!iNewItem.hasOwnProperty(key)) {\r\n console.error(`[${this.$vmId}] couldn't update item to '${iListName}' due to missing property '${key}'.`);\r\n return;\r\n }\r\n var state = {};\r\n state[iListName] = this.State()[iListName].map(function(i) {\r\n return i[key] == iNewItem[key] ? $.extend(i, iNewItem) : i;\r\n });\r\n this.State(state);\r\n }\r\n else console.error(`[${this.$vmId}] missing item key for '${iListName}'; add '${iListName}_itemKey' property to the view model.`);\r\n }\r\n}\r\n","/* \r\nimport { dotnetify } from 'dotnetify/dist/dotnetify-ko';\r\nCopyright 2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport { createEventEmitter } from '../libs/utils';\r\n\r\nconst window = window || global || {};\r\n\r\nconst normalize = iVMId => iVMId && iVMId.replace(/\\./g, '_');\r\nconst hasLocalVM = iVMId => {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n return typeof vm == 'object' && typeof vm.onConnect == 'function';\r\n};\r\n\r\nexport class dotNetifyHubLocal {\r\n mode = 'local';\r\n debug = false;\r\n isConnected = false;\r\n isHubStarted = false;\r\n\r\n responseEvent = createEventEmitter();\r\n reconnectedEvent = createEventEmitter();\r\n connectedEvent = createEventEmitter();\r\n connectionFailedEvent = createEventEmitter();\r\n\r\n startHub() {\r\n this.isConnected = true;\r\n this.isHubStarted = true;\r\n this.connectedEvent.emit();\r\n }\r\n\r\n requestVM(iVMId, iVMArgs) {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n\r\n if (typeof vm === 'object' && typeof vm.onConnect == 'function') {\r\n if (this.debug) console.log(`[${iVMId}] *** local mode ***`);\r\n\r\n vm.$pushUpdate = update => {\r\n if (typeof update == 'object') update = JSON.stringify(update);\r\n setTimeout(() => this.responseEvent.emit(iVMId, update));\r\n };\r\n\r\n vm.$pushUpdate(vm.onConnect(iVMArgs) || {});\r\n }\r\n }\r\n\r\n updateVM(iVMId, iValue) {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n\r\n if (typeof vm === 'object' && typeof vm.onDispatch == 'function') {\r\n let state = vm.onDispatch(iValue);\r\n if (state) {\r\n if (typeof state == 'object') state = JSON.stringify(state);\r\n setTimeout(() => this.responseEvent.emit(iVMId, state));\r\n }\r\n }\r\n }\r\n\r\n disposeVM(iVMId) {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n\r\n if (typeof vm === 'object' && typeof vm.onDestroy == 'function') {\r\n vm.onDestroy(iVMId);\r\n }\r\n }\r\n}\r\n\r\nexport default new dotNetifyHubLocal();\r\nexport { hasLocalVM };\r\n","module.exports = __WEBPACK_EXTERNAL_MODULE__14__;","/**\n* jQuery core object.\n*\n* Worker with jQuery deferred\n*\n* Code from: https://github.com/jquery/jquery/blob/master/src/core.js\n*\n*/\n\nvar jQuery = module.exports = {\n\ttype: type\n\t, isArray: isArray\n\t, isFunction: isFunction\n\t, isPlainObject: isPlainObject\n\t, each: each\n\t, extend: extend\n\t, noop: function() {}\n};\n\nvar toString = Object.prototype.toString;\n\nvar class2type = {};\n// Populate the class2type map\n\"Boolean Number String Function Array Date RegExp Object\".split(\" \").forEach(function(name) {\n\tclass2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n});\n\n\nfunction type( obj ) {\n\treturn obj == null ?\n\t\tString( obj ) :\n\t\t\tclass2type[ toString.call(obj) ] || \"object\";\n}\n\nfunction isFunction( obj ) {\n\treturn jQuery.type(obj) === \"function\";\n}\n\nfunction isArray( obj ) {\n\treturn jQuery.type(obj) === \"array\";\n}\n\nfunction each( object, callback, args ) {\n\tvar name, i = 0,\n\tlength = object.length,\n\tisObj = length === undefined || isFunction( object );\n\n\tif ( args ) {\n\t\tif ( isObj ) {\n\t\t\tfor ( name in object ) {\n\t\t\t\tif ( callback.apply( object[ name ], args ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( ; i < length; ) {\n\t\t\t\tif ( callback.apply( object[ i++ ], args ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// A special, fast, case for the most common use of each\n\t} else {\n\t\tif ( isObj ) {\n\t\t\tfor ( name in object ) {\n\t\t\t\tif ( callback.call( object[ name ], name, object[ name ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( ; i < length; ) {\n\t\t\t\tif ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn object;\n}\n\nfunction isPlainObject( obj ) {\n\t// Must be an Object.\n\tif ( !obj || jQuery.type(obj) !== \"object\" ) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\nfunction extend() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\ttarget = arguments[0] || {},\n\ti = 1,\n\tlength = arguments.length,\n\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif ( typeof target === \"boolean\" ) {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\n\t// Handle case when target is a string or something (possible in deep copy)\n\tif ( typeof target !== \"object\" && !jQuery.isFunction(target) ) {\n\t\ttarget = {};\n\t}\n\n\t// extend jQuery itself if only one argument is passed\n\tif ( length === i ) {\n\t\ttarget = this;\n\t\t--i;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\t\t// Only deal with non-null/undefined values\n\t\tif ( (options = arguments[ i ]) != null ) {\n\t\t\t// Extend the base object\n\t\t\tfor ( name in options ) {\n\t\t\t\tsrc = target[ name ];\n\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif ( target === copy ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {\n\t\t\t\t\tif ( copyIsArray ) {\n\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\tclone = src && jQuery.isArray(src) ? src : [];\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclone = src && jQuery.isPlainObject(src) ? src : {};\n\t\t\t\t\t}\n\n\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\n\n","var jQuery = module.exports = require(\"./jquery-core.js\"),\n\tcore_rspace = /\\s+/;\n/**\n* jQuery Callbacks\n*\n* Code from: https://github.com/jquery/jquery/blob/master/src/callbacks.js\n*\n*/\n\n\n// String to Object options format cache\nvar optionsCache = {};\n\n// Convert String-formatted options into Object-formatted ones and store in cache\nfunction createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.split( core_rspace ), function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n\t// Convert options from String-formatted to Object-formatted if needed\n\t// (we check in cache first)\n\toptions = typeof options === \"string\" ?\n\t\t( optionsCache[ options ] || createOptions( options ) ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Last fire value (for non-forgettable lists)\n\t\tmemory,\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\t\t// Flag to know if list is currently firing\n\t\tfiring,\n\t\t// First callback to fire (used internally by add and fireWith)\n\t\tfiringStart,\n\t\t// End of the loop when firing\n\t\tfiringLength,\n\t\t// Index of currently firing callback (modified by remove if needed)\n\t\tfiringIndex,\n\t\t// Actual callback list\n\t\tlist = [],\n\t\t// Stack of fire calls for repeatable lists\n\t\tstack = !options.once && [],\n\t\t// Fire callbacks\n\t\tfire = function( data ) {\n\t\t\tmemory = options.memory && data;\n\t\t\tfired = true;\n\t\t\tfiringIndex = firingStart || 0;\n\t\t\tfiringStart = 0;\n\t\t\tfiringLength = list.length;\n\t\t\tfiring = true;\n\t\t\tfor ( ; list && firingIndex < firingLength; firingIndex++ ) {\n\t\t\t\tif ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {\n\t\t\t\t\tmemory = false; // To prevent further calls using add\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfiring = false;\n\t\t\tif ( list ) {\n\t\t\t\tif ( stack ) {\n\t\t\t\t\tif ( stack.length ) {\n\t\t\t\t\t\tfire( stack.shift() );\n\t\t\t\t\t}\n\t\t\t\t} else if ( memory ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t} else {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t// Actual Callbacks object\n\t\tself = {\n\t\t\t// Add a callback or a collection of callbacks to the list\n\t\t\tadd: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\t// First, we save the current length\n\t\t\t\t\tvar start = list.length;\n\t\t\t\t\t(function add( args ) {\n\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {\n\t\t\t\t\t\t\tvar type = jQuery.type( arg );\n\t\t\t\t\t\t\tif ( type === \"function\" ) {\n\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {\n\t\t\t\t\t\t\t\t\tlist.push( arg );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if ( arg && arg.length && type !== \"string\" ) {\n\t\t\t\t\t\t\t\t// Inspect recursively\n\t\t\t\t\t\t\t\tadd( arg );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t})( arguments );\n\t\t\t\t\t// Do we need to add the callbacks to the\n\t\t\t\t\t// current firing batch?\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tfiringLength = list.length;\n\t\t\t\t\t// With memory, if we're not firing then\n\t\t\t\t\t// we should call right away\n\t\t\t\t\t} else if ( memory ) {\n\t\t\t\t\t\tfiringStart = start;\n\t\t\t\t\t\tfire( memory );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\t\tvar index;\n\t\t\t\t\t\twhile( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\t\tlist.splice( index, 1 );\n\t\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\t\t\tif ( index <= firingLength ) {\n\t\t\t\t\t\t\t\t\tfiringLength--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\t\t\tfiringIndex--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Control if a given callback is in the list\n\t\t\thas: function( fn ) {\n\t\t\t\treturn jQuery.inArray( fn, list ) > -1;\n\t\t\t},\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tlist = [];\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Have the list do nothing anymore\n\t\t\tdisable: function() {\n\t\t\t\tlist = stack = memory = undefined;\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it disabled?\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\t\t\t// Lock the list in its current state\n\t\t\tlock: function() {\n\t\t\t\tstack = undefined;\n\t\t\t\tif ( !memory ) {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it locked?\n\t\t\tlocked: function() {\n\t\t\t\treturn !stack;\n\t\t\t},\n\t\t\t// Call all callbacks with the given context and arguments\n\t\t\tfireWith: function( context, args ) {\n\t\t\t\targs = args || [];\n\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\tif ( list && ( !fired || stack ) ) {\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tstack.push( args );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfire( args );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Call all the callbacks with the given arguments\n\t\t\tfire: function() {\n\t\t\t\tself.fireWith( this, arguments );\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// To know if the callbacks have already been called at least once\n\t\t\tfired: function() {\n\t\t\t\treturn !!fired;\n\t\t\t}\n\t\t};\n\n\treturn self;\n};\n\n","\n/*!\n* jquery-deferred\n* Copyright(c) 2011 Hidden \n* MIT Licensed\n*/\n\n/**\n* Library version.\n*/\n\nvar jQuery = module.exports = require(\"./jquery-callbacks.js\"),\n\tcore_slice = Array.prototype.slice;\n\n/**\n* jQuery deferred\n*\n* Code from: https://github.com/jquery/jquery/blob/master/src/deferred.js\n* Doc: http://api.jquery.com/category/deferred-object/\n*\n*/\n\njQuery.extend({\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\t\t\t\t// action, add listener, listener list, final state\n\t\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks(\"once memory\"), \"resolved\" ],\n\t\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks(\"once memory\"), \"rejected\" ],\n\t\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks(\"memory\") ]\n\t\t\t],\n\t\t\tstate = \"pending\",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\tthen: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\t\t\t\t\treturn jQuery.Deferred(function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\t\t\t\t\tvar action = tuple[ 0 ],\n\t\t\t\t\t\t\t\tfn = fns[ i ];\n\t\t\t\t\t\t\t// deferred[ done | fail | progress ] for forwarding actions to newDefer\n\t\t\t\t\t\t\tdeferred[ tuple[1] ]( jQuery.isFunction( fn ) ?\n\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\tvar returned = fn.apply( this, arguments );\n\t\t\t\t\t\t\t\t\tif ( returned && jQuery.isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject )\n\t\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tnewDefer[ action + \"With\" ]( this === deferred ? newDefer : this, [ returned ] );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} :\n\t\t\t\t\t\t\t\tnewDefer[ action ]\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tfns = null;\n\t\t\t\t\t}).promise();\n\t\t\t\t},\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Keep pipe for back-compat\n\t\tpromise.pipe = promise.then;\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 3 ];\n\n\t\t\t// promise[ done | fail | progress ] = list.add\n\t\t\tpromise[ tuple[1] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(function() {\n\t\t\t\t\t// state = [ resolved | rejected ]\n\t\t\t\t\tstate = stateString;\n\n\t\t\t\t// [ reject_list | resolve_list ].disable; progress_list.lock\n\t\t\t\t}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );\n\t\t\t}\n\n\t\t\t// deferred[ resolve | reject | notify ] = list.fire\n\t\t\tdeferred[ tuple[0] ] = list.fire;\n\t\t\tdeferred[ tuple[0] + \"With\" ] = list.fireWith;\n\t\t});\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( subordinate /* , ..., subordinateN */ ) {\n\t\tvar i = 0,\n\t\t\tresolveValues = core_slice.call( arguments ),\n\t\t\tlength = resolveValues.length,\n\n\t\t\t// the count of uncompleted subordinates\n\t\t\tremaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,\n\n\t\t\t// the master Deferred. If resolveValues consist of only a single Deferred, just use that.\n\t\t\tdeferred = remaining === 1 ? subordinate : jQuery.Deferred(),\n\n\t\t\t// Update function for both resolve and progress values\n\t\t\tupdateFunc = function( i, contexts, values ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tcontexts[ i ] = this;\n\t\t\t\t\tvalues[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;\n\t\t\t\t\tif( values === progressValues ) {\n\t\t\t\t\t\tdeferred.notifyWith( contexts, values );\n\t\t\t\t\t} else if ( !( --remaining ) ) {\n\t\t\t\t\t\tdeferred.resolveWith( contexts, values );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t},\n\n\t\t\tprogressValues, progressContexts, resolveContexts;\n\n\t\t// add listeners to Deferred subordinates; treat others as resolved\n\t\tif ( length > 1 ) {\n\t\t\tprogressValues = new Array( length );\n\t\t\tprogressContexts = new Array( length );\n\t\t\tresolveContexts = new Array( length );\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {\n\t\t\t\t\tresolveValues[ i ].promise()\n\t\t\t\t\t\t.done( updateFunc( i, resolveContexts, resolveValues ) )\n\t\t\t\t\t\t.fail( deferred.reject )\n\t\t\t\t\t\t.progress( updateFunc( i, progressContexts, progressValues ) );\n\t\t\t\t} else {\n\t\t\t\t\t--remaining;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// if we're not waiting on anything, resolve the master\n\t\tif ( !remaining ) {\n\t\t\tdeferred.resolveWith( resolveContexts, resolveValues );\n\t\t}\n\n\t\treturn deferred.promise();\n\t}\n});\n","\nmodule.exports = require('./lib/jquery-deferred');","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","/* \r\nCopyright 2017-2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport { createEventEmitter } from '../libs/utils';\r\nimport jQueryShim from '../libs/jquery-shim';\r\nconst signalRNetCore = require('@aspnet/signalr');\r\nlet $ = jQueryShim;\r\n\r\nconst window = window || global || {};\r\n\r\nexport class dotnetifyHubFactory {\r\n static create() {\r\n let dotnetifyHub = {\r\n version: '2.0.0',\r\n type: null,\r\n\r\n reconnectDelay: [ 2, 5, 10 ],\r\n reconnectRetry: null,\r\n\r\n _startInfo: null,\r\n _init: false,\r\n\r\n // Hub server methods.\r\n requestVM: (iVMId, iOptions) => dotnetifyHub.server.request_VM(iVMId, iOptions),\r\n updateVM: (iVMId, iValue) => dotnetifyHub.server.update_VM(iVMId, iValue),\r\n disposeVM: iVMId => dotnetifyHub.server.dispose_VM(iVMId),\r\n\r\n // Connection events.\r\n responseEvent: createEventEmitter(),\r\n reconnectedEvent: createEventEmitter(),\r\n connectedEvent: createEventEmitter(),\r\n connectionFailedEvent: createEventEmitter(),\r\n\r\n get isHubStarted() {\r\n return !!this._startInfo;\r\n },\r\n\r\n // Starts connection with SignalR hub server.\r\n startHub(hubOptions, doneHandler, failHandler, forceRestart) {\r\n const _doneHandler = () => {\r\n if (typeof doneHandler == 'function') doneHandler();\r\n this.connectedEvent.emit();\r\n };\r\n const _failHandler = ex => {\r\n if (typeof failHander == 'function') failHandler();\r\n this.connectionFailedEvent.emit();\r\n throw ex;\r\n };\r\n\r\n if (this._startInfo === null || forceRestart) {\r\n try {\r\n this._startInfo = this.start(hubOptions).done(_doneHandler).fail(_failHandler);\r\n } catch (err) {\r\n this._startInfo = null;\r\n }\r\n }\r\n else {\r\n try {\r\n this._startInfo.done(_doneHandler);\r\n } catch (err) {\r\n this._startInfo = null;\r\n return this.startHub(hubOptions, doneHandler, failHandler, forceRestart);\r\n }\r\n }\r\n }\r\n };\r\n\r\n // Configures connection to SignalR hub server.\r\n dotnetifyHub.init = function(iHubPath, iServerUrl, signalR) {\r\n if (dotnetifyHub._init) return;\r\n\r\n dotnetifyHub._init = true;\r\n signalR = signalR || window.signalR || signalRNetCore;\r\n\r\n // SignalR .NET Core.\r\n if (signalR && signalR.HubConnection) {\r\n dotnetifyHub.type = 'netcore';\r\n\r\n Object.defineProperty(dotnetifyHub, 'isConnected', {\r\n get: function() {\r\n return dotnetifyHub._connection && dotnetifyHub._connection.connection.connectionState === 1;\r\n }\r\n });\r\n\r\n dotnetifyHub = $.extend(dotnetifyHub, {\r\n hubPath: iHubPath || '/dotnetify',\r\n url: iServerUrl,\r\n\r\n // Internal variables. Do not modify!\r\n _connection: null,\r\n _reconnectCount: 0,\r\n _startDoneHandler: null,\r\n _startFailHandler: null,\r\n _disconnectedHandler: function() {},\r\n _stateChangedHandler: function(iNewState) {},\r\n\r\n _onDisconnected: function() {\r\n dotnetifyHub._changeState(4);\r\n dotnetifyHub._disconnectedHandler();\r\n },\r\n\r\n _changeState: function(iNewState) {\r\n if (iNewState == 1) dotnetifyHub._reconnectCount = 0;\r\n\r\n let stateText = { 0: 'connecting', 1: 'connected', 2: 'reconnecting', 4: 'disconnected', 99: 'terminated' };\r\n dotnetifyHub._stateChangedHandler(stateText[iNewState]);\r\n },\r\n\r\n _startConnection: function(iHubOptions, iTransportArray) {\r\n let url = dotnetifyHub.url ? dotnetifyHub.url + dotnetifyHub.hubPath : dotnetifyHub.hubPath;\r\n let hubOptions = {};\r\n Object.keys(iHubOptions).forEach(function(key) {\r\n hubOptions[key] = iHubOptions[key];\r\n });\r\n hubOptions.transport = iTransportArray.shift();\r\n\r\n dotnetifyHub._connection = new signalR.HubConnectionBuilder().withUrl(url, hubOptions).build();\r\n dotnetifyHub._connection.on('response_vm', dotnetifyHub.client.response_VM);\r\n dotnetifyHub._connection.onclose(dotnetifyHub._onDisconnected);\r\n\r\n let promise = dotnetifyHub._connection\r\n .start()\r\n .then(function() {\r\n dotnetifyHub._changeState(1);\r\n })\r\n .catch(function() {\r\n // If failed to start, fallback to the next transport.\r\n if (iTransportArray.length > 0) dotnetifyHub._startConnection(iHubOptions, iTransportArray);\r\n else dotnetifyHub._onDisconnected();\r\n });\r\n\r\n if (typeof dotnetifyHub._startDoneHandler === 'function')\r\n promise.then(dotnetifyHub._startDoneHandler).catch(dotnetifyHub._startFailHandler || function() {});\r\n return promise;\r\n },\r\n\r\n start: function(iHubOptions) {\r\n dotnetifyHub._startDoneHandler = null;\r\n dotnetifyHub._startFailHandler = null;\r\n\r\n // Map the transport option.\r\n let transport = [ 0 ];\r\n let transportOptions = { webSockets: 0, serverSentEvents: 1, longPolling: 2 };\r\n if (iHubOptions && Array.isArray(iHubOptions.transport))\r\n transport = iHubOptions.transport.map(function(arg) {\r\n return transportOptions[arg];\r\n });\r\n\r\n let promise = dotnetifyHub._startConnection(iHubOptions, transport);\r\n return {\r\n done: function(iHandler) {\r\n dotnetifyHub._startDoneHandler = iHandler;\r\n promise.then(iHandler).catch(function(error) {\r\n throw error;\r\n });\r\n return this;\r\n },\r\n fail: function(iHandler) {\r\n dotnetifyHub._startFailHandler = iHandler;\r\n promise.catch(iHandler);\r\n return this;\r\n }\r\n };\r\n },\r\n\r\n disconnected: function(iHandler) {\r\n if (typeof iHandler === 'function') dotnetifyHub._disconnectedHandler = iHandler;\r\n },\r\n\r\n stateChanged: function(iHandler) {\r\n if (typeof iHandler === 'function') dotnetifyHub._stateChangedHandler = iHandler;\r\n },\r\n\r\n reconnect: function(iStartHubFunc) {\r\n if (typeof iStartHubFunc === 'function') {\r\n // Only attempt reconnect if the specified retry hasn't been exceeded.\r\n if (!dotnetifyHub.reconnectRetry || dotnetifyHub._reconnectCount < dotnetifyHub.reconnectRetry) {\r\n // Determine reconnect delay from the specified configuration array.\r\n let delay =\r\n dotnetifyHub._reconnectCount < dotnetifyHub.reconnectDelay.length\r\n ? dotnetifyHub.reconnectDelay[dotnetifyHub._reconnectCount]\r\n : dotnetifyHub.reconnectDelay[dotnetifyHub.reconnectDelay.length - 1];\r\n\r\n dotnetifyHub._reconnectCount++;\r\n\r\n setTimeout(function() {\r\n dotnetifyHub._changeState(2);\r\n iStartHubFunc();\r\n }, delay * 1000);\r\n }\r\n else dotnetifyHub._changeState(99);\r\n }\r\n },\r\n\r\n client: {},\r\n\r\n server: {\r\n dispose_VM: function(iVMId) {\r\n dotnetifyHub._connection.invoke('Dispose_VM', iVMId);\r\n },\r\n update_VM: function(iVMId, iValue) {\r\n dotnetifyHub._connection.invoke('Update_VM', iVMId, iValue);\r\n },\r\n request_VM: function(iVMId, iArgs) {\r\n dotnetifyHub._connection.invoke('Request_VM', iVMId, iArgs);\r\n }\r\n }\r\n });\r\n }\r\n else {\r\n // SignalR .NET FX.\r\n dotnetifyHub.type = 'netfx';\r\n\r\n if (window.jQuery) $ = window.jQuery;\r\n\r\n // SignalR hub auto-generated from /signalr/hubs.\r\n /// \r\n /// \r\n (function($, window, undefined) {\r\n /// \r\n 'use strict';\r\n\r\n if (typeof $.signalR !== 'function') {\r\n throw new Error('SignalR: SignalR is not loaded. Please ensure jquery.signalR-x.js is referenced before ~/signalr/js.');\r\n }\r\n\r\n var signalR = $.signalR;\r\n\r\n function makeProxyCallback(hub, callback) {\r\n return function() {\r\n // Call the client hub method\r\n callback.apply(hub, $.makeArray(arguments));\r\n };\r\n }\r\n\r\n function registerHubProxies(instance, shouldSubscribe) {\r\n var key, hub, memberKey, memberValue, subscriptionMethod;\r\n\r\n for (key in instance) {\r\n if (instance.hasOwnProperty(key)) {\r\n hub = instance[key];\r\n\r\n if (!hub.hubName) {\r\n // Not a client hub\r\n continue;\r\n }\r\n\r\n if (shouldSubscribe) {\r\n // We want to subscribe to the hub events\r\n subscriptionMethod = hub.on;\r\n }\r\n else {\r\n // We want to unsubscribe from the hub events\r\n subscriptionMethod = hub.off;\r\n }\r\n\r\n // Loop through all members on the hub and find client hub functions to subscribe/unsubscribe\r\n for (memberKey in hub.client) {\r\n if (hub.client.hasOwnProperty(memberKey)) {\r\n memberValue = hub.client[memberKey];\r\n\r\n if (!$.isFunction(memberValue)) {\r\n // Not a client hub function\r\n continue;\r\n }\r\n\r\n subscriptionMethod.call(hub, memberKey, makeProxyCallback(hub, memberValue));\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n $.hubConnection.prototype.createHubProxies = function() {\r\n var proxies = {};\r\n this.starting(function() {\r\n // Register the hub proxies as subscribed\r\n // (instance, shouldSubscribe)\r\n registerHubProxies(proxies, true);\r\n\r\n this._registerSubscribedHubs();\r\n }).disconnected(function() {\r\n // Unsubscribe all hub proxies when we \"disconnect\". This is to ensure that we do not re-add functional call backs.\r\n // (instance, shouldSubscribe)\r\n registerHubProxies(proxies, false);\r\n });\r\n\r\n proxies['dotNetifyHub'] = this.createHubProxy('dotNetifyHub');\r\n proxies['dotNetifyHub'].client = {};\r\n proxies['dotNetifyHub'].server = {\r\n dispose_VM: function(vmId) {\r\n return proxies['dotNetifyHub'].invoke.apply(proxies['dotNetifyHub'], $.merge([ 'Dispose_VM' ], $.makeArray(arguments)));\r\n },\r\n\r\n request_VM: function(vmId, vmArg) {\r\n return proxies['dotNetifyHub'].invoke.apply(proxies['dotNetifyHub'], $.merge([ 'Request_VM' ], $.makeArray(arguments)));\r\n },\r\n\r\n update_VM: function(vmId, vmData) {\r\n return proxies['dotNetifyHub'].invoke.apply(proxies['dotNetifyHub'], $.merge([ 'Update_VM' ], $.makeArray(arguments)));\r\n }\r\n };\r\n\r\n return proxies;\r\n };\r\n\r\n signalR.hub = $.hubConnection(dotnetifyHub.hubPath, { useDefaultPath: false });\r\n $.extend(signalR, signalR.hub.createHubProxies());\r\n })($, window);\r\n\r\n Object.defineProperty(dotnetifyHub, 'state', {\r\n get: function() {\r\n return $.connection.hub.state;\r\n },\r\n set: function(val) {\r\n $.connection.hub.state = val;\r\n }\r\n });\r\n\r\n Object.defineProperty(dotnetifyHub, 'client', {\r\n get: function() {\r\n return $.connection.dotNetifyHub.client;\r\n }\r\n });\r\n\r\n Object.defineProperty(dotnetifyHub, 'server', {\r\n get: function() {\r\n return $.connection.dotNetifyHub.server;\r\n }\r\n });\r\n\r\n Object.defineProperty(dotnetifyHub, 'isConnected', {\r\n get: function() {\r\n return $.connection.hub.state == $.signalR.connectionState.connected;\r\n }\r\n });\r\n\r\n dotnetifyHub = $.extend(dotnetifyHub, {\r\n hubPath: iHubPath || '/signalr',\r\n url: iServerUrl,\r\n\r\n _reconnectCount: 0,\r\n _stateChangedHandler: function(iNewState) {},\r\n\r\n start: function(iHubOptions) {\r\n if (dotnetifyHub.url) $.connection.hub.url = dotnetifyHub.url;\r\n\r\n let deferred;\r\n if (iHubOptions) deferred = $.connection.hub.start(iHubOptions);\r\n else deferred = $.connection.hub.start();\r\n deferred.fail(function(error) {\r\n if (error.source && error.source.message === 'Error parsing negotiate response.')\r\n console.warn('This client may be attempting to connect to an incompatible SignalR .NET Core server.');\r\n });\r\n return deferred;\r\n },\r\n\r\n disconnected: function(iHandler) {\r\n return $.connection.hub.disconnected(iHandler);\r\n },\r\n\r\n stateChanged: function(iHandler) {\r\n dotnetifyHub._stateChangedHandler = iHandler;\r\n return $.connection.hub.stateChanged(function(state) {\r\n if (state == 1) dotnetifyHub._reconnectCount = 0;\r\n\r\n let stateText = { 0: 'connecting', 1: 'connected', 2: 'reconnecting', 4: 'disconnected' };\r\n iHandler(stateText[state.newState]);\r\n });\r\n },\r\n\r\n reconnect: function(iStartHubFunc) {\r\n if (typeof iStartHubFunc === 'function') {\r\n // Only attempt reconnect if the specified retry hasn't been exceeded.\r\n if (!dotnetifyHub.reconnectRetry || dotnetifyHub._reconnectCount < dotnetifyHub.reconnectRetry) {\r\n // Determine reconnect delay from the specified configuration array.\r\n let delay =\r\n dotnetifyHub._reconnectCount < dotnetifyHub.reconnectDelay.length\r\n ? dotnetifyHub.reconnectDelay[dotnetifyHub._reconnectCount]\r\n : dotnetifyHub.reconnectDelay[dotnetifyHub.reconnectDelay.length - 1];\r\n\r\n dotnetifyHub._reconnectCount++;\r\n\r\n setTimeout(function() {\r\n dotnetifyHub._stateChangedHandler('reconnecting');\r\n iStartHubFunc();\r\n }, delay * 1000);\r\n }\r\n else dotnetifyHub._stateChangedHandler('terminated');\r\n }\r\n }\r\n });\r\n }\r\n\r\n // Setup SignalR server method handler.\r\n dotnetifyHub.client.response_VM = function(iVMId, iVMData) {\r\n // SignalR .NET Core is sending an array of arguments.\r\n if (Array.isArray(iVMId)) {\r\n iVMData = iVMId[1];\r\n iVMId = iVMId[0];\r\n }\r\n\r\n let handled = dotnetifyHub.responseEvent.emit(iVMId, iVMData);\r\n\r\n // If we get to this point, that means the server holds a view model instance\r\n // whose view no longer existed. So, tell the server to dispose the view model.\r\n if (!handled) dotnetifyHub.server.dispose_VM(iVMId);\r\n };\r\n\r\n // On disconnected, keep attempting to start the connection.\r\n dotnetifyHub.disconnected(function() {\r\n dotnetifyHub._startInfo = null;\r\n dotnetifyHub.reconnect(function() {\r\n dotnetifyHub.reconnectedEvent.emit();\r\n });\r\n });\r\n };\r\n\r\n return dotnetifyHub;\r\n }\r\n}\r\n\r\nexport default dotnetifyHubFactory.create();\r\n","/* \r\nCopyright 2017-2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport dotnetifyHub, { dotnetifyHubFactory } from './dotnetify-hub';\r\nimport localHub, { hasLocalVM } from './dotnetify-hub-local';\r\n\r\nexport class dotnetifyFactory {\r\n static create() {\r\n const dotnetify = {\r\n // SignalR hub options.\r\n hub: dotnetifyHub,\r\n hubOptions: { transport: [ 'webSockets', 'longPolling' ] },\r\n hubPath: null,\r\n\r\n // Debug mode.\r\n debug: false,\r\n debugFn: null,\r\n\r\n // Offline mode. (WIP)\r\n offline: false,\r\n isOffline: true,\r\n offlineTimeout: 5000,\r\n offlineCacheFn: null,\r\n\r\n // Internal variables.\r\n _vmAccessors: [],\r\n\r\n // Use this to get notified of connection state changed events.\r\n // (state, exception, hub) => void\r\n connectionStateHandler: null,\r\n\r\n // Use this intercept a view model prior to establishing connection,\r\n // with the option to provide any connect parameters.\r\n // ({vmId, options}) => {vmId, options, hub}\r\n connectHandler: null,\r\n\r\n // Support changing hub server URL after first init.\r\n get hubServerUrl() {\r\n return this.hub.url;\r\n },\r\n\r\n set hubServerUrl(url) {\r\n this.hub.url = url;\r\n if (this.debug) console.log('SignalR: connecting to ' + this.hubServerUrl);\r\n if (this.hub.isHubStarted) this.startHub(this.hub, true);\r\n },\r\n\r\n // Generic connect function for non-React app.\r\n connect(iVMId, iOptions) {\r\n dotnetify.react.connect(iVMId, null, iOptions);\r\n },\r\n\r\n // Creates a SignalR hub client.\r\n createHub(hubServerUrl, hubPath, hubLib) {\r\n return this.initHub(dotnetifyHubFactory.create(), hubPath, hubServerUrl, hubLib);\r\n },\r\n\r\n // Configures hub connection to SignalR hub server.\r\n initHub(hub, hubPath, hubServerUrl, hubLib) {\r\n hub = hub || this.hub;\r\n hubPath = hubPath || this.hubPath;\r\n hubServerUrl = hubServerUrl || this.hubServerUrl;\r\n hubLib = hubLib || this.hubLib;\r\n\r\n if (!hub.isHubStarted) {\r\n hub.init(hubPath, hubServerUrl, hubLib);\r\n\r\n // Use SignalR event to raise the connection state event.\r\n hub.stateChanged(state => this.handleConnectionStateChanged(state, null, hub));\r\n }\r\n return hub;\r\n },\r\n\r\n // Used by a view to select a hub, and provides the opportunity to override any connect info.\r\n selectHub(vmConnectArgs) {\r\n vmConnectArgs = vmConnectArgs || { options: {} };\r\n let override = (typeof this.connectHandler == 'function' && this.connectHandler(vmConnectArgs)) || {};\r\n if (!override.hub) {\r\n override.hub = hasLocalVM(vmConnectArgs.vmId) ? localHub : this.initHub();\r\n override.hub.debug = this.debug;\r\n }\r\n return Object.assign(vmConnectArgs, override);\r\n },\r\n\r\n // Starts hub connection to SignalR hub server.\r\n startHub(hub, forceRestart) {\r\n hub = hub || this.hub;\r\n\r\n const doneHandler = () => {};\r\n const failHandler = ex => this.handleConnectionStateChanged('error', ex, hub);\r\n hub.startHub(this.hubOptions, doneHandler, failHandler, forceRestart);\r\n },\r\n\r\n // Used by dotnetify-react and -vue to expose their view model accessors.\r\n addVMAccessor(vmAccessor) {\r\n !this._vmAccessors.includes(vmAccessor) && this._vmAccessors.push(vmAccessor);\r\n },\r\n\r\n checkServerSideException(iVMId, iVMData, iExceptionHandler) {\r\n const vmData = JSON.parse(iVMData);\r\n if (vmData && vmData.hasOwnProperty('ExceptionType') && vmData.hasOwnProperty('Message')) {\r\n const exception = { name: vmData.ExceptionType, message: vmData.Message };\r\n\r\n if (typeof iExceptionHandler === 'function') {\r\n return iExceptionHandler(exception);\r\n }\r\n else {\r\n console.error('[' + iVMId + '] ' + exception.name + ': ' + exception.message);\r\n throw exception;\r\n }\r\n }\r\n },\r\n\r\n // Get all view models.\r\n getViewModels() {\r\n return this._vmAccessors\r\n .reduce((prev, current) => [ ...prev, ...current() ], [])\r\n .filter((val, idx, self) => self.indexOf(val) === idx); // returns distinct items.\r\n },\r\n\r\n handleConnectionStateChanged(iState, iException, iHub) {\r\n if (this.debug) console.log('SignalR: ' + (iException ? iException.message : iState));\r\n if (typeof this.connectionStateHandler === 'function') this.connectionStateHandler(iState, iException, iHub);\r\n else if (iException) console.error(iException);\r\n }\r\n };\r\n\r\n return dotnetify;\r\n }\r\n}\r\n\r\nexport default dotnetifyFactory.create();\r\n","import dotnetify from './dotnetify-vue';\r\nimport './dotnetify-vue.router';\r\nimport Scope from './Scope';\r\nimport './directives';\r\n\r\ndotnetify.vue.Scope = Scope;\r\nmodule.exports = Object.assign(dotnetify, { Scope });\r\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://dotnetify/webpack/universalModuleDefinition","webpack://dotnetify/webpack/bootstrap","webpack://dotnetify/(webpack)/buildin/global.js","webpack://dotnetify/./src/dotnetify/libs/utils.js","webpack://dotnetify/./src/dotnetify/libs/jquery-shim.js","webpack://dotnetify/./src/dotnetify/vue/dotnetify-vue.js","webpack://dotnetify/external {\"commonjs\":\"vue\",\"commonjs2\":\"vue\",\"amd\":\"vue\",\"root\":\"Vue\"}","webpack://dotnetify/./src/dotnetify/vue/directives.js","webpack://dotnetify/./src/dotnetify/vue/Scope.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-vm-router.js","webpack://dotnetify/./src/dotnetify/vue/dotnetify-vue.vm-router.js","webpack://dotnetify/./src/dotnetify/libs/path.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-router.js","webpack://dotnetify/./src/dotnetify/vue/dotnetify-vue.router.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-vm.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-hub-webapi.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-hub-local.js","webpack://dotnetify/external {\"commonjs\":\"@aspnet/signalr\",\"commonjs2\":\"@aspnet/signalr\",\"amd\":\"@aspnet/signalr\",\"root\":\"signalR\"}","webpack://dotnetify/./node_modules/jquery-deferred/lib/jquery-core.js","webpack://dotnetify/./node_modules/jquery-deferred/lib/jquery-callbacks.js","webpack://dotnetify/./node_modules/jquery-deferred/lib/jquery-deferred.js","webpack://dotnetify/./node_modules/jquery-deferred/index.js","webpack://dotnetify/(webpack)/buildin/module.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-hub.js","webpack://dotnetify/./src/dotnetify/core/dotnetify.js","webpack://dotnetify/./src/dotnetify/vue/index.js"],"names":["window","global","utils","iStr","indexOf","length","substr","iStr1","iStr2","toLowerCase","iValue","slice","iEvent","Event","dispatchEvent","event","document","createEvent","initEvent","iArray","iFilter","Array","isArray","filter","createEventEmitter","subscribers","emit","args","handled","forEach","subscriber","subscribe","includes","push","x","fetch","iMethod","iUrl","iData","iOptions","Promise","resolve","reject","request","XMLHttpRequest","open","onload","status","response","responseText","onerror","send","jQueryDeferred","require","jQueryShim","extend","selector","on","iHandler","addEventListener","bind","unbind","removeEventListener","events","handlers","idx","splice","triggerHandler","iArgs","type","arg","handler","apply","load","querySelector","innerHTML","call","abort","reason","support","cors","trim","inArray","iItem","makeArray","merge","iArray1","iArray2","prototype","isEmptyObject","iObj","Object","keys","ajax","onreadystatechange","readyState","_hasError","success","JSON","parse","error","url","setRequestHeader","contentType","data","getScript","iSuccess","done","promise","Deferred","head","getElementsByTagName","script","createElement","src","removeChild","appendChild","jQuery","exports","module","dotnetify","_dotnetify","vue","version","viewModels","plugins","controller","_hubs","init","iHub","self","hubInitialized","some","hub","start","isHubStarted","vmId","$hub","$requested","startHub","responseEvent","iVMId","iVMData","_responseVM","connectedEvent","$request","reconnectedEvent","connect","iVue","arguments","Error","hasOwnProperty","console","$destroy","setTimeout","component","props","$props","state","vm","$useState","$data","setState","value","key","$set","connectInfo","selectHub","options","dotnetifyVM","useState","watch","_addWatchers","iComponentOrName","obj","created","destroyed","name","getViewModels","map","iWatchlist","iVM","callback","newValue","$serverUpdate","$dispatch","prop","$watch","checkServerSideException","$exceptionHandler","$update","addVMAccessor","Vue","directive","el","binding","vnode","match","exec","expression","propName","methodName","context","route","href","$route","e","preventDefault","$handleRoute","componentUpdated","String","tag","inject","scoped","default","provide","_this","getScope","render","$slots","methods","scope","dotnetifyVMRouter","router","routes","debug","$dotnetify","iPath","State","RoutingState","assign","Active","iArg","path","currentTarget","pathname","pushState","hasRoutingState","Root","_absRoot","absRoot","VMRoot","root","$vmId","templates","Templates","$init","initRoot","urlPattern","template","UrlPattern","Id","mapUrl","toUrl","log","mapTo","urlPath","param","iParams","replace","routeTo","activeUrl","routeUrl","raiseRoutedEvent","iRoute","equal","Path","iTargetSelector","iViewUrl","iJsModuleUrl","iCallbackFn","unmountView","$","getScripts","split","i","when","callbackFn","iHtmlElement","iVmArg","mountViewFunc","target","firstChild","iTarget","iJSModuleUrl","Target","ViewUrl","JSModuleUrl","iTemplate","force","TemplateId","RedirectRoot","redirectRoot","charAt","redirectRootPath","urlRedirect","absRootPath","Url","$template","pathToRoute","iDisableEvent","isRedirect","vmOther","vmArg","$router","VMArg","onRouteEnter","getElementById","redirect","loadView","dispatchActiveRoutingState","onRouteExit","redirectUrlPath","grep","startsWith","routeElem","elem","dotnetifyVueVMRouter","Props","iDotNetifyRouter","componentProps","vmRoot","overrideUrl","endsWith","loadHtmlView","HTMLElement","loadHtmlElementView","loadVueView","iComponent","iProps","createViewFunc","vueClass","vueComponentType","vueComponent","propsData","$mount","mountedComponents","unmount","defined","core","rescue","fn","history","initial","title","supported","dispatch","fallback","location","hash","popState","initialPop","popped","URL","listen","onpopstate","parameterize","params","possible_routes","j","compare","result","undefined","partition","search","join","passed_route","previous_route","matched_route","current","previous","do_exit","run","documentMode","onhashchange","setInterval","action","do_enter","to","enter","fns","concat","exit","parts","re","text","halt_execution","dotnetifyRouter","iFn","iUrlPath","matched","iState","iTitle","initRouting","vmData","$inject","handleRoute","$routeTo","routeToRoute","iDotNetify","$component","$options","$vmArg","$headers","$loaded","$itemKey","getState","$getPlugins","plugin","isConnected","disposeVM","ex","handleConnectionStateChanged","updateVM","debugFn","listName","item","$updateList","id","iVMUpdate","$addList","$removeList","itemKey","$setItemKey","requestVM","$preProcess","$onLoad","$onUpdate","$ready","iItemKey","iListName","iNewItem","items","dotNetifyHubWebApi","iBaseUrl","iOnRequest","mode","connectionFailedEvent","_vmArgs","baseUrl","onRequest","iVMArgs","vmArgs","vmArgQuery","stringify","headers","then","catch","payload","createWebApiHub","create","normalize","hasLocalVM","onConnect","dotNetifyHubLocal","$pushUpdate","update","onDispatch","onDestroy","signalRNetCore","dotnetifyHubFactory","dotnetifyHub","reconnectDelay","reconnectRetry","_startInfo","_init","server","request_VM","update_VM","dispose_VM","hubOptions","doneHandler","failHandler","forceRestart","_doneHandler","_failHandler","failHander","fail","err","iHubPath","iServerUrl","signalR","HubConnection","defineProperty","get","_connection","connection","connectionState","hubPath","_reconnectCount","_startDoneHandler","_startFailHandler","_disconnectedHandler","_stateChangedHandler","iNewState","_onDisconnected","_changeState","stateText","_startConnection","iHubOptions","iTransportArray","transport","shift","HubConnectionBuilder","withUrl","build","client","response_VM","onclose","transportOptions","webSockets","serverSentEvents","longPolling","disconnected","stateChanged","reconnect","iStartHubFunc","delay","invoke","makeProxyCallback","registerHubProxies","instance","shouldSubscribe","memberKey","memberValue","subscriptionMethod","hubName","off","isFunction","hubConnection","createHubProxies","proxies","starting","_registerSubscribedHubs","createHubProxy","useDefaultPath","set","val","dotNetifyHub","connected","deferred","source","message","warn","newState","dotnetifyFactory","offline","isOffline","offlineTimeout","offlineCacheFn","_vmAccessors","connectionStateHandler","connectHandler","hubServerUrl","react","createHub","hubLib","initHub","onRequestHandler","vmConnectArgs","override","localHub","webApi","webApiHub","vmAccessor","iExceptionHandler","exception","ExceptionType","Message","reduce","prev","iException","Scope"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC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;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,QAAQ,YAAY;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;ACxJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,oCAAoC;AAC9C;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;AC3MA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA,MAAM;AACN,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,8CAA8C;AAC9C,KAAK;AACL;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,IAAI;;AAEJ;;AAEA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA,UAAU,YAAY;AACtB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;;;;;;;ACjKD,yC;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;;;;;;;;;;;;;;qjBCrBA;;;;;;;;;;;;;;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I,OAAO,KAAKgK,sBAAZ,KAAuC,UAA3C,EAAuD,KAAKA,sBAAL,CAA4BhK,MAA5B,EAAoCoL,UAApC,EAAgD1b,IAAhD,EAAvD,KACK,IAAI0b,UAAJ,EAAgBna,QAAQpD,KAAR,CAAcud,UAAd;AACtB;AA1He,OAAlB;;AA6HA,aAAOnc,SAAP;AACD;;;;;;kBAGYya,iBAAiB/F,MAAjB,E;;;;;;;;;ACtJf;;;;AACA;;AACA;;;;AACA;;;;AAEA1U,uBAAUE,GAAV,CAAckc,KAAd,GAAsBA,eAAtB;AACArc,OAAOD,OAAP,GAAiB3B,OAAO2I,MAAP,CAAc9G,sBAAd,EAAyB,EAAEoc,sBAAF,EAAzB,CAAjB,C","file":"dotnetify-vue.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"vue\"), require(\"@aspnet/signalr\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"vue\", \"@aspnet/signalr\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"dotnetify\"] = factory(require(\"vue\"), require(\"@aspnet/signalr\"));\n\telse\n\t\troot[\"dotnetify\"] = factory(root[\"Vue\"], root[\"signalR\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__4__, __WEBPACK_EXTERNAL_MODULE__15__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 23);\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","/* \r\nCopyright 2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nconst window = window || global || {};\r\n\r\nclass utils {\r\n // Trim slashes from start and end of string.\r\n trim(iStr) {\r\n if (typeof iStr !== 'string') return '';\r\n\r\n while (iStr.indexOf('/', iStr.length - 1) >= 0) iStr = iStr.substr(0, iStr.length - 1);\r\n while (iStr.indexOf('/') == 0) iStr = iStr.substr(1, iStr.length - 1);\r\n return iStr;\r\n }\r\n\r\n // Match two strings case-insensitive.\r\n equal(iStr1, iStr2) {\r\n return iStr1 != null && iStr2 != null && iStr1.toLowerCase() == iStr2.toLowerCase();\r\n }\r\n\r\n // Whether the string starts or ends with a value.\r\n startsWith(iStr, iValue) {\r\n return iStr.toLowerCase().slice(0, iValue.length) == iValue.toLowerCase();\r\n }\r\n\r\n endsWith(iStr, iValue) {\r\n return iValue == '' || iStr.toLowerCase().slice(-iValue.length) == iValue.toLowerCase();\r\n }\r\n\r\n // Dispatch event with IE polyfill.\r\n dispatchEvent(iEvent) {\r\n if (typeof Event === 'function') window.dispatchEvent(new Event(iEvent));\r\n else {\r\n var event = document.createEvent('CustomEvent');\r\n event.initEvent(iEvent, true, true);\r\n window.dispatchEvent(event);\r\n }\r\n }\r\n\r\n grep(iArray, iFilter) {\r\n return Array.isArray(iArray) ? iArray.filter(iFilter) : [];\r\n }\r\n}\r\n\r\nexport const createEventEmitter = _ => {\r\n let subscribers = [];\r\n return {\r\n emit(...args) {\r\n let handled = false;\r\n subscribers.forEach(subscriber => {\r\n handled = subscriber(...args) || handled;\r\n });\r\n return handled;\r\n },\r\n\r\n subscribe(subscriber) {\r\n !subscribers.includes(subscriber) && subscribers.push(subscriber);\r\n return () => (subscribers = subscribers.filter(x => x !== subscriber));\r\n }\r\n };\r\n};\r\n\r\nexport const fetch = (iMethod, iUrl, iData, iOptions) => {\r\n return new Promise((resolve, reject) => {\r\n let request = new window.XMLHttpRequest();\r\n request.open(iMethod, iUrl, true);\r\n if (typeof iOptions == 'function') iOptions(request);\r\n\r\n request.onload = function() {\r\n if (request.status >= 200 && request.status < 400) {\r\n var response = request.responseText;\r\n resolve(response);\r\n }\r\n else reject(request);\r\n };\r\n request.onerror = function() {\r\n reject(request);\r\n };\r\n request.send(iData);\r\n });\r\n};\r\n\r\nexport default new utils();\r\n","/* \r\nCopyright 2017 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\n\r\nconst window = window || global || {};\r\n\r\nconst jQueryDeferred = require('jquery-deferred');\r\nconst jQueryShim = jQueryDeferred.extend(\r\n function(selector) {\r\n if (selector === window || selector.document)\r\n return {\r\n 0: selector,\r\n on: function(iEvent, iHandler) {\r\n window.addEventListener(iEvent, iHandler);\r\n },\r\n bind: function(iEvent, iHandler) {\r\n window.addEventListener(iEvent, iHandler, false);\r\n },\r\n unbind: function(iEvent, iHandler) {\r\n window.removeEventListener(iEvent, iHandler, false);\r\n }\r\n };\r\n\r\n if (typeof selector !== 'string') selector.events = selector.events || {};\r\n\r\n return {\r\n 0: selector,\r\n\r\n bind: function(iEvent, iHandler) {\r\n var event = selector.events[iEvent] || [];\r\n event.push(iHandler);\r\n selector.events[iEvent] = event;\r\n },\r\n\r\n unbind: function(iEvent, iHandler) {\r\n var handlers = selector.events[iEvent] || [];\r\n if (iHandler) {\r\n var idx = handlers.indexOf(iHandler);\r\n if (idx !== -1) handlers.splice(idx, 1);\r\n }\r\n else handlers = [];\r\n selector.events[iEvent] = handlers;\r\n },\r\n\r\n triggerHandler: function(iEvent, iArgs) {\r\n var handlers = selector.events[iEvent] || [];\r\n var args = [ { type: iEvent } ];\r\n if (Array.isArray(iArgs))\r\n iArgs.forEach(function(arg) {\r\n args.push(arg);\r\n });\r\n else if (iArgs) args.push(iArgs);\r\n handlers.forEach(function(handler) {\r\n handler.apply(this, args);\r\n });\r\n },\r\n\r\n load: function(iUrl, iArgs, iHandler) {\r\n var request = new window.XMLHttpRequest();\r\n request.open('GET', iUrl, true);\r\n request.onload = function() {\r\n if (request.status >= 200 && request.status < 400) {\r\n var response = request.responseText;\r\n document.querySelector(selector).innerHTML = response;\r\n iHandler.call(document.querySelector(selector));\r\n }\r\n };\r\n request.send();\r\n return {\r\n abort: function(reason) {\r\n return request.abort(reason);\r\n }\r\n };\r\n }\r\n };\r\n },\r\n jQueryDeferred,\r\n {\r\n support: { cors: true },\r\n\r\n trim: function(iStr) {\r\n return typeof iStr === 'string' ? iStr.trim() : iStr;\r\n },\r\n\r\n inArray: function(iArray, iItem) {\r\n return iArray.indexOf(iItem) !== -1;\r\n },\r\n\r\n makeArray: function makeArray(iArray) {\r\n return [].slice.call(iArray, 0);\r\n },\r\n\r\n merge: function(iArray1, iArray2) {\r\n Array.prototype.push.apply(iArray1, iArray2);\r\n return iArray1;\r\n },\r\n\r\n isEmptyObject: function(iObj) {\r\n return !iObj || Object.keys(iObj).length === 0;\r\n },\r\n\r\n ajax: function(iOptions) {\r\n var request = new window.XMLHttpRequest();\r\n request.onreadystatechange = function() {\r\n if (request.readyState !== 4) return;\r\n if (request.status === 200 && !request._hasError) {\r\n try {\r\n iOptions.success && iOptions.success(JSON.parse(request.responseText));\r\n } catch (error) {\r\n iOptions.success && iOptions.success(request.responseText);\r\n }\r\n }\r\n else iOptions.error && iOptions.error(request);\r\n };\r\n request.open(iOptions.type, iOptions.url);\r\n request.setRequestHeader('content-type', iOptions.contentType);\r\n request.send(iOptions.data.data && 'data=' + iOptions.data.data);\r\n return {\r\n abort: function(reason) {\r\n return request.abort(reason);\r\n }\r\n };\r\n },\r\n\r\n getScript: function(iUrl, iSuccess) {\r\n var done = false;\r\n var promise = jQueryDeferred.Deferred();\r\n var head = document.getElementsByTagName('head')[0];\r\n var script = document.createElement('script');\r\n script.src = iUrl;\r\n script.onload = script.onreadystatechange = function() {\r\n if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) {\r\n done = true;\r\n script.onload = script.onreadystatechange = null;\r\n head.removeChild(script);\r\n if (typeof iSuccess === 'function') iSuccess();\r\n promise.resolve();\r\n }\r\n };\r\n head.appendChild(script);\r\n return promise;\r\n }\r\n }\r\n);\r\n\r\nif (typeof window !== 'undefined') window.jQuery = window.jQuery || jQueryShim;\r\n\r\nif (typeof exports === 'object' && typeof module === 'object') module.exports = jQueryShim;\r\n","/* \r\nCopyright 2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport _dotnetify from '../core/dotnetify';\r\nimport dotnetifyVM from '../core/dotnetify-vm';\r\n\r\nconst window = window || global || {};\r\nlet dotnetify = window.dotnetify || _dotnetify;\r\n\r\ndotnetify.vue = {\r\n version: '2.0.0',\r\n viewModels: {},\r\n plugins: {},\r\n controller: dotnetify,\r\n\r\n // Internal variables.\r\n _hubs: [],\r\n\r\n // Initializes connection to SignalR server hub.\r\n init: function(iHub) {\r\n const self = dotnetify.vue;\r\n const hubInitialized = self._hubs.some(hub => hub === iHub);\r\n\r\n const start = function() {\r\n if (!iHub.isHubStarted)\r\n Object.keys(self.viewModels)\r\n .filter(vmId => self.viewModels[vmId].$hub === iHub)\r\n .forEach(vmId => (self.viewModels[vmId].$requested = false));\r\n\r\n dotnetify.startHub(iHub);\r\n };\r\n\r\n if (!hubInitialized) {\r\n iHub.responseEvent.subscribe((iVMId, iVMData) => self._responseVM(iVMId, iVMData));\r\n iHub.connectedEvent.subscribe(() =>\r\n Object.keys(self.viewModels)\r\n .filter(vmId => self.viewModels[vmId].$hub === iHub && !self.viewModels[vmId].$requested)\r\n .forEach(vmId => self.viewModels[vmId].$request())\r\n );\r\n iHub.reconnectedEvent.subscribe(start);\r\n self._hubs.push(iHub);\r\n }\r\n\r\n start();\r\n },\r\n\r\n // Connects to a server view model.\r\n connect: function(iVMId, iVue, iOptions) {\r\n if (arguments.length < 2) throw new Error('[dotNetify] Missing arguments. Usage: connect(vmId, component) ');\r\n\r\n const self = dotnetify.vue;\r\n if (self.viewModels.hasOwnProperty(iVMId)) {\r\n console.error(\r\n `Component is attempting to connect to an already active '${iVMId}'. ` +\r\n ` If it's from a dismounted component, you must call vm.$destroy in destroyed().`\r\n );\r\n self.viewModels[iVMId].$destroy();\r\n return setTimeout(() => self.connect(iVMId, iVue, iOptions));\r\n }\r\n\r\n const component = {\r\n get props() {\r\n return iVue.$props;\r\n },\r\n get state() {\r\n const vm = self.viewModels[iVMId];\r\n return vm && vm.$useState ? { ...iVue.$data, ...iVue.state } : iVue.$data;\r\n },\r\n setState(state) {\r\n Object.keys(state).forEach(key => {\r\n const value = state[key];\r\n\r\n // If 'useState' option is enabled, store server state in the Vue instance's 'state' property.\r\n const vm = self.viewModels[iVMId];\r\n if (vm && vm.$useState) {\r\n if (iVue.state.hasOwnProperty(key)) iVue.state[key] = value;\r\n else if (value) iVue.$set(iVue.state, key, value);\r\n }\r\n else {\r\n if (iVue.hasOwnProperty(key)) iVue[key] = value;\r\n else if (value) console.error(`'${key}' is received, but the Vue instance doesn't declare the property.`);\r\n }\r\n });\r\n }\r\n };\r\n\r\n const connectInfo = dotnetify.selectHub({ vmId: iVMId, options: iOptions, hub: null });\r\n self.viewModels[iVMId] = new dotnetifyVM(connectInfo.vmId, component, connectInfo.options, self, connectInfo.hub);\r\n if (connectInfo.hub) self.init(connectInfo.hub);\r\n\r\n if (iOptions) {\r\n const vm = self.viewModels[iVMId];\r\n\r\n // If 'useState' is true, server state will be placed in the Vue component's 'state' data property.\r\n // Otherwise, they will be placed in the root data property.\r\n if (iOptions.useState) {\r\n if (iVue.hasOwnProperty('state')) vm.$useState = true;\r\n else console.error(`Option 'useState' requires the 'state' data property on the Vue instance.`);\r\n }\r\n\r\n // 'watch' array specifies properties to dispatch to server when the values change.\r\n if (Array.isArray(iOptions.watch)) self._addWatchers(iOptions.watch, vm, iVue);\r\n }\r\n\r\n return self.viewModels[iVMId];\r\n },\r\n\r\n // Creates a Vue component with pre-configured connection to a server view model.\r\n component: function(iComponentOrName, iVMId, iOptions) {\r\n const obj = {\r\n created() {\r\n this.vm = dotnetify.vue.connect(iVMId, this, { ...iOptions, useState: true });\r\n },\r\n destroyed() {\r\n this.vm.$destroy();\r\n },\r\n data() {\r\n return { state: {} };\r\n }\r\n };\r\n\r\n if (typeof iComponentOrName == 'string') return { name: iComponentOrName, ...obj };\r\n else return { ...obj, ...iComponentOrName };\r\n },\r\n\r\n // Gets all view models.\r\n getViewModels: function() {\r\n const self = dotnetify.vue;\r\n return Object.keys(self.viewModels).map(vmId => self.viewModels[vmId]);\r\n },\r\n\r\n _addWatchers(iWatchlist, iVM, iVue) {\r\n const callback = prop =>\r\n function(newValue) {\r\n iVM.$serverUpdate !== false && iVM.$dispatch({ [prop]: newValue });\r\n }.bind(iVM);\r\n\r\n iWatchlist.forEach(prop => iVue.$watch(iVM.$useState ? `state.${prop}` : prop, callback(prop)));\r\n },\r\n\r\n _responseVM: function(iVMId, iVMData) {\r\n const self = dotnetify.vue;\r\n\r\n if (self.viewModels.hasOwnProperty(iVMId)) {\r\n const vm = self.viewModels[iVMId];\r\n dotnetify.checkServerSideException(iVMId, iVMData, vm.$exceptionHandler);\r\n\r\n // Disable server update while updating Vue so the change event won't cause rebound.\r\n vm.$serverUpdate = false;\r\n vm.$update(iVMData);\r\n setTimeout(() => (vm.$serverUpdate = true));\r\n return true;\r\n }\r\n return false;\r\n }\r\n};\r\n\r\ndotnetify.addVMAccessor(dotnetify.vue.getViewModels);\r\n\r\nexport default dotnetify;\r\n","module.exports = __WEBPACK_EXTERNAL_MODULE__4__;","/* \r\nCopyright 2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport Vue from 'vue';\r\n\r\n// Call a method when a property value changes.\r\nVue.directive('vmOn', {\r\n bind: function(el, binding, vnode) {\r\n // Parse the value, which should be in object literal { property: fnName }.\r\n const match = /{(.*):(.*)}/.exec(binding.expression);\r\n if (match != null) {\r\n const propName = match[1].trim();\r\n const methodName = match[2].trim();\r\n const vue = vnode.context;\r\n\r\n if (!vue.hasOwnProperty(propName)) throw new Error(`v-vmOn property '${propName}' is not defined`);\r\n\r\n if (!vue.hasOwnProperty(methodName) && typeof vue[methodName] == 'function')\r\n throw new Error(`v-vmOn method '${propName}' is not defined or not a function`);\r\n\r\n vue.$watch(propName, () => vue[methodName](el));\r\n }\r\n }\r\n});\r\n\r\n// Route link directive for anchor tags.\r\nVue.directive('vmRoute', {\r\n bind: function(el, binding, vnode) {\r\n const vue = vnode.context;\r\n const route = binding.value;\r\n el.href = route && vue.vm ? vue.vm.$route(route) : '';\r\n el.addEventListener('click', function(e) {\r\n e.preventDefault();\r\n vue.vm.$handleRoute(e);\r\n });\r\n },\r\n componentUpdated: function(el, binding, vnode) {\r\n const vue = vnode.context;\r\n const route = binding.value;\r\n if (route && vue.vm) el.href = vue.vm.$route(route);\r\n }\r\n});\r\n","/* \r\nCopyright 2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport dotnetify from './dotnetify-vue';\r\n\r\nexport default {\r\n name: 'Scope',\r\n props: {\r\n vm: String,\r\n tag: String\r\n },\r\n inject: { scoped: { name: 'scoped', default: null } },\r\n provide: function() {\r\n const _this = this;\r\n return {\r\n scoped: vmId => _this.getScope(vmId),\r\n connect: (vmId, component, options) => {\r\n vmId = _this.getScope(vmId);\r\n return dotnetify.vue.connect(vmId, component, options);\r\n }\r\n };\r\n },\r\n render: function(createElement) {\r\n return createElement(this.tag || 'div', null, this.$slots.default);\r\n },\r\n methods: {\r\n getScope: function(vmId) {\r\n let scope = this.scoped ? this.scoped(this.vm) : this.vm;\r\n return scope ? scope + '.' + vmId : vmId;\r\n }\r\n }\r\n};\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport utils from '../libs/utils';\r\n\r\nexport default class dotnetifyVMRouter {\r\n routes = [];\r\n\r\n get RoutingState() {\r\n throw new Error('Not implemented');\r\n }\r\n get VMRoot() {\r\n throw new Error('Not implemented');\r\n }\r\n get VMArg() {\r\n throw new Error('Not implemented');\r\n }\r\n\r\n constructor(vm, router) {\r\n this.vm = vm;\r\n this.router = router;\r\n this.debug = vm.$dotnetify.controller.debug;\r\n }\r\n\r\n // Dispatch the active routing state to the server.\r\n dispatchActiveRoutingState(iPath) {\r\n this.vm.$dispatch({ 'RoutingState.Active': iPath });\r\n let { RoutingState } = this.vm.State();\r\n RoutingState = Object.assign(RoutingState || {}, { Active: iPath });\r\n this.vm.State({ RoutingState });\r\n }\r\n\r\n // Handles click event from anchor tags. Argument can be event object or path string.\r\n handleRoute(iArg) {\r\n let path = null;\r\n if (typeof iArg === 'object') {\r\n iArg.preventDefault();\r\n path = iArg.currentTarget.pathname;\r\n }\r\n else if (typeof iArg === 'string') path = iArg;\r\n\r\n if (path == null || path == '') throw new Error('$handleRoute requires path argument or event with pathname.');\r\n setTimeout(() => this.router.pushState({}, '', path));\r\n }\r\n\r\n // Build the absolute root path from the \"vmRoot\" property on React component.\r\n initRoot() {\r\n if (!this.hasRoutingState || this.RoutingState === null || this.RoutingState.Root === null) return;\r\n\r\n if (this._absRoot != this.RoutingState.Root) {\r\n var absRoot = utils.trim(this.VMRoot);\r\n if (absRoot != '') absRoot = '/' + absRoot;\r\n var root = utils.trim(this.RoutingState.Root);\r\n this._absRoot = root != '' ? absRoot + '/' + root : absRoot;\r\n this.RoutingState.Root = this._absRoot;\r\n }\r\n }\r\n\r\n // Initialize routing templates if the view model implements IRoutable.\r\n initRouting() {\r\n const vm = this.vm;\r\n if (!this.hasRoutingState) return;\r\n\r\n if (this.RoutingState === null) {\r\n console.error(\"router> the RoutingState prop of '\" + vm.$vmId + \"' was not initialized.\");\r\n return;\r\n }\r\n\r\n var templates = this.RoutingState.Templates;\r\n if (templates == null || templates.length == 0) return;\r\n\r\n // Initialize the router.\r\n if (!this.router.$init) {\r\n this.router.init();\r\n this.router.$init = true;\r\n }\r\n\r\n // Build the absolute root path.\r\n this.initRoot();\r\n\r\n templates.forEach(template => {\r\n // If url pattern isn't given, consider Id as the pattern.\r\n var urlPattern = template.UrlPattern != null ? template.UrlPattern : template.Id;\r\n urlPattern = urlPattern != '' ? urlPattern : '/';\r\n var mapUrl = this.toUrl(urlPattern);\r\n\r\n if (this.debug) console.log('router> map ' + mapUrl + ' to template id=' + template.Id);\r\n\r\n this.router.mapTo(mapUrl, iParams => {\r\n this.router.urlPath = '';\r\n\r\n // Construct the path from the template pattern and the params passed by PathJS.\r\n var path = urlPattern;\r\n for (var param in iParams) path = path.replace(':' + param, iParams[param]);\r\n path = path.replace(/\\(\\/:([^)]+)\\)/g, '').replace(/\\(|\\)/g, '');\r\n\r\n this.routeTo(path, template);\r\n });\r\n });\r\n\r\n // Route initial URL.\r\n var activeUrl = this.toUrl(this.RoutingState.Active);\r\n if (this.router.urlPath == '') this.router.urlPath = activeUrl;\r\n if (!this.routeUrl())\r\n // If routing ends incomplete, raise routed event anyway.\r\n this.raiseRoutedEvent(true);\r\n }\r\n\r\n // Whether a route is active.\r\n isActive(iRoute) {\r\n if (iRoute != null && iRoute.hasOwnProperty('Path')) {\r\n return utils.equal(iRoute.Path, this.RoutingState.Active);\r\n }\r\n return false;\r\n }\r\n\r\n // Loads an HTML view.\r\n loadHtmlView(iTargetSelector, iViewUrl, iJsModuleUrl, iCallbackFn) {\r\n const vm = this.vm;\r\n this.unmountView(iTargetSelector);\r\n\r\n // Load the HTML view.\r\n $(iTargetSelector).load(iViewUrl, null, function() {\r\n if (iJsModuleUrl != null) {\r\n const getScripts = iJsModuleUrl.split(',').map(i => $.getScript(i));\r\n $.when.apply($, getScripts).done(() => typeof callbackFn === 'function' && iCallbackFn.call(vm));\r\n }\r\n else if (typeof callbackFn === 'function') iCallbackFn.call(vm);\r\n });\r\n }\r\n\r\n loadHtmlElementView(iTargetSelector, iHtmlElement, iJsModuleUrl, iVmArg, iCallbackFn) {\r\n const vm = this.vm;\r\n const mountViewFunc = () => {\r\n this.unmountView(iTargetSelector);\r\n\r\n const target = document.querySelector(iTargetSelector);\r\n while (target.firstChild) target.removeChild(target.firstChild);\r\n target.appendChild(iHtmlElement);\r\n\r\n if (typeof callbackFn === 'function') iCallbackFn.call(vm);\r\n };\r\n\r\n if (iJsModuleUrl == null) mountViewFunc();\r\n else {\r\n // Load all javascripts first. Multiple files can be specified with comma delimiter.\r\n const getScripts = iJsModuleUrl.split(',').map(i => $.getScript(i));\r\n $.when.apply($, getScripts).done(mountViewFunc);\r\n }\r\n }\r\n\r\n // Loads a view into a target element.\r\n loadView(iTargetSelector, iViewUrl, iJsModuleUrl, iVmArg, iCallbackFn) {\r\n throw new Error('Not implemented');\r\n }\r\n\r\n // Routes to a path.\r\n manualRouteTo(iPath, iTarget, iViewUrl, iJSModuleUrl) {\r\n const vm = this.vm;\r\n var template = { Id: 'manual', Target: iTarget, ViewUrl: iViewUrl, JSModuleUrl: iJSModuleUrl };\r\n this.routeTo(iPath, template, true);\r\n }\r\n\r\n // Handles route enter event.\r\n onRouteEnter(iPath, iTemplate) {\r\n return true;\r\n }\r\n\r\n // Raise event indicating the routing process has ended.\r\n raiseRoutedEvent(force) {\r\n const vm = this.vm;\r\n if (this.router.urlPath == '' || force == true) {\r\n if (this.debug) console.log('router> routed');\r\n utils.dispatchEvent('dotnetify.routed');\r\n }\r\n }\r\n\r\n // Returns the URL for an anchor tag.\r\n route(iRoute, iTarget) {\r\n // No route to process. Return silently.\r\n if (iRoute == null) return;\r\n\r\n if (!iRoute.hasOwnProperty('Path') && !iRoute.hasOwnProperty('TemplateId')) throw new Error('Not a valid route');\r\n\r\n // Build the absolute root path.\r\n this.initRoot();\r\n\r\n // If the route path is not defined, use the URL pattern from the associated template.\r\n // This is so that we don't send the same data twice if both are equal.\r\n let path = iRoute.Path;\r\n let template = null;\r\n if (this.hasRoutingState && this.RoutingState.Templates != null && iRoute.TemplateId != null) {\r\n let match = this.RoutingState.Templates.filter(function(iTemplate) {\r\n return iTemplate.Id == iRoute.TemplateId;\r\n });\r\n if (match.length > 0) {\r\n template = match[0];\r\n\r\n if (typeof iTarget === 'string') template.Target = iTarget;\r\n\r\n if (path == null) {\r\n path = template.UrlPattern != null ? template.UrlPattern : template.Id;\r\n iRoute.Path = path;\r\n }\r\n }\r\n else if (iRoute.RedirectRoot == null) throw new Error(`vmRoute cannot find route template ${iRoute.TemplateId}`);\r\n }\r\n\r\n // If the path has a redirect root, the path doesn't belong to the current root and needs to be\r\n // redirected to a different one. Set the absolute path to the HREF attribute, and prevent the\r\n // default behavior of the anchor click event and instead do push to HTML5 history state, which\r\n // would attempt to resolve the path first before resorting to hard browser redirect.\r\n if (iRoute.RedirectRoot != null) {\r\n // Combine the redirect root with the view model's root.\r\n let redirectRoot = iRoute.RedirectRoot;\r\n if (redirectRoot.charAt(0) == '/') redirectRoot = redirectRoot.substr(0, redirectRoot.length - 1);\r\n let redirectRootPath = iRoute.RedirectRoot.split('/');\r\n\r\n let urlRedirect = '';\r\n let absRoot = this.VMRoot;\r\n if (absRoot != null) {\r\n let absRootPath = absRoot.split('/');\r\n for (let i = 0; i < absRootPath.length; i++) {\r\n if (absRootPath[i] != '' && absRootPath[i] == redirectRootPath[0]) break;\r\n urlRedirect += absRootPath[i] + '/';\r\n }\r\n }\r\n\r\n urlRedirect += redirectRoot + '/' + path;\r\n urlRedirect = urlRedirect.replace(/\\/\\/+/g, '/');\r\n if (!this.routes.some(x => x.Path === path)) this.routes.push({ Path: path, Url: urlRedirect });\r\n return urlRedirect;\r\n }\r\n\r\n // For quick lookup, save the mapping between the path to the route inside the view model.\r\n if (template == null) throw new Error('vmRoute cannot find any route template');\r\n\r\n iRoute.$template = template;\r\n this.pathToRoute = this.pathToRoute || {};\r\n this.pathToRoute[path] = iRoute;\r\n\r\n // Set the absolute path to the HREF attribute, and prevent the default behavior of\r\n // the anchor click event and instead do push to HTML5 history state.\r\n let url = this.toUrl(path);\r\n url = url.length > 0 ? url : '/';\r\n if (!this.routes.some(x => x.Path === path)) this.routes.push({ Path: path, Url: url });\r\n return url;\r\n }\r\n\r\n // Routes to a path.\r\n routeTo(iPath, iTemplate, iDisableEvent, iCallbackFn, isRedirect) {\r\n const vm = this.vm;\r\n const viewModels = vm.$dotnetify.getViewModels();\r\n\r\n if (this.debug) console.log(\"router> route '\" + iPath + \"' to template id=\" + iTemplate.Id);\r\n\r\n // We can determine whether the view has already been loaded by matching the 'RoutingState.Origin' argument\r\n // on the existing view model inside that target selector with the path.\r\n for (let i = 0; i < viewModels.length; i++) {\r\n var vmOther = viewModels[i];\r\n var vmArg = vmOther.$router.VMArg;\r\n if (vmArg != null) {\r\n if (typeof vmArg['RoutingState.Origin'] === 'string' && utils.equal(vmArg['RoutingState.Origin'], iPath)) return;\r\n }\r\n }\r\n\r\n // Support enter interception.\r\n if (iDisableEvent != true && vm.hasOwnProperty('onRouteEnter')) {\r\n if (this.onRouteEnter(iPath, iTemplate) == false || vm.onRouteEnter(iPath, iTemplate) == false) return;\r\n }\r\n\r\n // Check if the route has valid target.\r\n if (iTemplate.Target == null) {\r\n console.error(\"router> the Target for template '\" + iTemplate.Id + \"' was not set. Use vm.onRouteEnter() to set the target.\");\r\n return;\r\n }\r\n\r\n // If target DOM element isn't found, redirect URL to the path.\r\n if (document.getElementById(iTemplate.Target) == null) {\r\n if (isRedirect === true) {\r\n if (this.debug) console.log(\"router> target '\" + iTemplate.Target + \"' not found in DOM\");\r\n return;\r\n }\r\n else {\r\n if (this.debug) console.log(\"router> target '\" + iTemplate.Target + \"' not found in DOM, use redirect instead\");\r\n return this.router.redirect(this.toUrl(iPath), [ ...viewModels, ...vm.$dotnetify.controller.getViewModels() ]);\r\n }\r\n }\r\n\r\n // Load the view associated with the route asynchronously.\r\n this.loadView('#' + iTemplate.Target, iTemplate.ViewUrl, iTemplate.JSModuleUrl, { 'RoutingState.Origin': iPath }, () => {\r\n // If load is successful, update the active route.\r\n this.dispatchActiveRoutingState(iPath);\r\n\r\n // Support exit interception.\r\n if (iDisableEvent != true && vm.hasOwnProperty('onRouteExit')) vm.onRouteExit(iPath, iTemplate);\r\n\r\n if (typeof iCallbackFn === 'function') iCallbackFn.call(vm);\r\n });\r\n }\r\n\r\n routeToRoute(iRoute) {\r\n var path = this.vm.$route(iRoute);\r\n if (path == null || path == '') throw new Error('The route passed to $routeTo is invalid.');\r\n\r\n setTimeout(() => this.router.pushState({}, '', path));\r\n }\r\n\r\n // Routes the URL if the view model implements IRoutable.\r\n // Returns true if the view model handles the routing.\r\n routeUrl(redirectUrlPath) {\r\n if (!this.hasRoutingState) return false;\r\n\r\n const isRedirect = !!redirectUrlPath;\r\n let root = this.RoutingState.Root;\r\n if (root == null) return false;\r\n\r\n // Get the URL path to route.\r\n let urlPath = isRedirect ? redirectUrlPath : this.router.urlPath;\r\n\r\n if (this.debug) console.log('router> routing ' + urlPath);\r\n\r\n // If the URL path matches the root path of this view, use the template with a blank URL pattern if provided.\r\n if (utils.equal(urlPath, root) || utils.equal(urlPath, root + '/') || urlPath === '/') {\r\n let match = utils.grep(this.RoutingState.Templates, function(iTemplate) {\r\n return iTemplate.UrlPattern === '';\r\n });\r\n if (match.length > 0) {\r\n this.routeTo('', match[0], null, null, isRedirect);\r\n this.router.urlPath = '';\r\n this.raiseRoutedEvent();\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n // If the URL path starts with the root path of this view, look at the next path and try to match it with the\r\n // anchor tags in this view that are bound with the vmRoute binding type. If there is match, route to that path.\r\n root = root + '/';\r\n if (utils.startsWith(urlPath, root)) {\r\n let routeElem = null;\r\n let match = utils.grep(this.routes, function(elem) {\r\n return utils.startsWith(urlPath + '/', elem.Url + '/');\r\n });\r\n if (match.length > 0) {\r\n // If more than one match, find the best match.\r\n for (let i = 0; i < match.length; i++) if (routeElem == null || routeElem.Url.length < match[i].Url.length) routeElem = match[i];\r\n }\r\n\r\n if (routeElem != null) {\r\n let path = routeElem.Path;\r\n let template =\r\n this.hasOwnProperty('pathToRoute') && this.pathToRoute.hasOwnProperty(path) ? this.pathToRoute[path].$template : null;\r\n if (template != null) {\r\n // If the URL path is completely routed, clear it.\r\n if (utils.equal(this.router.urlPath, this.toUrl(path))) this.router.urlPath = '';\r\n\r\n // If route's not already active, route to it.\r\n if (!utils.equal(this.RoutingState.Active, path)) {\r\n this.routeTo(path, template, false, () => this.raiseRoutedEvent(), isRedirect);\r\n }\r\n else this.raiseRoutedEvent();\r\n return true;\r\n }\r\n }\r\n else if (this.router.match(urlPath)) {\r\n // If no vmRoute binding matches, try to match with any template's URL pattern.\r\n this.router.urlPath = '';\r\n this.raiseRoutedEvent();\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n // Builds an absolute URL from a path.\r\n toUrl(iPath) {\r\n let path = utils.trim(iPath);\r\n if (path.charAt(0) != '(' && path != '') path = '/' + path;\r\n return this.hasRoutingState ? this.RoutingState.Root + path : iPath;\r\n }\r\n\r\n // Unmount a view if there's one on the target selector.\r\n unmountView(iTargetSelector) {\r\n throw new Error('Not implemented');\r\n }\r\n}\r\n","/* \r\nCopyright 2018-2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport Vue from 'vue';\r\nimport dotnetifyVMRouter from '../core/dotnetify-vm-router';\r\nimport $ from '../libs/jquery-shim';\r\nimport utils from '../libs/utils';\r\n\r\nconst window = window || global || {};\r\n\r\nexport default class dotnetifyVueVMRouter extends dotnetifyVMRouter {\r\n get hasRoutingState() {\r\n const state = this.vm.State();\r\n return state && state.hasOwnProperty('RoutingState');\r\n }\r\n get RoutingState() {\r\n return this.vm.State().RoutingState;\r\n }\r\n get VMRoot() {\r\n return this.vm.Props('vmRoot');\r\n }\r\n get VMArg() {\r\n return this.vm.Props('vmArg');\r\n }\r\n\r\n constructor(iVM, iDotNetifyRouter) {\r\n super(iVM, iDotNetifyRouter);\r\n }\r\n\r\n onRouteEnter(iPath, iTemplate) {\r\n if (!iTemplate.ViewUrl) iTemplate.ViewUrl = iTemplate.Id;\r\n return true;\r\n }\r\n\r\n // Loads a view into a target element.\r\n loadView(iTargetSelector, iViewUrl, iJsModuleUrl, iVmArg, iCallbackFn) {\r\n const vm = this.vm;\r\n let componentProps;\r\n\r\n // If the view model supports routing, add the root path to the view, to be used\r\n // to build the absolute route path, and view model argument if provided.\r\n if (this.hasRoutingState) {\r\n if (this.RoutingState === null) {\r\n console.error(\"router> the RoutingState prop of '\" + vm.$vmId + \"' was not initialized.\");\r\n return;\r\n }\r\n\r\n let root = this.VMRoot;\r\n root = root != null ? '/' + utils.trim(this.RoutingState.Root) + '/' + utils.trim(root) : this.RoutingState.Root;\r\n componentProps = { vmRoot: root, vmArg: iVmArg };\r\n }\r\n\r\n // Provide the opportunity to override the URL.\r\n iViewUrl = this.router.overrideUrl(iViewUrl, iTargetSelector);\r\n iJsModuleUrl = this.router.overrideUrl(iJsModuleUrl, iTargetSelector);\r\n\r\n if (utils.endsWith(iViewUrl, 'html')) this.loadHtmlView(iTargetSelector, iViewUrl, iJsModuleUrl, iCallbackFn);\r\n else {\r\n let component = iViewUrl;\r\n if (typeof iViewUrl === 'string' && window.hasOwnProperty(iViewUrl)) component = Object.assign({}, window[iViewUrl]);\r\n\r\n if (component instanceof HTMLElement) this.loadHtmlElementView(iTargetSelector, component, iJsModuleUrl, componentProps, iCallbackFn);\r\n else this.loadVueView(iTargetSelector, component, iJsModuleUrl, componentProps, iCallbackFn);\r\n }\r\n }\r\n\r\n // Loads a Vue view.\r\n loadVueView(iTargetSelector, iComponent, iJsModuleUrl, iProps, callbackFn) {\r\n return new Promise((resolve, reject) => {\r\n const vm = this.vm;\r\n const vmId = this.vm ? this.vm.$vmId : '';\r\n const createViewFunc = () => {\r\n // Resolve the vue class from the argument, which can be the object itself, or a global window variable name.\r\n let vueClass = iComponent;\r\n if (typeof iComponent !== 'object' || (typeof iComponent.render !== 'function' && !iComponent.template)) {\r\n console.error(`[${vmId}] failed to load view '${iComponent}' because it's not a Vue element.`);\r\n reject();\r\n return;\r\n }\r\n\r\n // Unmount any existing Vue component on the target selector.\r\n this.unmountView(iTargetSelector);\r\n\r\n // Declare 'RoutingState' property in the component.\r\n let data = typeof vueClass.data == 'function' ? vueClass.data() : vueClass.data || {};\r\n if (!data.hasOwnProperty('RoutingState')) {\r\n data.RoutingState = {};\r\n vueClass.data = function() {\r\n return data;\r\n };\r\n }\r\n\r\n // Add any undeclared property to the vue class.\r\n if (iProps) {\r\n vueClass.props = vueClass.props || {};\r\n for (const prop in iProps) if (!vueClass.props.hasOwnProperty(prop)) vueClass.props[prop] = { type: null };\r\n }\r\n\r\n const vueComponentType = Vue.extend(vueClass);\r\n const vueComponent = new vueComponentType({ propsData: { ...iProps } });\r\n\r\n document.querySelector(iTargetSelector).innerHTML = '
';\r\n vueComponent.$mount(iTargetSelector + ' > div');\r\n this.mountedComponents[iTargetSelector] = () => vueComponent.$destroy();\r\n\r\n if (typeof callbackFn === 'function') callbackFn.call(vm, vueComponent);\r\n resolve(vueComponent);\r\n };\r\n\r\n if (iJsModuleUrl == null) createViewFunc();\r\n else {\r\n // Load all javascripts first. Multiple files can be specified with comma delimiter.\r\n const getScripts = iJsModuleUrl.split(',').map(i => $.getScript(i));\r\n $.when.apply($, getScripts).done(createViewFunc);\r\n }\r\n });\r\n }\r\n\r\n // Unmount a Vue view if there's one on the target selector.\r\n unmountView(iTargetSelector) {\r\n if (!this.mountedComponents) this.mountedComponents = {};\r\n\r\n const unmount = this.mountedComponents[iTargetSelector];\r\n if (typeof unmount == 'function') {\r\n unmount();\r\n delete this.mountedComponents[iTargetSelector];\r\n }\r\n }\r\n}\r\n","/*\r\nPathJS - Copyright (c) 2011 Mike Trpcic, released under the MIT license.\r\n */\r\nconst window = window || global || {};\r\n\r\nvar Path = {\r\n // Need this specific version, because latest version is causing issue.\r\n version: '0.8.5',\r\n map: function(path) {\r\n if (Path.routes.defined.hasOwnProperty(path)) {\r\n return Path.routes.defined[path];\r\n }\r\n else {\r\n return new Path.core.route(path);\r\n }\r\n },\r\n root: function(path) {\r\n Path.routes.root = path;\r\n },\r\n rescue: function(fn) {\r\n Path.routes.rescue = fn;\r\n },\r\n history: {\r\n initial: {}, // Empty container for \"Initial Popstate\" checking variables.\r\n pushState: function(state, title, path) {\r\n if (Path.history.supported) {\r\n if (Path.dispatch(path)) {\r\n history.pushState(state, title, path);\r\n }\r\n }\r\n else {\r\n if (Path.history.fallback) {\r\n window.location.hash = '#' + path;\r\n }\r\n }\r\n },\r\n popState: function(event) {\r\n var initialPop = !Path.history.initial.popped && location.href == Path.history.initial.URL;\r\n Path.history.initial.popped = true;\r\n if (initialPop) return;\r\n Path.dispatch(document.location.pathname === '/' ? '' : document.location.pathname);\r\n },\r\n listen: function(fallback) {\r\n Path.history.supported = !!(window.history && window.history.pushState);\r\n Path.history.fallback = fallback;\r\n\r\n if (Path.history.supported) {\r\n (Path.history.initial.popped = 'state' in window.history), (Path.history.initial.URL = location.href);\r\n window.onpopstate = Path.history.popState;\r\n }\r\n else {\r\n if (Path.history.fallback) {\r\n for (route in Path.routes.defined) {\r\n if (route.charAt(0) != '#') {\r\n Path.routes.defined['#' + route] = Path.routes.defined[route];\r\n Path.routes.defined['#' + route].path = '#' + route;\r\n }\r\n }\r\n Path.listen();\r\n }\r\n }\r\n }\r\n },\r\n match: function(path, parameterize) {\r\n var params = {},\r\n route = null,\r\n possible_routes,\r\n slice,\r\n i,\r\n j,\r\n compare,\r\n result;\r\n for (route in Path.routes.defined) {\r\n if (route !== null && route !== undefined) {\r\n route = Path.routes.defined[route];\r\n possible_routes = route.partition();\r\n for (j = 0; j < possible_routes.length; j++) {\r\n slice = possible_routes[j];\r\n compare = path;\r\n if (slice.search(/:/) > 0) {\r\n for (i = 0; i < slice.split('/').length; i++) {\r\n if (i < compare.split('/').length && slice.split('/')[i].charAt(0) === ':') {\r\n params[slice.split('/')[i].replace(/:/, '')] = compare.split('/')[i];\r\n result = compare.split('/');\r\n result[i] = slice.split('/')[i];\r\n compare = result.join('/');\r\n }\r\n }\r\n }\r\n if (slice === compare) {\r\n if (parameterize) {\r\n route.params = params;\r\n }\r\n return route;\r\n }\r\n }\r\n }\r\n }\r\n return null;\r\n },\r\n dispatch: function(passed_route) {\r\n var previous_route, matched_route;\r\n if (Path.routes.current !== passed_route) {\r\n Path.routes.previous = Path.routes.current;\r\n Path.routes.current = passed_route;\r\n matched_route = Path.match(passed_route, true);\r\n\r\n if (Path.routes.previous) {\r\n previous_route = Path.match(Path.routes.previous);\r\n if (previous_route !== null && previous_route.do_exit !== null) {\r\n previous_route.do_exit();\r\n }\r\n }\r\n\r\n if (matched_route !== null) {\r\n matched_route.run();\r\n return true;\r\n }\r\n else {\r\n if (Path.routes.rescue !== null) {\r\n Path.routes.rescue();\r\n }\r\n }\r\n }\r\n },\r\n listen: function() {\r\n var fn = function() {\r\n Path.dispatch(location.hash);\r\n };\r\n\r\n if (location.hash === '') {\r\n if (Path.routes.root !== null) {\r\n location.hash = Path.routes.root;\r\n }\r\n }\r\n\r\n // The 'document.documentMode' checks below ensure that PathJS fires the right events\r\n // even in IE \"Quirks Mode\".\r\n if ('onhashchange' in window && (!document.documentMode || document.documentMode >= 8)) {\r\n window.onhashchange = fn;\r\n }\r\n else {\r\n setInterval(fn, 50);\r\n }\r\n\r\n if (location.hash !== '') {\r\n Path.dispatch(location.hash);\r\n }\r\n },\r\n core: {\r\n route: function(path) {\r\n this.path = path;\r\n this.action = null;\r\n this.do_enter = [];\r\n this.do_exit = null;\r\n this.params = {};\r\n Path.routes.defined[path] = this;\r\n }\r\n },\r\n routes: {\r\n current: null,\r\n root: null,\r\n rescue: null,\r\n previous: null,\r\n defined: {}\r\n }\r\n};\r\n\r\nPath.core.route.prototype = {\r\n to: function(fn) {\r\n this.action = fn;\r\n return this;\r\n },\r\n enter: function(fns) {\r\n if (fns instanceof Array) {\r\n this.do_enter = this.do_enter.concat(fns);\r\n }\r\n else {\r\n this.do_enter.push(fns);\r\n }\r\n return this;\r\n },\r\n exit: function(fn) {\r\n this.do_exit = fn;\r\n return this;\r\n },\r\n partition: function() {\r\n var parts = [],\r\n options = [],\r\n re = /\\(([^}]+?)\\)/g,\r\n text,\r\n i;\r\n while ((text = re.exec(this.path))) {\r\n parts.push(text[1]);\r\n }\r\n options.push(this.path.split('(')[0]);\r\n for (i = 0; i < parts.length; i++) {\r\n options.push(options[options.length - 1] + parts[i]);\r\n }\r\n return options;\r\n },\r\n run: function() {\r\n var halt_execution = false,\r\n i,\r\n result,\r\n previous;\r\n\r\n if (Path.routes.defined[this.path].hasOwnProperty('do_enter')) {\r\n if (Path.routes.defined[this.path].do_enter.length > 0) {\r\n for (i = 0; i < Path.routes.defined[this.path].do_enter.length; i++) {\r\n result = Path.routes.defined[this.path].do_enter[i].apply(this, null);\r\n if (result === false) {\r\n halt_execution = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n if (!halt_execution) {\r\n Path.routes.defined[this.path].action();\r\n }\r\n }\r\n};\r\n\r\nexport default Path;\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport Path from '../libs/path';\r\n\r\nconst window = window || global || {};\r\n\r\nexport default class dotnetifyRouter {\r\n version = '2.0.1';\r\n\r\n // URL path that will be parsed when performing routing.\r\n urlPath = document.location.pathname;\r\n\r\n constructor(debug) {\r\n this.debug = debug;\r\n }\r\n\r\n // Initialize routing using PathJS.\r\n init() {\r\n if (typeof Path !== 'undefined') {\r\n Path.history.listen(true);\r\n Path.routes.rescue = function() {\r\n //window.location.replace(document.location.pathname);\r\n };\r\n }\r\n else throw new Error('Pathjs library is required for routing.');\r\n }\r\n\r\n // Map a route to an action.\r\n mapTo(iPath, iFn) {\r\n iPath = iPath.length > 0 ? iPath : '/';\r\n if (typeof Path !== 'undefined')\r\n Path.map(iPath).to(function() {\r\n iFn(this.params);\r\n });\r\n }\r\n\r\n // Match a URL path to a route and run the action.\r\n match(iUrlPath) {\r\n if (typeof Path !== 'undefined') {\r\n var matched = Path.match(iUrlPath, true);\r\n if (matched != null) {\r\n matched.run();\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n // Optional callback to override a URL before performing routing.\r\n overrideUrl(iUrl) {\r\n return iUrl;\r\n }\r\n\r\n // Push state to HTML history.\r\n pushState(iState, iTitle, iPath) {\r\n this.urlPath = '';\r\n if (typeof Path !== 'undefined') Path.history.pushState(iState, iTitle, iPath);\r\n }\r\n\r\n // Redirect to the a URL.\r\n redirect(iUrl, viewModels) {\r\n // Check first whether existing views can handle routing this URL.\r\n // Otherwise, do a hard browser redirect.\r\n this.urlPath = iUrl;\r\n for (let i = 0; i < viewModels.length; i++) {\r\n const vm = viewModels[i];\r\n if (vm.$router.routeUrl(iUrl)) {\r\n if (this.debug) console.log('router> redirected');\r\n return;\r\n }\r\n }\r\n window.location.replace(iUrl);\r\n }\r\n\r\n // Called by dotNetify when a view model is ready.\r\n $ready() {\r\n this.$router.initRouting();\r\n }\r\n\r\n // Called by dotNetify when a view model receives update.\r\n $update(vmData) {\r\n if (vmData && vmData.RoutingState) this.$router.initRouting();\r\n }\r\n}\r\n","/* \r\nCopyright 2018-2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport dotnetify from './dotnetify-vue';\r\nimport dotnetifyRouter from '../core/dotnetify-router';\r\nimport dotnetifyVueVMRouter from './dotnetify-vue.vm-router';\r\n\r\n// Add plugin functions.\r\ndotnetify.vue.router = new dotnetifyRouter(dotnetify.debug);\r\n\r\n// Inject a view model with functions.\r\ndotnetify.vue.router.$inject = function(iVM) {\r\n const router = new dotnetifyVueVMRouter(iVM, dotnetify.vue.router);\r\n\r\n // Put functions inside $router namespace.\r\n iVM.$router = router;\r\n\r\n // Returns the URL for an anchor tag.\r\n iVM.$route = (iRoute, iTarget) => router.route(iRoute, iTarget);\r\n\r\n // Handles click event from anchor tags.\r\n iVM.$handleRoute = iEvent => router.handleRoute(iEvent);\r\n\r\n // Executes the given route.\r\n iVM.$routeTo = iRoute => router.routeToRoute(iRoute);\r\n};\r\n\r\n// Provide function to load a view.\r\ndotnetify.vue.router.$mount = function(iTargetSelector, iComponent, iProps, iCallbackFn) {\r\n return dotnetifyVueVMRouter.prototype.loadVueView(iTargetSelector, iComponent, null, iProps, iCallbackFn);\r\n};\r\n\r\n// Register the plugin to dotNetify.\r\ndotnetify.vue.plugins['router'] = dotnetify.vue.router;\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport $ from '../libs/jquery-shim';\r\n\r\nconst window = window || global || {};\r\n\r\n// Client-side view model that acts as a proxy of the server view model.\r\nexport default class dotnetifyVM {\r\n // iVMId - identifies the view model.\r\n // iComponent - component object.\r\n // iOptions - Optional configuration options:\r\n // getState: state accessor.\r\n // setState: state mutator.\r\n // vmArg: view model arguments.\r\n // headers: request headers, for things like authentication token.\r\n // exceptionHandler: called when receiving server-side exception.\r\n // iDotNetify - framework-specific dotNetify library.\r\n // iHub - hub connection.\r\n constructor(iVMId, iComponent, iOptions, iDotNetify, iHub) {\r\n this.$vmId = iVMId;\r\n this.$component = iComponent;\r\n this.$options = iOptions || {};\r\n this.$vmArg = iOptions && iOptions['vmArg'];\r\n this.$headers = iOptions && iOptions['headers'];\r\n this.$exceptionHandler = iOptions && iOptions['exceptionHandler'];\r\n this.$requested = false;\r\n this.$loaded = false;\r\n this.$itemKey = {};\r\n this.$dotnetify = iDotNetify;\r\n this.$hub = iHub;\r\n\r\n let getState = iOptions && iOptions['getState'];\r\n let setState = iOptions && iOptions['setState'];\r\n getState = typeof getState === 'function' ? getState : () => iComponent.state;\r\n setState = typeof setState === 'function' ? setState : state => iComponent.setState(state);\r\n\r\n this.State = state => (typeof state === 'undefined' ? getState() : setState(state));\r\n this.Props = prop => this.$component.props && this.$component.props[prop];\r\n\r\n const vmArg = this.Props('vmArg');\r\n if (vmArg) this.$vmArg = $.extend(this.$vmArg, vmArg);\r\n\r\n // Inject plugin functions into this view model.\r\n this.$getPlugins().map(plugin => (typeof plugin['$inject'] == 'function' ? plugin.$inject(this) : null));\r\n }\r\n\r\n // Disposes the view model, both here and on the server.\r\n $destroy() {\r\n // Call any plugin's $destroy function if provided.\r\n this.$getPlugins().map(plugin => (typeof plugin['$destroy'] == 'function' ? plugin.$destroy.apply(this) : null));\r\n\r\n if (this.$hub.isConnected) {\r\n try {\r\n this.$hub.disposeVM(this.$vmId);\r\n } catch (ex) {\r\n this.$dotnetify.controller.handleConnectionStateChanged('error', ex, this.$hub);\r\n }\r\n }\r\n\r\n delete this.$dotnetify.viewModels[this.$vmId];\r\n }\r\n\r\n // Dispatches a value to the server view model.\r\n // iValue - Value to dispatch.\r\n $dispatch(iValue) {\r\n if (this.$hub.isConnected) {\r\n const controller = this.$dotnetify.controller;\r\n try {\r\n this.$hub.updateVM(this.$vmId, iValue);\r\n\r\n if (controller.debug) {\r\n console.log('[' + this.$vmId + '] sent> ');\r\n console.log(iValue);\r\n\r\n controller.debugFn && controller.debugFn(this.$vmId, 'sent', iValue);\r\n }\r\n } catch (ex) {\r\n controller.handleConnectionStateChanged('error', ex, this.$hub);\r\n }\r\n }\r\n }\r\n\r\n // Dispatches a state value to the server view model.\r\n // iValue - State value to dispatch.\r\n $dispatchListState(iValue) {\r\n for (var listName in iValue) {\r\n const key = this.$itemKey[listName];\r\n if (!key) {\r\n console.error(`[${this.$vmId}] missing item key for '${listName}'; add ${listName}_itemKey property to the view model.`);\r\n return;\r\n }\r\n var item = iValue[listName];\r\n if (!item[key]) {\r\n console.error(`[${this.$vmId}] couldn't dispatch data from '${listName}' due to missing property '${key}'.`);\r\n console.error(item);\r\n return;\r\n }\r\n\r\n Object.keys(item).forEach(prop => {\r\n if (prop != key) {\r\n let state = {};\r\n state[listName + '.$' + item[key] + '.' + prop] = item[prop];\r\n this.$dispatch(state);\r\n }\r\n });\r\n this.$updateList(listName, item);\r\n }\r\n }\r\n\r\n $getPlugins() {\r\n return Object.keys(this.$dotnetify.plugins).map(id => this.$dotnetify.plugins[id]);\r\n }\r\n\r\n // Preprocess view model update from the server before we set the state.\r\n $preProcess(iVMUpdate) {\r\n const vm = this;\r\n\r\n for (var prop in iVMUpdate) {\r\n // Look for property that end with '_add'. Interpret the value as a list item to be added\r\n // to an existing list whose property name precedes that suffix.\r\n var match = /(.*)_add/.exec(prop);\r\n if (match != null) {\r\n var listName = match[1];\r\n if (Array.isArray(this.State()[listName])) vm.$addList(listName, iVMUpdate[prop]);\r\n else console.error('unable to resolve ' + prop);\r\n delete iVMUpdate[prop];\r\n continue;\r\n }\r\n\r\n // Look for property that end with '_update'. Interpret the value as a list item to be updated\r\n // to an existing list whose property name precedes that suffix.\r\n var match = /(.*)_update/.exec(prop);\r\n if (match != null) {\r\n var listName = match[1];\r\n if (Array.isArray(this.State()[listName])) vm.$updateList(listName, iVMUpdate[prop]);\r\n else console.error('[' + this.$vmId + \"] '\" + listName + \"' is not found or not an array.\");\r\n delete iVMUpdate[prop];\r\n continue;\r\n }\r\n\r\n // Look for property that end with '_remove'. Interpret the value as a list item key to remove\r\n // from an existing list whose property name precedes that suffix.\r\n var match = /(.*)_remove/.exec(prop);\r\n if (match != null) {\r\n var listName = match[1];\r\n if (Array.isArray(this.State()[listName])) {\r\n var key = this.$itemKey[listName];\r\n if (key != null)\r\n vm.$removeList(listName, function(i) {\r\n return i[key] == iVMUpdate[prop];\r\n });\r\n else console.error(`[${this.$vmId}] missing item key for '${listName}'; add ${listName}_itemKey property to the view model.`);\r\n }\r\n else console.error(`[${this.$vmId}] '${listName}' is not found or not an array.`);\r\n delete iVMUpdate[prop];\r\n continue;\r\n }\r\n\r\n // Look for property that end with '_itemKey'. Interpret the value as the property name that will\r\n // uniquely identify items in the list.\r\n var match = /(.*)_itemKey/.exec(prop);\r\n if (match != null) {\r\n var listName = match[1];\r\n var itemKey = {};\r\n itemKey[listName] = iVMUpdate[prop];\r\n vm.$setItemKey(itemKey);\r\n delete iVMUpdate[prop];\r\n continue;\r\n }\r\n }\r\n }\r\n\r\n // Requests state from the server view model.\r\n $request() {\r\n if (this.$hub.isConnected) this.$hub.requestVM(this.$vmId, { $vmArg: this.$vmArg, $headers: this.$headers });\r\n this.$requested = true;\r\n }\r\n\r\n // Updates state from the server view model to the view.\r\n // iVMData - Serialized state from the server.\r\n $update(iVMData) {\r\n const controller = this.$dotnetify.controller;\r\n if (controller.debug) {\r\n console.log('[' + this.$vmId + '] received> ');\r\n console.log(JSON.parse(iVMData));\r\n\r\n controller.debugFn && controller.debugFn(this.$vmId, 'received', JSON.parse(iVMData));\r\n }\r\n let vmData = JSON.parse(iVMData);\r\n this.$preProcess(vmData);\r\n\r\n let state = this.State();\r\n state = $.extend({}, state, vmData);\r\n this.State(state);\r\n\r\n if (!this.$loaded) this.$onLoad();\r\n else this.$onUpdate(vmData);\r\n }\r\n\r\n // Handles initial view model load event.\r\n $onLoad() {\r\n this.$getPlugins().map(plugin => (typeof plugin['$ready'] == 'function' ? plugin.$ready.apply(this) : null));\r\n this.$loaded = true;\r\n }\r\n\r\n // Handles view model update event.\r\n $onUpdate(vmData) {\r\n this.$getPlugins().map(plugin => (typeof plugin['$update'] == 'function' ? plugin.$update.apply(this, [ vmData ]) : null));\r\n }\r\n\r\n // *** CRUD Functions ***\r\n\r\n // Sets items key to identify individual items in a list.\r\n // Accepts object literal: { \"\": \"\", ... }\r\n $setItemKey(iItemKey) {\r\n Object.assign(this.$itemKey, iItemKey);\r\n }\r\n\r\n //// Adds a new item to a state array.\r\n $addList(iListName, iNewItem) {\r\n // Check if the list already has an item with the same key. If so, replace it.\r\n var key = this.$itemKey[iListName];\r\n if (key != null) {\r\n if (!iNewItem.hasOwnProperty(key)) {\r\n console.error(`[${this.$vmId}] couldn't add item to '${iListName}' due to missing property '${key}'.`);\r\n return;\r\n }\r\n var match = this.State()[iListName].filter(function(i) {\r\n return i[key] == iNewItem[key];\r\n });\r\n if (match.length > 0) {\r\n console.error(`[${this.$vmId}] couldn't add item to '${iListName}' because the key already exists.`);\r\n return;\r\n }\r\n }\r\n\r\n let items = this.State()[iListName];\r\n items.push(iNewItem);\r\n\r\n let state = {};\r\n state[iListName] = items;\r\n this.State(state);\r\n }\r\n\r\n // Removes an item from a state array.\r\n $removeList(iListName, iFilter) {\r\n let state = {};\r\n state[iListName] = this.State()[iListName].filter(i => !iFilter(i));\r\n this.State(state);\r\n }\r\n\r\n //// Updates existing item to an observable array.\r\n $updateList(iListName, iNewItem) {\r\n // Check if the list already has an item with the same key. If so, update it.\r\n let key = this.$itemKey[iListName];\r\n if (key != null) {\r\n if (!iNewItem.hasOwnProperty(key)) {\r\n console.error(`[${this.$vmId}] couldn't update item to '${iListName}' due to missing property '${key}'.`);\r\n return;\r\n }\r\n var state = {};\r\n state[iListName] = this.State()[iListName].map(function(i) {\r\n return i[key] == iNewItem[key] ? $.extend(i, iNewItem) : i;\r\n });\r\n this.State(state);\r\n }\r\n else console.error(`[${this.$vmId}] missing item key for '${iListName}'; add '${iListName}_itemKey' property to the view model.`);\r\n }\r\n}\r\n","/* \r\nCopyright 2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport { createEventEmitter, fetch } from '../libs/utils';\r\n\r\nexport class dotNetifyHubWebApi {\r\n mode = 'webapi';\r\n debug = false;\r\n isConnected = false;\r\n isHubStarted = false;\r\n\r\n responseEvent = createEventEmitter();\r\n reconnectedEvent = createEventEmitter();\r\n connectedEvent = createEventEmitter();\r\n connectionFailedEvent = createEventEmitter();\r\n\r\n _vmArgs = {};\r\n\r\n constructor(iBaseUrl, iOnRequest) {\r\n this.baseUrl = iBaseUrl || '';\r\n this.onRequest = iOnRequest;\r\n }\r\n\r\n static create(iBaseUrl, iOnRequest) {\r\n return new dotNetifyHubWebApi(iBaseUrl, iOnRequest);\r\n }\r\n\r\n startHub() {\r\n this.isConnected = true;\r\n this.isHubStarted = true;\r\n this.connectedEvent.emit();\r\n }\r\n\r\n requestVM(iVMId, iVMArgs) {\r\n const vmArgs = iVMArgs || {};\r\n const vmArgQuery = vmArgs.$vmArg ? '?vmarg=' + JSON.stringify(vmArgs.$vmArg) : '';\r\n const headers = vmArgs.$headers || {};\r\n\r\n this._vmArgs[iVMId] = vmArgs;\r\n const url = this.baseUrl + `/api/dotnetify/vm/${iVMId}${vmArgQuery}`;\r\n\r\n fetch('GET', url, null, request => {\r\n Object.keys(headers).forEach(key => request.setRequestHeader(key, headers[key]));\r\n if (typeof this.onRequest == 'function') this.onRequest(url, request);\r\n })\r\n .then(response => {\r\n this.responseEvent.emit(iVMId, response);\r\n })\r\n .catch(request => console.error(`[${iVMId}] Request failed`, request));\r\n }\r\n\r\n updateVM(iVMId, iValue) {\r\n const vmArgs = this._vmArgs[iVMId] || {};\r\n const vmArgQuery = vmArgs.$vmArg ? '?vmarg=' + JSON.stringify(vmArgs.$vmArg) : '';\r\n const headers = vmArgs.$headers || {};\r\n const payload = typeof iValue == 'object' ? JSON.stringify(iValue) : iValue;\r\n\r\n const url = this.baseUrl + `/api/dotnetify/vm/${iVMId}${vmArgQuery}`;\r\n\r\n fetch('POST', url, payload, request => {\r\n request.setRequestHeader('Content-Type', 'application/json');\r\n Object.keys(headers).forEach(key => request.setRequestHeader(key, headers[key]));\r\n if (typeof this.onRequest == 'function') this.onRequest(url, request, payload);\r\n })\r\n .then(response => {\r\n this.responseEvent.emit(iVMId, response);\r\n })\r\n .catch(request => console.error(`[${iVMId}] Update failed`, request));\r\n }\r\n\r\n disposeVM(iVMId) {\r\n delete this._vmArgs[iVMId];\r\n }\r\n}\r\n\r\nconst createWebApiHub = dotNetifyHubWebApi.create;\r\n\r\nexport { createWebApiHub };\r\nexport default dotNetifyHubWebApi.create();\r\n","/* \r\nCopyright 2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport { createEventEmitter } from '../libs/utils';\r\n\r\nconst window = window || global || {};\r\n\r\nconst normalize = iVMId => iVMId && iVMId.replace(/\\./g, '_');\r\nconst hasLocalVM = iVMId => {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n return typeof vm == 'object' && typeof vm.onConnect == 'function';\r\n};\r\n\r\nexport class dotNetifyHubLocal {\r\n mode = 'local';\r\n debug = false;\r\n isConnected = false;\r\n isHubStarted = false;\r\n\r\n responseEvent = createEventEmitter();\r\n reconnectedEvent = createEventEmitter();\r\n connectedEvent = createEventEmitter();\r\n connectionFailedEvent = createEventEmitter();\r\n\r\n startHub() {\r\n this.isConnected = true;\r\n this.isHubStarted = true;\r\n this.connectedEvent.emit();\r\n }\r\n\r\n requestVM(iVMId, iVMArgs) {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n\r\n if (typeof vm === 'object' && typeof vm.onConnect == 'function') {\r\n if (this.debug) console.log(`[${iVMId}] *** local mode ***`);\r\n\r\n vm.$pushUpdate = update => {\r\n if (typeof update == 'object') update = JSON.stringify(update);\r\n setTimeout(() => this.responseEvent.emit(iVMId, update));\r\n };\r\n\r\n vm.$pushUpdate(vm.onConnect(iVMArgs) || {});\r\n }\r\n }\r\n\r\n updateVM(iVMId, iValue) {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n\r\n if (typeof vm === 'object' && typeof vm.onDispatch == 'function') {\r\n let state = vm.onDispatch(iValue);\r\n if (state) {\r\n if (typeof state == 'object') state = JSON.stringify(state);\r\n setTimeout(() => this.responseEvent.emit(iVMId, state));\r\n }\r\n }\r\n }\r\n\r\n disposeVM(iVMId) {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n\r\n if (typeof vm === 'object' && typeof vm.onDestroy == 'function') {\r\n vm.onDestroy(iVMId);\r\n }\r\n }\r\n}\r\n\r\nexport default new dotNetifyHubLocal();\r\nexport { hasLocalVM };\r\n","module.exports = __WEBPACK_EXTERNAL_MODULE__15__;","/**\n* jQuery core object.\n*\n* Worker with jQuery deferred\n*\n* Code from: https://github.com/jquery/jquery/blob/master/src/core.js\n*\n*/\n\nvar jQuery = module.exports = {\n\ttype: type\n\t, isArray: isArray\n\t, isFunction: isFunction\n\t, isPlainObject: isPlainObject\n\t, each: each\n\t, extend: extend\n\t, noop: function() {}\n};\n\nvar toString = Object.prototype.toString;\n\nvar class2type = {};\n// Populate the class2type map\n\"Boolean Number String Function Array Date RegExp Object\".split(\" \").forEach(function(name) {\n\tclass2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n});\n\n\nfunction type( obj ) {\n\treturn obj == null ?\n\t\tString( obj ) :\n\t\t\tclass2type[ toString.call(obj) ] || \"object\";\n}\n\nfunction isFunction( obj ) {\n\treturn jQuery.type(obj) === \"function\";\n}\n\nfunction isArray( obj ) {\n\treturn jQuery.type(obj) === \"array\";\n}\n\nfunction each( object, callback, args ) {\n\tvar name, i = 0,\n\tlength = object.length,\n\tisObj = length === undefined || isFunction( object );\n\n\tif ( args ) {\n\t\tif ( isObj ) {\n\t\t\tfor ( name in object ) {\n\t\t\t\tif ( callback.apply( object[ name ], args ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( ; i < length; ) {\n\t\t\t\tif ( callback.apply( object[ i++ ], args ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// A special, fast, case for the most common use of each\n\t} else {\n\t\tif ( isObj ) {\n\t\t\tfor ( name in object ) {\n\t\t\t\tif ( callback.call( object[ name ], name, object[ name ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( ; i < length; ) {\n\t\t\t\tif ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn object;\n}\n\nfunction isPlainObject( obj ) {\n\t// Must be an Object.\n\tif ( !obj || jQuery.type(obj) !== \"object\" ) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\nfunction extend() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\ttarget = arguments[0] || {},\n\ti = 1,\n\tlength = arguments.length,\n\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif ( typeof target === \"boolean\" ) {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\n\t// Handle case when target is a string or something (possible in deep copy)\n\tif ( typeof target !== \"object\" && !jQuery.isFunction(target) ) {\n\t\ttarget = {};\n\t}\n\n\t// extend jQuery itself if only one argument is passed\n\tif ( length === i ) {\n\t\ttarget = this;\n\t\t--i;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\t\t// Only deal with non-null/undefined values\n\t\tif ( (options = arguments[ i ]) != null ) {\n\t\t\t// Extend the base object\n\t\t\tfor ( name in options ) {\n\t\t\t\tsrc = target[ name ];\n\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif ( target === copy ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {\n\t\t\t\t\tif ( copyIsArray ) {\n\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\tclone = src && jQuery.isArray(src) ? src : [];\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclone = src && jQuery.isPlainObject(src) ? src : {};\n\t\t\t\t\t}\n\n\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\n\n","var jQuery = module.exports = require(\"./jquery-core.js\"),\n\tcore_rspace = /\\s+/;\n/**\n* jQuery Callbacks\n*\n* Code from: https://github.com/jquery/jquery/blob/master/src/callbacks.js\n*\n*/\n\n\n// String to Object options format cache\nvar optionsCache = {};\n\n// Convert String-formatted options into Object-formatted ones and store in cache\nfunction createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.split( core_rspace ), function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n\t// Convert options from String-formatted to Object-formatted if needed\n\t// (we check in cache first)\n\toptions = typeof options === \"string\" ?\n\t\t( optionsCache[ options ] || createOptions( options ) ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Last fire value (for non-forgettable lists)\n\t\tmemory,\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\t\t// Flag to know if list is currently firing\n\t\tfiring,\n\t\t// First callback to fire (used internally by add and fireWith)\n\t\tfiringStart,\n\t\t// End of the loop when firing\n\t\tfiringLength,\n\t\t// Index of currently firing callback (modified by remove if needed)\n\t\tfiringIndex,\n\t\t// Actual callback list\n\t\tlist = [],\n\t\t// Stack of fire calls for repeatable lists\n\t\tstack = !options.once && [],\n\t\t// Fire callbacks\n\t\tfire = function( data ) {\n\t\t\tmemory = options.memory && data;\n\t\t\tfired = true;\n\t\t\tfiringIndex = firingStart || 0;\n\t\t\tfiringStart = 0;\n\t\t\tfiringLength = list.length;\n\t\t\tfiring = true;\n\t\t\tfor ( ; list && firingIndex < firingLength; firingIndex++ ) {\n\t\t\t\tif ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {\n\t\t\t\t\tmemory = false; // To prevent further calls using add\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfiring = false;\n\t\t\tif ( list ) {\n\t\t\t\tif ( stack ) {\n\t\t\t\t\tif ( stack.length ) {\n\t\t\t\t\t\tfire( stack.shift() );\n\t\t\t\t\t}\n\t\t\t\t} else if ( memory ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t} else {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t// Actual Callbacks object\n\t\tself = {\n\t\t\t// Add a callback or a collection of callbacks to the list\n\t\t\tadd: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\t// First, we save the current length\n\t\t\t\t\tvar start = list.length;\n\t\t\t\t\t(function add( args ) {\n\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {\n\t\t\t\t\t\t\tvar type = jQuery.type( arg );\n\t\t\t\t\t\t\tif ( type === \"function\" ) {\n\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {\n\t\t\t\t\t\t\t\t\tlist.push( arg );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if ( arg && arg.length && type !== \"string\" ) {\n\t\t\t\t\t\t\t\t// Inspect recursively\n\t\t\t\t\t\t\t\tadd( arg );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t})( arguments );\n\t\t\t\t\t// Do we need to add the callbacks to the\n\t\t\t\t\t// current firing batch?\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tfiringLength = list.length;\n\t\t\t\t\t// With memory, if we're not firing then\n\t\t\t\t\t// we should call right away\n\t\t\t\t\t} else if ( memory ) {\n\t\t\t\t\t\tfiringStart = start;\n\t\t\t\t\t\tfire( memory );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\t\tvar index;\n\t\t\t\t\t\twhile( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\t\tlist.splice( index, 1 );\n\t\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\t\t\tif ( index <= firingLength ) {\n\t\t\t\t\t\t\t\t\tfiringLength--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\t\t\tfiringIndex--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Control if a given callback is in the list\n\t\t\thas: function( fn ) {\n\t\t\t\treturn jQuery.inArray( fn, list ) > -1;\n\t\t\t},\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tlist = [];\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Have the list do nothing anymore\n\t\t\tdisable: function() {\n\t\t\t\tlist = stack = memory = undefined;\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it disabled?\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\t\t\t// Lock the list in its current state\n\t\t\tlock: function() {\n\t\t\t\tstack = undefined;\n\t\t\t\tif ( !memory ) {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it locked?\n\t\t\tlocked: function() {\n\t\t\t\treturn !stack;\n\t\t\t},\n\t\t\t// Call all callbacks with the given context and arguments\n\t\t\tfireWith: function( context, args ) {\n\t\t\t\targs = args || [];\n\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\tif ( list && ( !fired || stack ) ) {\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tstack.push( args );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfire( args );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Call all the callbacks with the given arguments\n\t\t\tfire: function() {\n\t\t\t\tself.fireWith( this, arguments );\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// To know if the callbacks have already been called at least once\n\t\t\tfired: function() {\n\t\t\t\treturn !!fired;\n\t\t\t}\n\t\t};\n\n\treturn self;\n};\n\n","\n/*!\n* jquery-deferred\n* Copyright(c) 2011 Hidden \n* MIT Licensed\n*/\n\n/**\n* Library version.\n*/\n\nvar jQuery = module.exports = require(\"./jquery-callbacks.js\"),\n\tcore_slice = Array.prototype.slice;\n\n/**\n* jQuery deferred\n*\n* Code from: https://github.com/jquery/jquery/blob/master/src/deferred.js\n* Doc: http://api.jquery.com/category/deferred-object/\n*\n*/\n\njQuery.extend({\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\t\t\t\t// action, add listener, listener list, final state\n\t\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks(\"once memory\"), \"resolved\" ],\n\t\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks(\"once memory\"), \"rejected\" ],\n\t\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks(\"memory\") ]\n\t\t\t],\n\t\t\tstate = \"pending\",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\tthen: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\t\t\t\t\treturn jQuery.Deferred(function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\t\t\t\t\tvar action = tuple[ 0 ],\n\t\t\t\t\t\t\t\tfn = fns[ i ];\n\t\t\t\t\t\t\t// deferred[ done | fail | progress ] for forwarding actions to newDefer\n\t\t\t\t\t\t\tdeferred[ tuple[1] ]( jQuery.isFunction( fn ) ?\n\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\tvar returned = fn.apply( this, arguments );\n\t\t\t\t\t\t\t\t\tif ( returned && jQuery.isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject )\n\t\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tnewDefer[ action + \"With\" ]( this === deferred ? newDefer : this, [ returned ] );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} :\n\t\t\t\t\t\t\t\tnewDefer[ action ]\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tfns = null;\n\t\t\t\t\t}).promise();\n\t\t\t\t},\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Keep pipe for back-compat\n\t\tpromise.pipe = promise.then;\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 3 ];\n\n\t\t\t// promise[ done | fail | progress ] = list.add\n\t\t\tpromise[ tuple[1] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(function() {\n\t\t\t\t\t// state = [ resolved | rejected ]\n\t\t\t\t\tstate = stateString;\n\n\t\t\t\t// [ reject_list | resolve_list ].disable; progress_list.lock\n\t\t\t\t}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );\n\t\t\t}\n\n\t\t\t// deferred[ resolve | reject | notify ] = list.fire\n\t\t\tdeferred[ tuple[0] ] = list.fire;\n\t\t\tdeferred[ tuple[0] + \"With\" ] = list.fireWith;\n\t\t});\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( subordinate /* , ..., subordinateN */ ) {\n\t\tvar i = 0,\n\t\t\tresolveValues = core_slice.call( arguments ),\n\t\t\tlength = resolveValues.length,\n\n\t\t\t// the count of uncompleted subordinates\n\t\t\tremaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,\n\n\t\t\t// the master Deferred. If resolveValues consist of only a single Deferred, just use that.\n\t\t\tdeferred = remaining === 1 ? subordinate : jQuery.Deferred(),\n\n\t\t\t// Update function for both resolve and progress values\n\t\t\tupdateFunc = function( i, contexts, values ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tcontexts[ i ] = this;\n\t\t\t\t\tvalues[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;\n\t\t\t\t\tif( values === progressValues ) {\n\t\t\t\t\t\tdeferred.notifyWith( contexts, values );\n\t\t\t\t\t} else if ( !( --remaining ) ) {\n\t\t\t\t\t\tdeferred.resolveWith( contexts, values );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t},\n\n\t\t\tprogressValues, progressContexts, resolveContexts;\n\n\t\t// add listeners to Deferred subordinates; treat others as resolved\n\t\tif ( length > 1 ) {\n\t\t\tprogressValues = new Array( length );\n\t\t\tprogressContexts = new Array( length );\n\t\t\tresolveContexts = new Array( length );\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {\n\t\t\t\t\tresolveValues[ i ].promise()\n\t\t\t\t\t\t.done( updateFunc( i, resolveContexts, resolveValues ) )\n\t\t\t\t\t\t.fail( deferred.reject )\n\t\t\t\t\t\t.progress( updateFunc( i, progressContexts, progressValues ) );\n\t\t\t\t} else {\n\t\t\t\t\t--remaining;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// if we're not waiting on anything, resolve the master\n\t\tif ( !remaining ) {\n\t\t\tdeferred.resolveWith( resolveContexts, resolveValues );\n\t\t}\n\n\t\treturn deferred.promise();\n\t}\n});\n","\nmodule.exports = require('./lib/jquery-deferred');","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","/* \r\nCopyright 2017-2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport { createEventEmitter } from '../libs/utils';\r\nimport jQueryShim from '../libs/jquery-shim';\r\nconst signalRNetCore = require('@aspnet/signalr');\r\nlet $ = jQueryShim;\r\n\r\nconst window = window || global || {};\r\n\r\nexport class dotnetifyHubFactory {\r\n static create() {\r\n let dotnetifyHub = {\r\n version: '2.0.0',\r\n type: null,\r\n\r\n reconnectDelay: [ 2, 5, 10 ],\r\n reconnectRetry: null,\r\n\r\n _startInfo: null,\r\n _init: false,\r\n\r\n // Hub server methods.\r\n requestVM: (iVMId, iOptions) => dotnetifyHub.server.request_VM(iVMId, iOptions),\r\n updateVM: (iVMId, iValue) => dotnetifyHub.server.update_VM(iVMId, iValue),\r\n disposeVM: iVMId => dotnetifyHub.server.dispose_VM(iVMId),\r\n\r\n // Connection events.\r\n responseEvent: createEventEmitter(),\r\n reconnectedEvent: createEventEmitter(),\r\n connectedEvent: createEventEmitter(),\r\n connectionFailedEvent: createEventEmitter(),\r\n\r\n get isHubStarted() {\r\n return !!this._startInfo;\r\n },\r\n\r\n // Starts connection with SignalR hub server.\r\n startHub(hubOptions, doneHandler, failHandler, forceRestart) {\r\n const _doneHandler = () => {\r\n if (typeof doneHandler == 'function') doneHandler();\r\n this.connectedEvent.emit();\r\n };\r\n const _failHandler = ex => {\r\n if (typeof failHander == 'function') failHandler();\r\n this.connectionFailedEvent.emit();\r\n throw ex;\r\n };\r\n\r\n if (this._startInfo === null || forceRestart) {\r\n try {\r\n this._startInfo = this.start(hubOptions).done(_doneHandler).fail(_failHandler);\r\n } catch (err) {\r\n this._startInfo = null;\r\n }\r\n }\r\n else {\r\n try {\r\n this._startInfo.done(_doneHandler);\r\n } catch (err) {\r\n this._startInfo = null;\r\n return this.startHub(hubOptions, doneHandler, failHandler, forceRestart);\r\n }\r\n }\r\n }\r\n };\r\n\r\n // Configures connection to SignalR hub server.\r\n dotnetifyHub.init = function(iHubPath, iServerUrl, signalR) {\r\n if (dotnetifyHub._init) return;\r\n\r\n dotnetifyHub._init = true;\r\n signalR = signalR || window.signalR || signalRNetCore;\r\n\r\n // SignalR .NET Core.\r\n if (signalR && signalR.HubConnection) {\r\n dotnetifyHub.type = 'netcore';\r\n\r\n Object.defineProperty(dotnetifyHub, 'isConnected', {\r\n get: function() {\r\n return dotnetifyHub._connection && dotnetifyHub._connection.connection.connectionState === 1;\r\n }\r\n });\r\n\r\n dotnetifyHub = $.extend(dotnetifyHub, {\r\n hubPath: iHubPath || '/dotnetify',\r\n url: iServerUrl,\r\n\r\n // Internal variables. Do not modify!\r\n _connection: null,\r\n _reconnectCount: 0,\r\n _startDoneHandler: null,\r\n _startFailHandler: null,\r\n _disconnectedHandler: function() {},\r\n _stateChangedHandler: function(iNewState) {},\r\n\r\n _onDisconnected: function() {\r\n dotnetifyHub._changeState(4);\r\n dotnetifyHub._disconnectedHandler();\r\n },\r\n\r\n _changeState: function(iNewState) {\r\n if (iNewState == 1) dotnetifyHub._reconnectCount = 0;\r\n\r\n let stateText = { 0: 'connecting', 1: 'connected', 2: 'reconnecting', 4: 'disconnected', 99: 'terminated' };\r\n dotnetifyHub._stateChangedHandler(stateText[iNewState]);\r\n },\r\n\r\n _startConnection: function(iHubOptions, iTransportArray) {\r\n let url = dotnetifyHub.url ? dotnetifyHub.url + dotnetifyHub.hubPath : dotnetifyHub.hubPath;\r\n let hubOptions = {};\r\n Object.keys(iHubOptions).forEach(function(key) {\r\n hubOptions[key] = iHubOptions[key];\r\n });\r\n hubOptions.transport = iTransportArray.shift();\r\n\r\n dotnetifyHub._connection = new signalR.HubConnectionBuilder().withUrl(url, hubOptions).build();\r\n dotnetifyHub._connection.on('response_vm', dotnetifyHub.client.response_VM);\r\n dotnetifyHub._connection.onclose(dotnetifyHub._onDisconnected);\r\n\r\n let promise = dotnetifyHub._connection\r\n .start()\r\n .then(function() {\r\n dotnetifyHub._changeState(1);\r\n })\r\n .catch(function() {\r\n // If failed to start, fallback to the next transport.\r\n if (iTransportArray.length > 0) dotnetifyHub._startConnection(iHubOptions, iTransportArray);\r\n else dotnetifyHub._onDisconnected();\r\n });\r\n\r\n if (typeof dotnetifyHub._startDoneHandler === 'function')\r\n promise.then(dotnetifyHub._startDoneHandler).catch(dotnetifyHub._startFailHandler || function() {});\r\n return promise;\r\n },\r\n\r\n start: function(iHubOptions) {\r\n dotnetifyHub._startDoneHandler = null;\r\n dotnetifyHub._startFailHandler = null;\r\n\r\n // Map the transport option.\r\n let transport = [ 0 ];\r\n let transportOptions = { webSockets: 0, serverSentEvents: 1, longPolling: 2 };\r\n if (iHubOptions && Array.isArray(iHubOptions.transport))\r\n transport = iHubOptions.transport.map(function(arg) {\r\n return transportOptions[arg];\r\n });\r\n\r\n let promise = dotnetifyHub._startConnection(iHubOptions, transport);\r\n return {\r\n done: function(iHandler) {\r\n dotnetifyHub._startDoneHandler = iHandler;\r\n promise.then(iHandler).catch(function(error) {\r\n throw error;\r\n });\r\n return this;\r\n },\r\n fail: function(iHandler) {\r\n dotnetifyHub._startFailHandler = iHandler;\r\n promise.catch(iHandler);\r\n return this;\r\n }\r\n };\r\n },\r\n\r\n disconnected: function(iHandler) {\r\n if (typeof iHandler === 'function') dotnetifyHub._disconnectedHandler = iHandler;\r\n },\r\n\r\n stateChanged: function(iHandler) {\r\n if (typeof iHandler === 'function') dotnetifyHub._stateChangedHandler = iHandler;\r\n },\r\n\r\n reconnect: function(iStartHubFunc) {\r\n if (typeof iStartHubFunc === 'function') {\r\n // Only attempt reconnect if the specified retry hasn't been exceeded.\r\n if (!dotnetifyHub.reconnectRetry || dotnetifyHub._reconnectCount < dotnetifyHub.reconnectRetry) {\r\n // Determine reconnect delay from the specified configuration array.\r\n let delay =\r\n dotnetifyHub._reconnectCount < dotnetifyHub.reconnectDelay.length\r\n ? dotnetifyHub.reconnectDelay[dotnetifyHub._reconnectCount]\r\n : dotnetifyHub.reconnectDelay[dotnetifyHub.reconnectDelay.length - 1];\r\n\r\n dotnetifyHub._reconnectCount++;\r\n\r\n setTimeout(function() {\r\n dotnetifyHub._changeState(2);\r\n iStartHubFunc();\r\n }, delay * 1000);\r\n }\r\n else dotnetifyHub._changeState(99);\r\n }\r\n },\r\n\r\n client: {},\r\n\r\n server: {\r\n dispose_VM: function(iVMId) {\r\n dotnetifyHub._connection.invoke('Dispose_VM', iVMId);\r\n },\r\n update_VM: function(iVMId, iValue) {\r\n dotnetifyHub._connection.invoke('Update_VM', iVMId, iValue);\r\n },\r\n request_VM: function(iVMId, iArgs) {\r\n dotnetifyHub._connection.invoke('Request_VM', iVMId, iArgs);\r\n }\r\n }\r\n });\r\n }\r\n else {\r\n // SignalR .NET FX.\r\n dotnetifyHub.type = 'netfx';\r\n\r\n if (window.jQuery) $ = window.jQuery;\r\n\r\n // SignalR hub auto-generated from /signalr/hubs.\r\n /// \r\n /// \r\n (function($, window, undefined) {\r\n /// \r\n 'use strict';\r\n\r\n if (typeof $.signalR !== 'function') {\r\n throw new Error('SignalR: SignalR is not loaded. Please ensure jquery.signalR-x.js is referenced before ~/signalr/js.');\r\n }\r\n\r\n var signalR = $.signalR;\r\n\r\n function makeProxyCallback(hub, callback) {\r\n return function() {\r\n // Call the client hub method\r\n callback.apply(hub, $.makeArray(arguments));\r\n };\r\n }\r\n\r\n function registerHubProxies(instance, shouldSubscribe) {\r\n var key, hub, memberKey, memberValue, subscriptionMethod;\r\n\r\n for (key in instance) {\r\n if (instance.hasOwnProperty(key)) {\r\n hub = instance[key];\r\n\r\n if (!hub.hubName) {\r\n // Not a client hub\r\n continue;\r\n }\r\n\r\n if (shouldSubscribe) {\r\n // We want to subscribe to the hub events\r\n subscriptionMethod = hub.on;\r\n }\r\n else {\r\n // We want to unsubscribe from the hub events\r\n subscriptionMethod = hub.off;\r\n }\r\n\r\n // Loop through all members on the hub and find client hub functions to subscribe/unsubscribe\r\n for (memberKey in hub.client) {\r\n if (hub.client.hasOwnProperty(memberKey)) {\r\n memberValue = hub.client[memberKey];\r\n\r\n if (!$.isFunction(memberValue)) {\r\n // Not a client hub function\r\n continue;\r\n }\r\n\r\n subscriptionMethod.call(hub, memberKey, makeProxyCallback(hub, memberValue));\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n $.hubConnection.prototype.createHubProxies = function() {\r\n var proxies = {};\r\n this.starting(function() {\r\n // Register the hub proxies as subscribed\r\n // (instance, shouldSubscribe)\r\n registerHubProxies(proxies, true);\r\n\r\n this._registerSubscribedHubs();\r\n }).disconnected(function() {\r\n // Unsubscribe all hub proxies when we \"disconnect\". This is to ensure that we do not re-add functional call backs.\r\n // (instance, shouldSubscribe)\r\n registerHubProxies(proxies, false);\r\n });\r\n\r\n proxies['dotNetifyHub'] = this.createHubProxy('dotNetifyHub');\r\n proxies['dotNetifyHub'].client = {};\r\n proxies['dotNetifyHub'].server = {\r\n dispose_VM: function(vmId) {\r\n return proxies['dotNetifyHub'].invoke.apply(proxies['dotNetifyHub'], $.merge([ 'Dispose_VM' ], $.makeArray(arguments)));\r\n },\r\n\r\n request_VM: function(vmId, vmArg) {\r\n return proxies['dotNetifyHub'].invoke.apply(proxies['dotNetifyHub'], $.merge([ 'Request_VM' ], $.makeArray(arguments)));\r\n },\r\n\r\n update_VM: function(vmId, vmData) {\r\n return proxies['dotNetifyHub'].invoke.apply(proxies['dotNetifyHub'], $.merge([ 'Update_VM' ], $.makeArray(arguments)));\r\n }\r\n };\r\n\r\n return proxies;\r\n };\r\n\r\n signalR.hub = $.hubConnection(dotnetifyHub.hubPath, { useDefaultPath: false });\r\n $.extend(signalR, signalR.hub.createHubProxies());\r\n })($, window);\r\n\r\n Object.defineProperty(dotnetifyHub, 'state', {\r\n get: function() {\r\n return $.connection.hub.state;\r\n },\r\n set: function(val) {\r\n $.connection.hub.state = val;\r\n }\r\n });\r\n\r\n Object.defineProperty(dotnetifyHub, 'client', {\r\n get: function() {\r\n return $.connection.dotNetifyHub.client;\r\n }\r\n });\r\n\r\n Object.defineProperty(dotnetifyHub, 'server', {\r\n get: function() {\r\n return $.connection.dotNetifyHub.server;\r\n }\r\n });\r\n\r\n Object.defineProperty(dotnetifyHub, 'isConnected', {\r\n get: function() {\r\n return $.connection.hub.state == $.signalR.connectionState.connected;\r\n }\r\n });\r\n\r\n dotnetifyHub = $.extend(dotnetifyHub, {\r\n hubPath: iHubPath || '/signalr',\r\n url: iServerUrl,\r\n\r\n _reconnectCount: 0,\r\n _stateChangedHandler: function(iNewState) {},\r\n\r\n start: function(iHubOptions) {\r\n if (dotnetifyHub.url) $.connection.hub.url = dotnetifyHub.url;\r\n\r\n let deferred;\r\n if (iHubOptions) deferred = $.connection.hub.start(iHubOptions);\r\n else deferred = $.connection.hub.start();\r\n deferred.fail(function(error) {\r\n if (error.source && error.source.message === 'Error parsing negotiate response.')\r\n console.warn('This client may be attempting to connect to an incompatible SignalR .NET Core server.');\r\n });\r\n return deferred;\r\n },\r\n\r\n disconnected: function(iHandler) {\r\n return $.connection.hub.disconnected(iHandler);\r\n },\r\n\r\n stateChanged: function(iHandler) {\r\n dotnetifyHub._stateChangedHandler = iHandler;\r\n return $.connection.hub.stateChanged(function(state) {\r\n if (state == 1) dotnetifyHub._reconnectCount = 0;\r\n\r\n let stateText = { 0: 'connecting', 1: 'connected', 2: 'reconnecting', 4: 'disconnected' };\r\n iHandler(stateText[state.newState]);\r\n });\r\n },\r\n\r\n reconnect: function(iStartHubFunc) {\r\n if (typeof iStartHubFunc === 'function') {\r\n // Only attempt reconnect if the specified retry hasn't been exceeded.\r\n if (!dotnetifyHub.reconnectRetry || dotnetifyHub._reconnectCount < dotnetifyHub.reconnectRetry) {\r\n // Determine reconnect delay from the specified configuration array.\r\n let delay =\r\n dotnetifyHub._reconnectCount < dotnetifyHub.reconnectDelay.length\r\n ? dotnetifyHub.reconnectDelay[dotnetifyHub._reconnectCount]\r\n : dotnetifyHub.reconnectDelay[dotnetifyHub.reconnectDelay.length - 1];\r\n\r\n dotnetifyHub._reconnectCount++;\r\n\r\n setTimeout(function() {\r\n dotnetifyHub._stateChangedHandler('reconnecting');\r\n iStartHubFunc();\r\n }, delay * 1000);\r\n }\r\n else dotnetifyHub._stateChangedHandler('terminated');\r\n }\r\n }\r\n });\r\n }\r\n\r\n // Setup SignalR server method handler.\r\n dotnetifyHub.client.response_VM = function(iVMId, iVMData) {\r\n // SignalR .NET Core is sending an array of arguments.\r\n if (Array.isArray(iVMId)) {\r\n iVMData = iVMId[1];\r\n iVMId = iVMId[0];\r\n }\r\n\r\n let handled = dotnetifyHub.responseEvent.emit(iVMId, iVMData);\r\n\r\n // If we get to this point, that means the server holds a view model instance\r\n // whose view no longer existed. So, tell the server to dispose the view model.\r\n if (!handled) dotnetifyHub.server.dispose_VM(iVMId);\r\n };\r\n\r\n // On disconnected, keep attempting to start the connection.\r\n dotnetifyHub.disconnected(function() {\r\n dotnetifyHub._startInfo = null;\r\n dotnetifyHub.reconnect(function() {\r\n dotnetifyHub.reconnectedEvent.emit();\r\n });\r\n });\r\n };\r\n\r\n return dotnetifyHub;\r\n }\r\n}\r\n\r\nexport default dotnetifyHubFactory.create();\r\n","/* \r\nCopyright 2017-2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport dotnetifyHub, { dotnetifyHubFactory } from './dotnetify-hub';\r\nimport localHub, { hasLocalVM } from './dotnetify-hub-local';\r\nimport webApiHub, { createWebApiHub } from './dotnetify-hub-webapi';\r\n\r\nexport class dotnetifyFactory {\r\n static create() {\r\n const dotnetify = {\r\n // SignalR hub options.\r\n hub: dotnetifyHub,\r\n hubOptions: { transport: [ 'webSockets', 'longPolling' ] },\r\n hubPath: null,\r\n\r\n // Debug mode.\r\n debug: false,\r\n debugFn: null,\r\n\r\n // Offline mode. (WIP)\r\n offline: false,\r\n isOffline: true,\r\n offlineTimeout: 5000,\r\n offlineCacheFn: null,\r\n\r\n // Internal variables.\r\n _vmAccessors: [],\r\n\r\n // Use this to get notified of connection state changed events.\r\n // (state, exception, hub) => void\r\n connectionStateHandler: null,\r\n\r\n // Use this intercept a view model prior to establishing connection,\r\n // with the option to provide any connect parameters.\r\n // ({vmId, options}) => {vmId, options, hub}\r\n connectHandler: null,\r\n\r\n // Support changing hub server URL after first init.\r\n get hubServerUrl() {\r\n return this.hub.url;\r\n },\r\n\r\n set hubServerUrl(url) {\r\n this.hub.url = url;\r\n if (this.debug) console.log('SignalR: connecting to ' + this.hubServerUrl);\r\n if (this.hub.isHubStarted) this.startHub(this.hub, true);\r\n },\r\n\r\n // Generic connect function for non-React app.\r\n connect(iVMId, iOptions) {\r\n return dotnetify.react.connect(iVMId, {}, iOptions);\r\n },\r\n\r\n // Creates a SignalR hub client.\r\n createHub(hubServerUrl, hubPath, hubLib) {\r\n return this.initHub(dotnetifyHubFactory.create(), hubPath, hubServerUrl, hubLib);\r\n },\r\n\r\n // Creates a Web API hub client.\r\n createWebApiHub(baseUrl, onRequestHandler) {\r\n return createWebApiHub(baseUrl, onRequestHandler);\r\n },\r\n\r\n // Configures hub connection to SignalR hub server.\r\n initHub(hub, hubPath, hubServerUrl, hubLib) {\r\n hub = hub || this.hub;\r\n hubPath = hubPath || this.hubPath;\r\n hubServerUrl = hubServerUrl || this.hubServerUrl;\r\n hubLib = hubLib || this.hubLib;\r\n\r\n if (!hub.isHubStarted) {\r\n hub.init(hubPath, hubServerUrl, hubLib);\r\n\r\n // Use SignalR event to raise the connection state event.\r\n hub.stateChanged(state => this.handleConnectionStateChanged(state, null, hub));\r\n }\r\n return hub;\r\n },\r\n\r\n // Used by a view to select a hub, and provides the opportunity to override any connect info.\r\n selectHub(vmConnectArgs) {\r\n vmConnectArgs = vmConnectArgs || {};\r\n vmConnectArgs.options = vmConnectArgs.options || {};\r\n let override = (typeof this.connectHandler == 'function' && this.connectHandler(vmConnectArgs)) || {};\r\n if (!override.hub) {\r\n override.hub = hasLocalVM(vmConnectArgs.vmId) ? localHub : vmConnectArgs.options.webApi ? webApiHub : this.initHub();\r\n override.hub.debug = this.debug;\r\n }\r\n return Object.assign(vmConnectArgs, override);\r\n },\r\n\r\n // Starts hub connection to SignalR hub server.\r\n startHub(hub, forceRestart) {\r\n hub = hub || this.hub;\r\n\r\n const doneHandler = () => {};\r\n const failHandler = ex => this.handleConnectionStateChanged('error', ex, hub);\r\n hub.startHub(this.hubOptions, doneHandler, failHandler, forceRestart);\r\n },\r\n\r\n // Used by dotnetify-react and -vue to expose their view model accessors.\r\n addVMAccessor(vmAccessor) {\r\n !this._vmAccessors.includes(vmAccessor) && this._vmAccessors.push(vmAccessor);\r\n },\r\n\r\n checkServerSideException(iVMId, iVMData, iExceptionHandler) {\r\n const vmData = JSON.parse(iVMData);\r\n if (vmData && vmData.hasOwnProperty('ExceptionType') && vmData.hasOwnProperty('Message')) {\r\n const exception = { name: vmData.ExceptionType, message: vmData.Message };\r\n\r\n if (typeof iExceptionHandler === 'function') {\r\n return iExceptionHandler(exception);\r\n }\r\n else {\r\n console.error('[' + iVMId + '] ' + exception.name + ': ' + exception.message);\r\n throw exception;\r\n }\r\n }\r\n },\r\n\r\n // Get all view models.\r\n getViewModels() {\r\n return this._vmAccessors\r\n .reduce((prev, current) => [ ...prev, ...current() ], [])\r\n .filter((val, idx, self) => self.indexOf(val) === idx); // returns distinct items.\r\n },\r\n\r\n handleConnectionStateChanged(iState, iException, iHub) {\r\n if (this.debug) console.log('SignalR: ' + (iException ? iException.message : iState));\r\n if (typeof this.connectionStateHandler === 'function') this.connectionStateHandler(iState, iException, iHub);\r\n else if (iException) console.error(iException);\r\n }\r\n };\r\n\r\n return dotnetify;\r\n }\r\n}\r\n\r\nexport default dotnetifyFactory.create();\r\n","import dotnetify from './dotnetify-vue';\r\nimport './dotnetify-vue.router';\r\nimport Scope from './Scope';\r\nimport './directives';\r\n\r\ndotnetify.vue.Scope = Scope;\r\nmodule.exports = Object.assign(dotnetify, { Scope });\r\n"],"sourceRoot":""} \ No newline at end of file diff --git a/DevApp/dist/dist/dotnetify-vue.min.js b/DevApp/dist/dist/dotnetify-vue.min.js index 2661baed..459ad8e8 100644 --- a/DevApp/dist/dist/dotnetify-vue.min.js +++ b/DevApp/dist/dist/dotnetify-vue.min.js @@ -1,7 +1,7 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("vue"),require("@aspnet/signalr")):"function"==typeof define&&define.amd?define(["vue","@aspnet/signalr"],e):"object"==typeof exports?exports.dotnetify=e(require("vue"),require("@aspnet/signalr")):t.dotnetify=e(t.Vue,t.signalR)}(window,function(t,e){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=22)}([function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var n=0;n=0;)t=t.substr(0,t.length-1);for(;0==t.indexOf("/");)t=t.substr(1,t.length-1);return t}},{key:"equal",value:function(t,e){return null!=t&&null!=e&&t.toLowerCase()==e.toLowerCase()}},{key:"startsWith",value:function(t,e){return t.toLowerCase().slice(0,e.length)==e.toLowerCase()}},{key:"endsWith",value:function(t,e){return""==e||t.toLowerCase().slice(-e.length)==e.toLowerCase()}},{key:"dispatchEvent",value:function(t){if("function"==typeof Event)r.dispatchEvent(new Event(t));else{var e=document.createEvent("CustomEvent");e.initEvent(t,!0,!0),r.dispatchEvent(e)}}},{key:"grep",value:function(t,e){return Array.isArray(t)?t.filter(e):[]}}]),t}();e.createEventEmitter=function(t){var e=[];return{emit:function(){for(var t=arguments.length,n=Array(t),r=0;r=200&&o.status<400){var e=o.responseText;document.querySelector(t).innerHTML=e,r.call(document.querySelector(t))}},o.send(),{abort:function(t){return o.abort(t)}}}})},u,{support:{cors:!0},trim:function(t){return"string"==typeof t?t.trim():t},inArray:function(t,e){return-1!==t.indexOf(e)},makeArray:function(t){return[].slice.call(t,0)},merge:function(t,e){return Array.prototype.push.apply(t,e),t},isEmptyObject:function(t){return!t||0===Object.keys(t).length},ajax:function(t){var e=new i.XMLHttpRequest;return e.onreadystatechange=function(){if(4===e.readyState)if(200!==e.status||e._hasError)t.error&&t.error(e);else try{t.success&&t.success(JSON.parse(e.responseText))}catch(n){t.success&&t.success(e.responseText)}},e.open(t.type,t.url),e.setRequestHeader("content-type",t.contentType),e.send(t.data.data&&"data="+t.data.data),{abort:function(t){return e.abort(t)}}},getScript:function(t,e){var n=!1,r=u.Deferred(),o=document.getElementsByTagName("head")[0],i=document.createElement("script");return i.src=t,i.onload=i.onreadystatechange=function(){n||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(n=!0,i.onload=i.onreadystatechange=null,o.removeChild(i),"function"==typeof e&&e(),r.resolve())},o.appendChild(i),r}});void 0!==i&&(i.jQuery=i.jQuery||a),"object"===o(e)&&"object"===o(r)&&(r.exports=a)}).call(this,n(0),n(19)(t))},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e map "+r+" to template id="+e.Id),t.router.mapTo(r,function(r){t.router.urlPath="";var o=n;for(var i in r)o=o.replace(":"+i,r[i]);o=o.replace(/\(\/:([^)]+)\)/g,"").replace(/\(|\)/g,""),t.routeTo(o,e)})});var r=this.toUrl(this.RoutingState.Active);""==this.router.urlPath&&(this.router.urlPath=r),this.routeUrl()||this.raiseRoutedEvent(!0)}}else console.error("router> the RoutingState prop of '"+e.$vmId+"' was not initialized.")}},{key:"isActive",value:function(t){return!(null==t||!t.hasOwnProperty("Path"))&&i.default.equal(t.Path,this.RoutingState.Active)}},{key:"loadHtmlView",value:function(t,e,n,r){var o=this.vm;this.unmountView(t),$(t).load(e,null,function(){if(null!=n){var t=n.split(",").map(function(t){return $.getScript(t)});$.when.apply($,t).done(function(){return"function"==typeof callbackFn&&r.call(o)})}else"function"==typeof callbackFn&&r.call(o)})}},{key:"loadHtmlElementView",value:function(t,e,n,r,o){var i=this,u=this.vm,a=function(){i.unmountView(t);for(var n=document.querySelector(t);n.firstChild;)n.removeChild(n.firstChild);n.appendChild(e),"function"==typeof callbackFn&&o.call(u)};if(null==n)a();else{var s=n.split(",").map(function(t){return $.getScript(t)});$.when.apply($,s).done(a)}}},{key:"loadView",value:function(t,e,n,r,o){throw new Error("Not implemented")}},{key:"manualRouteTo",value:function(t,e,n,r){this.vm;var o={Id:"manual",Target:e,ViewUrl:n,JSModuleUrl:r};this.routeTo(t,o,!0)}},{key:"onRouteEnter",value:function(t,e){return!0}},{key:"raiseRoutedEvent",value:function(t){this.vm;""!=this.router.urlPath&&1!=t||(this.debug&&console.log("router> routed"),i.default.dispatchEvent("dotnetify.routed"))}},{key:"route",value:function(t,e){if(null!=t){if(!t.hasOwnProperty("Path")&&!t.hasOwnProperty("TemplateId"))throw new Error("Not a valid route");this.initRoot();var n=t.Path,r=null;if(this.hasRoutingState&&null!=this.RoutingState.Templates&&null!=t.TemplateId){var o=this.RoutingState.Templates.filter(function(e){return e.Id==t.TemplateId});if(o.length>0)r=o[0],"string"==typeof e&&(r.Target=e),null==n&&(n=null!=r.UrlPattern?r.UrlPattern:r.Id,t.Path=n);else if(null==t.RedirectRoot)throw new Error("vmRoute cannot find route template "+t.TemplateId)}if(null!=t.RedirectRoot){var i=t.RedirectRoot;"/"==i.charAt(0)&&(i=i.substr(0,i.length-1));var u=t.RedirectRoot.split("/"),a="",s=this.VMRoot;if(null!=s)for(var c=s.split("/"),l=0;l0?f:"/",this.routes.some(function(t){return t.Path===n})||this.routes.push({Path:n,Url:f}),f}}},{key:"routeTo",value:function(t,e,n,r,o){var a=this,s=this.vm,c=s.$dotnetify.getViewModels();this.debug&&console.log("router> route '"+t+"' to template id="+e.Id);for(var l=0;l target '"+e.Target+"' not found in DOM")):(this.debug&&console.log("router> target '"+e.Target+"' not found in DOM, use redirect instead"),this.router.redirect(this.toUrl(t),[].concat(u(c),u(s.$dotnetify.controller.getViewModels())))):void this.loadView("#"+e.Target,e.ViewUrl,e.JSModuleUrl,{"RoutingState.Origin":t},function(){a.dispatchActiveRoutingState(t),1!=n&&s.hasOwnProperty("onRouteExit")&&s.onRouteExit(t,e),"function"==typeof r&&r.call(s)});console.error("router> the Target for template '"+e.Id+"' was not set. Use vm.onRouteEnter() to set the target.")}}},{key:"routeToRoute",value:function(t){var e=this,n=this.vm.$route(t);if(null==n||""==n)throw new Error("The route passed to $routeTo is invalid.");setTimeout(function(){return e.router.pushState({},"",n)})}},{key:"routeUrl",value:function(t){var e=this;if(!this.hasRoutingState)return!1;var n=!!t,r=this.RoutingState.Root;if(null==r)return!1;var o=n?t:this.router.urlPath;if(this.debug&&console.log("router> routing "+o),i.default.equal(o,r)||i.default.equal(o,r+"/")||"/"===o){var u=i.default.grep(this.RoutingState.Templates,function(t){return""===t.UrlPattern});return u.length>0&&(this.routeTo("",u[0],null,null,n),this.router.urlPath="",this.raiseRoutedEvent(),!0)}if(r+="/",i.default.startsWith(o,r)){var a=null,s=i.default.grep(this.routes,function(t){return i.default.startsWith(o+"/",t.Url+"/")});if(s.length>0)for(var c=0;c the RoutingState prop of '"+i.$vmId+"' was not initialized.");var a=this.VMRoot;u={vmRoot:a=null!=a?"/"+c.default.trim(this.RoutingState.Root)+"/"+c.default.trim(a):this.RoutingState.Root,vmArg:r}}if(e=this.router.overrideUrl(e,t),n=this.router.overrideUrl(n,t),c.default.endsWith(e,"html"))this.loadHtmlView(t,e,n,o);else{var s=e;"string"==typeof e&&f.hasOwnProperty(e)&&(s=Object.assign({},f[e])),s instanceof HTMLElement?this.loadHtmlElementView(t,s,n,u,o):this.loadVueView(t,s,n,u,o)}}},{key:"loadVueView",value:function(t,e,n,i,a){var c=this;return new Promise(function(l,f){var d=c.vm,h=c.vm?c.vm.$vmId:"",p=function(){var n=e;if("object"!==(void 0===e?"undefined":o(e))||"function"!=typeof e.render&&!e.template)return console.error("["+h+"] failed to load view '"+e+"' because it's not a Vue element."),void f();c.unmountView(t);var s="function"==typeof n.data?n.data():n.data||{};if(s.hasOwnProperty("RoutingState")||(s.RoutingState={},n.data=function(){return s}),i)for(var p in n.props=n.props||{},i)n.props.hasOwnProperty(p)||(n.props[p]={type:null});var v=new(u.default.extend(n))({propsData:r({},i)});document.querySelector(t).innerHTML="
",v.$mount(t+" > div"),c.mountedComponents[t]=function(){return v.$destroy()},"function"==typeof a&&a.call(d,v),l(v)};if(null==n)p();else{var v=n.split(",").map(function(t){return s.default.getScript(t)});s.default.when.apply(s.default,v).done(p)}})}},{key:"unmountView",value:function(t){this.mountedComponents||(this.mountedComponents={});var e=this.mountedComponents[t];"function"==typeof e&&(e(),delete this.mountedComponents[t])}}]),e}();e.default=d}).call(this,n(0))},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var n=n||t||{},r={version:"0.8.5",map:function(t){return r.routes.defined.hasOwnProperty(t)?r.routes.defined[t]:new r.core.route(t)},root:function(t){r.routes.root=t},rescue:function(t){r.routes.rescue=t},history:{initial:{},pushState:function(t,e,o){r.history.supported?r.dispatch(o)&&history.pushState(t,e,o):r.history.fallback&&(n.location.hash="#"+o)},popState:function(t){var e=!r.history.initial.popped&&location.href==r.history.initial.URL;r.history.initial.popped=!0,e||r.dispatch("/"===document.location.pathname?"":document.location.pathname)},listen:function(t){if(r.history.supported=!(!n.history||!n.history.pushState),r.history.fallback=t,r.history.supported)r.history.initial.popped="state"in n.history,r.history.initial.URL=location.href,n.onpopstate=r.history.popState;else if(r.history.fallback){for(route in r.routes.defined)"#"!=route.charAt(0)&&(r.routes.defined["#"+route]=r.routes.defined[route],r.routes.defined["#"+route].path="#"+route);r.listen()}}},match:function(t,e){var n,o,i,u,a,s,c={},l=null;for(l in r.routes.defined)if(null!==l&&void 0!==l)for(n=(l=r.routes.defined[l]).partition(),u=0;u0)for(i=0;i=8)?n.onhashchange=t:setInterval(t,50),""!==location.hash&&r.dispatch(location.hash)},core:{route:function(t){this.path=t,this.action=null,this.do_enter=[],this.do_exit=null,this.params={},r.routes.defined[t]=this}},routes:{current:null,root:null,rescue:null,previous:null,defined:{}}};r.core.route.prototype={to:function(t){return this.action=t,this},enter:function(t){return t instanceof Array?this.do_enter=this.do_enter.concat(t):this.do_enter.push(t),this},exit:function(t){return this.do_exit=t,this},partition:function(){for(var t,e,n=[],r=[],o=/\(([^}]+?)\)/g;t=o.exec(this.path);)n.push(t[1]);for(r.push(this.path.split("(")[0]),e=0;e0)for(t=0;t0?t:"/",void 0!==o.default&&o.default.map(t).to(function(){e(this.params)})}},{key:"match",value:function(t){if(void 0!==o.default){var e=o.default.match(t,!0);if(null!=e)return e.run(),!0}return!1}},{key:"overrideUrl",value:function(t){return t}},{key:"pushState",value:function(t,e,n){this.urlPath="",void 0!==o.default&&o.default.history.pushState(t,e,n)}},{key:"redirect",value:function(t,e){this.urlPath=t;for(var n=0;n redirected"))}i.location.replace(t)}},{key:"$ready",value:function(){this.$router.initRouting()}},{key:"$update",value:function(t){t&&t.RoutingState&&this.$router.initRouting()}}]),t}();e.default=u}).call(this,n(0))},function(t,e,n){"use strict";var r=u(n(3)),o=u(n(10)),i=u(n(8));function u(t){return t&&t.__esModule?t:{default:t}}r.default.vue.router=new o.default(r.default.debug),r.default.vue.router.$inject=function(t){var e=new i.default(t,r.default.vue.router);t.$router=e,t.$route=function(t,n){return e.route(t,n)},t.$handleRoute=function(t){return e.handleRoute(t)},t.$routeTo=function(t){return e.routeToRoute(t)}},r.default.vue.router.$mount=function(t,e,n,r){return i.default.prototype.loadVueView(t,e,null,n,r)},r.default.vue.plugins.router=r.default.vue.router},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n "),console.log(t),e.debugFn&&e.debugFn(this.$vmId,"sent",t))}catch(t){e.handleConnectionStateChanged("error",t,this.$hub)}}}},{key:"$dispatchListState",value:function(t){var e=this,n=function(){var n=e.$itemKey[o];return n?(i=t[o])[n]?(Object.keys(i).forEach(function(t){if(t!=n){var r={};r[o+".$"+i[n]+"."+t]=i[t],e.$dispatch(r)}}),void e.$updateList(o,i)):(console.error("["+e.$vmId+"] couldn't dispatch data from '"+o+"' due to missing property '"+n+"'."),console.error(i),{v:void 0}):(console.error("["+e.$vmId+"] missing item key for '"+o+"'; add "+o+"_itemKey property to the view model."),{v:void 0})};for(var o in t){var i,u=n();if("object"===(void 0===u?"undefined":r(u)))return u.v}}},{key:"$getPlugins",value:function(){var t=this;return Object.keys(this.$dotnetify.plugins).map(function(e){return t.$dotnetify.plugins[e]})}},{key:"$preProcess",value:function(t){for(var e in t){if(null==(n=/(.*)_add/.exec(e))){if(null==(n=/(.*)_update/.exec(e))){if(null==(n=/(.*)_remove/.exec(e))){var n;if(null==(n=/(.*)_itemKey/.exec(e)));else{var r={};r[i=n[1]]=t[e],this.$setItemKey(r),delete t[e]}}else{i=n[1];if(Array.isArray(this.State()[i])){var o=this.$itemKey[i];null!=o?this.$removeList(i,function(n){return n[o]==t[e]}):console.error("["+this.$vmId+"] missing item key for '"+i+"'; add "+i+"_itemKey property to the view model.")}else console.error("["+this.$vmId+"] '"+i+"' is not found or not an array.");delete t[e]}}else{var i=n[1];Array.isArray(this.State()[i])?this.$updateList(i,t[e]):console.error("["+this.$vmId+"] '"+i+"' is not found or not an array."),delete t[e]}}else{var i=n[1];Array.isArray(this.State()[i])?this.$addList(i,t[e]):console.error("unable to resolve "+e),delete t[e]}}}},{key:"$request",value:function(){this.$hub.isConnected&&this.$hub.requestVM(this.$vmId,{$vmArg:this.$vmArg,$headers:this.$headers}),this.$requested=!0}},{key:"$update",value:function(t){var e=this.$dotnetify.controller;e.debug&&(console.log("["+this.$vmId+"] received> "),console.log(JSON.parse(t)),e.debugFn&&e.debugFn(this.$vmId,"received",JSON.parse(t)));var n=JSON.parse(t);this.$preProcess(n);var r=this.State();r=i.default.extend({},r,n),this.State(r),this.$loaded?this.$onUpdate(n):this.$onLoad()}},{key:"$onLoad",value:function(){var t=this;this.$getPlugins().map(function(e){return"function"==typeof e.$ready?e.$ready.apply(t):null}),this.$loaded=!0}},{key:"$onUpdate",value:function(t){var e=this;this.$getPlugins().map(function(n){return"function"==typeof n.$update?n.$update.apply(e,[t]):null})}},{key:"$setItemKey",value:function(t){Object.assign(this.$itemKey,t)}},{key:"$addList",value:function(t,e){var n=this.$itemKey[t];if(null!=n){if(!e.hasOwnProperty(n))return void console.error("["+this.$vmId+"] couldn't add item to '"+t+"' due to missing property '"+n+"'.");if(this.State()[t].filter(function(t){return t[n]==e[n]}).length>0)return void console.error("["+this.$vmId+"] couldn't add item to '"+t+"' because the key already exists.")}var r=this.State()[t];r.push(e);var o={};o[t]=r,this.State(o)}},{key:"$removeList",value:function(t,e){var n={};n[t]=this.State()[t].filter(function(t){return!e(t)}),this.State(n)}},{key:"$updateList",value:function(t,e){var n=this.$itemKey[t];if(null!=n){if(!e.hasOwnProperty(n))return void console.error("["+this.$vmId+"] couldn't update item to '"+t+"' due to missing property '"+n+"'.");var r={};r[t]=this.State()[t].map(function(t){return t[n]==e[n]?i.default.extend(t,e):t}),this.State(r)}else console.error("["+this.$vmId+"] missing item key for '"+t+"'; add '"+t+"_itemKey' property to the view model.")}}]),t}();e.default=u}).call(this,n(0))},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.hasLocalVM=e.dotNetifyHubLocal=void 0;var r=function(){function t(t,e){for(var n=0;n-1;)l.splice(n,1),u&&(n<=s&&s--,n<=c&&c--)}),this},has:function(t){return r.inArray(t,l)>-1},empty:function(){return l=[],this},disable:function(){return l=f=e=void 0,this},disabled:function(){return!l},lock:function(){return f=void 0,e||h.disable(),this},locked:function(){return!f},fireWith:function(t,e){return e=[t,(e=e||[]).slice?e.slice():e],!l||n&&!f||(u?f.push(e):d(e)),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!n}};return h}},function(t,e,n){ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("vue"),require("@aspnet/signalr")):"function"==typeof define&&define.amd?define(["vue","@aspnet/signalr"],e):"object"==typeof exports?exports.dotnetify=e(require("vue"),require("@aspnet/signalr")):t.dotnetify=e(t.Vue,t.signalR)}(window,function(t,e){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=23)}([function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var n=0;n=0;)t=t.substr(0,t.length-1);for(;0==t.indexOf("/");)t=t.substr(1,t.length-1);return t}},{key:"equal",value:function(t,e){return null!=t&&null!=e&&t.toLowerCase()==e.toLowerCase()}},{key:"startsWith",value:function(t,e){return t.toLowerCase().slice(0,e.length)==e.toLowerCase()}},{key:"endsWith",value:function(t,e){return""==e||t.toLowerCase().slice(-e.length)==e.toLowerCase()}},{key:"dispatchEvent",value:function(t){if("function"==typeof Event)r.dispatchEvent(new Event(t));else{var e=document.createEvent("CustomEvent");e.initEvent(t,!0,!0),r.dispatchEvent(e)}}},{key:"grep",value:function(t,e){return Array.isArray(t)?t.filter(e):[]}}]),t}();e.createEventEmitter=function(t){var e=[];return{emit:function(){for(var t=arguments.length,n=Array(t),r=0;r=200&&a.status<400){var t=a.responseText;i(t)}else u(a)},a.onerror=function(){u(a)},a.send(n)})};e.default=new o}).call(this,n(0))},function(t,e,n){"use strict";(function(t,r){var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=i||t||{},u=n(19),a=u.extend(function(t){return t===i||t.document?{0:t,on:function(t,e){i.addEventListener(t,e)},bind:function(t,e){i.addEventListener(t,e,!1)},unbind:function(t,e){i.removeEventListener(t,e,!1)}}:("string"!=typeof t&&(t.events=t.events||{}),{0:t,bind:function(e,n){var r=t.events[e]||[];r.push(n),t.events[e]=r},unbind:function(e,n){var r=t.events[e]||[];if(n){var o=r.indexOf(n);-1!==o&&r.splice(o,1)}else r=[];t.events[e]=r},triggerHandler:function(e,n){var r=t.events[e]||[],o=[{type:e}];Array.isArray(n)?n.forEach(function(t){o.push(t)}):n&&o.push(n),r.forEach(function(t){t.apply(this,o)})},load:function(e,n,r){var o=new i.XMLHttpRequest;return o.open("GET",e,!0),o.onload=function(){if(o.status>=200&&o.status<400){var e=o.responseText;document.querySelector(t).innerHTML=e,r.call(document.querySelector(t))}},o.send(),{abort:function(t){return o.abort(t)}}}})},u,{support:{cors:!0},trim:function(t){return"string"==typeof t?t.trim():t},inArray:function(t,e){return-1!==t.indexOf(e)},makeArray:function(t){return[].slice.call(t,0)},merge:function(t,e){return Array.prototype.push.apply(t,e),t},isEmptyObject:function(t){return!t||0===Object.keys(t).length},ajax:function(t){var e=new i.XMLHttpRequest;return e.onreadystatechange=function(){if(4===e.readyState)if(200!==e.status||e._hasError)t.error&&t.error(e);else try{t.success&&t.success(JSON.parse(e.responseText))}catch(n){t.success&&t.success(e.responseText)}},e.open(t.type,t.url),e.setRequestHeader("content-type",t.contentType),e.send(t.data.data&&"data="+t.data.data),{abort:function(t){return e.abort(t)}}},getScript:function(t,e){var n=!1,r=u.Deferred(),o=document.getElementsByTagName("head")[0],i=document.createElement("script");return i.src=t,i.onload=i.onreadystatechange=function(){n||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(n=!0,i.onload=i.onreadystatechange=null,o.removeChild(i),"function"==typeof e&&e(),r.resolve())},o.appendChild(i),r}});void 0!==i&&(i.jQuery=i.jQuery||a),"object"===o(e)&&"object"===o(r)&&(r.exports=a)}).call(this,n(0),n(20)(t))},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e map "+r+" to template id="+e.Id),t.router.mapTo(r,function(r){t.router.urlPath="";var o=n;for(var i in r)o=o.replace(":"+i,r[i]);o=o.replace(/\(\/:([^)]+)\)/g,"").replace(/\(|\)/g,""),t.routeTo(o,e)})});var r=this.toUrl(this.RoutingState.Active);""==this.router.urlPath&&(this.router.urlPath=r),this.routeUrl()||this.raiseRoutedEvent(!0)}}else console.error("router> the RoutingState prop of '"+e.$vmId+"' was not initialized.")}},{key:"isActive",value:function(t){return!(null==t||!t.hasOwnProperty("Path"))&&i.default.equal(t.Path,this.RoutingState.Active)}},{key:"loadHtmlView",value:function(t,e,n,r){var o=this.vm;this.unmountView(t),$(t).load(e,null,function(){if(null!=n){var t=n.split(",").map(function(t){return $.getScript(t)});$.when.apply($,t).done(function(){return"function"==typeof callbackFn&&r.call(o)})}else"function"==typeof callbackFn&&r.call(o)})}},{key:"loadHtmlElementView",value:function(t,e,n,r,o){var i=this,u=this.vm,a=function(){i.unmountView(t);for(var n=document.querySelector(t);n.firstChild;)n.removeChild(n.firstChild);n.appendChild(e),"function"==typeof callbackFn&&o.call(u)};if(null==n)a();else{var s=n.split(",").map(function(t){return $.getScript(t)});$.when.apply($,s).done(a)}}},{key:"loadView",value:function(t,e,n,r,o){throw new Error("Not implemented")}},{key:"manualRouteTo",value:function(t,e,n,r){this.vm;var o={Id:"manual",Target:e,ViewUrl:n,JSModuleUrl:r};this.routeTo(t,o,!0)}},{key:"onRouteEnter",value:function(t,e){return!0}},{key:"raiseRoutedEvent",value:function(t){this.vm;""!=this.router.urlPath&&1!=t||(this.debug&&console.log("router> routed"),i.default.dispatchEvent("dotnetify.routed"))}},{key:"route",value:function(t,e){if(null!=t){if(!t.hasOwnProperty("Path")&&!t.hasOwnProperty("TemplateId"))throw new Error("Not a valid route");this.initRoot();var n=t.Path,r=null;if(this.hasRoutingState&&null!=this.RoutingState.Templates&&null!=t.TemplateId){var o=this.RoutingState.Templates.filter(function(e){return e.Id==t.TemplateId});if(o.length>0)r=o[0],"string"==typeof e&&(r.Target=e),null==n&&(n=null!=r.UrlPattern?r.UrlPattern:r.Id,t.Path=n);else if(null==t.RedirectRoot)throw new Error("vmRoute cannot find route template "+t.TemplateId)}if(null!=t.RedirectRoot){var i=t.RedirectRoot;"/"==i.charAt(0)&&(i=i.substr(0,i.length-1));var u=t.RedirectRoot.split("/"),a="",s=this.VMRoot;if(null!=s)for(var c=s.split("/"),l=0;l0?f:"/",this.routes.some(function(t){return t.Path===n})||this.routes.push({Path:n,Url:f}),f}}},{key:"routeTo",value:function(t,e,n,r,o){var a=this,s=this.vm,c=s.$dotnetify.getViewModels();this.debug&&console.log("router> route '"+t+"' to template id="+e.Id);for(var l=0;l target '"+e.Target+"' not found in DOM")):(this.debug&&console.log("router> target '"+e.Target+"' not found in DOM, use redirect instead"),this.router.redirect(this.toUrl(t),[].concat(u(c),u(s.$dotnetify.controller.getViewModels())))):void this.loadView("#"+e.Target,e.ViewUrl,e.JSModuleUrl,{"RoutingState.Origin":t},function(){a.dispatchActiveRoutingState(t),1!=n&&s.hasOwnProperty("onRouteExit")&&s.onRouteExit(t,e),"function"==typeof r&&r.call(s)});console.error("router> the Target for template '"+e.Id+"' was not set. Use vm.onRouteEnter() to set the target.")}}},{key:"routeToRoute",value:function(t){var e=this,n=this.vm.$route(t);if(null==n||""==n)throw new Error("The route passed to $routeTo is invalid.");setTimeout(function(){return e.router.pushState({},"",n)})}},{key:"routeUrl",value:function(t){var e=this;if(!this.hasRoutingState)return!1;var n=!!t,r=this.RoutingState.Root;if(null==r)return!1;var o=n?t:this.router.urlPath;if(this.debug&&console.log("router> routing "+o),i.default.equal(o,r)||i.default.equal(o,r+"/")||"/"===o){var u=i.default.grep(this.RoutingState.Templates,function(t){return""===t.UrlPattern});return u.length>0&&(this.routeTo("",u[0],null,null,n),this.router.urlPath="",this.raiseRoutedEvent(),!0)}if(r+="/",i.default.startsWith(o,r)){var a=null,s=i.default.grep(this.routes,function(t){return i.default.startsWith(o+"/",t.Url+"/")});if(s.length>0)for(var c=0;c the RoutingState prop of '"+i.$vmId+"' was not initialized.");var a=this.VMRoot;u={vmRoot:a=null!=a?"/"+c.default.trim(this.RoutingState.Root)+"/"+c.default.trim(a):this.RoutingState.Root,vmArg:r}}if(e=this.router.overrideUrl(e,t),n=this.router.overrideUrl(n,t),c.default.endsWith(e,"html"))this.loadHtmlView(t,e,n,o);else{var s=e;"string"==typeof e&&f.hasOwnProperty(e)&&(s=Object.assign({},f[e])),s instanceof HTMLElement?this.loadHtmlElementView(t,s,n,u,o):this.loadVueView(t,s,n,u,o)}}},{key:"loadVueView",value:function(t,e,n,i,a){var c=this;return new Promise(function(l,f){var d=c.vm,h=c.vm?c.vm.$vmId:"",p=function(){var n=e;if("object"!==(void 0===e?"undefined":o(e))||"function"!=typeof e.render&&!e.template)return console.error("["+h+"] failed to load view '"+e+"' because it's not a Vue element."),void f();c.unmountView(t);var s="function"==typeof n.data?n.data():n.data||{};if(s.hasOwnProperty("RoutingState")||(s.RoutingState={},n.data=function(){return s}),i)for(var p in n.props=n.props||{},i)n.props.hasOwnProperty(p)||(n.props[p]={type:null});var v=new(u.default.extend(n))({propsData:r({},i)});document.querySelector(t).innerHTML="
",v.$mount(t+" > div"),c.mountedComponents[t]=function(){return v.$destroy()},"function"==typeof a&&a.call(d,v),l(v)};if(null==n)p();else{var v=n.split(",").map(function(t){return s.default.getScript(t)});s.default.when.apply(s.default,v).done(p)}})}},{key:"unmountView",value:function(t){this.mountedComponents||(this.mountedComponents={});var e=this.mountedComponents[t];"function"==typeof e&&(e(),delete this.mountedComponents[t])}}]),e}();e.default=d}).call(this,n(0))},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var n=n||t||{},r={version:"0.8.5",map:function(t){return r.routes.defined.hasOwnProperty(t)?r.routes.defined[t]:new r.core.route(t)},root:function(t){r.routes.root=t},rescue:function(t){r.routes.rescue=t},history:{initial:{},pushState:function(t,e,o){r.history.supported?r.dispatch(o)&&history.pushState(t,e,o):r.history.fallback&&(n.location.hash="#"+o)},popState:function(t){var e=!r.history.initial.popped&&location.href==r.history.initial.URL;r.history.initial.popped=!0,e||r.dispatch("/"===document.location.pathname?"":document.location.pathname)},listen:function(t){if(r.history.supported=!(!n.history||!n.history.pushState),r.history.fallback=t,r.history.supported)r.history.initial.popped="state"in n.history,r.history.initial.URL=location.href,n.onpopstate=r.history.popState;else if(r.history.fallback){for(route in r.routes.defined)"#"!=route.charAt(0)&&(r.routes.defined["#"+route]=r.routes.defined[route],r.routes.defined["#"+route].path="#"+route);r.listen()}}},match:function(t,e){var n,o,i,u,a,s,c={},l=null;for(l in r.routes.defined)if(null!==l&&void 0!==l)for(n=(l=r.routes.defined[l]).partition(),u=0;u0)for(i=0;i=8)?n.onhashchange=t:setInterval(t,50),""!==location.hash&&r.dispatch(location.hash)},core:{route:function(t){this.path=t,this.action=null,this.do_enter=[],this.do_exit=null,this.params={},r.routes.defined[t]=this}},routes:{current:null,root:null,rescue:null,previous:null,defined:{}}};r.core.route.prototype={to:function(t){return this.action=t,this},enter:function(t){return t instanceof Array?this.do_enter=this.do_enter.concat(t):this.do_enter.push(t),this},exit:function(t){return this.do_exit=t,this},partition:function(){for(var t,e,n=[],r=[],o=/\(([^}]+?)\)/g;t=o.exec(this.path);)n.push(t[1]);for(r.push(this.path.split("(")[0]),e=0;e0)for(t=0;t0?t:"/",void 0!==o.default&&o.default.map(t).to(function(){e(this.params)})}},{key:"match",value:function(t){if(void 0!==o.default){var e=o.default.match(t,!0);if(null!=e)return e.run(),!0}return!1}},{key:"overrideUrl",value:function(t){return t}},{key:"pushState",value:function(t,e,n){this.urlPath="",void 0!==o.default&&o.default.history.pushState(t,e,n)}},{key:"redirect",value:function(t,e){this.urlPath=t;for(var n=0;n redirected"))}i.location.replace(t)}},{key:"$ready",value:function(){this.$router.initRouting()}},{key:"$update",value:function(t){t&&t.RoutingState&&this.$router.initRouting()}}]),t}();e.default=u}).call(this,n(0))},function(t,e,n){"use strict";var r=u(n(3)),o=u(n(10)),i=u(n(8));function u(t){return t&&t.__esModule?t:{default:t}}r.default.vue.router=new o.default(r.default.debug),r.default.vue.router.$inject=function(t){var e=new i.default(t,r.default.vue.router);t.$router=e,t.$route=function(t,n){return e.route(t,n)},t.$handleRoute=function(t){return e.handleRoute(t)},t.$routeTo=function(t){return e.routeToRoute(t)}},r.default.vue.router.$mount=function(t,e,n,r){return i.default.prototype.loadVueView(t,e,null,n,r)},r.default.vue.plugins.router=r.default.vue.router},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n "),console.log(t),e.debugFn&&e.debugFn(this.$vmId,"sent",t))}catch(t){e.handleConnectionStateChanged("error",t,this.$hub)}}}},{key:"$dispatchListState",value:function(t){var e=this,n=function(){var n=e.$itemKey[o];return n?(i=t[o])[n]?(Object.keys(i).forEach(function(t){if(t!=n){var r={};r[o+".$"+i[n]+"."+t]=i[t],e.$dispatch(r)}}),void e.$updateList(o,i)):(console.error("["+e.$vmId+"] couldn't dispatch data from '"+o+"' due to missing property '"+n+"'."),console.error(i),{v:void 0}):(console.error("["+e.$vmId+"] missing item key for '"+o+"'; add "+o+"_itemKey property to the view model."),{v:void 0})};for(var o in t){var i,u=n();if("object"===(void 0===u?"undefined":r(u)))return u.v}}},{key:"$getPlugins",value:function(){var t=this;return Object.keys(this.$dotnetify.plugins).map(function(e){return t.$dotnetify.plugins[e]})}},{key:"$preProcess",value:function(t){for(var e in t){if(null==(n=/(.*)_add/.exec(e))){if(null==(n=/(.*)_update/.exec(e))){if(null==(n=/(.*)_remove/.exec(e))){var n;if(null==(n=/(.*)_itemKey/.exec(e)));else{var r={};r[i=n[1]]=t[e],this.$setItemKey(r),delete t[e]}}else{i=n[1];if(Array.isArray(this.State()[i])){var o=this.$itemKey[i];null!=o?this.$removeList(i,function(n){return n[o]==t[e]}):console.error("["+this.$vmId+"] missing item key for '"+i+"'; add "+i+"_itemKey property to the view model.")}else console.error("["+this.$vmId+"] '"+i+"' is not found or not an array.");delete t[e]}}else{var i=n[1];Array.isArray(this.State()[i])?this.$updateList(i,t[e]):console.error("["+this.$vmId+"] '"+i+"' is not found or not an array."),delete t[e]}}else{var i=n[1];Array.isArray(this.State()[i])?this.$addList(i,t[e]):console.error("unable to resolve "+e),delete t[e]}}}},{key:"$request",value:function(){this.$hub.isConnected&&this.$hub.requestVM(this.$vmId,{$vmArg:this.$vmArg,$headers:this.$headers}),this.$requested=!0}},{key:"$update",value:function(t){var e=this.$dotnetify.controller;e.debug&&(console.log("["+this.$vmId+"] received> "),console.log(JSON.parse(t)),e.debugFn&&e.debugFn(this.$vmId,"received",JSON.parse(t)));var n=JSON.parse(t);this.$preProcess(n);var r=this.State();r=i.default.extend({},r,n),this.State(r),this.$loaded?this.$onUpdate(n):this.$onLoad()}},{key:"$onLoad",value:function(){var t=this;this.$getPlugins().map(function(e){return"function"==typeof e.$ready?e.$ready.apply(t):null}),this.$loaded=!0}},{key:"$onUpdate",value:function(t){var e=this;this.$getPlugins().map(function(n){return"function"==typeof n.$update?n.$update.apply(e,[t]):null})}},{key:"$setItemKey",value:function(t){Object.assign(this.$itemKey,t)}},{key:"$addList",value:function(t,e){var n=this.$itemKey[t];if(null!=n){if(!e.hasOwnProperty(n))return void console.error("["+this.$vmId+"] couldn't add item to '"+t+"' due to missing property '"+n+"'.");if(this.State()[t].filter(function(t){return t[n]==e[n]}).length>0)return void console.error("["+this.$vmId+"] couldn't add item to '"+t+"' because the key already exists.")}var r=this.State()[t];r.push(e);var o={};o[t]=r,this.State(o)}},{key:"$removeList",value:function(t,e){var n={};n[t]=this.State()[t].filter(function(t){return!e(t)}),this.State(n)}},{key:"$updateList",value:function(t,e){var n=this.$itemKey[t];if(null!=n){if(!e.hasOwnProperty(n))return void console.error("["+this.$vmId+"] couldn't update item to '"+t+"' due to missing property '"+n+"'.");var r={};r[t]=this.State()[t].map(function(t){return t[n]==e[n]?i.default.extend(t,e):t}),this.State(r)}else console.error("["+this.$vmId+"] missing item key for '"+t+"'; add '"+t+"_itemKey' property to the view model.")}}]),t}();e.default=u}).call(this,n(0))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createWebApiHub=e.dotNetifyHubWebApi=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n-1;)l.splice(n,1),u&&(n<=s&&s--,n<=c&&c--)}),this},has:function(t){return r.inArray(t,l)>-1},empty:function(){return l=[],this},disable:function(){return l=f=e=void 0,this},disabled:function(){return!l},lock:function(){return f=void 0,e||h.disable(),this},locked:function(){return!f},fireWith:function(t,e){return e=[t,(e=e||[]).slice?e.slice():e],!l||n&&!f||(u?f.push(e):d(e)),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!n}};return h}},function(t,e,n){ /*! * jquery-deferred * Copyright(c) 2011 Hidden * MIT Licensed */ -var r=t.exports=n(16),o=Array.prototype.slice;r.extend({Deferred:function(t){var e=[["resolve","done",r.Callbacks("once memory"),"resolved"],["reject","fail",r.Callbacks("once memory"),"rejected"],["notify","progress",r.Callbacks("memory")]],n="pending",o={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var t=arguments;return r.Deferred(function(n){r.each(e,function(e,o){var u=o[0],a=t[e];i[o[1]](r.isFunction(a)?function(){var t=a.apply(this,arguments);t&&r.isFunction(t.promise)?t.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[u+"With"](this===i?n:this,[t])}:n[u])}),t=null}).promise()},promise:function(t){return null!=t?r.extend(t,o):o}},i={};return o.pipe=o.then,r.each(e,function(t,r){var u=r[2],a=r[3];o[r[1]]=u.add,a&&u.add(function(){n=a},e[1^t][2].disable,e[2][2].lock),i[r[0]]=u.fire,i[r[0]+"With"]=u.fireWith}),o.promise(i),t&&t.call(i,i),i},when:function(t){var e,n,i,u=0,a=o.call(arguments),s=a.length,c=1!==s||t&&r.isFunction(t.promise)?s:0,l=1===c?t:r.Deferred(),f=function(t,n,r){return function(i){n[t]=this,r[t]=arguments.length>1?o.call(arguments):i,r===e?l.notifyWith(n,r):--c||l.resolveWith(n,r)}};if(s>1)for(e=new Array(s),n=new Array(s),i=new Array(s);u0?t._startConnection(e,n):t._onDisconnected()});return"function"==typeof t._startDoneHandler&&u.then(t._startDoneHandler).catch(t._startFailHandler||function(){}),u},start:function(e){t._startDoneHandler=null,t._startFailHandler=null;var n=[0],r={webSockets:0,serverSentEvents:1,longPolling:2};e&&Array.isArray(e.transport)&&(n=e.transport.map(function(t){return r[t]}));var o=t._startConnection(e,n);return{done:function(e){return t._startDoneHandler=e,o.then(e).catch(function(t){throw t}),this},fail:function(e){return t._startFailHandler=e,o.catch(e),this}}},disconnected:function(e){"function"==typeof e&&(t._disconnectedHandler=e)},stateChanged:function(e){"function"==typeof e&&(t._stateChangedHandler=e)},reconnect:function(e){if("function"==typeof e)if(!t.reconnectRetry||t._reconnectCount1?o.call(arguments):i,r===e?l.notifyWith(n,r):--c||l.resolveWith(n,r)}};if(s>1)for(e=new Array(s),n=new Array(s),i=new Array(s);u0?t._startConnection(e,n):t._onDisconnected()});return"function"==typeof t._startDoneHandler&&u.then(t._startDoneHandler).catch(t._startFailHandler||function(){}),u},start:function(e){t._startDoneHandler=null,t._startFailHandler=null;var n=[0],r={webSockets:0,serverSentEvents:1,longPolling:2};e&&Array.isArray(e.transport)&&(n=e.transport.map(function(t){return r[t]}));var o=t._startConnection(e,n);return{done:function(e){return t._startDoneHandler=e,o.then(e).catch(function(t){throw t}),this},fail:function(e){return t._startFailHandler=e,o.catch(e),this}}},disconnected:function(e){"function"==typeof e&&(t._disconnectedHandler=e)},stateChanged:function(e){"function"==typeof e&&(t._stateChangedHandler=e)},reconnect:function(e){if("function"==typeof e)if(!t.reconnectRetry||t._reconnectCount= 0) { + iStr = iStr.substr(0, iStr.length - 1); + }while (iStr.indexOf('/') == 0) { + iStr = iStr.substr(1, iStr.length - 1); + }return iStr; + } + + // Match two strings case-insensitive. + + }, { + key: 'equal', + value: function equal(iStr1, iStr2) { + return iStr1 != null && iStr2 != null && iStr1.toLowerCase() == iStr2.toLowerCase(); + } + + // Whether the string starts or ends with a value. + + }, { + key: 'startsWith', + value: function startsWith(iStr, iValue) { + return iStr.toLowerCase().slice(0, iValue.length) == iValue.toLowerCase(); + } + }, { + key: 'endsWith', + value: function endsWith(iStr, iValue) { + return iValue == '' || iStr.toLowerCase().slice(-iValue.length) == iValue.toLowerCase(); + } + + // Dispatch event with IE polyfill. + + }, { + key: 'dispatchEvent', + value: function dispatchEvent(iEvent) { + if (typeof Event === 'function') window.dispatchEvent(new Event(iEvent));else { + var event = document.createEvent('CustomEvent'); + event.initEvent(iEvent, true, true); + window.dispatchEvent(event); + } + } + }, { + key: 'grep', + value: function grep(iArray, iFilter) { + return Array.isArray(iArray) ? iArray.filter(iFilter) : []; + } + }]); + + return utils; +}(); + +var createEventEmitter = exports.createEventEmitter = function createEventEmitter(_) { + var subscribers = []; + return { + emit: function emit() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var handled = false; + subscribers.forEach(function (subscriber) { + handled = subscriber.apply(undefined, _toConsumableArray(args)) || handled; + }); + return handled; + }, + subscribe: function subscribe(subscriber) { + !subscribers.includes(subscriber) && subscribers.push(subscriber); + return function () { + return subscribers = subscribers.filter(function (x) { + return x !== subscriber; + }); + }; + } + }; +}; + +var fetch = exports.fetch = function fetch(iMethod, iUrl, iData, iOptions) { + return new Promise(function (resolve, reject) { + var request = new window.XMLHttpRequest(); + request.open(iMethod, iUrl, true); + if (typeof iOptions == 'function') iOptions(request); + + request.onload = function () { + if (request.status >= 200 && request.status < 400) { + var response = request.responseText; + resolve(response); + } else reject(request); + }; + request.onerror = function () { + reject(request); + }; + request.send(iData); + }); +}; + +exports.default = new utils(); +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0))) + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + "use strict"; /* WEBPACK VAR INJECTION */(function(global, module) { @@ -295,7 +437,7 @@ limitations under the License. var window = window || global || {}; -var jQueryDeferred = __webpack_require__(11); +var jQueryDeferred = __webpack_require__(12); var jQueryShim = jQueryDeferred.extend(function (selector) { if (selector === window || selector.document) return { 0: selector, @@ -428,130 +570,7 @@ var jQueryShim = jQueryDeferred.extend(function (selector) { if (typeof window !== 'undefined') window.jQuery = window.jQuery || jQueryShim; if (( false ? undefined : _typeof(exports)) === 'object' && ( false ? undefined : _typeof(module)) === 'object') module.exports = jQueryShim; -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0), __webpack_require__(12)(module))) - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(global) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/* -Copyright 2018 Dicky Suryadi - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - */ -var window = window || global || {}; - -var utils = function () { - function utils() { - _classCallCheck(this, utils); - } - - _createClass(utils, [{ - key: 'trim', - - // Trim slashes from start and end of string. - value: function trim(iStr) { - if (typeof iStr !== 'string') return ''; - - while (iStr.indexOf('/', iStr.length - 1) >= 0) { - iStr = iStr.substr(0, iStr.length - 1); - }while (iStr.indexOf('/') == 0) { - iStr = iStr.substr(1, iStr.length - 1); - }return iStr; - } - - // Match two strings case-insensitive. - - }, { - key: 'equal', - value: function equal(iStr1, iStr2) { - return iStr1 != null && iStr2 != null && iStr1.toLowerCase() == iStr2.toLowerCase(); - } - - // Whether the string starts or ends with a value. - - }, { - key: 'startsWith', - value: function startsWith(iStr, iValue) { - return iStr.toLowerCase().slice(0, iValue.length) == iValue.toLowerCase(); - } - }, { - key: 'endsWith', - value: function endsWith(iStr, iValue) { - return iValue == '' || iStr.toLowerCase().slice(-iValue.length) == iValue.toLowerCase(); - } - - // Dispatch event with IE polyfill. - - }, { - key: 'dispatchEvent', - value: function dispatchEvent(iEvent) { - if (typeof Event === 'function') window.dispatchEvent(new Event(iEvent));else { - var event = document.createEvent('CustomEvent'); - event.initEvent(iEvent, true, true); - window.dispatchEvent(event); - } - } - }, { - key: 'grep', - value: function grep(iArray, iFilter) { - return Array.isArray(iArray) ? iArray.filter(iFilter) : []; - } - }]); - - return utils; -}(); - -var createEventEmitter = exports.createEventEmitter = function createEventEmitter(_) { - var subscribers = []; - return { - emit: function emit() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - var handled = false; - subscribers.forEach(function (subscriber) { - handled = subscriber.apply(undefined, _toConsumableArray(args)) || handled; - }); - return handled; - }, - subscribe: function subscribe(subscriber) { - !subscribers.includes(subscriber) && subscribers.push(subscriber); - return function () { - return subscribers = subscribers.filter(function (x) { - return x !== subscriber; - }); - }; - } - }; -}; - -exports.default = new utils(); -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0), __webpack_require__(13)(module))) /***/ }), /* 4 */, @@ -584,7 +603,7 @@ var _createClass = function () { function defineProperties(target, props) { for */ -var _jqueryShim = __webpack_require__(2); +var _jqueryShim = __webpack_require__(3); var _jqueryShim2 = _interopRequireDefault(_jqueryShim); @@ -947,6 +966,133 @@ exports.default = dotnetifyVM; /* 6 */ /***/ (function(module, exports, __webpack_require__) { +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createWebApiHub = exports.dotNetifyHubWebApi = undefined; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* + Copyright 2019 Dicky Suryadi + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + +var _utils = __webpack_require__(2); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var dotNetifyHubWebApi = exports.dotNetifyHubWebApi = function () { + function dotNetifyHubWebApi(iBaseUrl, iOnRequest) { + _classCallCheck(this, dotNetifyHubWebApi); + + this.mode = 'webapi'; + this.debug = false; + this.isConnected = false; + this.isHubStarted = false; + this.responseEvent = (0, _utils.createEventEmitter)(); + this.reconnectedEvent = (0, _utils.createEventEmitter)(); + this.connectedEvent = (0, _utils.createEventEmitter)(); + this.connectionFailedEvent = (0, _utils.createEventEmitter)(); + this._vmArgs = {}; + + this.baseUrl = iBaseUrl || ''; + this.onRequest = iOnRequest; + } + + _createClass(dotNetifyHubWebApi, [{ + key: 'startHub', + value: function startHub() { + this.isConnected = true; + this.isHubStarted = true; + this.connectedEvent.emit(); + } + }, { + key: 'requestVM', + value: function requestVM(iVMId, iVMArgs) { + var _this = this; + + var vmArgs = iVMArgs || {}; + var vmArgQuery = vmArgs.$vmArg ? '?vmarg=' + JSON.stringify(vmArgs.$vmArg) : ''; + var headers = vmArgs.$headers || {}; + + this._vmArgs[iVMId] = vmArgs; + var url = this.baseUrl + ('/api/dotnetify/vm/' + iVMId + vmArgQuery); + + (0, _utils.fetch)('GET', url, null, function (request) { + Object.keys(headers).forEach(function (key) { + return request.setRequestHeader(key, headers[key]); + }); + if (typeof _this.onRequest == 'function') _this.onRequest(url, request); + }).then(function (response) { + _this.responseEvent.emit(iVMId, response); + }).catch(function (request) { + return console.error('[' + iVMId + '] Request failed', request); + }); + } + }, { + key: 'updateVM', + value: function updateVM(iVMId, iValue) { + var _this2 = this; + + var vmArgs = this._vmArgs[iVMId] || {}; + var vmArgQuery = vmArgs.$vmArg ? '?vmarg=' + JSON.stringify(vmArgs.$vmArg) : ''; + var headers = vmArgs.$headers || {}; + var payload = (typeof iValue === 'undefined' ? 'undefined' : _typeof(iValue)) == 'object' ? JSON.stringify(iValue) : iValue; + + var url = this.baseUrl + ('/api/dotnetify/vm/' + iVMId + vmArgQuery); + + (0, _utils.fetch)('POST', url, payload, function (request) { + request.setRequestHeader('Content-Type', 'application/json'); + Object.keys(headers).forEach(function (key) { + return request.setRequestHeader(key, headers[key]); + }); + if (typeof _this2.onRequest == 'function') _this2.onRequest(url, request, payload); + }).then(function (response) { + _this2.responseEvent.emit(iVMId, response); + }).catch(function (request) { + return console.error('[' + iVMId + '] Update failed', request); + }); + } + }, { + key: 'disposeVM', + value: function disposeVM(iVMId) { + delete this._vmArgs[iVMId]; + } + }], [{ + key: 'create', + value: function create(iBaseUrl, iOnRequest) { + return new dotNetifyHubWebApi(iBaseUrl, iOnRequest); + } + }]); + + return dotNetifyHubWebApi; +}(); + +var createWebApiHub = dotNetifyHubWebApi.create; + +exports.createWebApiHub = createWebApiHub; +exports.default = dotNetifyHubWebApi.create(); + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + "use strict"; /* WEBPACK VAR INJECTION */(function(global) { @@ -958,7 +1104,6 @@ exports.hasLocalVM = exports.dotNetifyHubLocal = undefined; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /* - import { dotnetify } from 'dotnetify/dist/dotnetify-ko'; Copyright 2019 Dicky Suryadi Licensed under the Apache License, Version 2.0 (the "License"); @@ -975,7 +1120,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol */ -var _utils = __webpack_require__(3); +var _utils = __webpack_require__(2); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -1070,13 +1215,13 @@ exports.hasLocalVM = hasLocalVM; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0))) /***/ }), -/* 7 */ +/* 8 */ /***/ (function(module, exports) { -module.exports = __WEBPACK_EXTERNAL_MODULE__7__; +module.exports = __WEBPACK_EXTERNAL_MODULE__8__; /***/ }), -/* 8 */ +/* 9 */ /***/ (function(module, exports) { /** @@ -1237,10 +1382,10 @@ function extend() { /***/ }), -/* 9 */ +/* 10 */ /***/ (function(module, exports, __webpack_require__) { -var jQuery = module.exports = __webpack_require__(8), +var jQuery = module.exports = __webpack_require__(9), core_rspace = /\s+/; /** * jQuery Callbacks @@ -1449,7 +1594,7 @@ jQuery.Callbacks = function( options ) { /***/ }), -/* 10 */ +/* 11 */ /***/ (function(module, exports, __webpack_require__) { @@ -1463,7 +1608,7 @@ jQuery.Callbacks = function( options ) { * Library version. */ -var jQuery = module.exports = __webpack_require__(9), +var jQuery = module.exports = __webpack_require__(10), core_slice = Array.prototype.slice; /** @@ -1618,14 +1763,14 @@ jQuery.extend({ /***/ }), -/* 11 */ +/* 12 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = __webpack_require__(10); +module.exports = __webpack_require__(11); /***/ }), -/* 12 */ +/* 13 */ /***/ (function(module, exports) { module.exports = function(module) { @@ -1653,7 +1798,7 @@ module.exports = function(module) { /***/ }), -/* 13 */ +/* 14 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1681,9 +1826,9 @@ var _createClass = function () { function defineProperties(target, props) { for */ -var _utils = __webpack_require__(3); +var _utils = __webpack_require__(2); -var _jqueryShim = __webpack_require__(2); +var _jqueryShim = __webpack_require__(3); var _jqueryShim2 = _interopRequireDefault(_jqueryShim); @@ -1691,7 +1836,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -var signalRNetCore = __webpack_require__(7); +var signalRNetCore = __webpack_require__(8); var $ = _jqueryShim2.default; var window = window || global || {}; @@ -2110,7 +2255,7 @@ exports.default = dotnetifyHubFactory.create(); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0))) /***/ }), -/* 14 */ +/* 15 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2138,14 +2283,18 @@ var _createClass = function () { function defineProperties(target, props) { for */ -var _dotnetifyHub = __webpack_require__(13); +var _dotnetifyHub = __webpack_require__(14); var _dotnetifyHub2 = _interopRequireDefault(_dotnetifyHub); -var _dotnetifyHubLocal = __webpack_require__(6); +var _dotnetifyHubLocal = __webpack_require__(7); var _dotnetifyHubLocal2 = _interopRequireDefault(_dotnetifyHubLocal); +var _dotnetifyHubWebapi = __webpack_require__(6); + +var _dotnetifyHubWebapi2 = _interopRequireDefault(_dotnetifyHubWebapi); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } @@ -2201,7 +2350,7 @@ var dotnetifyFactory = exports.dotnetifyFactory = function () { // Generic connect function for non-React app. connect: function connect(iVMId, iOptions) { - dotnetify.react.connect(iVMId, null, iOptions); + return dotnetify.react.connect(iVMId, {}, iOptions); }, @@ -2211,6 +2360,12 @@ var dotnetifyFactory = exports.dotnetifyFactory = function () { }, + // Creates a Web API hub client. + createWebApiHub: function createWebApiHub(baseUrl, onRequestHandler) { + return (0, _dotnetifyHubWebapi.createWebApiHub)(baseUrl, onRequestHandler); + }, + + // Configures hub connection to SignalR hub server. initHub: function initHub(hub, hubPath, hubServerUrl, hubLib) { var _this = this; @@ -2234,10 +2389,11 @@ var dotnetifyFactory = exports.dotnetifyFactory = function () { // Used by a view to select a hub, and provides the opportunity to override any connect info. selectHub: function selectHub(vmConnectArgs) { - vmConnectArgs = vmConnectArgs || { options: {} }; + vmConnectArgs = vmConnectArgs || {}; + vmConnectArgs.options = vmConnectArgs.options || {}; var override = typeof this.connectHandler == 'function' && this.connectHandler(vmConnectArgs) || {}; if (!override.hub) { - override.hub = (0, _dotnetifyHubLocal.hasLocalVM)(vmConnectArgs.vmId) ? _dotnetifyHubLocal2.default : this.initHub(); + override.hub = (0, _dotnetifyHubLocal.hasLocalVM)(vmConnectArgs.vmId) ? _dotnetifyHubLocal2.default : vmConnectArgs.options.webApi ? _dotnetifyHubWebapi2.default : this.initHub(); override.hub.debug = this.debug; } return Object.assign(vmConnectArgs, override); diff --git a/DevApp/dist/dist/dotnetify.js.map b/DevApp/dist/dist/dotnetify.js.map index f5c8cc7c..4e37e2cd 100644 --- a/DevApp/dist/dist/dotnetify.js.map +++ b/DevApp/dist/dist/dotnetify.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://dotnetify/webpack/universalModuleDefinition","webpack://dotnetify/webpack/bootstrap","webpack://dotnetify/(webpack)/buildin/global.js","webpack://dotnetify/./src/dotnetify/react/dotnetify-react.js","webpack://dotnetify/./src/dotnetify/libs/jquery-shim.js","webpack://dotnetify/./src/dotnetify/libs/utils.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-vm.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-hub-local.js","webpack://dotnetify/external {\"commonjs\":\"@aspnet/signalr\",\"commonjs2\":\"@aspnet/signalr\",\"amd\":\"@aspnet/signalr\",\"root\":\"signalR\"}","webpack://dotnetify/./node_modules/jquery-deferred/lib/jquery-core.js","webpack://dotnetify/./node_modules/jquery-deferred/lib/jquery-callbacks.js","webpack://dotnetify/./node_modules/jquery-deferred/lib/jquery-deferred.js","webpack://dotnetify/./node_modules/jquery-deferred/index.js","webpack://dotnetify/(webpack)/buildin/module.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-hub.js","webpack://dotnetify/./src/dotnetify/core/dotnetify.js"],"names":["window","global","dotnetify","_dotnetify","react","version","viewModels","plugins","controller","_hubs","init","iHub","self","hubInitialized","some","hub","start","isHubStarted","Object","keys","filter","vmId","$hub","forEach","$requested","startHub","responseEvent","subscribe","iVMId","iVMData","_responseVM","connectedEvent","$request","reconnectedEvent","mode","push","connect","iReact","iOptions","arguments","length","Error","vmArg","ssr","ssrConnect","hasOwnProperty","console","error","$destroy","setTimeout","component","props","state","setState","connectInfo","selectHub","options","dotnetifyVM","getViewModels","map","vm","checkServerSideException","$exceptionHandler","$update","addVMAccessor","jQueryDeferred","require","jQueryShim","extend","selector","document","on","iEvent","iHandler","addEventListener","bind","unbind","removeEventListener","events","event","handlers","idx","indexOf","splice","triggerHandler","iArgs","args","type","Array","isArray","arg","handler","apply","load","iUrl","request","XMLHttpRequest","open","onload","status","response","responseText","querySelector","innerHTML","call","send","abort","reason","support","cors","trim","iStr","inArray","iArray","iItem","makeArray","slice","merge","iArray1","iArray2","prototype","isEmptyObject","iObj","ajax","onreadystatechange","readyState","_hasError","success","JSON","parse","url","setRequestHeader","contentType","data","getScript","iSuccess","done","promise","Deferred","head","getElementsByTagName","script","createElement","src","removeChild","resolve","appendChild","jQuery","exports","module","utils","substr","iStr1","iStr2","toLowerCase","iValue","Event","dispatchEvent","createEvent","initEvent","iFilter","createEventEmitter","subscribers","emit","handled","subscriber","includes","x","iComponent","iDotNetify","$vmId","$component","$options","$vmArg","$headers","$loaded","$itemKey","$dotnetify","getState","State","Props","prop","$","$getPlugins","plugin","$inject","isConnected","disposeVM","ex","handleConnectionStateChanged","updateVM","debug","log","debugFn","key","listName","item","$dispatch","$updateList","id","iVMUpdate","match","exec","$addList","$removeList","i","itemKey","$setItemKey","requestVM","vmData","$preProcess","$onLoad","$onUpdate","$ready","iItemKey","assign","iListName","iNewItem","items","normalize","replace","hasLocalVM","onConnect","dotNetifyHubLocal","connectionFailedEvent","iVMArgs","$pushUpdate","update","stringify","onDispatch","onDestroy","signalRNetCore","dotnetifyHubFactory","dotnetifyHub","reconnectDelay","reconnectRetry","_startInfo","_init","server","request_VM","update_VM","dispose_VM","hubOptions","doneHandler","failHandler","forceRestart","_doneHandler","_failHandler","failHander","fail","err","iHubPath","iServerUrl","signalR","HubConnection","defineProperty","get","_connection","connection","connectionState","hubPath","_reconnectCount","_startDoneHandler","_startFailHandler","_disconnectedHandler","_stateChangedHandler","iNewState","_onDisconnected","_changeState","stateText","_startConnection","iHubOptions","iTransportArray","transport","shift","HubConnectionBuilder","withUrl","build","client","response_VM","onclose","then","catch","transportOptions","webSockets","serverSentEvents","longPolling","disconnected","stateChanged","reconnect","iStartHubFunc","delay","invoke","undefined","makeProxyCallback","callback","registerHubProxies","instance","shouldSubscribe","memberKey","memberValue","subscriptionMethod","hubName","off","isFunction","hubConnection","createHubProxies","proxies","starting","_registerSubscribedHubs","createHubProxy","useDefaultPath","set","val","dotNetifyHub","connected","deferred","source","message","warn","newState","create","dotnetifyFactory","offline","isOffline","offlineTimeout","offlineCacheFn","_vmAccessors","connectionStateHandler","connectHandler","hubServerUrl","createHub","hubLib","initHub","vmConnectArgs","override","localHub","vmAccessor","iExceptionHandler","exception","name","ExceptionType","Message","reduce","prev","current","iState","iException"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;A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,QAAQ,YAAY;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;ACxJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,oCAAoC;AAC9C;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;AC3MA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA,MAAM;AACN,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,8CAA8C;AAC9C,KAAK;AACL;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,IAAI;;AAEJ;;AAEA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA,UAAU,YAAY;AACtB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;;;;;;;ACjKD,yC;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;;;;;;;;;;;;;;qjBCrBA;;;;;;;;;;;;;;;;;AAeA;;AACA;;;;;;;;AACA,IAAMU,iBAAiB,mBAAArK,CAAQ,CAAR,CAAvB;A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,MAAMnI,OAAOoI,aAAf,EAA8BvB,SAAS7G,OAAOqI,OAA9C,EAAlB;;AAEA,gBAAI,OAAOJ,iBAAP,KAA6B,UAAjC,EAA6C;AAC3C,qBAAOA,kBAAkBC,SAAlB,CAAP;AACD,aAFD,MAGK;AACHrS,sBAAQC,KAAR,CAAc,MAAMnB,KAAN,GAAc,IAAd,GAAqBuT,UAAUC,IAA/B,GAAsC,IAAtC,GAA6CD,UAAUrB,OAArE;AACA,oBAAMqB,SAAN;AACD;AACF;AACF,SAvGe;;;AAyGhB;AACAzR,qBA1GgB,2BA0GA;AACd,iBAAO,KAAK6Q,YAAL,CACJgB,MADI,CACG,UAACC,IAAD,EAAOC,OAAP;AAAA,gDAAwBD,IAAxB,sBAAiCC,SAAjC;AAAA,WADH,EACiD,EADjD,EAEJrU,MAFI,CAEG,UAACqS,GAAD,EAAMxO,GAAN,EAAWrE,IAAX;AAAA,mBAAoBA,KAAKsE,OAAL,CAAauO,GAAb,MAAsBxO,GAA1C;AAAA,WAFH,CAAP,CADc,CAG4C;AAC3D,SA9Ge;AAgHhB4G,oCAhHgB,wCAgHa6J,MAhHb,EAgHqBC,UAhHrB,EAgHiChV,IAhHjC,EAgHuC;AACrD,cAAI,KAAKoL,KAAT,EAAgBjJ,QAAQkJ,GAAR,CAAY,eAAe2J,aAAaA,WAAW7B,OAAxB,GAAkC4B,MAAjD,CAAZ;AAChB,cAAI,OAAO,KAAKlB,sBAAZ,KAAuC,UAA3C,EAAuD,KAAKA,sBAAL,CAA4BkB,MAA5B,EAAoCC,UAApC,EAAgDhV,IAAhD,EAAvD,KACK,IAAIgV,UAAJ,EAAgB7S,QAAQC,KAAR,CAAc4S,UAAd;AACtB;AApHe,OAAlB;;AAuHA,aAAOzV,SAAP;AACD;;;;;;kBAGYgU,iBAAiBD,MAAjB,E","file":"dotnetify.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@aspnet/signalr\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"@aspnet/signalr\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"dotnetify\"] = factory(require(\"@aspnet/signalr\"));\n\telse\n\t\troot[\"dotnetify\"] = factory(root[\"signalR\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__7__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport _dotnetify from '../core/dotnetify';\r\nimport dotnetifyVM from '../core/dotnetify-vm';\r\n\r\nconst window = window || global || {};\r\nlet dotnetify = window.dotnetify || _dotnetify;\r\n\r\ndotnetify.react = {\r\n version: '3.0.0',\r\n viewModels: {},\r\n plugins: {},\r\n controller: dotnetify,\r\n\r\n // Internal variables.\r\n _hubs: [],\r\n\r\n // Initializes connection to SignalR server hub.\r\n init: function(iHub) {\r\n const self = dotnetify.react;\r\n const hubInitialized = self._hubs.some(hub => hub === iHub);\r\n\r\n const start = function() {\r\n if (!iHub.isHubStarted)\r\n Object.keys(self.viewModels)\r\n .filter(vmId => self.viewModels[vmId].$hub === iHub)\r\n .forEach(vmId => (self.viewModels[vmId].$requested = false));\r\n\r\n dotnetify.startHub(iHub);\r\n };\r\n\r\n if (!hubInitialized) {\r\n iHub.responseEvent.subscribe((iVMId, iVMData) => self._responseVM(iVMId, iVMData));\r\n iHub.connectedEvent.subscribe(() =>\r\n Object.keys(self.viewModels)\r\n .filter(vmId => self.viewModels[vmId].$hub === iHub && !self.viewModels[vmId].$requested)\r\n .forEach(vmId => self.viewModels[vmId].$request())\r\n );\r\n iHub.reconnectedEvent.subscribe(start);\r\n\r\n if (iHub.mode !== 'local') self._hubs.push(iHub);\r\n }\r\n\r\n start();\r\n },\r\n\r\n // Connects to a server view model.\r\n connect: function(iVMId, iReact, iOptions) {\r\n if (arguments.length < 2) throw new Error('[dotNetify] Missing arguments. Usage: connect(vmId, component) ');\r\n\r\n const vmArg = iOptions && iOptions['vmArg'];\r\n\r\n if (dotnetify.ssr && dotnetify.react.ssrConnect) {\r\n return dotnetify.react.ssrConnect(iVMId, iReact, vmArg);\r\n }\r\n\r\n const self = dotnetify.react;\r\n if (self.viewModels.hasOwnProperty(iVMId)) {\r\n console.error(\r\n `Component is attempting to connect to an already active '${iVMId}'. ` +\r\n ` If it's from a dismounted component, you must add vm.$destroy to componentWillUnmount().`\r\n );\r\n self.viewModels[iVMId].$destroy();\r\n return setTimeout(() => self.connect(iVMId, iReact, iOptions));\r\n }\r\n\r\n const component = {\r\n get props() {\r\n return iReact.props;\r\n },\r\n get state() {\r\n return iReact.state;\r\n },\r\n setState(state) {\r\n iReact.setState(state);\r\n }\r\n };\r\n\r\n const connectInfo = dotnetify.selectHub({ vmId: iVMId, options: iOptions, hub: null });\r\n self.viewModels[iVMId] = new dotnetifyVM(connectInfo.vmId, component, connectInfo.options, self, connectInfo.hub);\r\n if (connectInfo.hub) self.init(connectInfo.hub);\r\n\r\n return self.viewModels[iVMId];\r\n },\r\n\r\n // Get all view models.\r\n getViewModels: function() {\r\n const self = dotnetify.react;\r\n return Object.keys(self.viewModels).map(vmId => self.viewModels[vmId]);\r\n },\r\n\r\n _responseVM: function(iVMId, iVMData) {\r\n const self = dotnetify.react;\r\n\r\n if (self.viewModels.hasOwnProperty(iVMId)) {\r\n const vm = self.viewModels[iVMId];\r\n dotnetify.checkServerSideException(iVMId, iVMData, vm.$exceptionHandler);\r\n vm.$update(iVMData);\r\n return true;\r\n }\r\n return false;\r\n }\r\n};\r\n\r\ndotnetify.addVMAccessor(dotnetify.react.getViewModels);\r\n\r\nexport default dotnetify;\r\n","/* \r\nCopyright 2017 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\n\r\nconst window = window || global || {};\r\n\r\nconst jQueryDeferred = require('jquery-deferred');\r\nconst jQueryShim = jQueryDeferred.extend(\r\n function(selector) {\r\n if (selector === window || selector.document)\r\n return {\r\n 0: selector,\r\n on: function(iEvent, iHandler) {\r\n window.addEventListener(iEvent, iHandler);\r\n },\r\n bind: function(iEvent, iHandler) {\r\n window.addEventListener(iEvent, iHandler, false);\r\n },\r\n unbind: function(iEvent, iHandler) {\r\n window.removeEventListener(iEvent, iHandler, false);\r\n }\r\n };\r\n\r\n if (typeof selector !== 'string') selector.events = selector.events || {};\r\n\r\n return {\r\n 0: selector,\r\n\r\n bind: function(iEvent, iHandler) {\r\n var event = selector.events[iEvent] || [];\r\n event.push(iHandler);\r\n selector.events[iEvent] = event;\r\n },\r\n\r\n unbind: function(iEvent, iHandler) {\r\n var handlers = selector.events[iEvent] || [];\r\n if (iHandler) {\r\n var idx = handlers.indexOf(iHandler);\r\n if (idx !== -1) handlers.splice(idx, 1);\r\n }\r\n else handlers = [];\r\n selector.events[iEvent] = handlers;\r\n },\r\n\r\n triggerHandler: function(iEvent, iArgs) {\r\n var handlers = selector.events[iEvent] || [];\r\n var args = [ { type: iEvent } ];\r\n if (Array.isArray(iArgs))\r\n iArgs.forEach(function(arg) {\r\n args.push(arg);\r\n });\r\n else if (iArgs) args.push(iArgs);\r\n handlers.forEach(function(handler) {\r\n handler.apply(this, args);\r\n });\r\n },\r\n\r\n load: function(iUrl, iArgs, iHandler) {\r\n var request = new window.XMLHttpRequest();\r\n request.open('GET', iUrl, true);\r\n request.onload = function() {\r\n if (request.status >= 200 && request.status < 400) {\r\n var response = request.responseText;\r\n document.querySelector(selector).innerHTML = response;\r\n iHandler.call(document.querySelector(selector));\r\n }\r\n };\r\n request.send();\r\n return {\r\n abort: function(reason) {\r\n return request.abort(reason);\r\n }\r\n };\r\n }\r\n };\r\n },\r\n jQueryDeferred,\r\n {\r\n support: { cors: true },\r\n\r\n trim: function(iStr) {\r\n return typeof iStr === 'string' ? iStr.trim() : iStr;\r\n },\r\n\r\n inArray: function(iArray, iItem) {\r\n return iArray.indexOf(iItem) !== -1;\r\n },\r\n\r\n makeArray: function makeArray(iArray) {\r\n return [].slice.call(iArray, 0);\r\n },\r\n\r\n merge: function(iArray1, iArray2) {\r\n Array.prototype.push.apply(iArray1, iArray2);\r\n return iArray1;\r\n },\r\n\r\n isEmptyObject: function(iObj) {\r\n return !iObj || Object.keys(iObj).length === 0;\r\n },\r\n\r\n ajax: function(iOptions) {\r\n var request = new window.XMLHttpRequest();\r\n request.onreadystatechange = function() {\r\n if (request.readyState !== 4) return;\r\n if (request.status === 200 && !request._hasError) {\r\n try {\r\n iOptions.success && iOptions.success(JSON.parse(request.responseText));\r\n } catch (error) {\r\n iOptions.success && iOptions.success(request.responseText);\r\n }\r\n }\r\n else iOptions.error && iOptions.error(request);\r\n };\r\n request.open(iOptions.type, iOptions.url);\r\n request.setRequestHeader('content-type', iOptions.contentType);\r\n request.send(iOptions.data.data && 'data=' + iOptions.data.data);\r\n return {\r\n abort: function(reason) {\r\n return request.abort(reason);\r\n }\r\n };\r\n },\r\n\r\n getScript: function(iUrl, iSuccess) {\r\n var done = false;\r\n var promise = jQueryDeferred.Deferred();\r\n var head = document.getElementsByTagName('head')[0];\r\n var script = document.createElement('script');\r\n script.src = iUrl;\r\n script.onload = script.onreadystatechange = function() {\r\n if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) {\r\n done = true;\r\n script.onload = script.onreadystatechange = null;\r\n head.removeChild(script);\r\n if (typeof iSuccess === 'function') iSuccess();\r\n promise.resolve();\r\n }\r\n };\r\n head.appendChild(script);\r\n return promise;\r\n }\r\n }\r\n);\r\n\r\nif (typeof window !== 'undefined') window.jQuery = window.jQuery || jQueryShim;\r\n\r\nif (typeof exports === 'object' && typeof module === 'object') module.exports = jQueryShim;\r\n","/* \r\nCopyright 2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nconst window = window || global || {};\r\n\r\nclass utils {\r\n // Trim slashes from start and end of string.\r\n trim(iStr) {\r\n if (typeof iStr !== 'string') return '';\r\n\r\n while (iStr.indexOf('/', iStr.length - 1) >= 0) iStr = iStr.substr(0, iStr.length - 1);\r\n while (iStr.indexOf('/') == 0) iStr = iStr.substr(1, iStr.length - 1);\r\n return iStr;\r\n }\r\n\r\n // Match two strings case-insensitive.\r\n equal(iStr1, iStr2) {\r\n return iStr1 != null && iStr2 != null && iStr1.toLowerCase() == iStr2.toLowerCase();\r\n }\r\n\r\n // Whether the string starts or ends with a value.\r\n startsWith(iStr, iValue) {\r\n return iStr.toLowerCase().slice(0, iValue.length) == iValue.toLowerCase();\r\n }\r\n\r\n endsWith(iStr, iValue) {\r\n return iValue == '' || iStr.toLowerCase().slice(-iValue.length) == iValue.toLowerCase();\r\n }\r\n\r\n // Dispatch event with IE polyfill.\r\n dispatchEvent(iEvent) {\r\n if (typeof Event === 'function') window.dispatchEvent(new Event(iEvent));\r\n else {\r\n var event = document.createEvent('CustomEvent');\r\n event.initEvent(iEvent, true, true);\r\n window.dispatchEvent(event);\r\n }\r\n }\r\n\r\n grep(iArray, iFilter) {\r\n return Array.isArray(iArray) ? iArray.filter(iFilter) : [];\r\n }\r\n}\r\n\r\nexport const createEventEmitter = _ => {\r\n let subscribers = [];\r\n return {\r\n emit(...args) {\r\n let handled = false;\r\n subscribers.forEach(subscriber => {\r\n handled = subscriber(...args) || handled;\r\n });\r\n return handled;\r\n },\r\n\r\n subscribe(subscriber) {\r\n !subscribers.includes(subscriber) && subscribers.push(subscriber);\r\n return () => (subscribers = subscribers.filter(x => x !== subscriber));\r\n }\r\n };\r\n};\r\n\r\nexport default new utils();\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport $ from '../libs/jquery-shim';\r\n\r\nconst window = window || global || {};\r\n\r\n// Client-side view model that acts as a proxy of the server view model.\r\nexport default class dotnetifyVM {\r\n // iVMId - identifies the view model.\r\n // iComponent - component object.\r\n // iOptions - Optional configuration options:\r\n // getState: state accessor.\r\n // setState: state mutator.\r\n // vmArg: view model arguments.\r\n // headers: request headers, for things like authentication token.\r\n // exceptionHandler: called when receiving server-side exception.\r\n // iDotNetify - framework-specific dotNetify library.\r\n // iHub - hub connection.\r\n constructor(iVMId, iComponent, iOptions, iDotNetify, iHub) {\r\n this.$vmId = iVMId;\r\n this.$component = iComponent;\r\n this.$options = iOptions || {};\r\n this.$vmArg = iOptions && iOptions['vmArg'];\r\n this.$headers = iOptions && iOptions['headers'];\r\n this.$exceptionHandler = iOptions && iOptions['exceptionHandler'];\r\n this.$requested = false;\r\n this.$loaded = false;\r\n this.$itemKey = {};\r\n this.$dotnetify = iDotNetify;\r\n this.$hub = iHub;\r\n\r\n let getState = iOptions && iOptions['getState'];\r\n let setState = iOptions && iOptions['setState'];\r\n getState = typeof getState === 'function' ? getState : () => iComponent.state;\r\n setState = typeof setState === 'function' ? setState : state => iComponent.setState(state);\r\n\r\n this.State = state => (typeof state === 'undefined' ? getState() : setState(state));\r\n this.Props = prop => this.$component.props && this.$component.props[prop];\r\n\r\n const vmArg = this.Props('vmArg');\r\n if (vmArg) this.$vmArg = $.extend(this.$vmArg, vmArg);\r\n\r\n // Inject plugin functions into this view model.\r\n this.$getPlugins().map(plugin => (typeof plugin['$inject'] == 'function' ? plugin.$inject(this) : null));\r\n }\r\n\r\n // Disposes the view model, both here and on the server.\r\n $destroy() {\r\n // Call any plugin's $destroy function if provided.\r\n this.$getPlugins().map(plugin => (typeof plugin['$destroy'] == 'function' ? plugin.$destroy.apply(this) : null));\r\n\r\n if (this.$hub.isConnected) {\r\n try {\r\n this.$hub.disposeVM(this.$vmId);\r\n } catch (ex) {\r\n this.$dotnetify.controller.handleConnectionStateChanged('error', ex, this.$hub);\r\n }\r\n }\r\n\r\n delete this.$dotnetify.viewModels[this.$vmId];\r\n }\r\n\r\n // Dispatches a value to the server view model.\r\n // iValue - Value to dispatch.\r\n $dispatch(iValue) {\r\n if (this.$hub.isConnected) {\r\n const controller = this.$dotnetify.controller;\r\n try {\r\n this.$hub.updateVM(this.$vmId, iValue);\r\n\r\n if (controller.debug) {\r\n console.log('[' + this.$vmId + '] sent> ');\r\n console.log(iValue);\r\n\r\n controller.debugFn && controller.debugFn(this.$vmId, 'sent', iValue);\r\n }\r\n } catch (ex) {\r\n controller.handleConnectionStateChanged('error', ex, this.$hub);\r\n }\r\n }\r\n }\r\n\r\n // Dispatches a state value to the server view model.\r\n // iValue - State value to dispatch.\r\n $dispatchListState(iValue) {\r\n for (var listName in iValue) {\r\n const key = this.$itemKey[listName];\r\n if (!key) {\r\n console.error(`[${this.$vmId}] missing item key for '${listName}'; add ${listName}_itemKey property to the view model.`);\r\n return;\r\n }\r\n var item = iValue[listName];\r\n if (!item[key]) {\r\n console.error(`[${this.$vmId}] couldn't dispatch data from '${listName}' due to missing property '${key}'.`);\r\n console.error(item);\r\n return;\r\n }\r\n\r\n Object.keys(item).forEach(prop => {\r\n if (prop != key) {\r\n let state = {};\r\n state[listName + '.$' + item[key] + '.' + prop] = item[prop];\r\n this.$dispatch(state);\r\n }\r\n });\r\n this.$updateList(listName, item);\r\n }\r\n }\r\n\r\n $getPlugins() {\r\n return Object.keys(this.$dotnetify.plugins).map(id => this.$dotnetify.plugins[id]);\r\n }\r\n\r\n // Preprocess view model update from the server before we set the state.\r\n $preProcess(iVMUpdate) {\r\n const vm = this;\r\n\r\n for (var prop in iVMUpdate) {\r\n // Look for property that end with '_add'. Interpret the value as a list item to be added\r\n // to an existing list whose property name precedes that suffix.\r\n var match = /(.*)_add/.exec(prop);\r\n if (match != null) {\r\n var listName = match[1];\r\n if (Array.isArray(this.State()[listName])) vm.$addList(listName, iVMUpdate[prop]);\r\n else console.error('unable to resolve ' + prop);\r\n delete iVMUpdate[prop];\r\n continue;\r\n }\r\n\r\n // Look for property that end with '_update'. Interpret the value as a list item to be updated\r\n // to an existing list whose property name precedes that suffix.\r\n var match = /(.*)_update/.exec(prop);\r\n if (match != null) {\r\n var listName = match[1];\r\n if (Array.isArray(this.State()[listName])) vm.$updateList(listName, iVMUpdate[prop]);\r\n else console.error('[' + this.$vmId + \"] '\" + listName + \"' is not found or not an array.\");\r\n delete iVMUpdate[prop];\r\n continue;\r\n }\r\n\r\n // Look for property that end with '_remove'. Interpret the value as a list item key to remove\r\n // from an existing list whose property name precedes that suffix.\r\n var match = /(.*)_remove/.exec(prop);\r\n if (match != null) {\r\n var listName = match[1];\r\n if (Array.isArray(this.State()[listName])) {\r\n var key = this.$itemKey[listName];\r\n if (key != null)\r\n vm.$removeList(listName, function(i) {\r\n return i[key] == iVMUpdate[prop];\r\n });\r\n else console.error(`[${this.$vmId}] missing item key for '${listName}'; add ${listName}_itemKey property to the view model.`);\r\n }\r\n else console.error(`[${this.$vmId}] '${listName}' is not found or not an array.`);\r\n delete iVMUpdate[prop];\r\n continue;\r\n }\r\n\r\n // Look for property that end with '_itemKey'. Interpret the value as the property name that will\r\n // uniquely identify items in the list.\r\n var match = /(.*)_itemKey/.exec(prop);\r\n if (match != null) {\r\n var listName = match[1];\r\n var itemKey = {};\r\n itemKey[listName] = iVMUpdate[prop];\r\n vm.$setItemKey(itemKey);\r\n delete iVMUpdate[prop];\r\n continue;\r\n }\r\n }\r\n }\r\n\r\n // Requests state from the server view model.\r\n $request() {\r\n if (this.$hub.isConnected) this.$hub.requestVM(this.$vmId, { $vmArg: this.$vmArg, $headers: this.$headers });\r\n this.$requested = true;\r\n }\r\n\r\n // Updates state from the server view model to the view.\r\n // iVMData - Serialized state from the server.\r\n $update(iVMData) {\r\n const controller = this.$dotnetify.controller;\r\n if (controller.debug) {\r\n console.log('[' + this.$vmId + '] received> ');\r\n console.log(JSON.parse(iVMData));\r\n\r\n controller.debugFn && controller.debugFn(this.$vmId, 'received', JSON.parse(iVMData));\r\n }\r\n let vmData = JSON.parse(iVMData);\r\n this.$preProcess(vmData);\r\n\r\n let state = this.State();\r\n state = $.extend({}, state, vmData);\r\n this.State(state);\r\n\r\n if (!this.$loaded) this.$onLoad();\r\n else this.$onUpdate(vmData);\r\n }\r\n\r\n // Handles initial view model load event.\r\n $onLoad() {\r\n this.$getPlugins().map(plugin => (typeof plugin['$ready'] == 'function' ? plugin.$ready.apply(this) : null));\r\n this.$loaded = true;\r\n }\r\n\r\n // Handles view model update event.\r\n $onUpdate(vmData) {\r\n this.$getPlugins().map(plugin => (typeof plugin['$update'] == 'function' ? plugin.$update.apply(this, [ vmData ]) : null));\r\n }\r\n\r\n // *** CRUD Functions ***\r\n\r\n // Sets items key to identify individual items in a list.\r\n // Accepts object literal: { \"\": \"\", ... }\r\n $setItemKey(iItemKey) {\r\n Object.assign(this.$itemKey, iItemKey);\r\n }\r\n\r\n //// Adds a new item to a state array.\r\n $addList(iListName, iNewItem) {\r\n // Check if the list already has an item with the same key. If so, replace it.\r\n var key = this.$itemKey[iListName];\r\n if (key != null) {\r\n if (!iNewItem.hasOwnProperty(key)) {\r\n console.error(`[${this.$vmId}] couldn't add item to '${iListName}' due to missing property '${key}'.`);\r\n return;\r\n }\r\n var match = this.State()[iListName].filter(function(i) {\r\n return i[key] == iNewItem[key];\r\n });\r\n if (match.length > 0) {\r\n console.error(`[${this.$vmId}] couldn't add item to '${iListName}' because the key already exists.`);\r\n return;\r\n }\r\n }\r\n\r\n let items = this.State()[iListName];\r\n items.push(iNewItem);\r\n\r\n let state = {};\r\n state[iListName] = items;\r\n this.State(state);\r\n }\r\n\r\n // Removes an item from a state array.\r\n $removeList(iListName, iFilter) {\r\n let state = {};\r\n state[iListName] = this.State()[iListName].filter(i => !iFilter(i));\r\n this.State(state);\r\n }\r\n\r\n //// Updates existing item to an observable array.\r\n $updateList(iListName, iNewItem) {\r\n // Check if the list already has an item with the same key. If so, update it.\r\n let key = this.$itemKey[iListName];\r\n if (key != null) {\r\n if (!iNewItem.hasOwnProperty(key)) {\r\n console.error(`[${this.$vmId}] couldn't update item to '${iListName}' due to missing property '${key}'.`);\r\n return;\r\n }\r\n var state = {};\r\n state[iListName] = this.State()[iListName].map(function(i) {\r\n return i[key] == iNewItem[key] ? $.extend(i, iNewItem) : i;\r\n });\r\n this.State(state);\r\n }\r\n else console.error(`[${this.$vmId}] missing item key for '${iListName}'; add '${iListName}_itemKey' property to the view model.`);\r\n }\r\n}\r\n","/* \r\nimport { dotnetify } from 'dotnetify/dist/dotnetify-ko';\r\nCopyright 2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport { createEventEmitter } from '../libs/utils';\r\n\r\nconst window = window || global || {};\r\n\r\nconst normalize = iVMId => iVMId && iVMId.replace(/\\./g, '_');\r\nconst hasLocalVM = iVMId => {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n return typeof vm == 'object' && typeof vm.onConnect == 'function';\r\n};\r\n\r\nexport class dotNetifyHubLocal {\r\n mode = 'local';\r\n debug = false;\r\n isConnected = false;\r\n isHubStarted = false;\r\n\r\n responseEvent = createEventEmitter();\r\n reconnectedEvent = createEventEmitter();\r\n connectedEvent = createEventEmitter();\r\n connectionFailedEvent = createEventEmitter();\r\n\r\n startHub() {\r\n this.isConnected = true;\r\n this.isHubStarted = true;\r\n this.connectedEvent.emit();\r\n }\r\n\r\n requestVM(iVMId, iVMArgs) {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n\r\n if (typeof vm === 'object' && typeof vm.onConnect == 'function') {\r\n if (this.debug) console.log(`[${iVMId}] *** local mode ***`);\r\n\r\n vm.$pushUpdate = update => {\r\n if (typeof update == 'object') update = JSON.stringify(update);\r\n setTimeout(() => this.responseEvent.emit(iVMId, update));\r\n };\r\n\r\n vm.$pushUpdate(vm.onConnect(iVMArgs) || {});\r\n }\r\n }\r\n\r\n updateVM(iVMId, iValue) {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n\r\n if (typeof vm === 'object' && typeof vm.onDispatch == 'function') {\r\n let state = vm.onDispatch(iValue);\r\n if (state) {\r\n if (typeof state == 'object') state = JSON.stringify(state);\r\n setTimeout(() => this.responseEvent.emit(iVMId, state));\r\n }\r\n }\r\n }\r\n\r\n disposeVM(iVMId) {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n\r\n if (typeof vm === 'object' && typeof vm.onDestroy == 'function') {\r\n vm.onDestroy(iVMId);\r\n }\r\n }\r\n}\r\n\r\nexport default new dotNetifyHubLocal();\r\nexport { hasLocalVM };\r\n","module.exports = __WEBPACK_EXTERNAL_MODULE__7__;","/**\n* jQuery core object.\n*\n* Worker with jQuery deferred\n*\n* Code from: https://github.com/jquery/jquery/blob/master/src/core.js\n*\n*/\n\nvar jQuery = module.exports = {\n\ttype: type\n\t, isArray: isArray\n\t, isFunction: isFunction\n\t, isPlainObject: isPlainObject\n\t, each: each\n\t, extend: extend\n\t, noop: function() {}\n};\n\nvar toString = Object.prototype.toString;\n\nvar class2type = {};\n// Populate the class2type map\n\"Boolean Number String Function Array Date RegExp Object\".split(\" \").forEach(function(name) {\n\tclass2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n});\n\n\nfunction type( obj ) {\n\treturn obj == null ?\n\t\tString( obj ) :\n\t\t\tclass2type[ toString.call(obj) ] || \"object\";\n}\n\nfunction isFunction( obj ) {\n\treturn jQuery.type(obj) === \"function\";\n}\n\nfunction isArray( obj ) {\n\treturn jQuery.type(obj) === \"array\";\n}\n\nfunction each( object, callback, args ) {\n\tvar name, i = 0,\n\tlength = object.length,\n\tisObj = length === undefined || isFunction( object );\n\n\tif ( args ) {\n\t\tif ( isObj ) {\n\t\t\tfor ( name in object ) {\n\t\t\t\tif ( callback.apply( object[ name ], args ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( ; i < length; ) {\n\t\t\t\tif ( callback.apply( object[ i++ ], args ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// A special, fast, case for the most common use of each\n\t} else {\n\t\tif ( isObj ) {\n\t\t\tfor ( name in object ) {\n\t\t\t\tif ( callback.call( object[ name ], name, object[ name ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( ; i < length; ) {\n\t\t\t\tif ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn object;\n}\n\nfunction isPlainObject( obj ) {\n\t// Must be an Object.\n\tif ( !obj || jQuery.type(obj) !== \"object\" ) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\nfunction extend() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\ttarget = arguments[0] || {},\n\ti = 1,\n\tlength = arguments.length,\n\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif ( typeof target === \"boolean\" ) {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\n\t// Handle case when target is a string or something (possible in deep copy)\n\tif ( typeof target !== \"object\" && !jQuery.isFunction(target) ) {\n\t\ttarget = {};\n\t}\n\n\t// extend jQuery itself if only one argument is passed\n\tif ( length === i ) {\n\t\ttarget = this;\n\t\t--i;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\t\t// Only deal with non-null/undefined values\n\t\tif ( (options = arguments[ i ]) != null ) {\n\t\t\t// Extend the base object\n\t\t\tfor ( name in options ) {\n\t\t\t\tsrc = target[ name ];\n\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif ( target === copy ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {\n\t\t\t\t\tif ( copyIsArray ) {\n\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\tclone = src && jQuery.isArray(src) ? src : [];\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclone = src && jQuery.isPlainObject(src) ? src : {};\n\t\t\t\t\t}\n\n\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\n\n","var jQuery = module.exports = require(\"./jquery-core.js\"),\n\tcore_rspace = /\\s+/;\n/**\n* jQuery Callbacks\n*\n* Code from: https://github.com/jquery/jquery/blob/master/src/callbacks.js\n*\n*/\n\n\n// String to Object options format cache\nvar optionsCache = {};\n\n// Convert String-formatted options into Object-formatted ones and store in cache\nfunction createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.split( core_rspace ), function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n\t// Convert options from String-formatted to Object-formatted if needed\n\t// (we check in cache first)\n\toptions = typeof options === \"string\" ?\n\t\t( optionsCache[ options ] || createOptions( options ) ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Last fire value (for non-forgettable lists)\n\t\tmemory,\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\t\t// Flag to know if list is currently firing\n\t\tfiring,\n\t\t// First callback to fire (used internally by add and fireWith)\n\t\tfiringStart,\n\t\t// End of the loop when firing\n\t\tfiringLength,\n\t\t// Index of currently firing callback (modified by remove if needed)\n\t\tfiringIndex,\n\t\t// Actual callback list\n\t\tlist = [],\n\t\t// Stack of fire calls for repeatable lists\n\t\tstack = !options.once && [],\n\t\t// Fire callbacks\n\t\tfire = function( data ) {\n\t\t\tmemory = options.memory && data;\n\t\t\tfired = true;\n\t\t\tfiringIndex = firingStart || 0;\n\t\t\tfiringStart = 0;\n\t\t\tfiringLength = list.length;\n\t\t\tfiring = true;\n\t\t\tfor ( ; list && firingIndex < firingLength; firingIndex++ ) {\n\t\t\t\tif ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {\n\t\t\t\t\tmemory = false; // To prevent further calls using add\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfiring = false;\n\t\t\tif ( list ) {\n\t\t\t\tif ( stack ) {\n\t\t\t\t\tif ( stack.length ) {\n\t\t\t\t\t\tfire( stack.shift() );\n\t\t\t\t\t}\n\t\t\t\t} else if ( memory ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t} else {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t// Actual Callbacks object\n\t\tself = {\n\t\t\t// Add a callback or a collection of callbacks to the list\n\t\t\tadd: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\t// First, we save the current length\n\t\t\t\t\tvar start = list.length;\n\t\t\t\t\t(function add( args ) {\n\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {\n\t\t\t\t\t\t\tvar type = jQuery.type( arg );\n\t\t\t\t\t\t\tif ( type === \"function\" ) {\n\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {\n\t\t\t\t\t\t\t\t\tlist.push( arg );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if ( arg && arg.length && type !== \"string\" ) {\n\t\t\t\t\t\t\t\t// Inspect recursively\n\t\t\t\t\t\t\t\tadd( arg );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t})( arguments );\n\t\t\t\t\t// Do we need to add the callbacks to the\n\t\t\t\t\t// current firing batch?\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tfiringLength = list.length;\n\t\t\t\t\t// With memory, if we're not firing then\n\t\t\t\t\t// we should call right away\n\t\t\t\t\t} else if ( memory ) {\n\t\t\t\t\t\tfiringStart = start;\n\t\t\t\t\t\tfire( memory );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\t\tvar index;\n\t\t\t\t\t\twhile( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\t\tlist.splice( index, 1 );\n\t\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\t\t\tif ( index <= firingLength ) {\n\t\t\t\t\t\t\t\t\tfiringLength--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\t\t\tfiringIndex--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Control if a given callback is in the list\n\t\t\thas: function( fn ) {\n\t\t\t\treturn jQuery.inArray( fn, list ) > -1;\n\t\t\t},\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tlist = [];\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Have the list do nothing anymore\n\t\t\tdisable: function() {\n\t\t\t\tlist = stack = memory = undefined;\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it disabled?\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\t\t\t// Lock the list in its current state\n\t\t\tlock: function() {\n\t\t\t\tstack = undefined;\n\t\t\t\tif ( !memory ) {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it locked?\n\t\t\tlocked: function() {\n\t\t\t\treturn !stack;\n\t\t\t},\n\t\t\t// Call all callbacks with the given context and arguments\n\t\t\tfireWith: function( context, args ) {\n\t\t\t\targs = args || [];\n\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\tif ( list && ( !fired || stack ) ) {\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tstack.push( args );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfire( args );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Call all the callbacks with the given arguments\n\t\t\tfire: function() {\n\t\t\t\tself.fireWith( this, arguments );\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// To know if the callbacks have already been called at least once\n\t\t\tfired: function() {\n\t\t\t\treturn !!fired;\n\t\t\t}\n\t\t};\n\n\treturn self;\n};\n\n","\n/*!\n* jquery-deferred\n* Copyright(c) 2011 Hidden \n* MIT Licensed\n*/\n\n/**\n* Library version.\n*/\n\nvar jQuery = module.exports = require(\"./jquery-callbacks.js\"),\n\tcore_slice = Array.prototype.slice;\n\n/**\n* jQuery deferred\n*\n* Code from: https://github.com/jquery/jquery/blob/master/src/deferred.js\n* Doc: http://api.jquery.com/category/deferred-object/\n*\n*/\n\njQuery.extend({\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\t\t\t\t// action, add listener, listener list, final state\n\t\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks(\"once memory\"), \"resolved\" ],\n\t\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks(\"once memory\"), \"rejected\" ],\n\t\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks(\"memory\") ]\n\t\t\t],\n\t\t\tstate = \"pending\",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\tthen: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\t\t\t\t\treturn jQuery.Deferred(function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\t\t\t\t\tvar action = tuple[ 0 ],\n\t\t\t\t\t\t\t\tfn = fns[ i ];\n\t\t\t\t\t\t\t// deferred[ done | fail | progress ] for forwarding actions to newDefer\n\t\t\t\t\t\t\tdeferred[ tuple[1] ]( jQuery.isFunction( fn ) ?\n\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\tvar returned = fn.apply( this, arguments );\n\t\t\t\t\t\t\t\t\tif ( returned && jQuery.isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject )\n\t\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tnewDefer[ action + \"With\" ]( this === deferred ? newDefer : this, [ returned ] );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} :\n\t\t\t\t\t\t\t\tnewDefer[ action ]\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tfns = null;\n\t\t\t\t\t}).promise();\n\t\t\t\t},\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Keep pipe for back-compat\n\t\tpromise.pipe = promise.then;\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 3 ];\n\n\t\t\t// promise[ done | fail | progress ] = list.add\n\t\t\tpromise[ tuple[1] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(function() {\n\t\t\t\t\t// state = [ resolved | rejected ]\n\t\t\t\t\tstate = stateString;\n\n\t\t\t\t// [ reject_list | resolve_list ].disable; progress_list.lock\n\t\t\t\t}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );\n\t\t\t}\n\n\t\t\t// deferred[ resolve | reject | notify ] = list.fire\n\t\t\tdeferred[ tuple[0] ] = list.fire;\n\t\t\tdeferred[ tuple[0] + \"With\" ] = list.fireWith;\n\t\t});\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( subordinate /* , ..., subordinateN */ ) {\n\t\tvar i = 0,\n\t\t\tresolveValues = core_slice.call( arguments ),\n\t\t\tlength = resolveValues.length,\n\n\t\t\t// the count of uncompleted subordinates\n\t\t\tremaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,\n\n\t\t\t// the master Deferred. If resolveValues consist of only a single Deferred, just use that.\n\t\t\tdeferred = remaining === 1 ? subordinate : jQuery.Deferred(),\n\n\t\t\t// Update function for both resolve and progress values\n\t\t\tupdateFunc = function( i, contexts, values ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tcontexts[ i ] = this;\n\t\t\t\t\tvalues[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;\n\t\t\t\t\tif( values === progressValues ) {\n\t\t\t\t\t\tdeferred.notifyWith( contexts, values );\n\t\t\t\t\t} else if ( !( --remaining ) ) {\n\t\t\t\t\t\tdeferred.resolveWith( contexts, values );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t},\n\n\t\t\tprogressValues, progressContexts, resolveContexts;\n\n\t\t// add listeners to Deferred subordinates; treat others as resolved\n\t\tif ( length > 1 ) {\n\t\t\tprogressValues = new Array( length );\n\t\t\tprogressContexts = new Array( length );\n\t\t\tresolveContexts = new Array( length );\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {\n\t\t\t\t\tresolveValues[ i ].promise()\n\t\t\t\t\t\t.done( updateFunc( i, resolveContexts, resolveValues ) )\n\t\t\t\t\t\t.fail( deferred.reject )\n\t\t\t\t\t\t.progress( updateFunc( i, progressContexts, progressValues ) );\n\t\t\t\t} else {\n\t\t\t\t\t--remaining;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// if we're not waiting on anything, resolve the master\n\t\tif ( !remaining ) {\n\t\t\tdeferred.resolveWith( resolveContexts, resolveValues );\n\t\t}\n\n\t\treturn deferred.promise();\n\t}\n});\n","\nmodule.exports = require('./lib/jquery-deferred');","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","/* \r\nCopyright 2017-2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport { createEventEmitter } from '../libs/utils';\r\nimport jQueryShim from '../libs/jquery-shim';\r\nconst signalRNetCore = require('@aspnet/signalr');\r\nlet $ = jQueryShim;\r\n\r\nconst window = window || global || {};\r\n\r\nexport class dotnetifyHubFactory {\r\n static create() {\r\n let dotnetifyHub = {\r\n version: '2.0.0',\r\n type: null,\r\n\r\n reconnectDelay: [ 2, 5, 10 ],\r\n reconnectRetry: null,\r\n\r\n _startInfo: null,\r\n _init: false,\r\n\r\n // Hub server methods.\r\n requestVM: (iVMId, iOptions) => dotnetifyHub.server.request_VM(iVMId, iOptions),\r\n updateVM: (iVMId, iValue) => dotnetifyHub.server.update_VM(iVMId, iValue),\r\n disposeVM: iVMId => dotnetifyHub.server.dispose_VM(iVMId),\r\n\r\n // Connection events.\r\n responseEvent: createEventEmitter(),\r\n reconnectedEvent: createEventEmitter(),\r\n connectedEvent: createEventEmitter(),\r\n connectionFailedEvent: createEventEmitter(),\r\n\r\n get isHubStarted() {\r\n return !!this._startInfo;\r\n },\r\n\r\n // Starts connection with SignalR hub server.\r\n startHub(hubOptions, doneHandler, failHandler, forceRestart) {\r\n const _doneHandler = () => {\r\n if (typeof doneHandler == 'function') doneHandler();\r\n this.connectedEvent.emit();\r\n };\r\n const _failHandler = ex => {\r\n if (typeof failHander == 'function') failHandler();\r\n this.connectionFailedEvent.emit();\r\n throw ex;\r\n };\r\n\r\n if (this._startInfo === null || forceRestart) {\r\n try {\r\n this._startInfo = this.start(hubOptions).done(_doneHandler).fail(_failHandler);\r\n } catch (err) {\r\n this._startInfo = null;\r\n }\r\n }\r\n else {\r\n try {\r\n this._startInfo.done(_doneHandler);\r\n } catch (err) {\r\n this._startInfo = null;\r\n return this.startHub(hubOptions, doneHandler, failHandler, forceRestart);\r\n }\r\n }\r\n }\r\n };\r\n\r\n // Configures connection to SignalR hub server.\r\n dotnetifyHub.init = function(iHubPath, iServerUrl, signalR) {\r\n if (dotnetifyHub._init) return;\r\n\r\n dotnetifyHub._init = true;\r\n signalR = signalR || window.signalR || signalRNetCore;\r\n\r\n // SignalR .NET Core.\r\n if (signalR && signalR.HubConnection) {\r\n dotnetifyHub.type = 'netcore';\r\n\r\n Object.defineProperty(dotnetifyHub, 'isConnected', {\r\n get: function() {\r\n return dotnetifyHub._connection && dotnetifyHub._connection.connection.connectionState === 1;\r\n }\r\n });\r\n\r\n dotnetifyHub = $.extend(dotnetifyHub, {\r\n hubPath: iHubPath || '/dotnetify',\r\n url: iServerUrl,\r\n\r\n // Internal variables. Do not modify!\r\n _connection: null,\r\n _reconnectCount: 0,\r\n _startDoneHandler: null,\r\n _startFailHandler: null,\r\n _disconnectedHandler: function() {},\r\n _stateChangedHandler: function(iNewState) {},\r\n\r\n _onDisconnected: function() {\r\n dotnetifyHub._changeState(4);\r\n dotnetifyHub._disconnectedHandler();\r\n },\r\n\r\n _changeState: function(iNewState) {\r\n if (iNewState == 1) dotnetifyHub._reconnectCount = 0;\r\n\r\n let stateText = { 0: 'connecting', 1: 'connected', 2: 'reconnecting', 4: 'disconnected', 99: 'terminated' };\r\n dotnetifyHub._stateChangedHandler(stateText[iNewState]);\r\n },\r\n\r\n _startConnection: function(iHubOptions, iTransportArray) {\r\n let url = dotnetifyHub.url ? dotnetifyHub.url + dotnetifyHub.hubPath : dotnetifyHub.hubPath;\r\n let hubOptions = {};\r\n Object.keys(iHubOptions).forEach(function(key) {\r\n hubOptions[key] = iHubOptions[key];\r\n });\r\n hubOptions.transport = iTransportArray.shift();\r\n\r\n dotnetifyHub._connection = new signalR.HubConnectionBuilder().withUrl(url, hubOptions).build();\r\n dotnetifyHub._connection.on('response_vm', dotnetifyHub.client.response_VM);\r\n dotnetifyHub._connection.onclose(dotnetifyHub._onDisconnected);\r\n\r\n let promise = dotnetifyHub._connection\r\n .start()\r\n .then(function() {\r\n dotnetifyHub._changeState(1);\r\n })\r\n .catch(function() {\r\n // If failed to start, fallback to the next transport.\r\n if (iTransportArray.length > 0) dotnetifyHub._startConnection(iHubOptions, iTransportArray);\r\n else dotnetifyHub._onDisconnected();\r\n });\r\n\r\n if (typeof dotnetifyHub._startDoneHandler === 'function')\r\n promise.then(dotnetifyHub._startDoneHandler).catch(dotnetifyHub._startFailHandler || function() {});\r\n return promise;\r\n },\r\n\r\n start: function(iHubOptions) {\r\n dotnetifyHub._startDoneHandler = null;\r\n dotnetifyHub._startFailHandler = null;\r\n\r\n // Map the transport option.\r\n let transport = [ 0 ];\r\n let transportOptions = { webSockets: 0, serverSentEvents: 1, longPolling: 2 };\r\n if (iHubOptions && Array.isArray(iHubOptions.transport))\r\n transport = iHubOptions.transport.map(function(arg) {\r\n return transportOptions[arg];\r\n });\r\n\r\n let promise = dotnetifyHub._startConnection(iHubOptions, transport);\r\n return {\r\n done: function(iHandler) {\r\n dotnetifyHub._startDoneHandler = iHandler;\r\n promise.then(iHandler).catch(function(error) {\r\n throw error;\r\n });\r\n return this;\r\n },\r\n fail: function(iHandler) {\r\n dotnetifyHub._startFailHandler = iHandler;\r\n promise.catch(iHandler);\r\n return this;\r\n }\r\n };\r\n },\r\n\r\n disconnected: function(iHandler) {\r\n if (typeof iHandler === 'function') dotnetifyHub._disconnectedHandler = iHandler;\r\n },\r\n\r\n stateChanged: function(iHandler) {\r\n if (typeof iHandler === 'function') dotnetifyHub._stateChangedHandler = iHandler;\r\n },\r\n\r\n reconnect: function(iStartHubFunc) {\r\n if (typeof iStartHubFunc === 'function') {\r\n // Only attempt reconnect if the specified retry hasn't been exceeded.\r\n if (!dotnetifyHub.reconnectRetry || dotnetifyHub._reconnectCount < dotnetifyHub.reconnectRetry) {\r\n // Determine reconnect delay from the specified configuration array.\r\n let delay =\r\n dotnetifyHub._reconnectCount < dotnetifyHub.reconnectDelay.length\r\n ? dotnetifyHub.reconnectDelay[dotnetifyHub._reconnectCount]\r\n : dotnetifyHub.reconnectDelay[dotnetifyHub.reconnectDelay.length - 1];\r\n\r\n dotnetifyHub._reconnectCount++;\r\n\r\n setTimeout(function() {\r\n dotnetifyHub._changeState(2);\r\n iStartHubFunc();\r\n }, delay * 1000);\r\n }\r\n else dotnetifyHub._changeState(99);\r\n }\r\n },\r\n\r\n client: {},\r\n\r\n server: {\r\n dispose_VM: function(iVMId) {\r\n dotnetifyHub._connection.invoke('Dispose_VM', iVMId);\r\n },\r\n update_VM: function(iVMId, iValue) {\r\n dotnetifyHub._connection.invoke('Update_VM', iVMId, iValue);\r\n },\r\n request_VM: function(iVMId, iArgs) {\r\n dotnetifyHub._connection.invoke('Request_VM', iVMId, iArgs);\r\n }\r\n }\r\n });\r\n }\r\n else {\r\n // SignalR .NET FX.\r\n dotnetifyHub.type = 'netfx';\r\n\r\n if (window.jQuery) $ = window.jQuery;\r\n\r\n // SignalR hub auto-generated from /signalr/hubs.\r\n /// \r\n /// \r\n (function($, window, undefined) {\r\n /// \r\n 'use strict';\r\n\r\n if (typeof $.signalR !== 'function') {\r\n throw new Error('SignalR: SignalR is not loaded. Please ensure jquery.signalR-x.js is referenced before ~/signalr/js.');\r\n }\r\n\r\n var signalR = $.signalR;\r\n\r\n function makeProxyCallback(hub, callback) {\r\n return function() {\r\n // Call the client hub method\r\n callback.apply(hub, $.makeArray(arguments));\r\n };\r\n }\r\n\r\n function registerHubProxies(instance, shouldSubscribe) {\r\n var key, hub, memberKey, memberValue, subscriptionMethod;\r\n\r\n for (key in instance) {\r\n if (instance.hasOwnProperty(key)) {\r\n hub = instance[key];\r\n\r\n if (!hub.hubName) {\r\n // Not a client hub\r\n continue;\r\n }\r\n\r\n if (shouldSubscribe) {\r\n // We want to subscribe to the hub events\r\n subscriptionMethod = hub.on;\r\n }\r\n else {\r\n // We want to unsubscribe from the hub events\r\n subscriptionMethod = hub.off;\r\n }\r\n\r\n // Loop through all members on the hub and find client hub functions to subscribe/unsubscribe\r\n for (memberKey in hub.client) {\r\n if (hub.client.hasOwnProperty(memberKey)) {\r\n memberValue = hub.client[memberKey];\r\n\r\n if (!$.isFunction(memberValue)) {\r\n // Not a client hub function\r\n continue;\r\n }\r\n\r\n subscriptionMethod.call(hub, memberKey, makeProxyCallback(hub, memberValue));\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n $.hubConnection.prototype.createHubProxies = function() {\r\n var proxies = {};\r\n this.starting(function() {\r\n // Register the hub proxies as subscribed\r\n // (instance, shouldSubscribe)\r\n registerHubProxies(proxies, true);\r\n\r\n this._registerSubscribedHubs();\r\n }).disconnected(function() {\r\n // Unsubscribe all hub proxies when we \"disconnect\". This is to ensure that we do not re-add functional call backs.\r\n // (instance, shouldSubscribe)\r\n registerHubProxies(proxies, false);\r\n });\r\n\r\n proxies['dotNetifyHub'] = this.createHubProxy('dotNetifyHub');\r\n proxies['dotNetifyHub'].client = {};\r\n proxies['dotNetifyHub'].server = {\r\n dispose_VM: function(vmId) {\r\n return proxies['dotNetifyHub'].invoke.apply(proxies['dotNetifyHub'], $.merge([ 'Dispose_VM' ], $.makeArray(arguments)));\r\n },\r\n\r\n request_VM: function(vmId, vmArg) {\r\n return proxies['dotNetifyHub'].invoke.apply(proxies['dotNetifyHub'], $.merge([ 'Request_VM' ], $.makeArray(arguments)));\r\n },\r\n\r\n update_VM: function(vmId, vmData) {\r\n return proxies['dotNetifyHub'].invoke.apply(proxies['dotNetifyHub'], $.merge([ 'Update_VM' ], $.makeArray(arguments)));\r\n }\r\n };\r\n\r\n return proxies;\r\n };\r\n\r\n signalR.hub = $.hubConnection(dotnetifyHub.hubPath, { useDefaultPath: false });\r\n $.extend(signalR, signalR.hub.createHubProxies());\r\n })($, window);\r\n\r\n Object.defineProperty(dotnetifyHub, 'state', {\r\n get: function() {\r\n return $.connection.hub.state;\r\n },\r\n set: function(val) {\r\n $.connection.hub.state = val;\r\n }\r\n });\r\n\r\n Object.defineProperty(dotnetifyHub, 'client', {\r\n get: function() {\r\n return $.connection.dotNetifyHub.client;\r\n }\r\n });\r\n\r\n Object.defineProperty(dotnetifyHub, 'server', {\r\n get: function() {\r\n return $.connection.dotNetifyHub.server;\r\n }\r\n });\r\n\r\n Object.defineProperty(dotnetifyHub, 'isConnected', {\r\n get: function() {\r\n return $.connection.hub.state == $.signalR.connectionState.connected;\r\n }\r\n });\r\n\r\n dotnetifyHub = $.extend(dotnetifyHub, {\r\n hubPath: iHubPath || '/signalr',\r\n url: iServerUrl,\r\n\r\n _reconnectCount: 0,\r\n _stateChangedHandler: function(iNewState) {},\r\n\r\n start: function(iHubOptions) {\r\n if (dotnetifyHub.url) $.connection.hub.url = dotnetifyHub.url;\r\n\r\n let deferred;\r\n if (iHubOptions) deferred = $.connection.hub.start(iHubOptions);\r\n else deferred = $.connection.hub.start();\r\n deferred.fail(function(error) {\r\n if (error.source && error.source.message === 'Error parsing negotiate response.')\r\n console.warn('This client may be attempting to connect to an incompatible SignalR .NET Core server.');\r\n });\r\n return deferred;\r\n },\r\n\r\n disconnected: function(iHandler) {\r\n return $.connection.hub.disconnected(iHandler);\r\n },\r\n\r\n stateChanged: function(iHandler) {\r\n dotnetifyHub._stateChangedHandler = iHandler;\r\n return $.connection.hub.stateChanged(function(state) {\r\n if (state == 1) dotnetifyHub._reconnectCount = 0;\r\n\r\n let stateText = { 0: 'connecting', 1: 'connected', 2: 'reconnecting', 4: 'disconnected' };\r\n iHandler(stateText[state.newState]);\r\n });\r\n },\r\n\r\n reconnect: function(iStartHubFunc) {\r\n if (typeof iStartHubFunc === 'function') {\r\n // Only attempt reconnect if the specified retry hasn't been exceeded.\r\n if (!dotnetifyHub.reconnectRetry || dotnetifyHub._reconnectCount < dotnetifyHub.reconnectRetry) {\r\n // Determine reconnect delay from the specified configuration array.\r\n let delay =\r\n dotnetifyHub._reconnectCount < dotnetifyHub.reconnectDelay.length\r\n ? dotnetifyHub.reconnectDelay[dotnetifyHub._reconnectCount]\r\n : dotnetifyHub.reconnectDelay[dotnetifyHub.reconnectDelay.length - 1];\r\n\r\n dotnetifyHub._reconnectCount++;\r\n\r\n setTimeout(function() {\r\n dotnetifyHub._stateChangedHandler('reconnecting');\r\n iStartHubFunc();\r\n }, delay * 1000);\r\n }\r\n else dotnetifyHub._stateChangedHandler('terminated');\r\n }\r\n }\r\n });\r\n }\r\n\r\n // Setup SignalR server method handler.\r\n dotnetifyHub.client.response_VM = function(iVMId, iVMData) {\r\n // SignalR .NET Core is sending an array of arguments.\r\n if (Array.isArray(iVMId)) {\r\n iVMData = iVMId[1];\r\n iVMId = iVMId[0];\r\n }\r\n\r\n let handled = dotnetifyHub.responseEvent.emit(iVMId, iVMData);\r\n\r\n // If we get to this point, that means the server holds a view model instance\r\n // whose view no longer existed. So, tell the server to dispose the view model.\r\n if (!handled) dotnetifyHub.server.dispose_VM(iVMId);\r\n };\r\n\r\n // On disconnected, keep attempting to start the connection.\r\n dotnetifyHub.disconnected(function() {\r\n dotnetifyHub._startInfo = null;\r\n dotnetifyHub.reconnect(function() {\r\n dotnetifyHub.reconnectedEvent.emit();\r\n });\r\n });\r\n };\r\n\r\n return dotnetifyHub;\r\n }\r\n}\r\n\r\nexport default dotnetifyHubFactory.create();\r\n","/* \r\nCopyright 2017-2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport dotnetifyHub, { dotnetifyHubFactory } from './dotnetify-hub';\r\nimport localHub, { hasLocalVM } from './dotnetify-hub-local';\r\n\r\nexport class dotnetifyFactory {\r\n static create() {\r\n const dotnetify = {\r\n // SignalR hub options.\r\n hub: dotnetifyHub,\r\n hubOptions: { transport: [ 'webSockets', 'longPolling' ] },\r\n hubPath: null,\r\n\r\n // Debug mode.\r\n debug: false,\r\n debugFn: null,\r\n\r\n // Offline mode. (WIP)\r\n offline: false,\r\n isOffline: true,\r\n offlineTimeout: 5000,\r\n offlineCacheFn: null,\r\n\r\n // Internal variables.\r\n _vmAccessors: [],\r\n\r\n // Use this to get notified of connection state changed events.\r\n // (state, exception, hub) => void\r\n connectionStateHandler: null,\r\n\r\n // Use this intercept a view model prior to establishing connection,\r\n // with the option to provide any connect parameters.\r\n // ({vmId, options}) => {vmId, options, hub}\r\n connectHandler: null,\r\n\r\n // Support changing hub server URL after first init.\r\n get hubServerUrl() {\r\n return this.hub.url;\r\n },\r\n\r\n set hubServerUrl(url) {\r\n this.hub.url = url;\r\n if (this.debug) console.log('SignalR: connecting to ' + this.hubServerUrl);\r\n if (this.hub.isHubStarted) this.startHub(this.hub, true);\r\n },\r\n\r\n // Generic connect function for non-React app.\r\n connect(iVMId, iOptions) {\r\n dotnetify.react.connect(iVMId, null, iOptions);\r\n },\r\n\r\n // Creates a SignalR hub client.\r\n createHub(hubServerUrl, hubPath, hubLib) {\r\n return this.initHub(dotnetifyHubFactory.create(), hubPath, hubServerUrl, hubLib);\r\n },\r\n\r\n // Configures hub connection to SignalR hub server.\r\n initHub(hub, hubPath, hubServerUrl, hubLib) {\r\n hub = hub || this.hub;\r\n hubPath = hubPath || this.hubPath;\r\n hubServerUrl = hubServerUrl || this.hubServerUrl;\r\n hubLib = hubLib || this.hubLib;\r\n\r\n if (!hub.isHubStarted) {\r\n hub.init(hubPath, hubServerUrl, hubLib);\r\n\r\n // Use SignalR event to raise the connection state event.\r\n hub.stateChanged(state => this.handleConnectionStateChanged(state, null, hub));\r\n }\r\n return hub;\r\n },\r\n\r\n // Used by a view to select a hub, and provides the opportunity to override any connect info.\r\n selectHub(vmConnectArgs) {\r\n vmConnectArgs = vmConnectArgs || { options: {} };\r\n let override = (typeof this.connectHandler == 'function' && this.connectHandler(vmConnectArgs)) || {};\r\n if (!override.hub) {\r\n override.hub = hasLocalVM(vmConnectArgs.vmId) ? localHub : this.initHub();\r\n override.hub.debug = this.debug;\r\n }\r\n return Object.assign(vmConnectArgs, override);\r\n },\r\n\r\n // Starts hub connection to SignalR hub server.\r\n startHub(hub, forceRestart) {\r\n hub = hub || this.hub;\r\n\r\n const doneHandler = () => {};\r\n const failHandler = ex => this.handleConnectionStateChanged('error', ex, hub);\r\n hub.startHub(this.hubOptions, doneHandler, failHandler, forceRestart);\r\n },\r\n\r\n // Used by dotnetify-react and -vue to expose their view model accessors.\r\n addVMAccessor(vmAccessor) {\r\n !this._vmAccessors.includes(vmAccessor) && this._vmAccessors.push(vmAccessor);\r\n },\r\n\r\n checkServerSideException(iVMId, iVMData, iExceptionHandler) {\r\n const vmData = JSON.parse(iVMData);\r\n if (vmData && vmData.hasOwnProperty('ExceptionType') && vmData.hasOwnProperty('Message')) {\r\n const exception = { name: vmData.ExceptionType, message: vmData.Message };\r\n\r\n if (typeof iExceptionHandler === 'function') {\r\n return iExceptionHandler(exception);\r\n }\r\n else {\r\n console.error('[' + iVMId + '] ' + exception.name + ': ' + exception.message);\r\n throw exception;\r\n }\r\n }\r\n },\r\n\r\n // Get all view models.\r\n getViewModels() {\r\n return this._vmAccessors\r\n .reduce((prev, current) => [ ...prev, ...current() ], [])\r\n .filter((val, idx, self) => self.indexOf(val) === idx); // returns distinct items.\r\n },\r\n\r\n handleConnectionStateChanged(iState, iException, iHub) {\r\n if (this.debug) console.log('SignalR: ' + (iException ? iException.message : iState));\r\n if (typeof this.connectionStateHandler === 'function') this.connectionStateHandler(iState, iException, iHub);\r\n else if (iException) console.error(iException);\r\n }\r\n };\r\n\r\n return dotnetify;\r\n }\r\n}\r\n\r\nexport default dotnetifyFactory.create();\r\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://dotnetify/webpack/universalModuleDefinition","webpack://dotnetify/webpack/bootstrap","webpack://dotnetify/(webpack)/buildin/global.js","webpack://dotnetify/./src/dotnetify/react/dotnetify-react.js","webpack://dotnetify/./src/dotnetify/libs/utils.js","webpack://dotnetify/./src/dotnetify/libs/jquery-shim.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-vm.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-hub-webapi.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-hub-local.js","webpack://dotnetify/external {\"commonjs\":\"@aspnet/signalr\",\"commonjs2\":\"@aspnet/signalr\",\"amd\":\"@aspnet/signalr\",\"root\":\"signalR\"}","webpack://dotnetify/./node_modules/jquery-deferred/lib/jquery-core.js","webpack://dotnetify/./node_modules/jquery-deferred/lib/jquery-callbacks.js","webpack://dotnetify/./node_modules/jquery-deferred/lib/jquery-deferred.js","webpack://dotnetify/./node_modules/jquery-deferred/index.js","webpack://dotnetify/(webpack)/buildin/module.js","webpack://dotnetify/./src/dotnetify/core/dotnetify-hub.js","webpack://dotnetify/./src/dotnetify/core/dotnetify.js"],"names":["window","global","dotnetify","_dotnetify","react","version","viewModels","plugins","controller","_hubs","init","iHub","self","hubInitialized","some","hub","start","isHubStarted","Object","keys","filter","vmId","$hub","forEach","$requested","startHub","responseEvent","subscribe","iVMId","iVMData","_responseVM","connectedEvent","$request","reconnectedEvent","mode","push","connect","iReact","iOptions","arguments","length","Error","vmArg","ssr","ssrConnect","hasOwnProperty","console","error","$destroy","setTimeout","component","props","state","setState","connectInfo","selectHub","options","dotnetifyVM","getViewModels","map","vm","checkServerSideException","$exceptionHandler","$update","addVMAccessor","utils","iStr","indexOf","substr","iStr1","iStr2","toLowerCase","iValue","slice","iEvent","Event","dispatchEvent","event","document","createEvent","initEvent","iArray","iFilter","Array","isArray","createEventEmitter","subscribers","emit","args","handled","subscriber","includes","x","fetch","iMethod","iUrl","iData","Promise","resolve","reject","request","XMLHttpRequest","open","onload","status","response","responseText","onerror","send","jQueryDeferred","require","jQueryShim","extend","selector","on","iHandler","addEventListener","bind","unbind","removeEventListener","events","handlers","idx","splice","triggerHandler","iArgs","type","arg","handler","apply","load","querySelector","innerHTML","call","abort","reason","support","cors","trim","inArray","iItem","makeArray","merge","iArray1","iArray2","prototype","isEmptyObject","iObj","ajax","onreadystatechange","readyState","_hasError","success","JSON","parse","url","setRequestHeader","contentType","data","getScript","iSuccess","done","promise","Deferred","head","getElementsByTagName","script","createElement","src","removeChild","appendChild","jQuery","exports","module","iComponent","iDotNetify","$vmId","$component","$options","$vmArg","$headers","$loaded","$itemKey","$dotnetify","getState","State","Props","prop","$","$getPlugins","plugin","$inject","isConnected","disposeVM","ex","handleConnectionStateChanged","updateVM","debug","log","debugFn","key","listName","item","$dispatch","$updateList","id","iVMUpdate","match","exec","$addList","$removeList","i","itemKey","$setItemKey","requestVM","vmData","$preProcess","$onLoad","$onUpdate","$ready","iItemKey","assign","iListName","iNewItem","items","dotNetifyHubWebApi","iBaseUrl","iOnRequest","connectionFailedEvent","_vmArgs","baseUrl","onRequest","iVMArgs","vmArgs","vmArgQuery","stringify","headers","then","catch","payload","createWebApiHub","create","normalize","replace","hasLocalVM","onConnect","dotNetifyHubLocal","$pushUpdate","update","onDispatch","onDestroy","signalRNetCore","dotnetifyHubFactory","dotnetifyHub","reconnectDelay","reconnectRetry","_startInfo","_init","server","request_VM","update_VM","dispose_VM","hubOptions","doneHandler","failHandler","forceRestart","_doneHandler","_failHandler","failHander","fail","err","iHubPath","iServerUrl","signalR","HubConnection","defineProperty","get","_connection","connection","connectionState","hubPath","_reconnectCount","_startDoneHandler","_startFailHandler","_disconnectedHandler","_stateChangedHandler","iNewState","_onDisconnected","_changeState","stateText","_startConnection","iHubOptions","iTransportArray","transport","shift","HubConnectionBuilder","withUrl","build","client","response_VM","onclose","transportOptions","webSockets","serverSentEvents","longPolling","disconnected","stateChanged","reconnect","iStartHubFunc","delay","invoke","undefined","makeProxyCallback","callback","registerHubProxies","instance","shouldSubscribe","memberKey","memberValue","subscriptionMethod","hubName","off","isFunction","hubConnection","createHubProxies","proxies","starting","_registerSubscribedHubs","createHubProxy","useDefaultPath","set","val","dotNetifyHub","connected","deferred","source","message","warn","newState","dotnetifyFactory","offline","isOffline","offlineTimeout","offlineCacheFn","_vmAccessors","connectionStateHandler","connectHandler","hubServerUrl","createHub","hubLib","initHub","onRequestHandler","vmConnectArgs","override","localHub","webApi","webApiHub","vmAccessor","iExceptionHandler","exception","name","ExceptionType","Message","reduce","prev","current","iState","iException"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;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;AACD;AACF;AACF;;;8BAESxB,K,EAAO;AACf,UAAMP,OAAO6N,UAAUtN,KAAV,CAAb;AACA,UAAMgC,KAAK5D,OAAOqB,IAAP,CAAX;;AAEA,UAAI,QAAOuC,EAAP,yCAAOA,EAAP,OAAc,QAAd,IAA0B,OAAOA,GAAG8L,SAAV,IAAuB,UAArD,EAAiE;AAC/D9L,WAAG8L,SAAH,CAAa9N,KAAb;AACD;AACF;;;;;;kBAGY,IAAI0N,iBAAJ,E;QACNF,U,GAAAA,U;;;;;;;ACnFT,gD;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;AAGD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,UAAU,YAAY;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,UAAU,YAAY;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,QAAQ,YAAY;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;ACxJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,oCAAoC;AAC9C;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;AC3MA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA,MAAM;AACN,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,8CAA8C;AAC9C,KAAK;AACL;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,IAAI;;AAEJ;;AAEA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA,UAAU,YAAY;AACtB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;;;;;;;ACjKD,yC;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;;;;;;;;;;;;;;qjBCrBA;;;;;;;;;;;;;;;;;AAeA;;AACA;;;;;;;;AACA,IAAMO,iBAAiB,mBAAA7I,CAAQ,CAAR,CAAvB;AACA,IAAI8E,IAAI7E,oBAAR;;AAEA,IAAM/G,SAASA,UAAUC,MAAV,IAAoB,EAAnC;;IAEa2P,mB,WAAAA,mB;;;;;;;6BACK;AACd,UAAIC,eAAe;AACjBxP,iBAAS,OADQ;AAEjByH,cAAM,IAFW;;AAIjBgI,wBAAgB,CAAE,CAAF,EAAK,CAAL,EAAQ,EAAR,CAJC;AAKjBC,wBAAgB,IALC;;AAOjBC,oBAAY,IAPK;AAQjBC,eAAO,KARU;;AA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ASzH,OAAOmJ,OAA9C,EAAlB;;AAEA,gBAAI,OAAOJ,iBAAP,KAA6B,UAAjC,EAA6C;AAC3C,qBAAOA,kBAAkBC,SAAlB,CAAP;AACD,aAFD,MAGK;AACHzT,sBAAQC,KAAR,CAAc,MAAMnB,KAAN,GAAc,IAAd,GAAqB2U,UAAUC,IAA/B,GAAsC,IAAtC,GAA6CD,UAAUvB,OAArE;AACA,oBAAMuB,SAAN;AACD;AACF;AACF,SA7Ge;;;AA+GhB;AACA7S,qBAhHgB,2BAgHA;AACd,iBAAO,KAAK8R,YAAL,CACJmB,MADI,CACG,UAACC,IAAD,EAAOC,OAAP;AAAA,gDAAwBD,IAAxB,sBAAiCC,SAAjC;AAAA,WADH,EACiD,EADjD,EAEJzV,MAFI,CAEG,UAACuT,GAAD,EAAMjN,GAAN,EAAW9G,IAAX;AAAA,mBAAoBA,KAAKuD,OAAL,CAAawQ,GAAb,MAAsBjN,GAA1C;AAAA,WAFH,CAAP,CADc,CAG4C;AAC3D,SApHe;AAsHhByE,oCAtHgB,wCAsHa2K,MAtHb,EAsHqBC,UAtHrB,EAsHiCpW,IAtHjC,EAsHuC;AACrD,cAAI,KAAK0L,KAAT,EAAgBvJ,QAAQwJ,GAAR,CAAY,eAAeyK,aAAaA,WAAW/B,OAAxB,GAAkC8B,MAAjD,CAAZ;AAChB,cAAI,OAAO,KAAKrB,sBAAZ,KAAuC,UAA3C,EAAuD,KAAKA,sBAAL,CAA4BqB,MAA5B,EAAoCC,UAApC,EAAgDpW,IAAhD,EAAvD,KACK,IAAIoW,UAAJ,EAAgBjU,QAAQC,KAAR,CAAcgU,UAAd;AACtB;AA1He,OAAlB;;AA6HA,aAAO7W,SAAP;AACD;;;;;;kBAGYiV,iBAAiBlG,MAAjB,E","file":"dotnetify.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@aspnet/signalr\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"@aspnet/signalr\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"dotnetify\"] = factory(require(\"@aspnet/signalr\"));\n\telse\n\t\troot[\"dotnetify\"] = factory(root[\"signalR\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__8__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport _dotnetify from '../core/dotnetify';\r\nimport dotnetifyVM from '../core/dotnetify-vm';\r\n\r\nconst window = window || global || {};\r\nlet dotnetify = window.dotnetify || _dotnetify;\r\n\r\ndotnetify.react = {\r\n version: '3.0.0',\r\n viewModels: {},\r\n plugins: {},\r\n controller: dotnetify,\r\n\r\n // Internal variables.\r\n _hubs: [],\r\n\r\n // Initializes connection to SignalR server hub.\r\n init: function(iHub) {\r\n const self = dotnetify.react;\r\n const hubInitialized = self._hubs.some(hub => hub === iHub);\r\n\r\n const start = function() {\r\n if (!iHub.isHubStarted)\r\n Object.keys(self.viewModels)\r\n .filter(vmId => self.viewModels[vmId].$hub === iHub)\r\n .forEach(vmId => (self.viewModels[vmId].$requested = false));\r\n\r\n dotnetify.startHub(iHub);\r\n };\r\n\r\n if (!hubInitialized) {\r\n iHub.responseEvent.subscribe((iVMId, iVMData) => self._responseVM(iVMId, iVMData));\r\n iHub.connectedEvent.subscribe(() =>\r\n Object.keys(self.viewModels)\r\n .filter(vmId => self.viewModels[vmId].$hub === iHub && !self.viewModels[vmId].$requested)\r\n .forEach(vmId => self.viewModels[vmId].$request())\r\n );\r\n iHub.reconnectedEvent.subscribe(start);\r\n\r\n if (iHub.mode !== 'local') self._hubs.push(iHub);\r\n }\r\n\r\n start();\r\n },\r\n\r\n // Connects to a server view model.\r\n connect: function(iVMId, iReact, iOptions) {\r\n if (arguments.length < 2) throw new Error('[dotNetify] Missing arguments. Usage: connect(vmId, component) ');\r\n\r\n const vmArg = iOptions && iOptions['vmArg'];\r\n\r\n if (dotnetify.ssr && dotnetify.react.ssrConnect) {\r\n return dotnetify.react.ssrConnect(iVMId, iReact, vmArg);\r\n }\r\n\r\n const self = dotnetify.react;\r\n if (self.viewModels.hasOwnProperty(iVMId)) {\r\n console.error(\r\n `Component is attempting to connect to an already active '${iVMId}'. ` +\r\n ` If it's from a dismounted component, you must add vm.$destroy to componentWillUnmount().`\r\n );\r\n self.viewModels[iVMId].$destroy();\r\n return setTimeout(() => self.connect(iVMId, iReact, iOptions));\r\n }\r\n\r\n const component = {\r\n get props() {\r\n return iReact.props;\r\n },\r\n get state() {\r\n return iReact.state;\r\n },\r\n setState(state) {\r\n iReact.setState(state);\r\n }\r\n };\r\n\r\n const connectInfo = dotnetify.selectHub({ vmId: iVMId, options: iOptions, hub: null });\r\n self.viewModels[iVMId] = new dotnetifyVM(connectInfo.vmId, component, connectInfo.options, self, connectInfo.hub);\r\n if (connectInfo.hub) self.init(connectInfo.hub);\r\n\r\n return self.viewModels[iVMId];\r\n },\r\n\r\n // Get all view models.\r\n getViewModels: function() {\r\n const self = dotnetify.react;\r\n return Object.keys(self.viewModels).map(vmId => self.viewModels[vmId]);\r\n },\r\n\r\n _responseVM: function(iVMId, iVMData) {\r\n const self = dotnetify.react;\r\n\r\n if (self.viewModels.hasOwnProperty(iVMId)) {\r\n const vm = self.viewModels[iVMId];\r\n dotnetify.checkServerSideException(iVMId, iVMData, vm.$exceptionHandler);\r\n vm.$update(iVMData);\r\n return true;\r\n }\r\n return false;\r\n }\r\n};\r\n\r\ndotnetify.addVMAccessor(dotnetify.react.getViewModels);\r\n\r\nexport default dotnetify;\r\n","/* \r\nCopyright 2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nconst window = window || global || {};\r\n\r\nclass utils {\r\n // Trim slashes from start and end of string.\r\n trim(iStr) {\r\n if (typeof iStr !== 'string') return '';\r\n\r\n while (iStr.indexOf('/', iStr.length - 1) >= 0) iStr = iStr.substr(0, iStr.length - 1);\r\n while (iStr.indexOf('/') == 0) iStr = iStr.substr(1, iStr.length - 1);\r\n return iStr;\r\n }\r\n\r\n // Match two strings case-insensitive.\r\n equal(iStr1, iStr2) {\r\n return iStr1 != null && iStr2 != null && iStr1.toLowerCase() == iStr2.toLowerCase();\r\n }\r\n\r\n // Whether the string starts or ends with a value.\r\n startsWith(iStr, iValue) {\r\n return iStr.toLowerCase().slice(0, iValue.length) == iValue.toLowerCase();\r\n }\r\n\r\n endsWith(iStr, iValue) {\r\n return iValue == '' || iStr.toLowerCase().slice(-iValue.length) == iValue.toLowerCase();\r\n }\r\n\r\n // Dispatch event with IE polyfill.\r\n dispatchEvent(iEvent) {\r\n if (typeof Event === 'function') window.dispatchEvent(new Event(iEvent));\r\n else {\r\n var event = document.createEvent('CustomEvent');\r\n event.initEvent(iEvent, true, true);\r\n window.dispatchEvent(event);\r\n }\r\n }\r\n\r\n grep(iArray, iFilter) {\r\n return Array.isArray(iArray) ? iArray.filter(iFilter) : [];\r\n }\r\n}\r\n\r\nexport const createEventEmitter = _ => {\r\n let subscribers = [];\r\n return {\r\n emit(...args) {\r\n let handled = false;\r\n subscribers.forEach(subscriber => {\r\n handled = subscriber(...args) || handled;\r\n });\r\n return handled;\r\n },\r\n\r\n subscribe(subscriber) {\r\n !subscribers.includes(subscriber) && subscribers.push(subscriber);\r\n return () => (subscribers = subscribers.filter(x => x !== subscriber));\r\n }\r\n };\r\n};\r\n\r\nexport const fetch = (iMethod, iUrl, iData, iOptions) => {\r\n return new Promise((resolve, reject) => {\r\n let request = new window.XMLHttpRequest();\r\n request.open(iMethod, iUrl, true);\r\n if (typeof iOptions == 'function') iOptions(request);\r\n\r\n request.onload = function() {\r\n if (request.status >= 200 && request.status < 400) {\r\n var response = request.responseText;\r\n resolve(response);\r\n }\r\n else reject(request);\r\n };\r\n request.onerror = function() {\r\n reject(request);\r\n };\r\n request.send(iData);\r\n });\r\n};\r\n\r\nexport default new utils();\r\n","/* \r\nCopyright 2017 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\n\r\nconst window = window || global || {};\r\n\r\nconst jQueryDeferred = require('jquery-deferred');\r\nconst jQueryShim = jQueryDeferred.extend(\r\n function(selector) {\r\n if (selector === window || selector.document)\r\n return {\r\n 0: selector,\r\n on: function(iEvent, iHandler) {\r\n window.addEventListener(iEvent, iHandler);\r\n },\r\n bind: function(iEvent, iHandler) {\r\n window.addEventListener(iEvent, iHandler, false);\r\n },\r\n unbind: function(iEvent, iHandler) {\r\n window.removeEventListener(iEvent, iHandler, false);\r\n }\r\n };\r\n\r\n if (typeof selector !== 'string') selector.events = selector.events || {};\r\n\r\n return {\r\n 0: selector,\r\n\r\n bind: function(iEvent, iHandler) {\r\n var event = selector.events[iEvent] || [];\r\n event.push(iHandler);\r\n selector.events[iEvent] = event;\r\n },\r\n\r\n unbind: function(iEvent, iHandler) {\r\n var handlers = selector.events[iEvent] || [];\r\n if (iHandler) {\r\n var idx = handlers.indexOf(iHandler);\r\n if (idx !== -1) handlers.splice(idx, 1);\r\n }\r\n else handlers = [];\r\n selector.events[iEvent] = handlers;\r\n },\r\n\r\n triggerHandler: function(iEvent, iArgs) {\r\n var handlers = selector.events[iEvent] || [];\r\n var args = [ { type: iEvent } ];\r\n if (Array.isArray(iArgs))\r\n iArgs.forEach(function(arg) {\r\n args.push(arg);\r\n });\r\n else if (iArgs) args.push(iArgs);\r\n handlers.forEach(function(handler) {\r\n handler.apply(this, args);\r\n });\r\n },\r\n\r\n load: function(iUrl, iArgs, iHandler) {\r\n var request = new window.XMLHttpRequest();\r\n request.open('GET', iUrl, true);\r\n request.onload = function() {\r\n if (request.status >= 200 && request.status < 400) {\r\n var response = request.responseText;\r\n document.querySelector(selector).innerHTML = response;\r\n iHandler.call(document.querySelector(selector));\r\n }\r\n };\r\n request.send();\r\n return {\r\n abort: function(reason) {\r\n return request.abort(reason);\r\n }\r\n };\r\n }\r\n };\r\n },\r\n jQueryDeferred,\r\n {\r\n support: { cors: true },\r\n\r\n trim: function(iStr) {\r\n return typeof iStr === 'string' ? iStr.trim() : iStr;\r\n },\r\n\r\n inArray: function(iArray, iItem) {\r\n return iArray.indexOf(iItem) !== -1;\r\n },\r\n\r\n makeArray: function makeArray(iArray) {\r\n return [].slice.call(iArray, 0);\r\n },\r\n\r\n merge: function(iArray1, iArray2) {\r\n Array.prototype.push.apply(iArray1, iArray2);\r\n return iArray1;\r\n },\r\n\r\n isEmptyObject: function(iObj) {\r\n return !iObj || Object.keys(iObj).length === 0;\r\n },\r\n\r\n ajax: function(iOptions) {\r\n var request = new window.XMLHttpRequest();\r\n request.onreadystatechange = function() {\r\n if (request.readyState !== 4) return;\r\n if (request.status === 200 && !request._hasError) {\r\n try {\r\n iOptions.success && iOptions.success(JSON.parse(request.responseText));\r\n } catch (error) {\r\n iOptions.success && iOptions.success(request.responseText);\r\n }\r\n }\r\n else iOptions.error && iOptions.error(request);\r\n };\r\n request.open(iOptions.type, iOptions.url);\r\n request.setRequestHeader('content-type', iOptions.contentType);\r\n request.send(iOptions.data.data && 'data=' + iOptions.data.data);\r\n return {\r\n abort: function(reason) {\r\n return request.abort(reason);\r\n }\r\n };\r\n },\r\n\r\n getScript: function(iUrl, iSuccess) {\r\n var done = false;\r\n var promise = jQueryDeferred.Deferred();\r\n var head = document.getElementsByTagName('head')[0];\r\n var script = document.createElement('script');\r\n script.src = iUrl;\r\n script.onload = script.onreadystatechange = function() {\r\n if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) {\r\n done = true;\r\n script.onload = script.onreadystatechange = null;\r\n head.removeChild(script);\r\n if (typeof iSuccess === 'function') iSuccess();\r\n promise.resolve();\r\n }\r\n };\r\n head.appendChild(script);\r\n return promise;\r\n }\r\n }\r\n);\r\n\r\nif (typeof window !== 'undefined') window.jQuery = window.jQuery || jQueryShim;\r\n\r\nif (typeof exports === 'object' && typeof module === 'object') module.exports = jQueryShim;\r\n","/* \r\nCopyright 2017-2018 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport $ from '../libs/jquery-shim';\r\n\r\nconst window = window || global || {};\r\n\r\n// Client-side view model that acts as a proxy of the server view model.\r\nexport default class dotnetifyVM {\r\n // iVMId - identifies the view model.\r\n // iComponent - component object.\r\n // iOptions - Optional configuration options:\r\n // getState: state accessor.\r\n // setState: state mutator.\r\n // vmArg: view model arguments.\r\n // headers: request headers, for things like authentication token.\r\n // exceptionHandler: called when receiving server-side exception.\r\n // iDotNetify - framework-specific dotNetify library.\r\n // iHub - hub connection.\r\n constructor(iVMId, iComponent, iOptions, iDotNetify, iHub) {\r\n this.$vmId = iVMId;\r\n this.$component = iComponent;\r\n this.$options = iOptions || {};\r\n this.$vmArg = iOptions && iOptions['vmArg'];\r\n this.$headers = iOptions && iOptions['headers'];\r\n this.$exceptionHandler = iOptions && iOptions['exceptionHandler'];\r\n this.$requested = false;\r\n this.$loaded = false;\r\n this.$itemKey = {};\r\n this.$dotnetify = iDotNetify;\r\n this.$hub = iHub;\r\n\r\n let getState = iOptions && iOptions['getState'];\r\n let setState = iOptions && iOptions['setState'];\r\n getState = typeof getState === 'function' ? getState : () => iComponent.state;\r\n setState = typeof setState === 'function' ? setState : state => iComponent.setState(state);\r\n\r\n this.State = state => (typeof state === 'undefined' ? getState() : setState(state));\r\n this.Props = prop => this.$component.props && this.$component.props[prop];\r\n\r\n const vmArg = this.Props('vmArg');\r\n if (vmArg) this.$vmArg = $.extend(this.$vmArg, vmArg);\r\n\r\n // Inject plugin functions into this view model.\r\n this.$getPlugins().map(plugin => (typeof plugin['$inject'] == 'function' ? plugin.$inject(this) : null));\r\n }\r\n\r\n // Disposes the view model, both here and on the server.\r\n $destroy() {\r\n // Call any plugin's $destroy function if provided.\r\n this.$getPlugins().map(plugin => (typeof plugin['$destroy'] == 'function' ? plugin.$destroy.apply(this) : null));\r\n\r\n if (this.$hub.isConnected) {\r\n try {\r\n this.$hub.disposeVM(this.$vmId);\r\n } catch (ex) {\r\n this.$dotnetify.controller.handleConnectionStateChanged('error', ex, this.$hub);\r\n }\r\n }\r\n\r\n delete this.$dotnetify.viewModels[this.$vmId];\r\n }\r\n\r\n // Dispatches a value to the server view model.\r\n // iValue - Value to dispatch.\r\n $dispatch(iValue) {\r\n if (this.$hub.isConnected) {\r\n const controller = this.$dotnetify.controller;\r\n try {\r\n this.$hub.updateVM(this.$vmId, iValue);\r\n\r\n if (controller.debug) {\r\n console.log('[' + this.$vmId + '] sent> ');\r\n console.log(iValue);\r\n\r\n controller.debugFn && controller.debugFn(this.$vmId, 'sent', iValue);\r\n }\r\n } catch (ex) {\r\n controller.handleConnectionStateChanged('error', ex, this.$hub);\r\n }\r\n }\r\n }\r\n\r\n // Dispatches a state value to the server view model.\r\n // iValue - State value to dispatch.\r\n $dispatchListState(iValue) {\r\n for (var listName in iValue) {\r\n const key = this.$itemKey[listName];\r\n if (!key) {\r\n console.error(`[${this.$vmId}] missing item key for '${listName}'; add ${listName}_itemKey property to the view model.`);\r\n return;\r\n }\r\n var item = iValue[listName];\r\n if (!item[key]) {\r\n console.error(`[${this.$vmId}] couldn't dispatch data from '${listName}' due to missing property '${key}'.`);\r\n console.error(item);\r\n return;\r\n }\r\n\r\n Object.keys(item).forEach(prop => {\r\n if (prop != key) {\r\n let state = {};\r\n state[listName + '.$' + item[key] + '.' + prop] = item[prop];\r\n this.$dispatch(state);\r\n }\r\n });\r\n this.$updateList(listName, item);\r\n }\r\n }\r\n\r\n $getPlugins() {\r\n return Object.keys(this.$dotnetify.plugins).map(id => this.$dotnetify.plugins[id]);\r\n }\r\n\r\n // Preprocess view model update from the server before we set the state.\r\n $preProcess(iVMUpdate) {\r\n const vm = this;\r\n\r\n for (var prop in iVMUpdate) {\r\n // Look for property that end with '_add'. Interpret the value as a list item to be added\r\n // to an existing list whose property name precedes that suffix.\r\n var match = /(.*)_add/.exec(prop);\r\n if (match != null) {\r\n var listName = match[1];\r\n if (Array.isArray(this.State()[listName])) vm.$addList(listName, iVMUpdate[prop]);\r\n else console.error('unable to resolve ' + prop);\r\n delete iVMUpdate[prop];\r\n continue;\r\n }\r\n\r\n // Look for property that end with '_update'. Interpret the value as a list item to be updated\r\n // to an existing list whose property name precedes that suffix.\r\n var match = /(.*)_update/.exec(prop);\r\n if (match != null) {\r\n var listName = match[1];\r\n if (Array.isArray(this.State()[listName])) vm.$updateList(listName, iVMUpdate[prop]);\r\n else console.error('[' + this.$vmId + \"] '\" + listName + \"' is not found or not an array.\");\r\n delete iVMUpdate[prop];\r\n continue;\r\n }\r\n\r\n // Look for property that end with '_remove'. Interpret the value as a list item key to remove\r\n // from an existing list whose property name precedes that suffix.\r\n var match = /(.*)_remove/.exec(prop);\r\n if (match != null) {\r\n var listName = match[1];\r\n if (Array.isArray(this.State()[listName])) {\r\n var key = this.$itemKey[listName];\r\n if (key != null)\r\n vm.$removeList(listName, function(i) {\r\n return i[key] == iVMUpdate[prop];\r\n });\r\n else console.error(`[${this.$vmId}] missing item key for '${listName}'; add ${listName}_itemKey property to the view model.`);\r\n }\r\n else console.error(`[${this.$vmId}] '${listName}' is not found or not an array.`);\r\n delete iVMUpdate[prop];\r\n continue;\r\n }\r\n\r\n // Look for property that end with '_itemKey'. Interpret the value as the property name that will\r\n // uniquely identify items in the list.\r\n var match = /(.*)_itemKey/.exec(prop);\r\n if (match != null) {\r\n var listName = match[1];\r\n var itemKey = {};\r\n itemKey[listName] = iVMUpdate[prop];\r\n vm.$setItemKey(itemKey);\r\n delete iVMUpdate[prop];\r\n continue;\r\n }\r\n }\r\n }\r\n\r\n // Requests state from the server view model.\r\n $request() {\r\n if (this.$hub.isConnected) this.$hub.requestVM(this.$vmId, { $vmArg: this.$vmArg, $headers: this.$headers });\r\n this.$requested = true;\r\n }\r\n\r\n // Updates state from the server view model to the view.\r\n // iVMData - Serialized state from the server.\r\n $update(iVMData) {\r\n const controller = this.$dotnetify.controller;\r\n if (controller.debug) {\r\n console.log('[' + this.$vmId + '] received> ');\r\n console.log(JSON.parse(iVMData));\r\n\r\n controller.debugFn && controller.debugFn(this.$vmId, 'received', JSON.parse(iVMData));\r\n }\r\n let vmData = JSON.parse(iVMData);\r\n this.$preProcess(vmData);\r\n\r\n let state = this.State();\r\n state = $.extend({}, state, vmData);\r\n this.State(state);\r\n\r\n if (!this.$loaded) this.$onLoad();\r\n else this.$onUpdate(vmData);\r\n }\r\n\r\n // Handles initial view model load event.\r\n $onLoad() {\r\n this.$getPlugins().map(plugin => (typeof plugin['$ready'] == 'function' ? plugin.$ready.apply(this) : null));\r\n this.$loaded = true;\r\n }\r\n\r\n // Handles view model update event.\r\n $onUpdate(vmData) {\r\n this.$getPlugins().map(plugin => (typeof plugin['$update'] == 'function' ? plugin.$update.apply(this, [ vmData ]) : null));\r\n }\r\n\r\n // *** CRUD Functions ***\r\n\r\n // Sets items key to identify individual items in a list.\r\n // Accepts object literal: { \"\": \"\", ... }\r\n $setItemKey(iItemKey) {\r\n Object.assign(this.$itemKey, iItemKey);\r\n }\r\n\r\n //// Adds a new item to a state array.\r\n $addList(iListName, iNewItem) {\r\n // Check if the list already has an item with the same key. If so, replace it.\r\n var key = this.$itemKey[iListName];\r\n if (key != null) {\r\n if (!iNewItem.hasOwnProperty(key)) {\r\n console.error(`[${this.$vmId}] couldn't add item to '${iListName}' due to missing property '${key}'.`);\r\n return;\r\n }\r\n var match = this.State()[iListName].filter(function(i) {\r\n return i[key] == iNewItem[key];\r\n });\r\n if (match.length > 0) {\r\n console.error(`[${this.$vmId}] couldn't add item to '${iListName}' because the key already exists.`);\r\n return;\r\n }\r\n }\r\n\r\n let items = this.State()[iListName];\r\n items.push(iNewItem);\r\n\r\n let state = {};\r\n state[iListName] = items;\r\n this.State(state);\r\n }\r\n\r\n // Removes an item from a state array.\r\n $removeList(iListName, iFilter) {\r\n let state = {};\r\n state[iListName] = this.State()[iListName].filter(i => !iFilter(i));\r\n this.State(state);\r\n }\r\n\r\n //// Updates existing item to an observable array.\r\n $updateList(iListName, iNewItem) {\r\n // Check if the list already has an item with the same key. If so, update it.\r\n let key = this.$itemKey[iListName];\r\n if (key != null) {\r\n if (!iNewItem.hasOwnProperty(key)) {\r\n console.error(`[${this.$vmId}] couldn't update item to '${iListName}' due to missing property '${key}'.`);\r\n return;\r\n }\r\n var state = {};\r\n state[iListName] = this.State()[iListName].map(function(i) {\r\n return i[key] == iNewItem[key] ? $.extend(i, iNewItem) : i;\r\n });\r\n this.State(state);\r\n }\r\n else console.error(`[${this.$vmId}] missing item key for '${iListName}'; add '${iListName}_itemKey' property to the view model.`);\r\n }\r\n}\r\n","/* \r\nCopyright 2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport { createEventEmitter, fetch } from '../libs/utils';\r\n\r\nexport class dotNetifyHubWebApi {\r\n mode = 'webapi';\r\n debug = false;\r\n isConnected = false;\r\n isHubStarted = false;\r\n\r\n responseEvent = createEventEmitter();\r\n reconnectedEvent = createEventEmitter();\r\n connectedEvent = createEventEmitter();\r\n connectionFailedEvent = createEventEmitter();\r\n\r\n _vmArgs = {};\r\n\r\n constructor(iBaseUrl, iOnRequest) {\r\n this.baseUrl = iBaseUrl || '';\r\n this.onRequest = iOnRequest;\r\n }\r\n\r\n static create(iBaseUrl, iOnRequest) {\r\n return new dotNetifyHubWebApi(iBaseUrl, iOnRequest);\r\n }\r\n\r\n startHub() {\r\n this.isConnected = true;\r\n this.isHubStarted = true;\r\n this.connectedEvent.emit();\r\n }\r\n\r\n requestVM(iVMId, iVMArgs) {\r\n const vmArgs = iVMArgs || {};\r\n const vmArgQuery = vmArgs.$vmArg ? '?vmarg=' + JSON.stringify(vmArgs.$vmArg) : '';\r\n const headers = vmArgs.$headers || {};\r\n\r\n this._vmArgs[iVMId] = vmArgs;\r\n const url = this.baseUrl + `/api/dotnetify/vm/${iVMId}${vmArgQuery}`;\r\n\r\n fetch('GET', url, null, request => {\r\n Object.keys(headers).forEach(key => request.setRequestHeader(key, headers[key]));\r\n if (typeof this.onRequest == 'function') this.onRequest(url, request);\r\n })\r\n .then(response => {\r\n this.responseEvent.emit(iVMId, response);\r\n })\r\n .catch(request => console.error(`[${iVMId}] Request failed`, request));\r\n }\r\n\r\n updateVM(iVMId, iValue) {\r\n const vmArgs = this._vmArgs[iVMId] || {};\r\n const vmArgQuery = vmArgs.$vmArg ? '?vmarg=' + JSON.stringify(vmArgs.$vmArg) : '';\r\n const headers = vmArgs.$headers || {};\r\n const payload = typeof iValue == 'object' ? JSON.stringify(iValue) : iValue;\r\n\r\n const url = this.baseUrl + `/api/dotnetify/vm/${iVMId}${vmArgQuery}`;\r\n\r\n fetch('POST', url, payload, request => {\r\n request.setRequestHeader('Content-Type', 'application/json');\r\n Object.keys(headers).forEach(key => request.setRequestHeader(key, headers[key]));\r\n if (typeof this.onRequest == 'function') this.onRequest(url, request, payload);\r\n })\r\n .then(response => {\r\n this.responseEvent.emit(iVMId, response);\r\n })\r\n .catch(request => console.error(`[${iVMId}] Update failed`, request));\r\n }\r\n\r\n disposeVM(iVMId) {\r\n delete this._vmArgs[iVMId];\r\n }\r\n}\r\n\r\nconst createWebApiHub = dotNetifyHubWebApi.create;\r\n\r\nexport { createWebApiHub };\r\nexport default dotNetifyHubWebApi.create();\r\n","/* \r\nCopyright 2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport { createEventEmitter } from '../libs/utils';\r\n\r\nconst window = window || global || {};\r\n\r\nconst normalize = iVMId => iVMId && iVMId.replace(/\\./g, '_');\r\nconst hasLocalVM = iVMId => {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n return typeof vm == 'object' && typeof vm.onConnect == 'function';\r\n};\r\n\r\nexport class dotNetifyHubLocal {\r\n mode = 'local';\r\n debug = false;\r\n isConnected = false;\r\n isHubStarted = false;\r\n\r\n responseEvent = createEventEmitter();\r\n reconnectedEvent = createEventEmitter();\r\n connectedEvent = createEventEmitter();\r\n connectionFailedEvent = createEventEmitter();\r\n\r\n startHub() {\r\n this.isConnected = true;\r\n this.isHubStarted = true;\r\n this.connectedEvent.emit();\r\n }\r\n\r\n requestVM(iVMId, iVMArgs) {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n\r\n if (typeof vm === 'object' && typeof vm.onConnect == 'function') {\r\n if (this.debug) console.log(`[${iVMId}] *** local mode ***`);\r\n\r\n vm.$pushUpdate = update => {\r\n if (typeof update == 'object') update = JSON.stringify(update);\r\n setTimeout(() => this.responseEvent.emit(iVMId, update));\r\n };\r\n\r\n vm.$pushUpdate(vm.onConnect(iVMArgs) || {});\r\n }\r\n }\r\n\r\n updateVM(iVMId, iValue) {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n\r\n if (typeof vm === 'object' && typeof vm.onDispatch == 'function') {\r\n let state = vm.onDispatch(iValue);\r\n if (state) {\r\n if (typeof state == 'object') state = JSON.stringify(state);\r\n setTimeout(() => this.responseEvent.emit(iVMId, state));\r\n }\r\n }\r\n }\r\n\r\n disposeVM(iVMId) {\r\n const vmId = normalize(iVMId);\r\n const vm = window[vmId];\r\n\r\n if (typeof vm === 'object' && typeof vm.onDestroy == 'function') {\r\n vm.onDestroy(iVMId);\r\n }\r\n }\r\n}\r\n\r\nexport default new dotNetifyHubLocal();\r\nexport { hasLocalVM };\r\n","module.exports = __WEBPACK_EXTERNAL_MODULE__8__;","/**\n* jQuery core object.\n*\n* Worker with jQuery deferred\n*\n* Code from: https://github.com/jquery/jquery/blob/master/src/core.js\n*\n*/\n\nvar jQuery = module.exports = {\n\ttype: type\n\t, isArray: isArray\n\t, isFunction: isFunction\n\t, isPlainObject: isPlainObject\n\t, each: each\n\t, extend: extend\n\t, noop: function() {}\n};\n\nvar toString = Object.prototype.toString;\n\nvar class2type = {};\n// Populate the class2type map\n\"Boolean Number String Function Array Date RegExp Object\".split(\" \").forEach(function(name) {\n\tclass2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n});\n\n\nfunction type( obj ) {\n\treturn obj == null ?\n\t\tString( obj ) :\n\t\t\tclass2type[ toString.call(obj) ] || \"object\";\n}\n\nfunction isFunction( obj ) {\n\treturn jQuery.type(obj) === \"function\";\n}\n\nfunction isArray( obj ) {\n\treturn jQuery.type(obj) === \"array\";\n}\n\nfunction each( object, callback, args ) {\n\tvar name, i = 0,\n\tlength = object.length,\n\tisObj = length === undefined || isFunction( object );\n\n\tif ( args ) {\n\t\tif ( isObj ) {\n\t\t\tfor ( name in object ) {\n\t\t\t\tif ( callback.apply( object[ name ], args ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( ; i < length; ) {\n\t\t\t\tif ( callback.apply( object[ i++ ], args ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// A special, fast, case for the most common use of each\n\t} else {\n\t\tif ( isObj ) {\n\t\t\tfor ( name in object ) {\n\t\t\t\tif ( callback.call( object[ name ], name, object[ name ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( ; i < length; ) {\n\t\t\t\tif ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn object;\n}\n\nfunction isPlainObject( obj ) {\n\t// Must be an Object.\n\tif ( !obj || jQuery.type(obj) !== \"object\" ) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\nfunction extend() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\ttarget = arguments[0] || {},\n\ti = 1,\n\tlength = arguments.length,\n\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif ( typeof target === \"boolean\" ) {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\n\t// Handle case when target is a string or something (possible in deep copy)\n\tif ( typeof target !== \"object\" && !jQuery.isFunction(target) ) {\n\t\ttarget = {};\n\t}\n\n\t// extend jQuery itself if only one argument is passed\n\tif ( length === i ) {\n\t\ttarget = this;\n\t\t--i;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\t\t// Only deal with non-null/undefined values\n\t\tif ( (options = arguments[ i ]) != null ) {\n\t\t\t// Extend the base object\n\t\t\tfor ( name in options ) {\n\t\t\t\tsrc = target[ name ];\n\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif ( target === copy ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {\n\t\t\t\t\tif ( copyIsArray ) {\n\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\tclone = src && jQuery.isArray(src) ? src : [];\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclone = src && jQuery.isPlainObject(src) ? src : {};\n\t\t\t\t\t}\n\n\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\n\n","var jQuery = module.exports = require(\"./jquery-core.js\"),\n\tcore_rspace = /\\s+/;\n/**\n* jQuery Callbacks\n*\n* Code from: https://github.com/jquery/jquery/blob/master/src/callbacks.js\n*\n*/\n\n\n// String to Object options format cache\nvar optionsCache = {};\n\n// Convert String-formatted options into Object-formatted ones and store in cache\nfunction createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.split( core_rspace ), function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n\t// Convert options from String-formatted to Object-formatted if needed\n\t// (we check in cache first)\n\toptions = typeof options === \"string\" ?\n\t\t( optionsCache[ options ] || createOptions( options ) ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Last fire value (for non-forgettable lists)\n\t\tmemory,\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\t\t// Flag to know if list is currently firing\n\t\tfiring,\n\t\t// First callback to fire (used internally by add and fireWith)\n\t\tfiringStart,\n\t\t// End of the loop when firing\n\t\tfiringLength,\n\t\t// Index of currently firing callback (modified by remove if needed)\n\t\tfiringIndex,\n\t\t// Actual callback list\n\t\tlist = [],\n\t\t// Stack of fire calls for repeatable lists\n\t\tstack = !options.once && [],\n\t\t// Fire callbacks\n\t\tfire = function( data ) {\n\t\t\tmemory = options.memory && data;\n\t\t\tfired = true;\n\t\t\tfiringIndex = firingStart || 0;\n\t\t\tfiringStart = 0;\n\t\t\tfiringLength = list.length;\n\t\t\tfiring = true;\n\t\t\tfor ( ; list && firingIndex < firingLength; firingIndex++ ) {\n\t\t\t\tif ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {\n\t\t\t\t\tmemory = false; // To prevent further calls using add\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfiring = false;\n\t\t\tif ( list ) {\n\t\t\t\tif ( stack ) {\n\t\t\t\t\tif ( stack.length ) {\n\t\t\t\t\t\tfire( stack.shift() );\n\t\t\t\t\t}\n\t\t\t\t} else if ( memory ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t} else {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t// Actual Callbacks object\n\t\tself = {\n\t\t\t// Add a callback or a collection of callbacks to the list\n\t\t\tadd: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\t// First, we save the current length\n\t\t\t\t\tvar start = list.length;\n\t\t\t\t\t(function add( args ) {\n\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {\n\t\t\t\t\t\t\tvar type = jQuery.type( arg );\n\t\t\t\t\t\t\tif ( type === \"function\" ) {\n\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {\n\t\t\t\t\t\t\t\t\tlist.push( arg );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if ( arg && arg.length && type !== \"string\" ) {\n\t\t\t\t\t\t\t\t// Inspect recursively\n\t\t\t\t\t\t\t\tadd( arg );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t})( arguments );\n\t\t\t\t\t// Do we need to add the callbacks to the\n\t\t\t\t\t// current firing batch?\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tfiringLength = list.length;\n\t\t\t\t\t// With memory, if we're not firing then\n\t\t\t\t\t// we should call right away\n\t\t\t\t\t} else if ( memory ) {\n\t\t\t\t\t\tfiringStart = start;\n\t\t\t\t\t\tfire( memory );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\t\tvar index;\n\t\t\t\t\t\twhile( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\t\tlist.splice( index, 1 );\n\t\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\t\t\tif ( index <= firingLength ) {\n\t\t\t\t\t\t\t\t\tfiringLength--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\t\t\tfiringIndex--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Control if a given callback is in the list\n\t\t\thas: function( fn ) {\n\t\t\t\treturn jQuery.inArray( fn, list ) > -1;\n\t\t\t},\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tlist = [];\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Have the list do nothing anymore\n\t\t\tdisable: function() {\n\t\t\t\tlist = stack = memory = undefined;\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it disabled?\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\t\t\t// Lock the list in its current state\n\t\t\tlock: function() {\n\t\t\t\tstack = undefined;\n\t\t\t\tif ( !memory ) {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it locked?\n\t\t\tlocked: function() {\n\t\t\t\treturn !stack;\n\t\t\t},\n\t\t\t// Call all callbacks with the given context and arguments\n\t\t\tfireWith: function( context, args ) {\n\t\t\t\targs = args || [];\n\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\tif ( list && ( !fired || stack ) ) {\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tstack.push( args );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfire( args );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Call all the callbacks with the given arguments\n\t\t\tfire: function() {\n\t\t\t\tself.fireWith( this, arguments );\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// To know if the callbacks have already been called at least once\n\t\t\tfired: function() {\n\t\t\t\treturn !!fired;\n\t\t\t}\n\t\t};\n\n\treturn self;\n};\n\n","\n/*!\n* jquery-deferred\n* Copyright(c) 2011 Hidden \n* MIT Licensed\n*/\n\n/**\n* Library version.\n*/\n\nvar jQuery = module.exports = require(\"./jquery-callbacks.js\"),\n\tcore_slice = Array.prototype.slice;\n\n/**\n* jQuery deferred\n*\n* Code from: https://github.com/jquery/jquery/blob/master/src/deferred.js\n* Doc: http://api.jquery.com/category/deferred-object/\n*\n*/\n\njQuery.extend({\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\t\t\t\t// action, add listener, listener list, final state\n\t\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks(\"once memory\"), \"resolved\" ],\n\t\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks(\"once memory\"), \"rejected\" ],\n\t\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks(\"memory\") ]\n\t\t\t],\n\t\t\tstate = \"pending\",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\tthen: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\t\t\t\t\treturn jQuery.Deferred(function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\t\t\t\t\tvar action = tuple[ 0 ],\n\t\t\t\t\t\t\t\tfn = fns[ i ];\n\t\t\t\t\t\t\t// deferred[ done | fail | progress ] for forwarding actions to newDefer\n\t\t\t\t\t\t\tdeferred[ tuple[1] ]( jQuery.isFunction( fn ) ?\n\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\tvar returned = fn.apply( this, arguments );\n\t\t\t\t\t\t\t\t\tif ( returned && jQuery.isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject )\n\t\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tnewDefer[ action + \"With\" ]( this === deferred ? newDefer : this, [ returned ] );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} :\n\t\t\t\t\t\t\t\tnewDefer[ action ]\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tfns = null;\n\t\t\t\t\t}).promise();\n\t\t\t\t},\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Keep pipe for back-compat\n\t\tpromise.pipe = promise.then;\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 3 ];\n\n\t\t\t// promise[ done | fail | progress ] = list.add\n\t\t\tpromise[ tuple[1] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(function() {\n\t\t\t\t\t// state = [ resolved | rejected ]\n\t\t\t\t\tstate = stateString;\n\n\t\t\t\t// [ reject_list | resolve_list ].disable; progress_list.lock\n\t\t\t\t}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );\n\t\t\t}\n\n\t\t\t// deferred[ resolve | reject | notify ] = list.fire\n\t\t\tdeferred[ tuple[0] ] = list.fire;\n\t\t\tdeferred[ tuple[0] + \"With\" ] = list.fireWith;\n\t\t});\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( subordinate /* , ..., subordinateN */ ) {\n\t\tvar i = 0,\n\t\t\tresolveValues = core_slice.call( arguments ),\n\t\t\tlength = resolveValues.length,\n\n\t\t\t// the count of uncompleted subordinates\n\t\t\tremaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,\n\n\t\t\t// the master Deferred. If resolveValues consist of only a single Deferred, just use that.\n\t\t\tdeferred = remaining === 1 ? subordinate : jQuery.Deferred(),\n\n\t\t\t// Update function for both resolve and progress values\n\t\t\tupdateFunc = function( i, contexts, values ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tcontexts[ i ] = this;\n\t\t\t\t\tvalues[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;\n\t\t\t\t\tif( values === progressValues ) {\n\t\t\t\t\t\tdeferred.notifyWith( contexts, values );\n\t\t\t\t\t} else if ( !( --remaining ) ) {\n\t\t\t\t\t\tdeferred.resolveWith( contexts, values );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t},\n\n\t\t\tprogressValues, progressContexts, resolveContexts;\n\n\t\t// add listeners to Deferred subordinates; treat others as resolved\n\t\tif ( length > 1 ) {\n\t\t\tprogressValues = new Array( length );\n\t\t\tprogressContexts = new Array( length );\n\t\t\tresolveContexts = new Array( length );\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {\n\t\t\t\t\tresolveValues[ i ].promise()\n\t\t\t\t\t\t.done( updateFunc( i, resolveContexts, resolveValues ) )\n\t\t\t\t\t\t.fail( deferred.reject )\n\t\t\t\t\t\t.progress( updateFunc( i, progressContexts, progressValues ) );\n\t\t\t\t} else {\n\t\t\t\t\t--remaining;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// if we're not waiting on anything, resolve the master\n\t\tif ( !remaining ) {\n\t\t\tdeferred.resolveWith( resolveContexts, resolveValues );\n\t\t}\n\n\t\treturn deferred.promise();\n\t}\n});\n","\nmodule.exports = require('./lib/jquery-deferred');","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","/* \r\nCopyright 2017-2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport { createEventEmitter } from '../libs/utils';\r\nimport jQueryShim from '../libs/jquery-shim';\r\nconst signalRNetCore = require('@aspnet/signalr');\r\nlet $ = jQueryShim;\r\n\r\nconst window = window || global || {};\r\n\r\nexport class dotnetifyHubFactory {\r\n static create() {\r\n let dotnetifyHub = {\r\n version: '2.0.0',\r\n type: null,\r\n\r\n reconnectDelay: [ 2, 5, 10 ],\r\n reconnectRetry: null,\r\n\r\n _startInfo: null,\r\n _init: false,\r\n\r\n // Hub server methods.\r\n requestVM: (iVMId, iOptions) => dotnetifyHub.server.request_VM(iVMId, iOptions),\r\n updateVM: (iVMId, iValue) => dotnetifyHub.server.update_VM(iVMId, iValue),\r\n disposeVM: iVMId => dotnetifyHub.server.dispose_VM(iVMId),\r\n\r\n // Connection events.\r\n responseEvent: createEventEmitter(),\r\n reconnectedEvent: createEventEmitter(),\r\n connectedEvent: createEventEmitter(),\r\n connectionFailedEvent: createEventEmitter(),\r\n\r\n get isHubStarted() {\r\n return !!this._startInfo;\r\n },\r\n\r\n // Starts connection with SignalR hub server.\r\n startHub(hubOptions, doneHandler, failHandler, forceRestart) {\r\n const _doneHandler = () => {\r\n if (typeof doneHandler == 'function') doneHandler();\r\n this.connectedEvent.emit();\r\n };\r\n const _failHandler = ex => {\r\n if (typeof failHander == 'function') failHandler();\r\n this.connectionFailedEvent.emit();\r\n throw ex;\r\n };\r\n\r\n if (this._startInfo === null || forceRestart) {\r\n try {\r\n this._startInfo = this.start(hubOptions).done(_doneHandler).fail(_failHandler);\r\n } catch (err) {\r\n this._startInfo = null;\r\n }\r\n }\r\n else {\r\n try {\r\n this._startInfo.done(_doneHandler);\r\n } catch (err) {\r\n this._startInfo = null;\r\n return this.startHub(hubOptions, doneHandler, failHandler, forceRestart);\r\n }\r\n }\r\n }\r\n };\r\n\r\n // Configures connection to SignalR hub server.\r\n dotnetifyHub.init = function(iHubPath, iServerUrl, signalR) {\r\n if (dotnetifyHub._init) return;\r\n\r\n dotnetifyHub._init = true;\r\n signalR = signalR || window.signalR || signalRNetCore;\r\n\r\n // SignalR .NET Core.\r\n if (signalR && signalR.HubConnection) {\r\n dotnetifyHub.type = 'netcore';\r\n\r\n Object.defineProperty(dotnetifyHub, 'isConnected', {\r\n get: function() {\r\n return dotnetifyHub._connection && dotnetifyHub._connection.connection.connectionState === 1;\r\n }\r\n });\r\n\r\n dotnetifyHub = $.extend(dotnetifyHub, {\r\n hubPath: iHubPath || '/dotnetify',\r\n url: iServerUrl,\r\n\r\n // Internal variables. Do not modify!\r\n _connection: null,\r\n _reconnectCount: 0,\r\n _startDoneHandler: null,\r\n _startFailHandler: null,\r\n _disconnectedHandler: function() {},\r\n _stateChangedHandler: function(iNewState) {},\r\n\r\n _onDisconnected: function() {\r\n dotnetifyHub._changeState(4);\r\n dotnetifyHub._disconnectedHandler();\r\n },\r\n\r\n _changeState: function(iNewState) {\r\n if (iNewState == 1) dotnetifyHub._reconnectCount = 0;\r\n\r\n let stateText = { 0: 'connecting', 1: 'connected', 2: 'reconnecting', 4: 'disconnected', 99: 'terminated' };\r\n dotnetifyHub._stateChangedHandler(stateText[iNewState]);\r\n },\r\n\r\n _startConnection: function(iHubOptions, iTransportArray) {\r\n let url = dotnetifyHub.url ? dotnetifyHub.url + dotnetifyHub.hubPath : dotnetifyHub.hubPath;\r\n let hubOptions = {};\r\n Object.keys(iHubOptions).forEach(function(key) {\r\n hubOptions[key] = iHubOptions[key];\r\n });\r\n hubOptions.transport = iTransportArray.shift();\r\n\r\n dotnetifyHub._connection = new signalR.HubConnectionBuilder().withUrl(url, hubOptions).build();\r\n dotnetifyHub._connection.on('response_vm', dotnetifyHub.client.response_VM);\r\n dotnetifyHub._connection.onclose(dotnetifyHub._onDisconnected);\r\n\r\n let promise = dotnetifyHub._connection\r\n .start()\r\n .then(function() {\r\n dotnetifyHub._changeState(1);\r\n })\r\n .catch(function() {\r\n // If failed to start, fallback to the next transport.\r\n if (iTransportArray.length > 0) dotnetifyHub._startConnection(iHubOptions, iTransportArray);\r\n else dotnetifyHub._onDisconnected();\r\n });\r\n\r\n if (typeof dotnetifyHub._startDoneHandler === 'function')\r\n promise.then(dotnetifyHub._startDoneHandler).catch(dotnetifyHub._startFailHandler || function() {});\r\n return promise;\r\n },\r\n\r\n start: function(iHubOptions) {\r\n dotnetifyHub._startDoneHandler = null;\r\n dotnetifyHub._startFailHandler = null;\r\n\r\n // Map the transport option.\r\n let transport = [ 0 ];\r\n let transportOptions = { webSockets: 0, serverSentEvents: 1, longPolling: 2 };\r\n if (iHubOptions && Array.isArray(iHubOptions.transport))\r\n transport = iHubOptions.transport.map(function(arg) {\r\n return transportOptions[arg];\r\n });\r\n\r\n let promise = dotnetifyHub._startConnection(iHubOptions, transport);\r\n return {\r\n done: function(iHandler) {\r\n dotnetifyHub._startDoneHandler = iHandler;\r\n promise.then(iHandler).catch(function(error) {\r\n throw error;\r\n });\r\n return this;\r\n },\r\n fail: function(iHandler) {\r\n dotnetifyHub._startFailHandler = iHandler;\r\n promise.catch(iHandler);\r\n return this;\r\n }\r\n };\r\n },\r\n\r\n disconnected: function(iHandler) {\r\n if (typeof iHandler === 'function') dotnetifyHub._disconnectedHandler = iHandler;\r\n },\r\n\r\n stateChanged: function(iHandler) {\r\n if (typeof iHandler === 'function') dotnetifyHub._stateChangedHandler = iHandler;\r\n },\r\n\r\n reconnect: function(iStartHubFunc) {\r\n if (typeof iStartHubFunc === 'function') {\r\n // Only attempt reconnect if the specified retry hasn't been exceeded.\r\n if (!dotnetifyHub.reconnectRetry || dotnetifyHub._reconnectCount < dotnetifyHub.reconnectRetry) {\r\n // Determine reconnect delay from the specified configuration array.\r\n let delay =\r\n dotnetifyHub._reconnectCount < dotnetifyHub.reconnectDelay.length\r\n ? dotnetifyHub.reconnectDelay[dotnetifyHub._reconnectCount]\r\n : dotnetifyHub.reconnectDelay[dotnetifyHub.reconnectDelay.length - 1];\r\n\r\n dotnetifyHub._reconnectCount++;\r\n\r\n setTimeout(function() {\r\n dotnetifyHub._changeState(2);\r\n iStartHubFunc();\r\n }, delay * 1000);\r\n }\r\n else dotnetifyHub._changeState(99);\r\n }\r\n },\r\n\r\n client: {},\r\n\r\n server: {\r\n dispose_VM: function(iVMId) {\r\n dotnetifyHub._connection.invoke('Dispose_VM', iVMId);\r\n },\r\n update_VM: function(iVMId, iValue) {\r\n dotnetifyHub._connection.invoke('Update_VM', iVMId, iValue);\r\n },\r\n request_VM: function(iVMId, iArgs) {\r\n dotnetifyHub._connection.invoke('Request_VM', iVMId, iArgs);\r\n }\r\n }\r\n });\r\n }\r\n else {\r\n // SignalR .NET FX.\r\n dotnetifyHub.type = 'netfx';\r\n\r\n if (window.jQuery) $ = window.jQuery;\r\n\r\n // SignalR hub auto-generated from /signalr/hubs.\r\n /// \r\n /// \r\n (function($, window, undefined) {\r\n /// \r\n 'use strict';\r\n\r\n if (typeof $.signalR !== 'function') {\r\n throw new Error('SignalR: SignalR is not loaded. Please ensure jquery.signalR-x.js is referenced before ~/signalr/js.');\r\n }\r\n\r\n var signalR = $.signalR;\r\n\r\n function makeProxyCallback(hub, callback) {\r\n return function() {\r\n // Call the client hub method\r\n callback.apply(hub, $.makeArray(arguments));\r\n };\r\n }\r\n\r\n function registerHubProxies(instance, shouldSubscribe) {\r\n var key, hub, memberKey, memberValue, subscriptionMethod;\r\n\r\n for (key in instance) {\r\n if (instance.hasOwnProperty(key)) {\r\n hub = instance[key];\r\n\r\n if (!hub.hubName) {\r\n // Not a client hub\r\n continue;\r\n }\r\n\r\n if (shouldSubscribe) {\r\n // We want to subscribe to the hub events\r\n subscriptionMethod = hub.on;\r\n }\r\n else {\r\n // We want to unsubscribe from the hub events\r\n subscriptionMethod = hub.off;\r\n }\r\n\r\n // Loop through all members on the hub and find client hub functions to subscribe/unsubscribe\r\n for (memberKey in hub.client) {\r\n if (hub.client.hasOwnProperty(memberKey)) {\r\n memberValue = hub.client[memberKey];\r\n\r\n if (!$.isFunction(memberValue)) {\r\n // Not a client hub function\r\n continue;\r\n }\r\n\r\n subscriptionMethod.call(hub, memberKey, makeProxyCallback(hub, memberValue));\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n $.hubConnection.prototype.createHubProxies = function() {\r\n var proxies = {};\r\n this.starting(function() {\r\n // Register the hub proxies as subscribed\r\n // (instance, shouldSubscribe)\r\n registerHubProxies(proxies, true);\r\n\r\n this._registerSubscribedHubs();\r\n }).disconnected(function() {\r\n // Unsubscribe all hub proxies when we \"disconnect\". This is to ensure that we do not re-add functional call backs.\r\n // (instance, shouldSubscribe)\r\n registerHubProxies(proxies, false);\r\n });\r\n\r\n proxies['dotNetifyHub'] = this.createHubProxy('dotNetifyHub');\r\n proxies['dotNetifyHub'].client = {};\r\n proxies['dotNetifyHub'].server = {\r\n dispose_VM: function(vmId) {\r\n return proxies['dotNetifyHub'].invoke.apply(proxies['dotNetifyHub'], $.merge([ 'Dispose_VM' ], $.makeArray(arguments)));\r\n },\r\n\r\n request_VM: function(vmId, vmArg) {\r\n return proxies['dotNetifyHub'].invoke.apply(proxies['dotNetifyHub'], $.merge([ 'Request_VM' ], $.makeArray(arguments)));\r\n },\r\n\r\n update_VM: function(vmId, vmData) {\r\n return proxies['dotNetifyHub'].invoke.apply(proxies['dotNetifyHub'], $.merge([ 'Update_VM' ], $.makeArray(arguments)));\r\n }\r\n };\r\n\r\n return proxies;\r\n };\r\n\r\n signalR.hub = $.hubConnection(dotnetifyHub.hubPath, { useDefaultPath: false });\r\n $.extend(signalR, signalR.hub.createHubProxies());\r\n })($, window);\r\n\r\n Object.defineProperty(dotnetifyHub, 'state', {\r\n get: function() {\r\n return $.connection.hub.state;\r\n },\r\n set: function(val) {\r\n $.connection.hub.state = val;\r\n }\r\n });\r\n\r\n Object.defineProperty(dotnetifyHub, 'client', {\r\n get: function() {\r\n return $.connection.dotNetifyHub.client;\r\n }\r\n });\r\n\r\n Object.defineProperty(dotnetifyHub, 'server', {\r\n get: function() {\r\n return $.connection.dotNetifyHub.server;\r\n }\r\n });\r\n\r\n Object.defineProperty(dotnetifyHub, 'isConnected', {\r\n get: function() {\r\n return $.connection.hub.state == $.signalR.connectionState.connected;\r\n }\r\n });\r\n\r\n dotnetifyHub = $.extend(dotnetifyHub, {\r\n hubPath: iHubPath || '/signalr',\r\n url: iServerUrl,\r\n\r\n _reconnectCount: 0,\r\n _stateChangedHandler: function(iNewState) {},\r\n\r\n start: function(iHubOptions) {\r\n if (dotnetifyHub.url) $.connection.hub.url = dotnetifyHub.url;\r\n\r\n let deferred;\r\n if (iHubOptions) deferred = $.connection.hub.start(iHubOptions);\r\n else deferred = $.connection.hub.start();\r\n deferred.fail(function(error) {\r\n if (error.source && error.source.message === 'Error parsing negotiate response.')\r\n console.warn('This client may be attempting to connect to an incompatible SignalR .NET Core server.');\r\n });\r\n return deferred;\r\n },\r\n\r\n disconnected: function(iHandler) {\r\n return $.connection.hub.disconnected(iHandler);\r\n },\r\n\r\n stateChanged: function(iHandler) {\r\n dotnetifyHub._stateChangedHandler = iHandler;\r\n return $.connection.hub.stateChanged(function(state) {\r\n if (state == 1) dotnetifyHub._reconnectCount = 0;\r\n\r\n let stateText = { 0: 'connecting', 1: 'connected', 2: 'reconnecting', 4: 'disconnected' };\r\n iHandler(stateText[state.newState]);\r\n });\r\n },\r\n\r\n reconnect: function(iStartHubFunc) {\r\n if (typeof iStartHubFunc === 'function') {\r\n // Only attempt reconnect if the specified retry hasn't been exceeded.\r\n if (!dotnetifyHub.reconnectRetry || dotnetifyHub._reconnectCount < dotnetifyHub.reconnectRetry) {\r\n // Determine reconnect delay from the specified configuration array.\r\n let delay =\r\n dotnetifyHub._reconnectCount < dotnetifyHub.reconnectDelay.length\r\n ? dotnetifyHub.reconnectDelay[dotnetifyHub._reconnectCount]\r\n : dotnetifyHub.reconnectDelay[dotnetifyHub.reconnectDelay.length - 1];\r\n\r\n dotnetifyHub._reconnectCount++;\r\n\r\n setTimeout(function() {\r\n dotnetifyHub._stateChangedHandler('reconnecting');\r\n iStartHubFunc();\r\n }, delay * 1000);\r\n }\r\n else dotnetifyHub._stateChangedHandler('terminated');\r\n }\r\n }\r\n });\r\n }\r\n\r\n // Setup SignalR server method handler.\r\n dotnetifyHub.client.response_VM = function(iVMId, iVMData) {\r\n // SignalR .NET Core is sending an array of arguments.\r\n if (Array.isArray(iVMId)) {\r\n iVMData = iVMId[1];\r\n iVMId = iVMId[0];\r\n }\r\n\r\n let handled = dotnetifyHub.responseEvent.emit(iVMId, iVMData);\r\n\r\n // If we get to this point, that means the server holds a view model instance\r\n // whose view no longer existed. So, tell the server to dispose the view model.\r\n if (!handled) dotnetifyHub.server.dispose_VM(iVMId);\r\n };\r\n\r\n // On disconnected, keep attempting to start the connection.\r\n dotnetifyHub.disconnected(function() {\r\n dotnetifyHub._startInfo = null;\r\n dotnetifyHub.reconnect(function() {\r\n dotnetifyHub.reconnectedEvent.emit();\r\n });\r\n });\r\n };\r\n\r\n return dotnetifyHub;\r\n }\r\n}\r\n\r\nexport default dotnetifyHubFactory.create();\r\n","/* \r\nCopyright 2017-2019 Dicky Suryadi\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n */\r\nimport dotnetifyHub, { dotnetifyHubFactory } from './dotnetify-hub';\r\nimport localHub, { hasLocalVM } from './dotnetify-hub-local';\r\nimport webApiHub, { createWebApiHub } from './dotnetify-hub-webapi';\r\n\r\nexport class dotnetifyFactory {\r\n static create() {\r\n const dotnetify = {\r\n // SignalR hub options.\r\n hub: dotnetifyHub,\r\n hubOptions: { transport: [ 'webSockets', 'longPolling' ] },\r\n hubPath: null,\r\n\r\n // Debug mode.\r\n debug: false,\r\n debugFn: null,\r\n\r\n // Offline mode. (WIP)\r\n offline: false,\r\n isOffline: true,\r\n offlineTimeout: 5000,\r\n offlineCacheFn: null,\r\n\r\n // Internal variables.\r\n _vmAccessors: [],\r\n\r\n // Use this to get notified of connection state changed events.\r\n // (state, exception, hub) => void\r\n connectionStateHandler: null,\r\n\r\n // Use this intercept a view model prior to establishing connection,\r\n // with the option to provide any connect parameters.\r\n // ({vmId, options}) => {vmId, options, hub}\r\n connectHandler: null,\r\n\r\n // Support changing hub server URL after first init.\r\n get hubServerUrl() {\r\n return this.hub.url;\r\n },\r\n\r\n set hubServerUrl(url) {\r\n this.hub.url = url;\r\n if (this.debug) console.log('SignalR: connecting to ' + this.hubServerUrl);\r\n if (this.hub.isHubStarted) this.startHub(this.hub, true);\r\n },\r\n\r\n // Generic connect function for non-React app.\r\n connect(iVMId, iOptions) {\r\n return dotnetify.react.connect(iVMId, {}, iOptions);\r\n },\r\n\r\n // Creates a SignalR hub client.\r\n createHub(hubServerUrl, hubPath, hubLib) {\r\n return this.initHub(dotnetifyHubFactory.create(), hubPath, hubServerUrl, hubLib);\r\n },\r\n\r\n // Creates a Web API hub client.\r\n createWebApiHub(baseUrl, onRequestHandler) {\r\n return createWebApiHub(baseUrl, onRequestHandler);\r\n },\r\n\r\n // Configures hub connection to SignalR hub server.\r\n initHub(hub, hubPath, hubServerUrl, hubLib) {\r\n hub = hub || this.hub;\r\n hubPath = hubPath || this.hubPath;\r\n hubServerUrl = hubServerUrl || this.hubServerUrl;\r\n hubLib = hubLib || this.hubLib;\r\n\r\n if (!hub.isHubStarted) {\r\n hub.init(hubPath, hubServerUrl, hubLib);\r\n\r\n // Use SignalR event to raise the connection state event.\r\n hub.stateChanged(state => this.handleConnectionStateChanged(state, null, hub));\r\n }\r\n return hub;\r\n },\r\n\r\n // Used by a view to select a hub, and provides the opportunity to override any connect info.\r\n selectHub(vmConnectArgs) {\r\n vmConnectArgs = vmConnectArgs || {};\r\n vmConnectArgs.options = vmConnectArgs.options || {};\r\n let override = (typeof this.connectHandler == 'function' && this.connectHandler(vmConnectArgs)) || {};\r\n if (!override.hub) {\r\n override.hub = hasLocalVM(vmConnectArgs.vmId) ? localHub : vmConnectArgs.options.webApi ? webApiHub : this.initHub();\r\n override.hub.debug = this.debug;\r\n }\r\n return Object.assign(vmConnectArgs, override);\r\n },\r\n\r\n // Starts hub connection to SignalR hub server.\r\n startHub(hub, forceRestart) {\r\n hub = hub || this.hub;\r\n\r\n const doneHandler = () => {};\r\n const failHandler = ex => this.handleConnectionStateChanged('error', ex, hub);\r\n hub.startHub(this.hubOptions, doneHandler, failHandler, forceRestart);\r\n },\r\n\r\n // Used by dotnetify-react and -vue to expose their view model accessors.\r\n addVMAccessor(vmAccessor) {\r\n !this._vmAccessors.includes(vmAccessor) && this._vmAccessors.push(vmAccessor);\r\n },\r\n\r\n checkServerSideException(iVMId, iVMData, iExceptionHandler) {\r\n const vmData = JSON.parse(iVMData);\r\n if (vmData && vmData.hasOwnProperty('ExceptionType') && vmData.hasOwnProperty('Message')) {\r\n const exception = { name: vmData.ExceptionType, message: vmData.Message };\r\n\r\n if (typeof iExceptionHandler === 'function') {\r\n return iExceptionHandler(exception);\r\n }\r\n else {\r\n console.error('[' + iVMId + '] ' + exception.name + ': ' + exception.message);\r\n throw exception;\r\n }\r\n }\r\n },\r\n\r\n // Get all view models.\r\n getViewModels() {\r\n return this._vmAccessors\r\n .reduce((prev, current) => [ ...prev, ...current() ], [])\r\n .filter((val, idx, self) => self.indexOf(val) === idx); // returns distinct items.\r\n },\r\n\r\n handleConnectionStateChanged(iState, iException, iHub) {\r\n if (this.debug) console.log('SignalR: ' + (iException ? iException.message : iState));\r\n if (typeof this.connectionStateHandler === 'function') this.connectionStateHandler(iState, iException, iHub);\r\n else if (iException) console.error(iException);\r\n }\r\n };\r\n\r\n return dotnetify;\r\n }\r\n}\r\n\r\nexport default dotnetifyFactory.create();\r\n"],"sourceRoot":""} \ No newline at end of file diff --git a/DevApp/dist/package.json b/DevApp/dist/package.json index cabc52a9..d820bf85 100644 --- a/DevApp/dist/package.json +++ b/DevApp/dist/package.json @@ -1,6 +1,6 @@ { "name": "dotnetify", - "version": "3.4.0", + "version": "3.5.0", "description": "Simple, lightweight, yet powerful way to build realtime .NET web apps.", "main": "index.js", "types": "dist/typings/dotnetify.d.ts", @@ -34,7 +34,8 @@ "mvvm", "web", "mobile", - "realtime" + "realtime", + "microfrontend" ], "author": "Dicky Suryadi", "license": "Apache 2.0", diff --git a/DevApp/package-lock.json b/DevApp/package-lock.json index 9f246c36..fa09e18e 100644 --- a/DevApp/package-lock.json +++ b/DevApp/package-lock.json @@ -13,6 +13,7 @@ "version": "7.0.0-rc.1", "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0-rc.1.tgz", "integrity": "sha1-SpBCpKNfg11Fxkn2jzZMx+19ywU=", + "dev": true, "requires": { "@babel/types": "7.0.0-rc.1" } @@ -26,9 +27,9 @@ }, "dependencies": { "@babel/types": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz", - "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.1.tgz", + "integrity": "sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g==", "requires": { "esutils": "^2.0.2", "lodash": "^4.17.13", @@ -48,9 +49,9 @@ } }, "@babel/runtime": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.5.5.tgz", - "integrity": "sha512-28QvEGyQyNkB0/m2B4FU7IEZGK2NUrcMtT6BZEFALTguLk+AUT6ofsHtPk5QyjAdUkpMJ+/Em+quwz4HOt30AQ==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.6.2.tgz", + "integrity": "sha512-EXxN64agfUqqIGeEjI5dL5z0Sw0ZwWo1mLTi4mQowCZ42O59b7DRpZAnTC6OqdF28wMBMFKNb/4uFGrVaigSpg==", "requires": { "regenerator-runtime": "^0.13.2" }, @@ -66,6 +67,7 @@ "version": "7.0.0-rc.1", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-rc.1.tgz", "integrity": "sha1-ar9tFN3Z/AImF+W2Lmsy9PplJq0=", + "dev": true, "requires": { "esutils": "^2.0.2", "lodash": "^4.17.10", @@ -75,53 +77,39 @@ "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=" + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true } } }, "@emotion/cache": { - "version": "10.0.15", - "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-10.0.15.tgz", - "integrity": "sha512-8VthgeKhlGeTXSW1JN7I14AnAaiFPbOrqNqg3dPoGCZ3bnMjkrmRU0zrx0BtBw9esBaPaQgDB9y0tVgAGT2Mrg==", + "version": "10.0.19", + "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-10.0.19.tgz", + "integrity": "sha512-BoiLlk4vEsGBg2dAqGSJu0vJl/PgVtCYLBFJaEO8RmQzPugXewQCXZJNXTDFaRlfCs0W+quesayav4fvaif5WQ==", "requires": { "@emotion/sheet": "0.9.3", "@emotion/stylis": "0.8.4", "@emotion/utils": "0.11.2", - "@emotion/weak-memoize": "0.2.3" + "@emotion/weak-memoize": "0.2.4" } }, "@emotion/hash": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.7.2.tgz", - "integrity": "sha512-RMtr1i6E8MXaBWwhXL3yeOU8JXRnz8GNxHvaUfVvwxokvayUY0zoBeWbKw1S9XkufmGEEdQd228pSZXFkAln8Q==" - }, - "@emotion/is-prop-valid": { "version": "0.7.3", - "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-0.7.3.tgz", - "integrity": "sha512-uxJqm/sqwXw3YPA5GXX365OBcJGFtxUVkB6WyezqFHlNe9jqUWH5ur2O2M8dGBz61kn1g3ZBlzUunFQXQIClhA==", - "requires": { - "@emotion/memoize": "0.7.1" - }, - "dependencies": { - "@emotion/memoize": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.1.tgz", - "integrity": "sha512-Qv4LTqO11jepd5Qmlp3M1YEjBumoTHcHFdgPTQ+sFlIL5myi/7xu/POwP7IRu6odBdmLXdtIs1D6TuW6kbwbbg==" - } - } + "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.7.3.tgz", + "integrity": "sha512-14ZVlsB9akwvydAdaEnVnvqu6J2P6ySv39hYyl/aoB6w/V+bXX0tay8cF6paqbgZsN2n5Xh15uF4pE+GvE+itw==" }, "@emotion/memoize": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.2.tgz", - "integrity": "sha512-hnHhwQzvPCW1QjBWFyBtsETdllOM92BfrKWbUTmh9aeOlcVOiXvlPsK4104xH8NsaKfg86PTFsWkueQeUfMA/w==" + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.3.tgz", + "integrity": "sha512-2Md9mH6mvo+ygq1trTeVp2uzAKwE2P7In0cRpD/M9Q70aH8L+rxMLbb3JCN2JoSWsV2O+DdFjfbbXoMoLBczow==" }, "@emotion/serialize": { - "version": "0.11.9", - "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-0.11.9.tgz", - "integrity": "sha512-/Cn4V81z3ZyFiDQRw8nhGFaHkxHtmCSSBUit4vgTuLA1BqxfJUYiqSq97tq/vV8z9LfIoqs6a9v6QrUFWZpK7A==", + "version": "0.11.11", + "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-0.11.11.tgz", + "integrity": "sha512-YG8wdCqoWtuoMxhHZCTA+egL0RSGdHEc+YCsmiSBPBEDNuVeMWtjEWtGrhUterSChxzwnWBXvzSxIFQI/3sHLw==", "requires": { - "@emotion/hash": "0.7.2", - "@emotion/memoize": "0.7.2", + "@emotion/hash": "0.7.3", + "@emotion/memoize": "0.7.3", "@emotion/unitless": "0.7.4", "@emotion/utils": "0.11.2", "csstype": "^2.5.7" @@ -148,9 +136,9 @@ "integrity": "sha512-UHX2XklLl3sIaP6oiMmlVzT0J+2ATTVpf0dHQVyPJHTkOITvXfaSqnRk6mdDhV9pR8T/tHc3cex78IKXssmzrA==" }, "@emotion/weak-memoize": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.2.3.tgz", - "integrity": "sha512-zVgvPwGK7c1aVdUVc9Qv7SqepOGRDrqCw7KZPSZziWGxSlbII3gmvGLPzLX4d0n0BMbamBacUrN22zOMyFFEkQ==" + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.2.4.tgz", + "integrity": "sha512-6PYY5DVdAY1ifaQW6XYTnOMihmBVT27elqSjEoodchsGjzYlEsTQMcEhSud99kVawatyTZRTiVkJ/c6lwbQ7nA==" }, "@vue/component-compiler-utils": { "version": "2.2.0", @@ -1037,14 +1025,14 @@ } }, "babel-plugin-emotion": { - "version": "10.0.15", - "resolved": "https://registry.npmjs.org/babel-plugin-emotion/-/babel-plugin-emotion-10.0.15.tgz", - "integrity": "sha512-E3W68Zk8EcKpRUDW2tsFKi4gsavapMRjfr2/KKgG3l7l2zZpiKk0BxB59Ul9C0w0ekv6my/ylGOk2WroaqKXPw==", + "version": "10.0.19", + "resolved": "https://registry.npmjs.org/babel-plugin-emotion/-/babel-plugin-emotion-10.0.19.tgz", + "integrity": "sha512-1pJb5uKN/gx6bi3gGr588Krj49sxARI9KmxhtMUa+NRJb6lR3OfC51mh3NlWRsOqdjWlT4cSjnZpnFq5K3T5ZA==", "requires": { "@babel/helper-module-imports": "^7.0.0", - "@emotion/hash": "0.7.2", - "@emotion/memoize": "0.7.2", - "@emotion/serialize": "^0.11.9", + "@emotion/hash": "0.7.3", + "@emotion/memoize": "0.7.3", + "@emotion/serialize": "^0.11.11", "babel-plugin-macros": "^2.0.0", "babel-plugin-syntax-jsx": "^6.18.0", "convert-source-map": "^1.5.0", @@ -1067,6 +1055,7 @@ "version": "1.5.1", "resolved": "https://registry.npmjs.org/babel-plugin-styled-components/-/babel-plugin-styled-components-1.5.1.tgz", "integrity": "sha1-MdvraW0TVNFYXmDWbHkF9eR0r80=", + "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.0.0-beta.37", "babel-types": "^6.26.0", @@ -1558,6 +1547,7 @@ "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dev": true, "requires": { "core-js": "^2.4.0", "regenerator-runtime": "^0.11.0" @@ -1566,7 +1556,8 @@ "core-js": { "version": "2.5.7", "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", - "integrity": "sha1-+XJgj/DOrWi4QaFqky0LGDeRgU4=" + "integrity": "sha1-+XJgj/DOrWi4QaFqky0LGDeRgU4=", + "dev": true } } }, @@ -1604,6 +1595,7 @@ "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "dev": true, "requires": { "babel-runtime": "^6.26.0", "esutils": "^2.0.2", @@ -1927,11 +1919,6 @@ "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", "dev": true }, - "camelize": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.0.tgz", - "integrity": "sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs=" - }, "caniuse-api": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-1.6.1.tgz", @@ -2539,11 +2526,6 @@ "randomfill": "^1.0.3" } }, - "css-color-keywords": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz", - "integrity": "sha1-/qJhbcZ2spYmhrOvjb2+GAskTgU=" - }, "css-color-names": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz", @@ -2720,15 +2702,29 @@ "dev": true }, "deep-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", - "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.0.tgz", + "integrity": "sha512-ZbfWJq/wN1Z273o7mUSjILYqehAktR2NVoSrOukDkU9kg2v/Uv89yU4Cvz8seJeAmtN5oqiefKq8FPuXOboqLw==", + "requires": { + "is-arguments": "^1.0.4", + "is-date-object": "^1.0.1", + "is-regex": "^1.0.4", + "object-is": "^1.0.1", + "object-keys": "^1.1.1", + "regexp.prototype.flags": "^1.2.0" + }, + "dependencies": { + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + } + } }, "define-properties": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", - "dev": true, "requires": { "foreach": "^2.0.5", "object-keys": "^1.0.8" @@ -2893,115 +2889,33 @@ "is-obj": "^1.0.0" } }, - "dotnetify": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/dotnetify/-/dotnetify-3.4.0.tgz", - "integrity": "sha512-Km9mS1tgJnhRBmh5XHeuwQhOLjQ2jvqkFEu7HJLaiJQ2IADR1eeyxY3/nI8qk8amYh5wmFE/lGDZztn0grJtSA==", - "requires": { - "@aspnet/signalr": "~1.0.3", - "jquery-deferred": "~0.3.1", - "prop-types": "~15.6.1" - } - }, "dotnetify-elements": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/dotnetify-elements/-/dotnetify-elements-1.0.2.tgz", - "integrity": "sha512-pXWg9HEYuNghJsF6w/D1OYvoq2qwpOJ0B13D9avttiRu7YYGJzk8aAKspfXpVLdYSKKrmMXjrUJrXbA5YhbQLA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/dotnetify-elements/-/dotnetify-elements-1.1.0.tgz", + "integrity": "sha512-YH0jMVHdVPj5nLhQYHRcScDl4g4KJF8wfrgHPTpY6F3nOof0QyRvKcjD7KlZLXYCN5gjwttrPAqcke+Dag1BsQ==", "requires": { "chart.js": "~2.7.2", "chartjs-plugin-streaming": "~1.7.1", - "dotnetify": "~3.4.0", "emotion": "~10.0.9", "html-to-react": "~1.3.4", - "marked": "~0.4.0", + "marked": "~0.7.0", "moment": "~2.24.0", "prismjs": "~1.15.0", "prop-types": "~15.6.1", "quill": "~1.3.6", - "react": "~16.6.0", "react-chartjs-2": "~2.7.2", "react-data-grid": "~4.0.7", - "react-dom": "~16.6.0", "react-widgets": "~4.3.2", "react-widgets-moment": "~4.0.6", "reactstrap": "~6.1.0", - "styled-components": "~4.1.3", "text-mask-addons": "~3.7.2", "text-mask-core": "~5.1.1" }, "dependencies": { - "css-to-react-native": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-2.3.1.tgz", - "integrity": "sha512-yO+oEx1Lf+hDKasqQRVrAvzMCz825Huh1VMlEEDlRWyAhFb/FWb6I0KpEF1PkyKQ7NEdcx9d5M2ZEWgJAsgPvQ==", - "requires": { - "camelize": "^1.0.0", - "css-color-keywords": "^1.0.0", - "postcss-value-parser": "^3.3.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" - }, "moment": { "version": "2.24.0", "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==" - }, - "react": { - "version": "16.6.3", - "resolved": "https://registry.npmjs.org/react/-/react-16.6.3.tgz", - "integrity": "sha512-zCvmH2vbEolgKxtqXL2wmGCUxUyNheYn/C+PD1YAjfxHC54+MhdruyhO7QieQrYsYeTxrn93PM2y0jRH1zEExw==", - "requires": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1", - "prop-types": "^15.6.2", - "scheduler": "^0.11.2" - } - }, - "react-dom": { - "version": "16.6.3", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.6.3.tgz", - "integrity": "sha512-8ugJWRCWLGXy+7PmNh8WJz3g1TaTUt1XyoIcFN+x0Zbkoz+KKdUyx1AQLYJdbFXjuF41Nmjn5+j//rxvhFjgSQ==", - "requires": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1", - "prop-types": "^15.6.2", - "scheduler": "^0.11.2" - } - }, - "react-is": { - "version": "16.9.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.9.0.tgz", - "integrity": "sha512-tJBzzzIgnnRfEm046qRcURvwQnZVXmuCbscxUO5RWrGTXpon2d4c8mI0D8WE6ydVIm29JiLB6+RslkIvym9Rjw==" - }, - "styled-components": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-4.1.3.tgz", - "integrity": "sha512-0quV4KnSfvq5iMtT0RzpMGl/Dg3XIxIxOl9eJpiqiq4SrAmR1l1DLzNpMzoy3DyzdXVDMJS2HzROnXscWA3SEw==", - "requires": { - "@babel/helper-module-imports": "^7.0.0", - "@emotion/is-prop-valid": "^0.7.3", - "@emotion/unitless": "^0.7.0", - "babel-plugin-styled-components": ">= 1", - "css-to-react-native": "^2.2.2", - "memoize-one": "^4.0.0", - "prop-types": "^15.5.4", - "react-is": "^16.6.0", - "stylis": "^3.5.0", - "stylis-rule-sheet": "^0.0.10", - "supports-color": "^5.5.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "requires": { - "has-flag": "^3.0.0" - } } } }, @@ -3051,11 +2965,11 @@ "dev": true }, "emotion": { - "version": "10.0.14", - "resolved": "https://registry.npmjs.org/emotion/-/emotion-10.0.14.tgz", - "integrity": "sha512-6cTWfwqVGy9UinGSZQKRGyuRsRGkzlT0MaeH2pF4BvL7u6PnyTZeyHj4INwzpaXBLwA9C0JaFqS31J62RWUNNw==", + "version": "10.0.17", + "resolved": "https://registry.npmjs.org/emotion/-/emotion-10.0.17.tgz", + "integrity": "sha512-nShD/a7PKZ77hr517KfzKkHo1v26uPJBImRiYrl8IwIA4KRmI3vxVEA5pzw1TQTXD1iZl6YQtWhjOiiE+QPmTQ==", "requires": { - "babel-plugin-emotion": "^10.0.14", + "babel-plugin-emotion": "^10.0.17", "create-emotion": "^10.0.14" } }, @@ -3530,8 +3444,7 @@ "foreach": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", - "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", - "dev": true + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=" }, "fragment-cache": { "version": "0.2.1", @@ -4102,8 +4015,7 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=", - "dev": true + "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=" }, "get-caller-file": { "version": "1.0.3", @@ -4203,7 +4115,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha1-ci18v8H2qoJB8W3YFOAR4fQeh5Y=", - "dev": true, "requires": { "function-bind": "^1.1.1" } @@ -4633,6 +4544,11 @@ } } }, + "is-arguments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==" + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -4673,6 +4589,11 @@ } } }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" + }, "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", @@ -4780,6 +4701,14 @@ "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", "dev": true }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "requires": { + "has": "^1.0.1" + } + }, "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", @@ -4824,11 +4753,6 @@ "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.3.1.tgz", "integrity": "sha1-lYzinoHJeQ8xvneS311NlfxX+8o=" }, - "jquery-deferred": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/jquery-deferred/-/jquery-deferred-0.3.1.tgz", - "integrity": "sha1-WW7KHKr/VPYbEQlisjyv6nTDU1U=" - }, "js-base64": { "version": "2.4.8", "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.8.tgz", @@ -5059,9 +4983,9 @@ } }, "marked": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.4.0.tgz", - "integrity": "sha512-tMsdNBgOsrUophCAFQl0XPe6Zqk/uy9gnue+jIIKhykO51hxyu6uNx7zBPy0+y/WKYVZZMspV9YeXLNdKk+iYw==" + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.7.0.tgz", + "integrity": "sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg==" }, "math-expression-evaluator": { "version": "1.2.17", @@ -5088,11 +5012,6 @@ "mimic-fn": "^1.0.0" } }, - "memoize-one": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-4.0.3.tgz", - "integrity": "sha512-QmpUu4KqDmX0plH4u+tf0riMc1KHE1+lw95cMrLlXQAFOx/xnBtwhZ52XJxd9X2O6kwKBqX32kmhbhlobD0cuw==" - }, "memory-fs": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.3.0.tgz", @@ -5467,11 +5386,15 @@ } } }, + "object-is": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.0.1.tgz", + "integrity": "sha1-CqYOyZiaCz7Xlc9NBvYs8a1lObY=" + }, "object-keys": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", - "integrity": "sha1-CcU4VTd1dTEMymL1W7M0q/97PtI=", - "dev": true + "integrity": "sha1-CcU4VTd1dTEMymL1W7M0q/97PtI=" }, "object-visit": { "version": "1.0.1", @@ -6234,7 +6157,8 @@ "postcss-value-parser": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz", - "integrity": "sha1-h/OPnxj3dKSrTIojL1xc6IcqnRU=" + "integrity": "sha1-h/OPnxj3dKSrTIojL1xc6IcqnRU=", + "dev": true }, "postcss-zindex": { "version": "2.2.0", @@ -6390,14 +6314,14 @@ "dev": true }, "quill": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/quill/-/quill-1.3.6.tgz", - "integrity": "sha512-K0mvhimWZN6s+9OQ249CH2IEPZ9JmkFuCQeHAOQax3EZ2nDJ3wfGh59mnlQaZV2i7u8eFarx6wAtvQKgShojug==", + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/quill/-/quill-1.3.7.tgz", + "integrity": "sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g==", "requires": { "clone": "^2.1.1", "deep-equal": "^1.0.1", "eventemitter3": "^2.0.3", - "extend": "^3.0.1", + "extend": "^3.0.2", "parchment": "^1.1.4", "quill-delta": "^3.6.2" }, @@ -6505,9 +6429,9 @@ } }, "react-is": { - "version": "16.4.2", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.4.2.tgz", - "integrity": "sha1-hIkbVsK22e/e5XfMg1Ad/F7OrYg=" + "version": "16.10.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.10.1.tgz", + "integrity": "sha512-BXUMf9sIOPXXZWqr7+c5SeOKJykyVr2u0UDzEf4LNGc6taGkQe1A9DFD07umCIXz45RLr9oAAwZbAJ0Pkknfaw==" }, "react-lifecycles-compat": { "version": "3.0.4", @@ -6662,7 +6586,8 @@ "regenerator-runtime": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha1-vgWtf5v30i4Fb5cmzuUBf78Z4uk=" + "integrity": "sha1-vgWtf5v30i4Fb5cmzuUBf78Z4uk=", + "dev": true }, "regenerator-transform": { "version": "0.10.1", @@ -6685,6 +6610,14 @@ "safe-regex": "^1.1.0" } }, + "regexp.prototype.flags": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.2.0.tgz", + "integrity": "sha512-ztaw4M1VqgMwl9HlPpOuiYgItcHlunW0He2fE6eNfT6E/CF2FtYi9ofOYe4mKntstYk0Fyh/rDRBdS3AnxjlrA==", + "requires": { + "define-properties": "^1.1.2" + } + }, "regexpu-core": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", @@ -6886,15 +6819,6 @@ "integrity": "sha1-KBYjTiN4vdxOU1T6tcqold9xANk=", "dev": true }, - "scheduler": { - "version": "0.11.3", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.11.3.tgz", - "integrity": "sha512-i9X9VRRVZDd3xZw10NY5Z2cVMbdYg6gqFecfj79USv1CFN+YrJ3gIPRKf1qlY+Sxly4djoKdfx1T+m9dnRB8kQ==", - "requires": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1" - } - }, "schema-utils": { "version": "0.4.7", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz", @@ -7328,12 +7252,8 @@ "stylis": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/stylis/-/stylis-3.5.3.tgz", - "integrity": "sha1-mf3Eavumr03v9XCCWZQYGl5s5UY=" - }, - "stylis-rule-sheet": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stylis-rule-sheet/-/stylis-rule-sheet-0.0.10.tgz", - "integrity": "sha1-ROZKKwdmQ/S1Ll/3HvwE2MPEpDA=" + "integrity": "sha1-mf3Eavumr03v9XCCWZQYGl5s5UY=", + "dev": true }, "supports-color": { "version": "3.2.3", @@ -7440,7 +7360,8 @@ "to-fast-properties": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", - "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=" + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "dev": true }, "to-object-path": { "version": "0.3.0", diff --git a/DevApp/package.json b/DevApp/package.json index de59fcfe..de346158 100644 --- a/DevApp/package.json +++ b/DevApp/package.json @@ -21,7 +21,7 @@ "dependencies": { "@aspnet/signalr": "~1.0.3", "chartjs-plugin-streaming": "~1.7.1", - "dotnetify-elements": "^1.0.2", + "dotnetify-elements": "^1.1.0", "jquery": "~3.3.1", "knockout": "~3.4.2", "react": "^16.9.0", diff --git a/DotNetifyLib.Core/DotNetifyLib.Core.csproj b/DotNetifyLib.Core/DotNetifyLib.Core.csproj index cd05730a..160e6b58 100644 --- a/DotNetifyLib.Core/DotNetifyLib.Core.csproj +++ b/DotNetifyLib.Core/DotNetifyLib.Core.csproj @@ -9,18 +9,18 @@ false false false - 3.4.0 + 3.5.0 True Simple, lightweight, yet powerful way to build reactive, real-time web apps. Library for .NET Core. Dicky Suryadi - http://dotnetify.net/ + https://dotnetify.net/ https://github.com/dsuryd/dotNetify/blob/master/LICENSE.md Copyright 2015-2019 https://github.com/dsuryd/dotNetify netcore reactive realtime signalr mobile web websocket - http://dotnetify.net/content/images/dotnetify.png - 3.4.0.0 - 3.4.0.0 + https://dotnetify.net/content/images/dotnetify.png + 3.5.0.0 + 3.5.0.0 diff --git a/DotNetifyLib.SignalR/DotNetifyLib.SignalR.csproj b/DotNetifyLib.SignalR/DotNetifyLib.SignalR.csproj index ac74bdc3..93a883e7 100644 --- a/DotNetifyLib.SignalR/DotNetifyLib.SignalR.csproj +++ b/DotNetifyLib.SignalR/DotNetifyLib.SignalR.csproj @@ -9,18 +9,18 @@ false false false - 3.4.0 + 3.5.0 True Dicky Suryadi Simple, lightweight, yet powerful way to build reactive, real-time web apps. SignalR hub for ASP.NET Core. Copyright 2015-2019 https://github.com/dsuryd/dotNetify/blob/master/LICENSE.md - http://dotnetify.net/ + https://dotnetify.net/ https://github.com/dsuryd/dotNetify netcore reactive realtime signalr mobile web websocket - http://dotnetify.net/content/images/dotnetify.png - 3.4.0.0 - 3.4.0.0 + https://dotnetify.net/content/images/dotnetify.png + 3.5.0.0 + 3.5.0.0 diff --git a/README.md b/README.md index 5a60261e..9838c889 100644 --- a/README.md +++ b/README.md @@ -5,41 +5,38 @@ [![npm version](https://badge.fury.io/js/dotnetify.svg)](https://badge.fury.io/js/dotnetify) [![NuGet](https://img.shields.io/nuget/v/DotNetify.SignalR.svg?style=flat-square)](https://www.nuget.org/packages/DotNetify.SignalR/) -DotNetify is a free, open source project that lets you create real-time, reactive, cross-platform apps with [React](https://facebook.github.io/react/), [React Native](https://facebook.github.io/react-native/), [Vue](https://vuejs.org) or [Knockout](http://knockoutjs.com) front-end on C# .NET back-end via WebSocket. +DotNetify is a free, open source project that lets you create real-time, reactive, cross-platform apps with [React](https://facebook.github.io/react/), [React Native](https://facebook.github.io/react-native/), [Vue](https://vuejs.org) or [Knockout](http://knockoutjs.com) front-end on C# .NET back-end via WebSocket (SignalR). ## What's New ->**_Coming soon_: [micro-frontend](https://martinfowler.com/articles/micro-frontends.html) support.** +* v3.5: **Multi-hub support, web API + local modes - [release notes](https://github.com/dsuryd/dotNetify/releases/tag/v3.5).** +* v3.4: [release notes](https://github.com/dsuryd/dotNetify/releases/tag/v3.4). +* v3.3: .NET client support - [release notes](https://github.com/dsuryd/dotNetify/releases/tag/v3.3.1). + +
-* v3.4: [**release notes**](https://github.com/dsuryd/dotNetify/releases/tag/v3.4). -* v3.3: **.NET client support - [release notes](https://github.com/dsuryd/dotNetify/releases/tag/v3.3.1).** -* v3.2: integrates with Vue. -

* **DotNetify-Elements** is out! See documentation and live demo. * React SPA template for ASP.NET Core 2.x - [github](https://github.com/dsuryd/dotnetify-react-demo-vs2017/tree/master/ReactTemplate). ## Features -* Simple and lightweight - no heavy JS client-side framework, and no REST APIs. -* Reactive back-end MVVM architecture on both .NET Core and .NET Framework. +* Simple and lightweight - no heavy client-side framework, no REST APIs. +* Reactive back-end MVVM architecture on either .NET Core or .NET Framework. * Built-in real-time across WebSocket with SignalR. +* Support local (client-side only) and Web API modes. * Full support for single-page apps, including deep-linked, nested routing and token-based authentication. -* Powerful back-end infrastructure, including dependency injection, WebSocket request/response pipelines, and modern tooling like VS2017 and Webpack. +* Powerful back-end infrastructure, including dependency injection, WebSocket request/response pipelines, and modern tooling. ## Documentation Documentation and live demo can be found at [https://dotnetify.net](http://dotnetify.net). -## React/React Native Code Example +## Code Examples -* Real-time "Hello World" with Visual Studio 2017 + WebPack: [dotnetify-react-demo-vs2017](https://github.com/dsuryd/dotnetify-react-demo-vs2017). -* Real-time "Hello World" with create-react-app + Node.js + .NET Core: [dotnetify-react-demo](https://github.com/dsuryd/dotnetify-react-demo). Includes example using ***Electron*** to build cross-platform desktop app. +* React example: [dotnetify-react-demo-vs2017](https://github.com/dsuryd/dotnetify-react-demo-vs2017). * React Native example: [dotnetify-react-native-demo](https://github.com/dsuryd/dotnetify-react-native-demo). +* Other examples: [demo github repo]([https://github.com/dsuryd/dotNetify/tree/master/Demo]). -## Knockout Code Example - -* Live chart: [Live Chart Example](https://github.com/dsuryd/dotnetify-knockout-demo/tree/master/LiveChart). -* Mobile app example: [Web/Mobile App Template](https://github.com/dsuryd/dotnetify-knockout-demo/tree/master/MobileApp). ## Installation