ZwiiCMS/core/vendor/filemanager/js/tui-color-picker.js

9 lines
33 KiB
JavaScript
Raw Normal View History

2022-06-06 15:44:19 +02:00
/*!
* TOAST UI Color Picker
* @version 2.2.6
* @author NHN FE Development Team <dl_javascript@nhn.com>
* @license MIT
*/
2023-02-13 20:30:20 +01:00
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.colorPicker=e():(t.tui=t.tui||{},t.tui.colorPicker=e())}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},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="dist",n(n.s=33)}([function(t,e,n){"use strict";t.exports=function(t,e){var n,r,o,i,s=Object.prototype.hasOwnProperty;for(o=1,i=arguments.length;o<i;o+=1)for(r in n=arguments[o])s.call(n,r)&&(t[r]=n[r]);return t}},function(t,e,n){"use strict";t.exports=function(t){return t instanceof Array}},function(t,e,n){"use strict";var r=n(1),o=n(6),i=n(7);t.exports=function(t,e,n){r(t)?o(t,e,n):i(t,e,n)}},function(t,e,n){"use strict";t.exports=function(t){return void 0===t}},function(t,e,n){"use strict";var r=n(22),o=n(2),i=n(6),s=n(7),c=(n(37),0),a={getLength:function(t){var e=0;return s(t,(function(){e+=1})),e},map:function(t,e,n){var r=[];return o(t,(function(){r.push(e.apply(n||null,arguments))})),r},filter:function(t,e,n){var r=[];return i(t,(function(t){e.apply(n||null,arguments)&&r.push(t)})),r},generateId:function(){return c+=1},isOldBrowser:r.msie&&r.version<9,sendHostName:function(){}};t.exports=a},function(t,e,n){"use strict";var r=n(1);t.exports=function(t,e,n){var o,i;if(n=n||0,!r(e))return-1;if(Array.prototype.indexOf)return Array.prototype.indexOf.call(e,t,n);for(i=e.length,o=n;n>=0&&o<i;o+=1)if(e[o]===t)return o;return-1}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r=0,o=t.length;for(n=n||null;r<o&&!1!==e.call(n,t[r],r,t);r+=1);}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r;for(r in n=n||null,t)if(t.hasOwnProperty(r)&&!1===e.call(n,t[r],r,t))break}},function(t,e,n){"use strict";var r=n(39),o=n(13),i=n(41),s=n(3),c=n(9),a=n(19),l=n(4);function u(t,e){var n=l.generateId();t=t||{},s(e)&&(e=c.appendHTMLElement("div")),r(e,"tui-view-"+n),this.id=n,this.container=e,this.childs=new a((function(t){return t.id})),this.parent=null}u.prototype.addChild=function(t,e){e&&e.call(t,this),t.parent=this,this.childs.add(t)},u.prototype.removeChild=function(t,e){var n=i(t)?this.childs.items[t]:t;e&&e.call(n,this),this.childs.remove(n.id)},u.prototype.render=function(){this.childs.each((function(t){t.render()}))},u.prototype.recursive=function(t,e){o(t)&&(e||t(this),this.childs.each((function(e){e.recursive(t)})))},u.prototype.resize=function(){for(var t=Array.prototype.slice.call(arguments),e=this.parent;e;)o(e._onResize)&&e._onResize.apply(e,t),e=e.parent},u.prototype._beforeDestroy=function(){},u.prototype._destroy=function(){this._beforeDestroy(),this.container.innerHTML="",this.id=this.parent=this.childs=this.container=null},u.prototype.destroy=function(t){this.childs&&(this.childs.each((function(t){t.destroy(!0),t._destroy()})),this.childs.clear()),t||this._destroy()},u.prototype.getViewBound=function(){var t=this.container.getBoundingClientRect();return{x:t.left,y:t.top,width:t.right-t.left,height:t.bottom-t.top}},t.exports=u},function(t,e,n){"use strict";var r={appendHTMLElement:function(t,e,n){var r=document.createElement(t);return r.className=n||"",e?e.appendChild(r):document.body.appendChild(r),r}};t.exports=r},function(t,e,n){"use strict";var r=n(0),o=n(20),
// @license RGB <-> HSV conversion utilities based off of http://www.cs.rit.edu/~ncs/color/t_convert.html
hexToRGB:function(t){return!!o.isValidRGB(t)&&(t=t.substring(1),[parseInt(t.substr(0,2),16),parseInt(t.substr(2,2),16),parseInt(t.substr(4,2),16)])},rgbToHEX:function(t,e,n){var r="#"+o.leadingZero(t.toString(16),2)+o.leadingZero(e.toString(16),2)+o.leadingZero(n.toString(16),2);return!!o.isValidRGB(r)&&r},rgbToHSV:function(t,e,n){var r,o,i,s,c,a;if(t/=255,e/=255,n/=255,c=r=Math.max(t,e,n),a=r-(o=Math.min(t,e,n)),s=0===r?0:a/r,r===o)i=0;else{switch(r){case t:i=(e-n)/a+(e<n?6:0);break;case e:i=(n-t)/a+2;break;case n:i=(t-e)/a+4;break}i/=6}return[Math.round(360*i),Math.round(100*s),Math.round(100*c)]},hsvToRGB:function(t,e,n){var r,o,i,s,c,a,l,u;if(t=Math.max(0,Math.min(360,t)),e=Math.max(0,Math.min(100,e)),n=Math.max(0,Math.min(100,n)),n/=100,0===(e/=100))return r=o=i=n,[Math.round(255*r),Math.round(255*o),Math.round(255*i)];switch(a=n*(1-e),l=n*(1-e*(c=(t/=60)-(s=Math.floor(t)))),u=n*(1-e*(1-c)),s){case 0:r=n,o=u,i=a;break;case 1:r=l,o=n,i=a;break;case 2:r=a,o=n,i=u;break;case 3:r=a,o=l,i=n;break;case 4:r=u,o=a,i=n;break;default:r=n,o=a,i=l;break}return[Math.round(255*r),Math.round(255*o),Math.round(255*i)]}};t.exports=o},function(t,e,n){"use strict";t.exports=function(t){return t instanceof Function}},function(t,e,n){"use strict";var r=n(11),o=n(2),i=n(26);function s(t,e,n,r){function s(e){n.call(r||t,e||window.event)}"addEventListener"in t?t.addEventListener(e,s):"attachEvent"in t&&t.attachEvent("on"+e,s),function(t,e,n,r){var s=i(t,e),c=!1;o(s,(function(t){return t.handler!==n||(c=!0,!1)})),c||s.push({handler:n,wrappedHandler:r})}(t,e,n,s)}t.exports=function(t,e,n,i){r(e)?o(e.split(/\s+/g),(function(e){s(t,e,n,i)})):o(e,(function(e,r){s(t,r,e,n)}))}},function(t,e,n){"use strict";t.exports=function(t){t.preventDefault?t.preventDefault():t.returnValue=!1}},function(t,e,n){"use strict";t.exports=function(t){return t.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}))}},function(t,e,n){"use strict";var r=n(11),o=n(2),i=n(26);function s(t,e,n){var r,s=i(t,e);n?(o(s,(function(o,i){return n!==o.handler||(c(t,e,o.wrappedHandler),r=i,!1)})),s.splice(r,1)):(o(s,(function(n){c(t,e,n.wrappedHandler)})),s.splice(0,s.length))}function c(t,e,n){"removeEventListener"in t?t.removeEventListener(e,n):"detachEvent"in t&&t.detachEvent("on"+e,n)}t.exports=function(t,e,n){r(e)?o(e.split(/\s+/g),(function(e){s(t,e,n)})):o(e,(function(e,n){s(t,n,e)}))}},function(t,e,n){"use strict";var r=n(50);t.exports=function(t,e){var n=r(e.prototype);n.constructor=t,t.prototype=n}},function(t,e,n){"use strict";var r=n(6),o=n(7),i=n(0),s=n(1),c=n(20),a=n(13),l=n(21),u=n(4),f=Array.prototype.slice;function p(t){this.items={},this.length=0,a(t)&&(this.getItemID=t)}p.and=function(t){var e;return t=f.call(arguments),e=t.length,function(n){for(var r=0;r<e;r+=1)if(!t[r].call(null,n))return!1;return!0}},p.or=function(t){var e;return t=f.call(arguments),e=t.length,function(n){for(var r=1,o=t[0].call(null,n);r<e;r+=1)o=o||t[r].call(null,n);return o}},p.merge=function(t){var e={},n=new p(t.getItemID);return r(arguments,(function(t){i(e,t.items)})),n.items=e,n.length=u.getLength(n.items),n},p.prototype.getItemID=function(t){return t._id+""},p.prototype.add=function(t){var e,n;arguments.length>1?r(f.call(arguments),(function(t){this.add(t)}),this):(e=this.getItemID(t),(n=this.items)[e]||(this.length+=1),n[e]=t)},p.prototype.remove=function(t){var e,n,r=[];return this.length?arguments.length>1?(r=u.map(f.call(arguments),(function(t){return this.remove(t)}),this),r):(e=this.items,l(t)&&(t=this.getItemID(t)),e[t]?(this.length-=1,n=e[t],delete e[t],n):r):r},p.prototype.clear=function(){this.items={},this.length=0},p.prototype.has=function(t){var e,n;return!!this.length&&(e=a(t),n=!1,e?this.each((function(e){return!0!==t(e)||(n=!0,!1)})):(t=l(t)?this.getItemID(t):t,n=c(this.items[t])),n)},p.prototype.doWhenHas=function(t,e,n){var r=this.items[t];c(r)&&e.call(n||this,r)},p.prototype.find=function(t){var e=new p;return this.hasOwnProperty("getItemID")&&(e.getItemID=this.getItemID),this.each((function(n){!0===t(n)&&e.add(n)})),e},p.prototype.groupBy=function(t,e){va