{"version":3,"names":["window","templates","_$_","sf","dom","$","__tmplt","_sf_internal","body_map","_replace","path","html","h","this","remove","reinitViews","append","document","body","apply","arguments","prepend","Blackprint","loadScope","url","Context","getContext","Sketch","registerInterface","IFace","Logger","m2v$log","now","el","$el","offsetWidth","offsetHeight","length","attr"],"sources":["nodes/Console/_init.sf","nodes/Console/Log.sf"],"sourcesContent":["## js-global\n// This script will run first, and then the other files\n// depends on blackprint.config.js configuration\n\n// Because .js and .sf is separated\n// we also need to call loadScope just like _init.js\nlet Blackprint = window.Blackprint.loadScope({\n\t// You can find the URL on Blackprint menu -> Modules\n\t// This will also be exported to JSON if this module's nodes is being used\n\turl: import.meta.url,\n});\n\n// Use sQuery\nlet $ = sf.$;\n\n// Global shared context (wait it to avoid race condition)\nlet Context = await Blackprint.getContext('Console');","## html\n<div class=\"node\" style=\"transform: translate({{ x }}px, {{ y }}px)\">\n  <sf-template path=\"Blackprint/nodes/template/routes.sf\"></sf-template>\n  <sf-template path=\"Blackprint/nodes/template/header.sf\"></sf-template>\n\n  <div class=\"content\">\n    <textarea value=\"{{ log }}\"></textarea>\n\n    <div class=\"left-port\">\n      <sf-template path=\"Blackprint/nodes/template/input-port.sf\"></sf-template>\n    </div>\n  </div>\n\n  <sf-template path=\"Blackprint/nodes/template/other.sf\"></sf-template>\n</div>\n\n## scss-global\nbpic-console-log{\n\ttextarea{\n\t\twidth: 100px;\n\t\tmargin: 0px 5px 0px -5px !important; // sometime this got overriden by the element\n\t}\n}\n\n## js-global\nBlackprint.Sketch.registerInterface('BPIC/Console/Log',\nclass extends Context.IFace.Logger {\n\tm2v$log(now){\n\t\t// Scale the input box depend on character length\n\t\tvar el = this.$el('textarea');\n\t\tif(el[0] == null) return;\n\n\t\t// Skip if textarea was larger than our auto control\n\t\t// I mean, if user have change the size manually\n\t\tif(el[0].offsetWidth > 150 || el[0].offsetHeight > 60)\n\t\t\treturn;\n\n\t\tif(now.length < 8)\n\t\t\tel.attr('style', '');\n\t\telse if(now.length >= 8 && now.length < 14)\n\t\t\tel.attr('style', 'width:'+(10*now.length)+'px');\n\t\telse if(now.length >= 14)\n\t\t\tel.attr('style', 'width:140px;height:50px');\n\t}\n});"],"mappings":"8HACAA,EAAAC,YAAAD,EAAAC,UAAA,QAAAC,EAAAC,GAAAC,KAAAD,GAAAE,EAAAC,EAAAN,EAAAC,UAAAD,EAAAO,aAAAP,EAAAO,cAAA,CAAAC,SAAA,GAAAC,SAAAC,EAAAC,GAAA,IAAAC,EAAAV,EAAAS,GAAA,OAAAE,KAAAL,SAAAE,IAAAG,KAAAL,SAAAE,GAAAI,SAAAD,KAAAE,aAAAF,KAAAE,YAAAH,GAAAC,KAAAL,SAAAE,GAAAE,CAAA,EAAAI,OAAAN,EAAAC,GAAAT,EAAAe,SAAAC,MAAAF,OAAAH,KAAAJ,SAAAU,MAAAN,KAAAO,WAAA,EAAAC,QAAAX,EAAAC,GAAAT,EAAAe,SAAAC,MAAAG,QAAAR,KAAAJ,SAAAU,MAAAN,KAAAO,WAAA,GAKA,IAAAE,EAAAtB,EAAAsB,WAAAC,UAAA,CAGAC,sBAOAC,GAHAtB,GAAAE,QAGAiB,EAAAI,WAAA,Y,2dCSAJ,EAAAK,OAAAC,kBAAA,mBACA,cAAAH,EAAAI,MAAAC,OACAC,QAAAC,GAEA,IAAAC,EAAApB,KAAAqB,IAAA,YACA,MAAAD,EAAA,KAIAA,EAAA,GAAAE,YAAA,KAAAF,EAAA,GAAAG,aAAA,KAGAJ,EAAAK,OAAA,EACAJ,EAAAK,KAAA,YACAN,EAAAK,QAAA,GAAAL,EAAAK,OAAA,GACAJ,EAAAK,KAAA,oBAAAN,EAAAK,OAAA,MACAL,EAAAK,QAAA,IACAJ,EAAAK,KAAA,oCACA,G","ignoreList":[]}