!function(n,t){var r,e;"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("underscore",t):(n="undefined"!=typeof globalThis?globalThis:n||self,r=n._,(e=n._=t()).noConflict=function(){return n._=r,e})}(this,function(){var n="1.13.7",t="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},e=Array.prototype,V=Object.prototype,F="undefined"!=typeof Symbol?Symbol.prototype:null,P=e.push,f=e.slice,s=V.toString,q=V.hasOwnProperty,r="undefined"!=typeof ArrayBuffer,u="undefined"!=typeof DataView,U=Array.isArray,W=Object.keys,z=Object.create,L=r&&ArrayBuffer.isView,$=isNaN,C=isFinite,K=!{toString:null}.propertyIsEnumerable("toString"),J=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],G=Math.pow(2,53)-1;function l(u,o){return o=null==o?u.length-1:+o,function(){for(var n=Math.max(arguments.length-o,0),t=Array(n),r=0;r<n;r++)t[r]=arguments[r+o];switch(o){case 0:return u.call(this,t);case 1:return u.call(this,arguments[0],t);case 2:return u.call(this,arguments[0],arguments[1],t)}for(var e=Array(o+1),r=0;r<o;r++)e[r]=arguments[r];return e[o]=t,u.apply(this,e)}}function o(n){var t=typeof n;return"function"==t||"object"==t&&!!n}function H(n){return void 0===n}function Q(n){return!0===n||!1===n||"[object Boolean]"===s.call(n)}function i(n){var t="[object "+n+"]";return function(n){return s.call(n)===t}}var X=i("String"),Y=i("Number"),Z=i("Date"),nn=i("RegExp"),tn=i("Error"),rn=i("Symbol"),en=i("ArrayBuffer"),a=i("Function"),t=t.document&&t.document.childNodes,p=a="function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof t?function(n){return"function"==typeof n||!1}:a,t=i("Object"),un=u&&(!/\[native code\]/.test(String(DataView))||t(new DataView(new ArrayBuffer(8)))),a="undefined"!=typeof Map&&t(new Map),u=i("DataView");var h=un?function(n){return null!=n&&p(n.getInt8)&&en(n.buffer)}:u,v=U||i("Array");function y(n,t){return null!=n&&q.call(n,t)}var on=i("Arguments"),an=(!function(){on(arguments)||(on=function(n){return y(n,"callee")})}(),on);function fn(n){return Y(n)&&$(n)}function cn(n){return function(){return n}}function ln(t){return function(n){n=t(n);return"number"==typeof n&&0<=n&&n<=G}}function sn(t){return function(n){return null==n?void 0:n[t]}}var d=sn("byteLength"),pn=ln(d),hn=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var vn=r?function(n){return L?L(n)&&!h(n):pn(n)&&hn.test(s.call(n))}:cn(!1),g=sn("length");function yn(n,t){t=function(t){for(var r={},n=t.length,e=0;e<n;++e)r[t[e]]=!0;return{contains:function(n){return!0===r[n]},push:function(n){return r[n]=!0,t.push(n)}}}(t);var r=J.length,e=n.constructor,u=p(e)&&e.prototype||V,o="constructor";for(y(n,o)&&!t.contains(o)&&t.push(o);r--;)(o=J[r])in n&&n[o]!==u[o]&&!t.contains(o)&&t.push(o)}function b(n){if(!o(n))return[];if(W)return W(n);var t,r=[];for(t in n)y(n,t)&&r.push(t);return K&&yn(n,r),r}function dn(n,t){var r=b(t),e=r.length;if(null==n)return!e;for(var u=Object(n),o=0;o<e;o++){var i=r[o];if(t[i]!==u[i]||!(i in u))return!1}return!0}function m(n){return n instanceof m?n:this instanceof m?void(this._wrapped=n):new m(n)}function gn(n){return new Uint8Array(n.buffer||n,n.byteOffset||0,d(n))}m.VERSION=n,m.prototype.valueOf=m.prototype.toJSON=m.prototype.value=function(){return this._wrapped},m.prototype.toString=function(){return String(this._wrapped)};var bn="[object DataView]";function mn(n,t,r,e){var u;return n===t?0!==n||1/n==1/t:null!=n&&null!=t&&(n!=n?t!=t:("function"==(u=typeof n)||"object"==u||"object"==typeof t)&&function n(t,r,e,u){t instanceof m&&(t=t._wrapped);r instanceof m&&(r=r._wrapped);var o=s.call(t);if(o!==s.call(r))return!1;if(un&&"[object Object]"==o&&h(t)){if(!h(r))return!1;o=bn}switch(o){case"[object RegExp]":case"[object String]":return""+t==""+r;case"[object Number]":return+t!=+t?+r!=+r:0==+t?1/+t==1/r:+t==+r;case"[object Date]":case"[object Boolean]":return+t==+r;case"[object Symbol]":return F.valueOf.call(t)===F.valueOf.call(r);case"[object ArrayBuffer]":case bn:return n(gn(t),gn(r),e,u)}o="[object Array]"===o;if(!o&&vn(t)){var i=d(t);if(i!==d(r))return!1;if(t.buffer===r.buffer&&t.byteOffset===r.byteOffset)return!0;o=!0}if(!o){if("object"!=typeof t||"object"!=typeof r)return!1;var i=t.constructor,a=r.constructor;if(i!==a&&!(p(i)&&i instanceof i&&p(a)&&a instanceof a)&&"constructor"in t&&"constructor"in r)return!1}e=e||[];u=u||[];var f=e.length;for(;f--;)if(e[f]===t)return u[f]===r;e.push(t);u.push(r);if(o){if((f=t.length)!==r.length)return!1;for(;f--;)if(!mn(t[f],r[f],e,u))return!1}else{var c,l=b(t);if(f=l.length,b(r).length!==f)return!1;for(;f--;)if(c=l[f],!y(r,c)||!mn(t[c],r[c],e,u))return!1}e.pop();u.pop();return!0}(n,t,r,e))}function c(n){if(!o(n))return[];var t,r=[];for(t in n)r.push(t);return K&&yn(n,r),r}function jn(e){var u=g(e);return function(n){if(null==n)return!1;var t=c(n);if(g(t))return!1;for(var r=0;r<u;r++)if(!p(n[e[r]]))return!1;return e!==_n||!p(n[wn])}}var wn="forEach",t=["clear","delete"],u=["get","has","set"],U=t.concat(wn,u),_n=t.concat(u),r=["add"].concat(t,wn,"has"),u=a?jn(U):i("Map"),t=a?jn(_n):i("WeakMap"),U=a?jn(r):i("Set"),a=i("WeakSet");function j(n){for(var t=b(n),r=t.length,e=Array(r),u=0;u<r;u++)e[u]=n[t[u]];return e}function An(n){for(var t={},r=b(n),e=0,u=r.length;e<u;e++)t[n[r[e]]]=r[e];return t}function xn(n){var t,r=[];for(t in n)p(n[t])&&r.push(t);return r.sort()}function Sn(f,c){return function(n){var t=arguments.length;if(c&&(n=Object(n)),!(t<2||null==n))for(var r=1;r<t;r++)for(var e=arguments[r],u=f(e),o=u.length,i=0;i<o;i++){var a=u[i];c&&void 0!==n[a]||(n[a]=e[a])}return n}}var On=Sn(c),w=Sn(b),Mn=Sn(c,!0);function En(n){var t;return o(n)?z?z(n):((t=function(){}).prototype=n,n=new t,t.prototype=null,n):{}}function Bn(n){return v(n)?n:[n]}function _(n){return m.toPath(n)}function Nn(n,t){for(var r=t.length,e=0;e<r;e++){if(null==n)return;n=n[t[e]]}return r?n:void 0}function In(n,t,r){n=Nn(n,_(t));return H(n)?r:n}function Tn(n){return n}function A(t){return t=w({},t),function(n){return dn(n,t)}}function kn(t){return t=_(t),function(n){return Nn(n,t)}}function x(u,o,n){if(void 0===o)return u;switch(null==n?3:n){case 1:return function(n){return u.call(o,n)};case 3:return function(n,t,r){return u.call(o,n,t,r)};case 4:return function(n,t,r,e){return u.call(o,n,t,r,e)}}return function(){return u.apply(o,arguments)}}function Dn(n,t,r){return null==n?Tn:p(n)?x(n,t,r):(o(n)&&!v(n)?A:kn)(n)}function Rn(n,t){return Dn(n,t,1/0)}function S(n,t,r){return m.iteratee!==Rn?m.iteratee(n,t):Dn(n,t,r)}function Vn(){}function Fn(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))}m.toPath=Bn,m.iteratee=Rn;var O=Date.now||function(){return(new Date).getTime()};function Pn(t){function r(n){return t[n]}var n="(?:"+b(t).join("|")+")",e=RegExp(n),u=RegExp(n,"g");return function(n){return e.test(n=null==n?"":""+n)?n.replace(u,r):n}}var r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},qn=Pn(r),r=Pn(An(r)),Un=m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Wn=/(.)^/,zn={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Ln=/\\|'|\r|\n|\u2028|\u2029/g;function $n(n){return"\\"+zn[n]}var Cn=/^\s*(\w|\$)+\s*$/;var Kn=0;function Jn(n,t,r,e,u){return e instanceof t?(e=En(n.prototype),o(t=n.apply(e,u))?t:e):n.apply(r,u)}var M=l(function(u,o){function i(){for(var n=0,t=o.length,r=Array(t),e=0;e<t;e++)r[e]=o[e]===a?arguments[n++]:o[e];for(;n<arguments.length;)r.push(arguments[n++]);return Jn(u,i,this,this,r)}var a=M.placeholder;return i}),Gn=(M.placeholder=m,l(function(t,r,e){var u;if(p(t))return u=l(function(n){return Jn(t,u,r,this,e.concat(n))});throw new TypeError("Bind must be called on a function")})),E=ln(g);function B(n,t,r,e){if(e=e||[],t||0===t){if(t<=0)return e.concat(n)}else t=1/0;for(var u=e.length,o=0,i=g(n);o<i;o++){var a=n[o];if(E(a)&&(v(a)||an(a)))if(1<t)B(a,t-1,r,e),u=e.length;else for(var f=0,c=a.length;f<c;)e[u++]=a[f++];else r||(e[u++]=a)}return e}var Hn=l(function(n,t){var r=(t=B(t,!1,!1)).length;if(r<1)throw new Error("bindAll must be passed function names");for(;r--;){var e=t[r];n[e]=Gn(n[e],n)}return n});var Qn=l(function(n,t,r){return setTimeout(function(){return n.apply(null,r)},t)}),Xn=M(Qn,m,1);function Yn(n){return function(){return!n.apply(this,arguments)}}function Zn(n,t){var r;return function(){return 0<--n&&(r=t.apply(this,arguments)),n<=1&&(t=null),r}}var nt=M(Zn,2);function tt(n,t,r){t=S(t,r);for(var e,u=b(n),o=0,i=u.length;o<i;o++)if(t(n[e=u[o]],e,n))return e}function rt(o){return function(n,t,r){t=S(t,r);for(var e=g(n),u=0<o?0:e-1;0<=u&&u<e;u+=o)if(t(n[u],u,n))return u;return-1}}var et=rt(1),ut=rt(-1);function ot(n,t,r,e){for(var u=(r=S(r,e,1))(t),o=0,i=g(n);o<i;){var a=Math.floor((o+i)/2);r(n[a])<u?o=a+1:i=a}return o}function it(o,i,a){return function(n,t,r){var e=0,u=g(n);if("number"==typeof r)0<o?e=0<=r?r:Math.max(r+u,e):u=0<=r?Math.min(r+1,u):r+u+1;else if(a&&r&&u)return n[r=a(n,t)]===t?r:-1;if(t!=t)return 0<=(r=i(f.call(n,e,u),fn))?r+e:-1;for(r=0<o?e:u-1;0<=r&&r<u;r+=o)if(n[r]===t)return r;return-1}}var at=it(1,et,ot),ft=it(-1,ut);function ct(n,t,r){t=(E(n)?et:tt)(n,t,r);if(void 0!==t&&-1!==t)return n[t]}function N(n,t,r){if(t=x(t,r),E(n))for(u=0,o=n.length;u<o;u++)t(n[u],u,n);else for(var e=b(n),u=0,o=e.length;u<o;u++)t(n[e[u]],e[u],n);return n}function I(n,t,r){t=S(t,r);for(var e=!E(n)&&b(n),u=(e||n).length,o=Array(u),i=0;i<u;i++){var a=e?e[i]:i;o[i]=t(n[a],a,n)}return o}function lt(f){return function(n,t,r,e){var u=3<=arguments.length;return function(n,t,r,e){var u=!E(n)&&b(n),o=(u||n).length,i=0<f?0:o-1;for(e||(r=n[u?u[i]:i],i+=f);0<=i&&i<o;i+=f){var a=u?u[i]:i;r=t(r,n[a],a,n)}return r}(n,x(t,e,4),r,u)}}var st=lt(1),pt=lt(-1);function T(n,e,t){var u=[];return e=S(e,t),N(n,function(n,t,r){e(n,t,r)&&u.push(n)}),u}function ht(n,t,r){t=S(t,r);for(var e=!E(n)&&b(n),u=(e||n).length,o=0;o<u;o++){var i=e?e[o]:o;if(!t(n[i],i,n))return!1}return!0}function vt(n,t,r){t=S(t,r);for(var e=!E(n)&&b(n),u=(e||n).length,o=0;o<u;o++){var i=e?e[o]:o;if(t(n[i],i,n))return!0}return!1}function k(n,t,r,e){return E(n)||(n=j(n)),0<=at(n,t,r="number"==typeof r&&!e?r:0)}var yt=l(function(n,r,e){var u,o;return p(r)?o=r:(r=_(r),u=r.slice(0,-1),r=r[r.length-1]),I(n,function(n){var t=o;if(!t){if(null==(n=u&&u.length?Nn(n,u):n))return;t=n[r]}return null==t?t:t.apply(n,e)})});function dt(n,t){return I(n,kn(t))}function gt(n,e,t){var r,u,o=-1/0,i=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=E(n)?n:j(n)).length;a<f;a++)null!=(r=n[a])&&o<r&&(o=r);else e=S(e,t),N(n,function(n,t,r){u=e(n,t,r),(i<u||u===-1/0&&o===-1/0)&&(o=n,i=u)});return o}var bt=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function mt(n){return n?v(n)?f.call(n):X(n)?n.match(bt):E(n)?I(n,Tn):j(n):[]}function jt(n,t,r){if(null==t||r)return(n=E(n)?n:j(n))[Fn(n.length-1)];for(var e=mt(n),r=g(e),u=(t=Math.max(Math.min(t,r),0),r-1),o=0;o<t;o++){var i=Fn(o,u),a=e[o];e[o]=e[i],e[i]=a}return e.slice(0,t)}function D(o,t){return function(r,e,n){var u=t?[[],[]]:{};return e=S(e,n),N(r,function(n,t){t=e(n,t,r);o(u,n,t)}),u}}var wt=D(function(n,t,r){y(n,r)?n[r].push(t):n[r]=[t]}),_t=D(function(n,t,r){n[r]=t}),At=D(function(n,t,r){y(n,r)?n[r]++:n[r]=1}),xt=D(function(n,t,r){n[r?0:1].push(t)},!0);function St(n,t,r){return t in r}var Ot=l(function(n,t){var r={},e=t[0];if(null!=n){p(e)?(1<t.length&&(e=x(e,t[1])),t=c(n)):(e=St,t=B(t,!1,!1),n=Object(n));for(var u=0,o=t.length;u<o;u++){var i=t[u],a=n[i];e(a,i,n)&&(r[i]=a)}}return r}),Mt=l(function(n,r){var t,e=r[0];return p(e)?(e=Yn(e),1<r.length&&(t=r[1])):(r=I(B(r,!1,!1),String),e=function(n,t){return!k(r,t)}),Ot(n,e,t)});function Et(n,t,r){return f.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))}function Bt(n,t,r){return null==n||n.length<1?null==t||r?void 0:[]:null==t||r?n[0]:Et(n,n.length-t)}function R(n,t,r){return f.call(n,null==t||r?1:t)}var Nt=l(function(n,t){return t=B(t,!0,!0),T(n,function(n){return!k(t,n)})}),It=l(function(n,t){return Nt(n,t)});function Tt(n,t,r,e){Q(t)||(e=r,r=t,t=!1),null!=r&&(r=S(r,e));for(var u=[],o=[],i=0,a=g(n);i<a;i++){var f=n[i],c=r?r(f,i,n):f;t&&!r?(i&&o===c||u.push(f),o=c):r?k(o,c)||(o.push(c),u.push(f)):k(u,f)||u.push(f)}return u}var kt=l(function(n){return Tt(B(n,!0,!0))});function Dt(n){for(var t=n&&gt(n,g).length||0,r=Array(t),e=0;e<t;e++)r[e]=dt(n,e);return r}var Rt=l(Dt);function Vt(n,t){return n._chain?m(t).chain():t}function Ft(r){return N(xn(r),function(n){var t=m[n]=r[n];m.prototype[n]=function(){var n=[this._wrapped];return P.apply(n,arguments),Vt(this,t.apply(m,n))}}),m}N(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var r=e[t];m.prototype[t]=function(){var n=this._wrapped;return null!=n&&(r.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0]),Vt(this,n)}}),N(["concat","join","slice"],function(n){var t=e[n];m.prototype[n]=function(){var n=this._wrapped;return Vt(this,n=null!=n?t.apply(n,arguments):n)}});n=Ft({__proto__:null,VERSION:n,restArguments:l,isObject:o,isNull:function(n){return null===n},isUndefined:H,isBoolean:Q,isElement:function(n){return!(!n||1!==n.nodeType)},isString:X,isNumber:Y,isDate:Z,isRegExp:nn,isError:tn,isSymbol:rn,isArrayBuffer:en,isDataView:h,isArray:v,isFunction:p,isArguments:an,isFinite:function(n){return!rn(n)&&C(n)&&!isNaN(parseFloat(n))},isNaN:fn,isTypedArray:vn,isEmpty:function(n){var t;return null==n||("number"==typeof(t=g(n))&&(v(n)||X(n)||an(n))?0===t:0===g(b(n)))},isMatch:dn,isEqual:function(n,t){return mn(n,t)},isMap:u,isWeakMap:t,isSet:U,isWeakSet:a,keys:b,allKeys:c,values:j,pairs:function(n){for(var t=b(n),r=t.length,e=Array(r),u=0;u<r;u++)e[u]=[t[u],n[t[u]]];return e},invert:An,functions:xn,methods:xn,extend:On,extendOwn:w,assign:w,defaults:Mn,create:function(n,t){return n=En(n),t&&w(n,t),n},clone:function(n){return o(n)?v(n)?n.slice():On({},n):n},tap:function(n,t){return t(n),n},get:In,has:function(n,t){for(var r=(t=_(t)).length,e=0;e<r;e++){var u=t[e];if(!y(n,u))return!1;n=n[u]}return!!r},mapObject:function(n,t,r){t=S(t,r);for(var e=b(n),u=e.length,o={},i=0;i<u;i++){var a=e[i];o[a]=t(n[a],a,n)}return o},identity:Tn,constant:cn,noop:Vn,toPath:Bn,property:kn,propertyOf:function(t){return null==t?Vn:function(n){return In(t,n)}},matcher:A,matches:A,times:function(n,t,r){var e=Array(Math.max(0,n));t=x(t,r,1);for(var u=0;u<n;u++)e[u]=t(u);return e},random:Fn,now:O,escape:qn,unescape:r,templateSettings:Un,template:function(o,n,t){n=Mn({},n=!n&&t?t:n,m.templateSettings);var r,t=RegExp([(n.escape||Wn).source,(n.interpolate||Wn).source,(n.evaluate||Wn).source].join("|")+"|$","g"),i=0,a="__p+='";if(o.replace(t,function(n,t,r,e,u){return a+=o.slice(i,u).replace(Ln,$n),i=u+n.length,t?a+="'+\n((__t=("+t+"))==null?'':_.escape(__t))+\n'":r?a+="'+\n((__t=("+r+"))==null?'':__t)+\n'":e&&(a+="';\n"+e+"\n__p+='"),n}),a+="';\n",t=n.variable){if(!Cn.test(t))throw new Error("variable is not a bare identifier: "+t)}else a="with(obj||{}){\n"+a+"}\n",t="obj";a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{r=new Function(t,"_",a)}catch(n){throw n.source=a,n}function e(n){return r.call(this,n,m)}return e.source="function("+t+"){\n"+a+"}",e},result:function(n,t,r){var e=(t=_(t)).length;if(!e)return p(r)?r.call(n):r;for(var u=0;u<e;u++){var o=null==n?void 0:n[t[u]];void 0===o&&(o=r,u=e),n=p(o)?o.call(n):o}return n},uniqueId:function(n){var t=++Kn+"";return n?n+t:t},chain:function(n){return(n=m(n))._chain=!0,n},iteratee:Rn,partial:M,bind:Gn,bindAll:Hn,memoize:function(e,u){function o(n){var t=o.cache,r=""+(u?u.apply(this,arguments):n);return y(t,r)||(t[r]=e.apply(this,arguments)),t[r]}return o.cache={},o},delay:Qn,defer:Xn,throttle:function(r,e,u){function o(){l=!1===u.leading?0:O(),i=null,c=r.apply(a,f),i||(a=f=null)}function n(){var n=O(),t=(l||!1!==u.leading||(l=n),e-(n-l));return a=this,f=arguments,t<=0||e<t?(i&&(clearTimeout(i),i=null),l=n,c=r.apply(a,f),i||(a=f=null)):i||!1===u.trailing||(i=setTimeout(o,t)),c}var i,a,f,c,l=0;return u=u||{},n.cancel=function(){clearTimeout(i),l=0,i=a=f=null},n},debounce:function(t,r,e){function u(){var n=O()-i;n<r?o=setTimeout(u,r-n):(o=null,e||(f=t.apply(c,a)),o||(a=c=null))}var o,i,a,f,c,n=l(function(n){return c=this,a=n,i=O(),o||(o=setTimeout(u,r),e&&(f=t.apply(c,a))),f});return n.cancel=function(){clearTimeout(o),o=a=c=null},n},wrap:function(n,t){return M(t,n)},negate:Yn,compose:function(){var r=arguments,e=r.length-1;return function(){for(var n=e,t=r[e].apply(this,arguments);n--;)t=r[n].call(this,t);return t}},after:function(n,t){return function(){if(--n<1)return t.apply(this,arguments)}},before:Zn,once:nt,findKey:tt,findIndex:et,findLastIndex:ut,sortedIndex:ot,indexOf:at,lastIndexOf:ft,find:ct,detect:ct,findWhere:function(n,t){return ct(n,A(t))},each:N,forEach:N,map:I,collect:I,reduce:st,foldl:st,inject:st,reduceRight:pt,foldr:pt,filter:T,select:T,reject:function(n,t,r){return T(n,Yn(S(t)),r)},every:ht,all:ht,some:vt,any:vt,contains:k,includes:k,include:k,invoke:yt,pluck:dt,where:function(n,t){return T(n,A(t))},max:gt,min:function(n,e,t){var r,u,o=1/0,i=1/0;if(null==e||"number"==typeof e&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=E(n)?n:j(n)).length;a<f;a++)null!=(r=n[a])&&r<o&&(o=r);else e=S(e,t),N(n,function(n,t,r){((u=e(n,t,r))<i||u===1/0&&o===1/0)&&(o=n,i=u)});return o},shuffle:function(n){return jt(n,1/0)},sample:jt,sortBy:function(n,e,t){var u=0;return e=S(e,t),dt(I(n,function(n,t,r){return{value:n,index:u++,criteria:e(n,t,r)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(e<r||void 0===r)return 1;if(r<e||void 0===e)return-1}return n.index-t.index}),"value")},groupBy:wt,indexBy:_t,countBy:At,partition:xt,toArray:mt,size:function(n){return null==n?0:(E(n)?n:b(n)).length},pick:Ot,omit:Mt,first:Bt,head:Bt,take:Bt,initial:Et,last:function(n,t,r){return null==n||n.length<1?null==t||r?void 0:[]:null==t||r?n[n.length-1]:R(n,Math.max(0,n.length-t))},rest:R,tail:R,drop:R,compact:function(n){return T(n,Boolean)},flatten:function(n,t){return B(n,t,!1)},without:It,uniq:Tt,unique:Tt,union:kt,intersection:function(n){for(var t=[],r=arguments.length,e=0,u=g(n);e<u;e++){var o=n[e];if(!k(t,o)){for(var i=1;i<r&&k(arguments[i],o);i++);i===r&&t.push(o)}}return t},difference:Nt,unzip:Dt,transpose:Dt,zip:Rt,object:function(n,t){for(var r={},e=0,u=g(n);e<u;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},range:function(n,t,r){null==t&&(t=n||0,n=0),r=r||(t<n?-1:1);for(var e=Math.max(Math.ceil((t-n)/r),0),u=Array(e),o=0;o<e;o++,n+=r)u[o]=n;return u},chunk:function(n,t){if(null==t||t<1)return[];for(var r=[],e=0,u=n.length;e<u;)r.push(f.call(n,e,e+=t));return r},mixin:Ft,default:m});return n._=n});
!function(E,q){var O="wapf-",V="."+O;E.wapfTT=function(){var s=10,u=E(".wttw"),p=u.find(".wapf-ttp"),h=p[0],i=null,g=null,e="mouseleave";function t(){i=setTimeout(function(){u.is(":hover")||(u.attr({style:"","aria-hidden":!0})[0].className="wttw",g=null)},75)}E(".wapf").on("mouseenter focus",V+"tt-wrap",function(e){function t(e,t){var a,n,i,r,c,l,o,d,f;e&&(p.html(e),u[0].className="wttw",t&&u.addClass("tt-img"),a=g[0].getBoundingClientRect(),e=t?"t":(n=g.data("dir")||"r",i={v:{s:a.top-s>h.offsetHeight,e:innerHeight-(a.bottom+s)>h.offsetHeight},h:{s:a.left-s>h.offsetWidth,e:innerWidth-(a.right+s)>h.offsetWidth}},r={t:"s",b:"e",l:"s",r:"e"},c={t:"b",b:"t",l:"r",r:"l",v:"h",h:"v"},(i=i[-1<["t","b"].indexOf(n)?"v":"h"])[r[n]]?n:i[r[c[n]]]?c[n]:"t"),l=a,o=e,d=h.getBoundingClientRect(),f={x:(f={x:scrollX,y:scrollY}).x,y:f.y},"t"!=o&&"b"!=o||(f.x+=l.left+(l.width/2-d.width/2)),"t"==o&&(f.y+=l.top-d.height-s),"b"==o&&(f.y+=t?l.top+20:l.bottom+s),"l"!=o&&"r"!=o||(f.y+=l.top+(l.height/2-d.height/2)),"l"==o&&(f.x+=l.left-s-d.width),"r"==o&&(f.x+=l.right+s),u.css({left:f.x,top:f.y}),u.addClass("tt-v tt-"+e).attr("aria-hidden",!1))}clearTimeout(i);var a,n,e=E(e.currentTarget);e.is(g)||(a=(g=e).data("tip")||g.find(V+"tt-content").html()||"",g.data("zoom-url")&&780<innerWidth?((n=new Image).addEventListener("load",function(){t(a="<div>"+n.outerHTML+"</div>"+a,!0)}),n.src=g.data("zoom-url")):t(a,!1))}).on(e+" blur",V+"tt-wrap",t),u.on(e,t)};var d={f:[],add:function(e,t){d.f[e]||(d.f[e]=[]),d.f[e].push(t)},apply:function(e,t,a){return d.f[e]&&d.f[e].forEach(function(e){t=e(t,a)}),t}},P={first:function(e,t,a){for(var n=0;n<e.length;n++)if(e[n][t]===a)return e[n];return null},formulas:Object.assign({len:function(e){return(""+e[0]).replace("true"==e[1]?/\s/g:"","").length},min:function(e,t){return Math.min.apply(null,e.map(function(e){return P.parseFx(e,t)}))},max:function(e,t){return Math.max.apply(null,e.map(function(e){return P.parseFx(e,t)}))}},window.customFormulas||{}),replaceFx:function(e,t,a,n,i,r){return void 0===r&&(r=0),e=(e=(e=(""+e).replace(/\[qty]/g,t).replace(/\[price]/g,a).replace(/\[x]/g,n).replace(/\[options_total]/g,r)).replace(/\[field\.(.+?)]/g,function(e,t){return P.getFieldValue(i.find(".input-"+t).first())})).replace(/\[price\.(.+?)]/g,function(e,t){t=i.find(".input-"+t).first();return 1===t.length?P.getFieldPrice(t):0}),d.apply("fx/replace",e,{qty:t,base:a,value:n,$parent:i})},parseFx:function(c,l,e,o){void 0===l&&(l=null),void 0===e&&(e=!0),void 0===o&&(o=null),c=c.replace(/&gt;/g,">").replace(/&lt;/g,"<");return d.apply("wapf/fx/functions",Object.keys(P.formulas)).forEach(function(e){for(var t,a=e+"(";-1<(t=(""+c).indexOf(a));){var n=t+a.length,i=function(e,t){for(var a=1,n=0,i=t;i<e.length;i++)if("("==e[i]&&a++,")"==e[i]&&a===++n)return i;return t}(c,n),r=function(e){for(var t=0,a="",n=[],i=0;i<e.length;i++)";"!=e[i]||t?("("==e[i]&&t++,")"==e[i]&&t--,a+=e[i]):(n.push(a.trim()),a="");return!a.length&&n.length||n.push(a.trim()),n}(c.substring(n,i)),n=P.formulas[e]?P.formulas[e](r,l,o):"";c=d.apply("wapf/fx/solve",c.substr(0,t)+n+c.substr(i+1),{func:e,args:r,$parent:l})}}),e?P.evalFx(c):c},evalFx:function(e,f){if(void 0===f&&(f=!0),!e)return 0;function s(e){return parseFloat(e.replace(",","."))}function u(e,t){return-1<e.indexOf(t)}var p=function(e){var t=!1,a=!1,n=0;if(f&&(e=(""+e).replace(/[^\d.+\-*\/()]/gi,"")),u(e,"(")&&u(e,")")){var i=/\(([\d.+\-*\/]+)\)/;if(1<(l=e.match(i)||[]).length)return p(e.replace(i,p(l[1])))}if(e=e.replace("(","").replace(")",""),u(e,"/")||u(e,"*"))for(var t=!0,r=["/","*"];r.length;)for(var c=r.pop();c&&u(e,c);){var l,i=new RegExp("([\\d.]+)\\"+c+"(\\-?[\\d.]+)");if(!(2<(l=e.match(i)||[]).length))return 0;"+"==c&&(n=s(l[1])+s(l[2])),"-"==c&&(n=s(l[1])-s(l[2])),"*"==c&&(n=s(l[1])*s(l[2])),"/"==c&&(n=s(l[1])/s(l[2])),e=(e=e.replace(i,n)).replace("++","+").replace("--","+").replace("-+","-").replace("+-","-")}if(u(e,"+")||u(e,"-")){var a=!0,o=(e=e.replace("--","+")).match(/([\d.]+|[+\-])/g)||[];if(0<o.length)for(var n=0,c="+",d=0;d<o.length;d++)"+"==o[d]||"-"==o[d]?c=o[d]:n="+"==c?n+s(o[d]):n-s(o[d])}return n=!t&&!a?s(e):n};return p(e)},cloneField:function(e,t,a){if(!a)return e;t=t.find(".field-"+e).first();return t.length&&(t.hasClass("has-repeat")||t.hasClass("has-parent-repeat"))?e+"_clone_"+a:e},cloneFx:function(e,n,i){return i?e.replace(/\[(field\.)(.+?)]/g,function(e,t,a){return"["+t+P.cloneField(a,n,i)+"]"}).replace(/\[(price\.)(.+?)]/g,function(e,t,a){return"["+t+P.cloneField(a,n,i)+"]"}).replace(/(files|checked|lookuptable)\((.+?)\)/g,function(e,t,a){return t+"("+a.split(";").map(function(e){return P.cloneField(e,n,i)}).join(";")+")"}):e},evalVars:function(o,e,d,f,s,u,p,h){return e.replace(/\[var_.+?]/g,function(e){var t=p.data("uid");if(o[t]){var a=P.first(o[t],"name",e.replace(/\[var_|]/g,""));if(a){for(var n=a.default,i=u.data("clone")||0,r=0;r<a.rules.length;r++){var c=a.rules[r],l=P.cloneField(c.field,p,i);if(P.isValidRule(p,l,c.condition,c.value||"")){n=c.variable;break}}return P.parseFx(P.replaceFx(P.cloneFx(P.evalVars(o,n,d,f,s,u,p,h),p,i),f,s,d,p,h),p,!0,u)}}return"0"})},fxPriceHint:function(e){e=d.apply("wapf/fx/hint",e);var t=P.formatMoney(e,wapf_config.display_options),e=0<e?"+":"";return d.apply("wapf/html/fxhint",wapf_config.hint.replace("{x}",t).replace("+",e))},getFieldType:function(t){if(t.is("input"))return t.data("df")?"date":t.data("isFile")?"file":t.data("isCalc")?"calc":t.attr("type");for(var e=["select","textarea","option"],a=0;a<e.length;a++)if(t.is(e[a]))return e[a];return["select","textarea","option"].find(function(e){return t.is(e)})||""},setFieldValue:function(t,a){a=Array.isArray(a)?a:[a];function e(a){var e=t.closest(V+"field-input"),n=e.find(V+"swatch").removeClass(O+"checked").length,i=e.find(V+"input").prop("checked",!1);a.forEach(function(e,t){e=i.filter('[value="'+e+'"]');n&&e.closest(V+"swatch").addClass(O+"checked"),e.prop("checked",!0),t==a.length-1&&e.trigger("change")})}switch(P.getFieldType(t)){case"radio":e(a);break;case"checkbox":"[]"==t.attr("name").slice(-2)?e(a):t.prop("checked",a[0]===""+t.data("true-label"));break;case"file":t.val(a),E("#wapf-dz-"+t.data("fieldId"))[0].dropzone.addFromUrl(a[0]);break;case"number":if(1<a.length){t.closest(V+"swatch-wrapper").find(".wapf-input").each(function(e,t){t.value=a[e]||0});break}default:t.val(a[0])}},getFieldPrice:function(e){switch(P.getFieldType(e)){case"select":return e.find("option:selected").data("price")||0;case"radio":return e.closest(V+"field-input").find("input:checked").data("price")||0;case"checkbox":if("[]"!=e.attr("name").slice(-2))return e.is(":checked")&&e.data("price")||0;var t=0;return e.closest(V+"field-input").find("input:checked").each(function(){t+=parseFloat(E(this).data("price"))||0}),t;default:return e.data("price")||0}},getFieldValue:function(e,a){switch(void 0===a&&(a=!1),P.getFieldType(e)){case"select":return(a?e.val():e.find("option:selected").data("wapfLabel"))||"";case"radio":var t=e.closest(V+"field-input").find("input:checked");return(a?t.val():t.data("wapfLabel"))||"";case"checkbox":return"[]"==e.attr("name").slice(-2)?e.closest(V+"field-input").find("input:checked").map(function(e,t){return a?t.value:t.dataset.wapfLabel}).get():e.is(":checked");case"file":return e.is(":file")?Array.from(e[0].files).map(function(e){return e.name}).join(","):e.val();case"calc":return a?e.data("raw"):e.val();default:return e.val()}},selectedVar:null,getQty:function(e){return parseInt(e.data("$qty").val())||1},currentProductType:function(e){return e.data("productType")},currentProductPrice:function(e){var t,a,n=0;return n="variable"==e.data("productType")?(a=P.getVariation(e))&&null!==(t=null!==(t=a.apf_base)&&void 0!==t?t:a.display_price)&&void 0!==t?t:0:e.data("$totals").data("productPrice"),d.apply("wapf/pricing/base",n,{parent:e})},getVariationId:function(e){e=e.find(".variation_id").val();return e?parseInt(e):0},varsViaAjax:function(e){return 0==e.find(".variations_form").data("product_variations")},getVariation:function(e){var t=e.find(".variations_form").data("product_variations");if(!t)return P.selectedVar;e=P.getVariationId(e);return e?P.first(t,"variation_id",e):null},formatNumber:function(e,t,a,n,i){void 0===i&&(i=!1);var r,c,l=null!==t?Math.abs(e).toFixed(t).split(".")[1]||"":(""+Math.abs(e)).split(".")[1]||"",l=i?(""+l).replace(new RegExp("^0+$","g"),""):l,i=null!==t?(r=Math.abs(e),c=t,Number(Math.round(r+"e"+c)+"e-"+c).toFixed(c)):""+e,t=e<0?"-":"",e=parseInt(i,10)+"",i=3<e.length?e.length%3:0;return t+(i?e.slice(0,i)+a:"")+e.slice(i).replace(/(\d{3})(?=\d)/g,"$1"+a)+(l?n+l:"")},formatMoney:function(e,t){return e<0&&t.format.replace("%2$s","-%2$s"),t.format.replace("%1$s",t.symbol).replace("%2$s",P.formatNumber(e,t.decimals||0,t.thousand,t.decimal,t.trim_zeroes))},isValidRule:function(e,t,a,n){var i=null;if("qty"==t)i=P.getQty(e);else{if(-1<a.indexOf("product_var")||-1<a.indexOf("patts")){var r=e.data("productType");if(-1===r.indexOf("variable")&&-1===r.indexOf("variation"))return!0;var c=P.getVariation(e);if(null==c)return!1;function l(){for(var e=0;e<o.length;e++){var t=o[e].split("|");if(c.attributes&&c.attributes["attribute_pa_"+t[0]]&&("*"==t[1]||c.attributes["attribute_pa_"+t[0]]===t[1]))return!0}return!1}var o=n.split(","),d=""+c.variation_id;switch(a){case"product_var":return-1<o.indexOf(d);case"!product_var":return-1==o.indexOf(d);case"patts":return!0===l();case"!patts":return!1===l()}}e=e.find(".input-"+t).first();if(!e.length)return!1;if(e.closest(V+"field-container").hasClass(O+"hide"))return!1;i=P.getFieldValue(e,!0),"date"===P.getFieldType(e)&&n&&(i=e.data("selected"),t=n.split("-"),n=new Date(parseInt(t[2]),parseInt(t[0])-1,parseInt(t[1]))),e.hasClass("is-qty")&&(i=e.closest(V+"field-input").find("input[type=number]").map(function(e,t){return t.value||"0"}).get().filter(function(e){return"0"!=e}))}switch("number"==typeof i&&(i=i.toString()),a){case"check":return 1==i;case"!check":return 0==i;case"==":return Array.isArray(i)?-1<i.indexOf(n):i instanceof Date?i&&i.getTime()===n.getTime():i==n;case"!=":return Array.isArray(i)?-1==i.indexOf(n):i instanceof Date?i&&i.getTime()!=n.getTime():i!=n;case"empty":return Array.isArray(i)&&0===i.length||""==i;case"!empty":return!(Array.isArray(i)&&0===i.length)&&""!=i;case"==contains":return-1<i.indexOf(n);case"!=contains":return-1===i.indexOf(n);case"lt":return parseFloat(i)<parseFloat(n);case"gt":return parseFloat(i)>parseFloat(n);case"gtd":return i&&i.getTime()>n.getTime();case"ltd":return i&&i.getTime()<n.getTime()}return!1},doDependencies:function(n){function i(e){var t=e.data("wapfD");if(!Array.isArray(t))return!0;for(var a=0;a<t.length;a++)if(function(e){for(var t=0;t<e.length;t++)if(!P.isValidRule(n,e[t].field,e[t].condition,e[t].value||""))return!1;return!0}(t[a].rules))return!0;return!1}var e=n.find(".has-conditions");e.length&&(e.each(function(e,t){var a=E(t),n=i(a);n?a.removeClass(O+"hide"):a.addClass(O+"hide"),a.hasClass(O+"field-true-false")&&a.find(V+"tf-h").prop("disabled",!n),a.find(V+"input").each(function(e,t){t=E(t);t.prop("required",!!n&&a.hasClass("wapf-required")),parseInt(t.data("disabled"))||t.prop("disabled",!n)})}),q.dispatchEvent(new CustomEvent("wapf/dependencies")))},repeat:function(o,a){var e,t=a.data("dupe")||[],n=t.length+2,d=a.hasClass(O+"section"),i=(a.data("cloneTxt")||"").replace("{n}",n),r=function(e,r,t,a){e.find(V+"cloner").remove();function n(e){var t=e.data("wapfD");t&&((t=JSON.parse(JSON.stringify(t))).forEach(function(e){e.rules.forEach(function(e){var t=o.find(".field-"+e.field).first();(t.hasClass("has-repeat")||t.closest(".has-repeat").length)&&(e.field=e.field+"_clone_"+r)})}),e.attr("data-wapf-d",JSON.stringify(t)).data("wapfD",t))}var i=e.find(V+"input,.wapf-tf-h").data("clone",r),c=e.find(".has-conditions");n(e),c.each(function(e,t){n(E(t))});function l(t,e){var a=t.hasClass(O+"tf-h"),n=t.data(a?"fid":"fieldId"),i=n+"_clone_"+r;["name","id","data-field-id","data-fid"].forEach(function(e){t.attr(e)&&t.attr(e,t.attr(e).replace(n,i))}),t.data("fieldId",i),e||a||t.removeClass("input-"+n).addClass("input-"+i)}a&&l(e,!0),i.each(function(e,t){t=E(t);l(t,!1);function a(e){var t;"fx"==e.data("wapfPricetype")&&(t=P.cloneFx(e.data("wapfPrice"),o,r),e.attr("data-wapf-price",t).data("wapfPrice",t))}a(t),t.find("option").data("clone",r).each(function(e,t){a(E(t))})}),e.removeAttr("data-qty-based data-clone-txt");i=e.find(V+"field-label");return!a&&t?i.find("label > span:first-child").html(t):d||i.remove(),e}(a.clone(!0),n,i,d);return r.insertAfter(t.length?t[t.length-1]:a),d&&i&&(e=E('<div class="wapf-clone-title">'+i+"</div>").prependTo(r),r.find(".has-conditions").length&&(i=function(){e[(r.find(".wapf-field-container:not(.wapf-hide)").length?"remove":"add")+"Class"](O+"hide")},E(q).on("wapf/dependencies",i),i())),r.find("select").each(function(e,t){t=E(t);P.setFieldValue(t,P.getFieldValue(a.find(".input-"+t.data("fieldId").split("_")[0]),!0))}),E(q).trigger("wapf/cloned",[a.attr("for"),n,r,o]),t.push(r),a.data("dupe",t),r},unrepeat:function(e,t,a){var n=t.data("dupe")||[];n.splice(-1*a,a).forEach(function(e){e.remove()}),t.data("dupe",n),E(q).trigger("wapf/uncloned")},doQtyLogic:function(r,e){var c=P.getQty(r);e.each(function(e,t){var a=E(t),t=a.nextAll(".has-repeat.field-"+a.attr("for")).length,n=c-(t+1);if(0!=n)if(0<n)for(var i=0;i<n;i++)P.repeat(r,a);else P.unrepeat(r,a,-1*n)}),I.calculateAll(r)}},I={variables:[],calculateOptionTotal:function(r){function s(e,t,a,n,i){return e=P.replaceFx(e,h,p,n,r,i),e=P.evalVars(I.variables,e,n,h,p,a,r,i),e=P.parseFx(e,r,t,a)}var u=0,p=P.currentProductPrice(r),h=P.getQty(r),g=r.data("tax")||1;return r.find(V+"field-input [data-wapf-price]").each(function(e,t){var a=E(t).data("price",0),n=a.data(),i=P.getFieldType(a),r=n.wapfPricetype||"",c=""+(n.wapfPrice||"0"),l=n.wapfLabel||a.val(),o="calc"===i&&"cost"!==(n.calcType||"")?"info":"cost",d=null,f=u/h;"fx"===r&&"calc"!==i&&(d=s(c,!0,a,l,f),t=P.fxPriceHint(I.addTax(d,g)),a.is("option")&&n.fxHint?a.html(n.wapfLabel+" "+t):a.closest(".has-pricing").find(V+"pricing-hint").html(t)),!0!==a.prop("disabled")&&(-1<["checkbox","radio"].indexOf(i)&&!a.is(":checked")||("option"!=i||a.is(":selected")&&!0!==a.closest("select").prop("disabled"))&&(!(i=a.val())||n.noZero&&0==i||(null===d&&(d="fx"===r?s(c,"cost"==o,a,l,f):function(e,t,a){switch(e){case"percent":return p*(t/100)*h;case"p":return p*(t/100);case"qt":return h*t;case"nr":return a*t;case"nrq":return a*t*h;case"char":return(""+a).length*t;case"charq":return(""+a).length*t*h;default:return t}}(r,parseFloat(c||"0"),l)),a.data("price",d||0),"cost"==o&&(u+=d||0))))}),u},addTax:function(e,t,a,n){void 0===t&&(t=1),void 0===a&&(a=null),void 0===n&&(n=null);var i=wapf_config.display_options;return e&&i&&i.tax_enabled?(n=n||i.tax_display,(a=a||(i.price_incl_tax?"incl":"excl"))===n?e:"excl"===a&&"incl"===n?e*t:"incl"===a&&"excl"===n?e/t:e):e},calculateAll:function(e){var t=e.data("$totals"),a=P.formatMoney,n=e.data("tax")||1,i=I.addTax,r=wapf_config.display_options,c=P.currentProductPrice(e)*P.getQty(e),l=I.calculateOptionTotal(e),o=Math.max(0,c+l);e.data("optionsTotal",l);function d(e){var t=a(i(e,n),r);return t=r.tax_enabled&&r.tax_suffix&&r.tax_suffix.length?t+" "+r.tax_suffix.replace("{price_including_tax}",a(i(e,n,null,"incl"),r)).replace("{price_excluding_tax}",a(i(e,n,null,"excl"),r)):t}t.find(V+"product-total").html(d(c)),t.find(V+"options-total").html(d(l)),t.find(V+"grand-total").html(d(o)),E(q).trigger("wapf/pricing",[i(c),i(l),i(o),e])}};WAPF={Pricing:I,Util:P,Filter:d,Frontend:function(d){var e,t,a,n,i,r,c,l,o,f,s,u,p,h,g,v,w,m,x,b,y,_,k,F=d.find(".wapf").attr("id");function T(e){v=e.image_id,q.dispatchEvent(new CustomEvent("wapf/image_changed",{detail:{image:e}})),setTimeout(function(){E(window).trigger("resize"),d.find(".images").trigger("woocommerce_gallery_init_zoom")},15)}function C(i){i&&v!=i&&setTimeout(function(){var e=f[parseInt(i)],t=d.find("[data-wapf-att-id="+i+"]");if(t.length&&wapf_config.slider_support){var a=d.find(".images").data("flexslider");if(a){var n=a.vars?a.vars.animationSpeed:250;x&&(a.vars.animationSpeed=0);t=d.find(".flex-control-nav li").eq(E("[data-wapf-att-id]").index(t)).find("img");return t.hasClass("flex-active")||t.trigger("click"),a.vars.animationSpeed=n,x=!1,T(e)}}!function(t){b=d.find(".images .wp-post-image").eq(0),w.forEach(function(e){t[e]&&b.attr(e,t[e])}),t.srcset||b.attr("srcset",""),Object.keys(m).forEach(function(e){b.attr(e,t[m[e]])});var e=d.find(".flex-control-nav li").eq(0).find("img");e.removeAttr("srcset").attr("src",t.thumb_src),b.closest("a").attr("href",t.full_src),b.closest("div").attr("data-wapf-att-id",t.image_id),e.hasClass("flex-active")||e.trigger("click"),T(t)}(e)},5)}function A(e,t,a){(t=function(e,t,a){for(var n=0;n<a.length;n++){for(var i=a[n],r=!0,c=0;c<i.values.length;c++){var l=i.values[c];if("*"!=l.value){var o=d.find(".input-"+l.field);if(o.closest(".wapf-field-container").hasClass(O+"hide")){r=!1;break}o=P.getFieldValue(o,!0);if(!(Array.isArray(o)?-1<o.indexOf(l.value):l.value==o)||"last"===e&&l.field!=t.data("fieldId")){r=!1;break}}}if(r)return i}return null}(e=void 0===e?"rules":e,a=void 0===a?null:a,t=void 0===t?[]:t))?C(t.image):(t=P.getVariation(d),C(t?t.image_id:_))}F&&(k=(e=d.find(V+"product-totals")).data("productType"),t=d.find("[data-qty-based]"),a=d.find("form :input.qty"),n=d.find(".has-pricing"),i=d.find(V+"field-group"),d.data({uid:F,productType:k,$qty:a,$totals:e,tax:e.data("tax")||1}),E(q).trigger("wapf/before_init",[d]),q.dispatchEvent(new CustomEvent("wapf:before_init",{detail:{wrapper:d[0]}})),r=d.data("uid"),I.variables[r]=[],i.each(function(e,t){t.dataset.variables&&(I.variables[r]=I.variables[r].concat(E(t).data("variables")))}),(c=null!==d[0].querySelector(".has-conditions"))&&(d.on("keyup change",V+'input, input[name="variation_id"]',P.doDependencies.bind(this,d)),P.doDependencies(d)),F=!(l=0<n.length)&&0<d.find(V+"field-calc").length,(l||F)&&(d.on("keyup change","".concat(V,'input,input[name="variation_id"]'),I.calculateAll.bind(this,d)),t.length||a.on("keyup change",I.calculateAll.bind(this,d)),I.calculateAll(d)),t.length&&(a.on("change",P.doQtyLogic.bind(this,d,t)),P.doQtyLogic(d,t)),f=o={},s=c,w=["src","height","width","title","srcset","alt","sizes"],m={"data-src":"full_src","data-caption":"caption","data-large_image":"full_src","data-large_image_width":"full_src_w","data-large_image_height":"full_src_h"},x=!(v=null),b=d.find(".images .wp-post-image"),y=i.filter("[data-wapf-gi]"),_=null,b.length&&y.length&&(q.dispatchEvent(new CustomEvent("wapf/delete_var")),_=b.closest("div").data("wapfAttId"),d.find("[data-wapf-att-id]").each(function(e,t){var a,n,i,r=E(t),t=r.data("wapfAttId");f[t]||(f[t]=(a={image_id:(r=r).attr("data-wapf-att-id")},n=r.find("img"),i=n.data("o_src")?"data-o_":"",w.forEach(function(e){a[e]=n.attr(i+e)}),a.thumb_src=r.data("thumb"),Object.keys(m).forEach(function(e){a[m[e]]=n.attr(i+e)}),wapf_config.slider_support||(a.srcset=" "),a))}),!(u=d.find('input[name="variation_id"]')).length||(p=d.find("form.cart").data("product_variations"))&&p.forEach(function(e){e.image.image_id=e.image_id,f[e.image_id]=e.image}),h=[],g=[],y.each(function(e,t){var a=E(t),n=a.data("wapfGi"),i=a.data("group"),t=n.rules.reverse();h[i]=t,g=g.concat(t),n.images.forEach(function(e){f[e.image_id]=e});var r=a.data("wapfSt"),c=null,l=a.find(V+"input").on("change",function(e){c=E(e.currentTarget),s||A(r,h[i],c)});(c=l.filter(":visible").eq(0)).length&&A(r,h[i],c),s&&q.addEventListener("wapf/dependencies",function(){l.filter(":visible").length&&A(r,h[i],c)})}),u.on("change",function(){A("rules",g,u)})),E(q).on("found_variation",function(e,t){d.data({tax:t.tax||1}),P.varsViaAjax(d)&&(P.selectedVar=t,P.doDependencies(d),o[t.variation_id]=t),n.length&&I.calculateAll(d)}),-1<k.indexOf("varia")&&E(q).on("wapf/pricing",function(){e[0<d.find(".wapf-wrapper").height()?"show":"hide"]()}),d.on("change",V+"swatch input",function(){var e,t=E(this);t.is(":disabled")||(e=t.closest(V+"swatch"),t.is(":radio")&&e.closest(V+"field-container").find(V+"swatch").removeClass(O+"checked"),e[t.is(":checked")?"addClass":"removeClass"](O+"checked"))}),d.on("click",".wapf-single-select ",function(e){var t=E(this),a=O+"checked",n=t.find("input");!n.prop("required")&&n.is(":checked")&&t.hasClass(a)&&(n.prop("checked",!1).trigger("change"),t.removeClass(a),e.stopPropagation(),e.preventDefault())}),d.on("change",'.wapf-checkbox input[type="checkbox"], .wapf-radio input[type="radio"]',function(){var e=E(this);e.is(":radio")&&e.closest(V+"radios").find(V+"radio").removeClass(O+"checked"),e.closest(V+"radio, .wapf-checkbox").toggleClass(O+"checked",e.is(":checked"))}),d.on("click",".wapf-card:not(.is-qty-select)",function(e){"A"!==e.target.tagName&&((e=this.querySelector("input")).disabled||(this.classList.toggle(O+"checked"),e.checked=!e.checked,e.dispatchEvent(new Event("change",{bubbles:!0}))))}),(k=function(){d.find(".wapf-required").each(function(e,t){var a,t=E(t);!(t.find(V+"checkboxes").length||t.find(V+"swatch-wrapper").length||t.find(V+"card-wrap").length)||(a=t.find('input[type="checkbox"]')).length&&(t=function(){a.filter(":checked").length?a.not(":checked").prop("required",!1):a.first().prop("required",!0)},a.off("change",t).on("change",t),t(),E(q).off("wapf/dependencies",t).on("wapf/dependencies",t))})})(),E(q).on("wapf/cloned",k),(k=function(){d.find(".has-minmax").each(function(e,t){var a=E(t),n=a.find('input[type="checkbox"]'),i=a.data("maxc"),r=a.data("minc");1!==r||1!==i?(t=function(){var e,t;a.hasClass(O+"hide")||(e=n.filter("input:checked").length,t=n.not(":checked").not("[data-disabled=1]"),i&&t.prop("disabled",i<=e),r&&t.prop("required",!(!a.hasClass("wapf-required")&&!e)&&e<r))},n.off("change",t).on("change",t),t(),E(q).off("wapf/dependencies",t).on("wapf/dependencies",t)):n.on("change",function(e){this.checked&&n.filter("input:checked").length&&((e=n.not(E(e.currentTarget))).prop("checked",!1).prop("required",!1),e.closest(V+"checked").removeClass(O+"checked"))})})})(),E(q).on("wapf/cloned",k),E("body").on("adding_to_cart",function(e,t,a){if("object"!=typeof a)return a;if(-1<Object.keys(a).indexOf("wapf_field_groups"))return a;t=(t=E(t)).closest("form.cart").find(V+"wrapper :input").serializeArray();if(!t)return a;t.forEach(function(e){var t;-1<e.name.indexOf("[]")?(t=e.name.replace("[]",""),a[t]||(a[t]=[]),a[t].push(e.value)):a[e.name]=e.value})}),/^iPad|iPhone$/.test(navigator.platform||navigator.userAgent)&&d[0].querySelectorAll('.wapf input[type="radio"], .wapf input[type="checkbox"]').forEach(function(e){e.addEventListener("invalid",function(e){e.target.scrollIntoView({block:"center",behavior:"smooth"})})}),d.on("click",".apf-minus, .apf-plus",function(e){var t,a,n,i,r=jQuery(e.currentTarget).siblings("input");r.is(":disabled")||(t=jQuery(e.currentTarget).hasClass("apf-minus"),a=parseFloat(r.attr("min"))||0,i=parseFloat(r.attr("max"))||9999999,n=parseFloat(r.attr("step"))||1,(e=parseFloat(""+r.val()||"0"))!==(i=t?Math.max(e-n,a):Math.min(e+n,i))&&r.val(i).trigger("change"))}),E.wapfTT(),E(q).trigger("wapf/init",[d]),q.dispatchEvent(new CustomEvent("wapf:init",{detail:{wrapper:d[0]}})))}}}(jQuery,document),jQuery(function(a){"product"==wapf_config.page_type?new WAPF.Frontend(a("body")):a("[data-product-page-preselected-id], .wp-block-woocommerce-single-product").each(function(e,t){new WAPF.Frontend(a(t))})});
!function(){const p=".wapf-";function r(e){for(var t=0,a=["<=",">=","!=","=",">","<"],n=0;n<e.length;n++)if("("===e[n]&&t++,")"===e[n]&&t--,!(0<t))for(var r of a)if(e.substring(n,n+r.length)===r)return{operand:r,left:e.substring(0,n).trim(),right:e.substring(n+r.length).trim()};return{operand:"=",left:e.trim(),right:"true"}}function i(e,t){return"true"===(e=n(e,t,!1))||"false"!==e&&(""===e?"":(t=g.evalFx(""+e,!1),isNaN(t)?e:t))}function f(e,t,a,n){switch(e=i(e,n),t=i(t,n),a){case"<":return e<t;case">":return t<e;case">=":return t<=e;case"<=":return e<=t;case"!=":return e!==t;default:return e===t}}var g=WAPF.Util,n=g.parseFx,e=WAPF.Util.formulas;["abs","floor","ceil","sqrt","sin","cos","tan"].forEach(function(a){e[a]=function(e,t){return Math[a](n(e[0],t))}}),e.formatNumber=function(e,t){var a=wapf_config.display_options,t=n(e[0],t);return g.formatNumber(t,1<e.length?e[1]:a.decimals,a.thousand,a.decimal,a.trim_zeroes)},e.round=function(e,t){var a=n(e[0],t);if(e[1]){t=n(e[1],t);return Math.round(a*Math.pow(10,t))/Math.pow(10,t)}return Math.round(a)},e.pow=function(e,t){return Math.pow(n(e[0],t),n(e[1],t))},e.checked=function(e,t){e=t.find(".input-"+e[0]),e=g.getFieldValue(e,!0);return Array.isArray(e)?e.length:0},e.files=function(e,t){e=t.find(".input-"+e[0]);if(1!==e.length)return 0;e=g.getFieldValue(e,!0);return e?e.split(",").length:0},e.sumQty=function(e,t){var t=t.find(".field-"+n(e[0],t,!1)+" .wapf-input"),a=0;return t.each(function(){a+=Number(jQuery(this).val())}),a},e.if=function(e,t){var a=r(e[0]);return f(a.left,a.right,a.operand,t)?e[1]:e[2]},e.or=function(e,t){for(var a=0;a<e.length;a++){var n=r(e[a]);if(f(n.left,n.right,n.operand,t))return"true"}return"false"},e.and=function(e,t){for(var a=0;a<e.length;a++){var n=r(e[a]);if(!f(n.left,n.right,n.operand,t))return"false"}return"true"};var u=wapf_config.date_format;function d(e,t,a){t=e[a||0]?n(e[a||0],t,!1):"";return!!t&&dpParseDate(t,u)}e.datediff=function(e,t){var a=d(e,t),t=d(e,t,1);return a&&t?Math.round((t.getTime()-a.getTime())/864e5):0},e.today=function(){return dpFormatDate(new Date(wapf_config.today),u)},e.dow=function(e,t){t=d(e,t);return t?t.getDay():0};function l(e,t,a){var n="string"==typeof e?e.split(/-/g):e,r=parseInt(n[0])-1,i=parseInt(n[1]),e=t||(2===n.length?(new Date).getFullYear():parseInt(n[2]));return a||1!=r||29!==i||t%4==0&&(t%100!=0||t%400==0)?((n=new Date(new Date(e,parseInt(n[0])-1,parseInt(n[1])).getTime())).setHours(0,0,0,0),n):null}function o(e,t){if(!t)return e;var a=0,n=0,r=0,i=t.split(" ");if(i.length)for(var f=0;f<i.length;f++){var u=i[f].toLowerCase();-1<u.indexOf("y")&&(a+=parseInt(u.replace("y",""))),-1<u.indexOf("m")&&(n+=parseInt(u.replace("m",""))),-1<u.indexOf("d")&&(r+=parseInt(u.replace("d","")))}return function(e,t,a,n){e=new Date(e.getTime());return e.setFullYear(e.getFullYear()+n),e.setMonth(e.getMonth()+a),e.setDate(e.getDate()+t),e}(e,r,n,a)}function c(e,t,a){var n,r=t.field.data(e),i=null;return r&&(h[e][a]?i=h[e][a]:new RegExp("[0-9]{2}-[0-9]{2}([0-9]{4})?").test(r)?(i=l(r),h[e][a]=i):0===r.indexOf("[field")?(n=/field.(.+?)\]/.exec(r))&&(!(n=t.field.closest(".wapf").find(".input-"+n[1]))||(n=g.getFieldValue(n,!0))&&(i=o(dpParseDate(n,wapf_config.date_format),r.replace(/\[(.+)\]/,"").trim()))):(i=o(t.today,r),h[e][a]=i)),i}var s={},h={min:{},max:{}};WAPF.Filter.add("date/selectable",function(e,t){if(!e)return!e;var a=t.field.data("fieldId");if(t.field.data("disable-after")&&t.isToday){var n=t.field.data("disable-after").split(":"),r=new Date((new Date).getTime()+(1e3*t.offset+6e4*(new Date).getTimezoneOffset()));if(r.getHours()>=parseInt(n[0])&&r.getMinutes()>=parseInt(n[1]))return!1}if(void 0!==t.field.data("disabled-days")&&-1<(f=(""+t.field.data("disabled-days")).split(",").map(function(e){return parseInt(e)})).indexOf(t.date.getDay()))return!1;n=c("min",t,a);if(n&&t.date<n)return!1;if((n=c("max",t,a))&&t.date>n)return!1;if(t.field.data("disabled-dates")){s[a]||(s[a]=[],t.field.data("disabled-dates").split(",").map(function(e){return e.trim()}).forEach(function(e){var t;-1<e.indexOf(" ")?(t=e.split(" "),s[a].push({start:t[0].split(/-/g),end:t[1].split(/-/g)})):s[a].push({start:e.split(/-/g)})}));for(var i=0;i<s[a].length;i++){var f,u=s[a][i];if(f=l(u.start,2===u.start.length?t.date.getFullYear():null,u.end))if(u.end){u=l(u.end,2===u.end.length?t.date.getFullYear():null,!0);if(u&&t.date>=f&&t.date<=u)return!1}else if(t.date.getMonth()===f.getMonth()&&t.date.getFullYear()===f.getFullYear()&&t.date.getDate()===f.getDate())return!1}}return e}),jQuery(document).on("wapf/before_init",function(e,t){var i=t.find(p+"field-calc");i.length&&(jQuery(document).on("wapf/cloned wapf/uncloned",function(){i=t.find(p+"field-calc")}),jQuery(document).on("wapf/cloned",function(e,t,n,a,r){a.find(p+"calc-text").each(function(e,t){var a=jQuery(t);"default"===a.data("type")&&(t=g.cloneFx(a.data("formula"),r,n),a.attr("data-formula",t).data("formula",t))}),a.find(".calc-raw").each(function(e,t){t=jQuery(t);t.attr("name","wapf[field_"+t.data("fieldId")+"_clone_"+n+"_raw]")})}),jQuery(document).on("wapf/pricing",function(e,t,a,n,r){const o=wapf_config.display_options,c=r.data("tax");let s=!1;i.each(function(e,t){const a=jQuery(t),n=a.find(p+"calc-text"),r=a.find(p+"input"),i=a.find(".calc-raw");var f=n.data("type");const u=n.data("txt");t=r.data("price");let d,l=0;"cost"===f?d=l=g.formatMoney(WAPF.Filter.apply("wapf/fx/hint",WAPF.Pricing.addTax(t||0,c)),o):(d=l=t||"","number"===n.data("format")&&(d=g.evalFx(l),l=d,d=g.formatNumber(d,o.decimals,o.thousand,o.decimal,o.trim_zeroes))),d=u.replace(/\{result}/g,d).trim(),n.html().trim()!==d&&(r.data("raw",l),i.val(l),n.html(d),r.val(d),s=!0)}),s&&WAPF.Util.doDependencies(r)})),t.on("input",".wapf-checkbox.wapf-custom-qty",function(e){var t=jQuery(e.target),a=t.closest(".wapf-custom-qty"),n=a.find('input[type="number"]'),e=parseInt(n.val())||0;"number"===t.attr("type")?a.find('input[type="checkbox"]').prop("checked",0<e).trigger("change"):t.is(":checked")&&!e?n.val(1).trigger("change"):t.is(":checked")||n.val(0).trigger("change")})})}();
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Cropper=e()}(this,function(){"use strict";function e(e,t){var i,a=Object.keys(e);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(e),t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,i)),a}function k(a){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?e(Object(n),!0).forEach(function(t){var e=a,i=n[t];(t=o(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach(function(t){Object.defineProperty(a,t,Object.getOwnPropertyDescriptor(n,t))})}return a}function o(t){return"symbol"==typeof(t=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return String(t);if("object"!=typeof(e=e.call(t,"string")))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t))?t:t+""}function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function t(t,e){for(var i=0;i<e.length;i++){var a=e[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,o(a.key),a)}}function T(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}()||function(t){var e;if(t)return"string"==typeof t?a(t,void 0):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?a(t,void 0):void 0}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i<e;i++)a[i]=t[i];return a}var r=(jt="undefined"!=typeof window&&void 0!==window.document)?window:{},n=!(!jt||!r.document.documentElement)&&"ontouchstart"in r.document.documentElement,h=jt&&"PointerEvent"in r,c="cropper",B="all",O="crop",W="move",E="zoom",H="e",N="w",z="s",L="n",Y="ne",R="nw",X="se",S="sw",s="".concat(c,"-crop"),l="".concat(c,"-disabled"),j="".concat(c,"-hidden"),d="".concat(c,"-hide"),p="".concat(c,"-invisible"),m="".concat(c,"-modal"),u="".concat(c,"-move"),g="".concat(c,"Action"),f="".concat(c,"Preview"),v="crop",w="move",b="none",y="crop",x="cropend",M="cropmove",C="cropstart",D="dblclick",A=h?"pointerdown":n?"touchstart":"mousedown",P=h?"pointermove":n?"touchmove":"mousemove",I=h?"pointerup pointercancel":n?"touchend touchcancel":"mouseup",U="zoom",$="image/jpeg",Z=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,q=/^data:/,F=/^data:image\/jpeg;base64,/,Q=/^img|canvas$/i,_={viewMode:0,dragMode:v,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:200,minContainerHeight:100,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},K=Number.isNaN||r.isNaN;function G(t){return"number"==typeof t&&!K(t)}function V(t){return 0<t&&t<1/0}function J(t){return void 0===t}function tt(t){return"object"===i(t)&&null!==t}var et=Object.prototype.hasOwnProperty;function it(t){if(!tt(t))return!1;try{var e=t.constructor,i=e.prototype;return e&&i&&et.call(i,"isPrototypeOf")}catch(t){return!1}}function at(t){return"function"==typeof t}var nt=Array.prototype.slice;function ot(t){return Array.from?Array.from(t):nt.call(t)}function rt(i,a){return i&&at(a)&&(Array.isArray(i)||G(i.length)?ot(i).forEach(function(t,e){a.call(i,t,e,i)}):tt(i)&&Object.keys(i).forEach(function(t){a.call(i,i[t],t,i)})),i}var ht=Object.assign||function(i){for(var t=arguments.length,e=new Array(1<t?t-1:0),a=1;a<t;a++)e[a-1]=arguments[a];return tt(i)&&0<e.length&&e.forEach(function(e){tt(e)&&Object.keys(e).forEach(function(t){i[t]=e[t]})}),i},st=/\.\d*(?:0|9){12}\d*$/;function ct(t,e){return e=1<arguments.length&&void 0!==e?e:1e11,st.test(t)?Math.round(t*e)/e:t}var lt=/^width|height|left|top|marginLeft|marginTop$/;function dt(t,e){var i=t.style;rt(e,function(t,e){lt.test(e)&&G(t)&&(t="".concat(t,"px")),i[e]=t})}function pt(t,e){var i;e&&(G(t.length)?rt(t,function(t){pt(t,e)}):t.classList?t.classList.add(e):(i=t.className.trim())?i.indexOf(e)<0&&(t.className="".concat(i," ").concat(e)):t.className=e)}function mt(t,e){e&&(G(t.length)?rt(t,function(t){mt(t,e)}):t.classList?t.classList.remove(e):0<=t.className.indexOf(e)&&(t.className=t.className.replace(e,"")))}function ut(t,e,i){e&&(G(t.length)?rt(t,function(t){ut(t,e,i)}):(i?pt:mt)(t,e))}var gt=/([a-z\d])([A-Z])/g;function ft(t){return t.replace(gt,"$1-$2").toLowerCase()}function vt(t,e){return tt(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(ft(e)))}function wt(t,e,i){tt(i)?t[e]=i:t.dataset?t.dataset[e]=i:t.setAttribute("data-".concat(ft(e)),i)}var bt,yt,xt=/\s\s*/,Mt=(yt=!1,jt&&(bt=!1,h=function(){},n=Object.defineProperty({},"once",{get:function(){return yt=!0,bt},set:function(t){bt=t}}),r.addEventListener("test",h,n),r.removeEventListener("test",h,n)),yt);function Ct(i,t,a,e){var n=3<arguments.length&&void 0!==e?e:{},o=a;t.trim().split(xt).forEach(function(t){var e;Mt||(e=i.listeners)&&e[t]&&e[t][a]&&(o=e[t][a],delete e[t][a],0===Object.keys(e[t]).length&&delete e[t],0===Object.keys(e).length)&&delete i.listeners,i.removeEventListener(t,o,n)})}function Dt(o,t,r,e){var h=3<arguments.length&&void 0!==e?e:{},s=r;t.trim().split(xt).forEach(function(a){var t,n;h.once&&!Mt&&(t=o.listeners,s=function(){delete n[a][r],o.removeEventListener(a,s,h);for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];r.apply(o,e)},(n=void 0===t?{}:t)[a]||(n[a]={}),n[a][r]&&o.removeEventListener(a,n[a][r],h),n[a][r]=s,o.listeners=n),o.addEventListener(a,s,h)})}function kt(t,e,i){var a;return at(Event)&&at(CustomEvent)?a=new CustomEvent(e,{detail:i,bubbles:!0,cancelable:!0}):(a=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,i),t.dispatchEvent(a)}function Bt(t){return{left:(t=t.getBoundingClientRect()).left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var Ot=r.location,Tt=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Wt(t){return null!==(t=t.match(Tt))&&(t[1]!==Ot.protocol||t[2]!==Ot.hostname||t[3]!==Ot.port)}function Et(t){var e="timestamp=".concat((new Date).getTime());return t+(-1===t.indexOf("?")?"?":"&")+e}function Ht(t){var e=t.rotate,i=t.scaleX,a=t.scaleY,n=t.translateX,t=t.translateY,o=[];return{WebkitTransform:n=(G(n)&&0!==n&&o.push("translateX(".concat(n,"px)")),G(t)&&0!==t&&o.push("translateY(".concat(t,"px)")),G(e)&&0!==e&&o.push("rotate(".concat(e,"deg)")),G(i)&&1!==i&&o.push("scaleX(".concat(i,")")),G(a)&&1!==a&&o.push("scaleY(".concat(a,")")),o.length?o.join(" "):"none"),msTransform:n,transform:n}}function Nt(t,e){var i=t.pageX,a={endX:i,endY:t=t.pageY};return e?a:k({startX:i,startY:t},a)}function zt(t,e){var i,a=t.aspectRatio,n=t.height,t=t.width,e=1<arguments.length&&void 0!==e?e:"contain",o=V(t),r=V(n);return o&&r?(i=n*a,"contain"===e&&t<i||"cover"===e&&i<t?n=t/a:t=n*a):o?n=t/a:r&&(t=n*a),{width:t,height:n}}var Lt=String.fromCharCode,Yt=/^data:.*,/;var Rt,Xt,St,jt={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,e=this.options,i=this.container,a=this.cropper,n=Number(e.minContainerWidth),e=Number(e.minContainerHeight),n=(pt(a,j),mt(t,j),{width:Math.max(i.offsetWidth,0<=n?n:200),height:Math.max(i.offsetHeight,0<=e?e:100)});dt(a,{width:(this.containerData=n).width,height:n.height}),pt(t,j),mt(a,j)},initCanvas:function(){var t=this.containerData,e=this.imageData,i=this.options.viewMode,a=Math.abs(e.rotate)%180==90,n=a?e.naturalHeight:e.naturalWidth,e=n/(a=a?e.naturalWidth:e.naturalHeight),o=t.width,r=t.height,e=(t.height*e>t.width?3===i?o=t.height*e:r=t.width/e:3===i?r=t.width/e:o=t.height*e,{aspectRatio:e,naturalWidth:n,naturalHeight:a,width:o,height:r});this.canvasData=e,this.limited=1===i||2===i,this.limitCanvas(!0,!0),e.width=Math.min(Math.max(e.width,e.minWidth),e.maxWidth),e.height=Math.min(Math.max(e.height,e.minHeight),e.maxHeight),e.left=(t.width-e.width)/2,e.top=(t.height-e.height)/2,e.oldLeft=e.left,e.oldTop=e.top,this.initialCanvasData=ht({},e)},limitCanvas:function(t,e){var i=this.options,a=this.containerData,n=this.canvasData,o=this.cropBoxData,r=i.viewMode,h=n.aspectRatio,s=this.cropped&&o;t&&(t=Number(i.minCanvasWidth)||0,i=Number(i.minCanvasHeight)||0,1<r?(t=Math.max(t,a.width),i=Math.max(i,a.height),3===r&&(t<i*h?t=i*h:i=t/h)):0<r&&(t?t=Math.max(t,s?o.width:0):i?i=Math.max(i,s?o.height:0):s&&((t=o.width)<(i=o.height)*h?t=i*h:i=t/h)),t=(h=zt({aspectRatio:h,width:t,height:i})).width,i=h.height,n.minWidth=t,n.minHeight=i,n.maxWidth=1/0,n.maxHeight=1/0),e&&((s?0:1)<r?(h=a.width-n.width,t=a.height-n.height,n.minLeft=Math.min(0,h),n.minTop=Math.min(0,t),n.maxLeft=Math.max(0,h),n.maxTop=Math.max(0,t),s&&this.limited&&(n.minLeft=Math.min(o.left,o.left+(o.width-n.width)),n.minTop=Math.min(o.top,o.top+(o.height-n.height)),n.maxLeft=o.left,n.maxTop=o.top,2===r)&&(n.width>=a.width&&(n.minLeft=Math.min(0,h),n.maxLeft=Math.max(0,h)),n.height>=a.height)&&(n.minTop=Math.min(0,t),n.maxTop=Math.max(0,t))):(n.minLeft=-n.width,n.minTop=-n.height,n.maxLeft=a.width,n.maxTop=a.height))},renderCanvas:function(t,e){var i,a,n,o,r=this.canvasData,h=this.imageData;e&&(h=(e={width:h.naturalWidth*Math.abs(h.scaleX||1),height:h.naturalHeight*Math.abs(h.scaleY||1),degree:h.rotate||0}).width,o=e.height,e=e.degree,i=90==(e=Math.abs(e)%180)?{width:o,height:h}:(a=e%90*Math.PI/180,i=Math.sin(a),n=h*(a=Math.cos(a))+o*i,h=h*i+o*a,90<e?{width:h,height:n}:{width:n,height:h}),a=r.width*((o=i.width)/r.naturalWidth),n=r.height*((e=i.height)/r.naturalHeight),r.left-=(a-r.width)/2,r.top-=(n-r.height)/2,r.width=a,r.height=n,r.aspectRatio=o/e,r.naturalWidth=o,r.naturalHeight=e,this.limitCanvas(!0,!1)),(r.width>r.maxWidth||r.width<r.minWidth)&&(r.left=r.oldLeft),(r.height>r.maxHeight||r.height<r.minHeight)&&(r.top=r.oldTop),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),this.limitCanvas(!1,!0),r.left=Math.min(Math.max(r.left,r.minLeft),r.maxLeft),r.top=Math.min(Math.max(r.top,r.minTop),r.maxTop),r.oldLeft=r.left,r.oldTop=r.top,dt(this.canvas,ht({width:r.width,height:r.height},Ht({translateX:r.left,translateY:r.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var e=this.canvasData,i=this.imageData,a=i.naturalWidth*(e.width/e.naturalWidth),n=i.naturalHeight*(e.height/e.naturalHeight);ht(i,{width:a,height:n,left:(e.width-a)/2,top:(e.height-n)/2}),dt(this.image,ht({width:i.width,height:i.height},Ht(ht({translateX:i.left,translateY:i.top},i)))),t&&this.output()},initCropBox:function(){var t=this.options,e=this.canvasData,i=t.aspectRatio||t.initialAspectRatio,t=Number(t.autoCropArea)||.8,a={width:e.width,height:e.height};i&&(e.height*i>e.width?a.height=a.width/i:a.width=a.height*i),this.cropBoxData=a,this.limitCropBox(!0,!0),a.width=Math.min(Math.max(a.width,a.minWidth),a.maxWidth),a.height=Math.min(Math.max(a.height,a.minHeight),a.maxHeight),a.width=Math.max(a.minWidth,a.width*t),a.height=Math.max(a.minHeight,a.height*t),a.left=e.left+(e.width-a.width)/2,a.top=e.top+(e.height-a.height)/2,a.oldLeft=a.left,a.oldTop=a.top,this.initialCropBoxData=ht({},a)},limitCropBox:function(t,e){var i,a,n=this.options,o=this.containerData,r=this.canvasData,h=this.cropBoxData,s=this.limited,c=n.aspectRatio;t&&(t=Number(n.minCropBoxWidth)||0,n=Number(n.minCropBoxHeight)||0,i=s?Math.min(o.width,r.width,r.width+r.left,o.width-r.left):o.width,a=s?Math.min(o.height,r.height,r.height+r.top,o.height-r.top):o.height,t=Math.min(t,o.width),n=Math.min(n,o.height),c&&(t&&n?t<n*c?n=t/c:t=n*c:t?n=t/c:n&&(t=n*c),i<a*c?a=i/c:i=a*c),h.minWidth=Math.min(t,i),h.minHeight=Math.min(n,a),h.maxWidth=i,h.maxHeight=a),e&&(s?(h.minLeft=Math.max(0,r.left),h.minTop=Math.max(0,r.top),h.maxLeft=Math.min(o.width,r.left+r.width)-h.width,h.maxTop=Math.min(o.height,r.top+r.height)-h.height):(h.minLeft=0,h.minTop=0,h.maxLeft=o.width-h.width,h.maxTop=o.height-h.height))},renderCropBox:function(){var t=this.options,e=this.containerData,i=this.cropBoxData;(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCropBox(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,t.movable&&t.cropBoxMovable&&wt(this.face,g,i.width>=e.width&&i.height>=e.height?W:B),dt(this.cropBox,ht({width:i.width,height:i.height},Ht({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),kt(this.element,y,this.getData())}},h={initPreview:function(){var t=this.element,i=this.crossOrigin,e=this.options.preview,a=i?this.crossOriginUrl:this.url,n=t.alt||"The image to preview",o=document.createElement("img");i&&(o.crossOrigin=i),o.src=a,o.alt=n,this.viewBox.appendChild(o),this.viewBoxImage=o,e&&("string"==typeof(o=e)?o=t.ownerDocument.querySelectorAll(e):e.querySelector&&(o=[e]),rt(this.previews=o,function(t){var e=document.createElement("img");wt(t,f,{width:t.offsetWidth,height:t.offsetHeight,html:t.innerHTML}),i&&(e.crossOrigin=i),e.src=a,e.alt=n,e.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;"',t.innerHTML="",t.appendChild(e)}))},resetPreview:function(){rt(this.previews,function(e){var i=vt(e,f);if(tt((i=(dt(e,{width:i.width,height:i.height}),e.innerHTML=i.html,e))[e=f]))try{delete i[e]}catch(t){i[e]=void 0}else if(i.dataset)try{delete i.dataset[e]}catch(t){i.dataset[e]=void 0}else i.removeAttribute("data-".concat(ft(e)))})},preview:function(){var r=this.imageData,t=this.canvasData,e=this.cropBoxData,h=e.width,s=e.height,c=r.width,l=r.height,d=e.left-t.left-r.left,p=e.top-t.top-r.top;this.cropped&&!this.disabled&&(dt(this.viewBoxImage,ht({width:c,height:l},Ht(ht({translateX:-d,translateY:-p},r)))),rt(this.previews,function(t){var e=vt(t,f),i=e.width,a=i,n=e=e.height,o=1;h&&(n=s*(o=i/h)),s&&e<n&&(a=h*(o=e/s),n=e),dt(t,{width:a,height:n}),dt(t.getElementsByTagName("img")[0],ht({width:c*o,height:l*o},Ht(ht({translateX:-d*o,translateY:-p*o},r))))}))}},n={bind:function(){var t=this.element,e=this.options,i=this.cropper;at(e.cropstart)&&Dt(t,C,e.cropstart),at(e.cropmove)&&Dt(t,M,e.cropmove),at(e.cropend)&&Dt(t,x,e.cropend),at(e.crop)&&Dt(t,y,e.crop),at(e.zoom)&&Dt(t,U,e.zoom),Dt(i,A,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&Dt(i,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&Dt(i,D,this.onDblclick=this.dblclick.bind(this)),Dt(t.ownerDocument,P,this.onCropMove=this.cropMove.bind(this)),Dt(t.ownerDocument,I,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&Dt(window,"resize",this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,e=this.options,i=this.cropper;at(e.cropstart)&&Ct(t,C,e.cropstart),at(e.cropmove)&&Ct(t,M,e.cropmove),at(e.cropend)&&Ct(t,x,e.cropend),at(e.crop)&&Ct(t,y,e.crop),at(e.zoom)&&Ct(t,U,e.zoom),Ct(i,A,this.onCropStart),e.zoomable&&e.zoomOnWheel&&Ct(i,"wheel",this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&Ct(i,D,this.onDblclick),Ct(t.ownerDocument,P,this.onCropMove),Ct(t.ownerDocument,I,this.onCropEnd),e.responsive&&Ct(window,"resize",this.onResize)}},At={resize:function(){var t,e,i,a,n,o,r;this.disabled||(t=this.options,a=this.container,e=this.containerData,i=a.offsetWidth/e.width,a=a.offsetHeight/e.height,1!=(n=Math.abs(i-1)>Math.abs(a-1)?i:a)&&(t.restore&&(o=this.getCanvasData(),r=this.getCropBoxData()),this.render(),t.restore)&&(this.setCanvasData(rt(o,function(t,e){o[e]=t*n})),this.setCropBoxData(rt(r,function(t,e){r[e]=t*n}))))},dblclick:function(){var t,e;this.disabled||this.options.dragMode===b||this.setDragMode((t=this.dragBox,e=s,(t.classList?t.classList.contains(e):-1<t.className.indexOf(e))?w:v))},wheel:function(t){var e=this,i=Number(this.options.wheelZoomRatio)||.1,a=1;this.disabled||(t.preventDefault(),this.wheeling)||(this.wheeling=!0,setTimeout(function(){e.wheeling=!1},50),t.deltaY?a=0<t.deltaY?1:-1:t.wheelDelta?a=-t.wheelDelta/120:t.detail&&(a=0<t.detail?1:-1),this.zoom(-a*i,t))},cropStart:function(t){var e,i=t.buttons,a=t.button;this.disabled||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(G(i)&&1!==i||G(a)&&0!==a||t.ctrlKey)||(i=this.options,e=this.pointers,t.changedTouches?rt(t.changedTouches,function(t){e[t.identifier]=Nt(t)}):e[t.pointerId||0]=Nt(t),a=1<Object.keys(e).length&&i.zoomable&&i.zoomOnTouch?E:vt(t.target,g),Z.test(a)&&!1!==kt(this.element,C,{originalEvent:t,action:a})&&(t.preventDefault(),this.action=a,this.cropping=!1,a===O)&&(this.cropping=!0,pt(this.dragBox,m)))},cropMove:function(t){var e,i=this.action;!this.disabled&&i&&(e=this.pointers,t.preventDefault(),!1!==kt(this.element,M,{originalEvent:t,action:i}))&&(t.changedTouches?rt(t.changedTouches,function(t){ht(e[t.identifier]||{},Nt(t,!0))}):ht(e[t.pointerId||0]||{},Nt(t,!0)),this.change(t))},cropEnd:function(t){var e,i;this.disabled||(e=this.action,i=this.pointers,t.changedTouches?rt(t.changedTouches,function(t){delete i[t.identifier]}):delete i[t.pointerId||0],e&&(t.preventDefault(),Object.keys(i).length||(this.action=""),this.cropping&&(this.cropping=!1,ut(this.dragBox,m,this.cropped&&this.options.modal)),kt(this.element,x,{originalEvent:t,action:e})))}},Pt={change:function(t){function e(t){switch(t){case H:f+D.x>y&&(D.x=y-f);break;case N:p+D.x<w&&(D.x=w-p);break;case L:m+D.y<b&&(D.y=b-m);break;case z:v+D.y>x&&(D.y=x-v)}}var i,a,o,n=this.options,r=this.canvasData,h=this.containerData,s=this.cropBoxData,c=this.pointers,l=this.action,d=n.aspectRatio,p=s.left,m=s.top,u=s.width,g=s.height,f=p+u,v=m+g,w=0,b=0,y=h.width,x=h.height,M=!0,C=(!d&&t.shiftKey&&(d=u&&g?u/g:1),this.limited&&(w=s.minLeft,b=s.minTop,y=w+Math.min(h.width,r.width,r.left+r.width),x=b+Math.min(h.height,r.height,r.top+r.height)),c[Object.keys(c)[0]]),D={x:C.endX-C.startX,y:C.endY-C.startY};switch(l){case B:p+=D.x,m+=D.y;break;case H:0<=D.x&&(y<=f||d&&(m<=b||x<=v))?M=!1:(e(H),(u+=D.x)<0&&(l=N,p-=u=-u),d&&(m+=(s.height-(g=u/d))/2));break;case L:D.y<=0&&(m<=b||d&&(p<=w||y<=f))?M=!1:(e(L),g-=D.y,m+=D.y,g<0&&(l=z,m-=g=-g),d&&(p+=(s.width-(u=g*d))/2));break;case N:D.x<=0&&(p<=w||d&&(m<=b||x<=v))?M=!1:(e(N),u-=D.x,p+=D.x,u<0&&(l=H,p-=u=-u),d&&(m+=(s.height-(g=u/d))/2));break;case z:0<=D.y&&(x<=v||d&&(p<=w||y<=f))?M=!1:(e(z),(g+=D.y)<0&&(l=L,m-=g=-g),d&&(p+=(s.width-(u=g*d))/2));break;case Y:if(d){if(D.y<=0&&(m<=b||y<=f)){M=!1;break}e(L),g-=D.y,m+=D.y,u=g*d}else e(L),e(H),!(0<=D.x)||f<y?u+=D.x:D.y<=0&&m<=b&&(M=!1),D.y<=0&&!(b<m)||(g-=D.y,m+=D.y);u<0&&g<0?(l=S,m-=g=-g,p-=u=-u):u<0?(l=R,p-=u=-u):g<0&&(l=X,m-=g=-g);break;case R:if(d){if(D.y<=0&&(m<=b||p<=w)){M=!1;break}e(L),g-=D.y,m+=D.y,p+=s.width-(u=g*d)}else e(L),e(N),!(D.x<=0)||w<p?(u-=D.x,p+=D.x):D.y<=0&&m<=b&&(M=!1),D.y<=0&&!(b<m)||(g-=D.y,m+=D.y);u<0&&g<0?(l=X,m-=g=-g,p-=u=-u):u<0?(l=Y,p-=u=-u):g<0&&(l=S,m-=g=-g);break;case S:if(d){if(D.x<=0&&(p<=w||x<=v)){M=!1;break}e(N),u-=D.x,p+=D.x,g=u/d}else e(z),e(N),!(D.x<=0)||w<p?(u-=D.x,p+=D.x):0<=D.y&&x<=v&&(M=!1),0<=D.y&&!(v<x)||(g+=D.y);u<0&&g<0?(l=Y,m-=g=-g,p-=u=-u):u<0?(l=X,p-=u=-u):g<0&&(l=R,m-=g=-g);break;case X:if(d){if(0<=D.x&&(y<=f||x<=v)){M=!1;break}e(H),g=(u+=D.x)/d}else e(z),e(H),!(0<=D.x)||f<y?u+=D.x:0<=D.y&&x<=v&&(M=!1),0<=D.y&&!(v<x)||(g+=D.y);u<0&&g<0?(l=R,m-=g=-g,p-=u=-u):u<0?(l=S,p-=u=-u):g<0&&(l=Y,m-=g=-g);break;case W:this.move(D.x,D.y),M=!1;break;case E:this.zoom((a=k({},i=c),o=0,rt(i,function(n,t){delete a[t],rt(a,function(t){var e=Math.abs(n.startX-t.startX),i=Math.abs(n.startY-t.startY),a=Math.abs(n.endX-t.endX),t=Math.abs(n.endY-t.endY),e=Math.sqrt(e*e+i*i),i=(Math.sqrt(a*a+t*t)-e)/e;Math.abs(i)>Math.abs(o)&&(o=i)})}),o),t),M=!1;break;case O:D.x&&D.y?(i=Bt(this.cropper),p=C.startX-i.left,m=C.startY-i.top,u=s.minWidth,g=s.minHeight,0<D.x?l=0<D.y?X:Y:D.x<0&&(p-=u,l=0<D.y?S:R),D.y<0&&(m-=g),this.cropped||(mt(this.cropBox,j),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))):M=!1}M&&(s.width=u,s.height=g,s.left=p,s.top=m,this.action=l,this.renderCropBox()),rt(c,function(t){t.startX=t.endX,t.startY=t.endY})}},It={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&pt(this.dragBox,m),mt(this.cropBox,j),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=ht({},this.initialImageData),this.canvasData=ht({},this.initialCanvasData),this.cropBoxData=ht({},this.initialCropBoxData),this.renderCanvas(),this.cropped)&&this.renderCropBox(),this},clear:function(){return this.cropped&&!this.disabled&&(ht(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),mt(this.dragBox,m),pt(this.cropBox,j)),this},replace:function(e){var t=1<arguments.length&&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,rt(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,mt(this.cropper,l)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,pt(this.cropper,l)),this},destroy:function(){var t=this.element;return t[c]&&(t[c]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate()),this},move:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,i=(a=this.canvasData).left,a=a.top;return this.moveTo(J(t)?t:i+Number(t),J(e)?e:a+Number(e))},moveTo:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,i=this.canvasData,a=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.movable&&(G(t)&&(i.left=t,a=!0),G(e)&&(i.top=e,a=!0),a)&&this.renderCanvas(!0),this},zoom:function(t,e){var i=this.canvasData;return t=Number(t),this.zoomTo(i.width*(t=t<0?1/(1-t):1+t)/i.naturalWidth,null,e)},zoomTo:function(t,e,i){var a,n,o,r=this.options,h=this.canvasData,s=h.width,c=h.height,l=h.naturalWidth,d=h.naturalHeight;if(0<=(t=Number(t))&&this.ready&&!this.disabled&&r.zoomable){if(r=l*t,d*=t,!1===kt(this.element,U,{ratio:t,oldRatio:s/l,originalEvent:i}))return this;i?(t=this.pointers,l=Bt(this.cropper),t=t&&Object.keys(t).length?(o=n=a=0,rt(t,function(t){var e=t.startX,t=t.startY;a+=e,n+=t,o+=1}),{pageX:a/=o,pageY:n/=o}):{pageX:i.pageX,pageY:i.pageY},h.left-=(r-s)*((t.pageX-l.left-h.left)/s),h.top-=(d-c)*((t.pageY-l.top-h.top)/c)):it(e)&&G(e.x)&&G(e.y)?(h.left-=(r-s)*((e.x-h.left)/s),h.top-=(d-c)*((e.y-h.top)/c)):(h.left-=(r-s)/2,h.top-=(d-c)/2),h.width=r,h.height=d,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return G(t=Number(t))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var e=this.imageData.scaleY;return this.scale(t,G(e)?e:1)},scaleY:function(t){var e=this.imageData.scaleX;return this.scale(G(e)?e:1,t)},scale:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,i=this.imageData,a=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.scalable&&(G(t)&&(i.scaleX=t,a=!0),G(e)&&(i.scaleY=e,a=!0),a)&&this.renderCanvas(!0,!0),this},getData:function(){var i,a,t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],e=this.options,n=this.imageData,o=this.canvasData,r=this.cropBoxData;return this.ready&&this.cropped?(i={x:r.left-o.left,y:r.top-o.top,width:r.width,height:r.height},a=n.width/n.naturalWidth,rt(i,function(t,e){i[e]=t/a}),t&&(o=Math.round(i.y+i.height),r=Math.round(i.x+i.width),i.x=Math.round(i.x),i.y=Math.round(i.y),i.width=r-i.x,i.height=o-i.y)):i={x:0,y:0,width:0,height:0},e.rotatable&&(i.rotate=n.rotate||0),e.scalable&&(i.scaleX=n.scaleX||1,i.scaleY=n.scaleY||1),i},setData:function(t){var e,i=this.options,a=this.imageData,n=this.canvasData,o={};return this.ready&&!this.disabled&&it(t)&&(e=!1,i.rotatable&&G(t.rotate)&&t.rotate!==a.rotate&&(a.rotate=t.rotate,e=!0),i.scalable&&(G(t.scaleX)&&t.scaleX!==a.scaleX&&(a.scaleX=t.scaleX,e=!0),G(t.scaleY))&&t.scaleY!==a.scaleY&&(a.scaleY=t.scaleY,e=!0),e&&this.renderCanvas(!0,!0),i=a.width/a.naturalWidth,G(t.x)&&(o.left=t.x*i+n.left),G(t.y)&&(o.top=t.y*i+n.top),G(t.width)&&(o.width=t.width*i),G(t.height)&&(o.height=t.height*i),this.setCropBoxData(o)),this},getContainerData:function(){return this.ready?ht({},this.containerData):{}},getImageData:function(){return this.sized?ht({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,i={};return this.ready&&rt(["left","top","width","height","naturalWidth","naturalHeight"],function(t){i[t]=e[t]}),i},setCanvasData:function(t){var e=this.canvasData,i=e.aspectRatio;return this.ready&&!this.disabled&&it(t)&&(G(t.left)&&(e.left=t.left),G(t.top)&&(e.top=t.top),G(t.width)?(e.width=t.width,e.height=t.width/i):G(t.height)&&(e.height=t.height,e.width=t.height*i),this.renderCanvas(!0)),this},getCropBoxData:function(){var t,e=this.cropBoxData;return(this.ready&&this.cropped?{left:e.left,top:e.top,width:e.width,height:e.height}:t)||{}},setCropBoxData:function(t){var e,i,a=this.cropBoxData,n=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&it(t)&&(G(t.left)&&(a.left=t.left),G(t.top)&&(a.top=t.top),G(t.width)&&t.width!==a.width&&(e=!0,a.width=t.width),G(t.height)&&t.height!==a.height&&(i=!0,a.height=t.height),n&&(e?a.height=a.width/n:i&&(a.width=a.height*n)),this.renderCropBox()),this},getCroppedCanvas:function(){var t,e,i,a,n,o,r,h,s,c,l,d,p,m,u,g,f,v,w,b,y,x,M,C,D,k,B,O=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.ready&&window.HTMLCanvasElement?(k=this.canvasData,u=this.image,a=k,g=(d=this.imageData).aspectRatio,e=d.naturalWidth,n=d.naturalHeight,c=void 0===(c=d.rotate)?0:c,l=void 0===(l=d.scaleX)?1:l,d=void 0===(d=d.scaleY)?1:d,i=a.aspectRatio,h=a.naturalWidth,a=a.naturalHeight,r=void 0===(r=(v=O).fillColor)?"transparent":r,p=void 0===(p=v.imageSmoothingEnabled)||p,m=void 0===(m=v.imageSmoothingQuality)?"low":m,o=void 0===(o=v.maxWidth)?1/0:o,B=void 0===(B=v.maxHeight)?1/0:B,t=void 0===(t=v.minWidth)?0:t,v=void 0===(v=v.minHeight)?0:v,f=(w=document.createElement("canvas")).getContext("2d"),s=zt({aspectRatio:i,width:o,height:B}),i=zt({aspectRatio:i,width:t,height:v},"cover"),h=Math.min(s.width,Math.max(i.width,h)),s=Math.min(s.height,Math.max(i.height,a)),i=zt({aspectRatio:g,width:o,height:B}),a=zt({aspectRatio:g,width:t,height:v},"cover"),g=[-(o=Math.min(i.width,Math.max(a.width,e)))/2,-(B=Math.min(i.height,Math.max(a.height,n)))/2,o,B],w.width=ct(h),w.height=ct(s),f.fillStyle=r,f.fillRect(0,0,h,s),f.save(),f.translate(h/2,s/2),f.rotate(c*Math.PI/180),f.scale(l,d),f.imageSmoothingEnabled=p,f.imageSmoothingQuality=m,f.drawImage.apply(f,[u].concat(T(g.map(function(t){return Math.floor(ct(t))})))),f.restore(),t=w,this.cropped?(e=(v=this.getData(O.rounded)).x,i=v.y,a=v.width,n=v.height,1!=(o=t.width/Math.floor(k.naturalWidth))&&(e*=o,i*=o,a*=o,n*=o),r=zt({aspectRatio:B=a/n,width:O.maxWidth||1/0,height:O.maxHeight||1/0}),h=zt({aspectRatio:B,width:O.minWidth||0,height:O.minHeight||0},"cover"),c=(s=zt({aspectRatio:B,width:O.width||(1!=o?t.width:a),height:O.height||(1!=o?t.height:n)})).width,l=s.height,c=Math.min(r.width,Math.max(h.width,c)),l=Math.min(r.height,Math.max(h.height,l)),p=(d=document.createElement("canvas")).getContext("2d"),d.width=ct(c),d.height=ct(l),p.fillStyle=O.fillColor||"transparent",p.fillRect(0,0,c,l),m=O.imageSmoothingEnabled,u=O.imageSmoothingQuality,p.imageSmoothingEnabled=void 0===m||m,u&&(p.imageSmoothingQuality=u),g=t.width,f=t.height,w=i,(v=e)<=-a||g<v?C=x=b=v=0:v<=0?(x=-v,v=0,C=b=Math.min(g,a+v)):v<=g&&(x=0,C=b=Math.min(a,g-v)),b<=0||w<=-n||f<w?D=M=y=w=0:w<=0?(M=-w,w=0,D=y=Math.min(f,n+w)):w<=f&&(M=0,D=y=Math.min(n,f-w)),k=[v,w,b,y],0<C&&0<D&&k.push(x*(B=c/a),M*B,C*B,D*B),p.drawImage.apply(p,[t].concat(T(k.map(function(t){return Math.floor(ct(t))})))),d):t):null},setAspectRatio:function(t){var e=this.options;return this.disabled||J(t)||(e.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped)&&this.renderCropBox()),this},setDragMode:function(t){var e,i,a=this.options,n=this.dragBox,o=this.face;return this.ready&&!this.disabled&&(i=a.movable&&t===w,a.dragMode=t=(e=t===v)||i?t:b,wt(n,g,t),ut(n,s,e),ut(n,u,i),a.cropBoxMovable||(wt(o,g,t),ut(o,s,e),ut(o,u,i))),this}},Ut=r.Cropper,Rt=(St=[{key:"noConflict",value:function(){return window.Cropper=Ut,$t}},{key:"setDefaults",value:function(t){ht(_,it(t)&&t)}}],Xt=[{key:"init",value:function(){var t,e=this.element,i=e.tagName.toLowerCase();if(!e[c]){if(e[c]=this,"img"===i){if(this.isImg=!0,t=e.getAttribute("src")||"",!(this.originalUrl=t))return;t=e.src}else"canvas"===i&&window.HTMLCanvasElement&&(t=e.toDataURL());this.load(t)}}},{key:"load",value:function(t){var e,i,a,n,o,r,h=this;t&&(this.url=t,this.imageData={},e=this.element,(i=this.options).rotatable||i.scalable||(i.checkOrientation=!1),i.checkOrientation&&window.ArrayBuffer?q.test(t)?F.test(t)?this.read((r=(r=t).replace(Yt,""),a=atob(r),r=new ArrayBuffer(a.length),rt(n=new Uint8Array(r),function(t,e){n[e]=a.charCodeAt(e)}),r)):this.clone():(o=new XMLHttpRequest,r=this.clone.bind(this),this.reloading=!0,(this.xhr=o).onabort=r,o.onerror=r,o.ontimeout=r,o.onprogress=function(){o.getResponseHeader("content-type")!==$&&o.abort()},o.onload=function(){h.read(o.response)},o.onloadend=function(){h.reloading=!1,h.xhr=null},i.checkCrossOrigin&&Wt(t)&&e.crossOrigin&&(t=Et(t)),o.open("GET",t,!0),o.responseType="arraybuffer",o.withCredentials="use-credentials"===e.crossOrigin,o.send()):this.clone())}},{key:"read",value:function(i){var t=this.options,e=this.imageData,a=function(t){var e,i,a,n,o,r,h,s=new DataView(t);try{if(255===s.getUint8(0)&&216===s.getUint8(1))for(var c=s.byteLength,l=2;l+1<c;){if(255===s.getUint8(l)&&225===s.getUint8(l+1)){i=l;break}l+=1}if(a=i&&(n=i+10,"Exif"===function(t,e,i){var a="";i+=e;for(var n=e;n<i;n+=1)a+=Lt(t.getUint8(n));return a}(s,i+4,4))&&((h=18761===(o=s.getUint16(n)))||19789===o)&&42===s.getUint16(n+2,h)&&8<=(r=s.getUint32(n+4,h))?n+r:a)for(var d,p=s.getUint16(a,h),m=0;m<p;m+=1)if(d=a+12*m+2,274===s.getUint16(d,h)){d+=8,e=s.getUint16(d,h),s.setUint16(d,1,h);break}}catch(t){e=1}return e}(i),n=0,o=1,r=1;1<a&&(this.url=function(){for(var t=[],e=new Uint8Array(i);0<e.length;)t.push(Lt.apply(null,ot(e.subarray(0,8192)))),e=e.subarray(8192);return"data:".concat("image/jpeg",";base64,").concat(btoa(t.join("")))}(),n=(i=function(){var t=0,e=1,i=1;switch(a){case 2:e=-1;break;case 3:t=-180;break;case 4:i=-1;break;case 5:t=90,i=-1;break;case 6:t=90;break;case 7:t=90,e=-1;break;case 8:t=-90}return{rotate:t,scaleX:e,scaleY:i}}()).rotate,o=i.scaleX,r=i.scaleY),t.rotatable&&(e.rotate=n),t.scalable&&(e.scaleX=o,e.scaleY=r),this.clone()}},{key:"clone",value:function(){var t=this.element,e=this.url,i=t.crossOrigin,a=e,n=(this.options.checkCrossOrigin&&Wt(e)&&(i=i||"anonymous",a=Et(e)),this.crossOrigin=i,this.crossOriginUrl=a,document.createElement("img"));i&&(n.crossOrigin=i),n.src=a||e,n.alt=t.alt||"The image to crop",(this.image=n).onload=this.start.bind(this),n.onerror=this.stop.bind(this),pt(n,d),t.parentNode.insertBefore(n,t.nextSibling)}},{key:"start",value:function(){function t(t,e){ht(a.imageData,{naturalWidth:t,naturalHeight:e,aspectRatio:t/e}),a.initialImageData=ht({},a.imageData),a.sizing=!1,a.sized=!0,a.build()}var e,i,a=this,n=this.image,o=(n.onload=null,n.onerror=null,this.sizing=!0,r.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(r.navigator.userAgent));n.naturalWidth&&!o?t(n.naturalWidth,n.naturalHeight):(e=document.createElement("img"),i=document.body||document.documentElement,(this.sizingImage=e).onload=function(){t(e.width,e.height),o||i.removeChild(e)},e.src=n.src,o||(e.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(e)))}},{key:"stop",value:function(){var t=this.image;t.onload=null,t.onerror=null,t.parentNode.removeChild(t),this.image=null}},{key:"build",value:function(){var t,e,i,a,n,o,r,h,s;this.sized&&!this.ready&&(t=this.element,e=this.options,i=this.image,a=t.parentNode,(n=document.createElement("div")).innerHTML='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',o=(n=n.querySelector(".".concat(c,"-container"))).querySelector(".".concat(c,"-canvas")),r=n.querySelector(".".concat(c,"-drag-box")),s=(h=n.querySelector(".".concat(c,"-crop-box"))).querySelector(".".concat(c,"-face")),this.container=a,this.cropper=n,this.canvas=o,this.dragBox=r,this.cropBox=h,this.viewBox=n.querySelector(".".concat(c,"-view-box")),this.face=s,o.appendChild(i),pt(t,j),a.insertBefore(n,t.nextSibling),mt(i,d),this.initPreview(),this.bind(),e.initialAspectRatio=Math.max(0,e.initialAspectRatio)||NaN,e.aspectRatio=Math.max(0,e.aspectRatio)||NaN,e.viewMode=Math.max(0,Math.min(3,Math.round(e.viewMode)))||0,pt(h,j),e.guides||pt(h.getElementsByClassName("".concat(c,"-dashed")),j),e.center||pt(h.getElementsByClassName("".concat(c,"-center")),j),e.background&&pt(n,"".concat(c,"-bg")),e.highlight||pt(s,p),e.cropBoxMovable&&(pt(s,u),wt(s,g,B)),e.cropBoxResizable||(pt(h.getElementsByClassName("".concat(c,"-line")),j),pt(h.getElementsByClassName("".concat(c,"-point")),j)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),at(e.ready)&&Dt(t,"ready",e.ready,{once:!0}),kt(t,"ready"))}},{key:"unbuild",value:function(){var t;this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),(t=this.cropper.parentNode)&&t.removeChild(this.cropper),mt(this.element,j))}},{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()}}],t((Rt=$t).prototype,Xt),t(Rt,St),Object.defineProperty(Rt,"prototype",{writable:!1}),Rt);function $t(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!(this instanceof $t))throw new TypeError("Cannot call a class as a function");if(!t||!Q.test(t.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,this.options=ht({},_,it(e)&&e),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()}return ht(Rt.prototype,jt,h,n,At,Pt,It),Rt}),jQuery(function(d){var p={cropper:null,$modal:null,getRatio:function(t){if(void 0===t.width||void 0===t.height)return!1;var e=t.width,t=t.height;return t<e?e/t:t/e},destroy:function(t){p.cropper&&(p.cropper.destroy(),p.cropper=null),p.$modal&&p.$modal.length&&(p.$modal.remove(),p.$modal=null),t&&(t.transformFile=null)},calcZoom:function(){var t=p.cropper.getCanvasData(),t=100*(t.width/t.naturalWidth);return p.$modal.find(".aium-footer-info span span").html(t.toFixed(1)),t},startCropper:function(i){cropSettings={guides:!1,highlight:!0,aspectRatio:i.ratio||null,rotatable:i.rotate,scalable:i.flip,checkCrossOrigin:!1,checkOrientation:!1,viewMode:1,zoom:function(){p.calcZoom()},ready:function(){p.calcZoom(),i.cropper||p.cropper.clear()},crop:function(t){var e=Math.round(t.detail.width),t=Math.round(t.detail.height);(e<i.minWidth||t<i.minHeight)&&p.cropper.setData({width:Math.max(i.minWidth,e),height:Math.max(i.minHeight,t)})}},i.cropper||(cropSettings.modal=!1,cropSettings.dragMode="move"),p.cropper=new Cropper(p.$modal.find("img")[0],cropSettings)},createModal:function(t,e,i,a,n,o,r,h,s){var c=d(e.options.editorTemplate).on("click","button",function(t){t.preventDefault()}).on("click",".crop-cancel",function(){p.destroy(e),h&&h()}).on("click",".rleft",function(){p.cropper.rotate(-90),p.calcZoom()}).on("click",".rright",function(){p.cropper.rotate(90),p.calcZoom()}).on("click",".fv",function(){p.cropper.scaleY(-p.cropper.getData().scaleY||-1),p.calcZoom()}).on("click",".fh",function(){p.cropper.scaleX(-p.cropper.getData().scaleX||-1),p.calcZoom()}).on("click",".aium-footer-info",function(){p.cropper.zoomTo(1),p.calcZoom()}).on("click",".zin",function(){p.cropper.zoom(.1),p.calcZoom()}).on("click",".zout",function(){p.cropper.zoom(-.1),p.calcZoom()}).on("click",".drag",function(){p.$modal.find(".crop").show(),p.$modal.find(".drag").hide(),p.cropper.setDragMode("move")}).on("click",".crop",function(){p.$modal.find(".drag").show(),p.$modal.find(".crop").hide(),p.cropper.setDragMode("crop")}).on("click",".crop-done",function(){p.cropper.getCroppedCanvas().toBlob(function(t){n&&p.replaceFile(e,i,t),r&&r(t),p.destroy(e)},i.type,aiuConfig.imgQuality)});s&&c.find(".crop-cancel").remove(),d("body").append(c),(p.$modal=c).find(".img-container").html('<img src="'+a+'" />'),o()},replaceFile:function(t,e,i){i.name=e.name,i.openedWithEdit=!0,t.removeFile(e),t.addFile(i),window.aiu_block_open=!0},compareRatio(t,e,i){return!t||(""+t/e).substring(0,6)===(""+i).substring(0,6)},canCrop:function(t,e){return!(t.minWidth&&t.minHeight&&e.width&&e.height&&e.height<=t.minHeight&&e.width<=t.minWidth)},initCropper:function(e,i,a,n,o,t,r,h){function s(t){p.destroy(e),p.createModal(l,e,i,a,t,function(){p.$modal.find(".img-container").css("max-height",.85*d(window).height()+"px").css("min-height","100%"),p.startCropper(l)},n,o,"crop_only"===r)}var c=h.find(".start-crop"),l=h.data("editor-config");t||!l.onlyCrop||p.canCrop(l,i)?t?s(!1):"crop_only"!==r&&c.on("click",function(t){t.preventDefault(),s(!0)}).show():c.remove()}};window.wapfaiu=p});
!function(z){var T={getSelections:function(a,r){var l=[];return a.each(function(a,e){var i=z(e),t=i.data("key"),n=r.filter('[data-field-id="'+t+'"]');i.find(".wapf-layer-image").hide(),n.closest(".wapf-field-container").hasClass("wapf-hide")||(e=WAPF.Util.getFieldValue(n,!0))&&l.push({$field:n,fieldId:t,$layer:i,value:e})}),l},setGeneratedImage:function(a,e,i){var t,n=this,r=a.find(".wapflayers-gallery-img"),l=r.find(".zoomImg");!l.length||(t=a.find(".images .wp-post-image").eq(0)).length&&(l.remove(),t.attr("data-src",e),r.trigger("woocommerce_gallery_init_zoom")),a.find(".wapf-layer-base img").attr("data-large_image",e).attr("data-src",e),n.$firstThumb.find("img").one("load",function(){n.$firstThumb.css("opacity",1)}).attr("src",i)},generateImage:function(a,e,i){var t=z();e.forEach(function(a){t=t.add(a.$field)}),z.post(wapf_config.ajax,t.serialize()+"&product="+a+"&action=wapf_layers_generate_image",function(a){a.success&&a.data.url&&"function"==typeof i&&i(a.data)})},init:function(r){var t,a,n,l,f,d,o,s,c,u,m,g,h,y,p,w,v,b,_=this,I=r.find(".wapflayers-gallery-img");I.length&&(t=I.data("product"),(a=wapf_lrs[t])&&(n=r.find(".woocommerce-product-gallery"),l=r.find('input[name="wapflayers_generated_image"]'),f=I.find(".wapf-layers"),d=I.find(".wapflayers-initial"),o=n.find(".woocommerce-product-gallery__image").index(I),s=1==I.data("delay"),c=1==I.data("preload"),u=1==I.data("scroll"),m=!s,g={},h={},y=z(),p=[],w="",a.forEach(function(t){var n=t.type;"field"==n&&(y=y.add(r.find('.wapf-input[data-field-id="'+t.key+'"]')),g[t.key]={},p[t.key]={}),w+='<div class="wapf-layer wapf-layer-'+n+'" style="z-index:'+t.zIndex+'" data-key="'+t.key+'"><div class="wapf-layer-images">',t.images.forEach(function(a){var e,i;w+='<div class="wapf-layer-image" style="'+("field"===n?"display:none;":"")+";z-index: "+a.zIndex+'" data-value="'+a.value+'">'+a.html+"</div>",!c&&"base"!==n||(e=new Image,i=z(a.html),e.loading="eager",e.sizes=i.attr("sizes"),e.srcset=i.attr("srcset"),e.src=a.src),"field"===n&&(p[t.key][a.value]=a)}),w+="</div></div>",f.html(w)}),(v=f.find(".wapf-layer-field")).each(function(a,e){var e=z(e),i=e.data("key");e.find(".wapf-layer-image").each(function(a,e){e=z(e);g[i][e.data("value")]=e})}),b=null,r.on("keyup change",".wapf-input",function(a){var e,i;m&&(l.val(""),e=T.getSelections(v,y),i="",e.forEach(function(a){var e=a.fieldId;Array.isArray(a.value)||(a.value=[a.value]),a.value.forEach(function(a){i+=a,g[e][a]&&g[e][a].show()})}),u&&i!==b&&n.data("flexslider")&&n.flexslider(o),b=i,e.length&&(h[i]?T.setGeneratedImage(r,h[i].full,h[i].thumb):T.generateImage(t,e,function(a){T.setGeneratedImage(r,a.url,a.thumb),h[i]={full:a.url,thumb:a.thumb},I.trigger("woocommerce_gallery_init_zoom"),l.val(a.name)})),m&&(e.length?(d.hide(),f.show()):s&&(d.show(),f.hide(),_.$firstThumb&&_.$firstThumb.find("img").attr("src",_.initialThumbUrl))))}),n.on("wc-product-gallery-after-init",function(){_.$firstThumb=r.find(".flex-control-thumbs li").eq(o),_.initialThumbUrl=_.$firstThumb.find("img").attr("src"),s?setTimeout(function(){m=!0},500):_.$firstThumb.css("opacity",0),y.first().trigger("change")}),I.css("opacity",1)))}};z(document).on("wapf/init",function(a,e){T.init(e)})}(jQuery);
!function(w){function l(e,t,i){t=parseFloat(t),i=parseFloat(i);return{x:e.x/100*t,y:e.y/100*i,w:e.w/100*t,h:e.h/100*i}}var y={cache:{fonts:[],textQueue:[]},screenType:"desktop",getSettingValue:function(e,t){for(var i=0;i<e.rules.length;i++){var n=e.rules[i];switch(n.type){case"field":var a=t.find('[data-field-id="'+n.id+'"]');if(a.closest(".wapf-field-container").hasClass("wapf-hide"))break;if(WAPF.Util.getFieldValue(a,!0)===n.meta)return n.value;break;case"variation":if(WAPF.Util.currentVariationId(t)==n.id)return n.value;break;case"attribute":var a=n.id.split("|")[0],o=n.id.split("|")[1];if(t.find("select#"+a).val()===o)return n.value}}return e.default},initCanvas:function(e,t,i,n){var a,o,l,r,c,s,f,d,p,g,u="img"===t?e.find(".wapf-img-canvas-wrap"):e,h=w('<div class="lcp-wrap">'),m=w('<div class="lcp-inner lcp-content">'),i=(h.append(m),{element:e,canvasWrapper:h,$inner:m,$parent:i}),v=("gallery"===t&&"function"==typeof w.fn.zoom&&(wc_single_product_params.zoom_enabled||lcpConfig.customZoom)&&(a=w('<div class="lcp-inner lcp-content-zoom" style="opacity: 0">'),h.append(a),d=null,v=u.find("[data-large_image_height]"),p=v.data("large_image_width"),g=v.data("large_image_height"),i.hasZoom=!0,i.zoomRatio=parseFloat(p)/u.width(),i.largeWidth=parseFloat(p),i.largeHeight=parseFloat(g),i.$innerZoom=a,u.on("mouseenter",function(e){r=u.width(),c=u.height(),o=u.width(),l=u.height(),f=(p-o)/r,d=(g-l)/c,s=h.offset(),m.css("opacity",0),a.css("opacity",1)}).on("mousemove",function(e){var t=e.pageX-s.left,e=e.pageY-s.top,e=Math.max(Math.min(e,c),0),t=Math.max(Math.min(t,r),0);a.css("left",t*-d+"px"),a.css("top",e*-f+"px")}).on("mouseleave",function(e){m.css("opacity",1),a.css("opacity",0)})),"img"===t?e.attr("for"):e.data("wapf-att-id")),e=(y.cache[v]||(y.cache[v]=i),t&&"img"===t?u.css("position","relative").prepend(h):h.prependTo(u),null),v=u.find(".wapf-layer-base");!(e=v.length?v.find("img"):u.find("img").first()).length||e[0].complete?n&&n():(e[0].loading="auto",e.on("load",function(){x.run(),n&&n()}))},initFields:function(t,n,l,r,c,s){for(var e=n.length;e--;){var i=t.find('[data-field-id="'+n[e].field+'"]');i.length?(n[e].$field=i,n[e].type=WAPF.Util.getFieldType(i)):n.splice(e,1)}n.forEach(function(a){function o(e){jQuery(document).trigger("lcp/before_draw",[a,y.cache[a.img]]);var i=!1;"img"===l&&r.hasClass("wapf-hide")||(y.clearCanvas(a.img),n.forEach(function(e){var t;e.$field.closest(".wapf-field-container").hasClass("wapf-hide")||("file"!==e.type?(t=WAPF.Util.getFieldValue(e.$field,!1),(t=Array.isArray(t)?t.join(", "):t)&&(t=(""+t).trim()).length&&(t=y.prepTextToCanvas(t,e))&&x.add(t)):e.file&&(y.addImageToCanvas(e.file,e),i=!0))}),x.canRun()&&(x.run(),i=!0),i&&void 0!==e&&-1<e&&(s.data("flexslider")?s.data("flexslider").flexAnimate(e):s.find(".woocommerce-product-gallery__wrapper").data("flickity")?s.find(".woocommerce-product-gallery__wrapper").data("flickity").select(e):t.find(".flex-control-nav li:eq("+e+") img").trigger("click"),document.dispatchEvent(new CustomEvent("lcp/auto_scroll_to",{detail:{scrollIndex:e,gallery:s[0]}}))))}"file"===a.type?(jQuery(document).on("wapf/file_uploaded",function(e,t){var i,n;a.field===t.fieldId&&(2e6<t.file.size?((i=new Image).onload=function(){o(c)},(a.file=i).src=t.response[0].file):((n=new FileReader).onloadend=()=>{var e=new Image;e.onload=function(){o(c)},e.src=n.result,a.file=e},n.readAsDataURL(t.file.transformedFile||t.file)))}),jQuery(document).on("wapf/file_deleted",function(e,t){t.fieldId===a.field&&(a.file=null,o())})):a.$field.on("change keyup",function(){o(c)}).trigger("change"),["color","font","align","size"].forEach(function(e){a[e]&&a[e].rules.length&&a[e].rules.forEach(function(e){"field"===e.type&&t.find('[data-field-id="'+e.id+'"]').off("change keyup",o).on("change",function(){o(c)})})}),jQuery("table.variations select").on("change",o),jQuery(document).on("wapf/dependencies",function(){x.cancelAll(),setTimeout(o,1)})}),n.forEach(function(e){function t(){r!==l.outerWidth()?(n(),l.remove()):0<a?(setTimeout(t,60),a-=60):l.remove()}var i,n,a,o,l,r;"file"!==e.type&&(i=e.font.default||"Arial",n=function(){e.$field.trigger("change")},a=1e3,o="-9999px",l=w("<span>"+Array(15).join("wi")+"</span>").css({position:"absolute",top:o,left:o,visibility:"hidden",fontFamily:i+", Courier New",fontSize:"250px"}),w("body").append(l),r=l.outerWidth(),t())})},init:function(){function e(){var e=jQuery(window).width();y.screenType=e<576?"mobile-portrait":e<768?"mobile":e<992?"tablet":"large"}addEventListener("resize",e),addEventListener("load",e),e(),w(".wapf-product-totals").each(function(e,t){var a,o,i,l,r,c,t=w(t),n=(y.cache.fonts=y.cache.fonts.concat(t.data("fonts")||[]),t.data("customizer"));n&&(a=t.closest("div.product"),o=(a=a.length?a:w("body")).find(".woocommerce-product-gallery"),i="function"==typeof w.fn.flexslider&&1<o.find(".woocommerce-product-gallery__image").length,l=1==t.data("lcpScroll"),r=[],n.forEach(function(e){r[e.img]?r[e.img].push(e):r[e.img]=[e]}),c=function(e){e.find("[data-wapf-att-id]").each(function(e,t){var i=w(t),t=i.data("wapf-att-id"),n=r[t]||[];n.length&&y.initCanvas(i,"gallery",a,function(){y.initFields(a,n,"gallery",i,l?e:-1,o)})})},i?w(document).on("wc-product-gallery-before-init",function(e,t,i){var n=w(t),a=wc_single_product_params.flexslider&&wc_single_product_params.flexslider.start?wc_single_product_params.flexslider.start:function(){};wc_single_product_params.flexslider.start=function(){a(),c(n),n.css("opacity",1)}}):c(o),Object.keys(r).forEach(function(e){var t,i=w(".wapf-field-img[for="+e+"]");i.length&&(i.find("img").wrap('<div class="wapf-img-canvas-wrap" style="display:inline-block">'),t=r[e],y.initCanvas(i,"img",a,function(){y.initFields(a,t,"img",i,-1)}))}))})},clearCanvas:function(e){e=y.cache[e];e&&(e.$inner.html(""),e.hasZoom&&e.$innerZoom.html(""))},addImageToCanvas:function(n,a){var e,o=y.cache[a.img];o&&(e=function(e,t=!1){var i=w('<div style="overflow:hidden;position:absolute;padding:0;margin:0;box-sizing: border-box;" class="lcp-img"></div>');i[0].style.top=e.y+"px",i[0].style.left=e.x+"px",i[0].style.width=e.w+"px",i[0].style.height=e.h+"px",0!=a.rotate&&(i[0].style.transform="rotate("+a.rotate+"deg)"),w(document).trigger("lcp/before_drawing_image",[n,o,e,t,a,i[0]]),i.html(n.cloneNode(!0)),o[t?"$innerZoom":"$inner"].append(i),w(document).trigger("lcp/after_drawing_image",[n,o,e,t,a,i[0]])},a.imgFit&&("scale"===a.imgFit?n.classList.add("scale"):"cover"===a.imgFit&&n.classList.add("cover")),"oval"===a.shape&&n.style.setProperty("border-radius","50%","important"),e(l(a,o.canvasWrapper[0].offsetWidth,o.canvasWrapper[0].offsetHeight)),o.hasZoom&&e(l(a,o.largeWidth,o.largeHeight),!0))},getFont:function(e){for(var t=0;t<y.cache.fonts.length;t++)if(e===y.cache.fonts[t].name)return y.cache.fonts[t];return null},getFontSize:function(i,n){function e(e,t){return i[e]||t&&i[t]?parseInt(y.getSettingValue(i[e],n)):i.size?parseInt(y.getSettingValue(i.size,n)):16}switch(this.screenType){case"mobile":return e("sizeMobile");case"tablet":return e("sizeTablet");case"mobile-portrait":return e("sizeXs");default:return e("size")}},prepTextToCanvas:function(e,t){var i=y.cache[t.img];if(!i)return null;e=(e=t.caps?e.toUpperCase():e).trim(),-1===["single","scaledown"].indexOf(t.textMode)&&(e=null==(o=e)?"":(o+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1<br/>$2"));var n,a,o="normal";return t.lineheight&&t.lineheight.default&&((n=y.getSettingValue(t.lineheight,i.$parent))&&(a=t.lineheight.unit&&"ul"===t.lineheight.unit?"":"px",o=(""+n).replace(",",".")+a)),{cache:i,field:t,color:y.getSettingValue(t.color,i.$parent),align:t.align?y.getSettingValue(t.align,i.$parent):"left",font:y.getSettingValue(t.font,i.$parent),fontSize:y.getFontSize(t,i.$parent),fontWeight:t.weight,italic:t.italic,textMode:t.textMode,valign:t.valign,lineheight:o,text:e,rotate:t.rotate}},addTextToCanvas:function(e){e.length&&(e.forEach(function(e){x.add(e)}),x.run())}},x={preps:[],add:function(e){this.preps.push(e)},cancelAll:function(){this.preps=[],this.isRunning=!1},canRun:function(){return 0<this.preps.length},isRunning:!1,run:function(e){var t,i,n,a=this;a.canRun()?a.isRunning&&!e||(a.isRunning=!0,t=function(s){function e(e,t=!1){var i=document.createElement("div"),n=(i.classList.add("lcp-text"),{margin:0,padding:0,boxSizing:"border-box",display:"flex",position:"absolute",textAlign:s.align,fontFamily:s.font,color:s.color,fontWeight:s.fontWeight||"normal",fontStyle:s.italic?"italic":"",alignItems:"top"===s.valign?"flex-start":s.valign,lineHeight:s.lineheight||"normal",whiteSpace:"normal",top:e.y+"px",left:e.x+"px",width:e.w+"px",height:e.h+"px",overflow:"visible"});for(const c in n)i.style[c]=n[c];if(i.dataset.fontSize=s.fontSize,t&&(i.dataset.fontSize=Math.floor(s.fontSize*s.cache.zoomRatio)),i.style.fontSize=i.dataset.fontSize+"px",s.lineheight&&t&&t&&(i.style.lineheight=Math.floor(s.lineheight*s.cache.zoomRatio)+"px"),s.textMode&&-1<["single","scaledown","multiscalex"].indexOf(s.textMode)&&(i.style.whiteSpace="nowrap"),0!=s.rotate&&(i.style.transform="rotate("+s.rotate+"deg)",i.style.transformOrigin="center center"),i.innerHTML='<div style="width:100%;">'+s.text+"</div>",w(document).trigger("livecontent/before_drawing_text",[s,e,t,i]),s.cache[t?"$innerZoom":"$inner"].append(i),"scaledown"===s.textMode)for(var a=0,o=i.scrollWidth;a<30&&o>i.offsetWidth;)a++,i.dataset.fontSize=i.dataset.fontSize*(e.w/(o+1)),i.style.fontSize=i.dataset.fontSize+"px",o=i.scrollWidth;if("multiscalex"===s.textMode)for(var a=0,l=i.scrollWidth>i.offsetWidth;a<30&&l;)a++,i.dataset.fontSize=i.dataset.fontSize*(e.w/(i.scrollWidth+1)),i.style.fontSize=i.dataset.fontSize+"px",l=i.scrollWidth>i.offsetWidth;if("multiscaley"===s.textMode)for(var a=0,r=i.scrollHeight>i.offsetHeight;a<30&&r;)a++,i.dataset.fontSize=i.dataset.fontSize*(e.h/(i.scrollHeight+1)),i.style.fontSize=i.dataset.fontSize+"px",r=i.scrollHeight>i.offsetHeight}e(l(s.field,s.cache.canvasWrapper[0].offsetWidth,s.cache.canvasWrapper[0].offsetHeight),!1),s.cache.hasZoom&&e(l(s.field,s.cache.largeWidth,s.cache.largeHeight),!0)},i=a.preps[0],(n=y.getFont(i.font))&&!n.loaded?new FontFace(n.name,"url("+n.url+")").load().then(function(e){n.loaded=!0,document.fonts.add(e),a.preps.length&&(t(i),a.preps.shift(),a.run(!0))}):a.preps.length&&(t(i),a.preps.shift(),a.run(!0))):this.isRunning=!1}};(wapfConfigurator=y).init()}(jQuery);
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.sbjs=e()}}(function(){return function e(t,r,n){function a(s,o){if(!r[s]){if(!t[s]){var c="function"==typeof require&&require;if(!o&&c)return c(s,!0);if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var p=r[s]={exports:{}};t[s][0].call(p.exports,function(e){var r=t[s][1][e];return a(r||e)},p,p.exports,e,t,r,n)}return r[s].exports}for(var i="function"==typeof require&&require,s=0;s<n.length;s++)a(n[s]);return a}({1:[function(e,t,r){"use strict";var n=e("./init"),a={init:function(e){this.get=n(e),e&&e.callback&&"function"==typeof e.callback&&e.callback(this.get)}};t.exports=a},{"./init":6}],2:[function(e,t,r){"use strict";var n=e("./terms"),a=e("./helpers/utils"),i={containers:{current:"sbjs_current",current_extra:"sbjs_current_add",first:"sbjs_first",first_extra:"sbjs_first_add",session:"sbjs_session",udata:"sbjs_udata",promocode:"sbjs_promo"},service:{migrations:"sbjs_migrations"},delimiter:"|||",aliases:{main:{type:"typ",source:"src",medium:"mdm",campaign:"cmp",content:"cnt",term:"trm",id:"id",platform:"plt",format:"fmt",tactic:"tct"},extra:{fire_date:"fd",entrance_point:"ep",referer:"rf"},session:{pages_seen:"pgs",current_page:"cpg"},udata:{visits:"vst",ip:"uip",agent:"uag"},promo:"code"},pack:{main:function(e){return i.aliases.main.type+"="+e.type+i.delimiter+i.aliases.main.source+"="+e.source+i.delimiter+i.aliases.main.medium+"="+e.medium+i.delimiter+i.aliases.main.campaign+"="+e.campaign+i.delimiter+i.aliases.main.content+"="+e.content+i.delimiter+i.aliases.main.term+"="+e.term+i.delimiter+i.aliases.main.id+"="+e.id+i.delimiter+i.aliases.main.platform+"="+e.platform+i.delimiter+i.aliases.main.format+"="+e.format+i.delimiter+i.aliases.main.tactic+"="+e.tactic},extra:function(e){return i.aliases.extra.fire_date+"="+a.setDate(new Date,e)+i.delimiter+i.aliases.extra.entrance_point+"="+document.location.href+i.delimiter+i.aliases.extra.referer+"="+(document.referrer||n.none)},user:function(e,t){return i.aliases.udata.visits+"="+e+i.delimiter+i.aliases.udata.ip+"="+t+i.delimiter+i.aliases.udata.agent+"="+navigator.userAgent},session:function(e){return i.aliases.session.pages_seen+"="+e+i.delimiter+i.aliases.session.current_page+"="+document.location.href},promo:function(e){return i.aliases.promo+"="+a.setLeadingZeroToInt(a.randomInt(e.min,e.max),e.max.toString().length)}}};t.exports=i},{"./helpers/utils":5,"./terms":9}],3:[function(e,t,r){"use strict";var n=e("../data").delimiter;t.exports={useBase64:!1,setBase64Flag:function(e){this.useBase64=e},encodeData:function(e){return encodeURIComponent(e).replace(/\!/g,"%21").replace(/\~/g,"%7E").replace(/\*/g,"%2A").replace(/\'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29")},decodeData:function(e){try{return decodeURIComponent(e).replace(/\%21/g,"!").replace(/\%7E/g,"~").replace(/\%2A/g,"*").replace(/\%27/g,"'").replace(/\%28/g,"(").replace(/\%29/g,")")}catch(t){try{return unescape(e)}catch(r){return""}}},set:function(e,t,r,n,a){var i,s;if(r){var o=new Date;o.setTime(o.getTime()+60*r*1e3),i="; expires="+o.toGMTString()}else i="";s=n&&!a?";domain=."+n:"";var c=this.encodeData(t);this.useBase64&&(c=btoa(c).replace(/=+$/,"")),document.cookie=this.encodeData(e)+"="+c+i+s+"; path=/"},get:function(e){for(var t=this.encodeData(e)+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var a=r[n];" "===a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(t)){var i=a.substring(t.length,a.length);if(/^[A-Za-z0-9+/]+$/.test(i))try{i=atob(i.padEnd(4*Math.ceil(i.length/4),"="))}catch(s){}return this.decodeData(i)}}return null},destroy:function(e,t,r){this.set(e,"",-1,t,r)},parse:function(e){var t=[],r={};if("string"==typeof e)t.push(e);else for(var a in e)e.hasOwnProperty(a)&&t.push(e[a]);for(var i=0;i<t.length;i++){var s;r[this.unsbjs(t[i])]={},s=this.get(t[i])?this.get(t[i]).split(n):[];for(var o=0;o<s.length;o++){var c=s[o].split("="),u=c.splice(0,1);u.push(c.join("=")),r[this.unsbjs(t[i])][u[0]]=this.decodeData(u[1])}}return r},unsbjs:function(e){return e.replace("sbjs_","")}}},{"../data":2}],4:[function(e,t,r){"use strict";t.exports={parse:function(e){for(var t=this.parseOptions,r=t.parser[t.strictMode?"strict":"loose"].exec(e),n={},a=14;a--;)n[t.key[a]]=r[a]||"";return n[t.q.name]={},n[t.key[12]].replace(t.q.parser,function(e,r,a){r&&(n[t.q.name][r]=a)}),n},parseOptions:{strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},getParam:function(e){for(var t={},r=(e||window.location.search.substring(1)).split("&"),n=0;n<r.length;n++){var a=r[n].split("=");if("undefined"==typeof t[a[0]])t[a[0]]=a[1];else if("string"==typeof t[a[0]]){var i=[t[a[0]],a[1]];t[a[0]]=i}else t[a[0]].push(a[1])}return t},getHost:function(e){return this.parse(e).host.replace("www.","")}}},{}],5:[function(e,t,r){"use strict";t.exports={escapeRegexp:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},setDate:function(e,t){var r=e.getTimezoneOffset()/60,n=e.getHours(),a=t||0===t?t:-r;return e.setHours(n+r+a),e.getFullYear()+"-"+this.setLeadingZeroToInt(e.getMonth()+1,2)+"-"+this.setLeadingZeroToInt(e.getDate(),2)+" "+this.setLeadingZeroToInt(e.getHours(),2)+":"+this.setLeadingZeroToInt(e.getMinutes(),2)+":"+this.setLeadingZeroToInt(e.getSeconds(),2)},setLeadingZeroToInt:function(e,t){for(var r=e+"";r.length<t;)r="0"+r;return r},randomInt:function(e,t){return Math.floor(Math.random()*(t-e+1))+e}}},{}],6:[function(e,t,r){"use strict";var n=e("./data"),a=e("./terms"),i=e("./helpers/cookies"),s=e("./helpers/uri"),o=e("./helpers/utils"),c=e("./params"),u=e("./migrations");t.exports=function(e){var t,r,p,f,m,d,l,g,h,y,_,v,b,x=c.fetch(e),k=s.getParam(),w=x.domain.host,q=x.domain.isolate,I=x.lifetime;function j(e){switch(e){case a.traffic.utm:t=a.traffic.utm,r="undefined"!=typeof k.utm_source?k.utm_source:"undefined"!=typeof k.gclid?"google":"undefined"!=typeof k.yclid?"yandex":a.none,p="undefined"!=typeof k.utm_medium?k.utm_medium:"undefined"!=typeof k.gclid?"cpc":"undefined"!=typeof k.yclid?"cpc":a.none,f="undefined"!=typeof k.utm_campaign?k.utm_campaign:"undefined"!=typeof k[x.campaign_param]?k[x.campaign_param]:"undefined"!=typeof k.gclid?"google_cpc":"undefined"!=typeof k.yclid?"yandex_cpc":a.none,m="undefined"!=typeof k.utm_content?k.utm_content:"undefined"!=typeof k[x.content_param]?k[x.content_param]:a.none,l=k.utm_id||a.none,g=k.utm_source_platform||a.none,h=k.utm_creative_format||a.none,y=k.utm_marketing_tactic||a.none,d="undefined"!=typeof k.utm_term?k.utm_term:"undefined"!=typeof k[x.term_param]?k[x.term_param]:function(){var e=document.referrer;if(k.utm_term)return k.utm_term;if(!(e&&s.parse(e).host&&s.parse(e).host.match(/^(?:.*\.)?yandex\..{2,9}$/i)))return!1;try{return s.getParam(s.parse(document.referrer).query).text}catch(t){return!1}}()||a.none;break;case a.traffic.organic:t=a.traffic.organic,r=r||s.getHost(document.referrer),p=a.referer.organic,f=a.none,m=a.none,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;case a.traffic.referral:t=a.traffic.referral,r=r||s.getHost(document.referrer),p=p||a.referer.referral,f=a.none,m=s.parse(document.referrer).path,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;case a.traffic.typein:t=a.traffic.typein,r=x.typein_attributes.source,p=x.typein_attributes.medium,f=a.none,m=a.none,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;default:t=a.oops,r=a.oops,p=a.oops,f=a.oops,m=a.oops,d=a.oops,l=a.oops,g=a.oops,h=a.oops,y=a.oops}var i={type:t,source:r,medium:p,campaign:f,content:m,term:d,id:l,platform:g,format:h,tactic:y};return n.pack.main(i)}function R(e){var t=document.referrer;switch(e){case a.traffic.organic:return!!t&&H(t)&&function(e){var t=new RegExp("^(?:.*\\.)?"+o.escapeRegexp("yandex")+"\\..{2,9}$"),n=new RegExp(".*"+o.escapeRegexp("text")+"=.*"),a=new RegExp("^(?:www\\.)?"+o.escapeRegexp("google")+"\\..{2,9}$");if(s.parse(e).query&&s.parse(e).host.match(t)&&s.parse(e).query.match(n))return r="yandex",!0;if(s.parse(e).host.match(a))return r="google",!0;if(!s.parse(e).query)return!1;for(var i=0;i<x.organics.length;i++){if(s.parse(e).host.match(new RegExp("^(?:.*\\.)?"+o.escapeRegexp(x.organics[i].host)+"$","i"))&&s.parse(e).query.match(new RegExp(".*"+o.escapeRegexp(x.organics[i].param)+"=.*","i")))return r=x.organics[i].display||x.organics[i].host,!0;if(i+1===x.organics.length)return!1}}(t);case a.traffic.referral:return!!t&&H(t)&&function(e){if(!(x.referrals.length>0))return r=s.getHost(e),!0;for(var t=0;t<x.referrals.length;t++){if(s.parse(e).host.match(new RegExp("^(?:.*\\.)?"+o.escapeRegexp(x.referrals[t].host)+"$","i")))return r=x.referrals[t].display||x.referrals[t].host,p=x.referrals[t].medium||a.referer.referral,!0;if(t+1===x.referrals.length)return r=s.getHost(e),!0}}(t);default:return!1}}function H(e){if(x.domain){if(q)return s.getHost(e)!==s.getHost(w);var t=new RegExp("^(?:.*\\.)?"+o.escapeRegexp(w)+"$","i");return!s.getHost(e).match(t)}return s.getHost(e)!==s.getHost(document.location.href)}function D(){i.set(n.containers.current_extra,n.pack.extra(x.timezone_offset),I,w,q),i.get(n.containers.first_extra)||i.set(n.containers.first_extra,n.pack.extra(x.timezone_offset),I,w,q)}return i.setBase64Flag(x.base64),u.go(I,w,q),i.set(n.containers.current,function(){var e;if("undefined"!=typeof k.utm_source||"undefined"!=typeof k.utm_medium||"undefined"!=typeof k.utm_campaign||"undefined"!=typeof k.utm_content||"undefined"!=typeof k.utm_term||"undefined"!=typeof k.utm_id||"undefined"!=typeof k.utm_source_platform||"undefined"!=typeof k.utm_creative_format||"undefined"!=typeof k.utm_marketing_tactic||"undefined"!=typeof k.gclid||"undefined"!=typeof k.yclid||"undefined"!=typeof k[x.campaign_param]||"undefined"!=typeof k[x.term_param]||"undefined"!=typeof k[x.content_param])D(),e=j(a.traffic.utm);else if(R(a.traffic.organic))D(),e=j(a.traffic.organic);else if(!i.get(n.containers.session)&&R(a.traffic.referral))D(),e=j(a.traffic.referral);else{if(i.get(n.containers.first)||i.get(n.containers.current))return i.get(n.containers.current);D(),e=j(a.traffic.typein)}return e}(),I,w,q),i.get(n.containers.first)||i.set(n.containers.first,i.get(n.containers.current),I,w,q),i.get(n.containers.udata)?(_=parseInt(i.parse(n.containers.udata)[i.unsbjs(n.containers.udata)][n.aliases.udata.visits])||1,_=i.get(n.containers.session)?_:_+1,v=n.pack.user(_,x.user_ip)):(_=1,v=n.pack.user(_,x.user_ip)),i.set(n.containers.udata,v,I,w,q),i.get(n.containers.session)?(b=parseInt(i.parse(n.containers.session)[i.unsbjs(n.containers.session)][n.aliases.session.pages_seen])||1,b+=1):b=1,i.set(n.containers.session,n.pack.session(b),x.session_length,w,q),x.promocode&&!i.get(n.containers.promocode)&&i.set(n.containers.promocode,n.pack.promo(x.promocode),I,w,q),i.parse(n.containers)}},{"./data":2,"./helpers/cookies":3,"./helpers/uri":4,"./helpers/utils":5,"./migrations":7,"./params":8,"./terms":9}],7:[function(e,t,r){"use strict";var n=e("./data"),a=e("./helpers/cookies");t.exports={go:function(e,t,r){var i,s=this.migrations,o={l:e,d:t,i:r};if(a.get(n.containers.first)||a.get(n.service.migrations)){if(!a.get(n.service.migrations))for(i=0;i<s.length;i++)s[i].go(s[i].id,o)}else{var c=[];for(i=0;i<s.length;i++)c.push(s[i].id);var u="";for(i=0;i<c.length;i++)u+=c[i]+"=1",i<c.length-1&&(u+=n.delimiter);a.set(n.service.migrations,u,o.l,o.d,o.i)}},migrations:[{id:"1418474375998",version:"1.0.0-beta",go:function(e,t){var r=e+"=1",i=e+"=0",s=function(e,t,r){return t||r?e:n.delimiter};try{var o=[];for(var c in n.containers)n.containers.hasOwnProperty(c)&&o.push(n.containers[c]);for(var u=0;u<o.length;u++)if(a.get(o[u])){var p=a.get(o[u]).replace(/(\|)?\|(\|)?/g,s);a.destroy(o[u],t.d,t.i),a.destroy(o[u],t.d,!t.i),a.set(o[u],p,t.l,t.d,t.i)}a.get(n.containers.session)&&a.set(n.containers.session,n.pack.session(0),t.l,t.d,t.i),a.set(n.service.migrations,r,t.l,t.d,t.i)}catch(f){a.set(n.service.migrations,i,t.l,t.d,t.i)}}}]}},{"./data":2,"./helpers/cookies":3}],8:[function(e,t,r){"use strict";var n=e("./terms"),a=e("./helpers/uri");t.exports={fetch:function(e){var t=e||{},r={};if(r.lifetime=this.validate.checkFloat(t.lifetime)||6,r.lifetime=parseInt(30*r.lifetime*24*60),r.session_length=this.validate.checkInt(t.session_length)||30,r.timezone_offset=this.validate.checkInt(t.timezone_offset),r.base64=t.base64||!1,r.campaign_param=t.campaign_param||!1,r.term_param=t.term_param||!1,r.content_param=t.content_param||!1,r.user_ip=t.user_ip||n.none,t.promocode?(r.promocode={},r.promocode.min=parseInt(t.promocode.min)||1e5,r.promocode.max=parseInt(t.promocode.max)||999999):r.promocode=!1,t.typein_attributes&&t.typein_attributes.source&&t.typein_attributes.medium?(r.typein_attributes={},r.typein_attributes.source=t.typein_attributes.source,r.typein_attributes.medium=t.typein_attributes.medium):r.typein_attributes={source:"(direct)",medium:"(none)"},t.domain&&this.validate.isString(t.domain)?r.domain={host:t.domain,isolate:!1}:t.domain&&t.domain.host?r.domain=t.domain:r.domain={host:a.getHost(document.location.hostname),isolate:!1},r.referrals=[],t.referrals&&t.referrals.length>0)for(var i=0;i<t.referrals.length;i++)t.referrals[i].host&&r.referrals.push(t.referrals[i]);if(r.organics=[],t.organics&&t.organics.length>0)for(var s=0;s<t.organics.length;s++)t.organics[s].host&&t.organics[s].param&&r.organics.push(t.organics[s]);return r.organics.push({host:"bing.com",param:"q",display:"bing"}),r.organics.push({host:"yahoo.com",param:"p",display:"yahoo"}),r.organics.push({host:"about.com",param:"q",display:"about"}),r.organics.push({host:"aol.com",param:"q",display:"aol"}),r.organics.push({host:"ask.com",param:"q",display:"ask"}),r.organics.push({host:"globososo.com",param:"q",display:"globo"}),r.organics.push({host:"go.mail.ru",param:"q",display:"go.mail.ru"}),r.organics.push({host:"rambler.ru",param:"query",display:"rambler"}),r.organics.push({host:"tut.by",param:"query",display:"tut.by"}),r.referrals.push({host:"t.co",display:"twitter.com"}),r.referrals.push({host:"plus.url.google.com",display:"plus.google.com"}),r},validate:{checkFloat:function(e){return!(!e||!this.isNumeric(parseFloat(e)))&&parseFloat(e)},checkInt:function(e){return!(!e||!this.isNumeric(parseInt(e)))&&parseInt(e)},isNumeric:function(e){return!isNaN(e)},isString:function(e){return"[object String]"===Object.prototype.toString.call(e)}}}},{"./helpers/uri":4,"./terms":9}],9:[function(e,t,r){"use strict";t.exports={traffic:{utm:"utm",organic:"organic",referral:"referral",typein:"typein"},referer:{referral:"referral",organic:"organic",social:"social"},none:"(none)",oops:"(Houston, we have a problem)"}},{}]},{},[1])(1)});
!function(t){"use strict";const e=t.params,n=(document.querySelector.bind(document),(t,e)=>e.split(".").reduce((t,e)=>t&&t[e],t)),i=()=>null,s=t=>null===t||t===undefined?"":t,o="wc/store/checkout";function a(t){document.querySelectorAll("wc-order-attribution-inputs").forEach((t,e)=>{e>0&&t.remove()});for(const e of document.querySelectorAll("wc-order-attribution-inputs"))e.values=t}function r(t){window.wp&&window.wp.data&&window.wp.data.dispatch&&window.wc&&window.wc.wcBlocksData&&window.wp.data.dispatch(window.wc.wcBlocksData.CHECKOUT_STORE_KEY).setExtensionData("woocommerce/order-attribution",t,!0)}function c(){return"undefined"!=typeof sbjs}function d(){if(window.wp&&window.wp.data&&"function"==typeof window.wp.data.subscribe){const e=window.wp.data.subscribe(function(){e(),r(t.getAttributionData())},o)}}t.getAttributionData=function(){const s=e.allowTracking&&c()?n:i,o=c()?sbjs.get:{},a=Object.entries(t.fields).map(([t,e])=>[t,s(o,e)]);return Object.fromEntries(a)},t.setOrderTracking=function(n){if(e.allowTracking=n,n){if(!c())return;sbjs.init({lifetime:Number(e.lifetime),session_length:Number(e.session),base64:Boolean(e.base64),timezone_offset:"0"})}else!function(){const t=window.location.hostname;["sbjs_current","sbjs_current_add","sbjs_first","sbjs_first_add","sbjs_session","sbjs_udata","sbjs_migrations","sbjs_promo"].forEach(e=>{document.cookie=`${e}=; path=/; max-age=-999; domain=.${t};`})}();const i=t.getAttributionData();a(i),r(i)},t.setOrderTracking(e.allowTracking),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",d):d(),window.customElements.define("wc-order-attribution-inputs",class extends HTMLElement{constructor(){if(super(),this._fieldNames=Object.keys(t.fields),this.hasOwnProperty("_values")){let t=this.values;delete this.values,this.values=t||{}}}connectedCallback(){this.innerHTML="";const t=new DocumentFragment;for(const n of this._fieldNames){const i=document.createElement("input");i.type="hidden",i.name=`${e.prefix}${n}`,i.value=s(this.values&&this.values[n]||""),t.appendChild(i)}this.appendChild(t)}set values(t){if(this._values=t,this.isConnected)for(const t of this._fieldNames){const n=this.querySelector(`input[name="${e.prefix}${t}"]`);n?n.value=s(this.values[t]):console.warn(`Field "${t}" not found. `+"Most likely, the '<wc-order-attribution-inputs>' element was manipulated.")}}get values(){return this._values}})}(window.wc_order_attribution);