basekernel/webv86/web/jquery.terminal.min.js

48 lines
171 KiB
JavaScript
Raw Permalink Normal View History

2024-12-09 23:50:54 +01:00
/**@license
* __ _____ ________ __
* / // _ /__ __ _____ ___ __ _/__ ___/__ ___ ______ __ __ __ ___ / /
* __ / // // // // // _ // _// // / / // _ // _// // // \/ // _ \/ /
* / / // // // // // ___// / / // / / // ___// / / / / // // /\ // // / /__
* \___//____ \\___//____//_/ _\_ / /_//____//_/ /_/ /_//_//_/ /_/ \__\_\___/
* \/ /____/ version 2.44.1
*
* This file is part of jQuery Terminal. https://terminal.jcubic.pl
*
* Copyright (c) 2010-2024 Jakub T. Jankiewicz <https://jcubic.pl/me>
* Released under the MIT license
*
* Contains:
*
* Storage plugin Distributed under the MIT License
* modified to work from Data URIs that block storage and cookies in Chrome
* Copyright (c) 2010 Dave Schindler
*
* jQuery Timers licenced with the WTFPL
* <http://jquery.offput.ca/timers/>
*
* Cross-Browser Split 1.1.1
* Copyright 2007-2012 Steven Levithan <stevenlevithan.com>
* Available under the MIT License
*
* jQuery Caret
* Copyright (c) 2009, Gideon Sireling
* 3 clause BSD License
*
* sprintf.js
* Copyright (c) 2007-2013 Alexandru Marasteanu <hello at alexei dot ro>
* licensed under 3 clause BSD license
*
* debounce function from Lodash
* Copyright JS Foundation and other contributors <https://js.foundation/>
* The MIT License
*
* emoji regex v9.0.0 by Mathias Bynens
* MIT license
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Tue, 08 Oct 2024 20:29:53 +0000
*/
(function(e){var m=function(){if(!m.cache.hasOwnProperty(arguments[0])){m.cache[arguments[0]]=m.parse(arguments[0])}return m.format.call(null,m.cache[arguments[0]],arguments)};m.format=function(e,t){var r=1,n=e.length,i="",a,u=[],o,s,l,f,c,p;for(o=0;o<n;o++){i=D(e[o]);if(i==="string"){u.push(e[o])}else if(i==="array"){l=e[o];if(l[2]){a=t[r];for(s=0;s<l[2].length;s++){if(!a.hasOwnProperty(l[2][s])){throw m('[sprintf] property "%s" does not exist',l[2][s])}a=a[l[2][s]]}}else if(l[1]){a=t[l[1]]}else{a=t[r++]}if(/[^s]/.test(l[8])&&D(a)!=="number"){throw m("[sprintf] expecting number but found %s",D(a))}switch(l[8]){case"b":a=a.toString(2);break;case"c":a=String.fromCharCode(a);break;case"d":a=parseInt(a,10);break;case"e":a=l[7]?a.toExponential(l[7]):a.toExponential();break;case"f":a=l[7]?parseFloat(a).toFixed(l[7]):parseFloat(a);break;case"o":a=a.toString(8);break;case"s":a=(a=String(a))&&l[7]?a.slice(0,l[7]):a;break;case"u":a=a>>>0;break;case"x":a=a.toString(16);break;case"X":a=a.toString(16).toUpperCase();break}a=/[def]/.test(l[8])&&l[3]&&a>=0?" +"+a:a;c=l[4]?l[4]==="0"?"0":l[4].charAt(1):" ";p=l[6]-String(a).length;f=l[6]?d(c,p):"";u.push(l[5]?a+f:f+a)}}return u.join("")};m.cache={};m.parse=function(e){var t=e,r=[],n=[],i=0;while(t){if((r=/^[^\x25]+/.exec(t))!==null){n.push(r[0])}else if((r=/^\x25{2}/.exec(t))!==null){n.push("%")}else if((r=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(t))!==null){if(r[2]){i|=1;var a=[],u=r[2],o=[];if((o=/^([a-z_][a-z_\d]*)/i.exec(u))!==null){a.push(o[1]);while((u=u.slice(o[0].length))!==""){if((o=/^\.([a-z_][a-z_\d]*)/i.exec(u))!==null){a.push(o[1])}else if((o=/^\[(\d+)\]/.exec(u))!==null){a.push(o[1])}else{throw"[sprintf] huh?"}}}else{throw"[sprintf] huh?"}r[2]=a}else{i|=2}if(i===3){throw"[sprintf] mixing positional and named placeholders is not (yet) supported"}n.push(r)}else{throw"[sprintf] huh?"}t=t.slice(r[0].length)}return n};var t=function(e,t,r){r=t.slice(0);r.splice(0,0,e);return m.apply(null,r)};function D(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function d(e,t){for(var r=[];t>0;r[--t]=e){}return r.join("")}e.sprintf=m;e.vsprintf=t})(typeof global!=="undefined"?global:self||window);(function(n,i){var r;if(typeof window!=="undefined"){r=window}else if(typeof self!=="undefined"){r=self}else if(typeof global!=="undefined"){r=global}else{throw new Error("Unknow context")}if(typeof define==="function"&&define.amd){define(["jquery","wcwidth"],function(e,t){n(e,t,r);return e})}else if(typeof module==="object"&&module.exports){module.exports=function(e,t,r){if(t===i){if(typeof window!=="undefined"){t=require("jquery")}else{t=require("jquery")(e)}}if(r===i){r=require("wcwidth")}n(t,r,e);return t}}else{if(!r.jQuery){r.$=r.cash}n(r.jQuery||r.cash,r.wcwidth,r)}})(function($,wcwidth,root,undefined){"use strict";function debug(e){if(false){console.log(e)}}function DelayQueue(){var t=$.Callbacks();var r=false;var e=this;this.resolve=function(){t.fire();e.resolved=r=true};this.add=function(e){if(r){e()}else{t.add(e)}}}$.omap=function(r,n){var i={};$.each(r,function(e,t){i[e]=n.call(r,e,t)});return i};$.fn.text_length=function(){return this.map(function(){return $(this).text().length}).get().reduce(function(e,t){return e+t},0)};var Clone={clone_object:function(e){var t={};if(typeof e==="object"){if(Array.isArray(e)){return this.clone_array(e)}else if(e===null){return e}else{for(var r in e){if(Array.isArray(e[r])){t[r]=this.clone_array(e[r])}else if(typeof e[r]==="object"){t[r]=this.clone_object(e[r])}else{t[r]=e[r]}}}}return t},clone_array:function(e){if(!is_function(Array.prototype.map)){throw new Error("Your browser don't support ES5 array map "+"use es5-shim")}return e.slice(0).map(function(e){if(typeof e==="object"){return this.clone_object(e)}else{return e}}.bind(this))}};var clone=function(e){return Clone.clone_object(e)};if("Map"in root&&!("clear"in Map.prototype)){Map.prototype.clear=function(){this.forEach(function(e,t,r){r.delete(t)})}}var localStorage;(function(){var e=function(){try{var e="test",t=window.loc
//# sourceMappingURL=jquery.terminal.min.js.map