{"version":3,"sources":["kendo.data.signalr.js"],"names":["f","define","$","transport","kendo","data","RemoteTransport","extend","init","options","hub","signalr","promise","Error","done","fail","this","on","invoke","fn","call","push","callbacks","client","create","pushCreate","update","pushUpdate","destroy","pushDestroy","_crud","type","args","server","format","parameterMap","isEmptyObject","apply","success","error","read","transports","window","jQuery","amd","a1","a2","a3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;CAwBC,SAAUA,EAAGC,QACVA,OAAO,sBAAuB,cAAeD,IAC/C,WAwEE,MAhEC,UAAUE,GACP,GAAIC,GAAYC,MAAMC,KAAKC,gBAAgBC,QACvCC,KAAM,SAAUC,GAAV,GAUEC,GATAC,EAAUF,GAAWA,EAAQE,QAAUF,EAAQE,WAC/CC,EAAUD,EAAQC,OACtB,KAAKA,EACD,KAAUC,OAAM,oCAEpB,IAA2B,kBAAhBD,GAAQE,MAA6C,kBAAhBF,GAAQG,KACpD,KAAUF,OAAM,0CAIpB,IAFAG,KAAKJ,QAAUA,EACXF,EAAMC,EAAQD,KACbA,EACD,KAAUG,OAAM,gCAEpB,IAAqB,kBAAVH,GAAIO,IAAyC,kBAAdP,GAAIQ,OAC1C,KAAUL,OAAM,qDAEpBG,MAAKN,IAAMA,EACXN,MAAMC,KAAKC,gBAAgBa,GAAGX,KAAKY,KAAKJ,KAAMP,IAElDY,KAAM,SAAUC,GACZ,GAAIC,GAASP,KAAKP,QAAQE,QAAQY,UAC9BA,GAAOC,QACPR,KAAKN,IAAIO,GAAGM,EAAOC,OAAQF,EAAUG,YAErCF,EAAOG,QACPV,KAAKN,IAAIO,GAAGM,EAAOG,OAAQJ,EAAUK,YAErCJ,EAAOK,SACPZ,KAAKN,IAAIO,GAAGM,EAAOK,QAASN,EAAUO,cAG9CC,MAAO,SAAUrB,EAASsB,GAAnB,GAMCC,GACA3B,EANAK,EAAMM,KAAKN,IACXuB,EAASjB,KAAKP,QAAQE,QAAQsB,MAClC,KAAKA,IAAWA,EAAOF,GACnB,KAAUlB,OAAMT,MAAM8B,OAAO,uCAAwCH,GAErEC,IAAQC,EAAOF,IACf1B,EAAOW,KAAKmB,aAAa1B,EAAQJ,KAAM0B,GACtC7B,EAAEkC,cAAc/B,IACjB2B,EAAKX,KAAKhB,GAEdW,KAAKJ,QAAQE,KAAK,WACdJ,EAAIQ,OAAOmB,MAAM3B,EAAKsB,GAAMlB,KAAKL,EAAQ6B,SAASvB,KAAKN,EAAQ8B,UAGvEC,KAAM,SAAU/B,GACZO,KAAKc,MAAMrB,EAAS,SAExBe,OAAQ,SAAUf,GACdO,KAAKc,MAAMrB,EAAS,WAExBiB,OAAQ,SAAUjB,GACdO,KAAKc,MAAMrB,EAAS,WAExBmB,QAAS,SAAUnB,GACfO,KAAKc,MAAMrB,EAAS,aAG5BP,GAAEK,QAAO,EAAMH,MAAMC,MAAQoC,YAAc9B,QAASR,MACtDuC,OAAOtC,MAAMuC,QACRD,OAAOtC,OACE,kBAAVH,SAAwBA,OAAO2C,IAAM3C,OAAS,SAAU4C,EAAIC,EAAIC,IACrEA,GAAMD","file":"kendo.data.signalr.min.js","sourcesContent":["/*!\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n*/\n(function (f, define) {\n define('kendo.data.signalr', ['kendo.data'], f);\n}(function () {\n var __meta__ = {\n id: 'data.signalr',\n name: 'SignalR',\n category: 'framework',\n depends: ['data'],\n hidden: true\n };\n (function ($) {\n var transport = kendo.data.RemoteTransport.extend({\n init: function (options) {\n var signalr = options && options.signalr ? options.signalr : {};\n var promise = signalr.promise;\n if (!promise) {\n throw new Error('The \"promise\" option must be set.');\n }\n if (typeof promise.done != 'function' || typeof promise.fail != 'function') {\n throw new Error('The \"promise\" option must be a Promise.');\n }\n this.promise = promise;\n var hub = signalr.hub;\n if (!hub) {\n throw new Error('The \"hub\" option must be set.');\n }\n if (typeof hub.on != 'function' || typeof hub.invoke != 'function') {\n throw new Error('The \"hub\" option is not a valid SignalR hub proxy.');\n }\n this.hub = hub;\n kendo.data.RemoteTransport.fn.init.call(this, options);\n },\n push: function (callbacks) {\n var client = this.options.signalr.client || {};\n if (client.create) {\n this.hub.on(client.create, callbacks.pushCreate);\n }\n if (client.update) {\n this.hub.on(client.update, callbacks.pushUpdate);\n }\n if (client.destroy) {\n this.hub.on(client.destroy, callbacks.pushDestroy);\n }\n },\n _crud: function (options, type) {\n var hub = this.hub;\n var server = this.options.signalr.server;\n if (!server || !server[type]) {\n throw new Error(kendo.format('The \"server.{0}\" option must be set.', type));\n }\n var args = [server[type]];\n var data = this.parameterMap(options.data, type);\n if (!$.isEmptyObject(data)) {\n args.push(data);\n }\n this.promise.done(function () {\n hub.invoke.apply(hub, args).done(options.success).fail(options.error);\n });\n },\n read: function (options) {\n this._crud(options, 'read');\n },\n create: function (options) {\n this._crud(options, 'create');\n },\n update: function (options) {\n this._crud(options, 'update');\n },\n destroy: function (options) {\n this._crud(options, 'destroy');\n }\n });\n $.extend(true, kendo.data, { transports: { signalr: transport } });\n }(window.kendo.jQuery));\n return window.kendo;\n}, typeof define == 'function' && define.amd ? define : function (a1, a2, a3) {\n (a3 || a2)();\n}));"]}