diff --git a/dist/LICENSE b/dist/LICENSE new file mode 100644 index 0000000..e674bf8 --- /dev/null +++ b/dist/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 Ryan McKinley + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/dist/README.md b/dist/README.md new file mode 100644 index 0000000..bb6c6d1 --- /dev/null +++ b/dist/README.md @@ -0,0 +1,70 @@ +## AJAX Panel for Grafana + +[![CircleCI](https://circleci.com/gh/ryantxu/ajax-panel/tree/master.svg?style=svg)](https://circleci.com/gh/ryantxu/ajax-panel/tree/master) +[![dependencies Status](https://david-dm.org/ryantxu/ajax-panel/status.svg)](https://david-dm.org/ryantxu/ajax-panel) +[![devDependencies Status](https://david-dm.org/ryantxu/ajax-panel/dev-status.svg)](https://david-dm.org/ryantxu/ajax-panel?type=dev) + +The AJAX Panel is a general way to load external content into a grafana dashboard. + +### Options + +* **Method**: + + GET or POST or iframe + +* **URL**: + + The URL to request + +* **Parameters**: + + The parameters that will be passed in the request. This is a javascript object with access to the variables: - `ctrl` The control object. + +### Screenshots + +![Screenshot](https://raw.githubusercontent.com/ryantxu/ajax-panel/master/src/img/screenshot.png) +![Options](https://raw.githubusercontent.com/ryantxu/ajax-panel/master/src/img/screenshot-ajax-options.png) +![Examples](https://raw.githubusercontent.com/ryantxu/ajax-panel/master/src/img/screenshot-examples.png) + +#### Changelog + +##### v0.0.6 (not released yet) + +* Support requests to /api (grafana internal API) +* Adding circleci build +* removing dist from master build (only add it on release branches) +* Support empty text response (#9) +* webpack build +* Show query results +* tested with grafana 6 + + +##### v0.0.5 + +* Support angular templates using AJAX response +* Options to display as: HTML, Text, JSON, or preformatted text +* Fixed display issue with 5.1 +* Support direct link rendered image +* Show possible variables in editor + +##### v0.0.4 + +* Support template variables in parameters (@linar-jether) +* Improved error handling +* Move ajax requests to 'issueQueries' block rather than refresh +* Show loading spinner +* Convert to TypeScript +* Use datasources for complex authentication +* Support loading images +* Support header configuration +* Support showing time info +* Include various sample configurations + +##### v0.0.3 + +* Support template variables in url (@linar-jether) +* Adding iframe method (@linar-jether) + +##### v0.0.2 + +* Quick and Dirty, but it works! diff --git a/dist/img/ajax_panel_logo.svg b/dist/img/ajax_panel_logo.svg new file mode 100644 index 0000000..c01b2a6 --- /dev/null +++ b/dist/img/ajax_panel_logo.svg @@ -0,0 +1 @@ +ajax_3 \ No newline at end of file diff --git a/dist/img/screenshot-ajax-options.png b/dist/img/screenshot-ajax-options.png new file mode 100644 index 0000000..ef52f76 Binary files /dev/null and b/dist/img/screenshot-ajax-options.png differ diff --git a/dist/img/screenshot-examples.png b/dist/img/screenshot-examples.png new file mode 100644 index 0000000..dbf938c Binary files /dev/null and b/dist/img/screenshot-examples.png differ diff --git a/dist/img/screenshot.png b/dist/img/screenshot.png new file mode 100644 index 0000000..173de62 Binary files /dev/null and b/dist/img/screenshot.png differ diff --git a/dist/module.js b/dist/module.js new file mode 100644 index 0000000..5c9e21c --- /dev/null +++ b/dist/module.js @@ -0,0 +1,2 @@ +define(["app/plugins/sdk","jquery","lodash","app/core/app_events","moment"],function(e,t,n,r,i){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.DSInfo=function(e){this.isProxy=!1,this.withCredentials=!1,this.name=e.name,e.url?this.baseURL=e.url:e.urls&&(this.baseURL=e.urls[0]),this.baseURL||(this.baseURL=""),this.isProxy=this.baseURL.startsWith("/api/"),this.withCredentials=e.withCredentials,this.basicAuth=e.basicAuth};var r,i=t.RenderMode=void 0;(r=i||(t.RenderMode=i={})).html="html",r.text="text",r.pre="pre",r.image="image",r.json="json",r.template="template"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PanelCtrl=t.AjaxCtrl=void 0;var r=n(2),i=u(n(3)),o=u(n(4)),s=u(n(5)),a=u(n(6));n(7);var l=n(0),p=n(12);function u(e){return e&&e.__esModule?e:{default:e}}var c,h=(c=function(e,t){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),d=function(e){function t(t,n,r,i,s,a,l,u,c,h){var d=e.call(this,t,n)||this;return d.$rootScope=r,d.$q=i,d.$timeout=s,d.$sce=a,d.templateSrv=l,d.datasourceSrv=u,d.backendSrv=c,d.$compile=h,d.isIframe=!1,d.objectURL=null,d.scopedVars=null,d.requestCount=0,d.lastRequestTime=-1,d.panel.useDatasource&&(d.panel.request="datasource",delete d.panel.useDatasource),o.default.defaults(d.panel,p.examples[0].config),t.$on("$destroy",function(){d.objectURL&&URL.revokeObjectURL(d.objectURL)}),d.events.on("data-received",d.onDataReceived.bind(d)),d.events.on("data-snapshot-load",d.onDataSnapshotLoad.bind(d)),d.events.on("data-error",d.onDataError.bind(d)),d.events.on("init-edit-mode",d.onInitEditMode.bind(d)),d.events.on("panel-initialized",d.onPanelInitalized.bind(d)),d.events.on("render",d.notifyWhenRenderingCompleted.bind(d)),d}return h(t,e),t.$inject=["$scope","$injector","$rootScope","$q","$timeout","$sce","templateSrv","datasourceSrv","backendSrv","$compile"],t.prototype.onDataSnapshotLoad=function(e){this.onDataReceived(e)},t.prototype.onDataError=function(e){console.log("onDataError",e)},t.prototype.onDataReceived=function(e){this.process(e),this.loading=!1},t.prototype.notifyWhenRenderingCompleted=function(){var e=this;if(this.timer&&this.$timeout.cancel(this.timer),0{{ response }}"),e=this.panel.template;else if(delete this.panel.template,this.isIframe)e='';else{this.panel.mode||(this.panel.mode=l.RenderMode.html);var t=this.panel.mode;switch(t===l.RenderMode.html&&this.isUsingMetricQuery()&&(t=l.RenderMode.pre),t){case l.RenderMode.html:e='
';break;case l.RenderMode.text:e="{{ response }}";break;case l.RenderMode.pre:e="
{{ response }}
";break;case l.RenderMode.json:e='';break;case l.RenderMode.image:e="";break;default:console.warn("Unsupported render mode:",this.panel.mode)}}this.ngtemplate.html(e),this.$compile(this.ngtemplate.contents())(this.$scope),this.$scope.response&&this.render()},t.prototype.showError=function(e,t){this.timeInfo=null,this.objectURL&&(this.img.css("display","none"),URL.revokeObjectURL(this.objectURL),this.objectURL=null);var n="

