mirror of
https://github.com/nuxsmin/sysPass.git
synced 2026-03-11 10:56:58 +01:00
22 lines
10 KiB
JavaScript
22 lines
10 KiB
JavaScript
var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(h,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");h!=Array.prototype&&h!=Object.prototype&&(h[b]=c.value)};$jscomp.getGlobal=function(h){return"undefined"!=typeof window&&window===h?h:"undefined"!=typeof global&&null!=global?global:h};$jscomp.global=$jscomp.getGlobal(this);
|
|
$jscomp.polyfill=function(h,b,c,e){if(b){c=$jscomp.global;h=h.split(".");for(e=0;e<h.length-1;e++){var a=h[e];a in c||(c[a]={});c=c[a]}h=h[h.length-1];e=c[h];b=b(e);b!=e&&null!=b&&$jscomp.defineProperty(c,h,{configurable:!0,writable:!0,value:b})}};$jscomp.polyfill("Object.setPrototypeOf",function(h){return h?h:"object"!=typeof"".__proto__?null:function(b,c){b.__proto__=c;if(b.__proto__!==c)throw new TypeError(b+" is not extensible");return b}},"es6","es5");
|
|
(function(h){"object"===typeof exports&&"undefined"!==typeof module?module.exports=h():"function"===typeof define&&define.amd?define([],h):("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:this).Clipboard=h()})(function(){return function b(c,e,a){function d(g,l){if(!e[g]){if(!c[g]){var f="function"==typeof require&&require;if(!l&&f)return f(g,!0);if(k)return k(g,!0);f=Error("Cannot find module '"+g+"'");throw f.code="MODULE_NOT_FOUND",f;}f=e[g]=
|
|
{exports:{}};c[g][0].call(f.exports,function(f){var a=c[g][1][f];return d(a?a:f)},f,f.exports,b,c,e,a)}return e[g].exports}for(var k="function"==typeof require&&require,l=0;l<a.length;l++)d(a[l]);return d}({1:[function(b,c,e){var a=b("matches-selector");c.exports=function(d,k,b){for(d=b?d:d.parentNode;d&&d!==document;){if(a(d,k))return d;d=d.parentNode}}},{"matches-selector":5}],2:[function(b,c,e){function a(a,b,g,c){return function(f){f.delegateTarget=d(f.target,b,!0);f.delegateTarget&&c.call(a,
|
|
f)}}var d=b("closest");c.exports=function(d,b,g,c,f){var m=a.apply(this,arguments);d.addEventListener(g,m,f);return{destroy:function(){d.removeEventListener(g,m,f)}}}},{closest:1}],3:[function(b,c,e){e.node=function(a){return void 0!==a&&a instanceof HTMLElement&&1===a.nodeType};e.nodeList=function(a){var d=Object.prototype.toString.call(a);return void 0!==a&&("[object NodeList]"===d||"[object HTMLCollection]"===d)&&"length"in a&&(0===a.length||e.node(a[0]))};e.string=function(a){return"string"===
|
|
typeof a||a instanceof String};e.fn=function(a){return"[object Function]"===Object.prototype.toString.call(a)}},{}],4:[function(b,c,e){function a(a,d,f){a.addEventListener(d,f);return{destroy:function(){a.removeEventListener(d,f)}}}function d(a,d,f){Array.prototype.forEach.call(a,function(a){a.addEventListener(d,f)});return{destroy:function(){Array.prototype.forEach.call(a,function(a){a.removeEventListener(d,f)})}}}var k=b("./is"),l=b("delegate");c.exports=function(g,b,f){if(!g&&!b&&!f)throw Error("Missing required arguments");
|
|
if(!k.string(b))throw new TypeError("Second argument must be a String");if(!k.fn(f))throw new TypeError("Third argument must be a Function");if(k.node(g))return a(g,b,f);if(k.nodeList(g))return d(g,b,f);if(k.string(g))return l(document.body,g,b,f);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");}},{"./is":3,delegate:2}],5:[function(b,c,e){b=Element.prototype;var a=b.matchesSelector||b.webkitMatchesSelector||b.mozMatchesSelector||b.msMatchesSelector||
|
|
b.oMatchesSelector;c.exports=function(d,b){if(a)return a.call(d,b);for(var c=d.parentNode.querySelectorAll(b),g=0;g<c.length;++g)if(c[g]==d)return!0;return!1}},{}],6:[function(b,c,e){c.exports=function(a){if("INPUT"===a.nodeName||"TEXTAREA"===a.nodeName)a.focus(),a.setSelectionRange(0,a.value.length),a=a.value;else{a.hasAttribute("contenteditable")&&a.focus();var d=window.getSelection(),b=document.createRange();b.selectNodeContents(a);d.removeAllRanges();d.addRange(b);a=d.toString()}return a}},{}],
|
|
7:[function(b,c,e){function a(){}a.prototype={on:function(a,b,c){var d=this.e||(this.e={});(d[a]||(d[a]=[])).push({fn:b,ctx:c});return this},once:function(a,b,c){function d(){e.off(a,d);b.apply(c,arguments)}var e=this;d._=b;return this.on(a,d,c)},emit:function(a){var d=[].slice.call(arguments,1),b=((this.e||(this.e={}))[a]||[]).slice(),c=0,e=b.length;for(c;c<e;c++)b[c].fn.apply(b[c].ctx,d);return this},off:function(a,b){var d=this.e||(this.e={}),c=d[a],e=[];if(c&&b)for(var f=0,m=c.length;f<m;f++)c[f].fn!==
|
|
b&&c[f].fn._!==b&&e.push(c[f]);e.length?d[a]=e:delete d[a];return this}};c.exports=a},{}],8:[function(b,c,e){(function(a,d){if("undefined"!==typeof e)d(c,b("select"));else{var k={exports:{}};d(k,a.select);a.clipboardAction=k.exports}})(this,function(a,b){var d=b&&b.__esModule?b:{"default":b},c="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"===typeof Symbol&&a.constructor===Symbol?"symbol":typeof a},e=function(){function a(a,
|
|
b){for(var d=0;d<b.length;d++){var c=b[d];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(a,c.key,c)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),p=function(){function a(b){if(!(this instanceof a))throw new TypeError("Cannot call a class as a function");this.resolveOptions(b);this.initSelection()}a.prototype.resolveOptions=function(){var a=0>=arguments.length||void 0===arguments[0]?{}:arguments[0];this.action=a.action;this.emitter=
|
|
a.emitter;this.target=a.target;this.text=a.text;this.trigger=a.trigger;this.selectedText=""};a.prototype.initSelection=function(){this.text?this.selectFake():this.target&&this.selectTarget()};a.prototype.selectFake=function(){var a=this,b="rtl"==document.documentElement.getAttribute("dir");this.removeFake();this.fakeHandlerCallback=function(){return a.removeFake()};this.fakeHandler=document.body.addEventListener("click",this.fakeHandlerCallback)||!0;this.fakeElem=document.createElement("textarea");
|
|
this.fakeElem.style.fontSize="12pt";this.fakeElem.style.border="0";this.fakeElem.style.padding="0";this.fakeElem.style.margin="0";this.fakeElem.style.position="absolute";this.fakeElem.style[b?"right":"left"]="-9999px";this.fakeElem.style.top=(window.pageYOffset||document.documentElement.scrollTop)+"px";this.fakeElem.setAttribute("readonly","");this.fakeElem.value=this.text;document.body.appendChild(this.fakeElem);this.selectedText=(0,d["default"])(this.fakeElem);this.copyText()};a.prototype.removeFake=
|
|
function(){this.fakeHandler&&(document.body.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandlerCallback=this.fakeHandler=null);this.fakeElem&&(document.body.removeChild(this.fakeElem),this.fakeElem=null)};a.prototype.selectTarget=function(){this.selectedText=(0,d["default"])(this.target);this.copyText()};a.prototype.copyText=function(){var a=void 0;try{a=document.execCommand(this.action)}catch(n){a=!1}this.handleResult(a)};a.prototype.handleResult=function(a){a?this.emitter.emit("success",
|
|
{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)}):this.emitter.emit("error",{action:this.action,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})};a.prototype.clearSelection=function(){this.target&&this.target.blur();window.getSelection().removeAllRanges()};a.prototype.destroy=function(){this.removeFake()};e(a,[{key:"action",set:function(){this._action=0>=arguments.length||void 0===arguments[0]?"copy":arguments[0];if("copy"!==
|
|
this._action&&"cut"!==this._action)throw Error('Invalid "action" value, use either "copy" or "cut"');},get:function(){return this._action}},{key:"target",set:function(a){if(void 0!==a)if(a&&"object"===("undefined"===typeof a?"undefined":c(a))&&1===a.nodeType){if("copy"===this.action&&a.hasAttribute("disabled"))throw Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(a.hasAttribute("readonly")||a.hasAttribute("disabled")))throw Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');
|
|
this._target=a}else throw Error('Invalid "target" value, use a valid Element');},get:function(){return this._target}}]);return a}();a.exports=p})},{select:6}],9:[function(b,c,e){(function(a,d){if("undefined"!==typeof e)d(c,b("./clipboard-action"),b("tiny-emitter"),b("good-listener"));else{var k={exports:{}};d(k,a.clipboardAction,a.tinyEmitter,a.goodListener);a.clipboard=k.exports}})(this,function(a,b,c,e){function d(a){return a&&a.__esModule?a:{"default":a}}function k(a,b){if("function"!==typeof b&&
|
|
null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function f(a,b){var c="data-clipboard-"+a;if(b.hasAttribute(c))return b.getAttribute(c)}var l=d(b);b=d(c);var n=d(e);e=function(a){function b(c,d){if(!(this instanceof b))throw new TypeError("Cannot call a class as a function");
|
|
var e;e=a.call(this);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");e=!e||"object"!==typeof e&&"function"!==typeof e?this:e;e.resolveOptions(d);e.listenClick(c);return e}k(b,a);b.prototype.resolveOptions=function(){var a=0>=arguments.length||void 0===arguments[0]?{}:arguments[0];this.action="function"===typeof a.action?a.action:this.defaultAction;this.target="function"===typeof a.target?a.target:this.defaultTarget;this.text="function"===typeof a.text?
|
|
a.text:this.defaultText};b.prototype.listenClick=function(a){var b=this;this.listener=(0,n["default"])(a,"click",function(a){return b.onClick(a)})};b.prototype.onClick=function(a){a=a.delegateTarget||a.currentTarget;this.clipboardAction&&(this.clipboardAction=null);this.clipboardAction=new l["default"]({action:this.action(a),target:this.target(a),text:this.text(a),trigger:a,emitter:this})};b.prototype.defaultAction=function(a){return f("action",a)};b.prototype.defaultTarget=function(a){if(a=f("target",
|
|
a))return document.querySelector(a)};b.prototype.defaultText=function(a){return f("text",a)};b.prototype.destroy=function(){this.listener.destroy();this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)};return b}(b["default"]);a.exports=e})},{"./clipboard-action":8,"good-listener":4,"tiny-emitter":7}]},{},[9])(9)});
|