From 87b75355a886eeba6b2601318548c3d477dbdc6f Mon Sep 17 00:00:00 2001 From: Ahmed Khallaf Date: Thu, 22 Oct 2020 10:52:58 +0200 Subject: [PATCH] =?UTF-8?q?Chore:=20release=20of=20a=20new=20version=203.1?= =?UTF-8?q?2.2=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 8 ++++++++ README.md | 17 ++++++++++++++--- .../filerobot-image-editor.min.js | 12 ++++++------ build/3/filerobot-image-editor.min.js | 12 ++++++------ examples/js/src/filerobot-init-example.js | 10 ++++++++++ examples/js/src/index.html | 2 +- package.json | 2 +- projects/react/ImageEditorWrapper.js | 9 +++------ projects/react/assets/theme/dark.js | 3 --- projects/react/assets/theme/light.js | 3 --- projects/react/components/CustomizedCanvas.js | 10 ++++------ projects/react/components/Preview/Preview.js | 4 ++-- projects/react/components/Toolbar/Text.js | 5 ++--- projects/react/components/Toolbar/Watermark.js | 10 ++++++++-- 14 files changed, 65 insertions(+), 42 deletions(-) rename build/{3.12.1 => 3.12.2}/filerobot-image-editor.min.js (65%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e80f4b9..d7c6b797 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,14 @@ Types of changes: ------------- +## 3.12.2 - 2020-10-22 +### Fixed +- Showing shapes borders in light color scheme. + +### Added +- Watermark fonts for using those fonts in text watermark fonts field. +- Theme fonts for supporting those fonts in text & text watermark fonts field (if no fonts provided for watermark object). + ## 3.12.1 - 2020-10-09 ### Fixed - Removing hot loader build paths from the complied library files. diff --git a/README.md b/README.md index a682374f..1e01f387 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ > Repository includes React version and Vanilla JS adapter for standalone usage -[![Release](https://img.shields.io/badge/release-v3.12.1-blue.svg)](https://github.com/scaleflex/filerobot-image-editor/releases) +[![Release](https://img.shields.io/badge/release-v3.12.2-blue.svg)](https://github.com/scaleflex/filerobot-image-editor/releases) [![Contributions welcome](https://img.shields.io/badge/contributions-welcome-orange.svg)](#contributing) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![Scaleflex team](https://img.shields.io/badge/%3C%2F%3E%20with%20%E2%99%A5%20by-the%20Scaleflex%20team-6986fa.svg)](https://www.scaleflex.it/en/home) @@ -140,7 +140,7 @@ or use your custom color scheme Use the latest CDNized plugin version: ```html - + ``` ### Quick start @@ -355,6 +355,9 @@ Add watermark on the image after applying image transformations. ##### `watermark.defaultText`: string - the default text that would be added as a text watermark +##### `watermark.fonts`: array - the fonts that would be shown & used in text watermark +example: [{ label: 'Arial', value: 'Arial' }] + ``` config.watermark = { @@ -392,7 +395,15 @@ config.theme = { border: '#161e23', borderLight: '#70777f' - } + }, + fonts: [ + { label: 'Arial', value: 'Arial' }, + { label: 'Tahoma', value: 'Tahoma' }, + { label: 'Times New Roman', value: 'Times New Roman'}, + { label: 'Courier', value: 'Courier' }, + { label: 'Courier New', value: 'Courier New' }, + { label: 'Verdana', value: 'Verdana' } + ] }; ``` diff --git a/build/3.12.1/filerobot-image-editor.min.js b/build/3.12.2/filerobot-image-editor.min.js similarity index 65% rename from build/3.12.1/filerobot-image-editor.min.js rename to build/3.12.2/filerobot-image-editor.min.js index f28b7ef0..527ec0d4 100644 --- a/build/3.12.1/filerobot-image-editor.min.js +++ b/build/3.12.2/filerobot-image-editor.min.js @@ -1,14 +1,14 @@ /*! * - * filerobot-image-editor v3.12.1 + * filerobot-image-editor v3.12.2 * https://github.com/scaleflex/filerobot-image-editor * * Copyright (c) 2019 scaleflex * Released under the MIT license * - * Date: 2020-10-09T11:48:47.886Z + * Date: 2020-10-22T08:50:10.602Z * - */!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="https://cdn.scaleflex.it/plugins/filerobot-image-editor/3.12.1/",n(n.s=70)}([function(e,t,n){"use strict";e.exports=n(23)},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return Xe}));var r=n(6),o=n.n(r),i=n(13),a=n.n(i),l=n(0),c=n.n(l),s=n(14),u=n(7),f=n(8),p=(n(27),n(20)),h=n(21),d=function(e,t){for(var n=[e[0]],r=0,o=t.length;r1?r-1:0),i=1;i0?" Additional arguments: "+o.join(", "):"")));return w(a)}return y(t,e),t}(Error),R=/^[^\S\n]*?\/\* sc-component-id:\s*(\S+)\s+\*\//gm,D=function(e){var t=""+(e||""),n=[];return t.replace(R,(function(e,t,r){return n.push({componentId:t,matchIndex:r}),e})),n.map((function(e,r){var o=e.componentId,i=e.matchIndex,a=n[r+1];return{componentId:o,cssFromDOM:a?t.slice(i,a.matchIndex):t.slice(i)}}))},M=/^\s*\/\/.*$/gm,A=new o.a({global:!1,cascade:!0,keyframe:!1,prefix:!1,compress:!1,semicolon:!0}),I=new o.a({global:!1,cascade:!0,keyframe:!1,prefix:!0,compress:!1,semicolon:!1}),z=[],B=function(e){if(-2===e){var t=z;return z=[],t}},L=a()((function(e){z.push(e)})),N=void 0,F=void 0,U=void 0,H=function(e,t,n){return t>0&&-1!==n.slice(0,t).indexOf(F)&&n.slice(t-F.length,t)!==F?"."+N:e};I.use([function(e,t,n){2===e&&n.length&&n[0].lastIndexOf(F)>0&&(n[0]=n[0].replace(U,H))},L,B]),A.use([L,B]);var W=function(e){return A("",e)};function Y(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&",o=e.join("").replace(M,""),i=t&&n?n+" "+t+" { "+o+" }":o;return N=r,F=t,U=new RegExp("\\"+F+"\\b","g"),I(n||!t?"":t,i)}var X=function(){return n.nc},V=function(e,t,n){n&&((e[t]||(e[t]=Object.create(null)))[n]=!0)},q=function(e,t){e[t]=Object.create(null)},Q=function(e){return function(t,n){return void 0!==e[t]&&e[t][n]}},$=function(e){var t="";for(var n in e)t+=Object.keys(e[n]).join(" ")+" ";return t.trim()},K=function(e){if(e.sheet)return e.sheet;for(var t=e.ownerDocument.styleSheets.length,n=0;n"+e()+""}},te=function(e,t){return function(){var n,r=((n={})[_]=$(t),n["data-styled-version"]="4.4.1",n),o=X();return o&&(r.nonce=o),c.a.createElement("style",b({},r,{dangerouslySetInnerHTML:{__html:e()}}))}},ne=function(e){return function(){return Object.keys(e)}},re=function(e,t){return e.createTextNode(G(t))},oe=function e(t,n){var r=void 0===t?Object.create(null):t,o=void 0===n?Object.create(null):n,i=function(e){var t=o[e];return void 0!==t?t:o[e]=[""]},a=function(){var e="";for(var t in o){var n=o[t][0];n&&(e+=G(t)+n)}return e};return{clone:function(){var t=function(e){var t=Object.create(null);for(var n in e)t[n]=b({},e[n]);return t}(r),n=Object.create(null);for(var i in o)n[i]=[o[i][0]];return e(t,n)},css:a,getIds:ne(o),hasNameForId:Q(r),insertMarker:i,insertRules:function(e,t,n){i(e)[0]+=t.join(" "),V(r,e,n)},removeRules:function(e){var t=o[e];void 0!==t&&(t[0]="",q(r,e))},sealed:!1,styleTag:null,toElement:te(a,r),toHTML:ee(a,r)}},ie=function(e,t,n,r,o){if(P&&!n){var i=function(e,t,n){var r=document;e?r=e.ownerDocument:t&&(r=t.ownerDocument);var o=r.createElement("style");o.setAttribute(_,""),o.setAttribute("data-styled-version","4.4.1");var i=X();if(i&&o.setAttribute("nonce",i),o.appendChild(r.createTextNode("")),e&&!t)e.appendChild(o);else{if(!t||!e||!t.parentNode)throw new j(6);t.parentNode.insertBefore(o,n?t:t.nextSibling)}return o}(e,t,r);return T?function(e,t){var n=Object.create(null),r=Object.create(null),o=void 0!==t,i=!1,a=function(t){var o=r[t];return void 0!==o?o:(r[t]=re(e.ownerDocument,t),e.appendChild(r[t]),n[t]=Object.create(null),r[t])},l=function(){var e="";for(var t in r)e+=r[t].data;return e};return{clone:function(){throw new j(5)},css:l,getIds:ne(r),hasNameForId:Q(n),insertMarker:a,insertRules:function(e,r,l){for(var c=a(e),s=[],u=r.length,f=0;f0&&(i=!0,t().insertRules(e+"-import",s))},removeRules:function(a){var l=r[a];if(void 0!==l){var c=re(e.ownerDocument,a);e.replaceChild(c,l),r[a]=c,q(n,a),o&&i&&t().removeRules(a+"-import")}},sealed:!1,styleTag:e,toElement:te(l,n),toHTML:ee(l,n)}}(i,o):function(e,t){var n=Object.create(null),r=Object.create(null),o=[],i=void 0!==t,a=!1,l=function(e){var t=r[e];return void 0!==t?t:(r[e]=o.length,o.push(0),q(n,e),r[e])},c=function(){var t=K(e).cssRules,n="";for(var i in r){n+=G(i);for(var a=r[i],l=J(o,a),c=l-o[a];c0&&(a=!0,t().insertRules(r+"-import",d)),o[u]+=h,V(n,r,s)},removeRules:function(l){var c=r[l];if(void 0!==c&&!1!==e.isConnected){var s=o[c];!function(e,t,n){for(var r=t-n,o=t;o>r;o-=1)e.deleteRule(o)}(K(e),J(o,c)-1,s),o[c]=0,q(n,l),i&&a&&t().removeRules(l+"-import")}},sealed:!1,styleTag:e,toElement:te(c,n),toHTML:ee(c,n)}}(i,o)}return oe()},ae=/\s+/,le=void 0;le=P?T?40:1e3:-1;var ce=0,se=void 0,ue=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:P?document.head:null,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];g(this,e),this.getImportRuleTag=function(){var e=t.importRuleTag;if(void 0!==e)return e;var n=t.tags[0];return t.importRuleTag=ie(t.target,n?n.styleTag:null,t.forceServer,!0)},ce+=1,this.id=ce,this.forceServer=r,this.target=r?null:n,this.tagMap={},this.deferred={},this.rehydratedNames={},this.ignoreRehydratedNames={},this.tags=[],this.capacity=1,this.clones=[]}return e.prototype.rehydrate=function(){if(!P||this.forceServer)return this;var e=[],t=[],n=!1,r=document.querySelectorAll("style["+_+'][data-styled-version="4.4.1"]'),o=r.length;if(!o)return this;for(var i=0;i0&&void 0!==arguments[0]&&arguments[0];se=new e(void 0,t).rehydrate()},e.prototype.clone=function(){var t=new e(this.target,this.forceServer);return this.clones.push(t),t.tags=this.tags.map((function(e){for(var n=e.getIds(),r=e.clone(),o=0;o1?t-1:0),r=1;r=4;)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(t>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(t=1540483477*(65535&(t^=t>>>24))+((1540483477*(t>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:r^=(255&e.charCodeAt(o+2))<<16;case 2:r^=(255&e.charCodeAt(o+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(o)))+((1540483477*(r>>>16)&65535)<<16)}return((r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16))^r>>>15)>>>0}var we=function(e){return String.fromCharCode(e+(e>25?39:97))};function xe(e){var t="",n=void 0;for(n=e;n>52;n=Math.floor(n/52))t=we(n%52)+t;return we(n%52)+t}function ke(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:C,r=!!n&&e.theme===n.theme,o=e.theme&&!r?e.theme:t||n.theme;return o},_e=/[[\].#*$><+~=|^:(),"'`-]+/g,Pe=/(^-|-$)/g;function Te(e){return e.replace(_e,"-").replace(Pe,"")}function je(e){return"string"==typeof e&&!0}var Re={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDerivedStateFromProps:!0,propTypes:!0,type:!0},De={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Me=((Ce={})[u.ForwardRef]={$$typeof:!0,render:!0},Ce),Ae=Object.defineProperty,Ie=Object.getOwnPropertyNames,ze=Object.getOwnPropertySymbols,Be=void 0===ze?function(){return[]}:ze,Le=Object.getOwnPropertyDescriptor,Ne=Object.getPrototypeOf,Fe=Object.prototype,Ue=Array.prototype;function He(e,t,n){if("string"!=typeof t){var r=Ne(t);r&&r!==Fe&&He(e,r,n);for(var o=Ue.concat(Ie(t),Be(t)),i=Me[e.$$typeof]||Re,a=Me[t.$$typeof]||Re,l=o.length,c=void 0,s=void 0;l--;)if(s=o[l],!(De[s]||n&&n[s]||a&&a[s]||i&&i[s])&&(c=Le(t,s)))try{Ae(e,s,c)}catch(e){}return e}return e}var We=Object(l.createContext)(),Ye=We.Consumer,Xe=function(e){function t(n){g(this,t);var r=w(this,e.call(this,n));return r.getContext=Object(f.a)(r.getContext.bind(r)),r.renderInner=r.renderInner.bind(r),r}return y(t,e),t.prototype.render=function(){return this.props.children?c.a.createElement(We.Consumer,null,this.renderInner):null},t.prototype.renderInner=function(e){var t=this.getContext(this.props.theme,e);return c.a.createElement(We.Provider,{value:t},this.props.children)},t.prototype.getTheme=function(e,t){if(S(e))return e(t);if(null===e||Array.isArray(e)||"object"!==(void 0===e?"undefined":m(e)))throw new j(8);return b({},t,e)},t.prototype.getContext=function(e,t){return this.getTheme(e,t)},t}(l.Component),Ve=(function(){function e(){g(this,e),this.masterSheet=ue.master,this.instance=this.masterSheet.clone(),this.sealed=!1}e.prototype.seal=function(){if(!this.sealed){var e=this.masterSheet.clones.indexOf(this.instance);this.masterSheet.clones.splice(e,1),this.sealed=!0}},e.prototype.collectStyles=function(e){if(this.sealed)throw new j(2);return c.a.createElement(Qe,{sheet:this.instance},e)},e.prototype.getStyleTags=function(){return this.seal(),this.instance.toHTML()},e.prototype.getStyleElement=function(){return this.seal(),this.instance.toReactElements()},e.prototype.interleaveWithNodeStream=function(e){throw new j(3)}}(),Object(l.createContext)()),qe=Ve.Consumer,Qe=function(e){function t(n){g(this,t);var r=w(this,e.call(this,n));return r.getContext=Object(f.a)(r.getContext),r}return y(t,e),t.prototype.getContext=function(e,t){if(e)return e;if(t)return new ue(t);throw new j(4)},t.prototype.render=function(){var e=this.props,t=e.children,n=e.sheet,r=e.target;return c.a.createElement(Ve.Provider,{value:this.getContext(n,r)},t)},t}(l.Component),$e={};var Ke=function(e){function t(){g(this,t);var n=w(this,e.call(this));return n.attrs={},n.renderOuter=n.renderOuter.bind(n),n.renderInner=n.renderInner.bind(n),n}return y(t,e),t.prototype.render=function(){return c.a.createElement(qe,null,this.renderOuter)},t.prototype.renderOuter=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ue.master;return this.styleSheet=e,this.props.forwardedComponent.componentStyle.isStatic?this.renderInner():c.a.createElement(Ye,null,this.renderInner)},t.prototype.renderInner=function(e){var t=this.props.forwardedComponent,n=t.componentStyle,r=t.defaultProps,o=(t.displayName,t.foldedComponentIds),i=t.styledComponentId,a=t.target,c=void 0;c=n.isStatic?this.generateAndInjectStyles(C,this.props):this.generateAndInjectStyles(Oe(this.props,e,r)||C,this.props);var s=this.props.as||this.attrs.as||a,u=je(s),f={},h=b({},this.props,this.attrs),d=void 0;for(d in h)"forwardedComponent"!==d&&"as"!==d&&("forwardedRef"===d?f.ref=h[d]:"forwardedAs"===d?f.as=h[d]:u&&!Object(p.a)(d)||(f[d]=h[d]));return this.props.style&&this.attrs.style&&(f.style=b({},this.attrs.style,this.props.style)),f.className=Array.prototype.concat(o,i,c!==i?c:null,this.props.className,this.attrs.className).filter(Boolean).join(" "),Object(l.createElement)(s,f)},t.prototype.buildExecutionContext=function(e,t,n){var r=this,o=b({},t,{theme:e});return n.length?(this.attrs={},n.forEach((function(e){var t,n=e,i=!1,a=void 0,l=void 0;for(l in S(n)&&(n=n(o),i=!0),n)a=n[l],i||!S(a)||(t=a)&&t.prototype&&t.prototype.isReactComponent||O(a)||(a=a(o)),r.attrs[l]=a,o[l]=a})),o):o},t.prototype.generateAndInjectStyles=function(e,t){var n=t.forwardedComponent,r=n.attrs,o=n.componentStyle;n.warnTooManyClasses;return o.isStatic&&!r.length?o.generateAndInjectStyles(C,this.styleSheet):o.generateAndInjectStyles(this.buildExecutionContext(e,t,r),this.styleSheet)},t}(l.Component);function Ze(e,t,n){var r=O(e),o=!je(e),i=t.displayName,a=void 0===i?function(e){return je(e)?"styled."+e:"Styled("+E(e)+")"}(e):i,l=t.componentId,s=void 0===l?function(e,t,n){var r="string"!=typeof t?"sc":Te(t),o=($e[r]||0)+1;$e[r]=o;var i=r+"-"+e.generateName(r+o);return n?n+"-"+i:i}(Ee,t.displayName,t.parentComponentId):l,u=t.ParentComponent,f=void 0===u?Ke:u,p=t.attrs,d=void 0===p?k:p,m=t.displayName&&t.componentId?Te(t.displayName)+"-"+t.componentId:t.componentId||s,g=r&&e.attrs?Array.prototype.concat(e.attrs,d).filter(Boolean):d,v=new Ee(r?e.componentStyle.rules.concat(n):n,g,m),y=void 0,w=function(e,t){return c.a.createElement(f,b({},e,{forwardedComponent:y,forwardedRef:t}))};return w.displayName=a,(y=c.a.forwardRef(w)).displayName=a,y.attrs=g,y.componentStyle=v,y.foldedComponentIds=r?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):k,y.styledComponentId=m,y.target=r?e.target:e,y.withComponent=function(e){var r=t.componentId,o=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["componentId"]),i=r&&r+"-"+(je(e)?e:Te(E(e)));return Ze(e,b({},o,{attrs:g,componentId:i,ParentComponent:f}),n)},Object.defineProperty(y,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?Object(h.a)(e.defaultProps,t):t}}),y.toString=function(){return"."+y.styledComponentId},o&&He(y,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,styledComponentId:!0,target:!0,withComponent:!0}),y}var Ge=function(e){return function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:C;if(!Object(u.isValidElementType)(n))throw new j(1,String(n));var o=function(){return t(n,r,be.apply(void 0,arguments))};return o.withConfig=function(o){return e(t,n,b({},r,o))},o.attrs=function(o){return e(t,n,b({},r,{attrs:Array.prototype.concat(r.attrs,o).filter(Boolean)}))},o}(Ze,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){Ge[e]=Ge(e)}));!function(){function e(t,n){g(this,e),this.rules=t,this.componentId=n,this.isStatic=ke(t,k),ue.master.hasId(n)||ue.master.deferredInject(n,[])}e.prototype.createStyles=function(e,t){var n=Y(ve(this.rules,e,t),"");t.inject(this.componentId,n)},e.prototype.removeStyles=function(e){var t=this.componentId;e.hasId(t)&&e.remove(t)},e.prototype.renderStyles=function(e,t){this.removeStyles(t),this.createStyles(e,t)}}();P&&(window.scCGSHMRCache={});t.b=Ge}).call(this,n(11))},function(e,t,n){"use strict";function r(e,t){for(var n=0;n1?n-1:0),o=1;o255?255:e}},{key:"copyAttributes",value:function(e,t,n){return null==n&&(n={}),function(){for(var r=[],o=0,i=Array.from(e.attributes);o])/g,b=/([[}=:>])\s+/g,y=/(\{[^{]+?);(?=\})/g,w=/\s{2,}/g,x=/([^\(])(:+) */g,k=/[svh]\w+-[tblr]{2}/,C=/\(\s*(.*)\s*\)/g,S=/([\s\S]*?);/g,E=/-self|flex-/g,O=/[^]*?(:[rp][el]a[\w-]+)[^]*/,_=/stretch|:\s*\w+\-(?:conte|avail)/,P=/([^-])(image-set\()/,T="-webkit-",j="-moz-",R="-ms-",D=59,M=125,A=123,I=40,z=41,B=10,L=13,N=32,F=45,U=42,H=44,W=58,Y=47,X=1,V=1,q=0,Q=1,$=1,K=1,Z=0,G=0,J=0,ee=[],te=[],ne=0,re=null,oe=0,ie=1,ae="",le="",ce="";function se(e,t,o,i,a){for(var l,c,u=0,f=0,p=0,h=0,v=0,b=0,y=0,w=0,k=0,S=0,E=0,O=0,_=0,P=0,j=0,R=0,Z=0,te=0,re=0,fe=o.length,ve=fe-1,be="",ye="",we="",xe="",ke="",Ce="";j0&&(ye=ye.replace(r,"")),ye.trim().length>0)){switch(y){case N:case 9:case D:case L:case B:break;default:ye+=o.charAt(j)}y=D}if(1===Z)switch(y){case A:case M:case D:case 34:case 39:case I:case z:case H:Z=0;case 9:case L:case B:case N:break;default:for(Z=0,re=j,v=y,j--,y=D;re0&&(++j,y=v);case A:re=fe}}switch(y){case A:for(v=(ye=ye.trim()).charCodeAt(0),E=1,re=++j;j0&&(ye=ye.replace(r,"")),b=ye.charCodeAt(1)){case 100:case 109:case 115:case F:l=t;break;default:l=ee}if(re=(we=se(t,l,we,b,a+1)).length,J>0&&0===re&&(re=ye.length),ne>0&&(c=me(3,we,l=ue(ee,ye,te),t,V,X,re,b,a,i),ye=l.join(""),void 0!==c&&0===(re=(we=c.trim()).length)&&(b=0,we="")),re>0)switch(b){case 115:ye=ye.replace(C,de);case 100:case 109:case F:we=ye+"{"+we+"}";break;case 107:we=(ye=ye.replace(d,"$1 $2"+(ie>0?ae:"")))+"{"+we+"}",we=1===$||2===$&&he("@"+we,3)?"@"+T+we+"@"+we:"@"+we;break;default:we=ye+we,112===i&&(xe+=we,we="")}else we="";break;default:we=se(t,ue(t,ye,te),we,i,a+1)}ke+=we,O=0,Z=0,P=0,R=0,te=0,_=0,ye="",we="",y=o.charCodeAt(++j);break;case M:case D:if((re=(ye=(R>0?ye.replace(r,""):ye).trim()).length)>1)switch(0===P&&((v=ye.charCodeAt(0))===F||v>96&&v<123)&&(re=(ye=ye.replace(" ",":")).length),ne>0&&void 0!==(c=me(1,ye,t,e,V,X,xe.length,i,a,i))&&0===(re=(ye=c.trim()).length)&&(ye="\0\0"),v=ye.charCodeAt(0),b=ye.charCodeAt(1),v){case 0:break;case 64:if(105===b||99===b){Ce+=ye+o.charAt(j);break}default:if(ye.charCodeAt(re-1)===W)break;xe+=pe(ye,v,b,ye.charCodeAt(2))}O=0,Z=0,P=0,R=0,te=0,ye="",y=o.charCodeAt(++j)}}switch(y){case L:case B:if(f+h+p+u+G===0)switch(S){case z:case 39:case 34:case 64:case 126:case 62:case U:case 43:case Y:case F:case W:case H:case D:case A:case M:break;default:P>0&&(Z=1)}f===Y?f=0:Q+O===0&&107!==i&&ye.length>0&&(R=1,ye+="\0"),ne*oe>0&&me(0,ye,t,e,V,X,xe.length,i,a,i),X=1,V++;break;case D:case M:if(f+h+p+u===0){X++;break}default:switch(X++,be=o.charAt(j),y){case 9:case N:if(h+u+f===0)switch(w){case H:case W:case 9:case N:be="";break;default:y!==N&&(be=" ")}break;case 0:be="\\0";break;case 12:be="\\f";break;case 11:be="\\v";break;case 38:h+f+u===0&&Q>0&&(te=1,R=1,be="\f"+be);break;case 108:if(h+f+u+q===0&&P>0)switch(j-P){case 2:112===w&&o.charCodeAt(j-3)===W&&(q=w);case 8:111===k&&(q=k)}break;case W:h+f+u===0&&(P=j);break;case H:f+p+h+u===0&&(R=1,be+="\r");break;case 34:case 39:0===f&&(h=h===y?0:0===h?y:h);break;case 91:h+f+p===0&&u++;break;case 93:h+f+p===0&&u--;break;case z:h+f+u===0&&p--;break;case I:if(h+f+u===0){if(0===O)switch(2*w+3*k){case 533:break;default:E=0,O=1}p++}break;case 64:f+p+h+u+P+_===0&&(_=1);break;case U:case Y:if(h+u+p>0)break;switch(f){case 0:switch(2*y+3*o.charCodeAt(j+1)){case 235:f=Y;break;case 220:re=j,f=U}break;case U:y===Y&&w===U&&re+2!==j&&(33===o.charCodeAt(re+2)&&(xe+=o.substring(re,j+1)),be="",f=0)}}if(0===f){if(Q+h+u+_===0&&107!==i&&y!==D)switch(y){case H:case 126:case 62:case 43:case z:case I:if(0===O){switch(w){case 9:case N:case B:case L:be+="\0";break;default:be="\0"+be+(y===H?"":"\0")}R=1}else switch(y){case I:P+7===j&&108===w&&(P=0),O=++E;break;case z:0==(O=--E)&&(R=1,be+="\0")}break;case 9:case N:switch(w){case 0:case A:case M:case D:case H:case 12:case 9:case N:case B:case L:break;default:0===O&&(R=1,be+="\0")}}ye+=be,y!==N&&9!==y&&(S=y)}}k=w,w=y,j++}if(re=xe.length,J>0&&0===re&&0===ke.length&&0===t[0].length==0&&(109!==i||1===t.length&&(Q>0?le:ce)===t[0])&&(re=t.join(",").length+2),re>0){if(l=0===Q&&107!==i?function(e){for(var t,n,o=0,i=e.length,a=Array(i);o1)){if(p=c.charCodeAt(c.length-1),h=n.charCodeAt(0),t="",0!==u)switch(p){case U:case 126:case 62:case 43:case N:case I:break;default:t=" "}switch(h){case 38:n=t+le;case 126:case 62:case 43:case N:case z:case I:break;case 91:n=t+n+le;break;case W:switch(2*n.charCodeAt(1)+3*n.charCodeAt(2)){case 530:if(K>0){n=t+n.substring(8,f-1);break}default:(u<1||l[u-1].length<1)&&(n=t+le+n)}break;case H:t="";default:n=f>1&&n.indexOf(":")>0?t+n.replace(x,"$1"+le+"$2"):t+n+le}c+=n}a[o]=c.replace(r,"").trim()}return a}(t):t,ne>0&&void 0!==(c=me(2,xe,l,e,V,X,re,i,a,i))&&0===(xe=c).length)return Ce+xe+ke;if(xe=l.join(",")+"{"+xe+"}",$*q!=0){switch(2!==$||he(xe,2)||(q=0),q){case 111:xe=xe.replace(g,":-moz-$1")+xe;break;case 112:xe=xe.replace(m,"::"+T+"input-$1")+xe.replace(m,"::-moz-$1")+xe.replace(m,":-ms-input-$1")+xe}q=0}}return Ce+xe+ke}function ue(e,t,n){var r=t.trim().split(u),o=r,i=r.length,a=e.length;switch(a){case 0:case 1:for(var l=0,c=0===a?"":e[0]+" ";l0&&Q>0)return o.replace(p,"$1").replace(f,"$1"+ce);break;default:return e.trim()+o.replace(f,"$1"+e.trim())}default:if(n*Q>0&&o.indexOf("\f")>0)return o.replace(f,(e.charCodeAt(0)===W?"":"$1")+e.trim())}return e+o}function pe(e,t,n,r){var s,u=0,f=e+";",p=2*t+3*n+4*r;if(944===p)return function(e){var t=e.length,n=e.indexOf(":",9)+1,r=e.substring(0,n).trim(),o=e.substring(n,t-1).trim();switch(e.charCodeAt(9)*ie){case 0:break;case F:if(110!==e.charCodeAt(10))break;default:var i=o.split((o="",l)),a=0;for(n=0,t=i.length;a64&&f<90||f>96&&f<123||95===f||f===F&&s.charCodeAt(1)!==F))switch(isNaN(parseFloat(s))+(-1!==s.indexOf("("))){case 1:switch(s){case"infinite":case"alternate":case"backwards":case"running":case"normal":case"forwards":case"both":case"none":case"linear":case"ease":case"ease-in":case"ease-out":case"ease-in-out":case"paused":case"reverse":case"alternate-reverse":case"inherit":case"initial":case"unset":case"step-start":case"step-end":break;default:s+=ae}}u[n++]=s}o+=(0===a?"":",")+u.join(" ")}}return o=r+o+";",1===$||2===$&&he(o,1)?T+o+o:o}(f);if(0===$||2===$&&!he(f,1))return f;switch(p){case 1015:return 97===f.charCodeAt(10)?T+f+f:f;case 951:return 116===f.charCodeAt(3)?T+f+f:f;case 963:return 110===f.charCodeAt(5)?T+f+f:f;case 1009:if(100!==f.charCodeAt(4))break;case 969:case 942:return T+f+f;case 978:return T+f+j+f+f;case 1019:case 983:return T+f+j+f+R+f+f;case 883:return f.charCodeAt(8)===F?T+f+f:f.indexOf("image-set(",11)>0?f.replace(P,"$1"+T+"$2")+f:f;case 932:if(f.charCodeAt(4)===F)switch(f.charCodeAt(5)){case 103:return T+"box-"+f.replace("-grow","")+T+f+R+f.replace("grow","positive")+f;case 115:return T+f+R+f.replace("shrink","negative")+f;case 98:return T+f+R+f.replace("basis","preferred-size")+f}return T+f+R+f+f;case 964:return T+f+R+"flex-"+f+f;case 1023:if(99!==f.charCodeAt(8))break;return s=f.substring(f.indexOf(":",15)).replace("flex-","").replace("space-between","justify"),T+"box-pack"+s+T+f+R+"flex-pack"+s+f;case 1005:return i.test(f)?f.replace(o,":"+T)+f.replace(o,":"+j)+f:f;case 1e3:switch(u=(s=f.substring(13).trim()).indexOf("-")+1,s.charCodeAt(0)+s.charCodeAt(u)){case 226:s=f.replace(k,"tb");break;case 232:s=f.replace(k,"tb-rl");break;case 220:s=f.replace(k,"lr");break;default:return f}return T+f+R+s+f;case 1017:if(-1===f.indexOf("sticky",9))return f;case 975:switch(u=(f=e).length-10,p=(s=(33===f.charCodeAt(u)?f.substring(0,u):f).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|s.charCodeAt(7))){case 203:if(s.charCodeAt(8)<111)break;case 115:f=f.replace(s,T+s)+";"+f;break;case 207:case 102:f=f.replace(s,T+(p>102?"inline-":"")+"box")+";"+f.replace(s,T+s)+";"+f.replace(s,R+s+"box")+";"+f}return f+";";case 938:if(f.charCodeAt(5)===F)switch(f.charCodeAt(6)){case 105:return s=f.replace("-items",""),T+f+T+"box-"+s+R+"flex-"+s+f;case 115:return T+f+R+"flex-item-"+f.replace(E,"")+f;default:return T+f+R+"flex-line-pack"+f.replace("align-content","").replace(E,"")+f}break;case 973:case 989:if(f.charCodeAt(3)!==F||122===f.charCodeAt(4))break;case 931:case 953:if(!0===_.test(e))return 115===(s=e.substring(e.indexOf(":")+1)).charCodeAt(0)?pe(e.replace("stretch","fill-available"),t,n,r).replace(":fill-available",":stretch"):f.replace(s,T+s)+f.replace(s,j+s.replace("fill-",""))+f;break;case 962:if(f=T+f+(102===f.charCodeAt(5)?R+f:"")+f,n+r===211&&105===f.charCodeAt(13)&&f.indexOf("transform",10)>0)return f.substring(0,f.indexOf(";",27)+1).replace(a,"$1"+T+"$2")+f}return f}function he(e,t){var n=e.indexOf(1===t?":":"{"),r=e.substring(0,3!==t?n:10),o=e.substring(n+1,e.length-1);return re(2!==t?r:r.replace(O,"$1"),o,t)}function de(e,t){var n=pe(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return n!==t+";"?n.replace(S," or ($1)").substring(4):"("+t+")"}function me(e,t,n,r,o,i,a,l,c,s){for(var u,f=0,p=t;f0&&(ae=o.replace(h,91===i?"":"-")),i=1,1===Q?ce=o:le=o;var a,l=[ce];ne>0&&void 0!==(a=me(-1,n,l,l,V,X,0,0,0,0))&&"string"==typeof a&&(n=a);var c=se(ee,l,n,0,0);return ne>0&&void 0!==(a=me(-2,c,l,l,V,X,c.length,0,0,0))&&"string"!=typeof(c=a)&&(i=0),ae="",ce="",le="",q=0,V=1,X=1,Z*i==0?c:c.replace(r,"").replace(v,"").replace(b,"$1").replace(y,"$1").replace(w," ")}return be.use=function e(t){switch(t){case void 0:case null:ne=te.length=0;break;default:if("function"==typeof t)te[ne++]=t;else if("object"==typeof t)for(var n=0,r=t.length;n1?r-1:0),i=1;i0?" Additional arguments: "+o.join(", "):"")));return w(a)}return y(t,e),t}(Error),R=/^[^\S\n]*?\/\* sc-component-id:\s*(\S+)\s+\*\//gm,D=function(e){var t=""+(e||""),n=[];return t.replace(R,(function(e,t,r){return n.push({componentId:t,matchIndex:r}),e})),n.map((function(e,r){var o=e.componentId,i=e.matchIndex,a=n[r+1];return{componentId:o,cssFromDOM:a?t.slice(i,a.matchIndex):t.slice(i)}}))},M=/^\s*\/\/.*$/gm,A=new o.a({global:!1,cascade:!0,keyframe:!1,prefix:!1,compress:!1,semicolon:!0}),I=new o.a({global:!1,cascade:!0,keyframe:!1,prefix:!0,compress:!1,semicolon:!1}),z=[],B=function(e){if(-2===e){var t=z;return z=[],t}},L=a()((function(e){z.push(e)})),N=void 0,F=void 0,U=void 0,H=function(e,t,n){return t>0&&-1!==n.slice(0,t).indexOf(F)&&n.slice(t-F.length,t)!==F?"."+N:e};I.use([function(e,t,n){2===e&&n.length&&n[0].lastIndexOf(F)>0&&(n[0]=n[0].replace(U,H))},L,B]),A.use([L,B]);var W=function(e){return A("",e)};function Y(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&",o=e.join("").replace(M,""),i=t&&n?n+" "+t+" { "+o+" }":o;return N=r,F=t,U=new RegExp("\\"+F+"\\b","g"),I(n||!t?"":t,i)}var V=function(){return n.nc},X=function(e,t,n){n&&((e[t]||(e[t]=Object.create(null)))[n]=!0)},q=function(e,t){e[t]=Object.create(null)},$=function(e){return function(t,n){return void 0!==e[t]&&e[t][n]}},Q=function(e){var t="";for(var n in e)t+=Object.keys(e[n]).join(" ")+" ";return t.trim()},K=function(e){if(e.sheet)return e.sheet;for(var t=e.ownerDocument.styleSheets.length,n=0;n"+e()+""}},te=function(e,t){return function(){var n,r=((n={})[_]=Q(t),n["data-styled-version"]="4.4.1",n),o=V();return o&&(r.nonce=o),c.a.createElement("style",b({},r,{dangerouslySetInnerHTML:{__html:e()}}))}},ne=function(e){return function(){return Object.keys(e)}},re=function(e,t){return e.createTextNode(G(t))},oe=function e(t,n){var r=void 0===t?Object.create(null):t,o=void 0===n?Object.create(null):n,i=function(e){var t=o[e];return void 0!==t?t:o[e]=[""]},a=function(){var e="";for(var t in o){var n=o[t][0];n&&(e+=G(t)+n)}return e};return{clone:function(){var t=function(e){var t=Object.create(null);for(var n in e)t[n]=b({},e[n]);return t}(r),n=Object.create(null);for(var i in o)n[i]=[o[i][0]];return e(t,n)},css:a,getIds:ne(o),hasNameForId:$(r),insertMarker:i,insertRules:function(e,t,n){i(e)[0]+=t.join(" "),X(r,e,n)},removeRules:function(e){var t=o[e];void 0!==t&&(t[0]="",q(r,e))},sealed:!1,styleTag:null,toElement:te(a,r),toHTML:ee(a,r)}},ie=function(e,t,n,r,o){if(P&&!n){var i=function(e,t,n){var r=document;e?r=e.ownerDocument:t&&(r=t.ownerDocument);var o=r.createElement("style");o.setAttribute(_,""),o.setAttribute("data-styled-version","4.4.1");var i=V();if(i&&o.setAttribute("nonce",i),o.appendChild(r.createTextNode("")),e&&!t)e.appendChild(o);else{if(!t||!e||!t.parentNode)throw new j(6);t.parentNode.insertBefore(o,n?t:t.nextSibling)}return o}(e,t,r);return T?function(e,t){var n=Object.create(null),r=Object.create(null),o=void 0!==t,i=!1,a=function(t){var o=r[t];return void 0!==o?o:(r[t]=re(e.ownerDocument,t),e.appendChild(r[t]),n[t]=Object.create(null),r[t])},l=function(){var e="";for(var t in r)e+=r[t].data;return e};return{clone:function(){throw new j(5)},css:l,getIds:ne(r),hasNameForId:$(n),insertMarker:a,insertRules:function(e,r,l){for(var c=a(e),s=[],u=r.length,f=0;f0&&(i=!0,t().insertRules(e+"-import",s))},removeRules:function(a){var l=r[a];if(void 0!==l){var c=re(e.ownerDocument,a);e.replaceChild(c,l),r[a]=c,q(n,a),o&&i&&t().removeRules(a+"-import")}},sealed:!1,styleTag:e,toElement:te(l,n),toHTML:ee(l,n)}}(i,o):function(e,t){var n=Object.create(null),r=Object.create(null),o=[],i=void 0!==t,a=!1,l=function(e){var t=r[e];return void 0!==t?t:(r[e]=o.length,o.push(0),q(n,e),r[e])},c=function(){var t=K(e).cssRules,n="";for(var i in r){n+=G(i);for(var a=r[i],l=J(o,a),c=l-o[a];c0&&(a=!0,t().insertRules(r+"-import",d)),o[u]+=h,X(n,r,s)},removeRules:function(l){var c=r[l];if(void 0!==c&&!1!==e.isConnected){var s=o[c];!function(e,t,n){for(var r=t-n,o=t;o>r;o-=1)e.deleteRule(o)}(K(e),J(o,c)-1,s),o[c]=0,q(n,l),i&&a&&t().removeRules(l+"-import")}},sealed:!1,styleTag:e,toElement:te(c,n),toHTML:ee(c,n)}}(i,o)}return oe()},ae=/\s+/,le=void 0;le=P?T?40:1e3:-1;var ce=0,se=void 0,ue=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:P?document.head:null,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];g(this,e),this.getImportRuleTag=function(){var e=t.importRuleTag;if(void 0!==e)return e;var n=t.tags[0];return t.importRuleTag=ie(t.target,n?n.styleTag:null,t.forceServer,!0)},ce+=1,this.id=ce,this.forceServer=r,this.target=r?null:n,this.tagMap={},this.deferred={},this.rehydratedNames={},this.ignoreRehydratedNames={},this.tags=[],this.capacity=1,this.clones=[]}return e.prototype.rehydrate=function(){if(!P||this.forceServer)return this;var e=[],t=[],n=!1,r=document.querySelectorAll("style["+_+'][data-styled-version="4.4.1"]'),o=r.length;if(!o)return this;for(var i=0;i0&&void 0!==arguments[0]&&arguments[0];se=new e(void 0,t).rehydrate()},e.prototype.clone=function(){var t=new e(this.target,this.forceServer);return this.clones.push(t),t.tags=this.tags.map((function(e){for(var n=e.getIds(),r=e.clone(),o=0;o1?t-1:0),r=1;r=4;)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(t>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(t=1540483477*(65535&(t^=t>>>24))+((1540483477*(t>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:r^=(255&e.charCodeAt(o+2))<<16;case 2:r^=(255&e.charCodeAt(o+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(o)))+((1540483477*(r>>>16)&65535)<<16)}return((r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16))^r>>>15)>>>0}var we=function(e){return String.fromCharCode(e+(e>25?39:97))};function xe(e){var t="",n=void 0;for(n=e;n>52;n=Math.floor(n/52))t=we(n%52)+t;return we(n%52)+t}function ke(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:C,r=!!n&&e.theme===n.theme,o=e.theme&&!r?e.theme:t||n.theme;return o},_e=/[[\].#*$><+~=|^:(),"'`-]+/g,Pe=/(^-|-$)/g;function Te(e){return e.replace(_e,"-").replace(Pe,"")}function je(e){return"string"==typeof e&&!0}var Re={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDerivedStateFromProps:!0,propTypes:!0,type:!0},De={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Me=((Ce={})[u.ForwardRef]={$$typeof:!0,render:!0},Ce),Ae=Object.defineProperty,Ie=Object.getOwnPropertyNames,ze=Object.getOwnPropertySymbols,Be=void 0===ze?function(){return[]}:ze,Le=Object.getOwnPropertyDescriptor,Ne=Object.getPrototypeOf,Fe=Object.prototype,Ue=Array.prototype;function He(e,t,n){if("string"!=typeof t){var r=Ne(t);r&&r!==Fe&&He(e,r,n);for(var o=Ue.concat(Ie(t),Be(t)),i=Me[e.$$typeof]||Re,a=Me[t.$$typeof]||Re,l=o.length,c=void 0,s=void 0;l--;)if(s=o[l],!(De[s]||n&&n[s]||a&&a[s]||i&&i[s])&&(c=Le(t,s)))try{Ae(e,s,c)}catch(e){}return e}return e}var We=Object(l.createContext)(),Ye=We.Consumer,Ve=function(e){function t(n){g(this,t);var r=w(this,e.call(this,n));return r.getContext=Object(f.a)(r.getContext.bind(r)),r.renderInner=r.renderInner.bind(r),r}return y(t,e),t.prototype.render=function(){return this.props.children?c.a.createElement(We.Consumer,null,this.renderInner):null},t.prototype.renderInner=function(e){var t=this.getContext(this.props.theme,e);return c.a.createElement(We.Provider,{value:t},this.props.children)},t.prototype.getTheme=function(e,t){if(S(e))return e(t);if(null===e||Array.isArray(e)||"object"!==(void 0===e?"undefined":m(e)))throw new j(8);return b({},t,e)},t.prototype.getContext=function(e,t){return this.getTheme(e,t)},t}(l.Component),Xe=(function(){function e(){g(this,e),this.masterSheet=ue.master,this.instance=this.masterSheet.clone(),this.sealed=!1}e.prototype.seal=function(){if(!this.sealed){var e=this.masterSheet.clones.indexOf(this.instance);this.masterSheet.clones.splice(e,1),this.sealed=!0}},e.prototype.collectStyles=function(e){if(this.sealed)throw new j(2);return c.a.createElement($e,{sheet:this.instance},e)},e.prototype.getStyleTags=function(){return this.seal(),this.instance.toHTML()},e.prototype.getStyleElement=function(){return this.seal(),this.instance.toReactElements()},e.prototype.interleaveWithNodeStream=function(e){throw new j(3)}}(),Object(l.createContext)()),qe=Xe.Consumer,$e=function(e){function t(n){g(this,t);var r=w(this,e.call(this,n));return r.getContext=Object(f.a)(r.getContext),r}return y(t,e),t.prototype.getContext=function(e,t){if(e)return e;if(t)return new ue(t);throw new j(4)},t.prototype.render=function(){var e=this.props,t=e.children,n=e.sheet,r=e.target;return c.a.createElement(Xe.Provider,{value:this.getContext(n,r)},t)},t}(l.Component),Qe={};var Ke=function(e){function t(){g(this,t);var n=w(this,e.call(this));return n.attrs={},n.renderOuter=n.renderOuter.bind(n),n.renderInner=n.renderInner.bind(n),n}return y(t,e),t.prototype.render=function(){return c.a.createElement(qe,null,this.renderOuter)},t.prototype.renderOuter=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ue.master;return this.styleSheet=e,this.props.forwardedComponent.componentStyle.isStatic?this.renderInner():c.a.createElement(Ye,null,this.renderInner)},t.prototype.renderInner=function(e){var t=this.props.forwardedComponent,n=t.componentStyle,r=t.defaultProps,o=(t.displayName,t.foldedComponentIds),i=t.styledComponentId,a=t.target,c=void 0;c=n.isStatic?this.generateAndInjectStyles(C,this.props):this.generateAndInjectStyles(Oe(this.props,e,r)||C,this.props);var s=this.props.as||this.attrs.as||a,u=je(s),f={},h=b({},this.props,this.attrs),d=void 0;for(d in h)"forwardedComponent"!==d&&"as"!==d&&("forwardedRef"===d?f.ref=h[d]:"forwardedAs"===d?f.as=h[d]:u&&!Object(p.a)(d)||(f[d]=h[d]));return this.props.style&&this.attrs.style&&(f.style=b({},this.attrs.style,this.props.style)),f.className=Array.prototype.concat(o,i,c!==i?c:null,this.props.className,this.attrs.className).filter(Boolean).join(" "),Object(l.createElement)(s,f)},t.prototype.buildExecutionContext=function(e,t,n){var r=this,o=b({},t,{theme:e});return n.length?(this.attrs={},n.forEach((function(e){var t,n=e,i=!1,a=void 0,l=void 0;for(l in S(n)&&(n=n(o),i=!0),n)a=n[l],i||!S(a)||(t=a)&&t.prototype&&t.prototype.isReactComponent||O(a)||(a=a(o)),r.attrs[l]=a,o[l]=a})),o):o},t.prototype.generateAndInjectStyles=function(e,t){var n=t.forwardedComponent,r=n.attrs,o=n.componentStyle;n.warnTooManyClasses;return o.isStatic&&!r.length?o.generateAndInjectStyles(C,this.styleSheet):o.generateAndInjectStyles(this.buildExecutionContext(e,t,r),this.styleSheet)},t}(l.Component);function Ze(e,t,n){var r=O(e),o=!je(e),i=t.displayName,a=void 0===i?function(e){return je(e)?"styled."+e:"Styled("+E(e)+")"}(e):i,l=t.componentId,s=void 0===l?function(e,t,n){var r="string"!=typeof t?"sc":Te(t),o=(Qe[r]||0)+1;Qe[r]=o;var i=r+"-"+e.generateName(r+o);return n?n+"-"+i:i}(Ee,t.displayName,t.parentComponentId):l,u=t.ParentComponent,f=void 0===u?Ke:u,p=t.attrs,d=void 0===p?k:p,m=t.displayName&&t.componentId?Te(t.displayName)+"-"+t.componentId:t.componentId||s,g=r&&e.attrs?Array.prototype.concat(e.attrs,d).filter(Boolean):d,v=new Ee(r?e.componentStyle.rules.concat(n):n,g,m),y=void 0,w=function(e,t){return c.a.createElement(f,b({},e,{forwardedComponent:y,forwardedRef:t}))};return w.displayName=a,(y=c.a.forwardRef(w)).displayName=a,y.attrs=g,y.componentStyle=v,y.foldedComponentIds=r?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):k,y.styledComponentId=m,y.target=r?e.target:e,y.withComponent=function(e){var r=t.componentId,o=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["componentId"]),i=r&&r+"-"+(je(e)?e:Te(E(e)));return Ze(e,b({},o,{attrs:g,componentId:i,ParentComponent:f}),n)},Object.defineProperty(y,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?Object(h.a)(e.defaultProps,t):t}}),y.toString=function(){return"."+y.styledComponentId},o&&He(y,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,styledComponentId:!0,target:!0,withComponent:!0}),y}var Ge=function(e){return function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:C;if(!Object(u.isValidElementType)(n))throw new j(1,String(n));var o=function(){return t(n,r,be.apply(void 0,arguments))};return o.withConfig=function(o){return e(t,n,b({},r,o))},o.attrs=function(o){return e(t,n,b({},r,{attrs:Array.prototype.concat(r.attrs,o).filter(Boolean)}))},o}(Ze,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){Ge[e]=Ge(e)}));!function(){function e(t,n){g(this,e),this.rules=t,this.componentId=n,this.isStatic=ke(t,k),ue.master.hasId(n)||ue.master.deferredInject(n,[])}e.prototype.createStyles=function(e,t){var n=Y(ve(this.rules,e,t),"");t.inject(this.componentId,n)},e.prototype.removeStyles=function(e){var t=this.componentId;e.hasId(t)&&e.remove(t)},e.prototype.renderStyles=function(e,t){this.removeStyles(t),this.createStyles(e,t)}}();P&&(window.scCGSHMRCache={});t.b=Ge}).call(this,n(11))},function(e,t,n){"use strict";function r(e,t){for(var n=0;n1?n-1:0),o=1;o255?255:e}},{key:"copyAttributes",value:function(e,t,n){return null==n&&(n={}),function(){for(var r=[],o=0,i=Array.from(e.attributes);o])/g,b=/([[}=:>])\s+/g,y=/(\{[^{]+?);(?=\})/g,w=/\s{2,}/g,x=/([^\(])(:+) */g,k=/[svh]\w+-[tblr]{2}/,C=/\(\s*(.*)\s*\)/g,S=/([\s\S]*?);/g,E=/-self|flex-/g,O=/[^]*?(:[rp][el]a[\w-]+)[^]*/,_=/stretch|:\s*\w+\-(?:conte|avail)/,P=/([^-])(image-set\()/,T="-webkit-",j="-moz-",R="-ms-",D=59,M=125,A=123,I=40,z=41,B=10,L=13,N=32,F=45,U=42,H=44,W=58,Y=47,V=1,X=1,q=0,$=1,Q=1,K=1,Z=0,G=0,J=0,ee=[],te=[],ne=0,re=null,oe=0,ie=1,ae="",le="",ce="";function se(e,t,o,i,a){for(var l,c,u=0,f=0,p=0,h=0,v=0,b=0,y=0,w=0,k=0,S=0,E=0,O=0,_=0,P=0,j=0,R=0,Z=0,te=0,re=0,fe=o.length,ve=fe-1,be="",ye="",we="",xe="",ke="",Ce="";j0&&(ye=ye.replace(r,"")),ye.trim().length>0)){switch(y){case N:case 9:case D:case L:case B:break;default:ye+=o.charAt(j)}y=D}if(1===Z)switch(y){case A:case M:case D:case 34:case 39:case I:case z:case H:Z=0;case 9:case L:case B:case N:break;default:for(Z=0,re=j,v=y,j--,y=D;re0&&(++j,y=v);case A:re=fe}}switch(y){case A:for(v=(ye=ye.trim()).charCodeAt(0),E=1,re=++j;j0&&(ye=ye.replace(r,"")),b=ye.charCodeAt(1)){case 100:case 109:case 115:case F:l=t;break;default:l=ee}if(re=(we=se(t,l,we,b,a+1)).length,J>0&&0===re&&(re=ye.length),ne>0&&(c=me(3,we,l=ue(ee,ye,te),t,X,V,re,b,a,i),ye=l.join(""),void 0!==c&&0===(re=(we=c.trim()).length)&&(b=0,we="")),re>0)switch(b){case 115:ye=ye.replace(C,de);case 100:case 109:case F:we=ye+"{"+we+"}";break;case 107:we=(ye=ye.replace(d,"$1 $2"+(ie>0?ae:"")))+"{"+we+"}",we=1===Q||2===Q&&he("@"+we,3)?"@"+T+we+"@"+we:"@"+we;break;default:we=ye+we,112===i&&(xe+=we,we="")}else we="";break;default:we=se(t,ue(t,ye,te),we,i,a+1)}ke+=we,O=0,Z=0,P=0,R=0,te=0,_=0,ye="",we="",y=o.charCodeAt(++j);break;case M:case D:if((re=(ye=(R>0?ye.replace(r,""):ye).trim()).length)>1)switch(0===P&&((v=ye.charCodeAt(0))===F||v>96&&v<123)&&(re=(ye=ye.replace(" ",":")).length),ne>0&&void 0!==(c=me(1,ye,t,e,X,V,xe.length,i,a,i))&&0===(re=(ye=c.trim()).length)&&(ye="\0\0"),v=ye.charCodeAt(0),b=ye.charCodeAt(1),v){case 0:break;case 64:if(105===b||99===b){Ce+=ye+o.charAt(j);break}default:if(ye.charCodeAt(re-1)===W)break;xe+=pe(ye,v,b,ye.charCodeAt(2))}O=0,Z=0,P=0,R=0,te=0,ye="",y=o.charCodeAt(++j)}}switch(y){case L:case B:if(f+h+p+u+G===0)switch(S){case z:case 39:case 34:case 64:case 126:case 62:case U:case 43:case Y:case F:case W:case H:case D:case A:case M:break;default:P>0&&(Z=1)}f===Y?f=0:$+O===0&&107!==i&&ye.length>0&&(R=1,ye+="\0"),ne*oe>0&&me(0,ye,t,e,X,V,xe.length,i,a,i),V=1,X++;break;case D:case M:if(f+h+p+u===0){V++;break}default:switch(V++,be=o.charAt(j),y){case 9:case N:if(h+u+f===0)switch(w){case H:case W:case 9:case N:be="";break;default:y!==N&&(be=" ")}break;case 0:be="\\0";break;case 12:be="\\f";break;case 11:be="\\v";break;case 38:h+f+u===0&&$>0&&(te=1,R=1,be="\f"+be);break;case 108:if(h+f+u+q===0&&P>0)switch(j-P){case 2:112===w&&o.charCodeAt(j-3)===W&&(q=w);case 8:111===k&&(q=k)}break;case W:h+f+u===0&&(P=j);break;case H:f+p+h+u===0&&(R=1,be+="\r");break;case 34:case 39:0===f&&(h=h===y?0:0===h?y:h);break;case 91:h+f+p===0&&u++;break;case 93:h+f+p===0&&u--;break;case z:h+f+u===0&&p--;break;case I:if(h+f+u===0){if(0===O)switch(2*w+3*k){case 533:break;default:E=0,O=1}p++}break;case 64:f+p+h+u+P+_===0&&(_=1);break;case U:case Y:if(h+u+p>0)break;switch(f){case 0:switch(2*y+3*o.charCodeAt(j+1)){case 235:f=Y;break;case 220:re=j,f=U}break;case U:y===Y&&w===U&&re+2!==j&&(33===o.charCodeAt(re+2)&&(xe+=o.substring(re,j+1)),be="",f=0)}}if(0===f){if($+h+u+_===0&&107!==i&&y!==D)switch(y){case H:case 126:case 62:case 43:case z:case I:if(0===O){switch(w){case 9:case N:case B:case L:be+="\0";break;default:be="\0"+be+(y===H?"":"\0")}R=1}else switch(y){case I:P+7===j&&108===w&&(P=0),O=++E;break;case z:0==(O=--E)&&(R=1,be+="\0")}break;case 9:case N:switch(w){case 0:case A:case M:case D:case H:case 12:case 9:case N:case B:case L:break;default:0===O&&(R=1,be+="\0")}}ye+=be,y!==N&&9!==y&&(S=y)}}k=w,w=y,j++}if(re=xe.length,J>0&&0===re&&0===ke.length&&0===t[0].length==0&&(109!==i||1===t.length&&($>0?le:ce)===t[0])&&(re=t.join(",").length+2),re>0){if(l=0===$&&107!==i?function(e){for(var t,n,o=0,i=e.length,a=Array(i);o1)){if(p=c.charCodeAt(c.length-1),h=n.charCodeAt(0),t="",0!==u)switch(p){case U:case 126:case 62:case 43:case N:case I:break;default:t=" "}switch(h){case 38:n=t+le;case 126:case 62:case 43:case N:case z:case I:break;case 91:n=t+n+le;break;case W:switch(2*n.charCodeAt(1)+3*n.charCodeAt(2)){case 530:if(K>0){n=t+n.substring(8,f-1);break}default:(u<1||l[u-1].length<1)&&(n=t+le+n)}break;case H:t="";default:n=f>1&&n.indexOf(":")>0?t+n.replace(x,"$1"+le+"$2"):t+n+le}c+=n}a[o]=c.replace(r,"").trim()}return a}(t):t,ne>0&&void 0!==(c=me(2,xe,l,e,X,V,re,i,a,i))&&0===(xe=c).length)return Ce+xe+ke;if(xe=l.join(",")+"{"+xe+"}",Q*q!=0){switch(2!==Q||he(xe,2)||(q=0),q){case 111:xe=xe.replace(g,":-moz-$1")+xe;break;case 112:xe=xe.replace(m,"::"+T+"input-$1")+xe.replace(m,"::-moz-$1")+xe.replace(m,":-ms-input-$1")+xe}q=0}}return Ce+xe+ke}function ue(e,t,n){var r=t.trim().split(u),o=r,i=r.length,a=e.length;switch(a){case 0:case 1:for(var l=0,c=0===a?"":e[0]+" ";l0&&$>0)return o.replace(p,"$1").replace(f,"$1"+ce);break;default:return e.trim()+o.replace(f,"$1"+e.trim())}default:if(n*$>0&&o.indexOf("\f")>0)return o.replace(f,(e.charCodeAt(0)===W?"":"$1")+e.trim())}return e+o}function pe(e,t,n,r){var s,u=0,f=e+";",p=2*t+3*n+4*r;if(944===p)return function(e){var t=e.length,n=e.indexOf(":",9)+1,r=e.substring(0,n).trim(),o=e.substring(n,t-1).trim();switch(e.charCodeAt(9)*ie){case 0:break;case F:if(110!==e.charCodeAt(10))break;default:var i=o.split((o="",l)),a=0;for(n=0,t=i.length;a64&&f<90||f>96&&f<123||95===f||f===F&&s.charCodeAt(1)!==F))switch(isNaN(parseFloat(s))+(-1!==s.indexOf("("))){case 1:switch(s){case"infinite":case"alternate":case"backwards":case"running":case"normal":case"forwards":case"both":case"none":case"linear":case"ease":case"ease-in":case"ease-out":case"ease-in-out":case"paused":case"reverse":case"alternate-reverse":case"inherit":case"initial":case"unset":case"step-start":case"step-end":break;default:s+=ae}}u[n++]=s}o+=(0===a?"":",")+u.join(" ")}}return o=r+o+";",1===Q||2===Q&&he(o,1)?T+o+o:o}(f);if(0===Q||2===Q&&!he(f,1))return f;switch(p){case 1015:return 97===f.charCodeAt(10)?T+f+f:f;case 951:return 116===f.charCodeAt(3)?T+f+f:f;case 963:return 110===f.charCodeAt(5)?T+f+f:f;case 1009:if(100!==f.charCodeAt(4))break;case 969:case 942:return T+f+f;case 978:return T+f+j+f+f;case 1019:case 983:return T+f+j+f+R+f+f;case 883:return f.charCodeAt(8)===F?T+f+f:f.indexOf("image-set(",11)>0?f.replace(P,"$1"+T+"$2")+f:f;case 932:if(f.charCodeAt(4)===F)switch(f.charCodeAt(5)){case 103:return T+"box-"+f.replace("-grow","")+T+f+R+f.replace("grow","positive")+f;case 115:return T+f+R+f.replace("shrink","negative")+f;case 98:return T+f+R+f.replace("basis","preferred-size")+f}return T+f+R+f+f;case 964:return T+f+R+"flex-"+f+f;case 1023:if(99!==f.charCodeAt(8))break;return s=f.substring(f.indexOf(":",15)).replace("flex-","").replace("space-between","justify"),T+"box-pack"+s+T+f+R+"flex-pack"+s+f;case 1005:return i.test(f)?f.replace(o,":"+T)+f.replace(o,":"+j)+f:f;case 1e3:switch(u=(s=f.substring(13).trim()).indexOf("-")+1,s.charCodeAt(0)+s.charCodeAt(u)){case 226:s=f.replace(k,"tb");break;case 232:s=f.replace(k,"tb-rl");break;case 220:s=f.replace(k,"lr");break;default:return f}return T+f+R+s+f;case 1017:if(-1===f.indexOf("sticky",9))return f;case 975:switch(u=(f=e).length-10,p=(s=(33===f.charCodeAt(u)?f.substring(0,u):f).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|s.charCodeAt(7))){case 203:if(s.charCodeAt(8)<111)break;case 115:f=f.replace(s,T+s)+";"+f;break;case 207:case 102:f=f.replace(s,T+(p>102?"inline-":"")+"box")+";"+f.replace(s,T+s)+";"+f.replace(s,R+s+"box")+";"+f}return f+";";case 938:if(f.charCodeAt(5)===F)switch(f.charCodeAt(6)){case 105:return s=f.replace("-items",""),T+f+T+"box-"+s+R+"flex-"+s+f;case 115:return T+f+R+"flex-item-"+f.replace(E,"")+f;default:return T+f+R+"flex-line-pack"+f.replace("align-content","").replace(E,"")+f}break;case 973:case 989:if(f.charCodeAt(3)!==F||122===f.charCodeAt(4))break;case 931:case 953:if(!0===_.test(e))return 115===(s=e.substring(e.indexOf(":")+1)).charCodeAt(0)?pe(e.replace("stretch","fill-available"),t,n,r).replace(":fill-available",":stretch"):f.replace(s,T+s)+f.replace(s,j+s.replace("fill-",""))+f;break;case 962:if(f=T+f+(102===f.charCodeAt(5)?R+f:"")+f,n+r===211&&105===f.charCodeAt(13)&&f.indexOf("transform",10)>0)return f.substring(0,f.indexOf(";",27)+1).replace(a,"$1"+T+"$2")+f}return f}function he(e,t){var n=e.indexOf(1===t?":":"{"),r=e.substring(0,3!==t?n:10),o=e.substring(n+1,e.length-1);return re(2!==t?r:r.replace(O,"$1"),o,t)}function de(e,t){var n=pe(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return n!==t+";"?n.replace(S," or ($1)").substring(4):"("+t+")"}function me(e,t,n,r,o,i,a,l,c,s){for(var u,f=0,p=t;f0&&(ae=o.replace(h,91===i?"":"-")),i=1,1===$?ce=o:le=o;var a,l=[ce];ne>0&&void 0!==(a=me(-1,n,l,l,X,V,0,0,0,0))&&"string"==typeof a&&(n=a);var c=se(ee,l,n,0,0);return ne>0&&void 0!==(a=me(-2,c,l,l,X,V,c.length,0,0,0))&&"string"!=typeof(c=a)&&(i=0),ae="",ce="",le="",q=0,X=1,V=1,Z*i==0?c:c.replace(r,"").replace(v,"").replace(b,"$1").replace(y,"$1").replace(w," ")}return be.use=function e(t){switch(t){case void 0:case null:ne=te.length=0;break;default:if("function"==typeof t)te[ne++]=t;else if("object"==typeof t)for(var n=0,r=t.length;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&e<1/0};function I(e){return void 0===e}function z(t){return"object"===e(t)&&null!==t}var B=Object.prototype.hasOwnProperty;function L(e){if(!z(e))return!1;try{var t=e.constructor,n=t.prototype;return t&&n&&B.call(n,"isPrototypeOf")}catch(e){return!1}}function N(e){return"function"==typeof e}var F=Array.prototype.slice;function U(e){return Array.from?Array.from(e):F.call(e)}function H(e,t){return e&&N(t)&&(Array.isArray(e)||M(e.length)?U(e).forEach((function(n,r){t.call(e,n,r,e)})):z(e)&&Object.keys(e).forEach((function(n){t.call(e,e[n],n,e)}))),e}var W=Object.assign||function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&n.forEach((function(t){z(t)&&Object.keys(t).forEach((function(n){e[n]=t[n]}))})),e},Y=/\.\d*(?:0|9){12}\d*$/;function X(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return Y.test(e)?Math.round(e*t)/t:e}var V=/^width|height|left|top|marginLeft|marginTop$/;function q(e,t){var n=e.style;H(t,(function(e,t){V.test(t)&&M(e)&&(e="".concat(e,"px")),n[t]=e}))}function Q(e,t){if(t)if(M(e.length))H(e,(function(e){Q(e,t)}));else if(e.classList)e.classList.add(t);else{var n=e.className.trim();n?n.indexOf(t)<0&&(e.className="".concat(n," ").concat(t)):e.className=t}}function $(e,t){t&&(M(e.length)?H(e,(function(e){$(e,t)})):e.classList?e.classList.remove(t):e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,"")))}function K(e,t,n){t&&(M(e.length)?H(e,(function(e){K(e,t,n)})):n?Q(e,t):$(e,t))}var Z=/([a-z\d])([A-Z])/g;function G(e){return e.replace(Z,"$1-$2").toLowerCase()}function J(e,t){return z(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(G(t)))}function ee(e,t,n){z(n)?e[t]=n:e.dataset?e.dataset[t]=n:e.setAttribute("data-".concat(G(t)),n)}var te=/\s\s*/,ne=function(){var e=!1;if(c){var t=!1,n=function(){},r=Object.defineProperty({},"once",{get:function(){return e=!0,t},set:function(e){t=e}});s.addEventListener("test",n,r),s.removeEventListener("test",n,r)}return e}();function re(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=n;t.trim().split(te).forEach((function(t){if(!ne){var i=e.listeners;i&&i[t]&&i[t][n]&&(o=i[t][n],delete i[t][n],0===Object.keys(i[t]).length&&delete i[t],0===Object.keys(i).length&&delete e.listeners)}e.removeEventListener(t,o,r)}))}function oe(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=n;t.trim().split(te).forEach((function(t){if(r.once&&!ne){var i=e.listeners,a=void 0===i?{}:i;o=function(){delete a[t][n],e.removeEventListener(t,o,r);for(var i=arguments.length,l=new Array(i),c=0;c1&&void 0!==arguments[1]?arguments[1]:"contain",i=A(r),a=A(n);if(i&&a){var l=n*t;"contain"===o&&l>r||"cover"===o&&l=8&&(i=c+u)}}}if(i){var f,p,h=n.getUint16(i,r);for(p=0;pe.width?3===n?l=e.height*a:c=e.width/a:3===n?c=e.width/a:l=e.height*a;var s={aspectRatio:a,naturalWidth:o,naturalHeight:i,width:l,height:c};s.left=(e.width-l)/2,s.top=(e.height-c)/2,s.oldLeft=s.left,s.oldTop=s.top,this.canvasData=s,this.limited=1===n||2===n,this.limitCanvas(!0,!0),this.initialImageData=W({},t),this.initialCanvasData=W({},s)},limitCanvas:function(e,t){var n=this.options,r=this.containerData,o=this.canvasData,i=this.cropBoxData,a=n.viewMode,l=o.aspectRatio,c=this.cropped&&i;if(e){var s=Number(n.minCanvasWidth)||0,u=Number(n.minCanvasHeight)||0;a>1?(s=Math.max(s,r.width),u=Math.max(u,r.height),3===a&&(u*l>s?s=u*l:u=s/l)):a>0&&(s?s=Math.max(s,c?i.width:0):u?u=Math.max(u,c?i.height:0):c&&(s=i.width,(u=i.height)*l>s?s=u*l:u=s/l));var f=he({aspectRatio:l,width:s,height:u});s=f.width,u=f.height,o.minWidth=s,o.minHeight=u,o.maxWidth=1/0,o.maxHeight=1/0}if(t)if(a>(c?0:1)){var p=r.width-o.width,h=r.height-o.height;o.minLeft=Math.min(0,p),o.minTop=Math.min(0,h),o.maxLeft=Math.max(0,p),o.maxTop=Math.max(0,h),c&&this.limited&&(o.minLeft=Math.min(i.left,i.left+(i.width-o.width)),o.minTop=Math.min(i.top,i.top+(i.height-o.height)),o.maxLeft=i.left,o.maxTop=i.top,2===a&&(o.width>=r.width&&(o.minLeft=Math.min(0,p),o.maxLeft=Math.max(0,p)),o.height>=r.height&&(o.minTop=Math.min(0,h),o.maxTop=Math.max(0,h))))}else o.minLeft=-o.width,o.minTop=-o.height,o.maxLeft=r.width,o.maxTop=r.height},renderCanvas:function(e,t){var n=this.canvasData,r=this.imageData;if(t){var o=function(e){var t=e.width,n=e.height,r=e.degree;if(90==(r=Math.abs(r)%180))return{width:n,height:t};var o=r%90*Math.PI/180,i=Math.sin(o),a=Math.cos(o),l=t*a+n*i,c=t*i+n*a;return r>90?{width:c,height:l}:{width:l,height:c}}({width:r.naturalWidth*Math.abs(r.scaleX||1),height:r.naturalHeight*Math.abs(r.scaleY||1),degree:r.rotate||0}),i=o.width,a=o.height,l=n.width*(i/n.naturalWidth),c=n.height*(a/n.naturalHeight);n.left-=(l-n.width)/2,n.top-=(c-n.height)/2,n.width=l,n.height=c,n.aspectRatio=i/a,n.naturalWidth=i,n.naturalHeight=a,this.limitCanvas(!0,!1)}(n.width>n.maxWidth||n.widthn.maxHeight||n.heightt.width?o.height=o.width/n:o.width=o.height*n),this.cropBoxData=o,this.limitCropBox(!0,!0),o.width=Math.min(Math.max(o.width,o.minWidth),o.maxWidth),o.height=Math.min(Math.max(o.height,o.minHeight),o.maxHeight),o.width=Math.max(o.minWidth,o.width*r),o.height=Math.max(o.minHeight,o.height*r),o.left=t.left+(t.width-o.width)/2,o.top=t.top+(t.height-o.height)/2,o.oldLeft=o.left,o.oldTop=o.top,this.initialCropBoxData=W({},o)},limitCropBox:function(e,t){var n=this.options,r=this.containerData,o=this.canvasData,i=this.cropBoxData,a=this.limited,l=n.aspectRatio;if(e){var c=Number(n.minCropBoxWidth)||0,s=Number(n.minCropBoxHeight)||0,u=a?Math.min(r.width,o.width,o.width+o.left,r.width-o.left):r.width,f=a?Math.min(r.height,o.height,o.height+o.top,r.height-o.top):r.height;c=Math.min(c,r.width),s=Math.min(s,r.height),l&&(c&&s?s*l>c?s=c/l:c=s*l:c?s=c/l:s&&(c=s*l),f*l>u?f=u/l:u=f*l),i.minWidth=Math.min(c,u),i.minHeight=Math.min(s,f),i.maxWidth=u,i.maxHeight=f}t&&(a?(i.minLeft=Math.max(0,o.left),i.minTop=Math.max(0,o.top),i.maxLeft=Math.min(r.width,o.left+o.width)-i.width,i.maxTop=Math.min(r.height,o.top+o.height)-i.height):(i.minLeft=0,i.minTop=0,i.maxLeft=r.width-i.width,i.maxTop=r.height-i.height))},renderCropBox:function(){var e=this.options,t=this.containerData,n=this.cropBoxData;(n.width>n.maxWidth||n.widthn.maxHeight||n.height=t.width&&n.height>=t.height?"move":"all"),q(this.cropBox,W({width:n.width,height:n.height},fe({translateX:n.left,translateY:n.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),ie(this.element,"crop",this.getData())}},ye={initPreview:function(){var e=this.element,t=this.crossOrigin,n=this.options.preview,r=t?this.crossOriginUrl:this.url,o=e.alt||"The image to preview",i=document.createElement("img");if(t&&(i.crossOrigin=t),i.src=r,i.alt=o,this.viewBox.appendChild(i),this.viewBoxImage=i,n){var a=n;"string"==typeof n?a=e.ownerDocument.querySelectorAll(n):n.querySelector&&(a=[n]),this.previews=a,H(a,(function(e){var n=document.createElement("img");ee(e,w,{width:e.offsetWidth,height:e.offsetHeight,html:e.innerHTML}),t&&(n.crossOrigin=t),n.src=r,n.alt=o,n.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',e.innerHTML="",e.appendChild(n)}))}},resetPreview:function(){H(this.previews,(function(e){var t=J(e,w);q(e,{width:t.width,height:t.height}),e.innerHTML=t.html,function(e,t){if(z(e[t]))try{delete e[t]}catch(n){e[t]=void 0}else if(e.dataset)try{delete e.dataset[t]}catch(n){e.dataset[t]=void 0}else e.removeAttribute("data-".concat(G(t)))}(e,w)}))},preview:function(){var e=this.imageData,t=this.canvasData,n=this.cropBoxData,r=n.width,o=n.height,i=e.width,a=e.height,l=n.left-t.left-e.left,c=n.top-t.top-e.top;this.cropped&&!this.disabled&&(q(this.viewBoxImage,W({width:i,height:a},fe(W({translateX:-l,translateY:-c},e)))),H(this.previews,(function(t){var n=J(t,w),s=n.width,u=n.height,f=s,p=u,h=1;r&&(p=o*(h=s/r)),o&&p>u&&(f=r*(h=u/o),p=u),q(t,{width:f,height:p}),q(t.getElementsByTagName("img")[0],W({width:i*h,height:a*h},fe(W({translateX:-l*h,translateY:-c*h},e))))})))}},we={bind:function(){var e=this.element,t=this.options,n=this.cropper;N(t.cropstart)&&oe(e,"cropstart",t.cropstart),N(t.cropmove)&&oe(e,"cropmove",t.cropmove),N(t.cropend)&&oe(e,"cropend",t.cropend),N(t.crop)&&oe(e,"crop",t.crop),N(t.zoom)&&oe(e,"zoom",t.zoom),oe(n,S,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&oe(n,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&oe(n,"dblclick",this.onDblclick=this.dblclick.bind(this)),oe(e.ownerDocument,E,this.onCropMove=this.cropMove.bind(this)),oe(e.ownerDocument,O,this.onCropEnd=this.cropEnd.bind(this)),t.responsive&&oe(window,"resize",this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,t=this.options,n=this.cropper;N(t.cropstart)&&re(e,"cropstart",t.cropstart),N(t.cropmove)&&re(e,"cropmove",t.cropmove),N(t.cropend)&&re(e,"cropend",t.cropend),N(t.crop)&&re(e,"crop",t.crop),N(t.zoom)&&re(e,"zoom",t.zoom),re(n,S,this.onCropStart),t.zoomable&&t.zoomOnWheel&&re(n,"wheel",this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&re(n,"dblclick",this.onDblclick),re(e.ownerDocument,E,this.onCropMove),re(e.ownerDocument,O,this.onCropEnd),t.responsive&&re(window,"resize",this.onResize)}},xe={resize:function(){if(!this.disabled){var e,t,n=this.options,r=this.container,o=this.containerData,i=r.offsetWidth/o.width;1===i&&r.offsetHeight===o.height||(n.restore&&(e=this.getCanvasData(),t=this.getCropBoxData()),this.render(),n.restore&&(this.setCanvasData(H(e,(function(t,n){e[n]=t*i}))),this.setCropBoxData(H(t,(function(e,n){t[n]=e*i})))))}},dblclick:function(){var e,t;this.disabled||"none"===this.options.dragMode||this.setDragMode((e=this.dragBox,t=p,(e.classList?e.classList.contains(t):e.className.indexOf(t)>-1)?"move":"crop"))},wheel:function(e){var t=this,n=Number(this.options.wheelZoomRatio)||.1,r=1;this.disabled||(e.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout((function(){t.wheeling=!1}),50),e.deltaY?r=e.deltaY>0?1:-1:e.wheelDelta?r=-e.wheelDelta/120:e.detail&&(r=e.detail>0?1:-1),this.zoom(-r*n,e)))},cropStart:function(e){var t=e.buttons,n=e.button;if(!(this.disabled||("mousedown"===e.type||"pointerdown"===e.type&&"mouse"===e.pointerType)&&(M(t)&&1!==t||M(n)&&0!==n||e.ctrlKey))){var r,o=this.options,i=this.pointers;e.changedTouches?H(e.changedTouches,(function(e){i[e.identifier]=pe(e)})):i[e.pointerId||0]=pe(e),r=Object.keys(i).length>1&&o.zoomable&&o.zoomOnTouch?"zoom":J(e.target,y),_.test(r)&&!1!==ie(this.element,"cropstart",{originalEvent:e,action:r})&&(e.preventDefault(),this.action=r,this.cropping=!1,"crop"===r&&(this.cropping=!0,Q(this.dragBox,v)))}},cropMove:function(e){var t=this.action;if(!this.disabled&&t){var n=this.pointers;e.preventDefault(),!1!==ie(this.element,"cropmove",{originalEvent:e,action:t})&&(e.changedTouches?H(e.changedTouches,(function(e){W(n[e.identifier]||{},pe(e,!0))})):W(n[e.pointerId||0]||{},pe(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var t=this.action,n=this.pointers;e.changedTouches?H(e.changedTouches,(function(e){delete n[e.identifier]})):delete n[e.pointerId||0],t&&(e.preventDefault(),Object.keys(n).length||(this.action=""),this.cropping&&(this.cropping=!1,K(this.dragBox,v,this.cropped&&this.options.modal)),ie(this.element,"cropend",{originalEvent:e,action:t}))}}},ke={change:function(e){var t,n=this.options,r=this.canvasData,o=this.containerData,a=this.cropBoxData,l=this.pointers,c=this.action,s=n.aspectRatio,u=a.left,f=a.top,p=a.width,h=a.height,m=u+p,g=f+h,v=0,b=0,y=o.width,w=o.height,x=!0;!s&&e.shiftKey&&(s=p&&h?p/h:1),this.limited&&(v=a.minLeft,b=a.minTop,y=v+Math.min(o.width,r.width,r.left+r.width),w=b+Math.min(o.height,r.height,r.top+r.height));var k=l[Object.keys(l)[0]],C={x:k.endX-k.startX,y:k.endY-k.startY},S=function(e){switch(e){case"e":m+C.x>y&&(C.x=y-m);break;case"w":u+C.xw&&(C.y=w-g)}};switch(c){case"all":u+=C.x,f+=C.y;break;case"e":if(C.x>=0&&(m>=y||s&&(f<=b||g>=w))){x=!1;break}S("e"),(p+=C.x)<0&&(c="w",u-=p=-p),s&&(h=p/s,f+=(a.height-h)/2);break;case"n":if(C.y<=0&&(f<=b||s&&(u<=v||m>=y))){x=!1;break}S("n"),h-=C.y,f+=C.y,h<0&&(c="s",f-=h=-h),s&&(p=h*s,u+=(a.width-p)/2);break;case"w":if(C.x<=0&&(u<=v||s&&(f<=b||g>=w))){x=!1;break}S("w"),p-=C.x,u+=C.x,p<0&&(c="e",u-=p=-p),s&&(h=p/s,f+=(a.height-h)/2);break;case"s":if(C.y>=0&&(g>=w||s&&(u<=v||m>=y))){x=!1;break}S("s"),(h+=C.y)<0&&(c="n",f-=h=-h),s&&(p=h*s,u+=(a.width-p)/2);break;case"ne":if(s){if(C.y<=0&&(f<=b||m>=y)){x=!1;break}S("n"),h-=C.y,f+=C.y,p=h*s}else S("n"),S("e"),C.x>=0?mb&&(h-=C.y,f+=C.y):(h-=C.y,f+=C.y);p<0&&h<0?(c="sw",f-=h=-h,u-=p=-p):p<0?(c="nw",u-=p=-p):h<0&&(c="se",f-=h=-h);break;case"nw":if(s){if(C.y<=0&&(f<=b||u<=v)){x=!1;break}S("n"),h-=C.y,f+=C.y,p=h*s,u+=a.width-p}else S("n"),S("w"),C.x<=0?u>v?(p-=C.x,u+=C.x):C.y<=0&&f<=b&&(x=!1):(p-=C.x,u+=C.x),C.y<=0?f>b&&(h-=C.y,f+=C.y):(h-=C.y,f+=C.y);p<0&&h<0?(c="se",f-=h=-h,u-=p=-p):p<0?(c="ne",u-=p=-p):h<0&&(c="sw",f-=h=-h);break;case"sw":if(s){if(C.x<=0&&(u<=v||g>=w)){x=!1;break}S("w"),p-=C.x,u+=C.x,h=p/s}else S("s"),S("w"),C.x<=0?u>v?(p-=C.x,u+=C.x):C.y>=0&&g>=w&&(x=!1):(p-=C.x,u+=C.x),C.y>=0?g=0&&(m>=y||g>=w)){x=!1;break}S("e"),h=(p+=C.x)/s}else S("s"),S("e"),C.x>=0?m=0&&g>=w&&(x=!1):p+=C.x,C.y>=0?g0?c=C.y>0?"se":"ne":C.x<0&&(u-=p,c=C.y>0?"sw":"nw"),C.y<0&&(f-=h),this.cropped||($(this.cropBox,d),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}x&&(a.width=p,a.height=h,a.left=u,a.top=f,this.action=c,this.renderCropBox()),H(l,(function(e){e.startX=e.endX,e.startY=e.endY}))}},Ce={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Q(this.dragBox,v),$(this.cropBox,d),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=W({},this.initialImageData),this.canvasData=W({},this.initialCanvasData),this.cropBoxData=W({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(W(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),$(this.dragBox,v),Q(this.cropBox,d)),this},replace:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,H(this.previews,(function(t){t.getElementsByTagName("img")[0].src=e})))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,$(this.cropper,h)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Q(this.cropper,h)),this},destroy:function(){var e=this.element;return e.cropper?(e.cropper=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=this.canvasData,r=n.left,o=n.top;return this.moveTo(I(e)?e:r+Number(e),I(t)?t:o+Number(t))},moveTo:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=this.canvasData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(M(e)&&(n.left=e,r=!0),M(t)&&(n.top=t,r=!0),r&&this.renderCanvas(!0)),this},zoom:function(e,t){var n=this.canvasData;return e=(e=Number(e))<0?1/(1-e):1+e,this.zoomTo(n.width*e/n.naturalWidth,null,t)},zoomTo:function(e,t,n){var r=this.options,o=this.canvasData,i=o.width,a=o.height,l=o.naturalWidth,c=o.naturalHeight;if((e=Number(e))>=0&&this.ready&&!this.disabled&&r.zoomable){var s=l*e,u=c*e;if(!1===ie(this.element,"zoom",{ratio:e,oldRatio:i/l,originalEvent:n}))return this;if(n){var f=this.pointers,p=ae(this.cropper),h=f&&Object.keys(f).length?function(e){var t=0,n=0,r=0;return H(e,(function(e){var o=e.startX,i=e.startY;t+=o,n+=i,r+=1})),{pageX:t/=r,pageY:n/=r}}(f):{pageX:n.pageX,pageY:n.pageY};o.left-=(s-i)*((h.pageX-p.left-o.left)/i),o.top-=(u-a)*((h.pageY-p.top-o.top)/a)}else L(t)&&M(t.x)&&M(t.y)?(o.left-=(s-i)*((t.x-o.left)/i),o.top-=(u-a)*((t.y-o.top)/a)):(o.left-=(s-i)/2,o.top-=(u-a)/2);o.width=s,o.height=u,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return M(e=Number(e))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var t=this.imageData.scaleY;return this.scale(e,M(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX;return this.scale(M(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=this.imageData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(M(e)&&(n.scaleX=e,r=!0),M(t)&&(n.scaleY=t,r=!0),r&&this.renderCanvas(!0,!0)),this},getData:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.options,r=this.imageData,o=this.canvasData,i=this.cropBoxData;if(this.ready&&this.cropped){e={x:i.left-o.left,y:i.top-o.top,width:i.width,height:i.height};var a=r.width/r.naturalWidth;if(H(e,(function(t,n){e[n]=t/a})),t){var l=Math.round(e.y+e.height),c=Math.round(e.x+e.width);e.x=Math.round(e.x),e.y=Math.round(e.y),e.width=c-e.x,e.height=l-e.y}}else e={x:0,y:0,width:0,height:0};return n.rotatable&&(e.rotate=r.rotate||0),n.scalable&&(e.scaleX=r.scaleX||1,e.scaleY=r.scaleY||1),e},setData:function(e){var t=this.options,n=this.imageData,r=this.canvasData,o={};if(this.ready&&!this.disabled&&L(e)){var i=!1;t.rotatable&&M(e.rotate)&&e.rotate!==n.rotate&&(n.rotate=e.rotate,i=!0),t.scalable&&(M(e.scaleX)&&e.scaleX!==n.scaleX&&(n.scaleX=e.scaleX,i=!0),M(e.scaleY)&&e.scaleY!==n.scaleY&&(n.scaleY=e.scaleY,i=!0)),i&&this.renderCanvas(!0,!0);var a=n.width/n.naturalWidth;M(e.x)&&(o.left=e.x*a+r.left),M(e.y)&&(o.top=e.y*a+r.top),M(e.width)&&(o.width=e.width*a),M(e.height)&&(o.height=e.height*a),this.setCropBoxData(o)}return this},getContainerData:function(){return this.ready?W({},this.containerData):{}},getImageData:function(){return this.sized?W({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={};return this.ready&&H(["left","top","width","height","naturalWidth","naturalHeight"],(function(n){t[n]=e[n]})),t},setCanvasData:function(e){var t=this.canvasData,n=t.aspectRatio;return this.ready&&!this.disabled&&L(e)&&(M(e.left)&&(t.left=e.left),M(e.top)&&(t.top=e.top),M(e.width)?(t.width=e.width,t.height=e.width/n):M(e.height)&&(t.height=e.height,t.width=e.height*n),this.renderCanvas(!0)),this},getCropBoxData:function(){var e,t=this.cropBoxData;return this.ready&&this.cropped&&(e={left:t.left,top:t.top,width:t.width,height:t.height}),e||{}},setCropBoxData:function(e){var t,n,r=this.cropBoxData,o=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&L(e)&&(M(e.left)&&(r.left=e.left),M(e.top)&&(r.top=e.top),M(e.width)&&e.width!==r.width&&(t=!0,r.width=e.width),M(e.height)&&e.height!==r.height&&(n=!0,r.height=e.height),o&&(t?r.height=r.width/o:n&&(r.width=r.height*o)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var t=this.canvasData,n=de(this.image,this.imageData,t,e);if(!this.cropped)return n;var r=this.getData(),o=r.x,i=r.y,l=r.width,c=r.height,s=n.width/Math.floor(t.naturalWidth);1!==s&&(o*=s,i*=s,l*=s,c*=s);var u=l/c,f=he({aspectRatio:u,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),p=he({aspectRatio:u,width:e.minWidth||0,height:e.minHeight||0},"cover"),h=he({aspectRatio:u,width:e.width||(1!==s?n.width:l),height:e.height||(1!==s?n.height:c)}),d=h.width,m=h.height;d=Math.min(f.width,Math.max(p.width,d)),m=Math.min(f.height,Math.max(p.height,m));var g=document.createElement("canvas"),v=g.getContext("2d");g.width=X(d),g.height=X(m),v.fillStyle=e.fillColor||"transparent",v.fillRect(0,0,d,m);var b=e.imageSmoothingEnabled,y=void 0===b||b,w=e.imageSmoothingQuality;v.imageSmoothingEnabled=y,w&&(v.imageSmoothingQuality=w);var x,k,C,S,E,O,_=n.width,P=n.height,T=o,j=i;T<=-l||T>_?(T=0,x=0,C=0,E=0):T<=0?(C=-T,T=0,E=x=Math.min(_,l+T)):T<=_&&(C=0,E=x=Math.min(l,_-T)),x<=0||j<=-c||j>P?(j=0,k=0,S=0,O=0):j<=0?(S=-j,j=0,O=k=Math.min(P,c+j)):j<=P&&(S=0,O=k=Math.min(c,P-j));var R=[T,j,x,k];if(E>0&&O>0){var D=d/l;R.push(C*D,S*D,E*D,O*D)}return v.drawImage.apply(v,[n].concat(a(R.map((function(e){return Math.floor(X(e))}))))),g},setAspectRatio:function(e){var t=this.options;return this.disabled||I(e)||(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,n=this.dragBox,r=this.face;if(this.ready&&!this.disabled){var o="crop"===e,i=t.movable&&"move"===e;e=o||i?e:"none",t.dragMode=e,ee(n,y,e),K(n,p,o),K(n,b,i),t.cropBoxMovable||(ee(r,y,e),K(r,p,o),K(r,b,i))}return this}},Se=s.Cropper,Ee=function(){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t(this,e),!n||!j.test(n.tagName))throw new Error("The first argument is required and must be an or element.");this.element=n,this.options=W({},R,L(r)&&r),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}var r,o,i;return r=e,i=[{key:"noConflict",value:function(){return window.Cropper=Se,e}},{key:"setDefaults",value:function(e){W(R,L(e)&&e)}}],(o=[{key:"init",value:function(){var e,t=this.element,n=t.tagName.toLowerCase();if(!t.cropper){if(t.cropper=this,"img"===n){if(this.isImg=!0,e=t.getAttribute("src")||"",this.originalUrl=e,!e)return;e=t.src}else"canvas"===n&&window.HTMLCanvasElement&&(e=t.toDataURL());this.load(e)}}},{key:"load",value:function(e){var t=this;if(e){this.url=e,this.imageData={};var n=this.element,r=this.options;if(r.rotatable||r.scalable||(r.checkOrientation=!1),r.checkOrientation&&window.ArrayBuffer)if(P.test(e))T.test(e)?this.read((o=e.replace(ge,""),i=atob(o),a=new ArrayBuffer(i.length),H(l=new Uint8Array(a),(function(e,t){l[t]=i.charCodeAt(t)})),a)):this.clone();else{var o,i,a,l,c=new XMLHttpRequest,s=this.clone.bind(this);this.reloading=!0,this.xhr=c,c.onabort=s,c.onerror=s,c.ontimeout=s,c.onprogress=function(){"image/jpeg"!==c.getResponseHeader("content-type")&&c.abort()},c.onload=function(){t.read(c.response)},c.onloadend=function(){t.reloading=!1,t.xhr=null},r.checkCrossOrigin&&se(e)&&n.crossOrigin&&(e=ue(e)),c.open("GET",e),c.responseType="arraybuffer",c.withCredentials="use-credentials"===n.crossOrigin,c.send()}else this.clone()}}},{key:"read",value:function(e){var t=this.options,n=this.imageData,r=ve(e),o=0,i=1,a=1;if(r>1){this.url=function(e,t){for(var n=[],r=new Uint8Array(e);r.length>0;)n.push(me.apply(null,U(r.subarray(0,8192)))),r=r.subarray(8192);return"data:".concat(t,";base64,").concat(btoa(n.join("")))}(e,"image/jpeg");var l=function(e){var t=0,n=1,r=1;switch(e){case 2:n=-1;break;case 3:t=-180;break;case 4:r=-1;break;case 5:t=90,r=-1;break;case 6:t=90;break;case 7:t=90,n=-1;break;case 8:t=-90}return{rotate:t,scaleX:n,scaleY:r}}(r);o=l.rotate,i=l.scaleX,a=l.scaleY}t.rotatable&&(n.rotate=o),t.scalable&&(n.scaleX=i,n.scaleY=a),this.clone()}},{key:"clone",value:function(){var e=this.element,t=this.url,n=e.crossOrigin,r=t;this.options.checkCrossOrigin&&se(t)&&(n||(n="anonymous"),r=ue(t)),this.crossOrigin=n,this.crossOriginUrl=r;var o=document.createElement("img");n&&(o.crossOrigin=n),o.src=r||t,o.alt=e.alt||"The image to crop",this.image=o,o.onload=this.start.bind(this),o.onerror=this.stop.bind(this),Q(o,m),e.parentNode.insertBefore(o,e.nextSibling)}},{key:"start",value:function(){var e=this,t=this.image;t.onload=null,t.onerror=null,this.sizing=!0;var n=s.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(s.navigator.userAgent),r=function(t,n){W(e.imageData,{naturalWidth:t,naturalHeight:n,aspectRatio:t/n}),e.sizing=!1,e.sized=!0,e.build()};if(!t.naturalWidth||n){var o=document.createElement("img"),i=document.body||document.documentElement;this.sizingImage=o,o.onload=function(){r(o.width,o.height),n||i.removeChild(o)},o.src=t.src,n||(o.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",i.appendChild(o))}else r(t.naturalWidth,t.naturalHeight)}},{key:"stop",value:function(){var e=this.image;e.onload=null,e.onerror=null,e.parentNode.removeChild(e),this.image=null}},{key:"build",value:function(){if(this.sized&&!this.ready){var e=this.element,t=this.options,n=this.image,r=e.parentNode,o=document.createElement("div");o.innerHTML='
';var i=o.querySelector(".".concat("cropper","-container")),a=i.querySelector(".".concat("cropper","-canvas")),l=i.querySelector(".".concat("cropper","-drag-box")),c=i.querySelector(".".concat("cropper","-crop-box")),s=c.querySelector(".".concat("cropper","-face"));this.container=r,this.cropper=i,this.canvas=a,this.dragBox=l,this.cropBox=c,this.viewBox=i.querySelector(".".concat("cropper","-view-box")),this.face=s,a.appendChild(n),Q(e,d),r.insertBefore(i,e.nextSibling),this.isImg||$(n,m),this.initPreview(),this.bind(),t.initialAspectRatio=Math.max(0,t.initialAspectRatio)||NaN,t.aspectRatio=Math.max(0,t.aspectRatio)||NaN,t.viewMode=Math.max(0,Math.min(3,Math.round(t.viewMode)))||0,Q(c,d),t.guides||Q(c.getElementsByClassName("".concat("cropper","-dashed")),d),t.center||Q(c.getElementsByClassName("".concat("cropper","-center")),d),t.background&&Q(i,"".concat("cropper","-bg")),t.highlight||Q(s,g),t.cropBoxMovable&&(Q(s,b),ee(s,y,"all")),t.cropBoxResizable||(Q(c.getElementsByClassName("".concat("cropper","-line")),d),Q(c.getElementsByClassName("".concat("cropper","-point")),d)),this.render(),this.ready=!0,this.setDragMode(t.dragMode),t.autoCrop&&this.crop(),this.setData(t.data),N(t.ready)&&oe(e,"ready",t.ready,{once:!0}),ie(e,"ready")}}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),$(this.element,d))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}])&&n(r.prototype,o),i&&n(r,i),e}();return W(Ee.prototype,be,ye,we,xe,ke,Ce),Ee}()},function(e,t,n){"use strict";const r=n(33),o=new Set(["jpg","png","gif","webp","flif","cr2","tif","bmp","jxr","psd","ico","bpg","jp2","jpm","jpx","heic","cur","dcm"]),i=e=>{const t=r(e);return o.has(t&&t.ext)?t:null};e.exports=i,e.exports.default=i,Object.defineProperty(i,"minimumBytes",{value:r.minimumBytes})},function(e,t,n){"use strict";function r(e,t){for(var n=0;nl;c?a++:a--){var s=a*o,u=s+(a===e.Blocks-1?i:o);if(Caman.NodeJS){var f=Fiber((function(){return t.call(n,a,s,u)})).run();r.push(n.blockFinished(f))}else r.push(setTimeout(function(e,r,o){return function(){return t.call(n,e,r,o)}}(a,s,u),0))}return r}()}},{key:"executeFilter",value:function(){return Caman.Event.trigger(this.c,"processStart",this.currentJob),this.currentJob.type===Caman.Filter.Type.Single?this.eachBlock(this.renderBlock):this.eachBlock(this.renderKernel)}},{key:"executePlugin",value:function(){return o.a.debug("Executing plugin ".concat(this.currentJob.plugin)),Caman.Plugin.execute(this.c,this.currentJob.plugin,this.currentJob.args),o.a.debug("Plugin ".concat(this.currentJob.plugin," finished!")),this.processNext()}},{key:"renderBlock",value:function(t,n,i){o.a.debug("Block #".concat(t," - Filter: ").concat(this.currentJob.name,", Start: ").concat(n,", End: ").concat(i)),Caman.Event.trigger(this.c,"blockStarted",{blockNum:t,totalBlocks:e.Blocks,startPixel:n,endPixel:i});var a=new Caman.Pixel;a.setContext(this.c);for(var l=n,c=i;l=v;b?g++:g--)for(var y=f,w=-f,x=f<=w;x?y<=w:y>=w;x?y++:y--){var k=p.getPixelRelative(g,y);u[3*m]=k.r,u[3*m+1]=k.g,u[3*m+2]=k.b,m++}var C=this.processKernel(c,u,a,i);this.modPixelData[h]=r.b.clampRGB(C.r),this.modPixelData[h+1]=r.b.clampRGB(C.g),this.modPixelData[h+2]=r.b.clampRGB(C.b),this.modPixelData[h+3]=this.c.pixelData[h+3]}return this.blockFinished(e)}},{key:"blockFinished",value:function(t){if(t>=0&&o.a.debug("Block #".concat(t," finished! Filter: ").concat(this.currentJob.name)),this.blocksDone++,Caman.Event.trigger(this.c,"blockFinished",{blockNum:t,blocksFinished:this.blocksDone,totalBlocks:e.Blocks}),this.blocksDone===e.Blocks){if(this.currentJob.type===Caman.Filter.Type.Kernel)for(var n=0,r=this.c.pixelData.length,i=0<=r;i?nr;i?n++:n--)this.c.pixelData[n]=this.modPixelData[n];return t>=0&&o.a.debug("Filter ".concat(this.currentJob.name," finished!")),Caman.Event.trigger(this.c,"processComplete",this.currentJob),this.processNext()}}},{key:"processKernel",value:function(e,t,n,r){for(var o={r:0,g:0,b:0},i=0,a=e.length,l=0<=a;l?ia;l?i++:i--)o.r+=e[i]*t[3*i],o.g+=e[i]*t[3*i+1],o.b+=e[i]*t[3*i+2];return o.r=o.r/n+r,o.g=o.g/n+r,o.b=o.b/n+r,o}},{key:"loadOverlay",value:function(e,t){var n=this,r=new Image;r.onload=function(){return e.context.drawImage(r,0,0,n.c.dimensions.width,n.c.dimensions.height),e.imageData=e.context.getImageData(0,0,n.c.dimensions.width,n.c.dimensions.height),e.pixelData=e.imageData.data,n.c.pixelData=e.pixelData,n.processNext()};var o=Caman.IO.remoteCheck(t);return r.src=null!=o?o:t}},{key:"loadLayerMask",value:function(e,t){var n=this,r=new Image;r.onload=function(){var t=document.createElement("canvas");t.width=n.c.dimensions.width,t.height=n.c.dimensions.height;var o=t.getContext("2d");o.drawImage(r,0,0,n.c.dimensions.width,n.c.dimensions.height);var i=o.getImageData(0,0,n.c.dimensions.width,n.c.dimensions.height);return e.maskData=i.data,n.processNext()};var o=Caman.IO.remoteCheck(t);return r.src=null!=o?o:t}}]),e}();l.initClass(),t.a=l},function(e,t,n){"use strict";var r=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,o=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){return r.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));t.a=o},function(e,t,n){"use strict";function r(e){return Object.prototype.toString.call(e).slice(8,-1)}function o(e){return"Object"===r(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function i(e){return"Array"===r(e)}function a(e){return"Symbol"===r(e)} +e.exports=function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&e<1/0};function I(e){return void 0===e}function z(t){return"object"===e(t)&&null!==t}var B=Object.prototype.hasOwnProperty;function L(e){if(!z(e))return!1;try{var t=e.constructor,n=t.prototype;return t&&n&&B.call(n,"isPrototypeOf")}catch(e){return!1}}function N(e){return"function"==typeof e}var F=Array.prototype.slice;function U(e){return Array.from?Array.from(e):F.call(e)}function H(e,t){return e&&N(t)&&(Array.isArray(e)||M(e.length)?U(e).forEach((function(n,r){t.call(e,n,r,e)})):z(e)&&Object.keys(e).forEach((function(n){t.call(e,e[n],n,e)}))),e}var W=Object.assign||function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&n.forEach((function(t){z(t)&&Object.keys(t).forEach((function(n){e[n]=t[n]}))})),e},Y=/\.\d*(?:0|9){12}\d*$/;function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return Y.test(e)?Math.round(e*t)/t:e}var X=/^width|height|left|top|marginLeft|marginTop$/;function q(e,t){var n=e.style;H(t,(function(e,t){X.test(t)&&M(e)&&(e="".concat(e,"px")),n[t]=e}))}function $(e,t){if(t)if(M(e.length))H(e,(function(e){$(e,t)}));else if(e.classList)e.classList.add(t);else{var n=e.className.trim();n?n.indexOf(t)<0&&(e.className="".concat(n," ").concat(t)):e.className=t}}function Q(e,t){t&&(M(e.length)?H(e,(function(e){Q(e,t)})):e.classList?e.classList.remove(t):e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,"")))}function K(e,t,n){t&&(M(e.length)?H(e,(function(e){K(e,t,n)})):n?$(e,t):Q(e,t))}var Z=/([a-z\d])([A-Z])/g;function G(e){return e.replace(Z,"$1-$2").toLowerCase()}function J(e,t){return z(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(G(t)))}function ee(e,t,n){z(n)?e[t]=n:e.dataset?e.dataset[t]=n:e.setAttribute("data-".concat(G(t)),n)}var te=/\s\s*/,ne=function(){var e=!1;if(c){var t=!1,n=function(){},r=Object.defineProperty({},"once",{get:function(){return e=!0,t},set:function(e){t=e}});s.addEventListener("test",n,r),s.removeEventListener("test",n,r)}return e}();function re(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=n;t.trim().split(te).forEach((function(t){if(!ne){var i=e.listeners;i&&i[t]&&i[t][n]&&(o=i[t][n],delete i[t][n],0===Object.keys(i[t]).length&&delete i[t],0===Object.keys(i).length&&delete e.listeners)}e.removeEventListener(t,o,r)}))}function oe(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=n;t.trim().split(te).forEach((function(t){if(r.once&&!ne){var i=e.listeners,a=void 0===i?{}:i;o=function(){delete a[t][n],e.removeEventListener(t,o,r);for(var i=arguments.length,l=new Array(i),c=0;c1&&void 0!==arguments[1]?arguments[1]:"contain",i=A(r),a=A(n);if(i&&a){var l=n*t;"contain"===o&&l>r||"cover"===o&&l=8&&(i=c+u)}}}if(i){var f,p,h=n.getUint16(i,r);for(p=0;pe.width?3===n?l=e.height*a:c=e.width/a:3===n?c=e.width/a:l=e.height*a;var s={aspectRatio:a,naturalWidth:o,naturalHeight:i,width:l,height:c};s.left=(e.width-l)/2,s.top=(e.height-c)/2,s.oldLeft=s.left,s.oldTop=s.top,this.canvasData=s,this.limited=1===n||2===n,this.limitCanvas(!0,!0),this.initialImageData=W({},t),this.initialCanvasData=W({},s)},limitCanvas:function(e,t){var n=this.options,r=this.containerData,o=this.canvasData,i=this.cropBoxData,a=n.viewMode,l=o.aspectRatio,c=this.cropped&&i;if(e){var s=Number(n.minCanvasWidth)||0,u=Number(n.minCanvasHeight)||0;a>1?(s=Math.max(s,r.width),u=Math.max(u,r.height),3===a&&(u*l>s?s=u*l:u=s/l)):a>0&&(s?s=Math.max(s,c?i.width:0):u?u=Math.max(u,c?i.height:0):c&&(s=i.width,(u=i.height)*l>s?s=u*l:u=s/l));var f=he({aspectRatio:l,width:s,height:u});s=f.width,u=f.height,o.minWidth=s,o.minHeight=u,o.maxWidth=1/0,o.maxHeight=1/0}if(t)if(a>(c?0:1)){var p=r.width-o.width,h=r.height-o.height;o.minLeft=Math.min(0,p),o.minTop=Math.min(0,h),o.maxLeft=Math.max(0,p),o.maxTop=Math.max(0,h),c&&this.limited&&(o.minLeft=Math.min(i.left,i.left+(i.width-o.width)),o.minTop=Math.min(i.top,i.top+(i.height-o.height)),o.maxLeft=i.left,o.maxTop=i.top,2===a&&(o.width>=r.width&&(o.minLeft=Math.min(0,p),o.maxLeft=Math.max(0,p)),o.height>=r.height&&(o.minTop=Math.min(0,h),o.maxTop=Math.max(0,h))))}else o.minLeft=-o.width,o.minTop=-o.height,o.maxLeft=r.width,o.maxTop=r.height},renderCanvas:function(e,t){var n=this.canvasData,r=this.imageData;if(t){var o=function(e){var t=e.width,n=e.height,r=e.degree;if(90==(r=Math.abs(r)%180))return{width:n,height:t};var o=r%90*Math.PI/180,i=Math.sin(o),a=Math.cos(o),l=t*a+n*i,c=t*i+n*a;return r>90?{width:c,height:l}:{width:l,height:c}}({width:r.naturalWidth*Math.abs(r.scaleX||1),height:r.naturalHeight*Math.abs(r.scaleY||1),degree:r.rotate||0}),i=o.width,a=o.height,l=n.width*(i/n.naturalWidth),c=n.height*(a/n.naturalHeight);n.left-=(l-n.width)/2,n.top-=(c-n.height)/2,n.width=l,n.height=c,n.aspectRatio=i/a,n.naturalWidth=i,n.naturalHeight=a,this.limitCanvas(!0,!1)}(n.width>n.maxWidth||n.widthn.maxHeight||n.heightt.width?o.height=o.width/n:o.width=o.height*n),this.cropBoxData=o,this.limitCropBox(!0,!0),o.width=Math.min(Math.max(o.width,o.minWidth),o.maxWidth),o.height=Math.min(Math.max(o.height,o.minHeight),o.maxHeight),o.width=Math.max(o.minWidth,o.width*r),o.height=Math.max(o.minHeight,o.height*r),o.left=t.left+(t.width-o.width)/2,o.top=t.top+(t.height-o.height)/2,o.oldLeft=o.left,o.oldTop=o.top,this.initialCropBoxData=W({},o)},limitCropBox:function(e,t){var n=this.options,r=this.containerData,o=this.canvasData,i=this.cropBoxData,a=this.limited,l=n.aspectRatio;if(e){var c=Number(n.minCropBoxWidth)||0,s=Number(n.minCropBoxHeight)||0,u=a?Math.min(r.width,o.width,o.width+o.left,r.width-o.left):r.width,f=a?Math.min(r.height,o.height,o.height+o.top,r.height-o.top):r.height;c=Math.min(c,r.width),s=Math.min(s,r.height),l&&(c&&s?s*l>c?s=c/l:c=s*l:c?s=c/l:s&&(c=s*l),f*l>u?f=u/l:u=f*l),i.minWidth=Math.min(c,u),i.minHeight=Math.min(s,f),i.maxWidth=u,i.maxHeight=f}t&&(a?(i.minLeft=Math.max(0,o.left),i.minTop=Math.max(0,o.top),i.maxLeft=Math.min(r.width,o.left+o.width)-i.width,i.maxTop=Math.min(r.height,o.top+o.height)-i.height):(i.minLeft=0,i.minTop=0,i.maxLeft=r.width-i.width,i.maxTop=r.height-i.height))},renderCropBox:function(){var e=this.options,t=this.containerData,n=this.cropBoxData;(n.width>n.maxWidth||n.widthn.maxHeight||n.height=t.width&&n.height>=t.height?"move":"all"),q(this.cropBox,W({width:n.width,height:n.height},fe({translateX:n.left,translateY:n.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),ie(this.element,"crop",this.getData())}},ye={initPreview:function(){var e=this.element,t=this.crossOrigin,n=this.options.preview,r=t?this.crossOriginUrl:this.url,o=e.alt||"The image to preview",i=document.createElement("img");if(t&&(i.crossOrigin=t),i.src=r,i.alt=o,this.viewBox.appendChild(i),this.viewBoxImage=i,n){var a=n;"string"==typeof n?a=e.ownerDocument.querySelectorAll(n):n.querySelector&&(a=[n]),this.previews=a,H(a,(function(e){var n=document.createElement("img");ee(e,w,{width:e.offsetWidth,height:e.offsetHeight,html:e.innerHTML}),t&&(n.crossOrigin=t),n.src=r,n.alt=o,n.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',e.innerHTML="",e.appendChild(n)}))}},resetPreview:function(){H(this.previews,(function(e){var t=J(e,w);q(e,{width:t.width,height:t.height}),e.innerHTML=t.html,function(e,t){if(z(e[t]))try{delete e[t]}catch(n){e[t]=void 0}else if(e.dataset)try{delete e.dataset[t]}catch(n){e.dataset[t]=void 0}else e.removeAttribute("data-".concat(G(t)))}(e,w)}))},preview:function(){var e=this.imageData,t=this.canvasData,n=this.cropBoxData,r=n.width,o=n.height,i=e.width,a=e.height,l=n.left-t.left-e.left,c=n.top-t.top-e.top;this.cropped&&!this.disabled&&(q(this.viewBoxImage,W({width:i,height:a},fe(W({translateX:-l,translateY:-c},e)))),H(this.previews,(function(t){var n=J(t,w),s=n.width,u=n.height,f=s,p=u,h=1;r&&(p=o*(h=s/r)),o&&p>u&&(f=r*(h=u/o),p=u),q(t,{width:f,height:p}),q(t.getElementsByTagName("img")[0],W({width:i*h,height:a*h},fe(W({translateX:-l*h,translateY:-c*h},e))))})))}},we={bind:function(){var e=this.element,t=this.options,n=this.cropper;N(t.cropstart)&&oe(e,"cropstart",t.cropstart),N(t.cropmove)&&oe(e,"cropmove",t.cropmove),N(t.cropend)&&oe(e,"cropend",t.cropend),N(t.crop)&&oe(e,"crop",t.crop),N(t.zoom)&&oe(e,"zoom",t.zoom),oe(n,S,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&oe(n,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&oe(n,"dblclick",this.onDblclick=this.dblclick.bind(this)),oe(e.ownerDocument,E,this.onCropMove=this.cropMove.bind(this)),oe(e.ownerDocument,O,this.onCropEnd=this.cropEnd.bind(this)),t.responsive&&oe(window,"resize",this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,t=this.options,n=this.cropper;N(t.cropstart)&&re(e,"cropstart",t.cropstart),N(t.cropmove)&&re(e,"cropmove",t.cropmove),N(t.cropend)&&re(e,"cropend",t.cropend),N(t.crop)&&re(e,"crop",t.crop),N(t.zoom)&&re(e,"zoom",t.zoom),re(n,S,this.onCropStart),t.zoomable&&t.zoomOnWheel&&re(n,"wheel",this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&re(n,"dblclick",this.onDblclick),re(e.ownerDocument,E,this.onCropMove),re(e.ownerDocument,O,this.onCropEnd),t.responsive&&re(window,"resize",this.onResize)}},xe={resize:function(){if(!this.disabled){var e,t,n=this.options,r=this.container,o=this.containerData,i=r.offsetWidth/o.width;1===i&&r.offsetHeight===o.height||(n.restore&&(e=this.getCanvasData(),t=this.getCropBoxData()),this.render(),n.restore&&(this.setCanvasData(H(e,(function(t,n){e[n]=t*i}))),this.setCropBoxData(H(t,(function(e,n){t[n]=e*i})))))}},dblclick:function(){var e,t;this.disabled||"none"===this.options.dragMode||this.setDragMode((e=this.dragBox,t=p,(e.classList?e.classList.contains(t):e.className.indexOf(t)>-1)?"move":"crop"))},wheel:function(e){var t=this,n=Number(this.options.wheelZoomRatio)||.1,r=1;this.disabled||(e.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout((function(){t.wheeling=!1}),50),e.deltaY?r=e.deltaY>0?1:-1:e.wheelDelta?r=-e.wheelDelta/120:e.detail&&(r=e.detail>0?1:-1),this.zoom(-r*n,e)))},cropStart:function(e){var t=e.buttons,n=e.button;if(!(this.disabled||("mousedown"===e.type||"pointerdown"===e.type&&"mouse"===e.pointerType)&&(M(t)&&1!==t||M(n)&&0!==n||e.ctrlKey))){var r,o=this.options,i=this.pointers;e.changedTouches?H(e.changedTouches,(function(e){i[e.identifier]=pe(e)})):i[e.pointerId||0]=pe(e),r=Object.keys(i).length>1&&o.zoomable&&o.zoomOnTouch?"zoom":J(e.target,y),_.test(r)&&!1!==ie(this.element,"cropstart",{originalEvent:e,action:r})&&(e.preventDefault(),this.action=r,this.cropping=!1,"crop"===r&&(this.cropping=!0,$(this.dragBox,v)))}},cropMove:function(e){var t=this.action;if(!this.disabled&&t){var n=this.pointers;e.preventDefault(),!1!==ie(this.element,"cropmove",{originalEvent:e,action:t})&&(e.changedTouches?H(e.changedTouches,(function(e){W(n[e.identifier]||{},pe(e,!0))})):W(n[e.pointerId||0]||{},pe(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var t=this.action,n=this.pointers;e.changedTouches?H(e.changedTouches,(function(e){delete n[e.identifier]})):delete n[e.pointerId||0],t&&(e.preventDefault(),Object.keys(n).length||(this.action=""),this.cropping&&(this.cropping=!1,K(this.dragBox,v,this.cropped&&this.options.modal)),ie(this.element,"cropend",{originalEvent:e,action:t}))}}},ke={change:function(e){var t,n=this.options,r=this.canvasData,o=this.containerData,a=this.cropBoxData,l=this.pointers,c=this.action,s=n.aspectRatio,u=a.left,f=a.top,p=a.width,h=a.height,m=u+p,g=f+h,v=0,b=0,y=o.width,w=o.height,x=!0;!s&&e.shiftKey&&(s=p&&h?p/h:1),this.limited&&(v=a.minLeft,b=a.minTop,y=v+Math.min(o.width,r.width,r.left+r.width),w=b+Math.min(o.height,r.height,r.top+r.height));var k=l[Object.keys(l)[0]],C={x:k.endX-k.startX,y:k.endY-k.startY},S=function(e){switch(e){case"e":m+C.x>y&&(C.x=y-m);break;case"w":u+C.xw&&(C.y=w-g)}};switch(c){case"all":u+=C.x,f+=C.y;break;case"e":if(C.x>=0&&(m>=y||s&&(f<=b||g>=w))){x=!1;break}S("e"),(p+=C.x)<0&&(c="w",u-=p=-p),s&&(h=p/s,f+=(a.height-h)/2);break;case"n":if(C.y<=0&&(f<=b||s&&(u<=v||m>=y))){x=!1;break}S("n"),h-=C.y,f+=C.y,h<0&&(c="s",f-=h=-h),s&&(p=h*s,u+=(a.width-p)/2);break;case"w":if(C.x<=0&&(u<=v||s&&(f<=b||g>=w))){x=!1;break}S("w"),p-=C.x,u+=C.x,p<0&&(c="e",u-=p=-p),s&&(h=p/s,f+=(a.height-h)/2);break;case"s":if(C.y>=0&&(g>=w||s&&(u<=v||m>=y))){x=!1;break}S("s"),(h+=C.y)<0&&(c="n",f-=h=-h),s&&(p=h*s,u+=(a.width-p)/2);break;case"ne":if(s){if(C.y<=0&&(f<=b||m>=y)){x=!1;break}S("n"),h-=C.y,f+=C.y,p=h*s}else S("n"),S("e"),C.x>=0?mb&&(h-=C.y,f+=C.y):(h-=C.y,f+=C.y);p<0&&h<0?(c="sw",f-=h=-h,u-=p=-p):p<0?(c="nw",u-=p=-p):h<0&&(c="se",f-=h=-h);break;case"nw":if(s){if(C.y<=0&&(f<=b||u<=v)){x=!1;break}S("n"),h-=C.y,f+=C.y,p=h*s,u+=a.width-p}else S("n"),S("w"),C.x<=0?u>v?(p-=C.x,u+=C.x):C.y<=0&&f<=b&&(x=!1):(p-=C.x,u+=C.x),C.y<=0?f>b&&(h-=C.y,f+=C.y):(h-=C.y,f+=C.y);p<0&&h<0?(c="se",f-=h=-h,u-=p=-p):p<0?(c="ne",u-=p=-p):h<0&&(c="sw",f-=h=-h);break;case"sw":if(s){if(C.x<=0&&(u<=v||g>=w)){x=!1;break}S("w"),p-=C.x,u+=C.x,h=p/s}else S("s"),S("w"),C.x<=0?u>v?(p-=C.x,u+=C.x):C.y>=0&&g>=w&&(x=!1):(p-=C.x,u+=C.x),C.y>=0?g=0&&(m>=y||g>=w)){x=!1;break}S("e"),h=(p+=C.x)/s}else S("s"),S("e"),C.x>=0?m=0&&g>=w&&(x=!1):p+=C.x,C.y>=0?g0?c=C.y>0?"se":"ne":C.x<0&&(u-=p,c=C.y>0?"sw":"nw"),C.y<0&&(f-=h),this.cropped||(Q(this.cropBox,d),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}x&&(a.width=p,a.height=h,a.left=u,a.top=f,this.action=c,this.renderCropBox()),H(l,(function(e){e.startX=e.endX,e.startY=e.endY}))}},Ce={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&$(this.dragBox,v),Q(this.cropBox,d),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=W({},this.initialImageData),this.canvasData=W({},this.initialCanvasData),this.cropBoxData=W({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(W(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Q(this.dragBox,v),$(this.cropBox,d)),this},replace:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,H(this.previews,(function(t){t.getElementsByTagName("img")[0].src=e})))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,Q(this.cropper,h)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,$(this.cropper,h)),this},destroy:function(){var e=this.element;return e.cropper?(e.cropper=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=this.canvasData,r=n.left,o=n.top;return this.moveTo(I(e)?e:r+Number(e),I(t)?t:o+Number(t))},moveTo:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=this.canvasData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(M(e)&&(n.left=e,r=!0),M(t)&&(n.top=t,r=!0),r&&this.renderCanvas(!0)),this},zoom:function(e,t){var n=this.canvasData;return e=(e=Number(e))<0?1/(1-e):1+e,this.zoomTo(n.width*e/n.naturalWidth,null,t)},zoomTo:function(e,t,n){var r=this.options,o=this.canvasData,i=o.width,a=o.height,l=o.naturalWidth,c=o.naturalHeight;if((e=Number(e))>=0&&this.ready&&!this.disabled&&r.zoomable){var s=l*e,u=c*e;if(!1===ie(this.element,"zoom",{ratio:e,oldRatio:i/l,originalEvent:n}))return this;if(n){var f=this.pointers,p=ae(this.cropper),h=f&&Object.keys(f).length?function(e){var t=0,n=0,r=0;return H(e,(function(e){var o=e.startX,i=e.startY;t+=o,n+=i,r+=1})),{pageX:t/=r,pageY:n/=r}}(f):{pageX:n.pageX,pageY:n.pageY};o.left-=(s-i)*((h.pageX-p.left-o.left)/i),o.top-=(u-a)*((h.pageY-p.top-o.top)/a)}else L(t)&&M(t.x)&&M(t.y)?(o.left-=(s-i)*((t.x-o.left)/i),o.top-=(u-a)*((t.y-o.top)/a)):(o.left-=(s-i)/2,o.top-=(u-a)/2);o.width=s,o.height=u,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return M(e=Number(e))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var t=this.imageData.scaleY;return this.scale(e,M(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX;return this.scale(M(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=this.imageData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(M(e)&&(n.scaleX=e,r=!0),M(t)&&(n.scaleY=t,r=!0),r&&this.renderCanvas(!0,!0)),this},getData:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.options,r=this.imageData,o=this.canvasData,i=this.cropBoxData;if(this.ready&&this.cropped){e={x:i.left-o.left,y:i.top-o.top,width:i.width,height:i.height};var a=r.width/r.naturalWidth;if(H(e,(function(t,n){e[n]=t/a})),t){var l=Math.round(e.y+e.height),c=Math.round(e.x+e.width);e.x=Math.round(e.x),e.y=Math.round(e.y),e.width=c-e.x,e.height=l-e.y}}else e={x:0,y:0,width:0,height:0};return n.rotatable&&(e.rotate=r.rotate||0),n.scalable&&(e.scaleX=r.scaleX||1,e.scaleY=r.scaleY||1),e},setData:function(e){var t=this.options,n=this.imageData,r=this.canvasData,o={};if(this.ready&&!this.disabled&&L(e)){var i=!1;t.rotatable&&M(e.rotate)&&e.rotate!==n.rotate&&(n.rotate=e.rotate,i=!0),t.scalable&&(M(e.scaleX)&&e.scaleX!==n.scaleX&&(n.scaleX=e.scaleX,i=!0),M(e.scaleY)&&e.scaleY!==n.scaleY&&(n.scaleY=e.scaleY,i=!0)),i&&this.renderCanvas(!0,!0);var a=n.width/n.naturalWidth;M(e.x)&&(o.left=e.x*a+r.left),M(e.y)&&(o.top=e.y*a+r.top),M(e.width)&&(o.width=e.width*a),M(e.height)&&(o.height=e.height*a),this.setCropBoxData(o)}return this},getContainerData:function(){return this.ready?W({},this.containerData):{}},getImageData:function(){return this.sized?W({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={};return this.ready&&H(["left","top","width","height","naturalWidth","naturalHeight"],(function(n){t[n]=e[n]})),t},setCanvasData:function(e){var t=this.canvasData,n=t.aspectRatio;return this.ready&&!this.disabled&&L(e)&&(M(e.left)&&(t.left=e.left),M(e.top)&&(t.top=e.top),M(e.width)?(t.width=e.width,t.height=e.width/n):M(e.height)&&(t.height=e.height,t.width=e.height*n),this.renderCanvas(!0)),this},getCropBoxData:function(){var e,t=this.cropBoxData;return this.ready&&this.cropped&&(e={left:t.left,top:t.top,width:t.width,height:t.height}),e||{}},setCropBoxData:function(e){var t,n,r=this.cropBoxData,o=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&L(e)&&(M(e.left)&&(r.left=e.left),M(e.top)&&(r.top=e.top),M(e.width)&&e.width!==r.width&&(t=!0,r.width=e.width),M(e.height)&&e.height!==r.height&&(n=!0,r.height=e.height),o&&(t?r.height=r.width/o:n&&(r.width=r.height*o)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var t=this.canvasData,n=de(this.image,this.imageData,t,e);if(!this.cropped)return n;var r=this.getData(),o=r.x,i=r.y,l=r.width,c=r.height,s=n.width/Math.floor(t.naturalWidth);1!==s&&(o*=s,i*=s,l*=s,c*=s);var u=l/c,f=he({aspectRatio:u,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),p=he({aspectRatio:u,width:e.minWidth||0,height:e.minHeight||0},"cover"),h=he({aspectRatio:u,width:e.width||(1!==s?n.width:l),height:e.height||(1!==s?n.height:c)}),d=h.width,m=h.height;d=Math.min(f.width,Math.max(p.width,d)),m=Math.min(f.height,Math.max(p.height,m));var g=document.createElement("canvas"),v=g.getContext("2d");g.width=V(d),g.height=V(m),v.fillStyle=e.fillColor||"transparent",v.fillRect(0,0,d,m);var b=e.imageSmoothingEnabled,y=void 0===b||b,w=e.imageSmoothingQuality;v.imageSmoothingEnabled=y,w&&(v.imageSmoothingQuality=w);var x,k,C,S,E,O,_=n.width,P=n.height,T=o,j=i;T<=-l||T>_?(T=0,x=0,C=0,E=0):T<=0?(C=-T,T=0,E=x=Math.min(_,l+T)):T<=_&&(C=0,E=x=Math.min(l,_-T)),x<=0||j<=-c||j>P?(j=0,k=0,S=0,O=0):j<=0?(S=-j,j=0,O=k=Math.min(P,c+j)):j<=P&&(S=0,O=k=Math.min(c,P-j));var R=[T,j,x,k];if(E>0&&O>0){var D=d/l;R.push(C*D,S*D,E*D,O*D)}return v.drawImage.apply(v,[n].concat(a(R.map((function(e){return Math.floor(V(e))}))))),g},setAspectRatio:function(e){var t=this.options;return this.disabled||I(e)||(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,n=this.dragBox,r=this.face;if(this.ready&&!this.disabled){var o="crop"===e,i=t.movable&&"move"===e;e=o||i?e:"none",t.dragMode=e,ee(n,y,e),K(n,p,o),K(n,b,i),t.cropBoxMovable||(ee(r,y,e),K(r,p,o),K(r,b,i))}return this}},Se=s.Cropper,Ee=function(){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t(this,e),!n||!j.test(n.tagName))throw new Error("The first argument is required and must be an or element.");this.element=n,this.options=W({},R,L(r)&&r),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}var r,o,i;return r=e,i=[{key:"noConflict",value:function(){return window.Cropper=Se,e}},{key:"setDefaults",value:function(e){W(R,L(e)&&e)}}],(o=[{key:"init",value:function(){var e,t=this.element,n=t.tagName.toLowerCase();if(!t.cropper){if(t.cropper=this,"img"===n){if(this.isImg=!0,e=t.getAttribute("src")||"",this.originalUrl=e,!e)return;e=t.src}else"canvas"===n&&window.HTMLCanvasElement&&(e=t.toDataURL());this.load(e)}}},{key:"load",value:function(e){var t=this;if(e){this.url=e,this.imageData={};var n=this.element,r=this.options;if(r.rotatable||r.scalable||(r.checkOrientation=!1),r.checkOrientation&&window.ArrayBuffer)if(P.test(e))T.test(e)?this.read((o=e.replace(ge,""),i=atob(o),a=new ArrayBuffer(i.length),H(l=new Uint8Array(a),(function(e,t){l[t]=i.charCodeAt(t)})),a)):this.clone();else{var o,i,a,l,c=new XMLHttpRequest,s=this.clone.bind(this);this.reloading=!0,this.xhr=c,c.onabort=s,c.onerror=s,c.ontimeout=s,c.onprogress=function(){"image/jpeg"!==c.getResponseHeader("content-type")&&c.abort()},c.onload=function(){t.read(c.response)},c.onloadend=function(){t.reloading=!1,t.xhr=null},r.checkCrossOrigin&&se(e)&&n.crossOrigin&&(e=ue(e)),c.open("GET",e),c.responseType="arraybuffer",c.withCredentials="use-credentials"===n.crossOrigin,c.send()}else this.clone()}}},{key:"read",value:function(e){var t=this.options,n=this.imageData,r=ve(e),o=0,i=1,a=1;if(r>1){this.url=function(e,t){for(var n=[],r=new Uint8Array(e);r.length>0;)n.push(me.apply(null,U(r.subarray(0,8192)))),r=r.subarray(8192);return"data:".concat(t,";base64,").concat(btoa(n.join("")))}(e,"image/jpeg");var l=function(e){var t=0,n=1,r=1;switch(e){case 2:n=-1;break;case 3:t=-180;break;case 4:r=-1;break;case 5:t=90,r=-1;break;case 6:t=90;break;case 7:t=90,n=-1;break;case 8:t=-90}return{rotate:t,scaleX:n,scaleY:r}}(r);o=l.rotate,i=l.scaleX,a=l.scaleY}t.rotatable&&(n.rotate=o),t.scalable&&(n.scaleX=i,n.scaleY=a),this.clone()}},{key:"clone",value:function(){var e=this.element,t=this.url,n=e.crossOrigin,r=t;this.options.checkCrossOrigin&&se(t)&&(n||(n="anonymous"),r=ue(t)),this.crossOrigin=n,this.crossOriginUrl=r;var o=document.createElement("img");n&&(o.crossOrigin=n),o.src=r||t,o.alt=e.alt||"The image to crop",this.image=o,o.onload=this.start.bind(this),o.onerror=this.stop.bind(this),$(o,m),e.parentNode.insertBefore(o,e.nextSibling)}},{key:"start",value:function(){var e=this,t=this.image;t.onload=null,t.onerror=null,this.sizing=!0;var n=s.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(s.navigator.userAgent),r=function(t,n){W(e.imageData,{naturalWidth:t,naturalHeight:n,aspectRatio:t/n}),e.sizing=!1,e.sized=!0,e.build()};if(!t.naturalWidth||n){var o=document.createElement("img"),i=document.body||document.documentElement;this.sizingImage=o,o.onload=function(){r(o.width,o.height),n||i.removeChild(o)},o.src=t.src,n||(o.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",i.appendChild(o))}else r(t.naturalWidth,t.naturalHeight)}},{key:"stop",value:function(){var e=this.image;e.onload=null,e.onerror=null,e.parentNode.removeChild(e),this.image=null}},{key:"build",value:function(){if(this.sized&&!this.ready){var e=this.element,t=this.options,n=this.image,r=e.parentNode,o=document.createElement("div");o.innerHTML='
';var i=o.querySelector(".".concat("cropper","-container")),a=i.querySelector(".".concat("cropper","-canvas")),l=i.querySelector(".".concat("cropper","-drag-box")),c=i.querySelector(".".concat("cropper","-crop-box")),s=c.querySelector(".".concat("cropper","-face"));this.container=r,this.cropper=i,this.canvas=a,this.dragBox=l,this.cropBox=c,this.viewBox=i.querySelector(".".concat("cropper","-view-box")),this.face=s,a.appendChild(n),$(e,d),r.insertBefore(i,e.nextSibling),this.isImg||Q(n,m),this.initPreview(),this.bind(),t.initialAspectRatio=Math.max(0,t.initialAspectRatio)||NaN,t.aspectRatio=Math.max(0,t.aspectRatio)||NaN,t.viewMode=Math.max(0,Math.min(3,Math.round(t.viewMode)))||0,$(c,d),t.guides||$(c.getElementsByClassName("".concat("cropper","-dashed")),d),t.center||$(c.getElementsByClassName("".concat("cropper","-center")),d),t.background&&$(i,"".concat("cropper","-bg")),t.highlight||$(s,g),t.cropBoxMovable&&($(s,b),ee(s,y,"all")),t.cropBoxResizable||($(c.getElementsByClassName("".concat("cropper","-line")),d),$(c.getElementsByClassName("".concat("cropper","-point")),d)),this.render(),this.ready=!0,this.setDragMode(t.dragMode),t.autoCrop&&this.crop(),this.setData(t.data),N(t.ready)&&oe(e,"ready",t.ready,{once:!0}),ie(e,"ready")}}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),Q(this.element,d))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}])&&n(r.prototype,o),i&&n(r,i),e}();return W(Ee.prototype,be,ye,we,xe,ke,Ce),Ee}()},function(e,t,n){"use strict";const r=n(33),o=new Set(["jpg","png","gif","webp","flif","cr2","tif","bmp","jxr","psd","ico","bpg","jp2","jpm","jpx","heic","cur","dcm"]),i=e=>{const t=r(e);return o.has(t&&t.ext)?t:null};e.exports=i,e.exports.default=i,Object.defineProperty(i,"minimumBytes",{value:r.minimumBytes})},function(e,t,n){"use strict";function r(e,t){for(var n=0;nl;c?a++:a--){var s=a*o,u=s+(a===e.Blocks-1?i:o);if(Caman.NodeJS){var f=Fiber((function(){return t.call(n,a,s,u)})).run();r.push(n.blockFinished(f))}else r.push(setTimeout(function(e,r,o){return function(){return t.call(n,e,r,o)}}(a,s,u),0))}return r}()}},{key:"executeFilter",value:function(){return Caman.Event.trigger(this.c,"processStart",this.currentJob),this.currentJob.type===Caman.Filter.Type.Single?this.eachBlock(this.renderBlock):this.eachBlock(this.renderKernel)}},{key:"executePlugin",value:function(){return o.a.debug("Executing plugin ".concat(this.currentJob.plugin)),Caman.Plugin.execute(this.c,this.currentJob.plugin,this.currentJob.args),o.a.debug("Plugin ".concat(this.currentJob.plugin," finished!")),this.processNext()}},{key:"renderBlock",value:function(t,n,i){o.a.debug("Block #".concat(t," - Filter: ").concat(this.currentJob.name,", Start: ").concat(n,", End: ").concat(i)),Caman.Event.trigger(this.c,"blockStarted",{blockNum:t,totalBlocks:e.Blocks,startPixel:n,endPixel:i});var a=new Caman.Pixel;a.setContext(this.c);for(var l=n,c=i;l=v;b?g++:g--)for(var y=f,w=-f,x=f<=w;x?y<=w:y>=w;x?y++:y--){var k=p.getPixelRelative(g,y);u[3*m]=k.r,u[3*m+1]=k.g,u[3*m+2]=k.b,m++}var C=this.processKernel(c,u,a,i);this.modPixelData[h]=r.b.clampRGB(C.r),this.modPixelData[h+1]=r.b.clampRGB(C.g),this.modPixelData[h+2]=r.b.clampRGB(C.b),this.modPixelData[h+3]=this.c.pixelData[h+3]}return this.blockFinished(e)}},{key:"blockFinished",value:function(t){if(t>=0&&o.a.debug("Block #".concat(t," finished! Filter: ").concat(this.currentJob.name)),this.blocksDone++,Caman.Event.trigger(this.c,"blockFinished",{blockNum:t,blocksFinished:this.blocksDone,totalBlocks:e.Blocks}),this.blocksDone===e.Blocks){if(this.currentJob.type===Caman.Filter.Type.Kernel)for(var n=0,r=this.c.pixelData.length,i=0<=r;i?nr;i?n++:n--)this.c.pixelData[n]=this.modPixelData[n];return t>=0&&o.a.debug("Filter ".concat(this.currentJob.name," finished!")),Caman.Event.trigger(this.c,"processComplete",this.currentJob),this.processNext()}}},{key:"processKernel",value:function(e,t,n,r){for(var o={r:0,g:0,b:0},i=0,a=e.length,l=0<=a;l?ia;l?i++:i--)o.r+=e[i]*t[3*i],o.g+=e[i]*t[3*i+1],o.b+=e[i]*t[3*i+2];return o.r=o.r/n+r,o.g=o.g/n+r,o.b=o.b/n+r,o}},{key:"loadOverlay",value:function(e,t){var n=this,r=new Image;r.onload=function(){return e.context.drawImage(r,0,0,n.c.dimensions.width,n.c.dimensions.height),e.imageData=e.context.getImageData(0,0,n.c.dimensions.width,n.c.dimensions.height),e.pixelData=e.imageData.data,n.c.pixelData=e.pixelData,n.processNext()};var o=Caman.IO.remoteCheck(t);return r.src=null!=o?o:t}},{key:"loadLayerMask",value:function(e,t){var n=this,r=new Image;r.onload=function(){var t=document.createElement("canvas");t.width=n.c.dimensions.width,t.height=n.c.dimensions.height;var o=t.getContext("2d");o.drawImage(r,0,0,n.c.dimensions.width,n.c.dimensions.height);var i=o.getImageData(0,0,n.c.dimensions.width,n.c.dimensions.height);return e.maskData=i.data,n.processNext()};var o=Caman.IO.remoteCheck(t);return r.src=null!=o?o:t}}]),e}();l.initClass(),t.a=l},function(e,t,n){"use strict";var r=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,o=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){return r.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));t.a=o},function(e,t,n){"use strict";function r(e){return Object.prototype.toString.call(e).slice(8,-1)}function o(e){return"Object"===r(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function i(e){return"Array"===r(e)}function a(e){return"Symbol"===r(e)} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use @@ -54,7 +54,7 @@ function l(){for(var e=0,t=0,n=arguments.length;t