"+e+"

";t&&(n+="
"+JSON.stringify(t)+"
"),this.ngtemplate.html(n),this.$compile(this.ngtemplate.contents())(this.$scope),this.$scope.response&&this.render()},t.prototype.process=function(e){if(this.panel.showTime){var t=this.panel.showTimePrefix?this.panel.showTimePrefix:"";if(this.panel.showTimeValue){var n=void 0;if("request"===this.panel.showTimeValue)n=this.lastRequestTime;else if("recieve"===this.panel.showTimeValue)n=Date.now();else if(this.panel.showTimeValue.startsWith("header-")){var r=this.panel.showTimeValue.substring("header-".length),i=e.headers[r];if(i)console.log("TODO, parse header",i,r);else{var o={};for(var s in e.headers())o[s]=e.headers[s];console.log("Header:",r,"not found in:",o,e)}}t+=n?(0,a.default)(n).format(this.panel.showTimeFormat):"missing: "+this.panel.showTimeValue}this.timeInfo=t}else this.timeInfo=null;if(e){this.$scope.response=e.hasOwnProperty("data")?e.data:e;var p="";if(e.hasOwnProperty("headers")&&(p=e.headers("Content-Type")),p&&p.startsWith("image/")){var u=new Blob([e.data],{type:p}),c=this.objectURL;return this.objectURL=URL.createObjectURL(u),this.img.attr("src",this.objectURL),c&&URL.revokeObjectURL(c),this.img.css("display","block"),void(this.panel.mode!=l.RenderMode.image&&(this.panel.mode=l.RenderMode.image,this.updateTemplate()))}this.objectURL&&(this.img.css("display","none"),URL.revokeObjectURL(this.objectURL),this.objectURL=null),this.panel.mode==l.RenderMode.json&&this.updateTemplate()}},t.prototype.openFullscreen=function(){var e=this;this.overlay.find("img").attr("src",this.objectURL),(0,i.default)(".grafana-app").append(this.overlay),this.overlay.on("click",function(){e.overlay.remove()})},t.prototype.link=function(e,t,n,r){this.img=(0,i.default)(t.find("img")[0]),this.ngtemplate=(0,i.default)(t.find(".ngtemplate")[0]),this.overlay=(0,i.default)(t.find(".ajaxmodal")[0]),this.overlay.remove(),this.overlay.css("display","block"),this.img.css("display","none")},t.templateUrl="partials/module.html",t.scrollable=!0,t}(r.MetricsPanelCtrl);t.AjaxCtrl=d,t.PanelCtrl=d},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t){e.exports=r},function(e,t){e.exports=i},function(e,t,n){var r=n(8);"string"==typeof r&&(r=[[e.i,r,""]]);n(10)(r,{hmr:!0,transform:void 0,insertInto:void 0}),r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(9)(!0)).push([e.i,".small-link a {\n text-decoration: none;\n color: #33b5e5;\n}\n\n.small-link a:hover {\n text-decoration: underline;\n}\n\n.small-link .label-tag {\n background-color: rgb(117, 117, 117);\n border-color: rgb(155, 155, 155);\n margin-right: 5px;\n cursor: context-menu;\n}\n\n.imgwrap img {\n width: 100%;\n height: 100%;\n}\n.imgwrap img:hover {\n border: 3px solid #33b5e5;\n cursor: pointer;\n}\n\n.center-popup {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1050;\n cursor: pointer;\n}\n","",{version:3,sources:["/Users/ryan/workspace/grafana-plugins/ajax-panel/src/style.css"],names:[],mappings:"AAAA;EACE,sBAAsB;EACtB,eAAe;CAChB;;AAED;EACE,2BAA2B;CAC5B;;AAED;EACE,qCAAqC;EACrC,iCAAiC;EACjC,kBAAkB;EAClB,qBAAqB;CACtB;;AAED;EACE,YAAY;EACZ,aAAa;CACd;AACD;EACE,0BAA0B;EAC1B,gBAAgB;CACjB;;AAED;EACE,mBAAmB;EACnB,SAAS;EACT,UAAU;EACV,iCAAiC;EACjC,cAAc;EACd,gBAAgB;CACjB",file:"style.css",sourcesContent:[".small-link a {\n text-decoration: none;\n color: #33b5e5;\n}\n\n.small-link a:hover {\n text-decoration: underline;\n}\n\n.small-link .label-tag {\n background-color: rgb(117, 117, 117);\n border-color: rgb(155, 155, 155);\n margin-right: 5px;\n cursor: context-menu;\n}\n\n.imgwrap img {\n width: 100%;\n height: 100%;\n}\n.imgwrap img:hover {\n border: 3px solid #33b5e5;\n cursor: pointer;\n}\n\n.center-popup {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1050;\n cursor: pointer;\n}\n"],sourceRoot:""}])},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n,r=e[1]||"",i=e[3];if(!i)return r;if(t&&"function"==typeof btoa){var o=(n=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n))))+" */"),s=i.sources.map(function(e){return"/*# sourceURL="+i.sourceRoot+e+" */"});return[r].concat(s).concat([o]).join("\n")}return[r].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;iOrigin: {{ response.origin }}\n\n
{{ response | json }}
",url:"https://httpbin.org/anything?templateInURL=$__interval",header_js:"{\n Accept: 'text/plain'\n}",showTime:!0}},{name:"Webcamera in Thailand",text:"Load an image dynamically",config:{method:"GET",url:"http://tat.touch-ics.com/CCTV/cam.php?cam=31&datatype=image&langISO=EN&t=current&reloadtime=1",params_js:"{\n __now:Date.now(),\n}",responseType:"arraybuffer",showTime:!0}},{name:"Image",text:'Sending "Accept" header',config:{method:"GET",url:"https://httpbin.org/image",params_js:"{}",header_js:"{\n Accept: 'image/jpeg'\n}",responseType:"blob",showTime:!0,showTimeValue:"recieve"}},{name:"Image in IFrame",text:"load an image in an iframe",config:{method:"iframe",url:"https://dummyimage.com/600x300/4286f4/000&text=GRAFANA",params_js:"{}"}},{name:"Results from Grafana API",text:"grafana settings api w/ template",config:{mode:r.RenderMode.template,template:"
{{ response.DEFAULT.instance_name }}
\n\n
{{ response | json }}
",url:"/api/admin/settings",params_js:"{}"}},{name:"Results from Grafana API",text:"formatted as JSON",config:{mode:r.RenderMode.json,url:"/api/admin/stats",params_js:"{}"}},{name:"Basic Auth (success)",text:"send correct basic auth",config:{url:"https://httpbin.org/basic-auth/user/pass",withCredentials:!0,params_js:"{}",header_js:"{\n Authorization: 'Basic ' + btoa('user' + ':' + 'pass')\n// Authorization: 'Basic dXNlcjpwYXNz'\n}"}},{name:"Basic Auth (fail)",text:"send correct basic auth",config:{url:"https://httpbin.org/basic-auth/userx/passx",withCredentials:!0,params_js:"{}",header_js:"{\n Authorization: 'Basic ...bad..'\n}"}}]}])}); +//# sourceMappingURL=module.js.map \ No newline at end of file diff --git a/dist/module.js.map b/dist/module.js.map new file mode 100644 index 0000000..a34b085 --- /dev/null +++ b/dist/module.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./types.ts","webpack:///./module.ts","webpack:///./style.css?95fb","webpack:///./style.css","webpack:///../node_modules/css-loader/lib/css-base.js","webpack:///../node_modules/style-loader/lib/addStyles.js","webpack:///../node_modules/style-loader/lib/urls.js","webpack:///./examples.ts"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","default","object","property","prototype","hasOwnProperty","p","s","e","basicAuth","ds","this","isProxy","withCredentials","url","baseURL","urls","startsWith","RenderMode","html","text","pre","image","json","template","PanelCtrl","AjaxCtrl","_sdk","h","u","_types","_examples","a","setPrototypeOf","__proto__","Array","constructor","_super","$scope","$injector","$rootScope","$q","$timeout","$sce","templateSrv","datasourceSrv","backendSrv","$compile","_this","isIframe","objectURL","scopedVars","requestCount","lastRequestTime","panel","useDatasource","request","_lodash2","defaults","examples","config","$on","URL","revokeObjectURL","events","on","onDataReceived","onDataSnapshotLoad","onDataError","onInitEditMode","onPanelInitalized","__extends","$inject","snapshotData","err","console","log","dataList","process","loading","notifyWhenRenderingCompleted","timer","cancel","requestID_1","renderingCompleted","getStaticExamples","isUsingMetricQuery","loadExample","example","evt","stopPropagation","preventDefault","first","forEach","keys","k","_jquery2","window","scrollTop","_app_events2","emit","animate","appEvent","editorTabIndex","response","updateFN","updateTemplate","refresh","getCurrentParams","params","params_fn","v","replace","getHeaders","header_fn","_getURL","param","hasArgs","indexOf","dsInfo","updateTimeRange","datasource","before","timeInfo","showTime","issueQueries","fn_error","error","assign","__interval","interval","__interval_ms","intervalMs","debugParams","each","variables","getValueForUrl","src","skipSameURL","lastURL","sent","Date","now","trustAsResourceUrl","img","css","url_1","options_1","method","responseType","headers","cache","helper","Promise","resolve","then","DSInfo","Authorization","showError","datasourceRequest","inspector","handleQueryResult","result","render","debounce","fn","onConfigChanged","addEditorTab","pluginId","params_js","Function","ex","warn","header_js","txt","ngtemplate","contents","msg","JSON","stringify","rsp","showTimePrefix","showTimeValue","when","substring","length","vals","_moment2","format","showTimeFormat","data","contentType","blob","Blob","type","old","createObjectURL","attr","openFullscreen","overlay","find","append","remove","link","scope","elem","attrs","ctrl","templateUrl","scrollable","MetricsPanelCtrl","transform","push","version","sources","names","mappings","file","sourcesContent","sourceRoot","useSourceMap","list","toString","map","item","content","sourceMap","cssMapping","btoa","sourceMapping","unescape","encodeURIComponent","sourceURLs","source","concat","join","mediaQuery","alreadyImportedModules","id","isOldIE","document","all","atob","memo","apply","arguments","getElement","target","parent","styleTarget","querySelector","HTMLIFrameElement","contentDocument","head","singleton","singletonCounter","addStylesToDom","styles","options","domStyle","refs","j","parts","addStyle","stylesInDom","listToStyles","base","media","newStyles","part","insertStyleElement","style","Error","insertAt","lastStyleElementInsertedAtTop","nextSibling","insertBefore","appendChild","firstChild","stylesInsertedAtTop","removeStyleElement","parentNode","removeChild","idx","splice","createStyleElement","nonce","nc","addAttrs","el","setAttribute","obj","update","applyToSingletonTag","styleIndex","x","rel","convertToAbsoluteUrls","autoFixUrls","fixUrls","href","oldSrc","g","styleSheet","cssText","createTextNode","newObj","DEBUG","insertInto","f","newList","mayRemove","A","replaceText","index","replacement","textStore","filter","Boolean","cssNode","childNodes","location","baseUrl","protocol","host","fullMatch","origUrl","unquotedOrigUrl","trim","$1","test","newUrl","currentDir","templateResponse"],"m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2J,UAAW,KACXI,UAAA,+BACAxB,aANM,OAONzB,YAPM0D,cAAA,YAWR,CACAxM,KAAM,kBACNsC,KAAA,6BACEwC,OAAA,CACAwF,OAAK,SACLtI,IAAA,yDAHM2J,UAAA,OAOR,CACA3L,KAAM,2BACNsC,KAAA,mCACEwC,OAAA,CACAlE,KAAAoC,EAAUZ,WAAAM,SACVA,SAAK,oFACLV,IAAA,sBAJM2J,UAAA,OAQR,CACA3L,KAAM,2BACNsC,KAAA,oBACEwC,OAAA,CACAlE,KAAKoC,EAAAZ,WAFCK,KAGNT,IAAA,mBAHM2J,UAAA,OAOR,CACA3L,KAAM,uBACNsC,KAAA,0BACEwC,OAAA,CACA9C,IAAA,2CACAD,mBACA4J,UACE,KALII,UAAA,2GAYR,CACA/L,KAAM,oBACNsC,KAAA,0BACEwC,OAAA,CACA9C,IAAA,6CACAD,mBACA4J,UAAW,KAJLI,UAAA","file":"module.js","sourcesContent":[" \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","export class DSInfo {\n name: string;\n baseURL: string;\n isProxy: boolean = false;\n withCredentials: boolean = false;\n basicAuth?: string;\n\n constructor(ds) {\n this.name = ds.name;\n if (ds.url) {\n this.baseURL = ds.url;\n } else if (ds.urls) {\n this.baseURL = ds.urls[0];\n }\n if (!this.baseURL) {\n this.baseURL = '';\n }\n\n this.isProxy = this.baseURL.startsWith('/api/');\n this.withCredentials = ds.withCredentials;\n this.basicAuth = ds.basicAuth;\n }\n}\n\n// \n// \n// \n// \n// \nexport enum RenderMode {\n html = 'html',\n text = 'text',\n pre = 'pre',\n image = 'image',\n json = 'json',\n template = 'template',\n}\n","///\n\nimport {MetricsPanelCtrl} from 'app/plugins/sdk';\nimport $ from 'jquery';\nimport _ from 'lodash';\nimport appEvents from 'app/core/app_events';\nimport moment from 'moment';\nimport './style.css';\nimport {DSInfo, RenderMode} from './types';\nimport {examples} from './examples';\n\nclass AjaxCtrl extends MetricsPanelCtrl {\n static templateUrl = 'partials/module.html';\n static scrollable = true;\n\n params_fn?: Function;\n header_fn?: Function;\n\n isIframe: boolean = false;\n objectURL: any = null; // Used for images\n scopedVars: any = null; // updated each request\n\n img?: any; // HTMLElement\n overlay?: any; // HTMLElement\n ngtemplate?: any; // HTMLElement\n\n requestCount = 0;\n lastRequestTime = -1;\n fn_error?: any;\n\n // Used in the editor\n lastURL?: string;\n dsInfo?: DSInfo;\n debugParams?: any;\n timer?: any;\n\n /** @ngInject */\n constructor(\n $scope,\n $injector,\n public $rootScope,\n public $q,\n public $timeout,\n public $sce,\n public templateSrv,\n public datasourceSrv,\n public backendSrv,\n public $compile\n ) {\n super($scope, $injector);\n\n // Migrate old settings\n if (this.panel.useDatasource) {\n this.panel.request = 'datasource';\n delete this.panel.useDatasource;\n }\n _.defaults(this.panel, examples[0].config);\n\n $scope.$on('$destroy', () => {\n if (this.objectURL) {\n URL.revokeObjectURL(this.objectURL);\n }\n });\n\n this.events.on('data-received', this.onDataReceived.bind(this));\n this.events.on('data-snapshot-load', this.onDataSnapshotLoad.bind(this));\n this.events.on('data-error', this.onDataError.bind(this));\n\n this.events.on('init-edit-mode', this.onInitEditMode.bind(this));\n this.events.on('panel-initialized', this.onPanelInitalized.bind(this));\n this.events.on('render', this.notifyWhenRenderingCompleted.bind(this));\n }\n\n onDataSnapshotLoad(snapshotData) {\n this.onDataReceived(snapshotData);\n }\n\n onDataError(err) {\n console.log('onDataError', err);\n }\n\n // Having this function pust ths query sidebar on\n onDataReceived(dataList) {\n this.process(dataList);\n this.loading = false;\n }\n\n // This checks that all requests have completed before saying\n notifyWhenRenderingCompleted() {\n if (this.timer) {\n this.$timeout.cancel(this.timer);\n }\n\n if (this.requestCount > 0) {\n const requestID = this.requestCount;\n this.timer = this.$timeout(() => {\n this.timer = undefined;\n\n if (this.requestCount != requestID) {\n return;\n }\n\n // If it is still loading... try again\n if (this.loading) {\n this.notifyWhenRenderingCompleted();\n } else {\n this.renderingCompleted();\n }\n }, 100);\n }\n }\n\n // Expose the examples to Angular\n getStaticExamples() {\n return examples;\n }\n\n isUsingMetricQuery() {\n return this.panel.request.startsWith('query');\n }\n\n loadExample(example: any, evt?: any) {\n if (evt) {\n evt.stopPropagation();\n evt.preventDefault();\n }\n\n console.log('Loading example', example);\n const first = examples[0].config;\n _.forEach(_.keys(first), k => {\n delete this.panel[k];\n });\n _.defaults(this.panel, example.config);\n _.defaults(this.panel, first);\n\n $(window).scrollTop(0);\n appEvents.emit('dash-scroll', {animate: false, evt: 0});\n\n this.$rootScope.appEvent('alert-success', ['Loaded Example Configuraiton', example.name]);\n\n if (example.editorTabIndex) {\n this.editorTabIndex = example.editorTabIndex;\n } else {\n this.editorTabIndex = 1;\n }\n this.$scope.response = null;\n this.updateFN();\n this.updateTemplate();\n this.refresh();\n }\n\n getCurrentParams(scopedVars?: any) {\n let params = {};\n if (this.params_fn) {\n params = this.params_fn(this);\n }\n // if(false) {\n // this.templateSrv.fillVariableValuesForUrl(params, scopedVars);\n // }\n return params;\n }\n\n // This is called from Javascript\n template(v: string) {\n if (v) {\n return this.templateSrv.replace(v, this.scopedVars);\n }\n return null;\n }\n\n getHeaders(scopedVars?: any) {\n if (this.header_fn) {\n return this.header_fn(this);\n }\n return null;\n }\n\n _getURL(scopedVars?: any) {\n let url = this.templateSrv.replace(this.panel.url, scopedVars);\n const params = this.getCurrentParams();\n if (params) {\n const p = $.param(params);\n if (p) {\n const hasArgs = url.indexOf('?') > 0;\n url = url + (hasArgs ? '&' : '?') + p;\n }\n }\n if (this.panel.request === 'datasource' && this.dsInfo) {\n return this.dsInfo.baseURL + url;\n }\n return url;\n }\n\n /**\n * @override\n */\n updateTimeRange(datasource?) {\n const before = this.timeInfo;\n const v = super.updateTimeRange(datasource);\n if (this.panel.showTime && before) {\n this.timeInfo = before;\n }\n return v;\n }\n\n /**\n * Rather than issue a datasource query, we will call our ajax request\n * @override\n */\n issueQueries(datasource) {\n if (this.isUsingMetricQuery()) {\n return super.issueQueries(datasource);\n }\n\n if (this.fn_error) {\n this.loading = false;\n this.error = this.fn_error;\n return null;\n }\n // make shallow copy of scoped vars,\n // and add built in variables interval and interval_ms\n const scopedVars = (this.scopedVars = Object.assign({}, this.panel.scopedVars, {\n __interval: {text: this.interval, value: this.interval},\n __interval_ms: {text: this.intervalMs, value: this.intervalMs},\n }));\n\n // This lets us see the parameters in the editor\n if (this.debugParams) {\n this.debugParams = {};\n _.each(scopedVars, (v, k) => {\n this.debugParams[k] = v.text;\n });\n _.each(this.templateSrv.variables, v => {\n this.debugParams[v.name] = v.getValueForUrl();\n });\n }\n\n const src = this._getURL(scopedVars);\n if (this.panel.skipSameURL && src === this.lastURL) {\n this.loading = false;\n return null;\n }\n\n this.lastURL = src;\n this.error = null; // remove the error\n const sent = Date.now();\n if (this.isIframe) {\n this.$scope.url = this.$sce.trustAsResourceUrl(src);\n // Its not an image, so remove it\n if (this.objectURL) {\n this.img.css('display', 'none');\n URL.revokeObjectURL(this.objectURL);\n this.objectURL = null;\n }\n return;\n } else {\n const url = this.templateSrv.replace(this.panel.url, scopedVars);\n const params = this.getCurrentParams();\n\n let options: any = {\n method: this.panel.method,\n responseType: this.panel.responseType,\n url: url,\n params: params,\n headers: this.getHeaders(),\n cache: false,\n withCredentials: this.panel.withCredentials,\n };\n options.headers = options.headers || {};\n\n let helper = Promise.resolve({});\n if (this.panel.request === 'datasource') {\n helper = this.datasourceSrv.get(this.panel.datasource).then(ds => {\n console.log('DDDD', ds, this);\n if (ds) {\n this.dsInfo = new DSInfo(ds);\n\n // Change the URL\n if (this.dsInfo.basicAuth || this.dsInfo.withCredentials) {\n options.withCredentials = true;\n }\n if (this.dsInfo.basicAuth) {\n options.headers.Authorization = this.dsInfo.basicAuth;\n }\n\n options.url = this.dsInfo.baseURL + url;\n } else {\n this.dsInfo = null;\n }\n });\n } else if (!options.url) {\n this.error = 'Missing URL';\n this.showError(this.error, null);\n return;\n } else if (options.url.indexOf('://') < 0 && options.url.indexOf('api/') < 0) {\n this.error = 'Invalid URL: ' + options.url;\n this.showError(this.error, params);\n return;\n }\n\n // Now make the call\n this.requestCount++;\n this.loading = true;\n helper.then(() => {\n this.backendSrv.datasourceRequest(options).then(\n response => {\n this.lastRequestTime = sent;\n this.process(response);\n this.loading = false;\n },\n err => {\n console.log('ERR', err);\n this.lastRequestTime = sent;\n this.loading = false;\n\n this.error = err; //.data.error + \" [\"+err.status+\"]\";\n this.inspector = {error: err};\n this.showError('Request Error', err);\n }\n );\n });\n }\n\n // Return empty results\n return null; //this.$q.when( [] );\n }\n\n // Overrides the default handling (error for null result)\n handleQueryResult(result) {\n // console.log('handleQueryResult', result, Date.now(), this.loading);\n this.loading = false;\n if (result) {\n if (this.isUsingMetricQuery()) {\n return super.handleQueryResult(result);\n }\n }\n this.render();\n }\n\n onPanelInitalized() {\n this.updateFN();\n this.updateTemplate();\n $(window).on(\n 'resize',\n _.debounce(fn => {\n this.refresh();\n }, 250)\n );\n }\n\n onConfigChanged() {\n this.lastURL = undefined;\n this.refresh();\n }\n\n onInitEditMode() {\n this.debugParams = {};\n this.addEditorTab(\n 'Request',\n 'public/plugins/' + this.pluginId + '/partials/editor.request.html',\n 2\n );\n this.addEditorTab(\n 'Display',\n 'public/plugins/' + this.pluginId + '/partials/editor.display.html',\n 3\n );\n this.addEditorTab(\n 'Examples',\n 'public/plugins/' + this.pluginId + '/partials/editor.examples.html',\n 5\n );\n this.editorTabIndex = 2;\n this.updateFN();\n }\n\n updateFN() {\n this.fn_error = null;\n this.params_fn = undefined;\n\n if (this.panel.params_js) {\n try {\n this.params_fn = new Function('ctrl', 'return ' + this.panel.params_js);\n } catch (ex) {\n console.warn('error parsing params_js', this.panel.params_js, ex);\n this.params_fn = undefined;\n this.fn_error = ex;\n }\n }\n if (this.panel.header_js) {\n try {\n this.header_fn = new Function('ctrl', 'return ' + this.panel.header_js);\n } catch (ex) {\n console.warn('error parsing header_js', this.panel.header_js, ex);\n this.header_fn = undefined;\n this.fn_error = ex;\n }\n }\n this.onConfigChanged();\n }\n\n updateTemplate() {\n let txt = '';\n this.isIframe = this.panel.method === 'iframe';\n if (this.panel.mode == RenderMode.template) {\n if (!this.panel.template) {\n this.panel.template = '
{{ response }}
';\n }\n txt = this.panel.template;\n } else {\n delete this.panel.template;\n if (this.isIframe) {\n txt =\n '';\n } else {\n if (!this.panel.mode) {\n this.panel.mode = RenderMode.html;\n }\n let mode = this.panel.mode;\n if (mode === RenderMode.html && this.isUsingMetricQuery()) {\n mode = RenderMode.pre; // don't show [object object]!\n }\n switch (mode) {\n case RenderMode.html:\n txt = '
';\n break;\n case RenderMode.text:\n txt = '{{ response }}';\n break;\n case RenderMode.pre:\n txt = '
{{ response }}
';\n break;\n case RenderMode.json:\n txt = '';\n break;\n case RenderMode.image:\n txt = '';\n break;\n default:\n console.warn('Unsupported render mode:', this.panel.mode);\n }\n }\n }\n //console.log('UPDATE template', this.panel, txt);\n\n this.ngtemplate.html(txt);\n this.$compile(this.ngtemplate.contents())(this.$scope);\n if (this.$scope.response) {\n this.render();\n }\n }\n\n showError(msg: string, err: any) {\n this.timeInfo = null;\n if (this.objectURL) {\n this.img.css('display', 'none');\n URL.revokeObjectURL(this.objectURL);\n this.objectURL = null;\n }\n\n let txt = `

${msg}

`;\n if (err) {\n txt += '
' + JSON.stringify(err) + '
';\n }\n\n this.ngtemplate.html(txt);\n this.$compile(this.ngtemplate.contents())(this.$scope);\n if (this.$scope.response) {\n this.render();\n }\n }\n\n process(rsp: any) {\n if (this.panel.showTime) {\n let txt: string = this.panel.showTimePrefix ? this.panel.showTimePrefix : '';\n if (this.panel.showTimeValue) {\n let when: any = undefined;\n if ('request' === this.panel.showTimeValue) {\n when = this.lastRequestTime;\n } else if ('recieve' === this.panel.showTimeValue) {\n when = Date.now();\n } else if (this.panel.showTimeValue.startsWith('header-')) {\n let h = this.panel.showTimeValue.substring('header-'.length);\n let v = rsp.headers[h];\n if (v) {\n console.log('TODO, parse header', v, h);\n } else {\n let vals: any = {};\n for (let key in rsp.headers()) {\n vals[key] = rsp.headers[key];\n }\n console.log('Header:', h, 'not found in:', vals, rsp);\n }\n }\n\n if (when) {\n txt += moment(when).format(this.panel.showTimeFormat);\n } else {\n txt += 'missing: ' + this.panel.showTimeValue;\n }\n }\n this.timeInfo = txt;\n } else {\n this.timeInfo = null;\n }\n\n if (!rsp) {\n return;\n }\n this.$scope.response = rsp.hasOwnProperty('data') ? rsp.data : rsp;\n\n let contentType: string = '';\n if (rsp.hasOwnProperty('headers')) {\n contentType = rsp.headers('Content-Type');\n }\n\n if (contentType) {\n if (contentType.startsWith('image/')) {\n const blob = new Blob([rsp.data], {\n type: contentType,\n });\n const old = this.objectURL;\n this.objectURL = URL.createObjectURL(blob);\n this.img.attr('src', this.objectURL);\n if (old) {\n URL.revokeObjectURL(old);\n }\n this.img.css('display', 'block');\n\n // If we get an image, change the display to image type\n if (this.panel.mode != RenderMode.image) {\n this.panel.mode = RenderMode.image;\n this.updateTemplate();\n }\n return;\n }\n }\n\n // Its not an image, so remove it\n if (this.objectURL) {\n this.img.css('display', 'none');\n URL.revokeObjectURL(this.objectURL);\n this.objectURL = null;\n }\n\n // JSON Node needs to force refresh\n if (this.panel.mode == RenderMode.json) {\n this.updateTemplate();\n }\n }\n\n openFullscreen() {\n // Update the image\n this.overlay.find('img').attr('src', this.objectURL);\n $('.grafana-app').append(this.overlay);\n this.overlay.on('click', () => {\n this.overlay.remove();\n });\n }\n\n link(scope, elem, attrs, ctrl) {\n this.img = $(elem.find('img')[0]);\n this.ngtemplate = $(elem.find('.ngtemplate')[0]);\n this.overlay = $(elem.find('.ajaxmodal')[0]);\n this.overlay.remove();\n this.overlay.css('display', 'block');\n this.img.css('display', 'none');\n }\n}\n\nexport {AjaxCtrl, AjaxCtrl as PanelCtrl};\n","\nvar content = require(\"!!../node_modules/css-loader/index.js??ref--5-1!./style.css\");\n\nif(typeof content === 'string') content = [[module.id, content, '']];\n\nvar transform;\nvar insertInto;\n\n\n\nvar options = {\"hmr\":true}\n\noptions.transform = transform\noptions.insertInto = undefined;\n\nvar update = require(\"!../node_modules/style-loader/lib/addStyles.js\")(content, options);\n\nif(content.locals) module.exports = content.locals;\n\nif(module.hot) {\n\tmodule.hot.accept(\"!!../node_modules/css-loader/index.js??ref--5-1!./style.css\", function() {\n\t\tvar newContent = require(\"!!../node_modules/css-loader/index.js??ref--5-1!./style.css\");\n\n\t\tif(typeof newContent === 'string') newContent = [[module.id, newContent, '']];\n\n\t\tvar locals = (function(a, b) {\n\t\t\tvar key, idx = 0;\n\n\t\t\tfor(key in a) {\n\t\t\t\tif(!b || a[key] !== b[key]) return false;\n\t\t\t\tidx++;\n\t\t\t}\n\n\t\t\tfor(key in b) idx--;\n\n\t\t\treturn idx === 0;\n\t\t}(content.locals, newContent.locals));\n\n\t\tif(!locals) throw new Error('Aborting CSS HMR due to changed css-modules locals.');\n\n\t\tupdate(newContent);\n\t});\n\n\tmodule.hot.dispose(function() { update(); });\n}","exports = module.exports = require(\"../node_modules/css-loader/lib/css-base.js\")(true);\n// imports\n\n\n// module\nexports.push([module.id, \".small-link a {\\n text-decoration: none;\\n color: #33b5e5;\\n}\\n\\n.small-link a:hover {\\n text-decoration: underline;\\n}\\n\\n.small-link .label-tag {\\n background-color: rgb(117, 117, 117);\\n border-color: rgb(155, 155, 155);\\n margin-right: 5px;\\n cursor: context-menu;\\n}\\n\\n.imgwrap img {\\n width: 100%;\\n height: 100%;\\n}\\n.imgwrap img:hover {\\n border: 3px solid #33b5e5;\\n cursor: pointer;\\n}\\n\\n.center-popup {\\n position: absolute;\\n top: 50%;\\n left: 50%;\\n transform: translate(-50%, -50%);\\n z-index: 1050;\\n cursor: pointer;\\n}\\n\", \"\", {\"version\":3,\"sources\":[\"/Users/ryan/workspace/grafana-plugins/ajax-panel/src/style.css\"],\"names\":[],\"mappings\":\"AAAA;EACE,sBAAsB;EACtB,eAAe;CAChB;;AAED;EACE,2BAA2B;CAC5B;;AAED;EACE,qCAAqC;EACrC,iCAAiC;EACjC,kBAAkB;EAClB,qBAAqB;CACtB;;AAED;EACE,YAAY;EACZ,aAAa;CACd;AACD;EACE,0BAA0B;EAC1B,gBAAgB;CACjB;;AAED;EACE,mBAAmB;EACnB,SAAS;EACT,UAAU;EACV,iCAAiC;EACjC,cAAc;EACd,gBAAgB;CACjB\",\"file\":\"style.css\",\"sourcesContent\":[\".small-link a {\\n text-decoration: none;\\n color: #33b5e5;\\n}\\n\\n.small-link a:hover {\\n text-decoration: underline;\\n}\\n\\n.small-link .label-tag {\\n background-color: rgb(117, 117, 117);\\n border-color: rgb(155, 155, 155);\\n margin-right: 5px;\\n cursor: context-menu;\\n}\\n\\n.imgwrap img {\\n width: 100%;\\n height: 100%;\\n}\\n.imgwrap img:hover {\\n border: 3px solid #33b5e5;\\n cursor: pointer;\\n}\\n\\n.center-popup {\\n position: absolute;\\n top: 50%;\\n left: 50%;\\n transform: translate(-50%, -50%);\\n z-index: 1050;\\n cursor: pointer;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n\n// exports\n","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn \"@media \" + item[2] + \"{\" + content + \"}\";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join(\"\");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === \"string\")\n\t\t\tmodules = [[null, modules, \"\"]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === \"number\")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || '';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === 'function') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n\t}\n\n\treturn [content].join('\\n');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}\n","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n\nvar stylesInDom = {};\n\nvar\tmemoize = function (fn) {\n\tvar memo;\n\n\treturn function () {\n\t\tif (typeof memo === \"undefined\") memo = fn.apply(this, arguments);\n\t\treturn memo;\n\t};\n};\n\nvar isOldIE = memoize(function () {\n\t// Test for IE <= 9 as proposed by Browserhacks\n\t// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n\t// Tests for existence of standard globals is to allow style-loader\n\t// to operate correctly into non-standard environments\n\t// @see https://github.com/webpack-contrib/style-loader/issues/177\n\treturn window && document && document.all && !window.atob;\n});\n\nvar getTarget = function (target, parent) {\n if (parent){\n return parent.querySelector(target);\n }\n return document.querySelector(target);\n};\n\nvar getElement = (function (fn) {\n\tvar memo = {};\n\n\treturn function(target, parent) {\n // If passing function in options, then use it for resolve \"head\" element.\n // Useful for Shadow Root style i.e\n // {\n // insertInto: function () { return document.querySelector(\"#foo\").shadowRoot }\n // }\n if (typeof target === 'function') {\n return target();\n }\n if (typeof memo[target] === \"undefined\") {\n\t\t\tvar styleTarget = getTarget.call(this, target, parent);\n\t\t\t// Special case to return head of iframe instead of iframe itself\n\t\t\tif (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n\t\t\t\ttry {\n\t\t\t\t\t// This will throw an exception if access to iframe is blocked\n\t\t\t\t\t// due to cross-origin restrictions\n\t\t\t\t\tstyleTarget = styleTarget.contentDocument.head;\n\t\t\t\t} catch(e) {\n\t\t\t\t\tstyleTarget = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmemo[target] = styleTarget;\n\t\t}\n\t\treturn memo[target]\n\t};\n})();\n\nvar singleton = null;\nvar\tsingletonCounter = 0;\nvar\tstylesInsertedAtTop = [];\n\nvar\tfixUrls = require(\"./urls\");\n\nmodule.exports = function(list, options) {\n\tif (typeof DEBUG !== \"undefined\" && DEBUG) {\n\t\tif (typeof document !== \"object\") throw new Error(\"The style-loader cannot be used in a non-browser environment\");\n\t}\n\n\toptions = options || {};\n\n\toptions.attrs = typeof options.attrs === \"object\" ? options.attrs : {};\n\n\t// Force single-tag solution on IE6-9, which has a hard limit on the # of