text: /*!
   * cnso v1.0.0 (https://github.com/alireza-molaee/cnso)
   * circle nested options to select  
   * Copyright 2017-2017 alireza molaee
   * Licensed under MIT (https://github.com/alireza-molaee/cnso/blob/master/LICENSE)
   */
  !function t(e,i,n){function a(s,o){if(!i[s]){if(!e[s]){var h="function"==typeof require&&require;if(!o&&h)return h(s,!0);if(r)return r(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=i[s]={exports:{}};e[s][0].call(u.exports,function(t){var i=e[s][1][t];return a(i||t)},u,u.exports,t,e,i,n)}return i[s].exports}for(var r="function"==typeof require&&require,s=0;s<n.length;s++)a(n[s]);return a}({1:[function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=function(){function t(e){var i=this,a=e.container,r=void 0===a?"my-cnso":a,s=e.data;n(this,t),this.container="string"==typeof r?document.getElementById(r):r,this.data=s,setTimeout(function(){i.setup()},100),window.addEventListener("resize",this.onResize.bind(this))}return a(t,[{key:"setup",value:function(){this.calculateDistance(),this.stage=new Konva.Stage({container:this.container,width:this.width,height:this.height}),this.optionLayers=[],this.lineLayer=new Konva.Layer,this.stage.add(this.lineLayer),this.itrateOnData(this.data)}},{key:"itrateOnData",value:function(t){var e=this,i=Object.keys(t);if(1!==i.length)throw new Error("data structure is not correct!");this.renderOption(i[0],this.stage.getWidth()/2,this.stage.getHeight()/2,this.minDistance/12);var n=Object.entries(t[i[0]]),a=2*Math.PI/n.length,r=this.minDistance/3,s=(r*Math.sin(a/2)*2-10)/2,o=this.minDistance/12<=s?this.minDistance/12:s;n.forEach(function(t,i){e.renderOption(t[0],e.stage.getWidth()/2+Math.cos(i*a)*r,e.stage.getHeight()/2+Math.sin(i*a)*r,o)})}},{key:"renderOption",value:function(t,e,i,n){var a=new Konva.Text({x:e,y:i,text:t,fontSize:15,fontFamily:"Calibri",fill:"black"});a.offsetX(a.width()/2),a.offsetY(a.height()/2);var r=new Konva.Circle({x:e,y:i,radius:n,fill:"red",stroke:"black",strokeWidth:4}),s=new Konva.Layer;s.add(r,a),this.stage.add(s)}},{key:"onResize",value:function(t){this.calculateDistance()}},{key:"calculateDistance",value:function(){this.height=this.container.offsetHeight,this.width=this.container.offsetWidth,this.minDistance=this.height<=this.width?this.height:this.width}}]),t}();i.default=r,window.Cnso=r},{}]},{},[1]);