whisper.cat/weboasis/crypto/assets/widget.js

2 lines
155 KiB
JavaScript
Raw Normal View History

2023-10-05 23:28:32 +11:00
!function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},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 o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},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="http://192.168.1.101:8000/",n(n.s=19)}([function(t,e,n){"use strict";var o=X4CryptoTables;window[o];e.a={components:function(t){var e={};for(var n in t)e[n]=t[n].default;return e},variables:function(t){var e=function(e){var n=t[e];t[e]=function(){var t=[].slice.call(arguments);return t.unshift({state:this.$store.state,getters:this.$store.getters,commit:this.$store.commit,dispatch:this.$store.dispatch}),n.apply(this,t)}};for(var n in t)e(n);return t}}},function(t,e,n){"use strict";function o(t,e,n,o,i,s,r,a){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),o&&(c.functional=!0),s&&(c._scopeId="data-v-"+s),r?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},c._ssrRegister=l):i&&(l=a?function(){i.call(this,this.$root.$options.shadowRoot)}:i),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(t,e){return l.call(e),u(t,e)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,l):[l]}return{exports:t,options:c}}n.d(e,"a",function(){return o})},function(t,e,n){"use strict";n.r(e);var o={props:["scale","colors"],data:function(){return{text:this.$slots.default?this.$slots.default[0].text:""}},updated:function(){this.$slots.default&&this.text!==this.$slots.default[0].text&&(this.text=this.$slots.default[0].text)},computed:{ascale:function(){return parseFloat(this.scale||this.$vnode.context.scale)||1},acolors:function(){return this.colors||this.$root.colors||this.$store.state.colors},output:function(){var t=this,e="",n=this.text;n=this.applyScale(n),n=this.applyColor(n);var o=this.buildBlocks(n),i=o.blocks,s=o.extraBlocks;return i=this.buildMultiBlocks(i),s.forEach(function(e){e.blocks=t.buildMultiBlocks(e.blocks)}),e+=this.buildOutput(i),e+=this.buildExtraOutput(s)}},methods:{buildBlocks:function(t){var e=[],n=[],o=[],i=[],s={key:!1,name:!1,blocks:[]},r=function(){0!==o.length&&((s.name?s.blocks:e).push({selector:n,props:o}),o=[])};return t.split("\n").forEach(function(t){var e=t.trim(),a=e.split(": ");if(0!==e.length){if(e.match(/\{$/))return r(),e.match(/^@/)&&(s.key=e.match(/^(@[^\s]+)\s/)[1]),void(s.name=e.match(/^(.+)\{$/)[1].trim());if("}"===e)return r(),s.blocks.length>0&&i.push(s),void(s={key:!1,name:!1,blocks:[]});if(1===a.length){r();var l=Math.ceil(t.match(/^\s*/)[0].length/2)-(s.name?1:0);(n=n.slice(0,l+1))[l]=e}else o.push({name:a[0].trim(),value:a.slice(1).join(":").trim()})}}),r(),{blocks:e,extraBlocks:i}},applyScale:function(t){var e=this;return t.replace(/\$scale\(([^)]+)\)/g,function(t,n){return 1!==e.ascale&&(n=n.replace(/[0-9.]+/g,function(t){return e.ascale*parseFloat(t)})),n})},applyColor:function(t){var e=this;return t.replace(/\$color\(([^)]+)\)/g,function(t,n){var o=n.split(",")[0].trim(),i=(n.split(",")[1]||"").trim();if(n=e.acolors[o],i){var s=parseFloat(i);e.acolors.dark&&s<=.16&&"!"!==i.substr(i.length-1,1)&&(s*=2),s<1&&(s=s.toString().replace("0.",".")),n=n.replace(/,\s*[0-9.]+\s*\)$/g,","+s+")")}return n})},buildMultiBlocks:function(t){var e=