­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ /*! For license information please see editor.js.LICENSE.txt */ (()=>{var t,e={5988:(t,e,i)=>{"use strict";var n=i(1481),r=i.n(n),s=i(3453),o=i(9922);function a(t,e){for(var i=0;i=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==i.return||i.return()}finally{if(a)throw s}}}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i2&&void 0!==arguments[2]?arguments[2]:"error",n=e?e.end.offset2&&void 0!==arguments[2]?arguments[2]:"rgba(0, 0, 0, 0)";return Array.isArray(t)&&(t={r:t[0],g:t[1],b:t[2],a:t[3]}),"hex"==i?e(t):"rgb"==i?n(t,s):"hsl"==i?r(t):t}function e(t){Array.isArray(t)&&(t={r:t[0],g:t[1],b:t[2],a:t[3]});var e=t.r.toString(16);t.r<16&&(e="0"+e);var i=t.g.toString(16);t.g<16&&(i="0"+i);var n=t.b.toString(16);t.b<16&&(n="0"+n);var r="";if(t.a<1){var s=Math.floor(255*t.a);r=s.toString(16),s<16&&(r="0"+r)}return"#"+e+i+n+r}function n(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"rgba(0, 0, 0, 0)";if(Array.isArray(t)&&(t={r:t[0],g:t[1],b:t[2],a:t[3]}),void 0!==t)return 1==t.a||void 0===t.a?isNaN(t.r)?e:"rgb("+t.r+","+t.g+","+t.b+")":"rgba("+t.r+","+t.g+","+t.b+","+t.a+")"}function r(t){return Array.isArray(t)&&(t={r:t[0],g:t[1],b:t[2],a:t[3]}),1==t.a||void 0===t.a?"hsl("+t.h+","+t.s+"%,"+t.l+"%)":"hsla("+t.h+","+t.s+"%,"+t.l+"%,"+t.a+")"}var s={format:t,rgb:n,hsl:r,hex:e};function o(t,e){return e=void 0===e?1:e,Math.round(t*e)/e}function a(t){return t*Math.PI/180}function h(t){var e=180*t/Math.PI;return e<0&&(e=360+e),e}function l(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)+e*Math.cos(a(t))}function u(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)+e*Math.sin(a(t))}function c(t,e){return h(Math.atan2(e,t))}var f={round:o,radianToDegree:h,degreeToRadian:a,getXInCircle:l,getYInCircle:u,caculateAngle:c},p={aliceblue:"rgb(240, 248, 255)",antiquewhite:"rgb(250, 235, 215)",aqua:"rgb(0, 255, 255)",aquamarine:"rgb(127, 255, 212)",azure:"rgb(240, 255, 255)",beige:"rgb(245, 245, 220)",bisque:"rgb(255, 228, 196)",black:"rgb(0, 0, 0)",blanchedalmond:"rgb(255, 235, 205)",blue:"rgb(0, 0, 255)",blueviolet:"rgb(138, 43, 226)",brown:"rgb(165, 42, 42)",burlywood:"rgb(222, 184, 135)",cadetblue:"rgb(95, 158, 160)",chartreuse:"rgb(127, 255, 0)",chocolate:"rgb(210, 105, 30)",coral:"rgb(255, 127, 80)",cornflowerblue:"rgb(100, 149, 237)",cornsilk:"rgb(255, 248, 220)",crimson:"rgb(237, 20, 61)",cyan:"rgb(0, 255, 255)",darkblue:"rgb(0, 0, 139)",darkcyan:"rgb(0, 139, 139)",darkgoldenrod:"rgb(184, 134, 11)",darkgray:"rgb(169, 169, 169)",darkgrey:"rgb(169, 169, 169)",darkgreen:"rgb(0, 100, 0)",darkkhaki:"rgb(189, 183, 107)",darkmagenta:"rgb(139, 0, 139)",darkolivegreen:"rgb(85, 107, 47)",darkorange:"rgb(255, 140, 0)",darkorchid:"rgb(153, 50, 204)",darkred:"rgb(139, 0, 0)",darksalmon:"rgb(233, 150, 122)",darkseagreen:"rgb(143, 188, 143)",darkslateblue:"rgb(72, 61, 139)",darkslategray:"rgb(47, 79, 79)",darkslategrey:"rgb(47, 79, 79)",darkturquoise:"rgb(0, 206, 209)",darkviolet:"rgb(148, 0, 211)",deeppink:"rgb(255, 20, 147)",deepskyblue:"rgb(0, 191, 255)",dimgray:"rgb(105, 105, 105)",dimgrey:"rgb(105, 105, 105)",dodgerblue:"rgb(30, 144, 255)",firebrick:"rgb(178, 34, 34)",floralwhite:"rgb(255, 250, 240)",forestgreen:"rgb(34, 139, 34)",fuchsia:"rgb(255, 0, 255)",gainsboro:"rgb(220, 220, 220)",ghostwhite:"rgb(248, 248, 255)",gold:"rgb(255, 215, 0)",goldenrod:"rgb(218, 165, 32)",gray:"rgb(128, 128, 128)",grey:"rgb(128, 128, 128)",green:"rgb(0, 128, 0)",greenyellow:"rgb(173, 255, 47)",honeydew:"rgb(240, 255, 240)",hotpink:"rgb(255, 105, 180)",indianred:"rgb(205, 92, 92)",indigo:"rgb(75, 0, 130)",ivory:"rgb(255, 255, 240)",khaki:"rgb(240, 230, 140)",lavender:"rgb(230, 230, 250)",lavenderblush:"rgb(255, 240, 245)",lawngreen:"rgb(124, 252, 0)",lemonchiffon:"rgb(255, 250, 205)",lightblue:"rgb(173, 216, 230)",lightcoral:"rgb(240, 128, 128)",lightcyan:"rgb(224, 255, 255)",lightgoldenrodyellow:"rgb(250, 250, 210)",lightgreen:"rgb(144, 238, 144)",lightgray:"rgb(211, 211, 211)",lightgrey:"rgb(211, 211, 211)",lightpink:"rgb(255, 182, 193)",lightsalmon:"rgb(255, 160, 122)",lightseagreen:"rgb(32, 178, 170)",lightskyblue:"rgb(135, 206, 250)",lightslategray:"rgb(119, 136, 153)",lightslategrey:"rgb(119, 136, 153)",lightsteelblue:"rgb(176, 196, 222)",lightyellow:"rgb(255, 255, 224)",lime:"rgb(0, 255, 0)",limegreen:"rgb(50, 205, 50)",linen:"rgb(250, 240, 230)",magenta:"rgb(255, 0, 255)",maroon:"rgb(128, 0, 0)",mediumaquamarine:"rgb(102, 205, 170)",mediumblue:"rgb(0, 0, 205)",mediumorchid:"rgb(186, 85, 211)",mediumpurple:"rgb(147, 112, 219)",mediumseagreen:"rgb(60, 179, 113)",mediumslateblue:"rgb(123, 104, 238)",mediumspringgreen:"rgb(0, 250, 154)",mediumturquoise:"rgb(72, 209, 204)",mediumvioletred:"rgb(199, 21, 133)",midnightblue:"rgb(25, 25, 112)",mintcream:"rgb(245, 255, 250)",mistyrose:"rgb(255, 228, 225)",moccasin:"rgb(255, 228, 181)",navajowhite:"rgb(255, 222, 173)",navy:"rgb(0, 0, 128)",oldlace:"rgb(253, 245, 230)",olive:"rgb(128, 128, 0)",olivedrab:"rgb(107, 142, 35)",orange:"rgb(255, 165, 0)",orangered:"rgb(255, 69, 0)",orchid:"rgb(218, 112, 214)",palegoldenrod:"rgb(238, 232, 170)",palegreen:"rgb(152, 251, 152)",paleturquoise:"rgb(175, 238, 238)",palevioletred:"rgb(219, 112, 147)",papayawhip:"rgb(255, 239, 213)",peachpuff:"rgb(255, 218, 185)",peru:"rgb(205, 133, 63)",pink:"rgb(255, 192, 203)",plum:"rgb(221, 160, 221)",powderblue:"rgb(176, 224, 230)",purple:"rgb(128, 0, 128)",rebeccapurple:"rgb(102, 51, 153)",red:"rgb(255, 0, 0)",rosybrown:"rgb(188, 143, 143)",royalblue:"rgb(65, 105, 225)",saddlebrown:"rgb(139, 69, 19)",salmon:"rgb(250, 128, 114)",sandybrown:"rgb(244, 164, 96)",seagreen:"rgb(46, 139, 87)",seashell:"rgb(255, 245, 238)",sienna:"rgb(160, 82, 45)",silver:"rgb(192, 192, 192)",skyblue:"rgb(135, 206, 235)",slateblue:"rgb(106, 90, 205)",slategray:"rgb(112, 128, 144)",slategrey:"rgb(112, 128, 144)",snow:"rgb(255, 250, 250)",springgreen:"rgb(0, 255, 127)",steelblue:"rgb(70, 130, 180)",tan:"rgb(210, 180, 140)",teal:"rgb(0, 128, 128)",thistle:"rgb(216, 191, 216)",tomato:"rgb(255, 99, 71)",turquoise:"rgb(64, 224, 208)",violet:"rgb(238, 130, 238)",wheat:"rgb(245, 222, 179)",white:"rgb(255, 255, 255)",whitesmoke:"rgb(245, 245, 245)",yellow:"rgb(255, 255, 0)",yellowgreen:"rgb(154, 205, 50)",transparent:"rgba(0, 0, 0, 0)"};var _={isColorName:function(t){return!!p[t]},getColorByName:function(t){return p[t]}};function d(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function v(t,e,i){if(1==arguments.length){var n=arguments[0];t=n.h,e=n.s,i=n.l}var r,s,a;if(t/=360,i/=100,0==(e/=100))r=s=a=i;else{var h=i<.5?i*(1+e):i+e-i*e,l=2*i-h;r=d(l,h,t+1/3),s=d(l,h,t),a=d(l,h,t-1/3)}return{r:o(255*r),g:o(255*s),b:o(255*a)}}var k={HUEtoRGB:d,HSLtoHSV:function(t,e,i){if(1==arguments.length){var n=arguments[0];t=n.h,e=n.s,i=n.l}var r=v(t,e,i);return M(r.r,r.g,r.b)},HSLtoRGB:v},g=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},x=function(){function t(t,e){for(var i=0;i-1||e[n].indexOf("rgb")>-1||e[n].indexOf("hsl")>-1)i.push({color:e[n]});else{var s=_.getColorByName(e[n]);s&&i.push({color:e[n],nameColor:s})}var o={next:0};return i.forEach((function(e){var i=t.indexOf(e.color,o.next);e.startIndex=i,e.endIndex=i+e.color.length,o.next=e.endIndex})),i}function I(t){var e=S(t);return e.forEach((function(e,i){t=t.replace(e.color,"@"+i)})),{str:t,matches:e}}function O(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",",i=I(t);return i.str.split(e).map((function(t,e){return t=N(t),i.matches[e]&&(t=t.replace("@"+e,i.matches[e].color)),t}))}function L(t,e){return e.forEach((function(e,i){t=t.replace("@"+i,e.color)})),t}function N(t){return t.replace(/^\s+|\s+$/g,"")}function R(t){if("string"==typeof t){if(_.isColorName(t)&&(t=_.getColorByName(t)),t.indexOf("rgb(")>-1){for(var e=0,i=(r=t.replace("rgb(","").replace(")","").split(",")).length;e-1){for(e=0,i=(r=t.replace("rgba(","").replace(")","").split(",")).length;e-1){for(e=0,i=(r=t.replace("hsl(","").replace(")","").split(",")).length;e-1){for(e=0,i=(r=t.replace("hsla(","").replace(")","").split(",")).length;e>16,g:(65280&t)>>8,b:255&t,a:1},Object.assign(n,U(n));if(0<=t&&t<=4294967295)return n={type:"hex",r:(4278190080&t)>>24,g:(16711680&t)>>16,b:(65280&t)>>8,a:(255&t)/255},Object.assign(n,U(n))}return t}function w(t){"string"==typeof t&&(t=O(t));var e=(t=t.map((function(t){if("string"==typeof t){var e=I(t),i=N(e.str).split(" ");return i[1]?i[1].includes("%")?i[1]=parseFloat(i[1].replace(/%/,""))/100:i[1]=parseFloat(i[1]):i[1]="*",i[0]=L(i[0],e.matches),i}if(Array.isArray(t))return t[1]?"string"==typeof t[1]&&(t[1].includes("%")?t[1]=parseFloat(t[1].replace(/%/,""))/100:t[1]=+t[1]):t[1]="*",[].concat(A(t))}))).filter((function(t){return"*"===t[1]})).length;if(e>0){var i=(1-t.filter((function(t){return"*"!=t[1]&&1!=t[1]})).map((function(t){return t[1]})).reduce((function(t,e){return t+e}),0))/e;t.forEach((function(e,n){"*"==e[1]&&n>0&&(t.length-1==n||(e[1]=i))}))}return t}var D={matches:S,convertMatches:I,convertMatchesArray:O,reverseMatches:L,parse:R,parseGradient:w,trim:N,color_regexp:$,color_split:","};function M(t,e,i){if(1==arguments.length){var n=arguments[0];t=n.r,e=n.g,i=n.b}var r=t/255,s=e/255,o=i/255,a=Math.max(r,s,o),h=a-Math.min(r,s,o),l=0;return 0==h?l=0:a==r?l=(s-o)/h%6*60:a==s?l=60*((o-r)/h+2):a==o&&(l=60*((r-s)/h+4)),l<0&&(l=360+l),{h:l,s:0==a?0:h/a,v:a}}function U(t,e,i){if(1==arguments.length){var n=arguments[0];t=n.r,e=n.g,i=n.b}t/=255,e/=255,i/=255;var r,s,a=Math.max(t,e,i),h=Math.min(t,e,i),l=(a+h)/2;if(a==h)r=s=0;else{var u=a-h;switch(s=l>.5?u/(2-a-h):u/(a+h),a){case t:r=(e-i)/u+(e(arguments.length>1&&void 0!==arguments[1]?arguments[1]:.04045)?Math.pow((t+.055)/1.055,2.4):t/12.92)}function G(t,e,i){if(1==arguments.length){var n=arguments[0];t=n.r,e=n.g,i=n.b}var r=t/255,s=e/255,o=i/255;return{x:.4124*(r=H(r))+.3576*(s=H(s))+.1805*(o=H(o)),y:.2126*r+.7152*s+.0722*o,z:.0193*r+.1192*s+.9505*o}}var V={RGBtoCMYK:function(t,e,i){if(1==arguments.length){var n=arguments[0];t=n.r,e=n.g,i=n.b}var r=t/255,s=e/255,o=i/255,a=1-Math.max(r,s,o);return{c:(1-r-a)/(1-a),m:(1-s-a)/(1-a),y:(1-o-a)/(1-a),k:a}},RGBtoGray:function(t,e,i){if(1==arguments.length){var n=arguments[0];t=n.r,e=n.g,i=n.b}return P(F(t,e,i).y)},RGBtoHSL:U,RGBtoHSV:M,RGBtoLAB:function(t,e,i){if(1==arguments.length){var n=arguments[0];t=n.r,e=n.g,i=n.b}return XYZtoLAB(G(t,e,i))},RGBtoSimpleGray:function(t,e,i){if(1==arguments.length){var n=arguments[0];t=n.r,e=n.g,i=n.b}return P(Math.ceil((t+e+i)/3))},RGBtoXYZ:G,RGBtoYCrCb:F,c:function(t,e,i){if(1==arguments.length){var n=arguments[0];t=n.r,e=n.g,i=n.b}return P((t+e+i)/3>90?0:255)},brightness:B,gray:P};var j={CMYKtoRGB:function(t,e,i,n){if(1==arguments.length){var r=arguments[0];t=r.c,e=r.m,i=r.y,n=r.k}return{r:255*(1-t)*(1-n),g:255*(1-e)*(1-n),b:255*(1-i)*(1-n)}}};function Y(t){return Math.pow(t,3)>.008856?Math.pow(t,3):(t-16/116)/7.787}function W(t){return t>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t}function Q(t,e,i){if(1==arguments.length){var n=arguments[0];t=n.x,e=n.y,i=n.z}var r=t/100,s=e/100,a=i/100,h=3.2406*r+-1.5372*s+-.4986*a,l=-.9689*r+1.8758*s+.0415*a,u=.0557*r+-.204*s+1.057*a;return h=W(h),l=W(l),u=W(u),{r:o(255*h),g:o(255*l),b:o(255*u)}}function z(t,e,i){if(1==arguments.length){var n=arguments[0];t=n.l,e=n.a,i=n.b}var r=(t+16)/116,s=e/500+r,o=r-i/200;return r=Y(r),{x:95.047*(s=Y(s)),y:100*r,z:108.883*(o=Y(o))}}var X={XYZtoRGB:Q,LABtoRGB:function(t,e,i){if(1==arguments.length){var n=arguments[0];t=n.l,e=n.a,i=n.b}return Q(z(t,e,i))},LABtoXYZ:z};function K(t,e,i){if(1==arguments.length){var n=arguments[0];t=n.h,e=n.s,i=n.v}var r=t,s=i;r>=360&&(r=0);var a=e*s,h=a*(1-Math.abs(r/60%2-1)),l=s-a,u=[];return 0<=r&&r<60?u=[a,h,0]:60<=r&&r<120?u=[h,a,0]:120<=r&&r<180?u=[0,a,h]:180<=r&&r<240?u=[0,h,a]:240<=r&&r<300?u=[h,0,a]:300<=r&&r<360&&(u=[a,0,h]),{r:o(255*(u[0]+l)),g:o(255*(u[1]+l)),b:o(255*(u[2]+l))}}var q={HSVtoHSL:function(t,e,i){if(1==arguments.length){var n=arguments[0];t=n.h,e=n.s,i=n.v}var r=K(t,e,i);return U(r.r,r.g,r.b)},HSVtoRGB:K};var J={YCrCbtoRGB:function(t,e,i,n){if(1==arguments.length){var r=arguments[0];t=r.y,e=r.cr,i=r.cb,n=(n=r.bit)||0}var s=t+1.402*(e-n),o=t-.344*(i-n)-.714*(e-n),a=t+1.772*(i-n);return{r:Math.ceil(s),g:Math.ceil(o),b:Math.ceil(a)}}};function Z(e,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.5,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"hex",s={r:o(e.r+(i.r-e.r)*n),g:o(e.g+(i.g-e.g)*n),b:o(e.b+(i.b-e.b)*n),a:o(e.a+(i.a-e.a)*n,100)};return t(s,s.a<1?"rgb":r)}function tt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if(!t)return[];"string"==typeof t&&(t=O(t));for(var i=(t=t||[]).length,n=[],r=0;r2&&void 0!==arguments[2]?arguments[2]:.5,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"hex";return Z(R(t),R(e),i,n)}function it(t){return t=R(t),(Math.round(299*t.r)+Math.round(587*t.g)+Math.round(114*t.b))/1e3}function nt(e){for(var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"h",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:9,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"rgb",s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:100,h=M(R(e)),l=(o-s)*a/n,u=[],c=1;c<=n;c++)h[i]=Math.abs((a-l*c)/a),u.push(t(K(h),r));return u}tt.parula=function(t){return tt(["#352a87","#0f5cdd","#00b5a6","#ffc337","#fdff00"],t)},tt.jet=function(t){return tt(["#00008f","#0020ff","#00ffff","#51ff77","#fdff00","#ff0000","#800000"],t)},tt.hsv=function(t){return tt(["#ff0000","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff","#ff0000"],t)},tt.hot=function(t){return tt(["#0b0000","#ff0000","#ffff00","#ffffff"],t)},tt.pink=function(t){return tt(["#1e0000","#bd7b7b","#e7e5b2","#ffffff"],t)},tt.bone=function(t){return tt(["#000000","#4a4a68","#a6c6c6","#ffffff"],t)},tt.copper=function(t){return tt(["#000000","#3d2618","#9d623e","#ffa167","#ffc77f"],t)};var rt={interpolateRGB:Z,blend:et,mix:function(t,e){return et(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:.5,arguments.length>3&&void 0!==arguments[3]?arguments[3]:"hex")},scale:tt,contrast:it,contrastColor:function(t){return it(t)>=128?"black":"white"},gradient:function(t){for(var e=[],i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:10)-((t=w(t)).length-1),n=i,r=1,s=t.length;r1&&void 0!==arguments[1]?arguments[1]:9,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgb",arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,arguments.length>4&&void 0!==arguments[4]?arguments[4]:360,1)},scaleS:function(t){return nt(t,"s",arguments.length>1&&void 0!==arguments[1]?arguments[1]:9,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgb",arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,100)},scaleV:function(t){return nt(t,"v",arguments.length>1&&void 0!==arguments[1]?arguments[1]:9,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgb",arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,100)}};function st(t,e){if(t.length!==e.length)return!1;for(var i=0,n=t.length;i0?lt(a):e[Math.floor(s()*e.length)],h),n[o]=l}return r}function ft(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"linear";e=e||Math.max(2,Math.ceil(Math.sqrt(t.length/2)));var s=i||"euclidean";"string"==typeof s&&(s=ot[s]);for(var o=0,a=function(){return(o=(9301*o+49297)%233280)/233280},h=function(t,e){return at[arguments.length>2&&void 0!==arguments[2]?arguments[2]:"linear"](t.length,e).map((function(e){return t[e]}))}(t,e,r),l=!0,u=0;l&&(l=ct(e,t,ut(e,t,h,s),h,!1,a),++u%n!=0););return h}var pt={create:function(t,e){var i=document.createElement("canvas");return i.width=t||0,i.height=e||0,i},drawPixels:function(t){var e=this.create(t.width,t.height),i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height);return n.data.set(t.pixels),i.putImageData(n,0,0),e},createHistogram:function(t,e,i,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{black:!0,red:!1,green:!1,blue:!1},s=this.create(t,e),o=s.getContext("2d");o.clearRect(0,0,t,e),o.fillStyle="white",o.fillRect(0,0,t,e),o.globalAlpha=.7;var a={black:!1};r.black?a.black=!1:a.black=!0,r.red?a.red=!1:a.red=!0,r.green?a.green=!1:a.green=!0,r.blue?a.blue=!1:a.blue=!0,Object.keys(i).forEach((function(n){if(!a[n]){var r=i[n],s=Math.max.apply(Math,r),h=t/r.length;o.fillStyle=n,r.forEach((function(t,i){var n=e*(t/s),r=i*h;o.fillRect(r,e-n,h,n)}))}})),"function"==typeof n&&n(s)},getHistogram:function(t){for(var e=new Array(256),i=new Array(256),n=new Array(256),r=new Array(256),s=0;s<256;s++)e[s]=0,i[s]=0,n[s]=0,r[s]=0;return function(t,e){!function(t,e){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};g(this,t),this.isLoaded=!1,this.imageUrl=e,this.opt=i,this.initialize()}return x(t,[{key:"initialize",value:function(){this.canvas=this.createCanvas(),this.context=this.canvas.getContext("2d")}},{key:"createCanvas",value:function(){return document.createElement("canvas")}},{key:"load",value:function(t){this.loadImage(t)}},{key:"loadImage",value:function(t){var e=this,i=this.context;this.newImage=new Image;var n=this.newImage;n.onload=function(){var r=n.height/n.width;e.opt.canvasWidth&&e.opt.canvasHeight?(e.canvas.width=e.opt.canvasWidth,e.canvas.height=e.opt.canvasHeight):(e.canvas.width=e.opt.maxWidth?e.opt.maxWidth:n.width,e.canvas.height=e.canvas.width*r),i.drawImage(n,0,0,n.width,n.height,0,0,e.canvas.width,e.canvas.height),e.isLoaded=!0,t&&t()},this.getImageUrl((function(t){n.src=t}))}},{key:"load",value:function(t){var e=this;this.newImage=new Image;var i=this.newImage;i.onload=function(){e.isLoaded=!0,t&&t()},this.getImageUrl((function(t){i.src=t}))}},{key:"getImageUrl",value:function(t){if("string"==typeof this.imageUrl)return t(this.imageUrl);if(this.imageUrl instanceof Blob){var e=new FileReader;e.onload=function(e){t(e.target.result)},e.readAsDataURL(this.imageUrl)}}},{key:"getRGBA",value:function(t,e,i,n){return[t,e,i,n]}},{key:"toArray",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this.context.getImageData(0,0,this.canvas.width,this.canvas.height),r=n.width,s=n.height;t||(t=function(t,e){e(t)}),t({pixels:new Uint8ClampedArray(n.data),width:r,height:s},(function(t){var n=pt.drawPixels(t);"canvas"==i.returnTo?e(n):e(n.toDataURL(i.outputFormat||"image/png"))}),i)}},{key:"toHistogram",value:function(t){var e=this.context.getImageData(0,0,this.canvas.width,this.canvas.height),i=e.width,n=e.height,r={pixels:new Uint8ClampedArray(e.data),width:i,height:n};return pt.getHistogram(r)}},{key:"toRGB",value:function(){for(var t=this.context.getImageData(0,0,this.canvas.width,this.canvas.height).data,e=[],i=0,n=t.length;i0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return[t=t||0===t?t:1,0,0,0,e=e||0===e?e:1,0,0,0,1]},scaleX:function(t){return this.scale(t)},scaleY:function(t){return this.scale(1,t)},translate:function(t,e){return[1,0,t,0,1,e,0,0,1]},rotate:function(t){var e=this.radian(t);return[Math.cos(e),-Math.sin(e),0,Math.sin(e),Math.cos(e),0,0,0,1]},rotate90:function(){return[0,-1,0,1,0,0,0,0,1]},rotate180:function(){return[-1,0,0,0,-1,0,0,0,1]},rotate270:function(){return[0,1,0,-1,0,0,0,0,1]},radian:function(t){return t*Math.PI/180},skew:function(t,e){var i=this.radian(t),n=this.radian(e);return[1,Math.tan(i),0,Math.tan(n),1,0,0,0,1]},skewX:function(t){var e=this.radian(t);return[1,Math.tan(e),0,0,1,0,0,0,1]},skewY:function(t){var e=this.radian(t);return[1,0,0,Math.tan(e),1,0,0,0,1]},shear1:function(t){return[1,-Math.tan(this.radian(t)/2),0,0,1,0,0,0,1]},shear2:function(t){return[1,0,0,Math.sin(this.radian(t)),1,0,0,0,1]}},vt={CONSTANT:dt,radian:function(t){return dt.radian(t)},multiply:function(t,e){return[t[0]*e[0]+t[1]*e[1]+t[2]*e[2],t[3]*e[0]+t[4]*e[1]+t[5]*e[2],t[6]*e[0]+t[7]*e[1]+t[8]*e[2]]},identity:function(t){return this.multiply(dt.identity(),t)},translate:function(t,e,i){return this.multiply(dt.translate(t,e),i)},rotate:function(t,e){return this.multiply(dt.rotate(t),e)},shear1:function(t,e){return this.multiply(dt.shear1(t),e)},shear2:function(t,e){return this.multiply(dt.shear2(t),e)},rotateShear:function(t,e){var i=e;return i=this.shear1(t,i),i=this.shear2(t,i),this.shear1(t,i)}};function kt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"center",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"center";return function(n,r){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=Yt(n.pixels.length,n.width,n.height),a=n.width,h=n.height;"center"==e&&(e=Math.floor(a/2)),"center"==i&&(i=Math.floor(h/2));var l=vt.CONSTANT.translate(-e,-i),u=vt.CONSTANT.translate(e,i),c=vt.CONSTANT.shear1(t),f=vt.CONSTANT.shear2(t);te((function(t,e,i,r){var s=vt.multiply(l,[i,r,1]);s=vt.multiply(c,s).map(Math.round),s=vt.multiply(f,s).map(Math.round),s=vt.multiply(c,s).map(Math.round),s=vt.multiply(u,s);var o=C(s,2),p=o[0],_=o[1];p<0||_<0||p>a-1||_>h-1||ne(t,_*a+p<<2,n.pixels,e)}))(o,(function(){r(o)}),s)}}function gt(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=zt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:200);return qt("\n // refer to Color.brightness \n const v = ($C * Math.ceil($r * 0.2126 + $g * 0.7152 + $b * 0.0722) ) >= $scale ? 255 : 0;\n\n if ($hasColor) {\n\n if (v == 0) {\n $r = 0 \n $g = 0 \n $b = 0\n }\n \n } else {\n const value = Math.round(v)\n $r = value \n $g = value \n $b = value \n }\n \n ",{$C:(t=zt(t))/100,$scale:i,$hasColor:e})}function xt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return re(Ft([1,2,1,2,4,2,1,2,1],1/16*((t=zt(t))/100)))}function yt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return re(Ft([1,4,6,4,1,4,16,24,16,4,6,24,36,24,6,4,16,24,16,4,1,4,6,4,1],1/256*((t=zt(t))/100)))}function Tt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return t=zt(t),re([5,5,5,-3,0,-3,-3,-3,-3])}function mt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return t=zt(t),re([5,-3,-3,5,0,-3,5,-3,-3])}function bt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return re(Ft([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,24,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],(t=zt(t))/100))}function Et(){return re(Ft([1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1],1/9))}function Ct(){return re(Ft([1,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,1],1/9))}function At(){return re(Ft([1,0,0,0,1,0,0,0,1,0,1,0,0,1,0,0,1,0,0,0,1,0,1,0,1,0,0,0,0,0,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,0,0,0,0,0,1,0,1,0,1,0,0,0,1,0,0,1,0,0,1,0,1,0,0,0,1,0,0,0,1],1/9))}function $t(){return re([-1,-2,-1,0,0,0,1,2,1])}function St(){return re([-1,0,1,-2,0,2,-1,0,1])}var It=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],Ot=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function Lt(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}function Nt(t,e,i,n){if(isNaN(n)||n<1)return t;n|=0;var r,s,o,a,h,l,u,c,f,p,_,d,v,k,g,x,y,T,m,b,E,C,A,$,S=t.pixels,I=t.width,O=t.height,L=n+n+1,N=I-1,R=O-1,w=n+1,D=w*(w+1)/2,M=new Lt,U=M;for(o=1;o>G,0!=A?(A=255/A,S[l]=(c*H>>G)*A,S[l+1]=(f*H>>G)*A,S[l+2]=(p*H>>G)*A):S[l]=S[l+1]=S[l+2]=0,c-=d,f-=v,p-=k,_-=g,d-=B.r,v-=B.g,k-=B.b,g-=B.a,a=u+((a=r+n+1)>G,A>0?(A=255/A,S[a]=(c*H>>G)*A,S[a+1]=(f*H>>G)*A,S[a+2]=(p*H>>G)*A):S[a]=S[a+1]=S[a+2]=0,c-=d,f-=v,p-=k,_-=g,d-=B.r,v-=B.g,k-=B.b,g-=B.a,a=r+((a=s+w)>P,E[l+1]=f*U>>P,E[l+2]=p*U>>P,c-=_,f-=d,p-=v,_-=D.r,d-=D.g,v-=D.b,a=u+((a=r+n+1)>P,E[a+1]=f*U>>P,E[a+2]=p*U>>P,c-=_,f-=d,p-=v,_-=D.r,d-=D.g,v-=D.b,a=r+((a=s+O)0&&void 0!==arguments[0]?arguments[0]:10,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t=zt(t),function(i,n){n(function(t,e,i){return i?Nt(t,0,0,e):stackBlurCanvasRGB(t,0,0,e)}(i,t,e))}}function wt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:256;return re(Ft([1,4,6,4,1,4,16,24,16,4,6,24,-476,24,6,4,16,24,16,4,1,4,6,4,1],-1/(t=zt(t))))}var Dt,Mt=T({},{crop:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments[2],n=arguments[3],r=Yt(i*n*4,i,n);return function(s,o){for(var a=e,h=0;a0&&void 0!==arguments[0]?arguments[0]:0;return t=zt(t),t%=360,function(e,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0==t)return e;if(90==t||270==t)var r=Yt(e.pixels.length,e.height,e.width);else{if(180!=t)return kt(t)(e,i,n);r=Yt(e.pixels.length,e.width,e.height)}te((function(i,n,s,o){if(90==t)var a=s*r.width+(r.width-1-o)<<2;else 270==t?a=(r.height-1-s)*r.width+o<<2:180==t&&(a=(r.height-1-o)*r.width+(r.width-1-s)<<2);ne(r.pixels,a,e.pixels,n)}))(e,(function(){i(r)}),n)}},rotateDegree:kt,histogram:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"gray",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=[],n=0;n2&&void 0!==arguments[2]?arguments[2]:100},{$darkColor:Ve.parse(t),$lightColor:Ve.parse(e)})},brightness:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return t=zt(t),qt("\n $r += $C \n $g += $C \n $b += $C \n ",{$C:Math.floor(t/100*255)})},brownie:function(){return qt("\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a \n ",{$matrix:[.5997023498159715,.34553243048391263,-.2708298674538042,0,-.037703249837783157,.8609577587992641,.15059552388459913,0,.24113635128153335,-.07441037908422492,.44972182064877153,0,0,0,0,1]})},clip:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t=zt(t),qt("\n\n $r = ($r > 255 - $C) ? 255 : 0\n $g = ($g > 255 - $C) ? 255 : 0\n $b = ($b > 255 - $C) ? 255 : 0\n\n ",{$C:2.55*Math.abs(t)})},contrast:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t=zt(t),qt("\n $r *= $C\n $g *= $C\n $b *= $C\n ",{$C:Math.max((128+t)/128,0)})},gamma:function(){return qt("\n $r = Math.pow($r / 255, $C) * 255\n $g = Math.pow($g / 255, $C) * 255\n $b = Math.pow($b / 255, $C) * 255\n ",{$C:zt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1)})},gradient:function(){var t=[].concat(Array.prototype.slice.call(arguments));1===t.length&&"string"==typeof t[0]&&(t=Ve.convertMatchesArray(t[0]));var e=(t=t.map((function(t){return Ve.matches(t).length?{type:"param",value:t}:{type:"scale",value:t}}))).filter((function(t){return"scale"==t.type}))[0];e=e?+e.value:256,t=t.filter((function(t){return"param"==t.type})).map((function(t){return t.value})).join(",");var i=Ve.gradient(t,e).map((function(t){var e=Ve.parse(t);return{r:e.r,g:e.g,b:e.b,a:e.a}}));return qt("\n const colorIndex = clamp(Math.ceil($r * 0.2126 + $g * 0.7152 + $b * 0.0722))\n const newColorIndex = clamp(Math.floor(colorIndex * ($scale / 256)))\n const color = $colors[newColorIndex]\n\n $r = color.r \n $g = color.g \n $b = color.b \n $a = clamp(Math.floor(color.a * 256))\n ",{},{$colors:i,$scale:e})},grayscale:function(t){var e=(t=zt(t))/100;return e>1&&(e=1),qt("\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a\n ",{$matrix:[.2126+.7874*(1-e),.7152-.7152*(1-e),.0722-.0722*(1-e),0,.2126-.2126*(1-e),.7152+.2848*(1-e),.0722-.0722*(1-e),0,.2126-.2126*(1-e),.7152-.7152*(1-e),.0722+.9278*(1-e),0,0,0,0,1]})},hue:function(){return qt("\n var hsv = Color.RGBtoHSV($r, $g, $b);\n\n // 0 ~ 360 \n var h = hsv.h;\n h += Math.abs($C)\n h = h % 360\n hsv.h = h\n\n var rgb = Color.HSVtoRGB(hsv);\n\n $r = rgb.r\n $g = rgb.g\n $b = rgb.b\n ",{$C:zt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:360)})},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return qt("\n $r = (255 - $r) * $C\n $g = (255 - $g) * $C\n $b = (255 - $b) * $C\n ",{$C:(t=zt(t))/100})},kodachrome:function(){return qt("\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a \n ",{$matrix:[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,0,0,0,1]})},matrix:function(){return qt("\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a \n ",{$matrix:[arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,arguments.length>15&&void 0!==arguments[15]?arguments[15]:0]})},noise:function(){return qt("\n const C = Math.abs($C) * 5\n const min = -C\n const max = C \n const noiseValue = Math.round(min + (Math.random() * (max - min)))\n\n $r += noiseValue\n $g += noiseValue\n $b += noiseValue\n ",{$C:zt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1)})},opacity:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return qt("\n $a *= $C \n ",{$C:(t=zt(t))/100})},polaroid:function(){return qt("\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a \n ",{$matrix:[1.438,-.062,-.062,0,-.122,1.378,-.122,0,-.016,-.016,1.483,0,0,0,0,1]})},saturation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,e=(t=zt(t))/100,i=1-Math.abs(e);return qt("\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a \n ",{$matrix:[i,0,0,0,0,i,0,0,0,0,i,0,0,0,0,i]})},sepia:function(){var t=zt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1);return t>1&&(t=1),qt("\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a \n ",{$matrix:[.393+.607*(1-t),.769-.769*(1-t),.189-.189*(1-t),0,.349-.349*(1-t),.686+.314*(1-t),.168-.168*(1-t),0,.272-.272*(1-t),.534-.534*(1-t),.131+.869*(1-t),0,0,0,0,1]})},shade:function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return qt("\n $r *= $redValue\n $g *= $greenValue\n $b *= $blueValue\n ",{$redValue:zt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1),$greenValue:zt(t),$blueValue:zt(e)})},shift:function(){return qt("\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a \n ",{$matrix:[1.438,-.062,-.062,0,-.122,1.378,-.122,0,-.016,-.016,1.483,0,0,0,0,1]})},solarize:function(t,e,i){return qt("\n $r = ($r < $redValue) ? 255 - $r: $r\n $g = ($g < $greenValue) ? 255 - $g: $g\n $b = ($b < $blueValue) ? 255 - $b: $b\n ",{$redValue:zt(t),$greenValue:zt(e),$blueValue:zt(i)})},technicolor:function(){return qt("\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a \n ",{$matrix:[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-.231103377548616,-.7501899197440212,1.847597816108189,0,0,0,0,1]})},threshold:function(){return gt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:200,arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,!1)},"threshold-color":gt,tint:function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return qt("\n\n $r += (255 - $r) * $redTint\n $g += (255 - $g) * $greenTint\n $b += (255 - $b) * $blueTint\n\n ",{$redTint:zt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1),$greenTint:zt(t),$blueTint:zt(e)})}},{blur:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;return re(ee(t=zt(t)))},emboss:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4;return re([-2*(t=zt(t)),-t,0,-t,1,t,0,t,2*t])},gaussianBlur:xt,"gaussian-blur":xt,gaussianBlur5x:yt,"gaussian-blur-5x":yt,grayscale2:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return re(Ft([.3,.3,.3,0,0,.59,.59,.59,0,0,.11,.11,.11,0,0,0,0,0,0,0,0,0,0,0,0],(t=zt(t))/100))},normal:function(){return re([0,0,0,0,1,0,0,0,0])},kirschHorizontal:Tt,"kirsch-horizontal":Tt,kirschVertical:mt,"kirsch-vertical":mt,laplacian:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return re(Ft([-1,-1,-1,-1,8,-1,-1,-1,-1],(t=zt(t))/100))},laplacian5x:bt,"laplacian-5x":bt,motionBlur:Et,"motion-blur":Et,motionBlur2:Ct,"motion-blur-2":Ct,motionBlur3:At,"motion-blur-3":At,negative:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return re(Ft([-1,0,0,0,0,0,-1,0,0,0,0,0,-1,0,0,0,0,0,1,0,1,1,1,1,1],(t=zt(t))/100))},sepia2:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return re(Ft([.393,.349,.272,0,0,.769,.686,.534,0,0,.189,.168,.131,0,0,0,0,0,0,0,0,0,0,0,0],(t=zt(t))/100))},sharpen:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return re(Ft([0,-1,0,-1,5,-1,0,-1,0],(t=zt(t))/100))},sobelHorizontal:$t,"sobel-horizontal":$t,sobelVertical:St,"sobel-vertical":St,stackBlur:Rt,"stack-blur":Rt,transparency:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return re(Ft([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,.3,0,0,0,0,0,1],(t=zt(t))/100))},unsharpMasking:wt,"unsharp-masking":wt},{kirsch:function(){return he("kirsch-horizontal kirsch-vertical")},sobel:function(){return he("sobel-horizontal sobel-vertical")},vintage:function(){return he("brightness(15) saturation(-20) gamma(1.8)")}}),Ut=0,Pt=(y(Dt={partial:fe,multi:ue,merge:ce,weight:Ft,repeat:Ht,colorMatrix:function(t,e,i){var n=t[e],r=t[e+1],s=t[e+2],o=t[e+3];ie(t,e,i[0]*n+i[1]*r+i[2]*s+i[3]*o,i[4]*n+i[5]*r+i[6]*s+i[7]*o,i[8]*n+i[9]*r+i[10]*s+i[11]*o,i[12]*n+i[13]*r+i[14]*s+i[15]*o)},each:Vt,eachXY:jt,createRandomCount:function(){return[9,16,25,36,49,64,81,100].sort((function(t,e){return.5-Math.random()}))[0]},createRandRange:function(t,e,i){for(var n=[],r=1;r<=i;r++){var s=Math.random()*(e-t)+t,o=Math.floor(10*Math.random())%2==0?-1:1;n.push(o*s)}n.sort();var a=Math.floor(i>>1),h=n[a];return n[a]=n[0],n[0]=h,n},createBitmap:Yt,createBlurMatrix:ee,pack:function(t){return function(e,i){Vt(e.pixels.length,(function(i,n){t(e.pixels,i,n,e.pixels[i],e.pixels[i+1],e.pixels[i+2],e.pixels[i+3])}),(function(){i(e)}))}},packXY:te,pixel:qt,getBitmap:Wt,putBitmap:Qt,radian:function(t){return vt.CONSTANT.radian(t)},convolution:re,parseParamNumber:zt,filter:he,clamp:ae,fillColor:ie,fillPixelColor:ne},"multi",ue),y(Dt,"merge",ce),y(Dt,"matches",se),y(Dt,"parseFilter",oe),y(Dt,"partial",fe),Dt),Bt=Pt;function Ft(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t.map((function(t){return t*e}))}function Ht(t,e){for(var i=new Array(e),n=0;n2&&void 0!==arguments[2]?arguments[2]:1,i=arguments[3],n=arguments[4],r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1e4,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"full",o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:50,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,h=function(t){setTimeout(t,0)};function l(){for(var s=function(){var t=[].concat(A(Array(arguments.length>0&&void 0!==arguments[0]?arguments[0]:50))).map((function(t){return"cri = ri + i * s; if (cri >= mx) return {currentRunIndex: cri, i: null}; c(cri); i++;"})).join("\n");return new Function("ri","i","s","mx","c","\n let cri = ri;\n \n "+t+"\n \n return {currentRunIndex: cri, i: i} \n ")}(o),u=a,c={},f=0;f=t?n():h?h(l):l()}(u)}"requestAnimationFrame"==s&&(h=requestAnimationFrame,r=1e3),"full"==s&&(h=null,r=t),l()}function Vt(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};Gt(t,0,4,(function(t){e(t,t>>2)}),(function(){i()}),n.functionDumpCount,n.frameTimer,n.loopCount)}function jt(t,e,i,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};Gt(t,0,4,(function(t){var n=t>>2;i(t,n%e,Math.floor(n/e))}),(function(){n()}),r.functionDumpCount,r.frameTimer,r.loopCount)}function Yt(t,e,i){return{pixels:new Uint8ClampedArray(t),width:e,height:i}}function Wt(t,e){return pt.getBitmap(t,e)}function Qt(t,e,i){return pt.putBitmap(t,e,i)}function zt(t){return"string"==typeof t&&(t=(t=t.replace(/deg/,"")).replace(/px/,"")),+t}var Xt=/(([\w_\-]+)(\(([^\)]*)\))?)+/gi;function Kt(t){return e={},i=[{callback:t,context:arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},rootContext:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}}].map((function(t){var i=[];Object.keys(t.context).forEach((function(t,e){i[t]="n$"+Ut+++t+"$"})),Object.keys(t.rootContext).forEach((function(n,r){i[n]="r$"+Ut+++n+"$",e[i[n]]=t.rootContext[n]}));var n=Object.keys(t.context).filter((function(e){return"number"!=typeof t.context[e]&&"string"!=typeof t.context[e]&&(!Array.isArray(t.context[e])||"number"!=typeof t.context[e][0]&&"string"!=typeof t.context[e][0])})).map((function(e,n){return[i[e],JSON.stringify(t.context[e])].join(" = ")})),r=t.callback;return"function"==typeof t.callback&&((r=t.callback.toString().split("{")).shift(),(r=(r=r.join("{")).split("}")).pop(),r=r.join("}")),Object.keys(i).forEach((function(e){var n=i[e];"number"==typeof t.context[e]||"string"==typeof t.context[e]?r=r.replace(new RegExp("\\"+e,"g"),t.context[e]):!Array.isArray(t.context[e])||"number"!=typeof t.context[e][0]&&"string"!=typeof t.context[e][0]?r=r.replace(new RegExp("\\"+e,"g"),n):t.context[e].forEach((function(t,i){r=r.replace(new RegExp("\\"+e+"\\["+i+"\\]","g"),t)}))})),{preCallbackString:r,preContext:n}})),n=i.map((function(t,e){return t.preContext.length?"const "+t.preContext+";":""})).join("\n\n"),r=i.map((function(t){return t.preCallbackString})).join("\n\n"),(s=new Function("$pixels","$pixelIndex","$clamp","$Color"," \n let $r = $pixels[$pixelIndex], $g = $pixels[$pixelIndex+1], $b = $pixels[$pixelIndex+2], $a = $pixels[$pixelIndex+3];\n\n "+n+"\n\n "+r+"\n \n $pixels[$pixelIndex] = $r\n $pixels[$pixelIndex+1] = $g \n $pixels[$pixelIndex+2] = $b \n $pixels[$pixelIndex+3] = $a \n ")).$preCallbackString=r,s.$preContext=n,s.rootContextObject=e,s;var e,i,n,r,s}function qt(t){var e=Kt(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),i=function(t,e){};return i.userFunction=e,i}var Jt=[0,1,2,3];function Zt(t,e,i){Jt.forEach((function(n){var r=t[e+n];t[e+n]=t[i+n],t[i+n]=r}))}function te(t){return function(e,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};jt(e.pixels.length,e.width,(function(i,n,r){t(e.pixels,i,n,r)}),(function(){i(e)}),n)}}function ee(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,e=Math.pow(t,2);return Ht(1/e,e)}function ie(t,e,i,n,r,s){if(3==arguments.length){var o=arguments[2];i=o.r,n=o.g,r=o.b,s=o.a}"number"==typeof i&&(t[e]=i),"number"==typeof n&&(t[e+1]=n),"number"==typeof r&&(t[e+2]=r),"number"==typeof s&&(t[e+3]=s)}function ne(t,e,i,n){ie(t,e,i[n],i[n+1],i[n+2],i[n+3])}function re(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=function(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:255;return e=t.map((function(t,e){return[]})),t.forEach((function(t,r){if(0!=t){var s=e[r];for(r=i;r<=n;r++)s[r]=t*r}})),e}(t);return function(n,r){var s=Math.round(Math.sqrt(t.length)),o=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=t.width+e,n=t.height+e;return{pixels:new Uint8ClampedArray(i*n*4),width:i,height:n}}(n,2*s);!function(t,e,i,n){for(var r=e.pixels.length/4,s=0,o=0,a=0,h=0,l=0,u=0,c=0;ct.width||o>t.height||(l=h*e.width+a<<2,u=o*t.width+s<<2,t.pixels[u]=e.pixels[l],t.pixels[u+1]=e.pixels[l+1],t.pixels[u+2]=e.pixels[l+2],t.pixels[u+3]=e.pixels[l+3])}(o,n,s,s);for(var a=Yt(o.pixels.length,o.width,o.height),h=Yt(n.pixels.length,n.width,n.height),l=function(t,e,i,n,r){var s=Math.round(Math.sqrt(t.length)),o=Math.floor(s/2),a=r?1:0,h="let r = 0, g = 0, b = 0, a = 0, scy = 0, scx =0, si = 0; ",l=[],u=[],c=[],f=[];t.forEach((function(t,e){var n=Math.floor(e/s)-o,r=e%s-o;0!=t&&(l.push("$t["+e+"][$sp[(($sy + ("+n+")) * "+i+" + ($sx + ("+r+"))) * 4]]"),u.push("$t["+e+"][$sp[(($sy + ("+n+")) * "+i+" + ($sx + ("+r+"))) * 4 + 1]]"),c.push("$t["+e+"][$sp[(($sy + ("+n+")) * "+i+" + ($sx + ("+r+"))) * 4 + 2]]"),f.push("$t["+e+"][$sp[(($sy + ("+n+")) * "+i+" + ($sx + ("+r+"))) * 4 + 3]]"))})),h+="r = "+l.join(" + ")+"; g = "+u.join(" + ")+"; b = "+c.join(" + ")+"; a = "+f.join(" + ")+";",h+="$dp[$di] = r; $dp[$di+1] = g;$dp[$di+2] = b;$dp[$di+3] = a + ("+a+")*(255-a); ";var p=new Function("$dp","$sp","$di","$sx","$sy","$t",h);return function(t,i,n,r,s){p(t,i,n,r,s,e)}}(t,i,o.width,o.height,e),u=n.pixels.length/4,c=0;c>2,s=0,o=0,a=0,h=0,l=0,u=0,c=0;ct.width||o>t.height||(l=o*t.width+s<<2,u=h*e.width+a<<2,e.pixels[u]=t.pixels[l],e.pixels[u+1]=t.pixels[l+1],e.pixels[u+2]=t.pixels[l+2],e.pixels[u+3]=t.pixels[l+3])})(a,h,s,s),r(h)}}function se(t){var e=Ve.convertMatches(t),i=e.str.match(Xt),n=[];if(!i)return n;n=i.map((function(t){return{filter:t,origin:Ve.reverseMatches(t,e.matches)}}));var r={next:0};return n.map((function(e){var i=t.indexOf(e.origin,r.next);return e.startIndex=i,e.endIndex=i+e.origin.length,e.arr=oe(e.origin),r.next=e.endIndex,e})).filter((function(t){return!!t.arr.length}))}function oe(t){var e=Ve.convertMatches(t),i=e.str.match(Xt);if(!i[0])return[];var n=i[0].split("("),r=n.shift(),s=[];return n.length&&(s=n.shift().split(")")[0].split(",").map((function(t){return Ve.reverseMatches(t,e.matches)}))),[r].concat(A(s)).map(Ve.trim)}function ae(t){return Math.min(255,t)}function he(t){return ce(se(t).map((function(t){return t.arr})))}function le(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=[],i=[],n=0,r=t.length;n2&&void 0!==arguments[2]?arguments[2]:{},s=t,o=0;function a(){e[o].call(null,s,(function(t){s=t,++o>=n?i(s):a()}),r)}a()}}function ce(t){return ue.apply(void 0,A(t))}function fe(t){for(var e=null,i=arguments.length,n=Array(i>1?i-1:0),r=1;r2&&void 0!==arguments[2]?arguments[2]:{};e(Wt(i,t),(function(e){n(Qt(i,e,t))}),r)}}function pe(t){return"string"==typeof t&&(t=(t=t.replace(/deg/,"")).replace(/px/,"")),+t}function _e(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t.map((function(t){return t*e}))}var de=0;function ve(t){return[].concat(Array.prototype.slice.call(arguments))}function ke(t){return{type:"convolution",length:t.length,content:t}}function ge(t,e){return"\n if (u_filterIndex == "+e+".0) {\n "+t+"\n }\n "}function xe(t,e){return{type:"shader",index:de,options:e,content:ge(t,de++)}}function ye(t){return"\n \n if (u_kernelSelect == "+t+".0) {\n vec4 colorSum = "+function(t){var e=Math.sqrt(t),i=Math.floor(e/2);return[].concat(A(Array(t))).map((function(n,r){var s=Math.floor(r/e)-i;return"texture(u_image, v_texCoord + onePixel * vec2("+(r%e-i)+", "+s+")) * u_kernel"+t+"["+r+"]"})).join(" + \n")}(t)+"; \n\n outColor = vec4((colorSum / u_kernel"+t+"Weight).rgb, 1);\n \n }\n "}function Te(t){return"vec4("+(t=[t.r/255,t.g/255,t.b/255,t.a||0].map(me))+")"}function me(t){return t==Math.floor(t)?t+".0":t}function be(){return ke(_e([1,2,1,2,4,2,1,2,1],pe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1)*(1/16)))}function Ee(){return ke([1,4,6,4,1,4,16,24,16,4,6,24,36,24,6,4,16,24,16,4,1,4,6,4,1])}function Ce(){return ke([5,5,5,-3,0,-3,-3,-3,-3])}function Ae(){return ke([5,-3,-3,5,0,-3,5,-3,-3])}function $e(){return ke([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,24,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1])}function Se(){return ke([1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1])}function Ie(){return ke([1,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,1])}function Oe(){return ke([1,0,0,0,1,0,0,0,1,0,1,0,0,1,0,0,1,0,0,0,1,0,1,0,1,0,0,0,0,0,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,0,0,0,0,0,1,0,1,0,1,0,0,0,1,0,0,1,0,0,1,0,1,0,0,0,1,0,0,0,1])}function Le(){return ke([-1,-2,-1,0,0,0,1,2,1])}function Ne(){return ke([-1,0,1,-2,0,2,-1,0,1])}function Re(){return ke(_e([1,4,6,4,1,4,16,24,16,4,6,24,-476,24,6,4,16,24,16,4,1,4,6,4,1],-1/256))}function we(){var t=[arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,arguments.length>15&&void 0!==arguments[15]?arguments[15]:0].map(me);return xe("\n\n outColor = vec4(\n "+t[0]+" * pixelColor.r + "+t[1]+" * pixelColor.g + "+t[2]+" * pixelColor.b + "+t[3]+" * pixelColor.a,\n "+t[4]+" * pixelColor.r + "+t[5]+" * pixelColor.g + "+t[6]+" * pixelColor.b + "+t[7]+" * pixelColor.a,\n "+t[8]+" * pixelColor.r + "+t[9]+" * pixelColor.g + "+t[10]+" * pixelColor.b + "+t[11]+" * pixelColor.a,\n "+t[12]+" * pixelColor.r + "+t[13]+" * pixelColor.g + "+t[14]+" * pixelColor.b + "+t[15]+" * pixelColor.a\n ); \n ")}function De(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return xe("\n float c = ( (pixelColor.r * 0.2126 + pixelColor.g * 0.7152 + pixelColor.b * 0.0722) ) >= "+(t=me(pe(t)))+" ? 1.0 : 0.0;\n\n outColor = vec4(c, c, c, pixelColor.a);\n ")}var Me=T({},{blur:function(){return ke([1,1,1,1,1,1,1,1,1])},normal:function(){return ke([0,0,0,0,1,0,0,0,0])},emboss:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4;return ke([-2*(t=pe(t)),-t,0,-t,1,t,0,t,2*t])},gaussianBlur:be,"gaussian-blur":be,gaussianBlur5x:Ee,"gaussian-blur-5x":Ee,grayscale2:function(){return ke([.3,.3,.3,0,0,.59,.59,.59,0,0,.11,.11,.11,0,0,0,0,0,0,0,0,0,0,0,0])},kirschHorizontal:Ce,"kirsch-horizontal":Ce,kirschVertical:Ae,"kirsch-vertical":Ae,laplacian:function(){return ke([-1,-1,-1,-1,8,-1,-1,-1,-1])},laplacian5x:$e,"laplacian-5x":$e,motionBlur:Se,"motion-blur":Se,motionBlur2:Ie,"motion-blur-2":Ie,motionBlur3:Oe,"motion-blur-3":Oe,negative:function(){return ke([-1,0,0,0,0,0,-1,0,0,0,0,0,-1,0,0,0,0,0,1,0,1,1,1,1,1])},sepia2:function(){return ke([.393,.349,.272,0,0,.769,.686,.534,0,0,.189,.168,.131,0,0,0,0,0,0,0,0,0,0,0,0])},sharpen:function(){return ke([0,-1,0,-1,5,-1,0,-1,0])},sobelHorizontal:Le,"sobel-horizontal":Le,sobelVertical:Ne,"sobel-vertical":Ne,transparency:function(){return ke([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,.3,0,0,0,0,0,1])},unsharpMasking:Re,"unsharp-masking":Re},{bitonal:function(t,e){var i=me(arguments.length>2&&void 0!==arguments[2]?arguments[2]:.5),n=Te(Ve.parse(t));return xe("\n if ((pixelColor.r + pixelColor.g + pixelColor.b) > "+i+") {\n outColor = vec4("+Te(Ve.parse(e))+".rgb, pixelColor.a);\n } else {\n outColor = vec4("+n+".rgb, pixelColor.a);\n }\n ")},brightness:function(){return xe("\n outColor = pixelColor + ("+me(pe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1))+");\n ")},brownie:function(){return we(.5997023498159715,.34553243048391263,-.2708298674538042,0,-.037703249837783157,.8609577587992641,.15059552388459913,0,.24113635128153335,-.07441037908422492,.44972182064877153,0,0,0,0,1)},clip:function(){var t=me(pe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0));return xe("\n outColor = vec4(\n (pixelColor.r > 1.0 - "+t+") ? 1.0 : 0.0,\n (pixelColor.g > 1.0 - "+t+") ? 1.0 : 0.0,\n (pixelColor.b > 1.0 - "+t+") ? 1.0 : 0.0,\n pixelColor.a \n );\n ")},chaos:function(){return xe("\n vec2 st = pixelColor.st;\n st *= "+me(pe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:10))+";\n \n vec2 ipos = floor(st); // get the integer coords\n\n vec3 color = vec3(random( ipos ));\n\n outColor = vec4(color, pixelColor.a);\n ")},contrast:function(){return xe("\n outColor = pixelColor * "+me(pe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1))+";\n ")},gamma:function(){var t=me(pe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1));return xe("\n outColor = vec4(pow(pixelColor.r, "+t+"), pow(pixelColor.g, "+t+"), pow(pixelColor.b, "+t+"), pixelColor.a );\n ")},gradient:function(){var t=[].concat(Array.prototype.slice.call(arguments));1===t.length&&"string"==typeof t[0]&&(t=Ve.convertMatchesArray(t[0])),t=t.map((function(t){return t})).join(", ");var e=Ve.parseGradient(t);e[0][1]=0,e[e.length-1][1]=1,e=e.map((function(t){var e=Ve.parse(t[0]);return[{r:e.r,g:e.g,b:e.b,a:e.a},t[1]]}));for(var i=[],n=0,r=e.length;n0&&void 0!==arguments[0]?arguments[0]:1);return t>1&&(t=1),we(.2126+.7874*(1-t),.7152-.7152*(1-t),.0722-.0722*(1-t),0,.2126-.2126*(1-t),.7152+.2848*(1-t),.0722-.0722*(1-t),0,.2126-.2126*(1-t),.7152-.7152*(1-t),.0722+.9278*(1-t),0,0,0,0,1)},hue:function(){return xe("\n vec3 hsv = rgb2hsv(pixelColor.rgb);\n hsv.x += "+me(pe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1))+";\n outColor = vec4(hsv2rgb(hsv).rgb, pixelColor.a);\n ")},invert:function(){var t=me(pe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1));return xe("\n outColor = vec4(\n (1.0 - pixelColor.r) * "+t+",\n (1.0 - pixelColor.g) * "+t+",\n (1.0 - pixelColor.b) * "+t+",\n pixelColor.a\n );\n ")},kodachrome:function(){return we(1.1285582396593525,-.3967382283601348,-.03992559172921793,0,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,0,0,0,1)},matrix:we,noise:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=Math.abs(pe(t)),i=me(-e);return xe("\n float rnd = "+i+" + random( pixelColor.st ) * ("+me(e)+" - "+i+");\n\n outColor = vec4(pixelColor.rgb + rnd, 1.0);\n ")},opacity:function(){return xe("\n outColor = vec4(pixelColor.rgb, pixelColor.a * "+me(pe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1))+");\n ")},polaroid:function(){return we(1.438,-.062,-.062,0,-.122,1.378,-.122,0,-.016,-.016,1.483,0,0,0,0,1)},saturation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=1-Math.abs(pe(t));return we(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,e)},sepia:function(){var t=pe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1);return t>1&&(t=1),we(.393+.607*(1-t),.769-.769*(1-t),.189-.189*(1-t),0,.349-.349*(1-t),.686+.314*(1-t),.168-.168*(1-t),0,.272-.272*(1-t),.534-.534*(1-t),.131+.869*(1-t),0,0,0,0,1)},shade:function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return xe("\n outColor = vec4(\n pixelColor.r * "+me(pe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1)/255)+",\n pixelColor.g * "+me(pe(t)/255)+",\n pixelColor.b * "+me(pe(e)/255)+",\n pixelColor.a\n );\n ")},shift:function(){return we(1.438,-.062,-.062,0,-.122,1.378,-.122,0,-.016,-.016,1.483,0,0,0,0,1)},solarize:function(t,e,i){return xe("\n outColor = vec4(\n (pixelColor.r < "+me(pe(t))+") ? 1.0 - pixelColor.r: pixelColor.r,\n (pixelColor.g < "+me(pe(e))+") ? 1.0 - pixelColor.g: pixelColor.g,\n (pixelColor.b < "+me(pe(i))+") ? 1.0 - pixelColor.b: pixelColor.b,\n pixelColor.a\n );\n ")},technicolor:function(){return we(1.9125277891456083,-.8545344976951645,-.09155508482755585,0,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-.231103377548616,-.7501899197440212,1.847597816108189,0,0,0,0,1)},threshold:function(){return De(arguments.length>0&&void 0!==arguments[0]?arguments[0]:200,arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,!1)},"threshold-color":De,tint:function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return xe("\n outColor = vec4(\n pixelColor.r += (1 - pixelColor.r) * "+pe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)+",\n pixelColor.g += (1 - pixelColor.g) * "+pe(t)+",\n pixelColor.b += (1 - pixelColor.b) * "+pe(e)+",\n pixelColor.a\n );\n ")}},{kirsch:function(){return ve("kirsch-horizontal kirsch-vertical")},sobel:function(){return ve("sobel-horizontal sobel-vertical")},vintage:function(){return ve("brightness(0.15) saturation(-0.2) gamma(1.8)")}}),Ue=0,Pe=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{width:"400px",height:"300px"};g(this,t),this.img=e.img,this.width=parseFloat(this.img.width||e.width||"400px"),this.height=parseFloat(this.img.height||e.height||"300px"),this.init()}return x(t,[{key:"resize",value:function(){this.canvas.width=this.width,this.canvas.height=this.height,this.canvas.style.width=this.width+"px",this.canvas.style.height=this.height+"px",this.viewport()}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=this.gl;r.clearColor(t,e,i,n),r.clear(r.COLOR_BUFFER_BIT|r.DEPTH_BUFFER_BIT)}},{key:"viewport",value:function(t,e,i,n){var r=this.gl;r.viewport(t||0,e||0,i||r.canvas.width,n||r.canvas.height)}},{key:"initCanvas",value:function(t,e){if(this.canvas=document.createElement("canvas"),this.gl=this.canvas.getContext("webgl2"),!this.gl)throw new Error("you need webgl2 support");this.program=this.createProgram(t,e),this.resize(),this.initBuffer()}},{key:"draw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"TRIANGLES",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:6,n=this.gl;n.drawArrays(n[t],e,i)}},{key:"triangles",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6;this.draw("TRIANGLES",t,e)}},{key:"uniform2f",value:function(){for(var t,e=arguments.length,i=Array(e),n=0;n2&&void 0!==arguments[2]?arguments[2]:"STATIC_DRAW",n=this.gl;this.buffers[t]||(this.buffers[t]=n.createBuffer()),n.bindBuffer(n.ARRAY_BUFFER,this.buffers[t]),e&&n.bufferData(n.ARRAY_BUFFER,new Float32Array(e),n[i])}},{key:"enable",value:function(t){this.gl.enableVertexAttribArray(this.locations[t])}},{key:"location",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"attribute";"attribute"===e?this.locations[t]=this.gl.getAttribLocation(this.program,t):"uniform"===e&&(this.locations[t]=this.gl.getUniformLocation(this.program,t))}},{key:"a",value:function(t){return this.location(t)}},{key:"u",value:function(t){return this.location(t,"uniform")}},{key:"pointer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"FLOAT",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=this.gl;o.vertexAttribPointer(this.locations[t],i,o[e],n,r,s)}},{key:"bufferData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=this.gl;e.bufferData(e.ARRAY_BUFFER,new Float32Array(t),e.STATIC_DRAW)}},{key:"isPowerOf2",value:function(t){return!(t&t-1)}},{key:"bindTexture",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"RGBA",r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"RGBA",s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"UNSIGNED_BYTE",o=this.gl;1!=arguments.length?(this.textures[t]||(this.textures[t]=o.createTexture()),this.textureIndex[t]=Ue++,o.bindTexture(o.TEXTURE_2D,this.textures[t]),this.setTextureParameter(),o.texImage2D(o.TEXTURE_2D,i,o[n],o[r],o[s],e.newImage||e)):o.bindTexture(o.TEXTURE_2D,this.textures[t])}},{key:"bindColorTexture",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:256,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"RGBA",o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"RGBA",a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"UNSIGNED_BYTE",h=this.gl;this.textures[t]||(this.textures[t]=h.createTexture()),this.textureIndex[t]=Ue++,h.bindTexture(h.TEXTURE_2D,this.textures[t]),this.setTextureParameter(),h.texImage2D(h.TEXTURE_2D,r,h[s],i,n,0,h[o],h[a],new Uint8Array(e))}},{key:"bindEmptyTexture",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"RGBA",s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"RGBA",o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"UNSIGNED_BYTE",a=this.gl;this.textures[t]||(this.textures[t]=a.createTexture()),this.textureIndex[t]=Ue++,a.bindTexture(a.TEXTURE_2D,this.textures[t]),this.setTextureParameter();a.texImage2D(a.TEXTURE_2D,n,a[r],e,i,0,a[s],a[o],null)}},{key:"setTextureParameter",value:function(){var t=this.gl;t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST)}},{key:"bindFrameBufferWithTexture",value:function(t,e,i,n){this.bindEmptyTexture(e,i,n),this.bindFrameBuffer(t,e)}},{key:"enumToString",value:function(t){var e=this.gl;if(0===t)return"NONE";for(var i in e)if(e[i]===t)return i;return"0x"+t.toString(16)}},{key:"bindFrameBuffer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=this.gl;if(1!==arguments.length){this.framebuffers[t]||(this.framebuffers[t]=i.createFramebuffer()),i.bindFramebuffer(i.FRAMEBUFFER,this.framebuffers[t]);var n=i.COLOR_ATTACHMENT0;i.framebufferTexture2D(i.FRAMEBUFFER,n,i.TEXTURE_2D,this.textures[e],0),i.checkFramebufferStatus(i.FRAMEBUFFER),i.FRAMEBUFFER_COMPLETE}else i.bindFramebuffer(i.FRAMEBUFFER,null==t?null:this.framebuffers[t])}},{key:"bindVA",value:function(){var t=this.gl;this.vao||(this.vao=t.createVertexArray()),t.bindVertexArray(this.vao)}},{key:"bindAttr",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"STATIC_DRAW",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;this.bindBuffer(t,e,i),this.enable(t),this.pointer(t,"FLOAT",n)}},{key:"initBuffer",value:function(){var t=this.canvas,e=t.width,i=t.height;this.a("a_position"),this.a("a_texCoord"),this.u("u_resolution"),this.u("u_image"),this.u("u_flipY"),this.u("u_kernelSelect"),this.u("u_filterIndex"),this.u("u_kernel9[0]"),this.u("u_kernel9Weight"),this.u("u_kernel25[0]"),this.u("u_kernel25Weight"),this.u("u_kernel49[0]"),this.u("u_kernel49Weight"),this.u("u_kernel81[0]"),this.u("u_kernel81Weight"),this.bindVA(),this.bindAttr("a_position",[0,0,e,0,0,i,0,i,e,0,e,i],"STATIC_DRAW",2),this.bindAttr("a_texCoord",[0,0,1,0,0,1,0,1,1,0,1,1],"STATIC_DRAW",2),this.bindTexture("u_image",this.img),this.bindFrameBufferWithTexture("frame_buffer_0","img_texture_0",e,i),this.bindFrameBufferWithTexture("frame_buffer_1","img_texture_1",e,i)}},{key:"activeTexture",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.gl;e.activeTexture(e.TEXTURE0+t)}},{key:"drawFilter",value:function(){var t=this,e=this.gl;this.resize(),this.clear(),this.useProgram(),this.bindVA(),this.activeTexture(0),this.bindTexture("u_image"),this.uniform1i("u_image",0),this.uniform1f("u_flipY",1);var i=e.canvas,n=i.width,r=i.height;this.eachFilter((function(e,i){t.bindFrameBuffer("frame_buffer_"+i%2),t.uniform2f("u_resolution",n,r),t.viewport(0,0,n,r),t.effectFilter(e),t.bindTexture("img_texture_"+i%2)})),this.uniform1f("u_flipY",-1),this.bindFrameBuffer(null),this.uniform2f("u_resolution",n,r),this.viewport(0,0,n,r),this.clear(),this.effectFilter("normal")}},{key:"effectFilter",value:function(t){"string"==typeof t&&(t=(Me[t]||Me.normal).call(Me)),"convolution"==t.type?(this.uniform1f("u_kernelSelect",t.length),this.uniform1f("u_filterIndex",-1),this.uniform1fv("u_kernel"+t.length+"[0]",t.content),this.uniform1f("u_kernel"+t.length+"Weight",this.computeKernelWeight(t.content))):(this.uniform1f("u_kernelSelect",-1),this.uniform1f("u_filterIndex",t.index)),this.triangles(0,6)}},{key:"computeKernelWeight",value:function(t){var e=t.reduce((function(t,e){return t+e}));return e<=0?1:e}},{key:"createProgram",value:function(t,e){var i=this.gl,n=i.createProgram();if(this.vertexShader=this.createVertexShader(t),this.fragmentShader=this.createFragmentShader(e),i.attachShader(n,this.vertexShader),i.attachShader(n,this.fragmentShader),i.linkProgram(n),i.getProgramParameter(n,i.LINK_STATUS))return n;console.error(i.getProgramInfoLog(n)),i.deleteProgram(n)}},{key:"createShader",value:function(t,e){var i=this.gl,n=i.createShader(t);if(i.shaderSource(n,e),i.compileShader(n),i.getShaderParameter(n,i.COMPILE_STATUS))return n;console.error(i.getShaderInfoLog(n)),i.deleteShader(n)}},{key:"createVertexShader",value:function(t){var e=this.gl;return this.createShader(e.VERTEX_SHADER,t)}},{key:"createFragmentShader",value:function(t){var e=this.gl;return this.createShader(e.FRAGMENT_SHADER,t)}},{key:"eachFilter",value:function(t){this.filterList.forEach(t)}},{key:"init",value:function(){this.locations={},this.buffers={},this.framebuffers={},this.textures={},this.textureIndex={},this.hasTexParameter={}}},{key:"destroy",value:function(){var t=this.gl;this.init(),t.deleteProgram(this.program)}},{key:"filter",value:function(t,e){var i,n,r;this.filterList=t,this.initCanvas("#version 300 es \n\n in vec2 a_position;\n in vec2 a_texCoord; \n\n uniform vec2 u_resolution;\n uniform float u_flipY;\n\n out vec2 v_texCoord; \n\n void main() {\n vec2 zeroToOne = a_position / u_resolution;\n\n vec2 zeroToTwo = zeroToOne * 2.0;\n\n vec2 clipSpace = zeroToTwo - 1.0;\n\n gl_Position = vec4(clipSpace * vec2(1, u_flipY), 0, 1);\n\n v_texCoord = a_texCoord;\n\n }\n ",(i=this.filterList,n=i.filter((function(t){return"shader"==t.type})).map((function(t){return t.content})).join("\n\n"),r={9:!0},i.filter((function(t){return"convolution"==t.type})).forEach((function(t){r[t.length]=!0})),"#version 300 es\n\n precision highp int;\n precision mediump float;\n \n uniform sampler2D u_image;\n\n // 3 is 3x3 matrix kernel \n uniform float u_kernelSelect;\n uniform float u_filterIndex;\n\n uniform float u_kernel9[9];\n uniform float u_kernel9Weight;\n uniform float u_kernel25[25];\n uniform float u_kernel25Weight;\n uniform float u_kernel49[49];\n uniform float u_kernel49Weight;\n uniform float u_kernel81[81];\n uniform float u_kernel81Weight; \n\n in vec2 v_texCoord;\n \n out vec4 outColor;\n\n float random (vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233)))* 43758.5453123);\n } \n\n // \n vec3 rgb2hsv(vec3 c)\n {\n vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);\n vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);\n\n float d = q.x - min(q.w, q.y);\n float e = 1.0e-10;\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);\n }\n\n vec3 hsv2rgb(vec3 c)\n {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n }\n \n void main() {\n vec4 pixelColor = texture(u_image, v_texCoord);\n vec2 onePixel = vec2(1) / vec2(textureSize(u_image, 0)); \n\n "+n+"\n\n "+Object.keys(r).map((function(t){return ye(+t)})).join("\n")+"\n\n }")),this.drawFilter(),"function"==typeof e&&e(this)}}]),t}(),Be={GLCanvas:Pe};function Fe(t){var e=[];"string"==typeof t?e=se(t):Array.isArray(t)&&(e=t);var i=[];return e.forEach((function(t){var e=t.arr[0];if(Me[e]){var n=function(t){var e=t.arr[0],i=Me[e],n=t.arr;return n.shift(),i.apply(this,n)}(t);"convolution"==n.type||"shader"==n.type?i.push(n):n.forEach((function(t){i=i.concat(Fe(t))}))}})),i}var He=T({},Be,{filter:function(t,e,i,n){var r=new Be.GLCanvas({width:n.width||t.width,height:n.height||t.height,img:t});r.filter(Fe(e),(function(){"function"==typeof i&&i(r)}))}});function Ge(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{frameTimer:"full"},r=new _t(t);r.loadImage((function(){r.toArray(e,(function(t){"function"==typeof i&&i(t)}),n)}))}var Ve=T({},s,f,rt,D,J,V,j,q,k,X,{palette:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"hex";return e.length>i&&(e=ft(e,i)),e.map((function(e){return t(e,n)}))},ImageToCanvas:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{frameTimer:"full"};Ge(t,e,i,Object.assign({returnTo:"canvas"},n))},ImageToHistogram:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{width:200,height:100},n=new _t(t);n.loadImage((function(){pt.createHistogram(i.width||200,i.height||100,n.toHistogram(i),(function(t){"function"==typeof e&&e(t.toDataURL("image/png"))}),i)}))},ImageToRGB:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments[2];if(i){if(i){var n;(n=new _t(t,e)).loadImage((function(){"function"==typeof i&&i(n.toRGB())}))}}else(n=new _t(t)).loadImage((function(){"function"==typeof e&&e(n.toRGB())}))},ImageToURL:Ge,GLToCanvas:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=new _t(t);r.load((function(){He.filter(r.newImage,e,(function(t){"function"==typeof i&&i(t)}),n)}))},histogram:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=new _t(t);n.loadImage((function(){"function"==typeof e&&e(n.toHistogram(i))}))},histogramToPoints:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.2,i=[],n=0;n=t){e=je[n-1],i=je[n];break}return e&&i?Ve.interpolateRGB(e,i,(t-e.start)/(i.start-e.start)):je[0].rgb}},We=T({},Mt,Pt),Qe={Color:Ve,HueColor:Ye,ColorNames:_,ImageFilter:We,GL:He,Canvas:pt,ImageLoader:_t},ze=(Ve.color,0),Xe=[],Ke=function(){function t(e,i,n){if(g(this,t),"string"!=typeof e)this.el=e;else{var r=document.createElement(e);for(var s in this.uniqId=ze++,i&&(r.className=i),n=n||{})r.setAttribute(s,n[s]);this.el=r}}return x(t,[{key:"attr",value:function(t,e){return 1==arguments.length?this.el.getAttribute(t):(this.el.setAttribute(t,e),this)}},{key:"closest",value:function(e){for(var i=this,n=!1;!(n=i.hasClass(e));){if(!i.el.parentNode)return null;i=new t(i.el.parentNode)}return n?i:null}},{key:"checked",value:function(){return this.el.checked}},{key:"removeClass",value:function(t){return this.el.className=(" "+this.el.className+" ").replace(" "+t+" "," ").trim(),this}},{key:"hasClass",value:function(t){return!!this.el.className&&(" "+this.el.className+" ").indexOf(" "+t+" ")>-1}},{key:"addClass",value:function(t){return this.hasClass(t)||(this.el.className=this.el.className+" "+t),this}},{key:"toggleClass",value:function(t){this.hasClass(t)?this.removeClass(t):this.addClass(t)}},{key:"html",value:function(t){try{"string"==typeof t?this.el.innerHTML=t:this.empty().append(t)}catch(e){console.log(t)}return this}},{key:"find",value:function(t){return this.el.querySelector(t)}},{key:"$",value:function(e){return new t(this.find(e))}},{key:"findAll",value:function(t){return this.el.querySelectorAll(t)}},{key:"$$",value:function(e){return[].concat(A(this.findAll(e))).map((function(e){return new t(e)}))}},{key:"empty",value:function(){return this.html("")}},{key:"append",value:function(t){return"string"==typeof t?this.el.appendChild(document.createTextNode(t)):this.el.appendChild(t.el||t),this}},{key:"appendTo",value:function(t){return(t.el?t.el:t).appendChild(this.el),this}},{key:"remove",value:function(){return this.el.parentNode&&this.el.parentNode.removeChild(this.el),this}},{key:"text",value:function(){return this.el.textContent}},{key:"css",value:function(t,e){var i=this;if(2==arguments.length)this.el.style[t]=e;else if(1==arguments.length){if("string"==typeof t)return getComputedStyle(this.el)[t];var n=t||{};Object.keys(n).forEach((function(t){i.el.style[t]=n[t]}))}return this}},{key:"cssFloat",value:function(t){return parseFloat(this.css(t))}},{key:"cssInt",value:function(t){return parseInt(this.css(t))}},{key:"offset",value:function(){var e=this.el.getBoundingClientRect();return{top:e.top+t.getScrollTop(),left:e.left+t.getScrollLeft()}}},{key:"rect",value:function(){return this.el.getBoundingClientRect()}},{key:"position",value:function(){return this.el.style.top?{top:parseFloat(this.css("top")),left:parseFloat(this.css("left"))}:this.el.getBoundingClientRect()}},{key:"size",value:function(){return[this.width(),this.height()]}},{key:"width",value:function(){return this.el.offsetWidth||this.el.getBoundingClientRect().width}},{key:"contentWidth",value:function(){return this.width()-this.cssFloat("padding-left")-this.cssFloat("padding-right")}},{key:"height",value:function(){return this.el.offsetHeight||this.el.getBoundingClientRect().height}},{key:"contentHeight",value:function(){return this.height()-this.cssFloat("padding-top")-this.cssFloat("padding-bottom")}},{key:"dataKey",value:function(t){return this.uniqId+"."+t}},{key:"data",value:function(t,e){if(2!=arguments.length){if(1==arguments.length)return Xe[this.dataKey(t)];var i=Object.keys(Xe),n=this.uniqId+".";return i.filter((function(t){return 0==t.indexOf(n)})).map((function(t){return Xe[t]}))}return Xe[this.dataKey(t)]=e,this}},{key:"val",value:function(t){return 0==arguments.length?this.el.value:(1==arguments.length&&(this.el.value=t),this)}},{key:"int",value:function(){return parseInt(this.val(),10)}},{key:"float",value:function(){return parseFloat(this.val())}},{key:"show",value:function(){return this.css("display","block")}},{key:"hide",value:function(){return this.css("display","none")}},{key:"toggle",value:function(){return"none"==this.css("display")?this.show():this.hide()}},{key:"scrollTop",value:function(){return this.el===document.body?t.getScrollTop():this.el.scrollTop}},{key:"scrollLeft",value:function(){return this.el===document.body?t.getScrollLeft():this.el.scrollLeft}},{key:"on",value:function(t,e,i,n){return this.el.addEventListener(t,e,i,n),this}},{key:"off",value:function(t,e){return this.el.removeEventListener(t,e),this}},{key:"getElement",value:function(){return this.el}},{key:"createChild",value:function(e){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=new t(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",arguments.length>2&&void 0!==arguments[2]?arguments[2]:{});return n.css(i),this.append(n),n}},{key:"firstChild",value:function(){return new t(this.el.firstElementChild)}},{key:"replace",value:function(t,e){return this.el.replaceChild(e,t),this}}],[{key:"getScrollTop",value:function(){return Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop)}},{key:"getScrollLeft",value:function(){return Math.max(window.pageXOffset,document.documentElement.scrollLeft,document.body.scrollLeft)}}]),t}(),qe=function(){function t(e){g(this,t),this.$store=e,this.initialize()}return x(t,[{key:"initialize",value:function(){var t=this;this.filterProps().forEach((function(e){t.$store.action(e,t)}))}},{key:"filterProps",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";return Object.getOwnPropertyNames(this.__proto__).filter((function(e){return e.startsWith(t)}))}}]),t}(),Je=function(t){function e(){return g(this,e),E(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return b(e,t),x(e,[{key:"initialize",value:function(){m(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"initialize",this).call(this),this.$store.colorSetsList=[{name:"Material",colors:["#F44336","#E91E63","#9C27B0","#673AB7","#3F51B5","#2196F3","#03A9F4","#00BCD4","#009688","#4CAF50","#8BC34A","#CDDC39","#FFEB3B","#FFC107","#FF9800","#FF5722","#795548","#9E9E9E","#607D8B"]},{name:"Custom",edit:!0,colors:[]},{name:"Color Scale",scale:["red","yellow","black"],count:5}],this.$store.currentColorSets={}}},{key:"/list",value:function(t){return Array.isArray(t.userList)&&t.userList.length?t.userList:t.colorSetsList}},{key:"/setUserPalette",value:function(t,e){t.userList=e,t.dispatch("/resetUserPalette"),t.dispatch("/setCurrentColorSets")}},{key:"/resetUserPalette",value:function(t){t.userList&&t.userList.length&&(t.userList=t.userList.map((function(e,i){if("function"==typeof e.colors){var n=e.colors;e.colors=n(t),e._colors=n}return Object.assign({name:"color-"+i,colors:[]},e)})),t.emit("changeUserList"))}},{key:"/setCurrentColorSets",value:function(t,e){var i=t.dispatch("/list");t.currentColorSets=void 0===e?i[0]:"number"==typeof e?i[e]:i.filter((function(t){return t.name==e}))[0],t.emit("changeCurrentColorSets")}},{key:"/getCurrentColorSets",value:function(t){return t.currentColorSets}},{key:"/addCurrentColor",value:function(t,e){Array.isArray(t.currentColorSets.colors)&&(t.currentColorSets.colors.push(e),t.emit("changeCurrentColorSets"))}},{key:"/setCurrentColorAll",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];t.currentColorSets.colors=e,t.emit("changeCurrentColorSets")}},{key:"/removeCurrentColor",value:function(t,e){t.currentColorSets.colors[e]&&(t.currentColorSets.colors.splice(e,1),t.emit("changeCurrentColorSets"))}},{key:"/removeCurrentColorToTheRight",value:function(t,e){t.currentColorSets.colors[e]&&(t.currentColorSets.colors.splice(e,Number.MAX_VALUE),t.emit("changeCurrentColorSets"))}},{key:"/clearPalette",value:function(t){t.currentColorSets.colors&&(t.currentColorSets.colors=[],t.emit("changeCurrentColorSets"))}},{key:"/getCurrentColors",value:function(t){return t.dispatch("/getColors",t.currentColorSets)}},{key:"/getColors",value:function(t,e){return e.scale?Ve.scale(e.scale,e.count):e.colors||[]}},{key:"/getColorSetsList",value:function(t){return t.dispatch("/list").map((function(e){return{name:e.name,edit:e.edit,colors:t.dispatch("/getColors",e)}}))}}]),e}(qe),Ze={addEvent:function(t,e,i,n){t&&t.addEventListener(e,i,n)},removeEvent:function(t,e,i){t&&t.removeEventListener(e,i)},pos:function(t){return t.touches&&t.touches[0]?t.touches[0]:t},posXY:function(t){var e=this.pos(t);return{x:e.pageX,y:e.pageY}}},ti=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};g(this,t),this.masterObj=e,this.settingObj=i}return x(t,[{key:"set",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;this.settingObj[t]=e||i}},{key:"init",value:function(t){if(!this.has(t)){var e=t.split("."),i=this.masterObj.refs[e[0]]||this.masterObj[e[0]]||this.masterObj,n=e.pop();if(i[n]){for(var r=arguments.length,s=Array(r>1?r-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:"";return this.init(t,e),this.settingObj[t]||e}},{key:"has",value:function(t){return!!this.settingObj[t]}}]),t}(),ei=/^(click|mouse(down|up|move|enter|leave)|touch(start|move|end)|key(down|up|press)|contextmenu|change|input)/gi,ii=/^load (.*)/gi,ni=["Control","Shift","Alt","Meta"],ri=function(){function t(){g(this,t),this.state=new ti(this),this.refs={},this.childComponents=this.components()}return x(t,[{key:"newChildComponents",value:function(){var t=this;Object.keys(this.childComponents).forEach((function(e){var i=t.childComponents[e];t[e]=new i(t)}))}},{key:"render",value:function(){this.$el=this.parseTemplate(this.template()),this.refs.$el=this.$el,this.parseTarget(),this.load(),this.afterRender()}},{key:"afterRender",value:function(){}},{key:"components",value:function(){return{}}},{key:"parseTemplate",value:function(t){var e=this,i=new Ke("div").html(t).firstChild(),n=i.findAll("[ref]");return[].concat(A(n)).forEach((function(t){var i=t.getAttribute("ref");e.refs[i]=new Ke(t)})),i}},{key:"parseTarget",value:function(){var t=this,e=this.$el.findAll("[target]");[].concat(A(e)).forEach((function(e){var i=e.getAttribute("target"),n=e.getAttribute("ref")||i,r=new(0,t.childComponents[i])(t);t[n]=r,t.refs[n]=r.$el,r&&(r.render(),new Ke(e.parentNode).replace(e,r.$el.el))}))}},{key:"load",value:function(){var t=this;this.filterProps(ii).forEach((function(e){var i=e.split("load ")[1];t.refs[i]&&t.refs[i].html(t.parseTemplate(t[e].call(t)))}))}},{key:"template",value:function(){return"
"}},{key:"initialize",value:function(){}},{key:"initializeEvent",value:function(){var t=this;this.initializeEventMachin(),Object.keys(this.childComponents).forEach((function(e){t[e]&&t[e].initializeEvent()}))}},{key:"destroy",value:function(){var t=this;this.destroyEventMachin(),Object.keys(this.childComponents).forEach((function(e){t[e]&&t[e].destroy()}))}},{key:"destroyEventMachin",value:function(){this.removeEventAll()}},{key:"initializeEventMachin",value:function(){this.filterProps(ei).forEach(this.parseEvent.bind(this))}},{key:"collectProps",value:function(){if(!this.collapsedProps){var t=this.__proto__,e=[];do{e.push.apply(e,A(Object.getOwnPropertyNames(t))),t=t.__proto__}while(t);this.collapsedProps=e}return this.collapsedProps}},{key:"filterProps",value:function(t){return this.collectProps().filter((function(e){return e.match(t)}))}},{key:"parseEvent",value:function(t){var e=t.split(" ");this.bindingEvent(e,this[t].bind(this))}},{key:"getDefaultDomElement",value:function(t){var e=void 0;return(e=t?this.refs[t]||this[t]||window[t]:this.el||this.$el||this.$root)instanceof Ke?e.getElement():e}},{key:"getDefaultEventObject",value:function(t){var e=this,i=t.split("."),n=i.shift(),r=i.includes("Control"),s=i.includes("Shift"),o=i.includes("Alt"),a=i.includes("Meta"),h=(i=i.filter((function(t){return!1===ni.includes(t)}))).filter((function(t){return!!e[t]}));return{eventName:n,isControl:r,isShift:s,isAlt:o,isMeta:a,codes:i=i.filter((function(t){return!1===h.includes(t)})).map((function(t){return t.toLowerCase()})),checkMethodList:h}}},{key:"bindingEvent",value:function(t,e){var i,n=(i=t,Array.isArray(i)?i:Array.from(i)),r=n[0],s=n[1],o=n.slice(2);s=this.getDefaultDomElement(s);var a=this.getDefaultEventObject(r);a.dom=s,a.delegate=o.join(" "),this.addEvent(a,e)}},{key:"matchPath",value:function(t,e){return t?t.matches(e)?t:this.matchPath(t.parentElement,e):null}},{key:"getBindings",value:function(){return this._bindings||this.initBindings(),this._bindings}},{key:"addBinding",value:function(t){this.getBindings().push(t)}},{key:"initBindings",value:function(){this._bindings=[]}},{key:"checkEventType",value:function(t,e){var i=this,n=!e.isControl||t.ctrlKey,r=!e.isShift||t.shiftKey,s=!e.isAlt||t.altKey,o=!e.isMeta||t.metaKey,a=!0;e.codes.length&&(a=e.codes.includes(t.code.toLowerCase())||e.codes.includes(t.key.toLowerCase()));var h=!0;return e.checkMethodList.length&&(h=e.checkMethodList.every((function(e){return i[e].call(i,t)}))),n&&s&&r&&o&&a&&h}},{key:"makeCallback",value:function(t,e){var i=this;return t.delegate?function(n){if(n.xy=Ze.posXY(n),i.checkEventType(n,t)){var r=i.matchPath(n.target||n.srcElement,t.delegate);if(r)return n.delegateTarget=r,n.$delegateTarget=new Ke(r),e(n)}}:function(n){if(n.xy=Ze.posXY(n),i.checkEventType(n,t))return e(n)}}},{key:"addEvent",value:function(t,e){t.callback=this.makeCallback(t,e),this.addBinding(t);var i=!0;"touchstart"===t.eventName&&(i={passive:!0}),Ze.addEvent(t.dom,t.eventName,t.callback,i)}},{key:"removeEventAll",value:function(){var t=this;this.getBindings().forEach((function(e){t.removeEvent(e)})),this.initBindings()}},{key:"removeEvent",value:function(t){var e=t.eventName,i=t.dom,n=t.callback;Ze.removeEvent(i,e,n)}}]),t}(),si=/^@/,oi=function(t){function e(t){g(this,e);var i=E(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return i.opt=t||{},t&&t.$store&&(i.$store=t.$store),i.initialize(),i.initializeStoreEvent(),i}return b(e,t),x(e,[{key:"initializeStoreEvent",value:function(){var t=this;this.storeEvents={},this.filterProps(si).forEach((function(e){var i=e.split("@");i.shift();var n=i.join("@");t.storeEvents[n]=t[e].bind(t),t.$store.on(n,t.storeEvents[n])}))}},{key:"destoryStoreEvent",value:function(){var t=this;Object.keys(this.storeEvents).forEach((function(e){t.$store.off(e,t.storeEvents[e])}))}}]),e}(ri);var ai=function(t){function e(){return g(this,e),E(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return b(e,t),x(e,[{key:"initialize",value:function(){m(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"initialize",this).call(this),this.$store.rgb={},this.$store.hsl={},this.$store.hsv={},this.$store.alpha=1,this.$store.format="hex"}},{key:"/changeFormat",value:function(t,e){t.format=e,t.emit("changeFormat")}},{key:"/initColor",value:function(t,e,i){t.dispatch("/changeColor",e,i,!0),t.emit("initColor")}},{key:"/changeColor",value:function(t,e,i,n){var r;"string"==typeof(e=e||"#FF0000")&&(e=Ve.parse(e)),e.source=e.source||i,t.alpha=void 0===(r=e.a)||null==r?t.alpha:e.a,t.format="hsv"!=e.type&&e.type||t.format,"hsl"==e.type?(t.hsl=Object.assign(t.hsl,e),t.rgb=Ve.HSLtoRGB(t.hsl),t.hsv=Ve.HSLtoHSV(e)):"hex"==e.type||"rgb"==e.type?(t.rgb=Object.assign(t.rgb,e),t.hsl=Ve.RGBtoHSL(t.rgb),t.hsv=Ve.RGBtoHSV(e)):"hsv"==e.type&&(t.hsv=Object.assign(t.hsv,e),t.rgb=Ve.HSVtoRGB(t.hsv),t.hsl=Ve.HSVtoHSL(t.hsv)),n||t.emit("changeColor",e.source)}},{key:"/getHueColor",value:function(t){return Ye.checkHueColor(t.hsv.h/360)}},{key:"/toString",value:function(t,e){var i=t[e=e||t.format]||t.rgb;return Ve.format(T({},i,{a:t.alpha}),e)}},{key:"/toColor",value:function(t,e){return"rgb"==(e=e||t.format)?t.dispatch("/toRGB"):"hsl"==e?t.dispatch("/toHSL"):"hex"==e?t.dispatch("/toHEX"):t.dispatch("/toString",e)}},{key:"/toRGB",value:function(t){return t.dispatch("/toString","rgb")}},{key:"/toHSL",value:function(t){return t.dispatch("/toString","hsl")}},{key:"/toHEX",value:function(t){return t.dispatch("/toString","hex").toUpperCase()}}]),e}(qe),hi=function(){function t(e){g(this,t),this.callbacks=[],this.actions=[],this.modules=e.modules||[],this.initialize()}return x(t,[{key:"initialize",value:function(){this.initializeModule()}},{key:"initializeModule",value:function(){var t=this;this.modules.forEach((function(e){new e(t)}))}},{key:"action",value:function(t,e){this.actions[t]={context:e,callback:e[t]}}},{key:"dispatch",value:function(t){var e=[].concat(Array.prototype.slice.call(arguments)),i=(t=e.shift(),this.actions[t]);if(i)return i.callback.apply(i.context,[this].concat(A(e)))}},{key:"module",value:function(t){}},{key:"on",value:function(t,e){this.callbacks.push({event:t,callback:e})}},{key:"off",value:function(t,e){0==arguments.length?this.callbacks=[]:1==arguments.length?this.callbacks=this.callbacks.filter((function(e){return e.event!=t})):2==arguments.length&&(this.callbacks=this.callbacks.filter((function(i){return i.event!=t&&i.callback!=e})))}},{key:"emit",value:function(){var t=[].concat(Array.prototype.slice.call(arguments)),e=t.shift();this.callbacks.filter((function(t){return t.event==e})).forEach((function(e){e&&"function"==typeof e.callback&&e.callback.apply(e,A(t))}))}}]),t}(),li=function(t){function e(t){g(this,e);var i=E(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return i.isColorPickerShow=!1,i.isShortCut=!1,i.hideDelay=+(void 0===i.opt.hideDeplay?2e3:i.opt.hideDelay),i.timerCloseColorPicker,i.autoHide=i.opt.autoHide||!0,i.outputFormat=i.opt.outputFormat,i.$checkColorPickerClass=i.checkColorPickerClass.bind(i),i}return b(e,t),x(e,[{key:"initialize",value:function(){var t=this;this.$body=null,this.$root=null,this.$store=new hi({modules:[ai,Je]}),this.callbackChange=function(){t.callbackColorValue()},this.callbackLastUpdate=function(){t.callbackLastUpdateColorValue()},this.colorpickerShowCallback=function(){},this.colorpickerHideCallback=function(){},this.colorpickerLastUpdateCallback=function(){},this.$body=new Ke(this.getContainer()),this.$root=new Ke("div","codemirror-colorpicker"),"inline"==this.opt.position&&this.$body.append(this.$root),this.opt.type&&this.$root.addClass(this.opt.type),this.opt.hideInformation&&this.$root.addClass("hide-information"),this.opt.hideColorsets&&this.$root.addClass("hide-colorsets"),this.$arrow=new Ke("div","arrow"),this.$root.append(this.$arrow),this.$store.dispatch("/setUserPalette",this.opt.colorSets),this.render(),this.$root.append(this.$el),this.initColorWithoutChangeEvent(this.opt.color),this.initializeEvent()}},{key:"initColorWithoutChangeEvent",value:function(t){this.$store.dispatch("/initColor",t)}},{key:"show",value:function(t,e,i,n,r){this.colorpickerShowCallback=i,this.colorpickerHideCallback=n,this.colorpickerLastUpdateCallback=r,this.$root.css(this.getInitalizePosition()).show(),this.isColorPickerShow=!0,this.isShortCut=t.isShortCut||!1,this.outputFormat=t.outputFormat,this.hideDelay=+(void 0===t.hideDelay?2e3:t.hideDelay),this.hideDelay>0&&this.setHideDelay(this.hideDelay),this.$root.appendTo(this.$body),this.definePosition(t),this.initColorWithoutChangeEvent(e)}},{key:"initColor",value:function(t,e){this.$store.dispatch("/changeColor",t,e)}},{key:"hide",value:function(){this.isColorPickerShow&&(this.$root.hide(),this.$root.remove(),this.isColorPickerShow=!1,this.callbackHideColorValue())}},{key:"setColorsInPalette",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.$store.dispatch("/setCurrentColorAll",t)}},{key:"setUserPalette",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.$store.dispatch("/setUserPalette",t)}},{key:"getOption",value:function(t){return this.opt[t]}},{key:"setOption",value:function(t,e){this.opt[t]=e}},{key:"isType",value:function(t){return this.getOption("type")==t}},{key:"isPaletteType",value:function(){return this.isType("palette")}},{key:"isSketchType",value:function(){return this.isType("sketch")}},{key:"getContainer",value:function(){return this.opt.container||document.body}},{key:"getColor",value:function(t){return this.$store.dispatch("/toColor",t)}},{key:"definePositionForArrow",value:function(t,e,i){}},{key:"definePosition",value:function(t){var e=this.$root.width(),i=this.$root.height(),n=t.left-this.$body.scrollLeft();e+n>window.innerWidth&&(n-=e+n-window.innerWidth),n<0&&(n=0);var r=t.top-this.$body.scrollTop();i+r>window.innerHeight&&(r-=i+r-window.innerHeight),r<0&&(r=0),this.$root.css({left:n+"px",top:r+"px"})}},{key:"getInitalizePosition",value:function(){return"inline"==this.opt.position?{position:"relative",left:"auto",top:"auto",display:"inline-block"}:{position:"fixed",left:"-10000px",top:"-10000px"}}},{key:"isAbsolute",value:function(){return"inline"!==this.opt.position}},{key:"mouseup.isAbsolute document",value:function(t){this.__isMouseDown=!1,this.checkInHtml(t.target)||(0==this.checkColorPickerClass(t.target)?this.hide():this.__isMouseIn||(clearTimeout(this.timerCloseColorPicker),this.timerCloseColorPicker=setTimeout(this.hide.bind(this),this.delayTime||this.hideDelay)))}},{key:"keyup.isAbsolute.escape $root",value:function(t){this.hide()}},{key:"mouseover.isAbsolute $root",value:function(t){clearTimeout(this.timerCloseColorPicker)}},{key:"mousemove.isAbsolute $root",value:function(t){clearTimeout(this.timerCloseColorPicker)}},{key:"mouseenter.isAbsolute $root",value:function(t){clearTimeout(this.timerCloseColorPicker),this.__isMouseIn=!0}},{key:"mouseleave.isAbsolute $root",value:function(t){this.__isMouseIn=!1,this.__isMouseDown||(clearTimeout(this.timerCloseColorPicker),this.timerCloseColorPicker=setTimeout(this.hide.bind(this),this.delayTime||this.hideDelay))}},{key:"mousedown.isAbsolute $root",value:function(t){this.__isMouseDown=!0}},{key:"setHideDelay",value:function(t){this.delayTime=t||0}},{key:"runHideDelay",value:function(){this.isColorPickerShow&&this.setHideDelay()}},{key:"callbackColorValue",value:function(t){t=t||this.getCurrentColor(),"function"==typeof this.opt.onChange&&this.opt.onChange.call(this,t),"function"==typeof this.colorpickerShowCallback&&this.colorpickerShowCallback(t)}},{key:"callbackLastUpdateColorValue",value:function(t){t=t||this.getCurrentColor(),"function"==typeof this.opt.onLastUpdate&&this.opt.onLastUpdate.call(this,t),"function"==typeof this.colorpickerLastUpdateCallback&&this.colorpickerLastUpdateCallback(t)}},{key:"callbackHideColorValue",value:function(t){t=t||this.getCurrentColor(),"function"==typeof this.opt.onHide&&this.opt.onHide.call(this,t),"function"==typeof this.colorpickerHideCallback&&this.colorpickerHideCallback(t)}},{key:"getCurrentColor",value:function(){return this.$store.dispatch("/toColor",this.outputFormat)}},{key:"checkColorPickerClass",value:function(t){var e=new Ke(t).closest("codemirror-colorview"),i=new Ke(t).closest("codemirror-colorpicker"),n=new Ke(t).closest("CodeMirror");return t.nodeName,!!(i||e||n)}},{key:"checkInHtml",value:function(t){return"HTML"==t.nodeName}},{key:"initializeStoreEvent",value:function(){m(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"initializeStoreEvent",this).call(this),this.$store.on("changeColor",this.callbackChange),this.$store.on("lastUpdateColor",this.callbackLastUpdate),this.$store.on("changeFormat",this.callbackChange)}},{key:"destroy",value:function(){m(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this),this.$store.off("changeColor",this.callbackChange),this.$store.off("lastUpdateColor",this.callbackLastUpdate),this.$store.off("changeFormat",this.callbackChange),this.callbackChange=void 0,this.callbackLastUpdate=void 0,this.colorpickerShowCallback=void 0,this.colorpickerHideCallback=void 0}}]),e}(oi),ui=function(t){function e(t){g(this,e);var i=E(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return i.minValue=0,i.maxValue=1,i.source="base-slider",i}return b(e,t),x(e,[{key:"getMinMaxPosition",value:function(){var t=this.getMinPosition(),e=this.getMaxDist();return{min:t,max:t+e,width:e}}},{key:"getCurrent",value:function(t){return min+this.getMaxDist()*t}},{key:"getMinPosition",value:function(){return this.refs.$container.offset().left}},{key:"getMaxDist",value:function(){return this.state.get("$container.width")}},{key:"getDist",value:function(t){var e=this.getMinMaxPosition(),i=e.min,n=e.max;return tn?100:(t-i)/(n-i)*100}},{key:"getCaculatedDist",value:function(t){var e=t?this.getMousePosition(t):this.getCurrent(this.getDefaultValue()/this.maxValue);return this.getDist(e)}},{key:"getDefaultValue",value:function(){return 0}},{key:"setMousePosition",value:function(t){this.refs.$bar.css({left:t+"px"})}},{key:"getMousePosition",value:function(t){return Ze.pos(t).pageX}},{key:"refresh",value:function(){this.setColorUI()}},{key:"setColorUI",value:function(t){(t=t||this.getDefaultValue())<=this.minValue?this.refs.$bar.addClass("first").removeClass("last"):t>=this.maxValue?this.refs.$bar.addClass("last").removeClass("first"):this.refs.$bar.removeClass("last").removeClass("first"),this.setMousePosition(this.getMaxDist()*((t||0)/this.maxValue))}}]),e}(function(t){function e(t){g(this,e);var i=E(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return i.source="base-box",i}return b(e,t),x(e,[{key:"refresh",value:function(){}},{key:"refreshColorUI",value:function(t){}},{key:"changeColor",value:function(t){this.$store.dispatch("/changeColor",Object.assign({source:this.source},t||{}))}},{key:"mouseup document",value:function(t){this.onDragEnd(t)}},{key:"mousemove document",value:function(t){this.onDragMove(t)}},{key:"mousedown $bar",value:function(t){t.preventDefault(),this.isDown=!0}},{key:"mousedown $container",value:function(t){this.isDown=!0,this.onDragStart(t)}},{key:"touchend document",value:function(t){this.onDragEnd(t)}},{key:"touchmove document",value:function(t){this.onDragMove(t)}},{key:"touchstart $bar",value:function(t){t.preventDefault(),this.isDown=!0}},{key:"touchstart $container",value:function(t){this.onDragStart(t)}},{key:"onDragStart",value:function(t){this.isDown=!0,this.refreshColorUI(t)}},{key:"onDragMove",value:function(t){this.isDown&&this.refreshColorUI(t)}},{key:"onDragEnd",value:function(t){this.isDown&&(this.$store.emit("lastUpdateColor"),this.isDown=!1)}},{key:"@changeColor",value:function(t){this.source!=t&&this.refresh()}},{key:"@initColor",value:function(){this.refresh()}}]),e}(oi)),ci=function(t){function e(t){g(this,e);var i=E(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return i.minValue=0,i.maxValue=1,i.source="value-control",i}return b(e,t),x(e,[{key:"template",value:function(){return'\n
\n
\n
\n
\n
\n '}},{key:"setBackgroundColor",value:function(){this.refs.$container.css("background-color",this.$store.dispatch("/toRGB"))}},{key:"refresh",value:function(){m(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"refresh",this).call(this),this.setBackgroundColor()}},{key:"getDefaultValue",value:function(){return this.$store.hsv.v}},{key:"refreshColorUI",value:function(t){var e=this.getCaculatedDist(t);this.setColorUI(e/100*this.maxValue),this.changeColor({type:"hsv",v:e/100*this.maxValue})}}]),e}(ui),fi=function(t){function e(t){g(this,e);var i=E(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return i.minValue=0,i.maxValue=1,i.source="opacity-control",i}return b(e,t),x(e,[{key:"template",value:function(){return'\n
\n
\n
\n
\n
\n
\n '}},{key:"refresh",value:function(){m(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"refresh",this).call(this),this.setOpacityColorBar()}},{key:"setOpacityColorBar",value:function(){var t=Object.assign({},this.$store.rgb);t.a=0;var e=Ve.format(t,"rgb");t.a=1;var i=Ve.format(t,"rgb");this.setOpacityColorBarBackground(e,i)}},{key:"setOpacityColorBarBackground",value:function(t,e){this.refs.$colorbar.css("background","linear-gradient(to right, "+t+", "+e+")")}},{key:"getDefaultValue",value:function(){return this.$store.alpha}},{key:"refreshColorUI",value:function(t){var e=this.getCaculatedDist(t);this.setColorUI(e/100*this.maxValue),this.changeColor({a:Math.floor(e)/100*this.maxValue})}}]),e}(ui);var pi,_i=(pi=window,"EyeDropper"in pi),di=function(t){function e(){return g(this,e),E(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return b(e,t),x(e,[{key:"template",value:function(){return'\n \n '}},{key:"click $button",value:function(){var t=this;_i&&(new EyeDropper).open().then((function(e){t.$store.dispatch("/changeColor",e.sRGBHex),t.$store.emit("lastUpdateColor")}))}}]),e}(oi),vi=function(t){function e(){return g(this,e),E(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return b(e,t),x(e,[{key:"components",value:function(){return{Value:ci,Opacity:fi,Eyedropper:di}}},{key:"template",value:function(){return'\n
\n
\n
\n
\n
\n '+(_i?'\n
\n
\n
\n ':"")+" \n
\n "}},{key:"setBackgroundColor",value:function(){this.refs.$controlColor.css("background-color",this.$store.dispatch("/toRGB"))}},{key:"refresh",value:function(){this.setColorUI(),this.setBackgroundColor()}},{key:"setColorUI",value:function(){this.Value.setColorUI(),this.Opacity.setColorUI()}},{key:"@changeColor",value:function(t){"macos-control"!=t&&this.refresh()}},{key:"@initColor",value:function(){this.refresh()}}]),e}(oi),ki=function(t){function e(t){g(this,e);var i=E(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return i.width=214,i.height=214,i.thinkness=0,i.half_thinkness=0,i.source="colorwheel",i}return b(e,t),x(e,[{key:"template",value:function(){return'\n
\n \n
\n
\n
\n '}},{key:"refresh",value:function(t){this.setColorUI(t)}},{key:"setColorUI",value:function(t){this.renderCanvas(),this.renderValue(),this.setHueColor(null,t)}},{key:"renderValue",value:function(){var t=1-this.$store.hsv.v;this.refs.$valuewheel.css({"background-color":"rgba(0, 0, 0, "+t+")"})}},{key:"renderWheel",value:function(t,e){this.width&&!t&&(t=this.width),this.height&&!e&&(e=this.height);var i=new Ke("canvas"),n=i.el.getContext("2d");i.el.width=t,i.el.height=e,i.css({width:t+"px",height:e+"px"});for(var r=n.getImageData(0,0,t,e),s=r.data,o=Math.floor(t/2),a=Math.floor(e/2),h=t>e?a:o,l=o,u=a,f=0;f0&&(n.globalCompositeOperation="destination-out",n.fillStyle="black",n.beginPath(),n.arc(l,u,h-this.thinkness,0,2*Math.PI),n.closePath(),n.fill()),i}},{key:"renderCanvas",value:function(){if(!this.$store.createdWheelCanvas){var t=this.refs.$colorwheel,e=t.el.getContext("2d"),i=t.size(),n=C(i,2),r=n[0],s=n[1];this.width&&!r&&(r=this.width),this.height&&!s&&(s=this.height),t.el.width=r,t.el.height=s,t.css({width:r+"px",height:s+"px"});var o=this.renderWheel(r,s);e.drawImage(o.el,0,0),this.$store.createdWheelCanvas=!0}}},{key:"getDefaultValue",value:function(){return this.$store.hsv.h}},{key:"getDefaultSaturation",value:function(){return this.$store.hsv.s}},{key:"getCurrentXY",value:function(t,e,i,n,r){return t?Ze.posXY(t):function(t,e){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{x:l(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0),y:u(t,e,i)}}(e,i,n,r)}},{key:"getRectangle",value:function(){var t=this.state.get("$el.width"),e=this.state.get("$el.height"),i=this.state.get("$colorwheel.width")/2,n=this.refs.$el.offset().left,r=n+t/2,s=this.refs.$el.offset().top;return{minX:n,minY:s,width:t,height:e,radius:i,centerX:r,centerY:s+e/2}}},{key:"setHueColor",value:function(t,e){if(this.state.get("$el.width")){var i=this.getRectangle(),n=i.minX,r=i.minY,s=i.radius,o=i.centerX,a=i.centerY,h=this.getCurrentXY(t,this.getDefaultValue(),this.getDefaultSaturation()*s,o,a),l=(d=h.x)-o,u=(v=h.y)-a,f=l*l+u*u,p=c(l,u);if(f>s*s)var _=this.getCurrentXY(null,p,s,o,a),d=_.x,v=_.y;var k=Math.min(Math.sqrt(f)/s,1);this.refs.$drag_pointer.css({left:d-n+"px",top:v-r+"px"}),e||this.changeColor({type:"hsv",h:p,s:k})}}},{key:"changeColor",value:function(t){this.$store.dispatch("/changeColor",Object.assign({source:this.source},t||{}))}},{key:"@changeColor",value:function(t){this.source!=t&&this.refresh(!0)}},{key:"@initColor",value:function(){this.refresh(!0)}},{key:"mouseup document",value:function(t){this.isDown&&(this.isDown=!1,this.$store.emit("lastUpdateColor"))}},{key:"mousemove document",value:function(t){this.isDown&&this.setHueColor(t)}},{key:"mousedown $drag_pointer",value:function(t){t.preventDefault(),this.isDown=!0}},{key:"mousedown $el",value:function(t){this.isDown=!0,this.setHueColor(t)}},{key:"touchend document",value:function(t){this.isDown&&(this.isDown=!1,this.$store.emit("lastUpdateColor"))}},{key:"touchmove document",value:function(t){this.isDown&&this.setHueColor(t)}},{key:"touchstart $drag_pointer",value:function(t){t.preventDefault(),this.isDown=!0}},{key:"touchstart $el",value:function(t){t.preventDefault(),this.isDown=!0,this.setHueColor(t)}}]),e}(oi),gi="chromedevtool-information",xi=function(t){function e(){return g(this,e),E(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return b(e,t),x(e,[{key:"template",value:function(){return'\n
\n
\n \n
\n
\n
\n \n
HEX
\n
\n
\n
\n
\n \n
R
\n
\n
\n \n
G
\n
\n
\n \n
B
\n
\n
\n \n
A
\n
\n
\n
\n
\n \n
H
\n
\n
\n \n
%
\n
S
\n
\n
\n \n
%
\n
L
\n
\n
\n \n
A
\n
\n
\n
\n '}},{key:"setCurrentFormat",value:function(t){this.format=t,this.initFormat()}},{key:"initFormat",value:function(){var t=this,e=this.format||"hex";["hex","rgb","hsl"].filter((function(t){return t!==e})).forEach((function(e){t.$el.removeClass(e)})),this.$el.addClass(e)}},{key:"nextFormat",value:function(){var t=this.$store.format||"hex",e="hex";"hex"==t?e="rgb":"rgb"==t?e="hsl":"hsl"==t&&(e="hex"),this.format=e,this.$store.dispatch("/changeFormat",e),this.$store.emit("lastUpdateColor"),this.initFormat()}},{key:"goToFormat",value:function(t){this.format=t,this.$store.dispatch("/changeFormat",this.format),this.$store.emit("lastUpdateColor"),this.initFormat()}},{key:"getFormat",value:function(){return this.format||"hex"}},{key:"checkNumberKey",value:function(t){var e=t.which,i=!1;return 37!=e&&39!=e&&8!=e&&46!=e&&9!=e||(i=!0),!(!i&&(e<48||e>57))}},{key:"checkNotNumberKey",value:function(t){return!this.checkNumberKey(t)}},{key:"changeRgbColor",value:function(){this.$store.dispatch("/changeColor",{type:"rgb",r:this.refs.$rgb_r.int(),g:this.refs.$rgb_g.int(),b:this.refs.$rgb_b.int(),a:this.refs.$rgb_a.float(),source:gi}),this.$store.emit("lastUpdateColor")}},{key:"changeHslColor",value:function(){this.$store.dispatch("/changeColor",{type:"hsl",h:this.refs.$hsl_h.int(),s:this.refs.$hsl_s.int(),l:this.refs.$hsl_l.int(),a:this.refs.$hsl_a.float(),source:gi}),this.$store.emit("lastUpdateColor")}},{key:"@changeColor",value:function(t){gi!=t&&this.refresh()}},{key:"@initColor",value:function(){this.refresh()}},{key:"input $rgb_r",value:function(t){this.changeRgbColor()}},{key:"input $rgb_g",value:function(t){this.changeRgbColor()}},{key:"input $rgb_b",value:function(t){this.changeRgbColor()}},{key:"input $rgb_a",value:function(t){this.changeRgbColor()}},{key:"input $hsl_h",value:function(t){this.changeHslColor()}},{key:"input $hsl_s",value:function(t){this.changeHslColor()}},{key:"input $hsl_l",value:function(t){this.changeHslColor()}},{key:"input $hsl_a",value:function(t){this.changeHslColor()}},{key:"keyup $hexCode",value:function(t){var e=this.refs.$hexCode.val();"#"!=e.charAt(0)||7!=e.length&&9!==e.length||(this.$store.dispatch("/changeColor",e,gi),this.$store.emit("lastUpdateColor"))}},{key:"click $formatChangeButton",value:function(t){this.nextFormat()}},{key:"click $el .information-item.hex .input-field .title",value:function(t){this.goToFormat("rgb")}},{key:"click $el .information-item.rgb .input-field .title",value:function(t){this.goToFormat("hsl")}},{key:"click $el .information-item.hsl .input-field .title",value:function(t){this.goToFormat("hex")}},{key:"setRGBInput",value:function(){this.refs.$rgb_r.val(this.$store.rgb.r),this.refs.$rgb_g.val(this.$store.rgb.g),this.refs.$rgb_b.val(this.$store.rgb.b),this.refs.$rgb_a.val(this.$store.alpha)}},{key:"setHSLInput",value:function(){this.refs.$hsl_h.val(this.$store.hsl.h),this.refs.$hsl_s.val(this.$store.hsl.s),this.refs.$hsl_l.val(this.$store.hsl.l),this.refs.$hsl_a.val(this.$store.alpha)}},{key:"setHexInput",value:function(){this.refs.$hexCode.val(this.$store.dispatch("/toHEX"))}},{key:"refresh",value:function(){this.setCurrentFormat(this.$store.format),this.setRGBInput(),this.setHSLInput(),this.setHexInput()}}]),e}(oi),yi=function(t){function e(){return g(this,e),E(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return b(e,t),x(e,[{key:"template",value:function(){return'\n
\n
\n
\n

Color Palettes

\n ×\n
\n
\n
\n
\n '}},{key:"refresh",value:function(){this.load()}},{key:"@changeCurrentColorSets",value:function(){this.refresh()}},{key:"@toggleColorChooser",value:function(){this.toggle()}},{key:"load $colorsetsList",value:function(){return"\n
\n "+this.$store.dispatch("/getColorSetsList").map((function(t,e){return'\n
\n

'+t.name+'

\n
\n
\n '+t.colors.filter((function(t,e){return e<5})).map((function(t){return'
\n
\n
'})).join("")+"\n
\n
\n
"})).join("")+"\n
\n "}},{key:"show",value:function(){this.$el.addClass("open")}},{key:"hide",value:function(){this.$el.removeClass("open")}},{key:"toggle",value:function(){this.$el.toggleClass("open")}},{key:"click $toggleButton",value:function(t){this.toggle()}},{key:"click $colorsetsList .colorsets-item",value:function(t){var e=t.$delegateTarget;if(e){var i=parseInt(e.attr("data-colorsets-index"));this.$store.dispatch("/setCurrentColorSets",i),this.hide()}}},{key:"destroy",value:function(){m(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this),this.hide()}}]),e}(oi),Ti=function(t){function e(){return g(this,e),E(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return b(e,t),x(e,[{key:"template",value:function(){return'\n
\n \n
\n
\n '}},{key:"load $colorSetsColorList",value:function(){var t=this.$store.dispatch("/getCurrentColorSets");return'\n
\n '+this.$store.dispatch("/getCurrentColors").map((function(t,e){return'
\n
\n
\n
'})).join("")+" \n "+(t.edit?'
+
':"")+" \n
\n "}},{key:"refresh",value:function(){this.load()}},{key:"addColor",value:function(t){this.$store.dispatch("/addCurrentColor",t)}},{key:"@changeCurrentColorSets",value:function(){this.refresh()}},{key:"click $colorSetsChooseButton",value:function(t){this.$store.emit("toggleColorChooser")}},{key:"contextmenu $colorSetsColorList",value:function(t){if(t.preventDefault(),this.$store.dispatch("/getCurrentColorSets").edit){var e=new Ke(t.target).closest("color-item");if(e){var i=parseInt(e.attr("data-index"));this.$store.emit("showContextMenu",t,i)}else this.$store.emit("showContextMenu",t)}}},{key:"click $colorSetsColorList .add-color-item",value:function(t){this.addColor(this.$store.dispatch("/toColor"))}},{key:"click $colorSetsColorList .color-item",value:function(t){this.$store.dispatch("/changeColor",t.$delegateTarget.attr("data-color")),this.$store.emit("lastUpdateColor")}}]),e}(oi),mi=function(t){function e(){return g(this,e),E(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return b(e,t),x(e,[{key:"template",value:function(){return'\n
    \n \n \n \n
\n '}},{key:"show",value:function(t,e){var i=Ze.pos(t);this.$el.css({top:i.clientY-10+"px",left:i.clientX+"px"}),this.$el.addClass("show"),this.selectedColorIndex=e,void 0===this.selectedColorIndex?this.$el.addClass("small"):this.$el.removeClass("small")}},{key:"hide",value:function(){this.$el.removeClass("show")}},{key:"runCommand",value:function(t){switch(t){case"remove-color":this.$store.dispatch("/removeCurrentColor",this.selectedColorIndex);break;case"remove-all-to-the-right":this.$store.dispatch("/removeCurrentColorToTheRight",this.selectedColorIndex);break;case"clear-palette":this.$store.dispatch("/clearPalette")}}},{key:"@showContextMenu",value:function(t,e){this.show(t,e)}},{key:"click $el .menu-item",value:function(t){t.preventDefault(),this.runCommand(t.$delegateTarget.attr("data-type")),this.hide()}}]),e}(oi),bi=function(t){function e(){return g(this,e),E(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return b(e,t),x(e,[{key:"template",value:function(){return'\n
\n
\n
\n
\n
\n
\n
\n
\n '}},{key:"components",value:function(){return{colorwheel:ki,control:vi,information:xi,currentColorSets:Ti,colorSetsChooser:yi,contextMenu:mi}}}]),e}(li),Ei=function(t){function e(t){g(this,e);var i=E(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return i.minValue=0,i.maxValue=360,i.source="hue-control",i}return b(e,t),x(e,[{key:"template",value:function(){return'\n
\n
\n
\n
\n
\n '}},{key:"getDefaultValue",value:function(){return this.$store.hsv.h}},{key:"refreshColorUI",value:function(t){var e=this.getCaculatedDist(t);this.setColorUI(e/100*this.maxValue),this.changeColor({h:e/100*this.maxValue,type:"hsv"})}}]),e}(ui),Ci=function(t){function e(){return g(this,e),E(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return b(e,t),x(e,[{key:"components",value:function(){return{Hue:Ei,Opacity:fi,Eyedropper:di}}},{key:"template",value:function(){return'\n
\n
\n
\n
\n
\n '+(_i?'\n
\n
\n
\n ':"")+" \n
\n "}},{key:"setBackgroundColor",value:function(){this.refs.$controlColor.css("background-color",this.$store.dispatch("/toRGB"))}},{key:"refresh",value:function(){this.setColorUI(),this.setBackgroundColor()}},{key:"setColorUI",value:function(){this.Hue.setColorUI(),this.Opacity.setColorUI()}},{key:"@changeColor",value:function(t){"chromedevtool-control"!=t&&this.refresh()}},{key:"@initColor",value:function(){this.refresh()}}]),e}(oi),Ai="chromedevtool-palette",$i=function(t){function e(){return g(this,e),E(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return b(e,t),x(e,[{key:"template",value:function(){return'\n
\n
\n
\n
\n
\n
\n
\n '}},{key:"setBackgroundColor",value:function(t){this.$el.css("background-color",t)}},{key:"refresh",value:function(){this.setColorUI()}},{key:"caculateSV",value:function(){var t=this.drag_pointer_pos||{x:0,y:0},e=this.state.get("$el.width"),i=this.state.get("$el.height"),n=t.x/e,r=(i-t.y)/i;this.$store.dispatch("/changeColor",{type:"hsv",s:n,v:r,source:Ai})}},{key:"setColorUI",value:function(){var t=this.state.get("$el.width")*this.$store.hsv.s,e=this.state.get("$el.height")*(1-this.$store.hsv.v);this.refs.$drag_pointer.css({left:t+"px",top:e+"px"}),this.drag_pointer_pos={x:t,y:e},this.setBackgroundColor(this.$store.dispatch("/getHueColor"))}},{key:"setMainColor",value:function(t){var e=this.$el.offset(),i=this.state.get("$el.contentWidth"),n=this.state.get("$el.contentHeight"),r=Ze.pos(t).pageX-e.left,s=Ze.pos(t).pageY-e.top;r<0?r=0:r>i&&(r=i),s<0?s=0:s>n&&(s=n),this.refs.$drag_pointer.css({left:r+"px",top:s+"px"}),this.drag_pointer_pos={x:r,y:s},this.caculateSV()}},{key:"@changeColor",value:function(t){Ai!=t&&this.refresh()}},{key:"@initColor",value:function(){this.refresh()}},{key:"mouseup document",value:function(t){this.isDown&&(this.isDown=!1,this.$store.emit("lastUpdateColor"))}},{key:"mousemove document",value:function(t){this.isDown&&this.setMainColor(t)}},{key:"mousedown",value:function(t){this.isDown=!0,this.setMainColor(t)}},{key:"touchend document",value:function(t){this.isDown&&(this.isDown=!1,this.$store.emit("lastUpdateColor"))}},{key:"touchmove document",value:function(t){this.isDown&&this.setMainColor(t)}},{key:"touchstart",value:function(t){t.preventDefault(),this.isDown=!0,this.setMainColor(t)}}]),e}(oi),Si=function(t){function e(){return g(this,e),E(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return b(e,t),x(e,[{key:"template",value:function(){return'\n
\n
\n
\n
\n
\n
\n
\n
\n '}},{key:"components",value:function(){return{palette:$i,control:Ci,information:xi,currentColorSets:Ti,colorSetsChooser:yi,contextMenu:mi}}}]),e}(li),Ii=function(t){function e(){return g(this,e),E(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return b(e,t),x(e,[{key:"components",value:function(){return{Hue:Ei,Opacity:fi}}},{key:"template",value:function(){return'\n
\n
\n
\n
\n '}},{key:"refresh",value:function(){this.setColorUI()}},{key:"setColorUI",value:function(){this.Hue.setColorUI(),this.Opacity.setColorUI()}},{key:"@changeColor",value:function(t){"mini-control"!=t&&this.refresh()}},{key:"@initColor",value:function(){this.refresh()}}]),e}(oi),Oi=function(t){function e(){return g(this,e),E(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return b(e,t),x(e,[{key:"template",value:function(){return'\n
\n
\n
\n
\n '}},{key:"components",value:function(){return{palette:$i,control:Ii}}}]),e}(li),Li=function(t){function e(t){g(this,e);var i=E(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return i.source="vertical-slider",i}return b(e,t),x(e,[{key:"getMaxDist",value:function(){return this.state.get("$container.height")}},{key:"setMousePosition",value:function(t){this.refs.$bar.css({top:t+"px"})}},{key:"getMousePosition",value:function(t){return Ze.pos(t).pageY}},{key:"getMinPosition",value:function(){return this.refs.$container.offset().top}},{key:"getCaculatedDist",value:function(t){var e=t?this.getMousePosition(t):this.getCurrent(this.getDefaultValue()/this.maxValue);return 100-this.getDist(e)}},{key:"setColorUI",value:function(t){(t=t||this.getDefaultValue())<=this.minValue?this.refs.$bar.addClass("first").removeClass("last"):t>=this.maxValue?this.refs.$bar.addClass("last").removeClass("first"):this.refs.$bar.removeClass("last").removeClass("first");var e=1-(t||0)/this.maxValue;this.setMousePosition(this.getMaxDist()*e)}}]),e}(ui),Ni=function(t){function e(t){g(this,e);var i=E(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return i.minValue=0,i.maxValue=360,i.source="vertical-hue-control",i}return b(e,t),x(e,[{key:"template",value:function(){return'\n
\n
\n
\n
\n
\n '}},{key:"getDefaultValue",value:function(){return this.$store.hsv.h}},{key:"refreshColorUI",value:function(t){var e=this.getCaculatedDist(t);this.setColorUI(e/100*this.maxValue),this.changeColor({h:e/100*this.maxValue,type:"hsv"})}}]),e}(Li),Ri=function(t){function e(t){g(this,e);var i=E(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return i.source="vertical-opacity-control",i}return b(e,t),x(e,[{key:"template",value:function(){return'\n
\n
\n
\n
\n
\n
\n '}},{key:"refresh",value:function(){m(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"refresh",this).call(this),this.setOpacityColorBar()}},{key:"setOpacityColorBar",value:function(){var t=Object.assign({},this.$store.rgb);t.a=0;var e=Ve.format(t,"rgb");t.a=1;var i=Ve.format(t,"rgb");this.refs.$colorbar.css("background","linear-gradient(to top, "+e+", "+i+")")}},{key:"getDefaultValue",value:function(){return this.$store.alpha}},{key:"refreshColorUI",value:function(t){var e=this.getCaculatedDist(t);this.setColorUI(e/100*this.maxValue),this.changeColor({a:Math.floor(e)/100*this.maxValue})}}]),e}(Li),wi=function(t){function e(){return g(this,e),E(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return b(e,t),x(e,[{key:"components",value:function(){return{Hue:Ni,Opacity:Ri}}},{key:"template",value:function(){return'
'}},{key:"refresh",value:function(){this.setColorUI()}},{key:"setColorUI",value:function(){this.Hue.setColorUI(),this.Opacity.setColorUI()}},{key:"@changeColor",value:function(t){"mini-control"!=t&&this.refresh()}},{key:"@initColor",value:function(){this.refresh()}}]),e}(oi),Di=function(t){function e(){return g(this,e),E(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return b(e,t),x(e,[{key:"template",value:function(){return'\n
\n
\n
\n '}},{key:"components",value:function(){return{palette:$i,control:wi}}}]),e}(li),Mi=function(t){function e(){return g(this,e),E(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return b(e,t),x(e,[{key:"components",value:function(){return{Value:ci,Opacity:fi,Eyedropper:di}}},{key:"template",value:function(){return'\n
\n
\n
\n
\n
\n '+(_i?'\n
\n
\n
\n ':"")+" \n
\n "}},{key:"setBackgroundColor",value:function(){this.refs.$controlColor.css("background-color",this.$store.dispatch("/toRGB"))}},{key:"refresh",value:function(){this.setColorUI(),this.setBackgroundColor()}},{key:"setColorUI",value:function(){this.Value.setColorUI(),this.Opacity.setColorUI()}},{key:"@changeColor",value:function(t){"macos-control"!=t&&this.refresh()}},{key:"@initColor",value:function(){this.refresh()}}]),e}(oi),Ui=function(t){function e(t){g(this,e);var i=E(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return i.width=214,i.height=214,i.thinkness=16,i.half_thinkness=i.thinkness/2,i.source="colorring",i}return b(e,t),x(e,[{key:"template",value:function(){return'\n
\n \n
\n
\n '}},{key:"setColorUI",value:function(t){this.renderCanvas(),this.setHueColor(null,t)}},{key:"getDefaultValue",value:function(){return this.$store.hsv.h}},{key:"setHueColor",value:function(t,e){if(this.state.get("$el.width")){var i=this.getRectangle(),n=i.minX,r=i.minY,s=i.radius,o=i.centerX,a=i.centerY,h=this.getCurrentXY(t,this.getDefaultValue(),s,o,a),l=c(h.x-o,h.y-a),u=this.getCurrentXY(null,l,s-this.half_thinkness,o,a),f=u.x,p=u.y;this.refs.$drag_pointer.css({left:f-n+"px",top:p-r+"px"}),e||this.changeColor({type:"hsv",h:l})}}}]),e}(ki),Pi=function(t){function e(){return g(this,e),E(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return b(e,t),x(e,[{key:"template",value:function(){return'\n
\n
\n
\n
\n
\n
\n
\n
\n
\n '}},{key:"components",value:function(){return{colorring:Ui,palette:$i,control:Mi,information:xi,currentColorSets:Ti,colorSetsChooser:yi,contextMenu:mi}}}]),e}(li),Bi=function(t){function e(){return g(this,e),E(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return b(e,t),x(e,[{key:"components",value:function(){return{Hue:Ni,Opacity:Ri}}},{key:"template",value:function(){return'\n
\n
\n
\n
\n '}},{key:"refresh",value:function(){this.setColorUI()}},{key:"setColorUI",value:function(){this.Hue.setColorUI(),this.Opacity.setColorUI()}},{key:"@changeColor",value:function(){this.refresh()}},{key:"@initColor",value:function(){this.refresh()}}]),e}(oi),Fi=function(t){function e(){return g(this,e),E(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return b(e,t),x(e,[{key:"template",value:function(){return'\n
\n
\n
\n
\n
\n
\n
\n
\n '}},{key:"components",value:function(){return{palette:$i,control:Bi,information:xi,currentColorSets:Ti,colorSetsChooser:yi,contextMenu:mi}}}]),e}(li),Hi=function(t){function e(){return g(this,e),E(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return b(e,t),x(e,[{key:"components",value:function(){return{Hue:Ni,Opacity:Ri}}},{key:"template",value:function(){return'\n
\n
\n
\n
\n '}},{key:"refresh",value:function(){this.setColorUI()}},{key:"setColorUI",value:function(){this.Hue.setColorUI(),this.Opacity.setColorUI()}},{key:"@changeColor",value:function(t){"mini-control"!=t&&this.refresh()}},{key:"@initColor",value:function(){this.refresh()}}]),e}(oi),Gi=function(t){function e(){return g(this,e),E(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return b(e,t),x(e,[{key:"template",value:function(){return"\n
\n
\n
\n
\n
\n '+(_i?'\n
\n
\n
\n ':"")+' \n
\n
\n
\n
\n
\n
\n '}},{key:"components",value:function(){return{palette:$i,control:Hi,Eyedropper:di}}},{key:"initColorWithoutChangeEvent",value:function(t){this.$store.dispatch("/initColor",t),this.refresh()}},{key:"setBackgroundColor",value:function(){var t=this.$store.dispatch("/toColor"),e=this.$store.rgb,i=Ve.brightness(e.r,e.g,e.b);this.refs.$colorview.css({"background-color":t,color:i>127?"black":"white"}),this.refs.$colorview.html(t)}},{key:"click $colorview",value:function(t){this.nextFormat()}},{key:"nextFormat",value:function(){var t=this.$store.format||"hex",e="hex";"hex"==t?e="rgb":"rgb"==t?e="hsl":"hsl"==t&&(e="hex"),this.$store.dispatch("/changeFormat",e),this.$store.emit("lastUpdateColor"),this.refresh()}},{key:"refresh",value:function(){this.setBackgroundColor()}},{key:"@changeColor",value:function(){this.refresh()}},{key:"@initColor",value:function(){this.refresh()}}]),e}(li),Vi=function(t){function e(){return g(this,e),E(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return b(e,t),x(e,[{key:"components",value:function(){return{Hue:Ei,Opacity:fi,Eyedropper:di}}},{key:"template",value:function(){return'\n
\n
\n '+(_i?'\n
\n
\n
\n ':"")+' \n
\n
\n
\n
\n
\n
\n
\n\n
\n '}},{key:"setBackgroundColor",value:function(){this.refs.$controlColor.css("background-color",this.$store.dispatch("/toRGB"))}},{key:"refresh",value:function(){this.setColorUI(),this.setBackgroundColor()}},{key:"setColorUI",value:function(){this.Hue.setColorUI(),this.Opacity.setColorUI()}},{key:"@changeColor",value:function(t){"chromedevtool-control"!=t&&this.refresh()}},{key:"@initColor",value:function(){this.refresh()}}]),e}(oi),ji=function(t){function e(){return g(this,e),E(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return b(e,t),x(e,[{key:"template",value:function(){return'\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n '}},{key:"components",value:function(){return{palette:$i,control:Vi,information:xi,currentColorSets:Ti,colorSetsChooser:yi,contextMenu:mi}}}]),e}(li),Yi={create:function(t){switch(t.type){case"box":return new ji(t);case"macos":return new bi(t);case"xd":return new Fi(t);case"ring":return new Pi(t);case"mini":return new Oi(t);case"vscode":return new Gi(t);case"mini-vertical":return new Di(t);default:return new Si(t)}},ColorPicker:Si,ChromeDevToolColorPicker:Si,MacOSColorPicker:bi,RingColorPicker:Pi,MiniColorPicker:Oi,VSCodePicker:Gi,MiniVerticalColorPicker:Di},Wi="codemirror-colorview",Qi="codemirror-colorview-background",zi=["comment","builtin","qualifier","tag","property","property error","variable","variable-2"];function Xi(t,e){"setValue"==e.origin?(t.state.colorpicker.init_color_update(),t.state.colorpicker.style_color_update()):t.state.colorpicker.style_color_update(t.getCursor().line)}function Ki(t,e){t.state.colorpicker.isUpdate||(t.state.colorpicker.isUpdate=!0,t.state.colorpicker.close_color_picker(),t.state.colorpicker.init_color_update(),t.state.colorpicker.style_color_update())}function qi(t,e){Xi(t,{origin:"setValue"})}function Ji(t,e){t.state.colorpicker.keyup(e)}function Zi(t,e){t.state.colorpicker.is_edit_mode()&&t.state.colorpicker.check_mousedown(e)}function tn(t,e){Xi(t,{origin:"setValue"})}function en(t){t.state.colorpicker.close_color_picker()}function nn(t){t.state.colorpicker.hide_delay_color_picker(t.state.colorpicker.opt.hideDelay||1e3)}var rn=function(){function t(e,i){g(this,t),i="boolean"==typeof i?{mode:"edit"}:Object.assign({mode:"edit"},i||{}),this.opt=i,this.cm=e,this.markers={},this.excluded_token=this.opt.excluded_token||zi,this.opt.colorpicker?this.colorpicker=this.opt.colorpicker(this.opt):this.colorpicker=Yi.create(this.opt),this.init_event()}return x(t,[{key:"init_event",value:function(){var t,e;this.cm.on("mousedown",Zi),this.cm.on("keyup",Ji),this.cm.on("change",Xi),this.cm.on("update",Ki),this.cm.on("refresh",qi),this.cm.on("blur",nn),this.onPasteCallback=(t=this.cm,e=tn,function(i){e.call(this,t,i)}),this.onScrollEvent=function(t,e){var i=void 0;return function(n,r){i&&clearTimeout(i),i=setTimeout((function(){t(n,r)}),e||300)}}(en,50),this.cm.getWrapperElement().addEventListener("paste",this.onPasteCallback),this.is_edit_mode()&&this.cm.on("scroll",this.onScrollEvent)}},{key:"is_edit_mode",value:function(){return"edit"==this.opt.mode}},{key:"is_view_mode",value:function(){return"view"==this.opt.mode}},{key:"destroy",value:function(){this.cm.off("mousedown",Zi),this.cm.off("keyup",Ji),this.cm.off("change",Xi),this.cm.off("blur",nn),this.cm.getWrapperElement().removeEventListener("paste",this.onPasteCallback),this.is_edit_mode()&&this.cm.off("scroll",this.onScrollEvent)}},{key:"hasClass",value:function(t,e){return!!t.className&&(" "+t.className+" ").indexOf(" "+e+" ")>-1}},{key:"check_mousedown",value:function(t){this.hasClass(t.target,Qi)?this.open_color_picker(t.target.parentNode):this.close_color_picker()}},{key:"popup_color_picker",value:function(t){var e=this.cm.getCursor(),i=this,n={lineNo:e.line,ch:e.ch,color:t||"#FFFFFF",isShortCut:!0};Object.keys(this.markers).forEach((function(t){if(("#"+t).indexOf("#"+n.lineNo+":")>-1){var e=i.markers[t];e.ch<=n.ch&&n.ch<=e.ch+e.color.length&&(n.ch=e.ch,n.color=e.color,n.nameColor=e.nameColor)}})),this.open_color_picker(n)}},{key:"open_color_picker",value:function(t){var e=this,i=t.lineNo,n=t.ch,r=t.nameColor,s=t.color;if(this.colorpicker){var o=s,a=this.cm.charCoords({line:i,ch:n});this.colorpicker.show({left:a.left,top:a.bottom,isShortCut:t.isShortCut||!1,hideDelay:this.opt.hideDelay||2e3},r||s,(function(t){e.cm.replaceRange(t,{line:i,ch:n},{line:i,ch:n+o.length},"*colorpicker"),e.cm.focus(),o=t}))}}},{key:"close_color_picker",value:function(){this.colorpicker&&this.colorpicker.hide()}},{key:"hide_delay_color_picker",value:function(){this.colorpicker&&this.colorpicker.runHideDelay()}},{key:"key",value:function(t,e){return[t,e].join(":")}},{key:"keyup",value:function(t){this.colorpicker&&("Escape"==t.key||0==this.colorpicker.isShortCut)&&this.colorpicker.hide()}},{key:"init_color_update",value:function(){this.markers={}}},{key:"style_color_update",value:function(t){if(t)this.match(t);else for(var e=this.cm.lineCount(),i=0;i-1)&&(delete this.markers[s],i[n].marker.clear())}var o,a}},{key:"match_result",value:function(t){return Ve.matches(t.text)}},{key:"submatch",value:function(t,e){var i=this;this.empty_marker(t,e);var n=this.match_result(e),r={next:0};n.forEach((function(n){i.render(r,t,e,n.color,n.nameColor)}))}},{key:"match",value:function(t){var e=this.cm.getLineHandle(t),i=this;this.cm.operation((function(){i.submatch(t,e)}))}},{key:"make_element",value:function(){var t=document.createElement("div");return t.className=Wi,this.is_edit_mode()?t.title="open color picker":t.title="",t.back_element=this.make_background_element(),t.appendChild(t.back_element),t}},{key:"make_background_element",value:function(){var t=document.createElement("div");return t.className=Qi,t}},{key:"set_state",value:function(t,e,i,n){var r=this.create_marker(t,e);return r.lineNo=t,r.ch=e,r.color=i,r.nameColor=n,r}},{key:"create_marker",value:function(t,e){return this.has_marker(t,e)||this.init_marker(t,e),this.get_marker(t,e)}},{key:"init_marker",value:function(t,e){this.markers[this.key(t,e)]=this.make_element()}},{key:"has_marker",value:function(t,e){return!!this.get_marker(t,e)}},{key:"get_marker",value:function(t,e){var i=this.key(t,e);return this.markers[i]}},{key:"update_element",value:function(t,e){t.back_element.style.backgroundColor=e}},{key:"set_mark",value:function(t,e,i){this.cm.setBookmark({line:t,ch:e},{widget:i,handleMouseEvents:!0})}},{key:"is_excluded_token",value:function(t,e){var i=this.cm.getTokenAt({line:t,ch:e},!0),n=i.type,r=i.state.state;return null==n&&"block"==r||null==n&&"top"==r||this.excluded_token.includes(n)}},{key:"render",value:function(t,e,i,n,r){var s=i.text.indexOf(n,t.next);if(!0!==this.is_excluded_token(e,s+1)){if(t.next=s+n.length,this.has_marker(e,s))return this.update_element(this.create_marker(e,s),r||n),void this.set_state(e,s,n,r);var o=this.create_marker(e,s);this.update_element(o,r||n),this.set_state(e,s,n,r||n),this.set_mark(e,s,o)}else t.next=s+n.length}}]),t}();try{var sn=i(1481)}catch(t){}function on(){var t=sn||window.CodeMirror;t&&t.defineOption("colorpicker",!1,(function(e,i,n){n&&n!=t.Init&&e.state.colorpicker&&(e.state.colorpicker.destroy(),e.state.colorpicker=null),i&&(e.state.colorpicker=new rn(e,i))}))}return on(),T({},Qe,Yi,{load:on})}()},4776:t=>{var e;self,e=()=>(()=>{"use strict";var t={555:(t,e,i)=>{var n=i(1907),r=i(7724),s=function(t,e){this.withPositions=t,this.withSource=e};s.precedence={},[["or"],["xor"],["and"],["="],["?"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","!=","===","!==","<=>"],["<","<=",">",">="],["<<",">>"],["+","-","."],["*","/","%"],["!"],["instanceof"],["cast","silent"],["**"]].forEach((function(t,e){t.forEach((function(t){s.precedence[t]=e+1}))})),s.prototype.isRightAssociative=function(t){return"**"===t||"??"===t},s.prototype.swapLocations=function(t,e,i,n){this.withPositions&&(t.loc.start=e.loc.start,t.loc.end=i.loc.end,this.withSource&&(t.loc.source=n.lexer._input.substring(t.loc.start.offset,t.loc.end.offset)))},s.prototype.resolveLocations=function(t,e,i,n){this.withPositions&&(t.loc.start.offset>e.loc.start.offset&&(t.loc.start=e.loc.start),t.loc.end.offset{var n=i(1530),r="array";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,i,s]),this.items=e,this.shortForm=t}))},4253:(t,e,i)=>{var n=i(1530),r="arrowfunc";t.exports=n.extends(r,(function(t,e,i,s,o,a,h,l){n.apply(this,[r,h,l]),this.arguments=t,this.byref=e,this.body=i,this.type=s,this.nullable=o,this.isStatic=a||!1}))},1997:(t,e,i)=>{var n=i(1530),r="assign";t.exports=n.extends(r,(function(t,e,i,s,o){n.apply(this,[r,s,o]),this.left=t,this.right=e,this.operator=i}))},1889:(t,e,i)=>{var n=i(1530),r="assignref";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,i,s]),this.left=t,this.right=e}))},9165:(t,e,i)=>{var n=i(2730),r="attrgroup";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.attrs=t||[]}))},4923:(t,e,i)=>{var n=i(2730),r="attribute";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,i,s]),this.name=t,this.args=e}))},4230:(t,e,i)=>{var n=i(6210);t.exports=n.extends("bin",(function(t,e,i,r,s){n.apply(this,["bin",r,s]),this.type=t,this.left=e,this.right=i}))},2325:(t,e,i)=>{var n=i(2898),r="block";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[t||r,i,s]),this.children=e.filter(Boolean)}))},504:(t,e,i)=>{var n=i(6602),r="boolean";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,t,e,i,s])}))},2271:(t,e,i)=>{var n=i(2898),r="break";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.level=t}))},5871:(t,e,i)=>{var n=i(1530),r="byref";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.what=t}))},1578:(t,e,i)=>{var n=i(1530),r="call";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,i,s]),this.what=t,this.arguments=e}))},7521:(t,e,i)=>{var n=i(2898),r="case";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,i,s]),this.test=t,this.body=e}))},8212:(t,e,i)=>{var n=i(6210),r="cast";t.exports=n.extends(r,(function(t,e,i,s,o){n.apply(this,[r,s,o]),this.type=t,this.raw=e,this.expr=i}))},1119:(t,e,i)=>{var n=i(2898),r="catch";t.exports=n.extends(r,(function(t,e,i,s,o){n.apply(this,[r,s,o]),this.body=t,this.what=e,this.variable=i}))},5178:(t,e,i)=>{var n=i(9036),r="class";t.exports=n.extends(r,(function(t,e,i,s,o,a,h){n.apply(this,[r,t,a,h]),this.isAnonymous=!t,this.extends=e,this.implements=i,this.body=s,this.attrGroups=[],this.parseFlags(o)}))},4027:(t,e,i)=>{var n=i(7224),r="classconstant",s=n.extends(r,(function(t,e,i,s,o,a){n.apply(this,[t||r,e,o,a]),this.parseFlags(i),this.attrGroups=s}));s.prototype.parseFlags=function(t){-1===t[0]?this.visibility="":null===t[0]?this.visibility=null:0===t[0]?this.visibility="public":1===t[0]?this.visibility="protected":2===t[0]&&(this.visibility="private"),this.final=2===t[2]},t.exports=s},5436:(t,e,i)=>{var n=i(1530),r="clone";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.what=t}))},5411:(t,e,i)=>{var n=i(1530),r="closure";t.exports=n.extends(r,(function(t,e,i,s,o,a,h,l){n.apply(this,[r,h,l]),this.uses=i,this.arguments=t,this.byref=e,this.type=s,this.nullable=o,this.isStatic=a||!1,this.body=null,this.attrGroups=[]}))},2001:(t,e,i)=>{var n=i(2730);t.exports=n.extends("comment",(function(t,e,i,r){n.apply(this,[t,i,r]),this.value=e}))},6659:(t,e,i)=>{var n=i(2001),r="commentblock";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,t,e,i])}))},387:(t,e,i)=>{var n=i(2001),r="commentline";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,t,e,i])}))},408:(t,e,i)=>{var n=i(2730),r="constant";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,i,s]),this.name=t,this.value=e}))},7224:(t,e,i)=>{var n=i(2898),r="constantstatement";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[t||r,i,s]),this.constants=e}))},6560:(t,e,i)=>{var n=i(2898),r="continue";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.level=t}))},9036:(t,e,i)=>{var n=i(2898),r="declaration",s=n.extends(r,(function(t,e,i,s){n.apply(this,[t||r,i,s]),this.name=e}));s.prototype.parseFlags=function(t){this.isAbstract=1===t[2],this.isFinal=2===t[2],this.isReadonly=1===t[3],"class"!==this.kind&&(-1===t[0]?this.visibility="":null===t[0]?this.visibility=null:0===t[0]?this.visibility="public":1===t[0]?this.visibility="protected":2===t[0]&&(this.visibility="private"),this.isStatic=1===t[1])},t.exports=s},4067:(t,e,i)=>{var n=i(2325),r="declare",s=n.extends(r,(function(t,e,i,s,o){n.apply(this,[r,e,s,o]),this.directives=t,this.mode=i}));s.MODE_SHORT="short",s.MODE_BLOCK="block",s.MODE_NONE="none",t.exports=s},2514:(t,e,i)=>{var n=i(2730),r="declaredirective";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,i,s]),this.key=t,this.value=e}))},8014:(t,e,i)=>{var n=i(2898);t.exports=n.extends("do",(function(t,e,i,r){n.apply(this,["do",i,r]),this.test=t,this.body=e}))},4395:(t,e,i)=>{var n=i(2898),r="echo";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,i,s]),this.shortForm=e,this.expressions=t}))},4514:(t,e,i)=>{var n=i(1530),r="empty";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.expression=t}))},6129:(t,e,i)=>{var n=i(6602),r="encapsed",s=n.extends(r,(function(t,e,i,s,o){n.apply(this,[r,t,e,s,o]),this.type=i}));s.TYPE_STRING="string",s.TYPE_SHELL="shell",s.TYPE_HEREDOC="heredoc",s.TYPE_OFFSET="offset",t.exports=s},3321:(t,e,i)=>{var n=i(1530),r="encapsedpart";t.exports=n.extends(r,(function(t,e,i,s,o){n.apply(this,[r,s,o]),this.expression=t,this.syntax=e,this.curly=i}))},3689:(t,e,i)=>{var n=i(1530),r="entry";t.exports=n.extends(r,(function(t,e,i,s,o,a){n.apply(this,[r,o,a]),this.key=t,this.value=e,this.byRef=i,this.unpack=s}))},4199:(t,e,i)=>{var n=i(9036),r="enum";t.exports=n.extends(r,(function(t,e,i,s,o,a){n.apply(this,[r,t,o,a]),this.valueType=e,this.implements=i,this.body=s,this.attrGroups=[]}))},2045:(t,e,i)=>{var n=i(2730),r="enumcase";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,i,s]),this.name=t,this.value=e}))},4042:(t,e,i)=>{var n=i(2730),r="error";t.exports=n.extends(r,(function(t,e,i,s,o,a){n.apply(this,[r,o,a]),this.message=t,this.token=e,this.line=i,this.expected=s}))},5886:(t,e,i)=>{var n=i(1530),r="eval";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.source=t}))},6389:(t,e,i)=>{var n=i(1530),r="exit";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,i,s]),this.expression=t,this.useDie=e}))},1530:(t,e,i)=>{var n=i(2730),r="expression";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[t||r,e,i])}))},9317:(t,e,i)=>{var n=i(2898),r="expressionstatement";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.expression=t}))},4607:(t,e,i)=>{var n=i(2898);t.exports=n.extends("for",(function(t,e,i,r,s,o,a){n.apply(this,["for",o,a]),this.init=t,this.test=e,this.increment=i,this.shortForm=s,this.body=r}))},358:(t,e,i)=>{var n=i(2898),r="foreach";t.exports=n.extends(r,(function(t,e,i,s,o,a,h){n.apply(this,[r,a,h]),this.source=t,this.key=e,this.value=i,this.shortForm=o,this.body=s}))},1057:(t,e,i)=>{var n=i(9036),r="function";t.exports=n.extends(r,(function(t,e,i,s,o,a,h){n.apply(this,[r,t,a,h]),this.arguments=e,this.byref=i,this.type=s,this.nullable=o,this.body=null,this.attrGroups=[]}))},7887:(t,e,i)=>{var n=i(2898),r="global";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.items=t}))},7752:(t,e,i)=>{var n=i(2898),r="goto";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.label=t}))},6547:(t,e,i)=>{var n=i(2898),r="halt";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.after=t}))},6403:(t,e,i)=>{var n=i(2730),r="identifier",s=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.name=t}));t.exports=s},5851:(t,e,i)=>{var n=i(2898);t.exports=n.extends("if",(function(t,e,i,r,s,o){n.apply(this,["if",s,o]),this.test=t,this.body=e,this.alternate=i,this.shortForm=r}))},8454:(t,e,i)=>{var n=i(1530),r="include";t.exports=n.extends(r,(function(t,e,i,s,o){n.apply(this,[r,s,o]),this.once=t,this.require=e,this.target=i}))},7133:(t,e,i)=>{var n=i(6602),r="inline";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,t,e,i,s])}))},7298:(t,e,i)=>{var n=i(9036),r="interface";t.exports=n.extends(r,(function(t,e,i,s,o,a){n.apply(this,[r,t,o,a]),this.extends=e,this.body=i,this.attrGroups=s}))},8323:(t,e,i)=>{var n=i(9036),r="intersectiontype";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,null,e,i]),this.types=t}))},9132:(t,e,i)=>{var n=i(1530),r="isset";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.variables=t}))},9522:(t,e,i)=>{var n=i(2898),r="label";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.name=t}))},298:(t,e,i)=>{var n=i(1530),r="list";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,i,s]),this.items=t,this.shortForm=e}))},6602:(t,e,i)=>{var n=i(1530),r="literal";t.exports=n.extends(r,(function(t,e,i,s,o){n.apply(this,[t||r,s,o]),this.value=e,i&&(this.raw=i)}))},1907:t=>{t.exports=function(t,e,i){this.source=t,this.start=e,this.end=i}},7592:(t,e,i)=>{var n=i(1530),r="lookup";t.exports=n.extends(r,(function(t,e,i,s,o){n.apply(this,[t||r,s,o]),this.what=e,this.offset=i}))},679:(t,e,i)=>{var n=i(6602),r="magic";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,t,e,i,s])}))},7046:(t,e,i)=>{var n=i(1530),r="match";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,i,s]),this.cond=t,this.arms=e}))},7920:(t,e,i)=>{var n=i(1530),r="matcharm";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,i,s]),this.conds=t,this.body=e}))},3110:(t,e,i)=>{var n=i(1057),r="method";t.exports=n.extends(r,(function(){n.apply(this,arguments),this.kind=r}))},3174:(t,e,i)=>{var n=i(1211),r="name",s=n.extends(r,(function(t,e,i,s){n.apply(this,[r,i,s]),this.name=t.replace(/\\$/,""),this.resolution=e}));s.UNQUALIFIED_NAME="uqn",s.QUALIFIED_NAME="qn",s.FULL_QUALIFIED_NAME="fqn",s.RELATIVE_NAME="rn",t.exports=s},2633:(t,e,i)=>{var n=i(1530),r="namedargument";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,i,s]),this.name=t,this.value=e}))},8356:(t,e,i)=>{var n=i(2325),r="namespace";t.exports=n.extends(r,(function(t,e,i,s,o){n.apply(this,[r,e,s,o]),this.name=t,this.withBrackets=i||!1}))},3725:(t,e,i)=>{var n=i(1530);t.exports=n.extends("new",(function(t,e,i,r){n.apply(this,["new",i,r]),this.what=t,this.arguments=e}))},2730:t=>{var e=function(t,e,i){this.kind=t,e&&(this.leadingComments=e),i&&(this.loc=i)};e.prototype.setTrailingComments=function(t){this.trailingComments=t},e.prototype.destroy=function(t){if(!t)throw new Error("Node already initialized, you must swap with another node");return this.leadingComments&&(t.leadingComments?t.leadingComments=Array.concat(this.leadingComments,t.leadingComments):t.leadingComments=this.leadingComments),this.trailingComments&&(t.trailingComments?t.trailingComments=Array.concat(this.trailingComments,t.trailingComments):t.trailingComments=this.trailingComments),t},e.prototype.includeToken=function(t){return this.loc&&(this.loc.end&&(this.loc.end.line=t.lexer.yylloc.last_line,this.loc.end.column=t.lexer.yylloc.last_column,this.loc.end.offset=t.lexer.offset),t.ast.withSource&&(this.loc.source=t.lexer._input.substring(this.loc.start.offset,t.lexer.offset))),this},e.extends=function(t,e){return e.prototype=Object.create(this.prototype),e.extends=this.extends,e.prototype.constructor=e,e.kind=t,e},t.exports=e},2450:(t,e,i)=>{var n=i(2730),r="noop";t.exports=n.extends(r,(function(t,e){n.apply(this,[r,t,e])}))},1358:(t,e,i)=>{var n=i(6602),r="nowdoc";t.exports=n.extends(r,(function(t,e,i,s,o){n.apply(this,[r,t,e,s,o]),this.label=i}))},8588:(t,e,i)=>{var n=i(2730),r="nullkeyword";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.raw=t}))},2895:(t,e,i)=>{var n=i(7592),r="nullsafepropertylookup";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,t,e,i,s])}))},1480:(t,e,i)=>{var n=i(6602),r="number";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,t,e,i,s])}))},368:(t,e,i)=>{var n=i(7592),r="offsetlookup";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,t,e,i,s])}))},6210:(t,e,i)=>{var n=i(1530),r="operation";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[t||r,e,i])}))},9281:(t,e,i)=>{var n=i(9036),r="parameter";t.exports=n.extends(r,(function(t,e,i,s,o,a,h,l,u,c){n.apply(this,[r,t,u,c]),this.value=i,this.type=e,this.byref=s,this.variadic=o,this.readonly=a,this.nullable=h,this.flags=l||0,this.attrGroups=[]}))},1771:(t,e,i)=>{var n=i(1211),r="parentreference",s=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.raw=t}));t.exports=s},7724:t=>{t.exports=function(t,e,i){this.line=t,this.column=e,this.offset=i}},8377:(t,e,i)=>{var n=i(6210),r="post";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,i,s]),this.type=t,this.what=e}))},5003:(t,e,i)=>{var n=i(6210);t.exports=n.extends("pre",(function(t,e,i,r){n.apply(this,["pre",i,r]),this.type=t,this.what=e}))},6340:(t,e,i)=>{var n=i(1530),r="print";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.expression=t}))},1558:(t,e,i)=>{var n=i(2325),r="program";t.exports=n.extends(r,(function(t,e,i,s,o,a){n.apply(this,[r,t,o,a]),this.errors=e,i&&(this.comments=i),s&&(this.tokens=s)}))},3429:(t,e,i)=>{var n=i(2898),r="property";t.exports=n.extends(r,(function(t,e,i,s,o,a,h,l){n.apply(this,[r,h,l]),this.name=t,this.value=e,this.readonly=i,this.nullable=s,this.type=o,this.attrGroups=a}))},6966:(t,e,i)=>{var n=i(7592),r="propertylookup";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,t,e,i,s])}))},2037:(t,e,i)=>{var n=i(2898),r="propertystatement",s=n.extends(r,(function(t,e,i,s,o){n.apply(this,[r,s,o]),this.properties=e,this.parseFlags(i)}));s.prototype.parseFlags=function(t){-1===t[0]?this.visibility="":null===t[0]?this.visibility=null:0===t[0]?this.visibility="public":1===t[0]?this.visibility="protected":2===t[0]&&(this.visibility="private"),this.isStatic=1===t[1]},t.exports=s},1211:(t,e,i)=>{var n=i(2730),r="reference",s=n.extends(r,(function(t,e,i){n.apply(this,[t||r,e,i])}));t.exports=s},4847:(t,e,i)=>{var n=i(1530),r="retif";t.exports=n.extends(r,(function(t,e,i,s,o){n.apply(this,[r,s,o]),this.test=t,this.trueExpr=e,this.falseExpr=i}))},619:(t,e,i)=>{var n=i(2898),r="return";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.expr=t}))},5182:(t,e,i)=>{var n=i(1211),r="selfreference",s=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.raw=t}));t.exports=s},7228:(t,e,i)=>{var n=i(1530),r="silent";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.expr=t}))},2898:(t,e,i)=>{var n=i(2730),r="statement";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[t||r,e,i])}))},5037:(t,e,i)=>{var n=i(2898),r="static";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.variables=t}))},8409:(t,e,i)=>{var n=i(7592),r="staticlookup";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,t,e,i,s])}))},2941:(t,e,i)=>{var n=i(1211),r="staticreference",s=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.raw=t}));t.exports=s},9732:(t,e,i)=>{var n=i(2730),r="staticvariable";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,i,s]),this.variable=t,this.defaultValue=e}))},7129:(t,e,i)=>{var n=i(6602),r="string";t.exports=n.extends(r,(function(t,e,i,s,o,a){n.apply(this,[r,e,s,o,a]),this.unicode=i,this.isDoubleQuote=t}))},2589:(t,e,i)=>{var n=i(2898),r="switch";t.exports=n.extends(r,(function(t,e,i,s,o){n.apply(this,[r,s,o]),this.test=t,this.body=e,this.shortForm=i}))},5228:(t,e,i)=>{var n=i(2898),r="throw";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.what=t}))},2523:(t,e,i)=>{var n=i(9036),r="trait";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,t,i,s]),this.body=e}))},8084:(t,e,i)=>{var n=i(2730),r="traitalias";t.exports=n.extends(r,(function(t,e,i,s,o,a){n.apply(this,[r,o,a]),this.trait=t,this.method=e,this.as=i,this.visibility="",s&&(0===s[0]?this.visibility="public":1===s[0]?this.visibility="protected":2===s[0]&&(this.visibility="private"))}))},4398:(t,e,i)=>{var n=i(2730),r="traitprecedence";t.exports=n.extends(r,(function(t,e,i,s,o){n.apply(this,[r,s,o]),this.trait=t,this.method=e,this.instead=i}))},3181:(t,e,i)=>{var n=i(2730),r="traituse";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,i,s]),this.traits=t,this.adaptations=e}))},8466:(t,e,i)=>{var n=i(2898);t.exports=n.extends("try",(function(t,e,i,r,s){n.apply(this,["try",r,s]),this.body=t,this.catches=e,this.always=i}))},8062:(t,e,i)=>{var n=i(1211),r="typereference",s=n.extends(r,(function(t,e,i,s){n.apply(this,[r,i,s]),this.name=t,this.raw=e}));s.types=["int","float","string","bool","object","array","callable","iterable","void","static"],t.exports=s},6178:(t,e,i)=>{var n=i(6210),r="unary";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,i,s]),this.type=t,this.what=e}))},7264:(t,e,i)=>{var n=i(9036),r="uniontype";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,null,e,i]),this.types=t}))},2379:(t,e,i)=>{var n=i(2898),r="unset";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.variables=t}))},3693:(t,e,i)=>{var n=i(2898),r="usegroup";t.exports=n.extends(r,(function(t,e,i,s,o){n.apply(this,[r,s,o]),this.name=t,this.type=e,this.items=i}))},7880:(t,e,i)=>{var n=i(2898),r="useitem",s=n.extends(r,(function(t,e,i,s,o){n.apply(this,[r,s,o]),this.name=t,this.alias=e,this.type=i}));s.TYPE_CONST="const",s.TYPE_FUNCTION="function",t.exports=s},6520:(t,e,i)=>{var n=i(1530),r="variable";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,i,s]),this.name=t,this.curly=e||!1}))},3656:(t,e,i)=>{var n=i(1530),r="variadic";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.what=t}))},7886:(t,e,i)=>{var n=i(2730),r="variadicplaceholder";t.exports=n.extends(r,(function(t,e){n.apply(this,[r,t,e])}))},41:(t,e,i)=>{var n=i(2898),r="while";t.exports=n.extends(r,(function(t,e,i,s,o){n.apply(this,[r,s,o]),this.test=t,this.body=e,this.shortForm=i}))},288:(t,e,i)=>{var n=i(1530),r="yield";t.exports=n.extends(r,(function(t,e,i,s){n.apply(this,[r,i,s]),this.value=t,this.key=e}))},8789:(t,e,i)=>{var n=i(1530),r="yieldfrom";t.exports=n.extends(r,(function(t,e,i){n.apply(this,[r,e,i]),this.value=t}))},1427:(t,e,i)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var r=i(8720),s=i(8410),o=i(6455),a=i(555);function h(t,e){for(var i=Object.keys(t),r=i.length;r--;){var s=i[r],o=t[s];null===o?delete e[s]:"function"==typeof o?e[s]=o.bind(e):Array.isArray(o)?e[s]=Array.isArray(e[s])?e[s].concat(o):o:"object"===n(o)?e[s]="object"===n(e[s])?h(o,e[s]):o:e[s]=o}return e}var l=function(t){if("function"==typeof this)return new this(t);if(this.tokens=o,this.lexer=new r(this),this.ast=new a,this.parser=new s(this.lexer,this.ast),t&&"object"===n(t)){if(t.parser&&(t.lexer||(t.lexer={}),t.parser.version)){if("string"==typeof t.parser.version){var e=t.parser.version.split(".");if(e=100*parseInt(e[0])+parseInt(e[1]),isNaN(e))throw new Error("Bad version number : "+t.parser.version);t.parser.version=e}else if("number"!=typeof t.parser.version)throw new Error("Expecting a number for version");if(t.parser.version<500||t.parser.version>900)throw new Error("Can only handle versions between 5.x to 8.x")}h(t,this),this.lexer.version=this.parser.version}},u=function(t){return"function"==typeof t.write?t.toString():t};l.create=function(t){return new l(t)},l.parseEval=function(t,e){return new l(e).parseEval(t)},l.prototype.parseEval=function(t){return this.lexer.mode_eval=!0,this.lexer.all_tokens=!1,t=u(t),this.parser.parse(t,"eval")},l.parseCode=function(t,e,i){return"object"!==n(e)||i||(i=e,e="unknown"),new l(i).parseCode(t,e)},l.prototype.parseCode=function(t,e){return this.lexer.mode_eval=!1,this.lexer.all_tokens=!1,t=u(t),this.parser.parse(t,e)},l.tokenGetAll=function(t,e){return new l(e).tokenGetAll(t)},l.prototype.tokenGetAll=function(t){this.lexer.mode_eval=!1,this.lexer.all_tokens=!0,t=u(t);var e=this.lexer.EOF,i=this.tokens.values;this.lexer.setInput(t);for(var n=this.lexer.lex()||e,r=[];n!=e;){var s=this.lexer.yytext;Object.prototype.hasOwnProperty.call(i,n)&&(s=[i[n],s,this.lexer.yylloc.first_line]),r.push(s),n=this.lexer.lex()||e}return r},t.exports=l,t.exports.tokens=o,t.exports.lexer=r,t.exports.AST=a,t.exports.parser=s,t.exports.combine=h,t.exports.Engine=l,t.exports.default=l},8720:(t,e,i)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var r=function(t){this.engine=t,this.tok=this.engine.tokens.names,this.EOF=1,this.debug=!1,this.all_tokens=!0,this.comment_tokens=!1,this.mode_eval=!1,this.asp_tags=!1,this.short_tags=!1,this.version=801,this.yyprevcol=0,this.keywords={__class__:this.tok.T_CLASS_C,__trait__:this.tok.T_TRAIT_C,__function__:this.tok.T_FUNC_C,__method__:this.tok.T_METHOD_C,__line__:this.tok.T_LINE,__file__:this.tok.T_FILE,__dir__:this.tok.T_DIR,__namespace__:this.tok.T_NS_C,exit:this.tok.T_EXIT,die:this.tok.T_EXIT,function:this.tok.T_FUNCTION,const:this.tok.T_CONST,return:this.tok.T_RETURN,try:this.tok.T_TRY,catch:this.tok.T_CATCH,finally:this.tok.T_FINALLY,throw:this.tok.T_THROW,if:this.tok.T_IF,elseif:this.tok.T_ELSEIF,endif:this.tok.T_ENDIF,else:this.tok.T_ELSE,while:this.tok.T_WHILE,endwhile:this.tok.T_ENDWHILE,do:this.tok.T_DO,for:this.tok.T_FOR,endfor:this.tok.T_ENDFOR,foreach:this.tok.T_FOREACH,endforeach:this.tok.T_ENDFOREACH,declare:this.tok.T_DECLARE,enddeclare:this.tok.T_ENDDECLARE,instanceof:this.tok.T_INSTANCEOF,as:this.tok.T_AS,switch:this.tok.T_SWITCH,endswitch:this.tok.T_ENDSWITCH,case:this.tok.T_CASE,default:this.tok.T_DEFAULT,break:this.tok.T_BREAK,continue:this.tok.T_CONTINUE,goto:this.tok.T_GOTO,echo:this.tok.T_ECHO,print:this.tok.T_PRINT,class:this.tok.T_CLASS,interface:this.tok.T_INTERFACE,trait:this.tok.T_TRAIT,enum:this.tok.T_ENUM,extends:this.tok.T_EXTENDS,implements:this.tok.T_IMPLEMENTS,new:this.tok.T_NEW,clone:this.tok.T_CLONE,var:this.tok.T_VAR,eval:this.tok.T_EVAL,include:this.tok.T_INCLUDE,include_once:this.tok.T_INCLUDE_ONCE,require:this.tok.T_REQUIRE,require_once:this.tok.T_REQUIRE_ONCE,namespace:this.tok.T_NAMESPACE,use:this.tok.T_USE,insteadof:this.tok.T_INSTEADOF,global:this.tok.T_GLOBAL,isset:this.tok.T_ISSET,empty:this.tok.T_EMPTY,__halt_compiler:this.tok.T_HALT_COMPILER,static:this.tok.T_STATIC,abstract:this.tok.T_ABSTRACT,final:this.tok.T_FINAL,private:this.tok.T_PRIVATE,protected:this.tok.T_PROTECTED,public:this.tok.T_PUBLIC,unset:this.tok.T_UNSET,list:this.tok.T_LIST,array:this.tok.T_ARRAY,callable:this.tok.T_CALLABLE,or:this.tok.T_LOGICAL_OR,and:this.tok.T_LOGICAL_AND,xor:this.tok.T_LOGICAL_XOR,match:this.tok.T_MATCH,readonly:this.tok.T_READ_ONLY},this.castKeywords={int:this.tok.T_INT_CAST,integer:this.tok.T_INT_CAST,real:this.tok.T_DOUBLE_CAST,double:this.tok.T_DOUBLE_CAST,float:this.tok.T_DOUBLE_CAST,string:this.tok.T_STRING_CAST,binary:this.tok.T_STRING_CAST,array:this.tok.T_ARRAY_CAST,object:this.tok.T_OBJECT_CAST,bool:this.tok.T_BOOL_CAST,boolean:this.tok.T_BOOL_CAST,unset:this.tok.T_UNSET_CAST}};r.prototype.setInput=function(t){return this._input=t,this.size=t.length,this.yylineno=1,this.offset=0,this.yyprevcol=0,this.yytext="",this.yylloc={first_offset:0,first_line:1,first_column:0,prev_offset:0,prev_line:1,prev_column:0,last_line:1,last_column:0},this.tokens=[],this.version>703?this.keywords.fn=this.tok.T_FN:delete this.keywords.fn,this.done=this.offset>=this.size,!this.all_tokens&&this.mode_eval?(this.conditionStack=["INITIAL"],this.begin("ST_IN_SCRIPTING")):(this.conditionStack=[],this.begin("INITIAL")),this.heredoc_label={label:"",length:0,indentation:0,indentation_uses_spaces:!1,finished:!1,first_encaps_node:!1,toString:function(){this.label}},this},r.prototype.input=function(){var t=this._input[this.offset];return t?(this.yytext+=t,this.offset++,"\r"===t&&"\n"===this._input[this.offset]&&(this.yytext+="\n",this.offset++),"\n"===t||"\r"===t?(this.yylloc.last_line=++this.yylineno,this.yyprevcol=this.yylloc.last_column,this.yylloc.last_column=0):this.yylloc.last_column++,t):""},r.prototype.unput=function(t){if(1===t)this.offset--,"\n"===this._input[this.offset]&&"\r"===this._input[this.offset-1]&&(this.offset--,t++),"\r"===this._input[this.offset]||"\n"===this._input[this.offset]?(this.yylloc.last_line--,this.yylineno--,this.yylloc.last_column=this.yyprevcol):this.yylloc.last_column--,this.yytext=this.yytext.substring(0,this.yytext.length-t);else if(t>0)if(this.offset-=t,t0?this.conditionStack.pop():this.conditionStack[0];if(this.curCondition=this.conditionStack[this.conditionStack.length-1],this.stateCb=this["match"+this.curCondition],"function"!=typeof this.stateCb)throw new Error('Undefined condition state "'+this.curCondition+'"');return t},r.prototype.next=function(){var t;if(this._input||(this.done=!0),this.yylloc.first_offset=this.offset,this.yylloc.first_line=this.yylloc.last_line,this.yylloc.first_column=this.yylloc.last_column,this.yytext="",this.done)return this.yylloc.prev_offset=this.yylloc.first_offset,this.yylloc.prev_line=this.yylloc.first_line,this.yylloc.prev_column=this.yylloc.first_column,this.EOF;if(this.tokens.length>0?("object"===n((t=this.tokens.shift())[1])?this.setState(t[1]):this.consume(t[1]),t=t[0]):t=this.stateCb.apply(this,[]),this.offset>=this.size&&0===this.tokens.length&&(this.done=!0),this.debug){var e=t;e="number"==typeof e?this.engine.tokens.values[e]:'"'+e+'"';var i=new Error(e+"\tfrom "+this.yylloc.first_line+","+this.yylloc.first_column+"\t - to "+this.yylloc.last_line+","+this.yylloc.last_column+'\t"'+this.yytext+'"');console.error(i.stack)}return t},[i(7010),i(438),i(3607),i(7405),i(465),i(5135),i(4437),i(1298),i(5609)].forEach((function(t){for(var e in t)r.prototype[e]=t[e]})),t.exports=r},7010:t=>{t.exports={attributeIndex:0,attributeListDepth:{},matchST_ATTRIBUTE:function(){var t=this.input();if(this.is_WHITESPACE()){do{t=this.input()}while(this.is_WHITESPACE());return this.unput(1),null}switch(t){case"]":return 0===this.attributeListDepth[this.attributeIndex]?(delete this.attributeListDepth[this.attributeIndex],this.attributeIndex--,this.popState()):this.attributeListDepth[this.attributeIndex]--,"]";case"(":case")":case":":case"=":case"|":case"&":case"^":case"-":case"+":case"*":case"%":case"~":case"<":case">":case"!":case".":return this.consume_TOKEN();case"[":return this.attributeListDepth[this.attributeIndex]++,"[";case",":return",";case'"':return this.ST_DOUBLE_QUOTES();case"'":return this.T_CONSTANT_ENCAPSED_STRING();case"/":return"/"===this._input[this.offset]?this.T_COMMENT():"*"===this._input[this.offset]?(this.input(),this.T_DOC_COMMENT()):this.consume_TOKEN()}if(this.is_LABEL_START()||"\\"===t){for(;this.offset{t.exports={T_COMMENT:function(){for(;this.offset"===this._input[this.offset])return this.unput(1),this.tok.T_COMMENT;if("%"===t&&this.aspTagMode&&">"===this._input[this.offset])return this.unput(1),this.tok.T_COMMENT}return this.tok.T_COMMENT},T_DOC_COMMENT:function(){var t=this.input(),e=this.tok.T_COMMENT;if("*"===t){if(t=this.input(),this.is_WHITESPACE()&&(e=this.tok.T_DOC_COMMENT),"/"===t)return e;this.unput(1)}for(;this.offset{t.exports={nextINITIAL:function(){return this.conditionStack.length>1&&"INITIAL"===this.conditionStack[this.conditionStack.length-1]?this.popState():this.begin("ST_IN_SCRIPTING"),this},matchINITIAL:function(){for(;this.offset0&&this.tok.T_INLINE_HTML}}},7405:t=>{t.exports={consume_NUM:function(){var t=this.yytext[0],e="."===t;if("0"===t)if("x"===(t=this.input())||"X"===t){if("_"!==(t=this.input())&&this.is_HEX())return this.consume_HNUM();this.unput(t?2:1)}else if("b"===t||"B"===t){if("_"!==(t=this.input())&&"0"===t||"1"===t)return this.consume_BNUM();this.unput(t?2:1)}else if("o"===t||"O"===t){if("_"!==(t=this.input())&&this.is_OCTAL())return this.consume_ONUM();this.unput(t?2:1)}else this.is_NUM()||t&&this.unput(1);for(;this.offset{t.exports={matchST_LOOKING_FOR_PROPERTY:function(){var t=this.input();if("-"===t){if(">"===(t=this.input()))return this.tok.T_OBJECT_OPERATOR;t&&this.unput(1)}else{if(this.is_WHITESPACE())return this.tok.T_WHITESPACE;if(this.is_LABEL_START())return this.consume_LABEL(),this.popState(),this.tok.T_STRING}return this.popState(),t&&this.unput(1),!1},matchST_LOOKING_FOR_VARNAME:function(){var t=this.input();if(this.popState(),this.begin("ST_IN_SCRIPTING"),this.is_LABEL_START()){if(this.consume_LABEL(),"["===(t=this.input())||"}"===t)return this.unput(1),this.tok.T_STRING_VARNAME;this.unput(this.yytext.length)}else t&&this.unput(1);return!1},matchST_VAR_OFFSET:function(){var t=this.input();if(this.is_NUM_START())return this.consume_NUM(),this.tok.T_NUM_STRING;if("]"===t)return this.popState(),"]";if("$"===t){if(this.input(),this.is_LABEL_START())return this.consume_LABEL(),this.tok.T_VARIABLE;throw new Error("Unexpected terminal")}if(this.is_LABEL_START())return this.consume_LABEL(),this.tok.T_STRING;if(this.is_WHITESPACE()||"\\"===t||"'"===t||"#"===t)return this.tok.T_ENCAPSED_AND_WHITESPACE;if("["===t||"{"===t||"}"===t||'"'===t||"`"===t||this.is_TOKEN())return t;throw new Error("Unexpected terminal")}}},5135:t=>{t.exports={matchST_IN_SCRIPTING:function(){var t=this.input();switch(t){case" ":case"\t":case"\n":case"\r":case"\r\n":return this.T_WHITESPACE();case"#":return this.version>=800&&"["===this._input[this.offset]?(this.input(),this.attributeListDepth[++this.attributeIndex]=0,this.begin("ST_ATTRIBUTE"),this.tok.T_ATTRIBUTE):this.T_COMMENT();case"/":return"/"===this._input[this.offset]?this.T_COMMENT():"*"===this._input[this.offset]?(this.input(),this.T_DOC_COMMENT()):this.consume_TOKEN();case"'":return this.T_CONSTANT_ENCAPSED_STRING();case'"':return this.ST_DOUBLE_QUOTES();case"`":return this.begin("ST_BACKQUOTE"),"`";case"?":if(!this.aspTagMode&&this.tryMatch(">")){this.input();var e=this._input[this.offset];return"\n"!==e&&"\r"!==e||this.input(),this.conditionStack.length>1&&this.begin("INITIAL"),this.tok.T_CLOSE_TAG}return this.consume_TOKEN();case"%":return this.aspTagMode&&">"===this._input[this.offset]?(this.input(),"\n"!==(t=this._input[this.offset])&&"\r"!==t||this.input(),this.aspTagMode=!1,this.conditionStack.length>1&&this.begin("INITIAL"),this.tok.T_CLOSE_TAG):this.consume_TOKEN();case"{":return this.begin("ST_IN_SCRIPTING"),"{";case"}":return this.conditionStack.length>2&&this.popState(),"}";default:if("."===t){if(t=this.input(),this.is_NUM_START())return this.consume_NUM();t&&this.unput(1)}if(this.is_NUM_START())return this.consume_NUM();if(this.is_LABEL_START())return this.consume_LABEL().T_STRING();if(this.is_TOKEN())return this.consume_TOKEN()}throw new Error('Bad terminal sequence "'+t+'" at line '+this.yylineno+" (offset "+this.offset+")")},T_WHITESPACE:function(){for(;this.offset{var e=["\n","\r"],i=["\n","\r",";"],n=i.concat(["\t"," ",",","]",")","/","=","!"]);t.exports={T_CONSTANT_ENCAPSED_STRING:function(){for(var t;this.offset2&&this.appendToken(this.tok.T_ENCAPSED_AND_WHITESPACE,this.yytext.length-e),this.unput(this.yytext.length-e),this.begin("ST_DOUBLE_QUOTES"),this.yytext},isDOC_MATCH:function(t,r){var s=this._input[t-2];if(!e.includes(s))return!1;var o=!1,a=!1,h=0,l=this._input[t-1];if(this.version>=703){for(;"\t"===l||" "===l;)" "===l?o=!0:"\t"===l&&(a=!0),l=this._input[t+h],h++;if(t+=h,e.includes(this._input[t-1]))return!1}if(this._input.substring(t-1,t-1+this.heredoc_label.length)===this.heredoc_label.label){var u=this._input[t-1+this.heredoc_label.length];if((this.version>=703?n:i).includes(u)){if(r){if(this.consume(h),o&&a)throw new Error("Parse error: mixing spaces and tabs in ending marker at line "+this.yylineno+" (offset "+this.offset+")")}else this.heredoc_label.indentation=h,this.heredoc_label.indentation_uses_spaces=o,this.heredoc_label.first_encaps_node=!0;return!0}}return!1},prematch_ENDOFDOC:function(){this.heredoc_label.indentation_uses_spaces=!1,this.heredoc_label.indentation=0,this.heredoc_label.first_encaps_node=!0;for(var t=this.offset+1;t2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){var i=this.offset,n=this.consume_VARIABLE();return this.yytext.length>this.offset-i+2?(this.appendToken(n,this.offset-i+2),this.unput(this.offset-i+2),this.tok.T_ENCAPSED_AND_WHITESPACE):n}}else if("{"===t){if("$"===(t=this.input()))return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN)}else t=this.input();return this.tok.T_ENCAPSED_AND_WHITESPACE},consume_VARIABLE:function(){this.consume_LABEL();var t=this.input();if("["==t)return this.unput(1),this.begin("ST_VAR_OFFSET"),this.tok.T_VARIABLE;if("-"===t){if(">"===this.input())return this.input(),this.is_LABEL_START()&&this.begin("ST_LOOKING_FOR_PROPERTY"),this.unput(3),this.tok.T_VARIABLE;this.unput(2)}else t&&this.unput(1);return this.tok.T_VARIABLE},matchST_BACKQUOTE:function(){var t=this.input();if("$"===t){if("{"===(t=this.input()))return this.begin("ST_LOOKING_FOR_VARNAME"),this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START())return this.consume_VARIABLE()}else if("{"===t){if("$"===this._input[this.offset])return this.begin("ST_IN_SCRIPTING"),this.tok.T_CURLY_OPEN}else if("`"===t)return this.popState(),"`";for(;this.offset2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){var e=this.offset,i=this.consume_VARIABLE();return this.yytext.length>this.offset-e+2?(this.appendToken(i,this.offset-e+2),this.unput(this.offset-e+2),this.tok.T_ENCAPSED_AND_WHITESPACE):i}continue}if("{"===t){if("$"===(t=this.input()))return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN);continue}}t=this.input()}return this.tok.T_ENCAPSED_AND_WHITESPACE},matchST_DOUBLE_QUOTES:function(){var t=this.input();if("$"===t){if("{"===(t=this.input()))return this.begin("ST_LOOKING_FOR_VARNAME"),this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START())return this.consume_VARIABLE()}else if("{"===t){if("$"===this._input[this.offset])return this.begin("ST_IN_SCRIPTING"),this.tok.T_CURLY_OPEN}else if('"'===t)return this.popState(),'"';for(;this.offset2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){var e=this.offset,i=this.consume_VARIABLE();return this.yytext.length>this.offset-e+2?(this.appendToken(i,this.offset-e+2),this.unput(this.offset-e+2),this.tok.T_ENCAPSED_AND_WHITESPACE):i}t&&this.unput(1)}else if("{"===t){if("$"===(t=this.input()))return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN);t&&this.unput(1)}}t=this.input()}return this.tok.T_ENCAPSED_AND_WHITESPACE}}},1298:t=>{t.exports={T_STRING:function(){var t=this.yytext.toLowerCase(),e=this.keywords[t];if("number"!=typeof e)if("yield"===t)this.version>=700&&this.tryMatch(" from")?(this.consume(5),e=this.tok.T_YIELD_FROM):e=this.tok.T_YIELD;else if(e=this.tok.T_STRING,"b"===t||"B"===t){var i=this.input();if('"'===i)return this.ST_DOUBLE_QUOTES();if("'"===i)return this.T_CONSTANT_ENCAPSED_STRING();i&&this.unput(1)}if(e===this.tok.T_ENUM){if(this.version<801)return this.tok.T_STRING;for(var n=this.offset,r=this.input();" "==r;)r=this.input();var s=!1;if(this.is_LABEL_START()){for(;this.is_LABEL();)r+=this.input();var o=r.slice(0,-1).toLowerCase();s="extends"!==o&&"implements"!==o}return this.unput(this.offset-n),s?this.tok.T_ENUM:this.tok.T_STRING}if(this.offset"===t?(this.begin("ST_LOOKING_FOR_PROPERTY").input(),this.tok.T_OBJECT_OPERATOR):"-"===t?(this.input(),this.tok.T_DEC):"="===t?(this.input(),this.tok.T_MINUS_EQUAL):"-"},"\\":function(){if(this.offset"===t?(this.input(),this.tok.T_DOUBLE_ARROW):"="===t?"="===this._input[this.offset+1]?(this.consume(2),this.tok.T_IS_IDENTICAL):(this.input(),this.tok.T_IS_EQUAL):"="},"+":function(){var t=this._input[this.offset];return"+"===t?(this.input(),this.tok.T_INC):"="===t?(this.input(),this.tok.T_PLUS_EQUAL):"+"},"!":function(){return"="===this._input[this.offset]?"="===this._input[this.offset+1]?(this.consume(2),this.tok.T_IS_NOT_IDENTICAL):(this.input(),this.tok.T_IS_NOT_EQUAL):"!"},"?":function(){return this.version>=700&&"?"===this._input[this.offset]?this.version>=704&&"="===this._input[this.offset+1]?(this.consume(2),this.tok.T_COALESCE_EQUAL):(this.input(),this.tok.T_COALESCE):this.version>=800&&"-"===this._input[this.offset]&&">"===this._input[this.offset+1]?(this.consume(2),this.tok.T_NULLSAFE_OBJECT_OPERATOR):"?"},"<":function(){var t=this._input[this.offset];return"<"===t?"="===(t=this._input[this.offset+1])?(this.consume(2),this.tok.T_SL_EQUAL):"<"===t&&this.is_HEREDOC()?this.tok.T_START_HEREDOC:(this.input(),this.tok.T_SL):"="===t?(this.input(),this.version>=700&&">"===this._input[this.offset]?(this.input(),this.tok.T_SPACESHIP):this.tok.T_IS_SMALLER_OR_EQUAL):">"===t?(this.input(),this.tok.T_IS_NOT_EQUAL):"<"},">":function(){var t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_IS_GREATER_OR_EQUAL):">"===t?"="===(t=this._input[this.offset+1])?(this.consume(2),this.tok.T_SR_EQUAL):(this.input(),this.tok.T_SR):">"},"*":function(){var t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_MUL_EQUAL):"*"===t?(this.input(),"="===this._input[this.offset]?(this.input(),this.tok.T_POW_EQUAL):this.tok.T_POW):"*"},".":function(){var t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_CONCAT_EQUAL):"."===t&&"."===this._input[this.offset+1]?(this.consume(2),this.tok.T_ELLIPSIS):"."},"%":function(){return"="===this._input[this.offset]?(this.input(),this.tok.T_MOD_EQUAL):"%"},"&":function(){var t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_AND_EQUAL):"&"===t?(this.input(),this.tok.T_BOOLEAN_AND):"&"},"|":function(){var t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_OR_EQUAL):"|"===t?(this.input(),this.tok.T_BOOLEAN_OR):"|"},"^":function(){return"="===this._input[this.offset]?(this.input(),this.tok.T_XOR_EQUAL):"^"}}}},5609:t=>{t.exports={is_NUM:function(){var t=this._input.charCodeAt(this.offset-1);return t>47&&t<58||95===t},is_NUM_START:function(){var t=this._input.charCodeAt(this.offset-1);return t>47&&t<58},is_LABEL:function(){var t=this._input.charCodeAt(this.offset-1);return t>96&&t<123||t>64&&t<91||95===t||t>47&&t<58||t>126},is_LABEL_START:function(){var t=this._input.charCodeAt(this.offset-1);return t>64&&t<91||t>96&&t<123||95===t||t>126},consume_LABEL:function(){for(;this.offset?@".indexOf(t)},is_WHITESPACE:function(){var t=this._input[this.offset-1];return" "===t||"\t"===t||"\n"===t||"\r"===t},is_TABSPACE:function(){var t=this._input[this.offset-1];return" "===t||"\t"===t},consume_TABSPACE:function(){for(;this.offset47&&t<58||t>64&&t<71||t>96&&t<103||95===t},is_OCTAL:function(){var t=this._input.charCodeAt(this.offset-1);return t>47&&t<56||95===t}}},8410:(t,e,i)=>{var n=i(7724);function r(t){return"."!=t&&","!=t&&!isNaN(parseFloat(t))&&isFinite(t)}var s=function(t,e){this.lexer=t,this.ast=e,this.tok=t.tok,this.EOF=t.EOF,this.token=null,this.prev=null,this.debug=!1,this.version=801,this.extractDoc=!1,this.extractTokens=!1,this.suppressErrors=!1;var i=function(t){return[t,null]};this.entries={IDENTIFIER:new Map([this.tok.T_ABSTRACT,this.tok.T_ARRAY,this.tok.T_AS,this.tok.T_BREAK,this.tok.T_CALLABLE,this.tok.T_CASE,this.tok.T_CATCH,this.tok.T_CLASS,this.tok.T_CLASS_C,this.tok.T_CLONE,this.tok.T_CONST,this.tok.T_CONTINUE,this.tok.T_DECLARE,this.tok.T_DEFAULT,this.tok.T_DIR,this.tok.T_DO,this.tok.T_ECHO,this.tok.T_ELSE,this.tok.T_ELSEIF,this.tok.T_EMPTY,this.tok.T_ENDDECLARE,this.tok.T_ENDFOR,this.tok.T_ENDFOREACH,this.tok.T_ENDIF,this.tok.T_ENDSWITCH,this.tok.T_ENDWHILE,this.tok.T_ENUM,this.tok.T_EVAL,this.tok.T_EXIT,this.tok.T_EXTENDS,this.tok.T_FILE,this.tok.T_FINAL,this.tok.T_FINALLY,this.tok.T_FN,this.tok.T_FOR,this.tok.T_FOREACH,this.tok.T_FUNC_C,this.tok.T_FUNCTION,this.tok.T_GLOBAL,this.tok.T_GOTO,this.tok.T_IF,this.tok.T_IMPLEMENTS,this.tok.T_INCLUDE,this.tok.T_INCLUDE_ONCE,this.tok.T_INSTANCEOF,this.tok.T_INSTEADOF,this.tok.T_INTERFACE,this.tok.T_ISSET,this.tok.T_LINE,this.tok.T_LIST,this.tok.T_LOGICAL_AND,this.tok.T_LOGICAL_OR,this.tok.T_LOGICAL_XOR,this.tok.T_MATCH,this.tok.T_METHOD_C,this.tok.T_NAMESPACE,this.tok.T_NEW,this.tok.T_NS_C,this.tok.T_PRINT,this.tok.T_PRIVATE,this.tok.T_PROTECTED,this.tok.T_PUBLIC,this.tok.T_READ_ONLY,this.tok.T_REQUIRE,this.tok.T_REQUIRE_ONCE,this.tok.T_RETURN,this.tok.T_STATIC,this.tok.T_SWITCH,this.tok.T_THROW,this.tok.T_TRAIT,this.tok.T_TRY,this.tok.T_UNSET,this.tok.T_USE,this.tok.T_VAR,this.tok.T_WHILE,this.tok.T_YIELD].map(i)),VARIABLE:new Map([this.tok.T_VARIABLE,"$","&",this.tok.T_STRING,this.tok.T_NAME_RELATIVE,this.tok.T_NAME_QUALIFIED,this.tok.T_NAME_FULLY_QUALIFIED,this.tok.T_NAMESPACE,this.tok.T_STATIC].map(i)),SCALAR:new Map([this.tok.T_CONSTANT_ENCAPSED_STRING,this.tok.T_START_HEREDOC,this.tok.T_LNUMBER,this.tok.T_DNUMBER,this.tok.T_ARRAY,"[",this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C,'"','b"','B"',"-",this.tok.T_NS_SEPARATOR].map(i)),T_MAGIC_CONST:new Map([this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C].map(i)),T_MEMBER_FLAGS:new Map([this.tok.T_PUBLIC,this.tok.T_PRIVATE,this.tok.T_PROTECTED,this.tok.T_STATIC,this.tok.T_ABSTRACT,this.tok.T_FINAL].map(i)),EOS:new Map([";",this.EOF,this.tok.T_INLINE_HTML].map(i)),EXPR:new Map(["@","-","+","!","~","(","`",this.tok.T_LIST,this.tok.T_CLONE,this.tok.T_INC,this.tok.T_DEC,this.tok.T_NEW,this.tok.T_ISSET,this.tok.T_EMPTY,this.tok.T_MATCH,this.tok.T_INCLUDE,this.tok.T_INCLUDE_ONCE,this.tok.T_REQUIRE,this.tok.T_REQUIRE_ONCE,this.tok.T_EVAL,this.tok.T_INT_CAST,this.tok.T_DOUBLE_CAST,this.tok.T_STRING_CAST,this.tok.T_ARRAY_CAST,this.tok.T_OBJECT_CAST,this.tok.T_BOOL_CAST,this.tok.T_UNSET_CAST,this.tok.T_EXIT,this.tok.T_PRINT,this.tok.T_YIELD,this.tok.T_STATIC,this.tok.T_FUNCTION,this.tok.T_FN,this.tok.T_VARIABLE,"$",this.tok.T_NS_SEPARATOR,this.tok.T_STRING,this.tok.T_NAME_RELATIVE,this.tok.T_NAME_QUALIFIED,this.tok.T_NAME_FULLY_QUALIFIED,this.tok.T_STRING,this.tok.T_CONSTANT_ENCAPSED_STRING,this.tok.T_START_HEREDOC,this.tok.T_LNUMBER,this.tok.T_DNUMBER,this.tok.T_ARRAY,"[",this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C,'"','b"','B"',"-",this.tok.T_NS_SEPARATOR].map(i))}};s.prototype.getTokenName=function(t){return r(t)?t==this.EOF?"the end of file (EOF)":this.lexer.engine.tokens.values[t]:"'"+t+"'"},s.prototype.parse=function(t,e){this._errors=[],this.filename=e||"eval",this.currentNamespace=[""],this.extractDoc?this._docs=[]:this._docs=null,this.extractTokens?this._tokens=[]:this._tokens=null,this._docIndex=0,this._lastNode=null,this.lexer.setInput(t),this.lexer.all_tokens=this.extractTokens,this.lexer.comment_tokens=this.extractDoc,this.length=this.lexer._input.length,this.innerList=!1,this.innerListForm=!1;var i=this.node("program"),n=[];for(this.next();this.token!=this.EOF;)n.push(this.read_start());0===n.length&&this.extractDoc&&this._docs.length>this._docIndex&&n.push(this.node("noop")()),this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset];var r=i(n,this._errors,this._docs,this._tokens);if(this.debug){var s=this.ast.checkNodes();if(s.length>0)throw s.forEach((function(t){t.position&&console.log("Node at line "+t.position.line+", column "+t.position.column),console.log(t.stack.join("\n"))})),new Error("Some nodes are not closed")}return r},s.prototype.raiseError=function(t,e,i,n){if(t+=" on line "+this.lexer.yylloc.first_line,!this.suppressErrors){var r=new SyntaxError(t,this.filename,this.lexer.yylloc.first_line);throw r.lineNumber=this.lexer.yylloc.first_line,r.fileName=this.filename,r.columnNumber=this.lexer.yylloc.first_column,r}var s=this.ast.prepare("error",null,this)(t,n,this.lexer.yylloc.first_line,i);return this._errors.push(s),s},s.prototype.error=function(t){var e="Parse Error : syntax error",i=this.getTokenName(this.token),n="";if(this.token!==this.EOF){if(r(this.token)){var s=this.text();s.length>10&&(s=s.substring(0,7)+"..."),i="'"+s+"' ("+i+")"}e+=", unexpected "+i}return t&&!Array.isArray(t)&&((r(t)||1===t.length)&&(n=", expecting "+this.getTokenName(t)),e+=n),this.raiseError(e,n,t,i)},s.prototype.position=function(){return new n(this.lexer.yylloc.first_line,this.lexer.yylloc.first_column,this.lexer.yylloc.first_offset)},s.prototype.node=function(t){if(this.extractDoc){var e=null;this._docIndexe);i++);i>this._docIndex&&(this._lastNode.setTrailingComments(this._docs.slice(this._docIndex,i)),this._docIndex=i)}else this.token===this.EOF&&(t.setTrailingComments(this._docs.slice(this._docIndex)),this._docIndex=this._docs.length);this._lastNode=t}.bind(this),i}return this.ast.prepare(t,null,this)},s.prototype.expectEndOfStatement=function(t){if(";"===this.token)t&&";"===this.lexer.yytext&&t.includeToken(this);else if(this.token!==this.tok.T_INLINE_HTML&&this.token!==this.EOF)return this.error(";"),!1;return this.next(),!0};var o=["parser.next","parser.node","parser.showlog"];s.prototype.showlog=function(){for(var t,e=(new Error).stack.split("\n"),i=2;i"+this.lexer.yytext+"< @--\x3e"+t),this},s.prototype.expect=function(t){if(Array.isArray(t)){if(-1===t.indexOf(this.token))return this.error(t),!1}else if(this.token!=t)return this.error(t),!1;return!0},s.prototype.text=function(){return this.lexer.yytext},s.prototype.next=function(){if(";"===this.token&&";"!==this.lexer.yytext||(this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset]),this.lex(),this.debug&&this.showlog(),this.extractDoc)for(;this.token===this.tok.T_COMMENT||this.token===this.tok.T_DOC_COMMENT;)this.token===this.tok.T_COMMENT?this._docs.push(this.read_comment()):this._docs.push(this.read_doc_comment());return this},s.prototype.peek=function(){var t=this.lexer.getState(),e=this.lexer.lex();return this.lexer.setState(t),e},s.prototype.lex=function(){if(this.extractTokens)do{if(this.token=this.lexer.lex()||this.EOF,this.token===this.EOF)return this;var t=this.lexer.yytext;if(t=Object.prototype.hasOwnProperty.call(this.lexer.engine.tokens.values,this.token)?[this.lexer.engine.tokens.values[this.token],t,this.lexer.yylloc.first_line,this.lexer.yylloc.first_offset,this.lexer.offset]:[null,t,this.lexer.yylloc.first_line,this.lexer.yylloc.first_offset,this.lexer.offset],this._tokens.push(t),this.token===this.tok.T_CLOSE_TAG)return this.token=";",this;if(this.token===this.tok.T_OPEN_TAG_WITH_ECHO)return this.token=this.tok.T_ECHO,this}while(this.token===this.tok.T_WHITESPACE||!this.extractDoc&&(this.token===this.tok.T_COMMENT||this.token===this.tok.T_DOC_COMMENT)||this.token===this.tok.T_OPEN_TAG);else this.token=this.lexer.lex()||this.EOF;return this},s.prototype.is=function(t){return Array.isArray(t)?-1!==t.indexOf(this.token):this.entries[t].has(this.token)},[i(3665),i(8342),i(9673),i(3166),i(847),i(2706),i(4002),i(3745),i(9905),i(1250),i(9889),i(4992),i(7991),i(4544),i(9957),i(1099)].forEach((function(t){for(var e in t){if(Object.prototype.hasOwnProperty.call(s.prototype,e))throw new Error("Function "+e+" is already defined - collision");s.prototype[e]=t[e]}})),t.exports=s},3665:t=>{t.exports={read_array:function(){var t=null,e=!1,i=this.node("array");this.token===this.tok.T_ARRAY?(this.next().expect("("),t=")"):(e=!0,t="]");var n=[];return this.next().token!==t&&(n=this.read_array_pair_list(e)),this.expect(t),this.next(),i(e,n)},read_array_pair_list:function(t){var e=this;return this.read_list((function(){return e.read_array_pair(t)}),",",!0)},read_array_pair:function(t){if(!(!t&&")"===this.token||t&&"]"===this.token)){if(","===this.token)return this.node("noop")();var e=this.node("entry"),i=null,n=null,r=!1,s=!1;if("&"===this.token)this.next(),r=!0,n=this.read_variable(!0,!1);else if(this.token===this.tok.T_ELLIPSIS&&this.version>=704)this.next(),"&"===this.token&&this.error(),s=!0,n=this.read_expr();else{var o=this.read_expr();this.token===this.tok.T_DOUBLE_ARROW?(this.next(),i=o,"&"===this.token?(this.next(),r=!0,n=this.read_variable(!0,!1)):n=this.read_expr()):n=o}return e(i,n,r,s)}}}},8342:t=>{function e(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||i(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){if(t){if("string"==typeof t)return n(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(t,e):void 0}}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i=801&&this.token===this.tok.T_READ_ONLY||this.version>=704&&("?"===this.token||this.token===this.tok.T_ARRAY||this.token===this.tok.T_CALLABLE||this.token===this.tok.T_NAMESPACE||this.token===this.tok.T_NAME_FULLY_QUALIFIED||this.token===this.tok.T_NAME_QUALIFIED||this.token===this.tok.T_NAME_RELATIVE||this.token===this.tok.T_NS_SEPARATOR||this.token===this.tok.T_STRING))){var h=this.read_variable_list(a,r);r=[],this.expect(";"),this.next(),n=n.concat(h)}else this.error([this.tok.T_CONST].concat(e(t?[this.tok.T_VARIABLE]:[]),e(i?[this.tok.T_CASE]:[]),[this.tok.T_FUNCTION])),this.next();else{var l=this.read_constant_list(a,r);this.expect(";")&&this.next(),n=n.concat(l)}}else n=n.concat(this.read_trait_use_statement());else n.push(this.read_doc_comment());else n.push(this.read_comment());return this.expect("}"),this.next(),n},read_variable_list:function(t,e){var n=this.node("propertystatement"),r=this.read_list((function(){var t=this.node("property"),n=!1;this.token===this.tok.T_READ_ONLY&&(n=!0,this.next());var r,s,o=(r=this.read_optional_type(),s=2,function(t){if(Array.isArray(t))return t}(r)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,r,s,o,a=[],h=!0,l=!1;try{if(s=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;h=!1}else for(;!(h=(n=s.call(i)).done)&&(a.push(n.value),a.length!==e);h=!0);}catch(t){l=!0,r=t}finally{try{if(!h&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(l)throw r}}return a}}(r,s)||i(r,s)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=o[0],h=o[1];this.expect(this.tok.T_VARIABLE);var l=this.node("identifier"),u=this.text().substring(1);return this.next(),l=l(u),";"===this.token||","===this.token?t(l,null,n,a,h,e||[]):"="===this.token?t(l,this.next().read_expr(),n,a,h,e||[]):(this.expect([",",";","="]),t(l,null,a,h,e||[]))}),",");return n(null,r,t)},read_constant_list:function(t,e){this.expect(this.tok.T_CONST)&&this.next();var i=this.node("classconstant"),n=this.read_list((function(){var t=this.node("constant"),e=null,i=null;if(this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){e=this.node("identifier");var n=this.text();this.next(),e=e(n)}else this.expect("IDENTIFIER");return this.expect("=")&&(i=this.next().read_expr()),t(e,i)}),",");return i(null,n,t,e||[])},read_member_flags:function(t){var e=[-1,-1,-1];if(this.is("T_MEMBER_FLAGS")){var i=0,n=0;do{switch(this.token){case this.tok.T_PUBLIC:i=0,n=0;break;case this.tok.T_PROTECTED:i=0,n=1;break;case this.tok.T_PRIVATE:i=0,n=2;break;case this.tok.T_STATIC:i=1,n=1;break;case this.tok.T_ABSTRACT:i=2,n=1;break;case this.tok.T_FINAL:i=2,n=2}t&&(0==i&&2==n?(this.expect([this.tok.T_PUBLIC,this.tok.T_PROTECTED]),n=-1):2==i&&1==n&&(this.error(),n=-1)),-1!==e[i]?this.error():-1!==n&&(e[i]=n)}while(this.next().is("T_MEMBER_FLAGS"))}return-1==e[1]&&(e[1]=0),-1==e[2]&&(e[2]=0),e},read_optional_type:function(){var t=!1;"?"===this.token&&(t=!0,this.next());var e=this.read_types();if(t&&!e&&this.raiseError("Expecting a type definition combined with nullable operator"),!t&&!e)return[!1,null];if("|"===this.token){e=[e];do{this.next();var i=this.read_type();if(!i){this.raiseError("Expecting a type definition");break}e.push(i)}while("|"===this.token)}return[t,e]},read_interface_declaration_statement:function(t){var e=this.node("interface");if(this.token!==this.tok.T_INTERFACE)return this.error(this.tok.T_INTERFACE),this.next(),null;this.next().expect(this.tok.T_STRING);var i=this.node("identifier"),n=this.text();this.next(),i=i(n);var r=this.read_interface_extends_list();return this.expect("{"),e(i,r,this.next().read_interface_body(),t||[])},read_interface_body:function(){for(var t=[],e=[];this.token!==this.EOF&&"}"!==this.token;)if(this.token!==this.tok.T_COMMENT)if(this.token!==this.tok.T_DOC_COMMENT){var i=this.position();e=this.read_attr_list();var n=this.read_member_flags(!0);if(this.token==this.tok.T_CONST){var r=this.read_constant_list(n,e);this.expect(";")&&this.next(),t=t.concat(r),e=[]}else if(this.token===this.tok.T_FUNCTION){var s=this.read_function_declaration(2,n,e,i);s.parseFlags(n),t.push(s),this.expect(";")&&this.next(),e=[]}else this.error([this.tok.T_CONST,this.tok.T_FUNCTION]),this.next()}else t.push(this.read_doc_comment());else t.push(this.read_comment());return this.expect("}")&&this.next(),t},read_trait_declaration_statement:function(){var t=this.node("trait");if(this.token!==this.tok.T_TRAIT)return this.error(this.tok.T_TRAIT),this.next(),null;this.next().expect(this.tok.T_STRING);var e=this.node("identifier"),i=this.text();return this.next(),e=e(i),this.expect("{"),t(e,this.next().read_class_body(!0,!1))},read_trait_use_statement:function(){var t=this.node("traituse");this.expect(this.tok.T_USE)&&this.next();for(var e=[this.read_namespace_name()],i=null;","===this.token;)e.push(this.next().read_namespace_name());if("{"===this.token){for(i=[];this.next().token!==this.EOF&&"}"!==this.token;)i.push(this.read_trait_use_alias()),this.expect(";");this.expect("}")&&this.next()}else this.expect(";")&&this.next();return t(e,i)},read_trait_use_alias:function(){var t,e=this.node(),i=null;if(this.is("IDENTIFIER")){t=this.node("identifier");var n=this.text();this.next(),t=t(n)}else if(t=this.read_namespace_name(),this.token===this.tok.T_DOUBLE_COLON)if(this.next(),this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){i=t,t=this.node("identifier");var r=this.text();this.next(),t=t(r)}else this.expect(this.tok.T_STRING);else t=t.name;if(this.token===this.tok.T_INSTEADOF)return e("traitprecedence",i,t,this.next().read_name_list());if(this.token===this.tok.T_AS){var s=null,o=null;if(this.next().is("T_MEMBER_FLAGS")&&(s=this.read_member_flags()),this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){o=this.node("identifier");var a=this.text();this.next(),o=o(a)}else!1===s&&this.expect(this.tok.T_STRING);return e("traitalias",i,t,o,s)}return this.expect([this.tok.T_AS,this.tok.T_INSTEADOF]),e("traitalias",i,t,null,null)}}},9673:t=>{t.exports={read_comment:function(){var t=this.text(),e=this.ast.prepare("/*"===t.substring(0,2)?"commentblock":"commentline",null,this),i=this.lexer.yylloc.first_offset,n=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),(e=e(t)).offset=i,this.prev=n,e},read_doc_comment:function(){var t=this.ast.prepare("commentblock",null,this),e=this.lexer.yylloc.first_offset,i=this.text(),n=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),(t=t(i)).offset=e,this.prev=n,t}}},847:t=>{t.exports={read_enum_declaration_statement:function(t){var e=this.node("enum");if(!this.expect(this.tok.T_ENUM))return null;this.next().expect(this.tok.T_STRING);var i=this.node("identifier"),n=this.text();this.next(),i=i(n);var r=this.read_enum_value_type(),s=this.read_implements_list();this.expect("{");var o=e(i,r,s,this.next().read_class_body(!1,!0));return t&&(o.attrGroups=t),o},read_enum_value_type:function(){return":"===this.token?this.next().read_namespace_name():null},read_enum_case:function(){this.expect(this.tok.T_CASE);var t=this.node("enumcase"),e=this.node("identifier"),i=this.next().text();this.next(),e=e(i);var n="="===this.token?this.next().read_expr():null;return this.expect(";"),t(e,n)}}},3166:t=>{t.exports={read_expr:function(t){var e=this.node();if("@"===this.token)return t||(t=this.next().read_expr()),e("silent",t);if(t||(t=this.read_expr_item()),"|"===this.token)return e("bin","|",t,this.next().read_expr());if("&"===this.token)return e("bin","&",t,this.next().read_expr());if("^"===this.token)return e("bin","^",t,this.next().read_expr());if("."===this.token)return e("bin",".",t,this.next().read_expr());if("+"===this.token)return e("bin","+",t,this.next().read_expr());if("-"===this.token)return e("bin","-",t,this.next().read_expr());if("*"===this.token)return e("bin","*",t,this.next().read_expr());if("/"===this.token)return e("bin","/",t,this.next().read_expr());if("%"===this.token)return e("bin","%",t,this.next().read_expr());if(this.token===this.tok.T_POW)return e("bin","**",t,this.next().read_expr());if(this.token===this.tok.T_SL)return e("bin","<<",t,this.next().read_expr());if(this.token===this.tok.T_SR)return e("bin",">>",t,this.next().read_expr());if(this.token===this.tok.T_BOOLEAN_OR)return e("bin","||",t,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_OR)return e("bin","or",t,this.next().read_expr());if(this.token===this.tok.T_BOOLEAN_AND)return e("bin","&&",t,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_AND)return e("bin","and",t,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_XOR)return e("bin","xor",t,this.next().read_expr());if(this.token===this.tok.T_IS_IDENTICAL)return e("bin","===",t,this.next().read_expr());if(this.token===this.tok.T_IS_NOT_IDENTICAL)return e("bin","!==",t,this.next().read_expr());if(this.token===this.tok.T_IS_EQUAL)return e("bin","==",t,this.next().read_expr());if(this.token===this.tok.T_IS_NOT_EQUAL)return e("bin","!=",t,this.next().read_expr());if("<"===this.token)return e("bin","<",t,this.next().read_expr());if(">"===this.token)return e("bin",">",t,this.next().read_expr());if(this.token===this.tok.T_IS_SMALLER_OR_EQUAL)return e("bin","<=",t,this.next().read_expr());if(this.token===this.tok.T_IS_GREATER_OR_EQUAL)return e("bin",">=",t,this.next().read_expr());if(this.token===this.tok.T_SPACESHIP)return e("bin","<=>",t,this.next().read_expr());if(this.token===this.tok.T_INSTANCEOF&&(t=e("bin","instanceof",t,this.next().read_class_name_reference()),";"!==this.token&&this.token!==this.tok.T_INLINE_HTML&&this.token!==this.EOF&&(t=this.read_expr(t))),this.token===this.tok.T_COALESCE)return e("bin","??",t,this.next().read_expr());if("?"===this.token){var i=null;return":"!==this.next().token&&(i=this.read_expr()),this.expect(":")&&this.next(),e("retif",t,i,this.read_expr())}return e.destroy(t),t},read_expr_cast:function(t){return this.node("cast")(t,this.text(),this.next().read_expr())},read_isset_variable:function(){return this.read_expr()},read_isset_variables:function(){return this.read_function_list(this.read_isset_variable,",")},read_internal_functions_in_yacc:function(){var t=null;switch(this.token){case this.tok.T_ISSET:t=this.node("isset"),this.next().expect("(")&&this.next();var e=this.read_isset_variables();this.expect(")")&&this.next(),t=t(e);break;case this.tok.T_EMPTY:t=this.node("empty"),this.next().expect("(")&&this.next();var i=this.read_expr();this.expect(")")&&this.next(),t=t(i);break;case this.tok.T_INCLUDE:t=this.node("include")(!1,!1,this.next().read_expr());break;case this.tok.T_INCLUDE_ONCE:t=this.node("include")(!0,!1,this.next().read_expr());break;case this.tok.T_EVAL:t=this.node("eval"),this.next().expect("(")&&this.next();var n=this.read_expr();this.expect(")")&&this.next(),t=t(n);break;case this.tok.T_REQUIRE:t=this.node("include")(!1,!0,this.next().read_expr());break;case this.tok.T_REQUIRE_ONCE:t=this.node("include")(!0,!0,this.next().read_expr())}return t},read_optional_expr:function(t){return this.token!==t?this.read_expr():null},read_exit_expr:function(){var t=null;return"("===this.token&&(this.next(),t=this.read_optional_expr(")"),this.expect(")")&&this.next()),t},read_expr_item:function(){var t,e,i=[];if("+"===this.token)return this.node("unary")("+",this.next().read_expr());if("-"===this.token)return this.node("unary")("-",this.next().read_expr());if("!"===this.token)return this.node("unary")("!",this.next().read_expr());if("~"===this.token)return this.node("unary")("~",this.next().read_expr());if("("===this.token)return(e=this.next().read_expr()).parenthesizedExpression=!0,this.expect(")")&&this.next(),this.handleDereferencable(e);if("`"===this.token)return this.read_encapsed_string("`");if(this.token===this.tok.T_LIST){var n=null,r=this.innerList;t=this.node("list"),r||(n=this.node("assign")),this.next().expect("(")&&this.next(),this.innerList||(this.innerList=!0);var s=this.read_array_pair_list(!1);this.expect(")")&&this.next();for(var o=!1,a=0;a=704&&this.token===this.tok.T_FN)return this.read_inline_function([0,1,0],i);this.lexer.tokens.push(c),this.next()}if(this.is("VARIABLE")){t=this.node();var f="identifier"===(e=this.read_variable(!1,!1)).kind||"staticlookup"===e.kind&&"identifier"===e.offset.kind;switch(this.token){case"=":return f&&this.error("VARIABLE"),"&"==this.next().token?this.read_assignref(t,e):t("assign",e,this.read_expr(),"=");case this.tok.T_PLUS_EQUAL:return f&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"+=");case this.tok.T_MINUS_EQUAL:return f&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"-=");case this.tok.T_MUL_EQUAL:return f&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"*=");case this.tok.T_POW_EQUAL:return f&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"**=");case this.tok.T_DIV_EQUAL:return f&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"/=");case this.tok.T_CONCAT_EQUAL:return f&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),".=");case this.tok.T_MOD_EQUAL:return f&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"%=");case this.tok.T_AND_EQUAL:return f&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"&=");case this.tok.T_OR_EQUAL:return f&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"|=");case this.tok.T_XOR_EQUAL:return f&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"^=");case this.tok.T_SL_EQUAL:return f&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"<<=");case this.tok.T_SR_EQUAL:return f&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),">>=");case this.tok.T_COALESCE_EQUAL:return f&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"??=");case this.tok.T_INC:return f&&this.error("VARIABLE"),this.next(),t("post","+",e);case this.tok.T_DEC:return f&&this.error("VARIABLE"),this.next(),t("post","-",e);default:t.destroy(e)}}else{if(this.is("SCALAR")){if(t=this.node(),"array"===(e=this.read_scalar()).kind&&e.shortForm&&"="===this.token){var p=this.convertToList(e);return e.loc&&(p.loc=e.loc),t("assign",p,this.next().read_expr(),"=")}return t.destroy(e),this.handleDereferencable(e)}this.error("EXPR"),this.next()}return e},convertToList:function(t){var e=this,i=t.items.map((function(t){return t.value&&"array"===t.value.kind&&t.value.shortForm&&(t.value=e.convertToList(t.value)),t})),n=this.node("list")(i,!0);return t.loc&&(n.loc=t.loc),t.leadingComments&&(n.leadingComments=t.leadingComments),t.trailingComments&&(n.trailingComments=t.trailingComments),n},read_assignref:function(t,e){var i;return this.next(),this.token===this.tok.T_NEW?(this.version>=700&&this.error(),i=this.read_new_expr()):i=this.read_variable(!1,!1),t("assignref",e,i)},read_inline_function:function(t,e){if(this.token===this.tok.T_FUNCTION){var i=this.read_function(!0,t,e);return i.attrGroups=e,i}!this.version>=704&&this.raiseError("Arrow Functions are not allowed");var n=this.node("arrowfunc");this.expect(this.tok.T_FN)&&this.next();var r=this.is_reference();this.expect("(")&&this.next();var s=this.read_parameter_list();this.expect(")")&&this.next();var o=!1,a=null;":"===this.token&&("?"===this.next().token&&(o=!0,this.next()),a=this.read_types()),this.expect(this.tok.T_DOUBLE_ARROW)&&this.next();var h=n(s,r,this.read_expr(),a,o,!!t);return h.attrGroups=e,h},read_match_expression:function(){var t,e,i=this.node("match");return this.expect(this.tok.T_MATCH)&&this.next(),this.version<800&&this.raiseError("Match statements are not allowed before PHP 8"),this.expect("(")&&this.next(),t=this.read_expr(),this.expect(")")&&this.next(),this.expect("{")&&this.next(),e=this.read_match_arms(),this.expect("}")&&this.next(),i(t,e)},read_match_arms:function(){var t=this;return this.read_list((function(){return t.read_match_arm()}),",",!0)},read_match_arm:function(){if("}"!==this.token)return this.node("matcharm")(this.read_match_arm_conds(),this.read_expr())},read_match_arm_conds:function(){var t=[];if(this.token===this.tok.T_DEFAULT)t=null,this.next();else for(t.push(this.read_expr());","===this.token;){if(this.next(),this.token===this.tok.T_DOUBLE_ARROW)return this.next(),t;t.push(this.read_expr())}return this.expect(this.tok.T_DOUBLE_ARROW)&&this.next(),t},read_attribute:function(){var t=this.text(),e=[];return this.next(),"("===this.token&&(e=this.read_argument_list()),this.node("attribute")(t,e)},read_attr_list:function(){var t=[];if(this.token===this.tok.T_ATTRIBUTE)do{var e=this.node("attrgroup")([]);for(this.next(),e.attrs.push(this.read_attribute());","===this.token;)this.next(),"]"!==this.token&&e.attrs.push(this.read_attribute());t.push(e),this.expect("]"),this.next()}while(this.token===this.tok.T_ATTRIBUTE);return t},read_new_expr:function(){var t=this.node("new");this.expect(this.tok.T_NEW)&&this.next();var e=[];if("("===this.token){this.next();var i=this.read_expr();return this.expect(")"),this.next(),"("===this.token&&(e=this.read_argument_list()),t(i,e)}var n=this.read_attr_list();if(this.token===this.tok.T_CLASS){var r=this.node("class");"("===this.next().token&&(e=this.read_argument_list());var s=this.read_extends_from(),o=this.read_implements_list(),a=null;this.expect("{")&&(a=this.next().read_class_body(!0,!1));var h=r(null,s,o,a,[0,0,0]);return h.attrGroups=n,t(h,e)}for(var l=this.read_new_class_name();"["===this.token;){var u=this.node("offsetlookup"),c=this.next().read_encaps_var_offset();this.expect("]")&&this.next(),l=u(l,c)}return"("===this.token&&(e=this.read_argument_list()),t(l,e)},read_new_class_name:function(){if(this.token===this.tok.T_NS_SEPARATOR||this.token===this.tok.T_NAME_RELATIVE||this.token===this.tok.T_NAME_QUALIFIED||this.token===this.tok.T_NAME_FULLY_QUALIFIED||this.token===this.tok.T_STRING||this.token===this.tok.T_NAMESPACE){var t=this.read_namespace_name(!0);return this.token===this.tok.T_DOUBLE_COLON&&(t=this.read_static_getter(t)),t}if(this.is("VARIABLE"))return this.read_variable(!0,!1);this.expect([this.tok.T_STRING,"VARIABLE"])},handleDereferencable:function(t){for(;this.token!==this.EOF;)if(this.token===this.tok.T_OBJECT_OPERATOR||this.token===this.tok.T_DOUBLE_COLON)t=this.recursive_variable_chain_scan(t,!1,!1,!0);else if(this.token===this.tok.T_CURLY_OPEN||"["===this.token)t=this.read_dereferencable(t);else{if("("!==this.token)return t;t=this.node("call")(t,this.read_argument_list())}return t}}},2706:t=>{t.exports={is_reference:function(){return"&"===this.token&&(this.next(),!0)},is_variadic:function(){return this.token===this.tok.T_ELLIPSIS&&(this.next(),!0)},read_function:function(t,e,i,n){var r=this.read_function_declaration(t?1:e?2:0,e&&1===e[1],i||[],n);return e&&1==e[2]?(r.parseFlags(e),this.expect(";")&&this.next()):(this.expect("{")&&(r.body=this.read_code_block(!1),r.loc&&r.body.loc&&(r.loc.end=r.body.loc.end)),!t&&e&&r.parseFlags(e)),r},read_function_declaration:function(t,e,i,n){var r=this,s="function";1===t?s="closure":2===t&&(s="method");var o=this.node(s);this.expect(this.tok.T_FUNCTION)&&this.next();var a=this.is_reference(),h=!1,l=[],u=null,c=!1;if(1!==t){var f=this.node("identifier");2===t?this.version>=700?this.token===this.tok.T_STRING||this.is("IDENTIFIER")?(h=this.text(),this.next()):this.version<704&&this.error("IDENTIFIER"):this.token===this.tok.T_STRING?(h=this.text(),this.next()):this.error("IDENTIFIER"):this.version>=700?this.token===this.tok.T_STRING?(h=this.text(),this.next()):this.version>=704?this.expect("(")||this.next():(this.error(this.tok.T_STRING),this.next()):(this.expect(this.tok.T_STRING)&&(h=this.text()),this.next()),h=f(h)}this.expect("(")&&this.next();var p=this.read_parameter_list("__construct"===h.name);this.expect(")")&&this.next(),1===t&&(l=this.read_lexical_vars()),":"===this.token&&("?"===this.next().token&&(c=!0,this.next()),u=this.read_types());var _;return(_=1===t?o(p,a,l,u,c,e):o(h,p,a,u,c)).attrGroups=i||[],n&&_.loc&&(_.loc.start=n,_.loc.source&&(_.loc.source=r.lexer._input.substr(_.loc.start.offset,_.loc.end.offset-_.loc.start.offset))),_},read_lexical_vars:function(){var t=[];return this.token===this.tok.T_USE&&(this.next(),this.expect("(")&&this.next(),t=this.read_lexical_var_list(),this.expect(")")&&this.next()),t},read_list_with_dangling_comma:function(t){for(var e=[];this.token!=this.EOF;){if(e.push(t()),","!=this.token){if(")"==this.token)break;this.error([",",")"]);break}if(this.next(),this.version>=800&&")"===this.token)return e}return e},read_lexical_var_list:function(){return this.read_list_with_dangling_comma(this.read_lexical_var.bind(this))},read_lexical_var:function(){if("&"===this.token)return this.read_byref(this.read_lexical_var.bind(this));var t=this.node("variable");this.expect(this.tok.T_VARIABLE);var e=this.text().substring(1);return this.next(),t(e,!1)},read_parameter_list:function(t){if(")"!==this.token){var e=!1;return this.read_list_with_dangling_comma(function(){var i=this.read_parameter(t);return i&&(e&&this.raiseError("Unexpected parameter after a variadic parameter"),i.variadic&&(e=!0)),i}.bind(this),",")}return[]},read_parameter:function(t){var e,i=this.node("parameter"),n=null,r=null,s=!1,o=!1,a=[];this.token===this.tok.T_ATTRIBUTE&&(a=this.read_attr_list()),this.version>=801&&this.token===this.tok.T_READ_ONLY&&(t?(this.next(),o=!0):this.raiseError("readonly properties can be used only on class constructor"));var h=this.read_promoted();!o&&this.version>=801&&this.token===this.tok.T_READ_ONLY&&(t?(this.next(),o=!0):this.raiseError("readonly properties can be used only on class constructor")),"?"===this.token&&(this.next(),s=!0),e=this.read_types(),s&&!e&&this.raiseError("Expecting a type definition combined with nullable operator");var l=this.is_reference(),u=this.is_variadic();if(this.expect(this.tok.T_VARIABLE)){n=this.node("identifier");var c=this.text().substring(1);this.next(),n=n(c)}"="==this.token&&(r=this.next().read_expr());var f=i(n,e,r,l,u,o,s,h);return a&&(f.attrGroups=a),f},read_types:function(){var t="unset",e="union",i="intersection",n=[],r=t,s=this.read_type();if(!s)return null;for(n.push(s);"|"===this.token||this.version>=801&&"&"===this.token;){var o=this.peek();if(o===this.tok.T_ELLIPSIS||o===this.tok.T_VARIABLE)break;r===t?r="|"===this.token?e:i:(r===e&&"|"!==this.token||r===i&&"&"!==this.token)&&this.raiseError('Unexpect token "'+this.token+'", "|" and "&" can not be mixed'),this.next(),n.push(this.read_type())}return 1===n.length?n[0]:r===i?this.node("intersectiontype")(n):this.node("uniontype")(n)},read_promoted:function(){return this.token===this.tok.T_PUBLIC?(this.next(),1):this.token===this.tok.T_PROTECTED?(this.next(),2):this.token===this.tok.T_PRIVATE?(this.next(),4):0},read_argument_list:function(){var t=[];return this.expect("(")&&this.next(),this.version>=801&&this.token===this.tok.T_ELLIPSIS&&")"===this.peek()?(t.push(this.node("variadicplaceholder")()),this.next()):")"!==this.token&&(t=this.read_non_empty_argument_list()),this.expect(")")&&this.next(),t},read_non_empty_argument_list:function(){var t=!1;return this.read_function_list(function(){var e=this.read_argument();if(e){var i="variadic"===e.kind;t&&!i&&this.raiseError("Unexpected non-variadic argument after a variadic argument"),i&&(t=!0)}return e}.bind(this),",")},read_argument:function(){return this.token===this.tok.T_ELLIPSIS?this.node("variadic")(this.next().read_expr()):this.token!==this.tok.T_STRING&&!Object.values(this.lexer.keywords).includes(this.token)||":"!==this.peek()?this.read_expr():(this.version<800&&this.raiseError("PHP 8+ is required to use named arguments"),this.node("namedargument")(this.text(),this.next().next().read_expr()))},read_type:function(){var t=this.node();if(this.token===this.tok.T_ARRAY||this.token===this.tok.T_CALLABLE){var e=this.text();return this.next(),t("typereference",e.toLowerCase(),e)}if(this.token===this.tok.T_NAME_RELATIVE||this.token===this.tok.T_NAME_QUALIFIED||this.token===this.tok.T_NAME_FULLY_QUALIFIED||this.token===this.tok.T_STRING||this.token===this.tok.T_STATIC){var i=this.text(),n=[this.token,this.lexer.getState()];return this.next(),this.token!==this.tok.T_NS_SEPARATOR&&this.ast.typereference.types.indexOf(i.toLowerCase())>-1?t("typereference",i.toLowerCase(),i):(this.lexer.tokens.push(n),this.next(),t.destroy(),this.read_namespace_name())}return t.destroy(),null}}},4002:t=>{t.exports={read_if:function(){var t=this.node("if"),e=this.next().read_if_expr(),i=null,n=null,r=!1;if(":"===this.token){r=!0,this.next(),i=this.node("block");for(var s=[];this.token!==this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){n=this.read_elseif_short();break}if(this.token===this.tok.T_ELSE){n=this.read_else_short();break}s.push(this.read_inner_statement())}i=i(null,s),this.expect(this.tok.T_ENDIF)&&this.next(),this.expectEndOfStatement()}else i=this.read_statement(),this.token===this.tok.T_ELSEIF?n=this.read_if():this.token===this.tok.T_ELSE&&(n=this.next().read_statement());return t(e,i,n,r)},read_if_expr:function(){this.expect("(")&&this.next();var t=this.read_expr();return this.expect(")")&&this.next(),t},read_elseif_short:function(){var t=null,e=this.node("if"),i=this.next().read_if_expr();this.expect(":")&&this.next();for(var n=this.node("block"),r=[];this.token!=this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){t=this.read_elseif_short();break}if(this.token===this.tok.T_ELSE){t=this.read_else_short();break}r.push(this.read_inner_statement())}return e(i,n(null,r),t,!0)},read_else_short:function(){this.next().expect(":")&&this.next();for(var t=this.node("block"),e=[];this.token!=this.EOF&&this.token!==this.tok.T_ENDIF;)e.push(this.read_inner_statement());return t(null,e)}}},3745:t=>{t.exports={read_while:function(){var t=this.node("while");this.expect(this.tok.T_WHILE)&&this.next();var e,i=null,n=!1;return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(")")&&this.next(),":"===this.token?(n=!0,i=this.read_short_form(this.tok.T_ENDWHILE)):i=this.read_statement(),t(e,i,n)},read_do:function(){var t=this.node("do");this.expect(this.tok.T_DO)&&this.next();var e,i=null;return e=this.read_statement(),this.expect(this.tok.T_WHILE)&&(this.next().expect("(")&&this.next(),i=this.read_expr(),this.expect(")")&&this.next(),this.expect(";")&&this.next()),t(i,e)},read_for:function(){var t=this.node("for");this.expect(this.tok.T_FOR)&&this.next();var e=[],i=[],n=[],r=null,s=!1;return this.expect("(")&&this.next(),";"!==this.token?(e=this.read_list(this.read_expr,","),this.expect(";")&&this.next()):this.next(),";"!==this.token?(i=this.read_list(this.read_expr,","),this.expect(";")&&this.next()):this.next(),")"!==this.token?(n=this.read_list(this.read_expr,","),this.expect(")")&&this.next()):this.next(),":"===this.token?(s=!0,r=this.read_short_form(this.tok.T_ENDFOR)):r=this.read_statement(),t(e,i,n,r,s)},read_foreach:function(){var t=this.node("foreach");this.expect(this.tok.T_FOREACH)&&this.next();var e,i=null,n=null,r=null,s=!1;return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(this.tok.T_AS)&&(this.next(),n=this.read_foreach_variable(),this.token===this.tok.T_DOUBLE_ARROW&&(i=n,n=this.next().read_foreach_variable())),i&&"list"===i.kind&&this.raiseError("Fatal Error : Cannot use list as key element"),this.expect(")")&&this.next(),":"===this.token?(s=!0,r=this.read_short_form(this.tok.T_ENDFOREACH)):r=this.read_statement(),t(e,i,n,r,s)},read_foreach_variable:function(){if(this.token===this.tok.T_LIST||"["===this.token){var t="["===this.token,e=this.node("list");this.next(),!t&&this.expect("(")&&this.next();var i=this.read_array_pair_list(t);return this.expect(t?"]":")")&&this.next(),e(i,t)}return this.read_variable(!1,!1)}}},9905:t=>{t.exports={read_start:function(){return this.token==this.tok.T_NAMESPACE?this.read_namespace():this.read_top_statement()}}},1250:t=>{t.exports={read_namespace:function(){var t,e,i=this.node("namespace");return this.expect(this.tok.T_NAMESPACE)&&this.next(),e="{"===this.token?{name:[""]}:this.read_namespace_name(),this.currentNamespace=e,";"===this.token?(this.currentNamespace=e,t=this.next().read_top_statements(),this.expect(this.EOF),i(e.name,t,!1)):"{"===this.token?(this.currentNamespace=e,t=this.next().read_top_statements(),this.expect("}")&&this.next(),0===t.length&&this.extractDoc&&this._docs.length>this._docIndex&&t.push(this.node("noop")()),i(e.name,t,!0)):(this.error(["{",";"]),this.currentNamespace=e,t=this.read_top_statements(),this.expect(this.EOF),i(e,t,!1))},read_namespace_name:function(t){var e,i=this.node(),n=this.text();switch(this.token){case this.tok.T_NAME_RELATIVE:e=this.ast.name.RELATIVE_NAME,n=n.replace(/^namespace\\/,"");break;case this.tok.T_NAME_QUALIFIED:e=this.ast.name.QUALIFIED_NAME;break;case this.tok.T_NAME_FULLY_QUALIFIED:e=this.ast.name.FULL_QUALIFIED_NAME;break;default:if(e=this.ast.name.UNQUALIFIED_NAME,!this.expect(this.tok.T_STRING))return i("name","",this.ast.name.FULL_QUALIFIED_NAME)}if(this.next(),t||"("!==this.token){if("parent"===n.toLowerCase())return i("parentreference",n);if("self"===n.toLowerCase())return i("selfreference",n)}return i("name",n,e)},read_use_statement:function(){var t=this.node("usegroup"),e=[],i=null;this.expect(this.tok.T_USE)&&this.next();var n=this.read_use_type();return e.push(this.read_use_declaration(!1)),","===this.token?e=e.concat(this.next().read_use_declarations(!1)):"{"===this.token&&(i=e[0].name,e=this.next().read_use_declarations(null===n),this.expect("}")&&this.next()),t=t(i,n,e),this.expect(";")&&this.next(),t},read_class_name_reference:function(){return this.read_variable(!0,!1)},read_use_declaration:function(t){var e=this.node("useitem"),i=null;t&&(i=this.read_use_type());var n=this.read_namespace_name(),r=this.read_use_alias();return e(n.name,r,i)},read_use_declarations:function(t){for(var e=[this.read_use_declaration(t)];","===this.token;){if(this.next(),t){if(this.token!==this.tok.T_NAME_RELATIVE&&this.token!==this.tok.T_NAME_QUALIFIED&&this.token!==this.tok.T_NAME_FULLY_QUALIFIED&&this.token!==this.tok.T_FUNCTION&&this.token!==this.tok.T_CONST&&this.token!==this.tok.T_STRING)break}else if(this.token!==this.tok.T_NAME_RELATIVE&&this.token!==this.tok.T_NAME_QUALIFIED&&this.token!==this.tok.T_NAME_FULLY_QUALIFIED&&this.token!==this.tok.T_STRING&&this.token!==this.tok.T_NS_SEPARATOR)break;e.push(this.read_use_declaration(t))}return e},read_use_alias:function(){var t=null;if(this.token===this.tok.T_AS&&this.next().expect(this.tok.T_STRING)){var e=this.node("identifier"),i=this.text();this.next(),t=e(i)}return t},read_use_type:function(){return this.token===this.tok.T_FUNCTION?(this.next(),this.ast.useitem.TYPE_FUNCTION):this.token===this.tok.T_CONST?(this.next(),this.ast.useitem.TYPE_CONST):null}}},9889:t=>{var e={"\\":"\\",$:"$",n:"\n",r:"\r",t:"\t",f:String.fromCharCode(12),v:String.fromCharCode(11),e:String.fromCharCode(27)};t.exports={resolve_special_chars:function(t,i){return i?t.replace(/\\"/,'"').replace(/\\([\\$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}|u{([0-9a-fA-F]+)})/g,(function(t,i,n){return e[i]?e[i]:"x"===i[0]||"X"===i[0]?String.fromCodePoint(parseInt(i.substr(1),16)):"u"===i[0]?String.fromCodePoint(parseInt(n,16)):String.fromCodePoint(parseInt(i,8))})):t.replace(/\\\\/g,"\\").replace(/\\'/g,"'")},remove_heredoc_leading_whitespace_chars:function(t,e,i,n){if(0===e)return t;this.check_heredoc_indentation_level(t,e,i,n);var r=i?" ":"\t",s=new RegExp("\\n".concat(r,"{").concat(e,"}"),"g"),o=new RegExp("^".concat(r,"{").concat(e,"}"));return n&&(t=t.replace(o,"")),t.replace(s,"\n")},check_heredoc_indentation_level:function(t,e,i,n){var r=t.length,s=0,o=0,a=!0,h=i?" ":"\t",l=!1;if(!n){if(-1===(s=t.indexOf("\n")))return;s++}for(;s0&&(t=t.substring(0,t.length-this.lexer.heredoc_label.indentation));var r=t[t.length-1];"\n"===r?t="\r"===t[t.length-2]?t.substring(0,t.length-2):t.substring(0,t.length-1):"\r"===r&&(t=t.substring(0,t.length-1)),this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE)&&this.next(),this.expect(this.tok.T_END_HEREDOC)&&this.next();var s=this.lexer._input.substring(n,this.lexer.yylloc.first_offset);return e=e(this.remove_heredoc_leading_whitespace_chars(t,this.lexer.heredoc_label.indentation,this.lexer.heredoc_label.indentation_uses_spaces,this.lexer.heredoc_label.first_encaps_node),s,this.lexer.heredoc_label.label),this.lexer.heredoc_label.finished=!0,e}return this.read_encapsed_string(this.tok.T_END_HEREDOC);case'"':return this.read_encapsed_string('"');case'b"':case'B"':return this.read_encapsed_string('"',!0);case this.tok.T_CONSTANT_ENCAPSED_STRING:case this.tok.T_ARRAY:case"[":return this.read_dereferencable_scalar();default:var o=this.error("SCALAR");return this.next(),o}},read_dereferencable:function(t){var e,i,n=this.node("offsetlookup");return"["===this.token?(i=this.next().read_expr(),this.expect("]")&&this.next(),e=n(t,i)):this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES&&(e=n(t,i=this.read_encapsed_string_item(!1))),e},read_encapsed_string_item:function(t){var e,i,n,r=this.node("encapsedpart"),s=null,o=!1,a=this.node();if(this.token===this.tok.T_ENCAPSED_AND_WHITESPACE){var h=this.text();this.next(),a=a("string",!1,this.version>=703&&!this.lexer.heredoc_label.finished?this.remove_heredoc_leading_whitespace_chars(this.resolve_special_chars(h,t),this.lexer.heredoc_label.indentation,this.lexer.heredoc_label.indentation_uses_spaces,this.lexer.heredoc_label.first_encaps_node):h,!1,h)}else if(this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES){if(s="simple",o=!0,n=null,this.next().token===this.tok.T_STRING_VARNAME){n=this.node("variable");var l=this.text();this.next(),a.destroy(),"["===this.token?(n=n(l,!1),i=this.node("offsetlookup"),e=this.next().read_expr(),this.expect("]")&&this.next(),a=i(n,e)):a=n(l,!1)}else a=a("variable",this.read_expr(),!1);this.expect("}")&&this.next()}else if(this.token===this.tok.T_CURLY_OPEN)s="complex",a.destroy(),a=this.next().read_variable(!1,!1),this.expect("}")&&this.next();else if(this.token===this.tok.T_VARIABLE){if(s="simple",a.destroy(),a=this.read_simple_variable(),"["===this.token&&(i=this.node("offsetlookup"),e=this.next().read_encaps_var_offset(),this.expect("]")&&this.next(),a=i(a,e)),this.token===this.tok.T_OBJECT_OPERATOR){i=this.node("propertylookup"),this.next().expect(this.tok.T_STRING);var u=this.node("identifier");n=this.text(),this.next(),a=i(a,u(n))}}else{this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE);var c=this.text();this.next(),a.destroy(),a=a("string",!1,c,!1,c)}return this.lexer.heredoc_label.first_encaps_node=!1,r(a,s,o)},read_encapsed_string:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.lexer.yylloc.first_offset,n=this.node("encapsed");this.next();var r,s=this.lexer.yylloc.prev_offset-(e?1:0),o=[];for(r="`"===t?this.ast.encapsed.TYPE_SHELL:'"'===t?this.ast.encapsed.TYPE_STRING:this.ast.encapsed.TYPE_HEREDOC;this.token!==t&&this.token!==this.EOF;)o.push(this.read_encapsed_string_item(!0));if(o.length>0&&"encapsedpart"===o[o.length-1].kind&&"string"===o[o.length-1].expression.kind){var a=o[o.length-1].expression,h=a.value[a.value.length-1];"\n"===h?"\r"===a.value[a.value.length-2]?a.value=a.value.substring(0,a.value.length-2):a.value=a.value.substring(0,a.value.length-1):"\r"===h&&(a.value=a.value.substring(0,a.value.length-1))}return this.expect(t)&&this.next(),n=n(o,this.lexer._input.substring("heredoc"===r?i:s-1,this.lexer.yylloc.first_offset),r),t===this.tok.T_END_HEREDOC&&(n.label=this.lexer.heredoc_label.label,this.lexer.heredoc_label.finished=!0),n},get_magic_constant:function(){var t=this.node("magic"),e=this.text();return this.next(),t(e.toUpperCase(),e)}}},4992:t=>{t.exports={read_top_statements:function(){for(var t=[];this.token!==this.EOF&&"}"!==this.token;){var e=this.read_top_statement();e&&(Array.isArray(e)?t=t.concat(e):t.push(e))}return t},read_top_statement:function(){var t=[];switch(this.token===this.tok.T_ATTRIBUTE&&(t=this.read_attr_list()),this.token){case this.tok.T_FUNCTION:return this.read_function(!1,!1,t);case this.tok.T_ABSTRACT:case this.tok.T_FINAL:case this.tok.T_READ_ONLY:case this.tok.T_CLASS:return this.read_class_declaration_statement(t);case this.tok.T_INTERFACE:return this.read_interface_declaration_statement(t);case this.tok.T_TRAIT:return this.read_trait_declaration_statement();case this.tok.T_ENUM:return this.read_enum_declaration_statement(t);case this.tok.T_USE:return this.read_use_statement();case this.tok.T_CONST:var e=this.node("constantstatement"),i=this.next().read_const_list();return this.expectEndOfStatement(),e(null,i);case this.tok.T_NAMESPACE:return this.read_namespace();case this.tok.T_HALT_COMPILER:var n=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),this.expect(";"),this.lexer.done=!0,n(this.lexer._input.substring(this.lexer.offset));default:return this.read_statement()}},read_inner_statements:function(){for(var t=[];this.token!=this.EOF&&"}"!==this.token;){var e=this.read_inner_statement();e&&(Array.isArray(e)?t=t.concat(e):t.push(e))}return t},read_const_list:function(){return this.read_list((function(){this.expect(this.tok.T_STRING);var t=this.node("constant"),e=this.node("identifier"),i=this.text();return this.next(),e=e(i),this.expect("=")?t(e,this.next().read_expr()):t(e,null)}),",",!1)},read_declare_list:function(){for(var t=[];this.token!=this.EOF&&")"!==this.token;){this.expect(this.tok.T_STRING);var e=this.node("declaredirective"),i=this.node("identifier"),n=this.text();this.next(),i=i(n);var r=null;if(this.expect("=")&&(r=this.next().read_expr()),t.push(e(i,r)),","!==this.token)break;this.next()}return t},read_inner_statement:function(){var t=[];switch(this.token===this.tok.T_ATTRIBUTE&&(t=this.read_attr_list()),this.token){case this.tok.T_FUNCTION:var e=this.read_function(!1,!1);return e.attrGroups=t,e;case this.tok.T_ABSTRACT:case this.tok.T_FINAL:case this.tok.T_CLASS:return this.read_class_declaration_statement();case this.tok.T_INTERFACE:return this.read_interface_declaration_statement();case this.tok.T_TRAIT:return this.read_trait_declaration_statement();case this.tok.T_ENUM:return this.read_enum_declaration_statement();case this.tok.T_HALT_COMPILER:this.raiseError("__HALT_COMPILER() can only be used from the outermost scope");var i=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),i=i(this.lexer._input.substring(this.lexer.offset)),this.expect(";")&&this.next(),i;default:return this.read_statement()}},read_statement:function(){switch(this.token){case"{":return this.read_code_block(!1);case this.tok.T_IF:return this.read_if();case this.tok.T_SWITCH:return this.read_switch();case this.tok.T_FOR:return this.read_for();case this.tok.T_FOREACH:return this.read_foreach();case this.tok.T_WHILE:return this.read_while();case this.tok.T_DO:return this.read_do();case this.tok.T_COMMENT:return this.read_comment();case this.tok.T_DOC_COMMENT:return this.read_doc_comment();case this.tok.T_RETURN:var t=this.node("return");this.next();var e=this.read_optional_expr(";");return this.expectEndOfStatement(),t(e);case this.tok.T_BREAK:case this.tok.T_CONTINUE:var i=this.node(this.token===this.tok.T_CONTINUE?"continue":"break");this.next();var n=this.read_optional_expr(";");return this.expectEndOfStatement(),i(n);case this.tok.T_GLOBAL:var r=this.node("global"),s=this.next().read_list(this.read_simple_variable,",");return this.expectEndOfStatement(),r(s);case this.tok.T_STATIC:var o=[this.token,this.lexer.getState()],a=this.node();if(this.next().token===this.tok.T_DOUBLE_COLON){this.lexer.tokens.push(o);var h=this.next().read_expr();return this.expectEndOfStatement(h),a("expressionstatement",h)}if(this.token===this.tok.T_FUNCTION)return this.read_function(!0,[0,1,0]);var l=this.read_variable_declarations();return this.expectEndOfStatement(),a("static",l);case this.tok.T_ECHO:var u=this.node("echo"),c=this.text(),f="0?this.lexer._input[this.lexer.yylloc.first_offset-1]:null,v="\r"===d||"\n"===d;v&&"\n"===d&&this.lexer.yylloc.first_offset>1&&"\r"===this.lexer._input[this.lexer.yylloc.first_offset-2]&&(d="\r\n");var k=this.node("inline");return this.next(),k(_,v?d+_:_);case this.tok.T_UNSET:var g=this.node("unset");this.next().expect("(")&&this.next();var x=this.read_function_list(this.read_variable,",");return this.expect(")")&&this.next(),this.expect(";")&&this.next(),g(x);case this.tok.T_DECLARE:var y,T=this.node("declare"),m=[];this.next().expect("(")&&this.next();var b=this.read_declare_list();if(this.expect(")")&&this.next(),":"===this.token){for(this.next();this.token!=this.EOF&&this.token!==this.tok.T_ENDDECLARE;)m.push(this.read_top_statement());0===m.length&&this.extractDoc&&this._docs.length>this._docIndex&&m.push(this.node("noop")()),this.expect(this.tok.T_ENDDECLARE)&&this.next(),this.expectEndOfStatement(),y=this.ast.declare.MODE_SHORT}else if("{"===this.token){for(this.next();this.token!=this.EOF&&"}"!==this.token;)m.push(this.read_top_statement());0===m.length&&this.extractDoc&&this._docs.length>this._docIndex&&m.push(this.node("noop")()),this.expect("}")&&this.next(),y=this.ast.declare.MODE_BLOCK}else this.expect(";")&&this.next(),y=this.ast.declare.MODE_NONE;return T(b,m,y);case this.tok.T_TRY:return this.read_try();case this.tok.T_THROW:var E=this.node("throw"),C=this.next().read_expr();return this.expectEndOfStatement(),E(C);case";":return this.next(),null;case this.tok.T_STRING:var A=this.node(),$=[this.token,this.lexer.getState()],S=this.text(),I=this.node("identifier");if(":"===this.next().token)return I=I(S),this.next(),A("label",I);I.destroy(),A.destroy(),this.lexer.tokens.push($);var O=this.node("expressionstatement"),L=this.next().read_expr();return this.expectEndOfStatement(L),O(L);case this.tok.T_GOTO:var N=this.node("goto"),R=null;if(this.next().expect(this.tok.T_STRING)){R=this.node("identifier");var w=this.text();this.next(),R=R(w),this.expectEndOfStatement()}return N(R);default:var D=this.node("expressionstatement"),M=this.read_expr();return this.expectEndOfStatement(M),D(M)}},read_code_block:function(t){var e=this.node("block");this.expect("{")&&this.next();var i=t?this.read_top_statements():this.read_inner_statements();return 0===i.length&&this.extractDoc&&this._docs.length>this._docIndex&&i.push(this.node("noop")()),this.expect("}")&&this.next(),e(null,i)}}},7991:t=>{t.exports={read_switch:function(){var t=this.node("switch");this.expect(this.tok.T_SWITCH)&&this.next(),this.expect("(")&&this.next();var e=this.read_expr();this.expect(")")&&this.next();var i=":"===this.token;return t(e,this.read_switch_case_list(),i)},read_switch_case_list:function(){var t=null,e=this.node("block"),i=[];for("{"===this.token?t="}":":"===this.token?t=this.tok.T_ENDSWITCH:this.expect(["{",":"]),this.next(),";"===this.token&&this.next();this.token!==this.EOF&&this.token!==t;)i.push(this.read_case_list(t));return 0===i.length&&this.extractDoc&&this._docs.length>this._docIndex&&i.push(this.node("noop")()),this.expect(t)&&this.next(),t===this.tok.T_ENDSWITCH&&this.expectEndOfStatement(),e(null,i)},read_case_list:function(t){var e=this.node("case"),i=null;this.token===this.tok.T_CASE?i=this.next().read_expr():this.token===this.tok.T_DEFAULT?this.next():this.expect([this.tok.T_CASE,this.tok.T_DEFAULT]),this.expect([":",";"])&&this.next();for(var n=this.node("block"),r=[];this.token!==this.EOF&&this.token!==t&&this.token!==this.tok.T_CASE&&this.token!==this.tok.T_DEFAULT;)r.push(this.read_inner_statement());return e(i,n(null,r))}}},4544:t=>{t.exports={read_try:function(){this.expect(this.tok.T_TRY);for(var t=this.node("try"),e=null,i=[],n=this.next().read_statement();this.token===this.tok.T_CATCH;){var r=this.node("catch");this.next().expect("(")&&this.next();var s=this.read_list(this.read_namespace_name,"|",!1),o=null;(this.version<800||this.token===this.tok.T_VARIABLE)&&(o=this.read_variable(!0,!1)),this.expect(")"),i.push(r(this.next().read_statement(),s,o))}return this.token===this.tok.T_FINALLY&&(e=this.next().read_statement()),t(n,i,e)}}},9957:t=>{t.exports={read_short_form:function(t){var e=this.node("block"),i=[];for(this.expect(":")&&this.next();this.token!=this.EOF&&this.token!==t;)i.push(this.read_inner_statement());return 0===i.length&&this.extractDoc&&this._docs.length>this._docIndex&&i.push(this.node("noop")()),this.expect(t)&&this.next(),this.expectEndOfStatement(),e(null,i)},read_function_list:function(t,e){var i=[];do{if(this.token==e&&this.version>=703&&i.length>0){i.push(this.node("noop")());break}if(i.push(t.apply(this,[])),this.token!=e)break;if(")"==this.next().token&&this.version>=703)break}while(this.token!=this.EOF);return i},read_list:function(t,e,i){var n=[];if(this.token==e&&(i&&n.push("function"==typeof t?this.node("noop")():null),this.next()),"function"==typeof t)do{var r=t.apply(this,[]);if(r&&n.push(r),this.token!=e)break}while(this.next().token!=this.EOF);else{if(!this.expect(t))return[];for(n.push(this.text());this.next().token!=this.EOF&&this.token==e&&this.next().token==t;)n.push(this.text())}return n},read_name_list:function(){return this.read_list(this.read_namespace_name,",",!1)},read_byref:function(t){var e=this.node("byref");this.next(),e=e(null);var i=t();return i&&(this.ast.swapLocations(i,e,i,this),i.byref=!0),i},read_variable_declarations:function(){return this.read_list((function(){var t=this.node("staticvariable"),e=this.node("variable");if(this.expect(this.tok.T_VARIABLE)){var i=this.text().substring(1);this.next(),e=e(i,!1)}else e=e("#ERR",!1);return"="===this.token?t(e,this.next().read_expr()):e}),",")},read_extends_from:function(){return this.token===this.tok.T_EXTENDS?this.next().read_namespace_name():null},read_interface_extends_list:function(){return this.token===this.tok.T_EXTENDS?this.next().read_name_list():null},read_implements_list:function(){return this.token===this.tok.T_IMPLEMENTS?this.next().read_name_list():null}}},1099:t=>{t.exports={read_variable:function(t,e){var i;if("&"===this.token)return this.read_byref(this.read_variable.bind(this,t,e));if(this.is([this.tok.T_VARIABLE,"$"]))i=this.read_reference_variable(e);else if(this.is([this.tok.T_NS_SEPARATOR,this.tok.T_STRING,this.tok.T_NAME_RELATIVE,this.tok.T_NAME_QUALIFIED,this.tok.T_NAME_FULLY_QUALIFIED,this.tok.T_NAMESPACE])){i=this.node();var n=this.read_namespace_name();if(this.token!=this.tok.T_DOUBLE_COLON&&"("!=this.token&&-1===["parentreference","selfreference"].indexOf(n.kind)){var r=n.name.toLowerCase();"true"===r?i=n.destroy(i("boolean",!0,n.name)):"false"===r?i=n.destroy(i("boolean",!1,n.name)):"null"===r?i=n.destroy(i("nullkeyword",n.name)):(i.destroy(n),i=n)}else i.destroy(n),i=n}else if(this.token===this.tok.T_STATIC){i=this.node("staticreference");var s=this.text();this.next(),i=i(s)}else this.expect("VARIABLE");return this.token===this.tok.T_DOUBLE_COLON&&(i=this.read_static_getter(i,e)),this.recursive_variable_chain_scan(i,t,e)},read_static_getter:function(t,e){var i,n,r=this.node("staticlookup");return this.next().is([this.tok.T_VARIABLE,"$"])?i=this.read_reference_variable(e):this.token===this.tok.T_STRING||this.token===this.tok.T_CLASS||this.version>=700&&this.is("IDENTIFIER")?(i=this.node("identifier"),n=this.text(),this.next(),i=i(n)):"{"===this.token?(i=this.node("literal"),n=this.next().read_expr(),this.expect("}")&&this.next(),i=i("literal",n,null),this.expect("(")):(this.error([this.tok.T_VARIABLE,this.tok.T_STRING]),i=this.node("identifier"),n=this.text(),this.next(),i=i(n)),r(t,i)},read_what:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=null,i=null;switch(this.next().token){case this.tok.T_STRING:e=this.node("identifier"),i=this.text(),this.next(),e=e(i),t&&this.token===this.tok.T_OBJECT_OPERATOR&&this.error();break;case this.tok.T_VARIABLE:e=this.node("variable"),i=this.text().substring(1),this.next(),e=e(i,!1);break;case"$":e=this.node(),this.next().expect(["$","{",this.tok.T_VARIABLE]),"{"===this.token?(i=this.next().read_expr(),this.expect("}")&&this.next(),e=e("variable",i,!0)):e=e("variable",i=this.read_expr(),!1);break;case"{":e=this.node("encapsedpart"),i=this.next().read_expr(),this.expect("}")&&this.next(),e=e(i,"complex",!1);break;default:this.error([this.tok.T_STRING,this.tok.T_VARIABLE,"$","{"]),e=this.node("identifier"),i=this.text(),this.next(),e=e(i)}return e},recursive_variable_chain_scan:function(t,e,i){var n,r;t:for(;this.token!=this.EOF;)switch(this.token){case"(":if(e)return t;t=this.node("call")(t,this.read_argument_list());break;case"[":case"{":var s="["===this.token;n=this.node("offsetlookup"),this.next(),r=!1,i?(r=this.read_encaps_var_offset(),this.expect(s?"]":"}")&&this.next()):(s?"]"!==this.token:"}"!==this.token)?(r=this.read_expr(),this.expect(s?"]":"}")&&this.next()):this.next(),t=n(t,r);break;case this.tok.T_DOUBLE_COLON:"staticlookup"===t.kind&&"identifier"===t.offset.kind&&this.error(),t=(n=this.node("staticlookup"))(t,this.read_what(!0));break;case this.tok.T_OBJECT_OPERATOR:t=(n=this.node("propertylookup"))(t,this.read_what());break;case this.tok.T_NULLSAFE_OBJECT_OPERATOR:t=(n=this.node("nullsafepropertylookup"))(t,this.read_what());break;default:break t}return t},read_encaps_var_offset:function(){var t=this.node();if(this.token===this.tok.T_STRING){var e=this.text();this.next(),t=t("identifier",e)}else if(this.token===this.tok.T_NUM_STRING){var i=this.text();this.next(),t=t("number",i,null)}else if("-"===this.token){this.next();var n=-1*this.text();this.expect(this.tok.T_NUM_STRING)&&this.next(),t=t("number",n,null)}else if(this.token===this.tok.T_VARIABLE){var r=this.text().substring(1);this.next(),t=t("variable",r,!1)}else{this.expect([this.tok.T_STRING,this.tok.T_NUM_STRING,"-",this.tok.T_VARIABLE]);var s=this.text();this.next(),t=t("identifier",s)}return t},read_reference_variable:function(t){for(var e,i=this.read_simple_variable();this.token!=this.EOF;){var n=this.node();if("{"!=this.token||t){n.destroy();break}e=this.next().read_expr(),this.expect("}")&&this.next(),i=n("offsetlookup",i,e)}return i},read_simple_variable:function(){var t,e=this.node("variable");if(this.expect([this.tok.T_VARIABLE,"$"])&&this.token===this.tok.T_VARIABLE)t=this.text().substring(1),this.next(),e=e(t,!1);else switch("$"===this.token&&this.next(),this.token){case"{":var i=this.next().read_expr();this.expect("}")&&this.next(),e=e(i,!0);break;case"$":e=e(this.read_simple_variable(),!1);break;case this.tok.T_VARIABLE:t=this.text().substring(1);var n=this.node("variable");this.next(),e=e(n(t,!1),!1);break;default:this.error(["{","$",this.tok.T_VARIABLE]),t=this.text(),this.next(),e=e(t,!1)}return e}}},6455:t=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function i(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function n(t){for(var e=1;et.length)&&(e=t.length);for(var i=0,n=new Array(e);i{"use strict";t.exports=window.wp.CodeMirror},3145:(t,e,i)=>{"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);in})},6369:(t,e,i)=>{"use strict";function n(t){if(Array.isArray(t))return t}i.d(e,{A:()=>n})},6986:(t,e,i)=>{"use strict";function n(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,r,s,o,a=[],h=!0,l=!1;try{if(s=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;h=!1}else for(;!(h=(n=s.call(i)).done)&&(a.push(n.value),a.length!==e);h=!0);}catch(t){l=!0,r=t}finally{try{if(!h&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(l)throw r}}return a}}i.d(e,{A:()=>n})},6562:(t,e,i)=>{"use strict";function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}i.d(e,{A:()=>n})},3453:(t,e,i)=>{"use strict";i.d(e,{A:()=>a});var n=i(6369),r=i(6986),s=i(7800),o=i(6562);function a(t,e){return(0,n.A)(t)||(0,r.A)(t,e)||(0,s.A)(t,e)||(0,o.A)()}},2327:(t,e,i)=>{"use strict";i.d(e,{A:()=>r});var n=i(2284);function r(t,e){if("object"!==(0,n.A)(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e||"default");if("object"!==(0,n.A)(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}},9922:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(2284),r=i(2327);function s(t){var e=(0,r.A)(t,"string");return"symbol"===(0,n.A)(e)?e:String(e)}},2284:(t,e,i)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}i.d(e,{A:()=>n})},7800:(t,e,i)=>{"use strict";i.d(e,{A:()=>r});var n=i(3145);function r(t,e){if(t){if("string"==typeof t)return(0,n.A)(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?(0,n.A)(t,e):void 0}}}},i={};function n(t){var r=i[t];if(void 0!==r)return r.exports;var s=i[t]={exports:{}};return e[t].call(s.exports,s,s.exports,n),s.exports}n.m=e,t=[],n.O=(e,i,r,s)=>{if(!i){var o=1/0;for(u=0;u=s)&&Object.keys(n.O).every((t=>n.O[t](i[h])))?i.splice(h--,1):(a=!1,s0&&t[u-1][2]>s;u--)t[u]=t[u-1];t[u]=[i,r,s]},n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t={6008:0};n.O.j=e=>0===t[e];var e=(e,i)=>{var r,s,[o,a,h]=i,l=0;if(o.some((e=>0!==t[e]))){for(r in a)n.o(a,r)&&(n.m[r]=a[r]);if(h)var u=h(n)}for(e&&e(i);l